@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,74 +1,69 @@
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
- const rn_ui_1 = require("@smart-link/rn-ui");
7
- const react_1 = __importDefault(require("react"));
8
- const react_native_1 = require("react-native");
9
- const useTranslation_1 = __importDefault(require("../../hooks/useTranslation"));
10
- const MaterialIcons_1 = __importDefault(require("react-native-vector-icons/MaterialIcons"));
11
- const SearchPictures_1 = __importDefault(require("./components/SearchPictures"));
12
- const SearchShareLinkList_1 = __importDefault(require("./components/SearchShareLinkList"));
13
- const SearchFileList_1 = __importDefault(require("./components/SearchFileList"));
1
+ import { dp, HeaderBar, NavigationPage, SearchInput, SegmentedView, useNavigation, CaihText, } from "@smart-link/rn-ui";
2
+ import React from "react";
3
+ import { StyleSheet, TouchableOpacity } from "react-native";
4
+ import useTranslation from "../../hooks/useTranslation";
5
+ import MaterialIcon from "react-native-vector-icons/MaterialIcons";
6
+ import SearchPictures from "./components/SearchPictures";
7
+ import SearchShareLinkList from "./components/SearchShareLinkList";
8
+ import SearchFileList from "./components/SearchFileList";
14
9
  const SearchManager = ({ navigation, route: { params } }) => {
15
- const { t } = (0, useTranslation_1.default)();
10
+ const { t } = useTranslation();
16
11
  const { conversation } = params;
17
- const [keyword, setKeyword] = react_1.default.useState('');
18
- const [activeIndex, setActiveIndex] = react_1.default.useState(0);
19
- const [multiple, setMultiple] = react_1.default.useState(false);
20
- return (<rn_ui_1.NavigationPage noPadding>
12
+ const [keyword, setKeyword] = React.useState('');
13
+ const [activeIndex, setActiveIndex] = React.useState(0);
14
+ const [multiple, setMultiple] = React.useState(false);
15
+ return (<NavigationPage noPadding>
21
16
  <Header showSearch={activeIndex !== 0} showMultiple={activeIndex === 0} showBack={activeIndex === 0} value={keyword} onSubmitEditing={setKeyword} multiple={multiple} onMultiple={() => {
22
17
  setMultiple(!multiple);
23
18
  }}/>
24
- <rn_ui_1.SegmentedView style={styles.segmented} barStyle={styles.segmentedBar} justifyItem={'fixed'} indicatorType={'boxWidth'} type={'carousel'} onChange={setActiveIndex}>
25
- <rn_ui_1.SegmentedView.Sheet title={t('pictureChats')} titleStyle={styles.sheetTitle} activeTitleStyle={styles.sheetTitleActive}>
26
- <SearchPictures_1.default conversationId={conversation.id} multiple={multiple}/>
27
- </rn_ui_1.SegmentedView.Sheet>
28
- <rn_ui_1.SegmentedView.Sheet title={t('linkChats')} titleStyle={styles.sheetTitle} activeTitleStyle={styles.sheetTitleActive}>
29
- <SearchShareLinkList_1.default keyword={keyword} conversationId={conversation.id}/>
30
- </rn_ui_1.SegmentedView.Sheet>
31
- <rn_ui_1.SegmentedView.Sheet title={t('fileChats')} titleStyle={styles.sheetTitle} activeTitleStyle={styles.sheetTitleActive}>
32
- <SearchFileList_1.default keyword={keyword} conversationId={conversation.id}/>
33
- </rn_ui_1.SegmentedView.Sheet>
34
- </rn_ui_1.SegmentedView>
35
- </rn_ui_1.NavigationPage>);
19
+ <SegmentedView style={styles.segmented} barStyle={styles.segmentedBar} justifyItem={'fixed'} indicatorType={'boxWidth'} type={'carousel'} onChange={setActiveIndex}>
20
+ <SegmentedView.Sheet title={t('pictureChats')} titleStyle={styles.sheetTitle} activeTitleStyle={styles.sheetTitleActive}>
21
+ <SearchPictures conversationId={conversation.id} multiple={multiple}/>
22
+ </SegmentedView.Sheet>
23
+ <SegmentedView.Sheet title={t('linkChats')} titleStyle={styles.sheetTitle} activeTitleStyle={styles.sheetTitleActive}>
24
+ <SearchShareLinkList keyword={keyword} conversationId={conversation.id}/>
25
+ </SegmentedView.Sheet>
26
+ <SegmentedView.Sheet title={t('fileChats')} titleStyle={styles.sheetTitle} activeTitleStyle={styles.sheetTitleActive}>
27
+ <SearchFileList keyword={keyword} conversationId={conversation.id}/>
28
+ </SegmentedView.Sheet>
29
+ </SegmentedView>
30
+ </NavigationPage>);
36
31
  };
37
- const styles = react_native_1.StyleSheet.create({
32
+ const styles = StyleSheet.create({
38
33
  segmented: {
39
34
  flex: 1,
40
35
  backgroundColor: '#fff',
41
36
  },
42
37
  segmentedBar: {
43
- paddingTop: (0, rn_ui_1.dp)(5),
44
- paddingHorizontal: (0, rn_ui_1.dp)(15),
38
+ paddingTop: dp(5),
39
+ paddingHorizontal: dp(15),
45
40
  },
46
41
  sheetTitle: {
47
- fontSize: (0, rn_ui_1.dp)(14),
48
- lineHeight: (0, rn_ui_1.dp)(16),
49
- borderRadius: (0, rn_ui_1.dp)(3),
42
+ fontSize: dp(14),
43
+ lineHeight: dp(16),
44
+ borderRadius: dp(3),
50
45
  },
51
46
  sheetTitleActive: {
52
- fontSize: (0, rn_ui_1.dp)(14),
53
- lineHeight: (0, rn_ui_1.dp)(16),
54
- borderRadius: (0, rn_ui_1.dp)(3),
47
+ fontSize: dp(14),
48
+ lineHeight: dp(16),
49
+ borderRadius: dp(3),
55
50
  },
56
51
  });
57
52
  const Header = ({ value, showSearch, showMultiple, showBack, onSubmitEditing, multiple, onMultiple }) => {
58
- const navigation = (0, rn_ui_1.useNavigation)();
59
- const input = react_1.default.useRef(null);
60
- const { t } = (0, useTranslation_1.default)();
61
- return <rn_ui_1.HeaderBar style={{
53
+ const navigation = useNavigation();
54
+ const input = React.useRef(null);
55
+ const { t } = useTranslation();
56
+ return <HeaderBar style={{
62
57
  alignItems: 'center',
63
58
  justifyContent: 'space-between',
64
59
  }}>
65
- {showSearch && <rn_ui_1.SearchInput ref={input} value={value} numberOfLines={1} style={{
66
- height: (0, rn_ui_1.dp)(32),
60
+ {showSearch && <SearchInput ref={input} value={value} numberOfLines={1} style={{
61
+ height: dp(32),
67
62
  flex: 1,
68
- borderRadius: (0, rn_ui_1.dp)(4),
63
+ borderRadius: dp(4),
69
64
  }} inputStyle={{
70
- fontSize: (0, rn_ui_1.dp)(14),
71
- height: (0, rn_ui_1.dp)(32),
65
+ fontSize: dp(14),
66
+ height: dp(32),
72
67
  flex: 1,
73
68
  }} placeholder={t('search')} onSubmitEditing={() => {
74
69
  var _a;
@@ -77,35 +72,35 @@ const Header = ({ value, showSearch, showMultiple, showBack, onSubmitEditing, mu
77
72
  onSubmitEditing(text);
78
73
  }} maxLength={20} returnKeyType="search"/>}
79
74
 
80
- {showSearch && <react_native_1.TouchableOpacity style={{
81
- height: (0, rn_ui_1.dp)(32),
75
+ {showSearch && <TouchableOpacity style={{
76
+ height: dp(32),
82
77
  alignItems: 'center',
83
78
  justifyContent: 'center',
84
- paddingLeft: (0, rn_ui_1.dp)(16),
79
+ paddingLeft: dp(16),
85
80
  }} onPress={() => {
86
81
  navigation.goBack();
87
82
  }}>
88
- <rn_ui_1.CaihText color="#fff">{t('cancel')}</rn_ui_1.CaihText>
89
- </react_native_1.TouchableOpacity>}
83
+ <CaihText color="#fff">{t('cancel')}</CaihText>
84
+ </TouchableOpacity>}
90
85
 
91
- {showBack && <react_native_1.TouchableOpacity style={{
92
- height: (0, rn_ui_1.dp)(32),
86
+ {showBack && <TouchableOpacity style={{
87
+ height: dp(32),
93
88
  alignItems: 'center',
94
89
  justifyContent: 'center',
95
- paddingLeft: showMultiple ? 0 : (0, rn_ui_1.dp)(16),
90
+ paddingLeft: showMultiple ? 0 : dp(16),
96
91
  }} onPress={() => {
97
92
  navigation.goBack();
98
93
  }}>
99
- <MaterialIcons_1.default name="arrow-back-ios" size={(0, rn_ui_1.dp)(20)} color="#fff"/>
100
- </react_native_1.TouchableOpacity>}
101
- {showMultiple && <react_native_1.TouchableOpacity style={{
102
- height: (0, rn_ui_1.dp)(32),
94
+ <MaterialIcon name="arrow-back-ios" size={dp(20)} color="#fff"/>
95
+ </TouchableOpacity>}
96
+ {showMultiple && <TouchableOpacity style={{
97
+ height: dp(32),
103
98
  alignItems: 'center',
104
99
  justifyContent: 'center',
105
- paddingLeft: (0, rn_ui_1.dp)(16),
100
+ paddingLeft: dp(16),
106
101
  }} onPress={onMultiple}>
107
- <rn_ui_1.CaihText color="#fff">{multiple ? t('cancel') : t('multiple')}</rn_ui_1.CaihText>
108
- </react_native_1.TouchableOpacity>}
109
- </rn_ui_1.HeaderBar>;
102
+ <CaihText color="#fff">{multiple ? t('cancel') : t('multiple')}</CaihText>
103
+ </TouchableOpacity>}
104
+ </HeaderBar>;
110
105
  };
111
- exports.default = SearchManager;
106
+ export default SearchManager;
@@ -1,56 +1,28 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- const react_1 = __importStar(require("react"));
30
- const react_native_1 = require("react-native");
31
- const rn_ui_1 = require("@smart-link/rn-ui");
32
- const useTranslation_1 = __importDefault(require("../../hooks/useTranslation"));
33
- const SearchPictures_1 = __importDefault(require("./components/SearchPictures"));
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Text, TouchableOpacity } from 'react-native';
3
+ import { dp, NavigationPage } from '@smart-link/rn-ui';
4
+ import useTranslation from '../../hooks/useTranslation';
5
+ import SearchPictures from './components/SearchPictures';
34
6
  const SearchPicturePage = ({ navigation, route: { params } }) => {
35
- const { t } = (0, useTranslation_1.default)();
7
+ const { t } = useTranslation();
36
8
  const { conversationId } = params;
37
- const [multiple, setMultiple] = (0, react_1.useState)(false);
38
- const [checkedIds, setCheckedIds] = (0, react_1.useState)([]);
9
+ const [multiple, setMultiple] = useState(false);
10
+ const [checkedIds, setCheckedIds] = useState([]);
39
11
  const title = t('pictureManager');
40
- (0, react_1.useEffect)(() => {
12
+ useEffect(() => {
41
13
  navigation.setOptions({
42
14
  title: title,
43
15
  headerRight: ({ tintColor }) => {
44
- return (<react_native_1.TouchableOpacity style={{ padding: (0, rn_ui_1.dp)(8) }} onPress={() => {
16
+ return (<TouchableOpacity style={{ padding: dp(8) }} onPress={() => {
45
17
  setMultiple(p => !p);
46
18
  }}>
47
- <react_native_1.Text style={{ color: tintColor }}>{multiple ? t('cancel') : t('multiple')}</react_native_1.Text>
48
- </react_native_1.TouchableOpacity>);
19
+ <Text style={{ color: tintColor }}>{multiple ? t('cancel') : t('multiple')}</Text>
20
+ </TouchableOpacity>);
49
21
  },
50
22
  });
51
23
  }, [title, navigation, multiple, checkedIds]);
52
- return (<rn_ui_1.NavigationPage noPadding>
53
- <SearchPictures_1.default conversationId={conversationId} multiple={multiple}/>
54
- </rn_ui_1.NavigationPage>);
24
+ return (<NavigationPage noPadding>
25
+ <SearchPictures conversationId={conversationId} multiple={multiple}/>
26
+ </NavigationPage>);
55
27
  };
56
- exports.default = SearchPicturePage;
28
+ export default SearchPicturePage;
@@ -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,25 +7,21 @@ 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 ChatAvatar_1 = __importDefault(require("../../../components/ChatAvatar/ChatAvatar"));
39
- const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
40
- const init_1 = require("../../../init");
41
- const rn_ui_1 = require("@smart-link/rn-ui");
42
- const react_1 = __importStar(require("react"));
43
- const react_native_1 = require("react-native");
10
+ import ChatAvatar from '../../../components/ChatAvatar/ChatAvatar';
11
+ import useTranslation from '../../../hooks/useTranslation';
12
+ import { getImManager } from '../../../init';
13
+ import { dp, useNavigation } from '@smart-link/rn-ui';
14
+ import React, { useEffect, useState } from 'react';
15
+ import { View, Text, FlatList, StyleSheet, TouchableOpacity } from 'react-native';
44
16
  const ChatRecords = ({ keyword }) => {
45
- const navigation = (0, rn_ui_1.useNavigation)();
46
- const { t } = (0, useTranslation_1.default)();
47
- const [data, setData] = (0, react_1.useState)([]);
48
- (0, react_1.useEffect)(() => {
17
+ const navigation = useNavigation();
18
+ const { t } = useTranslation();
19
+ const [data, setData] = useState([]);
20
+ useEffect(() => {
49
21
  if (!keyword || keyword === '') {
50
22
  return;
51
23
  }
52
- const db = (0, init_1.getImManager)().db;
24
+ const db = getImManager().db;
53
25
  db.selectConversationMessageCount(keyword).then((list) => __awaiter(void 0, void 0, void 0, function* () {
54
26
  const data = [];
55
27
  for (const item of list) {
@@ -62,51 +34,51 @@ const ChatRecords = ({ keyword }) => {
62
34
  }));
63
35
  }, [keyword]);
64
36
  if (data.length === 0) {
65
- return (<react_native_1.View style={{ flex: 1 }}>
66
- <react_native_1.View style={{
37
+ return (<View style={{ flex: 1 }}>
38
+ <View style={{
67
39
  flex: 1,
68
40
  justifyContent: 'center',
69
41
  alignItems: 'center',
70
42
  }}>
71
- <react_native_1.Text>{t('noSearchResult')}</react_native_1.Text>
72
- </react_native_1.View>
73
- </react_native_1.View>);
43
+ <Text>{t('noSearchResult')}</Text>
44
+ </View>
45
+ </View>);
74
46
  }
75
47
  const keyExtractor = (item) => item.id;
76
48
  const renderItem = ({ item }) => {
77
49
  const { id, type, name, count, avatars } = item;
78
- return (<react_native_1.TouchableOpacity style={styles.item} activeOpacity={0.5} onPress={() => {
50
+ return (<TouchableOpacity style={styles.item} activeOpacity={0.5} onPress={() => {
79
51
  navigation.navigate('SearchChatRecords', {
80
52
  conversation: item,
81
53
  keyword,
82
54
  });
83
55
  }}>
84
- <ChatAvatar_1.default id={id} size={(0, rn_ui_1.dp)(42)} url={avatars} name={name}/>
85
- <react_native_1.View style={styles.width10}/>
86
- <react_native_1.View style={styles.left}>
87
- <react_native_1.Text style={styles.name} numberOfLines={1}>
56
+ <ChatAvatar id={id} size={dp(42)} url={avatars} name={name}/>
57
+ <View style={styles.width10}/>
58
+ <View style={styles.left}>
59
+ <Text style={styles.name} numberOfLines={1}>
88
60
  {name}
89
- </react_native_1.Text>
90
- <react_native_1.Text style={styles.text} numberOfLines={1}>
61
+ </Text>
62
+ <Text style={styles.text} numberOfLines={1}>
91
63
  {count + ' ' + t('matchedMessage')}
92
- </react_native_1.Text>
93
- </react_native_1.View>
94
- </react_native_1.TouchableOpacity>);
64
+ </Text>
65
+ </View>
66
+ </TouchableOpacity>);
95
67
  };
96
- const itemSeparatorComponent = () => <react_native_1.View style={styles.separator}/>;
97
- return (<react_native_1.FlatList contentContainerStyle={styles.list} data={data} numColumns={1} initialNumToRender={1} keyExtractor={keyExtractor} renderItem={renderItem} keyboardShouldPersistTaps={'handled'} ItemSeparatorComponent={itemSeparatorComponent}/>);
68
+ const itemSeparatorComponent = () => <View style={styles.separator}/>;
69
+ return (<FlatList contentContainerStyle={styles.list} data={data} numColumns={1} initialNumToRender={1} keyExtractor={keyExtractor} renderItem={renderItem} keyboardShouldPersistTaps={'handled'} ItemSeparatorComponent={itemSeparatorComponent}/>);
98
70
  };
99
- const styles = react_native_1.StyleSheet.create({
71
+ const styles = StyleSheet.create({
100
72
  empty: {
101
73
  flex: 1,
102
74
  alignItems: 'center',
103
75
  justifyContent: 'center',
104
76
  },
105
77
  list: {
106
- marginVertical: (0, rn_ui_1.dp)(10),
107
- padding: (0, rn_ui_1.dp)(15),
78
+ marginVertical: dp(10),
79
+ padding: dp(15),
108
80
  backgroundColor: '#fff',
109
- borderWidth: (0, rn_ui_1.dp)(1),
81
+ borderWidth: dp(1),
110
82
  borderStyle: 'solid',
111
83
  borderColor: '#eee',
112
84
  borderLeftWidth: 0,
@@ -116,36 +88,36 @@ const styles = react_native_1.StyleSheet.create({
116
88
  flexDirection: 'row',
117
89
  },
118
90
  width10: {
119
- width: (0, rn_ui_1.dp)(10),
91
+ width: dp(10),
120
92
  },
121
93
  left: {
122
94
  justifyContent: 'space-between',
123
95
  },
124
96
  name: {
125
- top: (0, rn_ui_1.dp)(1),
126
- width: (0, rn_ui_1.dp)(250),
127
- fontSize: (0, rn_ui_1.dp)(14),
128
- lineHeight: (0, rn_ui_1.dp)(16),
97
+ top: dp(1),
98
+ width: dp(250),
99
+ fontSize: dp(14),
100
+ lineHeight: dp(16),
129
101
  color: '#333',
130
102
  },
131
103
  time: {
132
- fontSize: (0, rn_ui_1.dp)(13),
133
- lineHeight: (0, rn_ui_1.dp)(15),
104
+ fontSize: dp(13),
105
+ lineHeight: dp(15),
134
106
  color: '#999',
135
107
  position: 'absolute',
136
108
  right: 15,
137
109
  },
138
110
  text: {
139
- width: (0, rn_ui_1.dp)(270),
140
- fontSize: (0, rn_ui_1.dp)(13),
141
- lineHeight: (0, rn_ui_1.dp)(15),
111
+ width: dp(270),
112
+ fontSize: dp(13),
113
+ lineHeight: dp(15),
142
114
  color: '#999',
143
115
  },
144
116
  separator: {
145
- marginLeft: (0, rn_ui_1.dp)(50),
146
- marginVertical: (0, rn_ui_1.dp)(10),
147
- height: (0, rn_ui_1.dp)(1),
117
+ marginLeft: dp(50),
118
+ marginVertical: dp(10),
119
+ height: dp(1),
148
120
  backgroundColor: '#eee',
149
121
  },
150
122
  });
151
- exports.default = ChatRecords;
123
+ export default ChatRecords;
@@ -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,62 +7,58 @@ 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 ChatAvatar_1 = __importDefault(require("../../../components/ChatAvatar/ChatAvatar"));
39
- const useImSelector_1 = require("../../../hooks/useImSelector");
40
- const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
41
- const init_1 = require("../../../init");
42
- const summary_1 = require("../../../utils/summary");
43
- const im_base_1 = require("@smart-link/im-base");
44
- const rn_ui_1 = require("@smart-link/rn-ui");
45
- const react_1 = __importStar(require("react"));
46
- const react_native_1 = require("react-native");
47
- const MyGroupChat = (0, react_1.memo)(({ keyword }) => {
48
- const { chatGroups } = (0, useImSelector_1.useChatGroup)();
49
- const { t } = (0, useTranslation_1.default)();
50
- const navigation = (0, rn_ui_1.useNavigation)();
10
+ import ChatAvatar from '../../../components/ChatAvatar/ChatAvatar';
11
+ import { useChatGroup } from '../../../hooks/useImSelector';
12
+ import useTranslation from '../../../hooks/useTranslation';
13
+ import { getImManager } from '../../../init';
14
+ import { getSummary } from '../../../utils/summary';
15
+ import { ConversationType } from '@smart-link/im-base';
16
+ import { dp, useNavigation } from '@smart-link/rn-ui';
17
+ import React, { memo } from 'react';
18
+ import { View, StyleSheet, Text, FlatList, TouchableOpacity } from 'react-native';
19
+ const MyGroupChat = memo(({ keyword }) => {
20
+ const { chatGroups } = useChatGroup();
21
+ const { t } = useTranslation();
22
+ const navigation = useNavigation();
51
23
  const data = chatGroups.filter(item => {
52
24
  return keyword ? item.chatGroupName.includes(keyword) : false;
53
25
  });
54
26
  if (data.length === 0) {
55
- return (<react_native_1.View style={{ flex: 1 }}>
56
- <react_native_1.View style={{
27
+ return (<View style={{ flex: 1 }}>
28
+ <View style={{
57
29
  flex: 1,
58
30
  justifyContent: 'center',
59
31
  alignItems: 'center',
60
32
  }}>
61
- <react_native_1.Text>{t('noSearchResult')}</react_native_1.Text>
62
- </react_native_1.View>
63
- </react_native_1.View>);
33
+ <Text>{t('noSearchResult')}</Text>
34
+ </View>
35
+ </View>);
64
36
  }
65
37
  const renderItem = ({ item }) => {
66
38
  const { chatGroupId, chatGroupName, avatars } = item;
67
- return (<react_native_1.TouchableOpacity style={styles.item} activeOpacity={0.5} onPress={() => __awaiter(void 0, void 0, void 0, function* () {
39
+ return (<TouchableOpacity style={styles.item} activeOpacity={0.5} onPress={() => __awaiter(void 0, void 0, void 0, function* () {
68
40
  // onPress && onPress(item);
69
- yield (0, init_1.getImManager)().initChatGroupConversation(item);
41
+ yield getImManager().initChatGroupConversation(item);
70
42
  navigation.navigate('MessageList');
71
43
  })}>
72
- <ChatAvatar_1.default type={im_base_1.ConversationType.C2G} name={chatGroupName} disabled={true} id={chatGroupId} url={avatars} size={(0, rn_ui_1.dp)(42)}/>
73
- <react_native_1.View style={styles.width10}/>
74
- <react_native_1.View style={styles.left}>
75
- <react_native_1.Text style={styles.name} numberOfLines={1}>
76
- {(0, summary_1.getSummary)(chatGroupName, keyword, 20)}
77
- </react_native_1.Text>
78
- </react_native_1.View>
79
- </react_native_1.TouchableOpacity>);
44
+ <ChatAvatar type={ConversationType.C2G} name={chatGroupName} disabled={true} id={chatGroupId} url={avatars} size={dp(42)}/>
45
+ <View style={styles.width10}/>
46
+ <View style={styles.left}>
47
+ <Text style={styles.name} numberOfLines={1}>
48
+ {getSummary(chatGroupName, keyword, 20)}
49
+ </Text>
50
+ </View>
51
+ </TouchableOpacity>);
80
52
  };
81
- const itemSeparatorComponent = () => <react_native_1.View style={styles.separator}/>;
82
- return (<react_native_1.FlatList contentContainerStyle={styles.list} data={data} numColumns={1} keyExtractor={item => item.chatGroupId} renderItem={renderItem} keyboardShouldPersistTaps={'handled'} ItemSeparatorComponent={itemSeparatorComponent}/>);
53
+ const itemSeparatorComponent = () => <View style={styles.separator}/>;
54
+ return (<FlatList contentContainerStyle={styles.list} data={data} numColumns={1} keyExtractor={item => item.chatGroupId} renderItem={renderItem} keyboardShouldPersistTaps={'handled'} ItemSeparatorComponent={itemSeparatorComponent}/>);
83
55
  });
84
- const styles = react_native_1.StyleSheet.create({
56
+ const styles = StyleSheet.create({
85
57
  list: {
86
- marginVertical: (0, rn_ui_1.dp)(10),
87
- padding: (0, rn_ui_1.dp)(15),
58
+ marginVertical: dp(10),
59
+ padding: dp(15),
88
60
  backgroundColor: '#fff',
89
- borderWidth: (0, rn_ui_1.dp)(1),
61
+ borderWidth: dp(1),
90
62
  borderStyle: 'solid',
91
63
  borderColor: '#eee',
92
64
  borderLeftWidth: 0,
@@ -96,7 +68,7 @@ const styles = react_native_1.StyleSheet.create({
96
68
  flexDirection: 'row',
97
69
  },
98
70
  width10: {
99
- width: (0, rn_ui_1.dp)(10),
71
+ width: dp(10),
100
72
  },
101
73
  left: {
102
74
  justifyContent: 'center',
@@ -104,14 +76,14 @@ const styles = react_native_1.StyleSheet.create({
104
76
  avatars: {},
105
77
  name: {
106
78
  width: 250,
107
- fontSize: (0, rn_ui_1.dp)(14),
108
- lineHeight: (0, rn_ui_1.dp)(16),
79
+ fontSize: dp(14),
80
+ lineHeight: dp(16),
109
81
  color: '#333',
110
82
  },
111
83
  separator: {
112
- marginLeft: (0, rn_ui_1.dp)(50),
113
- marginVertical: (0, rn_ui_1.dp)(10),
114
- height: (0, rn_ui_1.dp)(1),
84
+ marginLeft: dp(50),
85
+ marginVertical: dp(10),
86
+ height: dp(1),
115
87
  backgroundColor: '#eee',
116
88
  },
117
89
  accessory: {
@@ -125,4 +97,4 @@ const styles = react_native_1.StyleSheet.create({
125
97
  tintColor: '#bebebe',
126
98
  },
127
99
  });
128
- exports.default = MyGroupChat;
100
+ export default MyGroupChat;