stream-chat-react-native-core 5.21.0 → 5.22.0-beta.10

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 (285) hide show
  1. package/README.md +10 -5
  2. package/lib/commonjs/components/Attachment/AudioAttachment.js +12 -12
  3. package/lib/commonjs/components/Attachment/AudioAttachment.js.map +1 -1
  4. package/lib/commonjs/components/Attachment/FileAttachment.js +10 -7
  5. package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
  6. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +8 -6
  7. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  8. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js +24 -20
  9. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
  10. package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js +26 -11
  11. package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js.map +1 -1
  12. package/lib/commonjs/components/Channel/Channel.js +65 -46
  13. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  14. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +2 -0
  15. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  16. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -2
  17. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  18. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +16 -14
  19. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
  20. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js +4 -2
  21. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
  22. package/lib/commonjs/components/ImageGallery/ImageGallery.js +30 -32
  23. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  24. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +7 -5
  25. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  26. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +10 -8
  27. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
  28. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +18 -15
  29. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  30. package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +41 -12
  31. package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
  32. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +10 -8
  33. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
  34. package/lib/commonjs/components/Indicators/EmptyStateIndicator.js +17 -12
  35. package/lib/commonjs/components/Indicators/EmptyStateIndicator.js.map +1 -1
  36. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +20 -17
  37. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
  38. package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +18 -17
  39. package/lib/commonjs/components/Message/MessageSimple/ReactionList.js.map +1 -1
  40. package/lib/commonjs/components/Message/MessageSimple/utils/generateMarkdownText.js +7 -5
  41. package/lib/commonjs/components/Message/MessageSimple/utils/generateMarkdownText.js.map +1 -1
  42. package/lib/commonjs/components/Message/MessageSimple/utils/generateMarkdownText.test.js +8 -0
  43. package/lib/commonjs/components/Message/MessageSimple/utils/generateMarkdownText.test.js.map +1 -0
  44. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +25 -17
  45. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  46. package/lib/commonjs/components/MessageInput/FileUploadPreview.js +30 -20
  47. package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
  48. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +13 -13
  49. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
  50. package/lib/commonjs/components/MessageInput/MessageInput.js +1 -1
  51. package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
  52. package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js.map +1 -1
  53. package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js +13 -11
  54. package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js.map +1 -1
  55. package/lib/commonjs/components/MessageOverlay/MessageActionList.js +8 -14
  56. package/lib/commonjs/components/MessageOverlay/MessageActionList.js.map +1 -1
  57. package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +11 -8
  58. package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js.map +1 -1
  59. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +32 -29
  60. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
  61. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +17 -15
  62. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
  63. package/lib/commonjs/contexts/channelContext/ChannelContext.js +2 -2
  64. package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
  65. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +66 -45
  66. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  67. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -2
  68. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  69. package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
  70. package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
  71. package/lib/commonjs/contexts/themeContext/utils/theme.js +1 -4
  72. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  73. package/lib/commonjs/hooks/index.js +11 -0
  74. package/lib/commonjs/hooks/index.js.map +1 -1
  75. package/lib/commonjs/hooks/useViewport.js +47 -0
  76. package/lib/commonjs/hooks/useViewport.js.map +1 -0
  77. package/lib/commonjs/i18n/en.json +6 -1
  78. package/lib/commonjs/i18n/es.json +77 -0
  79. package/lib/commonjs/i18n/fr.json +65 -60
  80. package/lib/commonjs/i18n/he.json +6 -1
  81. package/lib/commonjs/i18n/hi.json +65 -60
  82. package/lib/commonjs/i18n/it.json +65 -60
  83. package/lib/commonjs/i18n/ja.json +6 -1
  84. package/lib/commonjs/i18n/ko.json +6 -1
  85. package/lib/commonjs/i18n/nl.json +65 -60
  86. package/lib/commonjs/i18n/ru.json +65 -60
  87. package/lib/commonjs/i18n/tr.json +65 -60
  88. package/lib/commonjs/native.js.map +1 -1
  89. package/lib/commonjs/types/types.js.map +1 -1
  90. package/lib/commonjs/utils/Streami18n.js +4 -1
  91. package/lib/commonjs/utils/Streami18n.js.map +1 -1
  92. package/lib/commonjs/utils/compressImage.js +37 -0
  93. package/lib/commonjs/utils/compressImage.js.map +1 -0
  94. package/lib/commonjs/utils/utils.js +1 -15
  95. package/lib/commonjs/utils/utils.js.map +1 -1
  96. package/lib/commonjs/version.json +1 -1
  97. package/lib/module/components/Attachment/AudioAttachment.js +12 -12
  98. package/lib/module/components/Attachment/AudioAttachment.js.map +1 -1
  99. package/lib/module/components/Attachment/FileAttachment.js +10 -7
  100. package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
  101. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +8 -6
  102. package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  103. package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js +24 -20
  104. package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
  105. package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js +26 -11
  106. package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js.map +1 -1
  107. package/lib/module/components/Channel/Channel.js +65 -46
  108. package/lib/module/components/Channel/Channel.js.map +1 -1
  109. package/lib/module/components/Channel/hooks/useCreateChannelContext.js +2 -0
  110. package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  111. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -2
  112. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  113. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +16 -14
  114. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
  115. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js +4 -2
  116. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
  117. package/lib/module/components/ImageGallery/ImageGallery.js +30 -32
  118. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  119. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +7 -5
  120. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  121. package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +10 -8
  122. package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
  123. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +18 -15
  124. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  125. package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +41 -12
  126. package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
  127. package/lib/module/components/ImageGallery/components/ImageGrid.js +10 -8
  128. package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
  129. package/lib/module/components/Indicators/EmptyStateIndicator.js +17 -12
  130. package/lib/module/components/Indicators/EmptyStateIndicator.js.map +1 -1
  131. package/lib/module/components/Message/MessageSimple/MessageContent.js +20 -17
  132. package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
  133. package/lib/module/components/Message/MessageSimple/ReactionList.js +18 -17
  134. package/lib/module/components/Message/MessageSimple/ReactionList.js.map +1 -1
  135. package/lib/module/components/Message/MessageSimple/utils/generateMarkdownText.js +7 -5
  136. package/lib/module/components/Message/MessageSimple/utils/generateMarkdownText.js.map +1 -1
  137. package/lib/module/components/Message/MessageSimple/utils/generateMarkdownText.test.js +8 -0
  138. package/lib/module/components/Message/MessageSimple/utils/generateMarkdownText.test.js.map +1 -0
  139. package/lib/module/components/Message/MessageSimple/utils/renderText.js +25 -17
  140. package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  141. package/lib/module/components/MessageInput/FileUploadPreview.js +30 -20
  142. package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
  143. package/lib/module/components/MessageInput/ImageUploadPreview.js +13 -13
  144. package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
  145. package/lib/module/components/MessageInput/MessageInput.js +1 -1
  146. package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
  147. package/lib/module/components/MessageInput/UploadProgressIndicator.js.map +1 -1
  148. package/lib/module/components/MessageList/InlineUnreadIndicator.js +13 -11
  149. package/lib/module/components/MessageList/InlineUnreadIndicator.js.map +1 -1
  150. package/lib/module/components/MessageOverlay/MessageActionList.js +8 -14
  151. package/lib/module/components/MessageOverlay/MessageActionList.js.map +1 -1
  152. package/lib/module/components/MessageOverlay/MessageActionListItem.js +11 -8
  153. package/lib/module/components/MessageOverlay/MessageActionListItem.js.map +1 -1
  154. package/lib/module/components/MessageOverlay/MessageOverlay.js +32 -29
  155. package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
  156. package/lib/module/components/Thread/components/ThreadFooterComponent.js +17 -15
  157. package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
  158. package/lib/module/contexts/channelContext/ChannelContext.js +2 -2
  159. package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
  160. package/lib/module/contexts/messageInputContext/MessageInputContext.js +66 -45
  161. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  162. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -2
  163. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  164. package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
  165. package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
  166. package/lib/module/contexts/themeContext/utils/theme.js +1 -4
  167. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  168. package/lib/module/hooks/index.js +11 -0
  169. package/lib/module/hooks/index.js.map +1 -1
  170. package/lib/module/hooks/useViewport.js +47 -0
  171. package/lib/module/hooks/useViewport.js.map +1 -0
  172. package/lib/module/i18n/en.json +6 -1
  173. package/lib/module/i18n/es.json +77 -0
  174. package/lib/module/i18n/fr.json +65 -60
  175. package/lib/module/i18n/he.json +6 -1
  176. package/lib/module/i18n/hi.json +65 -60
  177. package/lib/module/i18n/it.json +65 -60
  178. package/lib/module/i18n/ja.json +6 -1
  179. package/lib/module/i18n/ko.json +6 -1
  180. package/lib/module/i18n/nl.json +65 -60
  181. package/lib/module/i18n/ru.json +65 -60
  182. package/lib/module/i18n/tr.json +65 -60
  183. package/lib/module/native.js.map +1 -1
  184. package/lib/module/types/types.js.map +1 -1
  185. package/lib/module/utils/Streami18n.js +4 -1
  186. package/lib/module/utils/Streami18n.js.map +1 -1
  187. package/lib/module/utils/compressImage.js +37 -0
  188. package/lib/module/utils/compressImage.js.map +1 -0
  189. package/lib/module/utils/utils.js +1 -15
  190. package/lib/module/utils/utils.js.map +1 -1
  191. package/lib/module/version.json +1 -1
  192. package/lib/typescript/components/Attachment/AudioAttachment.d.ts +1 -1
  193. package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
  194. package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +3 -0
  195. package/lib/typescript/components/Message/MessageSimple/utils/generateMarkdownText.d.ts +1 -3
  196. package/lib/typescript/components/Message/MessageSimple/utils/generateMarkdownText.test.d.ts +1 -0
  197. package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
  198. package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
  199. package/lib/typescript/components/MessageInput/UploadProgressIndicator.d.ts +5 -2
  200. package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +5 -0
  201. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
  202. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +3 -23
  203. package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts +2 -2
  204. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +2 -2
  205. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +1 -3
  206. package/lib/typescript/hooks/index.d.ts +1 -0
  207. package/lib/typescript/hooks/useViewport.d.ts +11 -0
  208. package/lib/typescript/i18n/en.json +6 -1
  209. package/lib/typescript/i18n/es.json +77 -0
  210. package/lib/typescript/i18n/fr.json +65 -60
  211. package/lib/typescript/i18n/he.json +6 -1
  212. package/lib/typescript/i18n/hi.json +65 -60
  213. package/lib/typescript/i18n/it.json +65 -60
  214. package/lib/typescript/i18n/ja.json +6 -1
  215. package/lib/typescript/i18n/ko.json +6 -1
  216. package/lib/typescript/i18n/nl.json +65 -60
  217. package/lib/typescript/i18n/ru.json +65 -60
  218. package/lib/typescript/i18n/tr.json +65 -60
  219. package/lib/typescript/native.d.ts +2 -0
  220. package/lib/typescript/store/mappers/mapStorableToChannel.d.ts +1 -1
  221. package/lib/typescript/types/types.d.ts +27 -10
  222. package/lib/typescript/utils/Streami18n.d.ts +7 -1
  223. package/lib/typescript/utils/compressImage.d.ts +8 -0
  224. package/lib/typescript/utils/utils.d.ts +0 -2
  225. package/package.json +2 -2
  226. package/src/components/Attachment/AudioAttachment.tsx +2 -1
  227. package/src/components/Attachment/FileAttachment.tsx +12 -3
  228. package/src/components/AttachmentPicker/AttachmentPicker.tsx +4 -2
  229. package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +7 -5
  230. package/src/components/AttachmentPicker/components/AttachmentSelectionBar.tsx +13 -1
  231. package/src/components/Channel/Channel.tsx +32 -8
  232. package/src/components/Channel/hooks/useCreateChannelContext.ts +2 -0
  233. package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +2 -9
  234. package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +4 -3
  235. package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts +4 -3
  236. package/src/components/ImageGallery/ImageGallery.tsx +10 -19
  237. package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +5 -3
  238. package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +5 -3
  239. package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +6 -2
  240. package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +12 -7
  241. package/src/components/ImageGallery/components/ImageGrid.tsx +2 -1
  242. package/src/components/Indicators/EmptyStateIndicator.tsx +8 -7
  243. package/src/components/Message/MessageSimple/MessageContent.tsx +3 -1
  244. package/src/components/Message/MessageSimple/ReactionList.tsx +2 -1
  245. package/src/components/Message/MessageSimple/utils/generateMarkdownText.test.ts +23 -0
  246. package/src/components/Message/MessageSimple/utils/generateMarkdownText.ts +12 -13
  247. package/src/components/Message/MessageSimple/utils/renderText.tsx +12 -2
  248. package/src/components/MessageInput/FileUploadPreview.tsx +17 -3
  249. package/src/components/MessageInput/ImageUploadPreview.tsx +1 -2
  250. package/src/components/MessageInput/MessageInput.tsx +1 -1
  251. package/src/components/MessageInput/UploadProgressIndicator.tsx +2 -2
  252. package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.tsx +1 -1
  253. package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.tsx +1 -1
  254. package/src/components/MessageInput/__tests__/MessageInput.test.js +2 -2
  255. package/src/components/MessageList/InlineUnreadIndicator.tsx +2 -1
  256. package/src/components/MessageOverlay/MessageActionList.tsx +3 -11
  257. package/src/components/MessageOverlay/MessageActionListItem.tsx +5 -2
  258. package/src/components/MessageOverlay/MessageOverlay.tsx +5 -3
  259. package/src/components/Thread/components/ThreadFooterComponent.tsx +2 -1
  260. package/src/contexts/channelContext/ChannelContext.tsx +5 -0
  261. package/src/contexts/messageInputContext/MessageInputContext.tsx +81 -69
  262. package/src/contexts/messageInputContext/__tests__/__snapshots__/sendMessage.test.tsx.snap +3 -3
  263. package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +2 -2
  264. package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +2 -2
  265. package/src/contexts/messagesContext/MessagesContext.tsx +2 -2
  266. package/src/contexts/themeContext/utils/theme.ts +2 -7
  267. package/src/hooks/index.ts +1 -0
  268. package/src/hooks/useViewport.ts +41 -0
  269. package/src/i18n/en.json +6 -1
  270. package/src/i18n/es.json +77 -0
  271. package/src/i18n/fr.json +65 -60
  272. package/src/i18n/he.json +6 -1
  273. package/src/i18n/hi.json +65 -60
  274. package/src/i18n/it.json +65 -60
  275. package/src/i18n/ja.json +6 -1
  276. package/src/i18n/ko.json +6 -1
  277. package/src/i18n/nl.json +65 -60
  278. package/src/i18n/ru.json +65 -60
  279. package/src/i18n/tr.json +65 -60
  280. package/src/native.ts +5 -1
  281. package/src/types/types.ts +29 -10
  282. package/src/utils/Streami18n.ts +13 -6
  283. package/src/utils/compressImage.ts +32 -0
  284. package/src/utils/utils.ts +0 -13
  285. package/src/version.json +1 -1
@@ -1,35 +1,54 @@
1
1
  import type { ExtendableGenerics, LiteralStringForUnion } from 'stream-chat';
2
2
 
3
+ import type { FileStateValue } from '../utils/utils';
4
+
3
5
  export type Asset = {
4
- duration: number | null;
5
- filename: string;
6
+ duration: number;
6
7
  height: number;
8
+ name: string;
7
9
  source: 'camera' | 'picker';
8
10
  type: string;
9
11
  uri: string;
10
12
  width: number;
11
- fileSize?: number;
12
13
  id?: string;
13
- size?: number | string;
14
+ size?: number;
14
15
  };
15
16
 
16
- export type FileAssetType = {
17
+ export type File = {
17
18
  name: string;
19
+ duration?: number;
20
+ id?: string;
18
21
  mimeType?: string;
19
- size?: number | string;
22
+ size?: number;
20
23
  // The uri should be of type `string`. But is `string|undefined` because the same type is used for the response from Stream's Attachment. This shall be fixed.
21
24
  uri?: string;
22
25
  };
23
26
 
24
- export type File = FileAssetType & {
25
- duration?: string | null;
26
- id?: string;
27
+ export type FileUpload = {
28
+ file: File;
29
+ id: string;
30
+ state: FileStateValue;
31
+ duration?: number;
32
+ paused?: boolean;
33
+ progress?: number;
34
+ thumb_url?: string;
35
+ url?: string;
36
+ };
37
+
38
+ export type ImageUpload = {
39
+ file: Partial<Asset>;
40
+ id: string;
41
+ state: FileStateValue;
42
+ height?: number;
43
+ url?: string;
44
+ width?: number;
27
45
  };
28
46
 
29
47
  export type DefaultAttachmentType = UnknownType & {
30
- file_size?: number | string;
48
+ file_size?: number;
31
49
  mime_type?: string;
32
50
  originalFile?: File;
51
+ originalImage?: Partial<Asset>;
33
52
  };
34
53
 
35
54
  interface DefaultUserType extends UnknownType {
@@ -10,6 +10,7 @@ import type moment from 'moment';
10
10
 
11
11
  import type { TDateTimeParser } from '../contexts/translationContext/TranslationContext';
12
12
  import enTranslations from '../i18n/en.json';
13
+ import esTranslations from '../i18n/es.json';
13
14
  import frTranslations from '../i18n/fr.json';
14
15
  import heTranslations from '../i18n/he.json';
15
16
  import hiTranslations from '../i18n/hi.json';
@@ -20,7 +21,9 @@ import nlTranslations from '../i18n/nl.json';
20
21
  import ruTranslations from '../i18n/ru.json';
21
22
  import trTranslations from '../i18n/tr.json';
22
23
 
24
+ import 'dayjs/locale/es';
23
25
  import 'dayjs/locale/fr';
26
+ import 'dayjs/locale/he';
24
27
  import 'dayjs/locale/hi';
25
28
  import 'dayjs/locale/it';
26
29
  import 'dayjs/locale/ja';
@@ -28,7 +31,6 @@ import 'dayjs/locale/ko';
28
31
  import 'dayjs/locale/nl';
29
32
  import 'dayjs/locale/ru';
30
33
  import 'dayjs/locale/tr';
31
- import 'dayjs/locale/he';
32
34
 
33
35
  /**
34
36
  * These locale imports also set these locales globally.
@@ -192,12 +194,16 @@ type I18NextConfig = {
192
194
  * Instance of this class should be provided to Chat component to handle translations.
193
195
  * Stream provides following list of in-built translations:
194
196
  * 1. English (en)
195
- * 2. Dutch (nl)
196
- * 3. Russian (ru)
197
- * 4. Turkish (tr)
198
- * 5. French (fr)
197
+ * 2. Spanish (es)
198
+ * 3. French (fr)
199
+ * 4. Hebrew (he)
200
+ * 5. Hindi (hi)
199
201
  * 6. Italian (it)
200
- * 7. Hindi (hi)
202
+ * 7. Japanese (ja)
203
+ * 8. Korean (ko)
204
+ * 9. Dutch (nl)
205
+ * 10. Russian (ru)
206
+ * 11. Turkish (tr)
201
207
  *
202
208
  * Simplest way to start using chat components in one of the in-built languages would be following:
203
209
  *
@@ -370,6 +376,7 @@ export class Streami18n {
370
376
  };
371
377
  } = {
372
378
  en: { [defaultNS]: enTranslations },
379
+ es: { [defaultNS]: esTranslations },
373
380
  fr: { [defaultNS]: frTranslations },
374
381
  he: { [defaultNS]: heTranslations },
375
382
  hi: { [defaultNS]: hiTranslations },
@@ -0,0 +1,32 @@
1
+ import { compressImage } from '../native';
2
+ import type { Asset } from '../types/types';
3
+
4
+ /**
5
+ * Function to compress and Image and return the compressed Image URI
6
+ * @param image
7
+ * @param compressImageQuality
8
+ * @returns string
9
+ */
10
+ export const compressedImageURI = async (image: Partial<Asset>, compressImageQuality?: number) => {
11
+ const uri = image.uri || '';
12
+ /**
13
+ * We skip compression if:
14
+ * - the file is from the camera as that should already be compressed
15
+ * - the file has no height/width value to maintain for compression
16
+ * - the compressImageQuality number is not present or is 1 (meaning no compression)
17
+ */
18
+ const compressedUri = await (image.source === 'camera' ||
19
+ !image.height ||
20
+ !image.width ||
21
+ typeof compressImageQuality !== 'number' ||
22
+ compressImageQuality === 1
23
+ ? uri
24
+ : compressImage({
25
+ compressImageQuality,
26
+ height: image.height,
27
+ uri,
28
+ width: image.width,
29
+ }));
30
+
31
+ return compressedUri;
32
+ };
@@ -1,5 +1,4 @@
1
1
  import type React from 'react';
2
- import { Dimensions } from 'react-native';
3
2
 
4
3
  import type { DebouncedFunc } from 'lodash';
5
4
  import debounce from 'lodash/debounce';
@@ -519,18 +518,6 @@ export const getUrlWithoutParams = (url?: string) => {
519
518
 
520
519
  export const isLocalUrl = (url: string) => url.indexOf('http') !== 0;
521
520
 
522
- export const vw = (percentageWidth: number, rounded = false) => {
523
- const value = Dimensions.get('window').width * (percentageWidth / 100);
524
- return rounded ? Math.round(value) : value;
525
- };
526
-
527
- export const vh = (percentageHeight: number, rounded = false) => {
528
- const height = Dimensions.get('window').height;
529
-
530
- const value = height * (percentageHeight / 100);
531
- return rounded ? Math.round(value) : value;
532
- };
533
-
534
521
  export const generateRandomId = (a = ''): string =>
535
522
  a
536
523
  ? /* eslint-disable no-bitwise */
package/src/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "5.21.0"
2
+ "version": "5.22.0-beta.10"
3
3
  }