stream-chat-react-native-core 5.1.0 → 5.2.0
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/ChannelList/ChannelListMessenger.js +32 -15
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +17 -5
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +106 -100
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +14 -16
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +13 -16
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +6 -6
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +39 -26
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +19 -19
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js.map +1 -1
- package/lib/commonjs/components/ProgressControl/ProgressControl.js +6 -6
- package/lib/commonjs/components/ProgressControl/ProgressControl.js.map +1 -1
- package/lib/commonjs/contexts/debugContext/DebugContext.js +63 -0
- package/lib/commonjs/contexts/debugContext/DebugContext.js.map +1 -0
- package/lib/commonjs/contexts/index.js +13 -0
- package/lib/commonjs/contexts/index.js.map +1 -1
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +32 -15
- package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +17 -5
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +106 -100
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +14 -16
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +13 -16
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +6 -6
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +39 -26
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactions.js +19 -19
- package/lib/module/components/MessageOverlay/OverlayReactions.js.map +1 -1
- package/lib/module/components/ProgressControl/ProgressControl.js +6 -6
- package/lib/module/components/ProgressControl/ProgressControl.js.map +1 -1
- package/lib/module/contexts/debugContext/DebugContext.js +63 -0
- package/lib/module/contexts/debugContext/DebugContext.js.map +1 -0
- package/lib/module/contexts/index.js +13 -0
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +3 -0
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryVideo.d.ts +5 -3
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +1 -3
- package/lib/typescript/components/MessageOverlay/OverlayReactions.d.ts +1 -0
- package/lib/typescript/components/ProgressControl/ProgressControl.d.ts +1 -1
- package/lib/typescript/contexts/debugContext/DebugContext.d.ts +27 -0
- package/lib/typescript/contexts/index.d.ts +1 -0
- package/lib/typescript/native.d.ts +3 -2
- package/package.json +2 -2
- package/src/components/ChannelList/ChannelListMessenger.tsx +17 -0
- package/src/components/Chat/Chat.tsx +13 -0
- package/src/components/ImageGallery/ImageGallery.tsx +87 -65
- package/src/components/ImageGallery/__tests__/AnimatedVideoGallery.test.tsx +2 -2
- package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +40 -28
- package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +16 -9
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +1 -6
- package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +5 -6
- package/src/components/MessageList/MessageList.tsx +15 -0
- package/src/components/MessageOverlay/OverlayReactions.tsx +1 -0
- package/src/components/ProgressControl/ProgressControl.tsx +8 -4
- package/src/contexts/debugContext/DebugContext.tsx +77 -0
- package/src/contexts/index.ts +1 -0
- package/src/native.ts +3 -2
- package/src/version.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { PropsWithChildren, useContext, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { Channel, ChannelState, StreamChat } from 'stream-chat';
|
|
4
|
+
|
|
5
|
+
import type { MessageType } from '../../components/MessageList/hooks/useMessageList';
|
|
6
|
+
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
7
|
+
|
|
8
|
+
import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
|
|
9
|
+
|
|
10
|
+
export type DebugDataType<
|
|
11
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
12
|
+
> =
|
|
13
|
+
| StreamChat<StreamChatGenerics>['user']
|
|
14
|
+
| {
|
|
15
|
+
data: Channel<StreamChatGenerics>['data'];
|
|
16
|
+
members: ChannelState<StreamChatGenerics>['members'];
|
|
17
|
+
}[]
|
|
18
|
+
| MessageType<StreamChatGenerics>[];
|
|
19
|
+
|
|
20
|
+
export type DebugContextValue<
|
|
21
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
22
|
+
> = {
|
|
23
|
+
eventType?: string;
|
|
24
|
+
sendEventParams?: {
|
|
25
|
+
action: string;
|
|
26
|
+
data: DebugDataType<StreamChatGenerics>;
|
|
27
|
+
};
|
|
28
|
+
setEventType?: (data: string) => void;
|
|
29
|
+
setSendEventParams?: (data: { action: string; data: DebugDataType<StreamChatGenerics> }) => void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const DebugContext = React.createContext(
|
|
33
|
+
DEFAULT_BASE_CONTEXT_VALUE as React.MutableRefObject<DebugContextValue>,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const DebugContextProvider = <
|
|
37
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
38
|
+
>({
|
|
39
|
+
children,
|
|
40
|
+
useFlipper,
|
|
41
|
+
}: PropsWithChildren<{
|
|
42
|
+
useFlipper: () => {
|
|
43
|
+
updateData: (ref: React.RefObject<DebugContextValue<StreamChatGenerics>>) => void;
|
|
44
|
+
};
|
|
45
|
+
}>) => {
|
|
46
|
+
const debugRef = useRef<DebugContextValue<StreamChatGenerics>>({
|
|
47
|
+
eventType: undefined,
|
|
48
|
+
sendEventParams: undefined,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const { updateData } = useFlipper();
|
|
52
|
+
|
|
53
|
+
const ref = useRef<DebugContextValue<StreamChatGenerics>>({
|
|
54
|
+
setEventType: (data: string) => {
|
|
55
|
+
debugRef.current.eventType = data;
|
|
56
|
+
updateData(debugRef);
|
|
57
|
+
},
|
|
58
|
+
setSendEventParams: (data: { action: string; data: DebugDataType<StreamChatGenerics> }) => {
|
|
59
|
+
debugRef.current.sendEventParams = data;
|
|
60
|
+
updateData(debugRef);
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<DebugContext.Provider value={ref as unknown as React.MutableRefObject<DebugContextValue>}>
|
|
66
|
+
{children}
|
|
67
|
+
</DebugContext.Provider>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const useDebugContext = () => {
|
|
72
|
+
const contextValue = useContext(
|
|
73
|
+
DebugContext,
|
|
74
|
+
) as unknown as React.MutableRefObject<DebugContextValue>;
|
|
75
|
+
|
|
76
|
+
return contextValue;
|
|
77
|
+
};
|
package/src/contexts/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './attachmentPickerContext/AttachmentPickerContext';
|
|
|
2
2
|
export * from './channelContext/ChannelContext';
|
|
3
3
|
export * from './channelsContext/ChannelsContext';
|
|
4
4
|
export * from './chatContext/ChatContext';
|
|
5
|
+
export * from './debugContext/DebugContext';
|
|
5
6
|
export * from './imageGalleryContext/ImageGalleryContext';
|
|
6
7
|
export * from './keyboardContext/KeyboardContext';
|
|
7
8
|
export * from './messageContext/MessageContext';
|
package/src/native.ts
CHANGED
|
@@ -164,9 +164,9 @@ export type SoundType = {
|
|
|
164
164
|
export let Sound: SoundType;
|
|
165
165
|
|
|
166
166
|
export type VideoProgressData = {
|
|
167
|
-
currentTime
|
|
167
|
+
currentTime: number;
|
|
168
|
+
seekableDuration: number;
|
|
168
169
|
playableDuration?: number;
|
|
169
|
-
seekableDuration?: number;
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
export type VideoPayloadData = {
|
|
@@ -196,6 +196,7 @@ export type VideoType = {
|
|
|
196
196
|
onPlaybackStatusUpdate?: (playbackStatus: PlaybackStatus) => void;
|
|
197
197
|
onProgress?: (data: VideoProgressData) => void;
|
|
198
198
|
onReadyForDisplay?: () => void;
|
|
199
|
+
repeat?: boolean;
|
|
199
200
|
replayAsync?: () => void;
|
|
200
201
|
resizeMode?: string;
|
|
201
202
|
seek?: (progress: number) => void;
|
package/src/version.json
CHANGED