@tencentcloud/chat-uikit-react 2.2.7 → 2.2.8

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 (673) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/_virtual/index.js +1 -0
  3. package/dist/cjs/components/Avatar/Avatar.d.ts +1 -1
  4. package/dist/cjs/components/{TUIChat/TUIChat.d.ts → Chat/Chat.d.ts} +8 -8
  5. package/dist/cjs/components/Chat/Chat.js +1 -0
  6. package/dist/cjs/components/Chat/index.js +1 -0
  7. package/dist/cjs/components/{TUIChatHeader/TUIChatHeader.d.ts → ChatHeader/ChatHeader.d.ts} +3 -3
  8. package/dist/cjs/components/ChatHeader/ChatHeader.js +1 -0
  9. package/dist/cjs/components/{TUIChatHeader/TUIChatHeaderDefault.d.ts → ChatHeader/ChatHeaderDefault.d.ts} +2 -2
  10. package/dist/cjs/components/ChatHeader/ChatHeaderDefault.js +1 -0
  11. package/dist/cjs/components/ChatSetting/ChatSetting.d.ts +6 -0
  12. package/dist/cjs/components/ChatSetting/ChatSetting.js +1 -0
  13. package/dist/cjs/components/Contact/Contact.d.ts +6 -0
  14. package/dist/cjs/components/Contact/Contact.js +1 -0
  15. package/dist/cjs/components/Contact/ContactInfo/ContactInfo.d.ts +10 -0
  16. package/dist/cjs/components/Contact/ContactInfo/ContactInfo.js +1 -0
  17. package/dist/cjs/components/Contact/ContactInfo/basicInfo.js +1 -0
  18. package/dist/cjs/components/Contact/ContactInfo/blockInfo.js +1 -0
  19. package/dist/cjs/components/Contact/ContactInfo/friendApplication.js +1 -0
  20. package/dist/cjs/components/Contact/ContactInfo/friendInfo.js +1 -0
  21. package/dist/cjs/components/Contact/ContactInfo/groupInfo.js +1 -0
  22. package/dist/cjs/components/Contact/ContactInfo/hooks/useContactInfo.js +1 -0
  23. package/dist/cjs/components/Contact/ContactList/ContactList.d.ts +6 -0
  24. package/dist/cjs/components/Contact/ContactList/ContactList.js +1 -0
  25. package/dist/cjs/components/Contact/hooks/useTUIContact.js +1 -0
  26. package/dist/cjs/components/ContactSearch/ContactSearch.js +1 -0
  27. package/dist/cjs/components/ContactSearch/hooks/useContactSearch.js +1 -0
  28. package/dist/cjs/components/ConversationActions/ConversationActions.d.ts +52 -0
  29. package/dist/cjs/components/ConversationActions/ConversationActions.js +1 -0
  30. package/dist/cjs/components/ConversationCreate/ConversationCreate.d.ts +21 -0
  31. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  32. package/dist/cjs/components/ConversationCreate/ConversationCreateButton.d.ts +13 -0
  33. package/dist/cjs/components/ConversationCreate/ConversationCreateButton.js +1 -0
  34. package/dist/cjs/components/ConversationCreate/ConversationCreateGroupDetail.d.ts +16 -0
  35. package/dist/cjs/components/ConversationCreate/ConversationCreateGroupDetail.js +1 -0
  36. package/dist/cjs/components/ConversationCreate/ConversationCreateSelectView.d.ts +15 -0
  37. package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.d.ts +18 -0
  38. package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  39. package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.d.ts +24 -0
  40. package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
  41. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.d.ts +14 -0
  42. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  43. package/dist/cjs/components/ConversationList/ConversationList.d.ts +57 -0
  44. package/dist/cjs/components/ConversationList/ConversationList.js +1 -0
  45. package/dist/cjs/components/ConversationList/ConversationListContent/ConversationListContent.d.ts +23 -0
  46. package/dist/cjs/components/ConversationList/ConversationListContent/ConversationListContent.js +1 -0
  47. package/dist/cjs/components/ConversationList/ConversationListHeader/ConversationListHeader.d.ts +15 -0
  48. package/dist/cjs/components/ConversationList/ConversationListHeader/ConversationListHeader.js +1 -0
  49. package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +39 -27
  50. package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
  51. package/dist/cjs/components/ConversationPreview/utils.js +1 -1
  52. package/dist/cjs/components/ConversationSearch/ConversationSearch.d.ts +39 -0
  53. package/dist/cjs/components/ConversationSearch/ConversationSearch.js +1 -0
  54. package/dist/cjs/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.d.ts +7 -0
  55. package/dist/cjs/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js +1 -0
  56. package/dist/cjs/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.d.ts +29 -0
  57. package/dist/cjs/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.js +1 -0
  58. package/dist/cjs/components/Icon/Icon.js +1 -1
  59. package/dist/cjs/components/Icon/config.js +1 -1
  60. package/dist/cjs/components/Icon/images/mute.svg.js +1 -0
  61. package/dist/cjs/components/Icon/type.d.ts +2 -0
  62. package/dist/cjs/components/Icon/type.js +1 -1
  63. package/dist/cjs/components/Input/Input.d.ts +5 -2
  64. package/dist/cjs/components/Input/Input.js +1 -1
  65. package/dist/{esm/components/TUIMessage/TUIMessage.d.ts → cjs/components/MessageElement/Message.d.ts} +1 -1
  66. package/dist/cjs/components/MessageElement/Message.js +1 -0
  67. package/dist/cjs/components/MessageElement/MessageAudio.js +1 -0
  68. package/dist/cjs/components/MessageElement/MessageAvatar.js +1 -0
  69. package/dist/cjs/components/MessageElement/MessageBubble.js +1 -0
  70. package/dist/cjs/components/MessageElement/MessageContext.js +1 -0
  71. package/dist/cjs/components/MessageElement/MessageCustom.js +1 -0
  72. package/dist/cjs/components/MessageElement/MessageDefault.js +1 -0
  73. package/dist/cjs/components/MessageElement/MessageName.js +1 -0
  74. package/dist/cjs/components/MessageElement/MessagePlugins.js +1 -0
  75. package/dist/cjs/components/MessageElement/MessageProgress.js +1 -0
  76. package/dist/cjs/components/MessageElement/MessageRevoke.js +1 -0
  77. package/dist/cjs/components/MessageElement/MessageStatus.js +1 -0
  78. package/dist/cjs/components/MessageElement/MessageSystem.js +1 -0
  79. package/dist/cjs/components/MessageElement/MessageText.js +1 -0
  80. package/dist/cjs/components/MessageElement/MessageTip.js +1 -0
  81. package/dist/cjs/components/MessageElement/hooks/useMessageHandler.js +1 -0
  82. package/dist/cjs/components/MessageElement/hooks/useMessageReply.js +1 -0
  83. package/dist/cjs/components/MessageInput/EmojiPicker.js +1 -0
  84. package/dist/cjs/components/MessageInput/Forward.js +1 -0
  85. package/dist/cjs/components/MessageInput/InputPluginsDefalut.js +1 -0
  86. package/dist/cjs/components/MessageInput/InputQuoteDefalut.js +1 -0
  87. package/dist/cjs/components/{TUIMessageInput/TUIMessageInput.d.ts → MessageInput/MessageInput.d.ts} +4 -4
  88. package/dist/cjs/components/MessageInput/MessageInput.js +1 -0
  89. package/dist/cjs/components/MessageInput/MessageInputDefault.js +1 -0
  90. package/dist/cjs/components/MessageInput/Transmitter.js +1 -0
  91. package/dist/cjs/components/MessageInput/hooks/useEmojiPicker.js +1 -0
  92. package/dist/cjs/components/MessageInput/hooks/useHandleForwardMessage.js +1 -0
  93. package/dist/cjs/components/MessageInput/hooks/useHandleQuoteMessage.js +1 -0
  94. package/dist/cjs/components/MessageInput/hooks/useMessageInputText.js +1 -0
  95. package/dist/cjs/components/MessageInput/hooks/useUploadPicker.js +1 -0
  96. package/dist/cjs/components/{TUIMessageList/TUIMessageList.d.ts → MessageList/MessageList.d.ts} +3 -3
  97. package/dist/cjs/components/MessageList/MessageList.js +1 -0
  98. package/dist/cjs/components/MessageList/hooks/useMessageListElement.js +1 -0
  99. package/dist/cjs/components/PlaceHolder/index.d.ts +34 -0
  100. package/dist/cjs/components/PlaceHolder/index.js +1 -0
  101. package/dist/cjs/components/Plugins/index.d.ts +5 -2
  102. package/dist/cjs/components/Profile/Profile.d.ts +10 -0
  103. package/dist/cjs/components/Profile/Profile.js +1 -1
  104. package/dist/cjs/components/Profile/ProfileDefault.js +1 -0
  105. package/dist/cjs/components/Profile/myProfile/MyProfile.js +1 -0
  106. package/dist/cjs/context/{TUIChatActionContext.d.ts → ChatActionContext.d.ts} +1 -1
  107. package/dist/cjs/context/{TUIChatStateContext.d.ts → ChatStateContext.d.ts} +6 -6
  108. package/dist/cjs/context/ComponentContext.d.ts +3 -3
  109. package/dist/cjs/context/{TUIContactContext.d.ts → ContactContext.d.ts} +4 -4
  110. package/dist/cjs/context/ConversationListContext.d.ts +22 -0
  111. package/dist/cjs/context/ConversationListContext.js +1 -0
  112. package/dist/{esm/context/TUIMessageContext.d.ts → cjs/context/MessageContext.d.ts} +1 -1
  113. package/dist/{esm/context/TUIMessageInputContext.d.ts → cjs/context/MessageInputContext.d.ts} +4 -4
  114. package/dist/cjs/hooks/useConversation.d.ts +4 -23
  115. package/dist/cjs/hooks/useConversation.js +1 -1
  116. package/dist/cjs/hooks/useLongPress.d.ts +3 -0
  117. package/dist/cjs/hooks/useLongPress.js +1 -0
  118. package/dist/cjs/hooks/useMouseHover.js +1 -0
  119. package/dist/cjs/index.css +2 -1
  120. package/dist/cjs/index.d.css +885 -407
  121. package/dist/cjs/index.d.ts +41 -29
  122. package/dist/cjs/index.js +1 -1
  123. package/dist/cjs/locales/en-US/TUIConversation.js +1 -1
  124. package/dist/cjs/locales/index.js +1 -1
  125. package/dist/cjs/locales/ja-JP/TUIConversation.js +1 -1
  126. package/dist/cjs/locales/ko-KR/TUIConversation.js +1 -1
  127. package/dist/cjs/locales/zh-CN/TUIConversation.js +1 -1
  128. package/dist/cjs/locales/zh-TW/TUIConversation.js +1 -1
  129. package/dist/esm/_virtual/index.js +1 -0
  130. package/dist/esm/components/Avatar/Avatar.d.ts +1 -1
  131. package/dist/esm/components/{TUIChat/TUIChat.d.ts → Chat/Chat.d.ts} +8 -8
  132. package/dist/esm/components/Chat/Chat.js +1 -0
  133. package/dist/esm/components/Chat/index.js +1 -0
  134. package/dist/esm/components/{TUIChatHeader/TUIChatHeader.d.ts → ChatHeader/ChatHeader.d.ts} +3 -3
  135. package/dist/esm/components/ChatHeader/ChatHeader.js +1 -0
  136. package/dist/esm/components/{TUIChatHeader/TUIChatHeaderDefault.d.ts → ChatHeader/ChatHeaderDefault.d.ts} +2 -2
  137. package/dist/esm/components/ChatHeader/ChatHeaderDefault.js +1 -0
  138. package/dist/esm/components/ChatSetting/ChatSetting.d.ts +6 -0
  139. package/dist/esm/components/ChatSetting/ChatSetting.js +1 -0
  140. package/dist/esm/components/Contact/Contact.d.ts +6 -0
  141. package/dist/esm/components/Contact/Contact.js +1 -0
  142. package/dist/esm/components/Contact/ContactInfo/ContactInfo.d.ts +10 -0
  143. package/dist/esm/components/Contact/ContactInfo/ContactInfo.js +1 -0
  144. package/dist/esm/components/Contact/ContactInfo/basicInfo.js +1 -0
  145. package/dist/esm/components/Contact/ContactInfo/blockInfo.js +1 -0
  146. package/dist/esm/components/Contact/ContactInfo/friendApplication.js +1 -0
  147. package/dist/esm/components/Contact/ContactInfo/friendInfo.js +1 -0
  148. package/dist/esm/components/Contact/ContactInfo/groupInfo.js +1 -0
  149. package/dist/esm/components/Contact/ContactInfo/hooks/useContactInfo.js +1 -0
  150. package/dist/esm/components/Contact/ContactList/ContactList.d.ts +6 -0
  151. package/dist/esm/components/Contact/ContactList/ContactList.js +1 -0
  152. package/dist/esm/components/Contact/hooks/useTUIContact.js +1 -0
  153. package/dist/esm/components/ContactSearch/ContactSearch.js +1 -0
  154. package/dist/esm/components/ContactSearch/hooks/useContactSearch.js +1 -0
  155. package/dist/esm/components/ConversationActions/ConversationActions.d.ts +52 -0
  156. package/dist/esm/components/ConversationActions/ConversationActions.js +1 -0
  157. package/dist/esm/components/ConversationCreate/ConversationCreate.d.ts +21 -0
  158. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  159. package/dist/esm/components/ConversationCreate/ConversationCreateButton.d.ts +13 -0
  160. package/dist/esm/components/ConversationCreate/ConversationCreateButton.js +1 -0
  161. package/dist/esm/components/ConversationCreate/ConversationCreateGroupDetail.d.ts +16 -0
  162. package/dist/esm/components/ConversationCreate/ConversationCreateGroupDetail.js +1 -0
  163. package/dist/esm/components/ConversationCreate/ConversationCreateSelectView.d.ts +15 -0
  164. package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.d.ts +18 -0
  165. package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  166. package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.d.ts +24 -0
  167. package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
  168. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.d.ts +14 -0
  169. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  170. package/dist/esm/components/ConversationList/ConversationList.d.ts +57 -0
  171. package/dist/esm/components/ConversationList/ConversationList.js +1 -0
  172. package/dist/esm/components/ConversationList/ConversationListContent/ConversationListContent.d.ts +23 -0
  173. package/dist/esm/components/ConversationList/ConversationListContent/ConversationListContent.js +1 -0
  174. package/dist/esm/components/ConversationList/ConversationListHeader/ConversationListHeader.d.ts +15 -0
  175. package/dist/esm/components/ConversationList/ConversationListHeader/ConversationListHeader.js +1 -0
  176. package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +39 -27
  177. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
  178. package/dist/esm/components/ConversationPreview/utils.js +1 -1
  179. package/dist/esm/components/ConversationSearch/ConversationSearch.d.ts +39 -0
  180. package/dist/esm/components/ConversationSearch/ConversationSearch.js +1 -0
  181. package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.d.ts +7 -0
  182. package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js +1 -0
  183. package/dist/esm/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.d.ts +29 -0
  184. package/dist/esm/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.js +1 -0
  185. package/dist/esm/components/Icon/Icon.js +1 -1
  186. package/dist/esm/components/Icon/config.js +1 -1
  187. package/dist/esm/components/Icon/images/mute.svg.js +1 -0
  188. package/dist/esm/components/Icon/type.d.ts +2 -0
  189. package/dist/esm/components/Icon/type.js +1 -1
  190. package/dist/esm/components/Input/Input.d.ts +5 -2
  191. package/dist/esm/components/Input/Input.js +1 -1
  192. package/dist/{cjs/components/TUIMessage/TUIMessage.d.ts → esm/components/MessageElement/Message.d.ts} +1 -1
  193. package/dist/esm/components/MessageElement/Message.js +1 -0
  194. package/dist/esm/components/MessageElement/MessageAudio.js +1 -0
  195. package/dist/esm/components/MessageElement/MessageAvatar.js +1 -0
  196. package/dist/esm/components/MessageElement/MessageBubble.js +1 -0
  197. package/dist/esm/components/MessageElement/MessageContext.js +1 -0
  198. package/dist/esm/components/MessageElement/MessageCustom.js +1 -0
  199. package/dist/esm/components/MessageElement/MessageDefault.js +1 -0
  200. package/dist/esm/components/MessageElement/MessageName.js +1 -0
  201. package/dist/esm/components/MessageElement/MessagePlugins.js +1 -0
  202. package/dist/esm/components/MessageElement/MessageProgress.js +1 -0
  203. package/dist/esm/components/MessageElement/MessageRevoke.js +1 -0
  204. package/dist/esm/components/MessageElement/MessageStatus.js +1 -0
  205. package/dist/esm/components/MessageElement/MessageSystem.js +1 -0
  206. package/dist/esm/components/MessageElement/MessageText.js +1 -0
  207. package/dist/esm/components/MessageElement/MessageTip.js +1 -0
  208. package/dist/esm/components/MessageElement/hooks/useMessageHandler.js +1 -0
  209. package/dist/esm/components/MessageElement/hooks/useMessageReply.js +1 -0
  210. package/dist/esm/components/MessageInput/EmojiPicker.js +1 -0
  211. package/dist/esm/components/MessageInput/Forward.js +1 -0
  212. package/dist/esm/components/MessageInput/InputPluginsDefalut.js +1 -0
  213. package/dist/esm/components/MessageInput/InputQuoteDefalut.js +1 -0
  214. package/dist/esm/components/{TUIMessageInput/TUIMessageInput.d.ts → MessageInput/MessageInput.d.ts} +4 -4
  215. package/dist/esm/components/MessageInput/MessageInput.js +1 -0
  216. package/dist/esm/components/MessageInput/MessageInputDefault.js +1 -0
  217. package/dist/esm/components/MessageInput/Transmitter.js +1 -0
  218. package/dist/esm/components/MessageInput/hooks/useEmojiPicker.js +1 -0
  219. package/dist/esm/components/MessageInput/hooks/useHandleForwardMessage.js +1 -0
  220. package/dist/esm/components/MessageInput/hooks/useHandleQuoteMessage.js +1 -0
  221. package/dist/esm/components/MessageInput/hooks/useMessageInputText.js +1 -0
  222. package/dist/esm/components/MessageInput/hooks/useUploadPicker.js +1 -0
  223. package/dist/esm/components/{TUIMessageList/TUIMessageList.d.ts → MessageList/MessageList.d.ts} +3 -3
  224. package/dist/esm/components/MessageList/MessageList.js +1 -0
  225. package/dist/esm/components/MessageList/hooks/useMessageListElement.js +1 -0
  226. package/dist/esm/components/PlaceHolder/index.d.ts +34 -0
  227. package/dist/esm/components/PlaceHolder/index.js +1 -0
  228. package/dist/esm/components/Plugins/index.d.ts +5 -2
  229. package/dist/esm/components/Profile/Profile.d.ts +10 -0
  230. package/dist/esm/components/Profile/Profile.js +1 -1
  231. package/dist/esm/components/Profile/ProfileDefault.js +1 -0
  232. package/dist/esm/components/Profile/myProfile/MyProfile.js +1 -0
  233. package/dist/esm/context/{TUIChatActionContext.d.ts → ChatActionContext.d.ts} +1 -1
  234. package/dist/esm/context/{TUIChatStateContext.d.ts → ChatStateContext.d.ts} +6 -6
  235. package/dist/esm/context/ComponentContext.d.ts +3 -3
  236. package/dist/esm/context/{TUIContactContext.d.ts → ContactContext.d.ts} +4 -4
  237. package/dist/esm/context/ConversationListContext.d.ts +22 -0
  238. package/dist/esm/context/ConversationListContext.js +1 -0
  239. package/dist/{cjs/context/TUIMessageContext.d.ts → esm/context/MessageContext.d.ts} +1 -1
  240. package/dist/{cjs/context/TUIMessageInputContext.d.ts → esm/context/MessageInputContext.d.ts} +4 -4
  241. package/dist/esm/hooks/useConversation.d.ts +4 -23
  242. package/dist/esm/hooks/useConversation.js +1 -1
  243. package/dist/esm/hooks/useLongPress.d.ts +3 -0
  244. package/dist/esm/hooks/useLongPress.js +1 -0
  245. package/dist/esm/hooks/useMouseHover.js +1 -0
  246. package/dist/esm/index.css +2 -1
  247. package/dist/esm/index.d.css +885 -407
  248. package/dist/esm/index.d.ts +41 -29
  249. package/dist/esm/index.js +1 -1
  250. package/dist/esm/locales/en-US/TUIConversation.js +1 -1
  251. package/dist/esm/locales/index.js +1 -1
  252. package/dist/esm/locales/ja-JP/TUIConversation.js +1 -1
  253. package/dist/esm/locales/ko-KR/TUIConversation.js +1 -1
  254. package/dist/esm/locales/zh-CN/TUIConversation.js +1 -1
  255. package/dist/esm/locales/zh-TW/TUIConversation.js +1 -1
  256. package/package.json +2 -1
  257. package/src/components/Avatar/Avatar.tsx +33 -31
  258. package/src/components/{TUIChat/TUIChat.tsx → Chat/Chat.tsx} +15 -15
  259. package/src/components/{TUIChat → Chat}/hooks/useHandleMessage.tsx +1 -1
  260. package/src/components/{TUIChat → Chat}/hooks/useHandleMessageList.tsx +1 -1
  261. package/src/components/{TUIChat → Chat}/index.ts +1 -1
  262. package/src/components/{TUIChatHeader/TUIChatHeader.tsx → ChatHeader/ChatHeader.tsx} +5 -5
  263. package/src/components/{TUIChatHeader/TUIChatHeaderDefault.tsx → ChatHeader/ChatHeaderDefault.tsx} +2 -2
  264. package/src/components/ChatHeader/index.ts +2 -0
  265. package/src/components/{TUIChatHeader → ChatHeader}/styles/layout.scss +0 -8
  266. package/src/components/{TUIManage/TUIManage.tsx → ChatSetting/ChatSetting.tsx} +17 -20
  267. package/src/components/ChatSetting/index.ts +1 -0
  268. package/src/components/{TUIManage → ChatSetting}/styles/index.scss +4 -2
  269. package/src/components/Checkbox/index.tsx +9 -9
  270. package/src/components/{TUIContact/TUIContact.tsx → Contact/Contact.tsx} +35 -35
  271. package/src/components/{TUIContact/TUIContactInfo/TUIContactInfo.tsx → Contact/ContactInfo/ContactInfo.tsx} +4 -4
  272. package/src/components/{TUIContact/TUIContactList/TUIContactList.tsx → Contact/ContactList/ContactList.tsx} +3 -3
  273. package/src/components/Contact/index.ts +3 -0
  274. package/src/components/{TUIContactSearch/TUIContactSearch.tsx → ContactSearch/ContactSearch.tsx} +8 -7
  275. package/src/components/ConversationActions/ConversationActions.scss +45 -0
  276. package/src/components/ConversationActions/ConversationActions.tsx +172 -0
  277. package/src/components/ConversationActions/index.ts +1 -0
  278. package/src/components/ConversationCreate/ConversationCreate.tsx +104 -49
  279. package/src/components/ConversationCreate/ConversationCreateButton.tsx +46 -0
  280. package/src/components/ConversationCreate/ConversationCreateGroupDetail.tsx +179 -0
  281. package/src/components/ConversationCreate/ConversationCreateSelectView.tsx +7 -7
  282. package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +31 -29
  283. package/src/components/ConversationCreate/ConversationGroupTypeInfo.tsx +19 -19
  284. package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +36 -29
  285. package/src/components/ConversationCreate/index.ts +2 -1
  286. package/src/components/ConversationCreate/styles/{ConversationCreatGroupDetail.scss → ConversationCreateGroupDetail.scss} +6 -1
  287. package/src/components/ConversationCreate/styles/conversationCreateButton.scss +5 -0
  288. package/src/components/ConversationCreate/styles/index.scss +34 -2
  289. package/src/components/ConversationList/ConversationList.scss +29 -0
  290. package/src/components/ConversationList/ConversationList.tsx +155 -0
  291. package/src/components/ConversationList/ConversationListContent/ConversationListContent.scss +16 -0
  292. package/src/components/ConversationList/ConversationListContent/ConversationListContent.tsx +63 -0
  293. package/src/components/ConversationList/ConversationListContent/index.ts +1 -0
  294. package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.scss +28 -0
  295. package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.tsx +43 -0
  296. package/src/components/ConversationList/ConversationListHeader/index.ts +1 -0
  297. package/src/components/ConversationList/index.ts +3 -0
  298. package/src/components/ConversationPreview/ConversationPreview.scss +137 -0
  299. package/src/components/ConversationPreview/ConversationPreview.tsx +245 -63
  300. package/src/components/ConversationPreview/index.ts +0 -1
  301. package/src/components/ConversationPreview/utils.tsx +78 -60
  302. package/src/components/ConversationSearch/ConversationSearch.scss +22 -0
  303. package/src/components/ConversationSearch/ConversationSearch.tsx +125 -0
  304. package/src/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.scss +13 -0
  305. package/src/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.tsx +42 -0
  306. package/src/components/ConversationSearch/ConversationSearchInput/index.ts +1 -0
  307. package/src/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.scss +15 -0
  308. package/src/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.tsx +72 -0
  309. package/src/components/ConversationSearch/ConversationSearchResult/index.ts +1 -0
  310. package/src/components/ConversationSearch/index.ts +3 -2
  311. package/src/components/EmptyStateIndicator/EmptyStateIndicator.tsx +2 -3
  312. package/src/components/Icon/Icon.tsx +8 -8
  313. package/src/components/Icon/config.ts +9 -0
  314. package/src/components/Icon/images/mute.svg +8 -0
  315. package/src/components/Icon/styles/index.scss +41 -6
  316. package/src/components/Icon/type.ts +2 -0
  317. package/src/components/Input/Input.tsx +24 -23
  318. package/src/components/{TUIMessage/TUIMessage.tsx → MessageElement/Message.tsx} +33 -33
  319. package/src/components/{TUIMessage → MessageElement}/MessageCustom.tsx +1 -1
  320. package/src/components/{TUIMessage/TUIMessageDefault.tsx → MessageElement/MessageDefault.tsx} +24 -24
  321. package/src/components/{TUIMessage → MessageElement}/MessagePlugins.tsx +18 -18
  322. package/src/components/{TUIMessage → MessageElement}/index.ts +1 -1
  323. package/src/components/{TUIMessage → MessageElement}/styles/layout.scss +1 -1
  324. package/src/components/{TUIMessageInput → MessageInput}/EmojiPicker.tsx +2 -2
  325. package/src/components/{TUIMessageInput/TUIForward.tsx → MessageInput/Forward.tsx} +41 -36
  326. package/src/components/{TUIMessageInput → MessageInput}/InputPluginsDefalut.tsx +2 -2
  327. package/src/components/{TUIMessageInput → MessageInput}/InputQuoteDefalut.tsx +1 -1
  328. package/src/components/{TUIMessageInput/TUIMessageInput.tsx → MessageInput/MessageInput.tsx} +25 -27
  329. package/src/components/{TUIMessageInput/TUIMessageInputDefault.tsx → MessageInput/MessageInputDefault.tsx} +14 -14
  330. package/src/components/{TUIMessageInput → MessageInput}/Transmitter.tsx +2 -2
  331. package/src/components/{TUIMessageInput → MessageInput}/hooks/useEmojiPicker.tsx +1 -1
  332. package/src/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.tsx +1 -1
  333. package/src/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputText.tsx +2 -2
  334. package/src/components/MessageInput/index.ts +3 -0
  335. package/src/components/{TUIMessageInput → MessageInput}/styles/color.scss +1 -1
  336. package/src/components/{TUIMessageList/TUIMessageList.tsx → MessageList/MessageList.tsx} +5 -5
  337. package/src/components/{TUIMessageList → MessageList}/hooks/useMessageListElement.tsx +1 -1
  338. package/src/components/MessageList/index.ts +1 -0
  339. package/src/components/PlaceHolder/index.tsx +79 -0
  340. package/src/components/PlaceHolder/styles/index.scss +36 -0
  341. package/src/components/Plugins/index.tsx +49 -45
  342. package/src/components/Profile/Profile.tsx +46 -21
  343. package/src/components/Profile/index.ts +2 -1
  344. package/src/components/Profile/myProfile/MyProfile.tsx +25 -0
  345. package/src/components/Profile/myProfile/index.ts +1 -0
  346. package/src/components/Profile/myProfile/styles/index.scss +32 -0
  347. package/src/components/Profile/styles/index.scss +2 -32
  348. package/src/components/{TUIProfile → Profile}/styles/layout.scss +1 -0
  349. package/src/components/index.ts +13 -11
  350. package/src/context/{TUIChatActionContext.tsx → ChatActionContext.tsx} +1 -1
  351. package/src/context/ChatStateContext.tsx +49 -0
  352. package/src/context/ComponentContext.tsx +13 -13
  353. package/src/context/{TUIContactContext.tsx → ContactContext.tsx} +10 -11
  354. package/src/context/ConversationListContext.tsx +113 -0
  355. package/src/context/LanguageContext.tsx +1 -0
  356. package/src/context/MessageContext.tsx +55 -0
  357. package/src/context/MessageInputContext.tsx +54 -0
  358. package/src/context/index.ts +6 -5
  359. package/src/hooks/index.ts +2 -0
  360. package/src/hooks/useConversation.tsx +26 -74
  361. package/src/hooks/useLongPress.tsx +117 -0
  362. package/src/hooks/useMouseHover.tsx +21 -0
  363. package/src/locales/en-US/TUIConversation.ts +4 -0
  364. package/src/locales/index.ts +10 -0
  365. package/src/locales/ja-JP/TUIConversation.ts +4 -0
  366. package/src/locales/ko-KR/TUIConversation.ts +4 -0
  367. package/src/locales/zh-CN/TUIConversation.ts +4 -0
  368. package/src/locales/zh-TW/TUIConversation.ts +4 -0
  369. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +0 -1
  370. package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +0 -10
  371. package/dist/cjs/components/ConversationPreview/ConversationListContainer.js +0 -1
  372. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +0 -10
  373. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +0 -1
  374. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +0 -6
  375. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.js +0 -1
  376. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +0 -12
  377. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +0 -1
  378. package/dist/cjs/components/TUIChat/TUIChat.js +0 -1
  379. package/dist/cjs/components/TUIChat/index.js +0 -1
  380. package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +0 -1
  381. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +0 -1
  382. package/dist/cjs/components/TUIContact/TUIContact.d.ts +0 -6
  383. package/dist/cjs/components/TUIContact/TUIContact.js +0 -1
  384. package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +0 -10
  385. package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +0 -1
  386. package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +0 -1
  387. package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +0 -1
  388. package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +0 -1
  389. package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +0 -1
  390. package/dist/cjs/components/TUIContact/TUIContactInfo/groupInfo.js +0 -1
  391. package/dist/cjs/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +0 -1
  392. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.d.ts +0 -6
  393. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +0 -1
  394. package/dist/cjs/components/TUIContact/hooks/useTUIContact.js +0 -1
  395. package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +0 -1
  396. package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +0 -1
  397. package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +0 -12
  398. package/dist/cjs/components/TUIConversation/TUIConversation.js +0 -1
  399. package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +0 -19
  400. package/dist/cjs/components/TUIConversationList/TUIConversationList.js +0 -1
  401. package/dist/cjs/components/TUIConversationList/hooks/useConversationList.js +0 -1
  402. package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +0 -1
  403. package/dist/cjs/components/TUIManage/TUIManage.d.ts +0 -6
  404. package/dist/cjs/components/TUIManage/TUIManage.js +0 -1
  405. package/dist/cjs/components/TUIMessage/MessageAudio.js +0 -1
  406. package/dist/cjs/components/TUIMessage/MessageAvatar.js +0 -1
  407. package/dist/cjs/components/TUIMessage/MessageBubble.js +0 -1
  408. package/dist/cjs/components/TUIMessage/MessageContext.js +0 -1
  409. package/dist/cjs/components/TUIMessage/MessageCustom.js +0 -1
  410. package/dist/cjs/components/TUIMessage/MessageName.js +0 -1
  411. package/dist/cjs/components/TUIMessage/MessagePlugins.js +0 -1
  412. package/dist/cjs/components/TUIMessage/MessageProgress.js +0 -1
  413. package/dist/cjs/components/TUIMessage/MessageRevoke.js +0 -1
  414. package/dist/cjs/components/TUIMessage/MessageStatus.js +0 -1
  415. package/dist/cjs/components/TUIMessage/MessageSystem.js +0 -1
  416. package/dist/cjs/components/TUIMessage/MessageText.js +0 -1
  417. package/dist/cjs/components/TUIMessage/MessageTip.js +0 -1
  418. package/dist/cjs/components/TUIMessage/TUIMessage.js +0 -1
  419. package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +0 -1
  420. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +0 -1
  421. package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +0 -1
  422. package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +0 -1
  423. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +0 -1
  424. package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +0 -1
  425. package/dist/cjs/components/TUIMessageInput/TUIForward.js +0 -1
  426. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +0 -1
  427. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +0 -1
  428. package/dist/cjs/components/TUIMessageInput/Transmitter.js +0 -1
  429. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +0 -1
  430. package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +0 -1
  431. package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +0 -1
  432. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +0 -1
  433. package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +0 -1
  434. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +0 -1
  435. package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +0 -1
  436. package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +0 -10
  437. package/dist/cjs/components/TUIProfile/TUIProfile.js +0 -1
  438. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +0 -1
  439. package/dist/cjs/context/TUIConversationContext.js +0 -1
  440. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +0 -1
  441. package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +0 -10
  442. package/dist/esm/components/ConversationPreview/ConversationListContainer.js +0 -1
  443. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +0 -10
  444. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +0 -1
  445. package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +0 -6
  446. package/dist/esm/components/ConversationSearch/ConversationSearchInput.js +0 -1
  447. package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +0 -12
  448. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +0 -1
  449. package/dist/esm/components/TUIChat/TUIChat.js +0 -1
  450. package/dist/esm/components/TUIChat/index.js +0 -1
  451. package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +0 -1
  452. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +0 -1
  453. package/dist/esm/components/TUIContact/TUIContact.d.ts +0 -6
  454. package/dist/esm/components/TUIContact/TUIContact.js +0 -1
  455. package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +0 -10
  456. package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +0 -1
  457. package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +0 -1
  458. package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +0 -1
  459. package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +0 -1
  460. package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +0 -1
  461. package/dist/esm/components/TUIContact/TUIContactInfo/groupInfo.js +0 -1
  462. package/dist/esm/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +0 -1
  463. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.d.ts +0 -6
  464. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +0 -1
  465. package/dist/esm/components/TUIContact/hooks/useTUIContact.js +0 -1
  466. package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +0 -1
  467. package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +0 -1
  468. package/dist/esm/components/TUIConversation/TUIConversation.d.ts +0 -12
  469. package/dist/esm/components/TUIConversation/TUIConversation.js +0 -1
  470. package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +0 -19
  471. package/dist/esm/components/TUIConversationList/TUIConversationList.js +0 -1
  472. package/dist/esm/components/TUIConversationList/hooks/useConversationList.js +0 -1
  473. package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +0 -1
  474. package/dist/esm/components/TUIManage/TUIManage.d.ts +0 -6
  475. package/dist/esm/components/TUIManage/TUIManage.js +0 -1
  476. package/dist/esm/components/TUIMessage/MessageAudio.js +0 -1
  477. package/dist/esm/components/TUIMessage/MessageAvatar.js +0 -1
  478. package/dist/esm/components/TUIMessage/MessageBubble.js +0 -1
  479. package/dist/esm/components/TUIMessage/MessageContext.js +0 -1
  480. package/dist/esm/components/TUIMessage/MessageCustom.js +0 -1
  481. package/dist/esm/components/TUIMessage/MessageName.js +0 -1
  482. package/dist/esm/components/TUIMessage/MessagePlugins.js +0 -1
  483. package/dist/esm/components/TUIMessage/MessageProgress.js +0 -1
  484. package/dist/esm/components/TUIMessage/MessageRevoke.js +0 -1
  485. package/dist/esm/components/TUIMessage/MessageStatus.js +0 -1
  486. package/dist/esm/components/TUIMessage/MessageSystem.js +0 -1
  487. package/dist/esm/components/TUIMessage/MessageText.js +0 -1
  488. package/dist/esm/components/TUIMessage/MessageTip.js +0 -1
  489. package/dist/esm/components/TUIMessage/TUIMessage.js +0 -1
  490. package/dist/esm/components/TUIMessage/TUIMessageDefault.js +0 -1
  491. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +0 -1
  492. package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +0 -1
  493. package/dist/esm/components/TUIMessageInput/EmojiPicker.js +0 -1
  494. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +0 -1
  495. package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +0 -1
  496. package/dist/esm/components/TUIMessageInput/TUIForward.js +0 -1
  497. package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +0 -1
  498. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +0 -1
  499. package/dist/esm/components/TUIMessageInput/Transmitter.js +0 -1
  500. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +0 -1
  501. package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +0 -1
  502. package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +0 -1
  503. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +0 -1
  504. package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +0 -1
  505. package/dist/esm/components/TUIMessageList/TUIMessageList.js +0 -1
  506. package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +0 -1
  507. package/dist/esm/components/TUIProfile/TUIProfile.d.ts +0 -10
  508. package/dist/esm/components/TUIProfile/TUIProfile.js +0 -1
  509. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +0 -1
  510. package/dist/esm/context/TUIConversationContext.js +0 -1
  511. package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +0 -170
  512. package/src/components/ConversationPreview/ConversationListContainer.tsx +0 -20
  513. package/src/components/ConversationPreview/ConversationPreviewContent.tsx +0 -191
  514. package/src/components/ConversationPreview/styles/index.scss +0 -171
  515. package/src/components/ConversationSearch/ConversationSearchInput.tsx +0 -27
  516. package/src/components/ConversationSearch/ConversationSearchResult.tsx +0 -39
  517. package/src/components/ConversationSearch/styles/index.scss +0 -20
  518. package/src/components/TUIChatHeader/index.ts +0 -2
  519. package/src/components/TUIContact/index.ts +0 -3
  520. package/src/components/TUIConversation/TUIConversation.tsx +0 -46
  521. package/src/components/TUIConversation/index.ts +0 -1
  522. package/src/components/TUIConversationList/TUIConversationList.tsx +0 -178
  523. package/src/components/TUIConversationList/hooks/useConversationList.tsx +0 -42
  524. package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +0 -38
  525. package/src/components/TUIConversationList/index.scss +0 -58
  526. package/src/components/TUIConversationList/index.ts +0 -2
  527. package/src/components/TUIManage/index.ts +0 -1
  528. package/src/components/TUIMessageInput/index.ts +0 -3
  529. package/src/components/TUIMessageList/index.ts +0 -1
  530. package/src/components/TUIProfile/TUIProfile.tsx +0 -50
  531. package/src/components/TUIProfile/index.ts +0 -2
  532. package/src/components/TUIProfile/styles/index.scss +0 -2
  533. package/src/context/TUIChatStateContext.tsx +0 -50
  534. package/src/context/TUIConversationContext.tsx +0 -29
  535. package/src/context/TUIMessageContext.tsx +0 -56
  536. package/src/context/TUIMessageInputContext.tsx +0 -55
  537. /package/dist/cjs/components/{TUIChat/TUIChatState.js → Chat/ChatState.js} +0 -0
  538. /package/dist/cjs/components/{TUIChat → Chat}/hooks/useCreateTUIChatStateContext.js +0 -0
  539. /package/dist/cjs/components/{TUIChat → Chat}/hooks/useHandleMessage.d.ts +0 -0
  540. /package/dist/cjs/components/{TUIChat → Chat}/hooks/useHandleMessage.js +0 -0
  541. /package/dist/cjs/components/{TUIChat → Chat}/hooks/useHandleMessageList.js +0 -0
  542. /package/dist/cjs/components/{TUIChat → Chat}/server.js +0 -0
  543. /package/dist/cjs/components/{TUIChat → Chat}/utils.js +0 -0
  544. /package/dist/cjs/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/addFriendInfo.js +0 -0
  545. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageContext.d.ts +0 -0
  546. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageFace.js +0 -0
  547. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageFile.js +0 -0
  548. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageImage.js +0 -0
  549. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageLocation.js +0 -0
  550. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageMerger.js +0 -0
  551. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessagePlugins.d.ts +0 -0
  552. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageVideo.js +0 -0
  553. /package/dist/cjs/components/{TUIMessage → MessageElement}/hooks/useMessageContextHandler.js +0 -0
  554. /package/dist/cjs/components/{TUIMessage → MessageElement}/hooks/useMessagePluginElement.js +0 -0
  555. /package/dist/cjs/components/{TUIMessage → MessageElement}/utils/decodeText.js +0 -0
  556. /package/dist/cjs/components/{TUIMessage → MessageElement}/utils/emojiMap.js +0 -0
  557. /package/dist/cjs/components/{TUIMessage → MessageElement}/utils/index.js +0 -0
  558. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/InputPluginsDefalut.d.ts +0 -0
  559. /package/dist/cjs/components/{TUIMessageInput/TUIMessageInputDefault.d.ts → MessageInput/MessageInputDefault.d.ts} +0 -0
  560. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useCreateMessageInputContext.js +0 -0
  561. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useEmojiPicker.d.ts +0 -0
  562. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.d.ts +0 -0
  563. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.js +0 -0
  564. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useUploadElement.js +0 -0
  565. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useUploadPicker.d.ts +0 -0
  566. /package/dist/cjs/components/{TUIProfile/TUIProfileDefault.d.ts → Profile/ProfileDefault.d.ts} +0 -0
  567. /package/dist/cjs/components/{TUIProfile → Profile}/hooks/useMyProfile.js +0 -0
  568. /package/dist/cjs/context/{TUIChatActionContext.js → ChatActionContext.js} +0 -0
  569. /package/dist/cjs/context/{TUIChatStateContext.js → ChatStateContext.js} +0 -0
  570. /package/dist/cjs/context/{TUIContactContext.js → ContactContext.js} +0 -0
  571. /package/dist/cjs/context/{TUIMessageContext.js → MessageContext.js} +0 -0
  572. /package/dist/cjs/context/{TUIMessageInputContext.js → MessageInputContext.js} +0 -0
  573. /package/dist/esm/components/{TUIChat/TUIChatState.js → Chat/ChatState.js} +0 -0
  574. /package/dist/esm/components/{TUIChat → Chat}/hooks/useCreateTUIChatStateContext.js +0 -0
  575. /package/dist/esm/components/{TUIChat → Chat}/hooks/useHandleMessage.d.ts +0 -0
  576. /package/dist/esm/components/{TUIChat → Chat}/hooks/useHandleMessage.js +0 -0
  577. /package/dist/esm/components/{TUIChat → Chat}/hooks/useHandleMessageList.js +0 -0
  578. /package/dist/esm/components/{TUIChat → Chat}/server.js +0 -0
  579. /package/dist/esm/components/{TUIChat → Chat}/utils.js +0 -0
  580. /package/dist/esm/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/addFriendInfo.js +0 -0
  581. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageContext.d.ts +0 -0
  582. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageFace.js +0 -0
  583. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageFile.js +0 -0
  584. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageImage.js +0 -0
  585. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageLocation.js +0 -0
  586. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageMerger.js +0 -0
  587. /package/dist/esm/components/{TUIMessage → MessageElement}/MessagePlugins.d.ts +0 -0
  588. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageVideo.js +0 -0
  589. /package/dist/esm/components/{TUIMessage → MessageElement}/hooks/useMessageContextHandler.js +0 -0
  590. /package/dist/esm/components/{TUIMessage → MessageElement}/hooks/useMessagePluginElement.js +0 -0
  591. /package/dist/esm/components/{TUIMessage → MessageElement}/utils/decodeText.js +0 -0
  592. /package/dist/esm/components/{TUIMessage → MessageElement}/utils/emojiMap.js +0 -0
  593. /package/dist/esm/components/{TUIMessage → MessageElement}/utils/index.js +0 -0
  594. /package/dist/esm/components/{TUIMessageInput → MessageInput}/InputPluginsDefalut.d.ts +0 -0
  595. /package/dist/esm/components/{TUIMessageInput/TUIMessageInputDefault.d.ts → MessageInput/MessageInputDefault.d.ts} +0 -0
  596. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useCreateMessageInputContext.js +0 -0
  597. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useEmojiPicker.d.ts +0 -0
  598. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.d.ts +0 -0
  599. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.js +0 -0
  600. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useUploadElement.js +0 -0
  601. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useUploadPicker.d.ts +0 -0
  602. /package/dist/esm/components/{TUIProfile/TUIProfileDefault.d.ts → Profile/ProfileDefault.d.ts} +0 -0
  603. /package/dist/esm/components/{TUIProfile → Profile}/hooks/useMyProfile.js +0 -0
  604. /package/dist/esm/context/{TUIChatActionContext.js → ChatActionContext.js} +0 -0
  605. /package/dist/esm/context/{TUIChatStateContext.js → ChatStateContext.js} +0 -0
  606. /package/dist/esm/context/{TUIContactContext.js → ContactContext.js} +0 -0
  607. /package/dist/esm/context/{TUIMessageContext.js → MessageContext.js} +0 -0
  608. /package/dist/esm/context/{TUIMessageInputContext.js → MessageInputContext.js} +0 -0
  609. /package/src/components/{TUIChat/TUIChatState.tsx → Chat/ChatState.tsx} +0 -0
  610. /package/src/components/{TUIChat → Chat}/hooks/useCreateTUIChatStateContext.tsx +0 -0
  611. /package/src/components/{TUIChat → Chat}/hooks/useIsMounted.ts +0 -0
  612. /package/src/components/{TUIChat → Chat}/server.ts +0 -0
  613. /package/src/components/{TUIChat → Chat}/styles/index.scss +0 -0
  614. /package/src/components/{TUIChat → Chat}/styles/layout.scss +0 -0
  615. /package/src/components/{TUIChat → Chat}/utils.ts +0 -0
  616. /package/src/components/{TUIChatHeader → ChatHeader}/styles/color.scss +0 -0
  617. /package/src/components/{TUIChatHeader → ChatHeader}/styles/index.scss +0 -0
  618. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/addFriendInfo.tsx +0 -0
  619. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/basicInfo.tsx +0 -0
  620. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/blockInfo.tsx +0 -0
  621. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/friendApplication.tsx +0 -0
  622. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/friendInfo.tsx +0 -0
  623. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/groupInfo.tsx +0 -0
  624. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/hooks/useContactInfo.tsx +0 -0
  625. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/index.scss +0 -0
  626. /package/src/components/{TUIContact/TUIContactList → Contact/ContactList}/index.scss +0 -0
  627. /package/src/components/{TUIContact → Contact}/hooks/useTUIContact.tsx +0 -0
  628. /package/src/components/{TUIContact → Contact}/index.scss +0 -0
  629. /package/src/components/{TUIContactSearch → ContactSearch}/hooks/useContactSearch.tsx +0 -0
  630. /package/src/components/{TUIContactSearch → ContactSearch}/index.scss +0 -0
  631. /package/src/components/{TUIMessage → MessageElement}/MessageAudio.tsx +0 -0
  632. /package/src/components/{TUIMessage → MessageElement}/MessageAvatar.tsx +0 -0
  633. /package/src/components/{TUIMessage → MessageElement}/MessageBubble.tsx +0 -0
  634. /package/src/components/{TUIMessage → MessageElement}/MessageContext.tsx +0 -0
  635. /package/src/components/{TUIMessage → MessageElement}/MessageFace.tsx +0 -0
  636. /package/src/components/{TUIMessage → MessageElement}/MessageFile.tsx +0 -0
  637. /package/src/components/{TUIMessage → MessageElement}/MessageImage.tsx +0 -0
  638. /package/src/components/{TUIMessage → MessageElement}/MessageLocation.tsx +0 -0
  639. /package/src/components/{TUIMessage → MessageElement}/MessageMerger.tsx +0 -0
  640. /package/src/components/{TUIMessage → MessageElement}/MessageName.tsx +0 -0
  641. /package/src/components/{TUIMessage → MessageElement}/MessageProgress.tsx +0 -0
  642. /package/src/components/{TUIMessage → MessageElement}/MessageRevoke.tsx +0 -0
  643. /package/src/components/{TUIMessage → MessageElement}/MessageStatus.tsx +0 -0
  644. /package/src/components/{TUIMessage → MessageElement}/MessageSystem.tsx +0 -0
  645. /package/src/components/{TUIMessage → MessageElement}/MessageText.tsx +0 -0
  646. /package/src/components/{TUIMessage → MessageElement}/MessageTip.tsx +0 -0
  647. /package/src/components/{TUIMessage → MessageElement}/MessageVideo.tsx +0 -0
  648. /package/src/components/{TUIMessage → MessageElement}/hooks/index.ts +0 -0
  649. /package/src/components/{TUIMessage → MessageElement}/hooks/useMessageContextHandler.ts +0 -0
  650. /package/src/components/{TUIMessage → MessageElement}/hooks/useMessageHandler.ts +0 -0
  651. /package/src/components/{TUIMessage → MessageElement}/hooks/useMessagePluginElement.tsx +0 -0
  652. /package/src/components/{TUIMessage → MessageElement}/hooks/useMessageReply.ts +0 -0
  653. /package/src/components/{TUIMessage → MessageElement}/styles/color.scss +0 -0
  654. /package/src/components/{TUIMessage → MessageElement}/styles/index.scss +0 -0
  655. /package/src/components/{TUIMessage → MessageElement}/utils/decodeText.ts +0 -0
  656. /package/src/components/{TUIMessage → MessageElement}/utils/emojiMap.ts +0 -0
  657. /package/src/components/{TUIMessage → MessageElement}/utils/index.ts +0 -0
  658. /package/src/components/{TUIMessageInput → MessageInput}/hooks/index.ts +0 -0
  659. /package/src/components/{TUIMessageInput → MessageInput}/hooks/useCreateMessageInputContext.ts +0 -0
  660. /package/src/components/{TUIMessageInput → MessageInput}/hooks/useHandleForwardMessage.tsx +0 -0
  661. /package/src/components/{TUIMessageInput → MessageInput}/hooks/useHandleQuoteMessage.tsx +0 -0
  662. /package/src/components/{TUIMessageInput → MessageInput}/hooks/usePluginsElement.tsx +0 -0
  663. /package/src/components/{TUIMessageInput → MessageInput}/hooks/useUploadElement.tsx +0 -0
  664. /package/src/components/{TUIMessageInput → MessageInput}/hooks/useUploadPicker.tsx +0 -0
  665. /package/src/components/{TUIMessageInput → MessageInput}/styles/index.scss +0 -0
  666. /package/src/components/{TUIMessageInput → MessageInput}/styles/layout.scss +0 -0
  667. /package/src/components/{TUIMessageList → MessageList}/styles/color.scss +0 -0
  668. /package/src/components/{TUIMessageList → MessageList}/styles/index.scss +0 -0
  669. /package/src/components/{TUIMessageList → MessageList}/styles/layout.scss +0 -0
  670. /package/src/components/{TUIProfile/TUIProfileDefault.tsx → Profile/ProfileDefault.tsx} +0 -0
  671. /package/src/components/{TUIProfile → Profile}/hooks/index.ts +0 -0
  672. /package/src/components/{TUIProfile → Profile}/hooks/useMyProfile.tsx +0 -0
  673. /package/src/components/{TUIProfile → Profile}/styles/color.scss +0 -0
@@ -0,0 +1,179 @@
1
+ import React, { useState } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { Profile } from '@tencentcloud/chat';
4
+ import { CreateGroupParams, IConversationModel } from '@tencentcloud/chat-uikit-engine';
5
+ import { Input } from '../Input';
6
+ import './styles/ConversationCreateGroupDetail.scss';
7
+ import { Icon, IconTypes } from '../Icon';
8
+ import { Toast } from '../Toast';
9
+ import {
10
+ Avatar,
11
+ defaultGroupAvatarWork,
12
+ defaultGroupAvatarAVChatRoom,
13
+ defaultGroupAvatarMeeting,
14
+ defaultGroupAvatarPublic,
15
+ defaultUserAvatar,
16
+ } from '../Avatar';
17
+ import { PageStateTypes } from './ConversationCreate';
18
+ import { ConversationGroupTypeInfo, GroupType, typeInfoList } from './ConversationGroupTypeInfo';
19
+ import { useUIManager } from '../../context';
20
+ import { createGroupConversation } from '../../hooks/useConversation';
21
+
22
+ export interface ConversationCreateGroupDetailProps {
23
+ profileList: Profile[];
24
+ pageState: PageStateTypes;
25
+ setPageState: React.Dispatch<React.SetStateAction<PageStateTypes>>;
26
+ onBeforeCreateConversation?: (params: CreateGroupParams) => void;
27
+ onConversationCreated?: (conversation: IConversationModel) => void;
28
+ }
29
+ export function ConversationCreateGroupDetail(props: ConversationCreateGroupDetailProps) {
30
+ const {
31
+ profileList,
32
+ pageState,
33
+ setPageState,
34
+ onBeforeCreateConversation,
35
+ onConversationCreated,
36
+ } = props;
37
+ const { t } = useTranslation();
38
+ const { setActiveConversation, myProfile } = useUIManager();
39
+ const temp = [...profileList];
40
+ myProfile && temp.unshift(myProfile);
41
+ const name = temp.map(item => item.nick || item.userID).toString();
42
+ const [groupName, setGroupName] = useState(
43
+ name.length >= 15 ? `${name.slice(0, 12)}...` : name,
44
+ );
45
+ const [groupID, setGroupID] = useState('');
46
+ const [groupType, setGroupType] = useState<GroupType>(GroupType.Work);
47
+ const groupInfoChange = (e: any, type: string) => {
48
+ const { value } = e.target;
49
+ switch (type) {
50
+ case 'name':
51
+ setGroupName(value);
52
+ break;
53
+ case 'id':
54
+ setGroupID(value);
55
+ break;
56
+ case 'type':
57
+ setGroupType(value);
58
+ break;
59
+ default:
60
+ }
61
+ };
62
+ const showGroupTypeInfo = () => {
63
+ setPageState(PageStateTypes.GROUP_TYPE);
64
+ };
65
+ const getDefaultAvatar = (type: GroupType) => {
66
+ switch (type) {
67
+ case GroupType.Work:
68
+ return defaultGroupAvatarWork;
69
+ case GroupType.Public:
70
+ return defaultGroupAvatarPublic;
71
+ case GroupType.Meeting:
72
+ return defaultGroupAvatarMeeting;
73
+ case GroupType.AVChatRoom:
74
+ return defaultGroupAvatarAVChatRoom;
75
+ default:
76
+ return '';
77
+ }
78
+ };
79
+ // eslint-disable-next-line
80
+ // @ts-ignore
81
+ const getDes = () => typeInfoList?.find((item: any) => item.type === groupType).des;
82
+ const next = async () => {
83
+ const memberList = profileList.map(item => ({
84
+ userID: item.userID,
85
+ }));
86
+ const avatar = getDefaultAvatar(groupType);
87
+ const options: CreateGroupParams = {
88
+ name: groupName,
89
+ type: groupType,
90
+ groupID,
91
+ avatar,
92
+ memberList,
93
+ } as any;
94
+ const _options = onBeforeCreateConversation?.(options) || options;
95
+ createGroupConversation(_options)
96
+ .then((conversation: IConversationModel) => {
97
+ onConversationCreated?.(conversation);
98
+ })
99
+ .catch((error) => {
100
+ Toast({ text: error.message, type: 'error' });
101
+ });
102
+ };
103
+ return pageState !== PageStateTypes.GROUP_TYPE
104
+ ? (
105
+ <>
106
+ <div className="tui-conversation-create-group-detail">
107
+ <div className="create-group-box create-group-name">
108
+ <Input
109
+ maxLength={15}
110
+ value={groupName}
111
+ onChange={(e) => {
112
+ groupInfoChange(e, 'name');
113
+ }}
114
+ border="bottom"
115
+ inputClassName="input-group-name"
116
+ clearable
117
+ prefix={<div className="input-group-title">{t('TUIConversation.Group Name')}</div>}
118
+ />
119
+ </div>
120
+ <div className="create-group-box create-group-id">
121
+ <Input
122
+ border="bottom"
123
+ inputClassName="input-group-text"
124
+ clearable
125
+ value={groupID}
126
+ onChange={(e) => {
127
+ groupInfoChange(e, 'id');
128
+ }}
129
+ prefix={<div className="input-group-title">{t('TUIConversation.Group ID')}</div>}
130
+ />
131
+ </div>
132
+ <div className="create-group-box create-group-type" onClick={showGroupTypeInfo}>
133
+ <Input
134
+ readOnly
135
+ border="bottom"
136
+ inputClassName="input-group-text"
137
+ prefix={<div className="input-group-title">{t('TUIConversation.Group Type')}</div>}
138
+ suffix={(
139
+ <Icon
140
+ onClick={showGroupTypeInfo}
141
+ type={IconTypes.ARROW_RIGHT}
142
+ width={7}
143
+ height={12}
144
+ />
145
+ )}
146
+ value={t(`TUIConversation.${groupType}`)}
147
+ onChange={(e) => {
148
+ groupInfoChange(e, 'type');
149
+ }}
150
+ />
151
+ </div>
152
+ <div className="create-group-illustrate">
153
+ {t(`TUIConversation.${getDes()}`)}
154
+ </div>
155
+ <div className="create-group-portrait">
156
+ <div className="create-group-portrait-title">{t('TUIConversation.Participants')}</div>
157
+ <div className="create-group-portrait-info-container">
158
+ {profileList.map(({ avatar, userID, nick }) => (
159
+ <div className="create-group-portrait-info" key={userID}>
160
+ <Avatar shape="square" size={50} image={avatar || defaultUserAvatar} />
161
+ <div className="create-group-portrait-info-nick">{nick}</div>
162
+ </div>
163
+ ))}
164
+ </div>
165
+ </div>
166
+ </div>
167
+ <div className="tui-conversation-create-next-container">
168
+ <div role="presentation" className="tui-conversation-create-next" onClick={next}>{t('TUIConversation.Create')}</div>
169
+ </div>
170
+ </>
171
+ )
172
+ : (
173
+ <ConversationGroupTypeInfo
174
+ groupType={groupType}
175
+ setGroupType={setGroupType}
176
+ setPageState={setPageState}
177
+ />
178
+ );
179
+ }
@@ -5,16 +5,16 @@ import './styles/conversationCreateSelectView.scss';
5
5
  import { Icon, IconTypes } from '../Icon';
6
6
 
7
7
  interface ValueProps {
8
- profile: Profile,
9
- domList: Array<HTMLInputElement>,
8
+ profile: Profile;
9
+ domList: HTMLInputElement[];
10
10
  }
11
- export interface ConversationCreateSelectViewProps{
12
- selectList: Array<ValueProps>,
13
- setSelectList: React.Dispatch<React.SetStateAction<Array<ValueProps>>>,
11
+ export interface ConversationCreateSelectViewProps {
12
+ selectList: ValueProps[];
13
+ setSelectList: React.Dispatch<React.SetStateAction<ValueProps[]>>;
14
14
  }
15
- export function ConversationCreateSelectView(props:ConversationCreateSelectViewProps) {
15
+ export function ConversationCreateSelectView(props: ConversationCreateSelectViewProps) {
16
16
  const { selectList, setSelectList } = props;
17
- const close = (domList:Array<HTMLInputElement>, index: number) => {
17
+ const close = (domList: HTMLInputElement[], index: number) => {
18
18
  // eslint-disable-next-line no-param-reassign
19
19
  domList.forEach((dom: HTMLInputElement) => { dom.checked = false; });
20
20
  selectList.splice(index, 1);
@@ -1,26 +1,25 @@
1
1
  import React, { useRef, useState } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
- import { Conversation, Profile } from '@tencentcloud/chat';
4
- import {
5
- TUIConversationService,
6
- } from '@tencentcloud/chat-uikit-engine';
3
+ import { Profile } from '@tencentcloud/chat';
7
4
  import { Input } from '../Input';
8
5
  import { Icon, IconTypes } from '../Icon';
9
6
  import { ConversationCreateSelectView, ConversationCreateSelectViewProps } from './ConversationCreateSelectView';
10
7
  import { Avatar, defaultUserAvatar } from '../Avatar';
11
8
  import { useConversationCreate } from './hooks/useConversationCreate';
12
- import { useUIKit, useUIManager } from '../../context';
9
+ import { createC2CConversation } from '../../hooks/useConversation';
10
+ import { useUIKit } from '../../context';
13
11
  import { PageStateTypes } from './ConversationCreate';
14
- import { useConversation } from '../../hooks';
15
12
  import { Toast } from '../Toast';
13
+ import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
16
14
 
17
- export interface ConversationCreateUserSelectListProps extends ConversationCreateSelectViewProps{
18
- isCreateGroup: boolean,
19
- setIsCreateGroup: React.Dispatch<React.SetStateAction<boolean>>,
20
- setConversationCreated: React.Dispatch<React.SetStateAction<boolean>>,
21
- className: string,
22
- conversationList: Array<Conversation>,
23
- setPageState: React.Dispatch<React.SetStateAction<PageStateTypes>>,
15
+ export interface ConversationCreateUserSelectListProps extends ConversationCreateSelectViewProps {
16
+ isCreateGroup: boolean;
17
+ setIsCreateGroup: React.Dispatch<React.SetStateAction<boolean>>;
18
+ className?: string;
19
+ conversationList: IConversationModel[];
20
+ setPageState: React.Dispatch<React.SetStateAction<PageStateTypes>>;
21
+ onBeforeCreateConversation?: (userID: string) => void;
22
+ onConversationCreated?: (conversation: IConversationModel) => void;
24
23
  }
25
24
  export function ConversationCreateUserSelectList(props: ConversationCreateUserSelectListProps) {
26
25
  const {
@@ -30,20 +29,19 @@ export function ConversationCreateUserSelectList(props: ConversationCreateUserSe
30
29
  className,
31
30
  conversationList,
32
31
  setIsCreateGroup,
33
- setConversationCreated,
34
32
  setPageState,
33
+ onBeforeCreateConversation,
34
+ onConversationCreated,
35
35
  } = props;
36
36
  const { t } = useTranslation();
37
37
  const [searchValue, setSearchValue] = useState('');
38
38
  const { chat } = useUIKit();
39
- const { setActiveConversation } = useUIManager();
40
39
  const [friendList, setFriendList] = useState<any>({});
41
40
  const {
42
41
  getFriendListSortSearchResult,
43
- } = useConversationCreate(chat, conversationList, (newFriendListResult) => {
42
+ } = useConversationCreate(conversationList, (newFriendListResult) => {
44
43
  setFriendList(newFriendListResult);
45
44
  });
46
- const { createConversation } = useConversation(chat);
47
45
  const userCheckedList = useRef(new Map());
48
46
  const searchValueChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
49
47
  const { value } = e.target;
@@ -55,7 +53,7 @@ export function ConversationCreateUserSelectList(props: ConversationCreateUserSe
55
53
  userCheckedList.current.clear();
56
54
  setSelectList([]);
57
55
  };
58
- const getUserChecked = (userID:string, dom: HTMLElement) => {
56
+ const getUserChecked = (userID: string, dom: HTMLElement) => {
59
57
  if (!dom) return;
60
58
  if (!userCheckedList.current.has(userID)) {
61
59
  userCheckedList.current.set(userID, []);
@@ -75,17 +73,21 @@ export function ConversationCreateUserSelectList(props: ConversationCreateUserSe
75
73
  if (checked) {
76
74
  selectList.push({ profile, domList });
77
75
  } else {
78
- selectList.splice(selectList.findIndex((item) => item.profile.userID === userID), 1);
76
+ selectList.splice(selectList.findIndex(item => item.profile.userID === userID), 1);
79
77
  }
80
78
  setSelectList([...selectList]);
81
79
  };
82
- const createC2CConversation = async (profile: Profile) => {
80
+
81
+ const _createConversation = async (profile: Profile) => {
83
82
  if (isCreateGroup) return;
84
83
  const { userID } = profile;
85
- const conversation = await createConversation(`C2C${userID}`);
86
- setConversationCreated(false);
87
- setActiveConversation(conversation);
88
- TUIConversationService.switchConversation(conversation?.conversationID);
84
+ const params = onBeforeCreateConversation?.(userID);
85
+ createC2CConversation(userID)
86
+ .then((conversation: IConversationModel) => {
87
+ onConversationCreated?.(conversation);
88
+ }).catch((error) => {
89
+ Toast({ text: error.message, type: 'error' });
90
+ });
89
91
  };
90
92
  const next = () => {
91
93
  if (selectList && selectList.length === 0) {
@@ -113,11 +115,11 @@ export function ConversationCreateUserSelectList(props: ConversationCreateUserSe
113
115
  <div className="tui-user-name active">{t('TUIConversation.New group chat')}</div>
114
116
  </div>
115
117
  )}
116
- <div className={`tui-conversation-create ${className}`}>
117
- <div className="tui-conversation-create-container">
118
+ <div className={`tui-conversation-create-select-list-container ${className}`}>
119
+ <div className="tui-conversation-create-select-list">
118
120
  <div className="tui-group-container">
119
121
  {Object.keys(friendList).map(
120
- (key) => friendList[key].length !== 0 && (
122
+ key => friendList[key].length !== 0 && (
121
123
  <div className="tui-group-box" key={key}>
122
124
  <div className="title">{key}</div>
123
125
  {friendList[key].map((profile: Profile, index: number) => {
@@ -128,8 +130,8 @@ export function ConversationCreateUserSelectList(props: ConversationCreateUserSe
128
130
  className="tui-user tui-user-checkbox-label"
129
131
  htmlFor={`userChecked-${key}-${userID}`}
130
132
  key={userID}
131
- onClick={(e) => {
132
- createC2CConversation(profile);
133
+ onClick={() => {
134
+ _createConversation(profile);
133
135
  }}
134
136
  >
135
137
  <Avatar size={30} image={avatar || defaultUserAvatar} />
@@ -1,40 +1,40 @@
1
1
  import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
+ import { TUIChatEngine } from '@tencentcloud/chat-uikit-engine';
3
4
  import './styles/conversationGroupTypeInfo.scss';
4
- import TencentCloudChat from '@tencentcloud/chat';
5
5
  import { PageStateTypes } from './ConversationCreate';
6
6
  import { Icon, IconTypes } from '../Icon';
7
7
 
8
8
  export enum GroupType {
9
- Work= TencentCloudChat.TYPES.GRP_WORK,
10
- Public= TencentCloudChat.TYPES.GRP_PUBLIC,
11
- Meeting= TencentCloudChat.TYPES.GRP_MEETING,
12
- AVChatRoom= TencentCloudChat.TYPES.GRP_AVCHATROOM,
13
- Community = TencentCloudChat.TYPES.GRP_COMMUNITY,
9
+ Work = TUIChatEngine.TYPES.GRP_WORK,
10
+ Public = TUIChatEngine.TYPES.GRP_PUBLIC,
11
+ Meeting = TUIChatEngine.TYPES.GRP_MEETING,
12
+ AVChatRoom = TUIChatEngine.TYPES.GRP_AVCHATROOM,
13
+ Community = TUIChatEngine.TYPES.GRP_COMMUNITY,
14
14
  }
15
15
  export interface ConversationGroupTypeInfoProps {
16
- groupType: string,
17
- setGroupType: React.Dispatch<React.SetStateAction<string>>,
18
- setPageState: React.Dispatch<React.SetStateAction<PageStateTypes>>,
16
+ groupType: GroupType;
17
+ setGroupType: React.Dispatch<React.SetStateAction<GroupType>>;
18
+ setPageState: React.Dispatch<React.SetStateAction<PageStateTypes>>;
19
19
  }
20
- export const typeInfoList = [
21
- { type: 'Work', des: 'Users can join the group only via invitation by existing members. The invitation does not need to be agreed by the invitee or approved by the group owner. See the documentation for details.' },
22
- { type: 'Public', des: 'After a public group is created, the group owner can designate group admins. To join the group, a user needs to search the group ID and send a request, which needs to be approved by the group owner or an admin before the user can join the group. See the documentation for details.' },
23
- { type: 'Meeting', des: 'After the group is created, a user can join and quit the group freely and can view the messages sent before joining the group. It is suitable for scenarios that integrate Tencent Real-Time Communication (TRTC), such as audio and video conferences and online education. See the documentation for details.' },
24
- { type: 'AVChatRoom', des: 'After a group is created, a user can join and quit the group freely. The group can have an unlimited number of members, but it does not store message history. It can be combined with Live Video Broadcasting (LVB) to support on-screen comment scenarios. See the documentation for details.' },
25
- { type: 'Community', des: 'After creation, you can enter and leave at will, support up to 100,000 people, support historical message storage, and after users search for group ID and initiate a group application, they can join the group without administrator approval. See product documentation for details.' },
20
+ export const typeInfoList: Array<{ type: GroupType; name: string; des: string }> = [
21
+ { type: GroupType.Work, name: 'Work', des: 'Users can join the group only via invitation by existing members. The invitation does not need to be agreed by the invitee or approved by the group owner. See the documentation for details.' },
22
+ { type: GroupType.Public, name: 'Public', des: 'After a public group is created, the group owner can designate group admins. To join the group, a user needs to search the group ID and send a request, which needs to be approved by the group owner or an admin before the user can join the group. See the documentation for details.' },
23
+ { type: GroupType.Meeting, name: 'Meeting', des: 'After the group is created, a user can join and quit the group freely and can view the messages sent before joining the group. It is suitable for scenarios that integrate Tencent Real-Time Communication (TRTC), such as audio and video conferences and online education. See the documentation for details.' },
24
+ { type: GroupType.AVChatRoom, name: 'AVChatRoom', des: 'After a group is created, a user can join and quit the group freely. The group can have an unlimited number of members, but it does not store message history. It can be combined with Live Video Broadcasting (LVB) to support on-screen comment scenarios. See the documentation for details.' },
25
+ { type: GroupType.Community, name: 'Community', des: 'After creation, you can enter and leave at will, support up to 100,000 people, support historical message storage, and after users search for group ID and initiate a group application, they can join the group without administrator approval. See product documentation for details.' },
26
26
  ];
27
27
  export function ConversationGroupTypeInfo(props: ConversationGroupTypeInfoProps) {
28
28
  const { groupType, setGroupType, setPageState } = props;
29
29
 
30
30
  const { t } = useTranslation();
31
- const selectGroupType = (type: string) => {
31
+ const selectGroupType = (type: GroupType) => {
32
32
  setGroupType(type);
33
33
  setPageState(PageStateTypes.CREATE_DETAIL);
34
34
  };
35
35
  return (
36
36
  <div className="tui-conversation-group-type-info">
37
- {typeInfoList.map(({ type, des }) => (
37
+ {typeInfoList.map(({ type, name, des }) => (
38
38
  <div
39
39
  key={type}
40
40
  role="presentation"
@@ -43,12 +43,12 @@ export function ConversationGroupTypeInfo(props: ConversationGroupTypeInfoProps)
43
43
  >
44
44
  <div className="group-type-info-title">
45
45
  {type === groupType && <Icon className="box-active-icon" type={IconTypes.RIGHT} width={16} height={16} />}
46
- {t(`TUIConversation.${type}`)}
46
+ {t(`TUIConversation.${name}`)}
47
47
  </div>
48
48
  <div className="group-type-info-description">{t(`TUIConversation.${des}`)}</div>
49
49
  </div>
50
50
  ))}
51
- <a className="group-type-info-document" target="_blank" href="https://www.tencentcloud.com/document/product/1047/33515?lang=en&pg=#group-features" rel="bookmark noreferrer">{t('TUIConversation.Details')}</a>
51
+ <a className="group-type-info-document" target="_blank" href="https://trtc.io/document/33529?platform=web&product=chat&menulabel=uikit#group-types" rel="bookmark noreferrer">{t('TUIConversation.Details')}</a>
52
52
  </div>
53
53
  );
54
54
  }
@@ -1,11 +1,10 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import TencentCloudChat, { Conversation, Friend, Profile } from '@tencentcloud/chat';
2
+ import { StoreName, TUIStore, TUIUserService, IConversationModel } from '@tencentcloud/chat-uikit-engine';
3
+ import TencentCloudChat, { Friend, Profile } from '@tencentcloud/chat';
3
4
  import { strChineseFirstPy } from '../static/word';
4
- import { useProfile } from '../../../hooks';
5
5
 
6
6
  export const useConversationCreate = (
7
- chat: any,
8
- conversationList: Conversation[],
7
+ conversationList: IConversationModel[],
9
8
  setFriendListResultHandler?: (
10
9
  newFriendListResult: object,
11
10
  setFriendListResult: React.Dispatch<React.SetStateAction<{ string: object[] }>>
@@ -20,30 +19,27 @@ export const useConversationCreate = (
20
19
  }
21
20
  return strChineseFirstPy.charAt(uni - 19968);
22
21
  };
23
- const queryFriendList = async () => {
22
+ const queryFriendList = async (friendList: Friend[]) => {
24
23
  const frequentlyConversationProfile = conversationList.filter(
25
- (item: Conversation) => item?.type === TencentCloudChat.TYPES.CONV_C2C,
26
- ).slice(0, 5).map((item: Conversation) => item?.userProfile);
27
- const { code, data } = await chat?.getFriendList() || {};
28
- if (code === 0) {
29
- const sortResult = handleData(
30
- data.map((item: Friend) => item.profile),
31
- frequentlyConversationProfile,
32
- );
33
- setFriendListSortResult(sortResult);
34
- if (setFriendListResultHandler) {
35
- setFriendListResultHandler(sortResult, setFriendListSortResult);
36
- }
24
+ (item: IConversationModel) => item?.type === TencentCloudChat.TYPES.CONV_C2C,
25
+ ).slice(0, 5).map((item: IConversationModel) => item?.userProfile);
26
+ const sortResult = handleData(
27
+ friendList?.map((item: Friend) => item.profile),
28
+ frequentlyConversationProfile,
29
+ );
30
+ setFriendListSortResult(sortResult);
31
+ if (setFriendListResultHandler) {
32
+ setFriendListResultHandler(sortResult, setFriendListSortResult);
37
33
  }
38
34
  };
39
- const handleData = (profileList: Profile[], frequentlyConversationProfile?: any) => {
35
+ function handleData(profileList: Profile[], frequentlyConversationProfile?: any) {
40
36
  const sortResult: any = {
41
37
  '#': [],
42
38
  };
43
39
  for (let i = 65; i <= 90; i += 1) {
44
40
  sortResult[String.fromCharCode(i)] = [];
45
41
  }
46
- profileList.forEach((profile) => {
42
+ profileList?.forEach((profile) => {
47
43
  const { nick, userID } = profile;
48
44
  const first = getFirstLetter(nick || userID);
49
45
  if (first >= 'a' && first <= 'z') {
@@ -58,21 +54,20 @@ export const useConversationCreate = (
58
54
  sortResult[key].sort((a: any, b: any) => {
59
55
  const { nick: aNick, userID: aUserID } = a;
60
56
  const { nick: bNick, userID: bUserID } = b;
61
- if (aNick || aUserID < bNick || bUserID) {
62
- return 1;
63
- } if (aNick || aUserID === bNick || bUserID) {
57
+ if (aNick || aUserID <= bNick || bUserID) {
64
58
  return 1;
65
59
  }
66
60
  return -1;
67
61
  });
68
62
  });
69
63
  return sortResult;
70
- };
71
- const { getUserProfile } = useProfile(chat);
64
+ }
65
+ // const { getUserProfile } = useProfile();
72
66
  const getFriendListSortSearchResult = async (searchValue: string) => {
73
67
  if (!searchValue) return friendListSortResult;
74
- const { data: profileList } = await getUserProfile([searchValue]);
75
-
68
+ const { data } = await TUIUserService.getUserProfile({
69
+ userIDList: [searchValue],
70
+ });
76
71
  const result: any = {};
77
72
  let isIncludes = false;
78
73
  Object.keys(friendListSortResult).forEach((key) => {
@@ -97,11 +92,23 @@ export const useConversationCreate = (
97
92
  if (process.env?.REACT_APP_ONLINE === 'TencentCloudDemo') {
98
93
  return result;
99
94
  }
100
- return !isIncludes ? handleData(profileList) : result;
95
+ return !isIncludes ? handleData(data) : result;
101
96
  };
97
+
98
+ function onFriendListUpdated(list: Friend[]) {
99
+ queryFriendList(list);
100
+ }
101
+
102
102
  useEffect(() => {
103
- queryFriendList();
104
- }, [chat]);
103
+ TUIStore.watch(StoreName.FRIEND, {
104
+ friendList: onFriendListUpdated,
105
+ });
106
+ return () => {
107
+ TUIStore.unwatch(StoreName.FRIEND, {
108
+ friendList: onFriendListUpdated,
109
+ });
110
+ };
111
+ }, []);
105
112
  return {
106
113
  getFirstLetter,
107
114
  queryFriendList,
@@ -1,6 +1,7 @@
1
1
  export * from './ConversationCreate';
2
2
  export * from './ConversationCreateSelectView';
3
- export * from './ConversationCreatGroupDetail';
3
+ export * from './ConversationCreateGroupDetail';
4
4
  export * from './ConversationCreateUserSelectList';
5
5
  export * from './hooks/useConversationCreate';
6
6
  export * from './ConversationGroupTypeInfo';
7
+ export * from './ConversationCreateButton';
@@ -1,6 +1,11 @@
1
1
  @use "../../../styles/colors/color-theme" as *;
2
2
 
3
3
  .tui-conversation-create-group-detail {
4
+ display: flex;
5
+ flex-direction: column;
6
+ padding: 0 10px;
7
+ overflow-y: scroll;
8
+
4
9
  @include theme() {
5
10
  color: get(text-color-primary);
6
11
  }
@@ -49,7 +54,7 @@
49
54
  align-items: center;
50
55
  display: flex;
51
56
  flex-direction: column;
52
- width: calc((100% - 10px) / 6);
57
+ // width: calc((100% - 10px) / 6);
53
58
  padding: 6px;
54
59
  box-sizing: border-box;
55
60
 
@@ -0,0 +1,5 @@
1
+ .tui-conversation-create-button {
2
+ display: flex;
3
+ align-items: center;
4
+ margin: 10px;
5
+ }
@@ -1,5 +1,29 @@
1
1
  @use "../../../styles/colors/color-theme" as *;
2
2
 
3
+ .uikit-conversation-create-container {
4
+ display: flex;
5
+ flex-direction: column;
6
+ justify-content: center;
7
+ }
8
+
9
+ .tui-conversation-create {
10
+ position: absolute;
11
+ display: flex;
12
+ flex-direction: column;
13
+ overflow: hidden;
14
+ flex: 1 1 auto;
15
+ box-sizing: border-box;
16
+ min-width: 0;
17
+ width: 100%;
18
+ height: 100%;
19
+ z-index: 2;
20
+
21
+ @include theme() {
22
+ background-color: get(bg-color-operate);
23
+ color: get(text-color-primary);
24
+ }
25
+ }
26
+
3
27
  .tui-conversation-create-header {
4
28
  display: flex;
5
29
  flex-direction: row;
@@ -24,6 +48,12 @@
24
48
  }
25
49
  }
26
50
 
51
+ .tui-conversation-create-icon {
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ }
56
+
27
57
  .tui-conversation-create-search-input {
28
58
  margin: 10px;
29
59
  }
@@ -92,10 +122,12 @@
92
122
  }
93
123
  }
94
124
 
95
- .tui-conversation-create {
125
+ .tui-conversation-create-select-list-container {
96
126
  overflow-y: auto;
127
+ flex: 1 1 auto;
128
+ padding: 0 10px;
97
129
 
98
- .tui-conversation-create-container {
130
+ .tui-conversation-create-select-list {
99
131
  position: relative;
100
132
 
101
133
  .tui-group-container {
@@ -0,0 +1,29 @@
1
+ @use "../../styles/colors/color-theme" as *;
2
+
3
+ .uikit-chat-list {
4
+ flex: 1;
5
+ box-sizing: border-box;
6
+ overflow: hidden;
7
+ min-width: 0;
8
+ display: flex;
9
+ flex-direction: column;
10
+ position: relative;
11
+ text-align: initial;
12
+
13
+ @include theme() {
14
+ background-color: get(bg-color-operate);
15
+ color: get(text-color-primary);
16
+ }
17
+
18
+ .uikit-chat-list__header--searching {
19
+ position: absolute;
20
+ width: 100%;
21
+ height: 100%;
22
+ }
23
+
24
+ .uikit-chat-list__header--creating {
25
+ position: absolute;
26
+ width: 100%;
27
+ height: 100%;
28
+ }
29
+ }