stream-chat-react-native-core 5.15.3-beta.5 → 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/ImageGallery/components/ImageGalleryHeader.js +2 -2
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.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/ImageGallery/components/ImageGalleryHeader.js +2 -2
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.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/ImageGallery/components/ImageGalleryHeader.tsx +1 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_OverlayContext","_AttachmentPicker","_AttachmentPickerBottomSheetHandle","_AttachmentPickerError","_AttachmentPickerErrorImage","_CameraSelectorIcon","_FileSelectorIcon","_ImageOverlaySelectedComponent","_ImageSelectorIcon","_ImageGallery","_MessageOverlay","_OverlayBackdrop","_useStreami18n","_AttachmentPickerContext","_ImageGalleryContext","_MessageOverlayContext","_ThemeContext","_TranslationContext","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","OverlayProvider","props","bottomSheetCloseTimeoutRef","useRef","_props$AttachmentPick","AttachmentPickerBottomSheetHandle","DefaultAttachmentPickerBottomSheetHandle","attachmentPickerBottomSheetHandleHeight","attachmentPickerBottomSheetHeight","_props$AttachmentPick2","AttachmentPickerError","DefaultAttachmentPickerError","attachmentPickerErrorButtonText","_props$AttachmentPick3","AttachmentPickerErrorImage","DefaultAttachmentPickerErrorImage","attachmentPickerErrorText","attachmentSelectionBarHeight","bottomInset","_props$CameraSelector","CameraSelectorIcon","DefaultCameraSelectorIcon","children","_props$closePicker","closePicker","ref","_ref$current","current","close","clearTimeout","setTimeout","_ref$current2","_props$FileSelectorIc","FileSelectorIcon","DefaultFileSelectorIcon","giphyVersion","i18nInstance","imageGalleryCustomComponents","imageGalleryGridHandleHeight","imageGalleryGridSnapPoints","_props$ImageOverlaySe","ImageOverlaySelectedComponent","DefaultImageOverlaySelectedComponent","_props$ImageSelectorI","ImageSelectorIcon","DefaultImageSelectorIcon","MessageActionList","MessageActionListItem","messageTextNumberOfLines","numberOfAttachmentImagesToLoadPerCall","numberOfAttachmentPickerImageColumns","numberOfImageGalleryGridColumns","_props$openPicker","openPicker","_ref$current3","snapToIndex","console","warn","topInset","translucentStatusBar","OverlayReactionList","OverlayReactions","OverlayReactionsAvatar","value","attachmentPickerProps","bottomSheetRef","_useState","useState","overlay","_useState2","_slicedToArray2","setOverlay","overlayOpacity","useSharedValue","_Dimensions$get","Dimensions","height","width","translators","useStreami18n","useEffect","backAction","backHandler","BackHandler","addEventListener","remove","cancelAnimation","withTiming","attachmentPickerContext","overlayStyle","useAnimatedStyle","opacity","overlayContext","style","createElement","TranslationProvider","_extends2","userLanguage","DEFAULT_USER_LANGUAGE","__self","__source","fileName","lineNumber","columnNumber","OverlayContext","Provider","MessageOverlayProvider","AttachmentPickerProvider","ImageGalleryProvider","ThemeProvider","View","pointerEvents","StyleSheet","absoluteFill","OverlayBackdrop","MessageOverlay","ImageGallery","AttachmentPicker","exports"],"sources":["OverlayProvider.tsx"],"sourcesContent":["import React, { PropsWithChildren, useEffect, useRef, useState } from 'react';\n\nimport { BackHandler, Dimensions, StyleSheet, ViewStyle } from 'react-native';\n\nimport Animated, {\n cancelAnimation,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport type BottomSheet from '@gorhom/bottom-sheet';\n\nimport { OverlayContext, OverlayProviderProps } from './OverlayContext';\n\nimport { AttachmentPicker } from '../../components/AttachmentPicker/AttachmentPicker';\n\nimport { AttachmentPickerBottomSheetHandle as DefaultAttachmentPickerBottomSheetHandle } from '../../components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle';\nimport { AttachmentPickerError as DefaultAttachmentPickerError } from '../../components/AttachmentPicker/components/AttachmentPickerError';\nimport { AttachmentPickerErrorImage as DefaultAttachmentPickerErrorImage } from '../../components/AttachmentPicker/components/AttachmentPickerErrorImage';\nimport { CameraSelectorIcon as DefaultCameraSelectorIcon } from '../../components/AttachmentPicker/components/CameraSelectorIcon';\nimport { FileSelectorIcon as DefaultFileSelectorIcon } from '../../components/AttachmentPicker/components/FileSelectorIcon';\nimport { ImageOverlaySelectedComponent as DefaultImageOverlaySelectedComponent } from '../../components/AttachmentPicker/components/ImageOverlaySelectedComponent';\nimport { ImageSelectorIcon as DefaultImageSelectorIcon } from '../../components/AttachmentPicker/components/ImageSelectorIcon';\nimport { ImageGallery } from '../../components/ImageGallery/ImageGallery';\nimport { MessageOverlay } from '../../components/MessageOverlay/MessageOverlay';\nimport { OverlayBackdrop } from '../../components/MessageOverlay/OverlayBackdrop';\nimport { useStreami18n } from '../../hooks/useStreami18n';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { AttachmentPickerProvider } from '../attachmentPickerContext/AttachmentPickerContext';\nimport { ImageGalleryProvider } from '../imageGalleryContext/ImageGalleryContext';\nimport { MessageOverlayProvider } from '../messageOverlayContext/MessageOverlayContext';\nimport { ThemeProvider } from '../themeContext/ThemeContext';\nimport {\n DEFAULT_USER_LANGUAGE,\n TranslationProvider,\n} from '../translationContext/TranslationContext';\n\n/**\n * - The highest level of these components is the `OverlayProvider`. The `OverlayProvider` allows users to interact with messages on long press above the underlying views, use the full screen image viewer, and use the `AttachmentPicker` as a keyboard-esk view.\n * Because these views must exist above all others `OverlayProvider` should wrap your navigation stack as well. Assuming [`React Navigation`](https://reactnavigation.org/) is being used, your highest level navigation stack should be wrapped in the provider:\n *\n * ```js\n * <NavigationContainer>\n * <OverlayProvider>\n * <Stack.Navigator>\n * <Stack.Screen />\n * </Stack.Navigator>\n * </OverlayProvider>\n * </NavigationContainer>\n * ```\n *\n * - Don't forget to check our cookbook section of [OverlayProvider](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#overlayprovider)\n *\n * - Also check the [visual component guide](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#custom-components), to learn about component customizations.\n *\n * @example ./OverlayProvider.md\n */\nexport const OverlayProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<OverlayProviderProps<StreamChatGenerics>>,\n) => {\n const bottomSheetCloseTimeoutRef = useRef<NodeJS.Timeout>();\n const {\n AttachmentPickerBottomSheetHandle = DefaultAttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError = DefaultAttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage = DefaultAttachmentPickerErrorImage,\n attachmentPickerErrorText,\n attachmentSelectionBarHeight,\n bottomInset,\n CameraSelectorIcon = DefaultCameraSelectorIcon,\n children,\n closePicker = (ref) => {\n if (ref.current?.close) {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n ref.current.close();\n // Attempt to close the bottomsheet again to circumvent accidental opening on Android.\n // Details: This to prevent a race condition where the close function is called during the point when a internal container layout happens within the bottomsheet due to keyboard affecting the layout\n // If the container layout measures a shorter height than previous but if the close snapped to the previous height's position, the bottom sheet will show up\n // this short delay ensures that close function is always called after a container layout due to keyboard change\n // NOTE: this timeout has to be above 500 as the keyboardAnimationDuration is 500 in the bottomsheet library - see src/hooks/useKeyboard.ts there for more details\n bottomSheetCloseTimeoutRef.current = setTimeout(() => {\n ref.current?.close();\n }, 600);\n }\n },\n FileSelectorIcon = DefaultFileSelectorIcon,\n giphyVersion,\n i18nInstance,\n imageGalleryCustomComponents,\n imageGalleryGridHandleHeight,\n imageGalleryGridSnapPoints,\n ImageOverlaySelectedComponent = DefaultImageOverlaySelectedComponent,\n ImageSelectorIcon = DefaultImageSelectorIcon,\n MessageActionList,\n MessageActionListItem,\n messageTextNumberOfLines,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n numberOfImageGalleryGridColumns,\n openPicker = (ref) => {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n if (ref.current?.snapToIndex) {\n ref.current.snapToIndex(0);\n } else {\n console.warn('bottom and top insets must be set for the image picker to work correctly');\n }\n },\n topInset,\n translucentStatusBar,\n OverlayReactionList,\n OverlayReactions,\n OverlayReactionsAvatar,\n value,\n } = props;\n\n const attachmentPickerProps = {\n AttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage,\n attachmentPickerErrorText,\n attachmentSelectionBarHeight,\n ImageOverlaySelectedComponent,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n translucentStatusBar,\n };\n\n const bottomSheetRef = useRef<BottomSheet>(null);\n\n const [overlay, setOverlay] = useState(value?.overlay || 'none');\n\n const overlayOpacity = useSharedValue(0);\n const { height, width } = Dimensions.get('screen');\n\n // Setup translators\n const translators = useStreami18n(i18nInstance);\n\n useEffect(() => {\n const backAction = () => {\n if (overlay !== 'none') {\n setOverlay('none');\n return true;\n }\n\n return false;\n };\n\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [overlay]);\n\n useEffect(\n () =>\n // cleanup the timeout if the component unmounts\n () => {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n },\n [],\n );\n\n useEffect(() => {\n closePicker(bottomSheetRef);\n cancelAnimation(overlayOpacity);\n if (overlay !== 'none') {\n overlayOpacity.value = withTiming(1);\n } else {\n overlayOpacity.value = withTiming(0);\n }\n }, [overlay]);\n\n const attachmentPickerContext = {\n attachmentPickerBottomSheetHeight,\n attachmentSelectionBarHeight,\n bottomInset,\n CameraSelectorIcon,\n closePicker: () => closePicker(bottomSheetRef),\n FileSelectorIcon,\n ImageSelectorIcon,\n openPicker: () => openPicker(bottomSheetRef),\n topInset,\n };\n\n const overlayStyle = useAnimatedStyle<ViewStyle>(\n () => ({\n opacity: overlayOpacity.value,\n }),\n [],\n );\n\n const overlayContext = {\n overlay,\n setOverlay,\n style: value?.style,\n translucentStatusBar,\n };\n\n return (\n <TranslationProvider value={{ ...translators, userLanguage: DEFAULT_USER_LANGUAGE }}>\n <OverlayContext.Provider value={overlayContext}>\n <MessageOverlayProvider<StreamChatGenerics>>\n <AttachmentPickerProvider value={attachmentPickerContext}>\n <ImageGalleryProvider>\n {children}\n <ThemeProvider style={overlayContext.style}>\n <Animated.View\n pointerEvents={overlay === 'none' ? 'none' : 'auto'}\n style={[StyleSheet.absoluteFill, overlayStyle]}\n >\n <OverlayBackdrop style={[StyleSheet.absoluteFill, { height, width }]} />\n </Animated.View>\n {overlay === 'message' && (\n <MessageOverlay<StreamChatGenerics>\n MessageActionList={MessageActionList}\n MessageActionListItem={MessageActionListItem}\n messageTextNumberOfLines={messageTextNumberOfLines}\n overlayOpacity={overlayOpacity}\n OverlayReactionList={OverlayReactionList}\n OverlayReactions={OverlayReactions}\n OverlayReactionsAvatar={OverlayReactionsAvatar}\n />\n )}\n {overlay === 'gallery' && (\n <ImageGallery<StreamChatGenerics>\n giphyVersion={giphyVersion}\n imageGalleryCustomComponents={imageGalleryCustomComponents}\n imageGalleryGridHandleHeight={imageGalleryGridHandleHeight}\n imageGalleryGridSnapPoints={imageGalleryGridSnapPoints}\n numberOfImageGalleryGridColumns={numberOfImageGalleryGridColumns}\n overlayOpacity={overlayOpacity}\n />\n )}\n <AttachmentPicker ref={bottomSheetRef} {...attachmentPickerProps} />\n </ThemeProvider>\n </ImageGalleryProvider>\n </AttachmentPickerProvider>\n </MessageOverlayProvider>\n </OverlayContext.Provider>\n </TranslationProvider>\n );\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AASA,IAAAG,eAAA,GAAAH,OAAA;AAEA,IAAAI,iBAAA,GAAAJ,OAAA;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H,YAAA;MAAA6H,UAAA;MAAAC,YAAA;IAAA;EAAA,CAChC,CACF,EACDtJ,MAAA,YAAA6I,aAAA,CAACvI,iBAAA,CAAA8J,gBAAgB,MAAArB,SAAA;IAACvE,GAAG,EAAEwC;EAAe,GAAKD,qBAAqB;IAAAmC,MAAA,EAAA3H,KAAA;IAAA4H,QAAA;MAAAC,QAAA,EAAA5H,YAAA;MAAA6H,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAG,CACtD,CACK,CACE,CACJ,CACD,CACN,CAAC;AAE1B,CAAC;AAACe,OAAA,CAAAtH,eAAA,GAAAA,eAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_OverlayContext","_AttachmentPicker","_AttachmentPickerBottomSheetHandle","_AttachmentPickerError","_AttachmentPickerErrorImage","_CameraSelectorIcon","_FileSelectorIcon","_ImageOverlaySelectedComponent","_ImageSelectorIcon","_ImageGallery","_MessageOverlay","_OverlayBackdrop","_useStreami18n","_AttachmentPickerContext","_ImageGalleryContext","_MessageOverlayContext","_ThemeContext","_TranslationContext","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","OverlayProvider","props","bottomSheetCloseTimeoutRef","useRef","autoPlayVideo","_props$AttachmentPick","AttachmentPickerBottomSheetHandle","DefaultAttachmentPickerBottomSheetHandle","attachmentPickerBottomSheetHandleHeight","attachmentPickerBottomSheetHeight","_props$AttachmentPick2","AttachmentPickerError","DefaultAttachmentPickerError","attachmentPickerErrorButtonText","_props$AttachmentPick3","AttachmentPickerErrorImage","DefaultAttachmentPickerErrorImage","attachmentPickerErrorText","attachmentSelectionBarHeight","bottomInset","_props$CameraSelector","CameraSelectorIcon","DefaultCameraSelectorIcon","children","_props$closePicker","closePicker","ref","_ref$current","current","close","clearTimeout","setTimeout","_ref$current2","_props$FileSelectorIc","FileSelectorIcon","DefaultFileSelectorIcon","giphyVersion","i18nInstance","imageGalleryCustomComponents","imageGalleryGridHandleHeight","imageGalleryGridSnapPoints","_props$ImageOverlaySe","ImageOverlaySelectedComponent","DefaultImageOverlaySelectedComponent","_props$ImageSelectorI","ImageSelectorIcon","DefaultImageSelectorIcon","MessageActionList","MessageActionListItem","messageTextNumberOfLines","numberOfAttachmentImagesToLoadPerCall","numberOfAttachmentPickerImageColumns","numberOfImageGalleryGridColumns","_props$openPicker","openPicker","_ref$current3","snapToIndex","console","warn","topInset","translucentStatusBar","OverlayReactionList","OverlayReactions","OverlayReactionsAvatar","value","attachmentPickerProps","bottomSheetRef","_useState","useState","overlay","_useState2","_slicedToArray2","setOverlay","overlayOpacity","useSharedValue","_Dimensions$get","Dimensions","height","width","translators","useStreami18n","useEffect","backAction","backHandler","BackHandler","addEventListener","remove","cancelAnimation","withTiming","attachmentPickerContext","overlayStyle","useAnimatedStyle","opacity","overlayContext","style","createElement","TranslationProvider","_extends2","userLanguage","DEFAULT_USER_LANGUAGE","__self","__source","fileName","lineNumber","columnNumber","OverlayContext","Provider","MessageOverlayProvider","AttachmentPickerProvider","ImageGalleryProvider","ThemeProvider","View","pointerEvents","StyleSheet","absoluteFill","OverlayBackdrop","MessageOverlay","ImageGallery","AttachmentPicker","exports"],"sources":["OverlayProvider.tsx"],"sourcesContent":["import React, { PropsWithChildren, useEffect, useRef, useState } from 'react';\n\nimport { BackHandler, Dimensions, StyleSheet, ViewStyle } from 'react-native';\n\nimport Animated, {\n cancelAnimation,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport type BottomSheet from '@gorhom/bottom-sheet';\n\nimport { OverlayContext, OverlayProviderProps } from './OverlayContext';\n\nimport { AttachmentPicker } from '../../components/AttachmentPicker/AttachmentPicker';\n\nimport { AttachmentPickerBottomSheetHandle as DefaultAttachmentPickerBottomSheetHandle } from '../../components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle';\nimport { AttachmentPickerError as DefaultAttachmentPickerError } from '../../components/AttachmentPicker/components/AttachmentPickerError';\nimport { AttachmentPickerErrorImage as DefaultAttachmentPickerErrorImage } from '../../components/AttachmentPicker/components/AttachmentPickerErrorImage';\nimport { CameraSelectorIcon as DefaultCameraSelectorIcon } from '../../components/AttachmentPicker/components/CameraSelectorIcon';\nimport { FileSelectorIcon as DefaultFileSelectorIcon } from '../../components/AttachmentPicker/components/FileSelectorIcon';\nimport { ImageOverlaySelectedComponent as DefaultImageOverlaySelectedComponent } from '../../components/AttachmentPicker/components/ImageOverlaySelectedComponent';\nimport { ImageSelectorIcon as DefaultImageSelectorIcon } from '../../components/AttachmentPicker/components/ImageSelectorIcon';\nimport { ImageGallery } from '../../components/ImageGallery/ImageGallery';\nimport { MessageOverlay } from '../../components/MessageOverlay/MessageOverlay';\nimport { OverlayBackdrop } from '../../components/MessageOverlay/OverlayBackdrop';\nimport { useStreami18n } from '../../hooks/useStreami18n';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { AttachmentPickerProvider } from '../attachmentPickerContext/AttachmentPickerContext';\nimport { ImageGalleryProvider } from '../imageGalleryContext/ImageGalleryContext';\nimport { MessageOverlayProvider } from '../messageOverlayContext/MessageOverlayContext';\nimport { ThemeProvider } from '../themeContext/ThemeContext';\nimport {\n DEFAULT_USER_LANGUAGE,\n TranslationProvider,\n} from '../translationContext/TranslationContext';\n\n/**\n * - The highest level of these components is the `OverlayProvider`. The `OverlayProvider` allows users to interact with messages on long press above the underlying views, use the full screen image viewer, and use the `AttachmentPicker` as a keyboard-esk view.\n * Because these views must exist above all others `OverlayProvider` should wrap your navigation stack as well. Assuming [`React Navigation`](https://reactnavigation.org/) is being used, your highest level navigation stack should be wrapped in the provider:\n *\n * ```js\n * <NavigationContainer>\n * <OverlayProvider>\n * <Stack.Navigator>\n * <Stack.Screen />\n * </Stack.Navigator>\n * </OverlayProvider>\n * </NavigationContainer>\n * ```\n *\n * - Don't forget to check our cookbook section of [OverlayProvider](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#overlayprovider)\n *\n * - Also check the [visual component guide](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#custom-components), to learn about component customizations.\n *\n * @example ./OverlayProvider.md\n */\nexport const OverlayProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<OverlayProviderProps<StreamChatGenerics>>,\n) => {\n const bottomSheetCloseTimeoutRef = useRef<NodeJS.Timeout>();\n const {\n autoPlayVideo,\n AttachmentPickerBottomSheetHandle = DefaultAttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError = DefaultAttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage = DefaultAttachmentPickerErrorImage,\n attachmentPickerErrorText,\n attachmentSelectionBarHeight,\n bottomInset,\n CameraSelectorIcon = DefaultCameraSelectorIcon,\n children,\n closePicker = (ref) => {\n if (ref.current?.close) {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n ref.current.close();\n // Attempt to close the bottomsheet again to circumvent accidental opening on Android.\n // Details: This to prevent a race condition where the close function is called during the point when a internal container layout happens within the bottomsheet due to keyboard affecting the layout\n // If the container layout measures a shorter height than previous but if the close snapped to the previous height's position, the bottom sheet will show up\n // this short delay ensures that close function is always called after a container layout due to keyboard change\n // NOTE: this timeout has to be above 500 as the keyboardAnimationDuration is 500 in the bottomsheet library - see src/hooks/useKeyboard.ts there for more details\n bottomSheetCloseTimeoutRef.current = setTimeout(() => {\n ref.current?.close();\n }, 600);\n }\n },\n FileSelectorIcon = DefaultFileSelectorIcon,\n giphyVersion,\n i18nInstance,\n imageGalleryCustomComponents,\n imageGalleryGridHandleHeight,\n imageGalleryGridSnapPoints,\n ImageOverlaySelectedComponent = DefaultImageOverlaySelectedComponent,\n ImageSelectorIcon = DefaultImageSelectorIcon,\n MessageActionList,\n MessageActionListItem,\n messageTextNumberOfLines,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n numberOfImageGalleryGridColumns,\n openPicker = (ref) => {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n if (ref.current?.snapToIndex) {\n ref.current.snapToIndex(0);\n } else {\n console.warn('bottom and top insets must be set for the image picker to work correctly');\n }\n },\n topInset,\n translucentStatusBar,\n OverlayReactionList,\n OverlayReactions,\n OverlayReactionsAvatar,\n value,\n } = props;\n\n const attachmentPickerProps = {\n AttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage,\n attachmentPickerErrorText,\n attachmentSelectionBarHeight,\n ImageOverlaySelectedComponent,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n translucentStatusBar,\n };\n\n const bottomSheetRef = useRef<BottomSheet>(null);\n\n const [overlay, setOverlay] = useState(value?.overlay || 'none');\n\n const overlayOpacity = useSharedValue(0);\n const { height, width } = Dimensions.get('screen');\n\n // Setup translators\n const translators = useStreami18n(i18nInstance);\n\n useEffect(() => {\n const backAction = () => {\n if (overlay !== 'none') {\n setOverlay('none');\n return true;\n }\n\n return false;\n };\n\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [overlay]);\n\n useEffect(\n () =>\n // cleanup the timeout if the component unmounts\n () => {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n },\n [],\n );\n\n useEffect(() => {\n closePicker(bottomSheetRef);\n cancelAnimation(overlayOpacity);\n if (overlay !== 'none') {\n overlayOpacity.value = withTiming(1);\n } else {\n overlayOpacity.value = withTiming(0);\n }\n }, [overlay]);\n\n const attachmentPickerContext = {\n attachmentPickerBottomSheetHeight,\n attachmentSelectionBarHeight,\n bottomInset,\n CameraSelectorIcon,\n closePicker: () => closePicker(bottomSheetRef),\n FileSelectorIcon,\n ImageSelectorIcon,\n openPicker: () => openPicker(bottomSheetRef),\n topInset,\n };\n\n const overlayStyle = useAnimatedStyle<ViewStyle>(\n () => ({\n opacity: overlayOpacity.value,\n }),\n [],\n );\n\n const overlayContext = {\n overlay,\n setOverlay,\n style: value?.style,\n translucentStatusBar,\n };\n\n return (\n <TranslationProvider value={{ ...translators, userLanguage: DEFAULT_USER_LANGUAGE }}>\n <OverlayContext.Provider value={overlayContext}>\n <MessageOverlayProvider<StreamChatGenerics>>\n <AttachmentPickerProvider value={attachmentPickerContext}>\n <ImageGalleryProvider>\n {children}\n <ThemeProvider style={overlayContext.style}>\n <Animated.View\n pointerEvents={overlay === 'none' ? 'none' : 'auto'}\n style={[StyleSheet.absoluteFill, overlayStyle]}\n >\n <OverlayBackdrop style={[StyleSheet.absoluteFill, { height, width }]} />\n </Animated.View>\n {overlay === 'message' && (\n <MessageOverlay<StreamChatGenerics>\n MessageActionList={MessageActionList}\n MessageActionListItem={MessageActionListItem}\n messageTextNumberOfLines={messageTextNumberOfLines}\n overlayOpacity={overlayOpacity}\n OverlayReactionList={OverlayReactionList}\n OverlayReactions={OverlayReactions}\n OverlayReactionsAvatar={OverlayReactionsAvatar}\n />\n )}\n {overlay === 'gallery' && (\n <ImageGallery<StreamChatGenerics>\n autoPlayVideo={autoPlayVideo}\n giphyVersion={giphyVersion}\n imageGalleryCustomComponents={imageGalleryCustomComponents}\n imageGalleryGridHandleHeight={imageGalleryGridHandleHeight}\n imageGalleryGridSnapPoints={imageGalleryGridSnapPoints}\n numberOfImageGalleryGridColumns={numberOfImageGalleryGridColumns}\n overlayOpacity={overlayOpacity}\n />\n )}\n <AttachmentPicker ref={bottomSheetRef} {...attachmentPickerProps} />\n </ThemeProvider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C,YAAA;IAAA;EAAA,CAChD,CACF,EACAnC,OAAO,KAAK,SAAS,IACpBpH,MAAA,YAAA8I,aAAA,CAAChI,aAAA,CAAAsJ,YAAY;IACXjH,aAAa,EAAEA,aAAc;IAC7BgC,YAAY,EAAEA,YAAa;IAC3BE,4BAA4B,EAAEA,4BAA6B;IAC3DC,4BAA4B,EAAEA,4BAA6B;IAC3DC,0BAA0B,EAAEA,0BAA2B;IACvDY,+BAA+B,EAAEA,+BAAgC;IACjEqB,cAAc,EAAEA,cAAe;IAAA2B,MAAA,EAAA5H,KAAA;IAAA6H,QAAA;MAAAC,QAAA,EAAA7H,YAAA;MAAA8H,UAAA;MAAAC,YAAA;IAAA;EAAA,CAChC,CACF,EACDvJ,MAAA,YAAA8I,aAAA,CAACxI,iBAAA,CAAA+J,gBAAgB,MAAArB,SAAA;IAACvE,GAAG,EAAEwC;EAAe,GAAKD,qBAAqB;IAAAmC,MAAA,EAAA5H,KAAA;IAAA6H,QAAA;MAAAC,QAAA,EAAA7H,YAAA;MAAA8H,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAG,CACtD,CACK,CACE,CACJ,CACD,CACN,CAAC;AAE1B,CAAC;AAACe,OAAA,CAAAvH,eAAA,GAAAA,eAAA"}
|
package/lib/module/version.json
CHANGED
|
@@ -57,7 +57,7 @@ export declare type ImageGalleryCustomComponents<StreamChatGenerics extends Defa
|
|
|
57
57
|
};
|
|
58
58
|
declare type Props<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = ImageGalleryCustomComponents<StreamChatGenerics> & {
|
|
59
59
|
overlayOpacity: Animated.SharedValue<number>;
|
|
60
|
-
} & Pick<OverlayProviderProps<StreamChatGenerics>, 'giphyVersion' | 'imageGalleryGridSnapPoints' | 'imageGalleryGridHandleHeight' | 'numberOfImageGalleryGridColumns'>;
|
|
60
|
+
} & Pick<OverlayProviderProps<StreamChatGenerics>, 'giphyVersion' | 'imageGalleryGridSnapPoints' | 'imageGalleryGridHandleHeight' | 'numberOfImageGalleryGridColumns' | 'autoPlayVideo'>;
|
|
61
61
|
export declare const ImageGallery: {
|
|
62
62
|
<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: Props<StreamChatGenerics>): JSX.Element;
|
|
63
63
|
displayName: string;
|
|
@@ -19,6 +19,7 @@ export declare type OverlayContextValue = {
|
|
|
19
19
|
};
|
|
20
20
|
export declare const OverlayContext: React.Context<OverlayContextValue>;
|
|
21
21
|
export declare type OverlayProviderProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Partial<AttachmentPickerProps> & Partial<Pick<AttachmentPickerContextValue, 'attachmentPickerBottomSheetHeight' | 'attachmentSelectionBarHeight' | 'bottomInset' | 'CameraSelectorIcon' | 'FileSelectorIcon' | 'ImageSelectorIcon' | 'topInset'>> & ImageGalleryCustomComponents<StreamChatGenerics> & Partial<Pick<MessageOverlayContextValue<StreamChatGenerics>, 'MessageActionList' | 'MessageActionListItem' | 'OverlayReactionList' | 'OverlayReactions' | 'OverlayReactionsAvatar'>> & Pick<OverlayContextValue, 'translucentStatusBar'> & {
|
|
22
|
+
autoPlayVideo?: boolean;
|
|
22
23
|
/**
|
|
23
24
|
* 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
|
|
24
25
|
* */
|
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:
|
|
@@ -178,7 +178,7 @@ export const ImageGalleryHeader = <
|
|
|
178
178
|
) : (
|
|
179
179
|
<View style={[styles.centerContainer, centerContainer]}>
|
|
180
180
|
<Text style={[styles.userName, { color: black }, usernameText]}>
|
|
181
|
-
{photo?.user?.name || t('Unknown User')}
|
|
181
|
+
{photo?.user?.name || photo?.user?.id || t('Unknown User')}
|
|
182
182
|
</Text>
|
|
183
183
|
{date && <Text style={[styles.date, { color: black }, dateText]}>{date}</Text>}
|
|
184
184
|
</View>
|
|
@@ -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