stream-chat-react-native-core 5.15.3 → 5.16.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/ImageGallery/ImageGallery.js +25 -22
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getDateSeparators.js +2 -2
- package/lib/commonjs/components/MessageList/utils/getDateSeparators.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +14 -12
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +25 -22
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/MessageList/utils/getDateSeparators.js +2 -2
- package/lib/module/components/MessageList/utils/getDateSeparators.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +14 -12
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ImageGallery/ImageGallery.tsx +4 -1
- package/src/components/MessageList/utils/getDateSeparators.ts +4 -2
- package/src/contexts/overlayContext/OverlayContext.tsx +1 -0
- package/src/contexts/overlayContext/OverlayProvider.tsx +2 -0
- package/src/version.json +1 -1
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": "5.
|
|
4
|
+
"version": "5.16.0-beta.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -131,6 +131,7 @@ type Props<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamC
|
|
|
131
131
|
| 'imageGalleryGridSnapPoints'
|
|
132
132
|
| 'imageGalleryGridHandleHeight'
|
|
133
133
|
| 'numberOfImageGalleryGridColumns'
|
|
134
|
+
| 'autoPlayVideo'
|
|
134
135
|
>;
|
|
135
136
|
|
|
136
137
|
export const ImageGallery = <
|
|
@@ -139,6 +140,7 @@ export const ImageGallery = <
|
|
|
139
140
|
props: Props<StreamChatGenerics>,
|
|
140
141
|
) => {
|
|
141
142
|
const {
|
|
143
|
+
autoPlayVideo = false,
|
|
142
144
|
giphyVersion = 'fixed_height',
|
|
143
145
|
imageGalleryCustomComponents,
|
|
144
146
|
imageGalleryGridHandleHeight,
|
|
@@ -273,6 +275,7 @@ export const ImageGallery = <
|
|
|
273
275
|
const attachmentPhotos = attachmentImages.map((a) => {
|
|
274
276
|
const imageUrl = getUrlOfImageAttachment(a) as string;
|
|
275
277
|
const giphyURL = a.giphy?.[giphyVersion]?.url || a.thumb_url || a.image_url;
|
|
278
|
+
const isInitiallyPaused = !autoPlayVideo;
|
|
276
279
|
|
|
277
280
|
return {
|
|
278
281
|
channelId: cur.cid,
|
|
@@ -283,7 +286,7 @@ export const ImageGallery = <
|
|
|
283
286
|
mime_type: a.type === 'giphy' ? getGiphyMimeType(giphyURL ?? '') : a.mime_type,
|
|
284
287
|
original_height: a.original_height,
|
|
285
288
|
original_width: a.original_width,
|
|
286
|
-
paused:
|
|
289
|
+
paused: isInitiallyPaused,
|
|
287
290
|
progress: 0,
|
|
288
291
|
type: a.type,
|
|
289
292
|
uri:
|
|
@@ -45,9 +45,11 @@ export const getDateSeparators = <
|
|
|
45
45
|
const previousMessage = messagesWithoutDeleted[i - 1];
|
|
46
46
|
const message = messagesWithoutDeleted[i];
|
|
47
47
|
|
|
48
|
-
const messageDate = message.created_at.
|
|
48
|
+
const messageDate = message.created_at.toDateString();
|
|
49
49
|
|
|
50
|
-
const prevMessageDate = previousMessage
|
|
50
|
+
const prevMessageDate = previousMessage
|
|
51
|
+
? previousMessage.created_at.toDateString()
|
|
52
|
+
: messageDate;
|
|
51
53
|
|
|
52
54
|
if (i === 0 || messageDate !== prevMessageDate) {
|
|
53
55
|
dateSeparators[message.id] = message.created_at;
|
|
@@ -58,6 +58,7 @@ export type OverlayProviderProps<
|
|
|
58
58
|
>
|
|
59
59
|
> &
|
|
60
60
|
Pick<OverlayContextValue, 'translucentStatusBar'> & {
|
|
61
|
+
autoPlayVideo?: boolean;
|
|
61
62
|
/**
|
|
62
63
|
* The giphy version to render - check the keys of the [Image Object](https://developers.giphy.com/docs/api/schema#image-object) for possible values. Uses 'fixed_height' by default
|
|
63
64
|
* */
|
|
@@ -64,6 +64,7 @@ export const OverlayProvider = <
|
|
|
64
64
|
) => {
|
|
65
65
|
const bottomSheetCloseTimeoutRef = useRef<NodeJS.Timeout>();
|
|
66
66
|
const {
|
|
67
|
+
autoPlayVideo,
|
|
67
68
|
AttachmentPickerBottomSheetHandle = DefaultAttachmentPickerBottomSheetHandle,
|
|
68
69
|
attachmentPickerBottomSheetHandleHeight,
|
|
69
70
|
attachmentPickerBottomSheetHeight,
|
|
@@ -237,6 +238,7 @@ export const OverlayProvider = <
|
|
|
237
238
|
)}
|
|
238
239
|
{overlay === 'gallery' && (
|
|
239
240
|
<ImageGallery<StreamChatGenerics>
|
|
241
|
+
autoPlayVideo={autoPlayVideo}
|
|
240
242
|
giphyVersion={giphyVersion}
|
|
241
243
|
imageGalleryCustomComponents={imageGalleryCustomComponents}
|
|
242
244
|
imageGalleryGridHandleHeight={imageGalleryGridHandleHeight}
|
package/src/version.json
CHANGED