stream-chat-react-native-core 4.12.0-beta.1 → 4.12.0-beta.4
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/Gallery.js +22 -18
- package/lib/commonjs/components/Attachment/Gallery.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/Message/MessageSimple/utils/parseLinks.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.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/Gallery.js +22 -18
- package/lib/module/components/Attachment/Gallery.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/Message/MessageSimple/utils/parseLinks.js +1 -1
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js +1 -1
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.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/Gallery.tsx +7 -1
- 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/Message/MessageSimple/utils/parseLinks.test.ts +4 -0
- package/src/components/Message/MessageSimple/utils/parseLinks.ts +1 -1
- 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
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.AudioAttachment = void 0;
|
|
9
9
|
|
|
10
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
11
|
|
|
@@ -30,7 +30,7 @@ var _native = require("../../native");
|
|
|
30
30
|
var _ProgressControl = require("../ProgressControl/ProgressControl");
|
|
31
31
|
|
|
32
32
|
var _this = this,
|
|
33
|
-
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/
|
|
33
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/AudioAttachment.tsx";
|
|
34
34
|
|
|
35
35
|
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); }
|
|
36
36
|
|
|
@@ -50,7 +50,8 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
50
50
|
paddingRight: 8
|
|
51
51
|
},
|
|
52
52
|
fileContentContainer: {
|
|
53
|
-
flexDirection: 'row'
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
paddingRight: 40
|
|
54
55
|
},
|
|
55
56
|
filenameText: {
|
|
56
57
|
fontSize: 14,
|
|
@@ -96,7 +97,7 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
96
97
|
}
|
|
97
98
|
});
|
|
98
99
|
|
|
99
|
-
var
|
|
100
|
+
var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
|
|
100
101
|
var soundRef = _react["default"].useRef(null);
|
|
101
102
|
|
|
102
103
|
var fileUploads = props.fileUploads,
|
|
@@ -357,8 +358,9 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
357
358
|
grey_whisper = _useTheme$theme$color.grey_whisper,
|
|
358
359
|
static_black = _useTheme$theme$color.static_black,
|
|
359
360
|
static_white = _useTheme$theme$color.static_white,
|
|
361
|
+
white = _useTheme$theme$color.white,
|
|
360
362
|
_useTheme$theme$messa = _useTheme$theme.messageInput.fileUploadPreview,
|
|
361
|
-
_useTheme$theme$messa2 = _useTheme$theme$messa.
|
|
363
|
+
_useTheme$theme$messa2 = _useTheme$theme$messa.audioAttachment,
|
|
362
364
|
progressControlView = _useTheme$theme$messa2.progressControlView,
|
|
363
365
|
progressDurationText = _useTheme$theme$messa2.progressDurationText,
|
|
364
366
|
roundedView = _useTheme$theme$messa2.roundedView,
|
|
@@ -374,6 +376,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
374
376
|
style: [styles.fileContainer, index === fileUploads.length - 1 ? {
|
|
375
377
|
marginBottom: 0
|
|
376
378
|
} : {}, {
|
|
379
|
+
backgroundColor: white,
|
|
377
380
|
borderColor: grey_whisper,
|
|
378
381
|
width: -16
|
|
379
382
|
}, fileContainer],
|
|
@@ -389,7 +392,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
389
392
|
__self: _this,
|
|
390
393
|
__source: {
|
|
391
394
|
fileName: _jsxFileName,
|
|
392
|
-
lineNumber:
|
|
395
|
+
lineNumber: 256,
|
|
393
396
|
columnNumber: 7
|
|
394
397
|
}
|
|
395
398
|
}, _react["default"].createElement(_reactNative.TouchableOpacity, {
|
|
@@ -404,7 +407,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
404
407
|
__self: _this,
|
|
405
408
|
__source: {
|
|
406
409
|
fileName: _jsxFileName,
|
|
407
|
-
lineNumber:
|
|
410
|
+
lineNumber: 257,
|
|
408
411
|
columnNumber: 9
|
|
409
412
|
}
|
|
410
413
|
}, item.paused ? _react["default"].createElement(_icons.Play, {
|
|
@@ -414,7 +417,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
414
417
|
__self: _this,
|
|
415
418
|
__source: {
|
|
416
419
|
fileName: _jsxFileName,
|
|
417
|
-
lineNumber:
|
|
420
|
+
lineNumber: 267,
|
|
418
421
|
columnNumber: 13
|
|
419
422
|
}
|
|
420
423
|
}) : _react["default"].createElement(_icons.Pause, {
|
|
@@ -424,7 +427,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
424
427
|
__self: _this,
|
|
425
428
|
__source: {
|
|
426
429
|
fileName: _jsxFileName,
|
|
427
|
-
lineNumber:
|
|
430
|
+
lineNumber: 269,
|
|
428
431
|
columnNumber: 13
|
|
429
432
|
}
|
|
430
433
|
})), _react["default"].createElement(_reactNative.View, {
|
|
@@ -432,7 +435,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
432
435
|
__self: _this,
|
|
433
436
|
__source: {
|
|
434
437
|
fileName: _jsxFileName,
|
|
435
|
-
lineNumber:
|
|
438
|
+
lineNumber: 272,
|
|
436
439
|
columnNumber: 9
|
|
437
440
|
}
|
|
438
441
|
}, _react["default"].createElement(_reactNative.Text, {
|
|
@@ -449,7 +452,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
449
452
|
__self: _this,
|
|
450
453
|
__source: {
|
|
451
454
|
fileName: _jsxFileName,
|
|
452
|
-
lineNumber:
|
|
455
|
+
lineNumber: 273,
|
|
453
456
|
columnNumber: 11
|
|
454
457
|
}
|
|
455
458
|
}, item.file.name.slice(0, 12) + '...' + item.file.name.slice(lastIndexOfDot)), _react["default"].createElement(_reactNative.View, {
|
|
@@ -461,7 +464,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
461
464
|
__self: _this,
|
|
462
465
|
__source: {
|
|
463
466
|
fileName: _jsxFileName,
|
|
464
|
-
lineNumber:
|
|
467
|
+
lineNumber: 292,
|
|
465
468
|
columnNumber: 11
|
|
466
469
|
}
|
|
467
470
|
}, _native.Sound.Player && _react["default"].createElement(_native.Sound.Player, {
|
|
@@ -475,7 +478,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
475
478
|
__self: _this,
|
|
476
479
|
__source: {
|
|
477
480
|
fileName: _jsxFileName,
|
|
478
|
-
lineNumber:
|
|
481
|
+
lineNumber: 301,
|
|
479
482
|
columnNumber: 15
|
|
480
483
|
}
|
|
481
484
|
}), _react["default"].createElement(_reactNative.Text, {
|
|
@@ -485,7 +488,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
485
488
|
__self: _this,
|
|
486
489
|
__source: {
|
|
487
490
|
fileName: _jsxFileName,
|
|
488
|
-
lineNumber:
|
|
491
|
+
lineNumber: 311,
|
|
489
492
|
columnNumber: 13
|
|
490
493
|
}
|
|
491
494
|
}, progressDuration), _react["default"].createElement(_reactNative.View, {
|
|
@@ -493,7 +496,7 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
493
496
|
__self: _this,
|
|
494
497
|
__source: {
|
|
495
498
|
fileName: _jsxFileName,
|
|
496
|
-
lineNumber:
|
|
499
|
+
lineNumber: 314,
|
|
497
500
|
columnNumber: 13
|
|
498
501
|
}
|
|
499
502
|
}, _react["default"].createElement(_ProgressControl.ProgressControl, {
|
|
@@ -503,23 +506,23 @@ var AudioAttachmentUploadPreviewWithContext = function AudioAttachmentUploadPrev
|
|
|
503
506
|
onProgressDrag: handleProgressDrag,
|
|
504
507
|
progress: item.progress,
|
|
505
508
|
testID: "progress-control",
|
|
506
|
-
width:
|
|
509
|
+
width: 120,
|
|
507
510
|
__self: _this,
|
|
508
511
|
__source: {
|
|
509
512
|
fileName: _jsxFileName,
|
|
510
|
-
lineNumber:
|
|
513
|
+
lineNumber: 315,
|
|
511
514
|
columnNumber: 15
|
|
512
515
|
}
|
|
513
516
|
}))))));
|
|
514
517
|
};
|
|
515
518
|
|
|
516
|
-
var
|
|
519
|
+
var AudioAttachment = function AudioAttachment(props) {
|
|
517
520
|
var _useMessageInputConte = (0, _contexts.useMessageInputContext)(),
|
|
518
521
|
fileUploads = _useMessageInputConte.fileUploads,
|
|
519
522
|
removeFile = _useMessageInputConte.removeFile,
|
|
520
523
|
uploadFile = _useMessageInputConte.uploadFile;
|
|
521
524
|
|
|
522
|
-
return _react["default"].createElement(
|
|
525
|
+
return _react["default"].createElement(AudioAttachmentWithContext, (0, _extends2["default"])({
|
|
523
526
|
fileUploads: fileUploads,
|
|
524
527
|
removeFile: removeFile,
|
|
525
528
|
uploadFile: uploadFile
|
|
@@ -528,11 +531,11 @@ var AudioAttachmentUploadPreview = function AudioAttachmentUploadPreview(props)
|
|
|
528
531
|
__source: {
|
|
529
532
|
fileName: _jsxFileName,
|
|
530
533
|
lineNumber: 354,
|
|
531
|
-
columnNumber:
|
|
534
|
+
columnNumber: 10
|
|
532
535
|
}
|
|
533
536
|
}));
|
|
534
537
|
};
|
|
535
538
|
|
|
536
|
-
exports.
|
|
537
|
-
|
|
538
|
-
//# sourceMappingURL=
|
|
539
|
+
exports.AudioAttachment = AudioAttachment;
|
|
540
|
+
AudioAttachment.displayName = 'AudioAttachment{messageInput{autoAttachment}}';
|
|
541
|
+
//# sourceMappingURL=AudioAttachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AudioAttachment.tsx"],"names":["dayjs","extend","duration","FILE_PREVIEW_HEIGHT","styles","StyleSheet","create","fileContainer","borderRadius","borderWidth","flexDirection","height","paddingLeft","paddingRight","fileContentContainer","filenameText","fontSize","fontWeight","fileTextContainer","justifyContent","flatList","marginBottom","maxHeight","overlay","marginLeft","marginRight","progressControlView","flex","progressDurationText","roundedView","alignItems","alignSelf","display","elevation","shadowOffset","width","shadowOpacity","shadowRadius","AudioAttachmentWithContext","props","soundRef","React","useRef","fileUploads","index","item","onLoad","onPlayPause","onProgress","handleLoad","payload","id","handleProgress","data","currentTime","seekableDuration","handlePlayPause","isPausedStatusAvailable","current","undefined","progress","seek","setPositionAsync","paused","playAsync","pauseAsync","handleProgressDrag","position","handleEnd","onPlaybackStatusUpdate","playbackStatus","isLoaded","error","console","log","durationMillis","positionMillis","isPlaying","isBuffering","didJustFinish","isLooping","Sound","Player","initiateSound","file","uri","initializeSound","stopAsync","unloadAsync","initalPlayPause","theme","colors","accent_blue","black","grey_dark","grey_whisper","static_black","static_white","white","messageInput","fileUploadPreview","audioAttachment","progressValueInSeconds","progressDuration","format","lastIndexOfDot","name","lastIndexOf","length","backgroundColor","borderColor","shadowColor","color","I18nManager","isRTL","writingDirection","slice","AudioAttachment","removeFile","uploadFile","displayName"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AAMA;;AACA;;AAQA;;;;;;;;;AAEAA,kBAAMC,MAAN,CAAaC,oBAAb;;AAEA,IAAMC,mBAAmB,GAAG,EAA5B;;AAEA,IAAMC,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,aAAa,EAAE;AACbC,IAAAA,YAAY,EAAE,EADD;AAEbC,IAAAA,WAAW,EAAE,CAFA;AAGbC,IAAAA,aAAa,EAAE,KAHF;AAIbC,IAAAA,MAAM,EAAER,mBAJK;AAKbS,IAAAA,WAAW,EAAE,CALA;AAMbC,IAAAA,YAAY,EAAE;AAND,GADgB;AAS/BC,EAAAA,oBAAoB,EAAE;AAAEJ,IAAAA,aAAa,EAAE,KAAjB;AAAwBG,IAAAA,YAAY,EA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lE,oBAApD,CAAb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACG2E,gBADH,CAnBF,EAsBE,gCAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACnG,MAAM,CAACsB,mBAAR,EAA6BA,mBAA7B,CAAb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACE,gCAAC,gCAAD;AACE,IAAA,QAAQ,EAAEmB,IAAI,CAAC3C,QADjB;AAEE,IAAA,WAAW,EAAE0F,WAFf;AAGE,IAAA,WAAW,EAAEpC,eAHf;AAIE,IAAA,cAAc,EAAEU,kBAJlB;AAKE,IAAA,QAAQ,EAAErB,IAAI,CAACe,QALjB;AAME,IAAA,MAAM,EAAC,kBANT;AAOE,IAAA,KAAK,EAAE,GAPT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IADF,CAtBF,CApBF,CAhBF,CAjBF,CADF;AA4FD,CA7OD;;AA8PO,IAAMyD,eAAe,GAAG,SAAlBA,eAAkB,CAG7B9E,KAH6B,EAI1B;AACH,8BAAgD,uCAAhD;AAAA,MAAQI,WAAR,yBAAQA,WAAR;AAAA,MAAqB2E,UAArB,yBAAqBA,UAArB;AAAA,MAAiCC,UAAjC,yBAAiCA,UAAjC;;AAEA,SAAO,gCAAC,0BAAD;AAAkC5E,IAAAA,WAAW,EAAXA,WAAlC;AAA+C2E,IAAAA,UAAU,EAAVA,UAA/C;AAA2DC,IAAAA,UAAU,EAAVA;AAA3D,KAA6EhF,KAA7E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAAP;AACD,CARM;;;AAUP8E,eAAe,CAACG,WAAhB,GAA8B,+CAA9B","sourcesContent":["import React, { useEffect } from 'react';\nimport { I18nManager, StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport dayjs from 'dayjs';\nimport duration from 'dayjs/plugin/duration';\n\nimport {\n FileUpload,\n MessageInputContextValue,\n useMessageInputContext,\n useTheme,\n} from '../../contexts';\nimport { Pause, Play } from '../../icons';\nimport {\n PlaybackStatus,\n Sound,\n SoundReturnType,\n VideoPayloadData,\n VideoProgressData,\n} from '../../native';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { ProgressControl } from '../ProgressControl/ProgressControl';\n\ndayjs.extend(duration);\n\nconst FILE_PREVIEW_HEIGHT = 70;\n\nconst styles = StyleSheet.create({\n fileContainer: {\n borderRadius: 12,\n borderWidth: 1,\n flexDirection: 'row',\n height: FILE_PREVIEW_HEIGHT,\n paddingLeft: 8,\n paddingRight: 8,\n },\n fileContentContainer: { flexDirection: 'row', paddingRight: 40 },\n filenameText: {\n fontSize: 14,\n fontWeight: 'bold',\n paddingLeft: 10,\n },\n fileTextContainer: {\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 progressControlView: {\n flex: 8,\n },\n progressDurationText: {\n flex: 4,\n fontSize: 12,\n paddingLeft: 10,\n paddingRight: 8,\n },\n roundedView: {\n alignItems: 'center',\n alignSelf: 'center',\n borderRadius: 50,\n display: 'flex',\n elevation: 4,\n height: 36,\n justifyContent: 'center',\n shadowOffset: {\n height: 2,\n width: 0,\n },\n shadowOpacity: 0.23,\n shadowRadius: 2.62,\n width: 36,\n },\n});\n\nexport type AudioAttachmentPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n MessageInputContextValue<StreamChatGenerics>,\n 'fileUploads' | 'removeFile' | 'uploadFile'\n> & {\n index: number;\n item: Omit<FileUpload, 'state'>;\n onLoad: (index: string, duration: number) => void;\n onPlayPause: (index: string, pausedStatus?: boolean) => void;\n onProgress: (index: string, currentTime?: number, hasEnd?: boolean) => void;\n testID?: string;\n};\n\nconst AudioAttachmentWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: AudioAttachmentPropsWithContext<StreamChatGenerics>,\n) => {\n const soundRef = React.useRef<SoundReturnType | null>(null);\n const { fileUploads, index, item, onLoad, onPlayPause, onProgress } = props;\n\n const handleLoad = (payload: VideoPayloadData) => {\n onLoad(item.id, payload.duration);\n };\n\n const handleProgress = (data: VideoProgressData) => {\n if (data.currentTime && data.seekableDuration) {\n onProgress(item.id, data.currentTime);\n }\n };\n\n const handlePlayPause = async (isPausedStatusAvailable?: boolean) => {\n if (soundRef.current) {\n if (isPausedStatusAvailable === undefined) {\n if (item.progress === 1) {\n // For native CLI\n if (soundRef.current.seek) soundRef.current.seek(0);\n // For expo CLI\n if (soundRef.current.setPositionAsync) soundRef.current.setPositionAsync(0);\n }\n if (item.paused) {\n if (soundRef.current.playAsync) await soundRef.current.playAsync();\n onPlayPause(item.id, false);\n } else {\n if (soundRef.current.pauseAsync) await soundRef.current.pauseAsync();\n onPlayPause(item.id, true);\n }\n } else {\n onPlayPause(item.id, isPausedStatusAvailable);\n }\n }\n };\n\n const handleProgressDrag = async (position: number) => {\n onProgress(item.id, position);\n if (soundRef.current?.seek) soundRef.current.seek(position);\n if (soundRef.current?.setPositionAsync) {\n await soundRef.current.setPositionAsync(position * 1000);\n }\n };\n\n const handleEnd = () => {\n onPlayPause(item.id, true);\n onProgress(item.id, item.duration, true);\n };\n\n const onPlaybackStatusUpdate = (playbackStatus: PlaybackStatus) => {\n if (!playbackStatus.isLoaded) {\n // Update your UI for the unloaded state\n if (playbackStatus.error) {\n console.log(`Encountered a fatal error during playback: ${playbackStatus.error}`);\n }\n } else {\n const { durationMillis, positionMillis } = playbackStatus;\n onLoad(item.id, durationMillis / 1000);\n // Update your UI for the loaded state\n if (playbackStatus.isPlaying) {\n // Update your UI for the playing state\n onProgress(item.id, positionMillis / 1000);\n } else {\n // Update your UI for the paused state\n }\n\n if (playbackStatus.isBuffering) {\n // Update your UI for the buffering state\n }\n\n if (playbackStatus.didJustFinish && !playbackStatus.isLooping) {\n // The player has just finished playing and will stop. Maybe you want to play something else?\n // status: opposite of pause,says i am playing\n handleEnd();\n }\n }\n };\n\n useEffect(() => {\n if (Sound.Player === null) {\n const initiateSound = async () => {\n if (item && item.file && item.file.uri) {\n soundRef.current = await Sound.initializeSound(\n { uri: item.file.uri },\n {},\n onPlaybackStatusUpdate,\n );\n }\n };\n initiateSound();\n }\n\n return () => {\n if (soundRef.current?.stopAsync && soundRef.current.unloadAsync) {\n soundRef.current.stopAsync();\n soundRef.current.unloadAsync();\n }\n };\n }, []);\n\n // This is needed for expo applications where the rerender doesn't occur on time thefore you need to update the state of the sound.\n useEffect(() => {\n const initalPlayPause = async () => {\n if (soundRef.current) {\n if (item.paused) {\n if (soundRef.current.pauseAsync) await soundRef.current.pauseAsync();\n } else {\n if (soundRef.current.playAsync) await soundRef.current.playAsync();\n }\n }\n };\n if (!Sound.Player) {\n initalPlayPause();\n }\n }, [item.paused]);\n\n const {\n theme: {\n colors: { accent_blue, black, grey_dark, grey_whisper, static_black, static_white, white },\n messageInput: {\n fileUploadPreview: {\n audioAttachment: { progressControlView, progressDurationText, roundedView },\n fileContainer,\n fileContentContainer,\n filenameText,\n fileTextContainer,\n },\n },\n },\n } = useTheme();\n\n const progressValueInSeconds = (item.duration as number) * (item.progress as number);\n\n const progressDuration = progressValueInSeconds\n ? progressValueInSeconds / 3600 >= 1\n ? dayjs.duration(progressValueInSeconds, 'second').format('HH:mm:ss')\n : dayjs.duration(progressValueInSeconds, 'second').format('mm:ss')\n : '00:00';\n\n const lastIndexOfDot = item.file.name.lastIndexOf('.');\n\n return (\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 <View style={[styles.fileContentContainer, fileContentContainer]}>\n <TouchableOpacity\n accessibilityLabel='Play Pause Button'\n onPress={() => handlePlayPause()}\n style={[\n styles.roundedView,\n roundedView,\n { backgroundColor: static_white, shadowColor: black },\n ]}\n >\n {item.paused ? (\n <Play height={24} pathFill={static_black} width={24} />\n ) : (\n <Pause height={24} pathFill={static_black} width={24} />\n )}\n </TouchableOpacity>\n <View style={[styles.fileTextContainer, fileTextContainer]}>\n <Text\n accessibilityLabel='File Name'\n numberOfLines={1}\n style={[\n styles.filenameText,\n {\n color: black,\n width:\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 <View\n style={{\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'row',\n }}\n >\n {/* <ExpoSoundPlayer filePaused={!!item.paused} soundRef={soundRef} /> */}\n {Sound.Player && (\n <Sound.Player\n onEnd={handleEnd}\n onLoad={handleLoad}\n onProgress={handleProgress}\n paused={item.paused as boolean}\n soundRef={soundRef}\n testID='sound-player'\n uri={item.file.uri}\n />\n )}\n <Text style={[styles.progressDurationText, { color: grey_dark }, progressDurationText]}>\n {progressDuration}\n </Text>\n <View style={[styles.progressControlView, progressControlView]}>\n <ProgressControl\n duration={item.duration as number}\n filledColor={accent_blue}\n onPlayPause={handlePlayPause}\n onProgressDrag={handleProgressDrag}\n progress={item.progress as number}\n testID='progress-control'\n width={120}\n />\n </View>\n </View>\n </View>\n </View>\n </View>\n );\n};\n\nexport type AudioAttachmentProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<AudioAttachmentPropsWithContext<StreamChatGenerics>> & {\n index: number;\n item: Omit<FileUpload, 'state'>;\n onLoad: (index: string, duration: number) => void;\n onPlayPause: (index: string, pausedStatus?: boolean) => void;\n onProgress: (index: string, currentTime?: number, hasEnd?: boolean) => void;\n testID: string;\n};\n\n/**\n * AudioAttachment\n * UI Component to preview the audio files\n */\nexport const AudioAttachment = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: AudioAttachmentProps<StreamChatGenerics>,\n) => {\n const { fileUploads, removeFile, uploadFile } = useMessageInputContext<StreamChatGenerics>();\n\n return <AudioAttachmentWithContext {...{ fileUploads, removeFile, uploadFile }} {...props} />;\n};\n\nAudioAttachment.displayName = 'AudioAttachment{messageInput{autoAttachment}}';\n"]}
|
|
@@ -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,IAAAA,OAAO,EAAE;AADA;AADoB,CAAlB,CAAf;;AAoBA,IAAMC,8BAA8B,GAAG,SAAjCA,8BAAiC,CAGrCC,KAHqC,EAIlC;AACH,MAAQC,UAAR,GAAkED,KAAlE,CAAQC,UAAR;AAAA,MAAoBC,KAApB,GAAkEF,KAAlE,CAAoBE,KAApB;AAAA,MAA2BC,SAA3B,GAAkEH,KAAlE,CAA2BG,SAA3B;AAAA,sBAAkEH,KAAlE,CAAsCN,MAAtC;AAAA,MAA8CU,UAA9C,8BAA2D,EAA3D;;AAEA,kBAMI,6BANJ;AAAA,MAG6BP,SAH7B,aACEQ,KADF,CAEIC,aAFJ,CAGMC,mBAHN,CAG6BV,SAH7B;;AAQA,SACE,gCAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACH,MAAM,CAACG,SA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AEA,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,KAAnF,CAAuDN,MAAvD;AAAA,MAA+DW,UAA/D,8BAA4E,EAA5E;;AACA,kBAA4C,qBAA+B,EAA/B,CAA5C;AAAA;AAAA,MAAOC,cAAP;AAAA,MAAuBC,iBAAvB;;AAEA,wBAAU,YAAM;AACdA,IAAAA,iBAAiB,CAACJ,KAAK,CAACK,GAAN,CAAU,UAACC,IAAD;AAAA,2CAAgBA,IAAhB;AAAsBC,QAAAA,QAAQ,EAAE,CAAhC;AAAmCC,QAAAA,MAAM,EAAE,IAA3C;AAAiDC,QAAAA,QAAQ,EAAE;AAA3D;AAAA,KAAV,CAAD,CAAjB;AACD,GAFD,EAEG,CAACT,KAAD,CAFH;;AAKA,MAAMU,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD,EAAgBJ,QAAhB,EAAqC;AAClDH,IAAA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AIIC,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"]}
|
|
@@ -78,6 +78,12 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
78
78
|
left: 4,
|
|
79
79
|
position: 'absolute'
|
|
80
80
|
},
|
|
81
|
+
imageLoadingIndicatorContainer: {
|
|
82
|
+
height: '100%',
|
|
83
|
+
justifyContent: 'center',
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
width: '100%'
|
|
86
|
+
},
|
|
81
87
|
imageLoadingIndicatorStyle: {
|
|
82
88
|
alignItems: 'center',
|
|
83
89
|
justifyContent: 'center',
|
|
@@ -161,7 +167,7 @@ var GalleryWithContext = function GalleryWithContext(props) {
|
|
|
161
167
|
__self: _this,
|
|
162
168
|
__source: {
|
|
163
169
|
fileName: _jsxFileName,
|
|
164
|
-
lineNumber:
|
|
170
|
+
lineNumber: 192,
|
|
165
171
|
columnNumber: 5
|
|
166
172
|
}
|
|
167
173
|
}, thumbnailGrid.map(function (rows, colIndex) {
|
|
@@ -175,7 +181,7 @@ var GalleryWithContext = function GalleryWithContext(props) {
|
|
|
175
181
|
__self: _this,
|
|
176
182
|
__source: {
|
|
177
183
|
fileName: _jsxFileName,
|
|
178
|
-
lineNumber:
|
|
184
|
+
lineNumber: 209,
|
|
179
185
|
columnNumber: 11
|
|
180
186
|
}
|
|
181
187
|
}, rows.map(function (thumbnail, rowIndex) {
|
|
@@ -225,7 +231,7 @@ var GalleryWithContext = function GalleryWithContext(props) {
|
|
|
225
231
|
__self: _this,
|
|
226
232
|
__source: {
|
|
227
233
|
fileName: _jsxFileName,
|
|
228
|
-
lineNumber:
|
|
234
|
+
lineNumber: 241,
|
|
229
235
|
columnNumber: 17
|
|
230
236
|
}
|
|
231
237
|
});
|
|
@@ -329,7 +335,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
329
335
|
__self: _this,
|
|
330
336
|
__source: {
|
|
331
337
|
fileName: _jsxFileName,
|
|
332
|
-
lineNumber:
|
|
338
|
+
lineNumber: 365,
|
|
333
339
|
columnNumber: 5
|
|
334
340
|
}
|
|
335
341
|
}), thumbnail.type === 'video' ? _react["default"].createElement(VideoThumbnail, {
|
|
@@ -341,7 +347,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
341
347
|
__self: _this,
|
|
342
348
|
__source: {
|
|
343
349
|
fileName: _jsxFileName,
|
|
344
|
-
lineNumber:
|
|
350
|
+
lineNumber: 407,
|
|
345
351
|
columnNumber: 9
|
|
346
352
|
}
|
|
347
353
|
}) : _react["default"].createElement(_reactNative.View, {
|
|
@@ -349,7 +355,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
349
355
|
__self: _this,
|
|
350
356
|
__source: {
|
|
351
357
|
fileName: _jsxFileName,
|
|
352
|
-
lineNumber:
|
|
358
|
+
lineNumber: 419,
|
|
353
359
|
columnNumber: 9
|
|
354
360
|
}
|
|
355
361
|
}, _react["default"].createElement(GalleryImageThumbnail, {
|
|
@@ -360,7 +366,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
360
366
|
__self: _this,
|
|
361
367
|
__source: {
|
|
362
368
|
fileName: _jsxFileName,
|
|
363
|
-
lineNumber:
|
|
369
|
+
lineNumber: 420,
|
|
364
370
|
columnNumber: 11
|
|
365
371
|
}
|
|
366
372
|
})), colIndex === numOfColumns - 1 && rowIndex === numOfRows - 1 && imagesAndVideos.length > 4 ? _react["default"].createElement(_reactNative.View, {
|
|
@@ -370,7 +376,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
370
376
|
__self: _this,
|
|
371
377
|
__source: {
|
|
372
378
|
fileName: _jsxFileName,
|
|
373
|
-
lineNumber:
|
|
379
|
+
lineNumber: 429,
|
|
374
380
|
columnNumber: 9
|
|
375
381
|
}
|
|
376
382
|
}, _react["default"].createElement(_reactNative.Text, {
|
|
@@ -378,7 +384,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
378
384
|
__self: _this,
|
|
379
385
|
__source: {
|
|
380
386
|
fileName: _jsxFileName,
|
|
381
|
-
lineNumber:
|
|
387
|
+
lineNumber: 437,
|
|
382
388
|
columnNumber: 11
|
|
383
389
|
}
|
|
384
390
|
}, "+" + (imagesAndVideos.length - 4))) : null);
|
|
@@ -407,7 +413,7 @@ var GalleryImageThumbnail = function GalleryImageThumbnail(_ref2) {
|
|
|
407
413
|
__self: _this,
|
|
408
414
|
__source: {
|
|
409
415
|
fileName: _jsxFileName,
|
|
410
|
-
lineNumber:
|
|
416
|
+
lineNumber: 469,
|
|
411
417
|
columnNumber: 5
|
|
412
418
|
}
|
|
413
419
|
}, isLoadingImageError ? _react["default"].createElement(ImageLoadingFailedIndicator, {
|
|
@@ -415,7 +421,7 @@ var GalleryImageThumbnail = function GalleryImageThumbnail(_ref2) {
|
|
|
415
421
|
__self: _this,
|
|
416
422
|
__source: {
|
|
417
423
|
fileName: _jsxFileName,
|
|
418
|
-
lineNumber:
|
|
424
|
+
lineNumber: 476,
|
|
419
425
|
columnNumber: 9
|
|
420
426
|
}
|
|
421
427
|
}) : _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(MemoizedGalleryImage, {
|
|
@@ -439,17 +445,15 @@ var GalleryImageThumbnail = function GalleryImageThumbnail(_ref2) {
|
|
|
439
445
|
__self: _this,
|
|
440
446
|
__source: {
|
|
441
447
|
fileName: _jsxFileName,
|
|
442
|
-
lineNumber:
|
|
448
|
+
lineNumber: 479,
|
|
443
449
|
columnNumber: 11
|
|
444
450
|
}
|
|
445
451
|
}), isLoadingImage && _react["default"].createElement(_reactNative.View, {
|
|
446
|
-
style:
|
|
447
|
-
position: 'absolute'
|
|
448
|
-
},
|
|
452
|
+
style: [styles.imageLoadingIndicatorContainer],
|
|
449
453
|
__self: _this,
|
|
450
454
|
__source: {
|
|
451
455
|
fileName: _jsxFileName,
|
|
452
|
-
lineNumber:
|
|
456
|
+
lineNumber: 499,
|
|
453
457
|
columnNumber: 13
|
|
454
458
|
}
|
|
455
459
|
}, _react["default"].createElement(ImageLoadingIndicator, {
|
|
@@ -457,7 +461,7 @@ var GalleryImageThumbnail = function GalleryImageThumbnail(_ref2) {
|
|
|
457
461
|
__self: _this,
|
|
458
462
|
__source: {
|
|
459
463
|
fileName: _jsxFileName,
|
|
460
|
-
lineNumber:
|
|
464
|
+
lineNumber: 500,
|
|
461
465
|
columnNumber: 15
|
|
462
466
|
}
|
|
463
467
|
}))));
|
|
@@ -577,7 +581,7 @@ var Gallery = function Gallery(props) {
|
|
|
577
581
|
__self: _this,
|
|
578
582
|
__source: {
|
|
579
583
|
fileName: _jsxFileName,
|
|
580
|
-
lineNumber:
|
|
584
|
+
lineNumber: 636,
|
|
581
585
|
columnNumber: 5
|
|
582
586
|
}
|
|
583
587
|
});
|