@smart-link/rn-im 1.0.23 → 1.0.26
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/assets/file-dir.jpg +0 -0
- package/dist/api/addressList.js +6 -17
- package/dist/api/backup.js +8 -20
- package/dist/api/file.js +6 -35
- package/dist/api/user.js +6 -16
- package/dist/components/CachedImage.js +14 -42
- package/dist/components/Camera/Camera.js +26 -54
- package/dist/components/Camera/CameraCapture.js +99 -128
- package/dist/components/Camera/CameraResult.js +33 -61
- package/dist/components/ChatAvatar/ChatAvatar.d.ts +1 -1
- package/dist/components/ChatAvatar/ChatAvatar.js +34 -62
- package/dist/components/ChatAvatar/ChatAvatarId.d.ts +2 -2
- package/dist/components/ChatAvatar/ChatAvatarId.js +26 -51
- package/dist/components/ChatAvatar/ChatAvatarLocal.d.ts +2 -2
- package/dist/components/ChatAvatar/ChatAvatarLocal.js +22 -25
- package/dist/components/ChatAvatar/index.js +2 -23
- package/dist/components/Favicon.js +6 -34
- package/dist/components/FormatTimeText.js +5 -10
- package/dist/components/Highlighter.js +9 -34
- package/dist/components/IndicatorText.js +14 -39
- package/dist/components/LocalImage.js +7 -32
- package/dist/components/NetworkUnconnected.js +14 -42
- package/dist/components/PopoverWrapper.js +22 -47
- package/dist/components/VideoPlayer.js +111 -138
- package/dist/components/styles.js +10 -13
- package/dist/default-assets.d.ts +2 -0
- package/dist/default-assets.js +9 -10
- package/dist/hooks/useDownloadSource.js +7 -12
- package/dist/hooks/useFormatMsgTime.js +5 -13
- package/dist/hooks/useImReady.js +7 -10
- package/dist/hooks/useImSelector.js +34 -48
- package/dist/hooks/useTranslation.js +5 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -28
- package/dist/init.js +30 -40
- package/dist/interface.d.ts +9 -0
- package/dist/interface.js +1 -2
- package/dist/locales/en/addressList.js +1 -3
- package/dist/locales/index.js +4 -27
- package/dist/locales/lao/addressList.js +1 -3
- package/dist/locales/zh/addressList.js +1 -3
- package/dist/pages/address-list/AddressList.js +33 -61
- package/dist/pages/address-list/CardInfo.js +10 -18
- package/dist/pages/address-list/ChooseContact.js +50 -78
- package/dist/pages/address-list/Icons.js +7 -14
- package/dist/pages/address-list/Organization.js +59 -89
- package/dist/pages/address-list/UserDetail.js +55 -83
- package/dist/pages/address-list/UserJobs.js +31 -33
- package/dist/pages/address-list/UserSearch.js +29 -54
- package/dist/pages/address-list/addressList.routes.js +11 -16
- package/dist/pages/collection/Collection.js +53 -81
- package/dist/pages/collection/ContentFactory.js +53 -82
- package/dist/pages/collection/collection.routes.js +3 -9
- package/dist/pages/conversation/ForwardToConversation.js +63 -91
- package/dist/pages/conversation/List.js +74 -102
- package/dist/pages/conversation/components/ConversationCard.js +46 -74
- package/dist/pages/conversation/components/ConversationOption.js +27 -55
- package/dist/pages/conversation/conversation.routes.js +17 -23
- package/dist/pages/conversation/setting/GroupTransfer.js +32 -60
- package/dist/pages/conversation/setting/OptionAvatars.d.ts +1 -1
- package/dist/pages/conversation/setting/OptionAvatars.js +62 -90
- package/dist/pages/conversation/setting/OptionCancelGroup.js +14 -42
- package/dist/pages/conversation/setting/OptionConversation.js +20 -48
- package/dist/pages/conversation/setting/OptionGroup.d.ts +1 -1
- package/dist/pages/conversation/setting/OptionGroup.js +20 -48
- package/dist/pages/conversation/setting/OptionGroupManage.js +21 -49
- package/dist/pages/conversation/setting/OptionGroupMoreMember.js +48 -53
- package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.js +49 -77
- package/dist/pages/conversation/setting/Setting.js +50 -56
- package/dist/pages/conversation/setting/SettingChatBg.js +26 -54
- package/dist/pages/index.js +7 -27
- package/dist/pages/message/ChooseMember.js +56 -84
- package/dist/pages/message/FileSelector.d.ts +6 -0
- package/dist/pages/message/FileSelector.js +235 -0
- package/dist/pages/message/MessageBackup/Bar.js +18 -43
- package/dist/pages/message/MessageBackup/MessageBackup.js +42 -72
- package/dist/pages/message/MessageBackup/RestoreBackupPage.js +48 -76
- package/dist/pages/message/MessageBackup/StartBackupPage.js +48 -76
- package/dist/pages/message/MessageBackup/index.js +3 -12
- package/dist/pages/message/MessageBackup/utils.js +14 -22
- package/dist/pages/message/MessageList.js +151 -141
- package/dist/pages/message/MessageRecord.js +74 -87
- package/dist/pages/message/components/BusiNotifyCard.js +60 -85
- package/dist/pages/message/components/ChatBg.js +11 -36
- package/dist/pages/message/components/MessageItem.d.ts +2 -1
- package/dist/pages/message/components/MessageItem.js +85 -112
- package/dist/pages/message/components/MessageItemQuote.js +30 -58
- package/dist/pages/message/components/MessageItemTips.js +27 -55
- package/dist/pages/message/components/MessageOption.d.ts +7 -3
- package/dist/pages/message/components/MessageOption.js +107 -134
- package/dist/pages/message/components/MessagePayload.d.ts +2 -1
- package/dist/pages/message/components/MessagePayload.js +36 -64
- package/dist/pages/message/components/MessagePictureAlbum.js +32 -60
- package/dist/pages/message/components/MessageReceiptStatus.js +18 -43
- package/dist/pages/message/components/MessageUndo.js +18 -48
- package/dist/pages/message/components/MultipleBar/index.js +48 -76
- package/dist/pages/message/components/Payload/PayloadContact.js +30 -58
- package/dist/pages/message/components/Payload/PayloadFile.d.ts +1 -1
- package/dist/pages/message/components/Payload/PayloadFile.js +44 -68
- package/dist/pages/message/components/Payload/PayloadMultiple.js +46 -70
- package/dist/pages/message/components/Payload/PayloadNotify.js +28 -56
- package/dist/pages/message/components/Payload/PayloadPicture.d.ts +1 -1
- package/dist/pages/message/components/Payload/PayloadPicture.js +21 -50
- package/dist/pages/message/components/Payload/PayloadShare.js +39 -67
- package/dist/pages/message/components/Payload/PayloadText.js +39 -67
- package/dist/pages/message/components/Payload/PayloadVideo.js +30 -57
- package/dist/pages/message/components/Payload/PayloadVoice.js +80 -93
- package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +2 -1
- package/dist/pages/message/components/Payload/PayloadWrapper.js +24 -44
- package/dist/pages/message/components/Payload/type.d.ts +2 -1
- package/dist/pages/message/components/Payload/type.js +1 -2
- package/dist/pages/message/components/ReceiptBack.js +30 -60
- package/dist/pages/message/components/TextMixMessage.js +13 -38
- package/dist/pages/message/components/TextMixQuote.js +128 -162
- package/dist/pages/message/components/TextMixQuoteMessage.js +19 -47
- package/dist/pages/message/components/UploadProgress.js +12 -37
- package/dist/pages/message/components/messageBar/EmojiPanel.js +25 -50
- package/dist/pages/message/components/messageBar/Icons.js +56 -74
- package/dist/pages/message/components/messageBar/MessageBar.js +84 -115
- package/dist/pages/message/components/messageBar/MessageInput.js +30 -55
- package/dist/pages/message/components/messageBar/OptionPanel.js +54 -107
- package/dist/pages/message/components/messageBar/VoiceBar.js +122 -100
- package/dist/pages/message/components/messageBar/index.js +2 -23
- package/dist/pages/message/message.routes.js +21 -40
- package/dist/pages/search/Search.js +38 -66
- package/dist/pages/search/SearchChatRecords.js +64 -92
- package/dist/pages/search/SearchFile.js +68 -96
- package/dist/pages/search/SearchManager.js +60 -65
- package/dist/pages/search/SearchPicturePage.js +16 -44
- package/dist/pages/search/components/ChatRecords.js +46 -74
- package/dist/pages/search/components/MyGroupChat.js +41 -69
- package/dist/pages/search/components/PictureMulipleBar.js +35 -63
- package/dist/pages/search/components/SearchFileList.js +59 -64
- package/dist/pages/search/components/SearchPictures.js +68 -98
- package/dist/pages/search/components/SearchShareLinkList.js +50 -55
- package/dist/pages/search/components/SearchUser.js +25 -53
- package/dist/pages/search/components/useSearchMessage.js +12 -16
- package/dist/pages/search/search.routes.js +11 -17
- package/dist/pages/search/utils.js +4 -12
- package/dist/pages/types.d.ts +4 -2
- package/dist/pages/types.js +1 -2
- package/dist/slice/contact/contact.slice.js +4 -8
- package/dist/slice/index.js +7 -13
- package/dist/slice/panel/panel.slice.d.ts +2 -1
- package/dist/slice/panel/panel.slice.js +8 -7
- package/dist/slice/video/video.action.d.ts +1 -0
- package/dist/slice/video/video.action.js +64 -38
- package/dist/slice/video/video.slice.d.ts +1 -1
- package/dist/slice/video/video.slice.js +7 -8
- package/dist/utils/audio.d.ts +3 -0
- package/dist/utils/audio.js +10 -0
- package/dist/utils/color.js +2 -9
- package/dist/utils/common-action-sheet.js +9 -14
- package/dist/utils/cookie.js +6 -14
- package/dist/utils/emoji.js +9 -12
- package/dist/utils/file-icon.js +33 -60
- package/dist/utils/file-operate.js +1 -2
- package/dist/utils/file.d.ts +10 -2
- package/dist/utils/file.js +188 -88
- package/dist/utils/golden-rectangle.js +3 -7
- package/dist/utils/phone.js +13 -22
- package/dist/utils/request.js +7 -15
- package/dist/utils/scroll.js +5 -9
- package/dist/utils/summary.js +4 -11
- package/dist/utils/take-camera.js +12 -19
- package/dist/utils/text-mix.js +4 -11
- package/dist/utils/upload.js +20 -41
- package/package.json +6 -7
- package/dist/slice/contact/contact.action.d.ts +0 -1
- package/dist/slice/contact/contact.action.js +0 -2
@@ -1,48 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
-
};
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
const file_1 = require("../../../api/file");
|
30
|
-
const file_2 = require("../../../utils/file");
|
31
|
-
const im_base_1 = require("@smart-link/im-base");
|
32
|
-
const rn_ui_1 = require("@smart-link/rn-ui");
|
33
|
-
const react_1 = __importStar(require("react"));
|
34
|
-
const react_native_1 = require("react-native");
|
35
|
-
const AntDesign_1 = __importDefault(require("react-native-vector-icons/AntDesign"));
|
1
|
+
import { getDownloadUrl } from '../../../api/file';
|
2
|
+
import { toAbsolutePath } from '../../../utils/file';
|
3
|
+
import { PayloadType } from '@smart-link/im-base';
|
4
|
+
import { AlbumView, dp } from '@smart-link/rn-ui';
|
5
|
+
import React, { memo, useEffect, useState } from 'react';
|
6
|
+
import { View, Dimensions, Modal, StyleSheet, Platform, StatusBar, TouchableOpacity, } from 'react-native';
|
7
|
+
import AntDesign from "react-native-vector-icons/AntDesign";
|
36
8
|
const MessagePictureAlbum = ({ visible, onClose, messages, messageSeq }) => {
|
37
|
-
const { width, height } =
|
38
|
-
const [index, setIndex] =
|
39
|
-
const [sources, setSources] =
|
40
|
-
|
9
|
+
const { width, height } = Dimensions.get('window');
|
10
|
+
const [index, setIndex] = useState(0);
|
11
|
+
const [sources, setSources] = useState([]);
|
12
|
+
useEffect(() => {
|
41
13
|
if (!visible)
|
42
14
|
return;
|
43
15
|
let defaultIndex = 0;
|
44
16
|
const imageSources = messages
|
45
|
-
.filter(item => item.payloadType ===
|
17
|
+
.filter(item => item.payloadType === PayloadType.PICTURE)
|
46
18
|
.sort((s, t) => {
|
47
19
|
return s.messageTime - t.messageTime;
|
48
20
|
})
|
@@ -53,10 +25,10 @@ const MessagePictureAlbum = ({ visible, onClose, messages, messageSeq }) => {
|
|
53
25
|
const { payload: { localPath, fileId }, } = item;
|
54
26
|
let source = localPath;
|
55
27
|
if (Object.prototype.toString.call(localPath) === '[object String]') {
|
56
|
-
source = { uri:
|
28
|
+
source = { uri: toAbsolutePath(localPath) };
|
57
29
|
}
|
58
30
|
else if (fileId) {
|
59
|
-
source = { uri:
|
31
|
+
source = { uri: getDownloadUrl(fileId) };
|
60
32
|
}
|
61
33
|
return source;
|
62
34
|
});
|
@@ -68,20 +40,20 @@ const MessagePictureAlbum = ({ visible, onClose, messages, messageSeq }) => {
|
|
68
40
|
setSources([]);
|
69
41
|
onClose();
|
70
42
|
};
|
71
|
-
return (<
|
72
|
-
{visible && (<
|
73
|
-
{
|
74
|
-
<
|
75
|
-
<
|
76
|
-
</
|
43
|
+
return (<Modal style={{ flex: 1 }} statusBarTranslucent animationType="fade" visible={visible} onRequestClose={handleClose}>
|
44
|
+
{visible && (<View style={styles.root}>
|
45
|
+
{Platform.OS === 'android' && <StatusBar backgroundColor={'#000'}/>}
|
46
|
+
<View style={{ width: width, height: height }}>
|
47
|
+
<AlbumView images={sources} defaultIndex={index} onClose={onClose}/>
|
48
|
+
</View>
|
77
49
|
|
78
|
-
<
|
79
|
-
<
|
80
|
-
</
|
81
|
-
</
|
82
|
-
</
|
50
|
+
<TouchableOpacity style={styles.cancel} onPress={handleClose}>
|
51
|
+
<AntDesign name='close' size={dp(25)} color={'#fff'}/>
|
52
|
+
</TouchableOpacity>
|
53
|
+
</View>)}
|
54
|
+
</Modal>);
|
83
55
|
};
|
84
|
-
const styles =
|
56
|
+
const styles = StyleSheet.create({
|
85
57
|
root: {
|
86
58
|
flex: 1,
|
87
59
|
backgroundColor: '#000',
|
@@ -89,16 +61,16 @@ const styles = react_native_1.StyleSheet.create({
|
|
89
61
|
alignItems: 'center',
|
90
62
|
},
|
91
63
|
cancel: {
|
92
|
-
height:
|
93
|
-
width:
|
94
|
-
borderRadius:
|
64
|
+
height: dp(40),
|
65
|
+
width: dp(40),
|
66
|
+
borderRadius: dp(5),
|
95
67
|
backgroundColor: '#333',
|
96
68
|
position: 'absolute',
|
97
|
-
top:
|
98
|
-
right:
|
69
|
+
top: dp(70),
|
70
|
+
right: dp(30),
|
99
71
|
justifyContent: 'center',
|
100
72
|
alignItems: 'center',
|
101
73
|
opacity: 0.7,
|
102
74
|
},
|
103
75
|
});
|
104
|
-
|
76
|
+
export default memo(MessagePictureAlbum);
|
@@ -1,61 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
const default_assets_1 = require("../../../default-assets");
|
27
|
-
const im_base_1 = require("@smart-link/im-base");
|
28
|
-
const rn_ui_1 = require("@smart-link/rn-ui");
|
29
|
-
const react_1 = __importStar(require("react"));
|
30
|
-
const react_native_1 = require("react-native");
|
31
|
-
const { EMITTED, ARRIVED, READ, } = im_base_1.MessageStatus;
|
32
|
-
const MessageReceiptStatus = (0, react_1.memo)(({ receiptBackList, messageStatus }) => {
|
1
|
+
import { receiptStatus } from '../../../default-assets';
|
2
|
+
import { MessageStatus } from '@smart-link/im-base';
|
3
|
+
import { dp } from '@smart-link/rn-ui';
|
4
|
+
import React, { memo } from 'react';
|
5
|
+
import { View, Image, StyleSheet } from 'react-native';
|
6
|
+
const { EMITTED, ARRIVED, READ, } = MessageStatus;
|
7
|
+
const MessageReceiptStatus = memo(({ receiptBackList, messageStatus }) => {
|
33
8
|
let statusSource;
|
34
9
|
let receiptBackMessageStatusList = (receiptBackList || []).map(item => item.receiptBackMessageStatus);
|
35
10
|
if (receiptBackMessageStatusList.includes(READ) || messageStatus === READ) {
|
36
|
-
statusSource =
|
11
|
+
statusSource = receiptStatus[READ];
|
37
12
|
}
|
38
13
|
else if (receiptBackMessageStatusList.includes(ARRIVED) || messageStatus === ARRIVED) {
|
39
|
-
statusSource =
|
14
|
+
statusSource = receiptStatus[ARRIVED];
|
40
15
|
}
|
41
16
|
else if (messageStatus === EMITTED) {
|
42
|
-
statusSource =
|
17
|
+
statusSource = receiptStatus[EMITTED];
|
43
18
|
}
|
44
19
|
if (!statusSource)
|
45
20
|
return null;
|
46
|
-
return (<
|
47
|
-
<
|
48
|
-
</
|
21
|
+
return (<View style={[styles.status]}>
|
22
|
+
<Image resizeMode="contain" style={styles.statusImage} source={statusSource}/>
|
23
|
+
</View>);
|
49
24
|
});
|
50
|
-
const styles =
|
25
|
+
const styles = StyleSheet.create({
|
51
26
|
status: {
|
52
27
|
alignSelf: 'flex-end',
|
53
28
|
flexDirection: 'row',
|
54
|
-
marginRight:
|
29
|
+
marginRight: dp(10),
|
55
30
|
},
|
56
31
|
statusImage: {
|
57
|
-
width:
|
58
|
-
height:
|
32
|
+
width: dp(18),
|
33
|
+
height: dp(18)
|
59
34
|
},
|
60
35
|
});
|
61
|
-
|
36
|
+
export default MessageReceiptStatus;
|
@@ -1,61 +1,31 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
-
};
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.MessageUndo = void 0;
|
30
|
-
const React = __importStar(require("react"));
|
31
|
-
const react_native_1 = require("react-native");
|
32
|
-
const rn_ui_1 = require("@smart-link/rn-ui");
|
33
|
-
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
34
|
-
const init_1 = require("../../../init");
|
35
|
-
const MessageUndo = (props) => {
|
1
|
+
import * as React from 'react';
|
2
|
+
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
3
|
+
import { dp } from "@smart-link/rn-ui";
|
4
|
+
import useTranslation from '../../../hooks/useTranslation';
|
5
|
+
import { getImManager } from "../../../init";
|
6
|
+
export const MessageUndo = (props) => {
|
36
7
|
const { undoText, edit, text, haveBackgroundImage = true } = props;
|
37
|
-
const { t } = (
|
8
|
+
const { t } = useTranslation();
|
38
9
|
const bgStyle = haveBackgroundImage ? { backgroundColor: 'rgba(255,255,255,0.7)' } : {};
|
39
10
|
const bgFont = haveBackgroundImage ? { color: '#555' } : {};
|
40
11
|
const onPress = () => {
|
41
12
|
var _a, _b;
|
42
|
-
const inputRef = (_a =
|
13
|
+
const inputRef = (_a = getImManager()) === null || _a === void 0 ? void 0 : _a.inputRef;
|
43
14
|
if (inputRef) {
|
44
15
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.setMessageText(undoText);
|
45
16
|
}
|
46
17
|
};
|
47
|
-
return (<
|
48
|
-
<
|
49
|
-
<
|
50
|
-
{edit && (undoText === null || undoText === void 0 ? void 0 : undoText.length) && <
|
51
|
-
</
|
52
|
-
</
|
18
|
+
return (<View style={[styles.root, bgStyle]}>
|
19
|
+
<Text style={[styles.text, bgFont]}>{text}</Text>
|
20
|
+
<TouchableOpacity activeOpacity={0.5} onPress={onPress}>
|
21
|
+
{edit && (undoText === null || undoText === void 0 ? void 0 : undoText.length) && <Text style={styles.edit}> {t('reedit')} </Text>}
|
22
|
+
</TouchableOpacity>
|
23
|
+
</View>);
|
53
24
|
};
|
54
|
-
|
55
|
-
const styles = react_native_1.StyleSheet.create({
|
25
|
+
const styles = StyleSheet.create({
|
56
26
|
root: {
|
57
|
-
borderRadius:
|
58
|
-
padding:
|
27
|
+
borderRadius: dp(3),
|
28
|
+
padding: dp(8),
|
59
29
|
flexDirection: 'row',
|
60
30
|
alignSelf: 'center'
|
61
31
|
},
|
@@ -72,4 +42,4 @@ const styles = react_native_1.StyleSheet.create({
|
|
72
42
|
lineHeight: (15)
|
73
43
|
}
|
74
44
|
});
|
75
|
-
|
45
|
+
export default MessageUndo;
|
@@ -1,27 +1,3 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -31,74 +7,70 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
31
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
8
|
});
|
33
9
|
};
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
const
|
47
|
-
const
|
48
|
-
const
|
49
|
-
const
|
50
|
-
const MultipleBar = (0, react_1.memo)((props) => {
|
51
|
-
const navigation = (0, rn_ui_1.useNavigation)();
|
52
|
-
const { multipleSelect } = (0, useImSelector_1.useMessage)();
|
53
|
-
const imManager = (0, init_1.getImManager)();
|
10
|
+
import React, { memo, useEffect, useState } from 'react';
|
11
|
+
import { StyleSheet, TouchableOpacity, Text, View, Animated } from 'react-native';
|
12
|
+
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
|
13
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
14
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
15
|
+
import { dp, Toast, useNavigation } from '@smart-link/rn-ui';
|
16
|
+
import useTranslation from '../../../../hooks/useTranslation';
|
17
|
+
import { useMessage } from '../../../../hooks/useImSelector';
|
18
|
+
import { getImManager } from '../../../../init';
|
19
|
+
import { onMultipleForward } from '@smart-link/im-base/dist/slice/message/message.panel.action';
|
20
|
+
import { MessagePanelActions } from '@smart-link/im-base';
|
21
|
+
import { ConfirmActionSheet } from '../../../../utils/common-action-sheet';
|
22
|
+
const MultipleBar = memo((props) => {
|
23
|
+
const navigation = useNavigation();
|
24
|
+
const { multipleSelect } = useMessage();
|
25
|
+
const imManager = getImManager();
|
54
26
|
const disabled = Object.keys(multipleSelect).length === 0;
|
55
|
-
const { t } = (
|
56
|
-
const [height] =
|
57
|
-
|
58
|
-
|
59
|
-
toValue:
|
27
|
+
const { t } = useTranslation();
|
28
|
+
const [height] = useState(new Animated.Value(0)); // 高度初始值设为0
|
29
|
+
useEffect(() => {
|
30
|
+
Animated.timing(height, {
|
31
|
+
toValue: dp(50),
|
60
32
|
duration: 300,
|
61
33
|
useNativeDriver: false
|
62
34
|
}).start();
|
63
35
|
}, []);
|
64
36
|
const color = disabled ? '#aaaaaa' : '#333';
|
65
37
|
const fontStyle = [styles.text, { color }];
|
66
|
-
return (<
|
67
|
-
<
|
68
|
-
imManager.store.dispatch(
|
38
|
+
return (<Animated.View style={[styles.wrap, { height }]}>
|
39
|
+
<TouchableOpacity disabled={disabled} style={styles.item} onPress={() => {
|
40
|
+
imManager.store.dispatch(onMultipleForward(imManager, true));
|
69
41
|
navigation.navigate('ForwardToConversation');
|
70
42
|
}}>
|
71
|
-
<
|
72
|
-
<
|
73
|
-
<
|
74
|
-
</
|
75
|
-
</
|
43
|
+
<View style={styles.item}>
|
44
|
+
<FontAwesome5 name="reply" size={dp(20)} color={color}/>
|
45
|
+
<Text style={fontStyle}>{t('forward')}</Text>
|
46
|
+
</View>
|
47
|
+
</TouchableOpacity>
|
76
48
|
|
77
|
-
<
|
78
|
-
yield imManager.store.dispatch(
|
79
|
-
|
49
|
+
<TouchableOpacity disabled={disabled} style={styles.item} onPress={() => __awaiter(void 0, void 0, void 0, function* () {
|
50
|
+
yield imManager.store.dispatch(MessagePanelActions.onMultipleCollect(imManager));
|
51
|
+
Toast.info(t('collectSuccess'));
|
80
52
|
})}>
|
81
|
-
<
|
82
|
-
<
|
83
|
-
</
|
53
|
+
<MaterialIcons name="collections" size={dp(20)} color={color}/>
|
54
|
+
<Text style={fontStyle}>{t('collect')}</Text>
|
55
|
+
</TouchableOpacity>
|
84
56
|
|
85
57
|
|
86
|
-
<
|
87
|
-
|
88
|
-
imManager.store.dispatch(
|
58
|
+
<TouchableOpacity disabled={disabled} style={styles.item} onPress={() => {
|
59
|
+
ConfirmActionSheet(t('confirmDeleteMessages'), () => {
|
60
|
+
imManager.store.dispatch(MessagePanelActions.onMultipleDelete(imManager));
|
89
61
|
}, t);
|
90
62
|
}}>
|
91
|
-
<
|
92
|
-
<
|
93
|
-
</
|
94
|
-
</
|
63
|
+
<AntDesign name="delete" size={dp(20)} color={color}/>
|
64
|
+
<Text style={fontStyle}>{t('delete')}</Text>
|
65
|
+
</TouchableOpacity>
|
66
|
+
</Animated.View>);
|
95
67
|
});
|
96
|
-
const styles =
|
68
|
+
const styles = StyleSheet.create({
|
97
69
|
wrap: {
|
98
|
-
paddingTop:
|
70
|
+
paddingTop: dp(10),
|
99
71
|
backgroundColor: '#fff',
|
100
72
|
width: '100%',
|
101
|
-
paddingHorizontal:
|
73
|
+
paddingHorizontal: dp(10),
|
102
74
|
justifyContent: 'space-around',
|
103
75
|
flexDirection: 'row',
|
104
76
|
},
|
@@ -108,9 +80,9 @@ const styles = react_native_1.StyleSheet.create({
|
|
108
80
|
alignItems: 'center'
|
109
81
|
},
|
110
82
|
text: {
|
111
|
-
fontSize:
|
83
|
+
fontSize: dp(12),
|
112
84
|
fontWeight: '500',
|
113
|
-
lineHeight:
|
85
|
+
lineHeight: dp(20)
|
114
86
|
}
|
115
87
|
});
|
116
|
-
|
88
|
+
export default MultipleBar;
|
@@ -1,86 +1,58 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
-
};
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
const useTranslation_1 = __importDefault(require("../../../../hooks/useTranslation"));
|
30
|
-
const rn_ui_1 = require("@smart-link/rn-ui");
|
31
|
-
const react_1 = __importStar(require("react"));
|
32
|
-
const react_native_1 = require("react-native");
|
33
|
-
const PayloadWrapper_1 = __importDefault(require("./PayloadWrapper"));
|
34
|
-
const ChatAvatar_1 = __importDefault(require("../../../../components/ChatAvatar/ChatAvatar"));
|
1
|
+
import useTranslation from '../../../../hooks/useTranslation';
|
2
|
+
import { dp, useNavigation } from '@smart-link/rn-ui';
|
3
|
+
import React, { memo } from 'react';
|
4
|
+
import { View, Text, StyleSheet } from 'react-native';
|
5
|
+
import PayloadWrapper from './PayloadWrapper';
|
6
|
+
import ChatAvatar from '../../../../components/ChatAvatar/ChatAvatar';
|
35
7
|
const PayloadContact = ({ payload, direction, style, showArrow = true, onLongPress }) => {
|
36
|
-
const { t } = (
|
8
|
+
const { t } = useTranslation();
|
37
9
|
const contact = payload.contact;
|
38
|
-
const navigation =
|
39
|
-
return (<
|
10
|
+
const navigation = useNavigation();
|
11
|
+
return (<PayloadWrapper direction={direction} showArrow={showArrow} style={[style, styles.contact]} onPress={() => {
|
40
12
|
navigation.navigate('UserDetail', { userId: contact.userId });
|
41
13
|
}} onLongPress={onLongPress}>
|
42
|
-
<
|
43
|
-
<
|
44
|
-
<
|
45
|
-
<
|
46
|
-
<
|
14
|
+
<View style={styles.content}>
|
15
|
+
<ChatAvatar id={contact.userId} url={contact.avatars} name={contact.userName}/>
|
16
|
+
<View style={styles.info}>
|
17
|
+
<Text style={styles.name}>{contact.userName}</Text>
|
18
|
+
<Text style={styles.group} numberOfLines={2}>
|
47
19
|
{contact.groupNamePaths}
|
48
|
-
</
|
49
|
-
</
|
50
|
-
</
|
51
|
-
<
|
52
|
-
</
|
20
|
+
</Text>
|
21
|
+
</View>
|
22
|
+
</View>
|
23
|
+
<Text style={styles.footer}>{t('contact')}</Text>
|
24
|
+
</PayloadWrapper>);
|
53
25
|
};
|
54
|
-
const styles =
|
26
|
+
const styles = StyleSheet.create({
|
55
27
|
contact: {
|
56
28
|
flexDirection: 'column',
|
57
|
-
padding:
|
58
|
-
borderRadius:
|
59
|
-
width:
|
29
|
+
padding: dp(6),
|
30
|
+
borderRadius: dp(8),
|
31
|
+
width: dp(240),
|
60
32
|
},
|
61
33
|
content: {
|
62
34
|
flex: 1,
|
63
35
|
flexDirection: 'row',
|
64
36
|
borderBottomColor: '#eee',
|
65
|
-
borderBottomWidth:
|
66
|
-
paddingBottom:
|
37
|
+
borderBottomWidth: dp(1),
|
38
|
+
paddingBottom: dp(6),
|
67
39
|
},
|
68
40
|
info: {
|
69
41
|
flex: 1,
|
70
42
|
flexDirection: 'column',
|
71
|
-
marginLeft:
|
43
|
+
marginLeft: dp(12),
|
72
44
|
},
|
73
45
|
name: {
|
74
|
-
fontSize:
|
46
|
+
fontSize: dp(16),
|
75
47
|
color: '#333',
|
76
48
|
},
|
77
49
|
group: {
|
78
50
|
color: '#999',
|
79
|
-
fontSize:
|
51
|
+
fontSize: dp(14),
|
80
52
|
},
|
81
53
|
footer: {
|
82
54
|
color: '#999',
|
83
|
-
fontSize:
|
55
|
+
fontSize: dp(12),
|
84
56
|
},
|
85
57
|
});
|
86
|
-
|
58
|
+
export default memo(PayloadContact);
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { PayloadProps } from './type';
|
3
|
-
declare const _default: React.MemoExoticComponent<({ payload, messageSeq, direction, showArrow, isRecord, messageStatus, sendSize, style, onLongPress }: PayloadProps) => React.JSX.Element>;
|
3
|
+
declare const _default: React.MemoExoticComponent<({ payload, messageSeq, direction, showArrow, isRecord, messageStatus, jobId, sendSize, style, onLongPress }: PayloadProps) => React.JSX.Element>;
|
4
4
|
export default _default;
|