stream-chat-react-native-core 5.2.0 → 5.3.0-beta.3
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/Card.js +29 -18
- package/lib/commonjs/components/Attachment/Card.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +16 -20
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/GalleryImage.js +34 -6
- package/lib/commonjs/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +37 -29
- package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +10 -8
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +3 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +4 -4
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +4 -4
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +6 -7
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +30 -6
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +8 -5
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +2 -0
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/ImageBackground.js +64 -0
- package/lib/commonjs/components/ImageBackground.js.map +1 -0
- package/lib/commonjs/components/Message/Message.js +15 -16
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +12 -4
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +26 -5
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +58 -47
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +2 -2
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Card.js +29 -18
- package/lib/module/components/Attachment/Card.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +16 -20
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/GalleryImage.js +34 -6
- package/lib/module/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +37 -29
- package/lib/module/components/Attachment/Giphy.js.map +1 -1
- package/lib/module/components/Avatar/Avatar.js +10 -8
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +3 -1
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +4 -4
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +4 -4
- package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +1 -1
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +6 -7
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +30 -6
- package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +8 -5
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +2 -0
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/ImageBackground.js +64 -0
- package/lib/module/components/ImageBackground.js.map +1 -0
- package/lib/module/components/Message/Message.js +15 -16
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +12 -4
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +26 -5
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +58 -47
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +2 -2
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +2 -2
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Card.d.ts +3 -2
- package/lib/typescript/components/Attachment/GalleryImage.d.ts +8 -2
- package/lib/typescript/components/Attachment/Giphy.d.ts +2 -1
- package/lib/typescript/components/Avatar/Avatar.d.ts +2 -1
- package/lib/typescript/components/Avatar/GroupAvatar.d.ts +2 -1
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelAvatar.d.ts +2 -0
- package/lib/typescript/components/Chat/Chat.d.ts +1 -1
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/components/ImageBackground.d.ts +33 -0
- package/lib/typescript/components/Message/Message.d.ts +2 -1
- package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +2 -1
- package/lib/typescript/components/Message/MessageSimple/MessageRepliesAvatars.d.ts +2 -0
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +1 -1
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +3 -1
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +4 -0
- package/lib/typescript/native.d.ts +2 -2
- package/package.json +1 -1
- package/src/__tests__/offline-feature.test.js +3 -1
- package/src/components/Attachment/Card.tsx +11 -2
- package/src/components/Attachment/Gallery.tsx +1 -7
- package/src/components/Attachment/GalleryImage.tsx +31 -9
- package/src/components/Attachment/Giphy.tsx +8 -2
- package/src/components/Avatar/Avatar.tsx +12 -2
- package/src/components/Avatar/GroupAvatar.tsx +4 -4
- package/src/components/ChannelList/ChannelList.tsx +3 -2
- package/src/components/ChannelList/ChannelListMessenger.tsx +3 -3
- package/src/components/ChannelList/__tests__/ChannelList.test.js +1 -1
- package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +2 -1
- package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +1 -1
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +12 -11
- package/src/components/ChannelPreview/ChannelAvatar.tsx +23 -4
- package/src/components/Chat/Chat.tsx +98 -95
- package/src/components/Chat/hooks/useCreateChatContext.ts +2 -0
- package/src/components/ImageBackground.tsx +77 -0
- package/src/components/Message/Message.tsx +8 -8
- package/src/components/Message/MessageSimple/MessageAvatar.tsx +6 -2
- package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +15 -3
- package/src/components/MessageOverlay/MessageOverlay.tsx +210 -205
- package/src/contexts/channelsContext/ChannelsContext.tsx +1 -1
- package/src/contexts/chatContext/ChatContext.tsx +3 -1
- package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +8 -1
- package/src/native.ts +2 -2
- package/src/version.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useContext } from 'react';
|
|
2
|
+
import type { ImageProps } from 'react-native';
|
|
2
3
|
|
|
3
4
|
import type { AppSettingsAPIResponse, Channel, EventHandler, Mute, StreamChat } from 'stream-chat';
|
|
4
5
|
|
|
@@ -34,6 +35,7 @@ export type ChatContextValue<
|
|
|
34
35
|
client: StreamChat<StreamChatGenerics>;
|
|
35
36
|
connectionRecovering: boolean;
|
|
36
37
|
enableOfflineSupport: boolean;
|
|
38
|
+
ImageComponent: React.ComponentType<ImageProps>;
|
|
37
39
|
isOnline: boolean;
|
|
38
40
|
mutedUsers: Mute<StreamChatGenerics>[];
|
|
39
41
|
/**
|
|
@@ -71,7 +73,7 @@ export const ChatProvider = <
|
|
|
71
73
|
children,
|
|
72
74
|
value,
|
|
73
75
|
}: PropsWithChildren<{
|
|
74
|
-
value
|
|
76
|
+
value?: ChatContextValue<StreamChatGenerics>;
|
|
75
77
|
}>) => (
|
|
76
78
|
<ChatContext.Provider value={value as unknown as ChatContextValue}>
|
|
77
79
|
{children}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useContext } from 'react';
|
|
2
2
|
|
|
3
|
+
import type { ImageProps } from 'react-native';
|
|
4
|
+
|
|
3
5
|
import type { Attachment, TranslationLanguages } from 'stream-chat';
|
|
4
6
|
|
|
5
7
|
import { useResettableState } from './hooks/useResettableState';
|
|
@@ -15,6 +17,7 @@ import type { OverlayReactionsProps } from '../../components/MessageOverlay/Over
|
|
|
15
17
|
import type { OverlayReactionsAvatarProps } from '../../components/MessageOverlay/OverlayReactionsAvatar';
|
|
16
18
|
import type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';
|
|
17
19
|
import type { ReactionData } from '../../utils/utils';
|
|
20
|
+
import type { ChatContextValue } from '../chatContext/ChatContext';
|
|
18
21
|
import type { Alignment, MessageContextValue } from '../messageContext/MessageContext';
|
|
19
22
|
import type { MessagesContextValue } from '../messagesContext/MessagesContext';
|
|
20
23
|
import type { OwnCapabilitiesContextValue } from '../ownCapabilitiesContext/OwnCapabilitiesContext';
|
|
@@ -27,10 +30,12 @@ export type MessageOverlayData<
|
|
|
27
30
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
28
31
|
> = {
|
|
29
32
|
alignment?: Alignment;
|
|
33
|
+
chatContext?: ChatContextValue<StreamChatGenerics>;
|
|
30
34
|
clientId?: string;
|
|
31
35
|
files?: Attachment<StreamChatGenerics>[];
|
|
32
36
|
groupStyles?: GroupType[];
|
|
33
37
|
handleReaction?: (reactionType: string) => Promise<void>;
|
|
38
|
+
ImageComponent?: React.ComponentType<ImageProps>;
|
|
34
39
|
images?: Attachment<StreamChatGenerics>[];
|
|
35
40
|
message?: MessageType<StreamChatGenerics>;
|
|
36
41
|
messageActions?: MessageActionType[];
|
|
@@ -89,7 +94,9 @@ export const MessageOverlayProvider = <
|
|
|
89
94
|
}>) => {
|
|
90
95
|
const messageOverlayContext = useResettableState(value);
|
|
91
96
|
return (
|
|
92
|
-
<MessageOverlayContext.Provider
|
|
97
|
+
<MessageOverlayContext.Provider
|
|
98
|
+
value={messageOverlayContext as unknown as MessageOverlayContextValue}
|
|
99
|
+
>
|
|
93
100
|
{children}
|
|
94
101
|
</MessageOverlayContext.Provider>
|
|
95
102
|
);
|
package/src/native.ts
CHANGED
|
@@ -27,7 +27,7 @@ export let compressImage: CompressImage = fail;
|
|
|
27
27
|
type DeleteFile = ({ uri }: { uri: string }) => Promise<boolean> | never;
|
|
28
28
|
export let deleteFile: DeleteFile = fail;
|
|
29
29
|
|
|
30
|
-
type GetLocalAssetUri = (uriOrAssetId: string) => never;
|
|
30
|
+
type GetLocalAssetUri = (uriOrAssetId: string) => Promise<string> | never;
|
|
31
31
|
export let getLocalAssetUri: GetLocalAssetUri = fail;
|
|
32
32
|
|
|
33
33
|
type GetPhotos = ({ after, first }: { first: number; after?: string }) =>
|
|
@@ -157,7 +157,7 @@ export type SoundType = {
|
|
|
157
157
|
source?: { uri: string },
|
|
158
158
|
initialStatus?: Partial<AVPlaybackStatusToSet>,
|
|
159
159
|
onPlaybackStatusUpdate?: (playbackStatus: PlaybackStatus) => void,
|
|
160
|
-
) => SoundReturnType | null
|
|
160
|
+
) => Promise<SoundReturnType | null>;
|
|
161
161
|
Player: React.ComponentType<SoundReturnType> | null;
|
|
162
162
|
};
|
|
163
163
|
|
package/src/version.json
CHANGED