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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeGestureHandler","_reactNativeReanimated","_bottomSheet","_AnimatedGalleryImage","_AnimatedGalleryVideo","_ImageGalleryFooter","_ImageGalleryHeader","_ImageGalleryOverlay","_ImageGrid","_ImageGridHandle","_useImageGalleryGestures","_ImageGalleryContext","_OverlayContext","_ThemeContext","_native","_getResizedImageUrl","_getUrlOfImageAttachment","_utils","_getGiphyMimeType","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","isAndroid","Platform","OS","fullScreenHeight","Dimensions","height","measuredScreenHeight","vh","screenWidth","vw","halfScreenWidth","MARGIN","HasPinched","exports","IsSwiping","ImageGallery","props","_StatusBar$currentHei","_imageGalleryAttachme","_props$giphyVersion","giphyVersion","imageGalleryCustomComponents","imageGalleryGridHandleHeight","imageGalleryGridSnapPoints","numberOfImageGalleryGridColumns","overlayOpacity","_useState","useState","_useState2","_slicedToArray2","imageGalleryAttachments","setImageGalleryAttachments","_useTheme","useTheme","_useTheme$theme","theme","white_snow","colors","_useTheme$theme$image","imageGallery","backgroundColor","pager","slide","_useState3","_useState4","gridPhotos","setGridPhotos","_useOverlayContext","useOverlayContext","overlay","translucentStatusBar","_useImageGalleryConte","useImageGalleryContext","messages","selectedMessage","setSelectedMessage","statusBarHeight","StatusBar","currentHeight","bottomBarHeight","androidScreenHeightAdjustment","screenHeight","halfScreenHeight","quarterScreenHeight","snapPoints","React","useMemo","bottomSheetModalRef","useRef","_useState5","_useState6","currentBottomSheetIndex","setCurrentBottomSheetIndex","animatedBottomSheetIndex","useSharedValue","screenTranslateY","showScreen","value","withTiming","duration","easing","Easing","out","ease","useEffect","Keyboard","dismiss","_useState7","_useState8","currentImageHeight","setCurrentImageHeight","_useState9","_useState10","selectedIndex","setSelectedIndex","index","headerFooterVisible","doubleTapRef","panRef","pinchRef","singleTapRef","translateX","translateY","offsetScale","scale","translationX","photos","reduce","acc","cur","_cur$attachments","attachmentImages","attachments","filter","attachment","_attachment$giphy","_attachment$giphy$gip","type","giphy","url","thumb_url","image_url","title_link","og_scrape_url","getUrlOfImageAttachment","isVideoPackageAvailable","reverse","attachmentPhotos","map","a","_a$giphy","_a$giphy$giphyVersion","imageUrl","giphyURL","channelId","cid","created_at","id","messageId","mime_type","getGiphyMimeType","original_height","original_width","paused","progress","uri","getResizedImageUrl","width","user","user_id","concat","_toConsumableArray2","photoLength","length","stripQueryFromUrl","split","updatePosition","newIndex","runOnJS","findIndex","photo","runOnUI","uriForCurrentImage","imageHeight","Math","floor","Image","getSize","_useImageGalleryGestu","useImageGalleryGestures","onDoubleTap","onPan","onPinch","onSingleTap","headerFooterOpacity","useDerivedValue","pagerStyle","useAnimatedStyle","transform","scaleX","containerBackground","opacity","showScreenStyle","closeGridView","_bottomSheetModalRef$","current","close","openGridView","_bottomSheetModalRef$2","present","handleEnd","handlePlayPause","handleProgress","videoRef","handleLoad","prevImageGalleryAttachment","imageGalleryAttachment","_extends2","hasEnd","prevImageGalleryAttachments","pausedStatus","onPlayPause","status","undefined","createElement","View","accessibilityLabel","pointerEvents","style","StyleSheet","absoluteFillObject","__self","__source","fileName","lineNumber","columnNumber","TapGestureHandler","minPointers","numberOfTaps","onGestureEvent","ref","waitFor","maxDeltaX","maxDeltaY","maxDist","PinchGestureHandler","simultaneousHandlers","absoluteFill","PanGestureHandler","enabled","maxPointers","minDist","styles","animatedContainer","i","AnimatedGalleryVideo","attachmentId","previous","repeat","selected","shouldRender","abs","source","marginRight","AnimatedGalleryImage","ImageGalleryHeader","visible","header","ImageGalleryFooter","footer","ImageGalleryOverlay","BottomSheetModalProvider","BottomSheetModal","animatedIndex","enablePanDownToClose","handleComponent","ImageGridHandle","gridHandle","handleHeight","onChange","ImageGrid","grid","clamp","lowerBound","upperBound","min","max","create","alignItems","flexDirection","displayName"],"sources":["ImageGallery.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport {\n Dimensions,\n Image,\n ImageStyle,\n Keyboard,\n Platform,\n StatusBar,\n StyleSheet,\n ViewStyle,\n} from 'react-native';\n\nimport {\n PanGestureHandler,\n PinchGestureHandler,\n TapGestureHandler,\n} from 'react-native-gesture-handler';\n\nimport Animated, {\n Easing,\n runOnJS,\n runOnUI,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { BottomSheetModal, BottomSheetModalProvider } from '@gorhom/bottom-sheet';\n\nimport type { UserResponse } from 'stream-chat';\n\nimport { AnimatedGalleryImage } from './components/AnimatedGalleryImage';\nimport { AnimatedGalleryVideo } from './components/AnimatedGalleryVideo';\nimport {\n ImageGalleryFooter,\n ImageGalleryFooterCustomComponentProps,\n} from './components/ImageGalleryFooter';\nimport {\n ImageGalleryHeader,\n ImageGalleryHeaderCustomComponentProps,\n} from './components/ImageGalleryHeader';\nimport { ImageGalleryOverlay } from './components/ImageGalleryOverlay';\nimport { ImageGalleryGridImageComponents, ImageGrid } from './components/ImageGrid';\nimport {\n ImageGalleryGridHandleCustomComponentProps,\n ImageGridHandle,\n} from './components/ImageGridHandle';\n\nimport { useImageGalleryGestures } from './hooks/useImageGalleryGestures';\n\nimport { useImageGalleryContext } from '../../contexts/imageGalleryContext/ImageGalleryContext';\nimport {\n OverlayProviderProps,\n useOverlayContext,\n} from '../../contexts/overlayContext/OverlayContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { isVideoPackageAvailable, VideoType } from '../../native';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { getResizedImageUrl } from '../../utils/getResizedImageUrl';\nimport { getUrlOfImageAttachment } from '../../utils/getUrlOfImageAttachment';\nimport { vh, vw } from '../../utils/utils';\nimport { getGiphyMimeType } from '../Attachment/utils/getGiphyMimeType';\n\nconst isAndroid = Platform.OS === 'android';\nconst fullScreenHeight = Dimensions.get('screen').height;\nconst measuredScreenHeight = vh(100);\nconst screenWidth = vw(100);\nconst halfScreenWidth = vw(50);\nconst MARGIN = 32;\n\nexport enum HasPinched {\n FALSE = 0,\n TRUE,\n}\n\nexport enum IsSwiping {\n UNDETERMINED = 0,\n TRUE,\n FALSE,\n}\n\nexport type ImageGalleryCustomComponents<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Override props for following UI components, which are part of [image gallery](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#gallery-components).\n *\n * - [ImageGalleryFooter](#ImageGalleryFooter)\n *\n * - [ImageGrid](#ImageGrid)\n *\n * - [ImageGridHandle](#ImageGridHandle)\n *\n * - [ImageGalleryHeader](#ImageGalleryHeader)\n *\n * e.g.,\n *\n * ```js\n * {\n * footer: {\n * ShareIcon: CustomShareIconComponent\n * },\n * grid: {\n * avatarComponent: CustomAvatarComponent\n * },\n * gridHandle: {\n * centerComponent: CustomCenterComponent\n * },\n * header: {\n * CloseIcon: CustomCloseButtonComponent\n * },\n * }\n * ```\n * @overrideType object\n */\n imageGalleryCustomComponents?: {\n footer?: ImageGalleryFooterCustomComponentProps<StreamChatGenerics>;\n grid?: ImageGalleryGridImageComponents<StreamChatGenerics>;\n gridHandle?: ImageGalleryGridHandleCustomComponentProps;\n header?: ImageGalleryHeaderCustomComponentProps<StreamChatGenerics>;\n };\n};\n\ntype Props<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> =\n ImageGalleryCustomComponents<StreamChatGenerics> & {\n overlayOpacity: Animated.SharedValue<number>;\n } & Pick<\n OverlayProviderProps<StreamChatGenerics>,\n | 'giphyVersion'\n | 'imageGalleryGridSnapPoints'\n | 'imageGalleryGridHandleHeight'\n | 'numberOfImageGalleryGridColumns'\n >;\n\nexport const ImageGallery = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: Props<StreamChatGenerics>,\n) => {\n const {\n giphyVersion = 'fixed_height',\n imageGalleryCustomComponents,\n imageGalleryGridHandleHeight,\n imageGalleryGridSnapPoints,\n numberOfImageGalleryGridColumns,\n overlayOpacity,\n } = props;\n const [imageGalleryAttachments, setImageGalleryAttachments] = useState<\n Photo<StreamChatGenerics>[]\n >([]);\n const {\n theme: {\n colors: { white_snow },\n imageGallery: { backgroundColor, pager, slide },\n },\n } = useTheme();\n const [gridPhotos, setGridPhotos] = useState<Photo<StreamChatGenerics>[]>([]);\n const { overlay, translucentStatusBar } = useOverlayContext();\n const { messages, selectedMessage, setSelectedMessage } =\n useImageGalleryContext<StreamChatGenerics>();\n\n /**\n * Height constants\n */\n const statusBarHeight = StatusBar.currentHeight ?? 0;\n const bottomBarHeight = fullScreenHeight - measuredScreenHeight - statusBarHeight;\n const androidScreenHeightAdjustment = translucentStatusBar\n ? bottomBarHeight === statusBarHeight || bottomBarHeight < 0\n ? 0\n : statusBarHeight\n : bottomBarHeight === statusBarHeight || bottomBarHeight < 0\n ? -statusBarHeight\n : 0;\n const screenHeight = isAndroid\n ? Dimensions.get('window').height + androidScreenHeightAdjustment\n : vh(100);\n const halfScreenHeight = screenHeight / 2;\n const quarterScreenHeight = screenHeight / 4;\n const snapPoints = React.useMemo(\n () => [(screenHeight * 3) / 4, screenHeight - (imageGalleryGridHandleHeight ?? 40)],\n [],\n );\n\n /**\n * BottomSheetModal ref\n */\n const bottomSheetModalRef = useRef<BottomSheetModal>(null);\n\n /**\n * BottomSheetModal state\n */\n const [currentBottomSheetIndex, setCurrentBottomSheetIndex] = useState(0);\n const animatedBottomSheetIndex = useSharedValue(0);\n\n /**\n * Fade animation for screen, it is always rendered with pointerEvents\n * set to none for fast opening\n */\n const screenTranslateY = useSharedValue(screenHeight);\n const showScreen = () => {\n 'worklet';\n screenTranslateY.value = withTiming(0, {\n duration: 250,\n easing: Easing.out(Easing.ease),\n });\n };\n\n /**\n * Run the fade animation on visible change\n */\n useEffect(() => {\n Keyboard.dismiss();\n showScreen();\n }, []);\n\n /**\n * Image height from URL or default to full screen height\n */\n const [currentImageHeight, setCurrentImageHeight] = useState<number>(screenHeight);\n\n /**\n * JS and UI index values, the JS follows the UI but is needed\n * for rendering the virtualized image list\n */\n const [selectedIndex, setSelectedIndex] = useState(0);\n const index = useSharedValue(0);\n\n /**\n * Header visible value for animating in out\n */\n const headerFooterVisible = useSharedValue(1);\n\n /**\n * Gesture handler refs\n */\n const doubleTapRef = useRef<TapGestureHandler>(null);\n const panRef = useRef<PanGestureHandler>(null);\n const pinchRef = useRef<PinchGestureHandler>(null);\n const singleTapRef = useRef<TapGestureHandler>(null);\n\n /**\n * Shared values for movement\n */\n const translateX = useSharedValue(0);\n const translateY = useSharedValue(0);\n const offsetScale = useSharedValue(1);\n const scale = useSharedValue(1);\n const translationX = useSharedValue(0);\n\n /**\n * Photos array created from all currently available\n * photo attachments\n */\n\n const photos = messages.reduce((acc: Photo<StreamChatGenerics>[], cur) => {\n const attachmentImages =\n cur.attachments\n ?.filter(\n (attachment) =>\n (attachment.type === 'giphy' &&\n (attachment.giphy?.[giphyVersion]?.url ||\n attachment.thumb_url ||\n attachment.image_url)) ||\n (attachment.type === 'image' &&\n !attachment.title_link &&\n !attachment.og_scrape_url &&\n getUrlOfImageAttachment(attachment)) ||\n (isVideoPackageAvailable() && attachment.type === 'video'),\n )\n .reverse() || [];\n\n const attachmentPhotos = attachmentImages.map((a) => {\n const imageUrl = getUrlOfImageAttachment(a) as string;\n const giphyURL = a.giphy?.[giphyVersion]?.url || a.thumb_url || a.image_url;\n\n return {\n channelId: cur.cid,\n created_at: cur.created_at,\n duration: 0,\n id: `photoId-${cur.id}-${imageUrl}`,\n messageId: cur.id,\n mime_type: a.type === 'giphy' ? getGiphyMimeType(giphyURL ?? '') : a.mime_type,\n original_height: a.original_height,\n original_width: a.original_width,\n paused: true,\n progress: 0,\n type: a.type,\n uri:\n a.type === 'giphy'\n ? giphyURL\n : getResizedImageUrl({\n height: screenHeight,\n url: imageUrl,\n width: screenWidth,\n }),\n user: cur.user,\n user_id: cur.user_id,\n };\n });\n\n return [...attachmentPhotos, ...acc] as Photo<StreamChatGenerics>[];\n }, []);\n\n /**\n * Photos length needs to be kept as a const here so if the length\n * changes it causes the pan gesture handler function to refresh. This\n * does not work if the calculation for the length of the array is left\n * inside the gesture handler as it will have an array as a dependency\n */\n const photoLength = photos.length;\n\n useEffect(() => {\n setImageGalleryAttachments(photos);\n }, []);\n\n /**\n * The URL for the images may differ because of dimensions passed as\n * part of the query.\n */\n const stripQueryFromUrl = (url: string) => url.split('?')[0];\n\n /**\n * Set selected photo when changed via pressing in the message list\n */\n useEffect(() => {\n const updatePosition = (newIndex: number) => {\n 'worklet';\n\n if (newIndex > -1) {\n index.value = newIndex;\n translationX.value = -(screenWidth + MARGIN) * newIndex;\n runOnJS(setSelectedIndex)(newIndex);\n }\n };\n\n const newIndex = photos.findIndex(\n (photo) =>\n photo.messageId === selectedMessage?.messageId &&\n stripQueryFromUrl(photo.uri) === stripQueryFromUrl(selectedMessage?.url || ''),\n );\n\n runOnUI(updatePosition)(newIndex);\n }, [selectedMessage, photoLength]);\n\n /**\n * Image heights are not provided and therefore need to be calculated.\n * We start by allowing the image to be the full height then reduce it\n * to the proper scaled height based on the width being restricted to the\n * screen width when the dimensions are received.\n */\n const uriForCurrentImage = imageGalleryAttachments[selectedIndex]?.uri;\n\n useEffect(() => {\n setCurrentImageHeight(screenHeight);\n const photo = imageGalleryAttachments[index.value];\n const height = photo?.original_height;\n const width = photo?.original_width;\n\n if (height && width) {\n const imageHeight = Math.floor(height * (screenWidth / width));\n setCurrentImageHeight(imageHeight > screenHeight ? screenHeight : imageHeight);\n } else if (photo?.uri) {\n if (photo.type === 'image') {\n Image.getSize(photo.uri, (width, height) => {\n const imageHeight = Math.floor(height * (screenWidth / width));\n setCurrentImageHeight(imageHeight > screenHeight ? screenHeight : imageHeight);\n });\n }\n }\n }, [uriForCurrentImage]);\n\n const { onDoubleTap, onPan, onPinch, onSingleTap } = useImageGalleryGestures({\n currentImageHeight,\n halfScreenHeight,\n halfScreenWidth,\n headerFooterVisible,\n offsetScale,\n overlayOpacity,\n photoLength,\n scale,\n screenHeight,\n screenWidth,\n selectedIndex,\n setSelectedIndex,\n translateX,\n translateY,\n translationX,\n });\n\n /**\n * If the header is visible we scale down the opacity of it as the\n * image is swiped downward\n */\n const headerFooterOpacity = useDerivedValue(\n () =>\n currentImageHeight * scale.value < screenHeight && translateY.value > 0\n ? 1 - translateY.value / quarterScreenHeight\n : currentImageHeight * scale.value > screenHeight &&\n translateY.value > (currentImageHeight / 2) * scale.value - halfScreenHeight\n ? 1 -\n (translateY.value - ((currentImageHeight / 2) * scale.value - halfScreenHeight)) /\n quarterScreenHeight\n : 1,\n [currentImageHeight],\n );\n\n /**\n * This transition and scaleX reverse lets use scroll left\n */\n const pagerStyle = useAnimatedStyle<ImageStyle>(\n () => ({\n transform: [\n { scaleX: -1 },\n {\n translateX: translationX.value,\n },\n ],\n }),\n [],\n );\n\n /**\n * Simple background color animation on Y movement\n */\n const containerBackground = useAnimatedStyle<ViewStyle>(\n () => ({\n backgroundColor: backgroundColor || white_snow,\n opacity: headerFooterOpacity.value,\n }),\n [headerFooterOpacity],\n );\n\n /**\n * Show screen style as component is always rendered we hide it\n * down and up and set opacity to 0 for good measure\n */\n const showScreenStyle = useAnimatedStyle<ViewStyle>(\n () => ({\n transform: [\n {\n translateY: screenTranslateY.value,\n },\n ],\n }),\n [],\n );\n\n /**\n * Functions toclose BottomSheetModal with image grid\n */\n const closeGridView = () => {\n if (bottomSheetModalRef.current?.close) {\n bottomSheetModalRef.current.close();\n setGridPhotos([]);\n }\n };\n\n /**\n * Function to open BottomSheetModal with image grid\n */\n const openGridView = () => {\n if (bottomSheetModalRef.current?.present) {\n bottomSheetModalRef.current.present();\n setGridPhotos(imageGalleryAttachments);\n }\n };\n\n const handleEnd = () => {\n handlePlayPause(imageGalleryAttachments[selectedIndex].id, true);\n handleProgress(imageGalleryAttachments[selectedIndex].id, 1, true);\n };\n\n const videoRef = useRef<VideoType>(null);\n\n const handleLoad = (index: string, duration: number) => {\n setImageGalleryAttachments((prevImageGalleryAttachment) =>\n prevImageGalleryAttachment.map((imageGalleryAttachment) => ({\n ...imageGalleryAttachment,\n duration: imageGalleryAttachment.id === index ? duration : imageGalleryAttachment.duration,\n })),\n );\n };\n\n const handleProgress = (index: string, progress: number, hasEnd?: boolean) => {\n setImageGalleryAttachments((prevImageGalleryAttachments) =>\n prevImageGalleryAttachments.map((imageGalleryAttachment) => ({\n ...imageGalleryAttachment,\n progress:\n imageGalleryAttachment.id === index\n ? hasEnd\n ? 1\n : progress\n : imageGalleryAttachment.progress,\n })),\n );\n };\n\n const handlePlayPause = (index: string, pausedStatus?: boolean) => {\n if (pausedStatus === false) {\n // If the status is false we set the audio with the index as playing and the others as paused.\n setImageGalleryAttachments((prevImageGalleryAttachment) =>\n prevImageGalleryAttachment.map((imageGalleryAttachment) => ({\n ...imageGalleryAttachment,\n paused: imageGalleryAttachment.id === index ? false : true,\n })),\n );\n } else {\n // If the status is true we simply set all the audio's paused state as true.\n setImageGalleryAttachments((prevImageGalleryAttachment) =>\n prevImageGalleryAttachment.map((imageGalleryAttachment) => ({\n ...imageGalleryAttachment,\n paused: true,\n })),\n );\n }\n };\n\n const onPlayPause = (status?: boolean) => {\n if (status === undefined) {\n if (imageGalleryAttachments[selectedIndex].paused) {\n handlePlayPause(imageGalleryAttachments[selectedIndex].id, false);\n } else {\n handlePlayPause(imageGalleryAttachments[selectedIndex].id, true);\n }\n } else {\n handlePlayPause(imageGalleryAttachments[selectedIndex].id, status);\n }\n };\n\n return (\n <Animated.View\n accessibilityLabel='Image Gallery'\n pointerEvents={'auto'}\n style={[StyleSheet.absoluteFillObject, showScreenStyle]}\n >\n <Animated.View style={[StyleSheet.absoluteFillObject, containerBackground]} />\n <TapGestureHandler\n minPointers={1}\n numberOfTaps={1}\n onGestureEvent={onSingleTap}\n ref={singleTapRef}\n waitFor={[panRef, pinchRef, doubleTapRef]}\n >\n <Animated.View style={StyleSheet.absoluteFillObject}>\n <TapGestureHandler\n maxDeltaX={8}\n maxDeltaY={8}\n maxDist={8}\n minPointers={1}\n numberOfTaps={2}\n onGestureEvent={onDoubleTap}\n ref={doubleTapRef}\n >\n <Animated.View style={StyleSheet.absoluteFillObject}>\n <PinchGestureHandler\n onGestureEvent={onPinch}\n ref={pinchRef}\n simultaneousHandlers={[panRef]}\n >\n <Animated.View style={StyleSheet.absoluteFill}>\n <PanGestureHandler\n enabled={overlay === 'gallery'}\n maxPointers={isAndroid ? undefined : 1}\n minDist={10}\n onGestureEvent={onPan}\n ref={panRef}\n simultaneousHandlers={[pinchRef]}\n >\n <Animated.View style={StyleSheet.absoluteFill}>\n <Animated.View\n style={[\n styles.animatedContainer,\n pagerStyle,\n pager,\n {\n transform: [\n { scaleX: -1 }, // Also only here for opening, wrong direction when not included\n {\n translateX: translationX.value, // Only here for opening, wrong index when this is not included\n },\n ],\n },\n ]}\n >\n {imageGalleryAttachments.map((photo, i) =>\n photo.type === 'video' ? (\n <AnimatedGalleryVideo\n attachmentId={photo.id}\n handleEnd={handleEnd}\n handleLoad={handleLoad}\n handleProgress={handleProgress}\n index={i}\n key={`${photo.uri}-${i}`}\n offsetScale={offsetScale}\n paused={photo.paused || false}\n previous={selectedIndex > i}\n repeat={true}\n scale={scale}\n screenHeight={screenHeight}\n selected={selectedIndex === i}\n shouldRender={Math.abs(selectedIndex - i) < 4}\n source={{ uri: photo.uri }}\n style={[\n {\n height: screenHeight * 8,\n marginRight: MARGIN,\n width: screenWidth * 8,\n },\n slide,\n ]}\n translateX={translateX}\n translateY={translateY}\n videoRef={videoRef}\n />\n ) : (\n <AnimatedGalleryImage\n accessibilityLabel={'Image Item'}\n index={i}\n key={`${photo.uri}-${i}`}\n offsetScale={offsetScale}\n photo={photo}\n previous={selectedIndex > i}\n scale={scale}\n screenHeight={screenHeight}\n selected={selectedIndex === i}\n shouldRender={Math.abs(selectedIndex - i) < 4}\n style={[\n {\n height: screenHeight * 8,\n marginRight: MARGIN,\n width: screenWidth * 8,\n },\n slide,\n ]}\n translateX={translateX}\n translateY={translateY}\n />\n ),\n )}\n </Animated.View>\n </Animated.View>\n </PanGestureHandler>\n </Animated.View>\n </PinchGestureHandler>\n </Animated.View>\n </TapGestureHandler>\n </Animated.View>\n </TapGestureHandler>\n <ImageGalleryHeader<StreamChatGenerics>\n opacity={headerFooterOpacity}\n photo={imageGalleryAttachments[selectedIndex]}\n visible={headerFooterVisible}\n {...imageGalleryCustomComponents?.header}\n />\n\n {imageGalleryAttachments.length > 0 && (\n <ImageGalleryFooter<StreamChatGenerics>\n accessibilityLabel={'Image Gallery Footer'}\n duration={imageGalleryAttachments[selectedIndex].duration || 0}\n onPlayPause={onPlayPause}\n opacity={headerFooterOpacity}\n openGridView={openGridView}\n paused={imageGalleryAttachments[selectedIndex].paused || false}\n photo={imageGalleryAttachments[selectedIndex]}\n photoLength={imageGalleryAttachments.length}\n progress={imageGalleryAttachments[selectedIndex].progress || 0}\n selectedIndex={selectedIndex}\n visible={headerFooterVisible}\n {...imageGalleryCustomComponents?.footer}\n />\n )}\n\n <ImageGalleryOverlay\n animatedBottomSheetIndex={animatedBottomSheetIndex}\n closeGridView={closeGridView}\n currentBottomSheetIndex={currentBottomSheetIndex}\n />\n <BottomSheetModalProvider>\n <BottomSheetModal\n animatedIndex={animatedBottomSheetIndex}\n enablePanDownToClose={true}\n handleComponent={() => (\n <ImageGridHandle\n closeGridView={closeGridView}\n {...imageGalleryCustomComponents?.gridHandle}\n />\n )}\n handleHeight={imageGalleryGridHandleHeight ?? 40}\n index={0}\n onChange={(index: number) => setCurrentBottomSheetIndex(index)}\n ref={bottomSheetModalRef}\n snapPoints={imageGalleryGridSnapPoints || snapPoints}\n >\n <ImageGrid\n closeGridView={closeGridView}\n numberOfImageGalleryGridColumns={numberOfImageGalleryGridColumns}\n photos={gridPhotos}\n setSelectedMessage={setSelectedMessage}\n {...imageGalleryCustomComponents?.grid}\n />\n </BottomSheetModal>\n </BottomSheetModalProvider>\n </Animated.View>\n );\n};\n\n/**\n * Clamping worklet to clamp the scaling\n */\nexport const clamp = (value: number, lowerBound: number, upperBound: number) => {\n 'worklet';\n return Math.min(Math.max(lowerBound, value), upperBound);\n};\n\nconst styles = StyleSheet.create({\n animatedContainer: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n});\n\nexport type Photo<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n id: string;\n uri: string;\n channelId?: string;\n created_at?: string | Date;\n duration?: number;\n messageId?: string;\n mime_type?: string;\n original_height?: number;\n original_width?: number;\n paused?: boolean;\n progress?: number;\n type?: string;\n user?: UserResponse<StreamChatGenerics> | null;\n user_id?: string;\n};\n\nImageGallery.displayName = 'ImageGallery{imageGallery}';\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAWA,IAAAE,0BAAA,GAAAF,OAAA;AAMA,IAAAG,sBAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAUA,IAAAI,YAAA,GAAAJ,OAAA;AAIA,IAAAK,qBAAA,GAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,mBAAA,GAAAP,OAAA;AAIA,IAAAQ,mBAAA,GAAAR,OAAA;AAIA,IAAAS,oBAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAX,OAAA;AAKA,IAAAY,wBAAA,GAAAZ,OAAA;AAEA,IAAAa,oBAAA,GAAAb,OAAA;AACA,IAAAc,eAAA,GAAAd,OAAA;AAIA,IAAAe,aAAA,GAAAf,OAAA;AACA,IAAAgB,OAAA,GAAAhB,OAAA;AAEA,IAAAiB,mBAAA,GAAAjB,OAAA;AACA,IAAAkB,wBAAA,GAAAlB,OAAA;AACA,IAAAmB,MAAA,GAAAnB,OAAA;AACA,IAAAoB,iBAAA,GAAApB,OAAA;AAAwE,IAAAqB,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAA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ACM,CACb,CAAC;AAEpB,CAAC;AAAC1M,OAAA,CAAAE,YAAA,GAAAA,YAAA;AAKK,IAAMuP,KAAK,GAAG,SAARA,KAAKA,CAAIzL,KAAa,EAAE0L,UAAkB,EAAEC,UAAkB,EAAK;EAC9E,SAAS;;EACT,OAAOpG,IAAI,CAACqG,GAAG,CAACrG,IAAI,CAACsG,GAAG,CAACH,UAAU,EAAE1L,KAAK,CAAC,EAAE2L,UAAU,CAAC;AAC1D,CAAC;AAAC3P,OAAA,CAAAyP,KAAA,GAAAA,KAAA;AAEF,IAAM9B,MAAM,GAAGvB,uBAAU,CAAC0D,MAAM,CAAC;EAC/BlC,iBAAiB,EAAE;IACjBmC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAqBF9P,YAAY,CAAC+P,WAAW,GAAG,4BAA4B"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeGestureHandler","_reactNativeReanimated","_bottomSheet","_AnimatedGalleryImage","_AnimatedGalleryVideo","_ImageGalleryFooter","_ImageGalleryHeader","_ImageGalleryOverlay","_ImageGrid","_ImageGridHandle","_useImageGalleryGestures","_ImageGalleryContext","_OverlayContext","_ThemeContext","_native","_getResizedImageUrl","_getUrlOfImageAttachment","_utils","_getGiphyMimeType","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","isAndroid","Platform","OS","fullScreenHeight","Dimensions","height","measuredScreenHeight","vh","screenWidth","vw","halfScreenWidth","MARGIN","HasPinched","exports","IsSwiping","ImageGallery","props","_StatusBar$currentHei","_imageGalleryAttachme","_props$autoPlayVideo","autoPlayVideo","_props$giphyVersion","giphyVersion","imageGalleryCustomComponents","imageGalleryGridHandleHeight","imageGalleryGridSnapPoints","numberOfImageGalleryGridColumns","overlayOpacity","_useState","useState","_useState2","_slicedToArray2","imageGalleryAttachments","setImageGalleryAttachments","_useTheme","useTheme","_useTheme$theme","theme","white_snow","colors","_useTheme$theme$image","imageGallery","backgroundColor","pager","slide","_useState3","_useState4","gridPhotos","setGridPhotos","_useOverlayContext","useOverlayContext","overlay","translucentStatusBar","_useImageGalleryConte","useImageGalleryContext","messages","selectedMessage","setSelectedMessage","statusBarHeight","StatusBar","currentHeight","bottomBarHeight","androidScreenHeightAdjustment","screenHeight","halfScreenHeight","quarterScreenHeight","snapPoints","React","useMemo","bottomSheetModalRef","useRef","_useState5","_useState6","currentBottomSheetIndex","setCurrentBottomSheetIndex","animatedBottomSheetIndex","useSharedValue","screenTranslateY","showScreen","value","withTiming","duration","easing","Easing","out","ease","useEffect","Keyboard","dismiss","_useState7","_useState8","currentImageHeight","setCurrentImageHeight","_useState9","_useState10","selectedIndex","setSelectedIndex","index","headerFooterVisible","doubleTapRef","panRef","pinchRef","singleTapRef","translateX","translateY","offsetScale","scale","translationX","photos","reduce","acc","cur","_cur$attachments","attachmentImages","attachments","filter","attachment","_attachment$giphy","_attachment$giphy$gip","type","giphy","url","thumb_url","image_url","title_link","og_scrape_url","getUrlOfImageAttachment","isVideoPackageAvailable","reverse","attachmentPhotos","map","a","_a$giphy","_a$giphy$giphyVersion","imageUrl","giphyURL","isInitiallyPaused","channelId","cid","created_at","id","messageId","mime_type","getGiphyMimeType","original_height","original_width","paused","progress","uri","getResizedImageUrl","width","user","user_id","concat","_toConsumableArray2","photoLength","length","stripQueryFromUrl","split","updatePosition","newIndex","runOnJS","findIndex","photo","runOnUI","uriForCurrentImage","imageHeight","Math","floor","Image","getSize","_useImageGalleryGestu","useImageGalleryGestures","onDoubleTap","onPan","onPinch","onSingleTap","headerFooterOpacity","useDerivedValue","pagerStyle","useAnimatedStyle","transform","scaleX","containerBackground","opacity","showScreenStyle","closeGridView","_bottomSheetModalRef$","current","close","openGridView","_bottomSheetModalRef$2","present","handleEnd","handlePlayPause","handleProgress","videoRef","handleLoad","prevImageGalleryAttachment","imageGalleryAttachment","_extends2","hasEnd","prevImageGalleryAttachments","pausedStatus","onPlayPause","status","undefined","createElement","View","accessibilityLabel","pointerEvents","style","StyleSheet","absoluteFillObject","__self","__source","fileName","lineNumber","columnNumber","TapGestureHandler","minPointers","numberOfTaps","onGestureEvent","ref","waitFor","maxDeltaX","maxDeltaY","maxDist","PinchGestureHandler","simultaneousHandlers","absoluteFill","PanGestureHandler","enabled","maxPointers","minDist","styles","animatedContainer","i","AnimatedGalleryVideo","attachmentId","previous","repeat","selected","shouldRender","abs","source","marginRight","AnimatedGalleryImage","ImageGalleryHeader","visible","header","ImageGalleryFooter","footer","ImageGalleryOverlay","BottomSheetModalProvider","BottomSheetModal","animatedIndex","enablePanDownToClose","handleComponent","ImageGridHandle","gridHandle","handleHeight","onChange","ImageGrid","grid","clamp","lowerBound","upperBound","min","max","create","alignItems","flexDirection","displayName"],"sources":["ImageGallery.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport {\n Dimensions,\n Image,\n ImageStyle,\n Keyboard,\n Platform,\n StatusBar,\n StyleSheet,\n ViewStyle,\n} from 'react-native';\n\nimport {\n PanGestureHandler,\n PinchGestureHandler,\n TapGestureHandler,\n} from 'react-native-gesture-handler';\n\nimport Animated, {\n Easing,\n runOnJS,\n runOnUI,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { BottomSheetModal, BottomSheetModalProvider } from '@gorhom/bottom-sheet';\n\nimport type { UserResponse } from 'stream-chat';\n\nimport { AnimatedGalleryImage } from './components/AnimatedGalleryImage';\nimport { AnimatedGalleryVideo } from './components/AnimatedGalleryVideo';\nimport {\n ImageGalleryFooter,\n ImageGalleryFooterCustomComponentProps,\n} from './components/ImageGalleryFooter';\nimport {\n ImageGalleryHeader,\n ImageGalleryHeaderCustomComponentProps,\n} from './components/ImageGalleryHeader';\nimport { ImageGalleryOverlay } from './components/ImageGalleryOverlay';\nimport { ImageGalleryGridImageComponents, ImageGrid } from './components/ImageGrid';\nimport {\n ImageGalleryGridHandleCustomComponentProps,\n ImageGridHandle,\n} from './components/ImageGridHandle';\n\nimport { useImageGalleryGestures } from './hooks/useImageGalleryGestures';\n\nimport { useImageGalleryContext } from '../../contexts/imageGalleryContext/ImageGalleryContext';\nimport {\n OverlayProviderProps,\n useOverlayContext,\n} from '../../contexts/overlayContext/OverlayContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { isVideoPackageAvailable, VideoType } from '../../native';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { getResizedImageUrl } from '../../utils/getResizedImageUrl';\nimport { getUrlOfImageAttachment } from '../../utils/getUrlOfImageAttachment';\nimport { vh, vw } from '../../utils/utils';\nimport { getGiphyMimeType } from '../Attachment/utils/getGiphyMimeType';\n\nconst isAndroid = Platform.OS === 'android';\nconst fullScreenHeight = Dimensions.get('screen').height;\nconst measuredScreenHeight = vh(100);\nconst screenWidth = vw(100);\nconst halfScreenWidth = vw(50);\nconst MARGIN = 32;\n\nexport enum HasPinched {\n FALSE = 0,\n TRUE,\n}\n\nexport enum IsSwiping {\n UNDETERMINED = 0,\n TRUE,\n FALSE,\n}\n\nexport type ImageGalleryCustomComponents<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Override props for following UI components, which are part of [image gallery](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#gallery-components).\n *\n * - [ImageGalleryFooter](#ImageGalleryFooter)\n *\n * - [ImageGrid](#ImageGrid)\n *\n * - [ImageGridHandle](#ImageGridHandle)\n *\n * - [ImageGalleryHeader](#ImageGalleryHeader)\n *\n * e.g.,\n *\n * ```js\n * {\n * footer: {\n * ShareIcon: CustomShareIconComponent\n * },\n * grid: {\n * avatarComponent: CustomAvatarComponent\n * },\n * gridHandle: {\n * centerComponent: CustomCenterComponent\n * },\n * header: {\n * CloseIcon: CustomCloseButtonComponent\n * },\n * }\n * ```\n * @overrideType object\n */\n imageGalleryCustomComponents?: {\n footer?: ImageGalleryFooterCustomComponentProps<StreamChatGenerics>;\n grid?: ImageGalleryGridImageComponents<StreamChatGenerics>;\n gridHandle?: ImageGalleryGridHandleCustomComponentProps;\n header?: ImageGalleryHeaderCustomComponentProps<StreamChatGenerics>;\n };\n};\n\ntype Props<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> =\n ImageGalleryCustomComponents<StreamChatGenerics> & {\n overlayOpacity: Animated.SharedValue<number>;\n } & Pick<\n OverlayProviderProps<StreamChatGenerics>,\n | 'giphyVersion'\n | 'imageGalleryGridSnapPoints'\n | 'imageGalleryGridHandleHeight'\n | 'numberOfImageGalleryGridColumns'\n | 'autoPlayVideo'\n >;\n\nexport const ImageGallery = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: Props<StreamChatGenerics>,\n) => {\n const {\n autoPlayVideo = false,\n giphyVersion = 'fixed_height',\n imageGalleryCustomComponents,\n imageGalleryGridHandleHeight,\n imageGalleryGridSnapPoints,\n numberOfImageGalleryGridColumns,\n overlayOpacity,\n } = props;\n const [imageGalleryAttachments, setImageGalleryAttachments] = useState<\n Photo<StreamChatGenerics>[]\n >([]);\n const {\n theme: {\n colors: { white_snow },\n imageGallery: { backgroundColor, pager, slide },\n },\n } = useTheme();\n const [gridPhotos, setGridPhotos] = useState<Photo<StreamChatGenerics>[]>([]);\n const { overlay, translucentStatusBar } = useOverlayContext();\n const { messages, selectedMessage, setSelectedMessage } =\n useImageGalleryContext<StreamChatGenerics>();\n\n /**\n * Height constants\n */\n const statusBarHeight = StatusBar.currentHeight ?? 0;\n const bottomBarHeight = fullScreenHeight - measuredScreenHeight - statusBarHeight;\n const androidScreenHeightAdjustment = translucentStatusBar\n ? bottomBarHeight === statusBarHeight || bottomBarHeight < 0\n ? 0\n : statusBarHeight\n : bottomBarHeight === statusBarHeight || bottomBarHeight < 0\n ? -statusBarHeight\n : 0;\n const screenHeight = isAndroid\n ? Dimensions.get('window').height + androidScreenHeightAdjustment\n : vh(100);\n const halfScreenHeight = screenHeight / 2;\n const quarterScreenHeight = screenHeight / 4;\n const snapPoints = React.useMemo(\n () => [(screenHeight * 3) / 4, screenHeight - (imageGalleryGridHandleHeight ?? 40)],\n [],\n );\n\n /**\n * BottomSheetModal ref\n */\n const bottomSheetModalRef = useRef<BottomSheetModal>(null);\n\n /**\n * BottomSheetModal state\n */\n const [currentBottomSheetIndex, setCurrentBottomSheetIndex] = useState(0);\n const animatedBottomSheetIndex = useSharedValue(0);\n\n /**\n * Fade animation for screen, it is always rendered with pointerEvents\n * set to none for fast opening\n */\n const screenTranslateY = useSharedValue(screenHeight);\n const showScreen = () => {\n 'worklet';\n screenTranslateY.value = withTiming(0, {\n duration: 250,\n easing: Easing.out(Easing.ease),\n });\n };\n\n /**\n * Run the fade animation on visible change\n */\n useEffect(() => {\n Keyboard.dismiss();\n showScreen();\n }, []);\n\n /**\n * Image height from URL or default to full screen height\n */\n const [currentImageHeight, setCurrentImageHeight] = useState<number>(screenHeight);\n\n /**\n * JS and UI index values, the JS follows the UI but is needed\n * for rendering the virtualized image list\n */\n const [selectedIndex, setSelectedIndex] = useState(0);\n const index = useSharedValue(0);\n\n /**\n * Header visible value for animating in out\n */\n const headerFooterVisible = useSharedValue(1);\n\n /**\n * Gesture handler refs\n */\n const doubleTapRef = useRef<TapGestureHandler>(null);\n const panRef = useRef<PanGestureHandler>(null);\n const pinchRef = useRef<PinchGestureHandler>(null);\n const singleTapRef = useRef<TapGestureHandler>(null);\n\n /**\n * Shared values for movement\n */\n const translateX = useSharedValue(0);\n const translateY = useSharedValue(0);\n const offsetScale = useSharedValue(1);\n const scale = useSharedValue(1);\n const translationX = useSharedValue(0);\n\n /**\n * Photos array created from all currently available\n * photo attachments\n */\n\n const photos = messages.reduce((acc: Photo<StreamChatGenerics>[], cur) => {\n const attachmentImages =\n cur.attachments\n ?.filter(\n (attachment) =>\n (attachment.type === 'giphy' &&\n (attachment.giphy?.[giphyVersion]?.url ||\n attachment.thumb_url ||\n attachment.image_url)) ||\n (attachment.type === 'image' &&\n !attachment.title_link &&\n !attachment.og_scrape_url &&\n getUrlOfImageAttachment(attachment)) ||\n (isVideoPackageAvailable() && attachment.type === 'video'),\n )\n .reverse() || [];\n\n const attachmentPhotos = attachmentImages.map((a) => {\n const imageUrl = getUrlOfImageAttachment(a) as string;\n const giphyURL = a.giphy?.[giphyVersion]?.url || a.thumb_url || a.image_url;\n const isInitiallyPaused = !autoPlayVideo;\n\n return {\n channelId: cur.cid,\n created_at: cur.created_at,\n duration: 0,\n id: `photoId-${cur.id}-${imageUrl}`,\n messageId: cur.id,\n mime_type: a.type === 'giphy' ? getGiphyMimeType(giphyURL ?? '') : a.mime_type,\n original_height: a.original_height,\n original_width: a.original_width,\n paused: isInitiallyPaused,\n progress: 0,\n type: a.type,\n uri:\n a.type === 'giphy'\n ? giphyURL\n : getResizedImageUrl({\n height: screenHeight,\n url: imageUrl,\n width: screenWidth,\n }),\n user: cur.user,\n user_id: cur.user_id,\n };\n });\n\n return [...attachmentPhotos, ...acc] as Photo<StreamChatGenerics>[];\n }, []);\n\n /**\n * Photos length needs to be kept as a const here so if the length\n * changes it causes the pan gesture handler function to refresh. This\n * does not work if the calculation for the length of the array is left\n * inside the gesture handler as it will have an array as a dependency\n */\n const photoLength = photos.length;\n\n useEffect(() => {\n setImageGalleryAttachments(photos);\n }, []);\n\n /**\n * The URL for the images may differ because of dimensions passed as\n * part of the query.\n */\n const stripQueryFromUrl = (url: string) => url.split('?')[0];\n\n /**\n * Set selected photo when changed via pressing in the message list\n */\n useEffect(() => {\n const updatePosition = (newIndex: number) => {\n 'worklet';\n\n if (newIndex > -1) {\n index.value = newIndex;\n translationX.value = -(screenWidth + MARGIN) * newIndex;\n runOnJS(setSelectedIndex)(newIndex);\n }\n };\n\n const newIndex = photos.findIndex(\n (photo) =>\n photo.messageId === selectedMessage?.messageId &&\n stripQueryFromUrl(photo.uri) === stripQueryFromUrl(selectedMessage?.url || ''),\n );\n\n runOnUI(updatePosition)(newIndex);\n }, [selectedMessage, photoLength]);\n\n /**\n * Image heights are not provided and therefore need to be calculated.\n * We start by allowing the image to be the full height then reduce it\n * to the proper scaled height based on the width being restricted to the\n * screen width when the dimensions are received.\n */\n const uriForCurrentImage = imageGalleryAttachments[selectedIndex]?.uri;\n\n useEffect(() => {\n setCurrentImageHeight(screenHeight);\n const photo = imageGalleryAttachments[index.value];\n const height = photo?.original_height;\n const width = photo?.original_width;\n\n if (height && width) {\n const imageHeight = Math.floor(height * (screenWidth / width));\n setCurrentImageHeight(imageHeight > screenHeight ? screenHeight : imageHeight);\n } else if (photo?.uri) {\n if (photo.type === 'image') {\n Image.getSize(photo.uri, (width, height) => {\n const imageHeight = Math.floor(height * (screenWidth / width));\n setCurrentImageHeight(imageHeight > screenHeight ? screenHeight : imageHeight);\n });\n }\n }\n }, [uriForCurrentImage]);\n\n const { onDoubleTap, onPan, onPinch, onSingleTap } = useImageGalleryGestures({\n currentImageHeight,\n halfScreenHeight,\n halfScreenWidth,\n headerFooterVisible,\n offsetScale,\n overlayOpacity,\n photoLength,\n scale,\n screenHeight,\n screenWidth,\n selectedIndex,\n setSelectedIndex,\n translateX,\n translateY,\n translationX,\n });\n\n /**\n * If the header is visible we scale down the opacity of it as the\n * image is swiped downward\n */\n const headerFooterOpacity = useDerivedValue(\n () =>\n currentImageHeight * scale.value < screenHeight && translateY.value > 0\n ? 1 - translateY.value / quarterScreenHeight\n : currentImageHeight * scale.value > screenHeight &&\n translateY.value > (currentImageHeight / 2) * scale.value - halfScreenHeight\n ? 1 -\n (translateY.value - ((currentImageHeight / 2) * scale.value - halfScreenHeight)) /\n quarterScreenHeight\n : 1,\n [currentImageHeight],\n );\n\n /**\n * This transition and scaleX reverse lets use scroll left\n */\n const pagerStyle = useAnimatedStyle<ImageStyle>(\n () => ({\n transform: [\n { scaleX: -1 },\n {\n translateX: translationX.value,\n },\n ],\n }),\n [],\n );\n\n /**\n * Simple background color animation on Y movement\n */\n const containerBackground = useAnimatedStyle<ViewStyle>(\n () => ({\n backgroundColor: backgroundColor || white_snow,\n opacity: headerFooterOpacity.value,\n }),\n [headerFooterOpacity],\n );\n\n /**\n * Show screen style as component is always rendered we hide it\n * down and up and set opacity to 0 for good measure\n */\n const showScreenStyle = useAnimatedStyle<ViewStyle>(\n () => ({\n transform: [\n {\n translateY: screenTranslateY.value,\n },\n ],\n }),\n [],\n );\n\n /**\n * Functions toclose BottomSheetModal with image grid\n */\n const closeGridView = () => {\n if (bottomSheetModalRef.current?.close) {\n bottomSheetModalRef.current.close();\n setGridPhotos([]);\n }\n };\n\n /**\n * Function to open BottomSheetModal with image grid\n */\n const openGridView = () => {\n if (bottomSheetModalRef.current?.present) {\n bottomSheetModalRef.current.present();\n setGridPhotos(imageGalleryAttachments);\n }\n };\n\n const handleEnd = () => {\n handlePlayPause(imageGalleryAttachments[selectedIndex].id, true);\n handleProgress(imageGalleryAttachments[selectedIndex].id, 1, true);\n };\n\n const videoRef = useRef<VideoType>(null);\n\n const handleLoad = (index: string, duration: number) => {\n setImageGalleryAttachments((prevImageGalleryAttachment) =>\n prevImageGalleryAttachment.map((imageGalleryAttachment) => ({\n ...imageGalleryAttachment,\n duration: imageGalleryAttachment.id === index ? duration : imageGalleryAttachment.duration,\n })),\n );\n };\n\n const handleProgress = (index: string, progress: number, hasEnd?: boolean) => {\n setImageGalleryAttachments((prevImageGalleryAttachments) =>\n prevImageGalleryAttachments.map((imageGalleryAttachment) => ({\n ...imageGalleryAttachment,\n progress:\n imageGalleryAttachment.id === index\n ? hasEnd\n ? 1\n : progress\n : imageGalleryAttachment.progress,\n })),\n );\n };\n\n const handlePlayPause = (index: string, pausedStatus?: boolean) => {\n if (pausedStatus === false) {\n // If the status is false we set the audio with the index as playing and the others as paused.\n setImageGalleryAttachments((prevImageGalleryAttachment) =>\n prevImageGalleryAttachment.map((imageGalleryAttachment) => ({\n ...imageGalleryAttachment,\n paused: imageGalleryAttachment.id === index ? false : true,\n })),\n );\n } else {\n // If the status is true we simply set all the audio's paused state as true.\n setImageGalleryAttachments((prevImageGalleryAttachment) =>\n prevImageGalleryAttachment.map((imageGalleryAttachment) => ({\n ...imageGalleryAttachment,\n paused: true,\n })),\n );\n }\n };\n\n const onPlayPause = (status?: boolean) => {\n if (status === undefined) {\n if (imageGalleryAttachments[selectedIndex].paused) {\n handlePlayPause(imageGalleryAttachments[selectedIndex].id, false);\n } else {\n handlePlayPause(imageGalleryAttachments[selectedIndex].id, true);\n }\n } else {\n handlePlayPause(imageGalleryAttachments[selectedIndex].id, status);\n }\n };\n\n return (\n <Animated.View\n accessibilityLabel='Image Gallery'\n pointerEvents={'auto'}\n style={[StyleSheet.absoluteFillObject, showScreenStyle]}\n >\n <Animated.View style={[StyleSheet.absoluteFillObject, containerBackground]} />\n <TapGestureHandler\n minPointers={1}\n numberOfTaps={1}\n onGestureEvent={onSingleTap}\n ref={singleTapRef}\n waitFor={[panRef, pinchRef, doubleTapRef]}\n >\n <Animated.View style={StyleSheet.absoluteFillObject}>\n <TapGestureHandler\n maxDeltaX={8}\n maxDeltaY={8}\n maxDist={8}\n minPointers={1}\n numberOfTaps={2}\n onGestureEvent={onDoubleTap}\n ref={doubleTapRef}\n >\n <Animated.View style={StyleSheet.absoluteFillObject}>\n <PinchGestureHandler\n onGestureEvent={onPinch}\n ref={pinchRef}\n simultaneousHandlers={[panRef]}\n >\n <Animated.View style={StyleSheet.absoluteFill}>\n <PanGestureHandler\n enabled={overlay === 'gallery'}\n maxPointers={isAndroid ? undefined : 1}\n minDist={10}\n onGestureEvent={onPan}\n ref={panRef}\n simultaneousHandlers={[pinchRef]}\n >\n <Animated.View style={StyleSheet.absoluteFill}>\n <Animated.View\n style={[\n styles.animatedContainer,\n pagerStyle,\n pager,\n {\n transform: [\n { scaleX: -1 }, // Also only here for opening, wrong direction when not included\n {\n translateX: translationX.value, // Only here for opening, wrong index when this is not included\n },\n ],\n },\n ]}\n >\n {imageGalleryAttachments.map((photo, i) =>\n photo.type === 'video' ? (\n <AnimatedGalleryVideo\n attachmentId={photo.id}\n handleEnd={handleEnd}\n handleLoad={handleLoad}\n handleProgress={handleProgress}\n index={i}\n key={`${photo.uri}-${i}`}\n offsetScale={offsetScale}\n paused={photo.paused || false}\n previous={selectedIndex > i}\n repeat={true}\n scale={scale}\n screenHeight={screenHeight}\n selected={selectedIndex === i}\n shouldRender={Math.abs(selectedIndex - i) < 4}\n source={{ uri: photo.uri }}\n style={[\n {\n height: screenHeight * 8,\n marginRight: MARGIN,\n width: screenWidth * 8,\n },\n slide,\n ]}\n translateX={translateX}\n translateY={translateY}\n videoRef={videoRef}\n />\n ) : (\n <AnimatedGalleryImage\n accessibilityLabel={'Image Item'}\n index={i}\n key={`${photo.uri}-${i}`}\n offsetScale={offsetScale}\n photo={photo}\n previous={selectedIndex > i}\n scale={scale}\n screenHeight={screenHeight}\n selected={selectedIndex === i}\n shouldRender={Math.abs(selectedIndex - i) < 4}\n style={[\n {\n height: screenHeight * 8,\n marginRight: MARGIN,\n width: screenWidth * 8,\n },\n slide,\n ]}\n translateX={translateX}\n translateY={translateY}\n />\n ),\n )}\n </Animated.View>\n </Animated.View>\n </PanGestureHandler>\n </Animated.View>\n </PinchGestureHandler>\n </Animated.View>\n </TapGestureHandler>\n </Animated.View>\n </TapGestureHandler>\n <ImageGalleryHeader<StreamChatGenerics>\n opacity={headerFooterOpacity}\n photo={imageGalleryAttachments[selectedIndex]}\n visible={headerFooterVisible}\n {...imageGalleryCustomComponents?.header}\n />\n\n {imageGalleryAttachments.length > 0 && (\n <ImageGalleryFooter<StreamChatGenerics>\n accessibilityLabel={'Image Gallery Footer'}\n duration={imageGalleryAttachments[selectedIndex].duration || 0}\n onPlayPause={onPlayPause}\n opacity={headerFooterOpacity}\n openGridView={openGridView}\n paused={imageGalleryAttachments[selectedIndex].paused || false}\n photo={imageGalleryAttachments[selectedIndex]}\n photoLength={imageGalleryAttachments.length}\n progress={imageGalleryAttachments[selectedIndex].progress || 0}\n selectedIndex={selectedIndex}\n visible={headerFooterVisible}\n {...imageGalleryCustomComponents?.footer}\n />\n )}\n\n <ImageGalleryOverlay\n animatedBottomSheetIndex={animatedBottomSheetIndex}\n closeGridView={closeGridView}\n currentBottomSheetIndex={currentBottomSheetIndex}\n />\n <BottomSheetModalProvider>\n <BottomSheetModal\n animatedIndex={animatedBottomSheetIndex}\n enablePanDownToClose={true}\n handleComponent={() => (\n <ImageGridHandle\n closeGridView={closeGridView}\n {...imageGalleryCustomComponents?.gridHandle}\n />\n )}\n handleHeight={imageGalleryGridHandleHeight ?? 40}\n index={0}\n onChange={(index: number) => setCurrentBottomSheetIndex(index)}\n ref={bottomSheetModalRef}\n snapPoints={imageGalleryGridSnapPoints || snapPoints}\n >\n <ImageGrid\n closeGridView={closeGridView}\n numberOfImageGalleryGridColumns={numberOfImageGalleryGridColumns}\n photos={gridPhotos}\n setSelectedMessage={setSelectedMessage}\n {...imageGalleryCustomComponents?.grid}\n />\n </BottomSheetModal>\n </BottomSheetModalProvider>\n </Animated.View>\n );\n};\n\n/**\n * Clamping worklet to clamp the scaling\n */\nexport const clamp = (value: number, lowerBound: number, upperBound: number) => {\n 'worklet';\n return Math.min(Math.max(lowerBound, value), upperBound);\n};\n\nconst styles = StyleSheet.create({\n animatedContainer: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n});\n\nexport type Photo<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n id: string;\n uri: string;\n channelId?: string;\n created_at?: string | Date;\n duration?: number;\n messageId?: string;\n mime_type?: string;\n original_height?: number;\n original_width?: number;\n paused?: boolean;\n progress?: number;\n type?: string;\n user?: UserResponse<StreamChatGenerics> | null;\n user_id?: string;\n};\n\nImageGallery.displayName = 'ImageGallery{imageGallery}';\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,C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CAAA4P,KAAA,GAAAA,KAAA;AAEF,IAAM9B,MAAM,GAAGvB,uBAAU,CAAC0D,MAAM,CAAC;EAC/BlC,iBAAiB,EAAE;IACjBmC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAqBFjQ,YAAY,CAACkQ,WAAW,GAAG,4BAA4B"}
|
|
@@ -20,8 +20,8 @@ var getDateSeparators = function getDateSeparators(params) {
|
|
|
20
20
|
for (var i = 0; i < messagesWithoutDeleted.length; i++) {
|
|
21
21
|
var previousMessage = messagesWithoutDeleted[i - 1];
|
|
22
22
|
var message = messagesWithoutDeleted[i];
|
|
23
|
-
var messageDate = message.created_at.
|
|
24
|
-
var prevMessageDate = previousMessage ? previousMessage.created_at.
|
|
23
|
+
var messageDate = message.created_at.toDateString();
|
|
24
|
+
var prevMessageDate = previousMessage ? previousMessage.created_at.toDateString() : messageDate;
|
|
25
25
|
if (i === 0 || messageDate !== prevMessageDate) {
|
|
26
26
|
dateSeparators[message.id] = message.created_at;
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDateSeparators","params","deletedMessagesVisibilityType","hideDateSeparators","messages","userId","dateSeparators","messagesWithoutDeleted","filter","message","_message$user","isMessageTypeDeleted","type","isDeletedMessageVisibleToSender","user","id","i","length","previousMessage","messageDate","created_at","
|
|
1
|
+
{"version":3,"names":["getDateSeparators","params","deletedMessagesVisibilityType","hideDateSeparators","messages","userId","dateSeparators","messagesWithoutDeleted","filter","message","_message$user","isMessageTypeDeleted","type","isDeletedMessageVisibleToSender","user","id","i","length","previousMessage","messageDate","created_at","toDateString","prevMessageDate","exports"],"sources":["getDateSeparators.ts"],"sourcesContent":["import type { DeletedMessagesVisibilityType } from '../../../contexts/messagesContext/MessagesContext';\nimport type { PaginatedMessageListContextValue } from '../../../contexts/paginatedMessageListContext/PaginatedMessageListContext';\nimport type { ThreadContextValue } from '../../../contexts/threadContext/ThreadContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport type GetDateSeparatorsParams<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n messages:\n | PaginatedMessageListContextValue<StreamChatGenerics>['messages']\n | ThreadContextValue<StreamChatGenerics>['threadMessages'];\n deletedMessagesVisibilityType?: DeletedMessagesVisibilityType;\n hideDateSeparators?: boolean;\n userId?: string;\n};\n\nexport type DateSeparators = {\n [key: string]: Date;\n};\n\nexport const getDateSeparators = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n params: GetDateSeparatorsParams<StreamChatGenerics>,\n) => {\n const { deletedMessagesVisibilityType, hideDateSeparators, messages, userId } = params;\n const dateSeparators: DateSeparators = {};\n\n if (hideDateSeparators) {\n return dateSeparators;\n }\n\n const messagesWithoutDeleted = messages.filter((message) => {\n const isMessageTypeDeleted = message.type === 'deleted';\n\n const isDeletedMessageVisibleToSender =\n deletedMessagesVisibilityType === 'sender' || deletedMessagesVisibilityType === 'always';\n\n return (\n !isMessageTypeDeleted || (userId === message.user?.id && isDeletedMessageVisibleToSender)\n );\n });\n\n for (let i = 0; i < messagesWithoutDeleted.length; i++) {\n const previousMessage = messagesWithoutDeleted[i - 1];\n const message = messagesWithoutDeleted[i];\n\n const messageDate = message.created_at.toDateString();\n\n const prevMessageDate = previousMessage\n ? previousMessage.created_at.toDateString()\n : messageDate;\n\n if (i === 0 || messageDate !== prevMessageDate) {\n dateSeparators[message.id] = message.created_at;\n }\n }\n\n return dateSeparators;\n};\n"],"mappings":";;;;AAoBO,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAG5BC,MAAmD,EAChD;EACH,IAAQC,6BAA6B,GAA2CD,MAAM,CAA9EC,6BAA6B;IAAEC,kBAAkB,GAAuBF,MAAM,CAA/CE,kBAAkB;IAAEC,QAAQ,GAAaH,MAAM,CAA3BG,QAAQ;IAAEC,MAAM,GAAKJ,MAAM,CAAjBI,MAAM;EAC3E,IAAMC,cAA8B,GAAG,CAAC,CAAC;EAEzC,IAAIH,kBAAkB,EAAE;IACtB,OAAOG,cAAc;EACvB;EAEA,IAAMC,sBAAsB,GAAGH,QAAQ,CAACI,MAAM,CAAC,UAACC,OAAO,EAAK;IAAA,IAAAC,aAAA;IAC1D,IAAMC,oBAAoB,GAAGF,OAAO,CAACG,IAAI,KAAK,SAAS;IAEvD,IAAMC,+BAA+B,GACnCX,6BAA6B,KAAK,QAAQ,IAAIA,6BAA6B,KAAK,QAAQ;IAE1F,OACE,CAACS,oBAAoB,IAAKN,MAAM,OAAAK,aAAA,GAAKD,OAAO,CAACK,IAAI,qBAAZJ,aAAA,CAAcK,EAAE,KAAIF,+BAAgC;EAE7F,CAAC,CAAC;EAEF,KAAK,IAAIG,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGT,sBAAsB,CAACU,MAAM,EAAED,CAAC,EAAE,EAAE;IACtD,IAAME,eAAe,GAAGX,sBAAsB,CAACS,CAAC,GAAG,CAAC,CAAC;IACrD,IAAMP,OAAO,GAAGF,sBAAsB,CAACS,CAAC,CAAC;IAEzC,IAAMG,WAAW,GAAGV,OAAO,CAACW,UAAU,CAACC,YAAY,CAAC,CAAC;IAErD,IAAMC,eAAe,GAAGJ,eAAe,GACnCA,eAAe,CAACE,UAAU,CAACC,YAAY,CAAC,CAAC,GACzCF,WAAW;IAEf,IAAIH,CAAC,KAAK,CAAC,IAAIG,WAAW,KAAKG,eAAe,EAAE;MAC9ChB,cAAc,CAACG,OAAO,CAACM,EAAE,CAAC,GAAGN,OAAO,CAACW,UAAU;IACjD;EACF;EAEA,OAAOd,cAAc;AACvB,CAAC;AAACiB,OAAA,CAAAvB,iBAAA,GAAAA,iBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_defaultBaseContextValue","_getDisplayName","_isTestEnvironment","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","OverlayContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","exports","useOverlayContext","contextValue","useContext","isTestEnvironment","Error","withOverlayContext","Component","WithOverlayContextComponent","props","overlayContext","createElement","_extends2","__self","__source","fileName","lineNumber","columnNumber","displayName","getDisplayName"],"sources":["OverlayContext.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport type { BottomSheetMethods } from '@gorhom/bottom-sheet/lib/typescript/types';\nimport type { Attachment } from 'stream-chat';\n\nimport type { AttachmentPickerProps } from '../../components/AttachmentPicker/AttachmentPicker';\nimport type { ImageGalleryCustomComponents } from '../../components/ImageGallery/ImageGallery';\n\nimport type { MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport type { Streami18n } from '../../utils/Streami18n';\nimport type { AttachmentPickerContextValue } from '../attachmentPickerContext/AttachmentPickerContext';\nimport type { MessageOverlayContextValue } from '../messageOverlayContext/MessageOverlayContext';\nimport type { DeepPartial } from '../themeContext/ThemeContext';\nimport type { Theme } from '../themeContext/utils/theme';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type Overlay = 'alert' | 'gallery' | 'message' | 'none';\n\nexport type OverlayContextValue = {\n overlay: Overlay;\n setOverlay: React.Dispatch<React.SetStateAction<Overlay>>;\n style?: DeepPartial<Theme>;\n translucentStatusBar?: boolean;\n};\n\nexport const OverlayContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as OverlayContextValue,\n);\n\nexport type OverlayProviderProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<AttachmentPickerProps> &\n Partial<\n Pick<\n AttachmentPickerContextValue,\n | 'attachmentPickerBottomSheetHeight'\n | 'attachmentSelectionBarHeight'\n | 'bottomInset'\n | 'CameraSelectorIcon'\n | 'FileSelectorIcon'\n | 'ImageSelectorIcon'\n | 'topInset'\n >\n > &\n ImageGalleryCustomComponents<StreamChatGenerics> &\n Partial<\n Pick<\n MessageOverlayContextValue<StreamChatGenerics>,\n | 'MessageActionList'\n | 'MessageActionListItem'\n | 'OverlayReactionList'\n | 'OverlayReactions'\n | 'OverlayReactionsAvatar'\n >\n > &\n Pick<OverlayContextValue, 'translucentStatusBar'> & {\n /**\n * 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\n * */\n closePicker?: (ref: React.RefObject<BottomSheetMethods>) => void;\n error?: boolean | Error;\n giphyVersion?: keyof NonNullable<Attachment['giphy']>;\n /** https://github.com/GetStream/stream-chat-react-native/wiki/Internationalization-(i18n) */\n i18nInstance?: Streami18n;\n imageGalleryGridHandleHeight?: number;\n imageGalleryGridSnapPoints?: [string | number, string | number];\n isMyMessage?: boolean;\n isThreadMessage?: boolean;\n message?: MessageType<StreamChatGenerics>;\n messageReactions?: boolean;\n messageTextNumberOfLines?: number;\n numberOfImageGalleryGridColumns?: number;\n openPicker?: (ref: React.RefObject<BottomSheetMethods>) => void;\n value?: Partial<OverlayContextValue>;\n };\n\nexport const useOverlayContext = () => {\n const contextValue = useContext(OverlayContext);\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useOverlayContext hook was called outside the OverlayContext Provider. Make sure you have configured OverlayProvider component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#overlay-provider`,\n );\n }\n\n return contextValue;\n};\n\nexport const withOverlayContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<StreamChatGenerics>,\n): React.FC<Omit<StreamChatGenerics, keyof OverlayContextValue>> => {\n const WithOverlayContextComponent = (\n props: Omit<StreamChatGenerics, keyof OverlayContextValue>,\n ) => {\n const overlayContext = useOverlayContext();\n\n return <Component {...(props as StreamChatGenerics)} {...overlayContext} />;\n };\n WithOverlayContextComponent.displayName = `WithOverlayContext${getDisplayName(\n Component as React.ComponentType,\n )}`;\n return WithOverlayContextComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAeA,IAAAC,wBAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAA+D,IAAAI,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,cAAAN,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAWxD,IAAMW,cAAc,GAAGC,iBAAK,CAACC,aAAa,CAC/CC,mDACF,CAAC;AAACC,OAAA,CAAAJ,cAAA,GAAAA,cAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_defaultBaseContextValue","_getDisplayName","_isTestEnvironment","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","OverlayContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","exports","useOverlayContext","contextValue","useContext","isTestEnvironment","Error","withOverlayContext","Component","WithOverlayContextComponent","props","overlayContext","createElement","_extends2","__self","__source","fileName","lineNumber","columnNumber","displayName","getDisplayName"],"sources":["OverlayContext.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport type { BottomSheetMethods } from '@gorhom/bottom-sheet/lib/typescript/types';\nimport type { Attachment } from 'stream-chat';\n\nimport type { AttachmentPickerProps } from '../../components/AttachmentPicker/AttachmentPicker';\nimport type { ImageGalleryCustomComponents } from '../../components/ImageGallery/ImageGallery';\n\nimport type { MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport type { Streami18n } from '../../utils/Streami18n';\nimport type { AttachmentPickerContextValue } from '../attachmentPickerContext/AttachmentPickerContext';\nimport type { MessageOverlayContextValue } from '../messageOverlayContext/MessageOverlayContext';\nimport type { DeepPartial } from '../themeContext/ThemeContext';\nimport type { Theme } from '../themeContext/utils/theme';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type Overlay = 'alert' | 'gallery' | 'message' | 'none';\n\nexport type OverlayContextValue = {\n overlay: Overlay;\n setOverlay: React.Dispatch<React.SetStateAction<Overlay>>;\n style?: DeepPartial<Theme>;\n translucentStatusBar?: boolean;\n};\n\nexport const OverlayContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as OverlayContextValue,\n);\n\nexport type OverlayProviderProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<AttachmentPickerProps> &\n Partial<\n Pick<\n AttachmentPickerContextValue,\n | 'attachmentPickerBottomSheetHeight'\n | 'attachmentSelectionBarHeight'\n | 'bottomInset'\n | 'CameraSelectorIcon'\n | 'FileSelectorIcon'\n | 'ImageSelectorIcon'\n | 'topInset'\n >\n > &\n ImageGalleryCustomComponents<StreamChatGenerics> &\n Partial<\n Pick<\n MessageOverlayContextValue<StreamChatGenerics>,\n | 'MessageActionList'\n | 'MessageActionListItem'\n | 'OverlayReactionList'\n | 'OverlayReactions'\n | 'OverlayReactionsAvatar'\n >\n > &\n Pick<OverlayContextValue, 'translucentStatusBar'> & {\n autoPlayVideo?: boolean;\n /**\n * 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\n * */\n closePicker?: (ref: React.RefObject<BottomSheetMethods>) => void;\n error?: boolean | Error;\n giphyVersion?: keyof NonNullable<Attachment['giphy']>;\n /** https://github.com/GetStream/stream-chat-react-native/wiki/Internationalization-(i18n) */\n i18nInstance?: Streami18n;\n imageGalleryGridHandleHeight?: number;\n imageGalleryGridSnapPoints?: [string | number, string | number];\n isMyMessage?: boolean;\n isThreadMessage?: boolean;\n message?: MessageType<StreamChatGenerics>;\n messageReactions?: boolean;\n messageTextNumberOfLines?: number;\n numberOfImageGalleryGridColumns?: number;\n openPicker?: (ref: React.RefObject<BottomSheetMethods>) => void;\n value?: Partial<OverlayContextValue>;\n };\n\nexport const useOverlayContext = () => {\n const contextValue = useContext(OverlayContext);\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useOverlayContext hook was called outside the OverlayContext Provider. Make sure you have configured OverlayProvider component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#overlay-provider`,\n );\n }\n\n return contextValue;\n};\n\nexport const withOverlayContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<StreamChatGenerics>,\n): React.FC<Omit<StreamChatGenerics, keyof OverlayContextValue>> => {\n const WithOverlayContextComponent = (\n props: Omit<StreamChatGenerics, keyof OverlayContextValue>,\n ) => {\n const overlayContext = useOverlayContext();\n\n return <Component {...(props as StreamChatGenerics)} {...overlayContext} />;\n };\n WithOverlayContextComponent.displayName = `WithOverlayContext${getDisplayName(\n Component as React.ComponentType,\n )}`;\n return WithOverlayContextComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAeA,IAAAC,wBAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAA+D,IAAAI,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,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A,kBAAkBA,CAG7BC,SAAkD,EACgB;EAClE,IAAMC,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAC/BC,KAA0D,EACvD;IACH,IAAMC,cAAc,GAAGT,iBAAiB,CAAC,CAAC;IAE1C,OAAOnC,MAAA,YAAA6C,aAAA,CAACJ,SAAS,MAAAK,SAAA,iBAAMH,KAAK,EAA6BC,cAAc;MAAAG,MAAA,EAAAzC,KAAA;MAAA0C,QAAA;QAAAC,QAAA,EAAA1C,YAAA;QAAA2C,UAAA;QAAAC,YAAA;MAAA;IAAA,EAAG,CAAC;EAC7E,CAAC;EACDT,2BAA2B,CAACU,WAAW,0BAAwB,IAAAC,8BAAc,EAC3EZ,SACF,CAAG;EACH,OAAOC,2BAA2B;AACpC,CAAC;AAACR,OAAA,CAAAM,kBAAA,GAAAA,kBAAA"}
|
|
@@ -33,7 +33,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
33
33
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
34
34
|
var OverlayProvider = function OverlayProvider(props) {
|
|
35
35
|
var bottomSheetCloseTimeoutRef = (0, _react.useRef)();
|
|
36
|
-
var
|
|
36
|
+
var autoPlayVideo = props.autoPlayVideo,
|
|
37
|
+
_props$AttachmentPick = props.AttachmentPickerBottomSheetHandle,
|
|
37
38
|
AttachmentPickerBottomSheetHandle = _props$AttachmentPick === void 0 ? _AttachmentPickerBottomSheetHandle.AttachmentPickerBottomSheetHandle : _props$AttachmentPick,
|
|
38
39
|
attachmentPickerBottomSheetHandleHeight = props.attachmentPickerBottomSheetHandleHeight,
|
|
39
40
|
attachmentPickerBottomSheetHeight = props.attachmentPickerBottomSheetHeight,
|
|
@@ -183,7 +184,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
183
184
|
__self: _this,
|
|
184
185
|
__source: {
|
|
185
186
|
fileName: _jsxFileName,
|
|
186
|
-
lineNumber:
|
|
187
|
+
lineNumber: 215,
|
|
187
188
|
columnNumber: 5
|
|
188
189
|
}
|
|
189
190
|
}, _react["default"].createElement(_OverlayContext.OverlayContext.Provider, {
|
|
@@ -191,14 +192,14 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
191
192
|
__self: _this,
|
|
192
193
|
__source: {
|
|
193
194
|
fileName: _jsxFileName,
|
|
194
|
-
lineNumber:
|
|
195
|
+
lineNumber: 216,
|
|
195
196
|
columnNumber: 7
|
|
196
197
|
}
|
|
197
198
|
}, _react["default"].createElement(_MessageOverlayContext.MessageOverlayProvider, {
|
|
198
199
|
__self: _this,
|
|
199
200
|
__source: {
|
|
200
201
|
fileName: _jsxFileName,
|
|
201
|
-
lineNumber:
|
|
202
|
+
lineNumber: 217,
|
|
202
203
|
columnNumber: 9
|
|
203
204
|
}
|
|
204
205
|
}, _react["default"].createElement(_AttachmentPickerContext.AttachmentPickerProvider, {
|
|
@@ -206,14 +207,14 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
206
207
|
__self: _this,
|
|
207
208
|
__source: {
|
|
208
209
|
fileName: _jsxFileName,
|
|
209
|
-
lineNumber:
|
|
210
|
+
lineNumber: 218,
|
|
210
211
|
columnNumber: 11
|
|
211
212
|
}
|
|
212
213
|
}, _react["default"].createElement(_ImageGalleryContext.ImageGalleryProvider, {
|
|
213
214
|
__self: _this,
|
|
214
215
|
__source: {
|
|
215
216
|
fileName: _jsxFileName,
|
|
216
|
-
lineNumber:
|
|
217
|
+
lineNumber: 219,
|
|
217
218
|
columnNumber: 13
|
|
218
219
|
}
|
|
219
220
|
}, children, _react["default"].createElement(_ThemeContext.ThemeProvider, {
|
|
@@ -221,7 +222,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
221
222
|
__self: _this,
|
|
222
223
|
__source: {
|
|
223
224
|
fileName: _jsxFileName,
|
|
224
|
-
lineNumber:
|
|
225
|
+
lineNumber: 221,
|
|
225
226
|
columnNumber: 15
|
|
226
227
|
}
|
|
227
228
|
}, _react["default"].createElement(_reactNativeReanimated["default"].View, {
|
|
@@ -230,7 +231,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
230
231
|
__self: _this,
|
|
231
232
|
__source: {
|
|
232
233
|
fileName: _jsxFileName,
|
|
233
|
-
lineNumber:
|
|
234
|
+
lineNumber: 222,
|
|
234
235
|
columnNumber: 17
|
|
235
236
|
}
|
|
236
237
|
}, _react["default"].createElement(_OverlayBackdrop.OverlayBackdrop, {
|
|
@@ -241,7 +242,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
241
242
|
__self: _this,
|
|
242
243
|
__source: {
|
|
243
244
|
fileName: _jsxFileName,
|
|
244
|
-
lineNumber:
|
|
245
|
+
lineNumber: 226,
|
|
245
246
|
columnNumber: 19
|
|
246
247
|
}
|
|
247
248
|
})), overlay === 'message' && _react["default"].createElement(_MessageOverlay.MessageOverlay, {
|
|
@@ -255,10 +256,11 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
255
256
|
__self: _this,
|
|
256
257
|
__source: {
|
|
257
258
|
fileName: _jsxFileName,
|
|
258
|
-
lineNumber:
|
|
259
|
+
lineNumber: 229,
|
|
259
260
|
columnNumber: 19
|
|
260
261
|
}
|
|
261
262
|
}), overlay === 'gallery' && _react["default"].createElement(_ImageGallery.ImageGallery, {
|
|
263
|
+
autoPlayVideo: autoPlayVideo,
|
|
262
264
|
giphyVersion: giphyVersion,
|
|
263
265
|
imageGalleryCustomComponents: imageGalleryCustomComponents,
|
|
264
266
|
imageGalleryGridHandleHeight: imageGalleryGridHandleHeight,
|
|
@@ -268,7 +270,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
268
270
|
__self: _this,
|
|
269
271
|
__source: {
|
|
270
272
|
fileName: _jsxFileName,
|
|
271
|
-
lineNumber:
|
|
273
|
+
lineNumber: 240,
|
|
272
274
|
columnNumber: 19
|
|
273
275
|
}
|
|
274
276
|
}), _react["default"].createElement(_AttachmentPicker.AttachmentPicker, (0, _extends2["default"])({
|
|
@@ -277,7 +279,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
277
279
|
__self: _this,
|
|
278
280
|
__source: {
|
|
279
281
|
fileName: _jsxFileName,
|
|
280
|
-
lineNumber:
|
|
282
|
+
lineNumber: 250,
|
|
281
283
|
columnNumber: 17
|
|
282
284
|
}
|
|
283
285
|
}))))))));
|
|
@@ -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;AAEA,IAAAK,kCAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAN,OAAA;AACA,IAAAO,2BAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,8BAAA,GAAAV,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,gBAAA,GAAAd,OAAA;AACA,IAAAe,cAAA,GAAAf,OAAA;AAGA,IAAAgB,wBAAA,GAAAhB,OAAA;AACA,IAAAiB,oBAAA,GAAAjB,OAAA;AACA,IAAAkB,sBAAA,GAAAlB,OAAA;AACA,IAAAmB,aAAA,GAAAnB,OAAA;AACA,IAAAoB,mBAAA,GAAApB,OAAA;AAGkD,IAAAqB,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAA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B,EAAEA,gBAAiB;IACnCC,sBAAsB,EAAEA,sBAAuB;IAAAqC,MAAA,EAAA3H,KAAA;IAAA4H,QAAA;MAAAC,QAAA,EAAA5H,YAAA;MAAA6H,UAAA;MAAAC,YAAA;IAAA;EAAA,CAChD,CACF,EACAnC,OAAO,KAAK,SAAS,IACpBnH,MAAA,YAAA6I,aAAA,CAAC/H,aAAA,CAAAqJ,YAAY;IACXjF,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,EAAA3H,KAAA;IAAA4H,QAAA;MAAAC,QAAA,EAAA5H,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>\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;AAEA,IAAAK,kCAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAN,OAAA;AACA,IAAAO,2BAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,8BAAA,GAAAV,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,gBAAA,GAAAd,OAAA;AACA,IAAAe,cAAA,GAAAf,OAAA;AAGA,IAAAgB,wBAAA,GAAAhB,OAAA;AACA,IAAAiB,oBAAA,GAAAjB,OAAA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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
|
* */
|