stream-chat-react-native-core 5.2.0-beta.1 → 5.3.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Attachment/Card.js +29 -18
- package/lib/commonjs/components/Attachment/Card.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +16 -20
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/GalleryImage.js +34 -6
- package/lib/commonjs/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +37 -29
- package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +10 -8
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +3 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +4 -4
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +4 -4
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +6 -7
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +30 -6
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +8 -5
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +2 -0
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/ImageBackground.js +64 -0
- package/lib/commonjs/components/ImageBackground.js.map +1 -0
- package/lib/commonjs/components/Message/Message.js +15 -16
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +12 -4
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +26 -5
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +58 -47
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +19 -19
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +2 -2
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Card.js +29 -18
- package/lib/module/components/Attachment/Card.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +16 -20
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/GalleryImage.js +34 -6
- package/lib/module/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +37 -29
- package/lib/module/components/Attachment/Giphy.js.map +1 -1
- package/lib/module/components/Avatar/Avatar.js +10 -8
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +3 -1
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +4 -4
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +4 -4
- package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +1 -1
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +6 -7
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +30 -6
- package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +8 -5
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +2 -0
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/ImageBackground.js +64 -0
- package/lib/module/components/ImageBackground.js.map +1 -0
- package/lib/module/components/Message/Message.js +15 -16
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +12 -4
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +26 -5
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +58 -47
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactions.js +19 -19
- package/lib/module/components/MessageOverlay/OverlayReactions.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +2 -2
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +2 -2
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Card.d.ts +3 -2
- package/lib/typescript/components/Attachment/GalleryImage.d.ts +8 -2
- package/lib/typescript/components/Attachment/Giphy.d.ts +2 -1
- package/lib/typescript/components/Avatar/Avatar.d.ts +2 -1
- package/lib/typescript/components/Avatar/GroupAvatar.d.ts +2 -1
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelAvatar.d.ts +2 -0
- package/lib/typescript/components/Chat/Chat.d.ts +1 -1
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/components/ImageBackground.d.ts +33 -0
- package/lib/typescript/components/Message/Message.d.ts +2 -1
- package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +2 -1
- package/lib/typescript/components/Message/MessageSimple/MessageRepliesAvatars.d.ts +2 -0
- package/lib/typescript/components/MessageOverlay/OverlayReactions.d.ts +1 -0
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +1 -1
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +3 -1
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +4 -0
- package/package.json +1 -1
- package/src/__tests__/offline-feature.test.js +3 -1
- package/src/components/Attachment/Card.tsx +11 -2
- package/src/components/Attachment/Gallery.tsx +1 -7
- package/src/components/Attachment/GalleryImage.tsx +31 -9
- package/src/components/Attachment/Giphy.tsx +8 -2
- package/src/components/Avatar/Avatar.tsx +12 -2
- package/src/components/Avatar/GroupAvatar.tsx +4 -4
- package/src/components/ChannelList/ChannelList.tsx +3 -2
- package/src/components/ChannelList/ChannelListMessenger.tsx +3 -3
- package/src/components/ChannelList/__tests__/ChannelList.test.js +1 -1
- package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +2 -1
- package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +1 -1
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +12 -11
- package/src/components/ChannelPreview/ChannelAvatar.tsx +23 -4
- package/src/components/Chat/Chat.tsx +98 -95
- package/src/components/Chat/hooks/useCreateChatContext.ts +2 -0
- package/src/components/ImageBackground.tsx +77 -0
- package/src/components/Message/Message.tsx +8 -8
- package/src/components/Message/MessageSimple/MessageAvatar.tsx +6 -2
- package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +15 -3
- package/src/components/MessageOverlay/MessageOverlay.tsx +210 -205
- package/src/components/MessageOverlay/OverlayReactions.tsx +1 -0
- package/src/contexts/channelsContext/ChannelsContext.tsx +1 -1
- package/src/contexts/chatContext/ChatContext.tsx +3 -1
- package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +8 -1
- package/src/version.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["OverlayReactions.tsx"],"names":["styles","StyleSheet","create","avatarContainer","padding","avatarInnerContainer","alignSelf","avatarName","flex","fontSize","fontWeight","paddingTop","textAlign","avatarNameContainer","alignItems","flexDirection","flexGrow","container","borderRadius","marginTop","width","flatListContainer","paddingHorizontal","paddingVertical","flatListContentContainer","paddingBottom","reactionBubble","justifyContent","position","reactionBubbleBackground","height","title","reactionData","Icon","LoveReaction","type","ThumbsUpReaction","ThumbsDownReaction","LOLReaction","WutReaction","ReactionIcon","pathFill","size","supportedReactions","find","reaction","Unknown","OverlayReactions","props","overlayAlignment","alignment","reactions","showScreen","OverlayReactionsAvatar","layoutHeight","layoutWidth","theme","colors","accent_blue","black","grey_gainsboro","white","overlay","overlayPadding","avatarSize","radius","titleStyle","supportedReactionTypes","map","supportedReaction","filteredReactions","filter","includes","numColumns","Math","floor","Number","maxHeight","renderItem","item","name","x","y","left","top","absoluteFill","backgroundColor","borderColor","borderWidth","color","showScreenStyle","transform","translateY","value","translateX","scale","layout","nativeEvent","index","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;;;;;;;;AAYA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,eAAe,EAAE;AACfC,IAAAA,OAA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AC5E,KAA3B;AACAkC,MAAAA,YAAY,CAACuC,KAAb,GAAqBG,MAAM,CAAClE,MAA5B;AACD,KAJH;AAKE,IAAA,KAAK,EAAE,CAAC9B,MAAM,CAACiB,SAAR,EAAmB;AAAEqE,MAAAA,eAAe,EAAEzB;AAAnB,KAAnB,EAA+C5C,SAA/C,EAA0DyE,eAA1D,CALT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAOE,gCAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAAC1F,MAAM,CAAC+B,KAAR,EAAe;AAAE0D,MAAAA,KAAK,EAAE9B;AAAT,KAAf,EAAiCO,UAAjC,CAAb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAA4DnC,KAA5D,CAPF,EAQE,gCAAC,mCAAD;AACE,IAAA,qBAAqB,EAAE/B,MAAM,CAACwB,wBADhC;AAEE,IAAA,IAAI,EAAE8C,iBAFR;AAGE,IAAA,YAAY,EAAE,6BAAW4B,KAAX;AAAA,UAAGlB,IAAH,SAAGA,IAAH;AAAA,aAAwBA,IAAxB,SAAgCkB,KAAhC;AAAA,KAHhB;AAIE,IAAA,UAAU,EAAEzB,UAJd;AAKE,IAAA,UAAU,EAAEK,UALd;AAME,IAAA,KAAK,EAAE,CAAC9E,MAAM,CAACqB,iBAAR,EAA2BA,iBAA3B,EAA8C;AAAEwD,MAAAA,SAAS,EAAEA,SAAS,GAAGJ;AAAzB,KAA9C,CANT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IARF,CADF;AAmBD,CArMM;;;AAuMP1B,gBAAgB,CAACoD,WAAjB,GAA+B,sCAA/B","sourcesContent":["import React from 'react';\nimport { StyleSheet, Text, useWindowDimensions, View, ViewStyle } from 'react-native';\nimport { FlatList } from 'react-native-gesture-handler';\nimport Animated, { interpolate, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';\nimport Svg, { Circle } from 'react-native-svg';\n\nimport type { Alignment } from '../../contexts/messageContext/MessageContext';\nimport type { MessageOverlayContextValue } from '../../contexts/messageOverlayContext/MessageOverlayContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport {\n LOLReaction,\n LoveReaction,\n ThumbsDownReaction,\n ThumbsUpReaction,\n Unknown,\n WutReaction,\n} from '../../icons';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport type { ReactionData } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n avatarContainer: {\n padding: 8,\n },\n avatarInnerContainer: {\n alignSelf: 'center',\n },\n avatarName: {\n flex: 1,\n fontSize: 12,\n fontWeight: '700',\n paddingTop: 6,\n textAlign: 'center',\n },\n avatarNameContainer: {\n alignItems: 'center',\n flexDirection: 'row',\n flexGrow: 1,\n },\n container: {\n alignItems: 'center',\n borderRadius: 16,\n marginTop: 8,\n width: '100%',\n },\n flatListContainer: {\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n flatListContentContainer: {\n alignItems: 'center',\n paddingBottom: 12,\n },\n reactionBubble: {\n alignItems: 'center',\n borderRadius: 24,\n justifyContent: 'center',\n position: 'absolute',\n },\n reactionBubbleBackground: {\n borderRadius: 24,\n height: 24,\n position: 'absolute',\n width: 24,\n },\n title: {\n fontSize: 16,\n fontWeight: '700',\n paddingTop: 16,\n },\n});\n\nconst reactionData: ReactionData[] = [\n {\n Icon: LoveReaction,\n type: 'love',\n },\n {\n Icon: ThumbsUpReaction,\n type: 'like',\n },\n {\n Icon: ThumbsDownReaction,\n type: 'sad',\n },\n {\n Icon: LOLReaction,\n type: 'haha',\n },\n {\n Icon: WutReaction,\n type: 'wow',\n },\n];\n\nexport type Reaction = {\n alignment: Alignment;\n name: string;\n type: string;\n image?: string;\n};\n\nexport type OverlayReactionsProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<MessageOverlayContextValue<StreamChatGenerics>, 'OverlayReactionsAvatar'> & {\n reactions: Reaction[];\n showScreen: Animated.SharedValue<number>;\n title: string;\n alignment?: Alignment;\n supportedReactions?: ReactionData[];\n};\n\nconst ReactionIcon: React.FC<\n Pick<Reaction, 'type'> & {\n pathFill: string;\n size: number;\n supportedReactions: ReactionData[];\n }\n> = ({ pathFill, size, supportedReactions, type }) => {\n const Icon = supportedReactions.find((reaction) => reaction.type === type)?.Icon || Unknown;\n return <Icon height={size} pathFill={pathFill} width={size} />;\n};\n\n/**\n * OverlayReactions - A high level component which implements all the logic required for message overlay reactions\n */\nexport const OverlayReactions: React.FC<OverlayReactionsProps> = (props) => {\n const {\n alignment: overlayAlignment,\n reactions,\n supportedReactions = reactionData,\n showScreen,\n title,\n OverlayReactionsAvatar,\n } = props;\n const layoutHeight = useSharedValue(0);\n const layoutWidth = useSharedValue(0);\n\n const {\n theme: {\n colors: { accent_blue, black, grey_gainsboro, white },\n overlay: {\n padding: overlayPadding,\n reactions: {\n avatarContainer,\n avatarName,\n avatarSize,\n container,\n flatListContainer,\n radius,\n reactionBubble,\n reactionBubbleBackground,\n title: titleStyle,\n },\n },\n },\n } = useTheme();\n\n const width = useWindowDimensions().width;\n const height = useWindowDimensions().height;\n\n const supportedReactionTypes = supportedReactions.map(\n (supportedReaction) => supportedReaction.type,\n );\n\n const filteredReactions = reactions.filter((reaction) =>\n supportedReactionTypes.includes(reaction.type),\n );\n\n const numColumns = Math.floor(\n (width -\n overlayPadding * 2 -\n ((Number(flatListContainer.paddingHorizontal || 0) ||\n styles.flatListContainer.paddingHorizontal) +\n (Number(avatarContainer.padding || 0) || styles.avatarContainer.padding)) *\n 2) /\n (avatarSize + (Number(avatarContainer.padding || 0) || styles.avatarContainer.padding) * 2),\n );\n\n const maxHeight = Math.floor(\n height -\n overlayPadding * 2 -\n ((Number(flatListContainer.paddingVertical || 0) ||\n styles.flatListContainer.paddingVertical) +\n (Number(avatarContainer.padding || 0) || styles.avatarContainer.padding)) *\n 2,\n );\n\n const renderItem = ({ item }: { item: Reaction }) => {\n const { alignment = 'left', name, type } = item;\n const x = avatarSize / 2 - (avatarSize / (radius * 4)) * (alignment === 'left' ? 1 : -1);\n const y = avatarSize - radius;\n\n const left =\n alignment === 'left'\n ? x -\n (Number(reactionBubbleBackground.width || 0) || styles.reactionBubbleBackground.width) +\n radius\n : x - radius;\n const top =\n y -\n radius -\n (Number(reactionBubbleBackground.height || 0) || styles.reactionBubbleBackground.height);\n\n return (\n <View style={[styles.avatarContainer, avatarContainer]}>\n <View style={styles.avatarInnerContainer}>\n <OverlayReactionsAvatar reaction={item} size={avatarSize} />\n <View style={[StyleSheet.absoluteFill]}>\n <Svg>\n <Circle\n cx={x - (radius * 2 - radius / 4) * (alignment === 'left' ? 1 : -1)}\n cy={y - radius * 2 - radius / 4}\n fill={alignment === 'left' ? grey_gainsboro : white}\n r={radius * 2}\n stroke={alignment === 'left' ? white : grey_gainsboro}\n strokeWidth={radius / 2}\n />\n <Circle\n cx={x}\n cy={y}\n fill={alignment === 'left' ? grey_gainsboro : white}\n r={radius}\n stroke={alignment === 'left' ? white : grey_gainsboro}\n strokeWidth={radius / 2}\n />\n </Svg>\n <View\n style={[\n styles.reactionBubbleBackground,\n {\n backgroundColor: alignment === 'left' ? grey_gainsboro : white,\n borderColor: alignment === 'left' ? white : grey_gainsboro,\n borderWidth: radius / 2,\n left,\n top,\n },\n reactionBubbleBackground,\n ]}\n />\n <View style={[StyleSheet.absoluteFill]}>\n <Svg>\n <Circle\n cx={x - (radius * 2 - radius / 4) * (alignment === 'left' ? 1 : -1)}\n cy={y - radius * 2 - radius / 4}\n fill={alignment === 'left' ? grey_gainsboro : white}\n r={radius * 2 - radius / 2}\n />\n </Svg>\n </View>\n <View\n style={[\n styles.reactionBubble,\n {\n backgroundColor: alignment === 'left' ? grey_gainsboro : white,\n height:\n (reactionBubble.borderRadius || styles.reactionBubble.borderRadius) -\n radius / 2,\n left,\n top,\n width:\n (reactionBubble.borderRadius || styles.reactionBubble.borderRadius) -\n radius / 2,\n },\n reactionBubble,\n ]}\n >\n <ReactionIcon\n pathFill={accent_blue}\n size={(reactionBubble.borderRadius || styles.reactionBubble.borderRadius) / 2}\n supportedReactions={supportedReactions}\n type={type}\n />\n </View>\n </View>\n </View>\n <View style={styles.avatarNameContainer}>\n <Text style={[styles.avatarName, { color: black }, avatarName]}>{name}</Text>\n </View>\n </View>\n );\n };\n\n const showScreenStyle = useAnimatedStyle<ViewStyle>(\n () => ({\n transform: [\n {\n translateY: interpolate(showScreen.value, [0, 1], [-layoutHeight.value / 2, 0]),\n },\n {\n translateX: interpolate(\n showScreen.value,\n [0, 1],\n [overlayAlignment === 'left' ? -layoutWidth.value / 2 : layoutWidth.value / 2, 0],\n ),\n },\n {\n scale: showScreen.value,\n },\n ],\n }),\n [overlayAlignment],\n );\n\n return (\n <Animated.View\n onLayout={({ nativeEvent: { layout } }) => {\n layoutWidth.value = layout.width;\n layoutHeight.value = layout.height;\n }}\n style={[styles.container, { backgroundColor: white }, container, showScreenStyle]}\n >\n <Text style={[styles.title, { color: black }, titleStyle]}>{title}</Text>\n <FlatList\n contentContainerStyle={styles.flatListContentContainer}\n data={filteredReactions}\n keyExtractor={({ name }, index) => `${name}_${index}`}\n numColumns={numColumns}\n renderItem={renderItem}\n style={[styles.flatListContainer, flatListContainer, { maxHeight: maxHeight / numColumns }]}\n />\n </Animated.View>\n );\n};\n\nOverlayReactions.displayName = 'OverlayReactions{overlay{reactions}}';\n"]}
|
|
1
|
+
{"version":3,"sources":["OverlayReactions.tsx"],"names":["styles","StyleSheet","create","avatarContainer","padding","avatarInnerContainer","alignSelf","avatarName","flex","fontSize","fontWeight","paddingTop","textAlign","avatarNameContainer","alignItems","flexDirection","flexGrow","container","borderRadius","marginTop","width","flatListContainer","paddingHorizontal","paddingVertical","flatListContentContainer","paddingBottom","reactionBubble","justifyContent","position","reactionBubbleBackground","height","title","reactionData","Icon","LoveReaction","type","ThumbsUpReaction","ThumbsDownReaction","LOLReaction","WutReaction","ReactionIcon","pathFill","size","supportedReactions","find","reaction","Unknown","OverlayReactions","props","overlayAlignment","alignment","reactions","showScreen","OverlayReactionsAvatar","layoutHeight","layoutWidth","theme","colors","accent_blue","black","grey_gainsboro","white","overlay","overlayPadding","avatarSize","radius","titleStyle","supportedReactionTypes","map","supportedReaction","filteredReactions","filter","includes","numColumns","Math","floor","Number","maxHeight","renderItem","item","name","x","y","left","top","absoluteFill","backgroundColor","borderColor","borderWidth","color","showScreenStyle","transform","translateY","value","translateX","scale","layout","nativeEvent","index","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;;;;;;;;AAYA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,eAAe,EAAE;AACfC,IAAAA,OAAO,EAAE;AADM,GADc;AAI/BC,EAAAA,oBAAoB,EAAE;AACpBC,IAAAA,SAAS,EAAE;AADS,GAJS;AAO/BC,EAAAA,UAAU,EAAE;AACVC,IAAAA,IAAI,EAAE,CADI;AAEVC,IAAAA,QAAQ,EAAE,EAFA;AAGVC,IAAAA,UAAU,EAAE,KAHF;AAIVC,IAAAA,UAAU,EAAE,CAJF;AAKVC,IAAAA,SAAS,EAAE;AALD,GAPmB;AAc/BC,EAAAA,mBAAmB,EAAE;AACnBC,IAAAA,UAAU,EAAE,QADO;AAEnBC,IAAAA,aAAa,EAAE,KAFI;AAGnBC,IAAAA,QAAQ,EAAE;AAHS,GAdU;AAmB/BC,EAAAA,SAAS,EAAE;AACTH,IAAAA,UAAU,EAAE,QADH;AAETI,IAAAA,YAAY,EAAE,EAFL;AAGTC,IAAAA,SAAS,EAAE,CAHF;AAITC,IAAAA,KAAK,EAAE;AAJE,GAnBoB;AAyB/BC,EAAAA,iBAAiB,EAAE;AACjBC,IAAAA,iBAAiB,EAAE,EADF;AAEjBC,IAAAA,eAAe,EAAE;AAFA,GAzBY;AA6B/BC,EAAAA,wBAAwB,EAAE;AACxBV,IAAAA,UAAU,EAAE,QADY;AAExBW,IAAAA,aAAa,EAAE;AAFS,GA7BK;AAiC/BC,EAAAA,cAA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AACqB,iBAAR,EAA2BA,iBAA3B,EAA8C;AAAEwD,MAAAA,SAAS,EAAEA,SAAS,GAAGJ;AAAzB,KAA9C,CANT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IARF,CADF;AAmBD,CArMM;;;AAuMP1B,gBAAgB,CAACoD,WAAjB,GAA+B,sCAA/B","sourcesContent":["import React from 'react';\nimport { StyleSheet, Text, useWindowDimensions, View, ViewStyle } from 'react-native';\nimport { FlatList } from 'react-native-gesture-handler';\nimport Animated, { interpolate, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';\nimport Svg, { Circle } from 'react-native-svg';\n\nimport type { Alignment } from '../../contexts/messageContext/MessageContext';\nimport type { MessageOverlayContextValue } from '../../contexts/messageOverlayContext/MessageOverlayContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport {\n LOLReaction,\n LoveReaction,\n ThumbsDownReaction,\n ThumbsUpReaction,\n Unknown,\n WutReaction,\n} from '../../icons';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport type { ReactionData } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n avatarContainer: {\n padding: 8,\n },\n avatarInnerContainer: {\n alignSelf: 'center',\n },\n avatarName: {\n flex: 1,\n fontSize: 12,\n fontWeight: '700',\n paddingTop: 6,\n textAlign: 'center',\n },\n avatarNameContainer: {\n alignItems: 'center',\n flexDirection: 'row',\n flexGrow: 1,\n },\n container: {\n alignItems: 'center',\n borderRadius: 16,\n marginTop: 8,\n width: '100%',\n },\n flatListContainer: {\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n flatListContentContainer: {\n alignItems: 'center',\n paddingBottom: 12,\n },\n reactionBubble: {\n alignItems: 'center',\n borderRadius: 24,\n justifyContent: 'center',\n position: 'absolute',\n },\n reactionBubbleBackground: {\n borderRadius: 24,\n height: 24,\n position: 'absolute',\n width: 24,\n },\n title: {\n fontSize: 16,\n fontWeight: '700',\n paddingTop: 16,\n },\n});\n\nconst reactionData: ReactionData[] = [\n {\n Icon: LoveReaction,\n type: 'love',\n },\n {\n Icon: ThumbsUpReaction,\n type: 'like',\n },\n {\n Icon: ThumbsDownReaction,\n type: 'sad',\n },\n {\n Icon: LOLReaction,\n type: 'haha',\n },\n {\n Icon: WutReaction,\n type: 'wow',\n },\n];\n\nexport type Reaction = {\n alignment: Alignment;\n id: string;\n name: string;\n type: string;\n image?: string;\n};\n\nexport type OverlayReactionsProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<MessageOverlayContextValue<StreamChatGenerics>, 'OverlayReactionsAvatar'> & {\n reactions: Reaction[];\n showScreen: Animated.SharedValue<number>;\n title: string;\n alignment?: Alignment;\n supportedReactions?: ReactionData[];\n};\n\nconst ReactionIcon: React.FC<\n Pick<Reaction, 'type'> & {\n pathFill: string;\n size: number;\n supportedReactions: ReactionData[];\n }\n> = ({ pathFill, size, supportedReactions, type }) => {\n const Icon = supportedReactions.find((reaction) => reaction.type === type)?.Icon || Unknown;\n return <Icon height={size} pathFill={pathFill} width={size} />;\n};\n\n/**\n * OverlayReactions - A high level component which implements all the logic required for message overlay reactions\n */\nexport const OverlayReactions: React.FC<OverlayReactionsProps> = (props) => {\n const {\n alignment: overlayAlignment,\n reactions,\n supportedReactions = reactionData,\n showScreen,\n title,\n OverlayReactionsAvatar,\n } = props;\n const layoutHeight = useSharedValue(0);\n const layoutWidth = useSharedValue(0);\n\n const {\n theme: {\n colors: { accent_blue, black, grey_gainsboro, white },\n overlay: {\n padding: overlayPadding,\n reactions: {\n avatarContainer,\n avatarName,\n avatarSize,\n container,\n flatListContainer,\n radius,\n reactionBubble,\n reactionBubbleBackground,\n title: titleStyle,\n },\n },\n },\n } = useTheme();\n\n const width = useWindowDimensions().width;\n const height = useWindowDimensions().height;\n\n const supportedReactionTypes = supportedReactions.map(\n (supportedReaction) => supportedReaction.type,\n );\n\n const filteredReactions = reactions.filter((reaction) =>\n supportedReactionTypes.includes(reaction.type),\n );\n\n const numColumns = Math.floor(\n (width -\n overlayPadding * 2 -\n ((Number(flatListContainer.paddingHorizontal || 0) ||\n styles.flatListContainer.paddingHorizontal) +\n (Number(avatarContainer.padding || 0) || styles.avatarContainer.padding)) *\n 2) /\n (avatarSize + (Number(avatarContainer.padding || 0) || styles.avatarContainer.padding) * 2),\n );\n\n const maxHeight = Math.floor(\n height -\n overlayPadding * 2 -\n ((Number(flatListContainer.paddingVertical || 0) ||\n styles.flatListContainer.paddingVertical) +\n (Number(avatarContainer.padding || 0) || styles.avatarContainer.padding)) *\n 2,\n );\n\n const renderItem = ({ item }: { item: Reaction }) => {\n const { alignment = 'left', name, type } = item;\n const x = avatarSize / 2 - (avatarSize / (radius * 4)) * (alignment === 'left' ? 1 : -1);\n const y = avatarSize - radius;\n\n const left =\n alignment === 'left'\n ? x -\n (Number(reactionBubbleBackground.width || 0) || styles.reactionBubbleBackground.width) +\n radius\n : x - radius;\n const top =\n y -\n radius -\n (Number(reactionBubbleBackground.height || 0) || styles.reactionBubbleBackground.height);\n\n return (\n <View style={[styles.avatarContainer, avatarContainer]}>\n <View style={styles.avatarInnerContainer}>\n <OverlayReactionsAvatar reaction={item} size={avatarSize} />\n <View style={[StyleSheet.absoluteFill]}>\n <Svg>\n <Circle\n cx={x - (radius * 2 - radius / 4) * (alignment === 'left' ? 1 : -1)}\n cy={y - radius * 2 - radius / 4}\n fill={alignment === 'left' ? grey_gainsboro : white}\n r={radius * 2}\n stroke={alignment === 'left' ? white : grey_gainsboro}\n strokeWidth={radius / 2}\n />\n <Circle\n cx={x}\n cy={y}\n fill={alignment === 'left' ? grey_gainsboro : white}\n r={radius}\n stroke={alignment === 'left' ? white : grey_gainsboro}\n strokeWidth={radius / 2}\n />\n </Svg>\n <View\n style={[\n styles.reactionBubbleBackground,\n {\n backgroundColor: alignment === 'left' ? grey_gainsboro : white,\n borderColor: alignment === 'left' ? white : grey_gainsboro,\n borderWidth: radius / 2,\n left,\n top,\n },\n reactionBubbleBackground,\n ]}\n />\n <View style={[StyleSheet.absoluteFill]}>\n <Svg>\n <Circle\n cx={x - (radius * 2 - radius / 4) * (alignment === 'left' ? 1 : -1)}\n cy={y - radius * 2 - radius / 4}\n fill={alignment === 'left' ? grey_gainsboro : white}\n r={radius * 2 - radius / 2}\n />\n </Svg>\n </View>\n <View\n style={[\n styles.reactionBubble,\n {\n backgroundColor: alignment === 'left' ? grey_gainsboro : white,\n height:\n (reactionBubble.borderRadius || styles.reactionBubble.borderRadius) -\n radius / 2,\n left,\n top,\n width:\n (reactionBubble.borderRadius || styles.reactionBubble.borderRadius) -\n radius / 2,\n },\n reactionBubble,\n ]}\n >\n <ReactionIcon\n pathFill={accent_blue}\n size={(reactionBubble.borderRadius || styles.reactionBubble.borderRadius) / 2}\n supportedReactions={supportedReactions}\n type={type}\n />\n </View>\n </View>\n </View>\n <View style={styles.avatarNameContainer}>\n <Text style={[styles.avatarName, { color: black }, avatarName]}>{name}</Text>\n </View>\n </View>\n );\n };\n\n const showScreenStyle = useAnimatedStyle<ViewStyle>(\n () => ({\n transform: [\n {\n translateY: interpolate(showScreen.value, [0, 1], [-layoutHeight.value / 2, 0]),\n },\n {\n translateX: interpolate(\n showScreen.value,\n [0, 1],\n [overlayAlignment === 'left' ? -layoutWidth.value / 2 : layoutWidth.value / 2, 0],\n ),\n },\n {\n scale: showScreen.value,\n },\n ],\n }),\n [overlayAlignment],\n );\n\n return (\n <Animated.View\n onLayout={({ nativeEvent: { layout } }) => {\n layoutWidth.value = layout.width;\n layoutHeight.value = layout.height;\n }}\n style={[styles.container, { backgroundColor: white }, container, showScreenStyle]}\n >\n <Text style={[styles.title, { color: black }, titleStyle]}>{title}</Text>\n <FlatList\n contentContainerStyle={styles.flatListContentContainer}\n data={filteredReactions}\n keyExtractor={({ name }, index) => `${name}_${index}`}\n numColumns={numColumns}\n renderItem={renderItem}\n style={[styles.flatListContainer, flatListContainer, { maxHeight: maxHeight / numColumns }]}\n />\n </Animated.View>\n );\n};\n\nOverlayReactions.displayName = 'OverlayReactions{overlay{reactions}}';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChannelsContext.tsx"],"names":["ChannelsContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","ChannelsProvider","children","value","useChannelsContext","contextValue","Error","withChannelsContext","Component","WithChannelsContextComponent","props","channelsContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAqBA;;AAEA;;AACA;;;;;;;;;AA4LO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAC7BC,mDAD6B,CAAxB;;;;AAIA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAG9BC,QAH8B,QAG9BA,QAH8B;AAAA,MAI9BC,KAJ8B,QAI9BA,KAJ8B;AAAA,SAQ9B,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR8B;AAAA,CAAzB;;;;AAaA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB,GAE3B;AACL,MAAMC,YAAY,GAAG,uBACnBR,eADmB,CAArB;;AAIA,MAAIQ,YAAY,KAAKL,mDAAjB,IAA+C,CAAC,2CAApD,EAAyE;AACvE,UAAM,IAAIM,KAAJ,yOAAN;AAGD;;AAED,SAAOD,YAAP;AACD,CAdM;;;;AAoBA,IAAME,mBAAmB,GAAG,SAAtBA,mBAAsB,CAIjCC,SAJiC,EAKqC;AACtE,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGP,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBM,KAAhB,EAAiCC,eAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAAeJ,SAAf,CAAjE;AACA,SAAOC,4BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { FlatListProps } from 'react-native';\nimport type { FlatList } from 'react-native-gesture-handler';\n\nimport type { ChannelPreviewMutedStatusProps } from 'src/components/ChannelPreview/ChannelPreviewMutedStatus';\n\nimport type { Channel } from 'stream-chat';\n\nimport type { HeaderErrorProps } from '../../components/ChannelList/ChannelListHeaderErrorIndicator';\nimport type { QueryChannels } from '../../components/ChannelList/hooks/usePaginatedChannels';\nimport type { ChannelAvatarProps } from '../../components/ChannelPreview/ChannelAvatar';\nimport type { ChannelPreviewMessageProps } from '../../components/ChannelPreview/ChannelPreviewMessage';\nimport type { ChannelPreviewMessengerProps } from '../../components/ChannelPreview/ChannelPreviewMessenger';\nimport type { ChannelPreviewStatusProps } from '../../components/ChannelPreview/ChannelPreviewStatus';\nimport type { ChannelPreviewTitleProps } from '../../components/ChannelPreview/ChannelPreviewTitle';\nimport type { ChannelPreviewUnreadCountProps } from '../../components/ChannelPreview/ChannelPreviewUnreadCount';\nimport type { EmptyStateProps } from '../../components/Indicators/EmptyStateIndicator';\nimport type { LoadingErrorProps } from '../../components/Indicators/LoadingErrorIndicator';\nimport type { LoadingProps } from '../../components/Indicators/LoadingIndicator';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChannelsContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Besides the existing default behavior of the ChannelListMessenger component, you can attach\n * additional props to the underlying React Native FlatList.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **EXAMPLE:**\n *\n * ```\n * <ChannelListMessenger\n * channels={channels}\n * additionalFlatListProps={{ bounces: true }}\n * />\n * ```\n *\n * **Note:** Don't use `additionalFlatListProps` to access the FlatList ref, use `setFlatListRef`\n */\n additionalFlatListProps: Partial<FlatListProps<Channel<StreamChatGenerics>>>;\n /**\n * Channels can be either an array of channels or a promise which resolves to an array of channels\n */\n channels: Channel<StreamChatGenerics>[];\n /**\n * Custom indicator to use when channel list is empty\n *\n * Default: [EmptyStateIndicator](https://getstream.io/chat/docs/sdk/reactnative/core-components/channel/#emptystateindicator)\n * */\n EmptyStateIndicator: React.ComponentType<EmptyStateProps>;\n /**\n * Custom loading indicator to display at bottom of the list, while loading further pages\n *\n * Default: [ChannelListFooterLoadingIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#footerloadingindicator)\n */\n FooterLoadingIndicator: React.ComponentType;\n /**\n * Incremental number change to force update the FlatList\n */\n forceUpdate: number;\n /**\n * Whether or not the FlatList has another page to render\n */\n hasNextPage: boolean;\n /**\n * Custom indicator to display error at top of list, if loading/pagination error occurs\n *\n * Default: [ChannelListHeaderErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headererrorindicator)\n */\n HeaderErrorIndicator: React.ComponentType<HeaderErrorProps>;\n /**\n * Custom indicator to display network-down error at top of list, if there is connectivity issue\n *\n * Default: [ChannelListHeaderNetworkDownIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headernetworkdownindicator)\n */\n HeaderNetworkDownIndicator: React.ComponentType;\n /**\n * Initial channels query loading state, triggers the LoadingIndicator\n */\n loadingChannels: boolean;\n /**\n * Custom indicator to use when there is error in fetching channels\n *\n * Default: [LoadingErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#loadingerrorindicator)\n * */\n LoadingErrorIndicator: React.ComponentType<LoadingErrorProps>;\n /**\n * Custom loading indicator to use on Channel List\n *\n * */\n LoadingIndicator: React.ComponentType<Pick<LoadingProps, 'listType'>>;\n /**\n * Whether or not additional channels are being loaded, triggers the FooterLoadingIndicator\n */\n loadingNextPage: boolean;\n /**\n * The React Native FlatList threshold to fetch more data\n * @see See loadMoreThreshold [doc](https://facebook.github.io/react-native/docs/flatlist#onendreachedthreshold)\n * */\n loadMoreThreshold: number;\n /**\n * Loads the next page of `channels`, which is present as a required prop\n */\n loadNextPage: QueryChannels | undefined;\n /**\n * Max number to display within notification badge. Default: 255 and it cannot be higher than that for now due to backend limitations\n */\n maxUnreadCount: number;\n /**\n * Number of skeletons that should show when loading. Default: 6\n */\n numberOfSkeletons: number;\n /**\n * Custom UI component to display individual channel list items\n *\n * Default: [ChannelPreviewMessenger](https://getstream.io/chat/docs/sdk/reactnative/ui-components/channel-preview-messenger/)\n */\n Preview: React.ComponentType<ChannelPreviewMessengerProps<StreamChatGenerics>>;\n /**\n * Triggered when the channel list is refreshing, displays a loading spinner at the top of the list\n */\n refreshing: boolean;\n /**\n * Function to refresh the channel list that is similar to `reloadList`, but it doesn't wipe out existing channels\n * from UI before loading the new ones\n */\n refreshList: () => void | Promise<void>;\n /**\n * Removes all the existing channels from UI and loads fresh channels\n * */\n reloadList: () => Promise<void>;\n // /**\n // * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n // *\n // * @param channel A channel object\n // */\n // setActiveChannel?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Function to gain access to the inner FlatList ref\n *\n * **Example:**\n *\n * ```\n * <ChannelListMessenger\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef: (ref: FlatList<Channel<StreamChatGenerics>> | null) => void;\n /**\n * Custom UI component to display loading channel skeletons\n *\n * Default: [Skeleton](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#skeleton)\n */\n Skeleton: React.ComponentType;\n /**\n * Error in channels query, if any\n */\n error?: Error;\n ListHeaderComponent?: React.ComponentType;\n /**\n * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n *\n * @param channel A channel object\n */\n onSelect?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelAvatar](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelAvatar.tsx)\n */\n PreviewAvatar?: React.ComponentType<ChannelAvatarProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview of latest message on channel.\n *\n * **Default** [ChannelPreviewMessage](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMessage.tsx)\n */\n PreviewMessage?: React.ComponentType<ChannelPreviewMessageProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render muted status.\n *\n * **Default** [ChannelMutedStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx)\n */\n PreviewMutedStatus?: React.ComponentType<ChannelPreviewMutedStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewStatus.tsx)\n */\n PreviewStatus?: React.ComponentType<ChannelPreviewStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewTitle](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewTitle.tsx)\n */\n PreviewTitle?: React.ComponentType<ChannelPreviewTitleProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewUnreadCount](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx)\n */\n PreviewUnreadCount?: React.ComponentType<ChannelPreviewUnreadCountProps<StreamChatGenerics>>;\n};\n\nexport const ChannelsContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as ChannelsContextValue,\n);\n\nexport const ChannelsProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChannelsContextValue<StreamChatGenerics>;\n}>) => (\n <ChannelsContext.Provider value={value as unknown as ChannelsContextValue}>\n {children}\n </ChannelsContext.Provider>\n);\n\nexport const useChannelsContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n ChannelsContext,\n ) as unknown as ChannelsContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChannelsContext hook was called outside of the ChannelsContext provider. Make sure you have configured ChannelList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#channel-list`,\n );\n }\n\n return contextValue;\n};\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChannelContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChannelsContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>> => {\n const WithChannelsContextComponent = (\n props: Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>,\n ) => {\n const channelsContext = useChannelsContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...channelsContext} />;\n };\n WithChannelsContextComponent.displayName = `WithChannelsContext${getDisplayName(Component)}`;\n return WithChannelsContextComponent;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["ChannelsContext.tsx"],"names":["ChannelsContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","ChannelsProvider","children","value","useChannelsContext","contextValue","Error","withChannelsContext","Component","WithChannelsContextComponent","props","channelsContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAqBA;;AAEA;;AACA;;;;;;;;;AA4LO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAC7BC,mDAD6B,CAAxB;;;;AAIA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAG9BC,QAH8B,QAG9BA,QAH8B;AAAA,MAI9BC,KAJ8B,QAI9BA,KAJ8B;AAAA,SAQ9B,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR8B;AAAA,CAAzB;;;;AAaA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB,GAE3B;AACL,MAAMC,YAAY,GAAG,uBACnBR,eADmB,CAArB;;AAIA,MAAIQ,YAAY,KAAKL,mDAAjB,IAA+C,CAAC,2CAApD,EAAyE;AACvE,UAAM,IAAIM,KAAJ,yOAAN;AAGD;;AAED,SAAOD,YAAP;AACD,CAdM;;;;AAoBA,IAAME,mBAAmB,GAAG,SAAtBA,mBAAsB,CAIjCC,SAJiC,EAKqC;AACtE,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGP,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBM,KAAhB,EAAiCC,eAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAAeJ,SAAf,CAAjE;AACA,SAAOC,4BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { FlatListProps } from 'react-native';\nimport type { FlatList } from 'react-native-gesture-handler';\n\nimport type { ChannelPreviewMutedStatusProps } from 'src/components/ChannelPreview/ChannelPreviewMutedStatus';\n\nimport type { Channel } from 'stream-chat';\n\nimport type { HeaderErrorProps } from '../../components/ChannelList/ChannelListHeaderErrorIndicator';\nimport type { QueryChannels } from '../../components/ChannelList/hooks/usePaginatedChannels';\nimport type { ChannelAvatarProps } from '../../components/ChannelPreview/ChannelAvatar';\nimport type { ChannelPreviewMessageProps } from '../../components/ChannelPreview/ChannelPreviewMessage';\nimport type { ChannelPreviewMessengerProps } from '../../components/ChannelPreview/ChannelPreviewMessenger';\nimport type { ChannelPreviewStatusProps } from '../../components/ChannelPreview/ChannelPreviewStatus';\nimport type { ChannelPreviewTitleProps } from '../../components/ChannelPreview/ChannelPreviewTitle';\nimport type { ChannelPreviewUnreadCountProps } from '../../components/ChannelPreview/ChannelPreviewUnreadCount';\nimport type { EmptyStateProps } from '../../components/Indicators/EmptyStateIndicator';\nimport type { LoadingErrorProps } from '../../components/Indicators/LoadingErrorIndicator';\nimport type { LoadingProps } from '../../components/Indicators/LoadingIndicator';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChannelsContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Besides the existing default behavior of the ChannelListMessenger component, you can attach\n * additional props to the underlying React Native FlatList.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **EXAMPLE:**\n *\n * ```\n * <ChannelListMessenger\n * channels={channels}\n * additionalFlatListProps={{ bounces: true }}\n * />\n * ```\n *\n * **Note:** Don't use `additionalFlatListProps` to access the FlatList ref, use `setFlatListRef`\n */\n additionalFlatListProps: Partial<FlatListProps<Channel<StreamChatGenerics>>>;\n /**\n * Channels can be either an array of channels or a promise which resolves to an array of channels\n */\n channels: Channel<StreamChatGenerics>[] | null;\n /**\n * Custom indicator to use when channel list is empty\n *\n * Default: [EmptyStateIndicator](https://getstream.io/chat/docs/sdk/reactnative/core-components/channel/#emptystateindicator)\n * */\n EmptyStateIndicator: React.ComponentType<EmptyStateProps>;\n /**\n * Custom loading indicator to display at bottom of the list, while loading further pages\n *\n * Default: [ChannelListFooterLoadingIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#footerloadingindicator)\n */\n FooterLoadingIndicator: React.ComponentType;\n /**\n * Incremental number change to force update the FlatList\n */\n forceUpdate: number;\n /**\n * Whether or not the FlatList has another page to render\n */\n hasNextPage: boolean;\n /**\n * Custom indicator to display error at top of list, if loading/pagination error occurs\n *\n * Default: [ChannelListHeaderErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headererrorindicator)\n */\n HeaderErrorIndicator: React.ComponentType<HeaderErrorProps>;\n /**\n * Custom indicator to display network-down error at top of list, if there is connectivity issue\n *\n * Default: [ChannelListHeaderNetworkDownIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headernetworkdownindicator)\n */\n HeaderNetworkDownIndicator: React.ComponentType;\n /**\n * Initial channels query loading state, triggers the LoadingIndicator\n */\n loadingChannels: boolean;\n /**\n * Custom indicator to use when there is error in fetching channels\n *\n * Default: [LoadingErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#loadingerrorindicator)\n * */\n LoadingErrorIndicator: React.ComponentType<LoadingErrorProps>;\n /**\n * Custom loading indicator to use on Channel List\n *\n * */\n LoadingIndicator: React.ComponentType<Pick<LoadingProps, 'listType'>>;\n /**\n * Whether or not additional channels are being loaded, triggers the FooterLoadingIndicator\n */\n loadingNextPage: boolean;\n /**\n * The React Native FlatList threshold to fetch more data\n * @see See loadMoreThreshold [doc](https://facebook.github.io/react-native/docs/flatlist#onendreachedthreshold)\n * */\n loadMoreThreshold: number;\n /**\n * Loads the next page of `channels`, which is present as a required prop\n */\n loadNextPage: QueryChannels | undefined;\n /**\n * Max number to display within notification badge. Default: 255 and it cannot be higher than that for now due to backend limitations\n */\n maxUnreadCount: number;\n /**\n * Number of skeletons that should show when loading. Default: 6\n */\n numberOfSkeletons: number;\n /**\n * Custom UI component to display individual channel list items\n *\n * Default: [ChannelPreviewMessenger](https://getstream.io/chat/docs/sdk/reactnative/ui-components/channel-preview-messenger/)\n */\n Preview: React.ComponentType<ChannelPreviewMessengerProps<StreamChatGenerics>>;\n /**\n * Triggered when the channel list is refreshing, displays a loading spinner at the top of the list\n */\n refreshing: boolean;\n /**\n * Function to refresh the channel list that is similar to `reloadList`, but it doesn't wipe out existing channels\n * from UI before loading the new ones\n */\n refreshList: () => void | Promise<void>;\n /**\n * Removes all the existing channels from UI and loads fresh channels\n * */\n reloadList: () => Promise<void>;\n // /**\n // * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n // *\n // * @param channel A channel object\n // */\n // setActiveChannel?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Function to gain access to the inner FlatList ref\n *\n * **Example:**\n *\n * ```\n * <ChannelListMessenger\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef: (ref: FlatList<Channel<StreamChatGenerics>> | null) => void;\n /**\n * Custom UI component to display loading channel skeletons\n *\n * Default: [Skeleton](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#skeleton)\n */\n Skeleton: React.ComponentType;\n /**\n * Error in channels query, if any\n */\n error?: Error;\n ListHeaderComponent?: React.ComponentType;\n /**\n * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n *\n * @param channel A channel object\n */\n onSelect?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelAvatar](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelAvatar.tsx)\n */\n PreviewAvatar?: React.ComponentType<ChannelAvatarProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview of latest message on channel.\n *\n * **Default** [ChannelPreviewMessage](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMessage.tsx)\n */\n PreviewMessage?: React.ComponentType<ChannelPreviewMessageProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render muted status.\n *\n * **Default** [ChannelMutedStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx)\n */\n PreviewMutedStatus?: React.ComponentType<ChannelPreviewMutedStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewStatus.tsx)\n */\n PreviewStatus?: React.ComponentType<ChannelPreviewStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewTitle](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewTitle.tsx)\n */\n PreviewTitle?: React.ComponentType<ChannelPreviewTitleProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewUnreadCount](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx)\n */\n PreviewUnreadCount?: React.ComponentType<ChannelPreviewUnreadCountProps<StreamChatGenerics>>;\n};\n\nexport const ChannelsContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as ChannelsContextValue,\n);\n\nexport const ChannelsProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChannelsContextValue<StreamChatGenerics>;\n}>) => (\n <ChannelsContext.Provider value={value as unknown as ChannelsContextValue}>\n {children}\n </ChannelsContext.Provider>\n);\n\nexport const useChannelsContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n ChannelsContext,\n ) as unknown as ChannelsContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChannelsContext hook was called outside of the ChannelsContext provider. Make sure you have configured ChannelList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#channel-list`,\n );\n }\n\n return contextValue;\n};\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChannelContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChannelsContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>> => {\n const WithChannelsContextComponent = (\n props: Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>,\n ) => {\n const channelsContext = useChannelsContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...channelsContext} />;\n };\n WithChannelsContextComponent.displayName = `WithChannelsContext${getDisplayName(Component)}`;\n return WithChannelsContextComponent;\n};\n"]}
|
|
@@ -36,7 +36,7 @@ var ChatProvider = function ChatProvider(_ref) {
|
|
|
36
36
|
__self: _this,
|
|
37
37
|
__source: {
|
|
38
38
|
fileName: _jsxFileName,
|
|
39
|
-
lineNumber:
|
|
39
|
+
lineNumber: 78,
|
|
40
40
|
columnNumber: 3
|
|
41
41
|
}
|
|
42
42
|
}, children);
|
|
@@ -63,7 +63,7 @@ var withChatContext = function withChatContext(Component) {
|
|
|
63
63
|
__self: _this,
|
|
64
64
|
__source: {
|
|
65
65
|
fileName: _jsxFileName,
|
|
66
|
-
lineNumber:
|
|
66
|
+
lineNumber: 111,
|
|
67
67
|
columnNumber: 12
|
|
68
68
|
}
|
|
69
69
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatContext.tsx"],"names":["ChatContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","ChatProvider","children","value","useChatContext","contextValue","Error","withChatContext","Component","WithChatContextComponent","props","chatContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["ChatContext.tsx"],"names":["ChatContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","ChatProvider","children","value","useChatContext","contextValue","Error","withChatContext","Component","WithChatContextComponent","props","chatContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAMA;;AAEA;;AACA;;;;;;;;;AA0DO,IAAMA,WAAW,GAAGC,kBAAMC,aAAN,CAAoBC,mDAApB,CAApB;;;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe;AAAA,MAG1BC,QAH0B,QAG1BA,QAH0B;AAAA,MAI1BC,KAJ0B,QAI1BA,KAJ0B;AAAA,SAQ1B,gCAAC,WAAD,CAAa,QAAb;AAAsB,IAAA,KAAK,EAAEA,KAA7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR0B;AAAA,CAArB;;;;AAaA,IAAME,cAAc,GAAG,SAAjBA,cAAiB,GAEvB;AACL,MAAMC,YAAY,GAAG,uBAAWR,WAAX,CAArB;;AAEA,MAAIQ,YAAY,KAAKL,mDAAjB,IAA+C,CAAC,2CAApD,EAAyE;AACvE,UAAM,IAAIM,KAAJ,+MAAN;AAGD;;AAED,SAAOD,YAAP;AACD,CAZM;;;;AAmBA,IAAME,eAAe,GAAG,SAAlBA,eAAkB,CAI7BC,SAJ6B,EAKqC;AAClE,MAAMC,wBAAwB,GAAG,SAA3BA,wBAA2B,CAACC,KAAD,EAAgE;AAC/F,QAAMC,WAAW,GAAGP,cAAc,EAAlC;AAEA,WAAO,gCAAC,SAAD,gCAAgBM,KAAhB,EAAiCC,WAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAJD;;AAKAF,EAAAA,wBAAwB,CAACG,WAAzB,uBAAyD,oCAAeJ,SAAf,CAAzD;AACA,SAAOC,wBAAP;AACD,CAbM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\nimport type { ImageProps } from 'react-native';\n\nimport type { AppSettingsAPIResponse, Channel, EventHandler, Mute, StreamChat } from 'stream-chat';\n\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChatContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Object of application settings returned from Stream.\n * */\n appSettings: AppSettingsAPIResponse<StreamChatGenerics> | null;\n /**\n * The StreamChat client object\n *\n * ```\n * import { StreamChat } from 'stream-chat';\n * import { Chat } from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key);\n * await client.connectUser('user_id', 'userToken');\n *\n * <Chat client={client}>\n * </Chat>\n * ```\n *\n * @overrideType StreamChat\n * */\n client: StreamChat<StreamChatGenerics>;\n connectionRecovering: boolean;\n enableOfflineSupport: boolean;\n ImageComponent: React.ComponentType<ImageProps>;\n isOnline: boolean;\n mutedUsers: Mute<StreamChatGenerics>[];\n /**\n * @param newChannel Channel to set as active.\n *\n * @overrideType Function\n */\n setActiveChannel: (newChannel?: Channel<StreamChatGenerics>) => void;\n subscribeConnectionRecoveredCallback: (callback: EventHandler<StreamChatGenerics>) => () => void;\n /**\n * Instance of channel object from stream-chat package.\n *\n * Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript\n *\n * ```\n * import { StreamChat, Channel } from 'stream-chat';\n * import { Chat, Channel} from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key');\n * await client.connectUser('user_id', 'user_token');\n * const channel = client.channel('messaging', 'channel_id');\n * await channel.watch();\n * ```\n *\n * @overrideType Channel\n */\n channel?: Channel<StreamChatGenerics>;\n};\n\nexport const ChatContext = React.createContext(DEFAULT_BASE_CONTEXT_VALUE as ChatContextValue);\n\nexport const ChatProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: ChatContextValue<StreamChatGenerics>;\n}>) => (\n <ChatContext.Provider value={value as unknown as ChatContextValue}>\n {children}\n </ChatContext.Provider>\n);\n\nexport const useChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(ChatContext) as unknown as ChatContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChatContext hook was called outside the ChatContext Provider. Make sure you have configured Chat component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#chat`,\n );\n }\n\n return contextValue;\n};\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChatContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChatContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChatContextValue<StreamChatGenerics>>> => {\n const WithChatContextComponent = (props: Omit<P, keyof ChatContextValue<StreamChatGenerics>>) => {\n const chatContext = useChatContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...chatContext} />;\n };\n WithChatContextComponent.displayName = `WithChatContext${getDisplayName(Component)}`;\n return WithChatContextComponent;\n};\n"]}
|
|
@@ -39,7 +39,7 @@ var MessageOverlayProvider = function MessageOverlayProvider(_ref) {
|
|
|
39
39
|
__self: _this,
|
|
40
40
|
__source: {
|
|
41
41
|
fileName: _jsxFileName,
|
|
42
|
-
lineNumber:
|
|
42
|
+
lineNumber: 97,
|
|
43
43
|
columnNumber: 5
|
|
44
44
|
}
|
|
45
45
|
}, children);
|
|
@@ -66,7 +66,7 @@ var withMessageOverlayContext = function withMessageOverlayContext(Component) {
|
|
|
66
66
|
__self: _this,
|
|
67
67
|
__source: {
|
|
68
68
|
fileName: _jsxFileName,
|
|
69
|
-
lineNumber:
|
|
69
|
+
lineNumber: 137,
|
|
70
70
|
columnNumber: 12
|
|
71
71
|
}
|
|
72
72
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MessageOverlayContext.tsx"],"names":["MessageOverlayContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","MessageOverlayProvider","children","value","messageOverlayContext","useMessageOverlayContext","contextValue","Error","withMessageOverlayContext","Component","WithMessageOverlayContextComponent","props","messageContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["MessageOverlayContext.tsx"],"names":["MessageOverlayContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","MessageOverlayProvider","children","value","messageOverlayContext","useMessageOverlayContext","contextValue","Error","withMessageOverlayContext","Component","WithMessageOverlayContextComponent","props","messageContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAMA;;AAiBA;;AAEA;;AACA;;;;;;;;;AAwDO,IAAMA,qBAAqB,GAAGC,kBAAMC,aAAN,CACnCC,mDADmC,CAA9B;;;;AAIA,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAyB,OAO/B;AAAA,MAJLC,QAIK,QAJLA,QAIK;AAAA,MAHLC,KAGK,QAHLA,KAGK;AACL,MAAMC,qBAAqB,GAAG,4CAAmBD,KAAnB,CAA9B;AACA,SACE,gCAAC,qBAAD,CAAuB,QAAvB;AACE,IAAA,KAAK,EAAEC,qBADT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAGGF,QAHH,CADF;AAOD,CAhBM;;;;AAkBA,IAAMG,wBAAwB,GAAG,SAA3BA,wBAA2B,GAEjC;AACL,MAAMC,YAAY,GAAG,uBACnBT,qBADmB,CAArB;;AAIA,MAAIS,YAAY,KAAKN,mDAAjB,IAA+C,CAAC,2CAApD,EAAyE;AACvE,UAAM,IAAIO,KAAJ,0PAAN;AAGD;;AAED,SAAOD,YAAP;AACD,CAdM;;;;AAqBA,IAAME,yBAAyB,GAAG,SAA5BA,yBAA4B,CAIvCC,SAJuC,EAKqC;AAC5E,MAAMC,kCAAkC,GAAG,SAArCA,kCAAqC,CACzCC,KADyC,EAEtC;AACH,QAAMC,cAAc,GAAGP,wBAAwB,EAA/C;AAEA,WAAO,gCAAC,SAAD,gCAAgBM,KAAhB,EAAiCC,cAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,kCAAkC,CAACG,WAAnC,iCAA6E,oCAC3EJ,SAD2E,CAA7E;AAGA,SAAOC,kCAAP;AACD,CAjBM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { ImageProps } from 'react-native';\n\nimport type { Attachment, TranslationLanguages } from 'stream-chat';\n\nimport { useResettableState } from './hooks/useResettableState';\n\nimport type { GroupType, MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { MessageActionListProps } from '../../components/MessageOverlay/MessageActionList';\nimport type {\n MessageActionListItemProps,\n MessageActionType,\n} from '../../components/MessageOverlay/MessageActionListItem';\nimport type { OverlayReactionListProps } from '../../components/MessageOverlay/OverlayReactionList';\nimport type { OverlayReactionsProps } from '../../components/MessageOverlay/OverlayReactions';\nimport type { OverlayReactionsAvatarProps } from '../../components/MessageOverlay/OverlayReactionsAvatar';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport type { ReactionData } from '../../utils/utils';\nimport type { ChatContextValue } from '../chatContext/ChatContext';\nimport type { Alignment, MessageContextValue } from '../messageContext/MessageContext';\nimport type { MessagesContextValue } from '../messagesContext/MessagesContext';\nimport type { OwnCapabilitiesContextValue } from '../ownCapabilitiesContext/OwnCapabilitiesContext';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type MessageOverlayData<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n alignment?: Alignment;\n chatContext?: ChatContextValue<StreamChatGenerics>;\n clientId?: string;\n files?: Attachment<StreamChatGenerics>[];\n groupStyles?: GroupType[];\n handleReaction?: (reactionType: string) => Promise<void>;\n ImageComponent?: React.ComponentType<ImageProps>;\n images?: Attachment<StreamChatGenerics>[];\n message?: MessageType<StreamChatGenerics>;\n messageActions?: MessageActionType[];\n messageContext?: MessageContextValue<StreamChatGenerics>;\n messageReactionTitle?: string;\n messagesContext?: MessagesContextValue<StreamChatGenerics>;\n onlyEmojis?: boolean;\n otherAttachments?: Attachment<StreamChatGenerics>[];\n OverlayReactionList?: React.ComponentType<OverlayReactionListProps<StreamChatGenerics>>;\n ownCapabilities?: OwnCapabilitiesContextValue;\n supportedReactions?: ReactionData[];\n threadList?: boolean;\n userLanguage?: TranslationLanguages;\n videos?: Attachment<StreamChatGenerics>[];\n};\n\nexport type MessageOverlayContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Custom UI component for rendering [message actions](https://github.com/GetStream/stream-chat-react-native/blob/main/screenshots/docs/2.png) in overlay.\n *\n * **Default** [MessageActionList](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageOverlay/MessageActions.tsx)\n */\n MessageActionList: React.ComponentType<MessageActionListProps<StreamChatGenerics>>;\n MessageActionListItem: React.ComponentType<MessageActionListItemProps<StreamChatGenerics>>;\n /**\n * Custom UI component for rendering [reaction selector](https://github.com/GetStream/stream-chat-react-native/blob/main/screenshots/docs/2.png) in overlay (which shows up on long press on message).\n *\n * **Default** [OverlayReactionList](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageOverlay/OverlayReactionList.tsx)\n */\n OverlayReactionList: React.ComponentType<OverlayReactionListProps<StreamChatGenerics>>;\n /**\n * Custom UI component for rendering [reactions list](https://github.com/GetStream/stream-chat-react-native/blob/main/screenshots/docs/2.png), in overlay (which shows up on long press on message).\n *\n * **Default** [OverlayReactions](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageOverlay/OverlayReactions.tsx)\n */\n OverlayReactions: React.ComponentType<OverlayReactionsProps<StreamChatGenerics>>;\n OverlayReactionsAvatar: React.ComponentType<OverlayReactionsAvatarProps>;\n reset: () => void;\n setData: React.Dispatch<React.SetStateAction<MessageOverlayData<StreamChatGenerics>>>;\n data?: MessageOverlayData<StreamChatGenerics>;\n};\n\nexport const MessageOverlayContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as MessageOverlayContextValue,\n);\n\nexport const MessageOverlayProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: MessageOverlayContextValue<StreamChatGenerics>;\n}>) => {\n const messageOverlayContext = useResettableState(value);\n return (\n <MessageOverlayContext.Provider\n value={messageOverlayContext as unknown as MessageOverlayContextValue}\n >\n {children}\n </MessageOverlayContext.Provider>\n );\n};\n\nexport const useMessageOverlayContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n MessageOverlayContext,\n ) as unknown as MessageOverlayContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useMessageOverlayContext hook was called outside the MessageOverlayContext 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\n/**\n * Typescript currently does not support partial inference so if MessageOverlayContext\n * typing is desired while using the HOC withMessageOverlayContextContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withMessageOverlayContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof MessageOverlayContextValue<StreamChatGenerics>>> => {\n const WithMessageOverlayContextComponent = (\n props: Omit<P, keyof MessageOverlayContextValue<StreamChatGenerics>>,\n ) => {\n const messageContext = useMessageOverlayContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...messageContext} />;\n };\n WithMessageOverlayContextComponent.displayName = `WithMessageOverlayContext${getDisplayName(\n Component,\n )}`;\n return WithMessageOverlayContextComponent;\n};\n"]}
|
|
@@ -15,6 +15,8 @@ var _reactNative = require("react-native");
|
|
|
15
15
|
|
|
16
16
|
var _openUrlSafely = require("./utils/openUrlSafely");
|
|
17
17
|
|
|
18
|
+
var _ChatContext = require("../../contexts/chatContext/ChatContext");
|
|
19
|
+
|
|
18
20
|
var _MessageContext = require("../../contexts/messageContext/MessageContext");
|
|
19
21
|
|
|
20
22
|
var _MessagesContext = require("../../contexts/messagesContext/MessagesContext");
|
|
@@ -25,6 +27,8 @@ var _Play = require("../../icons/Play");
|
|
|
25
27
|
|
|
26
28
|
var _utils = require("../../utils/utils");
|
|
27
29
|
|
|
30
|
+
var _ImageBackground = require("../ImageBackground");
|
|
31
|
+
|
|
28
32
|
var _excluded = ["description", "title"];
|
|
29
33
|
|
|
30
34
|
var _this = this,
|
|
@@ -90,6 +94,8 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
90
94
|
CardCover = props.CardCover,
|
|
91
95
|
CardFooter = props.CardFooter,
|
|
92
96
|
CardHeader = props.CardHeader,
|
|
97
|
+
_props$ImageComponent = props.ImageComponent,
|
|
98
|
+
ImageComponent = _props$ImageComponent === void 0 ? _reactNative.Image : _props$ImageComponent,
|
|
93
99
|
image_url = props.image_url,
|
|
94
100
|
og_scrape_url = props.og_scrape_url,
|
|
95
101
|
_onLongPress = props.onLongPress,
|
|
@@ -179,31 +185,32 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
179
185
|
__self: _this,
|
|
180
186
|
__source: {
|
|
181
187
|
fileName: _jsxFileName,
|
|
182
|
-
lineNumber:
|
|
188
|
+
lineNumber: 166,
|
|
183
189
|
columnNumber: 5
|
|
184
190
|
}
|
|
185
191
|
}), CardHeader && _react["default"].createElement(CardHeader, (0, _extends2["default"])({}, props, {
|
|
186
192
|
__self: _this,
|
|
187
193
|
__source: {
|
|
188
194
|
fileName: _jsxFileName,
|
|
189
|
-
lineNumber:
|
|
195
|
+
lineNumber: 201,
|
|
190
196
|
columnNumber: 22
|
|
191
197
|
}
|
|
192
198
|
})), CardCover && _react["default"].createElement(CardCover, (0, _extends2["default"])({}, props, {
|
|
193
199
|
__self: _this,
|
|
194
200
|
__source: {
|
|
195
201
|
fileName: _jsxFileName,
|
|
196
|
-
lineNumber:
|
|
202
|
+
lineNumber: 202,
|
|
197
203
|
columnNumber: 21
|
|
198
204
|
}
|
|
199
205
|
})), uri && !CardCover && _react["default"].createElement(_reactNative.View, {
|
|
200
206
|
__self: _this,
|
|
201
207
|
__source: {
|
|
202
208
|
fileName: _jsxFileName,
|
|
203
|
-
lineNumber:
|
|
209
|
+
lineNumber: 204,
|
|
204
210
|
columnNumber: 9
|
|
205
211
|
}
|
|
206
|
-
}, _react["default"].createElement(
|
|
212
|
+
}, _react["default"].createElement(_ImageBackground.ImageBackground, {
|
|
213
|
+
ImageComponent: ImageComponent,
|
|
207
214
|
imageStyle: styles.cardCover,
|
|
208
215
|
resizeMode: "cover",
|
|
209
216
|
source: {
|
|
@@ -213,7 +220,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
213
220
|
__self: _this,
|
|
214
221
|
__source: {
|
|
215
222
|
fileName: _jsxFileName,
|
|
216
|
-
lineNumber:
|
|
223
|
+
lineNumber: 205,
|
|
217
224
|
columnNumber: 11
|
|
218
225
|
}
|
|
219
226
|
}, isVideoCard ? _react["default"].createElement(_reactNative.View, {
|
|
@@ -223,7 +230,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
223
230
|
__self: _this,
|
|
224
231
|
__source: {
|
|
225
232
|
fileName: _jsxFileName,
|
|
226
|
-
lineNumber:
|
|
233
|
+
lineNumber: 213,
|
|
227
234
|
columnNumber: 15
|
|
228
235
|
}
|
|
229
236
|
}, _react["default"].createElement(_Play.Play, {
|
|
@@ -233,7 +240,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
233
240
|
__self: _this,
|
|
234
241
|
__source: {
|
|
235
242
|
fileName: _jsxFileName,
|
|
236
|
-
lineNumber:
|
|
243
|
+
lineNumber: 214,
|
|
237
244
|
columnNumber: 17
|
|
238
245
|
}
|
|
239
246
|
})) : null), author_name && _react["default"].createElement(_reactNative.View, {
|
|
@@ -241,7 +248,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
241
248
|
__self: _this,
|
|
242
249
|
__source: {
|
|
243
250
|
fileName: _jsxFileName,
|
|
244
|
-
lineNumber:
|
|
251
|
+
lineNumber: 219,
|
|
245
252
|
columnNumber: 13
|
|
246
253
|
}
|
|
247
254
|
}, _react["default"].createElement(_reactNative.View, {
|
|
@@ -251,7 +258,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
251
258
|
__self: _this,
|
|
252
259
|
__source: {
|
|
253
260
|
fileName: _jsxFileName,
|
|
254
|
-
lineNumber:
|
|
261
|
+
lineNumber: 220,
|
|
255
262
|
columnNumber: 15
|
|
256
263
|
}
|
|
257
264
|
}, _react["default"].createElement(_reactNative.Text, {
|
|
@@ -261,14 +268,14 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
261
268
|
__self: _this,
|
|
262
269
|
__source: {
|
|
263
270
|
fileName: _jsxFileName,
|
|
264
|
-
lineNumber:
|
|
271
|
+
lineNumber: 228,
|
|
265
272
|
columnNumber: 17
|
|
266
273
|
}
|
|
267
274
|
}, author_name)))), CardFooter ? _react["default"].createElement(CardFooter, (0, _extends2["default"])({}, props, {
|
|
268
275
|
__self: _this,
|
|
269
276
|
__source: {
|
|
270
277
|
fileName: _jsxFileName,
|
|
271
|
-
lineNumber:
|
|
278
|
+
lineNumber: 244,
|
|
272
279
|
columnNumber: 9
|
|
273
280
|
}
|
|
274
281
|
})) : _react["default"].createElement(_reactNative.View, {
|
|
@@ -276,7 +283,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
276
283
|
__self: _this,
|
|
277
284
|
__source: {
|
|
278
285
|
fileName: _jsxFileName,
|
|
279
|
-
lineNumber:
|
|
286
|
+
lineNumber: 246,
|
|
280
287
|
columnNumber: 9
|
|
281
288
|
}
|
|
282
289
|
}, _react["default"].createElement(_reactNative.View, {
|
|
@@ -288,7 +295,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
288
295
|
__self: _this,
|
|
289
296
|
__source: {
|
|
290
297
|
fileName: _jsxFileName,
|
|
291
|
-
lineNumber:
|
|
298
|
+
lineNumber: 247,
|
|
292
299
|
columnNumber: 11
|
|
293
300
|
}
|
|
294
301
|
}, !uri && author_name && _react["default"].createElement(_reactNative.Text, {
|
|
@@ -298,7 +305,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
298
305
|
__self: _this,
|
|
299
306
|
__source: {
|
|
300
307
|
fileName: _jsxFileName,
|
|
301
|
-
lineNumber:
|
|
308
|
+
lineNumber: 256,
|
|
302
309
|
columnNumber: 15
|
|
303
310
|
}
|
|
304
311
|
}, author_name), title && _react["default"].createElement(_reactNative.Text, {
|
|
@@ -309,7 +316,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
309
316
|
__self: _this,
|
|
310
317
|
__source: {
|
|
311
318
|
fileName: _jsxFileName,
|
|
312
|
-
lineNumber:
|
|
319
|
+
lineNumber: 268,
|
|
313
320
|
columnNumber: 15
|
|
314
321
|
}
|
|
315
322
|
}, title), text && _react["default"].createElement(_reactNative.Text, {
|
|
@@ -320,7 +327,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
320
327
|
__self: _this,
|
|
321
328
|
__source: {
|
|
322
329
|
fileName: _jsxFileName,
|
|
323
|
-
lineNumber:
|
|
330
|
+
lineNumber: 276,
|
|
324
331
|
columnNumber: 15
|
|
325
332
|
}
|
|
326
333
|
}, text))));
|
|
@@ -331,6 +338,9 @@ var MemoizedCard = _react["default"].memo(CardWithContext, function () {
|
|
|
331
338
|
});
|
|
332
339
|
|
|
333
340
|
var Card = function Card(props) {
|
|
341
|
+
var _useChatContext = (0, _ChatContext.useChatContext)(),
|
|
342
|
+
ImageComponent = _useChatContext.ImageComponent;
|
|
343
|
+
|
|
334
344
|
var _useMessageContext = (0, _MessageContext.useMessageContext)(),
|
|
335
345
|
message = _useMessageContext.message,
|
|
336
346
|
onLongPress = _useMessageContext.onLongPress,
|
|
@@ -351,6 +361,7 @@ var Card = function Card(props) {
|
|
|
351
361
|
CardFooter: CardFooter,
|
|
352
362
|
CardHeader: CardHeader,
|
|
353
363
|
channelId: message.cid,
|
|
364
|
+
ImageComponent: ImageComponent,
|
|
354
365
|
messageId: message.id,
|
|
355
366
|
onLongPress: onLongPress,
|
|
356
367
|
onPress: onPress,
|
|
@@ -360,7 +371,7 @@ var Card = function Card(props) {
|
|
|
360
371
|
__self: _this,
|
|
361
372
|
__source: {
|
|
362
373
|
fileName: _jsxFileName,
|
|
363
|
-
lineNumber:
|
|
374
|
+
lineNumber: 319,
|
|
364
375
|
columnNumber: 5
|
|
365
376
|
}
|
|
366
377
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Card.tsx"],"names":["styles","StyleSheet","create","authorName","fontSize","fontWeight","authorNameContainer","borderTopRightRadius","paddingHorizontal","paddingTop","authorNameFooter","padding","authorNameMask","bottom","left","position","cardCover","alignItems","borderRadius","height","justifyContent","marginHorizontal","cardFooter","flexDirection","container","overflow","width","description","playButtonStyle","elevation","title","CardWithContext","props","additionalTouchableProps","author_name","CardCover","CardFooter","CardHeader","image_url","og_scrape_url","onLongPress","onPress","onPressIn","preventPress","stylesProp","text","thumb_url","type","theme","colors","accent_blue","black","blue_alice","transparent","white","messageSimple","card","authorNameFooterContainer","cover","footer","titleStyle","footerStyle","noURI","roundedView","playIcon","uri","defaultOnPress","isVideoCard","event","additionalInfo","url","emitter","defaultHandler","backgroundColor","color","borderLeftColor","MemoizedCard","React","memo","Card","message","id","updated_at","channelId","cid","messageId","displayName"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAcA;;AAEA;;AAIA;;AAIA;;AACA;;AAE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ACO,WAAL,GAAmB,2BAAnB","sourcesContent":["import React from 'react';\nimport {\n ImageBackground,\n ImageStyle,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { openUrlSafely } from './utils/openUrlSafely';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Play } from '../../icons/Play';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { makeImageCompatibleUrl } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n authorName: { fontSize: 14.5, fontWeight: '600' },\n authorNameContainer: {\n borderTopRightRadius: 15,\n paddingHorizontal: 8,\n paddingTop: 8,\n },\n authorNameFooter: {\n fontSize: 14.5,\n fontWeight: '600',\n padding: 8,\n },\n authorNameMask: {\n bottom: 0,\n left: 2,\n position: 'absolute',\n },\n cardCover: {\n alignItems: 'center',\n borderRadius: 8,\n height: 140,\n justifyContent: 'center',\n marginHorizontal: 2,\n },\n cardFooter: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n container: {\n overflow: 'hidden',\n width: 256,\n },\n description: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n playButtonStyle: {\n alignItems: 'center',\n borderRadius: 50,\n elevation: 2,\n height: 36,\n justifyContent: 'center',\n width: 36,\n },\n title: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n});\n\nexport type CardPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Pick<\n MessageContextValue<StreamChatGenerics>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'\n > &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n > & {\n channelId: string | undefined;\n messageId: string | undefined;\n styles?: Partial<{\n authorName: StyleProp<TextStyle>;\n authorNameContainer: StyleProp<ViewStyle>;\n authorNameFooter: StyleProp<TextStyle>;\n authorNameFooterContainer: StyleProp<ViewStyle>;\n authorNameMask: StyleProp<ViewStyle>;\n cardCover: StyleProp<ImageStyle>;\n cardFooter: StyleProp<ViewStyle>;\n container: StyleProp<ViewStyle>;\n description: StyleProp<TextStyle>;\n title: StyleProp<TextStyle>;\n }>;\n };\n\nconst CardWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n additionalTouchableProps,\n author_name,\n CardCover,\n CardFooter,\n CardHeader,\n image_url,\n og_scrape_url,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n styles: stylesProp = {},\n text,\n thumb_url,\n title,\n type,\n } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, blue_alice, transparent, white },\n messageSimple: {\n card: {\n authorName,\n authorNameContainer,\n authorNameFooter,\n authorNameFooterContainer,\n authorNameMask,\n container,\n cover,\n footer: { description, title: titleStyle, ...footerStyle },\n noURI,\n playButtonStyle: { roundedView },\n playIcon: { height, width },\n },\n },\n },\n } = useTheme();\n\n const uri = image_url || thumb_url;\n\n const defaultOnPress = () => openUrlSafely(og_scrape_url || uri);\n\n const isVideoCard = type === 'video' && og_scrape_url;\n\n return (\n <TouchableOpacity\n disabled={preventPress}\n onLongPress={(event) => {\n if (onLongPress) {\n onLongPress({\n additionalInfo: { url: og_scrape_url },\n emitter: 'card',\n event,\n });\n }\n }}\n onPress={(event) => {\n if (onPress) {\n onPress({\n additionalInfo: { url: og_scrape_url },\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n onPressIn={(event) => {\n if (onPressIn) {\n onPressIn({\n additionalInfo: { url: og_scrape_url },\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n style={[styles.container, container, stylesProp.container]}\n testID='card-attachment'\n {...additionalTouchableProps}\n >\n {CardHeader && <CardHeader {...props} />}\n {CardCover && <CardCover {...props} />}\n {uri && !CardCover && (\n <View>\n <ImageBackground\n imageStyle={styles.cardCover}\n resizeMode='cover'\n source={{ uri: makeImageCompatibleUrl(uri) }}\n style={[styles.cardCover, cover, stylesProp.cardCover]}\n >\n {isVideoCard ? (\n <View style={[styles.playButtonStyle, roundedView, { backgroundColor: white }]}>\n <Play height={height} pathFill={black} width={width} />\n </View>\n ) : null}\n </ImageBackground>\n {author_name && (\n <View style={[styles.authorNameMask, authorNameMask, stylesProp.authorNameMask]}>\n <View\n style={[\n styles.authorNameContainer,\n { backgroundColor: blue_alice },\n authorNameContainer,\n stylesProp.authorNameContainer,\n ]}\n >\n <Text\n style={[\n styles.authorName,\n { color: accent_blue },\n authorName,\n stylesProp.authorName,\n ]}\n >\n {author_name}\n </Text>\n </View>\n </View>\n )}\n </View>\n )}\n {CardFooter ? (\n <CardFooter {...props} />\n ) : (\n <View style={[styles.cardFooter, footerStyle, stylesProp.cardFooter]}>\n <View\n style={[\n authorNameFooterContainer,\n { backgroundColor: transparent },\n !uri ? { borderLeftColor: accent_blue, ...noURI } : {},\n stylesProp.authorNameFooterContainer,\n ]}\n >\n {!uri && author_name && (\n <Text\n style={[\n styles.authorNameFooter,\n { color: accent_blue },\n authorNameFooter,\n stylesProp.authorNameFooter,\n ]}\n >\n {author_name}\n </Text>\n )}\n {title && (\n <Text\n numberOfLines={1}\n style={[styles.title, { color: black }, titleStyle, stylesProp.title]}\n >\n {title}\n </Text>\n )}\n {text && (\n <Text\n numberOfLines={3}\n style={[styles.description, { color: black }, description, stylesProp.description]}\n >\n {text}\n </Text>\n )}\n </View>\n </View>\n )}\n </TouchableOpacity>\n );\n};\n\nconst MemoizedCard = React.memo(CardWithContext, () => true) as typeof CardWithContext;\n\nexport type CardProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Partial<\n Pick<MessageContextValue<StreamChatGenerics>, 'onLongPress' | 'onPress' | 'onPressIn'> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n >\n >;\n\n/**\n * UI component for card in attachments.\n */\nexport const Card = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardProps<StreamChatGenerics>,\n) => {\n const { message, onLongPress, onPress, onPressIn, preventPress } =\n useMessageContext<StreamChatGenerics>();\n const { additionalTouchableProps, CardCover, CardFooter, CardHeader } =\n useMessagesContext<StreamChatGenerics>();\n\n return (\n <MemoizedCard\n key={`${message?.id}${message?.updated_at}`} // press listeners must change on message update, updating key ensures this\n {...{\n additionalTouchableProps,\n CardCover,\n CardFooter,\n CardHeader,\n channelId: message.cid,\n messageId: message.id,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n }}\n {...props}\n />\n );\n};\n\nCard.displayName = 'Card{messageSimple{card}}';\n"]}
|
|
1
|
+
{"version":3,"sources":["Card.tsx"],"names":["styles","StyleSheet","create","authorName","fontSize","fontWeight","authorNameContainer","borderTopRightRadius","paddingHorizontal","paddingTop","authorNameFooter","padding","authorNameMask","bottom","left","position","cardCover","alignItems","borderRadius","height","justifyContent","marginHorizontal","cardFooter","flexDirection","container","overflow","width","description","playButtonStyle","elevation","title","CardWithContext","props","additionalTouchableProps","author_name","CardCover","CardFooter","CardHeader","ImageComponent","Image","image_url","og_scrape_url","onLongPress","onPress","onPressIn","preventPress","stylesProp","text","thumb_url","type","theme","colors","accent_blue","black","blue_alice","transparent","white","messageSimple","card","authorNameFooterContainer","cover","footer","titleStyle","footerStyle","noURI","roundedView","playIcon","uri","defaultOnPress","isVideoCard","event","additionalInfo","url","emitter","defaultHandler","backgroundColor","color","borderLeftColor","MemoizedCard","React","memo","Card","message","id","updated_at","channelId","cid","mess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A,cAAc,EAAdA,cARJ;AASIiD,IAAAA,SAAS,EAAEL,OAAO,CAACC,EATvB;AAUIzC,IAAAA,WAAW,EAAXA,WAVJ;AAWIC,IAAAA,OAAO,EAAPA,OAXJ;AAYIC,IAAAA,SAAS,EAATA,SAZJ;AAaIC,IAAAA,YAAY,EAAZA;AAbJ,KAeMb,KAfN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAmBD,CA9BM;;;AAgCPiD,IAAI,CAACO,WAAL,GAAmB,2BAAnB","sourcesContent":["import React from 'react';\nimport {\n Image,\n ImageStyle,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { openUrlSafely } from './utils/openUrlSafely';\n\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Play } from '../../icons/Play';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { makeImageCompatibleUrl } from '../../utils/utils';\nimport { ImageBackground } from '../ImageBackground';\n\nconst styles = StyleSheet.create({\n authorName: { fontSize: 14.5, fontWeight: '600' },\n authorNameContainer: {\n borderTopRightRadius: 15,\n paddingHorizontal: 8,\n paddingTop: 8,\n },\n authorNameFooter: {\n fontSize: 14.5,\n fontWeight: '600',\n padding: 8,\n },\n authorNameMask: {\n bottom: 0,\n left: 2,\n position: 'absolute',\n },\n cardCover: {\n alignItems: 'center',\n borderRadius: 8,\n height: 140,\n justifyContent: 'center',\n marginHorizontal: 2,\n },\n cardFooter: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n container: {\n overflow: 'hidden',\n width: 256,\n },\n description: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n playButtonStyle: {\n alignItems: 'center',\n borderRadius: 50,\n elevation: 2,\n height: 36,\n justifyContent: 'center',\n width: 36,\n },\n title: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n});\n\nexport type CardPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Pick<ChatContextValue, 'ImageComponent'> &\n Pick<\n MessageContextValue<StreamChatGenerics>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'\n > &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n > & {\n channelId: string | undefined;\n messageId: string | undefined;\n styles?: Partial<{\n authorName: StyleProp<TextStyle>;\n authorNameContainer: StyleProp<ViewStyle>;\n authorNameFooter: StyleProp<TextStyle>;\n authorNameFooterContainer: StyleProp<ViewStyle>;\n authorNameMask: StyleProp<ViewStyle>;\n cardCover: StyleProp<ImageStyle>;\n cardFooter: StyleProp<ViewStyle>;\n container: StyleProp<ViewStyle>;\n description: StyleProp<TextStyle>;\n title: StyleProp<TextStyle>;\n }>;\n };\n\nconst CardWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n additionalTouchableProps,\n author_name,\n CardCover,\n CardFooter,\n CardHeader,\n ImageComponent = Image,\n image_url,\n og_scrape_url,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n styles: stylesProp = {},\n text,\n thumb_url,\n title,\n type,\n } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, blue_alice, transparent, white },\n messageSimple: {\n card: {\n authorName,\n authorNameContainer,\n authorNameFooter,\n authorNameFooterContainer,\n authorNameMask,\n container,\n cover,\n footer: { description, title: titleStyle, ...footerStyle },\n noURI,\n playButtonStyle: { roundedView },\n playIcon: { height, width },\n },\n },\n },\n } = useTheme();\n\n const uri = image_url || thumb_url;\n\n const defaultOnPress = () => openUrlSafely(og_scrape_url || uri);\n\n const isVideoCard = type === 'video' && og_scrape_url;\n\n return (\n <TouchableOpacity\n disabled={preventPress}\n onLongPress={(event) => {\n if (onLongPress) {\n onLongPress({\n additionalInfo: { url: og_scrape_url },\n emitter: 'card',\n event,\n });\n }\n }}\n onPress={(event) => {\n if (onPress) {\n onPress({\n additionalInfo: { url: og_scrape_url },\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n onPressIn={(event) => {\n if (onPressIn) {\n onPressIn({\n additionalInfo: { url: og_scrape_url },\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n style={[styles.container, container, stylesProp.container]}\n testID='card-attachment'\n {...additionalTouchableProps}\n >\n {CardHeader && <CardHeader {...props} />}\n {CardCover && <CardCover {...props} />}\n {uri && !CardCover && (\n <View>\n <ImageBackground\n ImageComponent={ImageComponent}\n imageStyle={styles.cardCover}\n resizeMode='cover'\n source={{ uri: makeImageCompatibleUrl(uri) }}\n style={[styles.cardCover, cover, stylesProp.cardCover]}\n >\n {isVideoCard ? (\n <View style={[styles.playButtonStyle, roundedView, { backgroundColor: white }]}>\n <Play height={height} pathFill={black} width={width} />\n </View>\n ) : null}\n </ImageBackground>\n {author_name && (\n <View style={[styles.authorNameMask, authorNameMask, stylesProp.authorNameMask]}>\n <View\n style={[\n styles.authorNameContainer,\n { backgroundColor: blue_alice },\n authorNameContainer,\n stylesProp.authorNameContainer,\n ]}\n >\n <Text\n style={[\n styles.authorName,\n { color: accent_blue },\n authorName,\n stylesProp.authorName,\n ]}\n >\n {author_name}\n </Text>\n </View>\n </View>\n )}\n </View>\n )}\n {CardFooter ? (\n <CardFooter {...props} />\n ) : (\n <View style={[styles.cardFooter, footerStyle, stylesProp.cardFooter]}>\n <View\n style={[\n authorNameFooterContainer,\n { backgroundColor: transparent },\n !uri ? { borderLeftColor: accent_blue, ...noURI } : {},\n stylesProp.authorNameFooterContainer,\n ]}\n >\n {!uri && author_name && (\n <Text\n style={[\n styles.authorNameFooter,\n { color: accent_blue },\n authorNameFooter,\n stylesProp.authorNameFooter,\n ]}\n >\n {author_name}\n </Text>\n )}\n {title && (\n <Text\n numberOfLines={1}\n style={[styles.title, { color: black }, titleStyle, stylesProp.title]}\n >\n {title}\n </Text>\n )}\n {text && (\n <Text\n numberOfLines={3}\n style={[styles.description, { color: black }, description, stylesProp.description]}\n >\n {text}\n </Text>\n )}\n </View>\n </View>\n )}\n </TouchableOpacity>\n );\n};\n\nconst MemoizedCard = React.memo(CardWithContext, () => true) as typeof CardWithContext;\n\nexport type CardProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Partial<\n Pick<ChatContextValue<StreamChatGenerics>, 'ImageComponent'> &\n Pick<MessageContextValue<StreamChatGenerics>, 'onLongPress' | 'onPress' | 'onPressIn'> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n >\n >;\n\n/**\n * UI component for card in attachments.\n */\nexport const Card = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardProps<StreamChatGenerics>,\n) => {\n const { ImageComponent } = useChatContext<StreamChatGenerics>();\n const { message, onLongPress, onPress, onPressIn, preventPress } =\n useMessageContext<StreamChatGenerics>();\n const { additionalTouchableProps, CardCover, CardFooter, CardHeader } =\n useMessagesContext<StreamChatGenerics>();\n\n return (\n <MemoizedCard\n key={`${message?.id}${message?.updated_at}`} // press listeners must change on message update, updating key ensures this\n {...{\n additionalTouchableProps,\n CardCover,\n CardFooter,\n CardHeader,\n channelId: message.cid,\n ImageComponent,\n messageId: message.id,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n }}\n {...props}\n />\n );\n};\n\nCard.displayName = 'Card{messageSimple{card}}';\n"]}
|