@smart-link/rn-im 1.1.5 → 1.1.6

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 (98) hide show
  1. package/dist/api/addressList.d.ts +2 -0
  2. package/dist/api/addressList.js +1 -0
  3. package/dist/api/user.d.ts +2 -1
  4. package/dist/api/user.js +1 -0
  5. package/dist/components/Camera/Camera.d.ts +1 -1
  6. package/dist/components/Camera/Camera.js +2 -1
  7. package/dist/components/Camera/CameraCapture.d.ts +0 -24
  8. package/dist/components/Camera/CameraCapture.js +10 -76
  9. package/dist/components/Camera/CameraResult.js +6 -5
  10. package/dist/components/FormatTimeText.js +2 -2
  11. package/dist/components/Highlighter.js +5 -6
  12. package/dist/components/IndicatorText.js +4 -4
  13. package/dist/components/NetworkUnconnected.js +4 -4
  14. package/dist/components/VideoPlayer.js +5 -5
  15. package/dist/hooks/useImSelector.d.ts +3 -1
  16. package/dist/hooks/useImSelector.js +6 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +1 -0
  19. package/dist/init.js +17 -2
  20. package/dist/pages/address-list/AddressList.js +8 -8
  21. package/dist/pages/address-list/ChooseContact.js +40 -22
  22. package/dist/pages/address-list/MyGroups.js +4 -4
  23. package/dist/pages/address-list/Organization.js +3 -3
  24. package/dist/pages/address-list/UserDetail.js +26 -21
  25. package/dist/pages/address-list/UserSearch.js +3 -3
  26. package/dist/pages/address-list/components/OrgPath.js +4 -4
  27. package/dist/pages/address-list/components/RenderUserItem.d.ts +4 -3
  28. package/dist/pages/address-list/components/RenderUserItem.js +5 -5
  29. package/dist/pages/address-list/components/UserJobs.d.ts +3 -3
  30. package/dist/pages/address-list/components/UserJobs.js +23 -8
  31. package/dist/pages/collection/Collection.js +5 -5
  32. package/dist/pages/collection/ContentFactory.js +11 -11
  33. package/dist/pages/conversation/ConversationList.js +5 -5
  34. package/dist/pages/conversation/ForwardToConversation.js +8 -8
  35. package/dist/pages/conversation/components/ConversationCard.js +8 -8
  36. package/dist/pages/conversation/components/ConversationOption.js +3 -3
  37. package/dist/pages/conversation/setting/GroupTransfer.js +4 -4
  38. package/dist/pages/conversation/setting/OptionAvatars.js +6 -6
  39. package/dist/pages/conversation/setting/OptionGroup.js +4 -4
  40. package/dist/pages/conversation/setting/OptionGroupMoreMember.js +3 -3
  41. package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.js +4 -4
  42. package/dist/pages/message/ChooseMember.js +7 -7
  43. package/dist/pages/message/FileSelector.js +19 -13
  44. package/dist/pages/message/MessageBackup/MessageBackup.js +3 -3
  45. package/dist/pages/message/MessageBackup/RestoreBackupPage.js +4 -4
  46. package/dist/pages/message/MessageBackup/StartBackupPage.js +4 -4
  47. package/dist/pages/message/MessageList.js +17 -22
  48. package/dist/pages/message/MessageRecord.js +3 -3
  49. package/dist/pages/message/components/BusiNotifyCard.js +9 -9
  50. package/dist/pages/message/components/MessageItem.d.ts +1 -2
  51. package/dist/pages/message/components/MessageItem.js +11 -11
  52. package/dist/pages/message/components/MessageItemQuote.js +4 -4
  53. package/dist/pages/message/components/MessageItemTips.js +5 -5
  54. package/dist/pages/message/components/MessageOption.d.ts +2 -3
  55. package/dist/pages/message/components/MessageOption.js +18 -18
  56. package/dist/pages/message/components/MessagePayload.d.ts +1 -2
  57. package/dist/pages/message/components/MessagePayload.js +2 -2
  58. package/dist/pages/message/components/MessageUndo.js +6 -9
  59. package/dist/pages/message/components/MultipleBar/index.js +5 -5
  60. package/dist/pages/message/components/Payload/PayloadContact.js +6 -6
  61. package/dist/pages/message/components/Payload/PayloadFile.js +4 -4
  62. package/dist/pages/message/components/Payload/PayloadMultiple.js +8 -8
  63. package/dist/pages/message/components/Payload/PayloadNotify.js +12 -11
  64. package/dist/pages/message/components/Payload/PayloadPicture.js +1 -1
  65. package/dist/pages/message/components/Payload/PayloadShare.js +5 -5
  66. package/dist/pages/message/components/Payload/PayloadVideo.js +3 -3
  67. package/dist/pages/message/components/Payload/PayloadVoice.js +3 -3
  68. package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +2 -3
  69. package/dist/pages/message/components/Payload/PayloadWrapper.js +6 -5
  70. package/dist/pages/message/components/Payload/type.d.ts +1 -2
  71. package/dist/pages/message/components/ReceiptBack.js +8 -8
  72. package/dist/pages/message/components/TextMixMessage.js +9 -8
  73. package/dist/pages/message/components/TextMixQuote.js +23 -23
  74. package/dist/pages/message/components/UploadProgress.js +3 -3
  75. package/dist/pages/message/components/messageBar/EmojiPanel.js +3 -2
  76. package/dist/pages/message/components/messageBar/MessageBar.js +1 -0
  77. package/dist/pages/message/components/messageBar/MessageInput.js +1 -0
  78. package/dist/pages/message/components/messageBar/OptionPanel.js +40 -29
  79. package/dist/pages/message/components/messageBar/VoiceBar.js +6 -6
  80. package/dist/pages/search/SearchChatRecords.js +6 -6
  81. package/dist/pages/search/SearchFile.js +9 -9
  82. package/dist/pages/search/SearchPicturePage.js +3 -3
  83. package/dist/pages/search/components/ChatRecords.js +7 -7
  84. package/dist/pages/search/components/MyGroupChat.js +5 -5
  85. package/dist/pages/search/components/PictureMulipleBar.js +5 -5
  86. package/dist/pages/search/components/SearchFileList.js +8 -8
  87. package/dist/pages/search/components/SearchPictures.js +4 -4
  88. package/dist/pages/search/components/SearchShareLinkList.js +8 -8
  89. package/dist/pages/search/components/SearchUser.js +5 -5
  90. package/dist/slice/video/video.action.js +6 -2
  91. package/dist/utils/camera.d.ts +25 -0
  92. package/dist/utils/camera.js +75 -0
  93. package/dist/utils/file.d.ts +2 -1
  94. package/dist/utils/file.js +26 -22
  95. package/dist/utils/request.js +0 -1
  96. package/dist/utils/summary.js +2 -2
  97. package/dist/utils/upload.js +10 -4
  98. package/package.json +3 -4
@@ -10,9 +10,9 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { ConversationType, MessageStatus, PayloadType, isNotifyMessage, MessagePanelActions, } from '@smart-link/im-base';
13
- import { Checkbox, dp, useTheme } from '@smart-link/rn-ui';
13
+ import { CaihText, Checkbox, dp, useTheme } from '@smart-link/rn-ui';
14
14
  import React, { memo } from 'react';
15
- import { View, Text, StyleSheet, TouchableOpacity, Dimensions, ActivityIndicator, TouchableWithoutFeedback, } from 'react-native';
15
+ import { View, StyleSheet, TouchableOpacity, Dimensions, ActivityIndicator, TouchableWithoutFeedback, } from 'react-native';
16
16
  import ChatAvatar from '../../../components/ChatAvatar/ChatAvatar';
17
17
  import useFormatMsgTime from '../../../hooks/useFormatMsgTime';
18
18
  import BusiNotifyCard from './BusiNotifyCard';
@@ -41,7 +41,7 @@ const MessageItem = (_a) => {
41
41
  return (<View style={styles.root} onLayout={(e) => {
42
42
  onLayoutItem(message, index, e);
43
43
  }}>
44
- {showTimeLine && <Text style={styles.time}>{time}</Text>}
44
+ {showTimeLine && <CaihText style={styles.time}>{time}</CaihText>}
45
45
  {isB2C && <BusiNotifyCard payload={message.payload}/>}
46
46
  {isNotify && <PayloadNotify {...message}/>}
47
47
  {isUndo && <MessageUndo messageSeq={message.messageSeq} text={mine ? t('youWithdrawMsg') : `"${message.messageFromName}" ${t('withdrawMsg')}`} undoText={message.payload.text} haveBackgroundImage={false} edit={mine && message.payloadType === 'text'}/>}
@@ -69,10 +69,10 @@ const MessageItem = (_a) => {
69
69
  : 0,
70
70
  },
71
71
  ]}>
72
- {!mine && message.conversationType !== ConversationType.C2C && (<Text style={[styles.name, {
72
+ {!mine && message.conversationType !== ConversationType.C2C && (<CaihText style={[styles.name, {
73
73
  marginLeft: notArrow ? 0 : dp(10),
74
74
  marginBottom: dp(5),
75
- }]}>{message.messageFromName}</Text>)}
75
+ }]}>{message.messageFromName}</CaihText>)}
76
76
  <View>
77
77
  <MessagePayload style={[
78
78
  styles.payload,
@@ -84,17 +84,17 @@ const MessageItem = (_a) => {
84
84
  e.stopPropagation();
85
85
  e.preventDefault();
86
86
  onPressPopover(message, e.nativeEvent);
87
- }} onLongPress={(e, layout) => {
87
+ }} onLongPress={(e, ref) => {
88
88
  e.stopPropagation();
89
89
  e.preventDefault();
90
- onLongPressPopover(message, e.nativeEvent, layout);
90
+ onLongPressPopover(message, ref);
91
91
  }}/>
92
92
  {isC2C && mine && <MessageReceiptStatus {...message}/>}
93
93
  </View>
94
94
  </View>
95
- {message.messageStatus === MessageStatus.EMIT_ERROR && (<Text style={{ alignSelf: 'center' }}>
95
+ {message.messageStatus === MessageStatus.EMIT_ERROR && (<CaihText style={{ alignSelf: 'center' }}>
96
96
  <Icon name="info" size={dp(20)} color={theme.errorColor}/>
97
- </Text>)}
97
+ </CaihText>)}
98
98
  {mine && message.messageStatus === MessageStatus.EMITTING && (<ActivityIndicator size="small" color={'#666'} animating={true}/>)}
99
99
  {!mine && isMultiple && message.payloadType !== 'voice' && (<Checkbox checked={isMultipleChecked} style={[styles.multipleCheckbox, styles.multipleCheckboxRight]}/>)}
100
100
  </View>
@@ -102,7 +102,7 @@ const MessageItem = (_a) => {
102
102
  {message.messageStatus === MessageStatus.EMIT_ERROR && (<>
103
103
  <View style={{ height: dp(10) }}/>
104
104
  <View style={styles.errorInfo}>
105
- <Text style={styles.errorInfoText}>{t('sendMsgFail')}</Text>
105
+ <CaihText style={styles.errorInfoText}>{t('sendMsgFail')}</CaihText>
106
106
  <TouchableOpacity activeOpacity={0.5} onPress={() => {
107
107
  var _a;
108
108
  const imManager = getImManager();
@@ -114,7 +114,7 @@ const MessageItem = (_a) => {
114
114
  offset: 0,
115
115
  });
116
116
  }}>
117
- <Text style={styles.errorInfoSend}>{t('resendMsg')}</Text>
117
+ <CaihText style={styles.errorInfoSend}>{t('resendMsg')}</CaihText>
118
118
  </TouchableOpacity>
119
119
  </View>
120
120
  </>)}
@@ -1,7 +1,7 @@
1
1
  import React, { memo } from 'react';
2
- import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';
2
+ import { StyleSheet, View, TouchableOpacity } from 'react-native';
3
3
  import ChatAvatar from '../../../components/ChatAvatar/ChatAvatar';
4
- import { dp } from '@smart-link/rn-ui';
4
+ import { CaihText, dp } from '@smart-link/rn-ui';
5
5
  // @ts-ignore
6
6
  import Icon from 'react-native-vector-icons/MaterialIcons';
7
7
  const MessageItemQuote = memo(props => {
@@ -10,8 +10,8 @@ const MessageItemQuote = memo(props => {
10
10
  <ChatAvatar id={quoteId} url={quoteAvatars} size={dp(32)} name={''}/>
11
11
  <View style={styles.width10}/>
12
12
  <View style={styles.left}>
13
- <Text style={styles.name} numberOfLines={1}>{quoteTitle}</Text>
14
- <Text style={styles.text} numberOfLines={1}>{quoteText}</Text>
13
+ <CaihText style={styles.name} numberOfLines={1}>{quoteTitle}</CaihText>
14
+ <CaihText style={styles.text} numberOfLines={1}>{quoteText}</CaihText>
15
15
  </View>
16
16
  <TouchableOpacity style={styles.delete} onPress={onDeleteQuote}>
17
17
  <Icon name="clear" color="#666" size={dp(18)}/>
@@ -1,6 +1,6 @@
1
- import { dp } from '@smart-link/rn-ui';
1
+ import { CaihText, dp } from '@smart-link/rn-ui';
2
2
  import React, { memo } from 'react';
3
- import { Image, StyleSheet, Text, TouchableOpacity } from 'react-native';
3
+ import { Image, StyleSheet, TouchableOpacity } from 'react-native';
4
4
  import FontAwesome from "react-native-vector-icons/FontAwesome";
5
5
  import { shadowStyle } from "../../../components/styles";
6
6
  import { getImManager, getLogo } from "../../../init";
@@ -12,10 +12,10 @@ const MessageItemTips = memo(props => {
12
12
  imManager.store.dispatch(MessagePanelActions.focusTipsMessage(imManager));
13
13
  }}>
14
14
  <Image style={styles.logo} source={getLogo()}/>
15
- <Text style={styles.text}>{text}</Text>
16
- <Text style={styles.icon}>
15
+ <CaihText style={styles.text}>{text}</CaihText>
16
+ <CaihText style={styles.icon}>
17
17
  <FontAwesome name="angle-double-up" color="#777" size={17}/>
18
- </Text>
18
+ </CaihText>
19
19
  </TouchableOpacity>);
20
20
  });
21
21
  const styles = StyleSheet.create({
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { IMessage } from '@smart-link/im-base';
3
- import { NativeEventLayout } from '../../../pages';
4
3
  type MessageOptionProps = {
5
4
  message?: IMessage;
6
5
  visible: boolean;
@@ -8,9 +7,9 @@ type MessageOptionProps = {
8
7
  x: number;
9
8
  y: number;
10
9
  };
11
- nativeEventLayout?: NativeEventLayout;
10
+ touchTarget?: any;
12
11
  onClose: () => void;
13
12
  setLoading: (loading: boolean) => void;
14
13
  };
15
- declare const _default: React.MemoExoticComponent<({ visible, message, nativeEventLayout, touchPoint, onClose, setLoading }: MessageOptionProps) => React.JSX.Element | null>;
14
+ declare const _default: React.MemoExoticComponent<({ visible, message, touchTarget, onClose, setLoading }: MessageOptionProps) => React.JSX.Element | null>;
16
15
  export default _default;
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import React, { memo, useRef } from 'react';
11
- import { Animated, Text, StyleSheet, TouchableOpacity, View, TouchableWithoutFeedback, Dimensions, StatusBar, Modal, } from 'react-native';
11
+ import { Animated, StyleSheet, TouchableOpacity, View, TouchableWithoutFeedback, Dimensions, Modal, } from 'react-native';
12
12
  import Clipboard from '@react-native-clipboard/clipboard';
13
13
  import { getMessageActionKeys, MessageActions, MessagePanelActions, MessageStatus, PayloadType, ConversationType, } from '@smart-link/im-base';
14
14
  import AntDesign from 'react-native-vector-icons/AntDesign';
@@ -16,7 +16,7 @@ import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
16
16
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
17
17
  import FontAwesome from 'react-native-vector-icons/FontAwesome';
18
18
  import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
19
- import { dp, Toast, useNavigation, Modal as Dialog } from '@smart-link/rn-ui';
19
+ import { dp, Toast, useNavigation, Modal as Dialog, CaihText } from '@smart-link/rn-ui';
20
20
  import useTranslation from '../../../hooks/useTranslation';
21
21
  import { ConfirmActionSheet } from '../../../utils/common-action-sheet';
22
22
  import { getImManager } from '../../../init';
@@ -193,14 +193,13 @@ const renderOperations = (items, close) => {
193
193
  }}>
194
194
  <View style={styles.operationItem}>
195
195
  {item.icon}
196
- <Text style={styles.operationText}>{item.title}</Text>
196
+ <CaihText allowFontScaling={false} style={styles.operationText}>{item.title}</CaihText>
197
197
  </View>
198
198
  </TouchableOpacity>);
199
199
  })}
200
200
  </View>);
201
201
  };
202
- const MessageOption = ({ visible, message, nativeEventLayout, touchPoint, onClose, setLoading }) => {
203
- var _a;
202
+ const MessageOption = ({ visible, message, touchTarget, onClose, setLoading }) => {
204
203
  const { t } = useTranslation();
205
204
  const headerHeight = useHeaderHeight();
206
205
  const { messageBarHeight } = usePanel();
@@ -217,7 +216,7 @@ const MessageOption = ({ visible, message, nativeEventLayout, touchPoint, onClos
217
216
  x: padding,
218
217
  y: padding,
219
218
  width: screenWidth - padding * 2,
220
- height: screenHeight - headerHeight - messageBarHeight - ((_a = StatusBar.currentHeight) !== null && _a !== void 0 ? _a : 0) - padding * 2,
219
+ height: screenHeight - headerHeight - messageBarHeight - padding * 2,
221
220
  };
222
221
  const showAnimation = (x, y) => {
223
222
  translateX.setValue(x);
@@ -256,20 +255,21 @@ const MessageOption = ({ visible, message, nativeEventLayout, touchPoint, onClos
256
255
  });
257
256
  };
258
257
  const onLayout = (e) => {
258
+ console.log('[MessageOption] onLayout: ', touchTarget);
259
259
  const { width: contentWidth, height: contentHeight } = e.nativeEvent.layout;
260
260
  // 计算操作项的显示位置
261
- // 判断点击位置是否存在
262
- if (nativeEventLayout && touchPoint) {
263
- const { height } = nativeEventLayout;
264
- const { x, y } = touchPoint;
265
- let safePageY = !isNaN(y) ? y : displayArea.y;
266
- let targetY = safePageY + height + contentHeight > displayArea.height
267
- ? safePageY - contentHeight
268
- : safePageY + height;
269
- let targetX = x + contentWidth > displayArea.width
270
- ? displayArea.width - contentWidth
271
- : x;
272
- showAnimation(targetX, targetY);
261
+ if (touchTarget) {
262
+ touchTarget.measureInWindow((x, y, width, height, pageX, pageY) => {
263
+ console.log('[MessageOption] touchTarget.measure: ', x, y, width, height, pageX, pageY);
264
+ let safePageY = !isNaN(y) ? y : displayArea.y;
265
+ let targetY = safePageY + height + contentHeight > displayArea.height
266
+ ? safePageY - contentHeight
267
+ : safePageY + height;
268
+ let targetX = x + contentWidth > displayArea.width
269
+ ? displayArea.width - contentWidth
270
+ : x;
271
+ showAnimation(targetX, targetY);
272
+ });
273
273
  }
274
274
  else {
275
275
  showAnimation(displayArea.x + displayArea.width - contentWidth, displayArea.y + displayArea.height / 2 - contentHeight / 2);
@@ -3,14 +3,13 @@ import { IMessage } from '@smart-link/im-base';
3
3
  import { StyleProp } from 'react-native';
4
4
  import { ViewStyle } from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
5
5
  import { GestureResponderEvent } from 'react-native/Libraries/Types/CoreEventTypes';
6
- import { NativeEventLayout } from "../../types";
7
6
  export interface MessagePayloadProps extends IMessage {
8
7
  style?: StyleProp<ViewStyle>;
9
8
  direction?: 'left' | 'right';
10
9
  showArrow?: boolean;
11
10
  isRecord?: boolean;
12
11
  onPress?: (e: GestureResponderEvent) => void;
13
- onLongPress?: (e: GestureResponderEvent, layout: NativeEventLayout) => void;
12
+ onLongPress?: (e: GestureResponderEvent, ref: any) => void;
14
13
  onLoad?: (localPath: string) => void;
15
14
  }
16
15
  declare const _default: React.NamedExoticComponent<MessagePayloadProps>;
@@ -11,7 +11,6 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import React, { memo } from 'react';
13
13
  import { PayloadType } from '@smart-link/im-base';
14
- import { Text } from 'react-native';
15
14
  import PayloadContact from './Payload/PayloadContact';
16
15
  import PayloadFile from './Payload/PayloadFile';
17
16
  import PayloadPicture from './Payload/PayloadPicture';
@@ -23,6 +22,7 @@ import useTranslation from '../../../hooks/useTranslation';
23
22
  import PayloadMultiple from './Payload/PayloadMultiple';
24
23
  import PayloadWrapper from './Payload/PayloadWrapper';
25
24
  import PayloadShare from "../../../pages/message/components/Payload/PayloadShare";
25
+ import { CaihText } from "@smart-link/rn-ui";
26
26
  const MessagePayload = props => {
27
27
  const { style: outStyle, isRecord } = props, retProps = __rest(props, ["style", "isRecord"]);
28
28
  const { t } = useTranslation();
@@ -60,7 +60,7 @@ const MessagePayload = props => {
60
60
  default:
61
61
  console.log('暂不支持的消息类型:', payloadType);
62
62
  content = (<PayloadWrapper style={style} direction={mergeProps.direction} isRecord={isRecord}>
63
- <Text style={plain}>[{t('msgTypeNotSupported')}]</Text>
63
+ <CaihText style={plain}>[{t('msgTypeNotSupported')}]</CaihText>
64
64
  </PayloadWrapper>);
65
65
  break;
66
66
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
3
- import { dp } from "@smart-link/rn-ui";
2
+ import { View, TouchableOpacity, StyleSheet } from 'react-native';
3
+ import { CaihText, dp } from "@smart-link/rn-ui";
4
4
  import useTranslation from '../../../hooks/useTranslation';
5
5
  import { getImManager } from "../../../init";
6
6
  export const MessageUndo = (props) => {
@@ -16,30 +16,27 @@ export const MessageUndo = (props) => {
16
16
  }
17
17
  };
18
18
  return (<View style={[styles.root, bgStyle]}>
19
- <Text style={[styles.text, bgFont]}>{text}</Text>
19
+ <CaihText style={[styles.text, bgFont]}>{text}</CaihText>
20
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>}
21
+ {edit && !!(undoText === null || undoText === void 0 ? void 0 : undoText.length) && <CaihText style={styles.edit}>{t('reedit')}</CaihText>}
22
22
  </TouchableOpacity>
23
23
  </View>);
24
24
  };
25
25
  const styles = StyleSheet.create({
26
26
  root: {
27
- borderRadius: dp(3),
28
27
  padding: dp(8),
29
28
  flexDirection: 'row',
30
- alignSelf: 'center'
29
+ alignSelf: 'center',
31
30
  },
32
31
  text: {
33
32
  color: '#808080',
34
33
  fontSize: (13),
35
- lineHeight: (15)
36
34
  },
37
35
  edit: {
38
- paddingHorizontal: 5,
39
36
  textDecorationLine: 'underline',
40
37
  color: '#208aff',
41
38
  fontSize: (13),
42
- lineHeight: (15)
39
+ paddingHorizontal: dp(5),
43
40
  }
44
41
  });
45
42
  export default MessageUndo;
@@ -8,11 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import React, { memo, useEffect, useState } from 'react';
11
- import { StyleSheet, TouchableOpacity, Text, View, Animated } from 'react-native';
11
+ import { StyleSheet, TouchableOpacity, View, Animated } from 'react-native';
12
12
  import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
13
13
  import AntDesign from 'react-native-vector-icons/AntDesign';
14
14
  import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
15
- import { dp, Toast, useNavigation } from '@smart-link/rn-ui';
15
+ import { CaihText, dp, Toast, useNavigation } from '@smart-link/rn-ui';
16
16
  import useTranslation from '../../../../hooks/useTranslation';
17
17
  import { useMessage } from '../../../../hooks/useImSelector';
18
18
  import { getImManager } from '../../../../init';
@@ -42,7 +42,7 @@ const MultipleBar = memo((props) => {
42
42
  }}>
43
43
  <View style={styles.item}>
44
44
  <FontAwesome5 name="reply" size={dp(20)} color={color}/>
45
- <Text style={fontStyle}>{t('forward')}</Text>
45
+ <CaihText style={fontStyle}>{t('forward')}</CaihText>
46
46
  </View>
47
47
  </TouchableOpacity>
48
48
 
@@ -51,7 +51,7 @@ const MultipleBar = memo((props) => {
51
51
  Toast.info(t('collectSuccess'));
52
52
  })}>
53
53
  <MaterialIcons name="collections" size={dp(20)} color={color}/>
54
- <Text style={fontStyle}>{t('collect')}</Text>
54
+ <CaihText style={fontStyle}>{t('collect')}</CaihText>
55
55
  </TouchableOpacity>
56
56
 
57
57
 
@@ -61,7 +61,7 @@ const MultipleBar = memo((props) => {
61
61
  }, t);
62
62
  }}>
63
63
  <AntDesign name="delete" size={dp(20)} color={color}/>
64
- <Text style={fontStyle}>{t('delete')}</Text>
64
+ <CaihText style={fontStyle}>{t('delete')}</CaihText>
65
65
  </TouchableOpacity>
66
66
  </Animated.View>);
67
67
  });
@@ -1,7 +1,7 @@
1
1
  import useTranslation from '../../../../hooks/useTranslation';
2
- import { dp, useNavigation } from '@smart-link/rn-ui';
2
+ import { CaihText, dp, useNavigation } from '@smart-link/rn-ui';
3
3
  import React, { memo } from 'react';
4
- import { View, Text, StyleSheet } from 'react-native';
4
+ import { View, StyleSheet } from 'react-native';
5
5
  import PayloadWrapper from './PayloadWrapper';
6
6
  import ChatAvatar from '../../../../components/ChatAvatar/ChatAvatar';
7
7
  const PayloadContact = ({ payload, direction, style, showArrow = true, onLongPress }) => {
@@ -14,13 +14,13 @@ const PayloadContact = ({ payload, direction, style, showArrow = true, onLongPre
14
14
  <View style={styles.content}>
15
15
  <ChatAvatar id={contact.userId} url={contact.avatars} name={contact.userName}/>
16
16
  <View style={styles.info}>
17
- <Text style={styles.name}>{contact.userName}</Text>
18
- <Text style={styles.group} numberOfLines={2}>
17
+ <CaihText style={styles.name}>{contact.userName}</CaihText>
18
+ <CaihText style={styles.group} numberOfLines={2}>
19
19
  {contact.groupNamePaths}
20
- </Text>
20
+ </CaihText>
21
21
  </View>
22
22
  </View>
23
- <Text style={styles.footer}>{t('contact')}</Text>
23
+ <CaihText style={styles.footer}>{t('contact')}</CaihText>
24
24
  </PayloadWrapper>);
25
25
  };
26
26
  const styles = StyleSheet.create({
@@ -7,10 +7,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { dp, Toast } from '@smart-link/rn-ui';
10
+ import { CaihText, dp, Toast } from '@smart-link/rn-ui';
11
11
  import FileViewer from 'react-native-file-viewer';
12
12
  import React, { memo, useRef, useState } from 'react';
13
- import { View, Text, StyleSheet, Dimensions, Platform, } from 'react-native';
13
+ import { View, StyleSheet, Dimensions, Platform, } from 'react-native';
14
14
  import { numberToFileSize, toAbsolutePath } from '../../../../utils/file';
15
15
  import { MessageStatus } from '@smart-link/im-base';
16
16
  import UploadProgress from '../UploadProgress';
@@ -108,8 +108,8 @@ const PayloadFile = ({ width = Dimensions.get('window').width * 0.72, payload, m
108
108
  <View style={{ flexDirection: 'row', alignItems: 'center', flex: 1 }}>
109
109
  <Icon style={styles.fileIcon}/>
110
110
  <View style={{ flex: 1 }}>
111
- <Text numberOfLines={1} ellipsizeMode="middle">{payload.filename}</Text>
112
- <Text style={styles.size}>{numberToFileSize(payload.size)} {payload.localPath ? t('downloaded') : ''}</Text>
111
+ <CaihText numberOfLines={1} ellipsizeMode="middle">{payload.filename}</CaihText>
112
+ <CaihText style={styles.size}>{numberToFileSize(payload.size)} {payload.localPath ? t('downloaded') : ''}</CaihText>
113
113
  </View>
114
114
  </View>
115
115
 
@@ -2,9 +2,9 @@ import { borderStyle, shadowStyle } from '../../../../components/styles';
2
2
  import useTranslation from '../../../../hooks/useTranslation';
3
3
  import { getImManager } from '../../../../init';
4
4
  import { buildSimpleText, ConversationType, MessageListActions } from '@smart-link/im-base';
5
- import { dp, useNavigation } from '@smart-link/rn-ui';
5
+ import { CaihText, dp, useNavigation } from '@smart-link/rn-ui';
6
6
  import React, { memo } from 'react';
7
- import { View, StyleSheet, Text, Dimensions } from 'react-native';
7
+ import { View, StyleSheet, Dimensions } from 'react-native';
8
8
  import PayloadWrapper from './PayloadWrapper';
9
9
  const { width } = Dimensions.get('window');
10
10
  const PayloadMultiple = memo(({ payload, isRecord, messageSeq, direction, showArrow = true, style, onLongPress }) => {
@@ -27,20 +27,20 @@ const PayloadMultiple = memo(({ payload, isRecord, messageSeq, direction, showAr
27
27
  },
28
28
  });
29
29
  }} onLongPress={onLongPress}>
30
- <Text style={styles.titleText} numberOfLines={2}>
30
+ <CaihText style={styles.titleText} numberOfLines={2}>
31
31
  {title}
32
- </Text>
32
+ </CaihText>
33
33
  <View style={styles.content}>
34
34
  {messages.map((message, index) => {
35
- return message === 'more' ? (<Text key={index} style={styles.itemTextMore}>
35
+ return message === 'more' ? (<CaihText key={index} style={styles.itemTextMore}>
36
36
  ......
37
- </Text>) : (<Text key={index} style={styles.itemText} numberOfLines={1} ellipsizeMode="middle">
37
+ </CaihText>) : (<CaihText key={index} style={styles.itemText} numberOfLines={1} ellipsizeMode="middle">
38
38
  {message.messageFromName + ': ' + buildSimpleText(imManager, message.payloadType, message.payload)}
39
- </Text>);
39
+ </CaihText>);
40
40
  })}
41
41
  </View>
42
42
  <View style={styles.line}/>
43
- <Text style={styles.footerText}>{t('multipleChatRecord')}</Text>
43
+ <CaihText style={styles.footerText}>{t('multipleChatRecord')}</CaihText>
44
44
  </PayloadWrapper>);
45
45
  });
46
46
  const styles = StyleSheet.create({
@@ -1,39 +1,40 @@
1
1
  import useTranslation from '../../../../hooks/useTranslation';
2
2
  import { PayloadType, MemberLevel } from '@smart-link/im-base';
3
3
  import React, { memo } from 'react';
4
- import { View, Text, StyleSheet } from 'react-native';
4
+ import { View, StyleSheet } from 'react-native';
5
+ import { CaihText } from "@smart-link/rn-ui";
5
6
  const DetailChange = ({ payload }) => {
6
7
  const { t } = useTranslation();
7
8
  const changeKeys = {
8
9
  noticeChange: 'chatGroupNoticeChange',
9
10
  nameChange: 'chatGroupNameChange',
10
11
  };
11
- return <Text style={styles.text}>{t(changeKeys[payload.changeKey], payload)}</Text>;
12
+ return <CaihText style={styles.text}>{t(changeKeys[payload.changeKey], payload)}</CaihText>;
12
13
  };
13
14
  const MemberInvite = ({ payload }) => {
14
15
  const { t } = useTranslation();
15
- return (<Text style={styles.text}>
16
+ return (<CaihText style={styles.text}>
16
17
  {t('chatGroupInviteMember', { userName: payload.inviterName, content: payload.inviteesName.join('、') })}
17
- </Text>);
18
+ </CaihText>);
18
19
  };
19
20
  const MemberRemove = ({ payload }) => {
20
21
  const { t } = useTranslation();
21
- return <Text style={styles.text}>{t('chatGroupRemoveMember', { content: payload.names.join('、') })}</Text>;
22
+ return <CaihText style={styles.text}>{t('chatGroupRemoveMember', { content: payload.names.join('、') })}</CaihText>;
22
23
  };
23
24
  const MemberBeenRemove = ({ payload }) => {
24
25
  const { t } = useTranslation();
25
- return <Text style={styles.text}>{t('chatGroupBeenRemoveMember')}</Text>;
26
+ return <CaihText style={styles.text}>{t('chatGroupBeenRemoveMember')}</CaihText>;
26
27
  };
27
28
  const MemberLeave = ({ payload }) => {
28
29
  const { t } = useTranslation();
29
- return <Text style={styles.text}>{t('chatGroupMemberLeave', { userName: payload.userName })}</Text>;
30
+ return <CaihText style={styles.text}>{t('chatGroupMemberLeave', { userName: payload.userName })}</CaihText>;
30
31
  };
31
32
  const GroupInviteSwitch = ({ payload }) => {
32
33
  const { t } = useTranslation();
33
34
  // console.log('GroupInviteSwitch: ', payload)
34
- return (<Text style={styles.text}>
35
+ return (<CaihText style={styles.text}>
35
36
  {t(payload.switchCode === 'on' ? 'groupInviteValidateEnable' : 'groupInviteValidateDisable')}
36
- </Text>);
37
+ </CaihText>);
37
38
  };
38
39
  const UpdateManager = ({ payload }) => {
39
40
  const { t } = useTranslation();
@@ -43,7 +44,7 @@ const UpdateManager = ({ payload }) => {
43
44
  if (memberLevel === MemberLevel.OWNER) {
44
45
  content = t('setToOwner', { userName: targetUserName });
45
46
  }
46
- return <Text style={styles.text}>{opUserName} {content}</Text>;
47
+ return <CaihText style={styles.text}>{opUserName} {content}</CaihText>;
47
48
  };
48
49
  const PayloadNotify = ({ payload, payloadType }) => {
49
50
  let content;
@@ -70,7 +71,7 @@ const PayloadNotify = ({ payload, payloadType }) => {
70
71
  content = <UpdateManager payload={payload}/>;
71
72
  break;
72
73
  default:
73
- content = <Text style={styles.text}>{payload === null || payload === void 0 ? void 0 : payload.text}</Text>;
74
+ content = <CaihText style={styles.text}>{payload === null || payload === void 0 ? void 0 : payload.text}</CaihText>;
74
75
  console.log('default PayloadNotify: ', payload, payloadType);
75
76
  break;
76
77
  }
@@ -29,7 +29,7 @@ const PayloadPicture = (_a) => {
29
29
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(localPath);
30
30
  }
31
31
  }, [onLoad, localPath]);
32
- const size = calculate(payload.height || dp(163), payload.width || dp(100), 200);
32
+ const size = calculate(payload.height || dp(163), payload.width || dp(100));
33
33
  if (!localPath) {
34
34
  return <View style={[borderStyle, size, { alignItems: 'center', justifyContent: 'center', backgroundColor: 'rgba(0,0,0, 0.8)' }]}>
35
35
  <ActivityIndicator color={theme.primaryColor} size={'large'}/>
@@ -1,7 +1,7 @@
1
1
  import React, { memo } from 'react';
2
2
  import useTranslation from "../../../../hooks/useTranslation";
3
- import { dp } from "@smart-link/rn-ui";
4
- import { Linking, StyleSheet, Text, View } from "react-native";
3
+ import { CaihText, dp } from "@smart-link/rn-ui";
4
+ import { Linking, StyleSheet, View } from "react-native";
5
5
  import PayloadWrapper from "./PayloadWrapper";
6
6
  import { borderStyle, shadowStyle } from "../../../../components/styles";
7
7
  import Favicon from "../../../../components/Favicon";
@@ -17,17 +17,17 @@ const PayloadShare = ({ payload, direction, showArrow = true, style, onLongPress
17
17
  }
18
18
  }} onLongPress={onLongPress}>
19
19
  <View style={styles.card}>
20
- <Text style={styles.title} numberOfLines={2}>{title}</Text>
20
+ <CaihText style={styles.title} numberOfLines={2}>{title}</CaihText>
21
21
  <View style={styles.h5}/>
22
22
  <View style={styles.info}>
23
- <Text style={styles.description} numberOfLines={3}>{description}</Text>
23
+ <CaihText style={styles.description} numberOfLines={3}>{description}</CaihText>
24
24
  <View style={styles.w10}/>
25
25
  {/* favicon */}
26
26
  <Favicon url={url} size={size}/>
27
27
  </View>
28
28
  </View>
29
29
  <View style={styles.line}/>
30
- <Text style={styles.shareName}>{t('shareLink')}</Text>
30
+ <CaihText style={styles.shareName}>{t('shareLink')}</CaihText>
31
31
  </PayloadWrapper>);
32
32
  };
33
33
  const styles = StyleSheet.create({
@@ -1,7 +1,7 @@
1
1
  import React, { memo } from 'react';
2
2
  import { MessageStatus, numberToTime } from '@smart-link/im-base';
3
- import { dp } from '@smart-link/rn-ui';
4
- import { StyleSheet, View, Text } from 'react-native';
3
+ import { CaihText, dp } from '@smart-link/rn-ui';
4
+ import { StyleSheet, View } from 'react-native';
5
5
  import { getDownloadUrl } from '../../../../api/file';
6
6
  import { calculate } from '../../../../utils/golden-rectangle';
7
7
  import Icon from 'react-native-vector-icons/MaterialIcons';
@@ -30,7 +30,7 @@ const PayloadVideo = ({ messageStatus, messageSeq, payload, sendSize = 0, isReco
30
30
  <Icon size={30} name='play-circle-outline' color='#fff'/>
31
31
  </View>
32
32
  <View style={{ position: 'absolute', bottom: dp(5), right: dp(5) }}>
33
- <Text style={{ fontSize: dp(12), color: '#fff' }}>{numberToTime(payload.duration)}</Text>
33
+ <CaihText style={{ fontSize: dp(12), color: '#fff' }}>{numberToTime(payload.duration)}</CaihText>
34
34
  </View>
35
35
  </PayloadWrapper>);
36
36
  };
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import React, { memo, useRef } from 'react';
11
- import { Text, StyleSheet, View } from 'react-native';
12
- import { dp } from '@smart-link/rn-ui';
11
+ import { StyleSheet, View } from 'react-native';
12
+ import { CaihText, dp } from '@smart-link/rn-ui';
13
13
  import PayloadWrapper from './PayloadWrapper';
14
14
  import variables from '@smart-link/rn-ui/dist/components/styles/variables';
15
15
  import { getImManager } from '../../../../init';
@@ -92,7 +92,7 @@ const PayloadVoice = ({ payload, direction, style, messageSeq, showArrow = true,
92
92
  });
93
93
  return (<View style={[styles.root, { flexDirection: direction === 'left' ? 'row' : 'row-reverse' }]}>
94
94
  <PayloadWrapper showArrow={showArrow} direction={direction} onPress={handlePlay} onLongPress={onLongPress} style={[style, styles.popoverVoice, { width: voiceWidth + 15 }]}>
95
- <Text style={styles.duration}>{second}''</Text>
95
+ <CaihText style={styles.duration}>{second}''</CaihText>
96
96
  <Image style={[
97
97
  styles.voiceImage,
98
98
  {
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { GestureResponderEvent } from 'react-native';
3
- import { NativeEventLayout } from "../../../types";
2
+ import { GestureResponderEvent, ViewComponent } from 'react-native';
4
3
  export interface PayloadWrapperProps {
5
4
  showArrow?: boolean;
6
5
  isRecord?: boolean;
@@ -8,7 +7,7 @@ export interface PayloadWrapperProps {
8
7
  children: React.ReactNode;
9
8
  style?: any;
10
9
  onPress?: (e: GestureResponderEvent) => void;
11
- onLongPress?: (e: GestureResponderEvent, layout: NativeEventLayout) => void;
10
+ onLongPress?: (e: GestureResponderEvent, ref: ViewComponent) => void;
12
11
  }
13
12
  declare const PayloadWrapper: React.NamedExoticComponent<PayloadWrapperProps>;
14
13
  export default PayloadWrapper;