stream-chat-react-native-core 4.11.1-beta.2 → 4.12.0-beta.1

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