@tencentcloud/chat-uikit-react 2.2.5 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/.eslintrc.js +16 -12
  2. package/.lintstagedrc.json +1 -1
  3. package/CHANGELOG.md +8 -0
  4. package/dist/cjs/components/Avatar/Avatar.d.ts +4 -4
  5. package/dist/cjs/components/Checkbox/index.d.ts +2 -2
  6. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  7. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  8. package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  9. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  10. package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
  11. package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +8 -8
  12. package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
  13. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
  14. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  15. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
  16. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
  17. package/dist/cjs/components/Icon/Icon.d.ts +3 -3
  18. package/dist/cjs/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
  19. package/dist/cjs/components/Input/Input.d.ts +4 -4
  20. package/dist/cjs/components/Model/index.d.ts +2 -2
  21. package/dist/cjs/components/Plugins/index.d.ts +4 -4
  22. package/dist/cjs/components/Popup/index.d.ts +2 -2
  23. package/dist/cjs/components/Switch/Switch.d.ts +2 -2
  24. package/dist/cjs/components/TUIChat/TUIChat.d.ts +12 -12
  25. package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
  26. package/dist/cjs/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
  27. package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +1 -1
  28. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
  29. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  30. package/dist/cjs/components/TUIContact/TUIContact.d.ts +3 -3
  31. package/dist/cjs/components/TUIContact/TUIContact.js +1 -1
  32. package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
  33. package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
  34. package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
  35. package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
  36. package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
  37. package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  38. package/dist/cjs/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
  39. package/dist/cjs/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
  40. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
  41. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  42. package/dist/cjs/components/TUIContact/hooks/useTUIContact.js +1 -1
  43. package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
  44. package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  45. package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +2 -2
  46. package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +6 -6
  47. package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
  48. package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  49. package/dist/cjs/components/TUIManage/TUIManage.d.ts +2 -2
  50. package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
  51. package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
  52. package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
  53. package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
  54. package/dist/cjs/components/TUIMessage/MessageContext.d.ts +2 -2
  55. package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
  56. package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
  57. package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
  58. package/dist/cjs/components/TUIMessage/MessagePlugins.d.ts +4 -4
  59. package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
  60. package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
  61. package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
  62. package/dist/cjs/components/TUIMessage/MessageStatus.js +1 -1
  63. package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
  64. package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
  65. package/dist/cjs/components/TUIMessage/MessageTip.js +1 -1
  66. package/dist/cjs/components/TUIMessage/TUIMessage.d.ts +19 -19
  67. package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
  68. package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
  69. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  70. package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
  71. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
  72. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  73. package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  74. package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
  75. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
  76. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
  77. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
  78. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  79. package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  80. package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  81. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  82. package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
  83. package/dist/cjs/components/TUIMessageList/TUIMessageList.d.ts +2 -2
  84. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
  85. package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  86. package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +3 -3
  87. package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
  88. package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
  89. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
  90. package/dist/cjs/components/Toast/index.d.ts +2 -2
  91. package/dist/cjs/context/ComponentContext.d.ts +12 -12
  92. package/dist/cjs/context/LanguageContext.js +1 -0
  93. package/dist/cjs/context/TUIChatActionContext.d.ts +3 -3
  94. package/dist/cjs/context/TUIChatStateContext.d.ts +5 -5
  95. package/dist/cjs/context/TUIContactContext.d.ts +4 -4
  96. package/dist/cjs/context/TUIConversationContext.js +1 -1
  97. package/dist/cjs/context/TUIMessageContext.d.ts +17 -17
  98. package/dist/cjs/context/TUIMessageInputContext.d.ts +4 -4
  99. package/dist/cjs/context/ThemeContext.js +1 -0
  100. package/dist/cjs/context/UIKitContext.d.ts +25 -0
  101. package/dist/cjs/context/UIKitContext.js +1 -0
  102. package/dist/cjs/context/UIManagerContext.d.ts +46 -0
  103. package/dist/cjs/context/UIManagerContext.js +1 -0
  104. package/dist/cjs/hooks/useConversation.d.ts +2 -2
  105. package/dist/cjs/index.css +1 -2
  106. package/dist/cjs/index.d.css +908 -1440
  107. package/dist/cjs/index.d.ts +2 -4
  108. package/dist/cjs/index.js +1 -1
  109. package/dist/cjs/locales/en-US/TUIGlobal.js +1 -0
  110. package/dist/cjs/locales/en-US/index.js +1 -1
  111. package/dist/cjs/locales/ja-JP/TUIGlobal.js +1 -0
  112. package/dist/cjs/locales/ja-JP/index.js +1 -1
  113. package/dist/cjs/locales/ko-KR/TUIGlobal.js +1 -0
  114. package/dist/cjs/locales/ko-KR/index.js +1 -1
  115. package/dist/cjs/locales/zh-CN/TUIGlobal.js +1 -0
  116. package/dist/cjs/locales/zh-CN/index.js +1 -1
  117. package/dist/esm/components/Avatar/Avatar.d.ts +4 -4
  118. package/dist/esm/components/Checkbox/index.d.ts +2 -2
  119. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  120. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  121. package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  122. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  123. package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
  124. package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +8 -8
  125. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
  126. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
  127. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  128. package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
  129. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
  130. package/dist/esm/components/Icon/Icon.d.ts +3 -3
  131. package/dist/esm/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
  132. package/dist/esm/components/Input/Input.d.ts +4 -4
  133. package/dist/esm/components/Model/index.d.ts +2 -2
  134. package/dist/esm/components/Plugins/index.d.ts +4 -4
  135. package/dist/esm/components/Popup/index.d.ts +2 -2
  136. package/dist/esm/components/Switch/Switch.d.ts +2 -2
  137. package/dist/esm/components/TUIChat/TUIChat.d.ts +12 -12
  138. package/dist/esm/components/TUIChat/TUIChat.js +1 -1
  139. package/dist/esm/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
  140. package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +1 -1
  141. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
  142. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  143. package/dist/esm/components/TUIContact/TUIContact.d.ts +3 -3
  144. package/dist/esm/components/TUIContact/TUIContact.js +1 -1
  145. package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
  146. package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
  147. package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
  148. package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
  149. package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
  150. package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  151. package/dist/esm/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
  152. package/dist/esm/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
  153. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
  154. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  155. package/dist/esm/components/TUIContact/hooks/useTUIContact.js +1 -1
  156. package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
  157. package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  158. package/dist/esm/components/TUIConversation/TUIConversation.d.ts +2 -2
  159. package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +6 -6
  160. package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
  161. package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  162. package/dist/esm/components/TUIManage/TUIManage.d.ts +2 -2
  163. package/dist/esm/components/TUIManage/TUIManage.js +1 -1
  164. package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
  165. package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
  166. package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
  167. package/dist/esm/components/TUIMessage/MessageContext.d.ts +2 -2
  168. package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
  169. package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
  170. package/dist/esm/components/TUIMessage/MessageName.js +1 -1
  171. package/dist/esm/components/TUIMessage/MessagePlugins.d.ts +4 -4
  172. package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
  173. package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
  174. package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
  175. package/dist/esm/components/TUIMessage/MessageStatus.js +1 -1
  176. package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
  177. package/dist/esm/components/TUIMessage/MessageText.js +1 -1
  178. package/dist/esm/components/TUIMessage/MessageTip.js +1 -1
  179. package/dist/esm/components/TUIMessage/TUIMessage.d.ts +19 -19
  180. package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
  181. package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
  182. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  183. package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
  184. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
  185. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  186. package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  187. package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
  188. package/dist/esm/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
  189. package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
  190. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
  191. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  192. package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  193. package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  194. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  195. package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
  196. package/dist/esm/components/TUIMessageList/TUIMessageList.d.ts +2 -2
  197. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
  198. package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  199. package/dist/esm/components/TUIProfile/TUIProfile.d.ts +3 -3
  200. package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
  201. package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
  202. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
  203. package/dist/esm/components/Toast/index.d.ts +2 -2
  204. package/dist/esm/context/ComponentContext.d.ts +12 -12
  205. package/dist/esm/context/LanguageContext.js +1 -0
  206. package/dist/esm/context/TUIChatActionContext.d.ts +3 -3
  207. package/dist/esm/context/TUIChatStateContext.d.ts +5 -5
  208. package/dist/esm/context/TUIContactContext.d.ts +4 -4
  209. package/dist/esm/context/TUIConversationContext.js +1 -1
  210. package/dist/esm/context/TUIMessageContext.d.ts +17 -17
  211. package/dist/esm/context/TUIMessageInputContext.d.ts +4 -4
  212. package/dist/esm/context/ThemeContext.js +1 -0
  213. package/dist/esm/context/UIKitContext.d.ts +25 -0
  214. package/dist/esm/context/UIKitContext.js +1 -0
  215. package/dist/esm/context/UIManagerContext.d.ts +46 -0
  216. package/dist/esm/context/UIManagerContext.js +1 -0
  217. package/dist/esm/hooks/useConversation.d.ts +2 -2
  218. package/dist/esm/index.css +1 -2
  219. package/dist/esm/index.d.css +908 -1440
  220. package/dist/esm/index.d.ts +2 -4
  221. package/dist/esm/index.js +1 -1
  222. package/dist/esm/locales/en-US/TUIGlobal.js +1 -0
  223. package/dist/esm/locales/en-US/index.js +1 -1
  224. package/dist/esm/locales/ja-JP/TUIGlobal.js +1 -0
  225. package/dist/esm/locales/ja-JP/index.js +1 -1
  226. package/dist/esm/locales/ko-KR/TUIGlobal.js +1 -0
  227. package/dist/esm/locales/ko-KR/index.js +1 -1
  228. package/dist/esm/locales/zh-CN/TUIGlobal.js +1 -0
  229. package/dist/esm/locales/zh-CN/index.js +1 -1
  230. package/package.json +4 -3
  231. package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +4 -4
  232. package/src/components/ConversationCreate/ConversationCreate.tsx +2 -2
  233. package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +3 -2
  234. package/src/components/ConversationPreview/ConversationPreview.tsx +21 -21
  235. package/src/components/ConversationPreview/ConversationPreviewContent.tsx +3 -2
  236. package/src/components/Plugins/styles/color.scss +2 -2
  237. package/src/components/TUIChat/TUIChat.tsx +4 -3
  238. package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +3 -3
  239. package/src/components/TUIContact/TUIContact.tsx +2 -2
  240. package/src/components/TUIContact/TUIContactInfo/TUIContactInfo.tsx +2 -2
  241. package/src/components/TUIContact/TUIContactInfo/basicInfo.tsx +2 -2
  242. package/src/components/TUIContact/TUIContactInfo/blockInfo.tsx +2 -2
  243. package/src/components/TUIContact/TUIContactInfo/friendApplication.tsx +2 -2
  244. package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +4 -3
  245. package/src/components/TUIContact/TUIContactInfo/groupInfo.tsx +3 -3
  246. package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +2 -2
  247. package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -5
  248. package/src/components/TUIContact/hooks/useTUIContact.tsx +2 -2
  249. package/src/components/TUIContactSearch/TUIContactSearch.tsx +2 -2
  250. package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +2 -2
  251. package/src/components/TUIConversationList/TUIConversationList.tsx +3 -4
  252. package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
  253. package/src/components/TUIManage/TUIManage.tsx +3 -3
  254. package/src/components/TUIMessage/MessageStatus.tsx +2 -2
  255. package/src/components/TUIMessage/MessageText.tsx +16 -15
  256. package/src/components/TUIMessage/hooks/useMessageHandler.ts +2 -2
  257. package/src/components/TUIMessage/hooks/useMessageReply.ts +2 -2
  258. package/src/components/TUIMessageInput/TUIMessageInput.tsx +1 -1
  259. package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +2 -2
  260. package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +2 -2
  261. package/src/components/TUIMessageInput/styles/color.scss +2 -2
  262. package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +2 -2
  263. package/src/components/TUIProfile/TUIProfile.tsx +3 -3
  264. package/src/components/TUIProfile/TUIProfileDefault.tsx +2 -2
  265. package/src/components/index.ts +0 -1
  266. package/src/context/LanguageContext.tsx +59 -0
  267. package/src/context/ThemeContext.tsx +61 -0
  268. package/src/context/UIKitContext.tsx +67 -0
  269. package/src/context/UIManagerContext.tsx +163 -0
  270. package/src/context/index.ts +3 -2
  271. package/src/locales/en-US/index.ts +1 -1
  272. package/src/locales/ja-JP/index.ts +2 -0
  273. package/src/locales/ko-KR/TUIGlobal.ts +2 -2
  274. package/src/locales/ko-KR/index.ts +2 -0
  275. package/src/locales/zh-CN/index.ts +2 -2
  276. package/src/styles/colors/_color-theme.scss +1 -1
  277. package/dist/cjs/components/Icon/images/chats-selected.svg.js +0 -1
  278. package/dist/cjs/components/Icon/images/chats.svg.js +0 -1
  279. package/dist/cjs/components/Icon/images/contacts-selected.svg.js +0 -1
  280. package/dist/cjs/components/Icon/images/contacts.svg.js +0 -1
  281. package/dist/cjs/components/TUIKit/TUIKit.d.ts +0 -12
  282. package/dist/cjs/components/TUIKit/TUIKit.js +0 -1
  283. package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
  284. package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
  285. package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
  286. package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +0 -1
  287. package/dist/cjs/context/TUIKitContext.d.ts +0 -25
  288. package/dist/cjs/context/TUIKitContext.js +0 -1
  289. package/dist/esm/components/Icon/images/chats-selected.svg.js +0 -1
  290. package/dist/esm/components/Icon/images/chats.svg.js +0 -1
  291. package/dist/esm/components/Icon/images/contacts-selected.svg.js +0 -1
  292. package/dist/esm/components/Icon/images/contacts.svg.js +0 -1
  293. package/dist/esm/components/TUIKit/TUIKit.d.ts +0 -12
  294. package/dist/esm/components/TUIKit/TUIKit.js +0 -1
  295. package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
  296. package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
  297. package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
  298. package/dist/esm/components/TUIKit/hooks/useTUIKit.js +0 -1
  299. package/dist/esm/context/TUIKitContext.d.ts +0 -25
  300. package/dist/esm/context/TUIKitContext.js +0 -1
  301. package/src/components/TUIKit/TUIKit.tsx +0 -229
  302. package/src/components/TUIKit/hooks/useCreateTUIKitContext.tsx +0 -48
  303. package/src/components/TUIKit/hooks/useTUIKit.tsx +0 -99
  304. package/src/components/TUIKit/index.ts +0 -3
  305. package/src/components/TUIKit/styles/h5.scss +0 -34
  306. package/src/components/TUIKit/styles/index.scss +0 -132
  307. package/src/context/TUIKitContext.tsx +0 -44
@@ -1,17 +1,17 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
  import { Conversation } from '@tencentcloud/chat';
3
3
 
4
4
  interface TUIChatHeaderDefaultProps {
5
5
  title?: string;
6
- avatar?: React.ReactElement | string;
6
+ avatar?: React__default.ReactElement | string;
7
7
  isOnline?: boolean;
8
8
  conversation?: Conversation;
9
- pluginComponentList?: Array<React.ComponentType>;
9
+ pluginComponentList?: Array<React__default.ComponentType>;
10
10
  }
11
11
  interface TUIChatHeaderBasicProps extends TUIChatHeaderDefaultProps {
12
12
  isLive?: boolean;
13
- opateIcon?: React.ReactElement | string;
13
+ opateIcon?: React__default.ReactElement | string;
14
14
  }
15
- declare function TUIChatHeaderDefault(props: TUIChatHeaderBasicProps): React.ReactElement;
15
+ declare function TUIChatHeaderDefault(props: TUIChatHeaderBasicProps): React__default.ReactElement;
16
16
 
17
17
  export { TUIChatHeaderBasicProps, TUIChatHeaderDefault, TUIChatHeaderDefaultProps };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import a,{useState as o,useEffect as r}from"react";import n from"@tencentcloud/chat";import{TUIConversationService as c}from"@tencentcloud/chat-uikit-engine";import{Avatar as l}from"../Avatar/Avatar.js";import{handleDisplayAvatar as s}from"../untils.js";import{isH5 as m}from"../../utils/env.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as h}from"../Icon/type.js";import{useTUIKitContext as u}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function v(a){var v=a.title,p=void 0===v?"":v,f=a.avatar;a.isOnline;var C=a.conversation,S=a.isLive,N=a.opateIcon,T=u("TUIContact").setActiveContact,g=o(p),I=g[0],E=g[1],P=o(""),y=P[0],O=P[1];r((function(){switch(E(p),f&&O(f),null==C?void 0:C.type){case n.TYPES.CONV_C2C:Y(C.userProfile,null==C?void 0:C.remark);break;case n.TYPES.CONV_GROUP:j(C.groupProfile);break;case n.TYPES.CONV_SYSTEM:E("System Notice");break;default:E("")}}),[C]);var Y=function(e,i){I||E(i||(null==e?void 0:e.nick)||(null==e?void 0:e.userID)),f||O(t(l,{size:32,image:s(e.avatar)}))},j=function(e){I||E((null==e?void 0:e.name)||(null==e?void 0:e.groupID)),f||O(t(l,{size:32,image:s(e.avatar,n.TYPES.CONV_GROUP)}))},k=u().setTUIManageShow;return i("header",e({className:"tui-chat-header ".concat(S?"tui-chat-live-header":"")},{children:[m&&t("div",e({style:{paddingRight:"10px"}},{children:t(d,{onClick:function(){c.switchConversation(""),T()},type:h.BACK,width:9,height:16})})),t("div",e({className:"tui-chat-header-left ".concat((null==C?void 0:C.type)===n.TYPES.CONV_SYSTEM?"system":"")},{children:(null==C?void 0:C.type)!==n.TYPES.CONV_SYSTEM&&y})),t("div",e({className:"header-content"},{children:t("h3",e({className:"title"},{children:I}))})),t("div",e({className:"tui-chat-header-right"},{children:t("div",e({className:"header-handle"},{children:N||t(d,{className:"header-handle-more",onClick:function(){k&&k(!0)},type:h.ELLIPSE,width:18,height:5})}))}))]}),null==C?void 0:C.conversationID)}var p=a.memo(v);function f(i){var a=e({},i);return t(p,e({},a))}export{f as TUIChatHeaderDefault};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import r,{useState as o,useEffect as a}from"react";import n from"@tencentcloud/chat";import{TUIConversationService as c}from"@tencentcloud/chat-uikit-engine";import{Avatar as l}from"../Avatar/Avatar.js";import{handleDisplayAvatar as s}from"../untils.js";import{isH5 as m}from"../../utils/env.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as h}from"../Icon/type.js";import"@tencentcloud/tui-core";import"react-i18next";import{useUIManager as u}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";function v(r){var v=r.title,p=void 0===v?"":v,f=r.avatar;r.isOnline;var C=r.conversation,S=r.isLive,N=r.opateIcon,g=u().setActiveContact,E=o(p),I=E[0],P=E[1],T=o(""),y=T[0],O=T[1];a((function(){switch(P(p),f&&O(f),null==C?void 0:C.type){case n.TYPES.CONV_C2C:Y(C.userProfile,null==C?void 0:C.remark);break;case n.TYPES.CONV_GROUP:j(C.groupProfile);break;case n.TYPES.CONV_SYSTEM:P("System Notice");break;default:P("")}}),[C]);var Y=function(e,i){I||P(i||(null==e?void 0:e.nick)||(null==e?void 0:e.userID)),f||O(t(l,{size:32,image:s(e.avatar)}))},j=function(e){I||P((null==e?void 0:e.name)||(null==e?void 0:e.groupID)),f||O(t(l,{size:32,image:s(e.avatar,n.TYPES.CONV_GROUP)}))},k=u().setTUIManageShow;return i("header",e({className:"tui-chat-header ".concat(S?"tui-chat-live-header":"")},{children:[m&&t("div",e({style:{paddingRight:"10px"}},{children:t(d,{onClick:function(){c.switchConversation(""),g()},type:h.BACK,width:9,height:16})})),t("div",e({className:"tui-chat-header-left ".concat((null==C?void 0:C.type)===n.TYPES.CONV_SYSTEM?"system":"")},{children:(null==C?void 0:C.type)!==n.TYPES.CONV_SYSTEM&&y})),t("div",e({className:"header-content"},{children:t("h3",e({className:"title"},{children:I}))})),t("div",e({className:"tui-chat-header-right"},{children:t("div",e({className:"header-handle"},{children:N||t(d,{className:"header-handle-more",onClick:function(){k&&k(!0)},type:h.ELLIPSE,width:18,height:5})}))}))]}),null==C?void 0:C.conversationID)}var p=r.memo(v);function f(i){var r=e({},i);return t(p,e({},r))}export{f as TUIChatHeaderDefault};
@@ -1,6 +1,6 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import React__default, { PropsWithChildren } from 'react';
2
2
 
3
- declare function UnMemoizedTUIContact<T>(props: PropsWithChildren<T>): React.ReactElement;
4
- declare const TUIContact: React.MemoExoticComponent<typeof UnMemoizedTUIContact>;
3
+ declare function UnMemoizedTUIContact<T>(props: PropsWithChildren<T>): React__default.ReactElement;
4
+ declare const TUIContact: React__default.MemoExoticComponent<typeof UnMemoizedTUIContact>;
5
5
 
6
6
  export { TUIContact, UnMemoizedTUIContact };
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as i,jsxs as o,Fragment as c}from"react/jsx-runtime";import n,{useState as e,useMemo as r}from"react";import{useTranslation as s}from"react-i18next";import{TUIContactContextProvider as a}from"../../context/TUIContactContext.js";import{isH5 as m}from"../../utils/env.js";import{useTUIKitContext as d}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import l from"./hooks/useTUIContact.js";import{TUIContactList as h}from"./TUIContactList/TUIContactList.js";import{TUIContactSearch as f}from"../TUIContactSearch/TUIContactSearch.js";import{Icon as p}from"../Icon/Icon.js";import{IconTypes as C}from"../Icon/type.js";function u(n){var u=n.children,I=s().t,L=d("TUIContact").setActiveContact,j=e(!1),v=j[0],T=j[1],U=l(),x=U.friendList,k=U.blockList,w=U.blocklistProfile,A=U.friendApplicationList,N=U.isShowContactList,S=U.setShowContactList,b=r((function(){return{friendList:x,blockList:k,blocklistProfile:w,friendApplicationList:A,isShowContactList:N,setShowContactList:S}}),[x,w,A,N,S]);return i(a,t({value:b},{children:u||o("div",t({className:"tui-contacts ".concat(m?"tui-contacts-h5":""," ")},{children:[!v&&o(c,{children:[o("div",t({className:"tui-contacts-header"},{children:[i("div",t({className:"tui-contact-input"},{children:i(f,{})})),i(p,{onClick:function(){L(),T(!0)},type:C.ADDFRIEND,width:24,height:24})]})),i(h,{})]}),v&&o(c,{children:[o("div",t({className:"tui-contacts-add-header"},{children:[i(p,{onClick:function(){L(),T(!1)},type:C.BACK,width:9,height:16}),i("div",t({className:"tui-contacts-add-header-title"},{children:I("TUIContact.Add Friend")}))]})),i(f,{})]})]}))}))}var I=n.memo(u);export{I as TUIContact,u as UnMemoizedTUIContact};
1
+ import{__assign as t}from"tslib";import{jsx as i,jsxs as o,Fragment as c}from"react/jsx-runtime";import e,{useState as n,useMemo as r}from"react";import{useTranslation as s}from"react-i18next";import{TUIContactContextProvider as a}from"../../context/TUIContactContext.js";import{isH5 as m}from"../../utils/env.js";import"@tencentcloud/tui-core";import{useUIManager as d}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";import l from"./hooks/useTUIContact.js";import{TUIContactList as h}from"./TUIContactList/TUIContactList.js";import{TUIContactSearch as p}from"../TUIContactSearch/TUIContactSearch.js";import{Icon as f}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";function C(e){var C=e.children,I=s().t,L=d().setActiveContact,j=n(!1),v=j[0],x=j[1],U=l(),T=U.friendList,k=U.blockList,w=U.blocklistProfile,A=U.friendApplicationList,N=U.isShowContactList,S=U.setShowContactList,b=r((function(){return{friendList:T,blockList:k,blocklistProfile:w,friendApplicationList:A,isShowContactList:N,setShowContactList:S}}),[T,w,A,N,S]);return i(a,t({value:b},{children:C||o("div",t({className:"tui-contacts ".concat(m?"tui-contacts-h5":""," ")},{children:[!v&&o(c,{children:[o("div",t({className:"tui-contacts-header"},{children:[i("div",t({className:"tui-contact-input"},{children:i(p,{})})),i(f,{onClick:function(){L(),x(!0)},type:u.ADDFRIEND,width:24,height:24})]})),i(h,{})]}),v&&o(c,{children:[o("div",t({className:"tui-contacts-add-header"},{children:[i(f,{onClick:function(){L(),x(!1)},type:u.BACK,width:9,height:16}),i("div",t({className:"tui-contacts-add-header-title"},{children:I("TUIContact.Add Friend")}))]})),i(p,{})]})]}))}))}var I=e.memo(C);export{I as TUIContact,C as UnMemoizedTUIContact};
@@ -1,10 +1,10 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import React__default, { PropsWithChildren } from 'react';
2
2
 
3
3
  interface TUIContactInfoProps {
4
4
  className?: string;
5
5
  showChats?: () => void;
6
6
  }
7
- declare function UnMemoizedTUIContactInfo<T extends TUIContactInfoProps>(props: PropsWithChildren<T>): React.ReactElement;
8
- declare const TUIContactInfo: React.MemoExoticComponent<typeof UnMemoizedTUIContactInfo>;
7
+ declare function UnMemoizedTUIContactInfo<T extends TUIContactInfoProps>(props: PropsWithChildren<T>): React__default.ReactElement;
8
+ declare const TUIContactInfo: React__default.MemoExoticComponent<typeof UnMemoizedTUIContactInfo>;
9
9
 
10
10
  export { TUIContactInfo, UnMemoizedTUIContactInfo };
@@ -1 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as t,Fragment as i,jsxs as n}from"react/jsx-runtime";import r from"react";import{useTUIKitContext as l}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{isH5 as a}from"../../../utils/env.js";import{FriendInfo as e}from"./friendInfo.js";import{BlockInfo as d}from"./blockInfo.js";import{AddFriendInfo as p}from"./addFriendInfo.js";import{GroupInfo as m}from"./groupInfo.js";import{FriendApplicationInfo as f}from"./friendApplication.js";function c(r){var c=r.showChats,s=l("TUIContact").contactData;return(null==s?void 0:s.type)?n("div",o({className:"tui-contact-info ".concat(a?"tui-contact-info-h5":""," ")},{children:["addFriend"===(null==s?void 0:s.type)&&t(p,{profile:null==s?void 0:s.data}),"friend"===(null==s?void 0:s.type)&&t(e,{showChats:c,friend:null==s?void 0:s.data}),"block"===(null==s?void 0:s.type)&&t(d,{profile:null==s?void 0:s.data}),"group"===(null==s?void 0:s.type)&&t(m,{showChats:c,group:null==s?void 0:s.data}),"friendApplication"===(null==s?void 0:s.type)&&t(f,{application:null==s?void 0:s.data})]})):t(i,{children:" "})}var s=r.memo(c);export{s as TUIContactInfo,c as UnMemoizedTUIContactInfo};
1
+ import{__assign as o}from"tslib";import{jsx as t,Fragment as i,jsxs as r}from"react/jsx-runtime";import n from"react";import"@tencentcloud/tui-core";import"react-i18next";import{useUIManager as e}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{isH5 as a}from"../../../utils/env.js";import{FriendInfo as l}from"./friendInfo.js";import{BlockInfo as d}from"./blockInfo.js";import{AddFriendInfo as p}from"./addFriendInfo.js";import{GroupInfo as m}from"./groupInfo.js";import{FriendApplicationInfo as c}from"./friendApplication.js";function f(n){var f=n.showChats,u=e().contactData;return(null==u?void 0:u.type)?r("div",o({className:"tui-contact-info ".concat(a?"tui-contact-info-h5":""," ")},{children:["addFriend"===(null==u?void 0:u.type)&&t(p,{profile:null==u?void 0:u.data}),"friend"===(null==u?void 0:u.type)&&t(l,{showChats:f,friend:null==u?void 0:u.data}),"block"===(null==u?void 0:u.type)&&t(d,{profile:null==u?void 0:u.data}),"group"===(null==u?void 0:u.type)&&t(m,{showChats:f,group:null==u?void 0:u.data}),"friendApplication"===(null==u?void 0:u.type)&&t(c,{application:null==u?void 0:u.data})]})):t(i,{children:" "})}var u=n.memo(f);export{u as TUIContactInfo,f as UnMemoizedTUIContactInfo};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import a from"react";import{useTranslation as i}from"react-i18next";import{TUIConversationService as o}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as n}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{Icon as c}from"../../Icon/Icon.js";import{IconTypes as m}from"../../Icon/type.js";import{isH5 as s}from"../../../utils/env.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as l}from"../../Avatar/default.js";function f(a){var f=a.profile,h=i().t,p=f.userID,v=f.nick,u=f.selfSignature,x=f.avatar,I=n("TUIContact").setActiveContact;return e("div",t({className:"tui-contact-info-header"},{children:[s&&r(c,{width:9,height:16,type:m.BACK,onClick:function(){o.switchConversation(""),I()}}),e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[r(d,{size:60,image:x||l}),r("div",t({className:"header-container-name"},{children:v||p}))]})),r("div",t({className:"header-container-text"},{children:"ID:".concat(p)})),e("div",t({className:"header-container-text"},{children:[h("TUIContact.Signature"),":",u||""]}))]}))]}))}var h=a.memo(f);export{h as BasicInfo,f as UnMemoizedBasicInfo};
1
+ import{__assign as t}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import a from"react";import{useTranslation as i}from"react-i18next";import{TUIConversationService as o}from"@tencentcloud/chat-uikit-engine";import"@tencentcloud/tui-core";import{useUIManager as n}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{Icon as c}from"../../Icon/Icon.js";import{IconTypes as m}from"../../Icon/type.js";import{isH5 as s}from"../../../utils/env.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as l}from"../../Avatar/default.js";function f(a){var f=a.profile,h=i().t,p=f.userID,v=f.nick,u=f.selfSignature,x=f.avatar,j=n().setActiveContact;return e("div",t({className:"tui-contact-info-header"},{children:[s&&r(c,{width:9,height:16,type:m.BACK,onClick:function(){o.switchConversation(""),j()}}),e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[r(d,{size:60,image:x||l}),r("div",t({className:"header-container-name"},{children:v||p}))]})),r("div",t({className:"header-container-text"},{children:"ID:".concat(p)})),e("div",t({className:"header-container-text"},{children:[h("TUIContact.Signature"),":",u||""]}))]}))]}))}var h=a.memo(f);export{h as BasicInfo,f as UnMemoizedBasicInfo};
@@ -1 +1 @@
1
- import{__assign as t,__awaiter as o,__generator as e}from"tslib";import{jsxs as n,Fragment as r,jsx as c}from"react/jsx-runtime";import i,{useState as m,useEffect as s}from"react";import{useTranslation as a}from"react-i18next";import{useTUIKitContext as f}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as l}from"./basicInfo.js";import{Switch as u}from"../../Switch/Switch.js";import p from"./hooks/useContactInfo.js";function h(i){var h=this,d=i.profile,v=f("TUIContact"),x=v.contactData,C=v.setActiveContact,I=a().t,j=m(!1),b=j[0],k=j[1],N=p().removeFromBlocklist;s((function(){k(!0)}),[x]);return n(r,{children:[c(l,{profile:d}),c("div",t({className:"tui-contact-info-content"},{children:n("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:I("TUIContact.block")})),c(u,{className:"content-item-text",onChange:function(){return o(h,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,N(d.userID)];case 1:return t.sent(),k(!1),C(),[2]}}))}))},checked:b})]}))}))]})}var d=i.memo(h);export{d as BlockInfo,h as UnMemoizedBlockInfo};
1
+ import{__assign as t,__awaiter as e,__generator as o}from"tslib";import{jsxs as n,Fragment as r,jsx as c}from"react/jsx-runtime";import i,{useState as m,useEffect as a}from"react";import{useTranslation as s}from"react-i18next";import"@tencentcloud/tui-core";import{useUIManager as l}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as f}from"./basicInfo.js";import{Switch as u}from"../../Switch/Switch.js";import p from"./hooks/useContactInfo.js";function h(i){var h=this,d=i.profile,v=l(),x=v.contactData,j=v.setActiveContact,C=s().t,I=m(!1),b=I[0],k=I[1],N=p().removeFromBlocklist;a((function(){k(!0)}),[x]);return n(r,{children:[c(f,{profile:d}),c("div",t({className:"tui-contact-info-content"},{children:n("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:C("TUIContact.block")})),c(u,{className:"content-item-text",onChange:function(){return e(h,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,N(d.userID)];case 1:return t.sent(),k(!1),j(),[2]}}))}))},checked:b})]}))}))]})}var d=i.memo(h);export{d as BlockInfo,h as UnMemoizedBlockInfo};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as e,Fragment as n,jsx as i}from"react/jsx-runtime";import a from"react";import{useTranslation as c}from"react-i18next";import o from"@tencentcloud/chat";import{useTUIKitContext as r}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{Avatar as m}from"../../Avatar/Avatar.js";import{defaultUserAvatar as s}from"../../Avatar/default.js";import l from"./hooks/useContactInfo.js";function d(a){var d=r("TUIContact").setActiveContact,f=c().t,h=a.application,p=h.userID,v=h.nick,u=h.avatar,N=h.type,I=h.wording,b=l(),x=b.acceptFriendApplication,C=b.refuseFriendApplication;return e(n,{children:[i("div",t({className:"tui-contact-info-header"},{children:e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[i(m,{size:60,image:u||s}),i("div",t({className:"header-container-name"},{children:v||p}))]})),i("div",t({className:"header-container-text"},{children:"ID:".concat(p)}))]}))})),i("div",t({className:"tui-contact-info-content"},{children:e("div",t({className:"content-item"},{children:[i("p",t({className:"content-item-label"},{children:f("TUIContact.verification info")})),i("p",t({className:"content-item-text"},{children:I}))]}))})),N===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&i("div",t({className:"tui-contact-info-content"},{children:e("div",t({className:"content-btn-container"},{children:[i("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){d(),C(p)}},{children:f("TUIContact.Refuse")})),i("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){d(),x(p)}},{children:f("TUIContact.Agree")}))]}))}))]})}var f=a.memo(d);export{f as FriendApplicationInfo,d as UnMemoizedFriendApplication};
1
+ import{__assign as t}from"tslib";import{jsxs as e,Fragment as n,jsx as i}from"react/jsx-runtime";import a from"react";import{useTranslation as c}from"react-i18next";import o from"@tencentcloud/chat";import"@tencentcloud/tui-core";import{useUIManager as r}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{Avatar as m}from"../../Avatar/Avatar.js";import{defaultUserAvatar as s}from"../../Avatar/default.js";import l from"./hooks/useContactInfo.js";function d(a){var d=r().setActiveContact,f=c().t,p=a.application,h=p.userID,v=p.nick,u=p.avatar,N=p.type,I=p.wording,b=l(),x=b.acceptFriendApplication,C=b.refuseFriendApplication;return e(n,{children:[i("div",t({className:"tui-contact-info-header"},{children:e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[i(m,{size:60,image:u||s}),i("div",t({className:"header-container-name"},{children:v||h}))]})),i("div",t({className:"header-container-text"},{children:"ID:".concat(h)}))]}))})),i("div",t({className:"tui-contact-info-content"},{children:e("div",t({className:"content-item"},{children:[i("p",t({className:"content-item-label"},{children:f("TUIContact.verification info")})),i("p",t({className:"content-item-text"},{children:I}))]}))})),N===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&i("div",t({className:"tui-contact-info-content"},{children:e("div",t({className:"content-btn-container"},{children:[i("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){d(),C(h)}},{children:f("TUIContact.Refuse")})),i("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){d(),x(h)}},{children:f("TUIContact.Agree")}))]}))}))]})}var f=a.memo(d);export{f as FriendApplicationInfo,d as UnMemoizedFriendApplication};
@@ -1 +1 @@
1
- import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as c}from"react/jsx-runtime";import r,{useState as a,useEffect as s}from"react";import{useTranslation as m}from"react-i18next";import{TUIConversationService as l}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as d}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as u}from"./basicInfo.js";import{Switch as f}from"../../Switch/Switch.js";import h from"./hooks/useContactInfo.js";import{DivWithEdit as v}from"../../DivWithEdit/DivWithEdit.js";function p(r){var p=this,C=d("TUIContact"),b=C.chat,k=C.contactData,I=C.setActiveContact,x=C.setActiveConversation,N=m().t,T=r.friend,g=r.showChats,j=T.userID,U=T.profile,w=T.remark,D=a(""),E=D[0],S=D[1],A=a(""),F=A[0],M=A[1],W=a(!1),y=W[0],B=W[1],K=h(),q=K.addToBlocklist,z=K.deleteFriend;s((function(){B(!1),M(w)}),[k,w]);return i(o,{children:[c(u,{profile:U}),i("div",t({className:"tui-contact-info-content"},{children:[i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:N("TUIContact.remark")})),c(v,{name:"remark",className:"content-item-text",value:F,type:"text",toggle:function(){S("remark")},isEdit:"remark"===E,confirm:function(t){b.updateFriend({userID:j,remark:null==t?void 0:t.value}),M(null==t?void 0:t.value),S("")},close:function(){S("")}})]})),i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:N("TUIContact.block")})),c(f,{className:"content-item-text",onChange:function(){return e(p,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,q(j)];case 1:return t.sent(),B(!0),I(),[2]}}))}))},checked:y})]})),i("div",t({className:"content-btn-container"},{children:[c("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){return e(p,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(j)];case 1:return t.sent(),I(),[2]}}))}))}},{children:N("TUIContact.Delete friend")})),c("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){var t="C2C".concat(j);g&&g(),l.switchConversation(t).then((function(t){x(t.getConversation())}))}},{children:N("TUIContact.Send Message")}))]}))]}))]})}var C=r.memo(p);export{C as FriendInfo,p as UnMemoizedFriendInfo};
1
+ import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as o,Fragment as i,jsx as r}from"react/jsx-runtime";import c,{useState as a,useEffect as s}from"react";import{useTranslation as m}from"react-i18next";import{TUIConversationService as l}from"@tencentcloud/chat-uikit-engine";import{useUIKit as d}from"../../../context/UIKitContext.js";import{useUIManager as u}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as f}from"./basicInfo.js";import{Switch as h}from"../../Switch/Switch.js";import v from"./hooks/useContactInfo.js";import{DivWithEdit as p}from"../../DivWithEdit/DivWithEdit.js";function C(c){var C=this,b=d().chat,x=u(),k=x.contactData,I=x.setActiveContact,N=x.setActiveConversation,g=m().t,j=c.friend,U=c.showChats,w=j.userID,D=j.profile,T=j.remark,E=a(""),M=E[0],S=E[1],A=a(""),F=A[0],W=A[1],y=a(!1),B=y[0],K=y[1],q=v(),z=q.addToBlocklist,G=q.deleteFriend;s((function(){K(!1),W(T)}),[k,T]);return o(i,{children:[r(f,{profile:D}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:g("TUIContact.remark")})),r(p,{name:"remark",className:"content-item-text",value:F,type:"text",toggle:function(){S("remark")},isEdit:"remark"===M,confirm:function(t){b.updateFriend({userID:w,remark:null==t?void 0:t.value}),W(null==t?void 0:t.value),S("")},close:function(){S("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:g("TUIContact.block")})),r(h,{className:"content-item-text",onChange:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(w)];case 1:return t.sent(),K(!0),I(),[2]}}))}))},checked:B})]})),o("div",t({className:"content-btn-container"},{children:[r("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,G(w)];case 1:return t.sent(),I(),[2]}}))}))}},{children:g("TUIContact.Delete friend")})),r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){var t="C2C".concat(w);U&&U(),l.switchConversation(t).then((function(t){N(t.getConversation())}))}},{children:g("TUIContact.Send Message")}))]}))]}))]})}var b=c.memo(C);export{b as FriendInfo,C as UnMemoizedFriendInfo};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as e,Fragment as n,jsx as o}from"react/jsx-runtime";import i from"react";import{useTranslation as r}from"react-i18next";import{TUIConversationService as a}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as c}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{Icon as s}from"../../Icon/Icon.js";import{IconTypes as m}from"../../Icon/type.js";import{isH5 as d}from"../../../utils/env.js";import{Avatar as l}from"../../Avatar/Avatar.js";import{defaultUserAvatar as h}from"../../Avatar/default.js";function v(i){var v=i.group,f=i.showChats,p=c("TUIContact"),u=p.setActiveContact,C=p.setActiveConversation,I=r().t,g=v.groupID,x=v.name,j=v.avatar;return e(n,{children:[e("div",t({className:"tui-contact-info-header"},{children:[d&&o(s,{width:9,height:16,type:m.BACK,onClick:function(){a.switchConversation(""),u()}}),e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[o(l,{size:60,image:j||h}),o("div",t({className:"header-container-name"},{children:x||g}))]})),o("div",t({className:"header-container-text"},{children:"groupID:".concat(g)}))]}))]})),o("div",t({className:"tui-contact-info-content"},{children:o("div",t({className:"content-btn-container"},{children:o("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){var t="GROUP".concat(g);f&&f(),a.switchConversation(t).then((function(t){C(t.getConversation())}))}},{children:I("TUIContact.Send Message")}))}))}))]})}var f=i.memo(v);export{f as GroupInfo,v as UnMemoizedGroupInfo};
1
+ import{__assign as t}from"tslib";import{jsxs as e,Fragment as n,jsx as o}from"react/jsx-runtime";import r from"react";import{useTranslation as i}from"react-i18next";import{TUIConversationService as a}from"@tencentcloud/chat-uikit-engine";import"@tencentcloud/tui-core";import{useUIManager as c}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{Icon as s}from"../../Icon/Icon.js";import{IconTypes as m}from"../../Icon/type.js";import{isH5 as d}from"../../../utils/env.js";import{Avatar as l}from"../../Avatar/Avatar.js";import{defaultUserAvatar as h}from"../../Avatar/default.js";function v(r){var v=r.group,f=r.showChats,p=c(),u=p.setActiveContact,C=p.setActiveConversation,g=i().t,x=v.groupID,I=v.name,j=v.avatar;return e(n,{children:[e("div",t({className:"tui-contact-info-header"},{children:[d&&o(s,{width:9,height:16,type:m.BACK,onClick:function(){a.switchConversation(""),u()}}),e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[o(l,{size:60,image:j||h}),o("div",t({className:"header-container-name"},{children:I||x}))]})),o("div",t({className:"header-container-text"},{children:"groupID:".concat(x)}))]}))]})),o("div",t({className:"tui-contact-info-content"},{children:o("div",t({className:"content-btn-container"},{children:o("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){var t="GROUP".concat(x);f&&f(),a.switchConversation(t).then((function(t){C(t.getConversation())}))}},{children:g("TUIContact.Send Message")}))}))}))]})}var f=r.memo(v);export{f as GroupInfo,v as UnMemoizedGroupInfo};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from"tslib";import{useCallback as n}from"react";import i from"@tencentcloud/chat";import{Toast as r}from"../../../Toast/index.js";import{useTUIKitContext as o}from"../../../../context/TUIKitContext.js";import"react/jsx-runtime";import"../../../../context/TUIMessageContext.js";function c(){var c=this,s=o("useContactInfo").chat,u=n((function(e){s.removeFromBlacklist({userIDList:[e]})}),[s]),a=n((function(e){s.addFriend({to:null==e?void 0:e.userID,source:"AddSource_Type_Web",remark:null==e?void 0:e.remark,wording:null==e?void 0:e.wording}).catch((function(e){console.warn("delete friend failed:",e),r({text:e,type:"error"})}))}),[s]),d=n((function(e){s.deleteFriend({userIDList:[e]})}),[s]);return{addToBlocklist:n((function(e){s.addToBlacklist({userIDList:[e]})}),[s]),removeFromBlocklist:u,isFriend:function(e){return new Promise((function(t,n){s.checkFriend({userIDList:[null==e?void 0:e.userID],type:i.TYPES.SNS_CHECK_TYPE_BOTH}).then((function(e){var n,r;switch(null===(r=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.successUserIDList[0])||void 0===r?void 0:r.relation){case i.TYPES.SNS_TYPE_NO_RELATION:case i.TYPES.SNS_TYPE_A_WITH_B:case i.TYPES.SNS_TYPE_B_WITH_A:t(!1);break;case i.TYPES.SNS_TYPE_BOTH_WAY:t(!0);break;default:t(!1)}})).catch((function(e){console.warn("checkFriend error",e),n(e)}))}))},isBlock:function(n){return e(c,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,s.getBlacklist()];case 1:return[2,e.sent().data.includes(n)]}}))}))},addFriend:a,deleteFriend:d,acceptFriendApplication:n((function(e){s.acceptFriendApplication({userID:e,type:i.TYPES.SNS_APPLICATION_AGREE_AND_ADD})}),[s]),refuseFriendApplication:n((function(e){s.refuseFriendApplication({userID:e})}),[s])}}export{c as default};
1
+ import{__awaiter as e,__generator as t}from"tslib";import{useCallback as i}from"react";import n from"@tencentcloud/chat";import{Toast as r}from"../../../Toast/index.js";import{useUIKit as o}from"../../../../context/UIKitContext.js";import"react/jsx-runtime";import"@tencentcloud/chat-uikit-engine";import"../../../../context/TUIMessageContext.js";function c(){var c=this,s=o().chat,u=i((function(e){s.removeFromBlacklist({userIDList:[e]})}),[s]),d=i((function(e){s.addFriend({to:null==e?void 0:e.userID,source:"AddSource_Type_Web",remark:null==e?void 0:e.remark,wording:null==e?void 0:e.wording}).catch((function(e){console.warn("delete friend failed:",e),r({text:e,type:"error"})}))}),[s]),a=i((function(e){s.deleteFriend({userIDList:[e]})}),[s]);return{addToBlocklist:i((function(e){s.addToBlacklist({userIDList:[e]})}),[s]),removeFromBlocklist:u,isFriend:function(e){return new Promise((function(t,i){s.checkFriend({userIDList:[null==e?void 0:e.userID],type:n.TYPES.SNS_CHECK_TYPE_BOTH}).then((function(e){var i,r;switch(null===(r=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.successUserIDList[0])||void 0===r?void 0:r.relation){case n.TYPES.SNS_TYPE_NO_RELATION:case n.TYPES.SNS_TYPE_A_WITH_B:case n.TYPES.SNS_TYPE_B_WITH_A:t(!1);break;case n.TYPES.SNS_TYPE_BOTH_WAY:t(!0);break;default:t(!1)}})).catch((function(e){console.warn("checkFriend error",e),i(e)}))}))},isBlock:function(i){return e(c,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,s.getBlacklist()];case 1:return[2,e.sent().data.includes(i)]}}))}))},addFriend:d,deleteFriend:a,acceptFriendApplication:i((function(e){s.acceptFriendApplication({userID:e,type:n.TYPES.SNS_APPLICATION_AGREE_AND_ADD})}),[s]),refuseFriendApplication:i((function(e){s.refuseFriendApplication({userID:e})}),[s])}}export{c as default};
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
 
3
- declare function UnMemoizedTUIContactList<T>(): React.ReactElement;
4
- declare const TUIContactList: React.MemoExoticComponent<typeof UnMemoizedTUIContactList>;
3
+ declare function UnMemoizedTUIContactList<T>(): React__default.ReactElement;
4
+ declare const TUIContactList: React__default.MemoExoticComponent<typeof UnMemoizedTUIContactList>;
5
5
 
6
6
  export { TUIContactList };
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as i,jsx as o,Fragment as n}from"react/jsx-runtime";import e,{useState as c}from"react";import{useTranslation as a}from"react-i18next";import s from"@tencentcloud/chat";import{isH5 as r}from"../../../utils/env.js";import{useTUIKitContext as l}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as m}from"../../../context/TUIContactContext.js";import p from"../TUIContactInfo/hooks/useContactInfo.js";import d from"../hooks/useTUIContact.js";import{Avatar as u}from"../../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../../Avatar/default.js";import h from"../../Icon/images/right-arrow.svg.js";import v from"../../Icon/images/down-arrow.png.js";function I(){var e=l().setActiveContact,I=a().t,C=m("TUIContactList"),N=C.isShowContactList,x=C.friendList,T=C.blocklistProfile,g=C.friendApplicationList,S=p().acceptFriendApplication,b=d().groupList,w=c(!1),k=w[0],A=w[1],U=c(!1),j=U[0],L=U[1],P=c(!1),_=P[0],y=P[1],E=c(!1),D=E[0],M=E[1],O=function(c){var a=c.type,s=c.isShow,r=c.setShow,l=c.list,m=c.title;return i(n,{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return r(!s)}},{children:[o("div",t({className:"tui-contacts-list-title"},{children:m})),o("div",t({className:"tui-contacts-list-icon"},{children:o("img",{src:s?v:h,alt:""})}))]})),s&&(null==l?void 0:l.map((function(n){var c=n.profile||n,s=c.userID,r=c.groupID,l=c.avatar,m=c.name,p=c.nick,d=n.remark||p||s||m||r;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){e({type:a,data:n})}},{children:[o(u,{size:30,image:l||f}),o("div",t({className:"tui-contacts-list-item-container"},{children:o("p",t({className:"tui-contacts-list-item-name"},{children:d}))}))]}),s||r)})))]})};return N&&i("div",t({className:"tui-contacts-list ".concat(r?"tui-contacts-list-h5":""," ")},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return A(!k)}},{children:[o("p",t({className:"tui-contacts-list-title"},{children:I("TUIContact.New Contacts")})),o("div",t({className:"tui-contacts-list-icon"},{children:o("img",{src:k?v:h,alt:""})}))]})),k&&(null==g?void 0:g.map((function(n,c){var a=n.userID,r=n.avatar,l=n.nick,m=n.wording,p=n.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),e({type:"friendApplication",data:n})}},{children:[o(u,{size:30,image:r||f}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[o("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||a})),""!==m&&o("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:m}))]}),p===s.TYPES.SNS_APPLICATION_SENT_BY_ME&&o("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:I("TUIContact.waiting for verification")})),p===s.TYPES.SNS_APPLICATION_SENT_TO_ME&&o("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),S(i),e()}(t,a)}},{children:I("TUIContact.Agree")}))]}))]}),a)}))),o(O,{type:"block",title:I("TUIContact.Blocked List"),isShow:_,setShow:y,list:T}),o(O,{type:"group",title:I("TUIContact.Group List"),setShow:M,isShow:D,list:b}),o(O,{type:"friend",title:I("TUIContact.Friends"),setShow:L,isShow:j,list:x})]}))}var C=e.memo(I);export{C as TUIContactList};
1
+ import{__assign as t}from"tslib";import{jsxs as i,jsx as o,Fragment as e}from"react/jsx-runtime";import n,{useState as c}from"react";import{useTranslation as a}from"react-i18next";import s from"@tencentcloud/chat";import{isH5 as r}from"../../../utils/env.js";import"@tencentcloud/tui-core";import{useUIManager as l}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as m}from"../../../context/TUIContactContext.js";import p from"../TUIContactInfo/hooks/useContactInfo.js";import u from"../hooks/useTUIContact.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../../Avatar/default.js";import h from"../../Icon/images/right-arrow.svg.js";import v from"../../Icon/images/down-arrow.png.js";function I(){var n=l().setActiveContact,I=a().t,C=m("TUIContactList"),N=C.isShowContactList,g=C.friendList,x=C.blocklistProfile,T=C.friendApplicationList,S=p().acceptFriendApplication,b=u().groupList,w=c(!1),k=w[0],A=w[1],U=c(!1),j=U[0],L=U[1],P=c(!1),_=P[0],y=P[1],E=c(!1),M=E[0],D=E[1],O=function(c){var a=c.type,s=c.isShow,r=c.setShow,l=c.list,m=c.title;return i(e,{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return r(!s)}},{children:[o("div",t({className:"tui-contacts-list-title"},{children:m})),o("div",t({className:"tui-contacts-list-icon"},{children:o("img",{src:s?v:h,alt:""})}))]})),s&&(null==l?void 0:l.map((function(e){var c=e.profile||e,s=c.userID,r=c.groupID,l=c.avatar,m=c.name,p=c.nick,u=e.remark||p||s||m||r;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){n({type:a,data:e})}},{children:[o(d,{size:30,image:l||f}),o("div",t({className:"tui-contacts-list-item-container"},{children:o("p",t({className:"tui-contacts-list-item-name"},{children:u}))}))]}),s||r)})))]})};return N&&i("div",t({className:"tui-contacts-list ".concat(r?"tui-contacts-list-h5":""," ")},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return A(!k)}},{children:[o("p",t({className:"tui-contacts-list-title"},{children:I("TUIContact.New Contacts")})),o("div",t({className:"tui-contacts-list-icon"},{children:o("img",{src:k?v:h,alt:""})}))]})),k&&(null==T?void 0:T.map((function(e,c){var a=e.userID,r=e.avatar,l=e.nick,m=e.wording,p=e.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),n({type:"friendApplication",data:e})}},{children:[o(d,{size:30,image:r||f}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[o("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||a})),""!==m&&o("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:m}))]}),p===s.TYPES.SNS_APPLICATION_SENT_BY_ME&&o("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:I("TUIContact.waiting for verification")})),p===s.TYPES.SNS_APPLICATION_SENT_TO_ME&&o("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),S(i),n()}(t,a)}},{children:I("TUIContact.Agree")}))]}))]}),a)}))),o(O,{type:"block",title:I("TUIContact.Blocked List"),isShow:_,setShow:y,list:x}),o(O,{type:"group",title:I("TUIContact.Group List"),setShow:D,isShow:M,list:b}),o(O,{type:"friend",title:I("TUIContact.Friends"),setShow:L,isShow:j,list:g})]}))}var C=n.memo(I);export{C as TUIContactList};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as n}from"tslib";import{useState as i,useEffect as r}from"react";import o from"@tencentcloud/chat";import{TUIStore as e,StoreName as c}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as a}from"../../../context/TUIKitContext.js";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";function u(){var u=this,s=a().chat,l=i([]),f=l[0],d=l[1],v=i([]),p=v[0],L=v[1],h=i([]),m=h[0],T=h[1],E=i([]),A=E[0],I=E[1],g=i(),D=g[0],P=g[1],b=i(!0),w=b[0],x=b[1];r((function(){e.watch(c.GRP,{groupList:C}),U(),_(),N()}),[s]);var C=function(t){P(t)};r((function(){null==s||s.on(o.EVENT.BLACKLIST_UPDATED,F),null==s||s.on(o.EVENT.FRIEND_LIST_UPDATED,j),null==s||s.on(o.EVENT.FRIEND_APPLICATION_LIST_UPDATED,k)}),[s]);var N=function(){return t(u,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,s.getFriendApplicationList()];case 1:return t=n.sent().data,T(null==t?void 0:t.friendApplicationList),[2]}}))}))},U=function(){return t(u,void 0,void 0,(function(){var t,i,r;return n(this,(function(n){switch(n.label){case 0:return[4,s.getFriendList()];case 1:return t=n.sent(),i=t.code,r=t.data,0===i&&d(r),[2]}}))}))},_=function(){return t(u,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,s.getBlacklist()];case 1:return 0===(t=n.sent().data).length||(L(t),S(t)),[2]}}))}))},S=function(i){return t(u,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,s.getUserProfile({userIDList:i})];case 1:return t=n.sent().data,I(t),[2]}}))}))},k=function(t){var n;T(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.friendApplicationList)},F=function(t){L(t.data),S(t.data)},j=function(t){d(t.data)};return{friendList:f,groupList:D,blocklistProfile:A,friendApplicationList:m,blockList:p,isShowContactList:w,setShowContactList:x}}export{u as default};
1
+ import{__awaiter as t,__generator as n}from"tslib";import{useState as i,useEffect as r}from"react";import o from"@tencentcloud/chat";import{TUIStore as e,StoreName as c}from"@tencentcloud/chat-uikit-engine";import{useUIKit as a}from"../../../context/UIKitContext.js";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";function u(){var u=this,s=a().chat,l=i([]),f=l[0],d=l[1],v=i([]),p=v[0],L=v[1],h=i([]),m=h[0],E=h[1],T=i([]),A=T[0],I=T[1],g=i(),D=g[0],P=g[1],b=i(!0),w=b[0],x=b[1];r((function(){e.watch(c.GRP,{groupList:C}),U(),_(),N()}),[s]);var C=function(t){P(t)};r((function(){null==s||s.on(o.EVENT.BLACKLIST_UPDATED,F),null==s||s.on(o.EVENT.FRIEND_LIST_UPDATED,j),null==s||s.on(o.EVENT.FRIEND_APPLICATION_LIST_UPDATED,k)}),[s]);var N=function(){return t(u,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,s.getFriendApplicationList()];case 1:return t=n.sent().data,E(null==t?void 0:t.friendApplicationList),[2]}}))}))},U=function(){return t(u,void 0,void 0,(function(){var t,i,r;return n(this,(function(n){switch(n.label){case 0:return[4,s.getFriendList()];case 1:return t=n.sent(),i=t.code,r=t.data,0===i&&d(r),[2]}}))}))},_=function(){return t(u,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,s.getBlacklist()];case 1:return 0===(t=n.sent().data).length||(L(t),S(t)),[2]}}))}))},S=function(i){return t(u,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,s.getUserProfile({userIDList:i})];case 1:return t=n.sent().data,I(t),[2]}}))}))},k=function(t){var n;E(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.friendApplicationList)},F=function(t){L(t.data),S(t.data)},j=function(t){d(t.data)};return{friendList:f,groupList:D,blocklistProfile:A,friendApplicationList:m,blockList:p,isShowContactList:w,setShowContactList:x}}export{u as default};
@@ -1 +1 @@
1
- import{__assign as t,__awaiter as e,__generator as r}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import a,{useState as i}from"react";import{useTranslation as c}from"react-i18next";import{useTUIKitContext as s}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{useTUIContactContext as u}from"../../context/TUIContactContext.js";import m from"./hooks/useContactSearch.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{Avatar as v}from"../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../Avatar/default.js";import{Input as h}from"../Input/Input.js";function p(){var a=this,p=s("TUIContactSearch");p.chat;var I=p.setActiveContact,C=c().t,x=u("TUIContactList"),j=x.friendList,g=x.setShowContactList,U=i(!1),T=U[0],b=U[1],k=m(),y=k.checkFriend,N=k.isBlock,A=k.getUserProfile,D=i(""),w=D[0],S=D[1],F=i([]),L=F[0],B=F[1];return n("div",t({className:"tui-contact-search"},{children:[o(h,{className:"tui-contact-search-input",placeholder:C("TUIContact.Enter a userID"),clearable:!0,value:w,onBlur:function(t){var e;S(null===(e=t.target)||void 0===e?void 0:e.value)},onFocus:function(){I()},onChange:function(t){var e,r;if(""===(null===(e=t.target)||void 0===e?void 0:e.value))return g&&g(!0),b(!1),void B([]);b(!0),S(null===(r=t.target)||void 0===r?void 0:r.value),g&&g(!1)},onKeyDown:function(){return e(a,void 0,void 0,(function(){return r(this,(function(t){return w&&A(w).then((function(t){var e=t.data;B(e)})),[2]}))}))},prefix:o(l,{type:d.SEARCH,height:16,width:16})}),T&&0===L.length?o("div",t({className:"tui-contact-search-item"},{children:C("TUIContact.No Result")})):L.map((function(i,c){var s=i.userID,u=i.avatar,m=i.nick;return n("div",t({className:"tui-contact-search-item",role:"button",tabIndex:0,onClick:function(){var t;t=i,e(a,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,y(t)];case 1:return r.sent()?((e=null==j?void 0:j.find((function(t){return t.userID===w})))&&I({type:"friend",data:e}),[2]):N(t.userID)?(I({type:"block",data:t}),[2]):(I({type:"addFriend",data:t}),[2])}}))}))}},{children:[o(v,{size:30,image:u||f}),o("div",t({className:"search-item-name"},{children:m||s}))]}),s)}))]}))}var I=a.memo(p);export{I as TUIContactSearch,p as UnMemoizedTUIContactSearch};
1
+ import{__assign as t,__awaiter as e,__generator as r}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import i,{useState as a}from"react";import{useTranslation as c}from"react-i18next";import"@tencentcloud/tui-core";import{useUIManager as s}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";import{useTUIContactContext as u}from"../../context/TUIContactContext.js";import m from"./hooks/useContactSearch.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{Avatar as v}from"../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../Avatar/default.js";import{Input as p}from"../Input/Input.js";function h(){var i=this,h=s().setActiveContact,I=c().t,C=u("TUIContactList"),x=C.friendList,g=C.setShowContactList,j=a(!1),U=j[0],b=j[1],k=m(),y=k.checkFriend,N=k.isBlock,A=k.getUserProfile,D=a(""),T=D[0],w=D[1],F=a([]),L=F[0],S=F[1];return n("div",t({className:"tui-contact-search"},{children:[o(p,{className:"tui-contact-search-input",placeholder:I("TUIContact.Enter a userID"),clearable:!0,value:T,onBlur:function(t){var e;w(null===(e=t.target)||void 0===e?void 0:e.value)},onFocus:function(){h()},onChange:function(t){var e,r;if(""===(null===(e=t.target)||void 0===e?void 0:e.value))return g&&g(!0),b(!1),void S([]);b(!0),w(null===(r=t.target)||void 0===r?void 0:r.value),g&&g(!1)},onKeyDown:function(){return e(i,void 0,void 0,(function(){return r(this,(function(t){return T&&A(T).then((function(t){var e=t.data;S(e)})),[2]}))}))},prefix:o(l,{type:d.SEARCH,height:16,width:16})}),U&&0===L.length?o("div",t({className:"tui-contact-search-item"},{children:I("TUIContact.No Result")})):L.map((function(a,c){var s=a.userID,u=a.avatar,m=a.nick;return n("div",t({className:"tui-contact-search-item",role:"button",tabIndex:0,onClick:function(){var t;t=a,e(i,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,y(t)];case 1:return r.sent()?((e=null==x?void 0:x.find((function(t){return t.userID===T})))&&h({type:"friend",data:e}),[2]):N(t.userID)?(h({type:"block",data:t}),[2]):(h({type:"addFriend",data:t}),[2])}}))}))}},{children:[o(v,{size:30,image:u||f}),o("div",t({className:"search-item-name"},{children:m||s}))]}),s)}))]}))}var I=i.memo(h);export{I as TUIContactSearch,h as UnMemoizedTUIContactSearch};
@@ -1 +1 @@
1
- import t from"@tencentcloud/chat";import{useTUIKitContext as e}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"react";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as o}from"../../../context/TUIContactContext.js";function r(){var r=o("TUIContactList").blockList,n=e("TUIContactSearch").chat;return{checkFriend:function(e){return n.checkFriend({userIDList:[null==e?void 0:e.userID],type:t.TYPES.SNS_CHECK_TYPE_BOTH}).then((function(e){var o,r;return(null===(r=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.successUserIDList[0])||void 0===r?void 0:r.relation)===t.TYPES.SNS_TYPE_BOTH_WAY}))},isBlock:function(t){return null==r?void 0:r.includes(t)},getUserProfile:function(t){return n.getUserProfile({userIDList:[t]})}}}export{r as default};
1
+ import t from"@tencentcloud/chat";import{useUIKit as e}from"../../../context/UIKitContext.js";import"tslib";import"react/jsx-runtime";import"react";import"@tencentcloud/chat-uikit-engine";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as n}from"../../../context/TUIContactContext.js";function o(){var o=n("TUIContactList").blockList,i=e().chat;return{checkFriend:function(e){return i.checkFriend({userIDList:[null==e?void 0:e.userID],type:t.TYPES.SNS_CHECK_TYPE_BOTH}).then((function(e){var n,o;return(null===(o=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.successUserIDList[0])||void 0===o?void 0:o.relation)===t.TYPES.SNS_TYPE_BOTH_WAY}))},isBlock:function(t){return null==o?void 0:o.includes(t)},getUserProfile:function(t){return i.getUserProfile({userIDList:[t]})}}}export{o as default};
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import React__default, { PropsWithChildren } from 'react';
2
2
  import { Conversation } from '@tencentcloud/chat';
3
3
 
4
4
  interface TUIConversationProps {
@@ -6,7 +6,7 @@ interface TUIConversationProps {
6
6
  deleteConversation?: (conversationID: string) => Promise<any>;
7
7
  filterConversation?: (conversationList: Array<Conversation>) => Array<Conversation>;
8
8
  }
9
- declare function UnMemoizedTUIConversation<T extends TUIConversationProps>(props: PropsWithChildren<T>): React.ReactElement;
9
+ declare function UnMemoizedTUIConversation<T extends TUIConversationProps>(props: PropsWithChildren<T>): React__default.ReactElement;
10
10
  declare const TUIConversation: typeof UnMemoizedTUIConversation;
11
11
 
12
12
  export { TUIConversation, UnMemoizedTUIConversation };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
  import { Conversation } from '@tencentcloud/chat';
3
3
  import { ConversationPreviewUIComponentProps } from '../ConversationPreview/ConversationPreview.js';
4
4
  import { ConversationListContainerProps } from '../ConversationPreview/ConversationListContainer.js';
@@ -8,12 +8,12 @@ interface Props {
8
8
  filters?: object;
9
9
  sort?: object;
10
10
  options?: object;
11
- Preview?: React.ComponentType<ConversationPreviewUIComponentProps>;
12
- Container?: React.ComponentType<ConversationListContainerProps>;
13
- onConversationListUpdated?: (setConversationList: React.Dispatch<React.SetStateAction<Array<Conversation>>>, event: () => void) => void;
11
+ Preview?: React__default.ComponentType<ConversationPreviewUIComponentProps>;
12
+ Container?: React__default.ComponentType<ConversationListContainerProps>;
13
+ onConversationListUpdated?: (setConversationList: React__default.Dispatch<React__default.SetStateAction<Array<Conversation>>>, event: () => void) => void;
14
14
  filterConversation?: (conversationList: Array<Conversation>) => Array<Conversation>;
15
15
  }
16
- declare function UnMemoTUIConversationList<T extends Props>(props: T): React.ReactElement;
17
- declare const TUIConversationList: React.MemoExoticComponent<typeof UnMemoTUIConversationList>;
16
+ declare function UnMemoTUIConversationList<T extends Props>(props: T): React__default.ReactElement;
17
+ declare const TUIConversationList: React__default.MemoExoticComponent<typeof UnMemoTUIConversationList>;
18
18
 
19
19
  export { TUIConversationList, UnMemoTUIConversationList };
@@ -1 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import i,{useState as r,useRef as s}from"react";import{useTranslation as a}from"react-i18next";import{useTUIKitContext as v}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{isH5 as c}from"../../utils/env.js";import l from"./hooks/useConversationList.js";import{ConversationPreview as m}from"../ConversationPreview/ConversationPreview.js";import"@tencentcloud/chat-uikit-engine";import{Icon as C}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import"@tencentcloud/chat";import{useTUIConversationContext as h}from"../../context/TUIConversationContext.js";import{ConversationListContainer as p}from"../ConversationPreview/ConversationListContainer.js";import{ConversationSearchInput as f}from"../ConversationSearch/ConversationSearchInput.js";import{ConversationSearchResult as d}from"../ConversationSearch/ConversationSearchResult.js";import{ConversationCreate as w}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import{getDisplayTitle as j}from"../ConversationPreview/utils.js";import{useConversationUpdate as I}from"./hooks/useConversationUpdate.js";function L(i){var L=i.Preview,S=i.Container,g=void 0===S?p:S,x=i.onConversationListUpdated,P=i.filterConversation,T=i.componentVisibleOptions,U=void 0===T?{isProfileShow:!0,isSearchInputShow:!0,isContainerShow:!0}:T;a().t;var N=v("TUIConversationList"),k=N.chat,y=N.customClasses,A=N.conversation,b=N.setActiveConversation;N.setTUIProfileShow;var D=h("TUIConversationList").filterConversation,E=P||D,R=r(0),F=R[0],O=R[1],V=l(k,(function(o,e){o.length&&b(A)}),E),G=V.conversationList,K=V.setConversationList;I(K,x,(function(){return O((function(o){return o+1}))}),E);var M=r(""),q=M[0],z=M[1],B=r(G),H=B[0],J=B[1],Q=r(!1),W=Q[0],X=Q[1],Y=r(""),Z=Y[0],$=Y[1],_=s(null);return e("div",o({className:"tui-conversation ".concat(c?"tui-conversation-h5":""," ").concat(y||""," "),ref:_},{children:W?e(w,{conversationList:G,setConversationCreated:X}):t(n,{children:[U.isSearchInputShow&&t("div",o({className:"tui-conversation-header"},{children:[e(f,{value:q,clearable:!0,onChange:function(o){var e,t;if(z(null===(e=o.target)||void 0===e?void 0:e.value),null===(t=o.target)||void 0===t?void 0:t.value){var n=G.filter((function(e){var t;return j(e).toLocaleLowerCase().includes(null===(t=o.target)||void 0===t?void 0:t.value.toLocaleLowerCase())}));J(n)}else J([])}}),e("div",o({className:"tui-conversation-create-icon"},{children:e(C,{onClick:function(){z(""),X(!0)},type:u.CREATE,height:24,width:24})}))]})),U.isContainerShow&&e(g,o({setConversationList:K},{children:0===G.length?t("div",o({className:"no-result"},{children:[e(C,{className:"no-result-icon",type:u.EFFORT,width:42,height:42}),e("div",o({className:"no-result-message"},{children:"No conversation"}))]})):q?e(d,{Preview:L,searchValue:q,result:H}):G.map((function(t){return e(m,o({},{activeConversation:A,conversation:t,setActiveConversation:b,Preview:L,conversationUpdateCount:F,activeConversationID:Z,setActiveConversationID:$}),t.conversationID)}))}))]})}))}var S=i.memo(L);export{S as TUIConversationList,L as UnMemoTUIConversationList};
1
+ import{__assign as o}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{useState as i,useRef as s}from"react";import{useTranslation as a}from"react-i18next";import{useUIKit as v}from"../../context/UIKitContext.js";import{useUIManager as c}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";import{isH5 as m}from"../../utils/env.js";import l from"./hooks/useConversationList.js";import{ConversationPreview as C}from"../ConversationPreview/ConversationPreview.js";import"@tencentcloud/chat-uikit-engine";import{Icon as u}from"../Icon/Icon.js";import{IconTypes as p}from"../Icon/type.js";import"@tencentcloud/chat";import{useTUIConversationContext as h}from"../../context/TUIConversationContext.js";import{ConversationListContainer as f}from"../ConversationPreview/ConversationListContainer.js";import{ConversationSearchInput as d}from"../ConversationSearch/ConversationSearchInput.js";import{ConversationSearchResult as j}from"../ConversationSearch/ConversationSearchResult.js";import{ConversationCreate as w}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import{getDisplayTitle as I}from"../ConversationPreview/utils.js";import{useConversationUpdate as g}from"./hooks/useConversationUpdate.js";function L(r){var L=r.Preview,S=r.Container,x=void 0===S?f:S,P=r.onConversationListUpdated,U=r.filterConversation,N=r.componentVisibleOptions,T=void 0===N?{isProfileShow:!0,isSearchInputShow:!0,isContainerShow:!0}:N;a().t;var k=v().chat,y=c(),A=y.customClasses,b=y.conversation,D=y.setActiveConversation;y.setTUIProfileShow;var E=h("TUIConversationList").filterConversation,R=U||E,F=i(0),M=F[0],O=F[1],V=l(k,(function(o,e){o.length}),R),G=V.conversationList,K=V.setConversationList;g(K,P,(function(){return O((function(o){return o+1}))}),R);var q=i(""),z=q[0],B=q[1],H=i(G),J=H[0],Q=H[1],W=i(!1),X=W[0],Y=W[1],Z=i(""),$=Z[0],_=Z[1],oo=s(null);return e("div",o({className:"tui-conversation ".concat(m?"tui-conversation-h5":""," ").concat(A||""," "),ref:oo},{children:X?e(w,{conversationList:G,setConversationCreated:Y}):t(n,{children:[T.isSearchInputShow&&t("div",o({className:"tui-conversation-header"},{children:[e(d,{value:z,clearable:!0,onChange:function(o){var e,t;if(B(null===(e=o.target)||void 0===e?void 0:e.value),null===(t=o.target)||void 0===t?void 0:t.value){var n=G.filter((function(e){var t;return I(e).toLocaleLowerCase().includes(null===(t=o.target)||void 0===t?void 0:t.value.toLocaleLowerCase())}));Q(n)}else Q([])}}),e("div",o({className:"tui-conversation-create-icon"},{children:e(u,{onClick:function(){B(""),Y(!0)},type:p.CREATE,height:24,width:24})}))]})),T.isContainerShow&&e(x,o({setConversationList:K},{children:0===G.length?t("div",o({className:"no-result"},{children:[e(u,{className:"no-result-icon",type:p.EFFORT,width:42,height:42}),e("div",o({className:"no-result-message"},{children:"No conversation"}))]})):z?e(j,{Preview:L,searchValue:z,result:J}):G.map((function(t){return e(C,o({},{activeConversation:b,conversation:t,setActiveConversation:D,Preview:L,conversationUpdateCount:M,activeConversationID:$,setActiveConversationID:_}),t.conversationID)}))}))]})}))}var S=r.memo(L);export{S as TUIConversationList,L as UnMemoTUIConversationList};
@@ -1 +1 @@
1
- import{useEffect as t}from"react";import n from"@tencentcloud/chat";import{useTUIKitContext as o}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";var r=function(r,e,i,a){var c=o("useConversationUpdate").chat;t((function(){var t=function(t){r&&r(a?a(t.data):t.data.filter((function(t){return t.type!==n.TYPES.CONV_SYSTEM}))),i&&i(),e&&"function"==typeof e&&r&&e(r,t)};return null==c||c.on(n.EVENT.CONVERSATION_LIST_UPDATED,t),function(){null==c||c.off(n.EVENT.CONVERSATION_LIST_UPDATED,t)}}),[c,e])};export{r as useConversationUpdate};
1
+ import{useEffect as t}from"react";import n from"@tencentcloud/chat";import{useUIKit as o}from"../../../context/UIKitContext.js";import"tslib";import"react/jsx-runtime";import"@tencentcloud/chat-uikit-engine";import"../../../context/TUIMessageContext.js";var r=function(r,e,i,c){var u=o().chat;t((function(){var t=function(t){r&&r(c?c(t.data):t.data.filter((function(t){return t.type!==n.TYPES.CONV_SYSTEM}))),i&&i(),e&&"function"==typeof e&&r&&e(r,t)};return null==u||u.on(n.EVENT.CONVERSATION_LIST_UPDATED,t),function(){null==u||u.off(n.EVENT.CONVERSATION_LIST_UPDATED,t)}}),[u,e])};export{r as useConversationUpdate};
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
 
3
- declare function UnMemoizedTUIManage<T>(): React.ReactElement;
3
+ declare function UnMemoizedTUIManage<T>(): React__default.ReactElement;
4
4
  declare const TUIManage: typeof UnMemoizedTUIManage;
5
5
 
6
6
  export { TUIManage };
@@ -1 +1 @@
1
- import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import o,{useState as t,useEffect as a}from"react";import{useTranslation as r}from"react-i18next";import{Icon as s}from"../Icon/Icon.js";import{IconTypes as c}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{defaultGroupAvatarWork as m,defaultUserAvatar as d}from"../Avatar/default.js";import{Switch as v}from"../Switch/Switch.js";import{useTUIKitContext as h}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{isH5 as u,isPC as f}from"../../utils/env.js";import{getMessageProfile as p}from"../ConversationPreview/utils.js";import{useConversationUpdate as g}from"../TUIConversationList/hooks/useConversationUpdate.js";import{useConversation as I}from"../../hooks/useConversation.js";function C(){var o=r().t,C=t(),N=C[0],j=C[1],x=t(),D=x[0],U=x[1],k=t(!1),T=k[0],w=k[1],A=t(0),y=A[0],M=A[1],P=h("TUIManage"),S=P.conversation,b=P.setActiveConversation,L=P.chat,K=P.TUIManageShow,z=P.setTUIManageShow;g(void 0,(function(){M((function(n){return n+1}))}));var B=I(L),E=B.pinConversation,q=B.deleteConversation,F=function(){z&&z(!1)};return a((function(){j(S),S&&U(p(S)),w(!!S&&S.isPinned)}),[S,y]),K&&S&&e("div",n({className:"tui-manage ".concat(u?"tui-h5-manage":"")},{children:[e("div",n({className:"tui-manage-title"},{children:[f&&i(s,{onClick:F,type:c.CANCEL,width:9,height:16}),u&&i(s,{onClick:F,type:c.BACK,width:9,height:16}),i("span",n({style:{marginLeft:"10px"}},{children:o("TUIConversation.Conversation Information")}))]})),e("div",n({className:"tui-manage-container"},{children:[e("div",n({className:"tui-manage-info"},{children:[i("div",n({className:"info-avatar"},{children:i(l,{size:64,image:(null==D?void 0:D.avatar)||((null==D?void 0:D.groupID)?m:d)})})),i("div",n({className:"info-name"},{children:(null==D?void 0:D.nick)||(null==D?void 0:D.name)})),e("div",n({className:"info-id"},{children:["ID:",(null==D?void 0:D.userID)||(null==D?void 0:D.groupID)]}))]})),e("div",n({className:"tui-manage-handle"},{children:[e("div",n({className:"manage-handle-box"},{children:[i("div",n({className:"manage-handle-title"},{children:o("TUIConversation.Pin")})),i(v,{onChange:function(n){!function(n){w(n.target.checked),(null==N?void 0:N.conversationID)&&E({conversationID:N.conversationID,isPinned:n.target.checked})}(n)},checked:T})]})),f&&i("div",n({className:"manage-handle-box",role:"presentation",onClick:function(){(null==N?void 0:N.conversationID)&&q(N.conversationID),b(void 0)}},{children:i("div",n({className:"manage-handle-title red"},{children:o("TUIConversation.Delete")}))}))]}))]}))]}))}var N=o.memo(C);export{N as TUIManage};
1
+ import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import o,{useState as t,useEffect as a}from"react";import{useTranslation as r}from"react-i18next";import{Icon as s}from"../Icon/Icon.js";import{IconTypes as c}from"../Icon/type.js";import{Avatar as m}from"../Avatar/Avatar.js";import{defaultGroupAvatarWork as l,defaultUserAvatar as d}from"../Avatar/default.js";import{Switch as v}from"../Switch/Switch.js";import{useUIKit as h}from"../../context/UIKitContext.js";import{useUIManager as u}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";import{isH5 as f,isPC as p}from"../../utils/env.js";import{getMessageProfile as g}from"../ConversationPreview/utils.js";import{useConversationUpdate as I}from"../TUIConversationList/hooks/useConversationUpdate.js";import{useConversation as C}from"../../hooks/useConversation.js";function j(){var o=r().t,j=t(),N=j[0],x=j[1],D=t(),U=D[0],k=D[1],w=t(!1),T=w[0],A=w[1],y=t(0),M=y[0],P=y[1],S=h().chat,b=u(),L=b.conversation,K=b.setActiveConversation,z=b.TUIManageShow,B=b.setTUIManageShow;I(void 0,(function(){P((function(n){return n+1}))}));var E=C(S),q=E.pinConversation,F=E.deleteConversation,G=function(){B&&B(!1)};return a((function(){x(L),L&&k(g(L)),A(!!L&&L.isPinned)}),[L,M]),z&&L&&e("div",n({className:"tui-manage ".concat(f?"tui-h5-manage":"")},{children:[e("div",n({className:"tui-manage-title"},{children:[p&&i(s,{onClick:G,type:c.CANCEL,width:9,height:16}),f&&i(s,{onClick:G,type:c.BACK,width:9,height:16}),i("span",n({style:{marginLeft:"10px"}},{children:o("TUIConversation.Conversation Information")}))]})),e("div",n({className:"tui-manage-container"},{children:[e("div",n({className:"tui-manage-info"},{children:[i("div",n({className:"info-avatar"},{children:i(m,{size:64,image:(null==U?void 0:U.avatar)||((null==U?void 0:U.groupID)?l:d)})})),i("div",n({className:"info-name"},{children:(null==U?void 0:U.nick)||(null==U?void 0:U.name)})),e("div",n({className:"info-id"},{children:["ID:",(null==U?void 0:U.userID)||(null==U?void 0:U.groupID)]}))]})),e("div",n({className:"tui-manage-handle"},{children:[e("div",n({className:"manage-handle-box"},{children:[i("div",n({className:"manage-handle-title"},{children:o("TUIConversation.Pin")})),i(v,{onChange:function(n){!function(n){A(n.target.checked),(null==N?void 0:N.conversationID)&&q({conversationID:N.conversationID,isPinned:n.target.checked})}(n)},checked:T})]})),p&&i("div",n({className:"manage-handle-box",role:"presentation",onClick:function(){(null==N?void 0:N.conversationID)&&F(N.conversationID),K(void 0)}},{children:i("div",n({className:"manage-handle-title red"},{children:o("TUIConversation.Delete")}))}))]}))]}))]}))}var N=o.memo(j);export{N as TUIManage};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as c,useCallback as i,useEffect as u}from"react";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as s}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";function m(r){var m=r.context,p=r.message,v=r.children,f=s().setAudioSource,h=a("MessageAudioWithContext").audioSource,x=o(0),g=x[0],C=x[1],I=c(null),j=o(!1),E=j[0],y=j[1],L=i((function(){h&&h!==(null==I?void 0:I.current)&&(h.pause(),h.currentTime=0,f&&f(null)),(null==I?void 0:I.current)&&(I.current.paused?(I.current.play(),y(!0),f&&f(I.current)):(I.current.pause(),N()))}),[I,h]),T=function(){y(!1)},N=function(){f&&f(null),I.current&&(I.current.currentTime=0),T()};return u((function(){return(null==I?void 0:I.current)&&(I.current.addEventListener("pause",T),I.current.addEventListener("ended",N),I.current.addEventListener("canplay",(function(){var e;C(parseInt("".concat(null===(e=I.current)||void 0===e?void 0:e.duration),10))}))),function(){(null==I?void 0:I.current)&&(I.current.removeEventListener("pause",T),I.current.removeEventListener("ended",N))}}),[I]),t("div",e({className:"message-audio"},{children:[t("div",e({className:"message-audio-content message-audio-".concat(null==p?void 0:p.flow)},{children:[n(l,{className:"".concat(null==p?void 0:p.flow," ").concat(E?"playing":""),type:d.VOICE,width:16,height:16,onClick:L}),n("span",{children:"".concat(g,"s")})]})),n("audio",e({src:null==m?void 0:m.url,ref:I,controls:!0,className:"message-audio-none"},{children:n("track",{kind:"captions"})})),v]}))}var p=r.memo(m);function v(t){return n(p,e({},t))}export{v as MessageAudio};
1
+ import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as c,useCallback as i,useEffect as u}from"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as s}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";function m(r){var m=r.context,p=r.message,v=r.children,f=s().setAudioSource,h=a("MessageAudioWithContext").audioSource,x=o(0),g=x[0],C=x[1],I=c(null),j=o(!1),E=j[0],y=j[1],L=i((function(){h&&h!==(null==I?void 0:I.current)&&(h.pause(),h.currentTime=0,f&&f(null)),(null==I?void 0:I.current)&&(I.current.paused?(I.current.play(),y(!0),f&&f(I.current)):(I.current.pause(),k()))}),[I,h]),T=function(){y(!1)},k=function(){f&&f(null),I.current&&(I.current.currentTime=0),T()};return u((function(){return(null==I?void 0:I.current)&&(I.current.addEventListener("pause",T),I.current.addEventListener("ended",k),I.current.addEventListener("canplay",(function(){var e;C(parseInt("".concat(null===(e=I.current)||void 0===e?void 0:e.duration),10))}))),function(){(null==I?void 0:I.current)&&(I.current.removeEventListener("pause",T),I.current.removeEventListener("ended",k))}}),[I]),t("div",e({className:"message-audio"},{children:[t("div",e({className:"message-audio-content message-audio-".concat(null==p?void 0:p.flow)},{children:[n(l,{className:"".concat(null==p?void 0:p.flow," ").concat(E?"playing":""),type:d.VOICE,width:16,height:16,onClick:L}),n("span",{children:"".concat(g,"s")})]})),n("audio",e({src:null==m?void 0:m.url,ref:I,controls:!0,className:"message-audio-none"},{children:n("track",{kind:"captions"})})),v]}))}var p=r.memo(m);function v(t){return n(p,e({},t))}export{v as MessageAudio};
@@ -1 +1 @@
1
- import{jsx as t,Fragment as r}from"react/jsx-runtime";import"tslib";import"react";import{messageShowType as o}from"../../context/TUIMessageContext.js";import{Avatar as a}from"../Avatar/Avatar.js";import{handleDisplayAvatar as e}from"../untils.js";function m(m){m.className;var s=m.CustomAvatar,i=m.message,n=m.showType;return(n===o.ALL||(null==i?void 0:i.flow)===n)&&n!==o.NONE?s||t(a,{size:32,image:e(null==i?void 0:i.avatar)}):t(r,{})}export{m as MessageAvatar};
1
+ import{jsx as t,Fragment as r}from"react/jsx-runtime";import"tslib";import"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{messageShowType as o}from"../../context/TUIMessageContext.js";import{Avatar as e}from"../Avatar/Avatar.js";import{handleDisplayAvatar as i}from"../untils.js";function a(a){a.className;var m=a.CustomAvatar,n=a.message,s=a.showType;return(s===o.ALL||(null==n?void 0:n.flow)===s)&&s!==o.NONE?m||t(e,{size:32,image:i(null==n?void 0:n.avatar)}):t(r,{})}export{a as MessageAvatar};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as s}from"react/jsx-runtime";import o,{useState as n,useEffect as i}from"react";import l from"@tencentcloud/chat";import{MESSAGE_STATUS as a}from"../../constants.js";import{useTUIChatStateContext as c}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as r}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{useMessageReply as d}from"./hooks/useMessageReply.js";import{MessageProgress as g}from"./MessageProgress.js";function p(o){var p=o.message,b=o.children,v=o.Context,f=o.Plugins,I=n(!1),h=I[0],x=I[1],M=d({message:p}),N=M.messageReply,y=M.replyMessage,S=M.sender,D=r(),E=D.setHighlightedMessageId,j=D.setActiveMessageID,C=c("MessageBubbleWithContext").activeMessageID;i((function(){C!==(null==p?void 0:p.ID)&&x(!1)}),[C]);return s("div",e({className:"meesage-bubble"},{children:[s("div",e({className:"meesage-bubble-context ".concat(null==p?void 0:p.flow),role:"button",tabIndex:0,onMouseEnter:function(){j&&p&&j(null==p?void 0:p.ID),x(!0)},onMouseLeave:function(){j&&p&&j(p.ID),x(!1)},onClick:function(){j&&p&&j(p.ID)}},{children:[s("div",e({className:"message-context\n ".concat(N?"meesage-bubble-reply meesage-bubble-reply-".concat(null==p?void 0:p.flow):"","\n ").concat((null==p?void 0:p.type)!==l.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==l.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==l.TYPES.MSG_FILE||(null==p?void 0:p.status)!==a.UNSEND?"":"loading")},{children:[N&&s("div",e({className:"meesage-bubble-reply-main",role:"menuitem",tabIndex:0,onClick:function(){E&&E(null==y?void 0:y.ID)}},{children:[t("header",e({className:"title"},{children:S})),v&&t(v,{message:y})]})),b,t(g,{message:p})]})),f&&t("div",e({className:"message-plugin"},{children:h&&t(f,{message:p})}))]})),s("div",e({className:"message-bubble-status icon"},{children:[(null==p?void 0:p.status)===a.FAIL&&t("i",{className:"icon-fail"}),(null==p?void 0:p.status)===a.UNSEND&&t(m,{width:10,height:10,type:u.PROGRESS})]}))]}))}var b=o.memo(p);function v(s){return t(b,e({},s))}export{v as MessageBubble};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import l from"@tencentcloud/chat";import{MESSAGE_STATUS as a}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as c}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as r}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{useMessageReply as d}from"./hooks/useMessageReply.js";import{MessageProgress as g}from"./MessageProgress.js";function p(s){var p=s.message,b=s.children,v=s.Context,f=s.Plugins,h=n(!1),I=h[0],x=h[1],M=d({message:p}),N=M.messageReply,y=M.replyMessage,S=M.sender,D=r(),E=D.setHighlightedMessageId,j=D.setActiveMessageID,C=c("MessageBubbleWithContext").activeMessageID;i((function(){C!==(null==p?void 0:p.ID)&&x(!1)}),[C]);return o("div",e({className:"meesage-bubble"},{children:[o("div",e({className:"meesage-bubble-context ".concat(null==p?void 0:p.flow),role:"button",tabIndex:0,onMouseEnter:function(){j&&p&&j(null==p?void 0:p.ID),x(!0)},onMouseLeave:function(){j&&p&&j(p.ID),x(!1)},onClick:function(){j&&p&&j(p.ID)}},{children:[o("div",e({className:"message-context\n ".concat(N?"meesage-bubble-reply meesage-bubble-reply-".concat(null==p?void 0:p.flow):"","\n ").concat((null==p?void 0:p.type)!==l.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==l.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==l.TYPES.MSG_FILE||(null==p?void 0:p.status)!==a.UNSEND?"":"loading")},{children:[N&&o("div",e({className:"meesage-bubble-reply-main",role:"menuitem",tabIndex:0,onClick:function(){E&&E(null==y?void 0:y.ID)}},{children:[t("header",e({className:"title"},{children:S})),v&&t(v,{message:y})]})),b,t(g,{message:p})]})),f&&t("div",e({className:"message-plugin"},{children:I&&t(f,{message:p})}))]})),o("div",e({className:"message-bubble-status icon"},{children:[(null==p?void 0:p.status)===a.FAIL&&t("i",{className:"icon-fail"}),(null==p?void 0:p.status)===a.UNSEND&&t(m,{width:10,height:10,type:u.PROGRESS})]}))]}))}var b=s.memo(p);function v(o){return t(b,e({},o))}export{v as MessageBubble};
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
  import { Message } from '@tencentcloud/chat';
3
3
 
4
4
  interface MessageContextProps {
5
5
  message?: Message;
6
6
  }
7
- declare function MessageContext(props: MessageContextProps): React.ReactElement;
7
+ declare function MessageContext(props: MessageContextProps): React__default.ReactElement;
8
8
 
9
9
  export { MessageContext, MessageContextProps };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import s from"@tencentcloud/chat";import{MessageAudio as m}from"./MessageAudio.js";import{MessageCustom as r}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as E}from"./MessageFile.js";import{MessageImage as n}from"./MessageImage.js";import{MessageLocation as M}from"./MessageLocation.js";import{MessageMerger as S}from"./MessageMerger.js";import{MessageText as a}from"./MessageText.js";import{MessageVideo as T}from"./MessageVideo.js";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import{useTUIMessageContext as p}from"../../context/TUIMessageContext.js";import{useMessageContextHandler as c}from"./hooks/useMessageContextHandler.js";import{MessageStatus as g}from"./MessageStatus.js";var G,f=((G={})[s.TYPES.MSG_TEXT]=a,G[s.TYPES.MSG_FACE]=i,G[s.TYPES.MSG_IMAGE]=n,G[s.TYPES.MSG_AUDIO]=m,G[s.TYPES.MSG_VIDEO]=T,G[s.TYPES.MSG_FILE]=E,G[s.TYPES.MSG_CUSTOM]=r,G[s.TYPES.MSG_MERGER]=S,G[s.TYPES.MSG_LOCATION]=M,G);function l(o){var m,r=o.message,i=c({message:r}).context,E=p("MessageCustom"),n=E.CustemElement,M=E.TextElement,S=E.FaceElement,a=E.ImageElement,T=E.AudioElement,G=E.VideoElement,l=E.FileElement,P=E.MergerElement,Y=E.LocationElement,_=((m={})[s.TYPES.MSG_TEXT]=M,m[s.TYPES.MSG_FACE]=S,m[s.TYPES.MSG_IMAGE]=a,m[s.TYPES.MSG_AUDIO]=T,m[s.TYPES.MSG_VIDEO]=G,m[s.TYPES.MSG_FILE]=l,m[s.TYPES.MSG_CUSTOM]=n,m[s.TYPES.MSG_MERGER]=P,m[s.TYPES.MSG_LOCATION]=Y,m),j=(null==r?void 0:r.type)&&(_[r.type]||f[r.type]);return j&&t(j,e({context:i,message:r},{children:t(g,{message:r})}))}var P=o.memo(l);function Y(o){return t(P,e({},o))}export{Y as MessageContext};
1
+ import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import m from"@tencentcloud/chat";import{MessageAudio as s}from"./MessageAudio.js";import{MessageCustom as r}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as n}from"./MessageFile.js";import{MessageImage as E}from"./MessageImage.js";import{MessageLocation as M}from"./MessageLocation.js";import{MessageMerger as S}from"./MessageMerger.js";import{MessageText as a}from"./MessageText.js";import{MessageVideo as p}from"./MessageVideo.js";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import{useTUIMessageContext as T}from"../../context/TUIMessageContext.js";import{useMessageContextHandler as c}from"./hooks/useMessageContextHandler.js";import{MessageStatus as g}from"./MessageStatus.js";var G,f=((G={})[m.TYPES.MSG_TEXT]=a,G[m.TYPES.MSG_FACE]=i,G[m.TYPES.MSG_IMAGE]=E,G[m.TYPES.MSG_AUDIO]=s,G[m.TYPES.MSG_VIDEO]=p,G[m.TYPES.MSG_FILE]=n,G[m.TYPES.MSG_CUSTOM]=r,G[m.TYPES.MSG_MERGER]=S,G[m.TYPES.MSG_LOCATION]=M,G);function l(o){var s,r=o.message,i=c({message:r}).context,n=T("MessageCustom"),E=n.CustemElement,M=n.TextElement,S=n.FaceElement,a=n.ImageElement,p=n.AudioElement,G=n.VideoElement,l=n.FileElement,u=n.MergerElement,P=n.LocationElement,Y=((s={})[m.TYPES.MSG_TEXT]=M,s[m.TYPES.MSG_FACE]=S,s[m.TYPES.MSG_IMAGE]=a,s[m.TYPES.MSG_AUDIO]=p,s[m.TYPES.MSG_VIDEO]=G,s[m.TYPES.MSG_FILE]=l,s[m.TYPES.MSG_CUSTOM]=E,s[m.TYPES.MSG_MERGER]=u,s[m.TYPES.MSG_LOCATION]=P,s),_=(null==r?void 0:r.type)&&(Y[r.type]||f[r.type]);return _&&t(_,e({context:i,message:r},{children:t(g,{message:r})}))}var u=o.memo(l);function P(o){return t(u,e({},o))}export{P as MessageContext};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as r,Fragment as n}from"react/jsx-runtime";import o from"react";import l from"@tencentcloud/chat";import{useTranslation as i}from"react-i18next";import{JSONStringToParse as a}from"../untils.js";import"../../context/TUIMessageContext.js";import{useComponentContext as u}from"../../context/ComponentContext.js";function c(o){var c=o.context,m=o.message,s=o.children,d=i().t,v=u().MessageCustomPlugins;return r("div",e({className:"bubble message-custom bubble-".concat(null==m?void 0:m.flow," ").concat((null==m?void 0:m.conversationType)===l.TYPES.CONV_GROUP?"group":"")},{children:[function(o){if("Hyperlink"===o.data){var l=a(null==o?void 0:o.extension);if(null==l?void 0:l.item)return null==l?void 0:l.item.map((function(r){return t("a",e({target:"_blank",href:r.value,rel:"noreferrer"},{children:r.value}),r.value)}));if(null==l?void 0:l.hyperlinks_text){var i=l.hyperlinks_text;return r(n,{children:[l.title," ",t("a",e({target:"_blank",href:null==i?void 0:i.value,rel:"noreferrer"},{children:i.key}),null==i?void 0:i.value)]})}}if("group_create"===o.data)return"".concat((null==m?void 0:m.nick)||(null==m?void 0:m.from)," Create a group");var u=a(o.data);return 1!==(null==u?void 0:u.chatbotPlugin)||15!==(null==u?void 0:u.src)||"welcome_msg"!==(null==u?void 0:u.subtype)&&"clarify_msg"!==(null==u?void 0:u.subtype)?"[".concat(d("TUIChat.Custom message"),"]"):t(v,{data:a(o.data).content})}(null==c?void 0:c.custom),s]}))}var m=o.memo(c);function s(r){return t(m,e({},r))}export{s as MessageCustom};
1
+ import{__assign as t}from"tslib";import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import o from"react";import l from"@tencentcloud/chat";import{useTranslation as i}from"react-i18next";import{JSONStringToParse as u}from"../untils.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import"../../context/TUIMessageContext.js";import{useComponentContext as a}from"../../context/ComponentContext.js";function c(o){var c=o.context,m=o.message,s=o.children,d=i().t,v=a().MessageCustomPlugins;return n("div",t({className:"bubble message-custom bubble-".concat(null==m?void 0:m.flow," ").concat((null==m?void 0:m.conversationType)===l.TYPES.CONV_GROUP?"group":"")},{children:[function(o){if("Hyperlink"===o.data){var l=u(null==o?void 0:o.extension);if(null==l?void 0:l.item)return null==l?void 0:l.item.map((function(n){return e("a",t({target:"_blank",href:n.value,rel:"noreferrer"},{children:n.value}),n.value)}));if(null==l?void 0:l.hyperlinks_text){var i=l.hyperlinks_text;return n(r,{children:[l.title," ",e("a",t({target:"_blank",href:null==i?void 0:i.value,rel:"noreferrer"},{children:i.key}),null==i?void 0:i.value)]})}}if("group_create"===o.data)return"".concat((null==m?void 0:m.nick)||(null==m?void 0:m.from)," Create a group");var a=u(o.data);return 1!==(null==a?void 0:a.chatbotPlugin)||15!==(null==a?void 0:a.src)||"welcome_msg"!==(null==a?void 0:a.subtype)&&"clarify_msg"!==(null==a?void 0:a.subtype)?"[".concat(d("TUIChat.Custom message"),"]"):e(v,{data:u(o.data).content})}(null==c?void 0:c.custom),s]}))}var m=o.memo(c);function s(n){return e(m,t({},n))}export{s as MessageCustom};
@@ -1 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as t,Fragment as e}from"react/jsx-runtime";import r from"@tencentcloud/chat";import"react";import{messageShowType as l}from"../../context/TUIMessageContext.js";function n(n){n.className;var m=n.CustomName,i=n.message,s=n.showType;return(s===l.ALL||(null==i?void 0:i.flow)===s)&&(null==i?void 0:i.conversationType)===r.TYPES.CONV_GROUP&&s!==l.NONE?m||t("label",o({htmlFor:"content",className:"text-ellipsis name"},{children:(null==i?void 0:i.nick)||(null==i?void 0:i.from)})):t(e,{})}export{n as MessageName};
1
+ import{__assign as t}from"tslib";import{jsx as e,Fragment as o}from"react/jsx-runtime";import n from"@tencentcloud/chat";import"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{messageShowType as i}from"../../context/TUIMessageContext.js";function r(r){r.className;var l=r.CustomName,m=r.message,c=r.showType;return(c===i.ALL||(null==m?void 0:m.flow)===c)&&(null==m?void 0:m.conversationType)===n.TYPES.CONV_GROUP&&c!==i.NONE?l||e("label",t({htmlFor:"content",className:"text-ellipsis name"},{children:(null==m?void 0:m.nick)||(null==m?void 0:m.from)})):e(o,{})}export{r as MessageName};
@@ -1,5 +1,5 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import _tencentcloud_chat__default from '@tencentcloud/chat';
1
+ import React__default, { PropsWithChildren } from 'react';
2
+ import _tencentcloud_chat from '@tencentcloud/chat';
3
3
  import { PluginsProps } from '../Plugins/index.js';
4
4
 
5
5
  declare enum PluginsNameEnum {
@@ -13,12 +13,12 @@ declare enum PluginsNameEnum {
13
13
  type MessagePluginConfigProps = {
14
14
  [propsName in PluginsNameEnum]?: {
15
15
  isShow?: boolean;
16
- relateMessageType?: _tencentcloud_chat__default.TYPES[];
16
+ relateMessageType?: _tencentcloud_chat.TYPES[];
17
17
  };
18
18
  };
19
19
  interface MessagePluginsProps extends PluginsProps {
20
20
  config?: MessagePluginConfigProps;
21
21
  }
22
- declare function MessagePlugins<T extends MessagePluginsProps>(props: PropsWithChildren<T>): React.ReactElement;
22
+ declare function MessagePlugins<T extends MessagePluginsProps>(props: PropsWithChildren<T>): React__default.ReactElement;
23
23
 
24
24
  export { MessagePluginConfigProps, MessagePlugins, MessagePluginsProps };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as o,jsx as s}from"react/jsx-runtime";import{useState as l,useRef as i}from"react";import{useTranslation as n}from"react-i18next";import t from"@tencentcloud/chat";import{Plugins as r}from"../Plugins/index.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{useTUIChatStateContext as u}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as c}from"../../context/TUIMessageContext.js";import{useMessageHandler as h}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as v,MESSAGE_FLOW as g}from"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import{useMessagePluginElement as p}from"./hooks/useMessagePluginElement.js";var m;function f(m){var f,M,S,w,y,C,T=m.plugins,U=m.showNumber,x=m.MoreIcon,E=m.config,I=n().t,N=l(""),R=N[0];N[1];var k=l({}),j=k[0],b=k[1],q=i(),O=c("MessagePlugins"),P=O.message,D=O.plugin,F=u("MessageBubbleWithContext").messageListRef,L=h({message:P}),W=L.handleDelMessage,Y=L.handleRevokeMessage,A=L.handleReplyMessage,V=L.handleCopyMessage,B=L.handleResendMessage,G=L.handleForWardMessage,H={quote:e(e({isShow:!0},null==E?void 0:E.quote),null===(f=null==D?void 0:D.config)||void 0===f?void 0:f.quote),forward:e(e({isShow:!0},null==E?void 0:E.forward),null===(M=null==D?void 0:D.config)||void 0===M?void 0:M.forward),copy:e(e({isShow:!0,relateMessageType:[t.TYPES.MSG_TEXT]},null==E?void 0:E.copy),null===(S=null==D?void 0:D.config)||void 0===S?void 0:S.copy),delete:e(e({isShow:!0},null==E?void 0:E.delete),null===(w=null==D?void 0:D.config)||void 0===w?void 0:w.delete),revoke:e(e({isShow:!0},null==E?void 0:E.revoke),null===(y=null==D?void 0:D.config)||void 0===y?void 0:y.revoke),resend:e(e({isShow:!0},null==E?void 0:E.resend),null===(C=null==D?void 0:D.config)||void 0===C?void 0:C.resend)},Q=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Recall")}),s(a,{width:20,height:20,type:d.REVOCATION})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),Y(e)},message:P,isShow:H.revoke.isShow&&(null==P?void 0:P.status)===v.SUCCESS&&P.flow===g.OUT,relateMessageType:H.revoke.relateMessageType}),X=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",e({className:"del"},{children:I("TUIChat.Delete")})),s(a,{width:20,height:20,type:d.DEL})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),W(e)},message:P,isShow:H.delete.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.delete.relateMessageType}),_=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Reference")}),s(a,{width:20,height:20,type:d.QUOTE})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),A(e)},message:P,isShow:H.quote.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.quote.relateMessageType}),z=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Copy")}),s(a,{width:20,height:20,type:d.COPY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),V(e)},message:P,isShow:H.copy.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.copy.relateMessageType}),J=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Resend")}),s(a,{width:20,height:20,type:d.REPLY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),B()},message:P,isShow:H.resend.isShow&&(null==P?void 0:P.status)!==v.SUCCESS,relateMessageType:H.resend.relateMessageType}),K=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Forward")}),s(a,{width:20,height:20,type:d.FORWARD})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),G(e)},message:P,isShow:H.forward.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.forward.relateMessageType}),Z=[Q,_,K,X,J,z],$=(T||(null==D?void 0:D.plugins)||Z).filter((function(e){return e})),ee=x||(null==D?void 0:D.MoreIcon)||s(a,{className:"icon-more",width:16,height:16,type:d.MORE}),oe=U||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==v.UNSEND&&s(r,{className:"message-plugin",customClass:R,style:j,ref:q,plugins:$,showNumber:oe,MoreIcon:ee,root:null==F?void 0:F.current,handleVisible:function(e){if(e.x&&e.y){var o=e.y<e.height||e.top,s=e.x<e.width||e.left;b({position:"fixed",left:"".concat(s?e.x:e.x-e.width,"px"),top:"".concat(o?e.y:e.y-e.height,"px")})}}})}!function(e){e.quote="quote",e.forward="forward",e.copy="copy",e.delete="delete",e.resend="resend",e.revoke="revoke"}(m||(m={}));export{f as MessagePlugins};
1
+ import{__assign as e}from"tslib";import{jsxs as o,jsx as l}from"react/jsx-runtime";import{useState as s,useRef as i}from"react";import{useTranslation as n}from"react-i18next";import t from"@tencentcloud/chat";import{Plugins as r}from"../Plugins/index.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as u}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as c}from"../../context/TUIMessageContext.js";import{useMessageHandler as h}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as v,MESSAGE_FLOW as g}from"../../constants.js";import"date-fns";import"date-fns/locale";import{useMessagePluginElement as p}from"./hooks/useMessagePluginElement.js";var m;function f(m){var f,M,S,w,y,C,T=m.plugins,U=m.showNumber,x=m.MoreIcon,E=m.config,I=n().t,N=s(""),R=N[0];N[1];var k=s({}),j=k[0],b=k[1],q=i(),O=c("MessagePlugins"),P=O.message,D=O.plugin,F=u("MessageBubbleWithContext").messageListRef,L=h({message:P}),W=L.handleDelMessage,Y=L.handleRevokeMessage,A=L.handleReplyMessage,V=L.handleCopyMessage,B=L.handleResendMessage,G=L.handleForWardMessage,H={quote:e(e({isShow:!0},null==E?void 0:E.quote),null===(f=null==D?void 0:D.config)||void 0===f?void 0:f.quote),forward:e(e({isShow:!0},null==E?void 0:E.forward),null===(M=null==D?void 0:D.config)||void 0===M?void 0:M.forward),copy:e(e({isShow:!0,relateMessageType:[t.TYPES.MSG_TEXT]},null==E?void 0:E.copy),null===(S=null==D?void 0:D.config)||void 0===S?void 0:S.copy),delete:e(e({isShow:!0},null==E?void 0:E.delete),null===(w=null==D?void 0:D.config)||void 0===w?void 0:w.delete),revoke:e(e({isShow:!0},null==E?void 0:E.revoke),null===(y=null==D?void 0:D.config)||void 0===y?void 0:y.revoke),resend:e(e({isShow:!0},null==E?void 0:E.resend),null===(C=null==D?void 0:D.config)||void 0===C?void 0:C.resend)},Q=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:I("TUIChat.Recall")}),l(a,{width:20,height:20,type:d.REVOCATION})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),Y(e)},message:P,isShow:H.revoke.isShow&&(null==P?void 0:P.status)===v.SUCCESS&&P.flow===g.OUT,relateMessageType:H.revoke.relateMessageType}),X=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",e({className:"del"},{children:I("TUIChat.Delete")})),l(a,{width:20,height:20,type:d.DEL})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),W(e)},message:P,isShow:H.delete.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.delete.relateMessageType}),_=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:I("TUIChat.Reference")}),l(a,{width:20,height:20,type:d.QUOTE})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),A(e)},message:P,isShow:H.quote.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.quote.relateMessageType}),z=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:I("TUIChat.Copy")}),l(a,{width:20,height:20,type:d.COPY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),V(e)},message:P,isShow:H.copy.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.copy.relateMessageType}),J=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:I("TUIChat.Resend")}),l(a,{width:20,height:20,type:d.REPLY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),B()},message:P,isShow:H.resend.isShow&&(null==P?void 0:P.status)!==v.SUCCESS,relateMessageType:H.resend.relateMessageType}),K=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:I("TUIChat.Forward")}),l(a,{width:20,height:20,type:d.FORWARD})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),G(e)},message:P,isShow:H.forward.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.forward.relateMessageType}),Z=[Q,_,K,X,J,z],$=(T||(null==D?void 0:D.plugins)||Z).filter((function(e){return e})),ee=x||(null==D?void 0:D.MoreIcon)||l(a,{className:"icon-more",width:16,height:16,type:d.MORE}),oe=U||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==v.UNSEND&&l(r,{className:"message-plugin",customClass:R,style:j,ref:q,plugins:$,showNumber:oe,MoreIcon:ee,root:null==F?void 0:F.current,handleVisible:function(e){if(e.x&&e.y){var o=e.y<e.height||e.top,l=e.x<e.width||e.left;b({position:"fixed",left:"".concat(l?e.x:e.x-e.width,"px"),top:"".concat(o?e.y:e.y-e.height,"px")})}}})}!function(e){e.quote="quote",e.forward="forward",e.copy="copy",e.delete="delete",e.resend="resend",e.revoke="revoke"}(m||(m={}));export{f as MessagePlugins};
@@ -1 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as t,Fragment as e,jsxs as s}from"react/jsx-runtime";import r,{useState as n,useEffect as i}from"react";import a from"@tencentcloud/chat";import{MESSAGE_STATUS as l}from"../../constants.js";import{useTUIChatStateContext as m}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as c}from"../../context/TUIMessageContext.js";function p(r){var p=r.message,u=r.children,g=r.Progress,d=r.isShow,v=void 0!==d&&d,f=n(),h=f[0],S=f[1],x=n(0),P=x[0],M=x[1],E=m("MessageProgressWithContext").uploadPendingMessageList,I=c("MessageProgressWithContext"),C=I.isShowProgress,T=void 0!==C&&C,j=I.Progress,y=g||j,D=v||T;return i((function(){E&&E.length>0&&E.map((function(o){return(null==o?void 0:o.ID)===(null==p?void 0:p.ID)&&(S(o),(null==o?void 0:o.progress)&&M(o.progress)),o}))}),[E]),D?y&&h?t(y,{message:h}):!((null==p?void 0:p.type)!==a.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==a.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==a.TYPES.MSG_FILE||(null==p?void 0:p.status)!==l.UNSEND)&&s("div",o({className:"progress-box"},{children:[t("span",{className:"progress",style:{width:"".concat(100*P,"%")}}),u]})):t(e,{})}var u=r.memo(p);function g(e){return t(u,o({},e))}export{g as MessageProgress};
1
+ import{__assign as t}from"tslib";import{jsx as e,Fragment as o,jsxs as r}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import a from"@tencentcloud/chat";import{MESSAGE_STATUS as c}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as l}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as m}from"../../context/TUIMessageContext.js";function u(s){var u=s.message,p=s.children,d=s.Progress,g=s.isShow,v=void 0!==g&&g,f=n(),h=f[0],x=f[1],S=n(0),P=S[0],M=S[1],E=l("MessageProgressWithContext").uploadPendingMessageList,I=m("MessageProgressWithContext"),C=I.isShowProgress,T=void 0!==C&&C,j=I.Progress,y=d||j,D=v||T;return i((function(){E&&E.length>0&&E.map((function(t){return(null==t?void 0:t.ID)===(null==u?void 0:u.ID)&&(x(t),(null==t?void 0:t.progress)&&M(t.progress)),t}))}),[E]),D?y&&h?e(y,{message:h}):!((null==u?void 0:u.type)!==a.TYPES.MSG_IMAGE&&(null==u?void 0:u.type)!==a.TYPES.MSG_VIDEO&&(null==u?void 0:u.type)!==a.TYPES.MSG_FILE||(null==u?void 0:u.status)!==c.UNSEND)&&r("div",t({className:"progress-box"},{children:[e("span",{className:"progress",style:{width:"".concat(100*P,"%")}}),p]})):e(o,{})}var p=s.memo(u);function d(o){return e(p,t({},o))}export{d as MessageProgress};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as r}from"react";import{useTranslation as i}from"react-i18next";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function c(n){var c=n.message,d=i().t,p=m().operateMessage,u=r((function(){var t;p&&c&&p(((t={})[l.REVOKE]=c,t))}),[p]);return o("div",t({className:"bubble message-system message-revoke"},{children:[(null==c?void 0:c.flow)===s.IN&&e("span",{children:(null==c?void 0:c.nick)||(null==c?void 0:c.from)}),(null==c?void 0:c.flow)!==s.IN&&e("span",t({style:{marginRight:"5px"}},{children:d("TUIChat.You")})),e("span",t({style:{marginRight:"5px"}},{children:d("TUIChat.recalled a message")})),(null==c?void 0:c.flow)===s.OUT&&(null==c?void 0:c.type)===a.TYPES.MSG_TEXT&&e("span",t({className:"edit",role:"button",tabIndex:0,onClick:u},{children:d("TUIChat.Re-edit")}))]}))}var d=n.memo(c);function p(o){return e(d,t({},o))}export{p as MessageRevoke};
1
+ import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as r}from"react";import{useTranslation as i}from"react-i18next";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function c(n){var c=n.message,u=i().t,d=m().operateMessage,p=r((function(){var t;d&&c&&d(((t={})[l.REVOKE]=c,t))}),[d]);return o("div",t({className:"bubble message-system message-revoke"},{children:[(null==c?void 0:c.flow)===s.IN&&e("span",{children:(null==c?void 0:c.nick)||(null==c?void 0:c.from)}),(null==c?void 0:c.flow)!==s.IN&&e("span",t({style:{marginRight:"5px"}},{children:u("TUIChat.You")})),e("span",t({style:{marginRight:"5px"}},{children:u("TUIChat.recalled a message")})),(null==c?void 0:c.flow)===s.OUT&&(null==c?void 0:c.type)===a.TYPES.MSG_TEXT&&e("span",t({className:"edit",role:"button",tabIndex:0,onClick:p},{children:u("TUIChat.Re-edit")}))]}))}var u=n.memo(c);function d(o){return e(u,t({},o))}export{d as MessageRevoke};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import i from"react";import{useTUIKitContext as o}from"../../context/TUIKitContext.js";import{useTUIMessageContext as r}from"../../context/TUIMessageContext.js";import{getTimeStamp as m}from"../untils.js";function s(i){var s=i.message,a=o("TUIChat").language,n=r("MessageStatustWithContext").isShowTime,c=(void 0===n||n)&&e("div",t({className:"time"},{children:(null==s?void 0:s.time)?m(1e3*s.time,a):0}));return e("div",t({className:"message-status"},{children:c}))}var a=i.memo(s);function n(i){return e(a,t({},i))}export{n as MessageStatus};
1
+ import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import i from"react";import{useUIKit as o}from"../../context/UIKitContext.js";import"@tencentcloud/chat-uikit-engine";import{useTUIMessageContext as r}from"../../context/TUIMessageContext.js";import{getTimeStamp as m}from"../untils.js";function s(i){var s=i.message,n=o().language,a=r("MessageStatustWithContext").isShowTime,c=(void 0===a||a)&&e("div",t({className:"time"},{children:(null==s?void 0:s.time)?m(1e3*s.time,n):0}));return e("div",t({className:"message-status"},{children:c}))}var n=i.memo(s);function a(i){return e(n,t({},i))}export{a as MessageStatus};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"../../context/TUIMessageContext.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function n(o){var n=o.message,s=r({message:n}).context;return e("div",t({className:"bubble message-system"},{children:e("div",{children:s})}))}var s=o.memo(n);function i(o){return e(s,t({},o))}export{i as MessageSystem};
1
+ import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"../../context/TUIMessageContext.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function n(o){var n=o.message,i=r({message:n}).context;return e("div",t({className:"bubble message-system"},{children:e("div",{children:i})}))}var i=o.memo(n);function s(o){return e(i,t({},o))}export{s as MessageSystem};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import o from"react";import r from"@tencentcloud/chat";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as s}from"../../context/ComponentContext.js";function c(o){var c=o.context,i=o.message,l=o.children,m=s().MessageTextPlugins,u=a("MessageText").firstSendMessage;if(m&&"in"===(null==i?void 0:i.flow)&&u&&(null==u?void 0:u.time)<=(null==i?void 0:i.time))return e("div",t({className:"bubble message-text bubble-".concat(i.flow," ").concat((null==i?void 0:i.conversationType)===r.TYPES.CONV_GROUP?"group":"")},{children:e(m,{data:i})}));var f=function(t){if(!t)return t;return t.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,(function(t){return"<a class='website' href='".concat(t,"' target='_blank'>").concat(t,"</a>")}))};return e("div",t({className:"bubble message-text bubble-".concat(null==i?void 0:i.flow," ").concat((null==i?void 0:i.conversationType)===r.TYPES.CONV_GROUP?"group":"")},{children:n("div",t({className:"message-text-content"},{children:[null==c?void 0:c.text.map((function(t,n){var o=i&&(null==i?void 0:i.ID)+n;return"text"===t.name?e("p",{className:"message-text-content-p",dangerouslySetInnerHTML:{__html:f(t.text)}},t.src+o):e("img",{className:"text-img",src:t.src,alt:""},t.src+o)})),l]}))}))}var i=o.memo(c);function l(n){return e(i,t({},n))}export{l as MessageText};
1
+ import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import o from"react";import c from"@tencentcloud/chat";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as i}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as r}from"../../context/ComponentContext.js";function s(o){var s=o.context,a=o.message,l=o.children,m=r().MessageTextPlugins,u=i("MessageText").firstSendMessage;return m&&"in"===(null==a?void 0:a.flow)&&u&&(null==u?void 0:u.time)<=(null==a?void 0:a.time)?e("div",t({className:"bubble message-text bubble-".concat(a.flow," ").concat((null==a?void 0:a.conversationType)===c.TYPES.CONV_GROUP?"group":"")},{children:e(m,{data:a})})):e("div",t({className:"bubble message-text bubble-".concat(null==a?void 0:a.flow," ").concat((null==a?void 0:a.conversationType)===c.TYPES.CONV_GROUP?"group":"")},{children:n("div",t({className:"message-text-content"},{children:[null==s?void 0:s.text.map((function(n,o){var c=a&&(null==a?void 0:a.ID)+o;return"text"===n.name?e("p",t({className:"message-text-content-p"},{children:n.text}),n.src+c):e("img",{className:"text-img",src:n.src,alt:""},n.src+c)})),l]}))}))}var a=o.memo(s);function l(n){return e(a,t({},n))}export{l as MessageText};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"../../context/TUIMessageContext.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function n(o){var n=o.message,i=r({message:n}).context;return e("div",t({className:"bubble message-tip"},{children:i.text}))}var i=o.memo(n);function s(o){return e(i,t({},o))}export{s as MessageTip};
1
+ import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"../../context/TUIMessageContext.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function n(o){var n=o.message,i=r({message:n}).context;return e("div",t({className:"bubble message-tip"},{children:i.text}))}var i=o.memo(n);function m(o){return e(i,t({},o))}export{m as MessageTip};