@smart-link/rn-im 1.0.22 → 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 +52 -81
  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 -134
  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 +7 -11
  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,52 +1,27 @@
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 react_native_1 = require("react-native");
28
- const emoji_1 = require("../../../../utils/emoji");
29
- const Icons_1 = require("./Icons");
30
- const emojis = Array.from(new Set([...emoji_1.face]));
31
- const EMOJI_SIZE = (react_native_1.Dimensions.get('screen').width - 20) / 8;
1
+ import React, { forwardRef, memo, useImperativeHandle, useRef, useState } from 'react';
2
+ import { View, Text, FlatList, Animated, TouchableOpacity, Dimensions } from 'react-native';
3
+ import { face } from '../../../../utils/emoji';
4
+ import { DeleteSvg } from './Icons';
5
+ const emojis = Array.from(new Set([...face]));
6
+ const EMOJI_SIZE = (Dimensions.get('screen').width - 20) / 8;
32
7
  const keyExtractor = (item) => item;
33
- const EmojiPanel = (0, react_1.forwardRef)(({ onCheck, onBackspace }, ref) => {
34
- const visible = (0, react_1.useRef)(false);
35
- const [, forceUpdate] = (0, react_1.useState)({});
36
- const timer = (0, react_1.useRef)(null);
37
- const start = (0, react_1.useRef)(false);
8
+ const EmojiPanel = forwardRef(({ onCheck, onBackspace }, ref) => {
9
+ const visible = useRef(false);
10
+ const [, forceUpdate] = useState({});
11
+ const timer = useRef(null);
12
+ const start = useRef(false);
38
13
  //通过动画设置表情面板高度
39
- const [heightAnim] = (0, react_1.useState)(new react_native_1.Animated.Value(0));
40
- const renderItem = ({ item }) => (<react_native_1.TouchableOpacity style={{
14
+ const [heightAnim] = useState(new Animated.Value(0));
15
+ const renderItem = ({ item }) => (<TouchableOpacity style={{
41
16
  width: EMOJI_SIZE,
42
17
  height: EMOJI_SIZE,
43
18
  alignItems: 'center',
44
19
  }} onPress={() => {
45
20
  onCheck(item);
46
21
  }}>
47
- <react_native_1.Text style={{ fontSize: 22, color: '#333' }}>{item}</react_native_1.Text>
48
- </react_native_1.TouchableOpacity>);
49
- (0, react_1.useImperativeHandle)(ref, () => ({
22
+ <Text style={{ fontSize: 22, color: '#333' }}>{item}</Text>
23
+ </TouchableOpacity>);
24
+ useImperativeHandle(ref, () => ({
50
25
  show: (height) => {
51
26
  visible.current = true;
52
27
  heightAnim.setValue(height);
@@ -58,17 +33,17 @@ const EmojiPanel = (0, react_1.forwardRef)(({ onCheck, onBackspace }, ref) => {
58
33
  forceUpdate({});
59
34
  },
60
35
  }), []);
61
- return (<react_native_1.Animated.View style={{
36
+ return (<Animated.View style={{
62
37
  height: heightAnim,
63
38
  position: 'relative',
64
39
  flexDirection: 'column',
65
40
  paddingBottom: visible.current ? 20 : 0,
66
41
  }} pointerEvents='auto'>
67
- <react_native_1.FlatList numColumns={8} initialNumToRender={80} data={emojis} keyExtractor={keyExtractor} contentContainerStyle={{
42
+ <FlatList numColumns={8} initialNumToRender={80} data={emojis} keyExtractor={keyExtractor} contentContainerStyle={{
68
43
  paddingHorizontal: 10,
69
44
  paddingBottom: 50,
70
45
  }} pointerEvents='auto' keyboardShouldPersistTaps={'handled'} renderItem={renderItem} scrollEnabled/>
71
- {visible.current && <react_native_1.View style={{
46
+ {visible.current && <View style={{
72
47
  position: 'absolute',
73
48
  height: EMOJI_SIZE,
74
49
  width: 80,
@@ -78,7 +53,7 @@ const EmojiPanel = (0, react_1.forwardRef)(({ onCheck, onBackspace }, ref) => {
78
53
  borderRadius: 6,
79
54
  elevation: 1,
80
55
  }}>
81
- <react_native_1.TouchableOpacity style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }} onPressIn={() => {
56
+ <TouchableOpacity style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }} onPressIn={() => {
82
57
  console.log('onPressIn: backspace');
83
58
  onBackspace();
84
59
  start.current = true;
@@ -93,9 +68,9 @@ const EmojiPanel = (0, react_1.forwardRef)(({ onCheck, onBackspace }, ref) => {
93
68
  start.current = false;
94
69
  clearInterval(timer.current);
95
70
  }}>
96
- <Icons_1.DeleteSvg />
97
- </react_native_1.TouchableOpacity>
98
- </react_native_1.View>}
99
- </react_native_1.Animated.View>);
71
+ <DeleteSvg />
72
+ </TouchableOpacity>
73
+ </View>}
74
+ </Animated.View>);
100
75
  });
101
- exports.default = (0, react_1.memo)(EmojiPanel);
76
+ export default memo(EmojiPanel);
@@ -1,88 +1,70 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UserIcon = exports.CollectionIcon = exports.FileIcon = exports.VideoIcon = exports.TelPhoneIcon = exports.ShootingIcon = exports.PhotosIcon = exports.DeleteSvg = exports.OptionSvg = exports.EmojiSvg = exports.KeyboardSvg = exports.VoiceSvg = void 0;
7
- const rn_ui_1 = require("@smart-link/rn-ui");
8
- const react_1 = __importDefault(require("react"));
9
- const react_native_svg_1 = require("react-native-svg");
10
- const VoiceSvg = () => (<react_native_svg_1.Svg viewBox="0 0 1024 1024" width={(0, rn_ui_1.dp)(32)} height={(0, rn_ui_1.dp)(32)}>
11
- <react_native_svg_1.Path d="M512.5 54C765.723 54 971 259.277 971 512.5S765.723 971 512.5 971 54 765.723 54 512.5 259.277 54 512.5 54z m0 64C294.624 118 118 294.624 118 512.5S294.624 907 512.5 907 907 730.376 907 512.5 730.376 118 512.5 118z m84.457 158.623c61.57 61.569 96.816 144.901 96.816 233.734s-35.247 172.165-96.816 233.734c-12.497 12.497-32.758 12.497-45.255 0-12.496-12.497-12.496-32.758 0-45.255 49.686-49.686 78.07-116.795 78.07-188.48 0-71.684-28.384-138.793-78.07-188.479-12.496-12.496-12.496-32.758 0-45.254 12.497-12.497 32.758-12.497 45.255 0zM491.405 382.175C525.16 415.93 544.5 461.653 544.5 510.357c0 48.704-19.34 94.426-53.096 128.18-12.497 12.497-32.759 12.496-45.255-0.001-12.496-12.498-12.495-32.759 0.002-45.255 21.872-21.87 34.349-51.369 34.349-82.924 0-31.555-12.477-61.054-34.35-82.927-12.497-12.497-12.497-32.758 0-45.255s32.758-12.497 45.255 0z m-128.18 85.53c23.556 0 42.65 19.094 42.65 42.65 0 23.555-19.094 42.65-42.65 42.65-23.556 0-42.65-19.095-42.65-42.65 0-23.556 19.094-42.65 42.65-42.65z"/>
12
- </react_native_svg_1.Svg>);
13
- exports.VoiceSvg = VoiceSvg;
14
- const KeyboardSvg = () => (<react_native_svg_1.Svg viewBox="0 0 1024 1024" width={(0, rn_ui_1.dp)(32)} height={(0, rn_ui_1.dp)(32)}>
15
- <react_native_svg_1.Path d="M736 352c-17.696 0-32 14.336-32 32l0 96-96 0c-17.696 0-32 14.336-32 32s14.304 32 32 32l128 0c17.696 0 32-14.336 32-32l0-128C768 366.336 753.696 352 736 352zM736 672 288 672c-17.664 0-32-14.304-32-32s14.336-32 32-32l448 0c17.696 0 32 14.304 32 32S753.696 672 736 672zM480 544l-32 0c-17.664 0-32-14.336-32-32s14.336-32 32-32l32 0c17.664 0 32 14.336 32 32S497.664 544 480 544zM320 544 288 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l32 0c17.664 0 32 14.336 32 32S337.664 544 320 544zM480 416l-32 0c-17.664 0-32-14.336-32-32s14.336-32 32-32l32 0c17.664 0 32 14.336 32 32S497.664 416 480 416zM640 416l-32 0c-17.696 0-32-14.336-32-32s14.304-32 32-32l32 0c17.696 0 32 14.336 32 32S657.696 416 640 416zM320 416 288 416c-17.664 0-32-14.336-32-32s14.336-32 32-32l32 0c17.664 0 32 14.336 32 32S337.664 416 320 416zM512.128 957.344c-247.04 0-448-200.96-448-448s200.96-448 448-448 448 200.96 448 448S759.168 957.344 512.128 957.344zM512.128 125.344c-211.744 0-384 172.256-384 384 0 211.744 172.256 384 384 384 211.744 0 384-172.256 384-384C896.128 297.6 723.872 125.344 512.128 125.344z"/>
16
- </react_native_svg_1.Svg>);
17
- exports.KeyboardSvg = KeyboardSvg;
18
- const EmojiSvg = () => (<react_native_svg_1.Svg viewBox="0 0 1024 1024" width={(0, rn_ui_1.dp)(32)} height={(0, rn_ui_1.dp)(32)}>
19
- <react_native_svg_1.Path d="M510.944 960c-247.04 0-448-200.96-448-448s200.992-448 448-448c247.008 0 448 200.96 448 448S757.984 960 510.944 960zM510.944 128c-211.744 0-384 172.256-384 384 0 211.744 172.256 384 384 384 211.744 0 384-172.256 384-384C894.944 300.256 722.688 128 510.944 128zM512 773.344c-89.184 0-171.904-40.32-226.912-110.624-10.88-13.92-8.448-34.016 5.472-44.896 13.888-10.912 34.016-8.48 44.928 5.472 42.784 54.688 107.136 86.048 176.512 86.048 70.112 0 134.88-31.904 177.664-87.552 10.784-14.016 30.848-16.672 44.864-5.888 14.016 10.784 16.672 30.88 5.888 44.864C685.408 732.32 602.144 773.344 512 773.344zM368 515.2c-26.528 0-48-21.472-48-48l0-64c0-26.528 21.472-48 48-48s48 21.472 48 48l0 64C416 493.696 394.496 515.2 368 515.2zM656 515.2c-26.496 0-48-21.472-48-48l0-64c0-26.528 21.504-48 48-48s48 21.472 48 48l0 64C704 493.696 682.496 515.2 656 515.2z"/>
20
- </react_native_svg_1.Svg>);
21
- exports.EmojiSvg = EmojiSvg;
22
- const OptionSvg = () => (<react_native_svg_1.Svg viewBox="0 0 1024 1024" width={(0, rn_ui_1.dp)(32)} height={(0, rn_ui_1.dp)(32)}>
23
- <react_native_svg_1.Path d="M512 128c211.2 0 384 172.8 384 384s-172.8 384-384 384-384-172.8-384-384 172.8-384 384-384m0-64C262.4 64 64 262.4 64 512s198.4 448 448 448 448-198.4 448-448-198.4-448-448-448z"/>
24
- <react_native_svg_1.Path d="M320 512m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"/>
25
- <react_native_svg_1.Path d="M704 512m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"/>
26
- <react_native_svg_1.Path d="M512 320m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"/>
27
- <react_native_svg_1.Path d="M512 704m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"/>
28
- <react_native_svg_1.Path d="M320 480h384v64H320z"/>
29
- <react_native_svg_1.Path d="M480 320h64v384h-64z"/>
30
- </react_native_svg_1.Svg>);
31
- exports.OptionSvg = OptionSvg;
32
- const DeleteSvg = () => (<react_native_svg_1.Svg fill={'#333'} viewBox="0 0 1024 1024" width={(0, rn_ui_1.dp)(24)} height={(0, rn_ui_1.dp)(24)}>
33
- <react_native_svg_1.Path d="M896 896H341.333333a42.666667 42.666667 0 0 1-32-14.506667l-298.666666-341.333333a42.666667 42.666667 0 0 1 0-56.32l298.666666-341.333333A42.666667 42.666667 0 0 1 341.333333 128h554.666667a128 128 0 0 1 128 128v512a128 128 0 0 1-128 128zM360.533333 810.666667H896a42.666667 42.666667 0 0 0 42.666667-42.666667V256a42.666667 42.666667 0 0 0-42.666667-42.666667H360.533333l-261.12 298.666667z"/>
34
- <react_native_svg_1.Path d="M512 682.666667a42.666667 42.666667 0 0 1-30.293333-12.373334 42.666667 42.666667 0 0 1 0-60.586666l256-256a42.666667 42.666667 0 0 1 60.586666 60.586666l-256 256A42.666667 42.666667 0 0 1 512 682.666667z"/>
35
- <react_native_svg_1.Path d="M768 682.666667a42.666667 42.666667 0 0 1-30.293333-12.373334l-256-256a42.666667 42.666667 0 0 1 60.586666-60.586666l256 256a42.666667 42.666667 0 0 1 0 60.586666A42.666667 42.666667 0 0 1 768 682.666667z"/>
36
- </react_native_svg_1.Svg>);
37
- exports.DeleteSvg = DeleteSvg;
38
- const PhotosIcon = (props) => {
1
+ import { dp } from '@smart-link/rn-ui';
2
+ import React from 'react';
3
+ import { Svg, Path } from 'react-native-svg';
4
+ export const VoiceSvg = () => (<Svg viewBox="0 0 1024 1024" width={dp(32)} height={dp(32)}>
5
+ <Path d="M512.5 54C765.723 54 971 259.277 971 512.5S765.723 971 512.5 971 54 765.723 54 512.5 259.277 54 512.5 54z m0 64C294.624 118 118 294.624 118 512.5S294.624 907 512.5 907 907 730.376 907 512.5 730.376 118 512.5 118z m84.457 158.623c61.57 61.569 96.816 144.901 96.816 233.734s-35.247 172.165-96.816 233.734c-12.497 12.497-32.758 12.497-45.255 0-12.496-12.497-12.496-32.758 0-45.255 49.686-49.686 78.07-116.795 78.07-188.48 0-71.684-28.384-138.793-78.07-188.479-12.496-12.496-12.496-32.758 0-45.254 12.497-12.497 32.758-12.497 45.255 0zM491.405 382.175C525.16 415.93 544.5 461.653 544.5 510.357c0 48.704-19.34 94.426-53.096 128.18-12.497 12.497-32.759 12.496-45.255-0.001-12.496-12.498-12.495-32.759 0.002-45.255 21.872-21.87 34.349-51.369 34.349-82.924 0-31.555-12.477-61.054-34.35-82.927-12.497-12.497-12.497-32.758 0-45.255s32.758-12.497 45.255 0z m-128.18 85.53c23.556 0 42.65 19.094 42.65 42.65 0 23.555-19.094 42.65-42.65 42.65-23.556 0-42.65-19.095-42.65-42.65 0-23.556 19.094-42.65 42.65-42.65z"/>
6
+ </Svg>);
7
+ export const KeyboardSvg = () => (<Svg viewBox="0 0 1024 1024" width={dp(32)} height={dp(32)}>
8
+ <Path d="M736 352c-17.696 0-32 14.336-32 32l0 96-96 0c-17.696 0-32 14.336-32 32s14.304 32 32 32l128 0c17.696 0 32-14.336 32-32l0-128C768 366.336 753.696 352 736 352zM736 672 288 672c-17.664 0-32-14.304-32-32s14.336-32 32-32l448 0c17.696 0 32 14.304 32 32S753.696 672 736 672zM480 544l-32 0c-17.664 0-32-14.336-32-32s14.336-32 32-32l32 0c17.664 0 32 14.336 32 32S497.664 544 480 544zM320 544 288 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l32 0c17.664 0 32 14.336 32 32S337.664 544 320 544zM480 416l-32 0c-17.664 0-32-14.336-32-32s14.336-32 32-32l32 0c17.664 0 32 14.336 32 32S497.664 416 480 416zM640 416l-32 0c-17.696 0-32-14.336-32-32s14.304-32 32-32l32 0c17.696 0 32 14.336 32 32S657.696 416 640 416zM320 416 288 416c-17.664 0-32-14.336-32-32s14.336-32 32-32l32 0c17.664 0 32 14.336 32 32S337.664 416 320 416zM512.128 957.344c-247.04 0-448-200.96-448-448s200.96-448 448-448 448 200.96 448 448S759.168 957.344 512.128 957.344zM512.128 125.344c-211.744 0-384 172.256-384 384 0 211.744 172.256 384 384 384 211.744 0 384-172.256 384-384C896.128 297.6 723.872 125.344 512.128 125.344z"/>
9
+ </Svg>);
10
+ export const EmojiSvg = () => (<Svg viewBox="0 0 1024 1024" width={dp(32)} height={dp(32)}>
11
+ <Path d="M510.944 960c-247.04 0-448-200.96-448-448s200.992-448 448-448c247.008 0 448 200.96 448 448S757.984 960 510.944 960zM510.944 128c-211.744 0-384 172.256-384 384 0 211.744 172.256 384 384 384 211.744 0 384-172.256 384-384C894.944 300.256 722.688 128 510.944 128zM512 773.344c-89.184 0-171.904-40.32-226.912-110.624-10.88-13.92-8.448-34.016 5.472-44.896 13.888-10.912 34.016-8.48 44.928 5.472 42.784 54.688 107.136 86.048 176.512 86.048 70.112 0 134.88-31.904 177.664-87.552 10.784-14.016 30.848-16.672 44.864-5.888 14.016 10.784 16.672 30.88 5.888 44.864C685.408 732.32 602.144 773.344 512 773.344zM368 515.2c-26.528 0-48-21.472-48-48l0-64c0-26.528 21.472-48 48-48s48 21.472 48 48l0 64C416 493.696 394.496 515.2 368 515.2zM656 515.2c-26.496 0-48-21.472-48-48l0-64c0-26.528 21.504-48 48-48s48 21.472 48 48l0 64C704 493.696 682.496 515.2 656 515.2z"/>
12
+ </Svg>);
13
+ export const OptionSvg = () => (<Svg viewBox="0 0 1024 1024" width={dp(32)} height={dp(32)}>
14
+ <Path d="M512 128c211.2 0 384 172.8 384 384s-172.8 384-384 384-384-172.8-384-384 172.8-384 384-384m0-64C262.4 64 64 262.4 64 512s198.4 448 448 448 448-198.4 448-448-198.4-448-448-448z"/>
15
+ <Path d="M320 512m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"/>
16
+ <Path d="M704 512m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"/>
17
+ <Path d="M512 320m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"/>
18
+ <Path d="M512 704m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z"/>
19
+ <Path d="M320 480h384v64H320z"/>
20
+ <Path d="M480 320h64v384h-64z"/>
21
+ </Svg>);
22
+ export const DeleteSvg = () => (<Svg fill={'#333'} viewBox="0 0 1024 1024" width={dp(24)} height={dp(24)}>
23
+ <Path d="M896 896H341.333333a42.666667 42.666667 0 0 1-32-14.506667l-298.666666-341.333333a42.666667 42.666667 0 0 1 0-56.32l298.666666-341.333333A42.666667 42.666667 0 0 1 341.333333 128h554.666667a128 128 0 0 1 128 128v512a128 128 0 0 1-128 128zM360.533333 810.666667H896a42.666667 42.666667 0 0 0 42.666667-42.666667V256a42.666667 42.666667 0 0 0-42.666667-42.666667H360.533333l-261.12 298.666667z"/>
24
+ <Path d="M512 682.666667a42.666667 42.666667 0 0 1-30.293333-12.373334 42.666667 42.666667 0 0 1 0-60.586666l256-256a42.666667 42.666667 0 0 1 60.586666 60.586666l-256 256A42.666667 42.666667 0 0 1 512 682.666667z"/>
25
+ <Path d="M768 682.666667a42.666667 42.666667 0 0 1-30.293333-12.373334l-256-256a42.666667 42.666667 0 0 1 60.586666-60.586666l256 256a42.666667 42.666667 0 0 1 0 60.586666A42.666667 42.666667 0 0 1 768 682.666667z"/>
26
+ </Svg>);
27
+ export const PhotosIcon = (props) => {
39
28
  const { size = 24, color = '#333' } = props;
40
- return (<react_native_svg_1.Svg fill={color} width={(0, rn_ui_1.dp)(size)} height={(0, rn_ui_1.dp)(size)} viewBox="0 0 1024 1024">
41
- <react_native_svg_1.Path d="M730.3 432.9c53.5 0 97-43.4 97-97 0-53.5-43.4-97-97-97-53.5 0-97 43.4-97 97s43.6 97 97 97zM900 109.7H108c-31.5 0-56.6 25.7-56.6 57.2v661.4c0 31.5 25 57.2 56.6 57.2h792c31.5 0 56.6-25.7 56.6-57.2V166.9c0-31.5-25.1-57.2-56.6-57.2zM691.8 509.1c-6.1-7.1-15.3-12.5-25.9-12.5-10.2 0-17.5 4.8-25.9 11.5L602.2 540c-7.8 5.6-14.2 9.5-23.3 9.5-8.8 0-16.6-3.2-22.2-8.2-2-1.9-5.6-5.2-8.8-8.2L439.2 415.6c-8-9.3-20.1-15.1-33.7-15.1-13.6 0-26.1 6.7-33.9 15.8L116.2 724.2V198c2-13.8 12.7-23.7 26.4-23.7h722.7c14 0 25.3 10.2 26.1 24.2l0.6 526-200.2-215.4z"></react_native_svg_1.Path>
42
- </react_native_svg_1.Svg>);
29
+ return (<Svg fill={color} width={dp(size)} height={dp(size)} viewBox="0 0 1024 1024">
30
+ <Path d="M730.3 432.9c53.5 0 97-43.4 97-97 0-53.5-43.4-97-97-97-53.5 0-97 43.4-97 97s43.6 97 97 97zM900 109.7H108c-31.5 0-56.6 25.7-56.6 57.2v661.4c0 31.5 25 57.2 56.6 57.2h792c31.5 0 56.6-25.7 56.6-57.2V166.9c0-31.5-25.1-57.2-56.6-57.2zM691.8 509.1c-6.1-7.1-15.3-12.5-25.9-12.5-10.2 0-17.5 4.8-25.9 11.5L602.2 540c-7.8 5.6-14.2 9.5-23.3 9.5-8.8 0-16.6-3.2-22.2-8.2-2-1.9-5.6-5.2-8.8-8.2L439.2 415.6c-8-9.3-20.1-15.1-33.7-15.1-13.6 0-26.1 6.7-33.9 15.8L116.2 724.2V198c2-13.8 12.7-23.7 26.4-23.7h722.7c14 0 25.3 10.2 26.1 24.2l0.6 526-200.2-215.4z"></Path>
31
+ </Svg>);
43
32
  };
44
- exports.PhotosIcon = PhotosIcon;
45
- const ShootingIcon = (props) => {
33
+ export const ShootingIcon = (props) => {
46
34
  const { size = 24, color = '#333' } = props;
47
- return (<react_native_svg_1.Svg fill={color} width={(0, rn_ui_1.dp)(size)} height={(0, rn_ui_1.dp)(size)} viewBox="0 0 1024 1024">
48
- <react_native_svg_1.Path d="M294.41 822.05c-53.11-9-95.48-49.27-107.16-101.85a681.035 681.035 0 0 1 0-295.52c11.69-52.58 54.05-92.85 107.16-101.85a1316.232 1316.232 0 0 1 439.84 0c53.11 9 95.48 49.27 107.16 101.85a681.035 681.035 0 0 1 0 295.52c-11.69 52.58-54.05 92.85-107.16 101.85a1316.232 1316.232 0 0 1-439.84 0z"></react_native_svg_1.Path>
49
- <react_native_svg_1.Path d="M668 331.32c0-22.18-2.42-44.36-7.26-66.14-5.23-23.54-24.19-41.56-47.97-45.59a589.311 589.311 0 0 0-196.88 0c-23.77 4.03-42.74 22.05-47.97 45.59a304.887 304.887 0 0 0-7.26 66.14"></react_native_svg_1.Path>
50
- <react_native_svg_1.Path d="M514.33 571.91m-139.27 0a139.27 139.27 0 1 0 278.54 0 139.27 139.27 0 1 0-278.54 0Z" fill="#FFFFFF"></react_native_svg_1.Path>
51
- </react_native_svg_1.Svg>);
35
+ return (<Svg fill={color} width={dp(size)} height={dp(size)} viewBox="0 0 1024 1024">
36
+ <Path d="M294.41 822.05c-53.11-9-95.48-49.27-107.16-101.85a681.035 681.035 0 0 1 0-295.52c11.69-52.58 54.05-92.85 107.16-101.85a1316.232 1316.232 0 0 1 439.84 0c53.11 9 95.48 49.27 107.16 101.85a681.035 681.035 0 0 1 0 295.52c-11.69 52.58-54.05 92.85-107.16 101.85a1316.232 1316.232 0 0 1-439.84 0z"></Path>
37
+ <Path d="M668 331.32c0-22.18-2.42-44.36-7.26-66.14-5.23-23.54-24.19-41.56-47.97-45.59a589.311 589.311 0 0 0-196.88 0c-23.77 4.03-42.74 22.05-47.97 45.59a304.887 304.887 0 0 0-7.26 66.14"></Path>
38
+ <Path d="M514.33 571.91m-139.27 0a139.27 139.27 0 1 0 278.54 0 139.27 139.27 0 1 0-278.54 0Z" fill="#FFFFFF"></Path>
39
+ </Svg>);
52
40
  };
53
- exports.ShootingIcon = ShootingIcon;
54
- const TelPhoneIcon = (props) => {
41
+ export const TelPhoneIcon = (props) => {
55
42
  const { size = 24, color = '#333' } = props;
56
- return (<react_native_svg_1.Svg fill={color} width={(0, rn_ui_1.dp)(size)} height={(0, rn_ui_1.dp)(size)} viewBox="0 0 1024 1024">
57
- <react_native_svg_1.Path d="M585 584.9c-94 94-202.9 183.9-245.9 140.9-61.7-61.6-99.6-115.3-235.4-6.1s-31.5 182 28.2 241.7c68.9 68.8 325.6 3.7 579.4-250.1 253.7-253.8 319-510.5 250.1-579.4-59.7-59.7-132.4-164-241.6-28.1-109.2 135.8-55.5 173.7 6.1 235.4C768.8 382 679 490.9 585 584.9z"></react_native_svg_1.Path>
58
- </react_native_svg_1.Svg>);
43
+ return (<Svg fill={color} width={dp(size)} height={dp(size)} viewBox="0 0 1024 1024">
44
+ <Path d="M585 584.9c-94 94-202.9 183.9-245.9 140.9-61.7-61.6-99.6-115.3-235.4-6.1s-31.5 182 28.2 241.7c68.9 68.8 325.6 3.7 579.4-250.1 253.7-253.8 319-510.5 250.1-579.4-59.7-59.7-132.4-164-241.6-28.1-109.2 135.8-55.5 173.7 6.1 235.4C768.8 382 679 490.9 585 584.9z"></Path>
45
+ </Svg>);
59
46
  };
60
- exports.TelPhoneIcon = TelPhoneIcon;
61
- const VideoIcon = (props) => {
47
+ export const VideoIcon = (props) => {
62
48
  const { size = 24, color = '#333' } = props;
63
- return (<react_native_svg_1.Svg fill={color} width={(0, rn_ui_1.dp)(size)} height={(0, rn_ui_1.dp)(size)} viewBox="0 0 1024 1024">
64
- <react_native_svg_1.Path d="M768 415.744q0 5.12-10.752 17.92t-23.04 30.208-23.04 37.888-10.752 41.984 10.752 41.472 23.04 36.352 23.04 27.136 10.752 13.824l0 107.52q0 17.408-12.8 39.424t-31.744 41.472-41.984 32.256-43.52 12.8l-508.928 0q-27.648 0-50.688-9.728t-40.448-27.136-27.136-40.96-9.728-51.2l0-441.344q0-20.48 9.216-42.496t26.112-40.448 39.936-30.72 50.688-12.288l508.928 0q27.648 0 51.712 9.728t41.984 26.624 28.16 40.448 10.24 50.176l0 89.088zM1086.464 319.488l0 467.968q0 22.528-11.776 39.936t-35.328 17.408q-8.192 0-20.992-6.144t-25.6-14.336-24.064-16.384-16.384-13.312q-13.312-11.264-40.448-38.912t-54.784-62.464-48.64-71.68-20.992-67.584 22.528-70.144 54.272-77.312 66.56-70.144 58.368-48.64q9.216-6.144 25.088-14.848t28.16-8.704q27.648 0 35.84 15.36t8.192 37.888l0 2.048z"></react_native_svg_1.Path>
65
- </react_native_svg_1.Svg>);
49
+ return (<Svg fill={color} width={dp(size)} height={dp(size)} viewBox="0 0 1024 1024">
50
+ <Path d="M768 415.744q0 5.12-10.752 17.92t-23.04 30.208-23.04 37.888-10.752 41.984 10.752 41.472 23.04 36.352 23.04 27.136 10.752 13.824l0 107.52q0 17.408-12.8 39.424t-31.744 41.472-41.984 32.256-43.52 12.8l-508.928 0q-27.648 0-50.688-9.728t-40.448-27.136-27.136-40.96-9.728-51.2l0-441.344q0-20.48 9.216-42.496t26.112-40.448 39.936-30.72 50.688-12.288l508.928 0q27.648 0 51.712 9.728t41.984 26.624 28.16 40.448 10.24 50.176l0 89.088zM1086.464 319.488l0 467.968q0 22.528-11.776 39.936t-35.328 17.408q-8.192 0-20.992-6.144t-25.6-14.336-24.064-16.384-16.384-13.312q-13.312-11.264-40.448-38.912t-54.784-62.464-48.64-71.68-20.992-67.584 22.528-70.144 54.272-77.312 66.56-70.144 58.368-48.64q9.216-6.144 25.088-14.848t28.16-8.704q27.648 0 35.84 15.36t8.192 37.888l0 2.048z"></Path>
51
+ </Svg>);
66
52
  };
67
- exports.VideoIcon = VideoIcon;
68
- const FileIcon = (props) => {
53
+ export const FileIcon = (props) => {
69
54
  const { size = 24, color = '#333' } = props;
70
- return (<react_native_svg_1.Svg fill={color} width={(0, rn_ui_1.dp)(size)} height={(0, rn_ui_1.dp)(size)} viewBox="0 0 1024 1024">
71
- <react_native_svg_1.Path d="M519.283382 163.91421l0 232.024447 232.315066 0L519.283382 163.91421zM490.341213 425.124374 490.341213 163.91421l0 0L257.879813 163.91421l0 696.170556 508.23935 0L766.119163 425.124374 490.341213 425.124374z"></react_native_svg_1.Path>
72
- </react_native_svg_1.Svg>);
55
+ return (<Svg fill={color} width={dp(size)} height={dp(size)} viewBox="0 0 1024 1024">
56
+ <Path d="M519.283382 163.91421l0 232.024447 232.315066 0L519.283382 163.91421zM490.341213 425.124374 490.341213 163.91421l0 0L257.879813 163.91421l0 696.170556 508.23935 0L766.119163 425.124374 490.341213 425.124374z"></Path>
57
+ </Svg>);
73
58
  };
74
- exports.FileIcon = FileIcon;
75
- const CollectionIcon = (props) => {
59
+ export const CollectionIcon = (props) => {
76
60
  const { size = 24, color = '#333' } = props;
77
- return (<react_native_svg_1.Svg fill={color} width={(0, rn_ui_1.dp)(size)} height={(0, rn_ui_1.dp)(size)} viewBox="0 0 1024 1024">
78
- <react_native_svg_1.Path d="M832 128H192a64.19 64.19 0 0 0-64 64v640a64.19 64.19 0 0 0 64 64h640a64.19 64.19 0 0 0 64-64V192a64.19 64.19 0 0 0-64-64zM685.41 750.68L512 659.51l-173.41 91.17 33.12-193.1-140.3-136.75 193.88-28.17L512 217l86.71 175.69 193.88 28.17-140.3 136.72z"></react_native_svg_1.Path>
79
- </react_native_svg_1.Svg>);
61
+ return (<Svg fill={color} width={dp(size)} height={dp(size)} viewBox="0 0 1024 1024">
62
+ <Path d="M832 128H192a64.19 64.19 0 0 0-64 64v640a64.19 64.19 0 0 0 64 64h640a64.19 64.19 0 0 0 64-64V192a64.19 64.19 0 0 0-64-64zM685.41 750.68L512 659.51l-173.41 91.17 33.12-193.1-140.3-136.75 193.88-28.17L512 217l86.71 175.69 193.88 28.17-140.3 136.72z"></Path>
63
+ </Svg>);
80
64
  };
81
- exports.CollectionIcon = CollectionIcon;
82
- const UserIcon = (props) => {
65
+ export const UserIcon = (props) => {
83
66
  const { size = 24, color = '#333' } = props;
84
- return (<react_native_svg_1.Svg fill={color} width={(0, rn_ui_1.dp)(size)} height={(0, rn_ui_1.dp)(size)} viewBox="0 0 1024 1024">
85
- <react_native_svg_1.Path d="M525.973 511.844c106.044 0 192.026-86.011 192.026-192.026 0-106.077-85.982-192.026-192.026-192.026-106.048 0-192.029 85.949-192.029 192.026 0 106.015 85.981 192.026 192.029 192.026z m0 32.004c-176.745 0-320.077 140.853-320.077 317.63 0 12.563 0.937 34.773 2.344 34.773h635.402c1.406 0 2.344-22.21 2.344-34.774 0-176.777-143.272-317.629-320.013-317.629z"></react_native_svg_1.Path>
86
- </react_native_svg_1.Svg>);
67
+ return (<Svg fill={color} width={dp(size)} height={dp(size)} viewBox="0 0 1024 1024">
68
+ <Path d="M525.973 511.844c106.044 0 192.026-86.011 192.026-192.026 0-106.077-85.982-192.026-192.026-192.026-106.048 0-192.029 85.949-192.029 192.026 0 106.015 85.981 192.026 192.029 192.026z m0 32.004c-176.745 0-320.077 140.853-320.077 317.63 0 12.563 0.937 34.773 2.344 34.773h635.402c1.406 0 2.344-22.21 2.344-34.774 0-176.777-143.272-317.629-320.013-317.629z"></Path>
69
+ </Svg>);
87
70
  };
88
- exports.UserIcon = UserIcon;
@@ -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,43 +7,39 @@ 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 rn_ui_1 = require("@smart-link/rn-ui");
39
- const ahooks_1 = require("ahooks");
40
- const react_1 = __importStar(require("react"));
41
- const react_native_1 = require("react-native");
42
- const useImSelector_1 = require("../../../../hooks/useImSelector");
43
- const useTranslation_1 = __importDefault(require("../../../../hooks/useTranslation"));
44
- const init_1 = require("../../../../init");
45
- const EmojiPanel_1 = __importDefault(require("./EmojiPanel"));
46
- const Icons_1 = require("./Icons");
47
- const MessageInput_1 = __importDefault(require("./MessageInput"));
48
- const OptionPanel_1 = __importDefault(require("./OptionPanel"));
49
- const VoiceBar_1 = __importDefault(require("./VoiceBar"));
50
- const panel_slice_1 = require("../../../../slice/panel/panel.slice");
51
- const react_redux_1 = require("react-redux");
52
- const im_base_1 = require("@smart-link/im-base");
53
- const debounce_1 = __importDefault(require("lodash-es/debounce"));
54
- const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
55
- const { t } = (0, useTranslation_1.default)();
56
- const dispatch = (0, react_redux_1.useDispatch)();
57
- const debounceAt = (0, react_1.useRef)(null);
58
- const inputRef = (0, react_1.useRef)(null);
59
- const emojiPanelRef = (0, react_1.useRef)(null);
60
- const optionPanelRef = (0, react_1.useRef)(null);
61
- const lazy = (0, react_1.useRef)(false);
62
- const tempText = (0, react_1.useRef)('');
63
- const { currentConversation } = (0, useImSelector_1.useConversation)();
64
- const { quote, messageText } = (0, useImSelector_1.useMessage)();
65
- const [showSend, setShowSend] = (0, react_1.useState)(false);
66
- const keyboardDuration = (0, react_1.useRef)(100);
67
- const modeRef = (0, react_1.useRef)('text');
68
- const [inputMode, setInputMode] = (0, react_1.useState)('text');
69
- const keyboardHeight = (0, react_1.useRef)(240);
70
- const handleChange = (0, react_1.useCallback)((text) => {
10
+ import { dp, Button, Modal } from '@smart-link/rn-ui';
11
+ import { useMemoizedFn } from 'ahooks';
12
+ import React, { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
13
+ import { StyleSheet, View, TouchableOpacity, Keyboard } from 'react-native';
14
+ import { useConversation, useMessage } from '../../../../hooks/useImSelector';
15
+ import useTranslation from '../../../../hooks/useTranslation';
16
+ import { getImManager } from '../../../../init';
17
+ import EmojiPanel from './EmojiPanel';
18
+ import { EmojiSvg, KeyboardSvg, OptionSvg, VoiceSvg } from './Icons';
19
+ import MessageInput from './MessageInput';
20
+ import OptionPanel from './OptionPanel';
21
+ import VoiceBar from './VoiceBar';
22
+ import { setMessageBarHeight } from '../../../../slice/panel/panel.slice';
23
+ import { useDispatch } from 'react-redux';
24
+ import { MessageActions } from '@smart-link/im-base';
25
+ import debounce from 'lodash-es/debounce';
26
+ const MessageBar = forwardRef(({ onKeyboardAt }, ref) => {
27
+ const { t } = useTranslation();
28
+ const dispatch = useDispatch();
29
+ const debounceAt = useRef(null);
30
+ const inputRef = useRef(null);
31
+ const emojiPanelRef = useRef(null);
32
+ const optionPanelRef = useRef(null);
33
+ const lazy = useRef(false);
34
+ const tempText = useRef('');
35
+ const { currentConversation } = useConversation();
36
+ const { quote, messageText } = useMessage();
37
+ const [showSend, setShowSend] = useState(false);
38
+ const keyboardDuration = useRef(100);
39
+ const modeRef = useRef('text');
40
+ const [inputMode, setInputMode] = useState('text');
41
+ const keyboardHeight = useRef(240);
42
+ const handleChange = useCallback((text) => {
71
43
  tempText.current = text;
72
44
  // const trimTxt = text.trim();
73
45
  if (text.length && !lazy.current) {
@@ -78,22 +50,22 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
78
50
  setShowSend(false);
79
51
  lazy.current = false;
80
52
  }
81
- dispatch(im_base_1.MessageActions.setDraftText(text));
53
+ dispatch(MessageActions.setDraftText(text));
82
54
  }, []);
83
- const handleInsertEmoji = (0, react_1.useCallback)((emoji) => {
55
+ const handleInsertEmoji = useCallback((emoji) => {
84
56
  var _a;
85
57
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.insertEmoji(emoji);
86
58
  }, []);
87
- const switchVoice = (0, react_1.useCallback)(() => {
59
+ const switchVoice = useCallback(() => {
88
60
  var _a, _b;
89
61
  (_a = emojiPanelRef.current) === null || _a === void 0 ? void 0 : _a.hide();
90
62
  (_b = optionPanelRef.current) === null || _b === void 0 ? void 0 : _b.hide();
91
- react_native_1.Keyboard.dismiss();
63
+ Keyboard.dismiss();
92
64
  modeRef.current = 'voice';
93
65
  setInputMode('voice');
94
66
  setShowSend(false);
95
67
  }, []);
96
- const switchKeyboardInputMode = (0, react_1.useCallback)(() => {
68
+ const switchKeyboardInputMode = useCallback(() => {
97
69
  var _a, _b;
98
70
  (_a = emojiPanelRef.current) === null || _a === void 0 ? void 0 : _a.hide();
99
71
  (_b = optionPanelRef.current) === null || _b === void 0 ? void 0 : _b.hide();
@@ -112,10 +84,10 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
112
84
  (_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.focus();
113
85
  }, timeout);
114
86
  }, []);
115
- const switchEmojiInputMode = (0, react_1.useCallback)(() => {
87
+ const switchEmojiInputMode = useCallback(() => {
116
88
  modeRef.current = 'emoji';
117
89
  setInputMode('emoji');
118
- react_native_1.Keyboard.dismiss();
90
+ Keyboard.dismiss();
119
91
  setTimeout(() => {
120
92
  var _a, _b, _c;
121
93
  (_a = optionPanelRef.current) === null || _a === void 0 ? void 0 : _a.hide();
@@ -123,7 +95,7 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
123
95
  (_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.focusNoSoftKeyboard();
124
96
  }, keyboardDuration.current);
125
97
  }, []);
126
- const switchOptionPanelMode = (0, ahooks_1.useMemoizedFn)(() => {
98
+ const switchOptionPanelMode = useMemoizedFn(() => {
127
99
  var _a;
128
100
  if ((_a = optionPanelRef.current) === null || _a === void 0 ? void 0 : _a.getVisible()) {
129
101
  switchKeyboardInputMode();
@@ -131,17 +103,17 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
131
103
  }
132
104
  setInputMode('option');
133
105
  modeRef.current = 'option';
134
- react_native_1.Keyboard.dismiss();
106
+ Keyboard.dismiss();
135
107
  setTimeout(() => {
136
108
  var _a, _b;
137
109
  (_a = emojiPanelRef.current) === null || _a === void 0 ? void 0 : _a.hide();
138
110
  (_b = optionPanelRef.current) === null || _b === void 0 ? void 0 : _b.show(keyboardHeight.current);
139
111
  }, keyboardDuration.current);
140
112
  });
141
- const onKeyPress = (0, react_1.useCallback)((e) => {
113
+ const onKeyPress = useCallback((e) => {
142
114
  if (e.nativeEvent.key === '@') {
143
115
  if (!debounceAt.current) {
144
- debounceAt.current = (0, debounce_1.default)(() => {
116
+ debounceAt.current = debounce(() => {
145
117
  onKeyboardAt && onKeyboardAt();
146
118
  }, 500);
147
119
  debounceAt.current();
@@ -151,11 +123,11 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
151
123
  }
152
124
  }
153
125
  }, []);
154
- const handleSendText = (0, react_1.useCallback)(() => __awaiter(void 0, void 0, void 0, function* () {
126
+ const handleSendText = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
155
127
  var _a, _b;
156
128
  const text = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.getText();
157
129
  if (text.trim().length === 0) {
158
- const { close } = rn_ui_1.Modal.open({
130
+ const { close } = Modal.open({
159
131
  title: t('tips'),
160
132
  content: t('cantSendEmptyMsg'),
161
133
  footer: {
@@ -174,13 +146,10 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
174
146
  (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.clear();
175
147
  tempText.current = '';
176
148
  handleChange('');
177
- react_native_1.InteractionManager.runAfterInteractions(() => {
178
- imManager.scrollToLatest(true);
179
- });
180
- const imManager = (0, init_1.getImManager)();
149
+ const imManager = getImManager();
181
150
  yield imManager.handleSend(text);
182
151
  }), [quote, handleChange, currentConversation]);
183
- (0, react_1.useImperativeHandle)(ref, () => ({
152
+ useImperativeHandle(ref, () => ({
184
153
  reset: () => {
185
154
  var _a, _b, _c;
186
155
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
@@ -214,10 +183,10 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
214
183
  }, keyboardDuration.current);
215
184
  (_b = emojiPanelRef.current) === null || _b === void 0 ? void 0 : _b.hide();
216
185
  (_c = optionPanelRef.current) === null || _c === void 0 ? void 0 : _c.hide();
217
- dispatch(im_base_1.MessageActions.setDraftText(text));
186
+ dispatch(MessageActions.setDraftText(text));
218
187
  }
219
188
  }), []);
220
- (0, react_1.useEffect)(() => {
189
+ useEffect(() => {
221
190
  var _a;
222
191
  if (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.draftText) {
223
192
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.setText(currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.draftText);
@@ -228,7 +197,7 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
228
197
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
229
198
  }, 150);
230
199
  }
231
- const keyboardDidShowListener = react_native_1.Keyboard.addListener('keyboardDidShow', event => {
200
+ const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', event => {
232
201
  var _a, _b;
233
202
  keyboardHeight.current = Math.max(event.endCoordinates.height, 240);
234
203
  keyboardDuration.current = event.duration;
@@ -240,52 +209,52 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
240
209
  };
241
210
  }, []);
242
211
  return (<>
243
- <react_native_1.View style={styles.root} onLayout={event => {
244
- dispatch((0, panel_slice_1.setMessageBarHeight)(event.nativeEvent.layout.height));
212
+ <View style={styles.root} onLayout={event => {
213
+ dispatch(setMessageBarHeight(event.nativeEvent.layout.height));
245
214
  }}>
246
- <react_native_1.View style={styles.switchInput}>
247
- {inputMode === 'voice' ? (<react_native_1.TouchableOpacity onPress={switchKeyboardInputMode}>
248
- <Icons_1.KeyboardSvg />
249
- </react_native_1.TouchableOpacity>) : (<react_native_1.TouchableOpacity onPress={switchVoice}>
250
- <Icons_1.VoiceSvg />
251
- </react_native_1.TouchableOpacity>)}
252
- </react_native_1.View>
253
- {inputMode === 'voice' ? <VoiceBar_1.default /> : <MessageInput_1.default ref={inputRef} onChangeText={handleChange} onKeyPress={onKeyPress}/>}
215
+ <View style={styles.switchInput}>
216
+ {inputMode === 'voice' ? (<TouchableOpacity onPress={switchKeyboardInputMode}>
217
+ <KeyboardSvg />
218
+ </TouchableOpacity>) : (<TouchableOpacity onPress={switchVoice}>
219
+ <VoiceSvg />
220
+ </TouchableOpacity>)}
221
+ </View>
222
+ {inputMode === 'voice' ? <VoiceBar /> : <MessageInput ref={inputRef} onChangeText={handleChange} onKeyPress={onKeyPress}/>}
254
223
 
255
- <react_native_1.View style={[styles.switchInput, { paddingRight: 0 }]}>
256
- {inputMode === 'emoji' ? (<react_native_1.TouchableOpacity onPress={switchKeyboardInputMode}>
257
- <Icons_1.KeyboardSvg />
258
- </react_native_1.TouchableOpacity>) : (<react_native_1.TouchableOpacity onPress={switchEmojiInputMode}>
259
- <Icons_1.EmojiSvg />
260
- </react_native_1.TouchableOpacity>)}
261
- </react_native_1.View>
262
- <react_native_1.View style={styles.switchInput}>
263
- {showSend ? (<rn_ui_1.Button type="primary" size="s" onPress={handleSendText}>
224
+ <View style={[styles.switchInput, { paddingRight: 0 }]}>
225
+ {inputMode === 'emoji' ? (<TouchableOpacity onPress={switchKeyboardInputMode}>
226
+ <KeyboardSvg />
227
+ </TouchableOpacity>) : (<TouchableOpacity onPress={switchEmojiInputMode}>
228
+ <EmojiSvg />
229
+ </TouchableOpacity>)}
230
+ </View>
231
+ <View style={styles.switchInput}>
232
+ {showSend ? (<Button type="primary" size="s" onPress={handleSendText}>
264
233
  {t('sent')}
265
- </rn_ui_1.Button>) : (<react_native_1.TouchableOpacity onPress={switchOptionPanelMode}>
266
- <Icons_1.OptionSvg />
267
- </react_native_1.TouchableOpacity>)}
268
- </react_native_1.View>
269
- </react_native_1.View>
270
- <EmojiPanel_1.default ref={emojiPanelRef} onCheck={handleInsertEmoji} onBackspace={() => { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.backspace(); }}/>
271
- <OptionPanel_1.default ref={optionPanelRef}/>
234
+ </Button>) : (<TouchableOpacity onPress={switchOptionPanelMode}>
235
+ <OptionSvg />
236
+ </TouchableOpacity>)}
237
+ </View>
238
+ </View>
239
+ <EmojiPanel ref={emojiPanelRef} onCheck={handleInsertEmoji} onBackspace={() => { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.backspace(); }}/>
240
+ <OptionPanel ref={optionPanelRef}/>
272
241
  </>);
273
242
  });
274
- const styles = react_native_1.StyleSheet.create({
243
+ const styles = StyleSheet.create({
275
244
  root: {
276
245
  justifyContent: 'flex-end',
277
246
  flexDirection: 'row',
278
- borderTopWidth: (0, rn_ui_1.dp)(1),
247
+ borderTopWidth: dp(1),
279
248
  borderTopColor: '#e3e3e3',
280
249
  },
281
250
  switchInput: {
282
251
  justifyContent: 'flex-end',
283
- paddingVertical: (0, rn_ui_1.dp)(8),
284
- paddingHorizontal: (0, rn_ui_1.dp)(8),
252
+ paddingVertical: dp(8),
253
+ paddingHorizontal: dp(8),
285
254
  },
286
255
  icon: {
287
- width: (0, rn_ui_1.dp)(28),
288
- height: (0, rn_ui_1.dp)(28),
256
+ width: dp(28),
257
+ height: dp(28),
289
258
  },
290
259
  });
291
- exports.default = (0, react_1.memo)(MessageBar);
260
+ export default memo(MessageBar);