@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,189 +1,155 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
13
|
-
|
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.QuoteMultiple = exports.QuoteVoice = exports.QuoteFile = exports.QuoteVideo = exports.QuotePicture = exports.QuoteTextMix = void 0;
|
30
|
-
const react_1 = __importStar(require("react"));
|
31
|
-
const react_native_1 = require("react-native");
|
32
|
-
const TextMixMessage_1 = __importDefault(require("./TextMixMessage"));
|
33
|
-
const styles_1 = require("../../../components/styles");
|
34
|
-
const AntDesign_1 = __importDefault(require("react-native-vector-icons/AntDesign"));
|
35
|
-
const rn_ui_1 = require("@smart-link/rn-ui");
|
36
|
-
const im_base_1 = require("@smart-link/im-base");
|
37
|
-
const golden_rectangle_1 = require("../../../utils/golden-rectangle");
|
38
|
-
const color_1 = require("../../../utils/color");
|
39
|
-
const LocalImage_1 = __importDefault(require("../../../components/LocalImage"));
|
40
|
-
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
41
|
-
const init_1 = require("../../../init");
|
42
|
-
const PayloadFile_1 = __importDefault(require("./Payload/PayloadFile"));
|
43
|
-
const useDownloadSource_1 = __importStar(require("../../../hooks/useDownloadSource"));
|
1
|
+
import React, { memo } from 'react';
|
2
|
+
import { ActivityIndicator, Image, StyleSheet, Text, TouchableOpacity, View, Dimensions } from 'react-native';
|
3
|
+
import TextMixMessage from './TextMixMessage';
|
4
|
+
import { shadowStyle } from '../../../components/styles';
|
5
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
6
|
+
import { dp, useTheme } from '@smart-link/rn-ui';
|
7
|
+
import { ConversationType, numberToTime, buildSimpleText } from '@smart-link/im-base';
|
8
|
+
import { calculate } from '../../../utils/golden-rectangle';
|
9
|
+
import { dark } from '../../../utils/color';
|
10
|
+
import LocalImage from '../../../components/LocalImage';
|
11
|
+
import useTranslation from '../../../hooks/useTranslation';
|
12
|
+
import { getImManager } from '../../../init';
|
13
|
+
import PayloadFile from './Payload/PayloadFile';
|
44
14
|
const voiceLeft = require('../../../../assets/voice-left.png');
|
45
|
-
const { width } =
|
46
|
-
|
15
|
+
const { width } = Dimensions.get('window');
|
16
|
+
export const QuoteTextMix = memo(props => {
|
47
17
|
const { quoteTitle, quoteText, color, textStyle, quoteStyle, onPressQuote, onLongPressPhone, onLongPressURL } = props;
|
48
|
-
return (<
|
49
|
-
<
|
18
|
+
return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { backgroundColor: dark(color, 4) }]}>
|
19
|
+
<Text style={[textStyle, styles.replyUserName]}>
|
50
20
|
{quoteTitle}
|
51
21
|
{' : '}
|
52
|
-
</
|
53
|
-
<
|
54
|
-
<
|
55
|
-
</
|
22
|
+
</Text>
|
23
|
+
<View style={styles.h5}/>
|
24
|
+
<TextMixMessage text={quoteText} textStyle={textStyle} onLongPressPhone={onLongPressPhone} onLongPressURL={onLongPressURL}/>
|
25
|
+
</TouchableOpacity>);
|
56
26
|
});
|
57
|
-
|
27
|
+
export const QuotePicture = memo(props => {
|
58
28
|
const { quoteTitle, quoteMessage, quoteStyle, color, textStyle, borderColor, backgroundColor, onPressQuote } = props;
|
59
|
-
const { height, width } = quoteMessage.payload;
|
60
|
-
const theme =
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
return (<react_native_1.TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { backgroundColor: (0, color_1.dark)(color, 6) }]}>
|
65
|
-
<react_native_1.Text style={[textStyle, styles.replyUserName]}>
|
29
|
+
const { height, width, localPath } = quoteMessage.payload;
|
30
|
+
const theme = useTheme();
|
31
|
+
const sizeStyle = calculate(height || 100, width || 61.8, 100);
|
32
|
+
return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { backgroundColor: dark(color, 6) }]}>
|
33
|
+
<Text style={[textStyle, styles.replyUserName]}>
|
66
34
|
{quoteTitle}
|
67
35
|
{' : '}
|
68
|
-
</
|
69
|
-
<
|
70
|
-
{(!
|
36
|
+
</Text>
|
37
|
+
<View style={styles.h5}/>
|
38
|
+
{(!localPath) && (<View style={[
|
71
39
|
styles.pictureEmpty,
|
72
40
|
Object.assign({ backgroundColor,
|
73
41
|
borderColor }, sizeStyle),
|
74
|
-
{ backgroundColor:
|
42
|
+
{ backgroundColor: dark(color, 6) },
|
75
43
|
]}>
|
76
|
-
<
|
77
|
-
</
|
44
|
+
<ActivityIndicator color={theme.primaryColor} animating={true}/>
|
45
|
+
</View>)}
|
78
46
|
|
79
|
-
{
|
80
|
-
</
|
47
|
+
{localPath && (<LocalImage style={sizeStyle} resizeMode="cover" localPath={localPath}/>)}
|
48
|
+
</TouchableOpacity>);
|
81
49
|
});
|
82
|
-
|
50
|
+
export const QuoteVideo = memo(props => {
|
83
51
|
const { quoteTitle, quoteMessage, quoteStyle, color, textStyle, borderColor, backgroundColor, onPressQuote } = props;
|
84
|
-
const { duration, height, width } = quoteMessage.payload;
|
85
|
-
const theme =
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
return (<react_native_1.TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { backgroundColor: (0, color_1.dark)(color, 6) }]}>
|
90
|
-
<react_native_1.Text style={[textStyle, styles.replyUserName]}>
|
52
|
+
const { duration, height, width, imagePath } = quoteMessage.payload;
|
53
|
+
const theme = useTheme();
|
54
|
+
const sizeStyle = calculate(height, width);
|
55
|
+
return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { backgroundColor: dark(color, 6) }]}>
|
56
|
+
<Text style={[textStyle, styles.replyUserName]}>
|
91
57
|
{quoteTitle}
|
92
58
|
{' : '}
|
93
|
-
</
|
94
|
-
<
|
95
|
-
{(!
|
59
|
+
</Text>
|
60
|
+
<View style={styles.h5}/>
|
61
|
+
{(!imagePath) && (<View style={[
|
96
62
|
styles.pictureEmpty,
|
97
63
|
Object.assign({ backgroundColor,
|
98
64
|
borderColor }, sizeStyle),
|
99
|
-
{ backgroundColor:
|
65
|
+
{ backgroundColor: dark(color, 6) },
|
100
66
|
]}>
|
101
|
-
<
|
102
|
-
</
|
67
|
+
<ActivityIndicator color={theme.primaryColor} animating={true}/>
|
68
|
+
</View>)}
|
103
69
|
|
104
|
-
{
|
105
|
-
<
|
106
|
-
<
|
107
|
-
<
|
108
|
-
</
|
109
|
-
<
|
110
|
-
<
|
111
|
-
</
|
112
|
-
</
|
113
|
-
</
|
70
|
+
{imagePath && (<View style={{ width: sizeStyle.width }}>
|
71
|
+
<LocalImage style={sizeStyle} resizeMode="cover" localPath={imagePath}/>
|
72
|
+
<View style={styles.playView}>
|
73
|
+
<AntDesign size={30} name="playcircleo" color="#fff"/>
|
74
|
+
</View>
|
75
|
+
<View style={{ position: 'absolute', bottom: dp(5), right: dp(5) }}>
|
76
|
+
<Text style={{ fontSize: dp(12), color: '#fff' }}>{numberToTime(duration)}</Text>
|
77
|
+
</View>
|
78
|
+
</View>)}
|
79
|
+
</TouchableOpacity>);
|
114
80
|
});
|
115
|
-
|
81
|
+
export const QuoteFile = memo(props => {
|
116
82
|
const { quoteTitle, quoteMessage, color, textStyle, onPressQuote } = props;
|
117
|
-
return (<
|
118
|
-
<
|
83
|
+
return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[styles.leftBorder, { padding: dp(5), backgroundColor: dark(color, 6) }]}>
|
84
|
+
<Text style={[textStyle, styles.replyUserName]}>
|
119
85
|
{quoteTitle}
|
120
86
|
{' : '}
|
121
|
-
</
|
122
|
-
<
|
123
|
-
<
|
124
|
-
<
|
125
|
-
</
|
126
|
-
</
|
87
|
+
</Text>
|
88
|
+
<View style={styles.h5}/>
|
89
|
+
<View style={[styles.popoverFile, { backgroundColor: dark(color, 10) }]}>
|
90
|
+
<PayloadFile {...quoteMessage} style={{ flex: 1 }} showArrow={false}/>
|
91
|
+
</View>
|
92
|
+
</TouchableOpacity>);
|
127
93
|
});
|
128
|
-
|
94
|
+
export const QuoteVoice = memo(props => {
|
129
95
|
const { quoteTitle, quoteMessage, color, textStyle, onPressQuote } = props;
|
130
96
|
const { duration } = quoteMessage.payload;
|
131
97
|
let voiceViewLength = 40 + (80 * duration) / 60;
|
132
|
-
voiceViewLength =
|
133
|
-
return (<
|
134
|
-
<
|
98
|
+
voiceViewLength = dp(voiceViewLength > 120 ? 120 : voiceViewLength);
|
99
|
+
return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[styles.leftBorder, { padding: dp(5), backgroundColor: dark(color, 6) }]}>
|
100
|
+
<Text style={[textStyle, styles.replyUserName]}>
|
135
101
|
{quoteTitle}
|
136
102
|
{' : '}
|
137
|
-
</
|
138
|
-
<
|
103
|
+
</Text>
|
104
|
+
<View style={styles.h5}/>
|
139
105
|
|
140
|
-
<
|
141
|
-
<
|
142
|
-
<
|
143
|
-
</
|
144
|
-
<
|
145
|
-
</
|
146
|
-
</
|
106
|
+
<View style={[styles.popoverVoice, { backgroundColor: dark(color, 10), width: voiceViewLength + dp(10) }]}>
|
107
|
+
<View style={{ width: voiceViewLength, alignItems: 'flex-start' }}>
|
108
|
+
<Image style={styles.voiceImage} source={voiceLeft}></Image>
|
109
|
+
</View>
|
110
|
+
<Text style={styles.duration}>{Math.round(duration || 0)}''</Text>
|
111
|
+
</View>
|
112
|
+
</TouchableOpacity>);
|
147
113
|
});
|
148
|
-
|
114
|
+
export const QuoteMultiple = memo(props => {
|
149
115
|
const { quoteTitle, quoteMessage, color, textStyle, quoteStyle, onPressQuote } = props;
|
150
116
|
const { type, fromName, toName, selectedMessages } = quoteMessage.payload;
|
151
|
-
const { t } = (
|
117
|
+
const { t } = useTranslation();
|
152
118
|
const messages = selectedMessages.length > 4 ? [...selectedMessages.slice(0, 4), 'more'] : selectedMessages;
|
153
|
-
const title = type ===
|
119
|
+
const title = type === ConversationType.C2C
|
154
120
|
? t('multipleChatRecordTitle', { fromName, toName })
|
155
121
|
: t('multipleChatRecordTitleGroup');
|
156
|
-
const imManager =
|
157
|
-
return (<
|
158
|
-
<
|
122
|
+
const imManager = getImManager();
|
123
|
+
return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { padding: dp(5), backgroundColor: dark(color, 4) }]}>
|
124
|
+
<Text style={[textStyle, styles.replyUserName]}>
|
159
125
|
{quoteTitle}
|
160
126
|
{' : '}
|
161
|
-
</
|
162
|
-
<
|
163
|
-
<
|
127
|
+
</Text>
|
128
|
+
<View style={styles.h5}/>
|
129
|
+
<Text style={styles.mulTitleText} numberOfLines={2}>
|
164
130
|
{title}
|
165
|
-
</
|
166
|
-
<
|
131
|
+
</Text>
|
132
|
+
<View style={styles.mulContent}>
|
167
133
|
{messages.map((message, index) => {
|
168
134
|
if (typeof message === 'string') {
|
169
|
-
return (<
|
135
|
+
return (<Text key={index} style={styles.mulItemTextMore}>
|
170
136
|
......
|
171
|
-
</
|
137
|
+
</Text>);
|
172
138
|
}
|
173
|
-
return (<
|
139
|
+
return (<Text key={index} style={styles.mulItemText} numberOfLines={1}>
|
174
140
|
{message.messageFromName +
|
175
141
|
': ' +
|
176
|
-
|
177
|
-
</
|
142
|
+
buildSimpleText(imManager, message.payloadType, message.payload)}
|
143
|
+
</Text>);
|
178
144
|
})}
|
179
|
-
</
|
180
|
-
<
|
181
|
-
<
|
182
|
-
</
|
145
|
+
</View>
|
146
|
+
<View style={styles.mulLine}/>
|
147
|
+
<Text style={styles.mulFooterText}>{t('multipleChatRecord')}</Text>
|
148
|
+
</TouchableOpacity>);
|
183
149
|
});
|
184
|
-
const styles =
|
150
|
+
const styles = StyleSheet.create({
|
185
151
|
h5: {
|
186
|
-
height:
|
152
|
+
height: dp(5),
|
187
153
|
},
|
188
154
|
pictureEmpty: {
|
189
155
|
justifyContent: 'center',
|
@@ -200,79 +166,79 @@ const styles = react_native_1.StyleSheet.create({
|
|
200
166
|
},
|
201
167
|
fileInfo: {
|
202
168
|
flex: 1,
|
203
|
-
paddingHorizontal:
|
169
|
+
paddingHorizontal: dp(10),
|
204
170
|
justifyContent: 'center',
|
205
171
|
},
|
206
172
|
fileName: {
|
207
|
-
fontSize:
|
208
|
-
lineHeight:
|
173
|
+
fontSize: dp(15),
|
174
|
+
lineHeight: dp(20),
|
209
175
|
color: '#010101',
|
210
176
|
},
|
211
177
|
fileSize: {
|
212
|
-
fontSize:
|
213
|
-
lineHeight:
|
178
|
+
fontSize: dp(12),
|
179
|
+
lineHeight: dp(20),
|
214
180
|
color: '#a2a2a2',
|
215
181
|
},
|
216
182
|
imageIcon: {
|
217
|
-
height:
|
183
|
+
height: dp(45),
|
218
184
|
},
|
219
185
|
popoverFile: {
|
220
186
|
backgroundColor: '#fff',
|
221
187
|
flexDirection: 'row',
|
222
|
-
paddingVertical:
|
223
|
-
width: width -
|
188
|
+
paddingVertical: dp(8),
|
189
|
+
width: width - dp(145),
|
224
190
|
},
|
225
191
|
voiceImage: {
|
226
|
-
width:
|
227
|
-
height:
|
192
|
+
width: dp(24),
|
193
|
+
height: dp(18),
|
228
194
|
},
|
229
195
|
duration: {
|
230
|
-
fontSize:
|
231
|
-
lineHeight:
|
196
|
+
fontSize: dp(13),
|
197
|
+
lineHeight: dp(21),
|
232
198
|
color: '#666',
|
233
199
|
position: 'absolute',
|
234
|
-
right:
|
200
|
+
right: dp(5),
|
235
201
|
alignSelf: 'center',
|
236
202
|
},
|
237
|
-
popoverVoice: Object.assign({ flexDirection: 'row', padding:
|
203
|
+
popoverVoice: Object.assign({ flexDirection: 'row', padding: dp(9), borderRadius: dp(3), borderStyle: 'solid' }, shadowStyle),
|
238
204
|
replyUserName: {
|
239
205
|
fontWeight: '600',
|
240
206
|
},
|
241
207
|
leftBorder: {
|
242
|
-
borderLeftWidth:
|
208
|
+
borderLeftWidth: dp(4),
|
243
209
|
borderColor: '#adadad',
|
244
|
-
borderRadius:
|
210
|
+
borderRadius: dp(4),
|
245
211
|
},
|
246
212
|
mulTitleText: {
|
247
213
|
color: '#333',
|
248
|
-
fontSize:
|
249
|
-
lineHeight:
|
214
|
+
fontSize: dp(14),
|
215
|
+
lineHeight: dp(18),
|
250
216
|
},
|
251
217
|
mulContent: {
|
252
|
-
paddingVertical:
|
218
|
+
paddingVertical: dp(5),
|
253
219
|
},
|
254
220
|
mulItem: {
|
255
221
|
justifyContent: 'center',
|
256
222
|
},
|
257
223
|
mulItemText: {
|
258
224
|
color: '#999',
|
259
|
-
fontSize:
|
260
|
-
lineHeight:
|
225
|
+
fontSize: dp(13),
|
226
|
+
lineHeight: dp(19),
|
261
227
|
},
|
262
228
|
mulItemTextMore: {
|
263
229
|
color: '#999',
|
264
|
-
fontSize:
|
265
|
-
lineHeight:
|
230
|
+
fontSize: dp(13),
|
231
|
+
lineHeight: dp(13),
|
266
232
|
},
|
267
233
|
mulFooterText: {
|
268
234
|
color: '#777',
|
269
|
-
fontSize:
|
235
|
+
fontSize: dp(13),
|
270
236
|
},
|
271
237
|
mulLine: {
|
272
|
-
marginTop:
|
273
|
-
marginBottom:
|
238
|
+
marginTop: dp(5),
|
239
|
+
marginBottom: dp(5),
|
274
240
|
backgroundColor: '#ddd',
|
275
241
|
width: '100%',
|
276
|
-
height:
|
242
|
+
height: dp(1),
|
277
243
|
},
|
278
244
|
});
|
@@ -1,38 +1,10 @@
|
|
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 react_1 = __importStar(require("react"));
|
30
|
-
const TextMixQuote_1 = require("./TextMixQuote");
|
31
|
-
const react_native_1 = require("react-native");
|
32
|
-
const TextMixMessage_1 = __importDefault(require("./TextMixMessage"));
|
33
|
-
const im_base_1 = require("@smart-link/im-base");
|
34
|
-
const { TEXT, VOICE, VIDEO, PICTURE, FILE, MULTIPLE } = im_base_1.PayloadType;
|
35
|
-
const TextMixQuoteMessage = (0, react_1.memo)(props => {
|
1
|
+
import React, { memo } from 'react';
|
2
|
+
import { QuoteFile, QuotePicture, QuoteTextMix, QuoteVideo, QuoteVoice, QuoteMultiple } from './TextMixQuote';
|
3
|
+
import { View } from 'react-native';
|
4
|
+
import TextMixMessage from './TextMixMessage';
|
5
|
+
import { PayloadType } from '@smart-link/im-base';
|
6
|
+
const { TEXT, VOICE, VIDEO, PICTURE, FILE, MULTIPLE } = PayloadType;
|
7
|
+
const TextMixQuoteMessage = memo(props => {
|
36
8
|
const { text, quote, textStyle, quoteStyle, quoteBgColor, onLongPressPhone, onLongPressURL, onPressQuote } = props;
|
37
9
|
let quotePayloadType;
|
38
10
|
let quoteMessageSeq;
|
@@ -43,32 +15,32 @@ const TextMixQuoteMessage = (0, react_1.memo)(props => {
|
|
43
15
|
}
|
44
16
|
return (<>
|
45
17
|
{haveQuote && (<>
|
46
|
-
{quotePayloadType === TEXT && (<
|
18
|
+
{quotePayloadType === TEXT && (<QuoteTextMix quoteTitle={quote.quoteTitle} quoteText={quote.quoteText} color={quoteBgColor} quoteStyle={quoteStyle} textStyle={textStyle} onLongPressPhone={onLongPressPhone} onLongPressURL={onLongPressURL} onPressQuote={() => {
|
47
19
|
onPressQuote === null || onPressQuote === void 0 ? void 0 : onPressQuote(quoteMessageSeq);
|
48
20
|
}}/>)}
|
49
21
|
|
50
|
-
{quotePayloadType === PICTURE && (<
|
51
|
-
onPressQuote
|
22
|
+
{quotePayloadType === PICTURE && (<QuotePicture quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} quoteStyle={quoteStyle} color={quoteBgColor} textStyle={textStyle} backgroundColor={quoteBgColor} borderColor={quoteBgColor} onPressQuote={() => {
|
23
|
+
onPressQuote === null || onPressQuote === void 0 ? void 0 : onPressQuote(quoteMessageSeq);
|
52
24
|
}}/>)}
|
53
25
|
|
54
|
-
{quotePayloadType === VIDEO && (<
|
55
|
-
onPressQuote
|
26
|
+
{quotePayloadType === VIDEO && (<QuoteVideo quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} quoteStyle={quoteStyle} color={quoteBgColor} textStyle={textStyle} backgroundColor={quoteBgColor} borderColor={quoteBgColor} onPressQuote={() => {
|
27
|
+
onPressQuote === null || onPressQuote === void 0 ? void 0 : onPressQuote(quoteMessageSeq);
|
56
28
|
}}/>)}
|
57
29
|
|
58
|
-
{quotePayloadType === FILE && (<
|
59
|
-
onPressQuote
|
30
|
+
{quotePayloadType === FILE && (<QuoteFile quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} color={quoteBgColor} textStyle={textStyle} onPressQuote={() => {
|
31
|
+
onPressQuote === null || onPressQuote === void 0 ? void 0 : onPressQuote(quoteMessageSeq);
|
60
32
|
}}/>)}
|
61
33
|
|
62
|
-
{quotePayloadType === VOICE && (<
|
34
|
+
{quotePayloadType === VOICE && (<QuoteVoice quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} color={quoteBgColor} textStyle={textStyle} onPressQuote={() => {
|
63
35
|
onPressQuote && onPressQuote(quoteMessageSeq);
|
64
36
|
}}/>)}
|
65
|
-
{quotePayloadType === MULTIPLE && (<
|
37
|
+
{quotePayloadType === MULTIPLE && (<QuoteMultiple quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} color={quoteBgColor} textStyle={textStyle} onPressQuote={() => {
|
66
38
|
onPressQuote && onPressQuote(quoteMessageSeq);
|
67
39
|
}}/>)}
|
68
|
-
<
|
40
|
+
<View style={{ height: 10 }}/>
|
69
41
|
</>)}
|
70
42
|
|
71
|
-
<
|
43
|
+
<TextMixMessage text={text} textStyle={textStyle} onLongPressPhone={onLongPressPhone} onLongPressURL={onLongPressURL}/>
|
72
44
|
</>);
|
73
45
|
});
|
74
|
-
|
46
|
+
export default TextMixQuoteMessage;
|
@@ -1,33 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
const react_1 = __importStar(require("react"));
|
27
|
-
const rn_ui_1 = require("@smart-link/rn-ui");
|
28
|
-
const react_native_progress_1 = require("react-native-progress");
|
29
|
-
const react_native_1 = require("react-native");
|
30
|
-
const file_1 = require("../../../utils/file");
|
1
|
+
import React, { memo } from 'react';
|
2
|
+
import { dp } from '@smart-link/rn-ui';
|
3
|
+
import { Bar } from 'react-native-progress';
|
4
|
+
import { View, StyleSheet, Text } from 'react-native';
|
5
|
+
import { numberToFileSize } from '../../../utils/file';
|
31
6
|
const UploadProgress = ({ show, sendSize, totalSize, width }) => {
|
32
7
|
if (!show) {
|
33
8
|
return null;
|
@@ -36,16 +11,16 @@ const UploadProgress = ({ show, sendSize, totalSize, width }) => {
|
|
36
11
|
return null;
|
37
12
|
}
|
38
13
|
const progress = sendSize / totalSize;
|
39
|
-
return (<
|
40
|
-
<
|
41
|
-
<
|
42
|
-
</
|
14
|
+
return (<View>
|
15
|
+
<Bar progress={progress} width={width} height={dp(3)} color={'#999'} borderRadius={dp(1)}/>
|
16
|
+
<Text style={styles.rate}>{numberToFileSize(sendSize) + ' / ' + numberToFileSize(totalSize)}</Text>
|
17
|
+
</View>);
|
43
18
|
};
|
44
|
-
const styles =
|
19
|
+
const styles = StyleSheet.create({
|
45
20
|
rate: {
|
46
21
|
alignSelf: 'flex-end',
|
47
|
-
fontSize:
|
22
|
+
fontSize: dp(10),
|
48
23
|
color: '#999'
|
49
24
|
}
|
50
25
|
});
|
51
|
-
|
26
|
+
export default memo(UploadProgress);
|