@sendbird/uikit-react-native 3.7.4 → 3.7.5
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 +5 -4
- package/lib/commonjs/components/ChannelInput/index.js +1 -1
- package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
- package/lib/commonjs/components/FileViewer/FileViewerContent.js +1 -1
- package/lib/commonjs/components/FileViewer/FileViewerContent.js.map +1 -1
- package/lib/commonjs/components/FileViewer/FileViewerFooter.js +1 -0
- package/lib/commonjs/components/FileViewer/FileViewerFooter.js.map +1 -1
- package/lib/commonjs/components/FileViewer/FileViewerHeader.js +1 -0
- package/lib/commonjs/components/FileViewer/FileViewerHeader.js.map +1 -1
- package/lib/commonjs/components/ReactionAddons/BottomSheetReactionAddon.js +3 -1
- package/lib/commonjs/components/ReactionAddons/BottomSheetReactionAddon.js.map +1 -1
- package/lib/commonjs/components/ReactionBottomSheets/ReactionListBottomSheet.js +3 -1
- package/lib/commonjs/components/ReactionBottomSheets/ReactionListBottomSheet.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +15 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/commonjs/domain/groupChannelThread/component/GroupChannelThreadMessageList.js +15 -1
- package/lib/commonjs/domain/groupChannelThread/component/GroupChannelThreadMessageList.js.map +1 -1
- package/lib/commonjs/hooks/usePushTokenRegistration.js +2 -2
- package/lib/commonjs/hooks/usePushTokenRegistration.js.map +1 -1
- package/lib/commonjs/platform/createFileService.native.js +2 -2
- package/lib/commonjs/platform/createFileService.native.js.map +1 -1
- package/lib/commonjs/platform/createPlayerService.native.js +3 -4
- package/lib/commonjs/platform/createPlayerService.native.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 +1 -1
- package/lib/module/components/ChannelInput/index.js.map +1 -1
- package/lib/module/components/FileViewer/FileViewerContent.js +1 -1
- package/lib/module/components/FileViewer/FileViewerContent.js.map +1 -1
- package/lib/module/components/FileViewer/FileViewerFooter.js +1 -0
- package/lib/module/components/FileViewer/FileViewerFooter.js.map +1 -1
- package/lib/module/components/FileViewer/FileViewerHeader.js +1 -0
- package/lib/module/components/FileViewer/FileViewerHeader.js.map +1 -1
- package/lib/module/components/ReactionAddons/BottomSheetReactionAddon.js +3 -1
- package/lib/module/components/ReactionAddons/BottomSheetReactionAddon.js.map +1 -1
- package/lib/module/components/ReactionBottomSheets/ReactionListBottomSheet.js +3 -1
- package/lib/module/components/ReactionBottomSheets/ReactionListBottomSheet.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +15 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/module/domain/groupChannelThread/component/GroupChannelThreadMessageList.js +15 -1
- package/lib/module/domain/groupChannelThread/component/GroupChannelThreadMessageList.js.map +1 -1
- package/lib/module/hooks/usePushTokenRegistration.js +2 -2
- package/lib/module/hooks/usePushTokenRegistration.js.map +1 -1
- package/lib/module/platform/createFileService.native.js +2 -2
- package/lib/module/platform/createFileService.native.js.map +1 -1
- package/lib/module/platform/createPlayerService.native.js +3 -4
- package/lib/module/platform/createPlayerService.native.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +6 -6
- package/src/components/ChannelInput/index.tsx +1 -1
- package/src/components/FileViewer/FileViewerContent.tsx +1 -1
- package/src/components/FileViewer/FileViewerFooter.tsx +1 -0
- package/src/components/FileViewer/FileViewerHeader.tsx +1 -0
- package/src/components/ReactionAddons/BottomSheetReactionAddon.tsx +4 -1
- package/src/components/ReactionBottomSheets/ReactionListBottomSheet.tsx +5 -1
- package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +17 -1
- package/src/domain/groupChannelThread/component/GroupChannelThreadMessageList.tsx +16 -1
- package/src/hooks/usePushTokenRegistration.ts +2 -2
- package/src/platform/createFileService.native.ts +2 -6
- package/src/platform/createPlayerService.native.tsx +5 -4
- package/src/version.ts +1 -1
|
@@ -192,7 +192,7 @@ const useTypingTrigger = (text: string, channel: SendbirdBaseChannel) => {
|
|
|
192
192
|
() => {
|
|
193
193
|
function triggerTyping() {
|
|
194
194
|
if (channel.isGroupChannel()) {
|
|
195
|
-
const action = text.length === 0 ? channel.endTyping : channel.startTyping;
|
|
195
|
+
const action = () => (text.length === 0 ? channel.endTyping() : channel.startTyping());
|
|
196
196
|
action().catch((error) => {
|
|
197
197
|
Logger.debug('ChannelInput: Failed to trigger typing', error);
|
|
198
198
|
});
|
|
@@ -47,7 +47,10 @@ const BottomSheetReactionAddon = ({ onClose, message, channel }: Props) => {
|
|
|
47
47
|
const reacted = currentUserIdx > -1;
|
|
48
48
|
|
|
49
49
|
const onPress = async () => {
|
|
50
|
-
const action =
|
|
50
|
+
const action = (message: BaseMessage, key: string) => {
|
|
51
|
+
return reacted ? channel.deleteReaction(message, key) : channel.addReaction(message, key);
|
|
52
|
+
};
|
|
53
|
+
|
|
51
54
|
await action(message, key)
|
|
52
55
|
.catch((error) => {
|
|
53
56
|
Logger.warn('Failed to reaction', error);
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { FlatList, Pressable, View, useWindowDimensions } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
|
+
import type { BaseMessage } from '@sendbird/chat/message';
|
|
5
6
|
import { Image, Modal, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
6
7
|
import { Logger } from '@sendbird/uikit-utils';
|
|
7
8
|
|
|
@@ -56,7 +57,10 @@ const ReactionListBottomSheet = ({ visible, onClose, onDismiss, reactionCtx, cha
|
|
|
56
57
|
key={key}
|
|
57
58
|
onPress={async () => {
|
|
58
59
|
if (message && channel) {
|
|
59
|
-
const action =
|
|
60
|
+
const action = (message: BaseMessage, key: string) => {
|
|
61
|
+
return reacted ? channel.deleteReaction(message, key) : channel.addReaction(message, key);
|
|
62
|
+
};
|
|
63
|
+
|
|
60
64
|
action(message, key).catch((error) => {
|
|
61
65
|
Logger.warn('Failed to reaction', error);
|
|
62
66
|
});
|
|
@@ -75,7 +75,7 @@ const GroupChannelMessageList = (props: GroupChannelProps['MessageList']) => {
|
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
useEffect(() => {
|
|
78
|
-
return subscribe(({ type }) => {
|
|
78
|
+
return subscribe(({ type, data }) => {
|
|
79
79
|
switch (type) {
|
|
80
80
|
case 'TYPING_BUBBLE_RENDERED':
|
|
81
81
|
case 'MESSAGES_RECEIVED': {
|
|
@@ -84,6 +84,22 @@ const GroupChannelMessageList = (props: GroupChannelProps['MessageList']) => {
|
|
|
84
84
|
}
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
|
+
case 'MESSAGES_UPDATED': {
|
|
88
|
+
const lastMessage = props.channel.lastMessage;
|
|
89
|
+
const [updatedMessage] = data.messages;
|
|
90
|
+
|
|
91
|
+
const lastMessageUpdated =
|
|
92
|
+
updatedMessage && lastMessage && lastMessage.messageId === updatedMessage.messageId;
|
|
93
|
+
|
|
94
|
+
const isMaybeStreaming = props.channel.hasAiBot && lastMessageUpdated;
|
|
95
|
+
|
|
96
|
+
if (isMaybeStreaming) {
|
|
97
|
+
scrollToBottom(false);
|
|
98
|
+
} else if (!props.scrolledAwayFromBottom && lastMessageUpdated) {
|
|
99
|
+
scrollToBottom(true);
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
87
103
|
case 'MESSAGE_SENT_SUCCESS':
|
|
88
104
|
case 'MESSAGE_SENT_PENDING': {
|
|
89
105
|
scrollToBottom(false);
|
|
@@ -69,7 +69,7 @@ const GroupChannelThreadMessageList = (props: GroupChannelThreadProps['MessageLi
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
useEffect(() => {
|
|
72
|
-
return subscribe(({ type }) => {
|
|
72
|
+
return subscribe(({ type, data }) => {
|
|
73
73
|
switch (type) {
|
|
74
74
|
case 'TYPING_BUBBLE_RENDERED':
|
|
75
75
|
case 'MESSAGES_RECEIVED': {
|
|
@@ -78,6 +78,21 @@ const GroupChannelThreadMessageList = (props: GroupChannelThreadProps['MessageLi
|
|
|
78
78
|
}
|
|
79
79
|
break;
|
|
80
80
|
}
|
|
81
|
+
case 'MESSAGES_UPDATED': {
|
|
82
|
+
const lastMessage = props.channel.lastMessage;
|
|
83
|
+
const [updatedMessage] = data.messages;
|
|
84
|
+
|
|
85
|
+
const lastMessageUpdated =
|
|
86
|
+
updatedMessage && lastMessage && lastMessage.messageId === updatedMessage.messageId;
|
|
87
|
+
const isMaybeStreaming = props.channel.hasAiBot && lastMessageUpdated;
|
|
88
|
+
|
|
89
|
+
if (isMaybeStreaming) {
|
|
90
|
+
scrollToBottom(false);
|
|
91
|
+
} else if (!props.scrolledAwayFromBottom && lastMessageUpdated) {
|
|
92
|
+
scrollToBottom(true);
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
81
96
|
case 'MESSAGE_SENT_SUCCESS':
|
|
82
97
|
case 'MESSAGE_SENT_PENDING': {
|
|
83
98
|
scrollToBottom(false);
|
|
@@ -21,8 +21,8 @@ const usePushTokenRegistration = () => {
|
|
|
21
21
|
default: (token: string) => sdk.unregisterFCMPushTokenForCurrentUser(token),
|
|
22
22
|
}),
|
|
23
23
|
Platform.select({
|
|
24
|
-
ios: notificationService.getAPNSToken,
|
|
25
|
-
default: notificationService.getFCMToken,
|
|
24
|
+
ios: () => notificationService.getAPNSToken(),
|
|
25
|
+
default: () => notificationService.getFCMToken(),
|
|
26
26
|
}),
|
|
27
27
|
];
|
|
28
28
|
});
|
|
@@ -31,11 +31,7 @@ function getAndroidStoragePermissionsByAPILevel(permissionModule: typeof Permiss
|
|
|
31
31
|
if (Platform.OS !== 'android') return [];
|
|
32
32
|
|
|
33
33
|
if (Platform.Version > 32) {
|
|
34
|
-
return [
|
|
35
|
-
permissionModule.PERMISSIONS.ANDROID.READ_MEDIA_AUDIO,
|
|
36
|
-
permissionModule.PERMISSIONS.ANDROID.READ_MEDIA_IMAGES,
|
|
37
|
-
permissionModule.PERMISSIONS.ANDROID.READ_MEDIA_VIDEO,
|
|
38
|
-
];
|
|
34
|
+
return [];
|
|
39
35
|
}
|
|
40
36
|
|
|
41
37
|
if (Platform.Version > 28) {
|
|
@@ -63,7 +59,7 @@ const createNativeFileService = ({
|
|
|
63
59
|
}): FileServiceInterface => {
|
|
64
60
|
const cameraPermissions: Permission[] = Platform.select({
|
|
65
61
|
ios: [permissionModule.PERMISSIONS.IOS.CAMERA, permissionModule.PERMISSIONS.IOS.MICROPHONE],
|
|
66
|
-
android: [
|
|
62
|
+
android: [],
|
|
67
63
|
default: [],
|
|
68
64
|
});
|
|
69
65
|
const mediaLibraryPermissions: Permission[] = Platform.select({
|
|
@@ -58,14 +58,15 @@ const createNativePlayerService = ({ audioRecorderModule, permissionModule }: Mo
|
|
|
58
58
|
|
|
59
59
|
public requestPermission = async (): Promise<boolean> => {
|
|
60
60
|
if (Platform.OS === 'android') {
|
|
61
|
-
|
|
62
|
-
const permission = Platform.Version > 32 ? READ_MEDIA_AUDIO : READ_EXTERNAL_STORAGE;
|
|
61
|
+
if (Platform.Version > 32) return true;
|
|
63
62
|
|
|
64
|
-
const
|
|
63
|
+
const { READ_EXTERNAL_STORAGE } = permissionModule.PERMISSIONS.ANDROID;
|
|
64
|
+
|
|
65
|
+
const status = await permissionModule.check(READ_EXTERNAL_STORAGE);
|
|
65
66
|
if (status === 'granted') {
|
|
66
67
|
return true;
|
|
67
68
|
} else {
|
|
68
|
-
const status = await permissionModule.request(
|
|
69
|
+
const status = await permissionModule.request(READ_EXTERNAL_STORAGE);
|
|
69
70
|
return status === 'granted';
|
|
70
71
|
}
|
|
71
72
|
} else {
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const VERSION = '3.7.
|
|
1
|
+
const VERSION = '3.7.5';
|
|
2
2
|
export default VERSION;
|