@sendbird/uikit-react-native 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
- package/lib/commonjs/components/ReactionAddons/MessageReactionAddon.js +6 -3
- package/lib/commonjs/components/ReactionAddons/MessageReactionAddon.js.map +1 -1
- package/lib/commonjs/components/ReactionAddons/ReactionRoundedButton.js +4 -3
- package/lib/commonjs/components/ReactionAddons/ReactionRoundedButton.js.map +1 -1
- package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +1 -3
- package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelSuggestedMentionList.js +3 -2
- package/lib/commonjs/domain/groupChannel/component/GroupChannelSuggestedMentionList.js.map +1 -1
- package/lib/commonjs/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.js +3 -2
- package/lib/commonjs/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.js.map +1 -1
- package/lib/commonjs/libs/EmojiManager.js +6 -0
- package/lib/commonjs/libs/EmojiManager.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/components/ChannelInput/index.js.map +1 -1
- package/lib/module/components/ReactionAddons/MessageReactionAddon.js +6 -3
- package/lib/module/components/ReactionAddons/MessageReactionAddon.js.map +1 -1
- package/lib/module/components/ReactionAddons/ReactionRoundedButton.js +4 -3
- package/lib/module/components/ReactionAddons/ReactionRoundedButton.js.map +1 -1
- package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +1 -3
- package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelSuggestedMentionList.js +3 -2
- package/lib/module/domain/groupChannel/component/GroupChannelSuggestedMentionList.js.map +1 -1
- package/lib/module/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.js +3 -2
- package/lib/module/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.js.map +1 -1
- package/lib/module/libs/EmojiManager.js +6 -0
- package/lib/module/libs/EmojiManager.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/components/ChannelInput/index.d.ts +4 -0
- package/lib/typescript/src/components/ReactionAddons/ReactionRoundedButton.d.ts +7 -3
- package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.d.ts +1 -1
- package/lib/typescript/src/libs/EmojiManager.d.ts +3 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +5 -5
- package/src/components/ChannelInput/index.tsx +4 -0
- package/src/components/ReactionAddons/MessageReactionAddon.tsx +7 -5
- package/src/components/ReactionAddons/ReactionRoundedButton.tsx +8 -4
- package/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.tsx +9 -3
- package/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.tsx +6 -3
- package/src/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.tsx +6 -3
- package/src/libs/EmojiManager.ts +11 -3
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_uikitReactNativeFoundation","require","_InternalLocalCacheStorage","_interopRequireDefault","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MemoryStorage","constructor","getAllKeys","keys","_data","getItem","key","removeItem","setItem","EmojiManager","internalStorage","InternalLocalCacheStorage","container","get","emojiStorage","strItem","freeze","JSON","parse","set","stringify","emojiContainer","category","emojiCategories","_emojiCategoryMap","id","emoji","emojis","_allEmojiMap","_allEmoji","values","emojiCategoryMap","allEmojiMap","allEmoji","getEmojiIconSource","url","uri","Icon","Assets","question","emojiHash","_this$emojiStorage$co","_default","exports"],"sources":["EmojiManager.ts"],"sourcesContent":["import { ImageProps } from 'react-native';\n\nimport { Icon } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdEmoji, SendbirdEmojiCategory, SendbirdEmojiContainer } from '@sendbird/uikit-utils';\n\nimport type { AsyncLocalCacheStorage } from '../types';\nimport InternalLocalCacheStorage from './InternalLocalCacheStorage';\n\nclass MemoryStorage implements AsyncLocalCacheStorage {\n _data: Record<string, string> = {};\n\n async getAllKeys(): Promise<readonly string[] | string[]> {\n return Object.keys(this._data);\n }\n\n async getItem(key: string): Promise<string | null> {\n return this._data[key];\n }\n\n async removeItem(key: string): Promise<void> {\n delete this._data[key];\n }\n\n async setItem(key: string, value: string): Promise<void> {\n this._data[key] = value;\n }\n}\ntype EmojiCategoryId = string;\ntype EmojiKey = string;\nclass EmojiManager {\n static key = 'sendbird-uikit@emoji-manager';\n\n constructor(\n private internalStorage: InternalLocalCacheStorage = new InternalLocalCacheStorage(new MemoryStorage()),\n ) {}\n\n private emojiStorage = {\n container: null as null | SendbirdEmojiContainer,\n get: async () => {\n if (!this.emojiStorage.container) {\n const strItem = await this.internalStorage.getItem(EmojiManager.key);\n if (strItem) this.emojiStorage.container = Object.freeze(JSON.parse(strItem));\n }\n return this.emojiStorage.container;\n },\n set: async (container: SendbirdEmojiContainer) => {\n this.emojiStorage.container = Object.freeze(container);\n await this.internalStorage.setItem(EmojiManager.key, JSON.stringify(container));\n },\n };\n\n private _emojiCategoryMap: Record<EmojiCategoryId, SendbirdEmojiCategory> = {};\n public get emojiCategoryMap() {\n return this._emojiCategoryMap;\n }\n\n private _allEmojiMap: Record<EmojiKey, SendbirdEmoji> = {};\n public get allEmojiMap() {\n return this._allEmojiMap;\n }\n\n private _allEmoji: SendbirdEmoji[] = [];\n public get allEmoji() {\n return this._allEmoji;\n }\n\n public getEmojiIconSource(emoji?: SendbirdEmoji | null | undefined): ImageProps['source'] {\n return emoji?.url ? { uri: emoji.url } : Icon.Assets.question;\n }\n\n public init = async (emojiContainer?: SendbirdEmojiContainer) => {\n if (emojiContainer) await this.emojiStorage.set(emojiContainer);\n\n const container = await this.emojiStorage.get();\n\n if (container) {\n for (const category of container.emojiCategories) {\n this._emojiCategoryMap[category.id] = category;\n for (const emoji of category.emojis) {\n this._allEmojiMap[emoji.key] = emoji;\n }\n }\n this._allEmoji = Object.values(this._allEmojiMap);\n }\n };\n\n public get emojiHash() {\n return this.emojiStorage.container?.emojiHash;\n }\n}\n\nexport default EmojiManager;\n"],"mappings":";;;;;;AAEA,IAAAA,2BAAA,GAAAC,OAAA;AAIA,IAAAC,0BAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAoE,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA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,EAAEV,KAAK,CAACS;IAAI,CAAC,GAAGE,gCAAI,CAACC,MAAM,CAACC,QAAQ;EAC/D;EAkBA,IAAWC,SAASA,CAAA,EAAG;IAAA,IAAAC,qBAAA;IACrB,QAAAA,qBAAA,GAAO,IAAI,CAAC3B,YAAY,CAACF,SAAS,cAAA6B,qBAAA,uBAA3BA,qBAAA,CAA6BD,SAAS;EAC/C;AACF;AAAC1D,eAAA,CA5DK2B,YAAY,SACH,8BAA8B;AAAA,IAAAiC,QAAA,GAAAC,OAAA,CAAA9D,OAAA,GA6D9B4B,YAAY","ignoreList":[]}
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VERSION","_default","exports","default"],"sources":["version.ts"],"sourcesContent":["const VERSION = '3.8.
|
|
1
|
+
{"version":3,"names":["VERSION","_default","exports","default"],"sources":["version.ts"],"sourcesContent":["const VERSION = '3.8.1';\nexport default VERSION;\n"],"mappings":";;;;;;AAAA,MAAMA,OAAO,GAAG,OAAO;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACTH,OAAO","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useMemo","useState","KeyboardAvoidingView","Platform","StyleSheet","View","createStyleSheet","useUIKitTheme","Logger","replace","useIIFE","useSafeAreaPadding","useSendbirdChat","useMentionTextInput","AttachmentsButton","EditInput","MessageToReplyPreview","SendInput","VoiceMessageInput","AUTO_FOCUS","select","ios","android","default","KEYBOARD_AVOID_VIEW_BEHAVIOR","undefined","ChannelInput","props","channel","keyboardAvoidOffset","messageToEdit","setMessageToEdit","safeArea","colors","typography","sbOptions","mentionManager","selection","onSelectionChange","textInputRef","text","onChangeText","mentionedUsers","inputMode","isFileMessage","mentionAvailable","uikit","groupChannel","enableMention","isGroupChannel","isBroadcast","inputKeyToRemount","inputHeight","setInputHeight","styles","inputDefault","height","fontStyle","body3","fontSize","lineHeight","textAlignVertical","textInputStyle","flatten","input","style","useTypingTrigger","useTextClearOnDisabled","inputDisabled","useAutoFocusOnEditMode","onPressToMention","user","searchStringRange","mentionedMessageText","asMentionedMessageText","range","start","end","length","shouldRenderInput","createElement","SafeAreaBottom","paddingBottom","Fragment","keyboardVerticalOffset","behavior","paddingStart","paddingEnd","backgroundColor","background","onLayout","e","nativeEvent","layout","inputContainer","_extends","key","ref","autoFocus","SuggestedMentionList","topInset","paddingTop","bottomInset","triggerTyping","action","endTyping","startTyping","catch","error","debug","setText","chatDisabled","isUserMessage","setTimeout","_textInputRef$current","current","focus","justifyContent","width","flex","marginEnd","borderRadius","minHeight","maxHeight","memo"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport { KeyboardAvoidingView, Platform, StyleProp, StyleSheet, TextInput, TextStyle, View } from 'react-native';\n\nimport { createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport {\n Logger,\n SendbirdBaseChannel,\n SendbirdBaseMessage,\n SendbirdFileMessage,\n SendbirdFileMessageCreateParams,\n SendbirdFileMessageUpdateParams,\n SendbirdMember,\n SendbirdUserMessage,\n SendbirdUserMessageCreateParams,\n SendbirdUserMessageUpdateParams,\n replace,\n useIIFE,\n useSafeAreaPadding,\n} from '@sendbird/uikit-utils';\n\nimport { useSendbirdChat } from '../../hooks/useContext';\nimport useMentionTextInput from '../../hooks/useMentionTextInput';\nimport type { CommonComponent, MentionedUser, Range } from '../../types';\nimport type { AttachmentsButtonProps } from './AttachmentsButton';\nimport AttachmentsButton from './AttachmentsButton';\nimport EditInput from './EditInput';\nimport type { MessageToReplyPreviewProps } from './MessageToReplyPreview';\nimport { MessageToReplyPreview } from './MessageToReplyPreview';\nimport SendInput from './SendInput';\nimport VoiceMessageInput, { VoiceMessageInputProps } from './VoiceMessageInput';\n\nexport type SuggestedMentionListProps = {\n text: string;\n selection: Range;\n topInset: number;\n bottomInset: number;\n inputHeight: number;\n onPressToMention: (user: SendbirdMember, searchStringRange: Range) => void;\n mentionedUsers: MentionedUser[];\n};\n\nexport type ChannelInputProps = {\n // style\n style?: StyleProp<TextStyle>;\n\n // default\n channel: SendbirdBaseChannel;\n shouldRenderInput: boolean;\n keyboardAvoidOffset: number;\n\n // default actions\n onPressSendUserMessage: (params: SendbirdUserMessageCreateParams) => Promise<void>;\n onPressSendFileMessage: (params: SendbirdFileMessageCreateParams) => Promise<void>;\n onPressUpdateUserMessage: (message: SendbirdUserMessage, params: SendbirdUserMessageUpdateParams) => Promise<void>;\n onPressUpdateFileMessage: (message: SendbirdFileMessage, params: SendbirdFileMessageUpdateParams) => Promise<void>;\n\n // input status\n inputFrozen: boolean;\n inputMuted: boolean;\n inputDisabled: boolean;\n\n // edit\n messageToEdit: undefined | SendbirdUserMessage | SendbirdFileMessage;\n setMessageToEdit: (message?: undefined | SendbirdUserMessage | SendbirdFileMessage) => void;\n\n // reply - only available on group channel\n messageToReply?: undefined | SendbirdUserMessage | SendbirdFileMessage;\n setMessageToReply?: (message?: undefined | SendbirdUserMessage | SendbirdFileMessage) => void;\n messageForThread?: undefined | SendbirdUserMessage | SendbirdFileMessage;\n\n // mention\n SuggestedMentionList?: CommonComponent<SuggestedMentionListProps>;\n\n // sub-components\n AttachmentsButton?: (props: AttachmentsButtonProps) => React.ReactNode | null;\n MessageToReplyPreview?: (props: MessageToReplyPreviewProps) => React.ReactNode | null;\n VoiceMessageInput?: (props: VoiceMessageInputProps) => React.ReactNode | null;\n};\n\nconst AUTO_FOCUS = Platform.select({ ios: false, android: true, default: false });\nconst KEYBOARD_AVOID_VIEW_BEHAVIOR = Platform.select({ ios: 'padding' as const, default: undefined });\n\n// FIXME(iOS): Dynamic style does not work properly when typing the CJK. (https://github.com/facebook/react-native/issues/26107)\n// To workaround temporarily, change the key for re-mount the component.\n// -> This will affect to keyboard blur when add/remove first mentioned user.\n// const GET_INPUT_KEY = (shouldReset: boolean) => {\n// return Platform.OS === 'ios' && shouldReset ? 'uikit-input-clear' : 'uikit-input';\n// };\n\n// TODO: Refactor 'Edit' mode to clearly\nconst ChannelInput = (props: ChannelInputProps) => {\n const { channel, keyboardAvoidOffset, messageToEdit, setMessageToEdit } = props;\n\n const safeArea = useSafeAreaPadding(['top', 'left', 'right', 'bottom']);\n const { colors, typography } = useUIKitTheme();\n const { sbOptions, mentionManager } = useSendbirdChat();\n\n const { selection, onSelectionChange, textInputRef, text, onChangeText, mentionedUsers } = useMentionTextInput({\n messageToEdit,\n });\n const inputMode = useIIFE(() => {\n if (messageToEdit && !messageToEdit.isFileMessage()) return 'edit';\n else return 'send';\n });\n\n const mentionAvailable =\n sbOptions.uikit.groupChannel.channel.enableMention && channel.isGroupChannel() && !channel.isBroadcast;\n const inputKeyToRemount = 'input'; //GET_INPUT_KEY(mentionAvailable ? mentionedUsers.length === 0 : false);\n\n const [inputHeight, setInputHeight] = useState(styles.inputDefault.height);\n\n const fontStyle = useMemo(() => {\n if (!typography.body3.fontSize) return typography.body3;\n // NOTE: iOS does not support textAlignVertical, so we should adjust lineHeight to center the text in multiline TextInput.\n return { ...typography.body3, lineHeight: typography.body3.fontSize * 1.275, textAlignVertical: 'center' };\n }, [typography.body3.fontSize]);\n\n const textInputStyle = StyleSheet.flatten([styles.input, fontStyle, props.style]);\n\n useTypingTrigger(text, channel);\n useTextClearOnDisabled(onChangeText, props.inputDisabled);\n useAutoFocusOnEditMode(textInputRef, messageToEdit);\n\n const onPressToMention = (user: SendbirdMember, searchStringRange: Range) => {\n const mentionedMessageText = mentionManager.asMentionedMessageText(user, true);\n const range = { start: searchStringRange.start, end: searchStringRange.start + mentionedMessageText.length - 1 };\n\n onChangeText(replace(text, searchStringRange.start, searchStringRange.end, mentionedMessageText), { user, range });\n };\n\n if (!props.shouldRenderInput) {\n return <SafeAreaBottom height={safeArea.paddingBottom} />;\n }\n\n return (\n <>\n <KeyboardAvoidingView\n keyboardVerticalOffset={-safeArea.paddingBottom + keyboardAvoidOffset}\n behavior={KEYBOARD_AVOID_VIEW_BEHAVIOR}\n >\n <View\n style={{\n paddingStart: safeArea.paddingStart,\n paddingEnd: safeArea.paddingEnd,\n backgroundColor: colors.background,\n }}\n >\n <View onLayout={(e) => setInputHeight(e.nativeEvent.layout.height)} style={styles.inputContainer}>\n {inputMode === 'send' && (\n <SendInput\n {...props}\n key={inputKeyToRemount}\n ref={textInputRef as never}\n text={text}\n onChangeText={onChangeText}\n onSelectionChange={onSelectionChange}\n mentionedUsers={mentionedUsers}\n VoiceMessageInput={props.VoiceMessageInput ?? VoiceMessageInput}\n AttachmentsButton={props.AttachmentsButton ?? AttachmentsButton}\n MessageToReplyPreview={props.MessageToReplyPreview ?? MessageToReplyPreview}\n style={textInputStyle}\n />\n )}\n {inputMode === 'edit' && messageToEdit && (\n <EditInput\n {...props}\n key={inputKeyToRemount}\n ref={textInputRef as never}\n text={text}\n onChangeText={onChangeText}\n autoFocus={AUTO_FOCUS}\n onSelectionChange={onSelectionChange}\n mentionedUsers={mentionedUsers}\n messageToEdit={messageToEdit}\n setMessageToEdit={setMessageToEdit}\n style={textInputStyle}\n />\n )}\n </View>\n <SafeAreaBottom height={safeArea.paddingBottom} />\n </View>\n </KeyboardAvoidingView>\n {mentionAvailable && props.SuggestedMentionList && (\n <props.SuggestedMentionList\n text={text}\n selection={selection}\n inputHeight={inputHeight}\n topInset={safeArea.paddingTop}\n bottomInset={safeArea.paddingBottom}\n onPressToMention={onPressToMention}\n mentionedUsers={mentionedUsers}\n />\n )}\n </>\n );\n};\n\nconst useTypingTrigger = (text: string, channel: SendbirdBaseChannel) => {\n useEffect(\n () => {\n function triggerTyping() {\n if (channel.isGroupChannel()) {\n const action = () => (text.length === 0 ? channel.endTyping() : channel.startTyping());\n action().catch((error) => {\n Logger.debug('ChannelInput: Failed to trigger typing', error);\n });\n }\n }\n\n triggerTyping();\n },\n channel.isGroupChannel() ? [text] : [],\n );\n};\n\nconst useTextClearOnDisabled = (setText: (val: string) => void, chatDisabled: boolean) => {\n useEffect(() => {\n if (chatDisabled) setText('');\n }, [chatDisabled]);\n};\n\nconst useAutoFocusOnEditMode = (\n textInputRef: React.MutableRefObject<TextInput | undefined>,\n messageToEdit?: SendbirdBaseMessage,\n) => {\n useEffect(() => {\n if (messageToEdit?.isUserMessage()) {\n if (!AUTO_FOCUS) setTimeout(() => textInputRef.current?.focus(), 500);\n }\n }, [messageToEdit]);\n};\n\nconst SafeAreaBottom = ({ height }: { height: number }) => {\n return <View style={{ height }} />;\n};\n\nconst styles = createStyleSheet({\n inputContainer: {\n justifyContent: 'center',\n width: '100%',\n },\n inputDefault: {\n height: 56,\n },\n input: {\n flex: 1,\n marginEnd: 4,\n borderRadius: 20,\n paddingTop: 8,\n paddingBottom: 8,\n minHeight: 36,\n // Android - padding area is hidden\n // iOS - padding area is visible\n maxHeight: Platform.select({ ios: 36 * 2 + 16, android: 36 * 2 }),\n },\n});\n\nexport default React.memo(ChannelInput);\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,SAASC,oBAAoB,EAAEC,QAAQ,EAAaC,UAAU,EAAwBC,IAAI,QAAQ,cAAc;AAEhH,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,yCAAyC;AACzF,SACEC,MAAM,EAUNC,OAAO,EACPC,OAAO,EACPC,kBAAkB,QACb,uBAAuB;AAE9B,SAASC,eAAe,QAAQ,wBAAwB;AACxD,OAAOC,mBAAmB,MAAM,iCAAiC;AAGjE,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,SAAS,MAAM,aAAa;AAEnC,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,iBAAiB,MAAkC,qBAAqB;AAkD/E,MAAMC,UAAU,GAAGhB,QAAQ,CAACiB,MAAM,CAAC;EAAEC,GAAG,EAAE,KAAK;EAAEC,OAAO,EAAE,IAAI;EAAEC,OAAO,EAAE;AAAM,CAAC,CAAC;AACjF,M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IACb;IACA;IACAC,SAAS,EAAExH,QAAQ,CAACiB,MAAM,CAAC;MAAEC,GAAG,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE;MAAEC,OAAO,EAAE,EAAE,GAAG;IAAE,CAAC;EAClE;AACF,CAAC,CAAC;AAEF,4BAAexB,KAAK,CAAC8H,IAAI,CAAClG,YAAY,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","useState","KeyboardAvoidingView","Platform","StyleSheet","View","createStyleSheet","useUIKitTheme","Logger","replace","useIIFE","useSafeAreaPadding","useSendbirdChat","useMentionTextInput","AttachmentsButton","EditInput","MessageToReplyPreview","SendInput","VoiceMessageInput","AUTO_FOCUS","select","ios","android","default","KEYBOARD_AVOID_VIEW_BEHAVIOR","undefined","ChannelInput","props","channel","keyboardAvoidOffset","messageToEdit","setMessageToEdit","safeArea","colors","typography","sbOptions","mentionManager","selection","onSelectionChange","textInputRef","text","onChangeText","mentionedUsers","inputMode","isFileMessage","mentionAvailable","uikit","groupChannel","enableMention","isGroupChannel","isBroadcast","inputKeyToRemount","inputHeight","setInputHeight","styles","inputDefault","height","fontStyle","body3","fontSize","lineHeight","textAlignVertical","textInputStyle","flatten","input","style","useTypingTrigger","useTextClearOnDisabled","inputDisabled","useAutoFocusOnEditMode","onPressToMention","user","searchStringRange","mentionedMessageText","asMentionedMessageText","range","start","end","length","shouldRenderInput","createElement","SafeAreaBottom","paddingBottom","Fragment","keyboardVerticalOffset","behavior","paddingStart","paddingEnd","backgroundColor","background","onLayout","e","nativeEvent","layout","inputContainer","_extends","key","ref","autoFocus","SuggestedMentionList","topInset","paddingTop","bottomInset","triggerTyping","action","endTyping","startTyping","catch","error","debug","setText","chatDisabled","isUserMessage","setTimeout","_textInputRef$current","current","focus","justifyContent","width","flex","marginEnd","borderRadius","minHeight","maxHeight","memo"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport { KeyboardAvoidingView, Platform, StyleProp, StyleSheet, TextInput, TextStyle, View } from 'react-native';\n\nimport { createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport {\n Logger,\n SendbirdBaseChannel,\n SendbirdBaseMessage,\n SendbirdFileMessage,\n SendbirdFileMessageCreateParams,\n SendbirdFileMessageUpdateParams,\n SendbirdMember,\n SendbirdUserMessage,\n SendbirdUserMessageCreateParams,\n SendbirdUserMessageUpdateParams,\n replace,\n useIIFE,\n useSafeAreaPadding,\n} from '@sendbird/uikit-utils';\n\nimport { useSendbirdChat } from '../../hooks/useContext';\nimport useMentionTextInput from '../../hooks/useMentionTextInput';\nimport type { CommonComponent, MentionedUser, Range } from '../../types';\nimport type { AttachmentsButtonProps } from './AttachmentsButton';\nimport AttachmentsButton from './AttachmentsButton';\nimport EditInput from './EditInput';\nimport type { MessageToReplyPreviewProps } from './MessageToReplyPreview';\nimport { MessageToReplyPreview } from './MessageToReplyPreview';\nimport SendInput from './SendInput';\nimport VoiceMessageInput, { VoiceMessageInputProps } from './VoiceMessageInput';\n\nexport type SuggestedMentionListProps = {\n text: string;\n selection: Range;\n topInset: number;\n bottomInset: number;\n inputHeight: number;\n onPressToMention: (user: SendbirdMember, searchStringRange: Range) => void;\n mentionedUsers: MentionedUser[];\n /**\n * Whether to show user id information on each item.\n * */\n showUserId?: boolean;\n};\n\nexport type ChannelInputProps = {\n // style\n style?: StyleProp<TextStyle>;\n\n // default\n channel: SendbirdBaseChannel;\n shouldRenderInput: boolean;\n keyboardAvoidOffset: number;\n\n // default actions\n onPressSendUserMessage: (params: SendbirdUserMessageCreateParams) => Promise<void>;\n onPressSendFileMessage: (params: SendbirdFileMessageCreateParams) => Promise<void>;\n onPressUpdateUserMessage: (message: SendbirdUserMessage, params: SendbirdUserMessageUpdateParams) => Promise<void>;\n onPressUpdateFileMessage: (message: SendbirdFileMessage, params: SendbirdFileMessageUpdateParams) => Promise<void>;\n\n // input status\n inputFrozen: boolean;\n inputMuted: boolean;\n inputDisabled: boolean;\n\n // edit\n messageToEdit: undefined | SendbirdUserMessage | SendbirdFileMessage;\n setMessageToEdit: (message?: undefined | SendbirdUserMessage | SendbirdFileMessage) => void;\n\n // reply - only available on group channel\n messageToReply?: undefined | SendbirdUserMessage | SendbirdFileMessage;\n setMessageToReply?: (message?: undefined | SendbirdUserMessage | SendbirdFileMessage) => void;\n messageForThread?: undefined | SendbirdUserMessage | SendbirdFileMessage;\n\n // mention\n SuggestedMentionList?: CommonComponent<SuggestedMentionListProps>;\n\n // sub-components\n AttachmentsButton?: (props: AttachmentsButtonProps) => React.ReactNode | null;\n MessageToReplyPreview?: (props: MessageToReplyPreviewProps) => React.ReactNode | null;\n VoiceMessageInput?: (props: VoiceMessageInputProps) => React.ReactNode | null;\n};\n\nconst AUTO_FOCUS = Platform.select({ ios: false, android: true, default: false });\nconst KEYBOARD_AVOID_VIEW_BEHAVIOR = Platform.select({ ios: 'padding' as const, default: undefined });\n\n// FIXME(iOS): Dynamic style does not work properly when typing the CJK. (https://github.com/facebook/react-native/issues/26107)\n// To workaround temporarily, change the key for re-mount the component.\n// -> This will affect to keyboard blur when add/remove first mentioned user.\n// const GET_INPUT_KEY = (shouldReset: boolean) => {\n// return Platform.OS === 'ios' && shouldReset ? 'uikit-input-clear' : 'uikit-input';\n// };\n\n// TODO: Refactor 'Edit' mode to clearly\nconst ChannelInput = (props: ChannelInputProps) => {\n const { channel, keyboardAvoidOffset, messageToEdit, setMessageToEdit } = props;\n\n const safeArea = useSafeAreaPadding(['top', 'left', 'right', 'bottom']);\n const { colors, typography } = useUIKitTheme();\n const { sbOptions, mentionManager } = useSendbirdChat();\n\n const { selection, onSelectionChange, textInputRef, text, onChangeText, mentionedUsers } = useMentionTextInput({\n messageToEdit,\n });\n const inputMode = useIIFE(() => {\n if (messageToEdit && !messageToEdit.isFileMessage()) return 'edit';\n else return 'send';\n });\n\n const mentionAvailable =\n sbOptions.uikit.groupChannel.channel.enableMention && channel.isGroupChannel() && !channel.isBroadcast;\n const inputKeyToRemount = 'input'; //GET_INPUT_KEY(mentionAvailable ? mentionedUsers.length === 0 : false);\n\n const [inputHeight, setInputHeight] = useState(styles.inputDefault.height);\n\n const fontStyle = useMemo(() => {\n if (!typography.body3.fontSize) return typography.body3;\n // NOTE: iOS does not support textAlignVertical, so we should adjust lineHeight to center the text in multiline TextInput.\n return { ...typography.body3, lineHeight: typography.body3.fontSize * 1.275, textAlignVertical: 'center' };\n }, [typography.body3.fontSize]);\n\n const textInputStyle = StyleSheet.flatten([styles.input, fontStyle, props.style]);\n\n useTypingTrigger(text, channel);\n useTextClearOnDisabled(onChangeText, props.inputDisabled);\n useAutoFocusOnEditMode(textInputRef, messageToEdit);\n\n const onPressToMention = (user: SendbirdMember, searchStringRange: Range) => {\n const mentionedMessageText = mentionManager.asMentionedMessageText(user, true);\n const range = { start: searchStringRange.start, end: searchStringRange.start + mentionedMessageText.length - 1 };\n\n onChangeText(replace(text, searchStringRange.start, searchStringRange.end, mentionedMessageText), { user, range });\n };\n\n if (!props.shouldRenderInput) {\n return <SafeAreaBottom height={safeArea.paddingBottom} />;\n }\n\n return (\n <>\n <KeyboardAvoidingView\n keyboardVerticalOffset={-safeArea.paddingBottom + keyboardAvoidOffset}\n behavior={KEYBOARD_AVOID_VIEW_BEHAVIOR}\n >\n <View\n style={{\n paddingStart: safeArea.paddingStart,\n paddingEnd: safeArea.paddingEnd,\n backgroundColor: colors.background,\n }}\n >\n <View onLayout={(e) => setInputHeight(e.nativeEvent.layout.height)} style={styles.inputContainer}>\n {inputMode === 'send' && (\n <SendInput\n {...props}\n key={inputKeyToRemount}\n ref={textInputRef as never}\n text={text}\n onChangeText={onChangeText}\n onSelectionChange={onSelectionChange}\n mentionedUsers={mentionedUsers}\n VoiceMessageInput={props.VoiceMessageInput ?? VoiceMessageInput}\n AttachmentsButton={props.AttachmentsButton ?? AttachmentsButton}\n MessageToReplyPreview={props.MessageToReplyPreview ?? MessageToReplyPreview}\n style={textInputStyle}\n />\n )}\n {inputMode === 'edit' && messageToEdit && (\n <EditInput\n {...props}\n key={inputKeyToRemount}\n ref={textInputRef as never}\n text={text}\n onChangeText={onChangeText}\n autoFocus={AUTO_FOCUS}\n onSelectionChange={onSelectionChange}\n mentionedUsers={mentionedUsers}\n messageToEdit={messageToEdit}\n setMessageToEdit={setMessageToEdit}\n style={textInputStyle}\n />\n )}\n </View>\n <SafeAreaBottom height={safeArea.paddingBottom} />\n </View>\n </KeyboardAvoidingView>\n {mentionAvailable && props.SuggestedMentionList && (\n <props.SuggestedMentionList\n text={text}\n selection={selection}\n inputHeight={inputHeight}\n topInset={safeArea.paddingTop}\n bottomInset={safeArea.paddingBottom}\n onPressToMention={onPressToMention}\n mentionedUsers={mentionedUsers}\n />\n )}\n </>\n );\n};\n\nconst useTypingTrigger = (text: string, channel: SendbirdBaseChannel) => {\n useEffect(\n () => {\n function triggerTyping() {\n if (channel.isGroupChannel()) {\n const action = () => (text.length === 0 ? channel.endTyping() : channel.startTyping());\n action().catch((error) => {\n Logger.debug('ChannelInput: Failed to trigger typing', error);\n });\n }\n }\n\n triggerTyping();\n },\n channel.isGroupChannel() ? [text] : [],\n );\n};\n\nconst useTextClearOnDisabled = (setText: (val: string) => void, chatDisabled: boolean) => {\n useEffect(() => {\n if (chatDisabled) setText('');\n }, [chatDisabled]);\n};\n\nconst useAutoFocusOnEditMode = (\n textInputRef: React.MutableRefObject<TextInput | undefined>,\n messageToEdit?: SendbirdBaseMessage,\n) => {\n useEffect(() => {\n if (messageToEdit?.isUserMessage()) {\n if (!AUTO_FOCUS) setTimeout(() => textInputRef.current?.focus(), 500);\n }\n }, [messageToEdit]);\n};\n\nconst SafeAreaBottom = ({ height }: { height: number }) => {\n return <View style={{ height }} />;\n};\n\nconst styles = createStyleSheet({\n inputContainer: {\n justifyContent: 'center',\n width: '100%',\n },\n inputDefault: {\n height: 56,\n },\n input: {\n flex: 1,\n marginEnd: 4,\n borderRadius: 20,\n paddingTop: 8,\n paddingBottom: 8,\n minHeight: 36,\n // Android - padding area is hidden\n // iOS - padding area is visible\n maxHeight: Platform.select({ ios: 36 * 2 + 16, android: 36 * 2 }),\n },\n});\n\nexport default React.memo(ChannelInput);\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,SAASC,oBAAoB,EAAEC,QAAQ,EAAaC,UAAU,EAAwBC,IAAI,QAAQ,cAAc;AAEhH,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,yCAAyC;AACzF,SACEC,MAAM,EAUNC,OAAO,EACPC,OAAO,EACPC,kBAAkB,QACb,uBAAuB;AAE9B,SAASC,eAAe,QAAQ,wBAAwB;AACxD,OAAOC,mBAAmB,MAAM,iCAAiC;AAGjE,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,SAAS,MAAM,aAAa;AAEnC,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,iBAAiB,MAAkC,qBAAqB;AAsD/E,MAAMC,UAAU,GAAGhB,QAAQ,CAACiB,MAAM,CAAC;EAAEC,GAAG,EAAE,KAAK;EAAEC,OAAO,EAAE,IAAI;EAAEC,OAAO,EAAE;AAAM,CAAC,CAAC;AACjF,MAAMC,4BAA4B,GAAGrB,QAAQ,CAACiB,MAAM,CAAC;EAAEC,GAAG,EAAE,SAAkB;EAAEE,OAAO,EAAEE;AAAU,CAAC,CAAC;;AAErG;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,YAAY,GAAIC,KAAwB,IAAK;EACjD,MAAM;IAAEC,OAAO;IAAEC,mBAAmB;IAAEC,aAAa;IAAEC;EAAiB,CAAC,GAAGJ,KAAK;EAE/E,MAAMK,QAAQ,GAAGrB,kBAAkB,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;EACvE,MAAM;IAAEsB,MAAM;IAAEC;EAAW,CAAC,GAAG3B,aAAa,CAA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C,CAAC,EAAE;MAClC,IAAI,CAAC7F,UAAU,EAAE8F,UAAU,CAAC;QAAA,IAAAC,qBAAA;QAAA,QAAAA,qBAAA,GAAM3E,YAAY,CAAC4E,OAAO,cAAAD,qBAAA,uBAApBA,qBAAA,CAAsBE,KAAK,CAAC,CAAC;MAAA,GAAE,GAAG,CAAC;IACvE;EACF,CAAC,EAAE,CAACtF,aAAa,CAAC,CAAC;AACrB,CAAC;AAED,MAAMmD,cAAc,GAAGA,CAAC;EAAEzB;AAA2B,CAAC,KAAK;EACzD,oBAAO1D,KAAA,CAAAkF,aAAA,CAAC3E,IAAI;IAAC4D,KAAK,EAAE;MAAET;IAAO;EAAE,CAAE,CAAC;AACpC,CAAC;AAED,MAAMF,MAAM,GAAGhD,gBAAgB,CAAC;EAC9BwF,cAAc,EAAE;IACduB,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT,CAAC;EACD/D,YAAY,EAAE;IACZC,MAAM,EAAE;EACV,CAAC;EACDQ,KAAK,EAAE;IACLuD,IAAI,EAAE,CAAC;IACPC,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE,EAAE;IAChBpB,UAAU,EAAE,CAAC;IACbnB,aAAa,EAAE,CAAC;IAChBwC,SAAS,EAAE,EAAE;IACb;IACA;IACAC,SAAS,EAAExH,QAAQ,CAACiB,MAAM,CAAC;MAAEC,GAAG,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE;MAAEC,OAAO,EAAE,EAAE,GAAG;IAAE,CAAC;EAClE;AACF,CAAC,CAAC;AAEF,4BAAexB,KAAK,CAAC8H,IAAI,CAAClG,YAAY,CAAC","ignoreList":[]}
|
|
@@ -17,7 +17,7 @@ const createOnPressReaction = (reaction, channel, message, reacted) => {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
const createReactionButtons = (channel, message,
|
|
20
|
+
const createReactionButtons = (channel, message, getIconSource, emojiLimit, onOpenReactionList, onOpenReactionUserList, reactionAddonType) => {
|
|
21
21
|
const reactions = message.reactions ?? [];
|
|
22
22
|
const buttons = reactions.map((reaction, index) => {
|
|
23
23
|
const isNotLastOfRow = index % NUM_COL !== NUM_COL - 1;
|
|
@@ -30,7 +30,7 @@ const createReactionButtons = (channel, message, getEmoji, emojiLimit, onOpenRea
|
|
|
30
30
|
}, ({
|
|
31
31
|
pressed
|
|
32
32
|
}) => /*#__PURE__*/React.createElement(ReactionRoundedButton, {
|
|
33
|
-
|
|
33
|
+
source: getIconSource(reaction.key),
|
|
34
34
|
count: getReactionCount(reaction),
|
|
35
35
|
reacted: pressed || reaction.hasCurrentUserReacted,
|
|
36
36
|
style: reactionAddonType === 'default' ? [isNotLastOfRow && styles.marginEnd, isNotLastOfCol && styles.marginBottom] : [styles.marginEnd, styles.marginBottom]
|
|
@@ -75,7 +75,10 @@ const MessageReactionAddon = ({
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
if (reactionAddonType === 'default' && !((_message$reactions = message.reactions) !== null && _message$reactions !== void 0 && _message$reactions.length)) return null;
|
|
78
|
-
const reactionButtons = createReactionButtons(channel, message,
|
|
78
|
+
const reactionButtons = createReactionButtons(channel, message, reactionKey => {
|
|
79
|
+
const emoji = emojiManager.allEmojiMap[reactionKey];
|
|
80
|
+
return emojiManager.getEmojiIconSource(emoji);
|
|
81
|
+
}, emojiManager.allEmoji.length, () => openReactionList({
|
|
79
82
|
channel,
|
|
80
83
|
message
|
|
81
84
|
}), focusIndex => openReactionUserList({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Pressable","createStyleSheet","useUIKitTheme","useForceUpdate","useGroupChannelHandler","getReactionCount","DEFAULT_LONG_PRESS_DELAY","useReaction","useSendbirdChat","ReactionRoundedButton","NUM_COL","REACTION_MORE_KEY","createOnPressReaction","reaction","channel","message","reacted","deleteReaction","key","addReaction","createReactionButtons","
|
|
1
|
+
{"version":3,"names":["React","Pressable","createStyleSheet","useUIKitTheme","useForceUpdate","useGroupChannelHandler","getReactionCount","DEFAULT_LONG_PRESS_DELAY","useReaction","useSendbirdChat","ReactionRoundedButton","NUM_COL","REACTION_MORE_KEY","createOnPressReaction","reaction","channel","message","reacted","deleteReaction","key","addReaction","createReactionButtons","getIconSource","emojiLimit","onOpenReactionList","onOpenReactionUserList","reactionAddonType","reactions","buttons","map","index","isNotLastOfRow","isNotLastOfCol","length","createElement","onPress","hasCurrentUserReacted","onLongPress","delayLongPress","pressed","source","count","style","styles","marginEnd","marginBottom","push","More","MessageReactionAddon","_message$reactions","colors","sdk","emojiManager","openReactionList","openReactionUserList","forceUpdate","onReactionUpdated","_","event","messageId","applyReactionEvent","reactionButtons","reactionKey","emoji","allEmojiMap","getEmojiIconSource","allEmoji","focusIndex","containerStyle","reactionContainer","reactionThreadParentMessageContainer","backgroundColor","background","borderColor","ui","rounded","enabled","alignItems","flexDirection","flexWrap","padding","borderRadius","borderWidth"],"sources":["MessageReactionAddon.tsx"],"sourcesContent":["import React from 'react';\nimport { ImageProps, Pressable } from 'react-native';\n\nimport { createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { useForceUpdate, useGroupChannelHandler } from '@sendbird/uikit-tools';\nimport type { SendbirdBaseChannel, SendbirdBaseMessage, SendbirdReaction } from '@sendbird/uikit-utils';\nimport { getReactionCount } from '@sendbird/uikit-utils';\n\nimport { DEFAULT_LONG_PRESS_DELAY } from '../../constants';\nimport { useReaction, useSendbirdChat } from '../../hooks/useContext';\nimport ReactionRoundedButton from './ReactionRoundedButton';\n\nconst NUM_COL = 4;\nconst REACTION_MORE_KEY = 'reaction-more-button';\nexport type ReactionAddonType = 'default' | 'thread_parent_message';\n\nconst createOnPressReaction = (\n reaction: SendbirdReaction,\n channel: SendbirdBaseChannel,\n message: SendbirdBaseMessage,\n reacted: boolean,\n) => {\n return () => {\n if (reacted) {\n return channel.deleteReaction(message, reaction.key);\n } else {\n return channel.addReaction(message, reaction.key);\n }\n };\n};\n\nconst createReactionButtons = (\n channel: SendbirdBaseChannel,\n message: SendbirdBaseMessage,\n getIconSource: (reactionKey: string) => ImageProps['source'],\n emojiLimit: number,\n onOpenReactionList: () => void,\n onOpenReactionUserList: (focusIndex: number) => void,\n reactionAddonType?: ReactionAddonType,\n) => {\n const reactions = message.reactions ?? [];\n const buttons = reactions.map((reaction, index) => {\n const isNotLastOfRow = index % NUM_COL !== NUM_COL - 1;\n const isNotLastOfCol = index < NUM_COL && reactions.length >= NUM_COL;\n return (\n <Pressable\n key={reaction.key}\n onPress={createOnPressReaction(reaction, channel, message, reaction.hasCurrentUserReacted)}\n onLongPress={() => onOpenReactionUserList(index)}\n delayLongPress={DEFAULT_LONG_PRESS_DELAY}\n >\n {({ pressed }) => (\n <ReactionRoundedButton\n source={getIconSource(reaction.key)}\n count={getReactionCount(reaction)}\n reacted={pressed || reaction.hasCurrentUserReacted}\n style={\n reactionAddonType === 'default'\n ? [isNotLastOfRow && styles.marginEnd, isNotLastOfCol && styles.marginBottom]\n : [styles.marginEnd, styles.marginBottom]\n }\n />\n )}\n </Pressable>\n );\n });\n if (buttons.length < emojiLimit) {\n buttons.push(\n <Pressable key={REACTION_MORE_KEY} onPress={onOpenReactionList}>\n {({ pressed }) => <ReactionRoundedButton.More pressed={pressed} />}\n </Pressable>,\n );\n }\n\n return buttons;\n};\n\nconst MessageReactionAddon = ({\n channel,\n message,\n reactionAddonType = 'default',\n}: {\n channel: SendbirdBaseChannel;\n message: SendbirdBaseMessage;\n reactionAddonType?: ReactionAddonType;\n}) => {\n const { colors } = useUIKitTheme();\n const { sdk, emojiManager } = useSendbirdChat();\n const { openReactionList, openReactionUserList } = useReaction();\n const forceUpdate = useForceUpdate();\n\n useGroupChannelHandler(sdk, {\n async onReactionUpdated(_, event) {\n if (event.messageId === message.messageId) {\n message.applyReactionEvent(event);\n forceUpdate();\n }\n },\n });\n\n if (reactionAddonType === 'default' && !message.reactions?.length) return null;\n\n const reactionButtons = createReactionButtons(\n channel,\n message,\n (reactionKey) => {\n const emoji = emojiManager.allEmojiMap[reactionKey];\n return emojiManager.getEmojiIconSource(emoji);\n },\n emojiManager.allEmoji.length,\n () => openReactionList({ channel, message }),\n (focusIndex) => openReactionUserList({ channel, message, focusIndex }),\n reactionAddonType,\n );\n\n const containerStyle =\n reactionAddonType === 'default' ? styles.reactionContainer : styles.reactionThreadParentMessageContainer;\n\n return (\n <Pressable\n style={[\n containerStyle,\n { backgroundColor: colors.background, borderColor: colors.ui.reaction.rounded.enabled.background },\n ]}\n >\n {reactionButtons}\n </Pressable>\n );\n};\n\nconst styles = createStyleSheet({\n reactionContainer: {\n alignItems: 'stretch',\n flexDirection: 'row',\n flexWrap: 'wrap',\n padding: 8,\n borderRadius: 16,\n borderWidth: 1,\n },\n reactionThreadParentMessageContainer: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n marginEnd: {\n marginEnd: 4.5,\n },\n marginBottom: {\n marginBottom: 4,\n },\n});\n\nexport default MessageReactionAddon;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAqBC,SAAS,QAAQ,cAAc;AAEpD,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,yCAAyC;AACzF,SAASC,cAAc,EAAEC,sBAAsB,QAAQ,uBAAuB;AAE9E,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,SAASC,wBAAwB,QAAQ,iBAAiB;AAC1D,SAASC,WAAW,EAAEC,eAAe,QAAQ,wBAAwB;AACrE,OAAOC,qBAAqB,MAAM,yBAAyB;AAE3D,MAAMC,OAAO,GAAG,CAAC;AACjB,MAAMC,iBAAiB,GAAG,sBAAsB;AAGhD,MAAMC,qBAAqB,GAAGA,CAC5BC,QAA0B,EAC1BC,OAA4B,EAC5BC,OAA4B,EAC5BC,OAAgB,KACb;EACH,OAAO,MAAM;IACX,IAAIA,OAAO,EAAE;MACX,OAAOF,OAAO,CAACG,cAAc,CAACF,OAAO,EAAEF,QAAQ,CAACK,GAAG,CAAC;IACtD,CAAC,MAAM;MACL,O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}
|
|
@@ -3,10 +3,11 @@ import { View } from 'react-native';
|
|
|
3
3
|
import { Icon, Image, Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
4
4
|
import { truncatedCount } from '@sendbird/uikit-utils';
|
|
5
5
|
const ReactionRoundedButton = ({
|
|
6
|
-
|
|
6
|
+
source,
|
|
7
7
|
count,
|
|
8
8
|
reacted,
|
|
9
|
-
style
|
|
9
|
+
style,
|
|
10
|
+
url
|
|
10
11
|
}) => {
|
|
11
12
|
const {
|
|
12
13
|
colors
|
|
@@ -17,7 +18,7 @@ const ReactionRoundedButton = ({
|
|
|
17
18
|
backgroundColor: reacted ? color.selected.background : color.enabled.background
|
|
18
19
|
}, style]
|
|
19
20
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
20
|
-
source: {
|
|
21
|
+
source: source ? source : {
|
|
21
22
|
uri: url
|
|
22
23
|
},
|
|
23
24
|
style: styles.emoji
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Icon","Image","Text","createStyleSheet","useUIKitTheme","truncatedCount","ReactionRoundedButton","
|
|
1
|
+
{"version":3,"names":["React","View","Icon","Image","Text","createStyleSheet","useUIKitTheme","truncatedCount","ReactionRoundedButton","source","count","reacted","style","url","colors","color","ui","reaction","rounded","createElement","styles","reactionContainer","backgroundColor","selected","background","enabled","uri","emoji","caption4","onBackground01","numberOfLines","More","pressed","icon","onBackground03","size","flexDirection","justifyContent","alignItems","width","borderRadius","paddingVertical","paddingHorizontal","height","marginEnd","textAlign"],"sources":["ReactionRoundedButton.tsx"],"sourcesContent":["import React from 'react';\nimport { ImageProps, StyleProp, View, ViewStyle } from 'react-native';\n\nimport { Icon, Image, Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { truncatedCount } from '@sendbird/uikit-utils';\n\ntype Props = {\n source: ImageProps['source'];\n count: number;\n reacted: boolean;\n style: StyleProp<ViewStyle>;\n /**\n * @deprecated Please use `source` instead\n * */\n url?: string;\n};\n\nconst ReactionRoundedButton = ({ source, count, reacted, style, url }: Props) => {\n const { colors } = useUIKitTheme();\n const color = colors.ui.reaction.rounded;\n\n return (\n <View\n style={[\n styles.reactionContainer,\n { backgroundColor: reacted ? color.selected.background : color.enabled.background },\n style,\n ]}\n >\n <Image source={source ? source : { uri: url }} style={styles.emoji} />\n <Text caption4 color={colors.onBackground01} numberOfLines={1} style={styles.count}>\n {truncatedCount(count, 99, '')}\n </Text>\n </View>\n );\n};\n\nReactionRoundedButton.More = ({ pressed }: { pressed: boolean }) => {\n const { colors } = useUIKitTheme();\n const color = colors.ui.reaction.rounded;\n\n return (\n <View\n style={[\n styles.reactionContainer,\n { backgroundColor: pressed ? color.selected.background : color.enabled.background },\n ]}\n >\n <Icon icon={'emoji-more'} color={colors.onBackground03} size={20} />\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n reactionContainer: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n width: 52,\n borderRadius: 24,\n paddingVertical: 5,\n paddingHorizontal: 8,\n },\n emoji: {\n width: 20,\n height: 20,\n marginEnd: 4,\n },\n count: {\n width: 13,\n textAlign: 'left',\n },\n});\n\nexport default ReactionRoundedButton;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAgCC,IAAI,QAAmB,cAAc;AAErE,SAASC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,aAAa,QAAQ,yCAAyC;AAC5G,SAASC,cAAc,QAAQ,uBAAuB;AAatD,MAAMC,qBAAqB,GAAGA,CAAC;EAAEC,MAAM;EAAEC,KAAK;EAAEC,OAAO;EAAEC,KAAK;EAAEC;AAAW,CAAC,KAAK;EAC/E,MAAM;IAAEC;EAAO,CAAC,GAAGR,aAAa,CAAC,CAAC;EAClC,MAAMS,KAAK,GAAGD,MAAM,CAACE,EAAE,CAACC,QAAQ,CAACC,OAAO;EAExC,oBACElB,KAAA,CAAAmB,aAA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EAAE;IACjBe,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,EAAE;IACTC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE;EACrB,CAAC;EACDf,KAAK,EAAE;IACLY,KAAK,EAAE,EAAE;IACTI,MAAM,EAAE,EAAE;IACVC,SAAS,EAAE;EACb,CAAC;EACDlC,KAAK,EAAE;IACL6B,KAAK,EAAE,EAAE;IACTM,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAerC,qBAAqB","ignoreList":[]}
|
|
@@ -108,9 +108,7 @@ const ReactionUserListBottomSheet = ({
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
111
|
-
source:
|
|
112
|
-
uri: emoji.url
|
|
113
|
-
},
|
|
111
|
+
source: emojiManager.getEmojiIconSource(emoji),
|
|
114
112
|
style: styles.tabEmoji
|
|
115
113
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
116
114
|
button: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","useState","Animated","Easing","I18nManager","Pressable","ScrollView","View","useWindowDimensions","Avatar","Divider","Image","Modal","Text","createStyleSheet","useUIKitTheme","getReactionCount","truncatedCount","useSafeAreaPadding","ReactionUserListBottomSheet","visible","onClose","onDismiss","reactionCtx","chatCtx","localizationCtx","onPressUserProfile","width","safeArea","colors","tabIndex","setTabIndex","scrollRef","tabIndicatorValue","tabIndicatorAnimated","x","Value","current","focusedWithLayoutCalculated","emojiManager","channel","message","focusIndex","STRINGS","color","ui","reaction","default","reactions","focusedReaction","containerSafeArea","paddingStart","styles","layout","paddingHorizontal","paddingEnd","focusTab","index","animated","indicatorValue","_scrollRef$current","animateTabIndicator","scrollTo","baseConfig","duration","easing","inOut","ease","useNativeDriver","parallel","timing","toValue","start","layoutCalculated","filter","Boolean","length","renderTabs","createElement","style","tabsWrapper","map","isFocused","key","isLastItem","emoji","allEmojiMap","tabItem","marginEnd","onPress","onLayout","e","indexForLayout","isRTL","nativeEvent","source","uri","url","tabEmoji","button","selected","highlight","enabled","tabIndicator","backgroundColor","renderPage","userCountDifference","count","sampledUserInfoList","Fragment","reactedUserInfo","isGroupChannel","userId","pageItem","size","profileUrl","containerStyle","avatar","subtitle2","flex","nickname","LABELS","USER_NO_NAME","body3","onBackground02","REACTION","MORE_USERS","type","backgroundStyle","modal","container","paddingBottom","dialog","none","background","ref","horizontal","bounces","showsHorizontalScrollIndicator","contentContainerStyle","tabsContainer","top","showsVerticalScrollIndicator","pageContainer","overflow","borderTopStartRadius","borderTopEndRadius","paddingTop","alignItems","justifyContent","flexGrow","flexDirection","height","position","bottom"],"sources":["ReactionUserListBottomSheet.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Animated, Easing, I18nManager, Pressable, ScrollView, View, useWindowDimensions } from 'react-native';\n\nimport {\n Avatar,\n Divider,\n Image,\n Modal,\n Text,\n createStyleSheet,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport { SendbirdReaction, getReactionCount, truncatedCount, useSafeAreaPadding } from '@sendbird/uikit-utils';\n\nimport type { ReactionBottomSheetProps } from './index';\n\nconst ReactionUserListBottomSheet = ({\n visible,\n onClose,\n onDismiss,\n reactionCtx,\n chatCtx,\n localizationCtx,\n onPressUserProfile,\n}: ReactionBottomSheetProps) => {\n const { width } = useWindowDimensions();\n const safeArea = useSafeAreaPadding(['left', 'right', 'bottom']);\n const { colors } = useUIKitTheme();\n\n const [tabIndex, setTabIndex] = useState(0);\n const scrollRef = useRef<ScrollView>();\n const tabIndicatorValue = useRef<Array<{ x: number; width: number }>>([]);\n const tabIndicatorAnimated = useRef({ x: new Animated.Value(0), width: new Animated.Value(0) }).current;\n const focusedWithLayoutCalculated = useRef(false);\n\n const { emojiManager } = chatCtx;\n const { channel, message, focusIndex } = reactionCtx;\n const { STRINGS } = localizationCtx;\n\n const color = colors.ui.reaction.default;\n const reactions = message?.reactions ?? [];\n const focusedReaction = reactions[tabIndex] as SendbirdReaction | undefined;\n const containerSafeArea = {\n paddingStart: safeArea.paddingStart + styles.layout.paddingHorizontal,\n paddingEnd: safeArea.paddingEnd + styles.layout.paddingHorizontal,\n };\n\n const focusTab = (index: number, animated = true) => {\n const indicatorValue = tabIndicatorValue.current[index];\n if (indicatorValue) {\n setTabIndex(index);\n animateTabIndicator(indicatorValue.x, indicatorValue.width, animated);\n scrollRef.current?.scrollTo({ x: indicatorValue.x, animated });\n }\n };\n\n const animateTabIndicator = (x: number, width: number, animated = true) => {\n const baseConfig = { duration: animated ? 300 : 0, easing: Easing.inOut(Easing.ease), useNativeDriver: false };\n Animated.parallel([\n Animated.timing(tabIndicatorAnimated.x, { toValue: x, ...baseConfig }),\n Animated.timing(tabIndicatorAnimated.width, { toValue: width, ...baseConfig }),\n ]).start();\n };\n\n const layoutCalculated = () => {\n return tabIndicatorValue.current.filter(Boolean).length === reactions.length;\n };\n\n useEffect(() => {\n if (!visible) {\n tabIndicatorValue.current = [];\n tabIndicatorAnimated.x = new Animated.Value(0);\n tabIndicatorAnimated.width = new Animated.Value(0);\n focusedWithLayoutCalculated.current = false;\n }\n }, [visible]);\n\n const renderTabs = () => {\n return (\n <Pressable style={styles.tabsWrapper}>\n {reactions.map((reaction, index) => {\n const isFocused = focusedReaction?.key === reaction.key;\n const isLastItem = reactions.length - 1 === index;\n const emoji = emojiManager.allEmojiMap[reaction.key];\n\n return (\n <Pressable\n key={reaction.key}\n style={[styles.tabItem, isLastItem && { marginEnd: styles.layout.marginEnd }]}\n onPress={() => focusTab(index)}\n onLayout={(e) => {\n const indexForLayout = I18nManager.isRTL ? reactions.length - 1 - index : index;\n tabIndicatorValue.current[indexForLayout] = e.nativeEvent.layout;\n if (layoutCalculated()) {\n if (focusedWithLayoutCalculated.current) {\n // re-calculating layout when screen rotation\n focusTab(tabIndex, false);\n } else {\n focusedWithLayoutCalculated.current = true;\n focusTab(focusIndex);\n }\n }\n }}\n >\n <Image source={{ uri: emoji.url }} style={styles.tabEmoji} />\n <Text button color={isFocused ? color.selected.highlight : color.enabled.highlight}>\n {truncatedCount(getReactionCount(reaction))}\n </Text>\n </Pressable>\n );\n })}\n <Animated.View\n style={[\n styles.tabIndicator,\n {\n start: tabIndicatorAnimated.x,\n width: tabIndicatorAnimated.width,\n backgroundColor: color.selected.highlight,\n },\n ]}\n />\n </Pressable>\n );\n };\n\n const renderPage = () => {\n const userCountDifference = (focusedReaction?.count || 0) - (focusedReaction?.sampledUserInfoList.length || 0);\n\n return (\n <>\n {focusedReaction?.sampledUserInfoList.map((reactedUserInfo) => {\n if (channel?.isGroupChannel()) {\n return (\n <Pressable\n key={reactedUserInfo.userId}\n onPress={async () => {\n await onClose();\n onPressUserProfile(reactedUserInfo);\n }}\n style={styles.pageItem}\n >\n <Avatar size={36} uri={reactedUserInfo?.profileUrl} containerStyle={styles.avatar} />\n <Text subtitle2 style={{ flex: 1 }}>\n {reactedUserInfo?.nickname || STRINGS.LABELS.USER_NO_NAME}\n </Text>\n </Pressable>\n );\n }\n return null;\n })}\n {userCountDifference > 0 && (\n <View style={styles.pageItem}>\n <Text body3 color={colors.onBackground02}>\n {STRINGS.REACTION.MORE_USERS(userCountDifference)}\n </Text>\n </View>\n )}\n </>\n );\n };\n\n return (\n <Modal\n type={'slide-no-gesture'}\n visible={Boolean(visible && channel && message)}\n onClose={onClose}\n onDismiss={onDismiss}\n backgroundStyle={styles.modal}\n >\n <View\n style={[\n styles.container,\n { width, paddingBottom: safeArea.paddingBottom, backgroundColor: colors.ui.dialog.default.none.background },\n ]}\n >\n <ScrollView\n ref={scrollRef as never}\n horizontal\n bounces={false}\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={[containerSafeArea, styles.tabsContainer]}\n >\n {renderTabs()}\n </ScrollView>\n <Divider style={{ top: -1 }} />\n <ScrollView\n bounces={false}\n showsVerticalScrollIndicator={false}\n style={styles.pageContainer}\n contentContainerStyle={containerSafeArea}\n >\n {renderPage()}\n </ScrollView>\n </View>\n </Modal>\n );\n};\n\nconst styles = createStyleSheet({\n layout: {\n paddingHorizontal: 16,\n marginEnd: 0,\n },\n container: {\n overflow: 'hidden',\n borderTopStartRadius: 8,\n borderTopEndRadius: 8,\n paddingTop: 16,\n alignItems: 'center',\n },\n modal: {\n alignItems: 'center',\n justifyContent: 'flex-end',\n },\n tabsContainer: {\n flexGrow: 1,\n },\n tabsWrapper: {\n flexGrow: 1,\n flexDirection: 'row',\n alignItems: 'flex-start',\n justifyContent: 'center',\n height: 44,\n },\n tabItem: {\n marginEnd: 16,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n },\n tabEmoji: {\n width: 28,\n height: 28,\n marginEnd: 4,\n },\n tabIndicator: {\n position: 'absolute',\n bottom: 0,\n height: 3,\n },\n pageContainer: {\n height: 216,\n width: '100%',\n },\n pageItem: {\n flexDirection: 'row',\n width: '100%',\n height: 48,\n alignItems: 'center',\n },\n avatar: {\n marginEnd: 16,\n },\n});\n\nexport default ReactionUserListBottomSheet;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,QAAQ,EAAEC,MAAM,EAAEC,WAAW,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,mBAAmB,QAAQ,cAAc;AAE9G,SACEC,MAAM,EACNC,OAAO,EACPC,KAAK,EACLC,KAAK,EACLC,IAAI,EACJC,gBAAgB,EAChBC,aAAa,QACR,yCAAyC;AAChD,SAA2BC,gBAAgB,EAAEC,cAAc,EAAEC,kBAAkB,QAAQ,uBAAuB;AAI9G,MAAMC,2BAA2B,GAAGA,CAAC;EACnCC,OAAO;EACPC,OAAO;EACPC,SAAS;EACTC,WAAW;EACXC,OAAO;EACPC,eAAe;EACfC;AACwB,CAAC,KAAK;EAC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BuC,MAAM,EAAE;IACNC,iBAAiB,EAAE,EAAE;IACrBkC,SAAS,EAAE;EACb,CAAC;EACD0C,SAAS,EAAE;IACTc,QAAQ,EAAE,QAAQ;IAClBC,oBAAoB,EAAE,CAAC;IACvBC,kBAAkB,EAAE,CAAC;IACrBC,UAAU,EAAE,EAAE;IACdC,UAAU,EAAE;EACd,CAAC;EACDnB,KAAK,EAAE;IACLmB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDT,aAAa,EAAE;IACbU,QAAQ,EAAE;EACZ,CAAC;EACDtE,WAAW,EAAE;IACXsE,QAAQ,EAAE,CAAC;IACXC,aAAa,EAAE,KAAK;IACpBH,UAAU,EAAE,YAAY;IACxBC,cAAc,EAAE,QAAQ;IACxBG,MAAM,EAAE;EACV,CAAC;EACDjE,OAAO,EAAE;IACPC,SAAS,EAAE,EAAE;IACb+D,aAAa,EAAE,KAAK;IACpBH,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDnD,QAAQ,EAAE;IACRvE,KAAK,EAAE,EAAE;IACT6H,MAAM,EAAE,EAAE;IACVhE,SAAS,EAAE;EACb,CAAC;EACDe,YAAY,EAAE;IACZkD,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTF,MAAM,EAAE;EACV,CAAC;EACDT,aAAa,EAAE;IACbS,MAAM,EAAE,GAAG;IACX7H,KAAK,EAAE;EACT,CAAC;EACDsF,QAAQ,EAAE;IACRsC,aAAa,EAAE,KAAK;IACpB5H,KAAK,EAAE,MAAM;IACb6H,MAAM,EAAE,EAAE;IACVJ,UAAU,EAAE;EACd,CAAC;EACD/B,MAAM,EAAE;IACN7B,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAerE,2BAA2B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","Animated","Easing","I18nManager","Pressable","ScrollView","View","useWindowDimensions","Avatar","Divider","Image","Modal","Text","createStyleSheet","useUIKitTheme","getReactionCount","truncatedCount","useSafeAreaPadding","ReactionUserListBottomSheet","visible","onClose","onDismiss","reactionCtx","chatCtx","localizationCtx","onPressUserProfile","width","safeArea","colors","tabIndex","setTabIndex","scrollRef","tabIndicatorValue","tabIndicatorAnimated","x","Value","current","focusedWithLayoutCalculated","emojiManager","channel","message","focusIndex","STRINGS","color","ui","reaction","default","reactions","focusedReaction","containerSafeArea","paddingStart","styles","layout","paddingHorizontal","paddingEnd","focusTab","index","animated","indicatorValue","_scrollRef$current","animateTabIndicator","scrollTo","baseConfig","duration","easing","inOut","ease","useNativeDriver","parallel","timing","toValue","start","layoutCalculated","filter","Boolean","length","renderTabs","createElement","style","tabsWrapper","map","isFocused","key","isLastItem","emoji","allEmojiMap","tabItem","marginEnd","onPress","onLayout","e","indexForLayout","isRTL","nativeEvent","source","getEmojiIconSource","tabEmoji","button","selected","highlight","enabled","tabIndicator","backgroundColor","renderPage","userCountDifference","count","sampledUserInfoList","Fragment","reactedUserInfo","isGroupChannel","userId","pageItem","size","uri","profileUrl","containerStyle","avatar","subtitle2","flex","nickname","LABELS","USER_NO_NAME","body3","onBackground02","REACTION","MORE_USERS","type","backgroundStyle","modal","container","paddingBottom","dialog","none","background","ref","horizontal","bounces","showsHorizontalScrollIndicator","contentContainerStyle","tabsContainer","top","showsVerticalScrollIndicator","pageContainer","overflow","borderTopStartRadius","borderTopEndRadius","paddingTop","alignItems","justifyContent","flexGrow","flexDirection","height","position","bottom"],"sources":["ReactionUserListBottomSheet.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Animated, Easing, I18nManager, Pressable, ScrollView, View, useWindowDimensions } from 'react-native';\n\nimport {\n Avatar,\n Divider,\n Image,\n Modal,\n Text,\n createStyleSheet,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport {\n SendbirdEmoji,\n SendbirdReaction,\n getReactionCount,\n truncatedCount,\n useSafeAreaPadding,\n} from '@sendbird/uikit-utils';\n\nimport type { ReactionBottomSheetProps } from './index';\n\nconst ReactionUserListBottomSheet = ({\n visible,\n onClose,\n onDismiss,\n reactionCtx,\n chatCtx,\n localizationCtx,\n onPressUserProfile,\n}: ReactionBottomSheetProps) => {\n const { width } = useWindowDimensions();\n const safeArea = useSafeAreaPadding(['left', 'right', 'bottom']);\n const { colors } = useUIKitTheme();\n\n const [tabIndex, setTabIndex] = useState(0);\n const scrollRef = useRef<ScrollView>();\n const tabIndicatorValue = useRef<Array<{ x: number; width: number }>>([]);\n const tabIndicatorAnimated = useRef({ x: new Animated.Value(0), width: new Animated.Value(0) }).current;\n const focusedWithLayoutCalculated = useRef(false);\n\n const { emojiManager } = chatCtx;\n const { channel, message, focusIndex } = reactionCtx;\n const { STRINGS } = localizationCtx;\n\n const color = colors.ui.reaction.default;\n const reactions = message?.reactions ?? [];\n const focusedReaction = reactions[tabIndex] as SendbirdReaction | undefined;\n const containerSafeArea = {\n paddingStart: safeArea.paddingStart + styles.layout.paddingHorizontal,\n paddingEnd: safeArea.paddingEnd + styles.layout.paddingHorizontal,\n };\n\n const focusTab = (index: number, animated = true) => {\n const indicatorValue = tabIndicatorValue.current[index];\n if (indicatorValue) {\n setTabIndex(index);\n animateTabIndicator(indicatorValue.x, indicatorValue.width, animated);\n scrollRef.current?.scrollTo({ x: indicatorValue.x, animated });\n }\n };\n\n const animateTabIndicator = (x: number, width: number, animated = true) => {\n const baseConfig = { duration: animated ? 300 : 0, easing: Easing.inOut(Easing.ease), useNativeDriver: false };\n Animated.parallel([\n Animated.timing(tabIndicatorAnimated.x, { toValue: x, ...baseConfig }),\n Animated.timing(tabIndicatorAnimated.width, { toValue: width, ...baseConfig }),\n ]).start();\n };\n\n const layoutCalculated = () => {\n return tabIndicatorValue.current.filter(Boolean).length === reactions.length;\n };\n\n useEffect(() => {\n if (!visible) {\n tabIndicatorValue.current = [];\n tabIndicatorAnimated.x = new Animated.Value(0);\n tabIndicatorAnimated.width = new Animated.Value(0);\n focusedWithLayoutCalculated.current = false;\n }\n }, [visible]);\n\n const renderTabs = () => {\n return (\n <Pressable style={styles.tabsWrapper}>\n {reactions.map((reaction, index) => {\n const isFocused = focusedReaction?.key === reaction.key;\n const isLastItem = reactions.length - 1 === index;\n const emoji = emojiManager.allEmojiMap[reaction.key] as SendbirdEmoji | undefined;\n\n return (\n <Pressable\n key={reaction.key}\n style={[styles.tabItem, isLastItem && { marginEnd: styles.layout.marginEnd }]}\n onPress={() => focusTab(index)}\n onLayout={(e) => {\n const indexForLayout = I18nManager.isRTL ? reactions.length - 1 - index : index;\n tabIndicatorValue.current[indexForLayout] = e.nativeEvent.layout;\n if (layoutCalculated()) {\n if (focusedWithLayoutCalculated.current) {\n // re-calculating layout when screen rotation\n focusTab(tabIndex, false);\n } else {\n focusedWithLayoutCalculated.current = true;\n focusTab(focusIndex);\n }\n }\n }}\n >\n <Image source={emojiManager.getEmojiIconSource(emoji)} style={styles.tabEmoji} />\n <Text button color={isFocused ? color.selected.highlight : color.enabled.highlight}>\n {truncatedCount(getReactionCount(reaction))}\n </Text>\n </Pressable>\n );\n })}\n <Animated.View\n style={[\n styles.tabIndicator,\n {\n start: tabIndicatorAnimated.x,\n width: tabIndicatorAnimated.width,\n backgroundColor: color.selected.highlight,\n },\n ]}\n />\n </Pressable>\n );\n };\n\n const renderPage = () => {\n const userCountDifference = (focusedReaction?.count || 0) - (focusedReaction?.sampledUserInfoList.length || 0);\n\n return (\n <>\n {focusedReaction?.sampledUserInfoList.map((reactedUserInfo) => {\n if (channel?.isGroupChannel()) {\n return (\n <Pressable\n key={reactedUserInfo.userId}\n onPress={async () => {\n await onClose();\n onPressUserProfile(reactedUserInfo);\n }}\n style={styles.pageItem}\n >\n <Avatar size={36} uri={reactedUserInfo?.profileUrl} containerStyle={styles.avatar} />\n <Text subtitle2 style={{ flex: 1 }}>\n {reactedUserInfo?.nickname || STRINGS.LABELS.USER_NO_NAME}\n </Text>\n </Pressable>\n );\n }\n return null;\n })}\n {userCountDifference > 0 && (\n <View style={styles.pageItem}>\n <Text body3 color={colors.onBackground02}>\n {STRINGS.REACTION.MORE_USERS(userCountDifference)}\n </Text>\n </View>\n )}\n </>\n );\n };\n\n return (\n <Modal\n type={'slide-no-gesture'}\n visible={Boolean(visible && channel && message)}\n onClose={onClose}\n onDismiss={onDismiss}\n backgroundStyle={styles.modal}\n >\n <View\n style={[\n styles.container,\n { width, paddingBottom: safeArea.paddingBottom, backgroundColor: colors.ui.dialog.default.none.background },\n ]}\n >\n <ScrollView\n ref={scrollRef as never}\n horizontal\n bounces={false}\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={[containerSafeArea, styles.tabsContainer]}\n >\n {renderTabs()}\n </ScrollView>\n <Divider style={{ top: -1 }} />\n <ScrollView\n bounces={false}\n showsVerticalScrollIndicator={false}\n style={styles.pageContainer}\n contentContainerStyle={containerSafeArea}\n >\n {renderPage()}\n </ScrollView>\n </View>\n </Modal>\n );\n};\n\nconst styles = createStyleSheet({\n layout: {\n paddingHorizontal: 16,\n marginEnd: 0,\n },\n container: {\n overflow: 'hidden',\n borderTopStartRadius: 8,\n borderTopEndRadius: 8,\n paddingTop: 16,\n alignItems: 'center',\n },\n modal: {\n alignItems: 'center',\n justifyContent: 'flex-end',\n },\n tabsContainer: {\n flexGrow: 1,\n },\n tabsWrapper: {\n flexGrow: 1,\n flexDirection: 'row',\n alignItems: 'flex-start',\n justifyContent: 'center',\n height: 44,\n },\n tabItem: {\n marginEnd: 16,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n },\n tabEmoji: {\n width: 28,\n height: 28,\n marginEnd: 4,\n },\n tabIndicator: {\n position: 'absolute',\n bottom: 0,\n height: 3,\n },\n pageContainer: {\n height: 216,\n width: '100%',\n },\n pageItem: {\n flexDirection: 'row',\n width: '100%',\n height: 48,\n alignItems: 'center',\n },\n avatar: {\n marginEnd: 16,\n },\n});\n\nexport default ReactionUserListBottomSheet;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SA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AAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTF,MAAM,EAAE;EACV,CAAC;EACDT,aAAa,EAAE;IACbS,MAAM,EAAE,GAAG;IACX7H,KAAK,EAAE;EACT,CAAC;EACDqF,QAAQ,EAAE;IACRuC,aAAa,EAAE,KAAK;IACpB5H,KAAK,EAAE,MAAM;IACb6H,MAAM,EAAE,EAAE;IACVJ,UAAU,EAAE;EACd,CAAC;EACD/B,MAAM,EAAE;IACN7B,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAerE,2BAA2B","ignoreList":[]}
|
|
@@ -12,7 +12,8 @@ const GroupChannelSuggestedMentionList = ({
|
|
|
12
12
|
inputHeight,
|
|
13
13
|
bottomInset,
|
|
14
14
|
onPressToMention,
|
|
15
|
-
mentionedUsers
|
|
15
|
+
mentionedUsers,
|
|
16
|
+
showUserId = true
|
|
16
17
|
}) => {
|
|
17
18
|
const {
|
|
18
19
|
width: screenWidth,
|
|
@@ -89,7 +90,7 @@ const GroupChannelSuggestedMentionList = ({
|
|
|
89
90
|
color: colors.onBackground01,
|
|
90
91
|
numberOfLines: 1,
|
|
91
92
|
style: styles.userNickname
|
|
92
|
-
}, member.nickname || STRINGS.LABELS.USER_NO_NAME), /*#__PURE__*/React.createElement(Text, {
|
|
93
|
+
}, member.nickname || STRINGS.LABELS.USER_NO_NAME), !!showUserId && /*#__PURE__*/React.createElement(Text, {
|
|
93
94
|
body3: true,
|
|
94
95
|
color: colors.onBackground03,
|
|
95
96
|
numberOfLines: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useContext","Pressable","ScrollView","View","useWindowDimensions","Avatar","Box","Divider","Icon","Text","createStyleSheet","useHeaderStyle","useUIKitTheme","conditionChaining","useSafeAreaPadding","useLocalization","useSendbirdChat","useKeyboardStatus","useMentionSuggestion","GroupChannelContexts","GroupChannelSuggestedMentionList","text","selection","inputHeight","bottomInset","onPressToMention","mentionedUsers","width","screenWidth","height","screenHeight","channel","Fragment","sdk","mentionManager","STRINGS","colors","topInset","safeArea","keyboard","members","reset","searchStringRange","searchLimited","isLandscape","isShortened","visible","canRenderMembers","length","maxHeight","styles","suggestion","renderLimitGuide","createElement","style","borderTopColor","onBackground04","icon","size","containerStyle","marginEnd","color","onBackground02","body3","GROUP_CHANNEL","MENTION_LIMITED","config","mentionLimit","renderMembers","map","member","onPress","key","userId","userContainer","uri","profileUrl","userAvatar","userInfo","body2","onBackground01","numberOfLines","userNickname","nickname","LABELS","USER_NO_NAME","onBackground03","position","bottom","pointerEvents","container","bounces","keyboardDismissMode","keyboardShouldPersistTaps","scrollView","backgroundColor","background","bottomSpace","borderTopWidth","contentContainerStyle","top","start","end","paddingStart","flexDirection","alignItems","justifyContent","flex","flexShrink","lineHeight","textAlignVertical","minWidth","paddingHorizontal"],"sources":["GroupChannelSuggestedMentionList.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { Pressable, ScrollView, View, useWindowDimensions } from 'react-native';\n\nimport {\n Avatar,\n Box,\n Divider,\n Icon,\n Text,\n createStyleSheet,\n useHeaderStyle,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport { conditionChaining, useSafeAreaPadding } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport useKeyboardStatus from '../../../hooks/useKeyboardStatus';\nimport useMentionSuggestion from '../../../hooks/useMentionSuggestion';\nimport { GroupChannelContexts } from '../module/moduleContext';\nimport type { GroupChannelProps } from '../types';\n\nconst GroupChannelSuggestedMentionList = ({\n text,\n selection,\n inputHeight,\n bottomInset,\n onPressToMention,\n mentionedUsers,\n}: GroupChannelProps['SuggestedMentionList']) => {\n const { width: screenWidth, height: screenHeight } = useWindowDimensions();\n const { channel } = useContext(GroupChannelContexts.Fragment);\n const { sdk, mentionManager } = useSendbirdChat();\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n const { topInset } = useHeaderStyle();\n const safeArea = useSafeAreaPadding(['left', 'right']);\n\n const keyboard = useKeyboardStatus();\n\n const { members, reset, searchStringRange, searchLimited } = useMentionSuggestion({\n sdk,\n text,\n selection,\n channel,\n mentionedUsers,\n });\n\n const isLandscape = screenWidth > screenHeight;\n const isShortened = isLandscape && keyboard.visible;\n const canRenderMembers = members.length > 0;\n const maxHeight = isShortened ? screenHeight - (topInset + inputHeight + keyboard.height) : styles.suggestion.height;\n\n const renderLimitGuide = () => {\n return (\n <View style={[styles.searchLimited, { borderTopColor: colors.onBackground04 }]}>\n <Icon icon={'info'} size={20} containerStyle={{ marginEnd: 4 }} color={colors.onBackground02} />\n <Text body3 color={colors.onBackground02}>\n {STRINGS.GROUP_CHANNEL.MENTION_LIMITED(mentionManager.config.mentionLimit)}\n </Text>\n </View>\n );\n };\n\n const renderMembers = () => {\n return (\n <View>\n {members.map((member) => {\n return (\n <Pressable\n onPress={() => {\n onPressToMention(member, searchStringRange);\n reset();\n }}\n key={member.userId}\n style={styles.userContainer}\n >\n <Avatar size={28} uri={member.profileUrl} containerStyle={styles.userAvatar} />\n <Box style={styles.userInfo}>\n <Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>\n {member.nickname || STRINGS.LABELS.USER_NO_NAME}\n </Text>\n <Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>\n {member.userId}\n </Text>\n <Divider style={{ position: 'absolute', bottom: 0 }} />\n </Box>\n </Pressable>\n );\n })}\n </View>\n );\n };\n\n return (\n <Pressable\n onPress={reset}\n pointerEvents={canRenderMembers ? 'auto' : 'none'}\n style={[styles.container, { bottom: inputHeight + bottomInset }]}\n >\n <ScrollView\n bounces={false}\n keyboardDismissMode={'none'}\n keyboardShouldPersistTaps={'always'}\n style={[\n styles.scrollView,\n {\n maxHeight,\n backgroundColor: colors.background,\n bottom: keyboard.bottomSpace,\n },\n canRenderMembers && {\n borderTopWidth: 1,\n borderTopColor: colors.onBackground04,\n },\n ]}\n contentContainerStyle={safeArea}\n >\n {conditionChaining([searchLimited, canRenderMembers], [renderLimitGuide(), renderMembers(), null])}\n </ScrollView>\n </Pressable>\n );\n};\n\nconst styles = createStyleSheet({\n suggestion: {\n height: 196,\n },\n container: {\n position: 'absolute',\n top: 0,\n start: 0,\n end: 0,\n },\n scrollView: {\n position: 'absolute',\n start: 0,\n end: 0,\n },\n userContainer: {\n paddingStart: 16,\n flexDirection: 'row',\n height: 44,\n alignItems: 'center',\n justifyContent: 'center',\n },\n userAvatar: {\n marginEnd: 16,\n },\n userInfo: {\n flexDirection: 'row',\n flex: 1,\n },\n userNickname: {\n flexShrink: 1,\n lineHeight: 44,\n textAlignVertical: 'center',\n marginEnd: 6,\n },\n userId: {\n lineHeight: 44,\n textAlignVertical: 'center',\n minWidth: 32,\n flexShrink: 1,\n marginEnd: 16,\n },\n searchLimited: {\n borderTopWidth: 1,\n paddingHorizontal: 16,\n height: 44,\n flexDirection: 'row',\n alignItems: 'center',\n },\n});\nexport default GroupChannelSuggestedMentionList;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,mBAAmB,QAAQ,cAAc;AAE/E,SACEC,MAAM,EACNC,GAAG,EACHC,OAAO,EACPC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,cAAc,EACdC,aAAa,QACR,yCAAyC;AAChD,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,uBAAuB;AAE7E,SAASC,eAAe,EAAEC,eAAe,QAAQ,2BAA2B;AAC5E,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,oBAAoB,MAAM,qCAAqC;AACtE,SAASC,oBAAoB,QAAQ,yBAAyB;AAG9D,MAAMC,gCAAgC,GAAGA,CAAC;EACxCC,IAAI;EACJC,SAAS;EACTC,WAAW;EACXC,WAAW;EACXC,gBAAgB;EAChBC;AACyC,CAAC,KAAK;EAC/C,MAAM;IAAEC,KAAK,EAAEC,WAAW;IAAEC,M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C,gBAAgB,CAAC;EAC9ByC,UAAU,EAAE;IACVtB,MAAM,EAAE;EACV,CAAC;EACD6D,SAAS,EAAE;IACTH,QAAQ,EAAE,UAAU;IACpBa,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE;EACP,CAAC;EACDR,UAAU,EAAE;IACVP,QAAQ,EAAE,UAAU;IACpBc,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE;EACP,CAAC;EACD5B,aAAa,EAAE;IACb6B,YAAY,EAAE,EAAE;IAChBC,aAAa,EAAE,KAAK;IACpB3E,MAAM,EAAE,EAAE;IACV4E,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACD7B,UAAU,EAAE;IACVjB,SAAS,EAAE;EACb,CAAC;EACDkB,QAAQ,EAAE;IACR0B,aAAa,EAAE,KAAK;IACpBG,IAAI,EAAE;EACR,CAAC;EACDzB,YAAY,EAAE;IACZ0B,UAAU,EAAE,CAAC;IACbC,UAAU,EAAE,EAAE;IACdC,iBAAiB,EAAE,QAAQ;IAC3BlD,SAAS,EAAE;EACb,CAAC;EACDa,MAAM,EAAE;IACNoC,UAAU,EAAE,EAAE;IACdC,iBAAiB,EAAE,QAAQ;IAC3BC,QAAQ,EAAE,EAAE;IACZH,UAAU,EAAE,CAAC;IACbhD,SAAS,EAAE;EACb,CAAC;EACDjB,aAAa,EAAE;IACbuD,cAAc,EAAE,CAAC;IACjBc,iBAAiB,EAAE,EAAE;IACrBnF,MAAM,EAAE,EAAE;IACV2E,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AACF,eAAerF,gCAAgC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useContext","Pressable","ScrollView","View","useWindowDimensions","Avatar","Box","Divider","Icon","Text","createStyleSheet","useHeaderStyle","useUIKitTheme","conditionChaining","useSafeAreaPadding","useLocalization","useSendbirdChat","useKeyboardStatus","useMentionSuggestion","GroupChannelContexts","GroupChannelSuggestedMentionList","text","selection","inputHeight","bottomInset","onPressToMention","mentionedUsers","showUserId","width","screenWidth","height","screenHeight","channel","Fragment","sdk","mentionManager","STRINGS","colors","topInset","safeArea","keyboard","members","reset","searchStringRange","searchLimited","isLandscape","isShortened","visible","canRenderMembers","length","maxHeight","styles","suggestion","renderLimitGuide","createElement","style","borderTopColor","onBackground04","icon","size","containerStyle","marginEnd","color","onBackground02","body3","GROUP_CHANNEL","MENTION_LIMITED","config","mentionLimit","renderMembers","map","member","onPress","key","userId","userContainer","uri","profileUrl","userAvatar","userInfo","body2","onBackground01","numberOfLines","userNickname","nickname","LABELS","USER_NO_NAME","onBackground03","position","bottom","pointerEvents","container","bounces","keyboardDismissMode","keyboardShouldPersistTaps","scrollView","backgroundColor","background","bottomSpace","borderTopWidth","contentContainerStyle","top","start","end","paddingStart","flexDirection","alignItems","justifyContent","flex","flexShrink","lineHeight","textAlignVertical","minWidth","paddingHorizontal"],"sources":["GroupChannelSuggestedMentionList.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { Pressable, ScrollView, View, useWindowDimensions } from 'react-native';\n\nimport {\n Avatar,\n Box,\n Divider,\n Icon,\n Text,\n createStyleSheet,\n useHeaderStyle,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport { conditionChaining, useSafeAreaPadding } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport useKeyboardStatus from '../../../hooks/useKeyboardStatus';\nimport useMentionSuggestion from '../../../hooks/useMentionSuggestion';\nimport { GroupChannelContexts } from '../module/moduleContext';\nimport type { GroupChannelProps } from '../types';\n\nconst GroupChannelSuggestedMentionList = ({\n text,\n selection,\n inputHeight,\n bottomInset,\n onPressToMention,\n mentionedUsers,\n showUserId = true,\n}: GroupChannelProps['SuggestedMentionList']) => {\n const { width: screenWidth, height: screenHeight } = useWindowDimensions();\n const { channel } = useContext(GroupChannelContexts.Fragment);\n const { sdk, mentionManager } = useSendbirdChat();\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n const { topInset } = useHeaderStyle();\n const safeArea = useSafeAreaPadding(['left', 'right']);\n\n const keyboard = useKeyboardStatus();\n\n const { members, reset, searchStringRange, searchLimited } = useMentionSuggestion({\n sdk,\n text,\n selection,\n channel,\n mentionedUsers,\n });\n\n const isLandscape = screenWidth > screenHeight;\n const isShortened = isLandscape && keyboard.visible;\n const canRenderMembers = members.length > 0;\n const maxHeight = isShortened ? screenHeight - (topInset + inputHeight + keyboard.height) : styles.suggestion.height;\n\n const renderLimitGuide = () => {\n return (\n <View style={[styles.searchLimited, { borderTopColor: colors.onBackground04 }]}>\n <Icon icon={'info'} size={20} containerStyle={{ marginEnd: 4 }} color={colors.onBackground02} />\n <Text body3 color={colors.onBackground02}>\n {STRINGS.GROUP_CHANNEL.MENTION_LIMITED(mentionManager.config.mentionLimit)}\n </Text>\n </View>\n );\n };\n\n const renderMembers = () => {\n return (\n <View>\n {members.map((member) => {\n return (\n <Pressable\n onPress={() => {\n onPressToMention(member, searchStringRange);\n reset();\n }}\n key={member.userId}\n style={styles.userContainer}\n >\n <Avatar size={28} uri={member.profileUrl} containerStyle={styles.userAvatar} />\n <Box style={styles.userInfo}>\n <Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>\n {member.nickname || STRINGS.LABELS.USER_NO_NAME}\n </Text>\n {!!showUserId && (\n <Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>\n {member.userId}\n </Text>\n )}\n <Divider style={{ position: 'absolute', bottom: 0 }} />\n </Box>\n </Pressable>\n );\n })}\n </View>\n );\n };\n\n return (\n <Pressable\n onPress={reset}\n pointerEvents={canRenderMembers ? 'auto' : 'none'}\n style={[styles.container, { bottom: inputHeight + bottomInset }]}\n >\n <ScrollView\n bounces={false}\n keyboardDismissMode={'none'}\n keyboardShouldPersistTaps={'always'}\n style={[\n styles.scrollView,\n {\n maxHeight,\n backgroundColor: colors.background,\n bottom: keyboard.bottomSpace,\n },\n canRenderMembers && {\n borderTopWidth: 1,\n borderTopColor: colors.onBackground04,\n },\n ]}\n contentContainerStyle={safeArea}\n >\n {conditionChaining([searchLimited, canRenderMembers], [renderLimitGuide(), renderMembers(), null])}\n </ScrollView>\n </Pressable>\n );\n};\n\nconst styles = createStyleSheet({\n suggestion: {\n height: 196,\n },\n container: {\n position: 'absolute',\n top: 0,\n start: 0,\n end: 0,\n },\n scrollView: {\n position: 'absolute',\n start: 0,\n end: 0,\n },\n userContainer: {\n paddingStart: 16,\n flexDirection: 'row',\n height: 44,\n alignItems: 'center',\n justifyContent: 'center',\n },\n userAvatar: {\n marginEnd: 16,\n },\n userInfo: {\n flexDirection: 'row',\n flex: 1,\n },\n userNickname: {\n flexShrink: 1,\n lineHeight: 44,\n textAlignVertical: 'center',\n marginEnd: 6,\n },\n userId: {\n lineHeight: 44,\n textAlignVertical: 'center',\n minWidth: 32,\n flexShrink: 1,\n marginEnd: 16,\n },\n searchLimited: {\n borderTopWidth: 1,\n paddingHorizontal: 16,\n height: 44,\n flexDirection: 'row',\n alignItems: 'center',\n },\n});\nexport default GroupChannelSuggestedMentionList;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,mBAAmB,QAAQ,cAAc;AAE/E,SACEC,MAAM,EACNC,GAAG,EACHC,OAAO,EACPC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,cAAc,EACdC,aAAa,QACR,yCAAyC;AAChD,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,uBAAuB;AAE7E,SAASC,eAAe,EAAEC,eAAe,QAAQ,2BAA2B;AAC5E,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,oBAAoB,MAAM,qCAAqC;AACtE,SAASC,oBAAoB,QAAQ,yBAAyB;AAG9D,MAAMC,gCAAgC,GAAGA,CAAC;EACxCC,IAAI;EACJC,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annelThread/component/GroupChannelThreadSuggestedMentionList.js
CHANGED
|
@@ -12,7 +12,8 @@ const GroupChannelThreadSuggestedMentionList = ({
|
|
|
12
12
|
inputHeight,
|
|
13
13
|
bottomInset,
|
|
14
14
|
onPressToMention,
|
|
15
|
-
mentionedUsers
|
|
15
|
+
mentionedUsers,
|
|
16
|
+
showUserId = true
|
|
16
17
|
}) => {
|
|
17
18
|
const {
|
|
18
19
|
width: screenWidth,
|
|
@@ -89,7 +90,7 @@ const GroupChannelThreadSuggestedMentionList = ({
|
|
|
89
90
|
color: colors.onBackground01,
|
|
90
91
|
numberOfLines: 1,
|
|
91
92
|
style: styles.userNickname
|
|
92
|
-
}, member.nickname || STRINGS.LABELS.USER_NO_NAME), /*#__PURE__*/React.createElement(Text, {
|
|
93
|
+
}, member.nickname || STRINGS.LABELS.USER_NO_NAME), !!showUserId && /*#__PURE__*/React.createElement(Text, {
|
|
93
94
|
body3: true,
|
|
94
95
|
color: colors.onBackground03,
|
|
95
96
|
numberOfLines: 1,
|
package/lib/module/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useContext","Pressable","ScrollView","View","useWindowDimensions","Avatar","Divider","Icon","Text","createStyleSheet","useHeaderStyle","useUIKitTheme","conditionChaining","useSafeAreaPadding","useLocalization","useSendbirdChat","useKeyboardStatus","useMentionSuggestion","GroupChannelThreadContexts","GroupChannelThreadSuggestedMentionList","text","selection","inputHeight","bottomInset","onPressToMention","mentionedUsers","width","screenWidth","height","screenHeight","channel","Fragment","sdk","mentionManager","STRINGS","colors","topInset","safeArea","keyboard","members","reset","searchStringRange","searchLimited","isLandscape","isShortened","visible","canRenderMembers","length","maxHeight","styles","suggestion","renderLimitGuide","createElement","style","borderTopColor","onBackground04","icon","size","containerStyle","marginEnd","color","onBackground02","body3","GROUP_CHANNEL_THREAD","MENTION_LIMITED","config","mentionLimit","renderMembers","map","member","onPress","key","userId","userContainer","uri","profileUrl","userAvatar","userInfo","body2","onBackground01","numberOfLines","userNickname","nickname","LABELS","USER_NO_NAME","onBackground03","position","bottom","pointerEvents","container","bounces","keyboardDismissMode","keyboardShouldPersistTaps","scrollView","backgroundColor","background","bottomSpace","borderTopWidth","contentContainerStyle","top","start","end","paddingStart","flexDirection","alignItems","justifyContent","flex","flexShrink","lineHeight","textAlignVertical","minWidth","paddingHorizontal"],"sources":["GroupChannelThreadSuggestedMentionList.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { Pressable, ScrollView, View, useWindowDimensions } from 'react-native';\n\nimport {\n Avatar,\n Divider,\n Icon,\n Text,\n createStyleSheet,\n useHeaderStyle,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport { conditionChaining, useSafeAreaPadding } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport useKeyboardStatus from '../../../hooks/useKeyboardStatus';\nimport useMentionSuggestion from '../../../hooks/useMentionSuggestion';\nimport { GroupChannelThreadContexts } from '../module/moduleContext';\nimport type { GroupChannelThreadProps } from '../types';\n\nconst GroupChannelThreadSuggestedMentionList = ({\n text,\n selection,\n inputHeight,\n bottomInset,\n onPressToMention,\n mentionedUsers,\n}: GroupChannelThreadProps['SuggestedMentionList']) => {\n const { width: screenWidth, height: screenHeight } = useWindowDimensions();\n const { channel } = useContext(GroupChannelThreadContexts.Fragment);\n const { sdk, mentionManager } = useSendbirdChat();\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n const { topInset } = useHeaderStyle();\n const safeArea = useSafeAreaPadding(['left', 'right']);\n\n const keyboard = useKeyboardStatus();\n\n const { members, reset, searchStringRange, searchLimited } = useMentionSuggestion({\n sdk,\n text,\n selection,\n channel,\n mentionedUsers,\n });\n\n const isLandscape = screenWidth > screenHeight;\n const isShortened = isLandscape && keyboard.visible;\n const canRenderMembers = members.length > 0;\n const maxHeight = isShortened ? screenHeight - (topInset + inputHeight + keyboard.height) : styles.suggestion.height;\n\n const renderLimitGuide = () => {\n return (\n <View style={[styles.searchLimited, { borderTopColor: colors.onBackground04 }]}>\n <Icon icon={'info'} size={20} containerStyle={{ marginEnd: 4 }} color={colors.onBackground02} />\n <Text body3 color={colors.onBackground02}>\n {STRINGS.GROUP_CHANNEL_THREAD.MENTION_LIMITED(mentionManager.config.mentionLimit)}\n </Text>\n </View>\n );\n };\n\n const renderMembers = () => {\n return (\n <View>\n {members.map((member) => {\n return (\n <Pressable\n onPress={() => {\n onPressToMention(member, searchStringRange);\n reset();\n }}\n key={member.userId}\n style={styles.userContainer}\n >\n <Avatar size={28} uri={member.profileUrl} containerStyle={styles.userAvatar} />\n <View style={styles.userInfo}>\n <Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>\n {member.nickname || STRINGS.LABELS.USER_NO_NAME}\n </Text>\n <Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>\n {member.userId}\n </Text>\n <Divider style={{ position: 'absolute', bottom: 0 }} />\n </View>\n </Pressable>\n );\n })}\n </View>\n );\n };\n\n return (\n <Pressable\n onPress={reset}\n pointerEvents={canRenderMembers ? 'auto' : 'none'}\n style={[styles.container, { bottom: inputHeight + bottomInset }]}\n >\n <ScrollView\n bounces={false}\n keyboardDismissMode={'none'}\n keyboardShouldPersistTaps={'always'}\n style={[\n styles.scrollView,\n {\n maxHeight,\n backgroundColor: colors.background,\n bottom: keyboard.bottomSpace,\n },\n canRenderMembers && {\n borderTopWidth: 1,\n borderTopColor: colors.onBackground04,\n },\n ]}\n contentContainerStyle={safeArea}\n >\n {conditionChaining([searchLimited, canRenderMembers], [renderLimitGuide(), renderMembers(), null])}\n </ScrollView>\n </Pressable>\n );\n};\n\nconst styles = createStyleSheet({\n suggestion: {\n height: 196,\n },\n container: {\n position: 'absolute',\n top: 0,\n start: 0,\n end: 0,\n },\n scrollView: {\n position: 'absolute',\n start: 0,\n end: 0,\n },\n userContainer: {\n paddingStart: 16,\n flexDirection: 'row',\n height: 44,\n alignItems: 'center',\n justifyContent: 'center',\n },\n userAvatar: {\n marginEnd: 16,\n },\n userInfo: {\n flexDirection: 'row',\n flex: 1,\n },\n userNickname: {\n flexShrink: 1,\n lineHeight: 44,\n textAlignVertical: 'center',\n marginEnd: 6,\n },\n userId: {\n lineHeight: 44,\n textAlignVertical: 'center',\n minWidth: 32,\n flexShrink: 1,\n marginEnd: 16,\n },\n searchLimited: {\n borderTopWidth: 1,\n paddingHorizontal: 16,\n height: 44,\n flexDirection: 'row',\n alignItems: 'center',\n },\n});\nexport default GroupChannelThreadSuggestedMentionList;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,mBAAmB,QAAQ,cAAc;AAE/E,SACEC,MAAM,EACNC,OAAO,EACPC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,cAAc,EACdC,aAAa,QACR,yCAAyC;AAChD,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,uBAAuB;AAE7E,SAASC,eAAe,EAAEC,eAAe,QAAQ,2BAA2B;AAC5E,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,oBAAoB,MAAM,qCAAqC;AACtE,SAASC,0BAA0B,QAAQ,yBAAyB;AAGpE,MAAMC,sCAAsC,GAAGA,CAAC;EAC9CC,IAAI;EACJC,SAAS;EACTC,WAAW;EACXC,WAAW;EACXC,gBAAgB;EAChBC;AAC+C,CAAC,KAAK;EACrD,MAAM;IAAEC,KAAK,EAAEC,WAAW;IAAEC,MAAM,EAAEC;EAAa,CAAC,GAAGzB,mBAAmB,CAAC,CAAC;EAC1E,MAAM;IAAE0B;EAAQ,CAAC,GAAG9B,UAAU,CAACkB,0BAA0B,CAACa,QAAQ,CAAC;EACnE,MAAM;IAAEC,GAAG;IAAEC;EAAe,CAAC,GAAGlB,eAAe,CAAC,CAAC;EACjD,MAAM;IAAEmB;EAA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AAU;IACpBc,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE;EACP,CAAC;EACD5B,aAAa,EAAE;IACb6B,YAAY,EAAE,EAAE;IAChBC,aAAa,EAAE,KAAK;IACpB3E,MAAM,EAAE,EAAE;IACV4E,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACD7B,UAAU,EAAE;IACVjB,SAAS,EAAE;EACb,CAAC;EACDkB,QAAQ,EAAE;IACR0B,aAAa,EAAE,KAAK;IACpBG,IAAI,EAAE;EACR,CAAC;EACDzB,YAAY,EAAE;IACZ0B,UAAU,EAAE,CAAC;IACbC,UAAU,EAAE,EAAE;IACdC,iBAAiB,EAAE,QAAQ;IAC3BlD,SAAS,EAAE;EACb,CAAC;EACDa,MAAM,EAAE;IACNoC,UAAU,EAAE,EAAE;IACdC,iBAAiB,EAAE,QAAQ;IAC3BC,QAAQ,EAAE,EAAE;IACZH,UAAU,EAAE,CAAC;IACbhD,SAAS,EAAE;EACb,CAAC;EACDjB,aAAa,EAAE;IACbuD,cAAc,EAAE,CAAC;IACjBc,iBAAiB,EAAE,EAAE;IACrBnF,MAAM,EAAE,EAAE;IACV2E,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AACF,eAAerF,sCAAsC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useContext","Pressable","ScrollView","View","useWindowDimensions","Avatar","Divider","Icon","Text","createStyleSheet","useHeaderStyle","useUIKitTheme","conditionChaining","useSafeAreaPadding","useLocalization","useSendbirdChat","useKeyboardStatus","useMentionSuggestion","GroupChannelThreadContexts","GroupChannelThreadSuggestedMentionList","text","selection","inputHeight","bottomInset","onPressToMention","mentionedUsers","showUserId","width","screenWidth","height","screenHeight","channel","Fragment","sdk","mentionManager","STRINGS","colors","topInset","safeArea","keyboard","members","reset","searchStringRange","searchLimited","isLandscape","isShortened","visible","canRenderMembers","length","maxHeight","styles","suggestion","renderLimitGuide","createElement","style","borderTopColor","onBackground04","icon","size","containerStyle","marginEnd","color","onBackground02","body3","GROUP_CHANNEL_THREAD","MENTION_LIMITED","config","mentionLimit","renderMembers","map","member","onPress","key","userId","userContainer","uri","profileUrl","userAvatar","userInfo","body2","onBackground01","numberOfLines","userNickname","nickname","LABELS","USER_NO_NAME","onBackground03","position","bottom","pointerEvents","container","bounces","keyboardDismissMode","keyboardShouldPersistTaps","scrollView","backgroundColor","background","bottomSpace","borderTopWidth","contentContainerStyle","top","start","end","paddingStart","flexDirection","alignItems","justifyContent","flex","flexShrink","lineHeight","textAlignVertical","minWidth","paddingHorizontal"],"sources":["GroupChannelThreadSuggestedMentionList.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { Pressable, ScrollView, View, useWindowDimensions } from 'react-native';\n\nimport {\n Avatar,\n Divider,\n Icon,\n Text,\n createStyleSheet,\n useHeaderStyle,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport { conditionChaining, useSafeAreaPadding } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport useKeyboardStatus from '../../../hooks/useKeyboardStatus';\nimport useMentionSuggestion from '../../../hooks/useMentionSuggestion';\nimport { GroupChannelThreadContexts } from '../module/moduleContext';\nimport type { GroupChannelThreadProps } from '../types';\n\nconst GroupChannelThreadSuggestedMentionList = ({\n text,\n selection,\n inputHeight,\n bottomInset,\n onPressToMention,\n mentionedUsers,\n showUserId = true,\n}: GroupChannelThreadProps['SuggestedMentionList']) => {\n const { width: screenWidth, height: screenHeight } = useWindowDimensions();\n const { channel } = useContext(GroupChannelThreadContexts.Fragment);\n const { sdk, mentionManager } = useSendbirdChat();\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n const { topInset } = useHeaderStyle();\n const safeArea = useSafeAreaPadding(['left', 'right']);\n\n const keyboard = useKeyboardStatus();\n\n const { members, reset, searchStringRange, searchLimited } = useMentionSuggestion({\n sdk,\n text,\n selection,\n channel,\n mentionedUsers,\n });\n\n const isLandscape = screenWidth > screenHeight;\n const isShortened = isLandscape && keyboard.visible;\n const canRenderMembers = members.length > 0;\n const maxHeight = isShortened ? screenHeight - (topInset + inputHeight + keyboard.height) : styles.suggestion.height;\n\n const renderLimitGuide = () => {\n return (\n <View style={[styles.searchLimited, { borderTopColor: colors.onBackground04 }]}>\n <Icon icon={'info'} size={20} containerStyle={{ marginEnd: 4 }} color={colors.onBackground02} />\n <Text body3 color={colors.onBackground02}>\n {STRINGS.GROUP_CHANNEL_THREAD.MENTION_LIMITED(mentionManager.config.mentionLimit)}\n </Text>\n </View>\n );\n };\n\n const renderMembers = () => {\n return (\n <View>\n {members.map((member) => {\n return (\n <Pressable\n onPress={() => {\n onPressToMention(member, searchStringRange);\n reset();\n }}\n key={member.userId}\n style={styles.userContainer}\n >\n <Avatar size={28} uri={member.profileUrl} containerStyle={styles.userAvatar} />\n <View style={styles.userInfo}>\n <Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>\n {member.nickname || STRINGS.LABELS.USER_NO_NAME}\n </Text>\n {!!showUserId && (\n <Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>\n {member.userId}\n </Text>\n )}\n <Divider style={{ position: 'absolute', bottom: 0 }} />\n </View>\n </Pressable>\n );\n })}\n </View>\n );\n };\n\n return (\n <Pressable\n onPress={reset}\n pointerEvents={canRenderMembers ? 'auto' : 'none'}\n style={[styles.container, { bottom: inputHeight + bottomInset }]}\n >\n <ScrollView\n bounces={false}\n keyboardDismissMode={'none'}\n keyboardShouldPersistTaps={'always'}\n style={[\n styles.scrollView,\n {\n maxHeight,\n backgroundColor: colors.background,\n bottom: keyboard.bottomSpace,\n },\n canRenderMembers && {\n borderTopWidth: 1,\n borderTopColor: colors.onBackground04,\n },\n ]}\n contentContainerStyle={safeArea}\n >\n {conditionChaining([searchLimited, canRenderMembers], [renderLimitGuide(), renderMembers(), null])}\n </ScrollView>\n </Pressable>\n );\n};\n\nconst styles = createStyleSheet({\n suggestion: {\n height: 196,\n },\n container: {\n position: 'absolute',\n top: 0,\n start: 0,\n end: 0,\n },\n scrollView: {\n position: 'absolute',\n start: 0,\n end: 0,\n },\n userContainer: {\n paddingStart: 16,\n flexDirection: 'row',\n height: 44,\n alignItems: 'center',\n justifyContent: 'center',\n },\n userAvatar: {\n marginEnd: 16,\n },\n userInfo: {\n flexDirection: 'row',\n flex: 1,\n },\n userNickname: {\n flexShrink: 1,\n lineHeight: 44,\n textAlignVertical: 'center',\n marginEnd: 6,\n },\n userId: {\n lineHeight: 44,\n textAlignVertical: 'center',\n minWidth: 32,\n flexShrink: 1,\n marginEnd: 16,\n },\n searchLimited: {\n borderTopWidth: 1,\n paddingHorizontal: 16,\n height: 44,\n flexDirection: 'row',\n alignItems: 'center',\n },\n});\nexport default GroupChannelThreadSuggestedMentionList;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,mBAAmB,QAAQ,cAAc;AAE/E,SACEC,MAAM,EACNC,OAAO,EACPC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,cAAc,EACdC,aAAa,QACR,yCAAyC;AAChD,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,uBAAuB;AAE7E,SAASC,eAAe,EAAEC,eAAe,QAAQ,2BAA2B;AAC5E,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,oBAAoB,MAAM,qCAAqC;AACtE,SAASC,0BAA0B,QAAQ,yBAAyB;AAGpE,MAAMC,sCAAsC,GAAGA,CAAC;EAC9CC,IAAI;EACJC,SAAS;EACTC,WAAW;EACXC,WAAW;EACXC,gBAAgB;EAChBC,cAAc;EACdC,UAAU,GAAG;AACkC,CAAC,KAAK;EACrD,MAAM;IAAEC,KAAK,EAAEC,WAAW;IAAEC,MAAM,EAAEC;EAAa,CAAC,GAAG1B,mBAAmB,CAAC,CAAC;EAC1E,MAAM;I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,MAAM,EAAE;EACV,CAAC;EACD6D,SAAS,EAAE;IACTH,QAAQ,EAAE,UAAU;IACpBa,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE;EACP,CAAC;EACDR,UAAU,EAAE;IACVP,QAAQ,EAAE,UAAU;IACpBc,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE;EACP,CAAC;EACD5B,aAAa,EAAE;IACb6B,YAAY,EAAE,EAAE;IAChBC,aAAa,EAAE,KAAK;IACpB3E,MAAM,EAAE,EAAE;IACV4E,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACD7B,UAAU,EAAE;IACVjB,SAAS,EAAE;EACb,CAAC;EACDkB,QAAQ,EAAE;IACR0B,aAAa,EAAE,KAAK;IACpBG,IAAI,EAAE;EACR,CAAC;EACDzB,YAAY,EAAE;IACZ0B,UAAU,EAAE,CAAC;IACbC,UAAU,EAAE,EAAE;IACdC,iBAAiB,EAAE,QAAQ;IAC3BlD,SAAS,EAAE;EACb,CAAC;EACDa,MAAM,EAAE;IACNoC,UAAU,EAAE,EAAE;IACdC,iBAAiB,EAAE,QAAQ;IAC3BC,QAAQ,EAAE,EAAE;IACZH,UAAU,EAAE,CAAC;IACbhD,SAAS,EAAE;EACb,CAAC;EACDjB,aAAa,EAAE;IACbuD,cAAc,EAAE,CAAC;IACjBc,iBAAiB,EAAE,EAAE;IACrBnF,MAAM,EAAE,EAAE;IACV2E,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AACF,eAAetF,sCAAsC","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
+
import { Icon } from '@sendbird/uikit-react-native-foundation';
|
|
4
5
|
import InternalLocalCacheStorage from './InternalLocalCacheStorage';
|
|
5
6
|
class MemoryStorage {
|
|
6
7
|
constructor() {
|
|
@@ -62,6 +63,11 @@ class EmojiManager {
|
|
|
62
63
|
get allEmoji() {
|
|
63
64
|
return this._allEmoji;
|
|
64
65
|
}
|
|
66
|
+
getEmojiIconSource(emoji) {
|
|
67
|
+
return emoji !== null && emoji !== void 0 && emoji.url ? {
|
|
68
|
+
uri: emoji.url
|
|
69
|
+
} : Icon.Assets.question;
|
|
70
|
+
}
|
|
65
71
|
get emojiHash() {
|
|
66
72
|
var _this$emojiStorage$co;
|
|
67
73
|
return (_this$emojiStorage$co = this.emojiStorage.container) === null || _this$emojiStorage$co === void 0 ? void 0 : _this$emojiStorage$co.emojiHash;
|