@smart-link/rn-im 1.0.1

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 (302) hide show
  1. package/README.md +34 -0
  2. package/assets/avatars-busi-notify.png +0 -0
  3. package/assets/avatars-empty.png +0 -0
  4. package/assets/avatars-group.jpg +0 -0
  5. package/assets/avatars-man.jpg +0 -0
  6. package/assets/avatars-woman.jpg +0 -0
  7. package/assets/cloud-backup-begin.png +0 -0
  8. package/assets/cloud-backup.png +0 -0
  9. package/assets/group-mgr.png +0 -0
  10. package/assets/group-owner.png +0 -0
  11. package/assets/hook-black-double.png +0 -0
  12. package/assets/hook-black.png +0 -0
  13. package/assets/hook-blue-double.png +0 -0
  14. package/assets/hook-blue.png +0 -0
  15. package/assets/hook-green.png +0 -0
  16. package/assets/no_message.png +0 -0
  17. package/assets/share.jpeg +0 -0
  18. package/assets/voice-left-playing.gif +0 -0
  19. package/assets/voice-left.png +0 -0
  20. package/dist/api/addressList.d.ts +27 -0
  21. package/dist/api/addressList.js +18 -0
  22. package/dist/api/backup.d.ts +18 -0
  23. package/dist/api/backup.js +29 -0
  24. package/dist/api/file.d.ts +4 -0
  25. package/dist/api/file.js +49 -0
  26. package/dist/api/user.d.ts +8 -0
  27. package/dist/api/user.js +16 -0
  28. package/dist/components/CachedImage.d.ts +11 -0
  29. package/dist/components/CachedImage.js +48 -0
  30. package/dist/components/Camera/Camera.d.ts +10 -0
  31. package/dist/components/Camera/Camera.js +100 -0
  32. package/dist/components/Camera/CameraCapture.d.ts +32 -0
  33. package/dist/components/Camera/CameraCapture.js +360 -0
  34. package/dist/components/Camera/CameraResult.d.ts +11 -0
  35. package/dist/components/Camera/CameraResult.js +102 -0
  36. package/dist/components/ChatAvatar/ChatAvatar.d.ts +15 -0
  37. package/dist/components/ChatAvatar/ChatAvatar.js +134 -0
  38. package/dist/components/ChatAvatar/ChatAvatarId.d.ts +8 -0
  39. package/dist/components/ChatAvatar/ChatAvatarId.js +92 -0
  40. package/dist/components/ChatAvatar/ChatAvatarLocal.d.ts +9 -0
  41. package/dist/components/ChatAvatar/ChatAvatarLocal.js +76 -0
  42. package/dist/components/ChatAvatar/index.d.ts +2 -0
  43. package/dist/components/ChatAvatar/index.js +23 -0
  44. package/dist/components/Favicon.d.ts +7 -0
  45. package/dist/components/Favicon.js +74 -0
  46. package/dist/components/FormatTimeText.d.ts +8 -0
  47. package/dist/components/FormatTimeText.js +24 -0
  48. package/dist/components/Highlighter.d.ts +9 -0
  49. package/dist/components/Highlighter.js +42 -0
  50. package/dist/components/IndicatorText.d.ts +10 -0
  51. package/dist/components/IndicatorText.js +47 -0
  52. package/dist/components/LocalImage.d.ts +10 -0
  53. package/dist/components/LocalImage.js +37 -0
  54. package/dist/components/NetworkUnconnected.d.ts +3 -0
  55. package/dist/components/NetworkUnconnected.js +55 -0
  56. package/dist/components/PopoverWrapper.d.ts +13 -0
  57. package/dist/components/PopoverWrapper.js +78 -0
  58. package/dist/components/VideoPlayer.d.ts +13 -0
  59. package/dist/components/VideoPlayer.js +288 -0
  60. package/dist/components/styles.d.ts +19 -0
  61. package/dist/components/styles.js +23 -0
  62. package/dist/default-assets.d.ts +18 -0
  63. package/dist/default-assets.js +22 -0
  64. package/dist/hooks/useFormatMsgTime.d.ts +4 -0
  65. package/dist/hooks/useFormatMsgTime.js +53 -0
  66. package/dist/hooks/useImSelector.d.ts +15 -0
  67. package/dist/hooks/useImSelector.js +48 -0
  68. package/dist/hooks/useTranslation.d.ts +13 -0
  69. package/dist/hooks/useTranslation.js +12 -0
  70. package/dist/index.d.ts +7 -0
  71. package/dist/index.js +28 -0
  72. package/dist/init.d.ts +17 -0
  73. package/dist/init.js +116 -0
  74. package/dist/interface.d.ts +47 -0
  75. package/dist/interface.js +2 -0
  76. package/dist/locales/en/addressList.d.ts +3 -0
  77. package/dist/locales/en/addressList.js +31 -0
  78. package/dist/locales/index.d.ts +4 -0
  79. package/dist/locales/index.js +27 -0
  80. package/dist/locales/lao/addressList.d.ts +3 -0
  81. package/dist/locales/lao/addressList.js +31 -0
  82. package/dist/locales/zh/addressList.d.ts +30 -0
  83. package/dist/locales/zh/addressList.js +32 -0
  84. package/dist/pages/address-list/AddressList.d.ts +6 -0
  85. package/dist/pages/address-list/AddressList.js +158 -0
  86. package/dist/pages/address-list/CardInfo.d.ts +15 -0
  87. package/dist/pages/address-list/CardInfo.js +42 -0
  88. package/dist/pages/address-list/ChooseContact.d.ts +6 -0
  89. package/dist/pages/address-list/ChooseContact.js +197 -0
  90. package/dist/pages/address-list/Icons.d.ts +5 -0
  91. package/dist/pages/address-list/Icons.js +16 -0
  92. package/dist/pages/address-list/Organization.d.ts +13 -0
  93. package/dist/pages/address-list/Organization.js +221 -0
  94. package/dist/pages/address-list/UserDetail.d.ts +6 -0
  95. package/dist/pages/address-list/UserDetail.js +131 -0
  96. package/dist/pages/address-list/UserJobs.d.ts +6 -0
  97. package/dist/pages/address-list/UserJobs.js +50 -0
  98. package/dist/pages/address-list/UserSearch.d.ts +6 -0
  99. package/dist/pages/address-list/UserSearch.js +82 -0
  100. package/dist/pages/address-list/addressList.routes.d.ts +50 -0
  101. package/dist/pages/address-list/addressList.routes.js +50 -0
  102. package/dist/pages/collection/Collection.d.ts +3 -0
  103. package/dist/pages/collection/Collection.js +136 -0
  104. package/dist/pages/collection/ContentFactory.d.ts +6 -0
  105. package/dist/pages/collection/ContentFactory.js +167 -0
  106. package/dist/pages/collection/collection.routes.d.ts +9 -0
  107. package/dist/pages/collection/collection.routes.js +17 -0
  108. package/dist/pages/conversation/ForwardToConversation.d.ts +6 -0
  109. package/dist/pages/conversation/ForwardToConversation.js +172 -0
  110. package/dist/pages/conversation/List.d.ts +6 -0
  111. package/dist/pages/conversation/List.js +204 -0
  112. package/dist/pages/conversation/components/ConversationCard.d.ts +12 -0
  113. package/dist/pages/conversation/components/ConversationCard.js +142 -0
  114. package/dist/pages/conversation/components/ConversationOption.d.ts +11 -0
  115. package/dist/pages/conversation/components/ConversationOption.js +99 -0
  116. package/dist/pages/conversation/conversation.routes.d.ts +2 -0
  117. package/dist/pages/conversation/conversation.routes.js +74 -0
  118. package/dist/pages/conversation/setting/GroupTransfer.d.ts +6 -0
  119. package/dist/pages/conversation/setting/GroupTransfer.js +88 -0
  120. package/dist/pages/conversation/setting/OptionAvatars.d.ts +22 -0
  121. package/dist/pages/conversation/setting/OptionAvatars.js +152 -0
  122. package/dist/pages/conversation/setting/OptionCancelGroup.d.ts +6 -0
  123. package/dist/pages/conversation/setting/OptionCancelGroup.js +49 -0
  124. package/dist/pages/conversation/setting/OptionConversation.d.ts +19 -0
  125. package/dist/pages/conversation/setting/OptionConversation.js +71 -0
  126. package/dist/pages/conversation/setting/OptionGroup.d.ts +17 -0
  127. package/dist/pages/conversation/setting/OptionGroup.js +76 -0
  128. package/dist/pages/conversation/setting/OptionGroupManage.d.ts +6 -0
  129. package/dist/pages/conversation/setting/OptionGroupManage.js +68 -0
  130. package/dist/pages/conversation/setting/OptionGroupMoreMember.d.ts +4 -0
  131. package/dist/pages/conversation/setting/OptionGroupMoreMember.js +124 -0
  132. package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.d.ts +6 -0
  133. package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.js +149 -0
  134. package/dist/pages/conversation/setting/Setting.d.ts +6 -0
  135. package/dist/pages/conversation/setting/Setting.js +184 -0
  136. package/dist/pages/conversation/setting/SettingChatBg.d.ts +6 -0
  137. package/dist/pages/conversation/setting/SettingChatBg.js +95 -0
  138. package/dist/pages/index.d.ts +8 -0
  139. package/dist/pages/index.js +27 -0
  140. package/dist/pages/message/ChooseMember.d.ts +6 -0
  141. package/dist/pages/message/ChooseMember.js +185 -0
  142. package/dist/pages/message/MessageBackup/Bar.d.ts +8 -0
  143. package/dist/pages/message/MessageBackup/Bar.js +77 -0
  144. package/dist/pages/message/MessageBackup/MessageBackup.d.ts +10 -0
  145. package/dist/pages/message/MessageBackup/MessageBackup.js +133 -0
  146. package/dist/pages/message/MessageBackup/RestoreBackupPage.d.ts +6 -0
  147. package/dist/pages/message/MessageBackup/RestoreBackupPage.js +135 -0
  148. package/dist/pages/message/MessageBackup/StartBackupPage.d.ts +6 -0
  149. package/dist/pages/message/MessageBackup/StartBackupPage.js +135 -0
  150. package/dist/pages/message/MessageBackup/index.d.ts +3 -0
  151. package/dist/pages/message/MessageBackup/index.js +12 -0
  152. package/dist/pages/message/MessageBackup/utils.d.ts +46 -0
  153. package/dist/pages/message/MessageBackup/utils.js +239 -0
  154. package/dist/pages/message/MessageList.d.ts +6 -0
  155. package/dist/pages/message/MessageList.js +175 -0
  156. package/dist/pages/message/MessageRecord.d.ts +6 -0
  157. package/dist/pages/message/MessageRecord.js +97 -0
  158. package/dist/pages/message/components/BusiNotifyCard.d.ts +6 -0
  159. package/dist/pages/message/components/BusiNotifyCard.js +132 -0
  160. package/dist/pages/message/components/ChatBg.d.ts +7 -0
  161. package/dist/pages/message/components/ChatBg.js +65 -0
  162. package/dist/pages/message/components/MessageItem.d.ts +16 -0
  163. package/dist/pages/message/components/MessageItem.js +205 -0
  164. package/dist/pages/message/components/MessageItemQuote.d.ts +7 -0
  165. package/dist/pages/message/components/MessageItemQuote.js +83 -0
  166. package/dist/pages/message/components/MessageItemTips.d.ts +9 -0
  167. package/dist/pages/message/components/MessageItemTips.js +67 -0
  168. package/dist/pages/message/components/MessageOption.d.ts +11 -0
  169. package/dist/pages/message/components/MessageOption.js +360 -0
  170. package/dist/pages/message/components/MessagePayload.d.ts +14 -0
  171. package/dist/pages/message/components/MessagePayload.js +96 -0
  172. package/dist/pages/message/components/MessagePictureAlbum.d.ts +10 -0
  173. package/dist/pages/message/components/MessagePictureAlbum.js +105 -0
  174. package/dist/pages/message/components/MessageReceiptStatus.d.ts +6 -0
  175. package/dist/pages/message/components/MessageReceiptStatus.js +61 -0
  176. package/dist/pages/message/components/MessageUndo.d.ts +10 -0
  177. package/dist/pages/message/components/MessageUndo.js +75 -0
  178. package/dist/pages/message/components/MultipleBar/index.d.ts +5 -0
  179. package/dist/pages/message/components/MultipleBar/index.js +116 -0
  180. package/dist/pages/message/components/Payload/PayloadContact.d.ts +4 -0
  181. package/dist/pages/message/components/Payload/PayloadContact.js +86 -0
  182. package/dist/pages/message/components/Payload/PayloadFile.d.ts +4 -0
  183. package/dist/pages/message/components/Payload/PayloadFile.js +115 -0
  184. package/dist/pages/message/components/Payload/PayloadMultiple.d.ts +4 -0
  185. package/dist/pages/message/components/Payload/PayloadMultiple.js +102 -0
  186. package/dist/pages/message/components/Payload/PayloadNotify.d.ts +9 -0
  187. package/dist/pages/message/components/Payload/PayloadNotify.js +92 -0
  188. package/dist/pages/message/components/Payload/PayloadPicture.d.ts +7 -0
  189. package/dist/pages/message/components/Payload/PayloadPicture.js +69 -0
  190. package/dist/pages/message/components/Payload/PayloadShare.d.ts +4 -0
  191. package/dist/pages/message/components/Payload/PayloadShare.js +100 -0
  192. package/dist/pages/message/components/Payload/PayloadText.d.ts +4 -0
  193. package/dist/pages/message/components/Payload/PayloadText.js +128 -0
  194. package/dist/pages/message/components/Payload/PayloadVideo.d.ts +4 -0
  195. package/dist/pages/message/components/Payload/PayloadVideo.js +78 -0
  196. package/dist/pages/message/components/Payload/PayloadVoice.d.ts +6 -0
  197. package/dist/pages/message/components/Payload/PayloadVoice.js +155 -0
  198. package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +12 -0
  199. package/dist/pages/message/components/Payload/PayloadWrapper.js +73 -0
  200. package/dist/pages/message/components/Payload/type.d.ts +9 -0
  201. package/dist/pages/message/components/Payload/type.js +2 -0
  202. package/dist/pages/message/components/ReceiptBack.d.ts +7 -0
  203. package/dist/pages/message/components/ReceiptBack.js +82 -0
  204. package/dist/pages/message/components/TextMixMessage.d.ts +9 -0
  205. package/dist/pages/message/components/TextMixMessage.js +62 -0
  206. package/dist/pages/message/components/TextMixQuote.d.ts +61 -0
  207. package/dist/pages/message/components/TextMixQuote.js +276 -0
  208. package/dist/pages/message/components/TextMixQuoteMessage.d.ts +14 -0
  209. package/dist/pages/message/components/TextMixQuoteMessage.js +74 -0
  210. package/dist/pages/message/components/UploadProgress.d.ts +9 -0
  211. package/dist/pages/message/components/UploadProgress.js +51 -0
  212. package/dist/pages/message/components/messageBar/EmojiPanel.d.ts +11 -0
  213. package/dist/pages/message/components/messageBar/EmojiPanel.js +101 -0
  214. package/dist/pages/message/components/messageBar/Icons.d.ts +18 -0
  215. package/dist/pages/message/components/messageBar/Icons.js +88 -0
  216. package/dist/pages/message/components/messageBar/MessageBar.d.ts +12 -0
  217. package/dist/pages/message/components/messageBar/MessageBar.js +273 -0
  218. package/dist/pages/message/components/messageBar/MessageInput.d.ts +21 -0
  219. package/dist/pages/message/components/messageBar/MessageInput.js +203 -0
  220. package/dist/pages/message/components/messageBar/OptionPanel.d.ts +8 -0
  221. package/dist/pages/message/components/messageBar/OptionPanel.js +240 -0
  222. package/dist/pages/message/components/messageBar/VoiceBar.d.ts +3 -0
  223. package/dist/pages/message/components/messageBar/VoiceBar.js +272 -0
  224. package/dist/pages/message/components/messageBar/index.d.ts +2 -0
  225. package/dist/pages/message/components/messageBar/index.js +23 -0
  226. package/dist/pages/message/message.routes.d.ts +2 -0
  227. package/dist/pages/message/message.routes.js +79 -0
  228. package/dist/pages/search/Search.d.ts +6 -0
  229. package/dist/pages/search/Search.js +84 -0
  230. package/dist/pages/search/SearchChatRecords.d.ts +3 -0
  231. package/dist/pages/search/SearchChatRecords.js +173 -0
  232. package/dist/pages/search/SearchFile.d.ts +3 -0
  233. package/dist/pages/search/SearchFile.js +202 -0
  234. package/dist/pages/search/SearchManager.d.ts +6 -0
  235. package/dist/pages/search/SearchManager.js +111 -0
  236. package/dist/pages/search/SearchPicturePage.d.ts +6 -0
  237. package/dist/pages/search/SearchPicturePage.js +56 -0
  238. package/dist/pages/search/components/ChatRecords.d.ts +6 -0
  239. package/dist/pages/search/components/ChatRecords.js +151 -0
  240. package/dist/pages/search/components/MyGroupChat.d.ts +6 -0
  241. package/dist/pages/search/components/MyGroupChat.js +128 -0
  242. package/dist/pages/search/components/PictureMulipleBar.d.ts +10 -0
  243. package/dist/pages/search/components/PictureMulipleBar.js +105 -0
  244. package/dist/pages/search/components/SearchFileList.d.ts +7 -0
  245. package/dist/pages/search/components/SearchFileList.js +173 -0
  246. package/dist/pages/search/components/SearchPictures.d.ts +8 -0
  247. package/dist/pages/search/components/SearchPictures.js +220 -0
  248. package/dist/pages/search/components/SearchShareLinkList.d.ts +7 -0
  249. package/dist/pages/search/components/SearchShareLinkList.js +112 -0
  250. package/dist/pages/search/components/SearchUser.d.ts +6 -0
  251. package/dist/pages/search/components/SearchUser.js +83 -0
  252. package/dist/pages/search/components/useSearchMessage.d.ts +11 -0
  253. package/dist/pages/search/components/useSearchMessage.js +68 -0
  254. package/dist/pages/search/search.routes.d.ts +2 -0
  255. package/dist/pages/search/search.routes.js +48 -0
  256. package/dist/pages/search/utils.d.ts +12 -0
  257. package/dist/pages/search/utils.js +42 -0
  258. package/dist/pages/types.d.ts +70 -0
  259. package/dist/pages/types.js +2 -0
  260. package/dist/slice/contact/contact.action.d.ts +1 -0
  261. package/dist/slice/contact/contact.action.js +2 -0
  262. package/dist/slice/contact/contact.slice.d.ts +12 -0
  263. package/dist/slice/contact/contact.slice.js +60 -0
  264. package/dist/slice/index.d.ts +9 -0
  265. package/dist/slice/index.js +15 -0
  266. package/dist/slice/panel/panel.slice.d.ts +8 -0
  267. package/dist/slice/panel/panel.slice.js +19 -0
  268. package/dist/slice/video/video.action.d.ts +5 -0
  269. package/dist/slice/video/video.action.js +65 -0
  270. package/dist/slice/video/video.slice.d.ts +17 -0
  271. package/dist/slice/video/video.slice.js +40 -0
  272. package/dist/utils/color.d.ts +1 -0
  273. package/dist/utils/color.js +9 -0
  274. package/dist/utils/common-action-sheet.d.ts +8 -0
  275. package/dist/utils/common-action-sheet.js +45 -0
  276. package/dist/utils/cookie.d.ts +1 -0
  277. package/dist/utils/cookie.js +29 -0
  278. package/dist/utils/emoji.d.ts +9 -0
  279. package/dist/utils/emoji.js +627 -0
  280. package/dist/utils/file-icon.d.ts +7 -0
  281. package/dist/utils/file-icon.js +80 -0
  282. package/dist/utils/file-operate.d.ts +1 -0
  283. package/dist/utils/file-operate.js +4 -0
  284. package/dist/utils/file.d.ts +23 -0
  285. package/dist/utils/file.js +255 -0
  286. package/dist/utils/golden-rectangle.d.ts +4 -0
  287. package/dist/utils/golden-rectangle.js +34 -0
  288. package/dist/utils/phone.d.ts +2 -0
  289. package/dist/utils/phone.js +24 -0
  290. package/dist/utils/request.d.ts +34 -0
  291. package/dist/utils/request.js +67 -0
  292. package/dist/utils/scroll.d.ts +1 -0
  293. package/dist/utils/scroll.js +12 -0
  294. package/dist/utils/summary.d.ts +2 -0
  295. package/dist/utils/summary.js +42 -0
  296. package/dist/utils/take-camera.d.ts +2 -0
  297. package/dist/utils/take-camera.js +41 -0
  298. package/dist/utils/text-mix.d.ts +9 -0
  299. package/dist/utils/text-mix.js +82 -0
  300. package/dist/utils/upload.d.ts +5 -0
  301. package/dist/utils/upload.js +80 -0
  302. package/package.json +79 -0
@@ -0,0 +1,82 @@
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 rn_ui_1 = require("@smart-link/rn-ui");
27
+ const react_1 = __importStar(require("react"));
28
+ const react_native_1 = require("react-native");
29
+ const useTranslation_1 = require("../../hooks/useTranslation");
30
+ const Organization_1 = require("./Organization");
31
+ const addressList_1 = require("../../api/addressList");
32
+ const init_1 = require("../../init");
33
+ const react_redux_1 = require("react-redux");
34
+ const contact_slice_1 = require("../../slice/contact/contact.slice");
35
+ const useImSelector_1 = require("../../hooks/useImSelector");
36
+ const UserSearch = (0, react_1.memo)(({ navigation, route: { params } }) => {
37
+ const [keyword, setKeyword] = (0, react_1.useState)('');
38
+ const { selectUsers } = (0, useImSelector_1.useContact)();
39
+ const { checkable } = params || {};
40
+ const [userList, setUserList] = (0, react_1.useState)([]);
41
+ const { t } = (0, useTranslation_1.useTranslationAddrList)();
42
+ const imManager = (0, init_1.getImManager)();
43
+ const dispatch = (0, react_redux_1.useDispatch)();
44
+ const selectCount = Object.keys(selectUsers).length;
45
+ (0, react_1.useEffect)(() => {
46
+ if (!keyword || keyword === '') {
47
+ return;
48
+ }
49
+ (0, addressList_1.searchUser)({
50
+ userNameLike: keyword,
51
+ tenantId: imManager.user.tenantId,
52
+ }).then(({ data }) => {
53
+ setUserList(data);
54
+ });
55
+ }, [keyword]);
56
+ const handleUser = (item) => {
57
+ navigation.navigate('UserDetail', { userId: item.userId, userAccount: item.userAccount });
58
+ };
59
+ return (<>
60
+ <rn_ui_1.HeaderSearchBar value={keyword} onSubmitEditing={setKeyword}/>
61
+ <rn_ui_1.NavigationPage noPadding scroll={userList.length > 0}>
62
+ {userList.length > 0 ? (userList.map((item) => (<rn_ui_1.ListRow key={item.userId} onPress={() => {
63
+ if (checkable) {
64
+ dispatch((0, contact_slice_1.onSelectUser)(item));
65
+ }
66
+ else {
67
+ handleUser(item);
68
+ }
69
+ }} title={<Organization_1.RenderUserItem checkable={checkable} checked={!!selectUsers[item.userId]} data={item}/>} topSeparator="full"/>))) : (<react_native_1.View style={[styles.noData]}>
70
+ <react_native_1.Text>{t('noData')}</react_native_1.Text>
71
+ </react_native_1.View>)}
72
+ </rn_ui_1.NavigationPage>
73
+ </>);
74
+ });
75
+ const styles = react_native_1.StyleSheet.create({
76
+ noData: {
77
+ flex: 1,
78
+ justifyContent: 'center',
79
+ alignItems: 'center',
80
+ },
81
+ });
82
+ exports.default = UserSearch;
@@ -0,0 +1,50 @@
1
+ /// <reference types="react" />
2
+ declare const addressListRoutes: readonly [{
3
+ readonly name: "AddressList";
4
+ readonly component: ({ navigation }: {
5
+ navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("..").IMPageParamList, "AddressList", undefined>;
6
+ route: import("@react-navigation/native").RouteProp<import("..").IMPageParamList, "AddressList">;
7
+ }) => import("react").JSX.Element;
8
+ readonly options: {
9
+ readonly title: "";
10
+ };
11
+ }, {
12
+ readonly name: "Organization";
13
+ readonly component: ({ navigation, route: { params } }: {
14
+ navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("..").IMPageParamList, "Organization", undefined>;
15
+ route: import("@react-navigation/native").RouteProp<import("..").IMPageParamList, "Organization">;
16
+ }) => import("react").JSX.Element;
17
+ readonly options: {
18
+ readonly title: "";
19
+ };
20
+ }, {
21
+ readonly name: "ChooseContact";
22
+ readonly component: import("react").FC<{
23
+ navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("..").IMPageParamList, "ChooseContact", undefined>;
24
+ route: import("@react-navigation/native").RouteProp<import("..").IMPageParamList, "ChooseContact">;
25
+ }>;
26
+ readonly options: {
27
+ readonly animation: "fade";
28
+ readonly title: "";
29
+ };
30
+ }, {
31
+ readonly name: "UserDetail";
32
+ readonly component: ({ navigation, route: { params } }: {
33
+ navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("..").IMPageParamList, "UserDetail", undefined>;
34
+ route: import("@react-navigation/native").RouteProp<import("..").IMPageParamList, "UserDetail">;
35
+ }) => import("react").JSX.Element;
36
+ readonly options: {
37
+ readonly title: "";
38
+ };
39
+ }, {
40
+ readonly name: "UserSearch";
41
+ readonly component: import("react").MemoExoticComponent<({ navigation, route: { params } }: {
42
+ navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("..").IMPageParamList, "UserSearch", undefined>;
43
+ route: import("@react-navigation/native").RouteProp<import("..").IMPageParamList, "UserSearch">;
44
+ }) => import("react").JSX.Element>;
45
+ readonly options: {
46
+ readonly animation: "fade";
47
+ readonly headerShown: false;
48
+ };
49
+ }];
50
+ export default addressListRoutes;
@@ -0,0 +1,50 @@
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 UserDetail_1 = __importDefault(require("./UserDetail"));
7
+ const UserSearch_1 = __importDefault(require("./UserSearch"));
8
+ const ChooseContact_1 = __importDefault(require("./ChooseContact"));
9
+ const Organization_1 = __importDefault(require("./Organization"));
10
+ const AddressList_1 = __importDefault(require("./AddressList"));
11
+ const addressListRoutes = [
12
+ {
13
+ name: 'AddressList',
14
+ component: AddressList_1.default,
15
+ options: {
16
+ title: ''
17
+ },
18
+ },
19
+ {
20
+ name: 'Organization',
21
+ component: Organization_1.default,
22
+ options: {
23
+ title: ''
24
+ },
25
+ },
26
+ {
27
+ name: 'ChooseContact',
28
+ component: ChooseContact_1.default,
29
+ options: {
30
+ animation: 'fade',
31
+ title: ''
32
+ },
33
+ },
34
+ {
35
+ name: 'UserDetail',
36
+ component: UserDetail_1.default,
37
+ options: {
38
+ title: ''
39
+ },
40
+ },
41
+ {
42
+ name: 'UserSearch',
43
+ component: UserSearch_1.default,
44
+ options: {
45
+ animation: 'fade',
46
+ headerShown: false,
47
+ },
48
+ },
49
+ ];
50
+ exports.default = addressListRoutes;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Collection: () => React.JSX.Element;
3
+ export default Collection;
@@ -0,0 +1,136 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
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 react_1 = __importStar(require("react"));
40
+ const react_native_1 = require("react-native");
41
+ const useTranslation_1 = __importDefault(require("../../hooks/useTranslation"));
42
+ const init_1 = require("../../init");
43
+ const useImSelector_1 = require("../../hooks/useImSelector");
44
+ const ContentFactory_1 = __importDefault(require("./ContentFactory"));
45
+ const styles_1 = require("../../components/styles");
46
+ const FormatTimeText_1 = __importDefault(require("../../components/FormatTimeText"));
47
+ const common_action_sheet_1 = require("../../utils/common-action-sheet");
48
+ const Collection = () => {
49
+ const { t } = (0, useTranslation_1.default)();
50
+ const [keyword, setKeyword] = (0, react_1.useState)('');
51
+ const { currentConversation } = (0, useImSelector_1.useConversation)();
52
+ const { collections } = (0, useImSelector_1.useCollection)();
53
+ const navigation = (0, rn_ui_1.useNavigation)();
54
+ (0, react_1.useEffect)(() => {
55
+ (0, init_1.getImManager)().selectCollections(keyword);
56
+ }, [keyword]);
57
+ const onPressCollection = (collection) => {
58
+ (0, common_action_sheet_1.ConfirmActionSheet)(t('sendTo') + (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.name), () => __awaiter(void 0, void 0, void 0, function* () {
59
+ // TODO: 发送收藏消息
60
+ yield (0, init_1.getImManager)().sendCollectionMessage(collection);
61
+ navigation.goBack();
62
+ }), t);
63
+ };
64
+ const keyExtractor = (item) => item.messageSeq;
65
+ const itemSeparatorComponent = () => <react_native_1.View style={styles.h10}/>;
66
+ const renderItem = ({ item }) => {
67
+ const { conversationName, messageTime } = item;
68
+ return (<react_native_1.TouchableOpacity activeOpacity={0.5} style={styles.item} onPress={() => {
69
+ onPressCollection(item);
70
+ }}>
71
+ <ContentFactory_1.default collection={item} keyword={keyword}/>
72
+ <react_native_1.View style={styles.h10}/>
73
+ <react_native_1.View style={styles.row}>
74
+ <react_native_1.Text style={styles.title} numberOfLines={1}>
75
+ {conversationName + ' '}
76
+ </react_native_1.Text>
77
+ <FormatTimeText_1.default style={styles.time} time={messageTime}/>
78
+ </react_native_1.View>
79
+ </react_native_1.TouchableOpacity>);
80
+ };
81
+ return (<>
82
+ <rn_ui_1.HeaderSearchBar value={keyword} onSubmitEditing={setKeyword}/>
83
+ <rn_ui_1.NavigationPage scroll={false} noPadding>
84
+ {collections.length > 0 && (<react_native_1.FlatList contentContainerStyle={styles.list} numColumns={1} data={collections} keyExtractor={keyExtractor} renderItem={renderItem} keyboardShouldPersistTaps={'handled'} ItemSeparatorComponent={itemSeparatorComponent}/>)}
85
+ {collections.length === 0 && (<react_native_1.View style={{ flex: 1 }}>
86
+ <react_native_1.View style={{
87
+ flex: 1,
88
+ justifyContent: 'center',
89
+ alignItems: 'center',
90
+ height: (0, rn_ui_1.dp)(80),
91
+ }}>
92
+ <react_native_1.Text>{t('emptyCollect')}</react_native_1.Text>
93
+ </react_native_1.View>
94
+ </react_native_1.View>)}
95
+ </rn_ui_1.NavigationPage>
96
+ </>);
97
+ };
98
+ const styles = react_native_1.StyleSheet.create({
99
+ collection: {
100
+ flex: 1,
101
+ },
102
+ list: {
103
+ paddingVertical: (0, rn_ui_1.dp)(10),
104
+ paddingHorizontal: (0, rn_ui_1.dp)(12),
105
+ },
106
+ item: Object.assign(Object.assign({ minHeight: (0, rn_ui_1.dp)(80), padding: (0, rn_ui_1.dp)(15), backgroundColor: '#fff', borderColor: '#eee' }, styles_1.shadowStyle), styles_1.borderStyle),
107
+ search: Object.assign({ backgroundColor: '#fff', padding: (0, rn_ui_1.dp)(10), borderBottomWidth: (0, rn_ui_1.dp)(1), borderColor: '#e9e9e9' }, styles_1.shadowStyle),
108
+ empty: {
109
+ flex: 1,
110
+ backgroundColor: '#fff',
111
+ alignItems: 'center',
112
+ justifyContent: 'center',
113
+ },
114
+ h10: {
115
+ height: (0, rn_ui_1.dp)(10),
116
+ },
117
+ h15: {
118
+ height: (0, rn_ui_1.dp)(15),
119
+ },
120
+ row: {
121
+ flexDirection: 'row',
122
+ },
123
+ title: {
124
+ maxWidth: (0, rn_ui_1.dp)(230),
125
+ color: '#666',
126
+ fontSize: (0, rn_ui_1.dp)(13),
127
+ lineHeight: (0, rn_ui_1.dp)(20),
128
+ },
129
+ time: {
130
+ marginLeft: (0, rn_ui_1.dp)(10),
131
+ color: '#666',
132
+ fontSize: (0, rn_ui_1.dp)(13),
133
+ lineHeight: (0, rn_ui_1.dp)(20),
134
+ },
135
+ });
136
+ exports.default = Collection;
@@ -0,0 +1,6 @@
1
+ import { ICollection } from '@smart-link/im-base';
2
+ import React from 'react';
3
+ export default function ContentFactory({ keyword, collection }: {
4
+ keyword: string;
5
+ collection: ICollection;
6
+ }): React.JSX.Element | null;
@@ -0,0 +1,167 @@
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 __rest = (this && this.__rest) || function (s, e) {
26
+ var t = {};
27
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
+ t[p] = s[p];
29
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
+ t[p[i]] = s[p[i]];
33
+ }
34
+ return t;
35
+ };
36
+ var __importDefault = (this && this.__importDefault) || function (mod) {
37
+ return (mod && mod.__esModule) ? mod : { "default": mod };
38
+ };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ const LocalImage_1 = __importDefault(require("../../components/LocalImage"));
41
+ const im_base_1 = require("@smart-link/im-base");
42
+ const rn_ui_1 = require("@smart-link/rn-ui");
43
+ const react_1 = __importStar(require("react"));
44
+ const react_native_1 = require("react-native");
45
+ const MaterialIcons_1 = __importDefault(require("react-native-vector-icons/MaterialIcons"));
46
+ const PayloadFile_1 = __importDefault(require("../message/components/Payload/PayloadFile"));
47
+ const { TEXT, VOICE, VIDEO, PICTURE, FILE, } = im_base_1.PayloadType;
48
+ function ContentFactory({ keyword, collection }) {
49
+ const { payloadType, payload } = collection, retProps = __rest(collection, ["payloadType", "payload"]);
50
+ switch (payloadType) {
51
+ case TEXT: {
52
+ return <ContentText keyword={keyword} text={payload.text}/>;
53
+ }
54
+ case VOICE: {
55
+ return <ContentVoice {...payload}/>;
56
+ }
57
+ case FILE: {
58
+ // @ts-ignore
59
+ return <PayloadFile_1.default payload={payload} {...retProps}/>;
60
+ }
61
+ case PICTURE: {
62
+ return <ContentPicture {...payload}/>;
63
+ }
64
+ case VIDEO: {
65
+ return <ContentVideo {...payload}/>;
66
+ }
67
+ default: {
68
+ return null;
69
+ }
70
+ }
71
+ }
72
+ exports.default = ContentFactory;
73
+ const ContentText = (0, react_1.memo)(props => {
74
+ const { keyword, text } = props;
75
+ return (<react_native_1.Text style={styles.text} numberOfLines={3}>
76
+ {text}
77
+ </react_native_1.Text>);
78
+ });
79
+ const voiceLeft = require('../../../assets/voice-left.png');
80
+ const ContentVoice = (0, react_1.memo)(props => {
81
+ const { duration } = props;
82
+ return (<react_native_1.View style={styles.content}>
83
+ <react_native_1.View style={[styles.voice]}>
84
+ <react_native_1.Image style={[styles.voiceImage]} resizeMode="contain" source={voiceLeft}/>
85
+ </react_native_1.View>
86
+ <react_native_1.View style={styles.w15}/>
87
+ <react_native_1.Text style={[styles.duration]}>{duration}''</react_native_1.Text>
88
+ </react_native_1.View>);
89
+ });
90
+ const ContentPicture = (0, react_1.memo)(props => {
91
+ const { localPath, } = props;
92
+ return (<react_native_1.View style={styles.content}>
93
+ <LocalImage_1.default style={styles.picture} resizeMode="cover" localPath={(localPath)}/>
94
+ </react_native_1.View>);
95
+ });
96
+ const ContentVideo = (0, react_1.memo)(props => {
97
+ const { imagePath, duration, } = props;
98
+ return (<react_native_1.View style={styles.content}>
99
+ <react_native_1.View>
100
+ <LocalImage_1.default style={styles.picture} resizeMode="cover" localPath={imagePath}/>
101
+
102
+ <react_native_1.View style={styles.playView}>
103
+ <MaterialIcons_1.default size={30} name="play-circle-outline" color="#fff"/>
104
+ </react_native_1.View>
105
+ </react_native_1.View>
106
+ <react_native_1.View style={styles.w15}/>
107
+ <react_native_1.Text>{(0, im_base_1.numberToTime)(duration)}</react_native_1.Text>
108
+ </react_native_1.View>);
109
+ });
110
+ const styles = react_native_1.StyleSheet.create({
111
+ text: {
112
+ color: '#010101',
113
+ fontSize: (0, rn_ui_1.dp)(14),
114
+ lineHeight: (0, rn_ui_1.dp)(20),
115
+ },
116
+ content: {
117
+ flexDirection: 'row',
118
+ alignItems: 'center',
119
+ },
120
+ voice: {
121
+ justifyContent: 'center',
122
+ alignItems: 'center',
123
+ height: (0, rn_ui_1.dp)(40),
124
+ width: (0, rn_ui_1.dp)(40),
125
+ backgroundColor: '#ebebeb',
126
+ },
127
+ voiceImage: {
128
+ width: (0, rn_ui_1.dp)(25),
129
+ height: (0, rn_ui_1.dp)(20),
130
+ },
131
+ filename: {
132
+ fontSize: (0, rn_ui_1.dp)(15),
133
+ lineHeight: (0, rn_ui_1.dp)(20),
134
+ color: '#010101'
135
+ },
136
+ fileInfo: {
137
+ flex: 1,
138
+ paddingTop: (0, rn_ui_1.dp)(2),
139
+ justifyContent: 'center'
140
+ },
141
+ fileSize: {
142
+ fontSize: (0, rn_ui_1.dp)(12),
143
+ lineHeight: (0, rn_ui_1.dp)(20),
144
+ color: '#a2a2a2'
145
+ },
146
+ duration: {},
147
+ fileImage: {
148
+ width: (0, rn_ui_1.dp)(40),
149
+ height: (0, rn_ui_1.dp)(40)
150
+ },
151
+ picture: {
152
+ width: (0, rn_ui_1.dp)(90),
153
+ height: (0, rn_ui_1.dp)(90)
154
+ },
155
+ playView: {
156
+ position: 'absolute',
157
+ top: 0,
158
+ bottom: 0,
159
+ left: 0,
160
+ right: 0,
161
+ justifyContent: 'center',
162
+ alignItems: "center"
163
+ },
164
+ w15: {
165
+ width: (0, rn_ui_1.dp)(15),
166
+ }
167
+ });
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export declare const collectRoutes: readonly [{
3
+ readonly name: "Collection";
4
+ readonly component: () => import("react").JSX.Element;
5
+ readonly options: {
6
+ readonly animation: "fade_from_bottom";
7
+ readonly headerShown: false;
8
+ };
9
+ }];
@@ -0,0 +1,17 @@
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.collectRoutes = void 0;
7
+ const Collection_1 = __importDefault(require("./Collection"));
8
+ exports.collectRoutes = [
9
+ {
10
+ name: 'Collection',
11
+ component: Collection_1.default,
12
+ options: {
13
+ animation: 'fade_from_bottom',
14
+ headerShown: false,
15
+ },
16
+ },
17
+ ];
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { NativeStackScreenProps } from '@react-navigation/native-stack/lib/typescript/src/types';
3
+ import { IMPageParamList } from '../../pages';
4
+ type ForwardToConversationProps = NativeStackScreenProps<IMPageParamList, 'ForwardToConversation'>;
5
+ declare const _default: React.MemoExoticComponent<({ navigation }: ForwardToConversationProps) => React.JSX.Element>;
6
+ export default _default;