stream-chat-react-native-core 4.11.1-beta.4 → 4.12.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/lib/commonjs/components/Attachment/AudioAttachment.js +541 -0
  2. package/lib/commonjs/components/Attachment/AudioAttachment.js.map +1 -0
  3. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +113 -10
  4. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
  5. package/lib/commonjs/components/Attachment/Gallery.js +2 -2
  6. package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
  7. package/lib/commonjs/components/Attachment/{GallaryImage.js → GalleryImage.js} +3 -3
  8. package/lib/{module/components/Attachment/GallaryImage.js.map → commonjs/components/Attachment/GalleryImage.js.map} +1 -1
  9. package/lib/commonjs/components/Attachment/Giphy.js +1 -1
  10. package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
  11. package/lib/commonjs/components/Attachment/VideoThumbnail.js +10 -5
  12. package/lib/commonjs/components/Attachment/VideoThumbnail.js.map +1 -1
  13. package/lib/commonjs/components/Avatar/Avatar.js +1 -1
  14. package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
  15. package/lib/commonjs/components/Avatar/GroupAvatar.js +1 -1
  16. package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
  17. package/lib/commonjs/components/Channel/Channel.js +18 -13
  18. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  19. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -0
  20. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  21. package/lib/commonjs/components/ImageGallery/ImageGallery.js +37 -30
  22. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  23. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +5 -3
  24. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  25. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +10 -6
  26. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
  27. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +17 -14
  28. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  29. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +1 -0
  30. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  31. package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js +2 -1
  32. package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js.map +1 -1
  33. package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +37 -18
  34. package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
  35. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +3 -1
  36. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
  37. package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +5 -4
  38. package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
  39. package/lib/commonjs/components/Message/Message.js +8 -6
  40. package/lib/commonjs/components/Message/Message.js.map +1 -1
  41. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js +1 -1
  42. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js.map +1 -1
  43. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js +1 -1
  44. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -1
  45. package/lib/commonjs/components/MessageInput/FileUploadPreview.js +125 -35
  46. package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
  47. package/lib/{module/components/ImageGallery/components → commonjs/components/ProgressControl}/ProgressControl.js +37 -24
  48. package/lib/commonjs/components/ProgressControl/ProgressControl.js.map +1 -0
  49. package/lib/commonjs/components/index.js +26 -0
  50. package/lib/commonjs/components/index.js.map +1 -1
  51. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +5 -2
  52. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  53. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +7 -2
  54. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  55. package/lib/commonjs/contexts/themeContext/utils/theme.js +9 -0
  56. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  57. package/lib/commonjs/icons/Pause.js +2 -2
  58. package/lib/commonjs/icons/Pause.js.map +1 -1
  59. package/lib/commonjs/mock-builders/api/channelMocks.js +1 -0
  60. package/lib/commonjs/mock-builders/api/channelMocks.js.map +1 -1
  61. package/lib/commonjs/native.js +13 -5
  62. package/lib/commonjs/native.js.map +1 -1
  63. package/lib/commonjs/version.json +1 -1
  64. package/lib/module/components/Attachment/AudioAttachment.js +541 -0
  65. package/lib/module/components/Attachment/AudioAttachment.js.map +1 -0
  66. package/lib/module/components/Attachment/FileAttachmentGroup.js +113 -10
  67. package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
  68. package/lib/module/components/Attachment/Gallery.js +2 -2
  69. package/lib/module/components/Attachment/Gallery.js.map +1 -1
  70. package/lib/module/components/Attachment/{GallaryImage.js → GalleryImage.js} +3 -3
  71. package/lib/{commonjs/components/Attachment/GallaryImage.js.map → module/components/Attachment/GalleryImage.js.map} +1 -1
  72. package/lib/module/components/Attachment/Giphy.js +1 -1
  73. package/lib/module/components/Attachment/Giphy.js.map +1 -1
  74. package/lib/module/components/Attachment/VideoThumbnail.js +10 -5
  75. package/lib/module/components/Attachment/VideoThumbnail.js.map +1 -1
  76. package/lib/module/components/Avatar/Avatar.js +1 -1
  77. package/lib/module/components/Avatar/Avatar.js.map +1 -1
  78. package/lib/module/components/Avatar/GroupAvatar.js +1 -1
  79. package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
  80. package/lib/module/components/Channel/Channel.js +18 -13
  81. package/lib/module/components/Channel/Channel.js.map +1 -1
  82. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -0
  83. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  84. package/lib/module/components/ImageGallery/ImageGallery.js +37 -30
  85. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  86. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +5 -3
  87. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  88. package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +10 -6
  89. package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
  90. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +17 -14
  91. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  92. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +1 -0
  93. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  94. package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js +2 -1
  95. package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js.map +1 -1
  96. package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +37 -18
  97. package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
  98. package/lib/module/components/ImageGallery/components/ImageGrid.js +3 -1
  99. package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
  100. package/lib/module/components/ImageGallery/components/ImageGridHandle.js +5 -4
  101. package/lib/module/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
  102. package/lib/module/components/Message/Message.js +8 -6
  103. package/lib/module/components/Message/Message.js.map +1 -1
  104. package/lib/module/components/Message/MessageSimple/utils/parseLinks.js +1 -1
  105. package/lib/module/components/Message/MessageSimple/utils/parseLinks.js.map +1 -1
  106. package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js +1 -1
  107. package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -1
  108. package/lib/module/components/MessageInput/FileUploadPreview.js +125 -35
  109. package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
  110. package/lib/{commonjs/components/ImageGallery/components → module/components/ProgressControl}/ProgressControl.js +37 -24
  111. package/lib/module/components/ProgressControl/ProgressControl.js.map +1 -0
  112. package/lib/module/components/index.js +26 -0
  113. package/lib/module/components/index.js.map +1 -1
  114. package/lib/module/contexts/messageInputContext/MessageInputContext.js +5 -2
  115. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  116. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +7 -2
  117. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  118. package/lib/module/contexts/themeContext/utils/theme.js +9 -0
  119. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  120. package/lib/module/icons/Pause.js +2 -2
  121. package/lib/module/icons/Pause.js.map +1 -1
  122. package/lib/module/mock-builders/api/channelMocks.js +1 -0
  123. package/lib/module/mock-builders/api/channelMocks.js.map +1 -1
  124. package/lib/module/native.js +13 -5
  125. package/lib/module/native.js.map +1 -1
  126. package/lib/module/version.json +1 -1
  127. package/lib/typescript/components/Attachment/AudioAttachment.d.ts +26 -0
  128. package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts +2 -1
  129. package/lib/typescript/components/Attachment/{GallaryImage.d.ts → GalleryImage.d.ts} +0 -0
  130. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +1 -1
  131. package/lib/typescript/components/ImageGallery/__tests__/AnimatedVideoGallery.test.d.ts +1 -0
  132. package/lib/typescript/components/ImageGallery/__tests__/ImageGallery.test.d.ts +1 -0
  133. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryFooter.test.d.ts +1 -0
  134. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryGrid.test.d.ts +1 -0
  135. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryGridHandle.test.d.ts +1 -0
  136. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryHeader.test.d.ts +1 -0
  137. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryOverlay.test.d.ts +1 -0
  138. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryVideoControl.test.d.ts +1 -0
  139. package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts +1 -0
  140. package/lib/typescript/components/ImageGallery/components/AnimatedGalleryVideo.d.ts +2 -3
  141. package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +2 -1
  142. package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +2 -3
  143. package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
  144. package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
  145. package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +1 -1
  146. package/lib/typescript/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.d.ts +1 -0
  147. package/lib/typescript/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.d.ts +1 -0
  148. package/lib/typescript/components/ProgressControl/ProgressControl.d.ts +11 -0
  149. package/lib/typescript/components/index.d.ts +2 -0
  150. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
  151. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +7 -1
  152. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
  153. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +9 -0
  154. package/lib/typescript/native.d.ts +59 -2
  155. package/package.json +1 -1
  156. package/src/components/Attachment/AudioAttachment.tsx +357 -0
  157. package/src/components/Attachment/FileAttachmentGroup.tsx +96 -7
  158. package/src/components/Attachment/Gallery.tsx +1 -1
  159. package/src/components/Attachment/{GallaryImage.tsx → GalleryImage.tsx} +1 -1
  160. package/src/components/Attachment/Giphy.tsx +1 -1
  161. package/src/components/Attachment/VideoThumbnail.tsx +4 -4
  162. package/src/components/Attachment/__tests__/Gallery.test.js +6 -6
  163. package/src/components/Attachment/__tests__/Giphy.test.js +4 -4
  164. package/src/components/Avatar/Avatar.tsx +1 -1
  165. package/src/components/Avatar/GroupAvatar.tsx +1 -1
  166. package/src/components/Channel/Channel.tsx +3 -0
  167. package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +2 -0
  168. package/src/components/ImageGallery/ImageGallery.tsx +21 -11
  169. package/src/components/ImageGallery/__tests__/AnimatedVideoGallery.test.tsx +241 -0
  170. package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +192 -0
  171. package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +190 -0
  172. package/src/components/ImageGallery/__tests__/ImageGalleryGrid.test.tsx +98 -0
  173. package/src/components/ImageGallery/__tests__/ImageGalleryGridHandle.test.tsx +79 -0
  174. package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx +172 -0
  175. package/src/components/ImageGallery/__tests__/ImageGalleryOverlay.test.tsx +94 -0
  176. package/src/components/ImageGallery/__tests__/ImageGalleryVideoControl.test.tsx +84 -0
  177. package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +3 -0
  178. package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +11 -3
  179. package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +9 -2
  180. package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +1 -1
  181. package/src/components/ImageGallery/components/ImageGalleryOverlay.tsx +6 -1
  182. package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +27 -9
  183. package/src/components/ImageGallery/components/ImageGrid.tsx +19 -17
  184. package/src/components/ImageGallery/components/ImageGridHandle.tsx +4 -1
  185. package/src/components/Message/Message.tsx +2 -1
  186. package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +11 -3
  187. package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageAvatar.test.js.snap +1 -1
  188. package/src/components/Message/MessageSimple/utils/parseLinks.test.ts +4 -0
  189. package/src/components/Message/MessageSimple/utils/parseLinks.ts +1 -1
  190. package/src/components/MessageInput/FileUploadPreview.tsx +162 -66
  191. package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.tsx +196 -0
  192. package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.tsx +212 -0
  193. package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +64 -0
  194. package/src/components/{ImageGallery/components → ProgressControl}/ProgressControl.tsx +37 -19
  195. package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +4 -4
  196. package/src/components/index.ts +3 -0
  197. package/src/contexts/messageInputContext/MessageInputContext.tsx +11 -0
  198. package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +5 -1
  199. package/src/contexts/themeContext/utils/theme.ts +15 -0
  200. package/src/icons/Pause.tsx +2 -2
  201. package/src/mock-builders/api/channelMocks.tsx +1 -0
  202. package/src/native.ts +67 -7
  203. package/src/version.json +1 -1
  204. package/lib/commonjs/components/ImageGallery/components/ProgressControl.js.map +0 -1
  205. package/lib/module/components/ImageGallery/components/ProgressControl.js.map +0 -1
  206. package/lib/typescript/components/ImageGallery/components/ProgressControl.d.ts +0 -5
@@ -0,0 +1,541 @@
1
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
2
+
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.AudioAttachment = void 0;
9
+
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
14
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
15
+
16
+ var _react = _interopRequireWildcard(require("react"));
17
+
18
+ var _reactNative = require("react-native");
19
+
20
+ var _dayjs = _interopRequireDefault(require("dayjs"));
21
+
22
+ var _duration = _interopRequireDefault(require("dayjs/plugin/duration"));
23
+
24
+ var _contexts = require("../../contexts");
25
+
26
+ var _icons = require("../../icons");
27
+
28
+ var _native = require("../../native");
29
+
30
+ var _ProgressControl = require("../ProgressControl/ProgressControl");
31
+
32
+ var _this = this,
33
+ _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/AudioAttachment.tsx";
34
+
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
+
37
+ 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; }
38
+
39
+ _dayjs["default"].extend(_duration["default"]);
40
+
41
+ var FILE_PREVIEW_HEIGHT = 70;
42
+
43
+ var styles = _reactNative.StyleSheet.create({
44
+ fileContainer: {
45
+ borderRadius: 12,
46
+ borderWidth: 1,
47
+ flexDirection: 'row',
48
+ height: FILE_PREVIEW_HEIGHT,
49
+ paddingLeft: 8,
50
+ paddingRight: 8
51
+ },
52
+ fileContentContainer: {
53
+ flexDirection: 'row',
54
+ paddingRight: 40
55
+ },
56
+ filenameText: {
57
+ fontSize: 14,
58
+ fontWeight: 'bold',
59
+ paddingLeft: 10
60
+ },
61
+ fileTextContainer: {
62
+ justifyContent: 'space-around'
63
+ },
64
+ flatList: {
65
+ marginBottom: 12,
66
+ maxHeight: FILE_PREVIEW_HEIGHT * 2.5 + 16
67
+ },
68
+ overlay: {
69
+ borderRadius: 12,
70
+ marginLeft: 8,
71
+ marginRight: 8
72
+ },
73
+ progressControlView: {
74
+ flex: 8
75
+ },
76
+ progressDurationText: {
77
+ flex: 4,
78
+ fontSize: 12,
79
+ paddingLeft: 10,
80
+ paddingRight: 8
81
+ },
82
+ roundedView: {
83
+ alignItems: 'center',
84
+ alignSelf: 'center',
85
+ borderRadius: 50,
86
+ display: 'flex',
87
+ elevation: 4,
88
+ height: 36,
89
+ justifyContent: 'center',
90
+ shadowOffset: {
91
+ height: 2,
92
+ width: 0
93
+ },
94
+ shadowOpacity: 0.23,
95
+ shadowRadius: 2.62,
96
+ width: 36
97
+ }
98
+ });
99
+
100
+ var AudioAttachmentWithContext = function AudioAttachmentWithContext(props) {
101
+ var soundRef = _react["default"].useRef(null);
102
+
103
+ var fileUploads = props.fileUploads,
104
+ index = props.index,
105
+ item = props.item,
106
+ onLoad = props.onLoad,
107
+ onPlayPause = props.onPlayPause,
108
+ onProgress = props.onProgress;
109
+
110
+ var handleLoad = function handleLoad(payload) {
111
+ onLoad(item.id, payload.duration);
112
+ };
113
+
114
+ var handleProgress = function handleProgress(data) {
115
+ if (data.currentTime && data.seekableDuration) {
116
+ onProgress(item.id, data.currentTime);
117
+ }
118
+ };
119
+
120
+ var handlePlayPause = function () {
121
+ var _ref = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(isPausedStatusAvailable) {
122
+ return _regenerator["default"].wrap(function _callee$(_context) {
123
+ while (1) {
124
+ switch (_context.prev = _context.next) {
125
+ case 0:
126
+ if (!soundRef.current) {
127
+ _context.next = 17;
128
+ break;
129
+ }
130
+
131
+ if (!(isPausedStatusAvailable === undefined)) {
132
+ _context.next = 16;
133
+ break;
134
+ }
135
+
136
+ if (item.progress === 1) {
137
+ if (soundRef.current.seek) soundRef.current.seek(0);
138
+ if (soundRef.current.setPositionAsync) soundRef.current.setPositionAsync(0);
139
+ }
140
+
141
+ if (!item.paused) {
142
+ _context.next = 10;
143
+ break;
144
+ }
145
+
146
+ if (!soundRef.current.playAsync) {
147
+ _context.next = 7;
148
+ break;
149
+ }
150
+
151
+ _context.next = 7;
152
+ return soundRef.current.playAsync();
153
+
154
+ case 7:
155
+ onPlayPause(item.id, false);
156
+ _context.next = 14;
157
+ break;
158
+
159
+ case 10:
160
+ if (!soundRef.current.pauseAsync) {
161
+ _context.next = 13;
162
+ break;
163
+ }
164
+
165
+ _context.next = 13;
166
+ return soundRef.current.pauseAsync();
167
+
168
+ case 13:
169
+ onPlayPause(item.id, true);
170
+
171
+ case 14:
172
+ _context.next = 17;
173
+ break;
174
+
175
+ case 16:
176
+ onPlayPause(item.id, isPausedStatusAvailable);
177
+
178
+ case 17:
179
+ case "end":
180
+ return _context.stop();
181
+ }
182
+ }
183
+ }, _callee);
184
+ }));
185
+
186
+ return function handlePlayPause(_x) {
187
+ return _ref.apply(this, arguments);
188
+ };
189
+ }();
190
+
191
+ var handleProgressDrag = function () {
192
+ var _ref2 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(position) {
193
+ var _soundRef$current, _soundRef$current2;
194
+
195
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
196
+ while (1) {
197
+ switch (_context2.prev = _context2.next) {
198
+ case 0:
199
+ onProgress(item.id, position);
200
+ if ((_soundRef$current = soundRef.current) != null && _soundRef$current.seek) soundRef.current.seek(position);
201
+
202
+ if (!((_soundRef$current2 = soundRef.current) != null && _soundRef$current2.setPositionAsync)) {
203
+ _context2.next = 5;
204
+ break;
205
+ }
206
+
207
+ _context2.next = 5;
208
+ return soundRef.current.setPositionAsync(position * 1000);
209
+
210
+ case 5:
211
+ case "end":
212
+ return _context2.stop();
213
+ }
214
+ }
215
+ }, _callee2);
216
+ }));
217
+
218
+ return function handleProgressDrag(_x2) {
219
+ return _ref2.apply(this, arguments);
220
+ };
221
+ }();
222
+
223
+ var handleEnd = function handleEnd() {
224
+ onPlayPause(item.id, true);
225
+ onProgress(item.id, item.duration, true);
226
+ };
227
+
228
+ var onPlaybackStatusUpdate = function onPlaybackStatusUpdate(playbackStatus) {
229
+ if (!playbackStatus.isLoaded) {
230
+ if (playbackStatus.error) {
231
+ console.log("Encountered a fatal error during playback: " + playbackStatus.error);
232
+ }
233
+ } else {
234
+ var durationMillis = playbackStatus.durationMillis,
235
+ positionMillis = playbackStatus.positionMillis;
236
+ onLoad(item.id, durationMillis / 1000);
237
+
238
+ if (playbackStatus.isPlaying) {
239
+ onProgress(item.id, positionMillis / 1000);
240
+ } else {}
241
+
242
+ if (playbackStatus.isBuffering) {}
243
+
244
+ if (playbackStatus.didJustFinish && !playbackStatus.isLooping) {
245
+ handleEnd();
246
+ }
247
+ }
248
+ };
249
+
250
+ (0, _react.useEffect)(function () {
251
+ if (_native.Sound.Player === null) {
252
+ var initiateSound = function () {
253
+ var _ref3 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3() {
254
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
255
+ while (1) {
256
+ switch (_context3.prev = _context3.next) {
257
+ case 0:
258
+ if (!(item && item.file && item.file.uri)) {
259
+ _context3.next = 4;
260
+ break;
261
+ }
262
+
263
+ _context3.next = 3;
264
+ return _native.Sound.initializeSound({
265
+ uri: item.file.uri
266
+ }, {}, onPlaybackStatusUpdate);
267
+
268
+ case 3:
269
+ soundRef.current = _context3.sent;
270
+
271
+ case 4:
272
+ case "end":
273
+ return _context3.stop();
274
+ }
275
+ }
276
+ }, _callee3);
277
+ }));
278
+
279
+ return function initiateSound() {
280
+ return _ref3.apply(this, arguments);
281
+ };
282
+ }();
283
+
284
+ initiateSound();
285
+ }
286
+
287
+ return function () {
288
+ var _soundRef$current3;
289
+
290
+ if ((_soundRef$current3 = soundRef.current) != null && _soundRef$current3.stopAsync && soundRef.current.unloadAsync) {
291
+ soundRef.current.stopAsync();
292
+ soundRef.current.unloadAsync();
293
+ }
294
+ };
295
+ }, []);
296
+ (0, _react.useEffect)(function () {
297
+ var initalPlayPause = function () {
298
+ var _ref4 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4() {
299
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
300
+ while (1) {
301
+ switch (_context4.prev = _context4.next) {
302
+ case 0:
303
+ if (!soundRef.current) {
304
+ _context4.next = 10;
305
+ break;
306
+ }
307
+
308
+ if (!item.paused) {
309
+ _context4.next = 7;
310
+ break;
311
+ }
312
+
313
+ if (!soundRef.current.pauseAsync) {
314
+ _context4.next = 5;
315
+ break;
316
+ }
317
+
318
+ _context4.next = 5;
319
+ return soundRef.current.pauseAsync();
320
+
321
+ case 5:
322
+ _context4.next = 10;
323
+ break;
324
+
325
+ case 7:
326
+ if (!soundRef.current.playAsync) {
327
+ _context4.next = 10;
328
+ break;
329
+ }
330
+
331
+ _context4.next = 10;
332
+ return soundRef.current.playAsync();
333
+
334
+ case 10:
335
+ case "end":
336
+ return _context4.stop();
337
+ }
338
+ }
339
+ }, _callee4);
340
+ }));
341
+
342
+ return function initalPlayPause() {
343
+ return _ref4.apply(this, arguments);
344
+ };
345
+ }();
346
+
347
+ if (!_native.Sound.Player) {
348
+ initalPlayPause();
349
+ }
350
+ }, [item.paused]);
351
+
352
+ var _useTheme = (0, _contexts.useTheme)(),
353
+ _useTheme$theme = _useTheme.theme,
354
+ _useTheme$theme$color = _useTheme$theme.colors,
355
+ accent_blue = _useTheme$theme$color.accent_blue,
356
+ black = _useTheme$theme$color.black,
357
+ grey_dark = _useTheme$theme$color.grey_dark,
358
+ grey_whisper = _useTheme$theme$color.grey_whisper,
359
+ static_black = _useTheme$theme$color.static_black,
360
+ static_white = _useTheme$theme$color.static_white,
361
+ white = _useTheme$theme$color.white,
362
+ _useTheme$theme$messa = _useTheme$theme.messageInput.fileUploadPreview,
363
+ _useTheme$theme$messa2 = _useTheme$theme$messa.audioAttachment,
364
+ progressControlView = _useTheme$theme$messa2.progressControlView,
365
+ progressDurationText = _useTheme$theme$messa2.progressDurationText,
366
+ roundedView = _useTheme$theme$messa2.roundedView,
367
+ fileContainer = _useTheme$theme$messa.fileContainer,
368
+ fileContentContainer = _useTheme$theme$messa.fileContentContainer,
369
+ filenameText = _useTheme$theme$messa.filenameText,
370
+ fileTextContainer = _useTheme$theme$messa.fileTextContainer;
371
+
372
+ var progressValueInSeconds = item.duration * item.progress;
373
+ var progressDuration = progressValueInSeconds ? progressValueInSeconds / 3600 >= 1 ? _dayjs["default"].duration(progressValueInSeconds, 'second').format('HH:mm:ss') : _dayjs["default"].duration(progressValueInSeconds, 'second').format('mm:ss') : '00:00';
374
+ var lastIndexOfDot = item.file.name.lastIndexOf('.');
375
+ return _react["default"].createElement(_reactNative.View, {
376
+ style: [styles.fileContainer, index === fileUploads.length - 1 ? {
377
+ marginBottom: 0
378
+ } : {}, {
379
+ backgroundColor: white,
380
+ borderColor: grey_whisper,
381
+ width: -16
382
+ }, fileContainer],
383
+ testID: "audio-attachment-upload-preview",
384
+ __self: _this,
385
+ __source: {
386
+ fileName: _jsxFileName,
387
+ lineNumber: 239,
388
+ columnNumber: 5
389
+ }
390
+ }, _react["default"].createElement(_reactNative.View, {
391
+ style: [styles.fileContentContainer, fileContentContainer],
392
+ __self: _this,
393
+ __source: {
394
+ fileName: _jsxFileName,
395
+ lineNumber: 256,
396
+ columnNumber: 7
397
+ }
398
+ }, _react["default"].createElement(_reactNative.TouchableOpacity, {
399
+ accessibilityLabel: "Play Pause Button",
400
+ onPress: function onPress() {
401
+ return handlePlayPause();
402
+ },
403
+ style: [styles.roundedView, roundedView, {
404
+ backgroundColor: static_white,
405
+ shadowColor: black
406
+ }],
407
+ __self: _this,
408
+ __source: {
409
+ fileName: _jsxFileName,
410
+ lineNumber: 257,
411
+ columnNumber: 9
412
+ }
413
+ }, item.paused ? _react["default"].createElement(_icons.Play, {
414
+ height: 24,
415
+ pathFill: static_black,
416
+ width: 24,
417
+ __self: _this,
418
+ __source: {
419
+ fileName: _jsxFileName,
420
+ lineNumber: 267,
421
+ columnNumber: 13
422
+ }
423
+ }) : _react["default"].createElement(_icons.Pause, {
424
+ height: 24,
425
+ pathFill: static_black,
426
+ width: 24,
427
+ __self: _this,
428
+ __source: {
429
+ fileName: _jsxFileName,
430
+ lineNumber: 269,
431
+ columnNumber: 13
432
+ }
433
+ })), _react["default"].createElement(_reactNative.View, {
434
+ style: [styles.fileTextContainer, fileTextContainer],
435
+ __self: _this,
436
+ __source: {
437
+ fileName: _jsxFileName,
438
+ lineNumber: 272,
439
+ columnNumber: 9
440
+ }
441
+ }, _react["default"].createElement(_reactNative.Text, {
442
+ accessibilityLabel: "File Name",
443
+ numberOfLines: 1,
444
+ style: [styles.filenameText, {
445
+ color: black,
446
+ width: 16 - 40 - 24 - 24
447
+ }, _reactNative.I18nManager.isRTL ? {
448
+ writingDirection: 'rtl'
449
+ } : {
450
+ writingDirection: 'ltr'
451
+ }, filenameText],
452
+ __self: _this,
453
+ __source: {
454
+ fileName: _jsxFileName,
455
+ lineNumber: 273,
456
+ columnNumber: 11
457
+ }
458
+ }, item.file.name.slice(0, 12) + '...' + item.file.name.slice(lastIndexOfDot)), _react["default"].createElement(_reactNative.View, {
459
+ style: {
460
+ alignItems: 'center',
461
+ display: 'flex',
462
+ flexDirection: 'row'
463
+ },
464
+ __self: _this,
465
+ __source: {
466
+ fileName: _jsxFileName,
467
+ lineNumber: 292,
468
+ columnNumber: 11
469
+ }
470
+ }, _native.Sound.Player && _react["default"].createElement(_native.Sound.Player, {
471
+ onEnd: handleEnd,
472
+ onLoad: handleLoad,
473
+ onProgress: handleProgress,
474
+ paused: item.paused,
475
+ soundRef: soundRef,
476
+ testID: "sound-player",
477
+ uri: item.file.uri,
478
+ __self: _this,
479
+ __source: {
480
+ fileName: _jsxFileName,
481
+ lineNumber: 301,
482
+ columnNumber: 15
483
+ }
484
+ }), _react["default"].createElement(_reactNative.Text, {
485
+ style: [styles.progressDurationText, {
486
+ color: grey_dark
487
+ }, progressDurationText],
488
+ __self: _this,
489
+ __source: {
490
+ fileName: _jsxFileName,
491
+ lineNumber: 311,
492
+ columnNumber: 13
493
+ }
494
+ }, progressDuration), _react["default"].createElement(_reactNative.View, {
495
+ style: [styles.progressControlView, progressControlView],
496
+ __self: _this,
497
+ __source: {
498
+ fileName: _jsxFileName,
499
+ lineNumber: 314,
500
+ columnNumber: 13
501
+ }
502
+ }, _react["default"].createElement(_ProgressControl.ProgressControl, {
503
+ duration: item.duration,
504
+ filledColor: accent_blue,
505
+ onPlayPause: handlePlayPause,
506
+ onProgressDrag: handleProgressDrag,
507
+ progress: item.progress,
508
+ testID: "progress-control",
509
+ width: 120,
510
+ __self: _this,
511
+ __source: {
512
+ fileName: _jsxFileName,
513
+ lineNumber: 315,
514
+ columnNumber: 15
515
+ }
516
+ }))))));
517
+ };
518
+
519
+ var AudioAttachment = function AudioAttachment(props) {
520
+ var _useMessageInputConte = (0, _contexts.useMessageInputContext)(),
521
+ fileUploads = _useMessageInputConte.fileUploads,
522
+ removeFile = _useMessageInputConte.removeFile,
523
+ uploadFile = _useMessageInputConte.uploadFile;
524
+
525
+ return _react["default"].createElement(AudioAttachmentWithContext, (0, _extends2["default"])({
526
+ fileUploads: fileUploads,
527
+ removeFile: removeFile,
528
+ uploadFile: uploadFile
529
+ }, props, {
530
+ __self: _this,
531
+ __source: {
532
+ fileName: _jsxFileName,
533
+ lineNumber: 354,
534
+ columnNumber: 10
535
+ }
536
+ }));
537
+ };
538
+
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,YAA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AAoDlE,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"]}