@tencentcloud/chat-uikit-react 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/.eslintrc.js +0 -1
  2. package/CHANGELOG.md +5 -0
  3. package/dist/cjs/components/Avatar/Avatar.js +1 -1
  4. package/dist/cjs/components/Checkbox/index.d.ts +2 -1
  5. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  6. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  7. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  8. package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
  9. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
  10. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  11. package/dist/cjs/components/ConversationPreview/utils.js +1 -1
  12. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
  13. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
  14. package/dist/cjs/components/DivWithEdit/DivWithEdit.d.ts +3 -2
  15. package/dist/cjs/components/DivWithEdit/DivWithEdit.js +1 -1
  16. package/dist/cjs/components/DivWithEdit/WithText.js +1 -1
  17. package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
  18. package/dist/cjs/components/Icon/Icon.d.ts +2 -1
  19. package/dist/cjs/components/Icon/Icon.js +1 -1
  20. package/dist/cjs/components/Input/Input.js +1 -1
  21. package/dist/cjs/components/Model/index.d.ts +1 -1
  22. package/dist/cjs/components/Model/index.js +1 -1
  23. package/dist/cjs/components/Plugins/index.js +1 -1
  24. package/dist/cjs/components/Popup/index.d.ts +1 -1
  25. package/dist/cjs/components/Popup/index.js +1 -1
  26. package/dist/cjs/components/Switch/Switch.d.ts +2 -6
  27. package/dist/cjs/components/Switch/Switch.js +1 -1
  28. package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
  29. package/dist/cjs/components/TUIChat/TUIChatState.js +1 -1
  30. package/dist/cjs/components/TUIChat/hooks/useHandleMessage.js +1 -1
  31. package/dist/cjs/components/TUIChat/hooks/useHandleMessageList.js +1 -1
  32. package/dist/cjs/components/TUIChat/unitls.js +1 -1
  33. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  34. package/dist/cjs/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
  35. package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  36. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  37. package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
  38. package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  39. package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  40. package/dist/cjs/components/TUIKit/TUIKit.d.ts +2 -2
  41. package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
  42. package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
  43. package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +1 -1
  44. package/dist/cjs/components/TUIManage/TUIManage.d.ts +4 -1
  45. package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
  46. package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
  47. package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
  48. package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
  49. package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
  50. package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
  51. package/dist/cjs/components/TUIMessage/MessageFace.js +1 -1
  52. package/dist/cjs/components/TUIMessage/MessageFile.js +1 -1
  53. package/dist/cjs/components/TUIMessage/MessageImage.js +1 -1
  54. package/dist/cjs/components/TUIMessage/MessageLocation.js +1 -1
  55. package/dist/cjs/components/TUIMessage/MessageMerger.js +1 -1
  56. package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
  57. package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
  58. package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
  59. package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
  60. package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
  61. package/dist/cjs/components/TUIMessage/MessageVideo.js +1 -1
  62. package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
  63. package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
  64. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  65. package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
  66. package/dist/cjs/components/TUIMessage/utils/index.js +1 -1
  67. package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +1 -1
  68. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  69. package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  70. package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
  71. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  72. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  73. package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  74. package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  75. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
  76. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  77. package/dist/cjs/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
  78. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
  79. package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  80. package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
  81. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
  82. package/dist/cjs/components/TUIProfile/hooks/useMyProfile.js +1 -1
  83. package/dist/cjs/components/Toast/index.js +1 -1
  84. package/dist/cjs/context/ComponentContext.d.ts +3 -2
  85. package/dist/cjs/context/TUIChatActionContext.d.ts +1 -1
  86. package/dist/cjs/context/TUIChatStateContext.d.ts +4 -4
  87. package/dist/cjs/context/TUIContactContext.js +1 -1
  88. package/dist/cjs/context/TUIConversationContext.js +1 -1
  89. package/dist/cjs/context/TUIKitContext.d.ts +1 -1
  90. package/dist/cjs/context/TUIMessageContext.js +1 -1
  91. package/dist/cjs/context/TUIMessageInputContext.js +1 -1
  92. package/dist/cjs/hooks/useProfile.d.ts +1 -1
  93. package/dist/cjs/index.css +1 -1
  94. package/dist/cjs/index.d.css +3 -3
  95. package/dist/cjs/index.d.ts +1 -1
  96. package/dist/esm/components/Avatar/Avatar.js +1 -1
  97. package/dist/esm/components/Checkbox/index.d.ts +2 -1
  98. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  99. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  100. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  101. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
  102. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
  103. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  104. package/dist/esm/components/ConversationPreview/utils.js +1 -1
  105. package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
  106. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
  107. package/dist/esm/components/DivWithEdit/DivWithEdit.d.ts +3 -2
  108. package/dist/esm/components/DivWithEdit/DivWithEdit.js +1 -1
  109. package/dist/esm/components/DivWithEdit/WithText.js +1 -1
  110. package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
  111. package/dist/esm/components/Icon/Icon.d.ts +2 -1
  112. package/dist/esm/components/Icon/Icon.js +1 -1
  113. package/dist/esm/components/Input/Input.js +1 -1
  114. package/dist/esm/components/Model/index.d.ts +1 -1
  115. package/dist/esm/components/Model/index.js +1 -1
  116. package/dist/esm/components/Plugins/index.js +1 -1
  117. package/dist/esm/components/Popup/index.d.ts +1 -1
  118. package/dist/esm/components/Popup/index.js +1 -1
  119. package/dist/esm/components/Switch/Switch.d.ts +2 -6
  120. package/dist/esm/components/Switch/Switch.js +1 -1
  121. package/dist/esm/components/TUIChat/TUIChat.js +1 -1
  122. package/dist/esm/components/TUIChat/TUIChatState.js +1 -1
  123. package/dist/esm/components/TUIChat/hooks/useHandleMessage.js +1 -1
  124. package/dist/esm/components/TUIChat/hooks/useHandleMessageList.js +1 -1
  125. package/dist/esm/components/TUIChat/unitls.js +1 -1
  126. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  127. package/dist/esm/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
  128. package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  129. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  130. package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
  131. package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  132. package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  133. package/dist/esm/components/TUIKit/TUIKit.d.ts +2 -2
  134. package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
  135. package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
  136. package/dist/esm/components/TUIKit/hooks/useTUIKit.js +1 -1
  137. package/dist/esm/components/TUIManage/TUIManage.d.ts +4 -1
  138. package/dist/esm/components/TUIManage/TUIManage.js +1 -1
  139. package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
  140. package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
  141. package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
  142. package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
  143. package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
  144. package/dist/esm/components/TUIMessage/MessageFace.js +1 -1
  145. package/dist/esm/components/TUIMessage/MessageFile.js +1 -1
  146. package/dist/esm/components/TUIMessage/MessageImage.js +1 -1
  147. package/dist/esm/components/TUIMessage/MessageLocation.js +1 -1
  148. package/dist/esm/components/TUIMessage/MessageMerger.js +1 -1
  149. package/dist/esm/components/TUIMessage/MessageName.js +1 -1
  150. package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
  151. package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
  152. package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
  153. package/dist/esm/components/TUIMessage/MessageText.js +1 -1
  154. package/dist/esm/components/TUIMessage/MessageVideo.js +1 -1
  155. package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
  156. package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
  157. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  158. package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
  159. package/dist/esm/components/TUIMessage/utils/index.js +1 -1
  160. package/dist/esm/components/TUIMessageInput/EmojiPicker.js +1 -1
  161. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  162. package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  163. package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
  164. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  165. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  166. package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  167. package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  168. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
  169. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  170. package/dist/esm/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
  171. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
  172. package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  173. package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
  174. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
  175. package/dist/esm/components/TUIProfile/hooks/useMyProfile.js +1 -1
  176. package/dist/esm/components/Toast/index.js +1 -1
  177. package/dist/esm/context/ComponentContext.d.ts +3 -2
  178. package/dist/esm/context/TUIChatActionContext.d.ts +1 -1
  179. package/dist/esm/context/TUIChatStateContext.d.ts +4 -4
  180. package/dist/esm/context/TUIContactContext.js +1 -1
  181. package/dist/esm/context/TUIConversationContext.js +1 -1
  182. package/dist/esm/context/TUIKitContext.d.ts +1 -1
  183. package/dist/esm/context/TUIMessageContext.js +1 -1
  184. package/dist/esm/context/TUIMessageInputContext.js +1 -1
  185. package/dist/esm/hooks/useProfile.d.ts +1 -1
  186. package/dist/esm/index.css +1 -1
  187. package/dist/esm/index.d.css +3 -3
  188. package/dist/esm/index.d.ts +1 -1
  189. package/index.ts +1 -0
  190. package/package.json +7 -6
  191. package/rollup.config.js +2 -1
  192. package/src/components/Avatar/Avatar.tsx +7 -3
  193. package/src/components/Avatar/styles/index.scss +1 -1
  194. package/src/components/Checkbox/index.tsx +1 -1
  195. package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +14 -7
  196. package/src/components/ConversationCreate/ConversationCreate.tsx +5 -1
  197. package/src/components/ConversationCreate/ConversationCreateSelectView.tsx +2 -2
  198. package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +11 -10
  199. package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +14 -12
  200. package/src/components/ConversationPreview/ConversationPreview.tsx +3 -3
  201. package/src/components/ConversationPreview/ConversationPreviewContent.tsx +9 -5
  202. package/src/components/ConversationPreview/utils.tsx +6 -3
  203. package/src/components/DivWithEdit/DivWithEdit.tsx +6 -5
  204. package/src/components/DivWithEdit/WithText.tsx +3 -1
  205. package/src/components/DivWithEdit/styles/index.scss +1 -1
  206. package/src/components/Icon/Icon.tsx +2 -2
  207. package/src/components/Input/Input.tsx +15 -12
  208. package/src/components/Model/index.tsx +2 -2
  209. package/src/components/Plugins/index.tsx +15 -12
  210. package/src/components/Popup/index.tsx +13 -9
  211. package/src/components/Switch/Switch.tsx +5 -7
  212. package/src/components/TUIChat/TUIChat.tsx +20 -5
  213. package/src/components/TUIChat/TUIChatState.tsx +3 -3
  214. package/src/components/TUIChat/hooks/useHandleMessage.tsx +5 -5
  215. package/src/components/TUIChat/hooks/useHandleMessageList.tsx +2 -2
  216. package/src/components/TUIChat/unitls.ts +2 -2
  217. package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +1 -1
  218. package/src/components/TUIContact/TUIContactInfo/addFriendInfo.tsx +2 -2
  219. package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +1 -2
  220. package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +0 -10
  221. package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -3
  222. package/src/components/TUIContact/hooks/useTUIContact.tsx +3 -4
  223. package/src/components/TUIContactSearch/TUIContactSearch.tsx +6 -7
  224. package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +1 -3
  225. package/src/components/TUIConversationList/TUIConversationList.tsx +1 -1
  226. package/src/components/TUIConversationList/hooks/useConversationList.tsx +1 -1
  227. package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
  228. package/src/components/TUIKit/TUIKit.tsx +1 -1
  229. package/src/components/TUIKit/hooks/useTUIKit.tsx +4 -4
  230. package/src/components/TUIManage/TUIManage.tsx +20 -13
  231. package/src/components/TUIMessage/MessageAudio.tsx +8 -6
  232. package/src/components/TUIMessage/MessageAvatar.tsx +2 -2
  233. package/src/components/TUIMessage/MessageBubble.tsx +7 -5
  234. package/src/components/TUIMessage/MessageContext.tsx +3 -3
  235. package/src/components/TUIMessage/MessageCustom.tsx +5 -3
  236. package/src/components/TUIMessage/MessageFace.tsx +2 -2
  237. package/src/components/TUIMessage/MessageFile.tsx +5 -5
  238. package/src/components/TUIMessage/MessageImage.tsx +4 -2
  239. package/src/components/TUIMessage/MessageLocation.tsx +3 -3
  240. package/src/components/TUIMessage/MessageMerger.tsx +3 -3
  241. package/src/components/TUIMessage/MessageName.tsx +1 -1
  242. package/src/components/TUIMessage/MessagePlugins.tsx +12 -10
  243. package/src/components/TUIMessage/MessageProgress.tsx +5 -4
  244. package/src/components/TUIMessage/MessageRevoke.tsx +1 -1
  245. package/src/components/TUIMessage/MessageText.tsx +4 -4
  246. package/src/components/TUIMessage/MessageVideo.tsx +3 -3
  247. package/src/components/TUIMessage/TUIMessage.tsx +1 -1
  248. package/src/components/TUIMessage/TUIMessageDefault.tsx +3 -1
  249. package/src/components/TUIMessage/hooks/useMessageHandler.ts +13 -13
  250. package/src/components/TUIMessage/hooks/useMessageReply.ts +6 -4
  251. package/src/components/TUIMessage/utils/decodeText.ts +2 -3
  252. package/src/components/TUIMessage/utils/index.ts +1 -2
  253. package/src/components/TUIMessageInput/EmojiPicker.tsx +4 -4
  254. package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +8 -8
  255. package/src/components/TUIMessageInput/InputQuoteDefalut.tsx +4 -2
  256. package/src/components/TUIMessageInput/TUIForward.tsx +22 -15
  257. package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +15 -9
  258. package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +2 -2
  259. package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +4 -4
  260. package/src/components/TUIMessageInput/hooks/useHandleQuoteMessage.tsx +5 -5
  261. package/src/components/TUIMessageInput/hooks/useMessageInputState.tsx +3 -3
  262. package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +12 -9
  263. package/src/components/TUIMessageInput/hooks/useUploadElement.tsx +2 -2
  264. package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +1 -1
  265. package/src/components/TUIMessageList/TUIMessageList.tsx +5 -6
  266. package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +5 -2
  267. package/src/components/TUIProfile/TUIProfile.tsx +3 -1
  268. package/src/components/TUIProfile/TUIProfileDefault.tsx +15 -15
  269. package/src/components/TUIProfile/hooks/useMyProfile.tsx +6 -6
  270. package/src/components/Toast/index.tsx +3 -3
  271. package/src/components/Toast/styles/layout.scss +1 -1
  272. package/src/components/untils.ts +1 -1
  273. package/src/context/TUIChatStateContext.tsx +4 -4
  274. package/src/context/TUIContactContext.tsx +1 -1
  275. package/src/context/TUIConversationContext.tsx +2 -2
  276. package/src/context/TUIMessageContext.tsx +1 -1
  277. package/src/context/TUIMessageInputContext.tsx +1 -1
  278. package/src/hooks/useConversation.tsx +1 -1
  279. package/src/hooks/useProfile.tsx +2 -2
  280. package/tsconfig.json +1 -0
@@ -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{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;
@@ -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{__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,l=o(s),f=l[0],g=l[1],d=o(),h=d[0],I=d[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(),I(null==n?void 0:n.data),[2]}}))}))}),[c,v]);var C=a((function(n){n&&(null==c||c.setMessageRead({conversationID:n.conversationID})),f&&(null==n?void 0:n.conversationID)!==f.conversationID&&D(!1),n&&g(n)}),[c]);return e((function(){s&&g(s)}),[s]),{conversation:f,contactData:T,setActiveConversation:C,myProfile:h,TUIManageShow:w,setTUIManageShow:D,TUIProfileShow:M,setTUIProfileShow:P,setActiveContact:function(n){U(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};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as s}from"react/jsx-runtime";import o,{useState as n,useEffect as i}from"react";import a from"@tencentcloud/chat";import{MESSAGE_STATUS as l}from"../../constants.js";import{useTUIChatStateContext as c}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as r}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{useMessageReply as d}from"./hooks/useMessageReply.js";import{MessageProgress as g}from"./MessageProgress.js";function p(o){var p=o.message,b=o.children,f=o.Context,v=o.Plugins,I=n(!1),h=I[0],x=I[1],M=d({message:p}),N=M.messageReply,y=M.replyMessage,S=M.sender,D=r(),E=D.setHighlightedMessageId,j=D.setActiveMessageID,C=c("MessageBubbleWithContext").activeMessageID;i((function(){C!==p.ID&&x(!1)}),[C]);return s("div",e({className:"meesage-bubble"},{children:[s("div",e({className:"meesage-bubble-context ".concat(null==p?void 0:p.flow),role:"button",tabIndex:0,onMouseEnter:function(){j(p.ID),x(!0)},onMouseLeave:function(){j(p.ID),x(!1)},onClick:function(){j(p.ID)}},{children:[s("div",e({className:"message-context\n ".concat(N?"meesage-bubble-reply meesage-bubble-reply-".concat(null==p?void 0:p.flow):"","\n ").concat((null==p?void 0:p.type)!==a.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==a.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==a.TYPES.MSG_FILE||(null==p?void 0:p.status)!==l.UNSEND?"":"loading")},{children:[N&&s("div",e({className:"meesage-bubble-reply-main",role:"menuitem",tabIndex:0,onClick:function(){E(null==y?void 0:y.ID)}},{children:[t("header",e({className:"title"},{children:S})),f&&t(f,{message:y})]})),b,t(g,{message:p})]})),v&&t("div",e({className:"message-plugin"},{children:h&&t(v,{message:p})}))]})),s("div",e({className:"message-bubble-status icon"},{children:[(null==p?void 0:p.status)===l.FAIL&&t("i",{className:"icon-fail"}),(null==p?void 0:p.status)===l.UNSEND&&t(m,{width:10,height:10,type:u.PROGRESS})]}))]}))}var b=o.memo(p);function f(s){return t(b,e({},s))}export{f as MessageBubble};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as s}from"react/jsx-runtime";import o,{useState as n,useEffect as i}from"react";import l from"@tencentcloud/chat";import{MESSAGE_STATUS as a}from"../../constants.js";import{useTUIChatStateContext as c}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as r}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{useMessageReply as d}from"./hooks/useMessageReply.js";import{MessageProgress as g}from"./MessageProgress.js";function p(o){var p=o.message,b=o.children,v=o.Context,f=o.Plugins,I=n(!1),h=I[0],x=I[1],M=d({message:p}),N=M.messageReply,y=M.replyMessage,S=M.sender,D=r(),E=D.setHighlightedMessageId,j=D.setActiveMessageID,C=c("MessageBubbleWithContext").activeMessageID;i((function(){C!==(null==p?void 0:p.ID)&&x(!1)}),[C]);return s("div",e({className:"meesage-bubble"},{children:[s("div",e({className:"meesage-bubble-context ".concat(null==p?void 0:p.flow),role:"button",tabIndex:0,onMouseEnter:function(){j&&p&&j(null==p?void 0:p.ID),x(!0)},onMouseLeave:function(){j&&p&&j(p.ID),x(!1)},onClick:function(){j&&p&&j(p.ID)}},{children:[s("div",e({className:"message-context\n ".concat(N?"meesage-bubble-reply meesage-bubble-reply-".concat(null==p?void 0:p.flow):"","\n ").concat((null==p?void 0:p.type)!==l.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==l.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==l.TYPES.MSG_FILE||(null==p?void 0:p.status)!==a.UNSEND?"":"loading")},{children:[N&&s("div",e({className:"meesage-bubble-reply-main",role:"menuitem",tabIndex:0,onClick:function(){E&&E(null==y?void 0:y.ID)}},{children:[t("header",e({className:"title"},{children:S})),v&&t(v,{message:y})]})),b,t(g,{message:p})]})),f&&t("div",e({className:"message-plugin"},{children:h&&t(f,{message:p})}))]})),s("div",e({className:"message-bubble-status icon"},{children:[(null==p?void 0:p.status)===a.FAIL&&t("i",{className:"icon-fail"}),(null==p?void 0:p.status)===a.UNSEND&&t(m,{width:10,height:10,type:u.PROGRESS})]}))]}))}var b=o.memo(p);function v(s){return t(b,e({},s))}export{v as MessageBubble};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import s from"@tencentcloud/chat";import{MessageAudio as m}from"./MessageAudio.js";import{MessageCustom as r}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as n}from"./MessageFile.js";import{MessageImage as E}from"./MessageImage.js";import{MessageLocation as M}from"./MessageLocation.js";import{MessageMerger as S}from"./MessageMerger.js";import{MessageText as a}from"./MessageText.js";import{MessageVideo as T}from"./MessageVideo.js";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import{useTUIMessageContext as p}from"../../context/TUIMessageContext.js";import{useMessageContextHandler as c}from"./hooks/useMessageContextHandler.js";import{MessageStatus as g}from"./MessageStatus.js";var l,G=((l={})[s.TYPES.MSG_TEXT]=a,l[s.TYPES.MSG_FACE]=i,l[s.TYPES.MSG_IMAGE]=E,l[s.TYPES.MSG_AUDIO]=m,l[s.TYPES.MSG_VIDEO]=T,l[s.TYPES.MSG_FILE]=n,l[s.TYPES.MSG_CUSTOM]=r,l[s.TYPES.MSG_MERGER]=S,l[s.TYPES.MSG_LOCATION]=M,l);function f(o){var m,r=o.message,i=c({message:r}).context,n=p("MessageCustom"),E=n.CustemElement,M=n.TextElement,S=n.FaceElement,a=n.ImageElement,T=n.AudioElement,l=n.VideoElement,f=n.FileElement,P=n.MergerElement,Y=n.LocationElement,_=((m={})[s.TYPES.MSG_TEXT]=M,m[s.TYPES.MSG_FACE]=S,m[s.TYPES.MSG_IMAGE]=a,m[s.TYPES.MSG_AUDIO]=T,m[s.TYPES.MSG_VIDEO]=l,m[s.TYPES.MSG_FILE]=f,m[s.TYPES.MSG_CUSTOM]=E,m[s.TYPES.MSG_MERGER]=P,m[s.TYPES.MSG_LOCATION]=Y,m)[null==r?void 0:r.type]||G[null==r?void 0:r.type];return _&&t(_,e({context:i,message:r},{children:t(g,{message:r})}))}var P=o.memo(f);function Y(o){return t(P,e({},o))}export{Y as MessageContext};
1
+ import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import s from"@tencentcloud/chat";import{MessageAudio as m}from"./MessageAudio.js";import{MessageCustom as r}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as E}from"./MessageFile.js";import{MessageImage as n}from"./MessageImage.js";import{MessageLocation as M}from"./MessageLocation.js";import{MessageMerger as S}from"./MessageMerger.js";import{MessageText as a}from"./MessageText.js";import{MessageVideo as T}from"./MessageVideo.js";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import{useTUIMessageContext as p}from"../../context/TUIMessageContext.js";import{useMessageContextHandler as c}from"./hooks/useMessageContextHandler.js";import{MessageStatus as g}from"./MessageStatus.js";var G,f=((G={})[s.TYPES.MSG_TEXT]=a,G[s.TYPES.MSG_FACE]=i,G[s.TYPES.MSG_IMAGE]=n,G[s.TYPES.MSG_AUDIO]=m,G[s.TYPES.MSG_VIDEO]=T,G[s.TYPES.MSG_FILE]=E,G[s.TYPES.MSG_CUSTOM]=r,G[s.TYPES.MSG_MERGER]=S,G[s.TYPES.MSG_LOCATION]=M,G);function l(o){var m,r=o.message,i=c({message:r}).context,E=p("MessageCustom"),n=E.CustemElement,M=E.TextElement,S=E.FaceElement,a=E.ImageElement,T=E.AudioElement,G=E.VideoElement,l=E.FileElement,P=E.MergerElement,Y=E.LocationElement,_=((m={})[s.TYPES.MSG_TEXT]=M,m[s.TYPES.MSG_FACE]=S,m[s.TYPES.MSG_IMAGE]=a,m[s.TYPES.MSG_AUDIO]=T,m[s.TYPES.MSG_VIDEO]=G,m[s.TYPES.MSG_FILE]=l,m[s.TYPES.MSG_CUSTOM]=n,m[s.TYPES.MSG_MERGER]=P,m[s.TYPES.MSG_LOCATION]=Y,m),j=(null==r?void 0:r.type)&&(_[r.type]||f[r.type]);return j&&t(j,e({context:i,message:r},{children:t(g,{message:r})}))}var P=o.memo(l);function Y(o){return t(P,e({},o))}export{Y as MessageContext};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as r,Fragment as n}from"react/jsx-runtime";import o from"react";import l from"@tencentcloud/chat";import{useTranslation as i}from"react-i18next";import{JSONStringToParse as a}from"../untils.js";import"../../context/TUIMessageContext.js";import{useComponentContext as u}from"../../context/ComponentContext.js";function c(o){var c=o.context,m=o.message,s=o.children,d=i().t,v=u().MessageCustomPlugins;return r("div",e({className:"bubble message-custom bubble-".concat(m.flow," ").concat((null==m?void 0:m.conversationType)===l.TYPES.CONV_GROUP?"group":"")},{children:[function(o){if("Hyperlink"===o.data){var l=a(null==o?void 0:o.extension);if(null==l?void 0:l.item)return null==l?void 0:l.item.map((function(r){return t("a",e({target:"_blank",href:r.value,rel:"noreferrer"},{children:r.value}),r.value)}));if(null==l?void 0:l.hyperlinks_text){var i=l.hyperlinks_text;return r(n,{children:[l.title," ",t("a",e({target:"_blank",href:null==i?void 0:i.value,rel:"noreferrer"},{children:i.key}),null==i?void 0:i.value)]})}}if("group_create"===o.data)return"".concat((null==m?void 0:m.nick)||(null==m?void 0:m.from)," Create a group");var u=a(o.data);return 1!==(null==u?void 0:u.chatbotPlugin)||15!==(null==u?void 0:u.src)||"welcome_msg"!==(null==u?void 0:u.subtype)&&"clarify_msg"!==(null==u?void 0:u.subtype)?"[".concat(d("TUIChat.Custom message"),"]"):t(v,{data:a(o.data).content})}(null==c?void 0:c.custom),s]}))}var m=o.memo(c);function s(r){return t(m,e({},r))}export{s as MessageCustom};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as r,Fragment as n}from"react/jsx-runtime";import o from"react";import l from"@tencentcloud/chat";import{useTranslation as i}from"react-i18next";import{JSONStringToParse as a}from"../untils.js";import"../../context/TUIMessageContext.js";import{useComponentContext as u}from"../../context/ComponentContext.js";function c(o){var c=o.context,m=o.message,s=o.children,d=i().t,v=u().MessageCustomPlugins;return r("div",e({className:"bubble message-custom bubble-".concat(null==m?void 0:m.flow," ").concat((null==m?void 0:m.conversationType)===l.TYPES.CONV_GROUP?"group":"")},{children:[function(o){if("Hyperlink"===o.data){var l=a(null==o?void 0:o.extension);if(null==l?void 0:l.item)return null==l?void 0:l.item.map((function(r){return t("a",e({target:"_blank",href:r.value,rel:"noreferrer"},{children:r.value}),r.value)}));if(null==l?void 0:l.hyperlinks_text){var i=l.hyperlinks_text;return r(n,{children:[l.title," ",t("a",e({target:"_blank",href:null==i?void 0:i.value,rel:"noreferrer"},{children:i.key}),null==i?void 0:i.value)]})}}if("group_create"===o.data)return"".concat((null==m?void 0:m.nick)||(null==m?void 0:m.from)," Create a group");var u=a(o.data);return 1!==(null==u?void 0:u.chatbotPlugin)||15!==(null==u?void 0:u.src)||"welcome_msg"!==(null==u?void 0:u.subtype)&&"clarify_msg"!==(null==u?void 0:u.subtype)?"[".concat(d("TUIChat.Custom message"),"]"):t(v,{data:a(o.data).content})}(null==c?void 0:c.custom),s]}))}var m=o.memo(c);function s(r){return t(m,e({},r))}export{s as MessageCustom};
@@ -1 +1 @@
1
- import{__assign as r}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import m from"react";function a(m){var a=m.context,c=m.message,o=m.children;return t("div",r({className:"bubble message-face bubble-".concat(c.flow)},{children:[e("img",{className:"img",src:a.url,alt:""}),o]}))}var c=m.memo(a);function o(t){return e(c,r({},t))}export{o as MessageFace};
1
+ import{__assign as r}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import m from"react";function o(m){var o=m.context,i=m.message,l=m.children;return t("div",r({className:"bubble message-face bubble-".concat(null==i?void 0:i.flow)},{children:[e("img",{className:"img",src:null==o?void 0:o.url,alt:""}),l]}))}var i=m.memo(o);function l(t){return e(i,r({},t))}export{l as MessageFace};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as r,jsxs as o}from"react/jsx-runtime";import a from"react";import n from"@tencentcloud/chat";import{Icon as t}from"../Icon/Icon.js";import{IconTypes as i}from"../Icon/type.js";function m(a){var m=a.context,s=a.message,l=a.children;return o("a",e({href:m.url,download:m.name,target:"_parent",className:"bubble message-file bubble-".concat(s.flow," ").concat((null==s?void 0:s.conversationType)===n.TYPES.CONV_GROUP?"group":""),rel:"noreferrer"},{children:[o("main",e({className:"message-file-main"},{children:[r(t,{className:"icon",width:15,height:20,type:i.FILE}),r("label",e({htmlFor:"message-file"},{children:m.name}))]})),o("div",e({className:"message-file-footer"},{children:[r("span",e({className:"message-file-size"},{children:m.size})),l]}))]}))}var s=a.memo(m);function l(o){return r(s,e({},o))}export{l as MessageFile};
1
+ import{__assign as e}from"tslib";import{jsx as r,jsxs as o}from"react/jsx-runtime";import l from"react";import n from"@tencentcloud/chat";import{Icon as i}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";function t(l){var t=l.context,m=l.message,s=l.children;return o("a",e({href:null==t?void 0:t.url,download:null==t?void 0:t.name,target:"_parent",className:"bubble message-file bubble-".concat(null==m?void 0:m.flow," ").concat((null==m?void 0:m.conversationType)===n.TYPES.CONV_GROUP?"group":""),rel:"noreferrer"},{children:[o("main",e({className:"message-file-main"},{children:[r(i,{className:"icon",width:15,height:20,type:a.FILE}),r("label",e({htmlFor:"message-file"},{children:null==t?void 0:t.name}))]})),o("div",e({className:"message-file-footer"},{children:[r("span",e({className:"message-file-size"},{children:null==t?void 0:t.size})),s]}))]}))}var m=l.memo(t);function s(o){return r(m,e({},o))}export{s as MessageFile};
@@ -1 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as i,jsxs as n}from"react/jsx-runtime";import r,{useState as t}from"react";import e from"@tencentcloud/chat";import{isH5 as l}from"../../utils/env.js";import{Model as c}from"../Model/index.js";function m(r){var m,a,u,d=r.context,s=r.message,f=r.children,v=t(!1),g=v[0],p=v[1],b=null===(a=null===(m=null==s?void 0:s.payload)||void 0===m?void 0:m.imageInfoArray)||void 0===a?void 0:a.filter((function(o){return 0===o.type}));return n("div",o({className:"message-image"},{children:[i("div",o({role:"button",tabIndex:0,onClick:function(){p(!0)}},{children:i("img",{className:"img ".concat(l?"img-h5":""," bubble-").concat(s.flow," ").concat((null==s?void 0:s.conversationType)===e.TYPES.CONV_GROUP?"group":""),src:d.url,alt:""})})),f,g&&i(c,o({onClick:function(){p(!1)}},{children:i("img",{className:"big-image",src:null===(u=b[0])||void 0===u?void 0:u.url,alt:""})}))]}))}var a=r.memo(m);function u(n){return i(a,o({},n))}export{u as MessageImage};
1
+ import{__assign as o}from"tslib";import{jsx as i,jsxs as n}from"react/jsx-runtime";import r,{useState as l}from"react";import t from"@tencentcloud/chat";import{isH5 as e}from"../../utils/env.js";import{Model as c}from"../Model/index.js";function m(r){var m,a,u,d=r.context,s=r.message,v=r.children,f=l(!1),g=f[0],p=f[1],b=null===(a=null===(m=null==s?void 0:s.payload)||void 0===m?void 0:m.imageInfoArray)||void 0===a?void 0:a.filter((function(o){return 0===o.type}));return n("div",o({className:"message-image"},{children:[i("div",o({role:"button",tabIndex:0,onClick:function(){p(!0)}},{children:i("img",{className:"img ".concat(e?"img-h5":""," bubble-").concat(null==s?void 0:s.flow," \n ").concat((null==s?void 0:s.conversationType)===t.TYPES.CONV_GROUP?"group":""),src:null==d?void 0:d.url,alt:""})})),v,g&&i(c,o({onClick:function(){p(!1)}},{children:i("img",{className:"big-image",src:null===(u=b[0])||void 0===u?void 0:u.url,alt:""})}))]}))}var a=r.memo(m);function u(n){return i(a,o({},n))}export{u as MessageImage};
@@ -1 +1 @@
1
- import{__assign as r}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import n from"react";function a(n){var a=n.context;n.message;var i=n.children;return t("a",r({className:"bubble message-location",href:a.href,target:"_blank",title:"点击查看详情",rel:"noreferrer"},{children:[e("span",{children:a.description}),e("img",{src:a.url,alt:""}),i]}))}var i=n.memo(a);function o(t){return e(i,r({},t))}export{o as MessageLocation};
1
+ import{__assign as r}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import n from"react";function i(n){var i=n.context;n.message;var l=n.children;return t("a",r({className:"bubble message-location",href:null==i?void 0:i.href,target:"_blank",title:"点击查看详情",rel:"noreferrer"},{children:[e("span",{children:null==i?void 0:i.description}),e("img",{src:null==i?void 0:i.url,alt:""}),l]}))}var l=n.memo(i);function o(t){return e(l,r({},t))}export{o as MessageLocation};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as r,jsxs as t}from"react/jsx-runtime";import n from"react";import a from"@tencentcloud/chat";function c(n){var c=n.context,i=n.message,m=n.children;return t("div",e({className:"bubble message-merger bubble-".concat(i.flow," ").concat((null==i?void 0:i.conversationType)===a.TYPES.CONV_GROUP?"group":"")},{children:[r("h3",{children:c.title}),r("ul",e({className:"message-merger-list"},{children:(null==c?void 0:c.abstractList.length)>0&&c.abstractList.map((function(t,n){var a=t+n;return r("li",e({className:"message-merger-item"},{children:t}),a)}))})),m]}))}var i=n.memo(c);function m(t){return r(i,e({},t))}export{m as MessageMerger};
1
+ import{__assign as e}from"tslib";import{jsx as r,jsxs as t}from"react/jsx-runtime";import l from"react";import n from"@tencentcloud/chat";function i(l){var i=l.context,o=l.message,a=l.children;return t("div",e({className:"bubble message-merger bubble-".concat(null==o?void 0:o.flow," ").concat((null==o?void 0:o.conversationType)===n.TYPES.CONV_GROUP?"group":"")},{children:[r("h3",{children:null==i?void 0:i.title}),r("ul",e({className:"message-merger-list"},{children:(null==i?void 0:i.abstractList.length)>0&&(null==i?void 0:i.abstractList.map((function(t,l){var n=t+l;return r("li",e({className:"message-merger-item"},{children:t}),n)})))})),a]}))}var o=l.memo(i);function a(t){return r(o,e({},t))}export{a as MessageMerger};
@@ -1 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import e from"@tencentcloud/chat";import"react";import{messageShowType as l}from"../../context/TUIMessageContext.js";function n(n){n.className;var r=n.CustomName,m=n.message,i=n.showType;return(i===l.ALL||(null==m?void 0:m.flow)===i)&&(null==m?void 0:m.conversationType)===e.TYPES.CONV_GROUP&&i!==l.NONE?r||t("label",o({htmlFor:"content",className:"text-ellipsis name"},{children:(null==m?void 0:m.nick)||(null==m?void 0:m.from)})):null}export{n as MessageName};
1
+ import{__assign as o}from"tslib";import{jsx as t,Fragment as e}from"react/jsx-runtime";import r from"@tencentcloud/chat";import"react";import{messageShowType as l}from"../../context/TUIMessageContext.js";function n(n){n.className;var m=n.CustomName,i=n.message,s=n.showType;return(s===l.ALL||(null==i?void 0:i.flow)===s)&&(null==i?void 0:i.conversationType)===r.TYPES.CONV_GROUP&&s!==l.NONE?m||t("label",o({htmlFor:"content",className:"text-ellipsis name"},{children:(null==i?void 0:i.nick)||(null==i?void 0:i.from)})):t(e,{})}export{n as MessageName};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as s,jsx as o}from"react/jsx-runtime";import{useState as i,useRef as l}from"react";import{useTranslation as t}from"react-i18next";import n from"@tencentcloud/chat";import{Plugins as r}from"../Plugins/index.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{useTUIChatStateContext as c}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as h}from"../../context/TUIMessageContext.js";import{useMessageHandler as u}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as g,MESSAGE_FLOW as p}from"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import{useMessagePluginElement as m}from"./hooks/useMessagePluginElement.js";var v;function f(v){var f,S,w,y,M,C,T=v.plugins,U=v.showNumber,x=v.MoreIcon,E=v.config,I=t().t,N=i(""),R=N[0];N[1];var k=i({}),j=k[0],b=k[1],q=l(null),O=h("MessagePlugins"),P=O.message,D=O.plugin,F=c("MessageBubbleWithContext").messageListRef,L=u({message:P}),W=L.handleDelMessage,Y=L.handleRevokeMessage,A=L.handleReplyMessage,V=L.handleCopyMessage,B=L.handleResendMessage,G=L.handleForWardMessage,H={quote:e(e({isShow:!0},null==E?void 0:E.quote),null===(f=null==D?void 0:D.config)||void 0===f?void 0:f.quote),forward:e(e({isShow:!0},null==E?void 0:E.forward),null===(S=null==D?void 0:D.config)||void 0===S?void 0:S.forward),copy:e(e({isShow:!0,relateMessageType:[n.TYPES.MSG_TEXT]},null==E?void 0:E.copy),null===(w=null==D?void 0:D.config)||void 0===w?void 0:w.copy),delete:e(e({isShow:!0},null==E?void 0:E.delete),null===(y=null==D?void 0:D.config)||void 0===y?void 0:y.delete),revoke:e(e({isShow:!0},null==E?void 0:E.revoke),null===(M=null==D?void 0:D.config)||void 0===M?void 0:M.revoke),resend:e(e({isShow:!0},null==E?void 0:E.resend),null===(C=null==D?void 0:D.config)||void 0===C?void 0:C.resend)},Q=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:I("TUIChat.Recall")}),o(a,{width:20,height:20,type:d.REVOCATION})]})),handle:function(e){q.current.closeMore(),Y(e)},message:P,isShow:H.revoke.isShow&&(null==P?void 0:P.status)===g.SUCCESS&&P.flow===p.OUT,relateMessageType:H.revoke.relateMessageType}),X=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",e({className:"del"},{children:I("TUIChat.Delete")})),o(a,{width:20,height:20,type:d.DEL})]})),handle:function(e){q.current.closeMore(),W(e)},message:P,isShow:H.delete.isShow&&(null==P?void 0:P.status)===g.SUCCESS,relateMessageType:H.delete.relateMessageType}),_=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:I("TUIChat.Reference")}),o(a,{width:20,height:20,type:d.QUOTE})]})),handle:function(e){q.current.closeMore(),A(e)},message:P,isShow:H.quote.isShow&&(null==P?void 0:P.status)===g.SUCCESS,relateMessageType:H.quote.relateMessageType}),z=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:I("TUIChat.Copy")}),o(a,{width:20,height:20,type:d.COPY})]})),handle:function(e){q.current.closeMore(),V(e)},message:P,isShow:H.copy.isShow&&(null==P?void 0:P.status)===g.SUCCESS,relateMessageType:H.copy.relateMessageType}),J=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:I("TUIChat.Resend")}),o(a,{width:20,height:20,type:d.REPLY})]})),handle:function(e){q.current.closeMore(),B(e)},message:P,isShow:H.resend.isShow&&(null==P?void 0:P.status)!==g.SUCCESS,relateMessageType:H.resend.relateMessageType}),K=[Q,_,m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:I("TUIChat.Forward")}),o(a,{width:20,height:20,type:d.FORWARD})]})),handle:function(e){q.current.closeMore(),G(e)},message:P,isShow:H.forward.isShow&&(null==P?void 0:P.status)===g.SUCCESS,relateMessageType:H.forward.relateMessageType}),X,J,z],Z=(T||(null==D?void 0:D.plugins)||K).filter((function(e){return e})),$=x||(null==D?void 0:D.MoreIcon)||o(a,{className:"icon-more",width:16,height:16,type:d.MORE}),ee=U||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==g.UNSEND&&o(r,{className:"message-plugin",customClass:R,style:j,ref:q,plugins:Z,showNumber:ee,MoreIcon:$,root:null==F?void 0:F.current,handleVisible:function(e){if(e.x&&e.y){var s=e.y<e.height||e.top,o=e.x<e.width||e.left;b({position:"fixed",left:"".concat(o?e.x:e.x-e.width,"px"),top:"".concat(s?e.y:e.y-e.height,"px")})}}})}!function(e){e.quote="quote",e.forward="forward",e.copy="copy",e.delete="delete",e.resend="resend",e.revoke="revoke"}(v||(v={}));export{f as MessagePlugins};
1
+ import{__assign as e}from"tslib";import{jsxs as o,jsx as s}from"react/jsx-runtime";import{useState as l,useRef as i}from"react";import{useTranslation as n}from"react-i18next";import t from"@tencentcloud/chat";import{Plugins as r}from"../Plugins/index.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{useTUIChatStateContext as u}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as c}from"../../context/TUIMessageContext.js";import{useMessageHandler as h}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as v,MESSAGE_FLOW as g}from"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import{useMessagePluginElement as p}from"./hooks/useMessagePluginElement.js";var m;function f(m){var f,M,S,w,y,C,T=m.plugins,U=m.showNumber,x=m.MoreIcon,E=m.config,I=n().t,N=l(""),R=N[0];N[1];var k=l({}),j=k[0],b=k[1],q=i(),O=c("MessagePlugins"),P=O.message,D=O.plugin,F=u("MessageBubbleWithContext").messageListRef,L=h({message:P}),W=L.handleDelMessage,Y=L.handleRevokeMessage,A=L.handleReplyMessage,V=L.handleCopyMessage,B=L.handleResendMessage,G=L.handleForWardMessage,H={quote:e(e({isShow:!0},null==E?void 0:E.quote),null===(f=null==D?void 0:D.config)||void 0===f?void 0:f.quote),forward:e(e({isShow:!0},null==E?void 0:E.forward),null===(M=null==D?void 0:D.config)||void 0===M?void 0:M.forward),copy:e(e({isShow:!0,relateMessageType:[t.TYPES.MSG_TEXT]},null==E?void 0:E.copy),null===(S=null==D?void 0:D.config)||void 0===S?void 0:S.copy),delete:e(e({isShow:!0},null==E?void 0:E.delete),null===(w=null==D?void 0:D.config)||void 0===w?void 0:w.delete),revoke:e(e({isShow:!0},null==E?void 0:E.revoke),null===(y=null==D?void 0:D.config)||void 0===y?void 0:y.revoke),resend:e(e({isShow:!0},null==E?void 0:E.resend),null===(C=null==D?void 0:D.config)||void 0===C?void 0:C.resend)},Q=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Recall")}),s(a,{width:20,height:20,type:d.REVOCATION})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),Y(e)},message:P,isShow:H.revoke.isShow&&(null==P?void 0:P.status)===v.SUCCESS&&P.flow===g.OUT,relateMessageType:H.revoke.relateMessageType}),X=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",e({className:"del"},{children:I("TUIChat.Delete")})),s(a,{width:20,height:20,type:d.DEL})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),W(e)},message:P,isShow:H.delete.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.delete.relateMessageType}),_=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Reference")}),s(a,{width:20,height:20,type:d.QUOTE})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),A(e)},message:P,isShow:H.quote.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.quote.relateMessageType}),z=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Copy")}),s(a,{width:20,height:20,type:d.COPY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),V(e)},message:P,isShow:H.copy.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.copy.relateMessageType}),J=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Resend")}),s(a,{width:20,height:20,type:d.REPLY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),B()},message:P,isShow:H.resend.isShow&&(null==P?void 0:P.status)!==v.SUCCESS,relateMessageType:H.resend.relateMessageType}),K=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Forward")}),s(a,{width:20,height:20,type:d.FORWARD})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),G(e)},message:P,isShow:H.forward.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.forward.relateMessageType}),Z=[Q,_,K,X,J,z],$=(T||(null==D?void 0:D.plugins)||Z).filter((function(e){return e})),ee=x||(null==D?void 0:D.MoreIcon)||s(a,{className:"icon-more",width:16,height:16,type:d.MORE}),oe=U||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==v.UNSEND&&s(r,{className:"message-plugin",customClass:R,style:j,ref:q,plugins:$,showNumber:oe,MoreIcon:ee,root:null==F?void 0:F.current,handleVisible:function(e){if(e.x&&e.y){var o=e.y<e.height||e.top,s=e.x<e.width||e.left;b({position:"fixed",left:"".concat(s?e.x:e.x-e.width,"px"),top:"".concat(o?e.y:e.y-e.height,"px")})}}})}!function(e){e.quote="quote",e.forward="forward",e.copy="copy",e.delete="delete",e.resend="resend",e.revoke="revoke"}(m||(m={}));export{f as MessagePlugins};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as o,jsxs as e}from"react/jsx-runtime";import s,{useState as r,useEffect as n}from"react";import i from"@tencentcloud/chat";import{MESSAGE_STATUS as l}from"../../constants.js";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as m}from"../../context/TUIMessageContext.js";function u(s){var u=s.message,c=s.children,p=s.Progress,d=s.isShow,g=void 0!==d&&d,v=r(),f=v[0],h=v[1],S=r(0),x=S[0],P=S[1],M=a("MessageProgressWithContext").uploadPendingMessageList,E=m("MessageProgressWithContext"),I=E.isShowProgress,C=void 0!==I&&I,T=E.Progress,j=p||T,y=g||C;return n((function(){M&&M.length>0&&M.map((function(t){return(null==t?void 0:t.ID)===(null==u?void 0:u.ID)&&(h(t),P(null==t?void 0:t.progress)),t}))}),[M]),y?j?o(j,{message:f}):!((null==u?void 0:u.type)!==i.TYPES.MSG_IMAGE&&(null==u?void 0:u.type)!==i.TYPES.MSG_VIDEO&&(null==u?void 0:u.type)!==i.TYPES.MSG_FILE||(null==u?void 0:u.status)!==l.UNSEND)&&e("div",t({className:"progress-box"},{children:[o("span",{className:"progress",style:{width:"".concat(100*x,"%")}}),c]})):null}var c=s.memo(u);function p(e){return o(c,t({},e))}export{p as MessageProgress};
1
+ import{__assign as o}from"tslib";import{jsx as t,Fragment as e,jsxs as s}from"react/jsx-runtime";import r,{useState as n,useEffect as i}from"react";import a from"@tencentcloud/chat";import{MESSAGE_STATUS as l}from"../../constants.js";import{useTUIChatStateContext as m}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as c}from"../../context/TUIMessageContext.js";function p(r){var p=r.message,u=r.children,g=r.Progress,d=r.isShow,v=void 0!==d&&d,f=n(),h=f[0],S=f[1],x=n(0),P=x[0],M=x[1],E=m("MessageProgressWithContext").uploadPendingMessageList,I=c("MessageProgressWithContext"),C=I.isShowProgress,T=void 0!==C&&C,j=I.Progress,y=g||j,D=v||T;return i((function(){E&&E.length>0&&E.map((function(o){return(null==o?void 0:o.ID)===(null==p?void 0:p.ID)&&(S(o),(null==o?void 0:o.progress)&&M(o.progress)),o}))}),[E]),D?y&&h?t(y,{message:h}):!((null==p?void 0:p.type)!==a.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==a.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==a.TYPES.MSG_FILE||(null==p?void 0:p.status)!==l.UNSEND)&&s("div",o({className:"progress-box"},{children:[t("span",{className:"progress",style:{width:"".concat(100*P,"%")}}),u]})):t(e,{})}var u=r.memo(p);function g(e){return t(u,o({},e))}export{g as MessageProgress};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as r}from"react";import{useTranslation as i}from"react-i18next";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function c(n){var c=n.message,d=i().t,p=m().operateMessage,u=r((function(){var t;p(((t={})[l.REVOKE]=c,t))}),[p]);return o("div",t({className:"bubble message-system message-revoke"},{children:[(null==c?void 0:c.flow)===s.IN&&e("span",{children:(null==c?void 0:c.nick)||(null==c?void 0:c.from)}),(null==c?void 0:c.flow)!==s.IN&&e("span",t({style:{marginRight:"5px"}},{children:d("TUIChat.You")})),e("span",t({style:{marginRight:"5px"}},{children:d("TUIChat.recalled a message")})),(null==c?void 0:c.flow)===s.OUT&&(null==c?void 0:c.type)===a.TYPES.MSG_TEXT&&e("span",t({className:"edit",role:"button",tabIndex:0,onClick:u},{children:d("TUIChat.Re-edit")}))]}))}var d=n.memo(c);function p(o){return e(d,t({},o))}export{p as MessageRevoke};
1
+ import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as r}from"react";import{useTranslation as i}from"react-i18next";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function c(n){var c=n.message,d=i().t,p=m().operateMessage,u=r((function(){var t;p&&c&&p(((t={})[l.REVOKE]=c,t))}),[p]);return o("div",t({className:"bubble message-system message-revoke"},{children:[(null==c?void 0:c.flow)===s.IN&&e("span",{children:(null==c?void 0:c.nick)||(null==c?void 0:c.from)}),(null==c?void 0:c.flow)!==s.IN&&e("span",t({style:{marginRight:"5px"}},{children:d("TUIChat.You")})),e("span",t({style:{marginRight:"5px"}},{children:d("TUIChat.recalled a message")})),(null==c?void 0:c.flow)===s.OUT&&(null==c?void 0:c.type)===a.TYPES.MSG_TEXT&&e("span",t({className:"edit",role:"button",tabIndex:0,onClick:u},{children:d("TUIChat.Re-edit")}))]}))}var d=n.memo(c);function p(o){return e(d,t({},o))}export{p as MessageRevoke};