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

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 (205) 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 +4 -5
  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/Message/MessageSimple/utils/parseLinks.js +1 -1
  40. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js.map +1 -1
  41. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js +1 -1
  42. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -1
  43. package/lib/commonjs/components/MessageInput/AudioAttachmentUploadPreview.js +538 -0
  44. package/lib/commonjs/components/MessageInput/AudioAttachmentUploadPreview.js.map +1 -0
  45. package/lib/commonjs/components/MessageInput/FileUploadPreview.js +143 -32
  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/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 +4 -5
  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/Message/MessageSimple/utils/parseLinks.js +1 -1
  103. package/lib/module/components/Message/MessageSimple/utils/parseLinks.js.map +1 -1
  104. package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js +1 -1
  105. package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -1
  106. package/lib/module/components/MessageInput/AudioAttachmentUploadPreview.js +538 -0
  107. package/lib/module/components/MessageInput/AudioAttachmentUploadPreview.js.map +1 -0
  108. package/lib/module/components/MessageInput/FileUploadPreview.js +143 -32
  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/{GallaryImage.d.ts → GalleryImage.d.ts} +0 -0
  128. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +1 -1
  129. package/lib/typescript/components/ImageGallery/__tests__/AnimatedVideoGallery.test.d.ts +1 -0
  130. package/lib/typescript/components/ImageGallery/__tests__/ImageGallery.test.d.ts +1 -0
  131. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryFooter.test.d.ts +1 -0
  132. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryGrid.test.d.ts +1 -0
  133. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryGridHandle.test.d.ts +1 -0
  134. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryHeader.test.d.ts +1 -0
  135. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryOverlay.test.d.ts +1 -0
  136. package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryVideoControl.test.d.ts +1 -0
  137. package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts +1 -0
  138. package/lib/typescript/components/ImageGallery/components/AnimatedGalleryVideo.d.ts +2 -3
  139. package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +2 -1
  140. package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +2 -3
  141. package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
  142. package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
  143. package/lib/typescript/components/MessageInput/AudioAttachmentUploadPreview.d.ts +26 -0
  144. package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +1 -1
  145. package/lib/typescript/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.d.ts +1 -0
  146. package/lib/typescript/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.d.ts +1 -0
  147. package/lib/typescript/components/ProgressControl/ProgressControl.d.ts +11 -0
  148. package/lib/typescript/components/index.d.ts +2 -0
  149. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
  150. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +7 -1
  151. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
  152. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +9 -0
  153. package/lib/typescript/native.d.ts +59 -2
  154. package/package.json +1 -1
  155. package/src/components/Attachment/Gallery.tsx +1 -1
  156. package/src/components/Attachment/{GallaryImage.tsx → GalleryImage.tsx} +1 -1
  157. package/src/components/Attachment/Giphy.tsx +1 -1
  158. package/src/components/Attachment/VideoThumbnail.tsx +1 -2
  159. package/src/components/Attachment/__tests__/Gallery.test.js +6 -6
  160. package/src/components/Attachment/__tests__/Giphy.test.js +4 -4
  161. package/src/components/Avatar/Avatar.tsx +1 -1
  162. package/src/components/Avatar/GroupAvatar.tsx +1 -1
  163. package/src/components/Channel/Channel.tsx +3 -0
  164. package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +2 -0
  165. package/src/components/ChannelPreview/ChannelPreview.tsx +14 -12
  166. package/src/components/ImageGallery/ImageGallery.tsx +21 -11
  167. package/src/components/ImageGallery/__tests__/AnimatedVideoGallery.test.tsx +241 -0
  168. package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +192 -0
  169. package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +190 -0
  170. package/src/components/ImageGallery/__tests__/ImageGalleryGrid.test.tsx +98 -0
  171. package/src/components/ImageGallery/__tests__/ImageGalleryGridHandle.test.tsx +79 -0
  172. package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx +172 -0
  173. package/src/components/ImageGallery/__tests__/ImageGalleryOverlay.test.tsx +94 -0
  174. package/src/components/ImageGallery/__tests__/ImageGalleryVideoControl.test.tsx +84 -0
  175. package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +3 -0
  176. package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +11 -3
  177. package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +9 -2
  178. package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +1 -1
  179. package/src/components/ImageGallery/components/ImageGalleryOverlay.tsx +6 -1
  180. package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +22 -9
  181. package/src/components/ImageGallery/components/ImageGrid.tsx +19 -17
  182. package/src/components/ImageGallery/components/ImageGridHandle.tsx +4 -1
  183. package/src/components/Message/Message.tsx +2 -1
  184. package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +9 -3
  185. package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageAvatar.test.js.snap +1 -1
  186. package/src/components/Message/MessageSimple/utils/parseLinks.test.ts +4 -0
  187. package/src/components/Message/MessageSimple/utils/parseLinks.ts +1 -1
  188. package/src/components/MessageInput/AudioAttachmentUploadPreview.tsx +362 -0
  189. package/src/components/MessageInput/FileUploadPreview.tsx +162 -57
  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/Thread/__tests__/__snapshots__/Thread.test.js.snap +4 -4
  195. package/src/components/index.ts +3 -0
  196. package/src/contexts/messageInputContext/MessageInputContext.tsx +13 -0
  197. package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +5 -1
  198. package/src/contexts/themeContext/utils/theme.ts +15 -0
  199. package/src/icons/Pause.tsx +2 -2
  200. package/src/mock-builders/api/channelMocks.tsx +1 -0
  201. package/src/native.ts +67 -7
  202. package/src/version.json +1 -1
  203. package/lib/commonjs/components/ImageGallery/components/ProgressControl.js.map +0 -1
  204. package/lib/module/components/ImageGallery/components/ProgressControl.js.map +0 -1
  205. package/lib/typescript/components/ImageGallery/components/ProgressControl.d.ts +0 -5
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import type { ImageStyle, StyleProp } from 'react-native';
3
3
  import Animated from 'react-native-reanimated';
4
4
  declare type Props = {
5
+ accessibilityLabel: string;
5
6
  index: number;
6
7
  offsetScale: Animated.SharedValue<number>;
7
8
  photo: {
@@ -3,7 +3,7 @@ import { ViewStyle } from 'react-native';
3
3
  import type { StyleProp } from 'react-native';
4
4
  import Animated from 'react-native-reanimated';
5
5
  import { VideoPayloadData, VideoProgressData, VideoType } from '../../../native';
6
- declare type Props = {
6
+ export declare type AnimatedGalleryVideoType = {
7
7
  handleEnd: () => void;
8
8
  handleLoad: (payload: VideoPayloadData) => void;
9
9
  handleProgress: (data: VideoProgressData) => void;
@@ -23,5 +23,4 @@ declare type Props = {
23
23
  videoRef: React.RefObject<VideoType>;
24
24
  style?: StyleProp<ViewStyle>;
25
25
  };
26
- export declare const AnimatedGalleryVideo: React.FC<Props>;
27
- export {};
26
+ export declare const AnimatedGalleryVideo: React.FC<AnimatedGalleryVideoType>;
@@ -10,7 +10,7 @@ export declare type ImageGalleryFooterCustomComponent<StreamChatGenerics extends
10
10
  }) => React.ReactElement | null;
11
11
  export declare type ImageGalleryFooterVideoControlProps = {
12
12
  duration: number;
13
- onPlayPause: () => void;
13
+ onPlayPause: (status?: boolean) => void;
14
14
  onProgressDrag: (progress: number) => void;
15
15
  paused: boolean;
16
16
  progress: number;
@@ -25,6 +25,7 @@ export declare type ImageGalleryFooterCustomComponentProps<StreamChatGenerics ex
25
25
  videoControlElement?: ImageGalleryFooterVideoControlComponent;
26
26
  };
27
27
  declare type ImageGalleryFooterPropsWithContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = ImageGalleryFooterCustomComponentProps<StreamChatGenerics> & {
28
+ accessibilityLabel: string;
28
29
  duration: number;
29
30
  onPlayPause: () => void;
30
31
  onProgressDrag: (progress: number) => void;
@@ -15,7 +15,7 @@ export declare type GridImageItem<StreamChatGenerics extends DefaultStreamChatGe
15
15
  selectAndClose: () => void;
16
16
  numberOfImageGalleryGridColumns?: number;
17
17
  };
18
- declare type Props<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = ImageGalleryGridImageComponents<StreamChatGenerics> & {
18
+ export declare type ImageGridType<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = ImageGalleryGridImageComponents<StreamChatGenerics> & {
19
19
  closeGridView: () => void;
20
20
  photos: Photo<StreamChatGenerics>[];
21
21
  setImage: React.Dispatch<React.SetStateAction<{
@@ -25,7 +25,6 @@ declare type Props<StreamChatGenerics extends DefaultStreamChatGenerics = Defaul
25
25
  numberOfImageGalleryGridColumns?: number;
26
26
  };
27
27
  export declare const ImageGrid: {
28
- <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: Props<StreamChatGenerics>): JSX.Element;
28
+ <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: ImageGridType<StreamChatGenerics>): JSX.Element;
29
29
  displayName: string;
30
30
  };
31
- export {};
@@ -3,7 +3,7 @@ import type { ChatContextValue } from '../../../contexts/chatContext/ChatContext
3
3
  import type { MessageContextValue } from '../../../contexts/messageContext/MessageContext';
4
4
  import type { MessagesContextValue } from '../../../contexts/messagesContext/MessagesContext';
5
5
  import type { DefaultStreamChatGenerics } from '../../../types/types';
6
- export declare const useMessageActionHandlers: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channel, client, enforceUniqueReaction, message, removeMessage, retrySendMessage, setEditingState, setQuotedMessageState, supportedReactions, updateMessage, }: Pick<MessagesContextValue<StreamChatGenerics>, "setQuotedMessageState" | "updateMessage" | "removeMessage" | "retrySendMessage" | "setEditingState" | "supportedReactions"> & Pick<ChannelContextValue<StreamChatGenerics>, "channel" | "enforceUniqueReaction"> & Pick<ChatContextValue<StreamChatGenerics>, "client"> & Pick<MessageContextValue<StreamChatGenerics>, "message">) => {
6
+ export declare const useMessageActionHandlers: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channel, client, enforceUniqueReaction, message, removeMessage, retrySendMessage, setEditingState, setQuotedMessageState, supportedReactions, updateMessage, }: Pick<MessagesContextValue<StreamChatGenerics>, "setQuotedMessageState" | "updateMessage" | "supportedReactions" | "removeMessage" | "retrySendMessage" | "setEditingState"> & Pick<ChannelContextValue<StreamChatGenerics>, "channel" | "enforceUniqueReaction"> & Pick<ChatContextValue<StreamChatGenerics>, "client"> & Pick<MessageContextValue<StreamChatGenerics>, "message">) => {
7
7
  handleDeleteMessage: () => Promise<void>;
8
8
  handleEditMessage: () => void;
9
9
  handleQuotedReplyMessage: () => void;
@@ -8,7 +8,7 @@ import type { TranslationContextValue } from '../../../contexts/translationConte
8
8
  import type { DefaultStreamChatGenerics } from '../../../types/types';
9
9
  import type { MessageType } from '../../MessageList/hooks/useMessageList';
10
10
  import type { MessageActionType } from '../../MessageOverlay/MessageActionListItem';
11
- export declare const useMessageActions: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channel, client, enforceUniqueReaction, handleBlock, handleCopy, handleDelete, handleEdit, handleFlag, handleMute, handlePinMessage, handleQuotedReply, handleReaction: handleReactionProp, handleRetry, handleThreadReply, message, onThreadSelect, openThread, removeMessage, retrySendMessage, selectReaction, setEditingState, setOverlay, setQuotedMessageState, supportedReactions, t, updateMessage, }: Pick<MessagesContextValue<StreamChatGenerics>, "setQuotedMessageState" | "updateMessage" | "removeMessage" | "retrySendMessage" | "setEditingState" | "supportedReactions" | "handleBlock" | "handleCopy" | "handleDelete" | "handleEdit" | "handleFlag" | "handleMute" | "handlePinMessage" | "handleQuotedReply" | "handleReaction" | "handleRetry" | "handleThreadReply" | "selectReaction"> & Pick<ChannelContextValue<StreamChatGenerics>, "channel" | "enforceUniqueReaction"> & Pick<ChatContextValue<StreamChatGenerics>, "client"> & Pick<OverlayContextValue, "setOverlay"> & Pick<ThreadContextValue<StreamChatGenerics>, "openThread"> & Pick<MessageContextValue<StreamChatGenerics>, "message"> & Pick<TranslationContextValue, "t"> & {
11
+ export declare const useMessageActions: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channel, client, enforceUniqueReaction, handleBlock, handleCopy, handleDelete, handleEdit, handleFlag, handleMute, handlePinMessage, handleQuotedReply, handleReaction: handleReactionProp, handleRetry, handleThreadReply, message, onThreadSelect, openThread, removeMessage, retrySendMessage, selectReaction, setEditingState, setOverlay, setQuotedMessageState, supportedReactions, t, updateMessage, }: Pick<MessagesContextValue<StreamChatGenerics>, "setQuotedMessageState" | "updateMessage" | "supportedReactions" | "handleReaction" | "removeMessage" | "retrySendMessage" | "setEditingState" | "handleBlock" | "handleCopy" | "handleDelete" | "handleEdit" | "handleFlag" | "handleMute" | "handlePinMessage" | "handleQuotedReply" | "handleRetry" | "handleThreadReply" | "selectReaction"> & Pick<ChannelContextValue<StreamChatGenerics>, "channel" | "enforceUniqueReaction"> & Pick<ChatContextValue<StreamChatGenerics>, "client"> & Pick<OverlayContextValue, "setOverlay"> & Pick<ThreadContextValue<StreamChatGenerics>, "openThread"> & Pick<MessageContextValue<StreamChatGenerics>, "message"> & Pick<TranslationContextValue, "t"> & {
12
12
  onThreadSelect?: ((message: MessageType<StreamChatGenerics>) => void) | undefined;
13
13
  }) => {
14
14
  blockUser: MessageActionType;
@@ -0,0 +1,26 @@
1
+ import { FileUpload, MessageInputContextValue } from '../../contexts';
2
+ import type { DefaultStreamChatGenerics } from '../../types/types';
3
+ export declare type AudioAttachmentUploadPreviewPropsWithContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<MessageInputContextValue<StreamChatGenerics>, 'fileUploads' | 'removeFile' | 'uploadFile'> & {
4
+ index: number;
5
+ item: FileUpload;
6
+ onLoad: (index: string, duration: number) => void;
7
+ onPlayPause: (index: string, status?: boolean) => void;
8
+ onProgress: (index: string, currentTime?: number, hasEnd?: boolean) => void;
9
+ testID: string;
10
+ };
11
+ export declare type AudioAttachmentUploadPreviewProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Partial<AudioAttachmentUploadPreviewPropsWithContext<StreamChatGenerics>> & {
12
+ index: number;
13
+ item: FileUpload;
14
+ onLoad: (index: string, duration: number) => void;
15
+ onPlayPause: (index: string, status?: boolean) => void;
16
+ onProgress: (index: string, currentTime?: number, hasEnd?: boolean) => void;
17
+ testID: string;
18
+ };
19
+ /**
20
+ * AudioAttachmentUploadPreview
21
+ * UI Component to preview the audio files set for upload
22
+ */
23
+ export declare const AudioAttachmentUploadPreview: {
24
+ <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: AudioAttachmentUploadPreviewProps<StreamChatGenerics>): JSX.Element;
25
+ displayName: string;
26
+ };
@@ -1,7 +1,7 @@
1
1
  import { MessageInputContextValue } from '../../contexts/messageInputContext/MessageInputContext';
2
2
  import { MessagesContextValue } from '../../contexts/messagesContext/MessagesContext';
3
3
  import type { DefaultStreamChatGenerics } from '../../types/types';
4
- declare type FileUploadPreviewPropsWithContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<MessageInputContextValue<StreamChatGenerics>, 'fileUploads' | 'removeFile' | 'uploadFile'> & Pick<MessagesContextValue<StreamChatGenerics>, 'FileAttachmentIcon'>;
4
+ declare type FileUploadPreviewPropsWithContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<MessageInputContextValue<StreamChatGenerics>, 'fileUploads' | 'removeFile' | 'uploadFile' | 'setFileUploads' | 'AudioAttachmentUploadPreview'> & Pick<MessagesContextValue<StreamChatGenerics>, 'FileAttachmentIcon'>;
5
5
  export declare type FileUploadPreviewProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Partial<FileUploadPreviewPropsWithContext<StreamChatGenerics>>;
6
6
  /**
7
7
  * FileUploadPreview
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export declare type ProgressControlProps = {
3
+ duration: number;
4
+ filledColor: string;
5
+ onPlayPause: (status?: boolean) => void;
6
+ onProgressDrag: (progress: number) => void;
7
+ progress: number;
8
+ testID: string;
9
+ width: number;
10
+ };
11
+ export declare const ProgressControl: React.FC<ProgressControlProps>;
@@ -101,6 +101,7 @@ export * from './MessageInput/AttachButton';
101
101
  export * from './MessageInput/CommandsButton';
102
102
  export * from './MessageInput/CooldownTimer';
103
103
  export * from './MessageInput/FileUploadPreview';
104
+ export * from './MessageInput/AudioAttachmentUploadPreview';
104
105
  export * from './MessageInput/ImageUploadPreview';
105
106
  export * from './MessageInput/InputButtons';
106
107
  export * from './MessageInput/MessageInput';
@@ -134,6 +135,7 @@ export * from './MessageOverlay/OverlayBackdrop';
134
135
  export * from './MessageOverlay/OverlayReactions';
135
136
  export * from './MessageOverlay/OverlayReactionsAvatar';
136
137
  export * from './MessageOverlay/OverlayReactionList';
138
+ export * from './ProgressControl/ProgressControl';
137
139
  export * from './Reply/Reply';
138
140
  export * from './Spinner/Spinner';
139
141
  export * from './Thread/Thread';
@@ -100,4 +100,4 @@ export declare const useMessageContext: <StreamChatGenerics extends DefaultStrea
100
100
  * typing is desired while using the HOC withMessageContextContext the Props for the
101
101
  * wrapped component must be provided as the first generic.
102
102
  */
103
- export declare const withMessageContext: <P extends UnknownType, StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(Component: React.ComponentType<P>) => React.FC<Omit<P, "disabled" | "onPress" | "onPressIn" | "onLongPress" | "channel" | "members" | "threadList" | "reactions" | "images" | "message" | "handleAction" | "alignment" | "actionsEnabled" | "files" | "groupStyles" | "handleDeleteMessage" | "handleEditMessage" | "handleQuotedReplyMessage" | "handleResendMessage" | "handleToggleBanUser" | "handleToggleMuteUser" | "handleToggleReaction" | "hasReactions" | "isMyMessage" | "lastGroupMessage" | "messageContentOrder" | "onlyEmojis" | "onOpenThread" | "otherAttachments" | "showMessageOverlay" | "showMessageStatus" | "videos" | "goToMessage" | "lastReceivedId" | "preventPress" | "showAvatar">>;
103
+ export declare const withMessageContext: <P extends UnknownType, StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(Component: React.ComponentType<P>) => React.FC<Omit<P, "disabled" | "onPress" | "onPressIn" | "onLongPress" | "channel" | "members" | "threadList" | "reactions" | "images" | "alignment" | "files" | "groupStyles" | "message" | "onlyEmojis" | "otherAttachments" | "videos" | "isMyMessage" | "actionsEnabled" | "handleAction" | "handleDeleteMessage" | "handleEditMessage" | "handleQuotedReplyMessage" | "handleResendMessage" | "handleToggleBanUser" | "handleToggleMuteUser" | "handleToggleReaction" | "hasReactions" | "lastGroupMessage" | "messageContentOrder" | "onOpenThread" | "showMessageOverlay" | "showMessageStatus" | "goToMessage" | "lastReceivedId" | "preventPress" | "showAvatar">>;
@@ -2,6 +2,7 @@ import React, { PropsWithChildren } from 'react';
2
2
  import type { TextInput, TextInputProps } from 'react-native';
3
3
  import { Attachment, SendFileAPIResponse, StreamChat, Message as StreamMessage, UserFilters, UserOptions, UserResponse, UserSort } from 'stream-chat';
4
4
  import type { AttachButtonProps } from '../../components/MessageInput/AttachButton';
5
+ import type { AudioAttachmentUploadPreviewProps } from '../../components/MessageInput/AudioAttachmentUploadPreview';
5
6
  import type { CommandsButtonProps } from '../../components/MessageInput/CommandsButton';
6
7
  import type { InputEditingStateHeaderProps } from '../../components/MessageInput/components/InputEditingStateHeader';
7
8
  import type { InputGiphySearchProps } from '../../components/MessageInput/components/InputGiphySearch';
@@ -22,6 +23,9 @@ export declare type FileUpload = {
22
23
  file: File;
23
24
  id: string;
24
25
  state: FileStateValue;
26
+ duration?: number;
27
+ paused?: boolean;
28
+ progress?: number;
25
29
  thumb_url?: string;
26
30
  url?: string;
27
31
  };
@@ -172,6 +176,8 @@ export declare type InputMessageInputContextValue<StreamChatGenerics extends Def
172
176
  * Defaults to and accepts same props as: [AttachButton](https://getstream.io/chat/docs/sdk/reactnative/ui-components/attach-button/)
173
177
  */
174
178
  AttachButton: React.ComponentType<AttachButtonProps<StreamChatGenerics>>;
179
+ /** Custom UI component for AudioAttachmentUploadPreview. */
180
+ AudioAttachmentUploadPreview: React.ComponentType<AudioAttachmentUploadPreviewProps<StreamChatGenerics>>;
175
181
  clearEditingState: () => void;
176
182
  clearQuotedMessageState: () => void;
177
183
  /**
@@ -341,4 +347,4 @@ export declare const useMessageInputContext: <StreamChatGenerics extends Default
341
347
  * typing is desired while using the HOC withMessageInputContext the Props for the
342
348
  * wrapped component must be provided as the first generic.
343
349
  */
344
- export declare const withMessageInputContext: <P extends UnknownType, StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(Component: React.ComponentType<P>) => React.FC<Omit<P, "AttachButton" | "clearEditingState" | "clearQuotedMessageState" | "CommandsButton" | "CooldownTimer" | "editing" | "editMessage" | "FileUploadPreview" | "hasCommands" | "hasFilePicker" | "hasImagePicker" | "ImageUploadPreview" | "InputEditingStateHeader" | "InputGiphySearch" | "InputReplyStateHeader" | "maxNumberOfFiles" | "MoreOptionsButton" | "numberOfLines" | "quotedMessage" | "SendButton" | "sendImageAsync" | "setQuotedMessageState" | "ShowThreadMessageInChannelButton" | "UploadProgressIndicator" | "additionalTextInputProps" | "autoCompleteSuggestionsLimit" | "autoCompleteTriggerSettings" | "compressImageQuality" | "doDocUploadRequest" | "doImageUploadRequest" | "initialValue" | "Input" | "InputButtons" | "maxMessageLength" | "mentionAllAppUsersEnabled" | "mentionAllAppUsersQuery" | "onChangeText" | "SendMessageDisallowedIndicator" | "setInputRef" | keyof LocalMessageInputContext<StreamChatGenerics>>>;
350
+ export declare const withMessageInputContext: <P extends UnknownType, StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(Component: React.ComponentType<P>) => React.FC<Omit<P, "AttachButton" | "AudioAttachmentUploadPreview" | "clearEditingState" | "clearQuotedMessageState" | "CommandsButton" | "CooldownTimer" | "editing" | "editMessage" | "FileUploadPreview" | "hasCommands" | "hasFilePicker" | "hasImagePicker" | "ImageUploadPreview" | "InputEditingStateHeader" | "InputGiphySearch" | "InputReplyStateHeader" | "maxNumberOfFiles" | "MoreOptionsButton" | "numberOfLines" | "quotedMessage" | "SendButton" | "sendImageAsync" | "setQuotedMessageState" | "ShowThreadMessageInChannelButton" | "UploadProgressIndicator" | "additionalTextInputProps" | "autoCompleteSuggestionsLimit" | "autoCompleteTriggerSettings" | "compressImageQuality" | "doDocUploadRequest" | "doImageUploadRequest" | "initialValue" | "Input" | "InputButtons" | "maxMessageLength" | "mentionAllAppUsersEnabled" | "mentionAllAppUsersQuery" | "onChangeText" | "SendMessageDisallowedIndicator" | "setInputRef" | keyof LocalMessageInputContext<StreamChatGenerics>>>;
@@ -1,4 +1,4 @@
1
1
  import type { DefaultStreamChatGenerics } from '../../../types/types';
2
2
  import type { ThreadContextValue } from '../../threadContext/ThreadContext';
3
3
  import type { MessageInputContextValue } from '../MessageInputContext';
4
- export declare const useCreateMessageInputContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ additionalTextInputProps, appendText, asyncIds, asyncUploads, AttachButton, autoCompleteSuggestionsLimit, clearEditingState, clearQuotedMessageState, closeAttachmentPicker, CommandsButton, compressImageQuality, cooldownEndsAt, CooldownTimer, doDocUploadRequest, doImageUploadRequest, editing, editMessage, FileUploadPreview, fileUploads, giphyActive, hasCommands, hasFilePicker, hasImagePicker, ImageUploadPreview, imageUploads, initialValue, Input, inputBoxRef, InputButtons, InputEditingStateHeader, InputGiphySearch, InputReplyStateHeader, isValidMessage, maxMessageLength, maxNumberOfFiles, mentionAllAppUsersEnabled, mentionAllAppUsersQuery, mentionedUsers, MoreOptionsButton, numberOfLines, numberOfUploads, onChange, onChangeText, onSelectItem, openAttachmentPicker, openCommandsPicker, openFilePicker, openMentionsPicker, pickFile, quotedMessage, removeFile, removeImage, resetInput, selectedPicker, SendButton, sendImageAsync, sending, sendMessage, sendMessageAsync, SendMessageDisallowedIndicator, sendThreadMessageInChannel, setAsyncIds, setAsyncUploads, setFileUploads, setGiphyActive, setImageUploads, setInputBoxRef, setInputRef, setMentionedUsers, setNumberOfUploads, setQuotedMessageState, setSendThreadMessageInChannel, setShowMoreOptions, setText, showMoreOptions, ShowThreadMessageInChannelButton, text, thread, toggleAttachmentPicker, triggerSettings, updateMessage, uploadFile, uploadImage, uploadNewFile, uploadNewImage, UploadProgressIndicator, }: import("../MessageInputContext").LocalMessageInputContext<StreamChatGenerics> & Omit<import("../MessageInputContext").InputMessageInputContextValue<StreamChatGenerics>, "sendMessage"> & Pick<ThreadContextValue<StreamChatGenerics>, "thread">) => MessageInputContextValue<StreamChatGenerics>;
4
+ export declare const useCreateMessageInputContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ additionalTextInputProps, appendText, asyncIds, asyncUploads, AttachButton, AudioAttachmentUploadPreview, autoCompleteSuggestionsLimit, clearEditingState, clearQuotedMessageState, closeAttachmentPicker, CommandsButton, compressImageQuality, cooldownEndsAt, CooldownTimer, doDocUploadRequest, doImageUploadRequest, editing, editMessage, FileUploadPreview, fileUploads, giphyActive, hasCommands, hasFilePicker, hasImagePicker, ImageUploadPreview, imageUploads, initialValue, Input, inputBoxRef, InputButtons, InputEditingStateHeader, InputGiphySearch, InputReplyStateHeader, isValidMessage, maxMessageLength, maxNumberOfFiles, mentionAllAppUsersEnabled, mentionAllAppUsersQuery, mentionedUsers, MoreOptionsButton, numberOfLines, numberOfUploads, onChange, onChangeText, onSelectItem, openAttachmentPicker, openCommandsPicker, openFilePicker, openMentionsPicker, pickFile, quotedMessage, removeFile, removeImage, resetInput, selectedPicker, SendButton, sendImageAsync, sending, sendMessage, sendMessageAsync, SendMessageDisallowedIndicator, sendThreadMessageInChannel, setAsyncIds, setAsyncUploads, setFileUploads, setGiphyActive, setImageUploads, setInputBoxRef, setInputRef, setMentionedUsers, setNumberOfUploads, setQuotedMessageState, setSendThreadMessageInChannel, setShowMoreOptions, setText, showMoreOptions, ShowThreadMessageInChannelButton, text, thread, toggleAttachmentPicker, triggerSettings, updateMessage, uploadFile, uploadImage, uploadNewFile, uploadNewImage, UploadProgressIndicator, }: import("../MessageInputContext").LocalMessageInputContext<StreamChatGenerics> & Omit<import("../MessageInputContext").InputMessageInputContextValue<StreamChatGenerics>, "sendMessage"> & Pick<ThreadContextValue<StreamChatGenerics>, "thread">) => MessageInputContextValue<StreamChatGenerics>;
@@ -17,9 +17,12 @@ export declare const Colors: {
17
17
  grey_whisper: string;
18
18
  icon_background: string;
19
19
  label_bg_transparent: string;
20
+ light_gray: string;
20
21
  modal_shadow: string;
21
22
  overlay: string;
22
23
  shadow_icon: string;
24
+ static_black: string;
25
+ static_white: string;
23
26
  targetedMessageBackground: string;
24
27
  transparent: string;
25
28
  white: string;
@@ -240,6 +243,12 @@ export declare type Theme = {
240
243
  editingBoxHeaderTitle: TextStyle;
241
244
  };
242
245
  fileUploadPreview: {
246
+ audioAttachmentFileContainer: ViewStyle;
247
+ audioAttachmentUploadPreview: {
248
+ progressControlView: ViewStyle;
249
+ progressDurationText: TextStyle;
250
+ roundedView: ViewStyle;
251
+ };
243
252
  dismiss: ViewStyle;
244
253
  fileContainer: ViewStyle;
245
254
  fileContentContainer: ViewStyle;
@@ -64,7 +64,6 @@ export declare let takePhoto: TakePhoto;
64
64
  declare type HapticFeedbackMethod = 'impactHeavy' | 'impactLight' | 'impactMedium' | 'notificationError' | 'notificationSuccess' | 'notificationWarning' | 'selection';
65
65
  declare type TriggerHaptic = (method: HapticFeedbackMethod) => void | never;
66
66
  export declare let triggerHaptic: TriggerHaptic;
67
- export declare let SDK: string;
68
67
  export declare type PlaybackStatus = {
69
68
  didJustFinish: boolean;
70
69
  durationMillis: number;
@@ -75,12 +74,68 @@ export declare type PlaybackStatus = {
75
74
  isPlaying: boolean;
76
75
  positionMillis: number;
77
76
  };
77
+ export declare type AVPlaybackStatusToSet = {
78
+ isLooping: boolean;
79
+ isMuted: boolean;
80
+ positionMillis: number;
81
+ progressUpdateIntervalMillis: number;
82
+ rate: number;
83
+ shouldCorrectPitch: boolean;
84
+ shouldPlay: boolean;
85
+ volume: number;
86
+ };
87
+ export declare let SDK: string;
88
+ export declare type SoundOptions = {
89
+ basePathOrCallback?: string;
90
+ callback?: () => void;
91
+ filenameOrFile?: string;
92
+ initialStatus?: Partial<AVPlaybackStatusToSet>;
93
+ onPlaybackStatusUpdate?: (playbackStatus: PlaybackStatus) => void;
94
+ source?: {
95
+ uri: string;
96
+ };
97
+ };
98
+ export declare type SoundReturnType = {
99
+ paused: boolean;
100
+ testID: string;
101
+ getDuration?: () => number;
102
+ isPlaying?: () => boolean;
103
+ onBuffer?: (props: {
104
+ isBuffering: boolean;
105
+ }) => void;
106
+ onEnd?: () => void;
107
+ onLoad?: (payload: VideoPayloadData) => void;
108
+ onLoadStart?: () => void;
109
+ onPlaybackStatusUpdate?: (playbackStatus: PlaybackStatus) => void;
110
+ onProgress?: (data: VideoProgressData) => void;
111
+ onReadyForDisplay?: () => void;
112
+ pauseAsync?: () => void;
113
+ play?: () => void;
114
+ playAsync?: () => void;
115
+ replayAsync?: () => void;
116
+ resizeMode?: string;
117
+ seek?: (progress: number) => void;
118
+ setPositionAsync?: (millis: number) => void;
119
+ soundRef?: React.RefObject<SoundReturnType>;
120
+ stopAsync?: () => void;
121
+ style?: StyleProp<ViewStyle>;
122
+ unloadAsync?: () => void;
123
+ uri?: string;
124
+ };
125
+ export declare type SoundType = {
126
+ initializeSound: (source?: {
127
+ uri: string;
128
+ }, initialStatus?: Partial<AVPlaybackStatusToSet>, onPlaybackStatusUpdate?: (playbackStatus: PlaybackStatus) => void) => SoundReturnType | null;
129
+ Player: React.ComponentType<SoundReturnType> | null;
130
+ };
131
+ export declare let Sound: SoundType;
78
132
  export declare type VideoProgressData = {
79
133
  currentTime?: number;
80
134
  playableDuration?: number;
81
135
  seekableDuration?: number;
82
136
  };
83
137
  export declare type VideoPayloadData = {
138
+ duration: number;
84
139
  audioTracks?: {
85
140
  index: number;
86
141
  language: string;
@@ -88,7 +143,6 @@ export declare type VideoPayloadData = {
88
143
  type: string;
89
144
  }[];
90
145
  currentPosition?: number;
91
- duration?: number;
92
146
  naturalSize?: {
93
147
  height: number;
94
148
  orientation: 'portrait' | 'landscape';
@@ -110,6 +164,7 @@ export declare type VideoPayloadData = {
110
164
  };
111
165
  export declare type VideoType = {
112
166
  paused: boolean;
167
+ testID: string;
113
168
  uri: string;
114
169
  videoRef: React.RefObject<VideoType>;
115
170
  onBuffer?: (props: {
@@ -139,10 +194,12 @@ declare type Handlers = {
139
194
  saveFile?: SaveFile;
140
195
  SDK?: string;
141
196
  shareImage?: ShareImage;
197
+ Sound?: SoundType;
142
198
  takePhoto?: TakePhoto;
143
199
  triggerHaptic?: TriggerHaptic;
144
200
  Video?: React.ComponentType<VideoType>;
145
201
  };
146
202
  export declare const registerNativeHandlers: (handlers: Handlers) => void;
147
203
  export declare const isVideoPackageAvailable: () => boolean;
204
+ export declare const isAudioPackageAvailable: () => true;
148
205
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stream-chat-react-native-core",
3
3
  "description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
4
- "version": "4.11.1-beta.3",
4
+ "version": "4.12.0-beta.2",
5
5
  "author": {
6
6
  "company": "Stream.io Inc",
7
7
  "name": "Stream.io Inc"
@@ -3,7 +3,7 @@ import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
3
3
 
4
4
  import type { Attachment } from 'stream-chat';
5
5
 
6
- import { GalleryImage } from './GallaryImage';
6
+ import { GalleryImage } from './GalleryImage';
7
7
  import { useLoadingImage } from './hooks/useLoadingImage';
8
8
  import { buildGallery } from './utils/buildGallery/buildGallery';
9
9
 
@@ -13,7 +13,7 @@ export const GalleryImage: React.FC<
13
13
  return (
14
14
  <ImageBackground
15
15
  {...rest}
16
- accessibilityLabel='gallery-image'
16
+ accessibilityLabel='Gallery Image'
17
17
  source={{
18
18
  uri: makeImageCompatibleUrl(uri),
19
19
  }}
@@ -341,7 +341,7 @@ const GiphyWithContext = <
341
341
  ]}
342
342
  >
343
343
  <Image
344
- accessibilityLabel='giphy-attachment-image'
344
+ accessibilityLabel='Giphy Attachment Image'
345
345
  onError={(error) => {
346
346
  console.warn(error);
347
347
  setLoadingImage(false);
@@ -15,7 +15,6 @@ const styles = StyleSheet.create({
15
15
  },
16
16
  roundedView: {
17
17
  alignItems: 'center',
18
- backgroundColor: '#fff',
19
18
  borderRadius: 50,
20
19
  display: 'flex',
21
20
  elevation: 6,
@@ -49,7 +48,7 @@ export const VideoThumbnail: React.FC<VideoThumbnailProps> = (props) => {
49
48
  const { imageStyle, style, thumb_url } = props;
50
49
  return (
51
50
  <ImageBackground
52
- accessibilityLabel='video-thumbnail'
51
+ accessibilityLabel='Video Thumbnail'
53
52
  imageStyle={imageStyle}
54
53
  source={{ uri: thumb_url }}
55
54
  style={[styles.container, container, style]}
@@ -93,7 +93,7 @@ describe('Gallery', () => {
93
93
  expect(queryAllByTestId('gallery-row-0').length).toBe(1);
94
94
 
95
95
  expect(queryAllByTestId('gallery-row-0-item-0').length).toBe(1);
96
- expect(getAllByA11yLabel('video-thumbnail').length).toBe(1);
96
+ expect(getAllByA11yLabel('Video Thumbnail').length).toBe(1);
97
97
  });
98
98
  });
99
99
 
@@ -267,7 +267,7 @@ describe('Gallery', () => {
267
267
  const component = await getComponent([image1]);
268
268
  const { getByA11yLabel, getByAccessibilityHint } = render(component);
269
269
 
270
- fireEvent(getByA11yLabel('gallery-image'), 'error');
270
+ fireEvent(getByA11yLabel('Gallery Image'), 'error');
271
271
  expect(getByAccessibilityHint('image-loading-error')).toBeTruthy();
272
272
  });
273
273
 
@@ -280,11 +280,11 @@ describe('Gallery', () => {
280
280
  const component = await getComponent([image1]);
281
281
  const { getByA11yLabel, getByAccessibilityHint } = render(component);
282
282
 
283
- fireEvent(getByA11yLabel('gallery-image'), 'onLoadStart');
283
+ fireEvent(getByA11yLabel('Gallery Image'), 'onLoadStart');
284
284
  expect(getByAccessibilityHint('image-loading')).toBeTruthy();
285
285
 
286
- fireEvent(getByA11yLabel('gallery-image'), 'onLoadFinish');
287
- waitForElementToBeRemoved(() => getByAccessibilityHint('image-loading'));
288
- expect(getByA11yLabel('gallery-image')).toBeTruthy();
286
+ fireEvent(getByA11yLabel('Gallery Image'), 'onLoadFinish');
287
+ waitForElementToBeRemoved(() => getByAccessibilityHint('Image Loading'));
288
+ expect(getByA11yLabel('Gallery Image')).toBeTruthy();
289
289
  });
290
290
  });
@@ -285,7 +285,7 @@ describe('Giphy', () => {
285
285
  </OverlayProvider>,
286
286
  );
287
287
 
288
- fireEvent(getByA11yLabel('giphy-attachment-image'), 'error');
288
+ fireEvent(getByA11yLabel('Giphy Attachment Image'), 'error');
289
289
  expect(getByAccessibilityHint('image-loading-error')).toBeTruthy();
290
290
  });
291
291
 
@@ -302,13 +302,13 @@ describe('Giphy', () => {
302
302
 
303
303
  expect(getByAccessibilityHint('image-loading')).toBeTruthy();
304
304
 
305
- fireEvent(getByA11yLabel('giphy-attachment-image'), 'onLoadStart');
305
+ fireEvent(getByA11yLabel('Giphy Attachment Image'), 'onLoadStart');
306
306
 
307
307
  expect(getByAccessibilityHint('image-loading')).toBeTruthy();
308
308
 
309
- fireEvent(getByA11yLabel('giphy-attachment-image'), 'onLoadFinish');
309
+ fireEvent(getByA11yLabel('Giphy Attachment Image'), 'onLoadFinish');
310
310
 
311
311
  waitForElementToBeRemoved(() => getByAccessibilityHint('image-loading'));
312
- expect(getByA11yLabel('giphy-attachment-image')).toBeTruthy();
312
+ expect(getByA11yLabel('Giphy Attachment Image')).toBeTruthy();
313
313
  });
314
314
  });
@@ -85,7 +85,7 @@ export const Avatar: React.FC<AvatarProps> = (props) => {
85
85
  ]}
86
86
  >
87
87
  <Image
88
- accessibilityLabel={testID || 'avatar-image'}
88
+ accessibilityLabel={testID || 'Avatar Image'}
89
89
  onError={() => setImageError(true)}
90
90
  source={{
91
91
  uri:
@@ -127,7 +127,7 @@ export const GroupAvatar: React.FC<GroupAvatarProps> = (props) => {
127
127
  >
128
128
  {column.map(({ height, name, url, width }, rowIndex) => (
129
129
  <Image
130
- accessibilityLabel={testID || 'avatar-image'}
130
+ accessibilityLabel={testID || 'Avatar Image'}
131
131
  key={`avatar-${url}-${rowIndex}`}
132
132
  onError={() => setImageError(true)}
133
133
  source={{
@@ -107,6 +107,7 @@ import { MessageSimple as MessageSimpleDefault } from '../Message/MessageSimple/
107
107
  import { MessageStatus as MessageStatusDefault } from '../Message/MessageSimple/MessageStatus';
108
108
  import { ReactionList as ReactionListDefault } from '../Message/MessageSimple/ReactionList';
109
109
  import { AttachButton as AttachButtonDefault } from '../MessageInput/AttachButton';
110
+ import { AudioAttachmentUploadPreview as AudioAttachmentUploadPreviewDefault } from '../MessageInput/AudioAttachmentUploadPreview';
110
111
  import { CommandsButton as CommandsButtonDefault } from '../MessageInput/CommandsButton';
111
112
  import { InputEditingStateHeader as InputEditingStateHeaderDefault } from '../MessageInput/components/InputEditingStateHeader';
112
113
  import { InputGiphySearch as InputGiphyCommandInputDefault } from '../MessageInput/components/InputGiphySearch';
@@ -398,6 +399,7 @@ const ChannelWithContext = <
398
399
  AttachButton = AttachButtonDefault,
399
400
  Attachment = AttachmentDefault,
400
401
  AttachmentActions = AttachmentActionsDefault,
402
+ AudioAttachmentUploadPreview = AudioAttachmentUploadPreviewDefault,
401
403
  AutoCompleteSuggestionHeader = AutoCompleteSuggestionHeaderDefault,
402
404
  AutoCompleteSuggestionItem = AutoCompleteSuggestionItemDefault,
403
405
  AutoCompleteSuggestionList = AutoCompleteSuggestionListDefault,
@@ -1618,6 +1620,7 @@ const ChannelWithContext = <
1618
1620
  const inputMessageInputContext = useCreateInputMessageInputContext<StreamChatGenerics>({
1619
1621
  additionalTextInputProps,
1620
1622
  AttachButton,
1623
+ AudioAttachmentUploadPreview,
1621
1624
  autoCompleteSuggestionsLimit,
1622
1625
  autoCompleteTriggerSettings,
1623
1626
  channelId,
@@ -8,6 +8,7 @@ export const useCreateInputMessageInputContext = <
8
8
  >({
9
9
  additionalTextInputProps,
10
10
  AttachButton,
11
+ AudioAttachmentUploadPreview,
11
12
  autoCompleteSuggestionsLimit,
12
13
  autoCompleteTriggerSettings,
13
14
  channelId,
@@ -64,6 +65,7 @@ export const useCreateInputMessageInputContext = <
64
65
  () => ({
65
66
  additionalTextInputProps,
66
67
  AttachButton,
68
+ AudioAttachmentUploadPreview,
67
69
  autoCompleteSuggestionsLimit,
68
70
  autoCompleteTriggerSettings,
69
71
  clearEditingState,
@@ -69,25 +69,27 @@ const ChannelPreviewWithContext = <
69
69
  }, [channelLastMessageString]);
70
70
 
71
71
  useEffect(() => {
72
- const handleEvent = (event: Event<StreamChatGenerics>) => {
73
- if (event.message) {
72
+ const handleNewMessageEvent = (event: Event<StreamChatGenerics>) => {
73
+ const message = event.message;
74
+ if (message && (!message.parent_id || message.show_in_channel)) {
74
75
  setLastMessage(event.message);
76
+ setUnread(channel.countUnread());
75
77
  }
78
+ };
76
79
 
77
- if (event.type === 'message.new') {
78
- setUnread(channel.countUnread());
80
+ const handleUpdatedOrDeletedMessage = (event: Event<StreamChatGenerics>) => {
81
+ if (event.message?.id === lastMessage?.id) {
82
+ setLastMessage(event.message);
79
83
  }
80
84
  };
81
85
 
82
- channel.on('message.new', handleEvent);
83
- channel.on('message.updated', handleEvent);
84
- channel.on('message.deleted', handleEvent);
86
+ const listeners = [
87
+ channel.on('message.new', handleNewMessageEvent),
88
+ channel.on('message.updated', handleUpdatedOrDeletedMessage),
89
+ channel.on('message.deleted', handleUpdatedOrDeletedMessage),
90
+ ];
85
91
 
86
- return () => {
87
- channel.off('message.new', handleEvent);
88
- channel.off('message.updated', handleEvent);
89
- channel.off('message.deleted', handleEvent);
90
- };
92
+ return () => listeners.forEach((l) => l.unsubscribe());
91
93
  }, []);
92
94
 
93
95
  useEffect(() => {