@tencentcloud/chat-uikit-react 2.1.2 → 2.1.3

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 (280) hide show
  1. package/.eslintrc.js +0 -1
  2. package/CHANGELOG.md +5 -0
  3. package/dist/cjs/components/Avatar/Avatar.js +1 -1
  4. package/dist/cjs/components/Checkbox/index.d.ts +2 -1
  5. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  6. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  7. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  8. package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
  9. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
  10. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  11. package/dist/cjs/components/ConversationPreview/utils.js +1 -1
  12. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
  13. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
  14. package/dist/cjs/components/DivWithEdit/DivWithEdit.d.ts +3 -2
  15. package/dist/cjs/components/DivWithEdit/DivWithEdit.js +1 -1
  16. package/dist/cjs/components/DivWithEdit/WithText.js +1 -1
  17. package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
  18. package/dist/cjs/components/Icon/Icon.d.ts +2 -1
  19. package/dist/cjs/components/Icon/Icon.js +1 -1
  20. package/dist/cjs/components/Input/Input.js +1 -1
  21. package/dist/cjs/components/Model/index.d.ts +1 -1
  22. package/dist/cjs/components/Model/index.js +1 -1
  23. package/dist/cjs/components/Plugins/index.js +1 -1
  24. package/dist/cjs/components/Popup/index.d.ts +1 -1
  25. package/dist/cjs/components/Popup/index.js +1 -1
  26. package/dist/cjs/components/Switch/Switch.d.ts +2 -6
  27. package/dist/cjs/components/Switch/Switch.js +1 -1
  28. package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
  29. package/dist/cjs/components/TUIChat/TUIChatState.js +1 -1
  30. package/dist/cjs/components/TUIChat/hooks/useHandleMessage.js +1 -1
  31. package/dist/cjs/components/TUIChat/hooks/useHandleMessageList.js +1 -1
  32. package/dist/cjs/components/TUIChat/unitls.js +1 -1
  33. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  34. package/dist/cjs/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
  35. package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  36. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  37. package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
  38. package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  39. package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  40. package/dist/cjs/components/TUIKit/TUIKit.d.ts +2 -2
  41. package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
  42. package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
  43. package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +1 -1
  44. package/dist/cjs/components/TUIManage/TUIManage.d.ts +4 -1
  45. package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
  46. package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
  47. package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
  48. package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
  49. package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
  50. package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
  51. package/dist/cjs/components/TUIMessage/MessageFace.js +1 -1
  52. package/dist/cjs/components/TUIMessage/MessageFile.js +1 -1
  53. package/dist/cjs/components/TUIMessage/MessageImage.js +1 -1
  54. package/dist/cjs/components/TUIMessage/MessageLocation.js +1 -1
  55. package/dist/cjs/components/TUIMessage/MessageMerger.js +1 -1
  56. package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
  57. package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
  58. package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
  59. package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
  60. package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
  61. package/dist/cjs/components/TUIMessage/MessageVideo.js +1 -1
  62. package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
  63. package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
  64. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  65. package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
  66. package/dist/cjs/components/TUIMessage/utils/index.js +1 -1
  67. package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +1 -1
  68. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  69. package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  70. package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
  71. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  72. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  73. package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  74. package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  75. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
  76. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  77. package/dist/cjs/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
  78. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
  79. package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  80. package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
  81. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
  82. package/dist/cjs/components/TUIProfile/hooks/useMyProfile.js +1 -1
  83. package/dist/cjs/components/Toast/index.js +1 -1
  84. package/dist/cjs/context/ComponentContext.d.ts +3 -2
  85. package/dist/cjs/context/TUIChatActionContext.d.ts +1 -1
  86. package/dist/cjs/context/TUIChatStateContext.d.ts +4 -4
  87. package/dist/cjs/context/TUIContactContext.js +1 -1
  88. package/dist/cjs/context/TUIConversationContext.js +1 -1
  89. package/dist/cjs/context/TUIKitContext.d.ts +1 -1
  90. package/dist/cjs/context/TUIMessageContext.js +1 -1
  91. package/dist/cjs/context/TUIMessageInputContext.js +1 -1
  92. package/dist/cjs/hooks/useProfile.d.ts +1 -1
  93. package/dist/cjs/index.css +1 -1
  94. package/dist/cjs/index.d.css +3 -3
  95. package/dist/cjs/index.d.ts +1 -1
  96. package/dist/esm/components/Avatar/Avatar.js +1 -1
  97. package/dist/esm/components/Checkbox/index.d.ts +2 -1
  98. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  99. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  100. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  101. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
  102. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
  103. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  104. package/dist/esm/components/ConversationPreview/utils.js +1 -1
  105. package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
  106. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
  107. package/dist/esm/components/DivWithEdit/DivWithEdit.d.ts +3 -2
  108. package/dist/esm/components/DivWithEdit/DivWithEdit.js +1 -1
  109. package/dist/esm/components/DivWithEdit/WithText.js +1 -1
  110. package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
  111. package/dist/esm/components/Icon/Icon.d.ts +2 -1
  112. package/dist/esm/components/Icon/Icon.js +1 -1
  113. package/dist/esm/components/Input/Input.js +1 -1
  114. package/dist/esm/components/Model/index.d.ts +1 -1
  115. package/dist/esm/components/Model/index.js +1 -1
  116. package/dist/esm/components/Plugins/index.js +1 -1
  117. package/dist/esm/components/Popup/index.d.ts +1 -1
  118. package/dist/esm/components/Popup/index.js +1 -1
  119. package/dist/esm/components/Switch/Switch.d.ts +2 -6
  120. package/dist/esm/components/Switch/Switch.js +1 -1
  121. package/dist/esm/components/TUIChat/TUIChat.js +1 -1
  122. package/dist/esm/components/TUIChat/TUIChatState.js +1 -1
  123. package/dist/esm/components/TUIChat/hooks/useHandleMessage.js +1 -1
  124. package/dist/esm/components/TUIChat/hooks/useHandleMessageList.js +1 -1
  125. package/dist/esm/components/TUIChat/unitls.js +1 -1
  126. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  127. package/dist/esm/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
  128. package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  129. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  130. package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
  131. package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  132. package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  133. package/dist/esm/components/TUIKit/TUIKit.d.ts +2 -2
  134. package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
  135. package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
  136. package/dist/esm/components/TUIKit/hooks/useTUIKit.js +1 -1
  137. package/dist/esm/components/TUIManage/TUIManage.d.ts +4 -1
  138. package/dist/esm/components/TUIManage/TUIManage.js +1 -1
  139. package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
  140. package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
  141. package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
  142. package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
  143. package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
  144. package/dist/esm/components/TUIMessage/MessageFace.js +1 -1
  145. package/dist/esm/components/TUIMessage/MessageFile.js +1 -1
  146. package/dist/esm/components/TUIMessage/MessageImage.js +1 -1
  147. package/dist/esm/components/TUIMessage/MessageLocation.js +1 -1
  148. package/dist/esm/components/TUIMessage/MessageMerger.js +1 -1
  149. package/dist/esm/components/TUIMessage/MessageName.js +1 -1
  150. package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
  151. package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
  152. package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
  153. package/dist/esm/components/TUIMessage/MessageText.js +1 -1
  154. package/dist/esm/components/TUIMessage/MessageVideo.js +1 -1
  155. package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
  156. package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
  157. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  158. package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
  159. package/dist/esm/components/TUIMessage/utils/index.js +1 -1
  160. package/dist/esm/components/TUIMessageInput/EmojiPicker.js +1 -1
  161. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  162. package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  163. package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
  164. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  165. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  166. package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  167. package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  168. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
  169. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  170. package/dist/esm/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
  171. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
  172. package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  173. package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
  174. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
  175. package/dist/esm/components/TUIProfile/hooks/useMyProfile.js +1 -1
  176. package/dist/esm/components/Toast/index.js +1 -1
  177. package/dist/esm/context/ComponentContext.d.ts +3 -2
  178. package/dist/esm/context/TUIChatActionContext.d.ts +1 -1
  179. package/dist/esm/context/TUIChatStateContext.d.ts +4 -4
  180. package/dist/esm/context/TUIContactContext.js +1 -1
  181. package/dist/esm/context/TUIConversationContext.js +1 -1
  182. package/dist/esm/context/TUIKitContext.d.ts +1 -1
  183. package/dist/esm/context/TUIMessageContext.js +1 -1
  184. package/dist/esm/context/TUIMessageInputContext.js +1 -1
  185. package/dist/esm/hooks/useProfile.d.ts +1 -1
  186. package/dist/esm/index.css +1 -1
  187. package/dist/esm/index.d.css +3 -3
  188. package/dist/esm/index.d.ts +1 -1
  189. package/index.ts +1 -0
  190. package/package.json +7 -6
  191. package/rollup.config.js +2 -1
  192. package/src/components/Avatar/Avatar.tsx +7 -3
  193. package/src/components/Avatar/styles/index.scss +1 -1
  194. package/src/components/Checkbox/index.tsx +1 -1
  195. package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +14 -7
  196. package/src/components/ConversationCreate/ConversationCreate.tsx +5 -1
  197. package/src/components/ConversationCreate/ConversationCreateSelectView.tsx +2 -2
  198. package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +11 -10
  199. package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +14 -12
  200. package/src/components/ConversationPreview/ConversationPreview.tsx +3 -3
  201. package/src/components/ConversationPreview/ConversationPreviewContent.tsx +9 -5
  202. package/src/components/ConversationPreview/utils.tsx +6 -3
  203. package/src/components/DivWithEdit/DivWithEdit.tsx +6 -5
  204. package/src/components/DivWithEdit/WithText.tsx +3 -1
  205. package/src/components/DivWithEdit/styles/index.scss +1 -1
  206. package/src/components/Icon/Icon.tsx +2 -2
  207. package/src/components/Input/Input.tsx +15 -12
  208. package/src/components/Model/index.tsx +2 -2
  209. package/src/components/Plugins/index.tsx +15 -12
  210. package/src/components/Popup/index.tsx +13 -9
  211. package/src/components/Switch/Switch.tsx +5 -7
  212. package/src/components/TUIChat/TUIChat.tsx +20 -5
  213. package/src/components/TUIChat/TUIChatState.tsx +3 -3
  214. package/src/components/TUIChat/hooks/useHandleMessage.tsx +5 -5
  215. package/src/components/TUIChat/hooks/useHandleMessageList.tsx +2 -2
  216. package/src/components/TUIChat/unitls.ts +2 -2
  217. package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +1 -1
  218. package/src/components/TUIContact/TUIContactInfo/addFriendInfo.tsx +2 -2
  219. package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +1 -2
  220. package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +0 -10
  221. package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -3
  222. package/src/components/TUIContact/hooks/useTUIContact.tsx +3 -4
  223. package/src/components/TUIContactSearch/TUIContactSearch.tsx +6 -7
  224. package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +1 -3
  225. package/src/components/TUIConversationList/TUIConversationList.tsx +1 -1
  226. package/src/components/TUIConversationList/hooks/useConversationList.tsx +1 -1
  227. package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
  228. package/src/components/TUIKit/TUIKit.tsx +1 -1
  229. package/src/components/TUIKit/hooks/useTUIKit.tsx +4 -4
  230. package/src/components/TUIManage/TUIManage.tsx +20 -13
  231. package/src/components/TUIMessage/MessageAudio.tsx +8 -6
  232. package/src/components/TUIMessage/MessageAvatar.tsx +2 -2
  233. package/src/components/TUIMessage/MessageBubble.tsx +7 -5
  234. package/src/components/TUIMessage/MessageContext.tsx +3 -3
  235. package/src/components/TUIMessage/MessageCustom.tsx +5 -3
  236. package/src/components/TUIMessage/MessageFace.tsx +2 -2
  237. package/src/components/TUIMessage/MessageFile.tsx +5 -5
  238. package/src/components/TUIMessage/MessageImage.tsx +4 -2
  239. package/src/components/TUIMessage/MessageLocation.tsx +3 -3
  240. package/src/components/TUIMessage/MessageMerger.tsx +3 -3
  241. package/src/components/TUIMessage/MessageName.tsx +1 -1
  242. package/src/components/TUIMessage/MessagePlugins.tsx +12 -10
  243. package/src/components/TUIMessage/MessageProgress.tsx +5 -4
  244. package/src/components/TUIMessage/MessageRevoke.tsx +1 -1
  245. package/src/components/TUIMessage/MessageText.tsx +4 -4
  246. package/src/components/TUIMessage/MessageVideo.tsx +3 -3
  247. package/src/components/TUIMessage/TUIMessage.tsx +1 -1
  248. package/src/components/TUIMessage/TUIMessageDefault.tsx +3 -1
  249. package/src/components/TUIMessage/hooks/useMessageHandler.ts +13 -13
  250. package/src/components/TUIMessage/hooks/useMessageReply.ts +6 -4
  251. package/src/components/TUIMessage/utils/decodeText.ts +2 -3
  252. package/src/components/TUIMessage/utils/index.ts +1 -2
  253. package/src/components/TUIMessageInput/EmojiPicker.tsx +4 -4
  254. package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +8 -8
  255. package/src/components/TUIMessageInput/InputQuoteDefalut.tsx +4 -2
  256. package/src/components/TUIMessageInput/TUIForward.tsx +22 -15
  257. package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +15 -9
  258. package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +2 -2
  259. package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +4 -4
  260. package/src/components/TUIMessageInput/hooks/useHandleQuoteMessage.tsx +5 -5
  261. package/src/components/TUIMessageInput/hooks/useMessageInputState.tsx +3 -3
  262. package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +12 -9
  263. package/src/components/TUIMessageInput/hooks/useUploadElement.tsx +2 -2
  264. package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +1 -1
  265. package/src/components/TUIMessageList/TUIMessageList.tsx +5 -6
  266. package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +5 -2
  267. package/src/components/TUIProfile/TUIProfile.tsx +3 -1
  268. package/src/components/TUIProfile/TUIProfileDefault.tsx +15 -15
  269. package/src/components/TUIProfile/hooks/useMyProfile.tsx +6 -6
  270. package/src/components/Toast/index.tsx +3 -3
  271. package/src/components/Toast/styles/layout.scss +1 -1
  272. package/src/components/untils.ts +1 -1
  273. package/src/context/TUIChatStateContext.tsx +4 -4
  274. package/src/context/TUIContactContext.tsx +1 -1
  275. package/src/context/TUIConversationContext.tsx +2 -2
  276. package/src/context/TUIMessageContext.tsx +1 -1
  277. package/src/context/TUIMessageInputContext.tsx +1 -1
  278. package/src/hooks/useConversation.tsx +1 -1
  279. package/src/hooks/useProfile.tsx +2 -2
  280. package/tsconfig.json +1 -0
@@ -6,14 +6,12 @@ import { useTUIKitContext } from '../../../../context';
6
6
  function useContactInfo() {
7
7
  const { chat } = useTUIKitContext('useContactInfo');
8
8
 
9
- // 移除黑名单
10
9
  const removeFromBlocklist = useCallback((userID: string) => {
11
10
  chat.removeFromBlacklist({
12
11
  userIDList: [userID],
13
12
  });
14
13
  }, [chat]);
15
14
 
16
- // 添加好友
17
15
  const addFriend = useCallback((param: any) => {
18
16
  chat.addFriend({
19
17
  to: param?.userID,
@@ -29,14 +27,12 @@ function useContactInfo() {
29
27
  });
30
28
  }, [chat]);
31
29
 
32
- // 删除好友
33
30
  const deleteFriend = useCallback((userID: string) => {
34
31
  chat.deleteFriend({
35
32
  userIDList: [userID],
36
33
  });
37
34
  }, [chat]);
38
35
 
39
- // 添加黑名单
40
36
  const addToBlocklist = useCallback((userID: string) => {
41
37
  chat.addToBlacklist({
42
38
  userIDList: [userID],
@@ -55,8 +51,6 @@ function useContactInfo() {
55
51
  userID,
56
52
  });
57
53
  }, [chat]);
58
- // 好友相关
59
- // 判断是否为双向好友关系
60
54
  const isFriend = (info: any): Promise<boolean> => (
61
55
  new Promise((resolve, reject) => {
62
56
  chat.checkFriend({
@@ -65,19 +59,15 @@ function useContactInfo() {
65
59
  })
66
60
  .then((res: any) => {
67
61
  switch (res?.data?.successUserIDList[0]?.relation) {
68
- // 无好友关系:A 的好友表中没有 B,B 的好友表中也没有 A
69
62
  case TencentCloudChat.TYPES.SNS_TYPE_NO_RELATION:
70
63
  resolve(false);
71
64
  break;
72
- // 单项好友:A 的好友表中有 B,但 B 的好友表中没有 A
73
65
  case TencentCloudChat.TYPES.SNS_TYPE_A_WITH_B:
74
66
  resolve(false);
75
67
  break;
76
- // 单项好友:A 的好友表中没有 B,但 B 的好友表中有 A
77
68
  case TencentCloudChat.TYPES.SNS_TYPE_B_WITH_A:
78
69
  resolve(false);
79
70
  break;
80
- // 双向好友关系
81
71
  case TencentCloudChat.TYPES.SNS_TYPE_BOTH_WAY:
82
72
  resolve(true);
83
73
  break;
@@ -30,6 +30,8 @@ function UnMemoizedTUIContactList<T>(): React.ReactElement {
30
30
  acceptFriendApplication(userID);
31
31
  setActiveContact();
32
32
  };
33
+ // eslint-disable-next-line
34
+ // @ts-ignore
33
35
  return (
34
36
  isShowContactList && (
35
37
  <div className={`tui-contacts-list ${isH5 ? 'tui-contacts-list-h5' : ''} `}>
@@ -45,7 +47,7 @@ function UnMemoizedTUIContactList<T>(): React.ReactElement {
45
47
  </div>
46
48
  </div>
47
49
  {iShowFriendApplication
48
- && friendApplicationList.map((item, index) => {
50
+ && friendApplicationList?.map((item, index) => {
49
51
  const {
50
52
  userID, avatar, nick, wording, type,
51
53
  } = item;
@@ -106,7 +108,7 @@ function UnMemoizedTUIContactList<T>(): React.ReactElement {
106
108
  </div>
107
109
  </div>
108
110
  {isShowBlocklist
109
- && blocklistProfile.map((item, index) => {
111
+ && blocklistProfile?.map((item, index) => {
110
112
  const { userID, avatar, nick } = item;
111
113
  return (
112
114
  <div
@@ -137,7 +139,7 @@ function UnMemoizedTUIContactList<T>(): React.ReactElement {
137
139
  </div>
138
140
  </div>
139
141
  {iShowFriends
140
- && friendList.map((item, index) => {
142
+ && friendList?.map((item, index) => {
141
143
  const { userID, avatar, nick } = item.profile;
142
144
  return (
143
145
  <div
@@ -35,7 +35,6 @@ function useTUIContact() {
35
35
  setFriendList(data);
36
36
  }
37
37
  };
38
- // todo: 获取 100个
39
38
  const getBlocklist = async () => {
40
39
  const { data: _blocklist } = await chat.getBlacklist();
41
40
  if (_blocklist.length === 0) {
@@ -51,15 +50,15 @@ function useTUIContact() {
51
50
  });
52
51
  setBlocklistProfile(data);
53
52
  };
54
- const onFriendApplicationListUpdated = (event) => {
53
+ const onFriendApplicationListUpdated = (event: any) => {
55
54
  setFriendApplicationList(event?.data?.friendApplicationList);
56
55
  };
57
- const onBlocklistUpdated = (event) => {
56
+ const onBlocklistUpdated = (event: any) => {
58
57
  setBlockList(event.data);
59
58
  getBlocklistProfile(event.data);
60
59
  };
61
60
 
62
- const onFriendListUpdated = (event) => {
61
+ const onFriendListUpdated = (event: any) => {
63
62
  setFriendList(event.data);
64
63
  };
65
64
 
@@ -16,19 +16,19 @@ export function UnMemoizedTUIContactSearch<T>(): React.ReactElement {
16
16
  const [searchedValue, setSearchedValue] = useState('');
17
17
  const [searchResult, setSearchResult] = useState([]);
18
18
 
19
- const searchValueChange = (e) => {
19
+ const searchValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {
20
20
  if (e.target?.value === '') {
21
- setShowContactList(true);
21
+ setShowContactList && setShowContactList(true);
22
22
  setShowSearchResult(false);
23
23
  setSearchResult([]);
24
24
  return;
25
25
  }
26
26
  setShowSearchResult(true);
27
27
  setSearchedValue(e.target?.value);
28
- setShowContactList(false);
28
+ setShowContactList && setShowContactList(false);
29
29
  };
30
30
 
31
- const searchValueBlur = (e) => {
31
+ const searchValueBlur = (e: React.ChangeEvent<HTMLInputElement>) => {
32
32
  setSearchedValue(e.target?.value);
33
33
  };
34
34
 
@@ -47,15 +47,14 @@ export function UnMemoizedTUIContactSearch<T>(): React.ReactElement {
47
47
  const setContactProfile = async (profile: any) => {
48
48
  const isFriend = await checkFriend(profile);
49
49
  if (isFriend) {
50
- const friendProfile = friendList.find((item) => item.userID === searchedValue);
51
- setActiveContact({ type: 'friend', data: friendProfile });
50
+ const friendProfile = friendList?.find((item) => item.userID === searchedValue);
51
+ friendProfile && setActiveContact({ type: 'friend', data: friendProfile });
52
52
  return;
53
53
  }
54
54
  if (isBlock(profile.userID)) {
55
55
  setActiveContact({ type: 'block', data: profile });
56
56
  return;
57
57
  }
58
- // set 数据
59
58
  setActiveContact({ type: 'addFriend', data: profile });
60
59
  };
61
60
  return (
@@ -5,8 +5,6 @@ function useContactSearch() {
5
5
  const { blockList } = useTUIContactContext('TUIContactList');
6
6
  const { chat } = useTUIKitContext('TUIContactSearch');
7
7
 
8
- // 好友相关
9
- // 判断是否为双向好友关系
10
8
  const checkFriend = (info: any): Promise<any> => chat.checkFriend({
11
9
  userIDList: [info?.userID],
12
10
  type: TencentCloudChat.TYPES.SNS_CHECK_TYPE_BOTH,
@@ -14,7 +12,7 @@ function useContactSearch() {
14
12
  === TencentCloudChat.TYPES.SNS_TYPE_BOTH_WAY);
15
13
 
16
14
  const isBlock = (userID: string) => (
17
- blockList.includes(userID)
15
+ blockList?.includes(userID)
18
16
  );
19
17
  const getUserProfile = (userID: string) => (
20
18
  chat.getUserProfile({
@@ -82,7 +82,7 @@ export function UnMemoTUIConversationList<T extends Props>(props: T):React.React
82
82
  const [conversationCreated, setConversationCreated] = useState(false);
83
83
  const [activeConversationID, setActiveConversationID] = useState('');
84
84
 
85
- const handleSearchValueChange = (e) => {
85
+ const handleSearchValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {
86
86
  setSearchValue(e.target?.value);
87
87
  if (e.target?.value) {
88
88
  const result = conversationList.filter(
@@ -23,7 +23,7 @@ function useConversationList(
23
23
  resConversationList = filterConversation(res.data.conversationList);
24
24
  } else {
25
25
  resConversationList = res.data.conversationList.filter(
26
- (item) => item.type !== TencentCloudChat.TYPES.CONV_SYSTEM,
26
+ (item: any) => item.type !== TencentCloudChat.TYPES.CONV_SYSTEM,
27
27
  );
28
28
  }
29
29
  const newConversationList = queryType === 'reload'
@@ -19,7 +19,7 @@ export const useConversationUpdate = (
19
19
  setConversationList(filterConversation(event.data));
20
20
  } else {
21
21
  setConversationList(event.data.filter(
22
- (item) => item.type !== TencentCloudChat.TYPES.CONV_SYSTEM,
22
+ (item: any) => item.type !== TencentCloudChat.TYPES.CONV_SYSTEM,
23
23
  ));
24
24
  }
25
25
  }
@@ -27,7 +27,7 @@ export const useConversationUpdate = (
27
27
  forceUpdate();
28
28
  }
29
29
  if (customHandler && typeof customHandler === 'function') {
30
- customHandler(setConversationList, event);
30
+ setConversationList && customHandler(setConversationList, event);
31
31
  }
32
32
  };
33
33
  chat?.on(TencentCloudChat.EVENT.CONVERSATION_LIST_UPDATED, onConversationListUpdated);
@@ -22,7 +22,7 @@ import contacts from '../Icon/images/contacts.svg';
22
22
  import contactsSelected from '../Icon/images/contacts-selected.svg';
23
23
 
24
24
  export interface ChatProps {
25
- chat?: ChatSDK | null,
25
+ chat?: any,
26
26
  language?: string,
27
27
  customClasses?: unknown,
28
28
  activeConversation?: Conversation,
@@ -42,7 +42,7 @@ export const useTUIKit = ({
42
42
  language,
43
43
  }:UseChatParams) => {
44
44
  const { i18n } = useTranslation();
45
- const [conversation, setConversation] = useState<Conversation>(paramsActiveConversation);
45
+ const [conversation, setConversation] = useState<Conversation | undefined>(paramsActiveConversation);
46
46
  const [myProfile, setMyProfile] = useState<Profile>();
47
47
  const [TUIManageShow, setTUIManageShow] = useState<boolean>(false);
48
48
  const [TUIProfileShow, setTUIProfileShow] = useState<boolean>(false);
@@ -61,10 +61,10 @@ export const useTUIKit = ({
61
61
  if (activeConversation) {
62
62
  chat?.setMessageRead({ conversationID: activeConversation.conversationID });
63
63
  }
64
- if (conversation && (activeConversation.conversationID !== conversation.conversationID)) {
64
+ if (conversation && (activeConversation?.conversationID !== conversation.conversationID)) {
65
65
  setTUIManageShow(false);
66
66
  }
67
- setConversation(activeConversation);
67
+ activeConversation && setConversation(activeConversation);
68
68
  },
69
69
  [chat],
70
70
  );
@@ -73,7 +73,7 @@ export const useTUIKit = ({
73
73
  };
74
74
 
75
75
  useEffect(() => {
76
- setConversation(paramsActiveConversation);
76
+ paramsActiveConversation && setConversation(paramsActiveConversation);
77
77
  }, [paramsActiveConversation]);
78
78
  return {
79
79
  conversation,
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
+ import { Conversation} from '@tencentcloud/chat';
3
4
  import './styles/index.scss';
4
5
  import { Icon, IconTypes } from '../Icon';
5
6
  import { Avatar, defaultGroupAvatarWork, defaultUserAvatar } from '../Avatar';
@@ -10,11 +11,13 @@ import { getMessageProfile } from '../ConversationPreview/utils';
10
11
  import { useConversationUpdate } from '../TUIConversationList/hooks/useConversationUpdate';
11
12
  import { useConversation } from '../../hooks';
12
13
 
13
- export function TUIManage() {
14
+
15
+ function UnMemoizedTUIManage<T>(
16
+ ):React.ReactElement {
14
17
  const { t } = useTranslation();
15
- const [conversation, setConversation] = useState(null);
16
- const [profile, setProfile] = useState(null);
17
- const [isPinned, setIsPinned] = useState(false);
18
+ const [conversation, setConversation] = useState<Conversation>();
19
+ const [profile, setProfile] = useState<any>();
20
+ const [isPinned, setIsPinned] = useState<boolean>(false);
18
21
  const [forceUpdateCount, setForceUpdateCount] = useState(0);
19
22
  const {
20
23
  conversation: activeConversation,
@@ -23,30 +26,31 @@ export function TUIManage() {
23
26
  TUIManageShow,
24
27
  setTUIManageShow,
25
28
  } = useTUIKitContext('TUIManage');
26
- useConversationUpdate(null, () => {
29
+ useConversationUpdate(undefined, () => {
27
30
  setForceUpdateCount((count) => count + 1);
28
31
  });
29
32
  const { pinConversation, deleteConversation } = useConversation(chat);
30
- const pinChatChange = (e) => {
33
+ const pinChatChange = (e: React.ChangeEvent<HTMLInputElement>) => {
31
34
  setIsPinned(e.target.checked);
32
- pinConversation({
35
+ conversation?.conversationID && pinConversation({
33
36
  conversationID: conversation.conversationID,
34
37
  isPinned: e.target.checked,
35
38
  });
36
39
  };
37
40
  const handleDelete = () => {
38
- deleteConversation(conversation.conversationID);
39
- setActiveConversation(null);
41
+ conversation?.conversationID && deleteConversation(conversation.conversationID);
42
+ setActiveConversation(undefined);
40
43
  };
41
44
  const close = () => {
42
- setTUIManageShow(false);
45
+ setTUIManageShow && setTUIManageShow(false);
43
46
  };
44
47
  useEffect(() => {
45
48
  setConversation(activeConversation);
46
- setProfile(getMessageProfile(activeConversation));
49
+ activeConversation && setProfile(getMessageProfile(activeConversation));
47
50
  setIsPinned(activeConversation ? activeConversation.isPinned : false);
48
51
  }, [activeConversation, forceUpdateCount]);
49
-
52
+ // eslint-disable-next-line
53
+ // @ts-ignore
50
54
  return (
51
55
  TUIManageShow
52
56
  && activeConversation && (
@@ -91,7 +95,7 @@ export function TUIManage() {
91
95
  <div className="manage-handle-title">
92
96
  {t('TUIConversation.Pin')}
93
97
  </div>
94
- <Switch onChange={pinChatChange} checked={isPinned} />
98
+ <Switch onChange={(e: any)=> {pinChatChange(e)}} checked={isPinned} />
95
99
  </div>
96
100
  {isPC && (
97
101
  <div
@@ -110,3 +114,6 @@ export function TUIManage() {
110
114
  )
111
115
  );
112
116
  }
117
+
118
+ export const TUIManage = React.memo(UnMemoizedTUIManage) as unknown as
119
+ typeof UnMemoizedTUIManage;
@@ -24,7 +24,7 @@ function MessageAudioWithContext <T extends MessageContextProps>(
24
24
  if (audioSource && audioSource !== audioRef?.current) {
25
25
  audioSource.pause();
26
26
  audioSource.currentTime = 0;
27
- setAudioSource(null);
27
+ setAudioSource && setAudioSource(null);
28
28
  }
29
29
  if (audioRef?.current) {
30
30
  if (!audioRef.current.paused) {
@@ -33,7 +33,7 @@ function MessageAudioWithContext <T extends MessageContextProps>(
33
33
  } else {
34
34
  audioRef.current.play();
35
35
  setPlayClassName(true);
36
- setAudioSource(audioRef.current);
36
+ setAudioSource && setAudioSource(audioRef.current);
37
37
  }
38
38
  }
39
39
  }, [audioRef, audioSource]);
@@ -42,8 +42,10 @@ function MessageAudioWithContext <T extends MessageContextProps>(
42
42
  setPlayClassName(false);
43
43
  };
44
44
  const endFunction = () => {
45
- setAudioSource(null);
46
- audioRef.current.currentTime = 0;
45
+ setAudioSource && setAudioSource(null);
46
+ if(audioRef.current) {
47
+ audioRef.current.currentTime = 0
48
+ }
47
49
  pauseFunction();
48
50
  };
49
51
 
@@ -52,7 +54,7 @@ function MessageAudioWithContext <T extends MessageContextProps>(
52
54
  audioRef.current.addEventListener('pause', pauseFunction);
53
55
  audioRef.current.addEventListener('ended', endFunction);
54
56
  audioRef.current.addEventListener('canplay', () => {
55
- setCurrentTime(parseInt(`${audioRef.current.duration}`, 10));
57
+ setCurrentTime(parseInt(`${audioRef.current?.duration}`, 10));
56
58
  });
57
59
  }
58
60
  return () => {
@@ -65,7 +67,7 @@ function MessageAudioWithContext <T extends MessageContextProps>(
65
67
 
66
68
  return (
67
69
  <div className="message-audio">
68
- <div className={`message-audio-content message-audio-${message.flow}`}>
70
+ <div className={`message-audio-content message-audio-${message?.flow}`}>
69
71
  <Icon className={`${message?.flow} ${playClassName ? 'playing' : ''}`} type={IconTypes.VOICE} width={16} height={16} onClick={play} />
70
72
  <span>{`${currentTime}s`}</span>
71
73
  </div>
@@ -10,7 +10,7 @@ import { handleDisplayAvatar } from '../untils';
10
10
  export interface MessageAvatarProps {
11
11
  CustomAvatar?: React.ReactElement,
12
12
  className?: string,
13
- message?: Message,
13
+ message: Message,
14
14
  showType?: messageShowType,
15
15
  }
16
16
 
@@ -27,7 +27,7 @@ export function MessageAvatar <T extends MessageAvatarProps>(
27
27
  const show = showType === messageShowType.ALL || message?.flow === showType;
28
28
 
29
29
  if (!show || showType === messageShowType.NONE) {
30
- return null;
30
+ return <></>;
31
31
  }
32
32
 
33
33
  if (CustomAvatar) {
@@ -47,26 +47,28 @@ function MessageBubbleWithContext <T extends MessageBubbleProps>(
47
47
  ) && message?.status === MESSAGE_STATUS.UNSEND);
48
48
 
49
49
  const handleMouseEnter = () => {
50
- setActiveMessageID(message.ID);
50
+ setActiveMessageID && message && setActiveMessageID(message?.ID);
51
51
  setPluginsShow(true);
52
52
  };
53
53
  const handleMouseLeave = () => {
54
- setActiveMessageID(message.ID);
54
+ setActiveMessageID && message && setActiveMessageID(message.ID);
55
55
  setPluginsShow(false);
56
56
  };
57
57
 
58
58
  const activeMessage = () => {
59
- setActiveMessageID(message.ID);
59
+ setActiveMessageID && message && setActiveMessageID(message.ID);
60
60
  };
61
61
 
62
62
  useEffect(() => {
63
- if (activeMessageID !== message.ID) {
63
+ if (activeMessageID !== message?.ID) {
64
64
  setPluginsShow(false);
65
65
  }
66
66
  }, [activeMessageID]);
67
67
 
68
68
  const handleReplyMessage = () => {
69
- setHighlightedMessageId(replyMessage?.ID);
69
+ // eslint-disable-next-line
70
+ // @ts-ignore
71
+ setHighlightedMessageId && setHighlightedMessageId(replyMessage?.ID);
70
72
  };
71
73
 
72
74
  return (
@@ -15,7 +15,7 @@ import { useMessageContextHandler } from './hooks';
15
15
  import { MessageStatus } from './MessageStatus';
16
16
  import { useTUIMessageContext } from '../../context';
17
17
 
18
- const components = {
18
+ const components: any = {
19
19
  [TencentCloudChat.TYPES.MSG_TEXT]: MessageText,
20
20
  [TencentCloudChat.TYPES.MSG_FACE]: MessageFace,
21
21
  [TencentCloudChat.TYPES.MSG_IMAGE]: MessageImage,
@@ -51,7 +51,7 @@ function MessageContextWithContext <T extends MessageContextProps>(
51
51
  LocationElement,
52
52
  } = useTUIMessageContext('MessageCustom');
53
53
 
54
- const CustemComponents = {
54
+ const CustemComponents: any = {
55
55
  [TencentCloudChat.TYPES.MSG_TEXT]: TextElement,
56
56
  [TencentCloudChat.TYPES.MSG_FACE]: FaceElement,
57
57
  [TencentCloudChat.TYPES.MSG_IMAGE]: ImageElement,
@@ -63,7 +63,7 @@ function MessageContextWithContext <T extends MessageContextProps>(
63
63
  [TencentCloudChat.TYPES.MSG_LOCATION]: LocationElement,
64
64
  };
65
65
 
66
- const Elements = CustemComponents[message?.type] || components[message?.type];
66
+ const Elements = message?.type && (CustemComponents[message.type] || components[message.type]);
67
67
  return Elements
68
68
  && (
69
69
  <Elements context={context} message={message}>
@@ -15,11 +15,11 @@ function MessageCustomWithContext <T extends MessageContextProps>(
15
15
  } = props;
16
16
  const { t } = useTranslation();
17
17
  const { MessageCustomPlugins } = useComponentContext('MessageCustom');
18
- const handleContext = (data) => {
18
+ const handleContext = (data: any) => {
19
19
  if (data.data === 'Hyperlink') {
20
20
  const extension = JSONStringToParse(data?.extension);
21
21
  if (extension?.item) {
22
- return extension?.item.map((item) => <a target="_blank" key={item.value} href={item.value} rel="noreferrer">{item.value}</a>);
22
+ return extension?.item.map((item: any) => <a target="_blank" key={item.value} href={item.value} rel="noreferrer">{item.value}</a>);
23
23
  }
24
24
  if (extension?.hyperlinks_text) {
25
25
  const hyperlinks = extension.hyperlinks_text;
@@ -38,6 +38,8 @@ function MessageCustomWithContext <T extends MessageContextProps>(
38
38
  const botMessage = JSONStringToParse(data.data);
39
39
  if (botMessage?.chatbotPlugin === 1 && botMessage?.src === 15 && (botMessage?.subtype === 'welcome_msg' || botMessage?.subtype === 'clarify_msg')) {
40
40
  return (
41
+ // eslint-disable-next-line
42
+ // @ts-ignore
41
43
  <MessageCustomPlugins data={JSONStringToParse(data.data).content} />
42
44
  );
43
45
  }
@@ -45,7 +47,7 @@ function MessageCustomWithContext <T extends MessageContextProps>(
45
47
  };
46
48
 
47
49
  return (
48
- <div className={`bubble message-custom bubble-${message.flow} ${message?.conversationType === TencentCloudChat.TYPES.CONV_GROUP ? 'group' : ''}`}>
50
+ <div className={`bubble message-custom bubble-${message?.flow} ${message?.conversationType === TencentCloudChat.TYPES.CONV_GROUP ? 'group' : ''}`}>
49
51
  {handleContext(context?.custom)}
50
52
  {children}
51
53
  </div>
@@ -11,8 +11,8 @@ function MessageFaceWithContext <T extends MessageContextProps>(
11
11
  } = props;
12
12
 
13
13
  return (
14
- <div className={`bubble message-face bubble-${message.flow}`}>
15
- <img className="img" src={context.url} alt="" />
14
+ <div className={`bubble message-face bubble-${message?.flow}`}>
15
+ <img className="img" src={context?.url} alt="" />
16
16
  {children}
17
17
  </div>
18
18
  );
@@ -13,18 +13,18 @@ function MessageFileWithContext <T extends MessageContextProps>(
13
13
  } = props;
14
14
  return (
15
15
  <a
16
- href={context.url}
17
- download={context.name}
16
+ href={context?.url}
17
+ download={context?.name}
18
18
  target="_parent"
19
- className={`bubble message-file bubble-${message.flow} ${message?.conversationType === TencentCloudChat.TYPES.CONV_GROUP ? 'group' : ''}`}
19
+ className={`bubble message-file bubble-${message?.flow} ${message?.conversationType === TencentCloudChat.TYPES.CONV_GROUP ? 'group' : ''}`}
20
20
  rel="noreferrer"
21
21
  >
22
22
  <main className="message-file-main">
23
23
  <Icon className="icon" width={15} height={20} type={IconTypes.FILE} />
24
- <label htmlFor="message-file">{ context.name }</label>
24
+ <label htmlFor="message-file">{ context?.name }</label>
25
25
  </main>
26
26
  <div className="message-file-footer">
27
- <span className="message-file-size">{ context.size }</span>
27
+ <span className="message-file-size">{ context?.size }</span>
28
28
  {children}
29
29
  </div>
30
30
  </a>
@@ -15,12 +15,14 @@ function MessageImageWithContext <T extends MessageContextProps>(
15
15
 
16
16
  const [show, setShow] = useState(false);
17
17
 
18
- const bigImageInfo = message?.payload?.imageInfoArray?.filter((item) => item.type === 0);
18
+ const bigImageInfo = message?.payload?.imageInfoArray?.filter((item: any) => item.type === 0);
19
19
 
20
20
  return (
21
21
  <div className="message-image">
22
22
  <div role="button" tabIndex={0} onClick={() => { setShow(true); }}>
23
- <img className={`img ${isH5 ? 'img-h5' : ''} bubble-${message.flow} ${message?.conversationType === TencentCloudChat.TYPES.CONV_GROUP ? 'group' : ''}`} src={context.url} alt="" />
23
+ <img className={`img ${isH5 ? 'img-h5' : ''} bubble-${message?.flow}
24
+ ${message?.conversationType === TencentCloudChat.TYPES.CONV_GROUP ? 'group' : ''}`}
25
+ src={context?.url} alt="" />
24
26
  </div>
25
27
  {children}
26
28
  {
@@ -11,9 +11,9 @@ function MessageLocationWithContext <T extends MessageContextProps>(
11
11
  } = props;
12
12
 
13
13
  return (
14
- <a className="bubble message-location" href={context.href} target="_blank" title="点击查看详情" rel="noreferrer">
15
- <span>{context.description}</span>
16
- <img src={context.url} alt="" />
14
+ <a className="bubble message-location" href={context?.href} target="_blank" title="点击查看详情" rel="noreferrer">
15
+ <span>{context?.description}</span>
16
+ <img src={context?.url} alt="" />
17
17
  {children}
18
18
  </a>
19
19
  );
@@ -12,12 +12,12 @@ function MessageMergerWithContext <T extends MessageContextProps>(
12
12
  } = props;
13
13
 
14
14
  return (
15
- <div className={`bubble message-merger bubble-${message.flow} ${message?.conversationType === TencentCloudChat.TYPES.CONV_GROUP ? 'group' : ''}`}>
16
- <h3>{context.title}</h3>
15
+ <div className={`bubble message-merger bubble-${message?.flow} ${message?.conversationType === TencentCloudChat.TYPES.CONV_GROUP ? 'group' : ''}`}>
16
+ <h3>{context?.title}</h3>
17
17
  <ul className="message-merger-list">
18
18
  {
19
19
  context?.abstractList.length > 0
20
- && context.abstractList.map((item:string, index:number) => {
20
+ && context?.abstractList.map((item:string, index:number) => {
21
21
  const key = item + index;
22
22
  return (<li className="message-merger-item" key={key}>{item}</li>);
23
23
  })
@@ -26,7 +26,7 @@ export function MessageName <T extends MessageNameProps>(
26
26
  && message?.conversationType === TencentCloudChat.TYPES.CONV_GROUP;
27
27
 
28
28
  if (!show || showType === messageShowType.NONE) {
29
- return null;
29
+ return <></>;
30
30
  }
31
31
 
32
32
  if (CustomName) {