@smart-link/rn-im 1.0.23 → 1.0.24

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.
Files changed (155) hide show
  1. package/dist/api/addressList.js +6 -17
  2. package/dist/api/backup.js +8 -20
  3. package/dist/api/file.js +6 -35
  4. package/dist/api/user.js +6 -16
  5. package/dist/components/CachedImage.js +14 -42
  6. package/dist/components/Camera/Camera.js +26 -54
  7. package/dist/components/Camera/CameraCapture.js +99 -128
  8. package/dist/components/Camera/CameraResult.js +33 -61
  9. package/dist/components/ChatAvatar/ChatAvatar.d.ts +1 -1
  10. package/dist/components/ChatAvatar/ChatAvatar.js +34 -62
  11. package/dist/components/ChatAvatar/ChatAvatarId.d.ts +2 -2
  12. package/dist/components/ChatAvatar/ChatAvatarId.js +26 -51
  13. package/dist/components/ChatAvatar/ChatAvatarLocal.d.ts +2 -2
  14. package/dist/components/ChatAvatar/ChatAvatarLocal.js +23 -25
  15. package/dist/components/ChatAvatar/index.js +2 -23
  16. package/dist/components/Favicon.js +6 -34
  17. package/dist/components/FormatTimeText.js +5 -10
  18. package/dist/components/Highlighter.js +9 -34
  19. package/dist/components/IndicatorText.js +14 -39
  20. package/dist/components/LocalImage.js +7 -32
  21. package/dist/components/NetworkUnconnected.js +14 -42
  22. package/dist/components/PopoverWrapper.js +22 -47
  23. package/dist/components/VideoPlayer.js +111 -138
  24. package/dist/components/styles.js +10 -13
  25. package/dist/default-assets.d.ts +1 -0
  26. package/dist/default-assets.js +8 -10
  27. package/dist/hooks/useDownloadSource.js +7 -12
  28. package/dist/hooks/useFormatMsgTime.js +5 -13
  29. package/dist/hooks/useImReady.js +7 -10
  30. package/dist/hooks/useImSelector.js +34 -48
  31. package/dist/hooks/useTranslation.js +5 -10
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.js +8 -28
  34. package/dist/init.js +30 -40
  35. package/dist/interface.js +1 -2
  36. package/dist/locales/en/addressList.js +1 -3
  37. package/dist/locales/index.js +4 -27
  38. package/dist/locales/lao/addressList.js +1 -3
  39. package/dist/locales/zh/addressList.js +1 -3
  40. package/dist/pages/address-list/AddressList.js +33 -61
  41. package/dist/pages/address-list/CardInfo.js +10 -18
  42. package/dist/pages/address-list/ChooseContact.js +50 -78
  43. package/dist/pages/address-list/Icons.js +7 -14
  44. package/dist/pages/address-list/Organization.js +59 -89
  45. package/dist/pages/address-list/UserDetail.js +55 -83
  46. package/dist/pages/address-list/UserJobs.js +31 -33
  47. package/dist/pages/address-list/UserSearch.js +29 -54
  48. package/dist/pages/address-list/addressList.routes.js +11 -16
  49. package/dist/pages/collection/Collection.js +53 -81
  50. package/dist/pages/collection/ContentFactory.js +53 -82
  51. package/dist/pages/collection/collection.routes.js +3 -9
  52. package/dist/pages/conversation/ForwardToConversation.js +63 -91
  53. package/dist/pages/conversation/List.js +74 -102
  54. package/dist/pages/conversation/components/ConversationCard.js +46 -74
  55. package/dist/pages/conversation/components/ConversationOption.js +27 -55
  56. package/dist/pages/conversation/conversation.routes.js +17 -23
  57. package/dist/pages/conversation/setting/GroupTransfer.js +32 -60
  58. package/dist/pages/conversation/setting/OptionAvatars.js +62 -90
  59. package/dist/pages/conversation/setting/OptionCancelGroup.js +14 -42
  60. package/dist/pages/conversation/setting/OptionConversation.js +20 -48
  61. package/dist/pages/conversation/setting/OptionGroup.js +20 -48
  62. package/dist/pages/conversation/setting/OptionGroupManage.js +21 -49
  63. package/dist/pages/conversation/setting/OptionGroupMoreMember.js +48 -53
  64. package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.js +49 -77
  65. package/dist/pages/conversation/setting/Setting.js +49 -54
  66. package/dist/pages/conversation/setting/SettingChatBg.js +26 -54
  67. package/dist/pages/index.js +7 -27
  68. package/dist/pages/message/ChooseMember.js +56 -84
  69. package/dist/pages/message/MessageBackup/Bar.js +18 -43
  70. package/dist/pages/message/MessageBackup/MessageBackup.js +42 -72
  71. package/dist/pages/message/MessageBackup/RestoreBackupPage.js +48 -76
  72. package/dist/pages/message/MessageBackup/StartBackupPage.js +48 -76
  73. package/dist/pages/message/MessageBackup/index.js +3 -12
  74. package/dist/pages/message/MessageBackup/utils.js +14 -22
  75. package/dist/pages/message/MessageList.js +141 -135
  76. package/dist/pages/message/MessageRecord.js +49 -73
  77. package/dist/pages/message/components/BusiNotifyCard.js +60 -85
  78. package/dist/pages/message/components/ChatBg.js +11 -36
  79. package/dist/pages/message/components/MessageItem.js +82 -110
  80. package/dist/pages/message/components/MessageItemQuote.js +30 -58
  81. package/dist/pages/message/components/MessageItemTips.js +27 -55
  82. package/dist/pages/message/components/MessageOption.js +96 -120
  83. package/dist/pages/message/components/MessagePayload.js +36 -64
  84. package/dist/pages/message/components/MessagePictureAlbum.js +32 -60
  85. package/dist/pages/message/components/MessageReceiptStatus.js +18 -43
  86. package/dist/pages/message/components/MessageUndo.js +18 -48
  87. package/dist/pages/message/components/MultipleBar/index.js +48 -76
  88. package/dist/pages/message/components/Payload/PayloadContact.js +30 -58
  89. package/dist/pages/message/components/Payload/PayloadFile.js +41 -65
  90. package/dist/pages/message/components/Payload/PayloadMultiple.js +38 -66
  91. package/dist/pages/message/components/Payload/PayloadNotify.js +28 -56
  92. package/dist/pages/message/components/Payload/PayloadPicture.js +21 -49
  93. package/dist/pages/message/components/Payload/PayloadShare.js +39 -67
  94. package/dist/pages/message/components/Payload/PayloadText.js +39 -67
  95. package/dist/pages/message/components/Payload/PayloadVideo.js +28 -56
  96. package/dist/pages/message/components/Payload/PayloadVoice.js +80 -93
  97. package/dist/pages/message/components/Payload/PayloadWrapper.js +18 -43
  98. package/dist/pages/message/components/Payload/type.js +1 -2
  99. package/dist/pages/message/components/ReceiptBack.js +31 -61
  100. package/dist/pages/message/components/TextMixMessage.js +13 -38
  101. package/dist/pages/message/components/TextMixQuote.js +129 -158
  102. package/dist/pages/message/components/TextMixQuoteMessage.js +16 -44
  103. package/dist/pages/message/components/UploadProgress.js +12 -37
  104. package/dist/pages/message/components/messageBar/EmojiPanel.js +25 -50
  105. package/dist/pages/message/components/messageBar/Icons.js +56 -74
  106. package/dist/pages/message/components/messageBar/MessageBar.js +84 -115
  107. package/dist/pages/message/components/messageBar/MessageInput.js +30 -55
  108. package/dist/pages/message/components/messageBar/OptionPanel.js +54 -82
  109. package/dist/pages/message/components/messageBar/VoiceBar.js +122 -100
  110. package/dist/pages/message/components/messageBar/index.js +2 -23
  111. package/dist/pages/message/message.routes.js +11 -40
  112. package/dist/pages/search/Search.js +38 -66
  113. package/dist/pages/search/SearchChatRecords.js +64 -92
  114. package/dist/pages/search/SearchFile.js +68 -96
  115. package/dist/pages/search/SearchManager.js +60 -65
  116. package/dist/pages/search/SearchPicturePage.js +16 -44
  117. package/dist/pages/search/components/ChatRecords.js +46 -74
  118. package/dist/pages/search/components/MyGroupChat.js +41 -69
  119. package/dist/pages/search/components/PictureMulipleBar.js +35 -63
  120. package/dist/pages/search/components/SearchFileList.js +59 -64
  121. package/dist/pages/search/components/SearchPictures.js +68 -98
  122. package/dist/pages/search/components/SearchShareLinkList.js +50 -55
  123. package/dist/pages/search/components/SearchUser.js +25 -53
  124. package/dist/pages/search/components/useSearchMessage.js +12 -16
  125. package/dist/pages/search/search.routes.js +11 -17
  126. package/dist/pages/search/utils.js +4 -12
  127. package/dist/pages/types.js +1 -2
  128. package/dist/slice/contact/contact.action.js +1 -2
  129. package/dist/slice/contact/contact.slice.js +4 -8
  130. package/dist/slice/index.js +7 -13
  131. package/dist/slice/panel/panel.slice.d.ts +2 -1
  132. package/dist/slice/panel/panel.slice.js +8 -7
  133. package/dist/slice/video/video.action.d.ts +1 -0
  134. package/dist/slice/video/video.action.js +56 -38
  135. package/dist/slice/video/video.slice.d.ts +1 -1
  136. package/dist/slice/video/video.slice.js +7 -8
  137. package/dist/utils/audio.d.ts +3 -0
  138. package/dist/utils/audio.js +10 -0
  139. package/dist/utils/color.js +2 -9
  140. package/dist/utils/common-action-sheet.js +9 -14
  141. package/dist/utils/cookie.js +6 -14
  142. package/dist/utils/emoji.js +9 -12
  143. package/dist/utils/file-icon.js +33 -60
  144. package/dist/utils/file-operate.js +1 -2
  145. package/dist/utils/file.d.ts +1 -1
  146. package/dist/utils/file.js +74 -87
  147. package/dist/utils/golden-rectangle.js +3 -7
  148. package/dist/utils/phone.js +13 -22
  149. package/dist/utils/request.js +7 -15
  150. package/dist/utils/scroll.js +5 -9
  151. package/dist/utils/summary.js +4 -11
  152. package/dist/utils/take-camera.js +12 -19
  153. package/dist/utils/text-mix.js +4 -11
  154. package/dist/utils/upload.js +20 -41
  155. package/package.json +6 -7
@@ -1,189 +1,160 @@
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
- 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';
14
+ import useDownloadSource, { useDownloadImgSource } from "../../../hooks/useDownloadSource";
44
15
  const voiceLeft = require('../../../../assets/voice-left.png');
45
- const { width } = react_native_1.Dimensions.get('window');
46
- exports.QuoteTextMix = (0, react_1.memo)(props => {
16
+ const { width } = Dimensions.get('window');
17
+ export const QuoteTextMix = memo(props => {
47
18
  const { quoteTitle, quoteText, color, textStyle, quoteStyle, onPressQuote, onLongPressPhone, onLongPressURL } = props;
48
- return (<react_native_1.TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { backgroundColor: (0, color_1.dark)(color, 4) }]}>
49
- <react_native_1.Text style={[textStyle, styles.replyUserName]}>
19
+ return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { backgroundColor: dark(color, 4) }]}>
20
+ <Text style={[textStyle, styles.replyUserName]}>
50
21
  {quoteTitle}
51
22
  {' : '}
52
- </react_native_1.Text>
53
- <react_native_1.View style={styles.h5}/>
54
- <TextMixMessage_1.default text={quoteText} textStyle={textStyle} onLongPressPhone={onLongPressPhone} onLongPressURL={onLongPressURL}/>
55
- </react_native_1.TouchableOpacity>);
23
+ </Text>
24
+ <View style={styles.h5}/>
25
+ <TextMixMessage text={quoteText} textStyle={textStyle} onLongPressPhone={onLongPressPhone} onLongPressURL={onLongPressURL}/>
26
+ </TouchableOpacity>);
56
27
  });
57
- exports.QuotePicture = (0, react_1.memo)(props => {
28
+ export const QuotePicture = memo(props => {
58
29
  const { quoteTitle, quoteMessage, quoteStyle, color, textStyle, borderColor, backgroundColor, onPressQuote } = props;
59
30
  const { height, width } = quoteMessage.payload;
60
- const theme = (0, rn_ui_1.useTheme)();
31
+ const theme = useTheme();
61
32
  console.log('QuotePicture', quoteMessage);
62
- const localImg = (0, useDownloadSource_1.default)(quoteMessage.payload);
63
- const sizeStyle = (0, golden_rectangle_1.calculate)(height || 100, width || 61.8, 100);
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]}>
33
+ const localImg = useDownloadSource(quoteMessage.payload);
34
+ const sizeStyle = calculate(height || 100, width || 61.8, 100);
35
+ return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { backgroundColor: dark(color, 6) }]}>
36
+ <Text style={[textStyle, styles.replyUserName]}>
66
37
  {quoteTitle}
67
38
  {' : '}
68
- </react_native_1.Text>
69
- <react_native_1.View style={styles.h5}/>
70
- {(!localImg) && (<react_native_1.View style={[
39
+ </Text>
40
+ <View style={styles.h5}/>
41
+ {(!localImg) && (<View style={[
71
42
  styles.pictureEmpty,
72
43
  Object.assign({ backgroundColor,
73
44
  borderColor }, sizeStyle),
74
- { backgroundColor: (0, color_1.dark)(color, 6) },
45
+ { backgroundColor: dark(color, 6) },
75
46
  ]}>
76
- <react_native_1.ActivityIndicator color={theme.primaryColor} animating={true}/>
77
- </react_native_1.View>)}
47
+ <ActivityIndicator color={theme.primaryColor} animating={true}/>
48
+ </View>)}
78
49
 
79
- {localImg && (<LocalImage_1.default style={sizeStyle} resizeMode="cover" localPath={localImg}/>)}
80
- </react_native_1.TouchableOpacity>);
50
+ {localImg && (<LocalImage style={sizeStyle} resizeMode="cover" localPath={localImg}/>)}
51
+ </TouchableOpacity>);
81
52
  });
82
- exports.QuoteVideo = (0, react_1.memo)(props => {
53
+ export const QuoteVideo = memo(props => {
83
54
  const { quoteTitle, quoteMessage, quoteStyle, color, textStyle, borderColor, backgroundColor, onPressQuote } = props;
84
55
  const { duration, height, width } = quoteMessage.payload;
85
- const theme = (0, rn_ui_1.useTheme)();
56
+ const theme = useTheme();
86
57
  console.log('QuoteVideo: ', quoteMessage);
87
- const sizeStyle = (0, golden_rectangle_1.calculate)(height, width);
88
- const localImg = (0, useDownloadSource_1.useDownloadImgSource)(quoteMessage.payload);
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]}>
58
+ const sizeStyle = calculate(height, width);
59
+ const localImg = useDownloadImgSource(quoteMessage.payload);
60
+ return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { backgroundColor: dark(color, 6) }]}>
61
+ <Text style={[textStyle, styles.replyUserName]}>
91
62
  {quoteTitle}
92
63
  {' : '}
93
- </react_native_1.Text>
94
- <react_native_1.View style={styles.h5}/>
95
- {(!localImg) && (<react_native_1.View style={[
64
+ </Text>
65
+ <View style={styles.h5}/>
66
+ {(!localImg) && (<View style={[
96
67
  styles.pictureEmpty,
97
68
  Object.assign({ backgroundColor,
98
69
  borderColor }, sizeStyle),
99
- { backgroundColor: (0, color_1.dark)(color, 6) },
70
+ { backgroundColor: dark(color, 6) },
100
71
  ]}>
101
- <react_native_1.ActivityIndicator color={theme.primaryColor} animating={true}/>
102
- </react_native_1.View>)}
72
+ <ActivityIndicator color={theme.primaryColor} animating={true}/>
73
+ </View>)}
103
74
 
104
- {localImg && (<react_native_1.View style={{ width: sizeStyle.width }}>
105
- <LocalImage_1.default style={sizeStyle} resizeMode="cover" localPath={localImg}/>
106
- <react_native_1.View style={styles.playView}>
107
- <AntDesign_1.default size={30} name="playcircleo" color="#fff"/>
108
- </react_native_1.View>
109
- <react_native_1.View style={{ position: 'absolute', bottom: (0, rn_ui_1.dp)(5), right: (0, rn_ui_1.dp)(5) }}>
110
- <react_native_1.Text style={{ fontSize: (0, rn_ui_1.dp)(12), color: '#fff' }}>{(0, im_base_1.numberToTime)(duration)}</react_native_1.Text>
111
- </react_native_1.View>
112
- </react_native_1.View>)}
113
- </react_native_1.TouchableOpacity>);
75
+ {localImg && (<View style={{ width: sizeStyle.width }}>
76
+ <LocalImage style={sizeStyle} resizeMode="cover" localPath={localImg}/>
77
+ <View style={styles.playView}>
78
+ <AntDesign size={30} name="playcircleo" color="#fff"/>
79
+ </View>
80
+ <View style={{ position: 'absolute', bottom: dp(5), right: dp(5) }}>
81
+ <Text style={{ fontSize: dp(12), color: '#fff' }}>{numberToTime(duration)}</Text>
82
+ </View>
83
+ </View>)}
84
+ </TouchableOpacity>);
114
85
  });
115
- exports.QuoteFile = (0, react_1.memo)(props => {
86
+ export const QuoteFile = memo(props => {
116
87
  const { quoteTitle, quoteMessage, color, textStyle, onPressQuote } = props;
117
- return (<react_native_1.TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[styles.leftBorder, { padding: (0, rn_ui_1.dp)(5), backgroundColor: (0, color_1.dark)(color, 6) }]}>
118
- <react_native_1.Text style={[textStyle, styles.replyUserName]}>
88
+ return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[styles.leftBorder, { padding: dp(5), backgroundColor: dark(color, 6) }]}>
89
+ <Text style={[textStyle, styles.replyUserName]}>
119
90
  {quoteTitle}
120
91
  {' : '}
121
- </react_native_1.Text>
122
- <react_native_1.View style={styles.h5}/>
123
- <react_native_1.View style={[styles.popoverFile, { backgroundColor: (0, color_1.dark)(color, 10) }]}>
124
- <PayloadFile_1.default {...quoteMessage} showArrow={false}/>
125
- </react_native_1.View>
126
- </react_native_1.TouchableOpacity>);
92
+ </Text>
93
+ <View style={styles.h5}/>
94
+ <View style={[styles.popoverFile, { backgroundColor: dark(color, 10) }]}>
95
+ <PayloadFile {...quoteMessage} style={{ flex: 1 }} showArrow={false}/>
96
+ </View>
97
+ </TouchableOpacity>);
127
98
  });
128
- exports.QuoteVoice = (0, react_1.memo)(props => {
99
+ export const QuoteVoice = memo(props => {
129
100
  const { quoteTitle, quoteMessage, color, textStyle, onPressQuote } = props;
130
101
  const { duration } = quoteMessage.payload;
131
102
  let voiceViewLength = 40 + (80 * duration) / 60;
132
- voiceViewLength = (0, rn_ui_1.dp)(voiceViewLength > 120 ? 120 : voiceViewLength);
133
- return (<react_native_1.TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[styles.leftBorder, { padding: (0, rn_ui_1.dp)(5), backgroundColor: (0, color_1.dark)(color, 6) }]}>
134
- <react_native_1.Text style={[textStyle, styles.replyUserName]}>
103
+ voiceViewLength = dp(voiceViewLength > 120 ? 120 : voiceViewLength);
104
+ return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[styles.leftBorder, { padding: dp(5), backgroundColor: dark(color, 6) }]}>
105
+ <Text style={[textStyle, styles.replyUserName]}>
135
106
  {quoteTitle}
136
107
  {' : '}
137
- </react_native_1.Text>
138
- <react_native_1.View style={styles.h5}/>
108
+ </Text>
109
+ <View style={styles.h5}/>
139
110
 
140
- <react_native_1.View style={[styles.popoverVoice, { backgroundColor: (0, color_1.dark)(color, 10), width: voiceViewLength + (0, rn_ui_1.dp)(10) }]}>
141
- <react_native_1.View style={{ width: voiceViewLength, alignItems: 'flex-start' }}>
142
- <react_native_1.Image style={styles.voiceImage} source={voiceLeft}></react_native_1.Image>
143
- </react_native_1.View>
144
- <react_native_1.Text style={styles.duration}>{Math.round(duration || 0)}''</react_native_1.Text>
145
- </react_native_1.View>
146
- </react_native_1.TouchableOpacity>);
111
+ <View style={[styles.popoverVoice, { backgroundColor: dark(color, 10), width: voiceViewLength + dp(10) }]}>
112
+ <View style={{ width: voiceViewLength, alignItems: 'flex-start' }}>
113
+ <Image style={styles.voiceImage} source={voiceLeft}></Image>
114
+ </View>
115
+ <Text style={styles.duration}>{Math.round(duration || 0)}''</Text>
116
+ </View>
117
+ </TouchableOpacity>);
147
118
  });
148
- exports.QuoteMultiple = (0, react_1.memo)(props => {
119
+ export const QuoteMultiple = memo(props => {
149
120
  const { quoteTitle, quoteMessage, color, textStyle, quoteStyle, onPressQuote } = props;
150
121
  const { type, fromName, toName, selectedMessages } = quoteMessage.payload;
151
- const { t } = (0, useTranslation_1.default)();
122
+ const { t } = useTranslation();
152
123
  const messages = selectedMessages.length > 4 ? [...selectedMessages.slice(0, 4), 'more'] : selectedMessages;
153
- const title = type === im_base_1.ConversationType.C2C
124
+ const title = type === ConversationType.C2C
154
125
  ? t('multipleChatRecordTitle', { fromName, toName })
155
126
  : t('multipleChatRecordTitleGroup');
156
- const imManager = (0, init_1.getImManager)();
157
- return (<react_native_1.TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { padding: (0, rn_ui_1.dp)(5), backgroundColor: (0, color_1.dark)(color, 4) }]}>
158
- <react_native_1.Text style={[textStyle, styles.replyUserName]}>
127
+ const imManager = getImManager();
128
+ return (<TouchableOpacity activeOpacity={0.5} onPress={onPressQuote} style={[quoteStyle, styles.leftBorder, { padding: dp(5), backgroundColor: dark(color, 4) }]}>
129
+ <Text style={[textStyle, styles.replyUserName]}>
159
130
  {quoteTitle}
160
131
  {' : '}
161
- </react_native_1.Text>
162
- <react_native_1.View style={styles.h5}/>
163
- <react_native_1.Text style={styles.mulTitleText} numberOfLines={2}>
132
+ </Text>
133
+ <View style={styles.h5}/>
134
+ <Text style={styles.mulTitleText} numberOfLines={2}>
164
135
  {title}
165
- </react_native_1.Text>
166
- <react_native_1.View style={styles.mulContent}>
136
+ </Text>
137
+ <View style={styles.mulContent}>
167
138
  {messages.map((message, index) => {
168
139
  if (typeof message === 'string') {
169
- return (<react_native_1.Text key={index} style={styles.mulItemTextMore}>
140
+ return (<Text key={index} style={styles.mulItemTextMore}>
170
141
  ......
171
- </react_native_1.Text>);
142
+ </Text>);
172
143
  }
173
- return (<react_native_1.Text key={index} style={styles.mulItemText} numberOfLines={1}>
144
+ return (<Text key={index} style={styles.mulItemText} numberOfLines={1}>
174
145
  {message.messageFromName +
175
146
  ': ' +
176
- (0, im_base_1.buildSimpleText)(imManager, message.payloadType, message.payload)}
177
- </react_native_1.Text>);
147
+ buildSimpleText(imManager, message.payloadType, message.payload)}
148
+ </Text>);
178
149
  })}
179
- </react_native_1.View>
180
- <react_native_1.View style={styles.mulLine}/>
181
- <react_native_1.Text style={styles.mulFooterText}>{t('multipleChatRecord')}</react_native_1.Text>
182
- </react_native_1.TouchableOpacity>);
150
+ </View>
151
+ <View style={styles.mulLine}/>
152
+ <Text style={styles.mulFooterText}>{t('multipleChatRecord')}</Text>
153
+ </TouchableOpacity>);
183
154
  });
184
- const styles = react_native_1.StyleSheet.create({
155
+ const styles = StyleSheet.create({
185
156
  h5: {
186
- height: (0, rn_ui_1.dp)(5),
157
+ height: dp(5),
187
158
  },
188
159
  pictureEmpty: {
189
160
  justifyContent: 'center',
@@ -200,79 +171,79 @@ const styles = react_native_1.StyleSheet.create({
200
171
  },
201
172
  fileInfo: {
202
173
  flex: 1,
203
- paddingHorizontal: (0, rn_ui_1.dp)(10),
174
+ paddingHorizontal: dp(10),
204
175
  justifyContent: 'center',
205
176
  },
206
177
  fileName: {
207
- fontSize: (0, rn_ui_1.dp)(15),
208
- lineHeight: (0, rn_ui_1.dp)(20),
178
+ fontSize: dp(15),
179
+ lineHeight: dp(20),
209
180
  color: '#010101',
210
181
  },
211
182
  fileSize: {
212
- fontSize: (0, rn_ui_1.dp)(12),
213
- lineHeight: (0, rn_ui_1.dp)(20),
183
+ fontSize: dp(12),
184
+ lineHeight: dp(20),
214
185
  color: '#a2a2a2',
215
186
  },
216
187
  imageIcon: {
217
- height: (0, rn_ui_1.dp)(45),
188
+ height: dp(45),
218
189
  },
219
190
  popoverFile: {
220
191
  backgroundColor: '#fff',
221
192
  flexDirection: 'row',
222
- paddingVertical: (0, rn_ui_1.dp)(8),
223
- width: width - (0, rn_ui_1.dp)(145),
193
+ paddingVertical: dp(8),
194
+ width: width - dp(145),
224
195
  },
225
196
  voiceImage: {
226
- width: (0, rn_ui_1.dp)(24),
227
- height: (0, rn_ui_1.dp)(18),
197
+ width: dp(24),
198
+ height: dp(18),
228
199
  },
229
200
  duration: {
230
- fontSize: (0, rn_ui_1.dp)(13),
231
- lineHeight: (0, rn_ui_1.dp)(21),
201
+ fontSize: dp(13),
202
+ lineHeight: dp(21),
232
203
  color: '#666',
233
204
  position: 'absolute',
234
- right: (0, rn_ui_1.dp)(5),
205
+ right: dp(5),
235
206
  alignSelf: 'center',
236
207
  },
237
- popoverVoice: Object.assign({ flexDirection: 'row', padding: (0, rn_ui_1.dp)(9), borderRadius: (0, rn_ui_1.dp)(3), borderStyle: 'solid' }, styles_1.shadowStyle),
208
+ popoverVoice: Object.assign({ flexDirection: 'row', padding: dp(9), borderRadius: dp(3), borderStyle: 'solid' }, shadowStyle),
238
209
  replyUserName: {
239
210
  fontWeight: '600',
240
211
  },
241
212
  leftBorder: {
242
- borderLeftWidth: (0, rn_ui_1.dp)(4),
213
+ borderLeftWidth: dp(4),
243
214
  borderColor: '#adadad',
244
- borderRadius: (0, rn_ui_1.dp)(4),
215
+ borderRadius: dp(4),
245
216
  },
246
217
  mulTitleText: {
247
218
  color: '#333',
248
- fontSize: (0, rn_ui_1.dp)(14),
249
- lineHeight: (0, rn_ui_1.dp)(18),
219
+ fontSize: dp(14),
220
+ lineHeight: dp(18),
250
221
  },
251
222
  mulContent: {
252
- paddingVertical: (0, rn_ui_1.dp)(5),
223
+ paddingVertical: dp(5),
253
224
  },
254
225
  mulItem: {
255
226
  justifyContent: 'center',
256
227
  },
257
228
  mulItemText: {
258
229
  color: '#999',
259
- fontSize: (0, rn_ui_1.dp)(13),
260
- lineHeight: (0, rn_ui_1.dp)(19),
230
+ fontSize: dp(13),
231
+ lineHeight: dp(19),
261
232
  },
262
233
  mulItemTextMore: {
263
234
  color: '#999',
264
- fontSize: (0, rn_ui_1.dp)(13),
265
- lineHeight: (0, rn_ui_1.dp)(13),
235
+ fontSize: dp(13),
236
+ lineHeight: dp(13),
266
237
  },
267
238
  mulFooterText: {
268
239
  color: '#777',
269
- fontSize: (0, rn_ui_1.dp)(13),
240
+ fontSize: dp(13),
270
241
  },
271
242
  mulLine: {
272
- marginTop: (0, rn_ui_1.dp)(5),
273
- marginBottom: (0, rn_ui_1.dp)(5),
243
+ marginTop: dp(5),
244
+ marginBottom: dp(5),
274
245
  backgroundColor: '#ddd',
275
246
  width: '100%',
276
- height: (0, rn_ui_1.dp)(1),
247
+ height: dp(1),
277
248
  },
278
249
  });
@@ -1,38 +1,10 @@
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
- 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 && (<TextMixQuote_1.QuoteTextMix quoteTitle={quote.quoteTitle} quoteText={quote.quoteText} color={quoteBgColor} quoteStyle={quoteStyle} textStyle={textStyle} onLongPressPhone={onLongPressPhone} onLongPressURL={onLongPressURL} onPressQuote={() => {
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 && (<TextMixQuote_1.QuotePicture quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} quoteStyle={quoteStyle} color={quoteBgColor} textStyle={textStyle} backgroundColor={quoteBgColor} borderColor={quoteBgColor} onPressQuote={() => {
22
+ {quotePayloadType === PICTURE && (<QuotePicture quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} quoteStyle={quoteStyle} color={quoteBgColor} textStyle={textStyle} backgroundColor={quoteBgColor} borderColor={quoteBgColor} onPressQuote={() => {
51
23
  onPressQuote && onPressQuote(quoteMessageSeq);
52
24
  }}/>)}
53
25
 
54
- {quotePayloadType === VIDEO && (<TextMixQuote_1.QuoteVideo quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} quoteStyle={quoteStyle} color={quoteBgColor} textStyle={textStyle} backgroundColor={quoteBgColor} borderColor={quoteBgColor} onPressQuote={() => {
26
+ {quotePayloadType === VIDEO && (<QuoteVideo quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} quoteStyle={quoteStyle} color={quoteBgColor} textStyle={textStyle} backgroundColor={quoteBgColor} borderColor={quoteBgColor} onPressQuote={() => {
55
27
  onPressQuote && onPressQuote(quoteMessageSeq);
56
28
  }}/>)}
57
29
 
58
- {quotePayloadType === FILE && (<TextMixQuote_1.QuoteFile quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} color={quoteBgColor} textStyle={textStyle} onPressQuote={() => {
30
+ {quotePayloadType === FILE && (<QuoteFile quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} color={quoteBgColor} textStyle={textStyle} onPressQuote={() => {
59
31
  onPressQuote && onPressQuote(quoteMessageSeq);
60
32
  }}/>)}
61
33
 
62
- {quotePayloadType === VOICE && (<TextMixQuote_1.QuoteVoice quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} color={quoteBgColor} textStyle={textStyle} onPressQuote={() => {
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 && (<TextMixQuote_1.QuoteMultiple quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} color={quoteBgColor} textStyle={textStyle} onPressQuote={() => {
37
+ {quotePayloadType === MULTIPLE && (<QuoteMultiple quoteTitle={quote.quoteTitle} quoteMessage={quote.quoteMessage} color={quoteBgColor} textStyle={textStyle} onPressQuote={() => {
66
38
  onPressQuote && onPressQuote(quoteMessageSeq);
67
39
  }}/>)}
68
- <react_native_1.View style={{ height: 10 }}/>
40
+ <View style={{ height: 10 }}/>
69
41
  </>)}
70
42
 
71
- <TextMixMessage_1.default text={text} textStyle={textStyle} onLongPressPhone={onLongPressPhone} onLongPressURL={onLongPressURL}/>
43
+ <TextMixMessage text={text} textStyle={textStyle} onLongPressPhone={onLongPressPhone} onLongPressURL={onLongPressURL}/>
72
44
  </>);
73
45
  });
74
- exports.default = TextMixQuoteMessage;
46
+ export default TextMixQuoteMessage;
@@ -1,33 +1,8 @@
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
- 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 (<react_native_1.View>
40
- <react_native_progress_1.Bar progress={progress} width={width} height={(0, rn_ui_1.dp)(3)} color={'#999'} borderRadius={(0, rn_ui_1.dp)(1)}/>
41
- <react_native_1.Text style={styles.rate}>{(0, file_1.numberToFileSize)(sendSize) + ' / ' + (0, file_1.numberToFileSize)(totalSize)}</react_native_1.Text>
42
- </react_native_1.View>);
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 = react_native_1.StyleSheet.create({
19
+ const styles = StyleSheet.create({
45
20
  rate: {
46
21
  alignSelf: 'flex-end',
47
- fontSize: (0, rn_ui_1.dp)(10),
22
+ fontSize: dp(10),
48
23
  color: '#999'
49
24
  }
50
25
  });
51
- exports.default = (0, react_1.memo)(UploadProgress);
26
+ export default memo(UploadProgress);