@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.
Files changed (170) hide show
  1. package/assets/file-dir.jpg +0 -0
  2. package/dist/api/addressList.js +6 -17
  3. package/dist/api/backup.js +8 -20
  4. package/dist/api/file.js +6 -35
  5. package/dist/api/user.js +6 -16
  6. package/dist/components/CachedImage.js +14 -42
  7. package/dist/components/Camera/Camera.js +26 -54
  8. package/dist/components/Camera/CameraCapture.js +99 -128
  9. package/dist/components/Camera/CameraResult.js +33 -61
  10. package/dist/components/ChatAvatar/ChatAvatar.d.ts +1 -1
  11. package/dist/components/ChatAvatar/ChatAvatar.js +34 -62
  12. package/dist/components/ChatAvatar/ChatAvatarId.d.ts +2 -2
  13. package/dist/components/ChatAvatar/ChatAvatarId.js +26 -51
  14. package/dist/components/ChatAvatar/ChatAvatarLocal.d.ts +2 -2
  15. package/dist/components/ChatAvatar/ChatAvatarLocal.js +22 -25
  16. package/dist/components/ChatAvatar/index.js +2 -23
  17. package/dist/components/Favicon.js +6 -34
  18. package/dist/components/FormatTimeText.js +5 -10
  19. package/dist/components/Highlighter.js +9 -34
  20. package/dist/components/IndicatorText.js +14 -39
  21. package/dist/components/LocalImage.js +7 -32
  22. package/dist/components/NetworkUnconnected.js +14 -42
  23. package/dist/components/PopoverWrapper.js +22 -47
  24. package/dist/components/VideoPlayer.js +111 -138
  25. package/dist/components/styles.js +10 -13
  26. package/dist/default-assets.d.ts +2 -0
  27. package/dist/default-assets.js +9 -10
  28. package/dist/hooks/useDownloadSource.js +7 -12
  29. package/dist/hooks/useFormatMsgTime.js +5 -13
  30. package/dist/hooks/useImReady.js +7 -10
  31. package/dist/hooks/useImSelector.js +34 -48
  32. package/dist/hooks/useTranslation.js +5 -10
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +8 -28
  35. package/dist/init.js +30 -40
  36. package/dist/interface.d.ts +9 -0
  37. package/dist/interface.js +1 -2
  38. package/dist/locales/en/addressList.js +1 -3
  39. package/dist/locales/index.js +4 -27
  40. package/dist/locales/lao/addressList.js +1 -3
  41. package/dist/locales/zh/addressList.js +1 -3
  42. package/dist/pages/address-list/AddressList.js +33 -61
  43. package/dist/pages/address-list/CardInfo.js +10 -18
  44. package/dist/pages/address-list/ChooseContact.js +50 -78
  45. package/dist/pages/address-list/Icons.js +7 -14
  46. package/dist/pages/address-list/Organization.js +59 -89
  47. package/dist/pages/address-list/UserDetail.js +55 -83
  48. package/dist/pages/address-list/UserJobs.js +31 -33
  49. package/dist/pages/address-list/UserSearch.js +29 -54
  50. package/dist/pages/address-list/addressList.routes.js +11 -16
  51. package/dist/pages/collection/Collection.js +53 -81
  52. package/dist/pages/collection/ContentFactory.js +53 -82
  53. package/dist/pages/collection/collection.routes.js +3 -9
  54. package/dist/pages/conversation/ForwardToConversation.js +63 -91
  55. package/dist/pages/conversation/List.js +74 -102
  56. package/dist/pages/conversation/components/ConversationCard.js +46 -74
  57. package/dist/pages/conversation/components/ConversationOption.js +27 -55
  58. package/dist/pages/conversation/conversation.routes.js +17 -23
  59. package/dist/pages/conversation/setting/GroupTransfer.js +32 -60
  60. package/dist/pages/conversation/setting/OptionAvatars.d.ts +1 -1
  61. package/dist/pages/conversation/setting/OptionAvatars.js +62 -90
  62. package/dist/pages/conversation/setting/OptionCancelGroup.js +14 -42
  63. package/dist/pages/conversation/setting/OptionConversation.js +20 -48
  64. package/dist/pages/conversation/setting/OptionGroup.d.ts +1 -1
  65. package/dist/pages/conversation/setting/OptionGroup.js +20 -48
  66. package/dist/pages/conversation/setting/OptionGroupManage.js +21 -49
  67. package/dist/pages/conversation/setting/OptionGroupMoreMember.js +48 -53
  68. package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.js +49 -77
  69. package/dist/pages/conversation/setting/Setting.js +50 -56
  70. package/dist/pages/conversation/setting/SettingChatBg.js +26 -54
  71. package/dist/pages/index.js +7 -27
  72. package/dist/pages/message/ChooseMember.js +56 -84
  73. package/dist/pages/message/FileSelector.d.ts +6 -0
  74. package/dist/pages/message/FileSelector.js +235 -0
  75. package/dist/pages/message/MessageBackup/Bar.js +18 -43
  76. package/dist/pages/message/MessageBackup/MessageBackup.js +42 -72
  77. package/dist/pages/message/MessageBackup/RestoreBackupPage.js +48 -76
  78. package/dist/pages/message/MessageBackup/StartBackupPage.js +48 -76
  79. package/dist/pages/message/MessageBackup/index.js +3 -12
  80. package/dist/pages/message/MessageBackup/utils.js +14 -22
  81. package/dist/pages/message/MessageList.js +151 -141
  82. package/dist/pages/message/MessageRecord.js +74 -87
  83. package/dist/pages/message/components/BusiNotifyCard.js +60 -85
  84. package/dist/pages/message/components/ChatBg.js +11 -36
  85. package/dist/pages/message/components/MessageItem.d.ts +2 -1
  86. package/dist/pages/message/components/MessageItem.js +85 -112
  87. package/dist/pages/message/components/MessageItemQuote.js +30 -58
  88. package/dist/pages/message/components/MessageItemTips.js +27 -55
  89. package/dist/pages/message/components/MessageOption.d.ts +7 -3
  90. package/dist/pages/message/components/MessageOption.js +107 -134
  91. package/dist/pages/message/components/MessagePayload.d.ts +2 -1
  92. package/dist/pages/message/components/MessagePayload.js +36 -64
  93. package/dist/pages/message/components/MessagePictureAlbum.js +32 -60
  94. package/dist/pages/message/components/MessageReceiptStatus.js +18 -43
  95. package/dist/pages/message/components/MessageUndo.js +18 -48
  96. package/dist/pages/message/components/MultipleBar/index.js +48 -76
  97. package/dist/pages/message/components/Payload/PayloadContact.js +30 -58
  98. package/dist/pages/message/components/Payload/PayloadFile.d.ts +1 -1
  99. package/dist/pages/message/components/Payload/PayloadFile.js +44 -68
  100. package/dist/pages/message/components/Payload/PayloadMultiple.js +46 -70
  101. package/dist/pages/message/components/Payload/PayloadNotify.js +28 -56
  102. package/dist/pages/message/components/Payload/PayloadPicture.d.ts +1 -1
  103. package/dist/pages/message/components/Payload/PayloadPicture.js +21 -50
  104. package/dist/pages/message/components/Payload/PayloadShare.js +39 -67
  105. package/dist/pages/message/components/Payload/PayloadText.js +39 -67
  106. package/dist/pages/message/components/Payload/PayloadVideo.js +30 -57
  107. package/dist/pages/message/components/Payload/PayloadVoice.js +80 -93
  108. package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +2 -1
  109. package/dist/pages/message/components/Payload/PayloadWrapper.js +24 -44
  110. package/dist/pages/message/components/Payload/type.d.ts +2 -1
  111. package/dist/pages/message/components/Payload/type.js +1 -2
  112. package/dist/pages/message/components/ReceiptBack.js +30 -60
  113. package/dist/pages/message/components/TextMixMessage.js +13 -38
  114. package/dist/pages/message/components/TextMixQuote.js +128 -162
  115. package/dist/pages/message/components/TextMixQuoteMessage.js +19 -47
  116. package/dist/pages/message/components/UploadProgress.js +12 -37
  117. package/dist/pages/message/components/messageBar/EmojiPanel.js +25 -50
  118. package/dist/pages/message/components/messageBar/Icons.js +56 -74
  119. package/dist/pages/message/components/messageBar/MessageBar.js +84 -115
  120. package/dist/pages/message/components/messageBar/MessageInput.js +30 -55
  121. package/dist/pages/message/components/messageBar/OptionPanel.js +54 -107
  122. package/dist/pages/message/components/messageBar/VoiceBar.js +122 -100
  123. package/dist/pages/message/components/messageBar/index.js +2 -23
  124. package/dist/pages/message/message.routes.js +21 -40
  125. package/dist/pages/search/Search.js +38 -66
  126. package/dist/pages/search/SearchChatRecords.js +64 -92
  127. package/dist/pages/search/SearchFile.js +68 -96
  128. package/dist/pages/search/SearchManager.js +60 -65
  129. package/dist/pages/search/SearchPicturePage.js +16 -44
  130. package/dist/pages/search/components/ChatRecords.js +46 -74
  131. package/dist/pages/search/components/MyGroupChat.js +41 -69
  132. package/dist/pages/search/components/PictureMulipleBar.js +35 -63
  133. package/dist/pages/search/components/SearchFileList.js +59 -64
  134. package/dist/pages/search/components/SearchPictures.js +68 -98
  135. package/dist/pages/search/components/SearchShareLinkList.js +50 -55
  136. package/dist/pages/search/components/SearchUser.js +25 -53
  137. package/dist/pages/search/components/useSearchMessage.js +12 -16
  138. package/dist/pages/search/search.routes.js +11 -17
  139. package/dist/pages/search/utils.js +4 -12
  140. package/dist/pages/types.d.ts +4 -2
  141. package/dist/pages/types.js +1 -2
  142. package/dist/slice/contact/contact.slice.js +4 -8
  143. package/dist/slice/index.js +7 -13
  144. package/dist/slice/panel/panel.slice.d.ts +2 -1
  145. package/dist/slice/panel/panel.slice.js +8 -7
  146. package/dist/slice/video/video.action.d.ts +1 -0
  147. package/dist/slice/video/video.action.js +64 -38
  148. package/dist/slice/video/video.slice.d.ts +1 -1
  149. package/dist/slice/video/video.slice.js +7 -8
  150. package/dist/utils/audio.d.ts +3 -0
  151. package/dist/utils/audio.js +10 -0
  152. package/dist/utils/color.js +2 -9
  153. package/dist/utils/common-action-sheet.js +9 -14
  154. package/dist/utils/cookie.js +6 -14
  155. package/dist/utils/emoji.js +9 -12
  156. package/dist/utils/file-icon.js +33 -60
  157. package/dist/utils/file-operate.js +1 -2
  158. package/dist/utils/file.d.ts +10 -2
  159. package/dist/utils/file.js +188 -88
  160. package/dist/utils/golden-rectangle.js +3 -7
  161. package/dist/utils/phone.js +13 -22
  162. package/dist/utils/request.js +7 -15
  163. package/dist/utils/scroll.js +5 -9
  164. package/dist/utils/summary.js +4 -11
  165. package/dist/utils/take-camera.js +12 -19
  166. package/dist/utils/text-mix.js +4 -11
  167. package/dist/utils/upload.js +20 -41
  168. package/package.json +6 -7
  169. package/dist/slice/contact/contact.action.d.ts +0 -1
  170. package/dist/slice/contact/contact.action.js +0 -2
@@ -1,48 +1,20 @@
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 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 } = react_native_1.Dimensions.get('window');
38
- const [index, setIndex] = (0, react_1.useState)(0);
39
- const [sources, setSources] = (0, react_1.useState)([]);
40
- (0, react_1.useEffect)(() => {
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 === im_base_1.PayloadType.PICTURE)
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: (0, file_2.toAbsolutePath)(localPath) };
28
+ source = { uri: toAbsolutePath(localPath) };
57
29
  }
58
30
  else if (fileId) {
59
- source = { uri: (0, file_1.getDownloadUrl)(fileId) };
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 (<react_native_1.Modal style={{ flex: 1 }} statusBarTranslucent animationType="fade" visible={visible} onRequestClose={handleClose}>
72
- {visible && (<react_native_1.View style={styles.root}>
73
- {react_native_1.Platform.OS === 'android' && <react_native_1.StatusBar backgroundColor={'#000'}/>}
74
- <react_native_1.View style={{ width: width, height: height }}>
75
- <rn_ui_1.AlbumView images={sources} defaultIndex={index} onClose={onClose}/>
76
- </react_native_1.View>
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
- <react_native_1.TouchableOpacity style={styles.cancel} onPress={handleClose}>
79
- <AntDesign_1.default name='close' size={(0, rn_ui_1.dp)(25)} color={'#fff'}/>
80
- </react_native_1.TouchableOpacity>
81
- </react_native_1.View>)}
82
- </react_native_1.Modal>);
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 = react_native_1.StyleSheet.create({
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: (0, rn_ui_1.dp)(40),
93
- width: (0, rn_ui_1.dp)(40),
94
- borderRadius: (0, rn_ui_1.dp)(5),
64
+ height: dp(40),
65
+ width: dp(40),
66
+ borderRadius: dp(5),
95
67
  backgroundColor: '#333',
96
68
  position: 'absolute',
97
- top: (0, rn_ui_1.dp)(70),
98
- right: (0, rn_ui_1.dp)(30),
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
- exports.default = (0, react_1.memo)(MessagePictureAlbum);
76
+ export default memo(MessagePictureAlbum);
@@ -1,61 +1,36 @@
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 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 = default_assets_1.receiptStatus[READ];
11
+ statusSource = receiptStatus[READ];
37
12
  }
38
13
  else if (receiptBackMessageStatusList.includes(ARRIVED) || messageStatus === ARRIVED) {
39
- statusSource = default_assets_1.receiptStatus[ARRIVED];
14
+ statusSource = receiptStatus[ARRIVED];
40
15
  }
41
16
  else if (messageStatus === EMITTED) {
42
- statusSource = default_assets_1.receiptStatus[EMITTED];
17
+ statusSource = receiptStatus[EMITTED];
43
18
  }
44
19
  if (!statusSource)
45
20
  return null;
46
- return (<react_native_1.View style={[styles.status]}>
47
- <react_native_1.Image resizeMode="contain" style={styles.statusImage} source={statusSource}/>
48
- </react_native_1.View>);
21
+ return (<View style={[styles.status]}>
22
+ <Image resizeMode="contain" style={styles.statusImage} source={statusSource}/>
23
+ </View>);
49
24
  });
50
- const styles = react_native_1.StyleSheet.create({
25
+ const styles = StyleSheet.create({
51
26
  status: {
52
27
  alignSelf: 'flex-end',
53
28
  flexDirection: 'row',
54
- marginRight: (0, rn_ui_1.dp)(10),
29
+ marginRight: dp(10),
55
30
  },
56
31
  statusImage: {
57
- width: (0, rn_ui_1.dp)(18),
58
- height: (0, rn_ui_1.dp)(18)
32
+ width: dp(18),
33
+ height: dp(18)
59
34
  },
60
35
  });
61
- exports.default = MessageReceiptStatus;
36
+ export default MessageReceiptStatus;
@@ -1,61 +1,31 @@
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.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 } = (0, useTranslation_1.default)();
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 = (0, init_1.getImManager)()) === null || _a === void 0 ? void 0 : _a.inputRef;
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 (<react_native_1.View style={[styles.root, bgStyle]}>
48
- <react_native_1.Text style={[styles.text, bgFont]}>{text}</react_native_1.Text>
49
- <react_native_1.TouchableOpacity activeOpacity={0.5} onPress={onPress}>
50
- {edit && (undoText === null || undoText === void 0 ? void 0 : undoText.length) && <react_native_1.Text style={styles.edit}> {t('reedit')} </react_native_1.Text>}
51
- </react_native_1.TouchableOpacity>
52
- </react_native_1.View>);
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
- exports.MessageUndo = MessageUndo;
55
- const styles = react_native_1.StyleSheet.create({
25
+ const styles = StyleSheet.create({
56
26
  root: {
57
- borderRadius: (0, rn_ui_1.dp)(3),
58
- padding: (0, rn_ui_1.dp)(8),
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
- exports.default = exports.MessageUndo;
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- const react_1 = __importStar(require("react"));
39
- const react_native_1 = require("react-native");
40
- const FontAwesome5_1 = __importDefault(require("react-native-vector-icons/FontAwesome5"));
41
- const AntDesign_1 = __importDefault(require("react-native-vector-icons/AntDesign"));
42
- const MaterialIcons_1 = __importDefault(require("react-native-vector-icons/MaterialIcons"));
43
- const rn_ui_1 = require("@smart-link/rn-ui");
44
- const useTranslation_1 = __importDefault(require("../../../../hooks/useTranslation"));
45
- const useImSelector_1 = require("../../../../hooks/useImSelector");
46
- const init_1 = require("../../../../init");
47
- const message_panel_action_1 = require("@smart-link/im-base/dist/slice/message/message.panel.action");
48
- const im_base_1 = require("@smart-link/im-base");
49
- const common_action_sheet_1 = require("../../../../utils/common-action-sheet");
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 } = (0, useTranslation_1.default)();
56
- const [height] = (0, react_1.useState)(new react_native_1.Animated.Value(0)); // 高度初始值设为0
57
- (0, react_1.useEffect)(() => {
58
- react_native_1.Animated.timing(height, {
59
- toValue: (0, rn_ui_1.dp)(50),
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 (<react_native_1.Animated.View style={[styles.wrap, { height }]}>
67
- <react_native_1.TouchableOpacity disabled={disabled} style={styles.item} onPress={() => {
68
- imManager.store.dispatch((0, message_panel_action_1.onMultipleForward)(imManager, true));
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
- <react_native_1.View style={styles.item}>
72
- <FontAwesome5_1.default name="reply" size={(0, rn_ui_1.dp)(20)} color={color}/>
73
- <react_native_1.Text style={fontStyle}>{t('forward')}</react_native_1.Text>
74
- </react_native_1.View>
75
- </react_native_1.TouchableOpacity>
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
- <react_native_1.TouchableOpacity disabled={disabled} style={styles.item} onPress={() => __awaiter(void 0, void 0, void 0, function* () {
78
- yield imManager.store.dispatch(im_base_1.MessagePanelActions.onMultipleCollect(imManager));
79
- rn_ui_1.Toast.info(t('collectSuccess'));
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
- <MaterialIcons_1.default name="collections" size={(0, rn_ui_1.dp)(20)} color={color}/>
82
- <react_native_1.Text style={fontStyle}>{t('collect')}</react_native_1.Text>
83
- </react_native_1.TouchableOpacity>
53
+ <MaterialIcons name="collections" size={dp(20)} color={color}/>
54
+ <Text style={fontStyle}>{t('collect')}</Text>
55
+ </TouchableOpacity>
84
56
 
85
57
 
86
- <react_native_1.TouchableOpacity disabled={disabled} style={styles.item} onPress={() => {
87
- (0, common_action_sheet_1.ConfirmActionSheet)(t('confirmDeleteMessages'), () => {
88
- imManager.store.dispatch(im_base_1.MessagePanelActions.onMultipleDelete(imManager));
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
- <AntDesign_1.default name="delete" size={(0, rn_ui_1.dp)(20)} color={color}/>
92
- <react_native_1.Text style={fontStyle}>{t('delete')}</react_native_1.Text>
93
- </react_native_1.TouchableOpacity>
94
- </react_native_1.Animated.View>);
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 = react_native_1.StyleSheet.create({
68
+ const styles = StyleSheet.create({
97
69
  wrap: {
98
- paddingTop: (0, rn_ui_1.dp)(10),
70
+ paddingTop: dp(10),
99
71
  backgroundColor: '#fff',
100
72
  width: '100%',
101
- paddingHorizontal: (0, rn_ui_1.dp)(10),
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: (0, rn_ui_1.dp)(12),
83
+ fontSize: dp(12),
112
84
  fontWeight: '500',
113
- lineHeight: (0, rn_ui_1.dp)(20)
85
+ lineHeight: dp(20)
114
86
  }
115
87
  });
116
- exports.default = MultipleBar;
88
+ export default MultipleBar;
@@ -1,86 +1,58 @@
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 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 } = (0, useTranslation_1.default)();
8
+ const { t } = useTranslation();
37
9
  const contact = payload.contact;
38
- const navigation = (0, rn_ui_1.useNavigation)();
39
- return (<PayloadWrapper_1.default direction={direction} showArrow={showArrow} style={[style, styles.contact]} onPress={() => {
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
- <react_native_1.View style={styles.content}>
43
- <ChatAvatar_1.default id={contact.userId} url={contact.avatars} name={contact.userName}/>
44
- <react_native_1.View style={styles.info}>
45
- <react_native_1.Text style={styles.name}>{contact.userName}</react_native_1.Text>
46
- <react_native_1.Text style={styles.group} numberOfLines={2}>
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
- </react_native_1.Text>
49
- </react_native_1.View>
50
- </react_native_1.View>
51
- <react_native_1.Text style={styles.footer}>{t('contact')}</react_native_1.Text>
52
- </PayloadWrapper_1.default>);
20
+ </Text>
21
+ </View>
22
+ </View>
23
+ <Text style={styles.footer}>{t('contact')}</Text>
24
+ </PayloadWrapper>);
53
25
  };
54
- const styles = react_native_1.StyleSheet.create({
26
+ const styles = StyleSheet.create({
55
27
  contact: {
56
28
  flexDirection: 'column',
57
- padding: (0, rn_ui_1.dp)(6),
58
- borderRadius: (0, rn_ui_1.dp)(8),
59
- width: (0, rn_ui_1.dp)(240),
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: (0, rn_ui_1.dp)(1),
66
- paddingBottom: (0, rn_ui_1.dp)(6),
37
+ borderBottomWidth: dp(1),
38
+ paddingBottom: dp(6),
67
39
  },
68
40
  info: {
69
41
  flex: 1,
70
42
  flexDirection: 'column',
71
- marginLeft: (0, rn_ui_1.dp)(12),
43
+ marginLeft: dp(12),
72
44
  },
73
45
  name: {
74
- fontSize: (0, rn_ui_1.dp)(16),
46
+ fontSize: dp(16),
75
47
  color: '#333',
76
48
  },
77
49
  group: {
78
50
  color: '#999',
79
- fontSize: (0, rn_ui_1.dp)(14),
51
+ fontSize: dp(14),
80
52
  },
81
53
  footer: {
82
54
  color: '#999',
83
- fontSize: (0, rn_ui_1.dp)(12),
55
+ fontSize: dp(12),
84
56
  },
85
57
  });
86
- exports.default = (0, react_1.memo)(PayloadContact);
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;