@tencentcloud/chat-uikit-react 2.1.2 → 2.1.4

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 (294) hide show
  1. package/.eslintrc.js +0 -1
  2. package/CHANGELOG.md +10 -0
  3. package/dist/cjs/components/Avatar/Avatar.js +1 -1
  4. package/dist/cjs/components/Checkbox/index.d.ts +2 -1
  5. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  6. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  7. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  8. package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
  9. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
  10. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  11. package/dist/cjs/components/ConversationPreview/utils.js +1 -1
  12. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
  13. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
  14. package/dist/cjs/components/DivWithEdit/DivWithEdit.d.ts +3 -2
  15. package/dist/cjs/components/DivWithEdit/DivWithEdit.js +1 -1
  16. package/dist/cjs/components/DivWithEdit/WithText.js +1 -1
  17. package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
  18. package/dist/cjs/components/Icon/Icon.d.ts +2 -1
  19. package/dist/cjs/components/Icon/Icon.js +1 -1
  20. package/dist/cjs/components/Input/Input.js +1 -1
  21. package/dist/cjs/components/Model/index.d.ts +1 -1
  22. package/dist/cjs/components/Model/index.js +1 -1
  23. package/dist/cjs/components/Plugins/index.js +1 -1
  24. package/dist/cjs/components/Popup/index.d.ts +1 -1
  25. package/dist/cjs/components/Popup/index.js +1 -1
  26. package/dist/cjs/components/Switch/Switch.d.ts +2 -6
  27. package/dist/cjs/components/Switch/Switch.js +1 -1
  28. package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
  29. package/dist/cjs/components/TUIChat/TUIChatState.js +1 -1
  30. package/dist/cjs/components/TUIChat/hooks/useHandleMessage.js +1 -1
  31. package/dist/cjs/components/TUIChat/hooks/useHandleMessageList.js +1 -1
  32. package/dist/cjs/components/TUIChat/unitls.js +1 -1
  33. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  34. package/dist/cjs/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
  35. package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  36. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  37. package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
  38. package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  39. package/dist/cjs/components/TUIConversation/TUIConversation.js +1 -1
  40. package/dist/cjs/components/TUIConversationList/hooks/useConversationList.js +1 -1
  41. package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  42. package/dist/cjs/components/TUIKit/TUIKit.d.ts +2 -2
  43. package/dist/cjs/components/TUIKit/TUIKit.js +1 -1
  44. package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
  45. package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
  46. package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +1 -1
  47. package/dist/cjs/components/TUIManage/TUIManage.d.ts +4 -1
  48. package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
  49. package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
  50. package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
  51. package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
  52. package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
  53. package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
  54. package/dist/cjs/components/TUIMessage/MessageFace.js +1 -1
  55. package/dist/cjs/components/TUIMessage/MessageFile.js +1 -1
  56. package/dist/cjs/components/TUIMessage/MessageImage.js +1 -1
  57. package/dist/cjs/components/TUIMessage/MessageLocation.js +1 -1
  58. package/dist/cjs/components/TUIMessage/MessageMerger.js +1 -1
  59. package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
  60. package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
  61. package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
  62. package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
  63. package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
  64. package/dist/cjs/components/TUIMessage/MessageVideo.js +1 -1
  65. package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
  66. package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
  67. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  68. package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
  69. package/dist/cjs/components/TUIMessage/utils/index.js +1 -1
  70. package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +1 -1
  71. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  72. package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  73. package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
  74. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  75. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  76. package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  77. package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  78. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
  79. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  80. package/dist/cjs/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
  81. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
  82. package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  83. package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
  84. package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
  85. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
  86. package/dist/cjs/components/TUIProfile/hooks/useMyProfile.js +1 -1
  87. package/dist/cjs/components/Toast/index.js +1 -1
  88. package/dist/cjs/context/ComponentContext.d.ts +3 -2
  89. package/dist/cjs/context/TUIChatActionContext.d.ts +1 -1
  90. package/dist/cjs/context/TUIChatStateContext.d.ts +4 -4
  91. package/dist/cjs/context/TUIContactContext.js +1 -1
  92. package/dist/cjs/context/TUIConversationContext.js +1 -1
  93. package/dist/cjs/context/TUIKitContext.d.ts +1 -1
  94. package/dist/cjs/context/TUIMessageContext.js +1 -1
  95. package/dist/cjs/context/TUIMessageInputContext.js +1 -1
  96. package/dist/cjs/hooks/useProfile.d.ts +1 -1
  97. package/dist/cjs/index.css +1 -1
  98. package/dist/cjs/index.d.css +3 -3
  99. package/dist/cjs/index.d.ts +1 -1
  100. package/dist/cjs/index.js +1 -1
  101. package/dist/esm/components/Avatar/Avatar.js +1 -1
  102. package/dist/esm/components/Checkbox/index.d.ts +2 -1
  103. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  104. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  105. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  106. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
  107. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
  108. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  109. package/dist/esm/components/ConversationPreview/utils.js +1 -1
  110. package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
  111. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
  112. package/dist/esm/components/DivWithEdit/DivWithEdit.d.ts +3 -2
  113. package/dist/esm/components/DivWithEdit/DivWithEdit.js +1 -1
  114. package/dist/esm/components/DivWithEdit/WithText.js +1 -1
  115. package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
  116. package/dist/esm/components/Icon/Icon.d.ts +2 -1
  117. package/dist/esm/components/Icon/Icon.js +1 -1
  118. package/dist/esm/components/Input/Input.js +1 -1
  119. package/dist/esm/components/Model/index.d.ts +1 -1
  120. package/dist/esm/components/Model/index.js +1 -1
  121. package/dist/esm/components/Plugins/index.js +1 -1
  122. package/dist/esm/components/Popup/index.d.ts +1 -1
  123. package/dist/esm/components/Popup/index.js +1 -1
  124. package/dist/esm/components/Switch/Switch.d.ts +2 -6
  125. package/dist/esm/components/Switch/Switch.js +1 -1
  126. package/dist/esm/components/TUIChat/TUIChat.js +1 -1
  127. package/dist/esm/components/TUIChat/TUIChatState.js +1 -1
  128. package/dist/esm/components/TUIChat/hooks/useHandleMessage.js +1 -1
  129. package/dist/esm/components/TUIChat/hooks/useHandleMessageList.js +1 -1
  130. package/dist/esm/components/TUIChat/unitls.js +1 -1
  131. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  132. package/dist/esm/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
  133. package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  134. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  135. package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
  136. package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  137. package/dist/esm/components/TUIConversation/TUIConversation.js +1 -1
  138. package/dist/esm/components/TUIConversationList/hooks/useConversationList.js +1 -1
  139. package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  140. package/dist/esm/components/TUIKit/TUIKit.d.ts +2 -2
  141. package/dist/esm/components/TUIKit/TUIKit.js +1 -1
  142. package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
  143. package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
  144. package/dist/esm/components/TUIKit/hooks/useTUIKit.js +1 -1
  145. package/dist/esm/components/TUIManage/TUIManage.d.ts +4 -1
  146. package/dist/esm/components/TUIManage/TUIManage.js +1 -1
  147. package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
  148. package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
  149. package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
  150. package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
  151. package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
  152. package/dist/esm/components/TUIMessage/MessageFace.js +1 -1
  153. package/dist/esm/components/TUIMessage/MessageFile.js +1 -1
  154. package/dist/esm/components/TUIMessage/MessageImage.js +1 -1
  155. package/dist/esm/components/TUIMessage/MessageLocation.js +1 -1
  156. package/dist/esm/components/TUIMessage/MessageMerger.js +1 -1
  157. package/dist/esm/components/TUIMessage/MessageName.js +1 -1
  158. package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
  159. package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
  160. package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
  161. package/dist/esm/components/TUIMessage/MessageText.js +1 -1
  162. package/dist/esm/components/TUIMessage/MessageVideo.js +1 -1
  163. package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
  164. package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
  165. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  166. package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
  167. package/dist/esm/components/TUIMessage/utils/index.js +1 -1
  168. package/dist/esm/components/TUIMessageInput/EmojiPicker.js +1 -1
  169. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  170. package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  171. package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
  172. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  173. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  174. package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  175. package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  176. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
  177. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  178. package/dist/esm/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
  179. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
  180. package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  181. package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
  182. package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
  183. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
  184. package/dist/esm/components/TUIProfile/hooks/useMyProfile.js +1 -1
  185. package/dist/esm/components/Toast/index.js +1 -1
  186. package/dist/esm/context/ComponentContext.d.ts +3 -2
  187. package/dist/esm/context/TUIChatActionContext.d.ts +1 -1
  188. package/dist/esm/context/TUIChatStateContext.d.ts +4 -4
  189. package/dist/esm/context/TUIContactContext.js +1 -1
  190. package/dist/esm/context/TUIConversationContext.js +1 -1
  191. package/dist/esm/context/TUIKitContext.d.ts +1 -1
  192. package/dist/esm/context/TUIMessageContext.js +1 -1
  193. package/dist/esm/context/TUIMessageInputContext.js +1 -1
  194. package/dist/esm/hooks/useProfile.d.ts +1 -1
  195. package/dist/esm/index.css +1 -1
  196. package/dist/esm/index.d.css +3 -3
  197. package/dist/esm/index.d.ts +1 -1
  198. package/dist/esm/index.js +1 -1
  199. package/index.ts +1 -0
  200. package/package.json +7 -6
  201. package/rollup.config.js +2 -1
  202. package/src/components/Avatar/Avatar.tsx +7 -3
  203. package/src/components/Avatar/styles/index.scss +1 -1
  204. package/src/components/Checkbox/index.tsx +1 -1
  205. package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +14 -7
  206. package/src/components/ConversationCreate/ConversationCreate.tsx +5 -1
  207. package/src/components/ConversationCreate/ConversationCreateSelectView.tsx +2 -2
  208. package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +11 -10
  209. package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +14 -12
  210. package/src/components/ConversationPreview/ConversationPreview.tsx +3 -3
  211. package/src/components/ConversationPreview/ConversationPreviewContent.tsx +9 -5
  212. package/src/components/ConversationPreview/utils.tsx +6 -3
  213. package/src/components/DivWithEdit/DivWithEdit.tsx +6 -5
  214. package/src/components/DivWithEdit/WithText.tsx +3 -1
  215. package/src/components/DivWithEdit/styles/index.scss +1 -1
  216. package/src/components/Icon/Icon.tsx +2 -2
  217. package/src/components/Input/Input.tsx +15 -12
  218. package/src/components/Model/index.tsx +2 -2
  219. package/src/components/Plugins/index.tsx +15 -12
  220. package/src/components/Popup/index.tsx +13 -9
  221. package/src/components/Profile/index.ts +1 -2
  222. package/src/components/Switch/Switch.tsx +5 -7
  223. package/src/components/TUIChat/TUIChat.tsx +20 -5
  224. package/src/components/TUIChat/TUIChatState.tsx +3 -3
  225. package/src/components/TUIChat/hooks/useHandleMessage.tsx +5 -5
  226. package/src/components/TUIChat/hooks/useHandleMessageList.tsx +2 -2
  227. package/src/components/TUIChat/unitls.ts +2 -2
  228. package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +1 -1
  229. package/src/components/TUIContact/TUIContactInfo/addFriendInfo.tsx +2 -2
  230. package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +1 -2
  231. package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +0 -10
  232. package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -3
  233. package/src/components/TUIContact/hooks/useTUIContact.tsx +3 -4
  234. package/src/components/TUIContactSearch/TUIContactSearch.tsx +6 -7
  235. package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +1 -3
  236. package/src/components/TUIConversationList/TUIConversationList.tsx +1 -1
  237. package/src/components/TUIConversationList/hooks/useConversationList.tsx +19 -24
  238. package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
  239. package/src/components/TUIKit/TUIKit.tsx +31 -12
  240. package/src/components/TUIKit/hooks/useTUIKit.tsx +14 -10
  241. package/src/components/TUIManage/TUIManage.tsx +20 -13
  242. package/src/components/TUIMessage/MessageAudio.tsx +8 -6
  243. package/src/components/TUIMessage/MessageAvatar.tsx +2 -2
  244. package/src/components/TUIMessage/MessageBubble.tsx +7 -5
  245. package/src/components/TUIMessage/MessageContext.tsx +3 -3
  246. package/src/components/TUIMessage/MessageCustom.tsx +5 -3
  247. package/src/components/TUIMessage/MessageFace.tsx +2 -2
  248. package/src/components/TUIMessage/MessageFile.tsx +5 -5
  249. package/src/components/TUIMessage/MessageImage.tsx +4 -2
  250. package/src/components/TUIMessage/MessageLocation.tsx +3 -3
  251. package/src/components/TUIMessage/MessageMerger.tsx +3 -3
  252. package/src/components/TUIMessage/MessageName.tsx +1 -1
  253. package/src/components/TUIMessage/MessagePlugins.tsx +12 -10
  254. package/src/components/TUIMessage/MessageProgress.tsx +5 -4
  255. package/src/components/TUIMessage/MessageRevoke.tsx +1 -1
  256. package/src/components/TUIMessage/MessageText.tsx +4 -4
  257. package/src/components/TUIMessage/MessageVideo.tsx +3 -3
  258. package/src/components/TUIMessage/TUIMessage.tsx +1 -1
  259. package/src/components/TUIMessage/TUIMessageDefault.tsx +3 -1
  260. package/src/components/TUIMessage/hooks/useMessageHandler.ts +13 -13
  261. package/src/components/TUIMessage/hooks/useMessageReply.ts +6 -4
  262. package/src/components/TUIMessage/utils/decodeText.ts +2 -3
  263. package/src/components/TUIMessage/utils/index.ts +1 -2
  264. package/src/components/TUIMessageInput/EmojiPicker.tsx +4 -4
  265. package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +8 -8
  266. package/src/components/TUIMessageInput/InputQuoteDefalut.tsx +4 -2
  267. package/src/components/TUIMessageInput/TUIForward.tsx +22 -15
  268. package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +15 -9
  269. package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +2 -2
  270. package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +4 -4
  271. package/src/components/TUIMessageInput/hooks/useHandleQuoteMessage.tsx +5 -5
  272. package/src/components/TUIMessageInput/hooks/useMessageInputState.tsx +3 -3
  273. package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +12 -9
  274. package/src/components/TUIMessageInput/hooks/useUploadElement.tsx +2 -2
  275. package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +1 -1
  276. package/src/components/TUIMessageList/TUIMessageList.tsx +5 -6
  277. package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +5 -2
  278. package/src/components/TUIProfile/TUIProfile.tsx +3 -1
  279. package/src/components/TUIProfile/TUIProfileDefault.tsx +17 -17
  280. package/src/components/TUIProfile/hooks/useMyProfile.tsx +19 -37
  281. package/src/components/Toast/index.tsx +3 -3
  282. package/src/components/Toast/styles/layout.scss +1 -1
  283. package/src/components/untils.ts +1 -1
  284. package/src/context/TUIChatStateContext.tsx +4 -4
  285. package/src/context/TUIContactContext.tsx +1 -1
  286. package/src/context/TUIConversationContext.tsx +2 -2
  287. package/src/context/TUIMessageContext.tsx +1 -1
  288. package/src/context/TUIMessageInputContext.tsx +1 -1
  289. package/src/hooks/useConversation.tsx +1 -1
  290. package/src/hooks/useProfile.tsx +2 -2
  291. package/tsconfig.json +1 -0
  292. package/dist/cjs/components/TUIProfile/hooks/useMyProfile.d.ts +0 -17
  293. package/dist/esm/components/TUIProfile/hooks/useMyProfile.d.ts +0 -17
  294. package/src/components/Profile/hooks/useProfile.tsx +0 -28
@@ -1 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import{useState as e,useEffect as n}from"react";import{useTUIKitContext as i}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{ConversationPreviewContent as r}from"./ConversationPreviewContent.js";import{getDisplayImage as a,getDisplayTitle as s,getDisplayMessage as v,getDisplayTime as m}from"./utils.js";function l(l){var u=l.activeConversation,c=l.conversation,p=l.Preview,C=void 0===p?r:p,d=l.searchValue,f=l.conversationUpdateCount,x=i("TUIConversation").language,I=i("ConversationPreview"),g=I.setActiveConversation,j=I.myProfile,y=e(a(c)),T=y[0],P=y[1],U=e(s(c,d)),w=U[0],A=U[1],D=e(v(c,j)),M=D[0],b=D[1],h=e(m(c,x)),K=h[0],V=h[1],k=e(c.unreadCount),q=k[0],z=k[1],B=(null==u?void 0:u.conversationID)===(null==c?void 0:c.conversationID);return C?(n((function(){A(s(c,d)),b(v(c,j)),P(a(c)),V(m(c,x)),z(c.unreadCount)}),[c,d,f,x]),t(C,o({},l,{active:B,displayImage:T,displayTitle:w,displayMessage:M,displayTime:K,unread:q,setActiveConversation:g}))):null}export{l as ConversationPreview};
1
+ import{__assign as o}from"tslib";import{jsx as t,Fragment as e}from"react/jsx-runtime";import{useState as n,useEffect as i}from"react";import{useTUIKitContext as r}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{ConversationPreviewContent as a}from"./ConversationPreviewContent.js";import{getDisplayImage as s,getDisplayTitle as v,getDisplayMessage as m,getDisplayTime as c}from"./utils.js";function u(u){var l=u.activeConversation,p=u.conversation,C=u.Preview,d=void 0===C?a:C,f=u.searchValue,x=u.conversationUpdateCount,I=r("TUIConversation").language,g=r("ConversationPreview"),j=g.setActiveConversation,y=g.myProfile,T=n(s(p)),P=T[0],U=T[1],w=n(v(p,f)),A=w[0],D=w[1],M=n(y&&m(p,y)),b=M[0],h=M[1],K=n(c(p,I)),V=K[0],k=K[1],q=n(p.unreadCount),z=q[0],B=q[1],E=(null==l?void 0:l.conversationID)===(null==p?void 0:p.conversationID);return d?(i((function(){D(v(p,f)),y&&h(m(p,y)),U(s(p)),k(c(p,I)),B(p.unreadCount)}),[p,f,x,I]),t(d,o({},u,{active:E,displayImage:P,displayTitle:A,displayMessage:b,displayTime:V,unread:z,setActiveConversation:j}))):t(e,{})}export{u as ConversationPreview};
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
2
  import { ConversationPreviewUIComponentProps } from './ConversationPreview.js';
3
3
 
4
+ interface IPluginsRef {
5
+ closeMore?: () => void;
6
+ }
4
7
  declare function unMemoConversationPreviewContent<T extends ConversationPreviewUIComponentProps>(props: T): React.ReactElement;
5
8
  declare const ConversationPreviewContent: typeof unMemoConversationPreviewContent;
6
9
 
7
- export { ConversationPreviewContent, unMemoConversationPreviewContent };
10
+ export { ConversationPreviewContent, IPluginsRef, unMemoConversationPreviewContent };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t,{useRef as i,useState as r,useEffect as a}from"react";import{useTranslation as c}from"react-i18next";import{TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import{isPC as l}from"../../utils/env.js";import{Avatar as m}from"../Avatar/Avatar.js";import{Icon as v}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{Plugins as d}from"../Plugins/index.js";import{useConversation as p}from"../../hooks/useConversation.js";import{useTUIKitContext as h}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function f(t){var f,C=t.conversation,I=t.Avatar,N=void 0===I?m:I,T=t.displayImage,x=t.displayTitle,g=t.displayMessage,w=t.displayTime,j=t.unread,b=t.active,y=t.activeConversationID,D=t.setActiveConversationID,P=t.setActiveConversation,k=c().t,M=i(null),U=h("ConversationPreviewContent"),A=U.chat,E=U.conversation,F=p(A),z=F.pinConversation,K=F.deleteConversation,L=b?"conversation-preview-content--active":"",O=j&&j>=1?"conversation-preview-content--unread":"",R=C.isPinned?"conversation-preview-content--pin":"",S=r(!1),q=S[0],B=S[1],G=i(null);a((function(){y!==C.conversationID&&B(!1)}),[y]);var H=function(e){if(!l){var n=C.conversationID;switch(D(n),e){case"touchstart":f=setTimeout(o,500);break;case"touchend":clearTimeout(f),setTimeout((function(){}),200)}}function o(){clearTimeout(f),B(!0)}},J=function(e,n){var o=C.conversationID,t=C.isPinned;switch(e.stopPropagation(),B(!1),G.current.closeMore(),n){case"pin":z({conversationID:o,isPinned:!t});break;case"delete":K(o),C===E&&P(null)}};return n("button",e({type:"button","aria-selected":b,role:"option",className:"conversation-preview-container ".concat(L," ").concat(O," ").concat(R),onClick:function(){s.switchConversation(null==C?void 0:C.conversationID),P&&P(C),(null==M?void 0:M.current)&&M.current.blur()},onMouseEnter:function(){B(!0)},onMouseLeave:function(){B(!1)},onTouchStart:function(){return H("touchstart")},onTouchEnd:function(){return H("touchend")},ref:M},{children:[o("div",e({className:"avatar"},{children:o(N,{image:T,name:x,size:40})})),n("div",e({className:"content"},{children:[o("div",e({className:"title text-ellipsis"},{children:x})),o("div",e({className:"message"},{children:g}))]})),n("div",e({className:"external"},{children:[o("div",j?e({className:"unread"},{children:j<=99?j:"99+"}):{className:"unread"}),o("div",q?e({className:"".concat(q?"more--hover":"more")},{children:o(d,{customClass:"more-handle-box",ref:G,plugins:[o("div",e({role:"presentation",className:"more-handle-item",onClick:function(e){J(e,"pin")}},{children:k(C.isPinned?"TUIConversation.Unpin":"TUIConversation.Pin")})),o("div",e({className:"more-handle-item",style:{color:"#FF584C"},onClick:function(e){J(e,"delete")},role:"presentation"},{children:k("TUIConversation.Delete")}))],showNumber:0,MoreIcon:o(v,{className:"icon-more",width:16,height:16,type:u.MORE})})}):e({className:"time"},{children:w}))]}))]}))}var C=t.memo(f);export{C as ConversationPreviewContent,f as unMemoConversationPreviewContent};
1
+ import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t,{useRef as i,useState as r,useEffect as a}from"react";import{useTranslation as c}from"react-i18next";import{TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import{isPC as l}from"../../utils/env.js";import{Avatar as m}from"../Avatar/Avatar.js";import{Icon as v}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{Plugins as d}from"../Plugins/index.js";import{useConversation as p}from"../../hooks/useConversation.js";import{useTUIKitContext as h}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function f(t){var f,C=t.conversation,I=t.Avatar,N=void 0===I?m:I,T=t.displayImage,x=t.displayTitle,g=t.displayMessage,w=t.displayTime,j=t.unread,b=t.active,y=t.activeConversationID,D=t.setActiveConversationID,M=t.setActiveConversation,P=c().t,k=i(null),U=h("ConversationPreviewContent"),A=U.chat,E=U.conversation,F=p(A),z=F.pinConversation,K=F.deleteConversation,L=b?"conversation-preview-content--active":"",O=j&&j>=1?"conversation-preview-content--unread":"",R=C.isPinned?"conversation-preview-content--pin":"",S=r(!1),q=S[0],B=S[1],G=i(null);a((function(){y!==C.conversationID&&B(!1)}),[y]);var H=function(e){if(!l){var n=C.conversationID;switch(D&&D(n),e){case"touchstart":f=setTimeout(o,500);break;case"touchend":clearTimeout(f),setTimeout((function(){}),200)}}function o(){clearTimeout(f),B(!0)}},J=function(e,n){var o,t=C.conversationID,i=C.isPinned;switch(e.stopPropagation(),B(!1),(null===(o=null==G?void 0:G.current)||void 0===o?void 0:o.closeMore)&&G.current.closeMore(),n){case"pin":z({conversationID:t,isPinned:!i});break;case"delete":K(t),M&&C===E&&M(void 0)}};return n("button",e({type:"button","aria-selected":b,role:"option",className:"conversation-preview-container ".concat(L," ").concat(O," ").concat(R),onClick:function(){s.switchConversation(null==C?void 0:C.conversationID),M&&M(C),(null==k?void 0:k.current)&&k.current.blur()},onMouseEnter:function(){B(!0)},onMouseLeave:function(){B(!1)},onTouchStart:function(){return H("touchstart")},onTouchEnd:function(){return H("touchend")},ref:k},{children:[o("div",e({className:"avatar"},{children:o(N,{image:T,name:x,size:40})})),n("div",e({className:"content"},{children:[o("div",e({className:"title text-ellipsis"},{children:x})),o("div",e({className:"message"},{children:g}))]})),n("div",e({className:"external"},{children:[o("div",j?e({className:"unread"},{children:j<=99?j:"99+"}):{className:"unread"}),o("div",q?e({className:"".concat(q?"more--hover":"more")},{children:o(d,{customClass:"more-handle-box",ref:G,plugins:[o("div",e({role:"presentation",className:"more-handle-item",onClick:function(e){J(e,"pin")}},{children:P(C.isPinned?"TUIConversation.Unpin":"TUIConversation.Pin")})),o("div",e({className:"more-handle-item",style:{color:"#FF584C"},onClick:function(e){J(e,"delete")},role:"presentation"},{children:P("TUIConversation.Delete")}))],showNumber:0,MoreIcon:o(v,{className:"icon-more",width:16,height:16,type:u.MORE})})}):e({className:"time"},{children:w}))]}))]}))}var C=t.memo(f);export{C as ConversationPreviewContent,f as unMemoConversationPreviewContent};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as r,jsx as a}from"react/jsx-runtime";import o from"@tencentcloud/chat";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as t,defaultUserAvatar as i}from"../Avatar/default.js";import{formatEmojiString as s}from"../TUIMessage/utils/emojiMap.js";import{getTimeStamp as c}from"../untils.js";var n=function(t,i,s){void 0===s&&(s="#147AFF");var c=u(t),n=c.name,l=c.nick,p=c.groupID,d=c.userID,m=t.type,f=t.remark,v="";switch(m){case o.TYPES.CONV_C2C:v=f||l||d;break;case o.TYPES.CONV_GROUP:v=n||p;break;default:v=""}var C,h;return i?(h=(C=v).toLocaleLowerCase().indexOf(i.toLocaleLowerCase()),r("div",{children:[a("span",{children:C.slice(0,h)}),a("span",e({style:{color:s}},{children:C.slice(h,h+i.length)})),a("span",{children:C.slice(h+i.length)})]})):v},l=function(e){var r=e.type,a=u(e).avatar,s=a;if(!a)switch(r){case o.TYPES.CONV_C2C:s=i;break;case o.TYPES.CONV_GROUP:default:s=t}return s},p=function(t,i,c){var n,l=t.lastMessage,p=t.type,u=l.fromAccount,d=l.nick,m=l.nameCard,f=l.isRevoked,v=l.messageForShow;l.type===o.TYPES.MSG_CUSTOM&&(null===(n=l.payload)||void 0===n?void 0:n.description)&&(v=l.payload.description);var C="";switch(p){case o.TYPES.CONV_GROUP:C=(null==l?void 0:l.fromAccount)===(null==i?void 0:i.userID)?"You":"".concat(m||d||u||""),C="".concat(C?"".concat(C,":"):"");break;case o.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[a("span",{children:C}),a("span",{children:l.isRevoked?"recalled a message":s(v,1)})]}))},u=function(e){if(!e)return null;var r={},a=e.type,t=e.groupProfile,i=e.userProfile;switch(a){case o.TYPES.CONV_C2C:r=i;break;case o.TYPES.CONV_GROUP:r=t;case o.TYPES.CONV_SYSTEM:}return r},d=function(e,r){var a=e.lastMessage;return c(1e3*a.lastTime,r)};export{l as getDisplayImage,p as getDisplayMessage,d as getDisplayTime,n as getDisplayTitle,u as getMessageProfile};
1
+ import{__assign as e}from"tslib";import{jsxs as r,jsx as a,Fragment as o}from"react/jsx-runtime";import t from"@tencentcloud/chat";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as i,defaultUserAvatar as s}from"../Avatar/default.js";import{formatEmojiString as c}from"../TUIMessage/utils/emojiMap.js";import{getTimeStamp as n}from"../untils.js";var l=function(i,s,c){void 0===c&&(c="#147AFF");var n=d(i),l=n.name,p=n.nick,u=n.groupID,m=n.userID,f=i.type,v=i.remark,C="";switch(f){case t.TYPES.CONV_C2C:C=v||p||m;break;case t.TYPES.CONV_GROUP:C=l||u;break;default:C=""}var h,O,P;return s?(O=(h=C).toLocaleLowerCase(),""===(P=s&&O.indexOf(s.toLocaleLowerCase()))?a(o,{}):r("div",{children:[a("span",{children:h.slice(0,P)}),a("span",e({style:{color:c}},{children:P&&h.slice(P,P+s.length)})),a("span",{children:P&&h.slice(P+s.length)})]})):C},p=function(e){var r=e.type,a=d(e).avatar,o=a;if(!a)switch(r){case t.TYPES.CONV_C2C:o=s;break;case t.TYPES.CONV_GROUP:default:o=i}return o},u=function(o,i,s){var n,l=o.lastMessage,p=o.type,u=l.fromAccount,d=l.nick,m=l.nameCard,f=l.isRevoked,v=l.messageForShow;l.type===t.TYPES.MSG_CUSTOM&&(null===(n=l.payload)||void 0===n?void 0:n.description)&&(v=l.payload.description);var C="";switch(p){case t.TYPES.CONV_GROUP:C=(null==l?void 0:l.fromAccount)===(null==i?void 0:i.userID)?"You":"".concat(m||d||u||""),C="".concat(C?"".concat(C,":"):"");break;case t.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[a("span",{children:C}),a("span",{children:l.isRevoked?"recalled a message":c(v,1)})]}))},d=function(e){if(!e)return null;var r={},a=e.type,o=e.groupProfile,i=e.userProfile;switch(a){case t.TYPES.CONV_C2C:r=i;break;case t.TYPES.CONV_GROUP:r=o;case t.TYPES.CONV_SYSTEM:}return r},m=function(e,r){var a=e.lastMessage;return n(1e3*a.lastTime,r)};export{p as getDisplayImage,u as getDisplayMessage,m as getDisplayTime,l as getDisplayTitle,d as getMessageProfile};
@@ -1,5 +1,6 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { InputProps } from '../Input/Input.js';
2
3
 
3
- declare function ConversationSearchInput(props: InputProps): JSX.Element;
4
+ declare function ConversationSearchInput(props: InputProps): react_jsx_runtime.JSX.Element;
4
5
 
5
6
  export { ConversationSearchInput };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{ConversationPreview as s}from"../ConversationPreview/ConversationPreview.js";import"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../utils/env.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as i}from"../Icon/type.js";import"@tencentcloud/chat";import"../TUIKit/TUIKit.js";import"../../context/TUIMessageContext.js";import"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"date-fns";import"date-fns/locale";import"../../constants.js";import"../TUIMessage/hooks/useMessageReply.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import"../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../TUIProfile/TUIProfileDefault.js";import"../Switch/Switch.js";function n(n){var a=n.result,c=n.searchValue,m=n.Preview;return t("div",{children:0===(null==a?void 0:a.length)?o("div",e({className:"conversation-search-result no-result"},{children:[t(r,{className:"no-result-icon",type:i.CRY,width:42,height:42}),t("span",e({className:"no-result-message"},{children:'No results for "'.concat(c,'"')}))]})):a.map((function(o){return t(s,e({searchValue:c},{conversation:o,Preview:m}),o.conversationID)}))})}export{n as ConversationSearchResult};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{ConversationPreview as s}from"../ConversationPreview/ConversationPreview.js";import"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../utils/env.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as i}from"../Icon/type.js";import"@tencentcloud/chat";import"../TUIKit/TUIKit.js";import"../../context/TUIMessageContext.js";import"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"date-fns";import"date-fns/locale";import"../../constants.js";import"../TUIMessage/hooks/useMessageReply.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import"../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../TUIProfile/TUIProfileDefault.js";function n(n){var a=n.result,m=n.searchValue,c=n.Preview;return t("div",{children:0===(null==a?void 0:a.length)?o("div",e({className:"conversation-search-result no-result"},{children:[t(r,{className:"no-result-icon",type:i.CRY,width:42,height:42}),t("span",e({className:"no-result-message"},{children:'No results for "'.concat(m,'"')}))]})):a.map((function(o){return t(s,e({searchValue:m},{conversation:o,Preview:c}),o.conversationID)}))})}export{n as ConversationSearchResult};
@@ -1,3 +1,4 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { PropsWithChildren } from 'react';
2
3
 
3
4
  interface DivWithEditProps {
@@ -9,8 +10,8 @@ interface DivWithEditProps {
9
10
  type?: string;
10
11
  isEdit?: boolean;
11
12
  toggle?: (name: string) => void;
12
- close?: () => void;
13
+ close: () => void;
13
14
  }
14
- declare function DivWithEdit<T extends DivWithEditProps>(props: PropsWithChildren<T>): JSX.Element;
15
+ declare function DivWithEdit<T extends DivWithEditProps>(props: PropsWithChildren<T>): react_jsx_runtime.JSX.Element;
15
16
 
16
17
  export { DivWithEdit };
@@ -1 +1 @@
1
- import{__assign as i}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o,useLayoutEffect as c}from"react";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Popup as m}from"../Popup/index.js";import{WithSelect as n}from"./WithSelect.js";import{WithText as a}from"./WithText.js";var l={text:a,select:n};function d(n){var d=n.value,p=n.className,h=n.classEditName,f=n.confirm,u=n.type,v=n.isEdit,N=n.toggle,j=n.children,w=n.name,x=n.close,I=o(d),g=I[0],y=I[1],E=l[u]||a;c((function(){y(d)}),[d]);return e("div",i({className:"div-with-edit ".concat(p)},{children:t(m,i({className:"div-with-edit-popup",show:!0,close:x},{children:[!v&&t("div",i({className:"show"},{children:[e("p",{children:g||"-"}),e("div",i({className:"icon"},{children:e(r,{className:"icon-edit",width:12,height:12,type:s.EDIT,onClick:function(){N(w)}})}))]})),v&&e(E,i({value:g,confirm:function(i){f({name:w,value:i})},className:h,close:x},{children:j}))]}))}))}export{d as DivWithEdit};
1
+ import{__assign as i}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o,useLayoutEffect as c}from"react";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Popup as m}from"../Popup/index.js";import{WithSelect as n}from"./WithSelect.js";import{WithText as a}from"./WithText.js";var l={text:a,select:n};function d(n){var d=n.value,p=n.className,h=n.classEditName,f=n.confirm,u=n.type,v=n.isEdit,N=n.toggle,j=n.children,w=n.name,x=n.close,I=o(d),g=I[0],y=I[1],E=l[u]||a;c((function(){y(d)}),[d]);return e("div",i({className:"div-with-edit ".concat(p)},{children:t(m,i({className:"div-with-edit-popup",show:!0,close:x},{children:[!v&&t("div",i({className:"show"},{children:[e("p",{children:g||"-"}),e("div",i({className:"icon"},{children:e(r,{className:"icon-edit",width:12,height:12,type:s.EDIT,onClick:function(){N&&w&&N(w)}})}))]})),v&&e(E,i({value:g,confirm:function(i){f&&f({name:w,value:i})},className:h,close:x},{children:j}))]}))}))}export{d as DivWithEdit};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useRef as r,useState as e,useLayoutEffect as i}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";function m(m){var u=m.value,l=m.confirm,f=m.className,s=r(),p=e(u),v=p[0],d=p[1];i((function(){var t;null===(t=null==s?void 0:s.current)||void 0===t||t.focus(),d(v)}),[s,u]);return o("div",t({className:"edit ".concat(f)},{children:[n("input",{ref:s,type:"text",value:v,onChange:function(t){d(t.target.value)}}),n(c,{className:"icon",width:15,height:10.5,type:a.CONFIRM,onClick:function(){l(v)}})]}))}export{m as WithText};
1
+ import{__assign as t}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useRef as r,useState as e,useLayoutEffect as i}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";function m(m){var u=m.value,l=m.confirm,f=m.className,s=r(),p=e(u),v=p[0],d=p[1];i((function(){var t;null===(t=null==s?void 0:s.current)||void 0===t||t.focus(),d(v)}),[s,u]);return o("div",t({className:"edit ".concat(f)},{children:[n("input",{ref:s,type:"text",value:v,onChange:function(t){d(t.target.value)}}),n(c,{className:"icon",width:15,height:10.5,type:a.CONFIRM,onClick:function(){l&&l(v)}})]}))}export{m as WithText};
@@ -1,10 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { PropsWithChildren } from 'react';
2
3
 
3
4
  interface EmptyStateIndicatorProps {
4
5
  /** List Type: conversation | message */
5
6
  listType?: 'conversation' | 'message' | 'chat';
6
7
  }
7
- declare function UnMemoizedEmptyStateIndicator<T extends EmptyStateIndicatorProps>(props: PropsWithChildren<T>): JSX.Element;
8
+ declare function UnMemoizedEmptyStateIndicator<T extends EmptyStateIndicatorProps>(props: PropsWithChildren<T>): react_jsx_runtime.JSX.Element | null;
8
9
  declare const EmptyStateIndicator: typeof UnMemoizedEmptyStateIndicator;
9
10
 
10
11
  export { EmptyStateIndicator, EmptyStateIndicatorProps };
@@ -1,3 +1,4 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
  import { IconTypes } from './type.js';
3
4
 
@@ -9,6 +10,6 @@ interface IconProps {
9
10
  onClick?: (event: React.BaseSyntheticEvent) => void;
10
11
  className?: string;
11
12
  }
12
- declare function Icon(props: React.PropsWithChildren<IconProps>): JSX.Element;
13
+ declare function Icon(props: React.PropsWithChildren<IconProps>): react_jsx_runtime.JSX.Element;
13
14
 
14
15
  export { Icon, IconProps, changeTypeToIconClassName };
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as i}from"react/jsx-runtime";import{ICON_CONFIG as n}from"./config.js";var o=function(t){var o=n[t].url||"";return i("img",{className:"icon-image icon-image-".concat(t),src:o,alt:t})},c=function(t){var i;return(null===(i=n[t])||void 0===i?void 0:i.className)||""};function r(n){var r=n.children,e=n.type,a=n.height,s=void 0===a?24:a,m=n.width,l=void 0===m?24:m,p=n.onClick,d=n.className,f=void 0===d?"":d,g={width:"string"==typeof l?l:"".concat(l,"px"),minWidth:"string"==typeof l?l:"".concat(l,"px"),height:"string"==typeof s?s:"".concat(s,"px"),minHeight:"string"==typeof s?s:"".concat(s,"px")};return i("div",t({className:"tui-kit-icon ".concat(c(e)," ").concat(f),role:"button",tabIndex:0,style:g,onClick:p},{children:r||o(e)}))}export{r as Icon,c as changeTypeToIconClassName};
1
+ import{__assign as t}from"tslib";import{jsx as i}from"react/jsx-runtime";import{ICON_CONFIG as n}from"./config.js";var o=function(t){var o=n[t].url||"";return i("img",{className:"icon-image icon-image-".concat(t),src:o,alt:t})},c=function(t){var i;return(null===(i=n[t])||void 0===i?void 0:i.className)||""};function r(n){var r=n.children,e=n.type,a=n.height,s=void 0===a?24:a,m=n.width,l=void 0===m?24:m,p=n.onClick,d=n.className,f=void 0===d?"":d,g={width:"string"==typeof l?l:"".concat(l,"px"),minWidth:"string"==typeof l?l:"".concat(l,"px"),height:"string"==typeof s?s:"".concat(s,"px"),minHeight:"string"==typeof s?s:"".concat(s,"px")};return i("div",t({className:"tui-kit-icon ".concat(e&&c(e)," ").concat(f),role:"button",tabIndex:0,style:g,onClick:p},{children:r||e&&o(e)}))}export{r as Icon,c as changeTypeToIconClassName};
@@ -1 +1 @@
1
- import{__assign as n}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import e,{useState as r,useRef as u,useImperativeHandle as i}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";var a=e.forwardRef((function(e,a){var d=e.className,f=void 0===d?"":d,s=e.customClassName,v=void 0===s?"":s,p=e.placeholder,m=e.clearable,b=void 0!==m&&m,h=e.prefix,x=e.suffix,g=e.onChange,k=e.onBlur,N=e.onFocus,y=e.onKeyDown,C=e.value,j=void 0===C?"":C,w=e.border,D=void 0===w?"":w,E=e.disabled,I=void 0!==E&&E,L=e.maxLength,B=void 0===L?void 0:L,F=r(!1),K=F[0],O=F[1],R=["Enter","NumpadEnter"],A=r(j),T=A[0],q=A[1],z=u(null),G=function(){z.current&&z.current.focus()};return i(a,(function(){return{focus:G,blur:function(){var n;null===(n=z.current)||void 0===n||n.blur()},input:z.current}})),t("div",n({className:"".concat(f," tui-kit-input-container")},{children:o("div",n({className:"tui-kit-input-box ".concat(D&&"tui-kit-input-border--".concat(D)," ").concat(K?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[h,t("input",{maxLength:B,disabled:I,className:"tui-kit-input ".concat(v),placeholder:p,ref:z,value:T,onFocus:function(n){O(!0),null==N||N(n)},onBlur:function(n){O(!1),null==k||k(n)},onChange:function(n){q(n.target.value),z.current&&(null==g||g(n))},onKeyDown:function(n){R.indexOf(null==n?void 0:n.key)>-1&&y&&(null==n||n.preventDefault(),y(n))}}),x,b&&T&&t(c,{type:l.CLEAR,height:13,width:13,onClick:function(n){q(""),G();var t=z.current.cloneNode(!0),o=Object.create(n,{target:{value:t},currentTarget:{value:t}});t.value="",null==g||g(o)}})]}))}))}));export{a as Input};
1
+ import{__assign as n}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import e,{useState as u,useRef as i,useImperativeHandle as r}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";var a=e.forwardRef((function(e,a){var d=e.className,v=void 0===d?"":d,f=e.customClassName,s=void 0===f?"":f,p=e.placeholder,m=e.clearable,b=void 0!==m&&m,h=e.prefix,x=e.suffix,g=e.onChange,k=e.onBlur,N=e.onFocus,y=e.onKeyDown,C=e.value,j=void 0===C?"":C,w=e.border,D=void 0===w?"":w,E=e.disabled,I=void 0!==E&&E,L=e.maxLength,B=void 0===L?void 0:L,F=u(!1),K=F[0],O=F[1],R=["Enter","NumpadEnter"],A=u(j),T=A[0],q=A[1],z=i(null),G=function(){z.current&&z.current.focus()};return r(a,(function(){return{focus:G,blur:function(){var n;null===(n=z.current)||void 0===n||n.blur()},input:z.current}})),t("div",n({className:"".concat(v," tui-kit-input-container")},{children:o("div",n({className:"tui-kit-input-box ".concat(D&&"tui-kit-input-border--".concat(D)," ").concat(K?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[h,t("input",{maxLength:B,disabled:I,className:"tui-kit-input ".concat(s),placeholder:p,ref:z,value:T,onFocus:function(n){O(!0),null==N||N(n)},onBlur:function(n){O(!1),null==k||k(n)},onChange:function(n){q(n.target.value),z.current&&(null==g||g(n))},onKeyDown:function(n){R.indexOf(null==n?void 0:n.key)>-1&&y&&(null==n||n.preventDefault(),y(n))}}),x,b&&T&&t(c,{type:l.CLEAR,height:13,width:13,onClick:function(n){!function(n){var t;q(""),G();var o=null===(t=null==z?void 0:z.current)||void 0===t?void 0:t.cloneNode(!0),e=Object.create(n,{target:{value:o},currentTarget:{value:o}});o.value="",null==g||g(e)}(n)}})]}))}))}));export{a as Input};
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  interface PopupProps {
4
4
  className?: string;
5
- onClick?: (e?: any) => void;
5
+ onClick?: (e: Event) => void;
6
6
  }
7
7
  declare function Model<T extends PopupProps>(props: React.PropsWithChildren<T>): React.ReactElement;
8
8
 
@@ -1 +1 @@
1
- import{__assign as r}from"tslib";import{jsx as o}from"react/jsx-runtime";function t(t){var e=t.className,n=t.onClick,c=t.children;return o("div",r({role:"button",tabIndex:0,className:"model ".concat(e),onClick:n},{children:c}))}export{t as Model};
1
+ import{__assign as r}from"tslib";import{jsx as n}from"react/jsx-runtime";function t(t){var o=t.className,e=t.onClick,c=t.children;return n("div",r({role:"button",tabIndex:0,className:"model ".concat(o),onClick:function(r){return e&&e(r)}},{children:c}))}export{t as Model};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import{forwardRef as t,useImperativeHandle as i,useRef as r,useState as l}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Popup as u}from"../Popup/index.js";import{usePluginsElement as a}from"./hooks/usePluginsElement.js";function m(t,m){var d=t.plugins,p=void 0===d?[]:d,h=t.showNumber,f=t.MoreIcon,g=t.className,v=void 0===g?"":g,N=t.style,b=t.customClass,w=void 0===b?"":b,x=t.root,y=t.handleVisible;i(m,(function(){return{closeMore:function(e){B(!1)}}}));var P=a({plugins:p,showNumber:h}),j=P.showPicker,I=P.elements,C=r(null),k=l(!1),E=k[0],B=k[1],D=function e(n){n.stopPropagation(),B(!E),E||C.current.offsetParent.removeEventListener("scroll",e)};return(j.length>0||(null==I?void 0:I.length)>0)&&n("ul",e({className:"plugin ".concat(v)},{children:[(null==j?void 0:j.length)>0&&j.map((function(n,t){var i="".concat(n).concat(t);return o("li",e({className:"plugin-item"},{children:n}),i)})),(null==I?void 0:I.length)>0&&n("div",e({className:"plugin-popup",ref:C},{children:[n("div",e({role:"menuitem",tabIndex:0,className:"more",onClick:D},{children:[!f&&o(c,{width:20,height:20,type:s.ADD}),f&&f]})),o(u,e({className:"plugin-popup-box ".concat(w),style:N,show:E,close:D,root:x,handleVisible:function(n){if(y){var o=C.current.children[1].getBoundingClientRect(),t=o.width,i=o.height,r=C.current.getBoundingClientRect(),l=r.x,c=void 0===l?0:l,s=r.y,u=void 0===s?0:s;C.current.offsetParent.addEventListener("scroll",D),y(e(e({},n),{width:t,height:i,x:c,y:u}))}}},{children:o("ul",{children:I.map((function(n,t){var i="".concat(n).concat(t);return o("li",e({className:"plugin-item"},{children:n}),i)}))})}))]}))]}))}var d=t(m);export{d as Plugins};
1
+ import{__assign as n}from"tslib";import{jsxs as o,jsx as e}from"react/jsx-runtime";import{forwardRef as i,useImperativeHandle as l,useRef as t,useState as r}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{Popup as s}from"../Popup/index.js";import{usePluginsElement as d}from"./hooks/usePluginsElement.js";function a(i,a){var m=i.plugins,v=void 0===m?[]:m,p=i.showNumber,h=i.MoreIcon,f=i.className,g=void 0===f?"":f,N=i.style,b=i.customClass,w=void 0===b?"":b,x=i.root,y=i.handleVisible;l(a,(function(){return{closeMore:function(n){B(!1)}}}));var P=d({plugins:v,showNumber:p}),j=P.showPicker,I=P.elements,C=t(null),k=r(!1),E=k[0],B=k[1],D=function n(o){var e,i;o.stopPropagation(),B(!E),E||null===(i=null===(e=null==C?void 0:C.current)||void 0===e?void 0:e.offsetParent)||void 0===i||i.removeEventListener("scroll",n)};return(j&&j.length>0||I&&(null==I?void 0:I.length)>0)&&o("ul",n({className:"plugin ".concat(g)},{children:[j&&(null==j?void 0:j.length)>0&&j.map((function(o,i){var l="".concat(o).concat(i);return e("li",n({className:"plugin-item"},{children:o}),l)})),I&&(null==I?void 0:I.length)>0&&o("div",n({className:"plugin-popup",ref:C},{children:[o("div",n({role:"menuitem",tabIndex:0,className:"more",onClick:D},{children:[!h&&e(c,{width:20,height:20,type:u.ADD}),h&&h]})),e(s,n({className:"plugin-popup-box ".concat(w),style:N,show:E,close:D,root:x,handleVisible:function(o){var e,i,l,t;if(y){var r=(null===(e=null==C?void 0:C.current)||void 0===e?void 0:e.children[1].getBoundingClientRect())||{},c=r.width,u=r.height,s=(null===(i=null==C?void 0:C.current)||void 0===i?void 0:i.getBoundingClientRect())||{},d=s.x,a=void 0===d?0:d,m=s.y,v=void 0===m?0:m;null===(t=null===(l=C.current)||void 0===l?void 0:l.offsetParent)||void 0===t||t.addEventListener("scroll",D),y(n(n({},o),{width:c,height:u,x:a,y:v}))}}},{children:e("ul",{children:I.map((function(o,i){var l="".concat(o).concat(i);return e("li",n({className:"plugin-item"},{children:o}),l)}))})}))]}))]}))}var m=i(a);export{m as Plugins};
@@ -4,7 +4,7 @@ interface PopupProps {
4
4
  className?: string;
5
5
  style?: any;
6
6
  show?: boolean;
7
- close?: (e: any) => void;
7
+ close: (e: any) => void;
8
8
  root?: any;
9
9
  handleVisible?: (isVisible: any) => void;
10
10
  }
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import{useRef as n,useState as o,useLayoutEffect as r}from"react";function i(i){var u=i.show,l=i.close,s=i.children,c=i.className,d=i.style,v=i.root,a=i.handleVisible,m=n(),p=o(!1),h=p[0],f=p[1];r((function(){var e,t;return u?(window.addEventListener("mouseup",l,!1),null===(e=null==m?void 0:m.current)||void 0===e||e.addEventListener("mouseup",w)):(window.removeEventListener("mouseup",l,!1),null===(t=null==m?void 0:m.current)||void 0===t||t.removeEventListener("mouseup",w)),function(){var e;window.removeEventListener("mouseup",l,!1),null===(e=null==m?void 0:m.current)||void 0===e||e.removeEventListener("mouseup",w)}}),[u]),r((function(){var t=new IntersectionObserver((function(t){var n=t[0],o=n.boundingClientRect,r=n.rootBounds,i=n.intersectionRatio,u=m.current.getBoundingClientRect()||{},l=(null==v?void 0:v.getBoundingClientRect())||{},s=e(e({},o),u),c=e(e({},r),l);a&&i<1&&a({left:s.left-s.width<c.left,top:s.bottom+s.height<c.bottom,width:s.width,height:s.height}),f(!0)}),{root:v,threshold:[1]});return m&&u&&t.observe(null==m?void 0:m.current),function(){t.disconnect(),f(!1)}}),[m,u]);var w=function(e){e.stopPropagation()};return u&&t("div",e({role:"button",tabIndex:0,style:d,className:"popup ".concat(c," ").concat(h&&"popup-show"),ref:m},{children:s}))}export{i as Popup};
1
+ import{__assign as e}from"tslib";import{jsx as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useState as r,useLayoutEffect as i}from"react";function u(u){var l=u.show,d=u.close,c=u.children,s=u.className,v=u.style,a=u.root,m=u.handleVisible,p=o(),h=r(!1),f=h[0],w=h[1];i((function(){var e,t;return l?(window.addEventListener("mouseup",d,!1),null===(e=null==p?void 0:p.current)||void 0===e||e.addEventListener("mouseup",b)):(window.removeEventListener("mouseup",d,!1),null===(t=null==p?void 0:p.current)||void 0===t||t.removeEventListener("mouseup",b)),function(){var e;window.removeEventListener("mouseup",d,!1),null===(e=null==p?void 0:p.current)||void 0===e||e.removeEventListener("mouseup",b)}}),[l]),i((function(){var t=new IntersectionObserver((function(t){var n,o=t[0],r=o.boundingClientRect,i=o.rootBounds,u=o.intersectionRatio,l=(null===(n=p.current)||void 0===n?void 0:n.getBoundingClientRect())||{},d=(null==a?void 0:a.getBoundingClientRect())||{},c=e(e({},r),l),s=e(e({},i),d);m&&u<1&&m({left:c.left-c.width<s.left,top:c.bottom+c.height<s.bottom,width:c.width,height:c.height}),w(!0)}),{root:a,threshold:[1]});return(null==p?void 0:p.current)&&l&&t.observe(null==p?void 0:p.current),function(){t.disconnect(),w(!1)}}),[p,l]);var b=function(e){e.stopPropagation()};return t(n,{children:l&&t("div",e({role:"button",tabIndex:0,style:v,className:"popup ".concat(s," ").concat(f&&"popup-show"),ref:p},{children:c}))})}export{u as Popup};
@@ -1,3 +1,4 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
 
3
4
  interface Props {
@@ -6,11 +7,6 @@ interface Props {
6
7
  checkedColor?: string;
7
8
  className?: string;
8
9
  }
9
- declare function Switch(props: Props): JSX.Element;
10
- declare namespace Switch {
11
- var defaultProps: {
12
- checkedColor: string;
13
- };
14
- }
10
+ declare function Switch(props: Props): react_jsx_runtime.JSX.Element;
15
11
 
16
12
  export { Switch };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as c,jsxs as r}from"react/jsx-runtime";import{useRef as t}from"react";import{creteNewId as o}from"./utils/newId.js";function s(s){var i=s.checked,l=s.onChange,a=s.checkedColor,n=s.className,m=t(o());return c("div",e({className:"self-ui-switch"},{children:r("label",e({style:{backgroundColor:i?a:void 0},className:"self-ui-switch-label ".concat(n),htmlFor:m.current},{children:[c("input",{checked:i,onChange:l,id:m.current,className:"self-ui-switch-input",type:"checkbox"}),c("span",{className:"self-ui-switch-button"})]}))}))}s.defaultProps={checkedColor:"#34C759"};export{s as Switch};
1
+ import{__assign as e}from"tslib";import{jsx as c,jsxs as t}from"react/jsx-runtime";import{useRef as r}from"react";import{creteNewId as i}from"./utils/newId.js";function s(s){var o=s.checked,l=s.onChange,a=s.checkedColor,n=void 0===a?"#34C759":a,m=s.className,u=r(i());return c("div",e({className:"self-ui-switch"},{children:t("label",e({style:{backgroundColor:o?n:void 0},className:"self-ui-switch-label ".concat(m),htmlFor:u.current},{children:[c("input",{checked:o,onChange:l,id:u.current,className:"self-ui-switch-input",type:"checkbox"}),c("span",{className:"self-ui-switch-button"})]}))}))}export{s as Switch};
@@ -1 +1 @@
1
- import{__assign as e,__awaiter as t,__generator as s}from"tslib";import o,{createElement as a,useReducer as n,useRef as i,useEffect as r,useMemo as u}from"react";import{jsx as c,jsxs as g,Fragment as m}from"react/jsx-runtime";import{TUIStore as p,StoreName as d,TUIChatService as l}from"@tencentcloud/chat-uikit-engine";import{JSONStringToParse as M}from"../untils.js";import{useTUIKitContext as I}from"../../context/TUIKitContext.js";import{TUIChatStateContextProvider as f}from"../../context/TUIChatStateContext.js";import{TUIChatActionProvider as h}from"../../context/TUIChatActionContext.js";import{ComponentProvider as v}from"../../context/ComponentContext.js";import T from"./hooks/useCreateTUIChatStateContext.js";import{TUIMessage as C}from"../TUIMessage/TUIMessage.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import{CONSTANT_DISPATCH_TYPE as U}from"../../constants.js";import{chatReducer as j,initialState as S}from"./TUIChatState.js";import{useHandleMessageList as x}from"./hooks/useHandleMessageList.js";import{useHandleMessage as L}from"./hooks/useHandleMessage.js";import{TUIChatHeader as E}from"../TUIChatHeader/TUIChatHeader.js";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"../../utils/env.js";import"../../context/TUIMessageContext.js";import{TUIMessageList as P}from"../TUIMessageList/TUIMessageList.js";import{TUIMessageInput as y}from"../TUIMessageInput/TUIMessageInput.js";import"react-i18next";import{EmptyStateIndicator as H}from"../EmptyStateIndicator/EmptyStateIndicator.js";function A(t){var s=t.conversation,o=t.EmptyPlaceholder,n=void 0===o?c(H,{listType:"chat"}):o,i=I("TUIChat"),r=i.conversation,u=i.chat,g=s||r;return(null==g?void 0:g.conversationID)?a(D,e({chat:u},t,{conversation:g,key:g.conversationID})):n}function D(o){var a=this,I=o.chat,H=o.conversation,A=o.className,D=o.children,k=o.TUIMessage,_=o.TUIChatHeader,R=o.TUIMessageInput,N=o.InputPlugins,w=o.MessagePlugins,F=o.MessageContext,G=o.MessageCustomPlugins,O=o.MessageTextPlugins,Q=o.InputQuote;o.onMessageRecevied,o.sendMessage;var V=o.revokeMessage;o.selectedConversation;var b=o.filterMessage,K=o.messageConfig,q=o.cloudCustomData,z=o.TUIMessageInputConfig,B=o.TUIMessageListConfig,J=n(j,e(e({},S),{conversation:H})),W=J[0],X=J[1],Y=i(null),Z=i(),$=T(e({chat:I,conversation:H,messageListRef:Y,textareaRef:Z,messageConfig:K,cloudCustomData:q,TUIMessageInputConfig:z,TUIMessageListConfig:B},W)),ee=x({chat:I,conversation:H,state:W,dispatch:X,filterMessage:b}),te=ee.editLocalMessage,se=ee.updateUploadPendingMessageList,oe=L({state:W,dispatch:X}),ae=oe.operateMessage,ne=oe.setAudioSource,ie=oe.setVideoSource,re=oe.setHighlightedMessageId,ue=oe.setActiveMessageID;r((function(){return p.watch(d.CHAT,{messageList:ce,isCompleted:ge}),function(){p.unwatch(d.CHAT,{messageList:ce,isCompleted:ge})}}),[]);var ce=function(e){var t=e.filter((function(e){return!e.isDeleted}));X({type:U.SET_MESSAGELIST,value:b?b(t):t})},ge=function(e){e&&X({type:U.SET_NO_MORE,value:e})},me=function(){return t(a,void 0,void 0,(function(){return s(this,(function(e){return l.getMessageList(),[2]}))}))},pe=function(e){return t(a,void 0,void 0,(function(){var t;return s(this,(function(s){return"TIMCustomElem"===e.type&&7===(null===(t=M(e.payload.data))||void 0===t?void 0:t.src)||W.firstSendMessage||X({type:U.SET_FIRST_SEND_MESSAGE,value:e}),[2]}))}))},de=u((function(){return{editLocalMessage:te,operateMessage:ae,loadMore:me,revokeMessage:V,setAudioSource:ne,setVideoSource:ie,setHighlightedMessageId:re,setActiveMessageID:ue,updateUploadPendingMessageList:se,setFirstSendMessage:pe}}),[te,ae,me,V,ne,ie,re,ue,se,pe]),le=u((function(){return{TUIMessage:k||C,MessageContext:F,InputPlugins:N,MessagePlugins:w,MessageCustomPlugins:G,MessageTextPlugins:O,TUIChatHeader:_,TUIMessageInput:R,InputQuote:Q}}),[]);return c("div",e({className:"chat ".concat(A)},{children:c(f,e({value:$},{children:c(h,e({value:de},{children:c(v,e({value:le},{children:D||g(m,{children:[c(E,{}),c(P,{}),c(y,{})]})}))}))}))}))}var k=o.memo(A);export{k as TUIChat};
1
+ import{__assign as e,__awaiter as t,__generator as s}from"tslib";import o,{createElement as a,useReducer as n,useRef as i,useEffect as r,useMemo as u}from"react";import{jsx as c,jsxs as g,Fragment as m}from"react/jsx-runtime";import{TUIStore as p,StoreName as d,TUIChatService as l}from"@tencentcloud/chat-uikit-engine";import{JSONStringToParse as M}from"../untils.js";import{useTUIKitContext as I}from"../../context/TUIKitContext.js";import{TUIChatStateContextProvider as f}from"../../context/TUIChatStateContext.js";import{TUIChatActionProvider as h}from"../../context/TUIChatActionContext.js";import{ComponentProvider as v}from"../../context/ComponentContext.js";import T from"./hooks/useCreateTUIChatStateContext.js";import{TUIMessage as C}from"../TUIMessage/TUIMessage.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import{CONSTANT_DISPATCH_TYPE as U}from"../../constants.js";import{chatReducer as j,initialState as S}from"./TUIChatState.js";import{useHandleMessageList as x}from"./hooks/useHandleMessageList.js";import{useHandleMessage as L}from"./hooks/useHandleMessage.js";import{TUIChatHeader as E}from"../TUIChatHeader/TUIChatHeader.js";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"../../utils/env.js";import"../../context/TUIMessageContext.js";import{TUIMessageList as P}from"../TUIMessageList/TUIMessageList.js";import{TUIMessageInput as y}from"../TUIMessageInput/TUIMessageInput.js";import"react-i18next";import{EmptyStateIndicator as H}from"../EmptyStateIndicator/EmptyStateIndicator.js";function A(t){var s=t.conversation,o=t.EmptyPlaceholder,n=void 0===o?c(H,{listType:"chat"}):o,i=I("TUIChat"),r=i.conversation,u=i.chat,g=s||r;return(null==g?void 0:g.conversationID)?a(D,e({chat:u},t,{conversation:g,key:g.conversationID})):n}function D(o){var a=this,I=o.chat,H=o.conversation,A=o.className,D=o.children,k=o.TUIMessage,_=o.TUIChatHeader,R=o.TUIMessageInput,N=o.InputPlugins,w=o.MessagePlugins,F=o.MessageContext,G=o.MessageCustomPlugins,O=o.MessageTextPlugins,Q=o.InputQuote;o.onMessageRecevied,o.sendMessage;var V=o.revokeMessage;o.selectedConversation;var b=o.filterMessage,K=o.messageConfig,q=o.cloudCustomData,z=o.TUIMessageInputConfig,B=o.TUIMessageListConfig,J=n(j,e(e({},S),{conversation:H})),W=J[0],X=J[1],Y=i(null),Z=i(),$=W&&T(e({chat:I,conversation:H,messageListRef:Y,textareaRef:Z,messageConfig:K,cloudCustomData:q,TUIMessageInputConfig:z,TUIMessageListConfig:B},W)),ee=x({chat:I,conversation:H,state:W,dispatch:X,filterMessage:b}),te=ee.editLocalMessage,se=ee.updateUploadPendingMessageList,oe=L({state:W,dispatch:X}),ae=oe.operateMessage,ne=oe.setAudioSource,ie=oe.setVideoSource,re=oe.setHighlightedMessageId,ue=oe.setActiveMessageID;r((function(){return p.watch(d.CHAT,{messageList:ce,isCompleted:ge}),function(){p.unwatch(d.CHAT,{messageList:ce,isCompleted:ge})}}),[]);var ce=function(e){var t=e.filter((function(e){return!e.isDeleted}));X({type:U.SET_MESSAGELIST,value:b?b(t):t})},ge=function(e){e&&X({type:U.SET_NO_MORE,value:e})},me=function(){return t(a,void 0,void 0,(function(){return s(this,(function(e){return l.getMessageList(),[2]}))}))},pe=function(e){return t(a,void 0,void 0,(function(){var t;return s(this,(function(s){return"TIMCustomElem"===e.type&&7===(null===(t=M(e.payload.data))||void 0===t?void 0:t.src)||W.firstSendMessage||X({type:U.SET_FIRST_SEND_MESSAGE,value:e}),[2]}))}))},de=u((function(){return{editLocalMessage:te,operateMessage:ae,loadMore:me,revokeMessage:V,setAudioSource:ne,setVideoSource:ie,setHighlightedMessageId:re,setActiveMessageID:ue,updateUploadPendingMessageList:se,setFirstSendMessage:pe}}),[te,ae,me,V,ne,ie,re,ue,se,pe]),le=u((function(){return{TUIMessage:k||C,MessageContext:F,InputPlugins:N,MessagePlugins:w,MessageCustomPlugins:G,MessageTextPlugins:O,TUIChatHeader:_,TUIMessageInput:R,InputQuote:Q}}),[]);return c("div",e({className:"chat ".concat(A)},{children:c(f,e({value:$},{children:c(h,e({value:de},{children:c(v,e({value:le},{children:D||g(m,{children:[c(E,{}),c(P,{}),c(y,{})]})}))}))}))}))}var k=o.memo(A);export{k as TUIChat};
@@ -1 +1 @@
1
- import{__assign as e,__spreadArray as s}from"tslib";import{CONSTANT_DISPATCH_TYPE as a}from"../../constants.js";import{handleUploadPendingMessage as t,handleEditMessage as r}from"./unitls.js";var E=function(E,S){switch(null==S?void 0:S.type){case a.SET_CONVERSATION_PRPFILE:return e(e({},E),{conversation:S.value});case a.SET_MESSAGELIST:return e(e({},E),{messageList:S.value});case a.SET_EDIT_MESSAGE:return e(e({},E),{messageList:s([],r(E.messageList,S.value),!0)});case a.SET_IS_COMPLETE:return e(e({},E),{isCompleted:S.value});case a.RESET:return e({},u);case a.SET_HIGH_LIGHTED_MESSAGE_ID:return e(e({},E),{highlightedMessageId:S.value});case a.OPERATE_MESSAGE:return e(e({},E),{operateData:e({},S.value)});case a.SET_NO_MORE:return e(e({},E),{noMore:S.value});case a.SET_AUDIO_SOURCE:return e(e({},E),{audioSource:S.value});case a.SET_VIDEO_SOURCE:return e(e({},E),{vidoeSource:S.value});case a.UPDATE_UPLOAD_PENDING_MESSAGE_LIST:return e(e({},E),{uploadPendingMessageList:s([],t(E.uploadPendingMessageList,S.value),!0)});case a.SET_FIRST_SEND_MESSAGE:return e(e({},E),{firstSendMessage:S.value});case a.SET_ACTIVE_MESSAGE_ID:return e(e({},E),{activeMessageID:S.value})}},u={conversation:{},messageList:[],nextReqMessageID:"",isCompleted:!1,init:!1,highlightedMessageId:"",lastMessageID:"",isSameLastMessageID:!1,operateData:{},noMore:!1,audioSource:null,vidoeSource:null,uploadPendingMessageList:[],firstSendMessage:null,activeMessageID:""};export{E as chatReducer,u as initialState};
1
+ import{__assign as e,__spreadArray as s}from"tslib";import{CONSTANT_DISPATCH_TYPE as a}from"../../constants.js";import{handleUploadPendingMessage as t,handleEditMessage as r}from"./unitls.js";var u=function(u,i){switch(null==i?void 0:i.type){case a.SET_CONVERSATION_PRPFILE:return e(e({},u),{conversation:i.value});case a.SET_MESSAGELIST:return e(e({},u),{messageList:i.value});case a.SET_EDIT_MESSAGE:return u.messageList&&i.value&&e(e({},u),{messageList:s([],r(u.messageList,i.value),!0)});case a.SET_IS_COMPLETE:return e(e({},u),{isCompleted:i.value});case a.RESET:return e({},E);case a.SET_HIGH_LIGHTED_MESSAGE_ID:return e(e({},u),{highlightedMessageId:i.value});case a.OPERATE_MESSAGE:return e(e({},u),{operateData:e({},i.value)});case a.SET_NO_MORE:return e(e({},u),{noMore:i.value});case a.SET_AUDIO_SOURCE:return e(e({},u),{audioSource:i.value});case a.SET_VIDEO_SOURCE:return e(e({},u),{vidoeSource:i.value});case a.UPDATE_UPLOAD_PENDING_MESSAGE_LIST:return(null==u?void 0:u.uploadPendingMessageList)&&i.value&&e(e({},u),{uploadPendingMessageList:s([],t(u.uploadPendingMessageList,i.value),!0)});case a.SET_FIRST_SEND_MESSAGE:return e(e({},u),{firstSendMessage:i.value});case a.SET_ACTIVE_MESSAGE_ID:return e(e({},u),{activeMessageID:i.value})}},E={conversation:{},messageList:[],nextReqMessageID:"",isCompleted:!1,init:!1,highlightedMessageId:"",lastMessageID:"",isSameLastMessageID:!1,operateData:{},noMore:!1,audioSource:null,vidoeSource:null,uploadPendingMessageList:[],firstSendMessage:null,activeMessageID:""};export{u as chatReducer,E as initialState};
@@ -1 +1 @@
1
- import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as t}from"../../../constants.js";function o(o){o.state;var E=o.dispatch;return{operateMessage:e((function(e){E({type:t.OPERATE_MESSAGE,value:e})}),[E]),setAudioSource:e((function(e){E({type:t.SET_AUDIO_SOURCE,value:e})}),[E]),setVideoSource:e((function(e){E({type:t.SET_VIDEO_SOURCE,value:e})}),[E]),setHighlightedMessageId:e((function(e){E({type:t.SET_HIGH_LIGHTED_MESSAGE_ID,value:e})}),[E]),setActiveMessageID:e((function(e){E({type:t.SET_ACTIVE_MESSAGE_ID,value:e})}),[E])}}export{o as useHandleMessage};
1
+ import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as t}from"../../../constants.js";function o(o){o.state;var E=o.dispatch;return{operateMessage:e((function(e){E&&E({type:t.OPERATE_MESSAGE,value:e})}),[E]),setAudioSource:e((function(e){E&&E({type:t.SET_AUDIO_SOURCE,value:e})}),[E]),setVideoSource:e((function(e){E&&E({type:t.SET_VIDEO_SOURCE,value:e})}),[E]),setHighlightedMessageId:e((function(e){E&&E({type:t.SET_HIGH_LIGHTED_MESSAGE_ID,value:e})}),[E]),setActiveMessageID:e((function(e){E&&E({type:t.SET_ACTIVE_MESSAGE_ID,value:e})}),[E])}}export{o as useHandleMessage};
@@ -1 +1 @@
1
- import{useCallback as t}from"react";import{CONSTANT_DISPATCH_TYPE as e}from"../../../constants.js";function a(a){a.chat,a.conversation,a.state;var n=a.dispatch;return a.filterMessage,{editLocalMessage:t((function(t){n({type:e.SET_EDIT_MESSAGE,value:t})}),[n]),updateUploadPendingMessageList:t((function(t){n({type:e.UPDATE_UPLOAD_PENDING_MESSAGE_LIST,value:t})}),[n])}}export{a as useHandleMessageList};
1
+ import{useCallback as t}from"react";import{CONSTANT_DISPATCH_TYPE as e}from"../../../constants.js";function a(a){a.chat,a.conversation,a.state;var n=a.dispatch;return a.filterMessage,{editLocalMessage:t((function(t){n&&n({type:e.SET_EDIT_MESSAGE,value:t})}),[n]),updateUploadPendingMessageList:t((function(t){n&&n({type:e.UPDATE_UPLOAD_PENDING_MESSAGE_LIST,value:t})}),[n])}}export{a as useHandleMessageList};
@@ -1 +1 @@
1
- import{__spreadArray as n}from"tslib";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import"react/jsx-runtime";import"react";import"../Icon/config.js";import"../Icon/type.js";var t=function(t,o){var r=n([],t,!0),i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r},o=function(t,o){var r=n([],t,!0);r.some((function(n){return n.ID===o.ID}))||r.push(o);var i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r};export{t as handleEditMessage,o as handleUploadPendingMessage};
1
+ import{__spreadArray as n}from"tslib";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import"react/jsx-runtime";import"react";import"../Icon/config.js";import"../Icon/type.js";var t=function(t,o){var r=n([],t,!0),i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r},o=function(t,o){var r=n([],t,!0);r.some((function(n){return n.ID===(null==o?void 0:o.ID)}))||r.push(o);var i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r};export{t as handleEditMessage,o as handleUploadPendingMessage};
@@ -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(!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 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 +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}from"react";import{useTranslation as m}from"react-i18next";import l from"./hooks/useContactInfo.js";import{BasicInfo as s}from"./basicInfo.js";import{DivWithEdit as d}from"../../DivWithEdit/DivWithEdit.js";function f(r){var f=this,u=r.profile,h=u.userID,v=m().t,p=a(""),N=p[0],b=p[1],x=a(""),I=x[0],g=x[1],k=a(""),C=k[0],j=k[1],w=a(!1),D=w[0],E=w[1],T=l().addFriend;return i(o,{children:[c(s,{profile:u}),D?c("div",t({className:"tui-contact-info-content"},{children:i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.verification info")})),c("p",t({className:"content-item-text"},{children:C}))]}))})):i("div",t({className:"tui-contact-info-content"},{children:[i("div",t({className:"content-item-wording"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.Enter the verification info")})),c("textarea",{className:"content-item-wording-text",value:C,onChange:function(t){j(t.target.value)}})]})),i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.remark")})),c(d,{name:"remark",className:"content-item-text",value:I,type:"text",toggle:function(){b("remark")},isEdit:"remark"===N,confirm:function(t){g(null==t?void 0:t.value),b("")},close:function(){b("")}})]})),c("div",t({className:"content-btn-container"},{children:c("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(f,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,T({userID:h,remark:I,wording:C})];case 1:return t.sent(),E(!0),[2]}}))}))}},{children:v("TUIContact.Send application")}))}))]}))]})}var u=r.memo(f);export{u as AddFriendInfo,f as UnMemoizedAddFriendInfo};
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}from"react";import{useTranslation as m}from"react-i18next";import l from"./hooks/useContactInfo.js";import{BasicInfo as s}from"./basicInfo.js";import{DivWithEdit as d}from"../../DivWithEdit/DivWithEdit.js";function f(r){var f=this,u=r.profile,h=u.userID,v=m().t,p=a(""),N=p[0],b=p[1],x=a(""),I=x[0],g=x[1],k=a(""),C=k[0],j=k[1],w=a(!1),D=w[0],E=w[1],T=l().addFriend;return i(o,{children:[c(s,{profile:u}),D?c("div",t({className:"tui-contact-info-content"},{children:i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.verification info")})),c("p",t({className:"content-item-text"},{children:C}))]}))})):i("div",t({className:"tui-contact-info-content"},{children:[i("div",t({className:"content-item-wording"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.Enter the verification info")})),c("textarea",{className:"content-item-wording-text",value:C,onChange:function(t){!function(t){j(t.target.value)}(t)}})]})),i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.remark")})),c(d,{name:"remark",className:"content-item-text",value:I,type:"text",toggle:function(){b("remark")},isEdit:"remark"===N,confirm:function(t){g(null==t?void 0:t.value),b("")},close:function(){b("")}})]})),c("div",t({className:"content-btn-container"},{children:c("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(f,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,T({userID:h,remark:I,wording:C})];case 1:return t.sent(),E(!0),[2]}}))}))}},{children:v("TUIContact.Send application")}))}))]}))]})}var u=r.memo(f);export{u as AddFriendInfo,f as UnMemoizedAddFriendInfo};
@@ -1 +1 @@
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{useTUIKitContext as u}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as d}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";import{useConversation as p}from"../../../hooks/useConversation.js";function C(c){var C=this,b=u("TUIContact"),k=b.chat,I=b.contactData,x=b.setActiveContact,N=b.setActiveConversation,j=m().t,T=c.friend,U=c.openChat,g=T.userID,w=T.profile,D=T.remark,E=a(""),S=E[0],A=E[1],F=a(""),M=F[0],W=F[1],y=a(!1),B=y[0],K=y[1],q=h(),z=q.addToBlocklist,G=q.deleteFriend,H=p(k).createConversation;s((function(){K(!1),W(D)}),[I,D]);return o(i,{children:[r(d,{profile:w}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.remark")})),r(v,{name:"remark",className:"content-item-text",value:M,type:"text",toggle:function(){A("remark")},isEdit:"remark"===S,confirm:function(t){k.updateFriend({userID:g,remark:null==t?void 0:t.value}),W(null==t?void 0:t.value),A("")},close:function(){A("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.block")})),r(f,{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(g)];case 1:return t.sent(),K(!0),x(),[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(g)];case 1:return t.sent(),x(),[2]}}))}))}},{children:j("TUIContact.Delete friend")})),r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){var t,e;return n(this,(function(n){switch(n.label){case 0:return t="C2C".concat(g),[4,H(t)];case 1:return e=n.sent(),l.switchConversation(t),N(e),U(),[2]}}))}))}},{children:j("TUIContact.Send Message")}))]}))]}))]})}var b=c.memo(C);export{b as FriendInfo,C 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{useTUIKitContext as u}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as d}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";import{useConversation as p}from"../../../hooks/useConversation.js";function C(c){var C=this,b=u("TUIContact"),k=b.chat,I=b.contactData,x=b.setActiveContact,N=b.setActiveConversation,j=m().t,T=c.friend,U=c.openChat,g=T.userID,w=T.profile,D=T.remark,E=a(""),S=E[0],A=E[1],F=a(""),M=F[0],W=F[1],y=a(!1),B=y[0],K=y[1],q=h(),z=q.addToBlocklist,G=q.deleteFriend,H=p(k).createConversation;s((function(){K(!1),W(D)}),[I,D]);return o(i,{children:[r(d,{profile:w}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.remark")})),r(v,{name:"remark",className:"content-item-text",value:M,type:"text",toggle:function(){A("remark")},isEdit:"remark"===S,confirm:function(t){k.updateFriend({userID:g,remark:null==t?void 0:t.value}),W(null==t?void 0:t.value),A("")},close:function(){A("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.block")})),r(f,{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(g)];case 1:return t.sent(),K(!0),x(),[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(g)];case 1:return t.sent(),x(),[2]}}))}))}},{children:j("TUIContact.Delete friend")})),r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){var t,e;return n(this,(function(n){switch(n.label){case 0:return t="C2C".concat(g),[4,H(t)];case 1:return e=n.sent(),l.switchConversation(t),N(e),U&&U(),[2]}}))}))}},{children:j("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 i,jsx as n}from"react/jsx-runtime";import c,{useState as a}from"react";import{useTranslation as e}from"react-i18next";import o from"@tencentcloud/chat";import{isH5 as s}from"../../../utils/env.js";import{useTUIKitContext as r}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as l}from"../../../context/TUIContactContext.js";import m from"../TUIContactInfo/hooks/useContactInfo.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as u}from"../../Avatar/default.js";import p from"../../Icon/images/right-arrow.svg.js";import f from"../../Icon/images/down-arrow.png.js";function v(){var c=r().setActiveContact,v=e().t,N=l("TUIContactList"),h=N.isShowContactList,I=N.friendList,C=N.blocklistProfile,x=N.friendApplicationList,b=m().acceptFriendApplication,g=a(!1),T=g[0],k=g[1],A=a(!1),j=A[0],U=A[1],P=a(!1),S=P[0],_=P[1];return h&&i("div",t({className:"tui-contacts-list ".concat(s?"tui-contacts-list-h5":""," ")},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return k(!T)}},{children:[n("p",t({className:"tui-contacts-list-title"},{children:v("TUIContact.New Contacts")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:T?f:p,alt:""})}))]})),T&&x.map((function(a,e){var s=a.userID,r=a.avatar,l=a.nick,m=a.wording,p=a.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),c({type:"friendApplication",data:a})}},{children:[n(d,{size:30,image:r||u}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[n("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||s})),""!==m&&n("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:m}))]}),p===o.TYPES.SNS_APPLICATION_SENT_BY_ME&&n("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:v("TUIContact.waiting for verification")})),p===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&n("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),b(i),c()}(t,s)}},{children:v("TUIContact.Agree")}))]}))]}),s)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return _(!S)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Blocked List")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:S?f:p,alt:""})}))]})),S&&C.map((function(a,e){var o=a.userID,s=a.avatar,r=a.nick;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){c({type:"block",data:a})}},{children:[n(d,{size:30,image:s||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:r||o}))}))]}),o)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return U(!j)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Friends")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:j?f:p,alt:""})}))]})),j&&I.map((function(a,e){var o=a.profile,s=o.userID,r=o.avatar,l=o.nick;return i("div",t({className:"tui-contacts-list-item",role:"button",tabIndex:0,onClick:function(){c({type:"friend",data:a})}},{children:[n(d,{size:30,image:r||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:a.remark||l||s}))}))]}),s)}))]}))}var N=c.memo(v);export{N as TUIContactList};
1
+ import{__assign as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import c,{useState as a}from"react";import{useTranslation as e}from"react-i18next";import o from"@tencentcloud/chat";import{isH5 as s}from"../../../utils/env.js";import{useTUIKitContext as r}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as l}from"../../../context/TUIContactContext.js";import m from"../TUIContactInfo/hooks/useContactInfo.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as u}from"../../Avatar/default.js";import p from"../../Icon/images/right-arrow.svg.js";import f from"../../Icon/images/down-arrow.png.js";function v(){var c=r().setActiveContact,v=e().t,N=l("TUIContactList"),h=N.isShowContactList,I=N.friendList,C=N.blocklistProfile,x=N.friendApplicationList,b=m().acceptFriendApplication,g=a(!1),T=g[0],k=g[1],A=a(!1),j=A[0],U=A[1],P=a(!1),S=P[0],_=P[1];return h&&i("div",t({className:"tui-contacts-list ".concat(s?"tui-contacts-list-h5":""," ")},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return k(!T)}},{children:[n("p",t({className:"tui-contacts-list-title"},{children:v("TUIContact.New Contacts")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:T?f:p,alt:""})}))]})),T&&(null==x?void 0:x.map((function(a,e){var s=a.userID,r=a.avatar,l=a.nick,m=a.wording,p=a.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),c({type:"friendApplication",data:a})}},{children:[n(d,{size:30,image:r||u}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[n("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||s})),""!==m&&n("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:m}))]}),p===o.TYPES.SNS_APPLICATION_SENT_BY_ME&&n("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:v("TUIContact.waiting for verification")})),p===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&n("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),b(i),c()}(t,s)}},{children:v("TUIContact.Agree")}))]}))]}),s)}))),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return _(!S)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Blocked List")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:S?f:p,alt:""})}))]})),S&&(null==C?void 0:C.map((function(a,e){var o=a.userID,s=a.avatar,r=a.nick;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){c({type:"block",data:a})}},{children:[n(d,{size:30,image:s||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:r||o}))}))]}),o)}))),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return U(!j)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Friends")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:j?f:p,alt:""})}))]})),j&&(null==I?void 0:I.map((function(a,e){var o=a.profile,s=o.userID,r=o.avatar,l=o.nick;return i("div",t({className:"tui-contacts-list-item",role:"button",tabIndex:0,onClick:function(){c({type:"friend",data:a})}},{children:[n(d,{size:30,image:r||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:a.remark||l||s}))}))]}),s)})))]}))}var N=c.memo(v);export{N as TUIContactList};
@@ -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(!0),b(!1),void B([]);b(!0),S(null===(r=t.target)||void 0===r?void 0:r.value),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=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 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 +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 r}from"../../../context/TUIContactContext.js";function o(){var o=r("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 r,o;return(null===(o=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.successUserIDList[0])||void 0===o?void 0:o.relation)===t.TYPES.SNS_TYPE_BOTH_WAY}))},isBlock:function(t){return o.includes(t)},getUserProfile:function(t){return n.getUserProfile({userIDList:[t]})}}}export{o as default};
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 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as o}from"react/jsx-runtime";import r,{useMemo as e}from"react";import{TUIConversationProvider as n}from"../../context/TUIConversationContext.js";import{TUIConversationList as i}from"../TUIConversationList/TUIConversationList.js";import"@tencentcloud/chat";function a(r){var a=r.children,s=r.createConversation,m=r.deleteConversation,c=r.filterConversation,v=e((function(){return{createConversation:s,deleteConversation:m,filterConversation:c}}),[s,m,c]);return o(n,t({value:v},{children:a||o(i,{})}))}var s=r.memo(a);export{s as TUIConversation,a as UnMemoizedTUIConversation};
1
+ import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o,{useMemo as r}from"react";import{TUIConversationProvider as n}from"../../context/TUIConversationContext.js";import{TUIConversationList as i}from"../TUIConversationList/TUIConversationList.js";import"@tencentcloud/chat";import"@tencentcloud/chat-uikit-engine";function a(o){var a=o.children,c=o.createConversation,m=o.deleteConversation,s=o.filterConversation,v=r((function(){return{createConversation:c,deleteConversation:m,filterConversation:s}}),[c,m,s]);return e(n,t({value:v},{children:a||e(i,{})}))}var c=o.memo(a);export{c as TUIConversation,a as UnMemoizedTUIConversation};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as o,__spreadArray as n}from"tslib";import{useState as r,useEffect as e}from"react";import i from"@tencentcloud/chat";function a(a,s,c){var l=this,u=r([]),d=u[0],v=u[1];return e((function(){var r;r="reload",t(l,void 0,void 0,(function(){var t,e,l,u;return o(this,(function(o){switch(o.label){case 0:return"reload"===r&&v([]),t="reload"===r?0:d.length,[4,null==a?void 0:a.getConversationList()];case 1:return 0===(null==(e=o.sent())?void 0:e.code)&&(l=[],l=c?c(e.data.conversationList):e.data.conversationList.filter((function(t){return t.type!==i.TYPES.CONV_SYSTEM})),u="reload"===r?l:n(n([],d,!0),[l],!1),v(u),!t&&s&&s(u,v)),[2]}}))}))}),[a]),{conversationList:d,setConversationList:v}}export{a as default};
1
+ import{useState as t,useEffect as n}from"react";import o from"@tencentcloud/chat";import{TUIStore as r,StoreName as e}from"@tencentcloud/chat-uikit-engine";function i(i,c,a){var u=t([]),f=u[0],s=u[1],m=function(t){var n=[];n=a?a(t):t.filter((function(t){return t.type!==o.TYPES.CONV_SYSTEM})),s(n),c&&c(n,s)};return n((function(){r.watch(e.CONV,{conversationList:m})}),[i]),{conversationList:f,setConversationList:s}}export{i as default};
@@ -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&&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{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,8 +1,8 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- import { ChatSDK, Conversation } from '@tencentcloud/chat';
2
+ import { Conversation } from '@tencentcloud/chat';
3
3
 
4
4
  interface ChatProps {
5
- chat?: ChatSDK | null;
5
+ chat?: any;
6
6
  language?: string;
7
7
  customClasses?: unknown;
8
8
  activeConversation?: Conversation;
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as n,useEffect as r}from"react";import{TUIStore as i,StoreName as c}from"@tencentcloud/chat-uikit-engine";import{useTranslation as s}from"react-i18next";import{isPC as l,isH5 as m}from"../../utils/env.js";import{useTUIKit as u}from"./hooks/useTUIKit.js";import{useCreateTUIKitContext as C}from"./hooks/useCreateTUIKitContext.js";import{TUIKitProvider as h}from"../../context/TUIKitContext.js";import{TUIConversation as T}from"../TUIConversation/TUIConversation.js";import{TUIChat as f}from"../TUIChat/TUIChat.js";import{TUIManage as d}from"../TUIManage/TUIManage.js";import{TUIProfile as p}from"../TUIProfile/TUIProfile.js";import"../TUIProfile/TUIProfileDefault.js";import"@tencentcloud/chat";import"../../context/TUIMessageContext.js";import"../Icon/config.js";import"../Icon/type.js";import{TUIContactInfo as I}from"../TUIContact/TUIContactInfo/TUIContactInfo.js";import{TUIContact as v}from"../TUIContact/TUIContact.js";import{TUIKIT_TABBAR as U}from"../../constants.js";import"../../locales/index.js";import g from"../Icon/images/chats.svg.js";import S from"../Icon/images/chats-selected.svg.js";import j from"../Icon/images/contacts.svg.js";import A from"../Icon/images/contacts-selected.svg.js";var N=[{id:1,name:U.CHATS,icon:g,selectedIcon:S,value:U.CHATS},{id:2,name:U.CONTACTS,icon:j,selectedIcon:A,value:U.CONTACTS}],w={className:"sample-h5-input",isTransmitter:!0};function b(n){var r=n.moduleValue,i=n.tabbarRender,c=n.setModuleValue;return o(a,{children:[o("div",t({className:"sample-chat-left-container"},{children:[e(p,{className:"sample-chat-profile"}),i,r===U.CHATS&&e(T,{}),r===U.CONTACTS&&e(v,{})]})),r===U.CHATS&&o(a,{children:[e(f,{}),e(d,{})]}),r===U.CONTACTS&&e(v,{children:e(I,{showChat:function(){c(U.CHATS)}})})]})}function M(n){var r=n.moduleValue,i=n.contactData,c=n.tabbarRender,s=n.currentConversationID,l=n.setModuleValue;return o(a,{children:[!s&&!i&&o("div",t({className:"sample-chat-h5-container"},{children:[e(p,{className:"sample-profile"}),c,r===U.CHATS&&e(T,{}),r===U.CONTACTS&&e(v,{})]})),r===U.CHATS&&s&&o(a,{children:[e(f,{TUIMessageInputConfig:w}),e(d,{})]}),r===U.CONTACTS&&i&&e(v,{children:e(I,{showChat:function(){l(U.CHATS)}})})]})}function x(a){var T=n(""),f=T[0],d=T[1],p=n("chats"),I=p[0],v=p[1],U=s().t,g=a.children,S=a.chat,j=a.customClasses,A=a.activeConversation,w=a.language,x=void 0===w?"en":w;window.tencent_cloud_im_csig_react_uikit_23F_xa=!0;var P=u({chat:S,activeConversation:A,language:x}),V=P.conversation,D=P.contactData,H=P.setActiveConversation,O=P.myProfile,_=P.TUIManageShow,k=P.setTUIManageShow,R=P.TUIProfileShow,y=P.setTUIProfileShow,K=P.setActiveContact,F=C({chat:S,language:x,conversation:V,contactData:D,setActiveConversation:H,customClasses:j,myProfile:O,TUIManageShow:_,setTUIManageShow:k,TUIProfileShow:R,setTUIProfileShow:y,setActiveContact:K});r((function(){return i.watch(c.CONV,{currentConversationID:q}),function(){i.unwatch(c.CONV,{currentConversationID:q})}}),[]);var q=function(t){d(t)},z=e("div",t({className:"sample-chat-tab"},{children:N.map((function(a){return o("div",t({className:"sample-chat-tab-container",role:"presentation",onClick:function(){var t;t=a.value,v(t)}},{children:[e("img",{src:I===a.value?a.selectedIcon:a.icon,alt:""}),e("p",t({className:"sample-chat-tab-text ".concat(I===a.value?"sample-chat-tab-active":"")},{children:U(a.name)}))]}),a.id)}))}));return e(h,t({value:F},{children:e("div",t({className:"tui-kit"},{children:g||l&&e(b,{moduleValue:I,tabbarRender:z,setModuleValue:v})||m&&e(M,{contactData:D,moduleValue:I,tabbarRender:z,currentConversationID:f,setModuleValue:v})}))}))}export{x as TUIKit};
1
+ import{__assign as t}from"tslib";import{jsx as e,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as n,useEffect as r}from"react";import{TUIStore as i,StoreName as c}from"@tencentcloud/chat-uikit-engine";import{TUILogin as s}from"@tencentcloud/tui-core";import{useTranslation as l}from"react-i18next";import{isPC as m,isH5 as u}from"../../utils/env.js";import{useTUIKit as C}from"./hooks/useTUIKit.js";import{useCreateTUIKitContext as h}from"./hooks/useCreateTUIKitContext.js";import{TUIKitProvider as d}from"../../context/TUIKitContext.js";import{TUIConversation as f}from"../TUIConversation/TUIConversation.js";import{TUIChat as T}from"../TUIChat/TUIChat.js";import{TUIManage as v}from"../TUIManage/TUIManage.js";import{TUIProfile as p}from"../TUIProfile/TUIProfile.js";import"../TUIProfile/TUIProfileDefault.js";import"@tencentcloud/chat";import"../../context/TUIMessageContext.js";import"../Icon/config.js";import"../Icon/type.js";import{TUIContactInfo as I}from"../TUIContact/TUIContactInfo/TUIContactInfo.js";import{TUIContact as g}from"../TUIContact/TUIContact.js";import{TUIKIT_TABBAR as U}from"../../constants.js";import"../../locales/index.js";import S from"../Icon/images/chats.svg.js";import j from"../Icon/images/chats-selected.svg.js";import A from"../Icon/images/contacts.svg.js";import N from"../Icon/images/contacts-selected.svg.js";var w=[{id:1,name:U.CHATS,icon:S,selectedIcon:j,value:U.CHATS},{id:2,name:U.CONTACTS,icon:A,selectedIcon:N,value:U.CONTACTS}],b={className:"sample-h5-input",isTransmitter:!0};function x(n){var r=n.moduleValue,i=n.tabbarRender,c=n.setModuleValue;return o(a,{children:[o("div",t({className:"sample-chat-left-container"},{children:[e(p,{className:"sample-chat-profile"}),i,r===U.CHATS&&e(f,{}),r===U.CONTACTS&&e(g,{})]})),r===U.CHATS&&o(a,{children:[e(T,{}),e(v,{})]}),r===U.CONTACTS&&e(g,{children:e(I,{showChat:function(){c(U.CHATS)}})})]})}function M(n){var r=n.moduleValue,i=n.contactData,c=n.tabbarRender,s=n.currentConversationID,l=n.setModuleValue;return o(a,{children:[!s&&!i&&o("div",t({className:"sample-chat-h5-container"},{children:[e(p,{className:"sample-profile"}),c,r===U.CHATS&&e(f,{}),r===U.CONTACTS&&e(g,{})]})),r===U.CHATS&&s&&o(a,{children:[e(T,{TUIMessageInputConfig:b}),e(v,{})]}),r===U.CONTACTS&&i&&e(g,{children:e(I,{showChat:function(){l(U.CHATS)}})})]})}function P(a){var f=n("chats"),T=f[0],v=f[1],p=l().t,I=a.children,g=a.chat,U=void 0===g?s.getContext().chat:g,S=a.customClasses,j=a.activeConversation,A=a.language,N=void 0===A?"en":A;window.tencent_cloud_im_csig_react_uikit_23F_xa=!0;var b=C({chat:U,activeConversation:j,language:N}),P=b.conversation,V=b.contactData,D=b.setActiveConversation,H=b.myProfile,O=b.TUIManageShow,_=b.setTUIManageShow,k=b.TUIProfileShow,R=b.setTUIProfileShow,y=b.setActiveContact,K=h({chat:U,language:N,conversation:P,contactData:V,setActiveConversation:D,customClasses:S,myProfile:H,TUIManageShow:O,setTUIManageShow:_,TUIProfileShow:k,setTUIProfileShow:R,setActiveContact:y});r((function(){return i.watch(c.CONV,{currentConversation:F}),function(){i.unwatch(c.CONV,{currentConversation:F})}}),[]);var F=function(t){D(null==t?void 0:t.getConversation())},q=e("div",t({className:"sample-chat-tab"},{children:w.map((function(a){return o("div",t({className:"sample-chat-tab-container",role:"presentation",onClick:function(){var t;t=a.value,v(t)}},{children:[e("img",{src:T===a.value?a.selectedIcon:a.icon,alt:""}),e("p",t({className:"sample-chat-tab-text ".concat(T===a.value?"sample-chat-tab-active":"")},{children:p(a.name)}))]}),a.id)}))}));return e(d,t({value:K},{children:e("div",t({className:"tui-kit"},{children:I||m&&e(x,{moduleValue:T,tabbarRender:q,setModuleValue:v})||u&&e(M,{contactData:V,moduleValue:T,tabbarRender:q,currentConversationID:(null==P?void 0:P.conversationID)||"",setModuleValue:v})}))}))}export{P as TUIKit};
@@ -6,15 +6,15 @@ import { TUIKitContextValue } from '../../../context/TUIKitContext.js';
6
6
  declare const useCreateTUIKitContext: (value: TUIKitContextValue) => {
7
7
  chat: _tencentcloud_chat.ChatSDK;
8
8
  language: string;
9
- conversation: _tencentcloud_chat.Conversation;
9
+ conversation: _tencentcloud_chat.Conversation | undefined;
10
10
  contactData: UseContactParams;
11
11
  customClasses: unknown;
12
- setActiveConversation: (conversation?: _tencentcloud_chat.Conversation) => void;
13
- myProfile: _tencentcloud_chat.Profile;
14
- TUIManageShow: boolean;
15
- setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>>;
16
- TUIProfileShow: boolean;
17
- setTUIProfileShow: React.Dispatch<React.SetStateAction<boolean>>;
12
+ setActiveConversation: (conversation?: _tencentcloud_chat.Conversation | undefined) => void;
13
+ myProfile: _tencentcloud_chat.Profile | undefined;
14
+ TUIManageShow: boolean | undefined;
15
+ setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>> | undefined;
16
+ TUIProfileShow: boolean | undefined;
17
+ setTUIProfileShow: React.Dispatch<React.SetStateAction<boolean>> | undefined;
18
18
  setActiveContact: (UseContactParams?: UseContactParams) => void;
19
19
  };
20
20
 
@@ -24,10 +24,10 @@ interface UseChatParams {
24
24
  language?: string;
25
25
  }
26
26
  declare const useTUIKit: ({ chat, activeConversation: paramsActiveConversation, language, }: UseChatParams) => {
27
- conversation: Conversation;
27
+ conversation: Conversation | undefined;
28
28
  contactData: UseContactParams;
29
29
  setActiveConversation: (activeConversation?: Conversation) => void;
30
- myProfile: Profile;
30
+ myProfile: Profile | undefined;
31
31
  TUIManageShow: boolean;
32
32
  setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>>;
33
33
  TUIProfileShow: boolean;
@@ -1 +1 @@
1
- import{__awaiter as n,__generator as t}from"tslib";import{useState as o,useEffect as e,useCallback as a}from"react";import{useTranslation as i}from"react-i18next";var r=function(r){var c=r.chat,s=r.activeConversation,v=r.language,u=i().i18n,f=o(s),l=f[0],g=f[1],h=o(),I=h[0],d=h[1],m=o(!1),w=m[0],D=m[1],p=o(!1),M=p[0],P=p[1],S=o(),T=S[0],U=S[1];e((function(){u.changeLanguage(v);n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,null==c?void 0:c.getMyProfile()];case 1:return n=t.sent(),d(null==n?void 0:n.data),[2]}}))}))}),[c,v]);var C=a((function(n){n&&(null==c||c.setMessageRead({conversationID:n.conversationID})),l&&n.conversationID!==l.conversationID&&D(!1),g(n)}),[c]);return e((function(){g(s)}),[s]),{conversation:l,contactData:T,setActiveConversation:C,myProfile:I,TUIManageShow:w,setTUIManageShow:D,TUIProfileShow:M,setTUIProfileShow:P,setActiveContact:function(n){U(n)}}};export{r as useTUIKit};
1
+ import{useState as n,useEffect as t,useCallback as o}from"react";import{TUIStore as e,StoreName as a}from"@tencentcloud/chat-uikit-engine";import{useTranslation as i}from"react-i18next";var r=function(r){var c=r.chat,s=r.activeConversation,u=r.language,v=i().i18n,f=n(s),l=f[0],g=f[1],h=n(),I=h[0],m=h[1],w=n(!1),D=w[0],S=w[1],U=n(!1),p=U[0],P=U[1],T=n(),d=T[0],C=T[1];t((function(){v.changeLanguage(u),e.watch(a.USER,{userProfile:function(n){m(n)}})}),[u]);var M=o((function(n){n&&(null==c||c.setMessageRead({conversationID:n.conversationID})),l&&(null==n?void 0:n.conversationID)!==l.conversationID&&S(!1),n&&g(n)}),[c]);return t((function(){s&&g(s)}),[s]),{conversation:l,contactData:d,setActiveConversation:M,myProfile:I,TUIManageShow:D,setTUIManageShow:S,TUIProfileShow:p,setTUIProfileShow:P,setActiveContact:function(n){C(n)}}};export{r as useTUIKit};
@@ -1,3 +1,6 @@
1
- declare function TUIManage(): JSX.Element;
1
+ import React from 'react';
2
+
3
+ declare function UnMemoizedTUIManage<T>(): React.ReactElement;
4
+ declare const TUIManage: typeof UnMemoizedTUIManage;
2
5
 
3
6
  export { TUIManage };
@@ -1 +1 @@
1
- import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o,useEffect as t}from"react";import{useTranslation as a}from"react-i18next";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{defaultGroupAvatarWork as c,defaultUserAvatar as m}from"../Avatar/default.js";import{Switch as d}from"../Switch/Switch.js";import{useTUIKitContext as v}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{isH5 as h,isPC as u}from"../../utils/env.js";import{getMessageProfile as f}from"../ConversationPreview/utils.js";import{useConversationUpdate as p}from"../TUIConversationList/hooks/useConversationUpdate.js";import{useConversation as g}from"../../hooks/useConversation.js";function C(){var C=a().t,I=o(null),N=I[0],j=I[1],x=o(null),U=x[0],k=x[1],T=o(!1),D=T[0],w=T[1],A=o(0),y=A[0],M=A[1],P=v("TUIManage"),S=P.conversation,b=P.setActiveConversation,L=P.chat,K=P.TUIManageShow,z=P.setTUIManageShow;p(null,(function(){M((function(n){return n+1}))}));var B=g(L),E=B.pinConversation,q=B.deleteConversation,F=function(){z(!1)};return t((function(){j(S),k(f(S)),w(!!S&&S.isPinned)}),[S,y]),K&&S&&e("div",n({className:"tui-manage ".concat(h?"tui-h5-manage":"")},{children:[e("div",n({className:"tui-manage-title"},{children:[u&&i(r,{onClick:F,type:s.CANCEL,width:9,height:16}),h&&i(r,{onClick:F,type:s.BACK,width:9,height:16}),i("span",n({style:{marginLeft:"10px"}},{children:C("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==U?void 0:U.avatar)||((null==U?void 0:U.groupID)?c:m)})})),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:C("TUIConversation.Pin")})),i(d,{onChange:function(n){w(n.target.checked),E({conversationID:N.conversationID,isPinned:n.target.checked})},checked:D})]})),u&&i("div",n({className:"manage-handle-box",role:"presentation",onClick:function(){q(N.conversationID),b(null)}},{children:i("div",n({className:"manage-handle-title red"},{children:C("TUIConversation.Delete")}))}))]}))]}))]}))}export{C 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 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 +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,f=r.children,v=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,v(null)),(null==I?void 0:I.current)&&(I.current.paused?(I.current.play(),y(!0),v(I.current)):(I.current.pause(),N()))}),[I,h]),T=function(){y(!1)},N=function(){v(null),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(){C(parseInt("".concat(I.current.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(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"})})),f]}))}var p=r.memo(m);function f(t){return n(p,e({},t))}export{f 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{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 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import"tslib";import"react";import{messageShowType as r}from"../../context/TUIMessageContext.js";import{Avatar as o}from"../Avatar/Avatar.js";import{handleDisplayAvatar as a}from"../untils.js";function e(e){e.className;var m=e.CustomAvatar,s=e.message,i=e.showType;return(i===r.ALL||(null==s?void 0:s.flow)===i)&&i!==r.NONE?m||t(o,{size:32,image:a(null==s?void 0:s.avatar)}):null}export{e as MessageAvatar};
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};