stream-chat-react-native-core 4.3.1-beta.1 → 4.3.1-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.
- package/lib/commonjs/components/Attachment/Giphy.js +26 -22
- package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +8 -4
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useAppSettings.js +80 -0
- package/lib/commonjs/components/Chat/hooks/useAppSettings.js.map +1 -0
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +3 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +4 -4
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +4 -4
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.md +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.md +2 -2
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.md +2 -2
- package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.md +2 -2
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.md +2 -2
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.md +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.md +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.md +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.md +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.md +2 -2
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.md +2 -2
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.md +1 -1
- package/lib/commonjs/contexts/typingContext/TypingContext.md +2 -2
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Giphy.js +26 -22
- package/lib/module/components/Attachment/Giphy.js.map +1 -1
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +8 -4
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useAppSettings.js +80 -0
- package/lib/module/components/Chat/hooks/useAppSettings.js.map +1 -0
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +3 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +4 -4
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +4 -4
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.md +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.md +2 -2
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.md +2 -2
- package/lib/module/contexts/chatContext/ChatContext.js +2 -2
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.md +2 -2
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.md +2 -2
- package/lib/module/contexts/keyboardContext/KeyboardContext.md +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/module/contexts/messageContext/MessageContext.md +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.md +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.md +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.md +2 -2
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.md +2 -2
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.md +1 -1
- package/lib/module/contexts/typingContext/TypingContext.md +2 -2
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts +4 -4
- package/lib/typescript/components/Channel/Channel.d.ts +2 -2
- package/lib/typescript/components/Chat/Chat.d.ts +1 -1
- package/lib/typescript/components/Chat/hooks/__tests__/useAppSettings.test.d.ts +1 -0
- package/lib/typescript/components/Chat/hooks/useAppSettings.d.ts +3 -0
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/components/Message/Message.d.ts +2 -2
- package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +3 -3
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +2 -2
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +6 -6
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +5 -1
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +2 -2
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +6 -6
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +3 -3
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +20 -20
- package/package.json +1 -1
- package/src/components/Attachment/Giphy.tsx +4 -0
- package/src/components/Attachment/__tests__/Attachment.test.js +0 -61
- package/src/components/Attachment/__tests__/Giphy.test.js +290 -0
- package/src/components/AttachmentPicker/AttachmentPicker.tsx +4 -4
- package/src/components/Channel/Channel.tsx +2 -2
- package/src/components/Channel/__tests__/isAttachmentEqualHandler.test.js +1 -1
- package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +1 -0
- package/src/components/Chat/Chat.tsx +5 -1
- package/src/components/Chat/hooks/__tests__/useAppSettings.test.tsx +34 -0
- package/src/components/Chat/hooks/useAppSettings.ts +39 -0
- package/src/components/Chat/hooks/useCreateChatContext.ts +2 -0
- package/src/components/Message/Message.tsx +2 -2
- package/src/components/Message/MessageSimple/MessageContent.tsx +16 -17
- package/src/components/Message/MessageSimple/MessageSimple.tsx +11 -12
- package/src/components/Message/MessageSimple/utils/renderText.md +1 -1
- package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +3 -3
- package/src/contexts/channelContext/ChannelContext.md +2 -2
- package/src/contexts/channelContext/ChannelContext.tsx +2 -2
- package/src/contexts/channelsContext/ChannelsContext.md +2 -2
- package/src/contexts/channelsContext/ChannelsContext.tsx +6 -6
- package/src/contexts/chatContext/ChatContext.md +2 -2
- package/src/contexts/chatContext/ChatContext.tsx +5 -1
- package/src/contexts/imageGalleryContext/ImageGalleryContext.md +2 -2
- package/src/contexts/keyboardContext/KeyboardContext.md +1 -1
- package/src/contexts/messageContext/MessageContext.md +1 -1
- package/src/contexts/messageContext/MessageContext.tsx +2 -2
- package/src/contexts/messageInputContext/MessageInputContext.md +1 -1
- package/src/contexts/messageInputContext/MessageInputContext.tsx +6 -6
- package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +3 -3
- package/src/contexts/messagesContext/MessagesContext.md +1 -1
- package/src/contexts/messagesContext/MessagesContext.tsx +20 -20
- package/src/contexts/overlayContext/OverlayContext.md +2 -2
- package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.md +2 -2
- package/src/contexts/suggestionsContext/SuggestionsContext.md +1 -1
- package/src/contexts/typingContext/TypingContext.md +2 -2
- package/src/version.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Please check the `TypingContextValue` in [TypingContext](https://github.com/GetStream/stream-chat-react-native/blob/master/src/contexts/TypingContext/TypingContext.tsx), for consumable values.
|
|
1
|
+
Please check the `TypingContextValue` in [TypingContext](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/contexts/TypingContext/TypingContext.tsx), for consumable values.
|
|
2
2
|
Provider for this context exists in `Channel` component. And so, any child component of Channel
|
|
3
3
|
can get access to context as following:
|
|
4
4
|
|
|
@@ -30,4 +30,4 @@ class SomeChildComponent extends React.Component {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// UI Logic
|
|
33
|
-
}
|
|
33
|
+
}
|
package/lib/module/version.json
CHANGED
|
@@ -5,25 +5,25 @@ export declare type AttachmentPickerProps = {
|
|
|
5
5
|
/**
|
|
6
6
|
* Custom UI component to render [draggable handle](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/1.png) of attachment picker.
|
|
7
7
|
*
|
|
8
|
-
* **Default** [AttachmentPickerBottomSheetHandle](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.tsx)
|
|
8
|
+
* **Default** [AttachmentPickerBottomSheetHandle](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.tsx)
|
|
9
9
|
*/
|
|
10
10
|
AttachmentPickerBottomSheetHandle: React.FC<BottomSheetHandleProps>;
|
|
11
11
|
/**
|
|
12
12
|
* Custom UI component to render error component while opening attachment picker.
|
|
13
13
|
*
|
|
14
|
-
* **Default** [AttachmentPickerError](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/AttachmentPicker/components/AttachmentPickerError.tsx)
|
|
14
|
+
* **Default** [AttachmentPickerError](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/AttachmentPickerError.tsx)
|
|
15
15
|
*/
|
|
16
16
|
AttachmentPickerError: React.ComponentType<AttachmentPickerErrorProps>;
|
|
17
17
|
/**
|
|
18
18
|
* Custom UI component to render error image for attachment picker
|
|
19
19
|
*
|
|
20
|
-
* **Default** [AttachmentPickerErrorImage](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/AttachmentPicker/components/AttachmentPickerErrorImage.tsx)
|
|
20
|
+
* **Default** [AttachmentPickerErrorImage](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/AttachmentPickerErrorImage.tsx)
|
|
21
21
|
*/
|
|
22
22
|
AttachmentPickerErrorImage: React.ComponentType;
|
|
23
23
|
/**
|
|
24
24
|
* Custom UI component to render overlay component, that shows up on top of [selected image](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/1.png) (with tick mark)
|
|
25
25
|
*
|
|
26
|
-
* **Default** [ImageOverlaySelectedComponent](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/AttachmentPicker/components/ImageOverlaySelectedComponent.tsx)
|
|
26
|
+
* **Default** [ImageOverlaySelectedComponent](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/ImageOverlaySelectedComponent.tsx)
|
|
27
27
|
*/
|
|
28
28
|
ImageOverlaySelectedComponent: React.ComponentType;
|
|
29
29
|
attachmentPickerBottomSheetHandleHeight?: number;
|
|
@@ -28,7 +28,7 @@ export declare type ChannelPropsWithContext<StreamChatGenerics extends DefaultSt
|
|
|
28
28
|
/**
|
|
29
29
|
* When true, disables the KeyboardCompatibleView wrapper
|
|
30
30
|
*
|
|
31
|
-
* Channel internally uses the [KeyboardCompatibleView](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx)
|
|
31
|
+
* Channel internally uses the [KeyboardCompatibleView](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx)
|
|
32
32
|
* component to adjust the height of Channel when the keyboard is opened or dismissed. This prop provides the ability to disable this functionality in case you
|
|
33
33
|
* want to use [KeyboardAvoidingView](https://facebook.github.io/react-native/docs/keyboardavoidingview) or handle dismissal yourself.
|
|
34
34
|
* KeyboardAvoidingView works well when your component occupies 100% of screen height, otherwise it may raise some issues.
|
|
@@ -63,7 +63,7 @@ export declare type ChannelPropsWithContext<StreamChatGenerics extends DefaultSt
|
|
|
63
63
|
keyboardBehavior?: KeyboardAvoidingViewProps['behavior'];
|
|
64
64
|
/**
|
|
65
65
|
* Custom wrapper component that handles height adjustment of Channel component when keyboard is opened or dismissed
|
|
66
|
-
* Default component (accepts the same props): [KeyboardCompatibleView](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx)
|
|
66
|
+
* Default component (accepts the same props): [KeyboardCompatibleView](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx)
|
|
67
67
|
*
|
|
68
68
|
* **Example:**
|
|
69
69
|
*
|
|
@@ -65,7 +65,7 @@ export declare type ChatProps<StreamChatGenerics extends DefaultStreamChatGeneri
|
|
|
65
65
|
*/
|
|
66
66
|
i18nInstance?: Streami18n;
|
|
67
67
|
/**
|
|
68
|
-
* You can pass the theme object to customize the styles of Chat components. You can check the default theme in [theme.ts](https://github.com/GetStream/stream-chat-react-native/blob/master/src/contexts/themeContext/utils/theme.ts)
|
|
68
|
+
* You can pass the theme object to customize the styles of Chat components. You can check the default theme in [theme.ts](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/contexts/themeContext/utils/theme.ts)
|
|
69
69
|
*
|
|
70
70
|
* Please check section about [themes in cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#theme) for details.
|
|
71
71
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AppSettingsAPIResponse, StreamChat } from 'stream-chat';
|
|
2
|
+
import type { DefaultStreamChatGenerics } from 'stream-chat-react-native';
|
|
3
|
+
export declare const useAppSettings: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(client: StreamChat<StreamChatGenerics>, isOnline: boolean) => AppSettingsAPIResponse | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChatContextValue } from '../../../contexts/chatContext/ChatContext';
|
|
2
2
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
3
|
-
export declare const useCreateChatContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channel, client, connectionRecovering, isOnline, mutedUsers, setActiveChannel, }: ChatContextValue<StreamChatGenerics>) => ChatContextValue<StreamChatGenerics>;
|
|
3
|
+
export declare const useCreateChatContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ appSettings, channel, client, connectionRecovering, isOnline, mutedUsers, setActiveChannel, }: ChatContextValue<StreamChatGenerics>) => ChatContextValue<StreamChatGenerics>;
|
|
@@ -46,7 +46,7 @@ export declare type MessagePropsWithContext<StreamChatGenerics extends DefaultSt
|
|
|
46
46
|
* You can call methods available on the Message
|
|
47
47
|
* component such as handleEdit, handleDelete, handleAction etc.
|
|
48
48
|
*
|
|
49
|
-
* Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/Message.tsx)
|
|
49
|
+
* Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/Message.tsx)
|
|
50
50
|
*
|
|
51
51
|
* By default, we show the overlay with all the message actions on long press.
|
|
52
52
|
*
|
|
@@ -58,7 +58,7 @@ export declare type MessagePropsWithContext<StreamChatGenerics extends DefaultSt
|
|
|
58
58
|
* You can call methods available on the Message
|
|
59
59
|
* component such as handleEdit, handleDelete, handleAction etc.
|
|
60
60
|
*
|
|
61
|
-
* Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/Message.tsx)
|
|
61
|
+
* Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/Message.tsx)
|
|
62
62
|
*
|
|
63
63
|
* By default, we will dismiss the keyboard on press.
|
|
64
64
|
*
|
|
@@ -17,20 +17,20 @@ export declare type AttachmentPickerContextValue = {
|
|
|
17
17
|
/**
|
|
18
18
|
* Custom UI component for [camera selector icon](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/1.png)
|
|
19
19
|
*
|
|
20
|
-
* **Default: ** [CameraSelectorIcon](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/AttachmentPicker/components/CameraSelectorIcon.tsx)
|
|
20
|
+
* **Default: ** [CameraSelectorIcon](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/CameraSelectorIcon.tsx)
|
|
21
21
|
*/
|
|
22
22
|
CameraSelectorIcon: React.ComponentType<AttachmentPickerIconProps>;
|
|
23
23
|
closePicker: () => void;
|
|
24
24
|
/**
|
|
25
25
|
* Custom UI component for [file selector icon](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/1.png)
|
|
26
26
|
*
|
|
27
|
-
* **Default: ** [FileSelectorIcon](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/AttachmentPicker/components/FileSelectorIcon.tsx)
|
|
27
|
+
* **Default: ** [FileSelectorIcon](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/FileSelectorIcon.tsx)
|
|
28
28
|
*/
|
|
29
29
|
FileSelectorIcon: React.ComponentType<AttachmentPickerIconProps>;
|
|
30
30
|
/**
|
|
31
31
|
* Custom UI component for [image selector icon](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/1.png)
|
|
32
32
|
*
|
|
33
|
-
* **Default: ** [ImageSelectorIcon](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/AttachmentPicker/components/ImageSelectorIcon.tsx)
|
|
33
|
+
* **Default: ** [ImageSelectorIcon](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/ImageSelectorIcon.tsx)
|
|
34
34
|
*/
|
|
35
35
|
ImageSelectorIcon: React.ComponentType<AttachmentPickerIconProps>;
|
|
36
36
|
/**
|
|
@@ -30,7 +30,7 @@ export declare type ChannelContextValue<StreamChatGenerics extends DefaultStream
|
|
|
30
30
|
/**
|
|
31
31
|
* Custom UI component to display empty state when channel has no messages.
|
|
32
32
|
*
|
|
33
|
-
* **Default** [EmptyStateIndicator](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Indicators/EmptyStateIndicator.tsx)
|
|
33
|
+
* **Default** [EmptyStateIndicator](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Indicators/EmptyStateIndicator.tsx)
|
|
34
34
|
*/
|
|
35
35
|
EmptyStateIndicator: React.ComponentType<EmptyStateProps>;
|
|
36
36
|
/**
|
|
@@ -145,7 +145,7 @@ export declare type ChannelContextValue<StreamChatGenerics extends DefaultStream
|
|
|
145
145
|
/**
|
|
146
146
|
* Custom UI component for sticky header of channel.
|
|
147
147
|
*
|
|
148
|
-
* **Default** [DateHeader](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageList/DateHeader.tsx)
|
|
148
|
+
* **Default** [DateHeader](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageList/DateHeader.tsx)
|
|
149
149
|
*/
|
|
150
150
|
StickyHeader?: React.ComponentType<{
|
|
151
151
|
dateString: string;
|
|
@@ -158,37 +158,37 @@ export declare type ChannelsContextValue<StreamChatGenerics extends DefaultStrea
|
|
|
158
158
|
/**
|
|
159
159
|
* Custom UI component to render preview avatar.
|
|
160
160
|
*
|
|
161
|
-
* **Default** [ChannelAvatar](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelAvatar.tsx)
|
|
161
|
+
* **Default** [ChannelAvatar](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/ChannelPreview/ChannelAvatar.tsx)
|
|
162
162
|
*/
|
|
163
163
|
PreviewAvatar?: React.ComponentType<ChannelAvatarProps<StreamChatGenerics>>;
|
|
164
164
|
/**
|
|
165
165
|
* Custom UI component to render preview of latest message on channel.
|
|
166
166
|
*
|
|
167
|
-
* **Default** [ChannelPreviewMessage](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewMessage.tsx)
|
|
167
|
+
* **Default** [ChannelPreviewMessage](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/ChannelPreview/ChannelPreviewMessage.tsx)
|
|
168
168
|
*/
|
|
169
169
|
PreviewMessage?: React.ComponentType<ChannelPreviewMessageProps<StreamChatGenerics>>;
|
|
170
170
|
/**
|
|
171
171
|
* Custom UI component to render muted status.
|
|
172
172
|
*
|
|
173
|
-
* **Default** [ChannelMutedStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx)
|
|
173
|
+
* **Default** [ChannelMutedStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx)
|
|
174
174
|
*/
|
|
175
175
|
PreviewMutedStatus?: React.ComponentType<ChannelPreviewMutedStatusProps<StreamChatGenerics>>;
|
|
176
176
|
/**
|
|
177
177
|
* Custom UI component to render preview avatar.
|
|
178
178
|
*
|
|
179
|
-
* **Default** [ChannelPreviewStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewStatus.tsx)
|
|
179
|
+
* **Default** [ChannelPreviewStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/ChannelPreview/ChannelPreviewStatus.tsx)
|
|
180
180
|
*/
|
|
181
181
|
PreviewStatus?: React.ComponentType<ChannelPreviewStatusProps<StreamChatGenerics>>;
|
|
182
182
|
/**
|
|
183
183
|
* Custom UI component to render preview avatar.
|
|
184
184
|
*
|
|
185
|
-
* **Default** [ChannelPreviewTitle](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewTitle.tsx)
|
|
185
|
+
* **Default** [ChannelPreviewTitle](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/ChannelPreview/ChannelPreviewTitle.tsx)
|
|
186
186
|
*/
|
|
187
187
|
PreviewTitle?: React.ComponentType<ChannelPreviewTitleProps<StreamChatGenerics>>;
|
|
188
188
|
/**
|
|
189
189
|
* Custom UI component to render preview avatar.
|
|
190
190
|
*
|
|
191
|
-
* **Default** [ChannelPreviewUnreadCount](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx)
|
|
191
|
+
* **Default** [ChannelPreviewUnreadCount](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx)
|
|
192
192
|
*/
|
|
193
193
|
PreviewUnreadCount?: React.ComponentType<ChannelPreviewUnreadCountProps<StreamChatGenerics>>;
|
|
194
194
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import type { Channel, Mute, StreamChat } from 'stream-chat';
|
|
2
|
+
import type { AppSettingsAPIResponse, Channel, Mute, StreamChat } from 'stream-chat';
|
|
3
3
|
import type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';
|
|
4
4
|
export declare type ChatContextValue<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
5
|
+
/**
|
|
6
|
+
* Object of application settings returned from Stream.
|
|
7
|
+
* */
|
|
8
|
+
appSettings: AppSettingsAPIResponse<StreamChatGenerics> | null;
|
|
5
9
|
/**
|
|
6
10
|
* The StreamChat client object
|
|
7
11
|
*
|
|
@@ -50,7 +50,7 @@ export declare type MessageContextValue<StreamChatGenerics extends DefaultStream
|
|
|
50
50
|
* You can call methods available on the Message
|
|
51
51
|
* component such as handleEdit, handleDelete, handleAction etc.
|
|
52
52
|
*
|
|
53
|
-
* Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/Message.tsx)
|
|
53
|
+
* Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/Message.tsx)
|
|
54
54
|
*
|
|
55
55
|
* By default, we show the overlay with all the message actions on long press.
|
|
56
56
|
*
|
|
@@ -65,7 +65,7 @@ export declare type MessageContextValue<StreamChatGenerics extends DefaultStream
|
|
|
65
65
|
* You can call methods available on the Message
|
|
66
66
|
* component such as handleEdit, handleDelete, handleAction etc.
|
|
67
67
|
*
|
|
68
|
-
* Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/Message.tsx)
|
|
68
|
+
* Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/Message.tsx)
|
|
69
69
|
*
|
|
70
70
|
* By default, we will dismiss the keyboard on press.
|
|
71
71
|
*
|
|
@@ -195,14 +195,14 @@ export declare type InputMessageInputContextValue<StreamChatGenerics extends Def
|
|
|
195
195
|
* being allowed to send another message. This component is displayed in place of the
|
|
196
196
|
* send button for the MessageInput component.
|
|
197
197
|
*
|
|
198
|
-
* **default** [CooldownTimer](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageInput/CooldownTimer.tsx)
|
|
198
|
+
* **default** [CooldownTimer](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageInput/CooldownTimer.tsx)
|
|
199
199
|
*/
|
|
200
200
|
CooldownTimer: React.ComponentType<CooldownTimerProps>;
|
|
201
201
|
editing: boolean | MessageType<StreamChatGenerics>;
|
|
202
202
|
editMessage: StreamChat<StreamChatGenerics>['updateMessage'];
|
|
203
203
|
/**
|
|
204
204
|
* Custom UI component for FileUploadPreview.
|
|
205
|
-
* Defaults to and accepts same props as: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageInput/FileUploadPreview.tsx
|
|
205
|
+
* Defaults to and accepts same props as: https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageInput/FileUploadPreview.tsx
|
|
206
206
|
*/
|
|
207
207
|
FileUploadPreview: React.ComponentType<FileUploadPreviewProps<StreamChatGenerics>>;
|
|
208
208
|
/** When false, CommandsButton will be hidden */
|
|
@@ -213,7 +213,7 @@ export declare type InputMessageInputContextValue<StreamChatGenerics extends Def
|
|
|
213
213
|
hasImagePicker: boolean;
|
|
214
214
|
/**
|
|
215
215
|
* Custom UI component for ImageUploadPreview.
|
|
216
|
-
* Defaults to and accepts same props as: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageInput/ImageUploadPreview.tsx
|
|
216
|
+
* Defaults to and accepts same props as: https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageInput/ImageUploadPreview.tsx
|
|
217
217
|
*/
|
|
218
218
|
ImageUploadPreview: React.ComponentType<ImageUploadPreviewProps<StreamChatGenerics>>;
|
|
219
219
|
InputEditingStateHeader: React.ComponentType<InputEditingStateHeaderProps<StreamChatGenerics>>;
|
|
@@ -249,7 +249,7 @@ export declare type InputMessageInputContextValue<StreamChatGenerics extends Def
|
|
|
249
249
|
/**
|
|
250
250
|
* Custom UI component to render upload progress indicator on attachment preview.
|
|
251
251
|
*
|
|
252
|
-
* **Default** [UploadProgressIndicator](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageInput/UploadProgressIndicator.tsx)
|
|
252
|
+
* **Default** [UploadProgressIndicator](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageInput/UploadProgressIndicator.tsx)
|
|
253
253
|
*/
|
|
254
254
|
UploadProgressIndicator: React.ComponentType<UploadProgressIndicatorProps>;
|
|
255
255
|
/**
|
|
@@ -301,14 +301,14 @@ export declare type InputMessageInputContextValue<StreamChatGenerics extends Def
|
|
|
301
301
|
initialValue?: string;
|
|
302
302
|
/**
|
|
303
303
|
* Custom UI component for AutoCompleteInput.
|
|
304
|
-
* Has access to all of [MessageInputContext](https://github.com/GetStream/stream-chat-react-native/blob/master/src/contexts/messageInputContext/MessageInputContext.tsx)
|
|
304
|
+
* Has access to all of [MessageInputContext](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/contexts/messageInputContext/MessageInputContext.tsx)
|
|
305
305
|
*/
|
|
306
306
|
Input?: React.ComponentType<Omit<MessageInputProps<StreamChatGenerics>, 'Input'> & InputButtonsProps<StreamChatGenerics> & {
|
|
307
307
|
getUsers: () => UserResponse<StreamChatGenerics>[];
|
|
308
308
|
}>;
|
|
309
309
|
/**
|
|
310
310
|
* Custom UI component to override buttons on left side of input box
|
|
311
|
-
* Defaults to [InputButtons](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageInput/InputButtons.tsx),
|
|
311
|
+
* Defaults to [InputButtons](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageInput/InputButtons.tsx),
|
|
312
312
|
* which contain following components/buttons:
|
|
313
313
|
*
|
|
314
314
|
* - AttachButton
|
|
@@ -34,20 +34,20 @@ export declare type MessageOverlayContextValue<StreamChatGenerics extends Defaul
|
|
|
34
34
|
/**
|
|
35
35
|
* Custom UI component for rendering [message actions](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/2.png) in overlay.
|
|
36
36
|
*
|
|
37
|
-
* **Default** [MessageActionList](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageOverlay/MessageActions.tsx)
|
|
37
|
+
* **Default** [MessageActionList](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageOverlay/MessageActions.tsx)
|
|
38
38
|
*/
|
|
39
39
|
MessageActionList: React.ComponentType<MessageActionListProps<StreamChatGenerics>>;
|
|
40
40
|
MessageActionListItem: React.ComponentType<MessageActionListItemProps<StreamChatGenerics>>;
|
|
41
41
|
/**
|
|
42
42
|
* Custom UI component for rendering [reaction selector](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/2.png) in overlay (which shows up on long press on message).
|
|
43
43
|
*
|
|
44
|
-
* **Default** [OverlayReactionList](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageOverlay/OverlayReactionList.tsx)
|
|
44
|
+
* **Default** [OverlayReactionList](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageOverlay/OverlayReactionList.tsx)
|
|
45
45
|
*/
|
|
46
46
|
OverlayReactionList: React.ComponentType<OverlayReactionListProps<StreamChatGenerics>>;
|
|
47
47
|
/**
|
|
48
48
|
* Custom UI component for rendering [reactions list](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/2.png), in overlay (which shows up on long press on message).
|
|
49
49
|
*
|
|
50
|
-
* **Default** [OverlayReactions](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageOverlay/OverlayReactions.tsx)
|
|
50
|
+
* **Default** [OverlayReactions](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageOverlay/OverlayReactions.tsx)
|
|
51
51
|
*/
|
|
52
52
|
OverlayReactions: React.ComponentType<OverlayReactionsProps<StreamChatGenerics>>;
|
|
53
53
|
OverlayReactionsAvatar: React.ComponentType<OverlayReactionsAvatarProps>;
|
|
@@ -44,22 +44,22 @@ export declare type MessageContentType = 'attachments' | 'files' | 'gallery' | '
|
|
|
44
44
|
export declare type MessagesContextValue<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
45
45
|
/**
|
|
46
46
|
* UI component for Attachment.
|
|
47
|
-
* Defaults to: [Attachment](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Attachment.tsx)
|
|
47
|
+
* Defaults to: [Attachment](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Attachment/Attachment.tsx)
|
|
48
48
|
*/
|
|
49
49
|
Attachment: React.ComponentType<AttachmentProps<StreamChatGenerics>>;
|
|
50
50
|
/**
|
|
51
51
|
* UI component to display AttachmentActions. e.g., send, shuffle, cancel in case of giphy
|
|
52
|
-
* Defaults to: [AttachmentActions](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/AttachmentActions.tsx)
|
|
52
|
+
* Defaults to: [AttachmentActions](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Attachment/AttachmentActions.tsx)
|
|
53
53
|
*/
|
|
54
54
|
AttachmentActions: React.ComponentType<AttachmentActionsProps<StreamChatGenerics>>;
|
|
55
55
|
/**
|
|
56
56
|
* UI component to display generic media type e.g. giphy, url preview etc
|
|
57
|
-
* Defaults to: [Card](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Card.tsx)
|
|
57
|
+
* Defaults to: [Card](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Attachment/Card.tsx)
|
|
58
58
|
*/
|
|
59
59
|
Card: React.ComponentType<CardProps<StreamChatGenerics>>;
|
|
60
60
|
/**
|
|
61
61
|
* UI component for DateHeader
|
|
62
|
-
* Defaults to: [DateHeader](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageList/DateHeader.tsx)
|
|
62
|
+
* Defaults to: [DateHeader](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageList/DateHeader.tsx)
|
|
63
63
|
**/
|
|
64
64
|
DateHeader: React.ComponentType<DateHeaderProps>;
|
|
65
65
|
/** Should keyboard be dismissed when messaged is touched */
|
|
@@ -67,28 +67,28 @@ export declare type MessagesContextValue<StreamChatGenerics extends DefaultStrea
|
|
|
67
67
|
enableMessageGroupingByUser: boolean;
|
|
68
68
|
/**
|
|
69
69
|
* UI component to display File type attachment.
|
|
70
|
-
* Defaults to: [FileAttachment](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileAttachment.tsx)
|
|
70
|
+
* Defaults to: [FileAttachment](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Attachment/FileAttachment.tsx)
|
|
71
71
|
*/
|
|
72
72
|
FileAttachment: React.ComponentType<FileAttachmentProps<StreamChatGenerics>>;
|
|
73
73
|
/**
|
|
74
74
|
* UI component to display group of File type attachments or multiple file attachments (in single message).
|
|
75
|
-
* Defaults to: [FileAttachmentGroup](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileAttachmentGroup.tsx)
|
|
75
|
+
* Defaults to: [FileAttachmentGroup](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Attachment/FileAttachmentGroup.tsx)
|
|
76
76
|
*/
|
|
77
77
|
FileAttachmentGroup: React.ComponentType<FileAttachmentGroupProps<StreamChatGenerics>>;
|
|
78
78
|
/**
|
|
79
79
|
* UI component for attachment icon for type 'file' attachment.
|
|
80
|
-
* Defaults to: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileIcon.tsx
|
|
80
|
+
* Defaults to: https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Attachment/FileIcon.tsx
|
|
81
81
|
*/
|
|
82
82
|
FileAttachmentIcon: React.ComponentType<FileIconProps>;
|
|
83
83
|
FlatList: typeof FlatList;
|
|
84
84
|
/**
|
|
85
85
|
* UI component to display image attachments
|
|
86
|
-
* Defaults to: [Gallery](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Gallery.tsx)
|
|
86
|
+
* Defaults to: [Gallery](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Attachment/Gallery.tsx)
|
|
87
87
|
*/
|
|
88
88
|
Gallery: React.ComponentType<GalleryProps<StreamChatGenerics>>;
|
|
89
89
|
/**
|
|
90
90
|
* UI component for Giphy
|
|
91
|
-
* Defaults to: [Giphy](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Giphy.tsx)
|
|
91
|
+
* Defaults to: [Giphy](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Attachment/Giphy.tsx)
|
|
92
92
|
*/
|
|
93
93
|
Giphy: React.ComponentType<GiphyProps<StreamChatGenerics>>;
|
|
94
94
|
/**
|
|
@@ -101,30 +101,30 @@ export declare type MessagesContextValue<StreamChatGenerics extends DefaultStrea
|
|
|
101
101
|
initialScrollToFirstUnreadMessage: boolean;
|
|
102
102
|
/**
|
|
103
103
|
* UI component for Message Date Separator Component
|
|
104
|
-
* Defaults to: [InlineDateSeparator](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageList/InlineDateSeparator.tsx)
|
|
104
|
+
* Defaults to: [InlineDateSeparator](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageList/InlineDateSeparator.tsx)
|
|
105
105
|
*/
|
|
106
106
|
InlineDateSeparator: React.ComponentType<InlineDateSeparatorProps>;
|
|
107
107
|
/**
|
|
108
108
|
* UI component for InlineUnreadIndicator
|
|
109
|
-
* Defaults to: [InlineUnreadIndicator](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/InlineUnreadIndicator.tsx)
|
|
109
|
+
* Defaults to: [InlineUnreadIndicator](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/MessageSimple/InlineUnreadIndicator.tsx)
|
|
110
110
|
**/
|
|
111
111
|
InlineUnreadIndicator: React.ComponentType;
|
|
112
112
|
Message: React.ComponentType<MessageProps<StreamChatGenerics>>;
|
|
113
113
|
/**
|
|
114
114
|
* UI component for MessageAvatar
|
|
115
|
-
* Defaults to: [MessageAvatar](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageAvatar.tsx)
|
|
115
|
+
* Defaults to: [MessageAvatar](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/MessageSimple/MessageAvatar.tsx)
|
|
116
116
|
**/
|
|
117
117
|
MessageAvatar: React.ComponentType<MessageAvatarProps<StreamChatGenerics>>;
|
|
118
118
|
/**
|
|
119
119
|
* UI component for MessageContent
|
|
120
|
-
* Defaults to: [MessageContent](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageContent.tsx)
|
|
120
|
+
* Defaults to: [MessageContent](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/MessageSimple/MessageContent.tsx)
|
|
121
121
|
*/
|
|
122
122
|
MessageContent: React.ComponentType<MessageContentProps<StreamChatGenerics>>;
|
|
123
123
|
/** Order to render the message content */
|
|
124
124
|
messageContentOrder: MessageContentType[];
|
|
125
125
|
/**
|
|
126
126
|
* UI component for MessageDeleted
|
|
127
|
-
* Defaults to: [MessageDeleted](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageSimple/MessageDeleted.tsx)
|
|
127
|
+
* Defaults to: [MessageDeleted](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageSimple/MessageDeleted.tsx)
|
|
128
128
|
*/
|
|
129
129
|
MessageDeleted: React.ComponentType<MessageDeletedProps<StreamChatGenerics>>;
|
|
130
130
|
/**
|
|
@@ -138,22 +138,22 @@ export declare type MessagesContextValue<StreamChatGenerics extends DefaultStrea
|
|
|
138
138
|
MessagePinnedHeader: React.ComponentType<MessagePinnedHeaderProps<StreamChatGenerics>>;
|
|
139
139
|
/**
|
|
140
140
|
* UI component for MessageReplies
|
|
141
|
-
* Defaults to: [MessageReplies](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageSimple/MessageReplies.tsx)
|
|
141
|
+
* Defaults to: [MessageReplies](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageSimple/MessageReplies.tsx)
|
|
142
142
|
*/
|
|
143
143
|
MessageReplies: React.ComponentType<MessageRepliesProps<StreamChatGenerics>>;
|
|
144
144
|
/**
|
|
145
145
|
* UI Component for MessageRepliesAvatars
|
|
146
|
-
* Defaults to: [MessageRepliesAvatars](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageSimple/MessageRepliesAvatars.tsx)
|
|
146
|
+
* Defaults to: [MessageRepliesAvatars](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/MessageSimple/MessageRepliesAvatars.tsx)
|
|
147
147
|
*/
|
|
148
148
|
MessageRepliesAvatars: React.ComponentType<MessageRepliesAvatarsProps<StreamChatGenerics>>;
|
|
149
149
|
/**
|
|
150
150
|
* UI component for MessageSimple
|
|
151
|
-
* Defaults to: [MessageSimple](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageSimple.tsx)
|
|
151
|
+
* Defaults to: [MessageSimple](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/MessageSimple/MessageSimple.tsx)
|
|
152
152
|
*/
|
|
153
153
|
MessageSimple: React.ComponentType<MessageSimpleProps<StreamChatGenerics>>;
|
|
154
154
|
/**
|
|
155
155
|
* UI component for MessageStatus (delivered/read)
|
|
156
|
-
* Defaults to: [MessageStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageStatus.tsx)
|
|
156
|
+
* Defaults to: [MessageStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Message/MessageSimple/MessageStatus.tsx)
|
|
157
157
|
*/
|
|
158
158
|
MessageStatus: React.ComponentType<MessageStatusProps<StreamChatGenerics>>;
|
|
159
159
|
/**
|
|
@@ -167,7 +167,7 @@ export declare type MessagesContextValue<StreamChatGenerics extends DefaultStrea
|
|
|
167
167
|
OverlayReactionList: React.ComponentType<OverlayReactionListProps<StreamChatGenerics>>;
|
|
168
168
|
/**
|
|
169
169
|
* UI component for ReactionList
|
|
170
|
-
* Defaults to: [ReactionList](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Reaction/ReactionList.tsx)
|
|
170
|
+
* Defaults to: [ReactionList](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Reaction/ReactionList.tsx)
|
|
171
171
|
*/
|
|
172
172
|
ReactionList: React.ComponentType<ReactionListProps<StreamChatGenerics>>;
|
|
173
173
|
removeMessage: (message: {
|
|
@@ -208,7 +208,7 @@ export declare type MessagesContextValue<StreamChatGenerics extends DefaultStrea
|
|
|
208
208
|
}) => void;
|
|
209
209
|
/**
|
|
210
210
|
* Custom UI component to display enriched url preview.
|
|
211
|
-
* Defaults to https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Card.tsx
|
|
211
|
+
* Defaults to https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/Attachment/Card.tsx
|
|
212
212
|
*/
|
|
213
213
|
UrlPreview: React.ComponentType<CardProps<StreamChatGenerics>>;
|
|
214
214
|
/**
|
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.3.1-beta.
|
|
4
|
+
"version": "4.3.1-beta.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -201,6 +201,7 @@ const GiphyWithContext = <
|
|
|
201
201
|
{ backgroundColor: white, borderColor: `${black}0D` },
|
|
202
202
|
selectionContainer,
|
|
203
203
|
]}
|
|
204
|
+
testID='giphy-action-attachment'
|
|
204
205
|
>
|
|
205
206
|
<View style={[styles.header, header]}>
|
|
206
207
|
<GiphyIcon />
|
|
@@ -229,6 +230,7 @@ const GiphyWithContext = <
|
|
|
229
230
|
{ borderColor: grey_gainsboro, borderRightWidth: 1 },
|
|
230
231
|
buttonContainer,
|
|
231
232
|
]}
|
|
233
|
+
testID={`${actions?.[2].value}-action-button`}
|
|
232
234
|
>
|
|
233
235
|
<Text style={[styles.cancel, { color: grey }, cancel]}>{actions?.[2].text}</Text>
|
|
234
236
|
</TouchableOpacity>
|
|
@@ -243,6 +245,7 @@ const GiphyWithContext = <
|
|
|
243
245
|
{ borderColor: grey_gainsboro, borderRightWidth: 1 },
|
|
244
246
|
buttonContainer,
|
|
245
247
|
]}
|
|
248
|
+
testID={`${actions?.[1].value}-action-button`}
|
|
246
249
|
>
|
|
247
250
|
<Text style={[styles.shuffle, { color: grey }, shuffle]}>{actions?.[1].text}</Text>
|
|
248
251
|
</TouchableOpacity>
|
|
@@ -253,6 +256,7 @@ const GiphyWithContext = <
|
|
|
253
256
|
}
|
|
254
257
|
}}
|
|
255
258
|
style={[styles.buttonContainer, { borderColor: grey_gainsboro }, buttonContainer]}
|
|
259
|
+
testID={`${actions?.[0].value}-action-button`}
|
|
256
260
|
>
|
|
257
261
|
<Text style={[styles.send, { color: accent_blue }, send]}>{actions?.[0].text}</Text>
|
|
258
262
|
</TouchableOpacity>
|
|
@@ -10,9 +10,7 @@ import {
|
|
|
10
10
|
generateAudioAttachment,
|
|
11
11
|
generateCardAttachment,
|
|
12
12
|
generateFileAttachment,
|
|
13
|
-
generateGiphyAttachment,
|
|
14
13
|
generateImageAttachment,
|
|
15
|
-
generateImgurAttachment,
|
|
16
14
|
} from '../../../mock-builders/generator/attachment';
|
|
17
15
|
import { generateMessage } from '../../../mock-builders/generator/message';
|
|
18
16
|
import { Attachment } from '../Attachment';
|
|
@@ -53,65 +51,6 @@ describe('Attachment', () => {
|
|
|
53
51
|
});
|
|
54
52
|
});
|
|
55
53
|
|
|
56
|
-
it('should render Card component for "imgur" type attachment', async () => {
|
|
57
|
-
const attachment = generateImgurAttachment();
|
|
58
|
-
const { getByTestId } = render(getAttachmentComponent({ attachment }));
|
|
59
|
-
|
|
60
|
-
await waitFor(() => {
|
|
61
|
-
expect(getByTestId('giphy-attachment')).toBeTruthy();
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('should render Card component for "giphy" type attachment', async () => {
|
|
66
|
-
const attachment = generateGiphyAttachment();
|
|
67
|
-
const { getByTestId } = render(getAttachmentComponent({ attachment }));
|
|
68
|
-
|
|
69
|
-
await waitFor(() => {
|
|
70
|
-
expect(getByTestId('giphy-attachment')).toBeTruthy();
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('"giphy" attachment size should be customisable', async () => {
|
|
75
|
-
const attachment = generateGiphyAttachment();
|
|
76
|
-
attachment.giphy = {
|
|
77
|
-
fixed_height: {
|
|
78
|
-
height: '200',
|
|
79
|
-
url: 'https://media1.giphy.com/media/test/fixed_height.gif',
|
|
80
|
-
width: '375',
|
|
81
|
-
},
|
|
82
|
-
original: {
|
|
83
|
-
height: '256',
|
|
84
|
-
url: 'https://media1.giphy.com/media/test/original.gif',
|
|
85
|
-
width: '480',
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
const { getByTestId: getByTestIdFixedHeight } = render(
|
|
89
|
-
getAttachmentComponent({ attachment, giphyVersion: 'fixed_height' }),
|
|
90
|
-
);
|
|
91
|
-
const { getByTestId: getByTestIdOriginal } = render(
|
|
92
|
-
getAttachmentComponent({ attachment, giphyVersion: 'original' }),
|
|
93
|
-
);
|
|
94
|
-
await waitFor(() => {
|
|
95
|
-
const checkImageProps = (imageProps, specificSizedGiphyData) => {
|
|
96
|
-
let imageStyle = imageProps.style;
|
|
97
|
-
if (Array.isArray(imageStyle)) {
|
|
98
|
-
imageStyle = Object.assign({}, ...imageStyle);
|
|
99
|
-
}
|
|
100
|
-
expect(imageStyle.height).toBe(parseFloat(specificSizedGiphyData.height));
|
|
101
|
-
expect(imageStyle.width).toBe(parseFloat(specificSizedGiphyData.width));
|
|
102
|
-
expect(imageProps.source.uri).toBe(specificSizedGiphyData.url);
|
|
103
|
-
};
|
|
104
|
-
checkImageProps(
|
|
105
|
-
getByTestIdFixedHeight('giphy-attachment-image').props,
|
|
106
|
-
attachment.giphy.fixed_height,
|
|
107
|
-
);
|
|
108
|
-
checkImageProps(
|
|
109
|
-
getByTestIdOriginal('giphy-attachment-image').props,
|
|
110
|
-
attachment.giphy.original,
|
|
111
|
-
);
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
|
|
115
54
|
it('should render UrlPreview component if attachment has title_link or og_scrape_url', async () => {
|
|
116
55
|
const attachment = generateImageAttachment({
|
|
117
56
|
og_scrape_url: uuidv4(),
|