@sendbird/uikit-react-native 1.0.2 → 1.1.0
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/README.md +7 -7
- package/lib/commonjs/SendbirdUIKitContainer.js +5 -2
- package/lib/commonjs/SendbirdUIKitContainer.js.map +1 -1
- package/lib/commonjs/components/FileViewer.js +326 -0
- package/lib/commonjs/components/FileViewer.js.map +1 -0
- package/lib/commonjs/components/GroupChannelPreviewContainer.js +180 -0
- package/lib/commonjs/components/GroupChannelPreviewContainer.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js +116 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/index.js +8 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/index.js.map +1 -1
- package/lib/commonjs/components/MessageRenderer/MessageOutgoingStatus.js +15 -24
- package/lib/commonjs/components/MessageRenderer/MessageOutgoingStatus.js.map +1 -1
- package/lib/commonjs/components/SBUPressable.js +45 -0
- package/lib/commonjs/components/SBUPressable.js.map +1 -0
- package/lib/commonjs/components/UserActionBar.js +1 -3
- package/lib/commonjs/components/UserActionBar.js.map +1 -1
- package/lib/commonjs/components/UserSelectableBar.js +1 -3
- package/lib/commonjs/components/UserSelectableBar.js.map +1 -1
- package/lib/commonjs/constants.js +7 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/contexts/PlatformService.js +4 -2
- package/lib/commonjs/contexts/PlatformService.js.map +1 -1
- package/lib/commonjs/contexts/SendbirdChat.js +6 -2
- package/lib/commonjs/contexts/SendbirdChat.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +30 -7
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js +2 -3
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelList/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js +1 -1
- package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelCreateFragment.js +3 -7
- package/lib/commonjs/fragments/createGroupChannelCreateFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelFragment.js +13 -11
- package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelListFragment.js +7 -37
- package/lib/commonjs/fragments/createGroupChannelListFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelMembersFragment.js +1 -1
- package/lib/commonjs/fragments/createGroupChannelMembersFragment.js.map +1 -1
- package/lib/commonjs/hooks/useContext.js.map +1 -1
- package/lib/commonjs/index.js +29 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/localization/StringSet.type.js +8 -0
- package/lib/commonjs/localization/StringSet.type.js.map +1 -1
- package/lib/commonjs/platform/createFileService.expo.js +21 -2
- package/lib/commonjs/platform/createFileService.expo.js.map +1 -1
- package/lib/commonjs/platform/createFileService.native.js +20 -3
- package/lib/commonjs/platform/createFileService.native.js.map +1 -1
- package/lib/commonjs/platform/createMediaService.expo.js +64 -0
- package/lib/commonjs/platform/createMediaService.expo.js.map +1 -0
- package/lib/commonjs/platform/createMediaService.native.js +67 -0
- package/lib/commonjs/platform/createMediaService.native.js.map +1 -0
- package/lib/commonjs/platform/createNotificationService.expo.js.map +1 -1
- package/lib/commonjs/platform/types.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/SendbirdUIKitContainer.js +5 -2
- package/lib/module/SendbirdUIKitContainer.js.map +1 -1
- package/lib/module/components/FileViewer.js +304 -0
- package/lib/module/components/FileViewer.js.map +1 -0
- package/lib/module/components/GroupChannelPreviewContainer.js +158 -0
- package/lib/module/components/GroupChannelPreviewContainer.js.map +1 -0
- package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js +100 -0
- package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -0
- package/lib/module/components/MessageRenderer/FileMessage/index.js +6 -0
- package/lib/module/components/MessageRenderer/FileMessage/index.js.map +1 -1
- package/lib/module/components/MessageRenderer/MessageOutgoingStatus.js +17 -26
- package/lib/module/components/MessageRenderer/MessageOutgoingStatus.js.map +1 -1
- package/lib/module/components/SBUPressable.js +33 -0
- package/lib/module/components/SBUPressable.js.map +1 -0
- package/lib/module/components/UserActionBar.js +1 -1
- package/lib/module/components/UserActionBar.js.map +1 -1
- package/lib/module/components/UserSelectableBar.js +1 -1
- package/lib/module/components/UserSelectableBar.js.map +1 -1
- package/lib/module/constants.js +5 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/contexts/PlatformService.js +4 -2
- package/lib/module/contexts/PlatformService.js.map +1 -1
- package/lib/module/contexts/SendbirdChat.js +6 -2
- package/lib/module/contexts/SendbirdChat.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +28 -7
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/module/domain/groupChannel/module/moduleContext.js +2 -3
- package/lib/module/domain/groupChannel/module/moduleContext.js.map +1 -1
- package/lib/module/domain/groupChannel/types.js.map +1 -1
- package/lib/module/domain/groupChannelList/types.js.map +1 -1
- package/lib/module/domain/groupChannelSettings/module/moduleContext.js +1 -1
- package/lib/module/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
- package/lib/module/fragments/createGroupChannelCreateFragment.js +4 -4
- package/lib/module/fragments/createGroupChannelCreateFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelFragment.js +15 -13
- package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelListFragment.js +11 -38
- package/lib/module/fragments/createGroupChannelListFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelMembersFragment.js +1 -1
- package/lib/module/fragments/createGroupChannelMembersFragment.js.map +1 -1
- package/lib/module/hooks/useContext.js.map +1 -1
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/localization/StringSet.type.js +8 -0
- package/lib/module/localization/StringSet.type.js.map +1 -1
- package/lib/module/platform/createFileService.expo.js +21 -2
- package/lib/module/platform/createFileService.expo.js.map +1 -1
- package/lib/module/platform/createFileService.native.js +20 -3
- package/lib/module/platform/createFileService.native.js.map +1 -1
- package/lib/module/platform/createMediaService.expo.js +54 -0
- package/lib/module/platform/createMediaService.expo.js.map +1 -0
- package/lib/module/platform/createMediaService.native.js +57 -0
- package/lib/module/platform/createMediaService.native.js.map +1 -0
- package/lib/module/platform/createNotificationService.expo.js.map +1 -1
- package/lib/module/platform/types.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/SendbirdUIKitContainer.d.ts +7 -3
- package/lib/typescript/src/components/FileViewer.d.ts +12 -0
- package/lib/typescript/src/components/GroupChannelPreviewContainer.d.ts +8 -0
- package/lib/typescript/src/components/MessageRenderer/FileMessage/VideoFileMessage.d.ts +3 -0
- package/lib/typescript/src/components/SBUPressable.d.ts +18 -0
- package/lib/typescript/src/components/UserActionBar.d.ts +2 -3
- package/lib/typescript/src/components/UserSelectableBar.d.ts +2 -3
- package/lib/typescript/src/constants.d.ts +5 -0
- package/lib/typescript/src/contexts/PlatformService.d.ts +3 -2
- package/lib/typescript/src/contexts/SendbirdChat.d.ts +5 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelMessageList.d.ts +3 -2
- package/lib/typescript/src/domain/groupChannel/types.d.ts +6 -2
- package/lib/typescript/src/hooks/useContext.d.ts +7 -5
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/localization/StringSet.type.d.ts +4 -0
- package/lib/typescript/src/platform/createMediaService.expo.d.ts +9 -0
- package/lib/typescript/src/platform/createMediaService.native.d.ts +9 -0
- package/lib/typescript/src/platform/createNotificationService.expo.d.ts +1 -1
- package/lib/typescript/src/platform/types.d.ts +20 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +14 -5
- package/src/SendbirdUIKitContainer.tsx +14 -2
- package/src/components/FileViewer.tsx +284 -0
- package/src/components/GroupChannelPreviewContainer.tsx +134 -0
- package/src/components/MessageRenderer/FileMessage/VideoFileMessage.tsx +91 -0
- package/src/components/MessageRenderer/FileMessage/index.tsx +6 -0
- package/src/components/MessageRenderer/MessageOutgoingStatus.tsx +25 -32
- package/src/components/SBUPressable.tsx +40 -0
- package/src/components/UserActionBar.tsx +1 -1
- package/src/components/UserSelectableBar.tsx +1 -1
- package/src/constants.ts +5 -0
- package/src/contexts/PlatformService.tsx +15 -3
- package/src/contexts/SendbirdChat.tsx +13 -5
- package/src/domain/groupChannel/component/GroupChannelInput/SendInput.tsx +1 -1
- package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +23 -6
- package/src/domain/groupChannel/module/moduleContext.tsx +6 -13
- package/src/domain/groupChannel/types.ts +8 -2
- package/src/domain/groupChannelList/types.ts +1 -0
- package/src/domain/groupChannelSettings/module/moduleContext.tsx +5 -10
- package/src/fragments/createGroupChannelCreateFragment.tsx +38 -41
- package/src/fragments/createGroupChannelFragment.tsx +23 -33
- package/src/fragments/createGroupChannelListFragment.tsx +10 -32
- package/src/fragments/createGroupChannelMembersFragment.tsx +34 -39
- package/src/hooks/useContext.ts +3 -5
- package/src/index.ts +5 -1
- package/src/localization/StringSet.type.ts +8 -0
- package/src/platform/createFileService.expo.ts +17 -2
- package/src/platform/createFileService.native.ts +16 -3
- package/src/platform/createMediaService.expo.tsx +30 -0
- package/src/platform/createMediaService.native.tsx +37 -0
- package/src/platform/createNotificationService.expo.ts +1 -1
- package/src/platform/types.ts +26 -1
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getFileExtension","getFileType","BaseFileMessage","ImageFileMessage","FileMessage","props","fileType","message","type","name","memo"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SendbirdFileMessage, getFileExtension, getFileType } from '@sendbird/uikit-utils';\n\nimport type { MessageRendererInterface } from '../index';\nimport BaseFileMessage from './BaseFileMessage';\nimport ImageFileMessage from './ImageFileMessage';\n\nexport type FileMessageProps = MessageRendererInterface<SendbirdFileMessage>;\nconst FileMessage = (props: FileMessageProps) => {\n const fileType = getFileType(props.message.type || getFileExtension(props.message.name));\n\n if (fileType === 'image') return <ImageFileMessage {...props} />;\n return <BaseFileMessage {...props} type={fileType} />;\n};\n\nexport default React.memo(FileMessage);\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAA8BC,gBAA9B,EAAgDC,WAAhD,QAAmE,uBAAnE;
|
|
1
|
+
{"version":3,"names":["React","getFileExtension","getFileType","usePlatformService","BaseFileMessage","ImageFileMessage","VideoFileMessage","FileMessage","props","mediaService","fileType","message","type","name","getVideoThumbnail","memo"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SendbirdFileMessage, getFileExtension, getFileType } from '@sendbird/uikit-utils';\n\nimport { usePlatformService } from '../../../hooks/useContext';\nimport type { MessageRendererInterface } from '../index';\nimport BaseFileMessage from './BaseFileMessage';\nimport ImageFileMessage from './ImageFileMessage';\nimport VideoFileMessage from './VideoFileMessage';\n\nexport type FileMessageProps = MessageRendererInterface<SendbirdFileMessage>;\nconst FileMessage = (props: FileMessageProps) => {\n const { mediaService } = usePlatformService();\n\n const fileType = getFileType(props.message.type || getFileExtension(props.message.name));\n\n if (fileType === 'image') return <ImageFileMessage {...props} />;\n if (fileType === 'video' && mediaService?.getVideoThumbnail) return <VideoFileMessage {...props} />;\n\n return <BaseFileMessage {...props} type={fileType} />;\n};\n\nexport default React.memo(FileMessage);\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAA8BC,gBAA9B,EAAgDC,WAAhD,QAAmE,uBAAnE;AAEA,SAASC,kBAAT,QAAmC,2BAAnC;AAEA,OAAOC,eAAP,MAA4B,mBAA5B;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;;AAGA,MAAMC,WAAW,GAAIC,KAAD,IAA6B;EAC/C,MAAM;IAAEC;EAAF,IAAmBN,kBAAkB,EAA3C;EAEA,MAAMO,QAAQ,GAAGR,WAAW,CAACM,KAAK,CAACG,OAAN,CAAcC,IAAd,IAAsBX,gBAAgB,CAACO,KAAK,CAACG,OAAN,CAAcE,IAAf,CAAvC,CAA5B;EAEA,IAAIH,QAAQ,KAAK,OAAjB,EAA0B,oBAAO,oBAAC,gBAAD,EAAsBF,KAAtB,CAAP;EAC1B,IAAIE,QAAQ,KAAK,OAAb,IAAwBD,YAAxB,aAAwBA,YAAxB,eAAwBA,YAAY,CAAEK,iBAA1C,EAA6D,oBAAO,oBAAC,gBAAD,EAAsBN,KAAtB,CAAP;EAE7D,oBAAO,oBAAC,eAAD,eAAqBA,KAArB;IAA4B,IAAI,EAAEE;EAAlC,GAAP;AACD,CATD;;AAWA,4BAAeV,KAAK,CAACe,IAAN,CAAWR,WAAX,CAAf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { useEffect
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import { Icon, LoadingSpinner, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
3
|
-
import { useUniqId } from '@sendbird/uikit-utils';
|
|
3
|
+
import { isDifferentChannel, useForceUpdate, useUniqId } from '@sendbird/uikit-utils';
|
|
4
4
|
import { useSendbirdChat } from '../../hooks/useContext';
|
|
5
5
|
const SIZE = 16;
|
|
6
6
|
|
|
@@ -10,7 +10,6 @@ const MessageOutgoingStatus = _ref => {
|
|
|
10
10
|
message
|
|
11
11
|
} = _ref;
|
|
12
12
|
if (!message.isUserMessage() && !message.isFileMessage()) return null;
|
|
13
|
-
const handlerId = useUniqId('MessageOutgoingStatus');
|
|
14
13
|
const {
|
|
15
14
|
sdk,
|
|
16
15
|
features
|
|
@@ -18,41 +17,33 @@ const MessageOutgoingStatus = _ref => {
|
|
|
18
17
|
const {
|
|
19
18
|
colors
|
|
20
19
|
} = useUIKitTheme();
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
undeliveredCount: channel.getUndeliveredMemberCount(message)
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
|
-
const getCounts = (channel, message) => {
|
|
27
|
-
return {
|
|
28
|
-
unreadCount: channel.getUnreadMemberCount(message),
|
|
29
|
-
undeliveredCount: channel.getUndeliveredMemberCount(message)
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
20
|
+
const uniqId = useUniqId('MessageOutgoingStatus');
|
|
21
|
+
const forceUpdate = useForceUpdate();
|
|
33
22
|
useEffect(() => {
|
|
34
|
-
const
|
|
23
|
+
const handlerId = `MessageOutgoingStatus_${uniqId}`;
|
|
35
24
|
|
|
36
|
-
if (message.sendingStatus === 'succeeded' &&
|
|
37
|
-
sdk.removeChannelHandler(
|
|
25
|
+
if (message.sendingStatus === 'succeeded' && channel.getUnreadMemberCount(message) === 0 && channel.getUndeliveredMemberCount(message) === 0) {
|
|
26
|
+
sdk.removeChannelHandler(handlerId);
|
|
38
27
|
} else {
|
|
39
28
|
const handler = new sdk.ChannelHandler();
|
|
40
29
|
|
|
41
|
-
handler.onReadReceiptUpdated =
|
|
42
|
-
if (
|
|
30
|
+
handler.onReadReceiptUpdated = eventChannel => {
|
|
31
|
+
if (isDifferentChannel(channel, eventChannel)) return;
|
|
32
|
+
forceUpdate();
|
|
43
33
|
};
|
|
44
34
|
|
|
45
35
|
if (features.deliveryReceiptEnabled) {
|
|
46
|
-
handler.onDeliveryReceiptUpdated =
|
|
47
|
-
if (
|
|
36
|
+
handler.onDeliveryReceiptUpdated = eventChannel => {
|
|
37
|
+
if (isDifferentChannel(channel, eventChannel)) return;
|
|
38
|
+
forceUpdate();
|
|
48
39
|
};
|
|
49
40
|
}
|
|
50
41
|
|
|
51
|
-
sdk.addChannelHandler(
|
|
42
|
+
sdk.addChannelHandler(handlerId, handler);
|
|
52
43
|
}
|
|
53
44
|
|
|
54
45
|
return () => {
|
|
55
|
-
sdk.removeChannelHandler(
|
|
46
|
+
sdk.removeChannelHandler(handlerId);
|
|
56
47
|
};
|
|
57
48
|
}, [message.sendingStatus]);
|
|
58
49
|
|
|
@@ -72,7 +63,7 @@ const MessageOutgoingStatus = _ref => {
|
|
|
72
63
|
});
|
|
73
64
|
}
|
|
74
65
|
|
|
75
|
-
if (
|
|
66
|
+
if (channel.getUnreadMemberCount(message) === 0) {
|
|
76
67
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
77
68
|
icon: 'done-all',
|
|
78
69
|
size: SIZE,
|
|
@@ -82,7 +73,7 @@ const MessageOutgoingStatus = _ref => {
|
|
|
82
73
|
}
|
|
83
74
|
|
|
84
75
|
if (features.deliveryReceiptEnabled) {
|
|
85
|
-
if (
|
|
76
|
+
if (channel.getUndeliveredMemberCount(message) === 0) {
|
|
86
77
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
87
78
|
icon: 'done-all',
|
|
88
79
|
size: SIZE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","
|
|
1
|
+
{"version":3,"names":["React","useEffect","Icon","LoadingSpinner","createStyleSheet","useUIKitTheme","isDifferentChannel","useForceUpdate","useUniqId","useSendbirdChat","SIZE","MessageOutgoingStatus","channel","message","isUserMessage","isFileMessage","sdk","features","colors","uniqId","forceUpdate","handlerId","sendingStatus","getUnreadMemberCount","getUndeliveredMemberCount","removeChannelHandler","handler","ChannelHandler","onReadReceiptUpdated","eventChannel","deliveryReceiptEnabled","onDeliveryReceiptUpdated","addChannelHandler","styles","container","error","secondary","onBackground03","marginRight","memo"],"sources":["MessageOutgoingStatus.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\nimport { Icon, LoadingSpinner, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdGroupChannel, SendbirdMessage } from '@sendbird/uikit-utils';\nimport { isDifferentChannel, useForceUpdate, useUniqId } from '@sendbird/uikit-utils';\n\nimport { useSendbirdChat } from '../../hooks/useContext';\n\nconst SIZE = 16;\n\ntype Props = { channel: SendbirdGroupChannel; message: SendbirdMessage };\nconst MessageOutgoingStatus = ({ channel, message }: Props) => {\n if (!message.isUserMessage() && !message.isFileMessage()) return null;\n\n const { sdk, features } = useSendbirdChat();\n const { colors } = useUIKitTheme();\n\n const uniqId = useUniqId('MessageOutgoingStatus');\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n const handlerId = `MessageOutgoingStatus_${uniqId}`;\n\n if (\n message.sendingStatus === 'succeeded' &&\n channel.getUnreadMemberCount(message) === 0 &&\n channel.getUndeliveredMemberCount(message) === 0\n ) {\n sdk.removeChannelHandler(handlerId);\n } else {\n const handler = new sdk.ChannelHandler();\n\n handler.onReadReceiptUpdated = (eventChannel) => {\n if (isDifferentChannel(channel, eventChannel)) return;\n forceUpdate();\n };\n\n if (features.deliveryReceiptEnabled) {\n handler.onDeliveryReceiptUpdated = (eventChannel) => {\n if (isDifferentChannel(channel, eventChannel)) return;\n forceUpdate();\n };\n }\n\n sdk.addChannelHandler(handlerId, handler);\n }\n\n return () => {\n sdk.removeChannelHandler(handlerId);\n };\n }, [message.sendingStatus]);\n\n if (message.sendingStatus === 'pending') {\n return <LoadingSpinner size={SIZE} style={styles.container} />;\n }\n\n if (message.sendingStatus === 'failed') {\n return <Icon icon={'error'} size={SIZE} color={colors.error} style={styles.container} />;\n }\n\n if (channel.getUnreadMemberCount(message) === 0) {\n return <Icon icon={'done-all'} size={SIZE} color={colors.secondary} style={styles.container} />;\n }\n\n if (features.deliveryReceiptEnabled) {\n if (channel.getUndeliveredMemberCount(message) === 0) {\n return <Icon icon={'done-all'} size={SIZE} color={colors.onBackground03} style={styles.container} />;\n }\n return <Icon icon={'done'} size={SIZE} color={colors.onBackground03} style={styles.container} />;\n }\n\n return <Icon icon={'done-all'} size={SIZE} color={colors.onBackground03} style={styles.container} />;\n};\n\nconst styles = createStyleSheet({\n container: {\n marginRight: 4,\n },\n});\n\nexport default React.memo(MessageOutgoingStatus);\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AAEA,SAASC,IAAT,EAAeC,cAAf,EAA+BC,gBAA/B,EAAiDC,aAAjD,QAAsE,yCAAtE;AAEA,SAASC,kBAAT,EAA6BC,cAA7B,EAA6CC,SAA7C,QAA8D,uBAA9D;AAEA,SAASC,eAAT,QAAgC,wBAAhC;AAEA,MAAMC,IAAI,GAAG,EAAb;;AAGA,MAAMC,qBAAqB,GAAG,QAAiC;EAAA,IAAhC;IAAEC,OAAF;IAAWC;EAAX,CAAgC;EAC7D,IAAI,CAACA,OAAO,CAACC,aAAR,EAAD,IAA4B,CAACD,OAAO,CAACE,aAAR,EAAjC,EAA0D,OAAO,IAAP;EAE1D,MAAM;IAAEC,GAAF;IAAOC;EAAP,IAAoBR,eAAe,EAAzC;EACA,MAAM;IAAES;EAAF,IAAab,aAAa,EAAhC;EAEA,MAAMc,MAAM,GAAGX,SAAS,CAAC,uBAAD,CAAxB;EACA,MAAMY,WAAW,GAAGb,cAAc,EAAlC;EAEAN,SAAS,CAAC,MAAM;IACd,MAAMoB,SAAS,GAAI,yBAAwBF,MAAO,EAAlD;;IAEA,IACEN,OAAO,CAACS,aAAR,KAA0B,WAA1B,IACAV,OAAO,CAACW,oBAAR,CAA6BV,OAA7B,MA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B,IAAI,EAAEH,IAA9B;MAAoC,KAAK,EAAEQ,MAAM,CAACkB,SAAlD;MAA6D,KAAK,EAAEH,MAAM,CAACC;IAA3E,EAAP;EACD;;EAED,IAAIjB,QAAQ,CAACa,sBAAb,EAAqC;IACnC,IAAIlB,OAAO,CAACY,yBAAR,CAAkCX,OAAlC,MAA+C,CAAnD,EAAsD;MACpD,oBAAO,oBAAC,IAAD;QAAM,IAAI,EAAE,UAAZ;QAAwB,IAAI,EAAEH,IAA9B;QAAoC,KAAK,EAAEQ,MAAM,CAACmB,cAAlD;QAAkE,KAAK,EAAEJ,MAAM,CAACC;MAAhF,EAAP;IACD;;IACD,oBAAO,oBAAC,IAAD;MAAM,IAAI,EAAE,MAAZ;MAAoB,IAAI,EAAExB,IAA1B;MAAgC,KAAK,EAAEQ,MAAM,CAACmB,cAA9C;MAA8D,KAAK,EAAEJ,MAAM,CAACC;IAA5E,EAAP;EACD;;EAED,oBAAO,oBAAC,IAAD;IAAM,IAAI,EAAE,UAAZ;IAAwB,IAAI,EAAExB,IAA9B;IAAoC,KAAK,EAAEQ,MAAM,CAACmB,cAAlD;IAAkE,KAAK,EAAEJ,MAAM,CAACC;EAAhF,EAAP;AACD,CA7DD;;AA+DA,MAAMD,MAAM,GAAG7B,gBAAgB,CAAC;EAC9B8B,SAAS,EAAE;IACTI,WAAW,EAAE;EADJ;AADmB,CAAD,CAA/B;AAMA,4BAAetC,KAAK,CAACuC,IAAN,CAAW5B,qBAAX,CAAf"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Pressable, TouchableOpacity } from 'react-native';
|
|
5
|
+
import { DEFAULT_LONG_PRESS_DELAY } from '../constants';
|
|
6
|
+
|
|
7
|
+
function getComponent(as) {
|
|
8
|
+
switch (as) {
|
|
9
|
+
case 'Pressable':
|
|
10
|
+
return Pressable;
|
|
11
|
+
|
|
12
|
+
case 'TouchableOpacity':
|
|
13
|
+
return TouchableOpacity;
|
|
14
|
+
|
|
15
|
+
default:
|
|
16
|
+
return Pressable;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const SBUPressable = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
as,
|
|
23
|
+
...props
|
|
24
|
+
} = _ref;
|
|
25
|
+
const Renderer = getComponent(as); // @ts-ignore
|
|
26
|
+
|
|
27
|
+
return /*#__PURE__*/React.createElement(Renderer, _extends({
|
|
28
|
+
delayLongPress: DEFAULT_LONG_PRESS_DELAY
|
|
29
|
+
}, props));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default SBUPressable;
|
|
33
|
+
//# sourceMappingURL=SBUPressable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Pressable","TouchableOpacity","DEFAULT_LONG_PRESS_DELAY","getComponent","as","SBUPressable","props","Renderer"],"sources":["SBUPressable.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable, PressableProps, TouchableOpacity, TouchableOpacityProps } from 'react-native';\n\nimport { DEFAULT_LONG_PRESS_DELAY } from '../constants';\n\ntype Components = 'Pressable' | 'TouchableOpacity';\ntype Props<T extends Components = 'Pressable'> = {\n as?: T;\n} & ExtractProps<T, AsProps>;\n\ntype AsProps =\n | {\n type: 'Pressable';\n props: PressableProps;\n }\n | {\n type: 'TouchableOpacity';\n props: TouchableOpacityProps;\n };\n\ntype ExtractProps<T extends Components, U extends AsProps> = U extends { type: T; props: infer P } ? P : never;\n\nfunction getComponent(as?: Components) {\n switch (as) {\n case 'Pressable':\n return Pressable;\n case 'TouchableOpacity':\n return TouchableOpacity;\n default:\n return Pressable;\n }\n}\n\nconst SBUPressable = <T extends Components>({ as, ...props }: Props<T>) => {\n const Renderer = getComponent(as);\n // @ts-ignore\n return <Renderer delayLongPress={DEFAULT_LONG_PRESS_DELAY} {...props} />;\n};\n\nexport default SBUPressable;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAT,EAAoCC,gBAApC,QAAmF,cAAnF;AAEA,SAASC,wBAAT,QAAyC,cAAzC;;AAmBA,SAASC,YAAT,CAAsBC,EAAtB,EAAuC;EACrC,QAAQA,EAAR;IACE,KAAK,WAAL;MACE,OAAOJ,SAAP;;IACF,KAAK,kBAAL;MACE,OAAOC,gBAAP;;IACF;MACE,OAAOD,SAAP;EANJ;AAQD;;AAED,MAAMK,YAAY,GAAG,QAAsD;EAAA,IAA/B;IAAED,EAAF;IAAM,GAAGE;EAAT,CAA+B;EACzE,MAAMC,QAAQ,GAAGJ,YAAY,CAACC,EAAD,CAA7B,CADyE,CAEzE;;EACA,oBAAO,oBAAC,QAAD;IAAU,cAAc,EAAEF;EAA1B,GAAwDI,KAAxD,EAAP;AACD,CAJD;;AAMA,eAAeD,YAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","TouchableOpacity","View","Avatar","Icon","Text","createStyleSheet","useUIKitTheme","conditionChaining","UserActionBar","muted","uri","name","disabled","onPressActionMenu","label","colors","iconColor","onBackground04","onBackground01","styles","container","avatar","infoContainer","borderBottomColor","Boolean","onBackground02","iconContainer","flexDirection","alignItems","width","height","marginLeft","marginRight","flex","paddingRight","borderBottomWidth","padding"
|
|
1
|
+
{"version":3,"names":["React","TouchableOpacity","View","Avatar","Icon","Text","createStyleSheet","useUIKitTheme","conditionChaining","UserActionBar","muted","uri","name","disabled","onPressActionMenu","label","colors","iconColor","onBackground04","onBackground01","styles","container","avatar","infoContainer","borderBottomColor","Boolean","onBackground02","iconContainer","flexDirection","alignItems","width","height","marginLeft","marginRight","flex","paddingRight","borderBottomWidth","padding"],"sources":["UserActionBar.tsx"],"sourcesContent":["import React from 'react';\nimport { TouchableOpacity, View } from 'react-native';\n\nimport { Avatar, Icon, Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { conditionChaining } from '@sendbird/uikit-utils';\n\ntype Props = {\n uri: string;\n name: string;\n label?: string;\n muted: boolean;\n disabled: boolean;\n onPressActionMenu?: () => void;\n};\nconst UserActionBar = ({ muted, uri, name, disabled, onPressActionMenu, label }: Props) => {\n const { colors } = useUIKitTheme();\n\n const iconColor = conditionChaining([disabled], [colors.onBackground04, colors.onBackground01]);\n\n return (\n <View style={styles.container}>\n <Avatar muted={muted} size={36} uri={uri} containerStyle={styles.avatar} />\n <View style={[styles.infoContainer, { borderBottomColor: colors.onBackground04 }]}>\n <Text subtitle2 numberOfLines={1} style={styles.name} color={colors.onBackground01}>\n {name}\n </Text>\n {Boolean(label) && (\n <Text body2 color={colors.onBackground02} style={styles.label}>\n {label}\n </Text>\n )}\n {Boolean(onPressActionMenu) && (\n <TouchableOpacity onPress={onPressActionMenu} disabled={disabled}>\n <Icon color={iconColor} size={24} icon={'more'} containerStyle={styles.iconContainer} />\n </TouchableOpacity>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n flexDirection: 'row',\n alignItems: 'center',\n width: '100%',\n height: 56,\n },\n avatar: {\n marginLeft: 16,\n marginRight: 16,\n },\n label: {\n marginRight: 4,\n },\n infoContainer: {\n height: '100%',\n flex: 1,\n alignItems: 'center',\n flexDirection: 'row',\n paddingRight: 12,\n borderBottomWidth: 1,\n },\n iconContainer: {\n padding: 4,\n },\n name: {\n flex: 1,\n marginRight: 8,\n },\n});\n\nexport default UserActionBar;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,gBAAT,EAA2BC,IAA3B,QAAuC,cAAvC;AAEA,SAASC,MAAT,EAAiBC,IAAjB,EAAuBC,IAAvB,EAA6BC,gBAA7B,EAA+CC,aAA/C,QAAoE,yCAApE;AACA,SAASC,iBA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CAVJ,CAFF,CADF;AAoBD,CAzBD;;AA2BA,MAAMP,MAAM,GAAGd,gBAAgB,CAAC;EAC9Be,SAAS,EAAE;IACTO,aAAa,EAAE,KADN;IAETC,UAAU,EAAE,QAFH;IAGTC,KAAK,EAAE,MAHE;IAITC,MAAM,EAAE;EAJC,CADmB;EAO9BT,MAAM,EAAE;IACNU,UAAU,EAAE,EADN;IAENC,WAAW,EAAE;EAFP,CAPsB;EAW9BlB,KAAK,EAAE;IACLkB,WAAW,EAAE;EADR,CAXuB;EAc9BV,aAAa,EAAE;IACbQ,MAAM,EAAE,MADK;IAEbG,IAAI,EAAE,CAFO;IAGbL,UAAU,EAAE,QAHC;IAIbD,aAAa,EAAE,KAJF;IAKbO,YAAY,EAAE,EALD;IAMbC,iBAAiB,EAAE;EANN,CAde;EAsB9BT,aAAa,EAAE;IACbU,OAAO,EAAE;EADI,CAtBe;EAyB9BzB,IAAI,EAAE;IACJsB,IAAI,EAAE,CADF;IAEJD,WAAW,EAAE;EAFT;AAzBwB,CAAD,CAA/B;AA+BA,eAAexB,aAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Avatar","Icon","Text","createStyleSheet","useUIKitTheme","conditionChaining","UserSelectableBar","uri","name","selected","disabled","colors","iconColor","onBackground04","primary","onBackground03","styles","container","avatar","infoContainer","borderBottomColor","onBackground01","flexDirection","alignItems","width","height","paddingHorizontal","marginRight","flex","borderBottomWidth"
|
|
1
|
+
{"version":3,"names":["React","View","Avatar","Icon","Text","createStyleSheet","useUIKitTheme","conditionChaining","UserSelectableBar","uri","name","selected","disabled","colors","iconColor","onBackground04","primary","onBackground03","styles","container","avatar","infoContainer","borderBottomColor","onBackground01","flexDirection","alignItems","width","height","paddingHorizontal","marginRight","flex","borderBottomWidth"],"sources":["UserSelectableBar.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { Avatar, Icon, Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { conditionChaining } from '@sendbird/uikit-utils';\n\ntype Props = {\n uri: string;\n name: string;\n selected: boolean;\n disabled: boolean;\n};\nconst UserSelectableBar = ({ uri, name, selected, disabled }: Props) => {\n const { colors } = useUIKitTheme();\n\n const iconColor = conditionChaining(\n [disabled, selected],\n [colors.onBackground04, colors.primary, colors.onBackground03],\n );\n\n return (\n <View style={styles.container}>\n <Avatar size={36} uri={uri} containerStyle={styles.avatar} />\n <View style={[styles.infoContainer, { borderBottomColor: colors.onBackground04 }]}>\n <Text subtitle2 numberOfLines={1} style={styles.name} color={colors.onBackground01}>\n {name}\n </Text>\n <Icon color={iconColor} size={24} icon={selected ? 'checkbox-on' : 'checkbox-off'} />\n </View>\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n flexDirection: 'row',\n alignItems: 'center',\n width: '100%',\n height: 56,\n paddingHorizontal: 16,\n },\n avatar: {\n marginRight: 16,\n },\n infoContainer: {\n height: '100%',\n flex: 1,\n alignItems: 'center',\n flexDirection: 'row',\n borderBottomWidth: 1,\n },\n name: {\n flex: 1,\n marginRight: 8,\n },\n});\n\nexport default UserSelectableBar;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,MAAT,EAAiBC,IAAjB,EAAuBC,IAAvB,EAA6BC,gBAA7B,EAA+CC,aAA/C,QAAoE,yCAApE;AACA,SAASC,iBAAT,QAAkC,uBAAlC;;AAQA,MAAMC,iBAAiB,GAAG,QAA8C;EAAA,IAA7C;IAAEC,GAAF;IAAOC,IAAP;IAAaC,QAAb;IAAuBC;EAAvB,CAA6C;EACtE,MAAM;IAAEC;EAAF,IAAaP,aAAa,EAAhC;EAEA,MAAMQ,SAAS,GAAGP,iBAAiB,CACjC,CAACK,QAAD,EAAWD,QAAX,CADiC,EAEjC,CAACE,MAAM,CAACE,cAAR,EAAwBF,MAAM,CAACG,OAA/B,EAAwCH,MAAM,CAACI,cAA/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ELAY"],"sources":["constants.ts"],"sourcesContent":["export const DEFAULT_LONG_PRESS_DELAY = 350;\n"],"mappings":"AAAA,OAAO,MAAMA,wBAAwB,GAAG,GAAjC"}
|
|
1
|
+
{"version":3,"names":["DEFAULT_LONG_PRESS_DELAY","DEPRECATION_WARNING","GROUP_CHANNEL","ON_PRESS_IMAGE_MESSAGE"],"sources":["constants.ts"],"sourcesContent":["export const DEFAULT_LONG_PRESS_DELAY = 350;\nexport const DEPRECATION_WARNING = {\n GROUP_CHANNEL: {\n ON_PRESS_IMAGE_MESSAGE: '`onPressImageMessage` is deprecated, please use `onPressMediaMessage` instead',\n },\n} as const;\n"],"mappings":"AAAA,OAAO,MAAMA,wBAAwB,GAAG,GAAjC;AACP,OAAO,MAAMC,mBAAmB,GAAG;EACjCC,aAAa,EAAE;IACbC,sBAAsB,EAAE;EADX;AADkB,CAA5B"}
|
|
@@ -5,13 +5,15 @@ export const PlatformServiceProvider = _ref => {
|
|
|
5
5
|
children,
|
|
6
6
|
fileService,
|
|
7
7
|
clipboardService,
|
|
8
|
-
notificationService
|
|
8
|
+
notificationService,
|
|
9
|
+
mediaService
|
|
9
10
|
} = _ref;
|
|
10
11
|
return /*#__PURE__*/React.createElement(PlatformServiceContext.Provider, {
|
|
11
12
|
value: {
|
|
12
13
|
fileService,
|
|
13
14
|
clipboardService,
|
|
14
|
-
notificationService
|
|
15
|
+
notificationService,
|
|
16
|
+
mediaService
|
|
15
17
|
}
|
|
16
18
|
}, children);
|
|
17
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PlatformServiceContext","createContext","PlatformServiceProvider","children","fileService","clipboardService","notificationService"],"sources":["PlatformService.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {
|
|
1
|
+
{"version":3,"names":["React","PlatformServiceContext","createContext","PlatformServiceProvider","children","fileService","clipboardService","notificationService","mediaService"],"sources":["PlatformService.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {\n ClipboardServiceInterface,\n FileServiceInterface,\n MediaServiceInterface,\n NotificationServiceInterface,\n} from '../platform/types';\n\ntype Props = React.PropsWithChildren<{\n fileService: FileServiceInterface;\n clipboardService: ClipboardServiceInterface;\n notificationService: NotificationServiceInterface;\n mediaService?: MediaServiceInterface;\n}>;\n\nexport const PlatformServiceContext = React.createContext<Props | null>(null);\nexport const PlatformServiceProvider = ({\n children,\n fileService,\n clipboardService,\n notificationService,\n mediaService,\n}: Props) => {\n return (\n <PlatformServiceContext.Provider value={{ fileService, clipboardService, notificationService, mediaService }}>\n {children}\n </PlatformServiceContext.Provider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAgBA,OAAO,MAAMC,sBAAsB,gBAAGD,KAAK,CAACE,aAAN,CAAkC,IAAlC,CAA/B;AACP,OAAO,MAAMC,uBAAuB,GAAG,QAM1B;EAAA,IAN2B;IACtCC,QADsC;IAEtCC,WAFsC;IAGtCC,gBAHsC;IAItCC,mBAJsC;IAKtCC;EALsC,CAM3B;EACX,oBACE,oBAAC,sBAAD,CAAwB,QAAxB;IAAiC,KAAK,EAAE;MAAEH,WAAF;MAAeC,gBAAf;MAAiCC,mBAAjC;MAAsDC;IAAtD;EAAxC,GACGJ,QADH,CADF;AAKD,CAZM"}
|
|
@@ -7,7 +7,9 @@ export const SendbirdChatProvider = _ref => {
|
|
|
7
7
|
let {
|
|
8
8
|
children,
|
|
9
9
|
sdkInstance,
|
|
10
|
-
enableAutoPushTokenRegistration
|
|
10
|
+
enableAutoPushTokenRegistration,
|
|
11
|
+
enableChannelListMessageReceiptStatus,
|
|
12
|
+
enableChannelListTypingIndicator
|
|
11
13
|
} = _ref;
|
|
12
14
|
const [currentUser, _setCurrentUser] = useState();
|
|
13
15
|
const forceUpdate = useForceUpdate();
|
|
@@ -56,7 +58,9 @@ export const SendbirdChatProvider = _ref => {
|
|
|
56
58
|
updateCurrentUserInfo,
|
|
57
59
|
markAsDeliveredWithChannel,
|
|
58
60
|
features: { ...appFeatures,
|
|
59
|
-
autoPushTokenRegistrationEnabled: enableAutoPushTokenRegistration
|
|
61
|
+
autoPushTokenRegistrationEnabled: enableAutoPushTokenRegistration,
|
|
62
|
+
channelListTypingIndicatorEnabled: enableChannelListTypingIndicator,
|
|
63
|
+
channelListMessageReceiptStatusEnabled: enableChannelListMessageReceiptStatus
|
|
60
64
|
}
|
|
61
65
|
};
|
|
62
66
|
return /*#__PURE__*/React.createElement(SendbirdChatContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useState","AppState","useAppFeatures","useForceUpdate","SendbirdChatContext","createContext","SendbirdChatProvider","children","sdkInstance","enableAutoPushTokenRegistration","currentUser","_setCurrentUser","forceUpdate","appFeatures","setCurrentUser","user","updateCurrentUserInfo","nickname","profile","Error","profileUrl","updateCurrentUserInfoWithProfileImage","markAsDeliveredWithChannel","channel","deliveryReceiptEnabled","unreadMessageCount","markAsDelivered","url","listener","status","getConnectionState","setForegroundState","setBackgroundState","subscriber","addEventListener","remove","value","sdk","features","autoPushTokenRegistrationEnabled"],"sources":["SendbirdChat.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { AppState, AppStateStatus } from 'react-native';\n\nimport { useAppFeatures } from '@sendbird/uikit-chat-hooks';\nimport type { SendbirdChatSDK, SendbirdGroupChannel, SendbirdUser } from '@sendbird/uikit-utils';\nimport { useForceUpdate } from '@sendbird/uikit-utils';\n\nimport type { FileType } from '../platform/types';\n\ntype Props = React.PropsWithChildren<{\n sdkInstance: SendbirdChatSDK;\n\n enableAutoPushTokenRegistration: boolean;\n
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useState","AppState","useAppFeatures","useForceUpdate","SendbirdChatContext","createContext","SendbirdChatProvider","children","sdkInstance","enableAutoPushTokenRegistration","enableChannelListMessageReceiptStatus","enableChannelListTypingIndicator","currentUser","_setCurrentUser","forceUpdate","appFeatures","setCurrentUser","user","updateCurrentUserInfo","nickname","profile","Error","profileUrl","updateCurrentUserInfoWithProfileImage","markAsDeliveredWithChannel","channel","deliveryReceiptEnabled","unreadMessageCount","markAsDelivered","url","listener","status","getConnectionState","setForegroundState","setBackgroundState","subscriber","addEventListener","remove","value","sdk","features","autoPushTokenRegistrationEnabled","channelListTypingIndicatorEnabled","channelListMessageReceiptStatusEnabled"],"sources":["SendbirdChat.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { AppState, AppStateStatus } from 'react-native';\n\nimport { useAppFeatures } from '@sendbird/uikit-chat-hooks';\nimport type { SendbirdChatSDK, SendbirdGroupChannel, SendbirdUser } from '@sendbird/uikit-utils';\nimport { useForceUpdate } from '@sendbird/uikit-utils';\n\nimport type { FileType } from '../platform/types';\n\ntype Props = React.PropsWithChildren<{\n sdkInstance: SendbirdChatSDK;\n\n enableAutoPushTokenRegistration: boolean;\n enableChannelListTypingIndicator: boolean;\n enableChannelListMessageReceiptStatus: boolean;\n}>;\n\ntype Context = {\n sdk: SendbirdChatSDK;\n currentUser?: SendbirdUser;\n setCurrentUser: React.Dispatch<React.SetStateAction<SendbirdUser | undefined>>;\n\n // helper functions\n updateCurrentUserInfo: (nickname: string, profile?: string | FileType) => Promise<SendbirdUser>;\n markAsDeliveredWithChannel: (channel: SendbirdGroupChannel) => void;\n\n features: {\n // UIKit features\n autoPushTokenRegistrationEnabled: boolean;\n channelListTypingIndicatorEnabled: boolean;\n channelListMessageReceiptStatusEnabled: boolean;\n\n // Sendbird application features\n deliveryReceiptEnabled: boolean;\n broadcastChannelEnabled: boolean;\n superGroupChannelEnabled: boolean;\n reactionEnabled: boolean;\n };\n};\n\nexport const SendbirdChatContext = React.createContext<Context | null>(null);\nexport const SendbirdChatProvider = ({\n children,\n sdkInstance,\n enableAutoPushTokenRegistration,\n enableChannelListMessageReceiptStatus,\n enableChannelListTypingIndicator,\n}: Props) => {\n const [currentUser, _setCurrentUser] = useState<SendbirdUser>();\n const forceUpdate = useForceUpdate();\n const appFeatures = useAppFeatures(sdkInstance);\n\n const setCurrentUser: Context['setCurrentUser'] = useCallback((user) => {\n // NOTE: Sendbird SDK handle User object is always same object, so force update after setCurrentUser\n _setCurrentUser(user);\n forceUpdate();\n }, []);\n\n const updateCurrentUserInfo: Context['updateCurrentUserInfo'] = useCallback(\n async (nickname, profile) => {\n let user = currentUser;\n\n if (!user) throw new Error('Current user is not defined, please connect using `useConnection()` hook first');\n\n if (typeof profile === 'undefined') {\n user = await sdkInstance.updateCurrentUserInfo(nickname, sdkInstance.currentUser.profileUrl);\n } else if (typeof profile === 'string') {\n user = await sdkInstance.updateCurrentUserInfo(nickname, profile);\n } else if (typeof profile === 'object') {\n user = await sdkInstance.updateCurrentUserInfoWithProfileImage(nickname, profile);\n } else {\n throw new Error(`Cannot update profile, not supported profile type(${typeof profile})`);\n }\n\n setCurrentUser(user);\n return user;\n },\n [sdkInstance, currentUser, setCurrentUser],\n );\n\n const markAsDeliveredWithChannel: Context['markAsDeliveredWithChannel'] = useCallback(\n (channel: SendbirdGroupChannel) => {\n if (appFeatures.deliveryReceiptEnabled && channel.unreadMessageCount > 0) {\n sdkInstance.markAsDelivered(channel.url);\n }\n },\n [sdkInstance, appFeatures.deliveryReceiptEnabled],\n );\n\n useEffect(() => {\n const listener = (status: AppStateStatus) => {\n // 'active' | 'background' | 'inactive' | 'unknown' | 'extension';\n if (status === 'active') sdkInstance.getConnectionState() === 'CLOSED' && sdkInstance.setForegroundState();\n else sdkInstance.getConnectionState() === 'OPEN' && sdkInstance.setBackgroundState();\n };\n\n const subscriber = AppState.addEventListener('change', listener);\n return () => subscriber.remove();\n }, [sdkInstance]);\n\n const value: Context = {\n sdk: sdkInstance,\n currentUser,\n setCurrentUser,\n\n updateCurrentUserInfo,\n markAsDeliveredWithChannel,\n\n features: {\n ...appFeatures,\n autoPushTokenRegistrationEnabled: enableAutoPushTokenRegistration,\n channelListTypingIndicatorEnabled: enableChannelListTypingIndicator,\n channelListMessageReceiptStatusEnabled: enableChannelList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rBgB,QAAQ,EAAE,EACR,GAAGzB,WADK;MAER0B,gCAAgC,EAAEhC,+BAF1B;MAGRiC,iCAAiC,EAAE/B,gCAH3B;MAIRgC,sCAAsC,EAAEjC;IAJhC;EARW,CAAvB;EAgBA,oBAAO,oBAAC,mBAAD,CAAqB,QAArB;IAA8B,KAAK,EAAE4B;EAArC,GAA6C/B,QAA7C,CAAP;AACD,CA5EM"}
|
|
@@ -38,7 +38,7 @@ const SendInput = _ref => {
|
|
|
38
38
|
icon: 'camera',
|
|
39
39
|
onPress: async () => {
|
|
40
40
|
const photo = await fileService.openCamera({
|
|
41
|
-
mediaType: '
|
|
41
|
+
mediaType: 'all',
|
|
42
42
|
onOpenFailureWithToastMessage: () => toast.show(STRINGS.TOAST.OPEN_CAMERA_ERROR, 'error')
|
|
43
43
|
});
|
|
44
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","TouchableOpacity","View","Icon","TextInput","createStyleSheet","useBottomSheet","useToast","useUIKitTheme","conditionChaining","useLocalization","usePlatformService","SendInput","onSendUserMessage","onSendFileMessage","text","setText","disabled","STRINGS","openSheet","fileService","colors","toast","onPressSend","catch","show","TOAST","SEND_MSG_ERROR","onPressAttachment","sheetItems","title","GROUP_CHANNEL","DIALOG_ATTACHMENT_CAMERA","icon","onPress","photo","openCamera","mediaType","onOpenFailureWithToastMessage","OPEN_CAMERA_ERROR","DIALOG_ATTACHMENT_PHOTO_LIBRARY","openMediaLibrary","selectionLimit","OPEN_PHOTO_LIBRARY_ERROR","DIALOG_ATTACHMENT_FILES","file","openDocument","OPEN_FILES_ERROR","styles","sendInputContainer","ui","input","default","highlight","active","iconAttach","INPUT_PLACEHOLDER_DISABLED","INPUT_PLACEHOLDER_ACTIVE","Boolean","trim","iconSend","paddingVertical","paddingHorizontal","alignItems","flexDirection","flex","marginRight","minHeight","maxHeight","select","ios","borderRadius","padding","marginLeft"],"sources":["SendInput.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, TouchableOpacity, View } from 'react-native';\n\nimport {\n Icon,\n TextInput,\n createStyleSheet,\n useBottomSheet,\n useToast,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport { conditionChaining } from '@sendbird/uikit-utils';\n\nimport { useLocalization, usePlatformService } from '../../../../hooks/useContext';\nimport type { GroupChannelProps } from '../../types';\n\ntype SendInputProps = GroupChannelProps['Input'] & {\n text: string;\n setText: (val: string) => void;\n disabled: boolean;\n};\nconst SendInput = ({ onSendUserMessage, onSendFileMessage, text, setText, disabled }: SendInputProps) => {\n const { STRINGS } = useLocalization();\n const { openSheet } = useBottomSheet();\n const { fileService } = usePlatformService();\n const { colors } = useUIKitTheme();\n const toast = useToast();\n\n const onPressSend = () => {\n onSendUserMessage(text).catch(() => toast.show(STRINGS.TOAST.SEND_MSG_ERROR, 'error'));\n setText('');\n };\n const onPressAttachment = () => {\n openSheet({\n sheetItems: [\n {\n title: STRINGS.GROUP_CHANNEL.DIALOG_ATTACHMENT_CAMERA,\n icon: 'camera',\n onPress: async () => {\n const photo = await fileService.openCamera({\n mediaType: '
|
|
1
|
+
{"version":3,"names":["React","Platform","TouchableOpacity","View","Icon","TextInput","createStyleSheet","useBottomSheet","useToast","useUIKitTheme","conditionChaining","useLocalization","usePlatformService","SendInput","onSendUserMessage","onSendFileMessage","text","setText","disabled","STRINGS","openSheet","fileService","colors","toast","onPressSend","catch","show","TOAST","SEND_MSG_ERROR","onPressAttachment","sheetItems","title","GROUP_CHANNEL","DIALOG_ATTACHMENT_CAMERA","icon","onPress","photo","openCamera","mediaType","onOpenFailureWithToastMessage","OPEN_CAMERA_ERROR","DIALOG_ATTACHMENT_PHOTO_LIBRARY","openMediaLibrary","selectionLimit","OPEN_PHOTO_LIBRARY_ERROR","DIALOG_ATTACHMENT_FILES","file","openDocument","OPEN_FILES_ERROR","styles","sendInputContainer","ui","input","default","highlight","active","iconAttach","INPUT_PLACEHOLDER_DISABLED","INPUT_PLACEHOLDER_ACTIVE","Boolean","trim","iconSend","paddingVertical","paddingHorizontal","alignItems","flexDirection","flex","marginRight","minHeight","maxHeight","select","ios","borderRadius","padding","marginLeft"],"sources":["SendInput.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, TouchableOpacity, View } from 'react-native';\n\nimport {\n Icon,\n TextInput,\n createStyleSheet,\n useBottomSheet,\n useToast,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport { conditionChaining } from '@sendbird/uikit-utils';\n\nimport { useLocalization, usePlatformService } from '../../../../hooks/useContext';\nimport type { GroupChannelProps } from '../../types';\n\ntype SendInputProps = GroupChannelProps['Input'] & {\n text: string;\n setText: (val: string) => void;\n disabled: boolean;\n};\nconst SendInput = ({ onSendUserMessage, onSendFileMessage, text, setText, disabled }: SendInputProps) => {\n const { STRINGS } = useLocalization();\n const { openSheet } = useBottomSheet();\n const { fileService } = usePlatformService();\n const { colors } = useUIKitTheme();\n const toast = useToast();\n\n const onPressSend = () => {\n onSendUserMessage(text).catch(() => toast.show(STRINGS.TOAST.SEND_MSG_ERROR, 'error'));\n setText('');\n };\n const onPressAttachment = () => {\n openSheet({\n sheetItems: [\n {\n title: STRINGS.GROUP_CHANNEL.DIALOG_ATTACHMENT_CAMERA,\n icon: 'camera',\n onPress: async () => {\n const photo = await fileService.openCamera({\n mediaType: 'all',\n onOpenFailureWithToastMessage: () => toast.show(STRINGS.TOAST.OPEN_CAMERA_ERROR, 'error'),\n });\n\n if (photo) {\n onSendFileMessage(photo).catch(() => toast.show(STRINGS.TOAST.SEND_MSG_ERROR, 'error'));\n }\n },\n },\n {\n title: STRINGS.GROUP_CHANNEL.DIALOG_ATTACHMENT_PHOTO_LIBRARY,\n icon: 'photo',\n onPress: async () => {\n const photo = await fileService.openMediaLibrary({\n selectionLimit: 1,\n mediaType: 'all',\n onOpenFailureWithToastMessage: () => toast.show(STRINGS.TOAST.OPEN_PHOTO_LIBRARY_ERROR, 'error'),\n });\n\n if (photo && photo[0]) {\n onSendFileMessage(photo[0]).catch(() => toast.show(STRINGS.TOAST.SEND_MSG_ERROR, 'error'));\n }\n },\n },\n {\n title: STRINGS.GROUP_CHANNEL.DIALOG_ATTACHMENT_FILES,\n icon: 'document',\n onPress: async () => {\n const file = await fileService.openDocument({\n onOpenFailureWithToastMessage: () => toast.show(STRINGS.TOAST.OPEN_FILES_ERROR, 'error'),\n });\n\n if (file) {\n onSendFileMessage(file).catch(() => toast.show(STRINGS.TOAST.SEND_MSG_ERROR, 'error'));\n }\n },\n },\n ],\n });\n };\n\n return (\n <View style={styles.sendInputContainer}>\n <TouchableOpacity onPress={onPressAttachment} disabled={disabled}>\n <Icon\n color={disabled ? colors.ui.input.default.disabled.highlight : colors.ui.input.default.active.highlight}\n icon={'add'}\n size={24}\n containerStyle={styles.iconAttach}\n />\n </TouchableOpacity>\n <TextInput\n multiline\n editable={!disabled}\n value={text}\n onChangeText={setText}\n style={styles.input}\n placeholder={conditionChaining(\n [disabled],\n [STRINGS.GROUP_CHANNEL.INPUT_PLACEHOLDER_DISABLED, STRINGS.GROUP_CHANNEL.INPUT_PLACEHOLDER_ACTIVE],\n )}\n />\n {Boolean(text.trim()) && (\n <TouchableOpacity onPress={onPressSend} disabled={disabled}>\n <Icon\n color={disabled ? colors.ui.input.default.disabled.highlight : colors.ui.input.default.active.highlight}\n icon={'send'}\n size={24}\n containerStyle={styles.iconSend}\n />\n </TouchableOpacity>\n )}\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n sendInputContainer: {\n paddingVertical: 10,\n paddingHorizontal: 12,\n alignItems: 'center',\n flexDirection: 'row',\n },\n input: {\n flex: 1,\n marginRight: 4,\n minHeight: 36,\n maxHeight: 36 * Platform.select({ ios: 2.5, default: 2 }),\n borderRadius: 20,\n },\n iconAttach: {\n marginRight: 8,\n padding: 4,\n },\n iconSend: {\n marginLeft: 4,\n padding: 4,\n },\n});\n\nexport default SendInput;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,E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,EAAE,EAHR;IAIE,cAAc,EAAEL,MAAM,CAACY;EAJzB,EADF,CArBJ,CADF;AAiCD,CA7FD;;AA+FA,MAAMZ,MAAM,GAAG3C,gBAAgB,CAAC;EAC9B4C,kBAAkB,EAAE;IAClBY,eAAe,EAAE,EADC;IAElBC,iBAAiB,EAAE,EAFD;IAGlBC,UAAU,EAAE,QAHM;IAIlBC,aAAa,EAAE;EAJG,CADU;EAO9Bb,KAAK,EAAE;IACLc,IAAI,EAAE,CADD;IAELC,WAAW,EAAE,CAFR;IAGLC,SAAS,EAAE,EAHN;IAILC,SAAS,EAAE,KAAKpE,QAAQ,CAACqE,MAAT,CAAgB;MAAEC,GAAG,EAAE,GAAP;MAAYlB,OAAO,EAAE;IAArB,CAAhB,CAJX;IAKLmB,YAAY,EAAE;EALT,CAPuB;EAc9BhB,UAAU,EAAE;IACVW,WAAW,EAAE,CADH;IAEVM,OAAO,EAAE;EAFC,CAdkB;EAkB9BZ,QAAQ,EAAE;IACRa,UAAU,EAAE,CADJ;IAERD,OAAO,EAAE;EAFD;AAlBoB,CAAD,CAA/B;AAwBA,eAAe5D,SAAf"}
|
|
@@ -4,8 +4,9 @@ import React, { useCallback, useContext, useEffect, useRef, useState } from 'rea
|
|
|
4
4
|
import { Linking, Platform, View } from 'react-native';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { ChannelFrozenBanner, createStyleSheet, useAlert, useBottomSheet, useToast, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
7
|
-
import { Logger, getAvailableUriFromFileMessage, getFileExtension, getFileType, isMyMessage, messageKeyExtractor, useFreshCallback } from '@sendbird/uikit-utils';
|
|
7
|
+
import { Logger, getAvailableUriFromFileMessage, getFileExtension, getFileType, isMyMessage, messageKeyExtractor, toMegabyte, useFreshCallback } from '@sendbird/uikit-utils';
|
|
8
8
|
import ChatFlatList from '../../../components/ChatFlatList';
|
|
9
|
+
import { DEPRECATION_WARNING } from '../../../constants';
|
|
9
10
|
import { useLocalization, usePlatformService } from '../../../hooks/useContext';
|
|
10
11
|
import { GroupChannelContexts } from '../module/moduleContext';
|
|
11
12
|
const HANDLE_NEXT_MSG_SEPARATELY = Platform.select({
|
|
@@ -27,6 +28,7 @@ const GroupChannelMessageList = _ref => {
|
|
|
27
28
|
onResendFailedMessage,
|
|
28
29
|
onDeleteMessage,
|
|
29
30
|
onPressImageMessage,
|
|
31
|
+
onPressMediaMessage,
|
|
30
32
|
flatListProps,
|
|
31
33
|
enableMessageGrouping
|
|
32
34
|
} = _ref;
|
|
@@ -46,6 +48,7 @@ const GroupChannelMessageList = _ref => {
|
|
|
46
48
|
const getMessagePressActions = useGetMessagePressActions({
|
|
47
49
|
onDeleteMessage,
|
|
48
50
|
onPressImageMessage,
|
|
51
|
+
onPressMediaMessage,
|
|
49
52
|
currentUserId,
|
|
50
53
|
onResendFailedMessage
|
|
51
54
|
});
|
|
@@ -133,11 +136,10 @@ const GroupChannelMessageList = _ref => {
|
|
|
133
136
|
})));
|
|
134
137
|
};
|
|
135
138
|
|
|
136
|
-
const toMegabyte = byte => byte / 1024 / 1024;
|
|
137
|
-
|
|
138
139
|
const useGetMessagePressActions = _ref3 => {
|
|
139
140
|
let {
|
|
140
141
|
onPressImageMessage,
|
|
142
|
+
onPressMediaMessage,
|
|
141
143
|
onDeleteMessage,
|
|
142
144
|
onResendFailedMessage,
|
|
143
145
|
currentUserId
|
|
@@ -259,10 +261,29 @@ const useGetMessagePressActions = _ref3 => {
|
|
|
259
261
|
|
|
260
262
|
const fileType = getFileType(msg.type || getFileExtension(msg.name));
|
|
261
263
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
switch (fileType) {
|
|
265
|
+
case 'image':
|
|
266
|
+
case 'video':
|
|
267
|
+
case 'audio':
|
|
268
|
+
{
|
|
269
|
+
response.onPress = () => {
|
|
270
|
+
if (onPressImageMessage && fileType === 'image') {
|
|
271
|
+
Logger.warn(DEPRECATION_WARNING.GROUP_CHANNEL.ON_PRESS_IMAGE_MESSAGE);
|
|
272
|
+
onPressImageMessage(msg, getAvailableUriFromFileMessage(msg));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
onPressMediaMessage === null || onPressMediaMessage === void 0 ? void 0 : onPressMediaMessage(msg, () => onDeleteMessage(msg), getAvailableUriFromFileMessage(msg));
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
default:
|
|
282
|
+
{
|
|
283
|
+
response.onPress = () => Linking.openURL(msg.url).catch();
|
|
284
|
+
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
266
287
|
}
|
|
267
288
|
}
|
|
268
289
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useContext","useEffect","useRef","useState","Linking","Platform","View","useSafeAreaInsets","ChannelFrozenBanner","createStyleSheet","useAlert","useBottomSheet","useToast","useUIKitTheme","Logger","getAvailableUriFromFileMessage","getFileExtension","getFileType","isMyMessage","messageKeyExtractor","useFreshCallback","ChatFlatList","useLocalization","usePlatformService","GroupChannelContexts","HANDLE_NEXT_MSG_SEPARATELY","select","default","GroupChannelMessageList","currentUserId","channel","messages","renderMessage","nextMessages","newMessagesFromMembers","onBottomReached","onTopReached","renderNewMessagesButton","renderScrollToBottomButton","onResendFailedMessage","onDeleteMessage","onPressImageMessage","flatListProps","enableMessageGrouping","STRINGS","colors","left","right","scrollLeaveBottom","setScrollLeaveBottom","scrollRef","newMessagesInternalBuffer","setNewMessagesInternalBuffer","getMessagePressActions","useGetMessagePressActions","safeAreaLayout","paddingLeft","paddingRight","renderItem","item","index","onPress","onLongPress","message","prevMessage","nextMessage","length","prev","concat","onLeaveScrollBottom","val","flex","backgroundColor","background","isFrozen","styles","frozenBanner","GROUP_CHANNEL","LIST_BANNER_FROZEN","url","frozenListPadding","contentContainerStyle","newMsgButton","visible","current","scrollToBottom","newMessages","scrollButton","toMegabyte","byte","toast","openSheet","alert","clipboardService","fileService","setEditMessage","Fragment","handleFailedMessage","sheetItems","title","DIALOG_MESSAGE_FAILED_RETRY","catch","show","TOAST","RESEND_MSG_ERROR","DIALOG_MESSAGE_FAILED_REMOVE","titleColor","ui","dialog","none","destructive","confirmDelete","DIALOG_MESSAGE_DELETE_CONFIRM_TITLE","buttons","text","DIALOG_MESSAGE_DELETE_CONFIRM_CANCEL","DIALOG_MESSAGE_DELETE_CONFIRM_OK","style","DELETE_MSG_ERROR","msg","isUserMessage","isFileMessage","undefined","response","push","icon","DIALOG_MESSAGE_COPY","setString","COPY_OK","sendingStatus","DIALOG_MESSAGE_EDIT","DIALOG_MESSAGE_DELETE","DIALOG_MESSAGE_SAVE","size","DOWNLOAD_START","save","fileUrl","fileName","name","fileType","type","then","DOWNLOAD_OK","log","err","DOWNLOAD_ERROR","openURL","position","zIndex","top","paddingBottom","bottom","alignSelf","memo"],"sources":["GroupChannelMessageList.tsx"],"sourcesContent":["import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { Linking, ListRenderItem, Platform, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport type { BottomSheetItem } from '@sendbird/uikit-react-native-foundation';\nimport {\n ChannelFrozenBanner,\n createStyleSheet,\n useAlert,\n useBottomSheet,\n useToast,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdFileMessage, SendbirdMessage, SendbirdUserMessage } from '@sendbird/uikit-utils';\nimport {\n Logger,\n getAvailableUriFromFileMessage,\n getFileExtension,\n getFileType,\n isMyMessage,\n messageKeyExtractor,\n useFreshCallback,\n} from '@sendbird/uikit-utils';\n\nimport type { ChatFlatListRef } from '../../../components/ChatFlatList';\nimport ChatFlatList from '../../../components/ChatFlatList';\nimport { useLocalization, usePlatformService } from '../../../hooks/useContext';\nimport { GroupChannelContexts } from '../module/moduleContext';\nimport type { GroupChannelProps } from '../types';\n\nconst HANDLE_NEXT_MSG_SEPARATELY = Platform.select({ default: true });\n\nconst GroupChannelMessageList = ({\n currentUserId,\n channel,\n messages,\n renderMessage,\n nextMessages,\n newMessagesFromMembers,\n onBottomReached,\n onTopReached,\n renderNewMessagesButton,\n renderScrollToBottomButton,\n onResendFailedMessage,\n onDeleteMessage,\n onPressImageMessage,\n flatListProps,\n enableMessageGrouping,\n}: GroupChannelProps['MessageList']) => {\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n const { left, right } = useSafeAreaInsets();\n const [scrollLeaveBottom, setScrollLeaveBottom] = useState(false);\n const scrollRef = useRef<ChatFlatListRef>(null);\n const [newMessagesInternalBuffer, setNewMessagesInternalBuffer] = useState(() => newMessagesFromMembers);\n const getMessagePressActions = useGetMessagePressActions({\n onDeleteMessage,\n onPressImageMessage,\n currentUserId,\n onResendFailedMessage,\n });\n\n const safeAreaLayout = { paddingLeft: left, paddingRight: right };\n\n const renderItem: ListRenderItem<SendbirdMessage> = useFreshCallback(({ item, index }) => {\n const { onPress, onLongPress } = getMessagePressActions(item);\n return renderMessage({\n message: item,\n prevMessage: messages[index + 1],\n nextMessage: messages[index - 1],\n onPress,\n onLongPress,\n enableMessageGrouping,\n channel,\n currentUserId,\n });\n });\n\n if (!HANDLE_NEXT_MSG_SEPARATELY) {\n useEffect(() => {\n if (newMessagesInternalBuffer.length !== 0) {\n setNewMessagesInternalBuffer((prev) => prev.concat(newMessagesFromMembers));\n }\n onBottomReached();\n }, [newMessagesFromMembers]);\n }\n\n const onLeaveScrollBottom = useCallback((val: boolean) => {\n if (!HANDLE_NEXT_MSG_SEPARATELY) setNewMessagesInternalBuffer([]);\n setScrollLeaveBottom(val);\n }, []);\n\n return (\n <View style={[{ flex: 1, backgroundColor: colors.background }, safeAreaLayout]}>\n {channel.isFrozen && (\n <ChannelFrozenBanner style={styles.frozenBanner} text={STRINGS.GROUP_CHANNEL.LIST_BANNER_FROZEN} />\n )}\n <ChatFlatList\n nextMessages={nextMessages}\n onBottomReached={onBottomReached}\n onTopReached={onTopReached}\n onLeaveScrollBottom={onLeaveScrollBottom}\n currentUserId={currentUserId}\n {...flatListProps}\n listKey={`group-channel-messages-${channel.url}`}\n ref={scrollRef}\n data={messages}\n renderItem={renderItem}\n keyExtractor={messageKeyExtractor}\n contentContainerStyle={[\n // { minHeight: '100%', justifyContent: 'flex-end' },\n channel.isFrozen && styles.frozenListPadding,\n flatListProps?.contentContainerStyle,\n ]}\n />\n {renderNewMessagesButton && (\n <View style={[styles.newMsgButton, safeAreaLayout]}>\n {renderNewMessagesButton({\n visible: scrollLeaveBottom,\n onPress: () => scrollRef.current?.scrollToBottom(false),\n newMessages: !HANDLE_NEXT_MSG_SEPARATELY ? newMessagesInternalBuffer : newMessagesFromMembers,\n })}\n </View>\n )}\n {renderScrollToBottomButton && (\n <View pointerEvents={scrollLeaveBottom ? 'auto' : 'none'} style={[styles.scrollButton, safeAreaLayout]}>\n {renderScrollToBottomButton({\n visible: scrollLeaveBottom,\n onPress: () => scrollRef.current?.scrollToBottom(false),\n })}\n </View>\n )}\n </View>\n );\n};\n\ntype HandleableMessage = SendbirdUserMessage | SendbirdFileMessage;\nconst toMegabyte = (byte: number) => byte / 1024 / 1024;\nconst useGetMessagePressActions = ({\n onPressImageMessage,\n onDeleteMessage,\n onResendFailedMessage,\n currentUserId,\n}: Pick<\n GroupChannelProps['MessageList'],\n 'onDeleteMessage' | 'onResendFailedMessage' | 'onPressImageMessage' | 'currentUserId'\n>) => {\n const { colors } = useUIKitTheme();\n const { STRINGS } = useLocalization();\n const toast = useToast();\n const { openSheet } = useBottomSheet();\n const { alert } = useAlert();\n const { clipboardService, fileService } = usePlatformService();\n const { setEditMessage } = useContext(GroupChannelContexts.Fragment);\n\n const handleFailedMessage = (message: HandleableMessage) => {\n openSheet({\n sheetItems: [\n {\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_FAILED_RETRY,\n onPress: () =>\n onResendFailedMessage(message).catch(() => toast.show(STRINGS.TOAST.RESEND_MSG_ERROR, 'error')),\n },\n {\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_FAILED_REMOVE,\n titleColor: colors.ui.dialog.default.none.destructive,\n onPress: () => confirmDelete(message),\n },\n ],\n });\n };\n const confirmDelete = (message: HandleableMessage) => {\n alert({\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_TITLE,\n buttons: [\n {\n text: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_CANCEL,\n },\n {\n text: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_OK,\n style: 'destructive',\n onPress: () => onDeleteMessage(message).catch(() => toast.show(STRINGS.TOAST.DELETE_MSG_ERROR, 'error')),\n },\n ],\n });\n };\n\n return (msg: SendbirdMessage) => {\n if (!msg.isUserMessage() && !msg.isFileMessage()) {\n return { onPress: undefined, onLongPress: undefined };\n }\n\n const sheetItems: BottomSheetItem['sheetItems'] = [];\n const response: { onPress?: () => void; onLongPress?: () => void } = {\n onPress: undefined,\n onLongPress: undefined,\n };\n\n if (msg.isUserMessage()) {\n sheetItems.push({\n icon: 'copy',\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_COPY,\n onPress: () => {\n clipboardService.setString(msg.message || '');\n toast.show(STRINGS.TOAST.COPY_OK, 'success');\n },\n });\n\n if (isMyMessage(msg, currentUserId) && msg.sendingStatus === 'succeeded') {\n sheetItems.push(\n {\n icon: 'edit',\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_EDIT,\n onPress: () => setEditMessage(msg),\n },\n {\n icon: 'delete',\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE,\n onPress: () => confirmDelete(msg),\n },\n );\n }\n }\n\n if (msg.isFileMessage()) {\n sheetItems.push({\n icon: 'download',\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_SAVE,\n onPress: async () => {\n if (toMegabyte(msg.size) > 4) {\n toast.show(STRINGS.TOAST.DOWNLOAD_START, 'success');\n }\n\n fileService\n .save({ fileUrl: msg.url, fileName: msg.name, fileType: msg.type })\n .then((response) => {\n toast.show(STRINGS.TOAST.DOWNLOAD_OK, 'success');\n Logger.log('File saved to', response);\n })\n .catch((err) => {\n toast.show(STRINGS.TOAST.DOWNLOAD_ERROR, 'error');\n Logger.log('File save failure', err);\n });\n },\n });\n\n if (isMyMessage(msg, currentUserId) && msg.sendingStatus === 'succeeded') {\n sheetItems.push({\n icon: 'delete',\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE,\n onPress: () => confirmDelete(msg),\n });\n }\n\n const fileType = getFileType(msg.type || getFileExtension(msg.name));\n if (fileType === 'image') {\n response.onPress = () => onPressImageMessage?.(msg, getAvailableUriFromFileMessage(msg));\n } else {\n response.onPress = () => Linking.openURL(msg.url).catch();\n }\n }\n\n if (sheetItems.length > 0) {\n response.onLongPress = () => openSheet({ sheetItems });\n }\n\n if (msg.sendingStatus === 'failed') {\n response.onLongPress = () => handleFailedMessage(msg);\n response.onPress = () => {\n onResendFailedMessage(msg).catch(() => toast.show(STRINGS.TOAST.RESEND_MSG_ERROR, 'error'));\n };\n }\n\n if (msg.sendingStatus === 'pending') {\n response.onLongPress = undefined;\n response.onPress = undefined;\n }\n\n return response;\n };\n};\n\nconst styles = createStyleSheet({\n frozenBanner: {\n position: 'absolute',\n zIndex: 999,\n top: 8,\n left: 8,\n right: 8,\n },\n frozenListPadding: {\n paddingBottom: 32,\n },\n newMsgButton: {\n position: 'absolute',\n zIndex: 999,\n bottom: 10,\n alignSelf: 'center',\n },\n scrollButton: {\n position: 'absolute',\n zIndex: 998,\n bottom: 10,\n right: 16,\n },\n});\n\nexport default React.memo(GroupChannelMessageList);\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,UAA7B,EAAyCC,SAAzC,EAAoDC,MAApD,EAA4DC,QAA5D,QAA4E,OAA5E;AACA,SAASC,OAAT,EAAkCC,QAA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lB,KAA3B,CAAiC,MAAMX,KAAK,CAACY,IAAN,CAAW1D,OAAO,CAAC2D,KAAR,CAAcC,gBAAzB,EAA2C,OAA3C,CAAvC;MACD,CAFD;IAGD;;IAED,IAAIe,GAAG,CAACU,aAAJ,KAAsB,SAA1B,EAAqC;MACnCN,QAAQ,CAAC7D,WAAT,GAAuB4D,SAAvB;MACAC,QAAQ,CAAC9D,OAAT,GAAmB6D,SAAnB;IACD;;IAED,OAAOC,QAAP;EACD,CA5FD;AA6FD,CA9ID;;AAgJA,MAAMhD,MAAM,GAAGlE,gBAAgB,CAAC;EAC9BmE,YAAY,EAAE;IACZuE,QAAQ,EAAE,UADE;IAEZC,MAAM,EAAE,GAFI;IAGZC,GAAG,EAAE,CAHO;IAIZvG,IAAI,EAAE,CAJM;IAKZC,KAAK,EAAE;EALK,CADgB;EAQ9BiC,iBAAiB,EAAE;IACjBsE,aAAa,EAAE;EADE,CARW;EAW9BpE,YAAY,EAAE;IACZiE,QAAQ,EAAE,UADE;IAEZC,MAAM,EAAE,GAFI;IAGZG,MAAM,EAAE,EAHI;IAIZC,SAAS,EAAE;EAJC,CAXgB;EAiB9BjE,YAAY,EAAE;IACZ4D,QAAQ,EAAE,UADE;IAEZC,MAAM,EAAE,GAFI;IAGZG,MAAM,EAAE,EAHI;IAIZxG,KAAK,EAAE;EAJK;AAjBgB,CAAD,CAA/B;AAyBA,4BAAejD,KAAK,CAAC2J,IAAN,CAAW7H,uBAAX,CAAf"}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useContext","useEffect","useRef","useState","Linking","Platform","View","useSafeAreaInsets","ChannelFrozenBanner","createStyleSheet","useAlert","useBottomSheet","useToast","useUIKitTheme","Logger","getAvailableUriFromFileMessage","getFileExtension","getFileType","isMyMessage","messageKeyExtractor","toMegabyte","useFreshCallback","ChatFlatList","DEPRECATION_WARNING","useLocalization","usePlatformService","GroupChannelContexts","HANDLE_NEXT_MSG_SEPARATELY","select","default","GroupChannelMessageList","currentUserId","channel","messages","renderMessage","nextMessages","newMessagesFromMembers","onBottomReached","onTopReached","renderNewMessagesButton","renderScrollToBottomButton","onResendFailedMessage","onDeleteMessage","onPressImageMessage","onPressMediaMessage","flatListProps","enableMessageGrouping","STRINGS","colors","left","right","scrollLeaveBottom","setScrollLeaveBottom","scrollRef","newMessagesInternalBuffer","setNewMessagesInternalBuffer","getMessagePressActions","useGetMessagePressActions","safeAreaLayout","paddingLeft","paddingRight","renderItem","item","index","onPress","onLongPress","message","prevMessage","nextMessage","length","prev","concat","onLeaveScrollBottom","val","flex","backgroundColor","background","isFrozen","styles","frozenBanner","GROUP_CHANNEL","LIST_BANNER_FROZEN","url","frozenListPadding","contentContainerStyle","newMsgButton","visible","current","scrollToBottom","newMessages","scrollButton","toast","openSheet","alert","clipboardService","fileService","setEditMessage","Fragment","handleFailedMessage","sheetItems","title","DIALOG_MESSAGE_FAILED_RETRY","catch","show","TOAST","RESEND_MSG_ERROR","DIALOG_MESSAGE_FAILED_REMOVE","titleColor","ui","dialog","none","destructive","confirmDelete","DIALOG_MESSAGE_DELETE_CONFIRM_TITLE","buttons","text","DIALOG_MESSAGE_DELETE_CONFIRM_CANCEL","DIALOG_MESSAGE_DELETE_CONFIRM_OK","style","DELETE_MSG_ERROR","msg","isUserMessage","isFileMessage","undefined","response","push","icon","DIALOG_MESSAGE_COPY","setString","COPY_OK","sendingStatus","DIALOG_MESSAGE_EDIT","DIALOG_MESSAGE_DELETE","DIALOG_MESSAGE_SAVE","size","DOWNLOAD_START","save","fileUrl","fileName","name","fileType","type","then","DOWNLOAD_OK","log","err","DOWNLOAD_ERROR","warn","ON_PRESS_IMAGE_MESSAGE","openURL","position","zIndex","top","paddingBottom","bottom","alignSelf","memo"],"sources":["GroupChannelMessageList.tsx"],"sourcesContent":["import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { Linking, ListRenderItem, Platform, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport type { BottomSheetItem } from '@sendbird/uikit-react-native-foundation';\nimport {\n ChannelFrozenBanner,\n createStyleSheet,\n useAlert,\n useBottomSheet,\n useToast,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdFileMessage, SendbirdMessage, SendbirdUserMessage } from '@sendbird/uikit-utils';\nimport {\n Logger,\n getAvailableUriFromFileMessage,\n getFileExtension,\n getFileType,\n isMyMessage,\n messageKeyExtractor,\n toMegabyte,\n useFreshCallback,\n} from '@sendbird/uikit-utils';\n\nimport type { ChatFlatListRef } from '../../../components/ChatFlatList';\nimport ChatFlatList from '../../../components/ChatFlatList';\nimport { DEPRECATION_WARNING } from '../../../constants';\nimport { useLocalization, usePlatformService } from '../../../hooks/useContext';\nimport { GroupChannelContexts } from '../module/moduleContext';\nimport type { GroupChannelProps } from '../types';\n\nconst HANDLE_NEXT_MSG_SEPARATELY = Platform.select({ default: true });\n\nconst GroupChannelMessageList = ({\n currentUserId,\n channel,\n messages,\n renderMessage,\n nextMessages,\n newMessagesFromMembers,\n onBottomReached,\n onTopReached,\n renderNewMessagesButton,\n renderScrollToBottomButton,\n onResendFailedMessage,\n onDeleteMessage,\n onPressImageMessage,\n onPressMediaMessage,\n flatListProps,\n enableMessageGrouping,\n}: GroupChannelProps['MessageList']) => {\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n const { left, right } = useSafeAreaInsets();\n const [scrollLeaveBottom, setScrollLeaveBottom] = useState(false);\n const scrollRef = useRef<ChatFlatListRef>(null);\n const [newMessagesInternalBuffer, setNewMessagesInternalBuffer] = useState(() => newMessagesFromMembers);\n const getMessagePressActions = useGetMessagePressActions({\n onDeleteMessage,\n onPressImageMessage,\n onPressMediaMessage,\n currentUserId,\n onResendFailedMessage,\n });\n\n const safeAreaLayout = { paddingLeft: left, paddingRight: right };\n\n const renderItem: ListRenderItem<SendbirdMessage> = useFreshCallback(({ item, index }) => {\n const { onPress, onLongPress } = getMessagePressActions(item);\n return renderMessage({\n message: item,\n prevMessage: messages[index + 1],\n nextMessage: messages[index - 1],\n onPress,\n onLongPress,\n enableMessageGrouping,\n channel,\n currentUserId,\n });\n });\n\n if (!HANDLE_NEXT_MSG_SEPARATELY) {\n useEffect(() => {\n if (newMessagesInternalBuffer.length !== 0) {\n setNewMessagesInternalBuffer((prev) => prev.concat(newMessagesFromMembers));\n }\n onBottomReached();\n }, [newMessagesFromMembers]);\n }\n\n const onLeaveScrollBottom = useCallback((val: boolean) => {\n if (!HANDLE_NEXT_MSG_SEPARATELY) setNewMessagesInternalBuffer([]);\n setScrollLeaveBottom(val);\n }, []);\n\n return (\n <View style={[{ flex: 1, backgroundColor: colors.background }, safeAreaLayout]}>\n {channel.isFrozen && (\n <ChannelFrozenBanner style={styles.frozenBanner} text={STRINGS.GROUP_CHANNEL.LIST_BANNER_FROZEN} />\n )}\n <ChatFlatList\n nextMessages={nextMessages}\n onBottomReached={onBottomReached}\n onTopReached={onTopReached}\n onLeaveScrollBottom={onLeaveScrollBottom}\n currentUserId={currentUserId}\n {...flatListProps}\n listKey={`group-channel-messages-${channel.url}`}\n ref={scrollRef}\n data={messages}\n renderItem={renderItem}\n keyExtractor={messageKeyExtractor}\n contentContainerStyle={[\n // { minHeight: '100%', justifyContent: 'flex-end' },\n channel.isFrozen && styles.frozenListPadding,\n flatListProps?.contentContainerStyle,\n ]}\n />\n {renderNewMessagesButton && (\n <View style={[styles.newMsgButton, safeAreaLayout]}>\n {renderNewMessagesButton({\n visible: scrollLeaveBottom,\n onPress: () => scrollRef.current?.scrollToBottom(false),\n newMessages: !HANDLE_NEXT_MSG_SEPARATELY ? newMessagesInternalBuffer : newMessagesFromMembers,\n })}\n </View>\n )}\n {renderScrollToBottomButton && (\n <View pointerEvents={scrollLeaveBottom ? 'auto' : 'none'} style={[styles.scrollButton, safeAreaLayout]}>\n {renderScrollToBottomButton({\n visible: scrollLeaveBottom,\n onPress: () => scrollRef.current?.scrollToBottom(false),\n })}\n </View>\n )}\n </View>\n );\n};\n\ntype HandleableMessage = SendbirdUserMessage | SendbirdFileMessage;\nconst useGetMessagePressActions = ({\n onPressImageMessage,\n onPressMediaMessage,\n onDeleteMessage,\n onResendFailedMessage,\n currentUserId,\n}: Pick<\n GroupChannelProps['MessageList'],\n 'onDeleteMessage' | 'onResendFailedMessage' | 'currentUserId' | 'onPressImageMessage' | 'onPressMediaMessage'\n>) => {\n const { colors } = useUIKitTheme();\n const { STRINGS } = useLocalization();\n const toast = useToast();\n const { openSheet } = useBottomSheet();\n const { alert } = useAlert();\n const { clipboardService, fileService } = usePlatformService();\n const { setEditMessage } = useContext(GroupChannelContexts.Fragment);\n\n const handleFailedMessage = (message: HandleableMessage) => {\n openSheet({\n sheetItems: [\n {\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_FAILED_RETRY,\n onPress: () =>\n onResendFailedMessage(message).catch(() => toast.show(STRINGS.TOAST.RESEND_MSG_ERROR, 'error')),\n },\n {\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_FAILED_REMOVE,\n titleColor: colors.ui.dialog.default.none.destructive,\n onPress: () => confirmDelete(message),\n },\n ],\n });\n };\n const confirmDelete = (message: HandleableMessage) => {\n alert({\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_TITLE,\n buttons: [\n {\n text: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_CANCEL,\n },\n {\n text: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_OK,\n style: 'destructive',\n onPress: () => onDeleteMessage(message).catch(() => toast.show(STRINGS.TOAST.DELETE_MSG_ERROR, 'error')),\n },\n ],\n });\n };\n\n return (msg: SendbirdMessage) => {\n if (!msg.isUserMessage() && !msg.isFileMessage()) {\n return { onPress: undefined, onLongPress: undefined };\n }\n\n const sheetItems: BottomSheetItem['sheetItems'] = [];\n const response: { onPress?: () => void; onLongPress?: () => void } = {\n onPress: undefined,\n onLongPress: undefined,\n };\n\n if (msg.isUserMessage()) {\n sheetItems.push({\n icon: 'copy',\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_COPY,\n onPress: () => {\n clipboardService.setString(msg.message || '');\n toast.show(STRINGS.TOAST.COPY_OK, 'success');\n },\n });\n\n if (isMyMessage(msg, currentUserId) && msg.sendingStatus === 'succeeded') {\n sheetItems.push(\n {\n icon: 'edit',\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_EDIT,\n onPress: () => setEditMessage(msg),\n },\n {\n icon: 'delete',\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE,\n onPress: () => confirmDelete(msg),\n },\n );\n }\n }\n\n if (msg.isFileMessage()) {\n sheetItems.push({\n icon: 'download',\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_SAVE,\n onPress: async () => {\n if (toMegabyte(msg.size) > 4) {\n toast.show(STRINGS.TOAST.DOWNLOAD_START, 'success');\n }\n\n fileService\n .save({ fileUrl: msg.url, fileName: msg.name, fileType: msg.type })\n .then((response) => {\n toast.show(STRINGS.TOAST.DOWNLOAD_OK, 'success');\n Logger.log('File saved to', response);\n })\n .catch((err) => {\n toast.show(STRINGS.TOAST.DOWNLOAD_ERROR, 'error');\n Logger.log('File save failure', err);\n });\n },\n });\n\n if (isMyMessage(msg, currentUserId) && msg.sendingStatus === 'succeeded') {\n sheetItems.push({\n icon: 'delete',\n title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE,\n onPress: () => confirmDelete(msg),\n });\n }\n\n const fileType = getFileType(msg.type || getFileExtension(msg.name));\n switch (fileType) {\n case 'image':\n case 'video':\n case 'audio': {\n response.onPress = () => {\n if (onPressImageMessage && fileType === 'image') {\n Logger.warn(DEPRECATION_WARNING.GROUP_CHANNEL.ON_PRESS_IMAGE_MESSAGE);\n onPressImageMessage(msg, getAvailableUriFromFileMessage(msg));\n }\n onPressMediaMessage?.(msg, () => onDeleteMessage(msg), getAvailableUriFromFileMessage(msg));\n };\n break;\n }\n default: {\n response.onPress = () => Linking.openURL(msg.url).catch();\n break;\n }\n }\n }\n\n if (sheetItems.length > 0) {\n response.onLongPress = () => openSheet({ sheetItems });\n }\n\n if (msg.sendingStatus === 'failed') {\n response.onLongPress = () => handleFailedMessage(msg);\n response.onPress = () => {\n onResendFailedMessage(msg).catch(() => toast.show(STRINGS.TOAST.RESEND_MSG_ERROR, 'error'));\n };\n }\n\n if (msg.sendingStatus === 'pending') {\n response.onLongPress = undefined;\n response.onPress = undefined;\n }\n\n return response;\n };\n};\n\nconst styles = createStyleSheet({\n frozenBanner: {\n position: 'absolute',\n zIndex: 999,\n top: 8,\n left: 8,\n right: 8,\n },\n frozenListPadding: {\n paddingBottom: 32,\n },\n newMsgButton: {\n position: 'absolute',\n zIndex: 999,\n bottom: 10,\n alignSelf: 'center',\n },\n scrollButton: {\n position: 'absolute',\n zIndex: 998,\n bottom: 10,\n right: 16,\n },\n});\n\nexport default React.memo(GroupChannelMessageList);\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,UAA7B,EAAyCC,SAAzC,EAAoDC,MAApD,EAA4DC,QAA5D,QAA4E,OAA5E;AACA,SAASC,OAAT,EAAkCC,QAAlC,EAA4CC,IAA5C,QAAwD,cAAxD;AACA,SAASC,iBAAT,QAAkC,gCAAlC;AAGA,SACEC,mBADF,EAEEC,gBAFF,EAGEC,QAHF,EAIEC,cAJF,EAKEC,QALF,EAMEC,aANF,QAOO,yCAPP;AASA,SACEC,MADF,EAEEC,8BAFF,EAGEC,gBAHF,EAIEC,WAJF,EAKEC,WALF,EAMEC,mBANF,EAOEC,UAPF,EAQEC,gBARF,QASO,uBATP;AAYA,OAAOC,YAAP,MAAyB,kCAAzB;AACA,SAASC,mBAAT,QAAoC,oBAApC;AACA,SAASC,eAAT,EAA0BC,kBAA1B,QAAoD,2BAApD;AACA,SAASC,oBAAT,QAAqC,yBAArC;AAGA,MAAMC,0BAA0B,GAAGtB,QAAQ,CAACuB,MAAT,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