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.
- package/lib/commonjs/components/Attachment/Gallery.js +2 -2
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/{GallaryImage.js → GalleryImage.js} +3 -3
- package/lib/{module/components/Attachment/GallaryImage.js.map → commonjs/components/Attachment/GalleryImage.js.map} +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
- package/lib/commonjs/components/Attachment/VideoThumbnail.js +19 -18
- package/lib/commonjs/components/Attachment/VideoThumbnail.js.map +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +18 -13
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -0
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +17 -12
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +37 -30
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +5 -3
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +10 -6
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +17 -14
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +1 -0
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js +2 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +36 -18
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +3 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +5 -4
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +8 -6
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/MessageInput/AudioAttachmentUploadPreview.js +538 -0
- package/lib/commonjs/components/MessageInput/AudioAttachmentUploadPreview.js.map +1 -0
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +147 -34
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +4 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/{module/components/ImageGallery/components → commonjs/components/ProgressControl}/ProgressControl.js +37 -24
- package/lib/commonjs/components/ProgressControl/ProgressControl.js.map +1 -0
- package/lib/commonjs/components/Reply/Reply.js +21 -13
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/index.js +26 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +5 -2
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +7 -2
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +14 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/icons/Pause.js +2 -2
- package/lib/commonjs/icons/Pause.js.map +1 -1
- package/lib/commonjs/mock-builders/api/channelMocks.js +1 -0
- package/lib/commonjs/mock-builders/api/channelMocks.js.map +1 -1
- package/lib/commonjs/native.js +13 -5
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Gallery.js +2 -2
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/{GallaryImage.js → GalleryImage.js} +3 -3
- package/lib/{commonjs/components/Attachment/GallaryImage.js.map → module/components/Attachment/GalleryImage.js.map} +1 -1
- package/lib/module/components/Attachment/Giphy.js +1 -1
- package/lib/module/components/Attachment/Giphy.js.map +1 -1
- package/lib/module/components/Attachment/VideoThumbnail.js +19 -18
- package/lib/module/components/Attachment/VideoThumbnail.js.map +1 -1
- package/lib/module/components/Avatar/Avatar.js +1 -1
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +18 -13
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -0
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +17 -12
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +37 -30
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +5 -3
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +10 -6
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +17 -14
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +1 -0
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js +2 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +36 -18
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +3 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js +5 -4
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
- package/lib/module/components/Message/Message.js +8 -6
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/MessageInput/AudioAttachmentUploadPreview.js +538 -0
- package/lib/module/components/MessageInput/AudioAttachmentUploadPreview.js.map +1 -0
- package/lib/module/components/MessageInput/FileUploadPreview.js +147 -34
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +4 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/{commonjs/components/ImageGallery/components → module/components/ProgressControl}/ProgressControl.js +37 -24
- package/lib/module/components/ProgressControl/ProgressControl.js.map +1 -0
- package/lib/module/components/Reply/Reply.js +21 -13
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/index.js +26 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +5 -2
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +7 -2
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +14 -1
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/icons/Pause.js +2 -2
- package/lib/module/icons/Pause.js.map +1 -1
- package/lib/module/mock-builders/api/channelMocks.js +1 -0
- package/lib/module/mock-builders/api/channelMocks.js.map +1 -1
- package/lib/module/native.js +13 -5
- package/lib/module/native.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/{GallaryImage.d.ts → GalleryImage.d.ts} +0 -0
- package/lib/typescript/components/Attachment/VideoThumbnail.d.ts +4 -2
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/__tests__/AnimatedVideoGallery.test.d.ts +1 -0
- package/lib/typescript/components/ImageGallery/__tests__/ImageGallery.test.d.ts +1 -0
- package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryFooter.test.d.ts +1 -0
- package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryGrid.test.d.ts +1 -0
- package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryGridHandle.test.d.ts +1 -0
- package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryHeader.test.d.ts +1 -0
- package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryOverlay.test.d.ts +1 -0
- package/lib/typescript/components/ImageGallery/__tests__/ImageGalleryVideoControl.test.d.ts +1 -0
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts +1 -0
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryVideo.d.ts +2 -3
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +2 -1
- package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +2 -3
- package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
- package/lib/typescript/components/MessageInput/AudioAttachmentUploadPreview.d.ts +26 -0
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +1 -1
- package/lib/typescript/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.d.ts +1 -0
- package/lib/typescript/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.d.ts +1 -0
- package/lib/typescript/components/ProgressControl/ProgressControl.d.ts +11 -0
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +7 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +13 -0
- package/lib/typescript/native.d.ts +59 -2
- package/package.json +1 -1
- package/src/components/Attachment/Gallery.tsx +1 -1
- package/src/components/Attachment/{GallaryImage.tsx → GalleryImage.tsx} +1 -1
- package/src/components/Attachment/Giphy.tsx +1 -1
- package/src/components/Attachment/VideoThumbnail.tsx +15 -6
- package/src/components/Attachment/__tests__/Gallery.test.js +6 -6
- package/src/components/Attachment/__tests__/Giphy.test.js +4 -4
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Avatar/GroupAvatar.tsx +1 -1
- package/src/components/Channel/Channel.tsx +3 -0
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +2 -0
- package/src/components/ChannelPreview/ChannelPreview.tsx +14 -12
- package/src/components/ImageGallery/ImageGallery.tsx +21 -11
- package/src/components/ImageGallery/__tests__/AnimatedVideoGallery.test.tsx +241 -0
- package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +192 -0
- package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +190 -0
- package/src/components/ImageGallery/__tests__/ImageGalleryGrid.test.tsx +98 -0
- package/src/components/ImageGallery/__tests__/ImageGalleryGridHandle.test.tsx +79 -0
- package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx +172 -0
- package/src/components/ImageGallery/__tests__/ImageGalleryOverlay.test.tsx +94 -0
- package/src/components/ImageGallery/__tests__/ImageGalleryVideoControl.test.tsx +84 -0
- package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +3 -0
- package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +11 -3
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +9 -2
- package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +1 -1
- package/src/components/ImageGallery/components/ImageGalleryOverlay.tsx +6 -1
- package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +22 -9
- package/src/components/ImageGallery/components/ImageGrid.tsx +19 -17
- package/src/components/ImageGallery/components/ImageGridHandle.tsx +4 -1
- package/src/components/Message/Message.tsx +2 -1
- package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +9 -3
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageAvatar.test.js.snap +1 -1
- package/src/components/MessageInput/AudioAttachmentUploadPreview.tsx +362 -0
- package/src/components/MessageInput/FileUploadPreview.tsx +165 -60
- package/src/components/MessageInput/ImageUploadPreview.tsx +2 -2
- package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.tsx +199 -0
- package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.tsx +215 -0
- package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +64 -0
- package/src/components/{ImageGallery/components → ProgressControl}/ProgressControl.tsx +37 -19
- package/src/components/Reply/Reply.tsx +14 -2
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +4 -4
- package/src/components/index.ts +3 -0
- package/src/contexts/messageInputContext/MessageInputContext.tsx +13 -0
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +5 -1
- package/src/contexts/themeContext/utils/theme.ts +23 -0
- package/src/icons/Pause.tsx +2 -2
- package/src/mock-builders/api/channelMocks.tsx +1 -0
- package/src/native.ts +67 -7
- package/src/version.json +1 -1
- package/lib/commonjs/components/ImageGallery/components/ProgressControl.js.map +0 -1
- package/lib/module/components/ImageGallery/components/ProgressControl.js.map +0 -1
- package/lib/typescript/components/ImageGallery/components/ProgressControl.d.ts +0 -5
|
@@ -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
|
package/lib/typescript/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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" | "
|
|
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;
|
|
@@ -525,6 +534,10 @@ export declare type Theme = {
|
|
|
525
534
|
markdownStyles: MarkdownStyle;
|
|
526
535
|
messageContainer: ViewStyle;
|
|
527
536
|
textContainer: ViewStyle;
|
|
537
|
+
videoThumbnail: {
|
|
538
|
+
container: ViewStyle;
|
|
539
|
+
image: ImageStyle;
|
|
540
|
+
};
|
|
528
541
|
};
|
|
529
542
|
screenPadding: number;
|
|
530
543
|
spinner: 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.
|
|
4
|
+
"version": "4.12.0-beta.1",
|
|
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 './
|
|
6
|
+
import { GalleryImage } from './GalleryImage';
|
|
7
7
|
import { useLoadingImage } from './hooks/useLoadingImage';
|
|
8
8
|
import { buildGallery } from './utils/buildGallery/buildGallery';
|
|
9
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ImageBackground, StyleSheet, View,
|
|
2
|
+
import { ImageBackground, ImageStyle, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
5
5
|
import { Play } from '../../icons';
|
|
@@ -15,16 +15,25 @@ const styles = StyleSheet.create({
|
|
|
15
15
|
},
|
|
16
16
|
roundedView: {
|
|
17
17
|
alignItems: 'center',
|
|
18
|
-
backgroundColor: '#fff',
|
|
19
18
|
borderRadius: 50,
|
|
20
19
|
display: 'flex',
|
|
20
|
+
elevation: 6,
|
|
21
21
|
height: 36,
|
|
22
22
|
justifyContent: 'center',
|
|
23
|
+
shadowColor: '#000',
|
|
24
|
+
shadowOffset: {
|
|
25
|
+
height: 3,
|
|
26
|
+
width: 0,
|
|
27
|
+
},
|
|
28
|
+
shadowOpacity: 0.27,
|
|
29
|
+
shadowRadius: 4.65,
|
|
23
30
|
width: 36,
|
|
24
31
|
},
|
|
25
32
|
});
|
|
26
33
|
|
|
27
|
-
export type VideoThumbnailProps =
|
|
34
|
+
export type VideoThumbnailProps = {
|
|
35
|
+
imageStyle?: StyleProp<ImageStyle>;
|
|
36
|
+
style?: StyleProp<ViewStyle>;
|
|
28
37
|
thumb_url?: string;
|
|
29
38
|
};
|
|
30
39
|
|
|
@@ -36,12 +45,12 @@ export const VideoThumbnail: React.FC<VideoThumbnailProps> = (props) => {
|
|
|
36
45
|
},
|
|
37
46
|
},
|
|
38
47
|
} = useTheme();
|
|
39
|
-
const { style, thumb_url
|
|
48
|
+
const { imageStyle, style, thumb_url } = props;
|
|
40
49
|
return (
|
|
41
50
|
<ImageBackground
|
|
42
|
-
accessibilityLabel='
|
|
51
|
+
accessibilityLabel='Video Thumbnail'
|
|
52
|
+
imageStyle={imageStyle}
|
|
43
53
|
source={{ uri: thumb_url }}
|
|
44
|
-
{...rest}
|
|
45
54
|
style={[styles.container, container, style]}
|
|
46
55
|
>
|
|
47
56
|
<View style={[styles.roundedView, roundedView]}>
|
|
@@ -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('
|
|
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('
|
|
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('
|
|
283
|
+
fireEvent(getByA11yLabel('Gallery Image'), 'onLoadStart');
|
|
284
284
|
expect(getByAccessibilityHint('image-loading')).toBeTruthy();
|
|
285
285
|
|
|
286
|
-
fireEvent(getByA11yLabel('
|
|
287
|
-
waitForElementToBeRemoved(() => getByAccessibilityHint('
|
|
288
|
-
expect(getByA11yLabel('
|
|
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('
|
|
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('
|
|
305
|
+
fireEvent(getByA11yLabel('Giphy Attachment Image'), 'onLoadStart');
|
|
306
306
|
|
|
307
307
|
expect(getByAccessibilityHint('image-loading')).toBeTruthy();
|
|
308
308
|
|
|
309
|
-
fireEvent(getByA11yLabel('
|
|
309
|
+
fireEvent(getByA11yLabel('Giphy Attachment Image'), 'onLoadFinish');
|
|
310
310
|
|
|
311
311
|
waitForElementToBeRemoved(() => getByAccessibilityHint('image-loading'));
|
|
312
|
-
expect(getByA11yLabel('
|
|
312
|
+
expect(getByA11yLabel('Giphy Attachment Image')).toBeTruthy();
|
|
313
313
|
});
|
|
314
314
|
});
|
|
@@ -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 || '
|
|
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
|
|
73
|
-
|
|
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
|
-
|
|
78
|
-
|
|
80
|
+
const handleUpdatedOrDeletedMessage = (event: Event<StreamChatGenerics>) => {
|
|
81
|
+
if (event.message?.id === lastMessage?.id) {
|
|
82
|
+
setLastMessage(event.message);
|
|
79
83
|
}
|
|
80
84
|
};
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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(() => {
|
|
@@ -471,17 +471,21 @@ export const ImageGallery = <
|
|
|
471
471
|
}
|
|
472
472
|
};
|
|
473
473
|
|
|
474
|
-
const handlePlayPause = () => {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
videoRef.current.seek
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
videoRef.current.replayAsync
|
|
482
|
-
|
|
474
|
+
const handlePlayPause = (status?: boolean) => {
|
|
475
|
+
if (status === undefined) {
|
|
476
|
+
// React Native Video for RN CLI has seek as an API to move to a particular location in the video
|
|
477
|
+
if (progress === 1 && videoRef.current && videoRef.current.seek) {
|
|
478
|
+
videoRef.current.seek(0);
|
|
479
|
+
}
|
|
480
|
+
// Expo AV for Expo has replayAsync as an API to move to a starting of the video
|
|
481
|
+
if (progress === 1 && videoRef.current && videoRef.current.replayAsync) {
|
|
482
|
+
videoRef.current.replayAsync();
|
|
483
|
+
}
|
|
483
484
|
|
|
484
|
-
|
|
485
|
+
setPaused((state) => !state);
|
|
486
|
+
} else {
|
|
487
|
+
setPaused(status);
|
|
488
|
+
}
|
|
485
489
|
};
|
|
486
490
|
|
|
487
491
|
const onProgressDrag = (progress: number) => {
|
|
@@ -497,7 +501,11 @@ export const ImageGallery = <
|
|
|
497
501
|
};
|
|
498
502
|
|
|
499
503
|
return (
|
|
500
|
-
<Animated.View
|
|
504
|
+
<Animated.View
|
|
505
|
+
accessibilityLabel='Image Gallery'
|
|
506
|
+
pointerEvents={'auto'}
|
|
507
|
+
style={[StyleSheet.absoluteFillObject, showScreenStyle]}
|
|
508
|
+
>
|
|
501
509
|
<Animated.View style={[StyleSheet.absoluteFillObject, containerBackground]} />
|
|
502
510
|
<TapGestureHandler
|
|
503
511
|
minPointers={1}
|
|
@@ -577,6 +585,7 @@ export const ImageGallery = <
|
|
|
577
585
|
/>
|
|
578
586
|
) : (
|
|
579
587
|
<AnimatedGalleryImage
|
|
588
|
+
accessibilityLabel={'Image Item'}
|
|
580
589
|
index={i}
|
|
581
590
|
key={`${photo.uri}-${i}`}
|
|
582
591
|
offsetScale={offsetScale}
|
|
@@ -615,6 +624,7 @@ export const ImageGallery = <
|
|
|
615
624
|
{...imageGalleryCustomComponents?.header}
|
|
616
625
|
/>
|
|
617
626
|
<ImageGalleryFooter<StreamChatGenerics>
|
|
627
|
+
accessibilityLabel={'Image Gallery Footer'}
|
|
618
628
|
duration={duration}
|
|
619
629
|
onPlayPause={handlePlayPause}
|
|
620
630
|
onProgressDrag={onProgressDrag}
|