@tencentcloud/chat-uikit-react 2.2.7 → 2.2.9

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 (672) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/Avatar/Avatar.d.ts +1 -1
  3. package/dist/cjs/components/{TUIChat/TUIChat.d.ts → Chat/Chat.d.ts} +8 -8
  4. package/dist/cjs/components/Chat/Chat.js +1 -0
  5. package/dist/cjs/components/Chat/index.js +1 -0
  6. package/dist/cjs/components/{TUIChatHeader/TUIChatHeader.d.ts → ChatHeader/ChatHeader.d.ts} +3 -3
  7. package/dist/cjs/components/ChatHeader/ChatHeader.js +1 -0
  8. package/dist/cjs/components/{TUIChatHeader/TUIChatHeaderDefault.d.ts → ChatHeader/ChatHeaderDefault.d.ts} +2 -2
  9. package/dist/cjs/components/ChatHeader/ChatHeaderDefault.js +1 -0
  10. package/dist/cjs/components/ChatSetting/ChatSetting.d.ts +6 -0
  11. package/dist/cjs/components/ChatSetting/ChatSetting.js +1 -0
  12. package/dist/cjs/components/Contact/Contact.d.ts +6 -0
  13. package/dist/cjs/components/Contact/Contact.js +1 -0
  14. package/dist/cjs/components/Contact/ContactInfo/ContactInfo.d.ts +10 -0
  15. package/dist/cjs/components/Contact/ContactInfo/ContactInfo.js +1 -0
  16. package/dist/cjs/components/Contact/ContactInfo/basicInfo.js +1 -0
  17. package/dist/cjs/components/Contact/ContactInfo/blockInfo.js +1 -0
  18. package/dist/cjs/components/Contact/ContactInfo/friendApplication.js +1 -0
  19. package/dist/cjs/components/Contact/ContactInfo/friendInfo.js +1 -0
  20. package/dist/cjs/components/Contact/ContactInfo/groupInfo.js +1 -0
  21. package/dist/cjs/components/Contact/ContactInfo/hooks/useContactInfo.js +1 -0
  22. package/dist/cjs/components/Contact/ContactList/ContactList.d.ts +6 -0
  23. package/dist/cjs/components/Contact/ContactList/ContactList.js +1 -0
  24. package/dist/cjs/components/Contact/hooks/useTUIContact.js +1 -0
  25. package/dist/cjs/components/ContactSearch/ContactSearch.js +1 -0
  26. package/dist/cjs/components/ContactSearch/hooks/useContactSearch.js +1 -0
  27. package/dist/cjs/components/ConversationActions/ConversationActions.d.ts +52 -0
  28. package/dist/cjs/components/ConversationActions/ConversationActions.js +1 -0
  29. package/dist/cjs/components/ConversationCreate/ConversationCreate.d.ts +21 -0
  30. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  31. package/dist/cjs/components/ConversationCreate/ConversationCreateButton.d.ts +13 -0
  32. package/dist/cjs/components/ConversationCreate/ConversationCreateButton.js +1 -0
  33. package/dist/cjs/components/ConversationCreate/ConversationCreateGroupDetail.d.ts +16 -0
  34. package/dist/cjs/components/ConversationCreate/ConversationCreateGroupDetail.js +1 -0
  35. package/dist/cjs/components/ConversationCreate/ConversationCreateSelectView.d.ts +15 -0
  36. package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.d.ts +18 -0
  37. package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  38. package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.d.ts +24 -0
  39. package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
  40. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.d.ts +14 -0
  41. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  42. package/dist/cjs/components/ConversationList/ConversationList.d.ts +57 -0
  43. package/dist/cjs/components/ConversationList/ConversationList.js +1 -0
  44. package/dist/cjs/components/ConversationList/ConversationListContent/ConversationListContent.d.ts +23 -0
  45. package/dist/cjs/components/ConversationList/ConversationListContent/ConversationListContent.js +1 -0
  46. package/dist/cjs/components/ConversationList/ConversationListHeader/ConversationListHeader.d.ts +15 -0
  47. package/dist/cjs/components/ConversationList/ConversationListHeader/ConversationListHeader.js +1 -0
  48. package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +39 -27
  49. package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
  50. package/dist/cjs/components/ConversationPreview/utils.js +1 -1
  51. package/dist/cjs/components/ConversationSearch/ConversationSearch.d.ts +39 -0
  52. package/dist/cjs/components/ConversationSearch/ConversationSearch.js +1 -0
  53. package/dist/cjs/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.d.ts +7 -0
  54. package/dist/cjs/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js +1 -0
  55. package/dist/cjs/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.d.ts +29 -0
  56. package/dist/cjs/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.js +1 -0
  57. package/dist/cjs/components/Icon/Icon.js +1 -1
  58. package/dist/cjs/components/Icon/config.js +1 -1
  59. package/dist/cjs/components/Icon/images/mute.svg.js +1 -0
  60. package/dist/cjs/components/Icon/type.d.ts +2 -0
  61. package/dist/cjs/components/Icon/type.js +1 -1
  62. package/dist/cjs/components/Input/Input.d.ts +5 -2
  63. package/dist/cjs/components/Input/Input.js +1 -1
  64. package/dist/{esm/components/TUIMessage/TUIMessage.d.ts → cjs/components/MessageElement/Message.d.ts} +1 -1
  65. package/dist/cjs/components/MessageElement/Message.js +1 -0
  66. package/dist/cjs/components/MessageElement/MessageAudio.js +1 -0
  67. package/dist/cjs/components/MessageElement/MessageAvatar.js +1 -0
  68. package/dist/cjs/components/MessageElement/MessageBubble.js +1 -0
  69. package/dist/cjs/components/MessageElement/MessageContext.js +1 -0
  70. package/dist/cjs/components/MessageElement/MessageCustom.js +1 -0
  71. package/dist/cjs/components/MessageElement/MessageDefault.js +1 -0
  72. package/dist/cjs/components/MessageElement/MessageName.js +1 -0
  73. package/dist/cjs/components/MessageElement/MessagePlugins.js +1 -0
  74. package/dist/cjs/components/MessageElement/MessageProgress.js +1 -0
  75. package/dist/cjs/components/MessageElement/MessageRevoke.js +1 -0
  76. package/dist/cjs/components/MessageElement/MessageStatus.js +1 -0
  77. package/dist/cjs/components/MessageElement/MessageSystem.js +1 -0
  78. package/dist/cjs/components/MessageElement/MessageText.js +1 -0
  79. package/dist/cjs/components/MessageElement/MessageTip.js +1 -0
  80. package/dist/cjs/components/MessageElement/hooks/useMessageHandler.js +1 -0
  81. package/dist/cjs/components/MessageElement/hooks/useMessageReply.js +1 -0
  82. package/dist/cjs/components/MessageInput/EmojiPicker.js +1 -0
  83. package/dist/cjs/components/MessageInput/Forward.js +1 -0
  84. package/dist/cjs/components/MessageInput/InputPluginsDefalut.js +1 -0
  85. package/dist/cjs/components/MessageInput/InputQuoteDefalut.js +1 -0
  86. package/dist/cjs/components/{TUIMessageInput/TUIMessageInput.d.ts → MessageInput/MessageInput.d.ts} +4 -4
  87. package/dist/cjs/components/MessageInput/MessageInput.js +1 -0
  88. package/dist/cjs/components/MessageInput/MessageInputDefault.js +1 -0
  89. package/dist/cjs/components/MessageInput/Transmitter.js +1 -0
  90. package/dist/cjs/components/MessageInput/hooks/useEmojiPicker.js +1 -0
  91. package/dist/cjs/components/MessageInput/hooks/useHandleForwardMessage.js +1 -0
  92. package/dist/cjs/components/MessageInput/hooks/useHandleQuoteMessage.js +1 -0
  93. package/dist/cjs/components/MessageInput/hooks/useMessageInputText.js +1 -0
  94. package/dist/cjs/components/MessageInput/hooks/useUploadPicker.js +1 -0
  95. package/dist/cjs/components/{TUIMessageList/TUIMessageList.d.ts → MessageList/MessageList.d.ts} +3 -3
  96. package/dist/cjs/components/MessageList/MessageList.js +1 -0
  97. package/dist/cjs/components/MessageList/hooks/useMessageListElement.js +1 -0
  98. package/dist/cjs/components/PlaceHolder/index.d.ts +34 -0
  99. package/dist/cjs/components/PlaceHolder/index.js +1 -0
  100. package/dist/cjs/components/Plugins/index.d.ts +5 -2
  101. package/dist/cjs/components/Profile/Profile.d.ts +10 -0
  102. package/dist/cjs/components/Profile/Profile.js +1 -1
  103. package/dist/cjs/components/Profile/ProfileDefault.js +1 -0
  104. package/dist/cjs/components/Profile/myProfile/MyProfile.js +1 -0
  105. package/dist/cjs/context/{TUIChatActionContext.d.ts → ChatActionContext.d.ts} +1 -1
  106. package/dist/cjs/context/{TUIChatStateContext.d.ts → ChatStateContext.d.ts} +6 -6
  107. package/dist/cjs/context/ComponentContext.d.ts +3 -3
  108. package/dist/cjs/context/{TUIContactContext.d.ts → ContactContext.d.ts} +4 -4
  109. package/dist/cjs/context/ConversationListContext.d.ts +22 -0
  110. package/dist/cjs/context/ConversationListContext.js +1 -0
  111. package/dist/{esm/context/TUIMessageContext.d.ts → cjs/context/MessageContext.d.ts} +1 -1
  112. package/dist/{esm/context/TUIMessageInputContext.d.ts → cjs/context/MessageInputContext.d.ts} +4 -4
  113. package/dist/cjs/hooks/useConversation.d.ts +4 -23
  114. package/dist/cjs/hooks/useConversation.js +1 -1
  115. package/dist/cjs/hooks/useLongPress.d.ts +3 -0
  116. package/dist/cjs/hooks/useLongPress.js +1 -0
  117. package/dist/cjs/hooks/useMouseHover.js +1 -0
  118. package/dist/cjs/index.css +2 -1
  119. package/dist/cjs/index.d.css +885 -407
  120. package/dist/cjs/index.d.ts +41 -29
  121. package/dist/cjs/index.js +1 -1
  122. package/dist/cjs/locales/en-US/TUIConversation.js +1 -1
  123. package/dist/cjs/locales/index.js +1 -1
  124. package/dist/cjs/locales/ja-JP/TUIConversation.js +1 -1
  125. package/dist/cjs/locales/ko-KR/TUIConversation.js +1 -1
  126. package/dist/cjs/locales/zh-CN/TUIConversation.js +1 -1
  127. package/dist/cjs/locales/zh-TW/TUIConversation.js +1 -1
  128. package/dist/esm/components/Avatar/Avatar.d.ts +1 -1
  129. package/dist/esm/components/{TUIChat/TUIChat.d.ts → Chat/Chat.d.ts} +8 -8
  130. package/dist/esm/components/Chat/Chat.js +1 -0
  131. package/dist/esm/components/Chat/index.js +1 -0
  132. package/dist/esm/components/{TUIChatHeader/TUIChatHeader.d.ts → ChatHeader/ChatHeader.d.ts} +3 -3
  133. package/dist/esm/components/ChatHeader/ChatHeader.js +1 -0
  134. package/dist/esm/components/{TUIChatHeader/TUIChatHeaderDefault.d.ts → ChatHeader/ChatHeaderDefault.d.ts} +2 -2
  135. package/dist/esm/components/ChatHeader/ChatHeaderDefault.js +1 -0
  136. package/dist/esm/components/ChatSetting/ChatSetting.d.ts +6 -0
  137. package/dist/esm/components/ChatSetting/ChatSetting.js +1 -0
  138. package/dist/esm/components/Contact/Contact.d.ts +6 -0
  139. package/dist/esm/components/Contact/Contact.js +1 -0
  140. package/dist/esm/components/Contact/ContactInfo/ContactInfo.d.ts +10 -0
  141. package/dist/esm/components/Contact/ContactInfo/ContactInfo.js +1 -0
  142. package/dist/esm/components/Contact/ContactInfo/basicInfo.js +1 -0
  143. package/dist/esm/components/Contact/ContactInfo/blockInfo.js +1 -0
  144. package/dist/esm/components/Contact/ContactInfo/friendApplication.js +1 -0
  145. package/dist/esm/components/Contact/ContactInfo/friendInfo.js +1 -0
  146. package/dist/esm/components/Contact/ContactInfo/groupInfo.js +1 -0
  147. package/dist/esm/components/Contact/ContactInfo/hooks/useContactInfo.js +1 -0
  148. package/dist/esm/components/Contact/ContactList/ContactList.d.ts +6 -0
  149. package/dist/esm/components/Contact/ContactList/ContactList.js +1 -0
  150. package/dist/esm/components/Contact/hooks/useTUIContact.js +1 -0
  151. package/dist/esm/components/ContactSearch/ContactSearch.js +1 -0
  152. package/dist/esm/components/ContactSearch/hooks/useContactSearch.js +1 -0
  153. package/dist/esm/components/ConversationActions/ConversationActions.d.ts +52 -0
  154. package/dist/esm/components/ConversationActions/ConversationActions.js +1 -0
  155. package/dist/esm/components/ConversationCreate/ConversationCreate.d.ts +21 -0
  156. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  157. package/dist/esm/components/ConversationCreate/ConversationCreateButton.d.ts +13 -0
  158. package/dist/esm/components/ConversationCreate/ConversationCreateButton.js +1 -0
  159. package/dist/esm/components/ConversationCreate/ConversationCreateGroupDetail.d.ts +16 -0
  160. package/dist/esm/components/ConversationCreate/ConversationCreateGroupDetail.js +1 -0
  161. package/dist/esm/components/ConversationCreate/ConversationCreateSelectView.d.ts +15 -0
  162. package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.d.ts +18 -0
  163. package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  164. package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.d.ts +24 -0
  165. package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
  166. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.d.ts +14 -0
  167. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  168. package/dist/esm/components/ConversationList/ConversationList.d.ts +57 -0
  169. package/dist/esm/components/ConversationList/ConversationList.js +1 -0
  170. package/dist/esm/components/ConversationList/ConversationListContent/ConversationListContent.d.ts +23 -0
  171. package/dist/esm/components/ConversationList/ConversationListContent/ConversationListContent.js +1 -0
  172. package/dist/esm/components/ConversationList/ConversationListHeader/ConversationListHeader.d.ts +15 -0
  173. package/dist/esm/components/ConversationList/ConversationListHeader/ConversationListHeader.js +1 -0
  174. package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +39 -27
  175. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
  176. package/dist/esm/components/ConversationPreview/utils.js +1 -1
  177. package/dist/esm/components/ConversationSearch/ConversationSearch.d.ts +39 -0
  178. package/dist/esm/components/ConversationSearch/ConversationSearch.js +1 -0
  179. package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.d.ts +7 -0
  180. package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js +1 -0
  181. package/dist/esm/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.d.ts +29 -0
  182. package/dist/esm/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.js +1 -0
  183. package/dist/esm/components/Icon/Icon.js +1 -1
  184. package/dist/esm/components/Icon/config.js +1 -1
  185. package/dist/esm/components/Icon/images/mute.svg.js +1 -0
  186. package/dist/esm/components/Icon/type.d.ts +2 -0
  187. package/dist/esm/components/Icon/type.js +1 -1
  188. package/dist/esm/components/Input/Input.d.ts +5 -2
  189. package/dist/esm/components/Input/Input.js +1 -1
  190. package/dist/{cjs/components/TUIMessage/TUIMessage.d.ts → esm/components/MessageElement/Message.d.ts} +1 -1
  191. package/dist/esm/components/MessageElement/Message.js +1 -0
  192. package/dist/esm/components/MessageElement/MessageAudio.js +1 -0
  193. package/dist/esm/components/MessageElement/MessageAvatar.js +1 -0
  194. package/dist/esm/components/MessageElement/MessageBubble.js +1 -0
  195. package/dist/esm/components/MessageElement/MessageContext.js +1 -0
  196. package/dist/esm/components/MessageElement/MessageCustom.js +1 -0
  197. package/dist/esm/components/MessageElement/MessageDefault.js +1 -0
  198. package/dist/esm/components/MessageElement/MessageName.js +1 -0
  199. package/dist/esm/components/MessageElement/MessagePlugins.js +1 -0
  200. package/dist/esm/components/MessageElement/MessageProgress.js +1 -0
  201. package/dist/esm/components/MessageElement/MessageRevoke.js +1 -0
  202. package/dist/esm/components/MessageElement/MessageStatus.js +1 -0
  203. package/dist/esm/components/MessageElement/MessageSystem.js +1 -0
  204. package/dist/esm/components/MessageElement/MessageText.js +1 -0
  205. package/dist/esm/components/MessageElement/MessageTip.js +1 -0
  206. package/dist/esm/components/MessageElement/hooks/useMessageHandler.js +1 -0
  207. package/dist/esm/components/MessageElement/hooks/useMessageReply.js +1 -0
  208. package/dist/esm/components/MessageInput/EmojiPicker.js +1 -0
  209. package/dist/esm/components/MessageInput/Forward.js +1 -0
  210. package/dist/esm/components/MessageInput/InputPluginsDefalut.js +1 -0
  211. package/dist/esm/components/MessageInput/InputQuoteDefalut.js +1 -0
  212. package/dist/esm/components/{TUIMessageInput/TUIMessageInput.d.ts → MessageInput/MessageInput.d.ts} +4 -4
  213. package/dist/esm/components/MessageInput/MessageInput.js +1 -0
  214. package/dist/esm/components/MessageInput/MessageInputDefault.js +1 -0
  215. package/dist/esm/components/MessageInput/Transmitter.js +1 -0
  216. package/dist/esm/components/MessageInput/hooks/useEmojiPicker.js +1 -0
  217. package/dist/esm/components/MessageInput/hooks/useHandleForwardMessage.js +1 -0
  218. package/dist/esm/components/MessageInput/hooks/useHandleQuoteMessage.js +1 -0
  219. package/dist/esm/components/MessageInput/hooks/useMessageInputText.js +1 -0
  220. package/dist/esm/components/MessageInput/hooks/useUploadPicker.js +1 -0
  221. package/dist/esm/components/{TUIMessageList/TUIMessageList.d.ts → MessageList/MessageList.d.ts} +3 -3
  222. package/dist/esm/components/MessageList/MessageList.js +1 -0
  223. package/dist/esm/components/MessageList/hooks/useMessageListElement.js +1 -0
  224. package/dist/esm/components/PlaceHolder/index.d.ts +34 -0
  225. package/dist/esm/components/PlaceHolder/index.js +1 -0
  226. package/dist/esm/components/Plugins/index.d.ts +5 -2
  227. package/dist/esm/components/Profile/Profile.d.ts +10 -0
  228. package/dist/esm/components/Profile/Profile.js +1 -1
  229. package/dist/esm/components/Profile/ProfileDefault.js +1 -0
  230. package/dist/esm/components/Profile/myProfile/MyProfile.js +1 -0
  231. package/dist/esm/context/{TUIChatActionContext.d.ts → ChatActionContext.d.ts} +1 -1
  232. package/dist/esm/context/{TUIChatStateContext.d.ts → ChatStateContext.d.ts} +6 -6
  233. package/dist/esm/context/ComponentContext.d.ts +3 -3
  234. package/dist/esm/context/{TUIContactContext.d.ts → ContactContext.d.ts} +4 -4
  235. package/dist/esm/context/ConversationListContext.d.ts +22 -0
  236. package/dist/esm/context/ConversationListContext.js +1 -0
  237. package/dist/{cjs/context/TUIMessageContext.d.ts → esm/context/MessageContext.d.ts} +1 -1
  238. package/dist/{cjs/context/TUIMessageInputContext.d.ts → esm/context/MessageInputContext.d.ts} +4 -4
  239. package/dist/esm/hooks/useConversation.d.ts +4 -23
  240. package/dist/esm/hooks/useConversation.js +1 -1
  241. package/dist/esm/hooks/useLongPress.d.ts +3 -0
  242. package/dist/esm/hooks/useLongPress.js +1 -0
  243. package/dist/esm/hooks/useMouseHover.js +1 -0
  244. package/dist/esm/index.css +2 -1
  245. package/dist/esm/index.d.css +885 -407
  246. package/dist/esm/index.d.ts +41 -29
  247. package/dist/esm/index.js +1 -1
  248. package/dist/esm/locales/en-US/TUIConversation.js +1 -1
  249. package/dist/esm/locales/index.js +1 -1
  250. package/dist/esm/locales/ja-JP/TUIConversation.js +1 -1
  251. package/dist/esm/locales/ko-KR/TUIConversation.js +1 -1
  252. package/dist/esm/locales/zh-CN/TUIConversation.js +1 -1
  253. package/dist/esm/locales/zh-TW/TUIConversation.js +1 -1
  254. package/package.json +2 -1
  255. package/rollup.config.js +1 -1
  256. package/src/components/Avatar/Avatar.tsx +33 -31
  257. package/src/components/{TUIChat/TUIChat.tsx → Chat/Chat.tsx} +15 -15
  258. package/src/components/{TUIChat → Chat}/hooks/useHandleMessage.tsx +1 -1
  259. package/src/components/{TUIChat → Chat}/hooks/useHandleMessageList.tsx +1 -1
  260. package/src/components/{TUIChat → Chat}/index.ts +1 -1
  261. package/src/components/{TUIChatHeader/TUIChatHeader.tsx → ChatHeader/ChatHeader.tsx} +5 -5
  262. package/src/components/{TUIChatHeader/TUIChatHeaderDefault.tsx → ChatHeader/ChatHeaderDefault.tsx} +2 -2
  263. package/src/components/ChatHeader/index.ts +2 -0
  264. package/src/components/{TUIChatHeader → ChatHeader}/styles/layout.scss +0 -8
  265. package/src/components/{TUIManage/TUIManage.tsx → ChatSetting/ChatSetting.tsx} +17 -20
  266. package/src/components/ChatSetting/index.ts +1 -0
  267. package/src/components/{TUIManage → ChatSetting}/styles/index.scss +4 -2
  268. package/src/components/Checkbox/index.tsx +9 -9
  269. package/src/components/{TUIContact/TUIContact.tsx → Contact/Contact.tsx} +35 -35
  270. package/src/components/{TUIContact/TUIContactInfo/TUIContactInfo.tsx → Contact/ContactInfo/ContactInfo.tsx} +4 -4
  271. package/src/components/{TUIContact/TUIContactList/TUIContactList.tsx → Contact/ContactList/ContactList.tsx} +3 -3
  272. package/src/components/Contact/index.ts +3 -0
  273. package/src/components/{TUIContactSearch/TUIContactSearch.tsx → ContactSearch/ContactSearch.tsx} +8 -7
  274. package/src/components/ConversationActions/ConversationActions.scss +45 -0
  275. package/src/components/ConversationActions/ConversationActions.tsx +172 -0
  276. package/src/components/ConversationActions/index.ts +1 -0
  277. package/src/components/ConversationCreate/ConversationCreate.tsx +104 -49
  278. package/src/components/ConversationCreate/ConversationCreateButton.tsx +46 -0
  279. package/src/components/ConversationCreate/ConversationCreateGroupDetail.tsx +179 -0
  280. package/src/components/ConversationCreate/ConversationCreateSelectView.tsx +7 -7
  281. package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +31 -29
  282. package/src/components/ConversationCreate/ConversationGroupTypeInfo.tsx +19 -19
  283. package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +36 -29
  284. package/src/components/ConversationCreate/index.ts +2 -1
  285. package/src/components/ConversationCreate/styles/{ConversationCreatGroupDetail.scss → ConversationCreateGroupDetail.scss} +6 -1
  286. package/src/components/ConversationCreate/styles/conversationCreateButton.scss +5 -0
  287. package/src/components/ConversationCreate/styles/index.scss +34 -2
  288. package/src/components/ConversationList/ConversationList.scss +29 -0
  289. package/src/components/ConversationList/ConversationList.tsx +155 -0
  290. package/src/components/ConversationList/ConversationListContent/ConversationListContent.scss +16 -0
  291. package/src/components/ConversationList/ConversationListContent/ConversationListContent.tsx +63 -0
  292. package/src/components/ConversationList/ConversationListContent/index.ts +1 -0
  293. package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.scss +28 -0
  294. package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.tsx +43 -0
  295. package/src/components/ConversationList/ConversationListHeader/index.ts +1 -0
  296. package/src/components/ConversationList/index.ts +3 -0
  297. package/src/components/ConversationPreview/ConversationPreview.scss +137 -0
  298. package/src/components/ConversationPreview/ConversationPreview.tsx +245 -63
  299. package/src/components/ConversationPreview/index.ts +0 -1
  300. package/src/components/ConversationPreview/utils.tsx +78 -60
  301. package/src/components/ConversationSearch/ConversationSearch.scss +22 -0
  302. package/src/components/ConversationSearch/ConversationSearch.tsx +125 -0
  303. package/src/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.scss +13 -0
  304. package/src/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.tsx +42 -0
  305. package/src/components/ConversationSearch/ConversationSearchInput/index.ts +1 -0
  306. package/src/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.scss +15 -0
  307. package/src/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.tsx +72 -0
  308. package/src/components/ConversationSearch/ConversationSearchResult/index.ts +1 -0
  309. package/src/components/ConversationSearch/index.ts +3 -2
  310. package/src/components/EmptyStateIndicator/EmptyStateIndicator.tsx +2 -3
  311. package/src/components/Icon/Icon.tsx +8 -8
  312. package/src/components/Icon/config.ts +9 -0
  313. package/src/components/Icon/images/mute.svg +8 -0
  314. package/src/components/Icon/styles/index.scss +41 -6
  315. package/src/components/Icon/type.ts +2 -0
  316. package/src/components/Input/Input.tsx +24 -23
  317. package/src/components/{TUIMessage/TUIMessage.tsx → MessageElement/Message.tsx} +33 -33
  318. package/src/components/{TUIMessage → MessageElement}/MessageCustom.tsx +1 -1
  319. package/src/components/{TUIMessage/TUIMessageDefault.tsx → MessageElement/MessageDefault.tsx} +24 -24
  320. package/src/components/{TUIMessage → MessageElement}/MessagePlugins.tsx +18 -18
  321. package/src/components/{TUIMessage → MessageElement}/index.ts +1 -1
  322. package/src/components/{TUIMessage → MessageElement}/styles/layout.scss +1 -1
  323. package/src/components/{TUIMessageInput → MessageInput}/EmojiPicker.tsx +2 -2
  324. package/src/components/{TUIMessageInput/TUIForward.tsx → MessageInput/Forward.tsx} +41 -36
  325. package/src/components/{TUIMessageInput → MessageInput}/InputPluginsDefalut.tsx +2 -2
  326. package/src/components/{TUIMessageInput → MessageInput}/InputQuoteDefalut.tsx +1 -1
  327. package/src/components/{TUIMessageInput/TUIMessageInput.tsx → MessageInput/MessageInput.tsx} +25 -27
  328. package/src/components/{TUIMessageInput/TUIMessageInputDefault.tsx → MessageInput/MessageInputDefault.tsx} +14 -14
  329. package/src/components/{TUIMessageInput → MessageInput}/Transmitter.tsx +2 -2
  330. package/src/components/{TUIMessageInput → MessageInput}/hooks/useEmojiPicker.tsx +1 -1
  331. package/src/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.tsx +1 -1
  332. package/src/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputText.tsx +2 -2
  333. package/src/components/MessageInput/index.ts +3 -0
  334. package/src/components/{TUIMessageInput → MessageInput}/styles/color.scss +1 -1
  335. package/src/components/{TUIMessageList/TUIMessageList.tsx → MessageList/MessageList.tsx} +5 -5
  336. package/src/components/{TUIMessageList → MessageList}/hooks/useMessageListElement.tsx +1 -1
  337. package/src/components/MessageList/index.ts +1 -0
  338. package/src/components/PlaceHolder/index.tsx +79 -0
  339. package/src/components/PlaceHolder/styles/index.scss +36 -0
  340. package/src/components/Plugins/index.tsx +49 -45
  341. package/src/components/Profile/Profile.tsx +46 -21
  342. package/src/components/Profile/index.ts +2 -1
  343. package/src/components/Profile/myProfile/MyProfile.tsx +25 -0
  344. package/src/components/Profile/myProfile/index.ts +1 -0
  345. package/src/components/Profile/myProfile/styles/index.scss +32 -0
  346. package/src/components/Profile/styles/index.scss +2 -32
  347. package/src/components/{TUIProfile → Profile}/styles/layout.scss +1 -0
  348. package/src/components/index.ts +13 -11
  349. package/src/context/{TUIChatActionContext.tsx → ChatActionContext.tsx} +1 -1
  350. package/src/context/ChatStateContext.tsx +49 -0
  351. package/src/context/ComponentContext.tsx +13 -13
  352. package/src/context/{TUIContactContext.tsx → ContactContext.tsx} +10 -11
  353. package/src/context/ConversationListContext.tsx +113 -0
  354. package/src/context/LanguageContext.tsx +1 -0
  355. package/src/context/MessageContext.tsx +55 -0
  356. package/src/context/MessageInputContext.tsx +54 -0
  357. package/src/context/index.ts +6 -5
  358. package/src/hooks/index.ts +2 -0
  359. package/src/hooks/useConversation.tsx +26 -74
  360. package/src/hooks/useLongPress.tsx +117 -0
  361. package/src/hooks/useMouseHover.tsx +21 -0
  362. package/src/locales/en-US/TUIConversation.ts +4 -0
  363. package/src/locales/index.ts +10 -0
  364. package/src/locales/ja-JP/TUIConversation.ts +4 -0
  365. package/src/locales/ko-KR/TUIConversation.ts +4 -0
  366. package/src/locales/zh-CN/TUIConversation.ts +4 -0
  367. package/src/locales/zh-TW/TUIConversation.ts +4 -0
  368. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +0 -1
  369. package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +0 -10
  370. package/dist/cjs/components/ConversationPreview/ConversationListContainer.js +0 -1
  371. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +0 -10
  372. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +0 -1
  373. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +0 -6
  374. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.js +0 -1
  375. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +0 -12
  376. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +0 -1
  377. package/dist/cjs/components/TUIChat/TUIChat.js +0 -1
  378. package/dist/cjs/components/TUIChat/index.js +0 -1
  379. package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +0 -1
  380. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +0 -1
  381. package/dist/cjs/components/TUIContact/TUIContact.d.ts +0 -6
  382. package/dist/cjs/components/TUIContact/TUIContact.js +0 -1
  383. package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +0 -10
  384. package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +0 -1
  385. package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +0 -1
  386. package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +0 -1
  387. package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +0 -1
  388. package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +0 -1
  389. package/dist/cjs/components/TUIContact/TUIContactInfo/groupInfo.js +0 -1
  390. package/dist/cjs/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +0 -1
  391. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.d.ts +0 -6
  392. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +0 -1
  393. package/dist/cjs/components/TUIContact/hooks/useTUIContact.js +0 -1
  394. package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +0 -1
  395. package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +0 -1
  396. package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +0 -12
  397. package/dist/cjs/components/TUIConversation/TUIConversation.js +0 -1
  398. package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +0 -19
  399. package/dist/cjs/components/TUIConversationList/TUIConversationList.js +0 -1
  400. package/dist/cjs/components/TUIConversationList/hooks/useConversationList.js +0 -1
  401. package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +0 -1
  402. package/dist/cjs/components/TUIManage/TUIManage.d.ts +0 -6
  403. package/dist/cjs/components/TUIManage/TUIManage.js +0 -1
  404. package/dist/cjs/components/TUIMessage/MessageAudio.js +0 -1
  405. package/dist/cjs/components/TUIMessage/MessageAvatar.js +0 -1
  406. package/dist/cjs/components/TUIMessage/MessageBubble.js +0 -1
  407. package/dist/cjs/components/TUIMessage/MessageContext.js +0 -1
  408. package/dist/cjs/components/TUIMessage/MessageCustom.js +0 -1
  409. package/dist/cjs/components/TUIMessage/MessageName.js +0 -1
  410. package/dist/cjs/components/TUIMessage/MessagePlugins.js +0 -1
  411. package/dist/cjs/components/TUIMessage/MessageProgress.js +0 -1
  412. package/dist/cjs/components/TUIMessage/MessageRevoke.js +0 -1
  413. package/dist/cjs/components/TUIMessage/MessageStatus.js +0 -1
  414. package/dist/cjs/components/TUIMessage/MessageSystem.js +0 -1
  415. package/dist/cjs/components/TUIMessage/MessageText.js +0 -1
  416. package/dist/cjs/components/TUIMessage/MessageTip.js +0 -1
  417. package/dist/cjs/components/TUIMessage/TUIMessage.js +0 -1
  418. package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +0 -1
  419. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +0 -1
  420. package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +0 -1
  421. package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +0 -1
  422. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +0 -1
  423. package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +0 -1
  424. package/dist/cjs/components/TUIMessageInput/TUIForward.js +0 -1
  425. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +0 -1
  426. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +0 -1
  427. package/dist/cjs/components/TUIMessageInput/Transmitter.js +0 -1
  428. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +0 -1
  429. package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +0 -1
  430. package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +0 -1
  431. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +0 -1
  432. package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +0 -1
  433. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +0 -1
  434. package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +0 -1
  435. package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +0 -10
  436. package/dist/cjs/components/TUIProfile/TUIProfile.js +0 -1
  437. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +0 -1
  438. package/dist/cjs/context/TUIConversationContext.js +0 -1
  439. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +0 -1
  440. package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +0 -10
  441. package/dist/esm/components/ConversationPreview/ConversationListContainer.js +0 -1
  442. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +0 -10
  443. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +0 -1
  444. package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +0 -6
  445. package/dist/esm/components/ConversationSearch/ConversationSearchInput.js +0 -1
  446. package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +0 -12
  447. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +0 -1
  448. package/dist/esm/components/TUIChat/TUIChat.js +0 -1
  449. package/dist/esm/components/TUIChat/index.js +0 -1
  450. package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +0 -1
  451. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +0 -1
  452. package/dist/esm/components/TUIContact/TUIContact.d.ts +0 -6
  453. package/dist/esm/components/TUIContact/TUIContact.js +0 -1
  454. package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +0 -10
  455. package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +0 -1
  456. package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +0 -1
  457. package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +0 -1
  458. package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +0 -1
  459. package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +0 -1
  460. package/dist/esm/components/TUIContact/TUIContactInfo/groupInfo.js +0 -1
  461. package/dist/esm/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +0 -1
  462. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.d.ts +0 -6
  463. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +0 -1
  464. package/dist/esm/components/TUIContact/hooks/useTUIContact.js +0 -1
  465. package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +0 -1
  466. package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +0 -1
  467. package/dist/esm/components/TUIConversation/TUIConversation.d.ts +0 -12
  468. package/dist/esm/components/TUIConversation/TUIConversation.js +0 -1
  469. package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +0 -19
  470. package/dist/esm/components/TUIConversationList/TUIConversationList.js +0 -1
  471. package/dist/esm/components/TUIConversationList/hooks/useConversationList.js +0 -1
  472. package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +0 -1
  473. package/dist/esm/components/TUIManage/TUIManage.d.ts +0 -6
  474. package/dist/esm/components/TUIManage/TUIManage.js +0 -1
  475. package/dist/esm/components/TUIMessage/MessageAudio.js +0 -1
  476. package/dist/esm/components/TUIMessage/MessageAvatar.js +0 -1
  477. package/dist/esm/components/TUIMessage/MessageBubble.js +0 -1
  478. package/dist/esm/components/TUIMessage/MessageContext.js +0 -1
  479. package/dist/esm/components/TUIMessage/MessageCustom.js +0 -1
  480. package/dist/esm/components/TUIMessage/MessageName.js +0 -1
  481. package/dist/esm/components/TUIMessage/MessagePlugins.js +0 -1
  482. package/dist/esm/components/TUIMessage/MessageProgress.js +0 -1
  483. package/dist/esm/components/TUIMessage/MessageRevoke.js +0 -1
  484. package/dist/esm/components/TUIMessage/MessageStatus.js +0 -1
  485. package/dist/esm/components/TUIMessage/MessageSystem.js +0 -1
  486. package/dist/esm/components/TUIMessage/MessageText.js +0 -1
  487. package/dist/esm/components/TUIMessage/MessageTip.js +0 -1
  488. package/dist/esm/components/TUIMessage/TUIMessage.js +0 -1
  489. package/dist/esm/components/TUIMessage/TUIMessageDefault.js +0 -1
  490. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +0 -1
  491. package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +0 -1
  492. package/dist/esm/components/TUIMessageInput/EmojiPicker.js +0 -1
  493. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +0 -1
  494. package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +0 -1
  495. package/dist/esm/components/TUIMessageInput/TUIForward.js +0 -1
  496. package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +0 -1
  497. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +0 -1
  498. package/dist/esm/components/TUIMessageInput/Transmitter.js +0 -1
  499. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +0 -1
  500. package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +0 -1
  501. package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +0 -1
  502. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +0 -1
  503. package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +0 -1
  504. package/dist/esm/components/TUIMessageList/TUIMessageList.js +0 -1
  505. package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +0 -1
  506. package/dist/esm/components/TUIProfile/TUIProfile.d.ts +0 -10
  507. package/dist/esm/components/TUIProfile/TUIProfile.js +0 -1
  508. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +0 -1
  509. package/dist/esm/context/TUIConversationContext.js +0 -1
  510. package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +0 -170
  511. package/src/components/ConversationPreview/ConversationListContainer.tsx +0 -20
  512. package/src/components/ConversationPreview/ConversationPreviewContent.tsx +0 -191
  513. package/src/components/ConversationPreview/styles/index.scss +0 -171
  514. package/src/components/ConversationSearch/ConversationSearchInput.tsx +0 -27
  515. package/src/components/ConversationSearch/ConversationSearchResult.tsx +0 -39
  516. package/src/components/ConversationSearch/styles/index.scss +0 -20
  517. package/src/components/TUIChatHeader/index.ts +0 -2
  518. package/src/components/TUIContact/index.ts +0 -3
  519. package/src/components/TUIConversation/TUIConversation.tsx +0 -46
  520. package/src/components/TUIConversation/index.ts +0 -1
  521. package/src/components/TUIConversationList/TUIConversationList.tsx +0 -178
  522. package/src/components/TUIConversationList/hooks/useConversationList.tsx +0 -42
  523. package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +0 -38
  524. package/src/components/TUIConversationList/index.scss +0 -58
  525. package/src/components/TUIConversationList/index.ts +0 -2
  526. package/src/components/TUIManage/index.ts +0 -1
  527. package/src/components/TUIMessageInput/index.ts +0 -3
  528. package/src/components/TUIMessageList/index.ts +0 -1
  529. package/src/components/TUIProfile/TUIProfile.tsx +0 -50
  530. package/src/components/TUIProfile/index.ts +0 -2
  531. package/src/components/TUIProfile/styles/index.scss +0 -2
  532. package/src/context/TUIChatStateContext.tsx +0 -50
  533. package/src/context/TUIConversationContext.tsx +0 -29
  534. package/src/context/TUIMessageContext.tsx +0 -56
  535. package/src/context/TUIMessageInputContext.tsx +0 -55
  536. /package/dist/cjs/components/{TUIChat/TUIChatState.js → Chat/ChatState.js} +0 -0
  537. /package/dist/cjs/components/{TUIChat → Chat}/hooks/useCreateTUIChatStateContext.js +0 -0
  538. /package/dist/cjs/components/{TUIChat → Chat}/hooks/useHandleMessage.d.ts +0 -0
  539. /package/dist/cjs/components/{TUIChat → Chat}/hooks/useHandleMessage.js +0 -0
  540. /package/dist/cjs/components/{TUIChat → Chat}/hooks/useHandleMessageList.js +0 -0
  541. /package/dist/cjs/components/{TUIChat → Chat}/server.js +0 -0
  542. /package/dist/cjs/components/{TUIChat → Chat}/utils.js +0 -0
  543. /package/dist/cjs/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/addFriendInfo.js +0 -0
  544. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageContext.d.ts +0 -0
  545. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageFace.js +0 -0
  546. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageFile.js +0 -0
  547. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageImage.js +0 -0
  548. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageLocation.js +0 -0
  549. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageMerger.js +0 -0
  550. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessagePlugins.d.ts +0 -0
  551. /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageVideo.js +0 -0
  552. /package/dist/cjs/components/{TUIMessage → MessageElement}/hooks/useMessageContextHandler.js +0 -0
  553. /package/dist/cjs/components/{TUIMessage → MessageElement}/hooks/useMessagePluginElement.js +0 -0
  554. /package/dist/cjs/components/{TUIMessage → MessageElement}/utils/decodeText.js +0 -0
  555. /package/dist/cjs/components/{TUIMessage → MessageElement}/utils/emojiMap.js +0 -0
  556. /package/dist/cjs/components/{TUIMessage → MessageElement}/utils/index.js +0 -0
  557. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/InputPluginsDefalut.d.ts +0 -0
  558. /package/dist/cjs/components/{TUIMessageInput/TUIMessageInputDefault.d.ts → MessageInput/MessageInputDefault.d.ts} +0 -0
  559. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useCreateMessageInputContext.js +0 -0
  560. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useEmojiPicker.d.ts +0 -0
  561. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.d.ts +0 -0
  562. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.js +0 -0
  563. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useUploadElement.js +0 -0
  564. /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useUploadPicker.d.ts +0 -0
  565. /package/dist/cjs/components/{TUIProfile/TUIProfileDefault.d.ts → Profile/ProfileDefault.d.ts} +0 -0
  566. /package/dist/cjs/components/{TUIProfile → Profile}/hooks/useMyProfile.js +0 -0
  567. /package/dist/cjs/context/{TUIChatActionContext.js → ChatActionContext.js} +0 -0
  568. /package/dist/cjs/context/{TUIChatStateContext.js → ChatStateContext.js} +0 -0
  569. /package/dist/cjs/context/{TUIContactContext.js → ContactContext.js} +0 -0
  570. /package/dist/cjs/context/{TUIMessageContext.js → MessageContext.js} +0 -0
  571. /package/dist/cjs/context/{TUIMessageInputContext.js → MessageInputContext.js} +0 -0
  572. /package/dist/esm/components/{TUIChat/TUIChatState.js → Chat/ChatState.js} +0 -0
  573. /package/dist/esm/components/{TUIChat → Chat}/hooks/useCreateTUIChatStateContext.js +0 -0
  574. /package/dist/esm/components/{TUIChat → Chat}/hooks/useHandleMessage.d.ts +0 -0
  575. /package/dist/esm/components/{TUIChat → Chat}/hooks/useHandleMessage.js +0 -0
  576. /package/dist/esm/components/{TUIChat → Chat}/hooks/useHandleMessageList.js +0 -0
  577. /package/dist/esm/components/{TUIChat → Chat}/server.js +0 -0
  578. /package/dist/esm/components/{TUIChat → Chat}/utils.js +0 -0
  579. /package/dist/esm/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/addFriendInfo.js +0 -0
  580. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageContext.d.ts +0 -0
  581. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageFace.js +0 -0
  582. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageFile.js +0 -0
  583. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageImage.js +0 -0
  584. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageLocation.js +0 -0
  585. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageMerger.js +0 -0
  586. /package/dist/esm/components/{TUIMessage → MessageElement}/MessagePlugins.d.ts +0 -0
  587. /package/dist/esm/components/{TUIMessage → MessageElement}/MessageVideo.js +0 -0
  588. /package/dist/esm/components/{TUIMessage → MessageElement}/hooks/useMessageContextHandler.js +0 -0
  589. /package/dist/esm/components/{TUIMessage → MessageElement}/hooks/useMessagePluginElement.js +0 -0
  590. /package/dist/esm/components/{TUIMessage → MessageElement}/utils/decodeText.js +0 -0
  591. /package/dist/esm/components/{TUIMessage → MessageElement}/utils/emojiMap.js +0 -0
  592. /package/dist/esm/components/{TUIMessage → MessageElement}/utils/index.js +0 -0
  593. /package/dist/esm/components/{TUIMessageInput → MessageInput}/InputPluginsDefalut.d.ts +0 -0
  594. /package/dist/esm/components/{TUIMessageInput/TUIMessageInputDefault.d.ts → MessageInput/MessageInputDefault.d.ts} +0 -0
  595. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useCreateMessageInputContext.js +0 -0
  596. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useEmojiPicker.d.ts +0 -0
  597. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.d.ts +0 -0
  598. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.js +0 -0
  599. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useUploadElement.js +0 -0
  600. /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useUploadPicker.d.ts +0 -0
  601. /package/dist/esm/components/{TUIProfile/TUIProfileDefault.d.ts → Profile/ProfileDefault.d.ts} +0 -0
  602. /package/dist/esm/components/{TUIProfile → Profile}/hooks/useMyProfile.js +0 -0
  603. /package/dist/esm/context/{TUIChatActionContext.js → ChatActionContext.js} +0 -0
  604. /package/dist/esm/context/{TUIChatStateContext.js → ChatStateContext.js} +0 -0
  605. /package/dist/esm/context/{TUIContactContext.js → ContactContext.js} +0 -0
  606. /package/dist/esm/context/{TUIMessageContext.js → MessageContext.js} +0 -0
  607. /package/dist/esm/context/{TUIMessageInputContext.js → MessageInputContext.js} +0 -0
  608. /package/src/components/{TUIChat/TUIChatState.tsx → Chat/ChatState.tsx} +0 -0
  609. /package/src/components/{TUIChat → Chat}/hooks/useCreateTUIChatStateContext.tsx +0 -0
  610. /package/src/components/{TUIChat → Chat}/hooks/useIsMounted.ts +0 -0
  611. /package/src/components/{TUIChat → Chat}/server.ts +0 -0
  612. /package/src/components/{TUIChat → Chat}/styles/index.scss +0 -0
  613. /package/src/components/{TUIChat → Chat}/styles/layout.scss +0 -0
  614. /package/src/components/{TUIChat → Chat}/utils.ts +0 -0
  615. /package/src/components/{TUIChatHeader → ChatHeader}/styles/color.scss +0 -0
  616. /package/src/components/{TUIChatHeader → ChatHeader}/styles/index.scss +0 -0
  617. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/addFriendInfo.tsx +0 -0
  618. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/basicInfo.tsx +0 -0
  619. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/blockInfo.tsx +0 -0
  620. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/friendApplication.tsx +0 -0
  621. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/friendInfo.tsx +0 -0
  622. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/groupInfo.tsx +0 -0
  623. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/hooks/useContactInfo.tsx +0 -0
  624. /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/index.scss +0 -0
  625. /package/src/components/{TUIContact/TUIContactList → Contact/ContactList}/index.scss +0 -0
  626. /package/src/components/{TUIContact → Contact}/hooks/useTUIContact.tsx +0 -0
  627. /package/src/components/{TUIContact → Contact}/index.scss +0 -0
  628. /package/src/components/{TUIContactSearch → ContactSearch}/hooks/useContactSearch.tsx +0 -0
  629. /package/src/components/{TUIContactSearch → ContactSearch}/index.scss +0 -0
  630. /package/src/components/{TUIMessage → MessageElement}/MessageAudio.tsx +0 -0
  631. /package/src/components/{TUIMessage → MessageElement}/MessageAvatar.tsx +0 -0
  632. /package/src/components/{TUIMessage → MessageElement}/MessageBubble.tsx +0 -0
  633. /package/src/components/{TUIMessage → MessageElement}/MessageContext.tsx +0 -0
  634. /package/src/components/{TUIMessage → MessageElement}/MessageFace.tsx +0 -0
  635. /package/src/components/{TUIMessage → MessageElement}/MessageFile.tsx +0 -0
  636. /package/src/components/{TUIMessage → MessageElement}/MessageImage.tsx +0 -0
  637. /package/src/components/{TUIMessage → MessageElement}/MessageLocation.tsx +0 -0
  638. /package/src/components/{TUIMessage → MessageElement}/MessageMerger.tsx +0 -0
  639. /package/src/components/{TUIMessage → MessageElement}/MessageName.tsx +0 -0
  640. /package/src/components/{TUIMessage → MessageElement}/MessageProgress.tsx +0 -0
  641. /package/src/components/{TUIMessage → MessageElement}/MessageRevoke.tsx +0 -0
  642. /package/src/components/{TUIMessage → MessageElement}/MessageStatus.tsx +0 -0
  643. /package/src/components/{TUIMessage → MessageElement}/MessageSystem.tsx +0 -0
  644. /package/src/components/{TUIMessage → MessageElement}/MessageText.tsx +0 -0
  645. /package/src/components/{TUIMessage → MessageElement}/MessageTip.tsx +0 -0
  646. /package/src/components/{TUIMessage → MessageElement}/MessageVideo.tsx +0 -0
  647. /package/src/components/{TUIMessage → MessageElement}/hooks/index.ts +0 -0
  648. /package/src/components/{TUIMessage → MessageElement}/hooks/useMessageContextHandler.ts +0 -0
  649. /package/src/components/{TUIMessage → MessageElement}/hooks/useMessageHandler.ts +0 -0
  650. /package/src/components/{TUIMessage → MessageElement}/hooks/useMessagePluginElement.tsx +0 -0
  651. /package/src/components/{TUIMessage → MessageElement}/hooks/useMessageReply.ts +0 -0
  652. /package/src/components/{TUIMessage → MessageElement}/styles/color.scss +0 -0
  653. /package/src/components/{TUIMessage → MessageElement}/styles/index.scss +0 -0
  654. /package/src/components/{TUIMessage → MessageElement}/utils/decodeText.ts +0 -0
  655. /package/src/components/{TUIMessage → MessageElement}/utils/emojiMap.ts +0 -0
  656. /package/src/components/{TUIMessage → MessageElement}/utils/index.ts +0 -0
  657. /package/src/components/{TUIMessageInput → MessageInput}/hooks/index.ts +0 -0
  658. /package/src/components/{TUIMessageInput → MessageInput}/hooks/useCreateMessageInputContext.ts +0 -0
  659. /package/src/components/{TUIMessageInput → MessageInput}/hooks/useHandleForwardMessage.tsx +0 -0
  660. /package/src/components/{TUIMessageInput → MessageInput}/hooks/useHandleQuoteMessage.tsx +0 -0
  661. /package/src/components/{TUIMessageInput → MessageInput}/hooks/usePluginsElement.tsx +0 -0
  662. /package/src/components/{TUIMessageInput → MessageInput}/hooks/useUploadElement.tsx +0 -0
  663. /package/src/components/{TUIMessageInput → MessageInput}/hooks/useUploadPicker.tsx +0 -0
  664. /package/src/components/{TUIMessageInput → MessageInput}/styles/index.scss +0 -0
  665. /package/src/components/{TUIMessageInput → MessageInput}/styles/layout.scss +0 -0
  666. /package/src/components/{TUIMessageList → MessageList}/styles/color.scss +0 -0
  667. /package/src/components/{TUIMessageList → MessageList}/styles/index.scss +0 -0
  668. /package/src/components/{TUIMessageList → MessageList}/styles/layout.scss +0 -0
  669. /package/src/components/{TUIProfile/TUIProfileDefault.tsx → Profile/ProfileDefault.tsx} +0 -0
  670. /package/src/components/{TUIProfile → Profile}/hooks/index.ts +0 -0
  671. /package/src/components/{TUIProfile → Profile}/hooks/useMyProfile.tsx +0 -0
  672. /package/src/components/{TUIProfile → Profile}/styles/color.scss +0 -0
@@ -0,0 +1,21 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import { CreateGroupParams, IConversationModel } from '@tencentcloud/chat-uikit-engine';
4
+
5
+ interface IConversationCreateProps {
6
+ visible?: boolean;
7
+ className?: string;
8
+ style?: React__default.CSSProperties;
9
+ onBeforeCreateConversation?: (params: string | CreateGroupParams) => string | CreateGroupParams;
10
+ onConversationCreated?: (conversation: IConversationModel) => void;
11
+ onChangeCreateModelVisible: (visible: boolean) => void;
12
+ conversationList?: IConversationModel[];
13
+ }
14
+ declare enum PageStateTypes {
15
+ USER_SELECT = "Next",
16
+ CREATE_DETAIL = "Create",
17
+ GROUP_TYPE = "GroupType"
18
+ }
19
+ declare function ConversationCreate<T extends IConversationCreateProps>(props: T): react_jsx_runtime.JSX.Element | null;
20
+
21
+ export { ConversationCreate, IConversationCreateProps, PageStateTypes };
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as e,Fragment as o,jsx as r}from"react/jsx-runtime";import{useState as i,useMemo as a}from"react";import{useTranslation as n}from"react-i18next";import{Icon as s}from"../Icon/Icon.js";import{IconTypes as c}from"../Icon/type.js";import{ConversationCreateUserSelectList as C}from"./ConversationCreateUserSelectList.js";import{ConversationCreatGroupDetail as m}from"./ConversationCreatGroupDetail.js";import{useUIKit as E}from"../../context/UIKitContext.js";import"@tencentcloud/chat-uikit-engine";import"../../context/TUIMessageContext.js";import{useConversation as p}from"../../hooks/useConversation.js";var l;function v(v){var f=v.className,u=void 0===f?"":f,T=v.setConversationCreated,d=v.conversationList,S=void 0===d?[]:d,L=n().t,h=i(!1),U=h[0],I=h[1],R=i(l.USER_SELECT),_=R[0],j=R[1],x=i([]),A=x[0],P=x[1],g=E().chat,G=p(g).createConversation,k=function(){if(U)switch(_){case l.USER_SELECT:I(!1);break;case l.CREATE_DETAIL:j(l.USER_SELECT),P([]);break;case l.GROUP_TYPE:j(l.CREATE_DETAIL)}else T(!1)};return a((function(){return e(o,{children:[e("div",t({className:"tui-conversation-create-header"},{children:[r(s,{onClick:k,type:c.BACK,width:9,height:16}),r("div",t({className:"title"},{children:L(U?"TUIConversation.Add Participants":"TUIConversation.Start chat")}))]})),_===l.USER_SELECT?r(C,{isCreateGroup:U,setIsCreateGroup:I,className:u,selectList:A,setSelectList:P,conversationList:S,setConversationCreated:T,setPageState:j}):r(m,{pageState:_,setPageState:j,profileList:A.map((function(t){return null==t?void 0:t.profile})),createConversation:G,setConversationCreated:T})]})}),[U,A,_])}!function(t){t.USER_SELECT="Next",t.CREATE_DETAIL="Create",t.GROUP_TYPE="GroupType"}(l||(l={}));export{v as ConversationCreate,l as PageStateTypes};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as r,useEffect as n,useMemo as i}from"react";import{useTranslation as a}from"react-i18next";import{TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import c from"classnames";import{Icon as C}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";import{ConversationCreateButton as m}from"./ConversationCreateButton.js";import{ConversationCreateUserSelectList as v}from"./ConversationCreateUserSelectList.js";import{ConversationCreateGroupDetail as E}from"./ConversationCreateGroupDetail.js";var u;function f(f){var p=f.visible,d=void 0===p||p,S=f.className,T=f.style,L=f.onChangeCreateModelVisible,h=f.conversationList,R=void 0===h?[]:h,U=f.onBeforeCreateConversation,_=f.onConversationCreated,I=a().t,A=r(!1),P=A[0],g=A[1],j=r(!1),k=j[0],G=j[1],N=r(u.USER_SELECT),b=N[0],y=N[1],B=r([]),D=B[0],x=B[1],w=function(e){g(!1),Y(),s.switchConversation(e.conversationID),null==_||_(e)};n((function(){L(P)}),[L,P]);var O=function(){if(k)switch(b){case u.USER_SELECT:G(!1);break;case u.CREATE_DETAIL:y(u.USER_SELECT),x([]);break;case u.GROUP_TYPE:y(u.CREATE_DETAIL)}else g(!1),Y()};function Y(){G(!1),y(u.USER_SELECT),x([])}return i((function(){return d?t("div",e({className:c("uikit-conversation-create-container",S),style:T},{children:[!P&&o(m,{onClick:function(){return g(!0)}}),P&&t("div",e({className:"tui-conversation-create"},{children:[t("div",e({className:"tui-conversation-create-header"},{children:[o(C,{onClick:O,type:l.BACK,width:9,height:16}),o("div",e({className:"title"},{children:I(k?"TUIConversation.Add Participants":"TUIConversation.Start chat")}))]})),b===u.USER_SELECT?o(v,{isCreateGroup:k,setIsCreateGroup:G,selectList:D,setSelectList:x,conversationList:R,onBeforeCreateConversation:U,onConversationCreated:w,setPageState:y}):o(E,{pageState:b,setPageState:y,profileList:D.map((function(e){return null==e?void 0:e.profile})),onBeforeCreateConversation:U,onConversationCreated:w})]}))]})):null}),[d,S,P,k,b,D,R,U])}!function(e){e.USER_SELECT="Next",e.CREATE_DETAIL="Create",e.GROUP_TYPE="GroupType"}(u||(u={}));export{f as ConversationCreate,u as PageStateTypes};
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+
4
+ interface IConversationCreateButtonProps {
5
+ visible?: boolean;
6
+ onClick?: (event: React__default.BaseSyntheticEvent) => void;
7
+ height?: number;
8
+ width?: number;
9
+ className?: string;
10
+ }
11
+ declare const ConversationCreateButton: (props: IConversationCreateButtonProps) => react_jsx_runtime.JSX.Element | null;
12
+
13
+ export { ConversationCreateButton, IConversationCreateButtonProps };
@@ -0,0 +1 @@
1
+ import{__assign as i}from"tslib";import{jsx as o}from"react/jsx-runtime";import t from"classnames";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as e}from"../Icon/type.js";var n=function(n){var m=n.visible,c=void 0===m||m,s=n.className,a=n.onClick,l=n.height,p=void 0===l?24:l,v=n.width,d=void 0===v?24:v;return c?o("div",i({className:t("tui-conversation-create-button",s)},{children:o(r,{onClick:a,type:e.CREATE,height:p,width:d})})):null};export{n as ConversationCreateButton};
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import { Profile } from '@tencentcloud/chat';
4
+ import { CreateGroupParams, IConversationModel } from '@tencentcloud/chat-uikit-engine';
5
+ import { PageStateTypes } from './ConversationCreate.js';
6
+
7
+ interface ConversationCreateGroupDetailProps {
8
+ profileList: Profile[];
9
+ pageState: PageStateTypes;
10
+ setPageState: React__default.Dispatch<React__default.SetStateAction<PageStateTypes>>;
11
+ onBeforeCreateConversation?: (params: CreateGroupParams) => void;
12
+ onConversationCreated?: (conversation: IConversationModel) => void;
13
+ }
14
+ declare function ConversationCreateGroupDetail(props: ConversationCreateGroupDetailProps): react_jsx_runtime.JSX.Element;
15
+
16
+ export { ConversationCreateGroupDetail, ConversationCreateGroupDetailProps };
@@ -0,0 +1 @@
1
+ import{__spreadArray as e,__assign as t,__awaiter as r,__generator as o}from"tslib";import{jsxs as n,Fragment as a,jsx as i}from"react/jsx-runtime";import{useState as c}from"react";import{useTranslation as s}from"react-i18next";import{Input as u}from"../Input/Input.js";import{Icon as p}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";import{Toast as m}from"../Toast/index.js";import{Avatar as d}from"../Avatar/Avatar.js";import{defaultUserAvatar as v,defaultGroupAvatarAVChatRoom as f,defaultGroupAvatarMeeting as g,defaultGroupAvatarPublic as h,defaultGroupAvatarWork as C}from"../Avatar/default.js";import{PageStateTypes as x}from"./ConversationCreate.js";import{GroupType as I,ConversationGroupTypeInfo as N,typeInfoList as b}from"./ConversationGroupTypeInfo.js";import"@tencentcloud/tui-core";import{useUIManager as T}from"../../context/UIManagerContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{createGroupConversation as y}from"../../hooks/useConversation.js";function j(j){var k=this,U=j.profileList,P=j.pageState,G=j.setPageState,A=j.onBeforeCreateConversation,D=j.onConversationCreated,R=s().t,O=T();O.setActiveConversation;var S=O.myProfile,w=e([],U,!0);S&&w.unshift(S);var L=w.map((function(e){return e.nick||e.userID})).toString(),M=c(L.length>=15?"".concat(L.slice(0,12),"..."):L),W=M[0],_=M[1],E=c(""),Y=E[0],q=E[1],z=c(I.Work),B=z[0],H=z[1],V=function(e,t){var r=e.target.value;switch(t){case"name":_(r);break;case"id":q(r);break;case"type":H(r)}},F=function(){G(x.GROUP_TYPE)};return P!==x.GROUP_TYPE?n(a,{children:[n("div",t({className:"tui-conversation-create-group-detail"},{children:[i("div",t({className:"create-group-box create-group-name"},{children:i(u,{maxLength:15,value:W,onChange:function(e){V(e,"name")},border:"bottom",inputClassName:"input-group-name",clearable:!0,prefix:i("div",t({className:"input-group-title"},{children:R("TUIConversation.Group Name")}))})})),i("div",t({className:"create-group-box create-group-id"},{children:i(u,{border:"bottom",inputClassName:"input-group-text",clearable:!0,value:Y,onChange:function(e){V(e,"id")},prefix:i("div",t({className:"input-group-title"},{children:R("TUIConversation.Group ID")}))})})),i("div",t({className:"create-group-box create-group-type",onClick:F},{children:i(u,{readOnly:!0,border:"bottom",inputClassName:"input-group-text",prefix:i("div",t({className:"input-group-title"},{children:R("TUIConversation.Group Type")})),suffix:i(p,{onClick:F,type:l.ARROW_RIGHT,width:7,height:12}),value:R("TUIConversation.".concat(B)),onChange:function(e){V(e,"type")}})})),i("div",t({className:"create-group-illustrate"},{children:R("TUIConversation.".concat(null==b?void 0:b.find((function(e){return e.type===B})).des))})),n("div",t({className:"create-group-portrait"},{children:[i("div",t({className:"create-group-portrait-title"},{children:R("TUIConversation.Participants")})),i("div",t({className:"create-group-portrait-info-container"},{children:U.map((function(e){var r=e.avatar,o=e.userID,a=e.nick;return n("div",t({className:"create-group-portrait-info"},{children:[i(d,{shape:"square",size:50,image:r||v}),i("div",t({className:"create-group-portrait-info-nick"},{children:a}))]}),o)}))}))]}))]})),i("div",t({className:"tui-conversation-create-next-container"},{children:i("div",t({role:"presentation",className:"tui-conversation-create-next",onClick:function(){return r(k,void 0,void 0,(function(){var e,t,r,n;return o(this,(function(o){return e=U.map((function(e){return{userID:e.userID}})),t=function(e){switch(e){case I.Work:return C;case I.Public:return h;case I.Meeting:return g;case I.AVChatRoom:return f;default:return""}}(B),r={name:W,type:B,groupID:Y,avatar:t,memberList:e},n=(null==A?void 0:A(r))||r,y(n).then((function(e){null==D||D(e)})).catch((function(e){m({text:e.message,type:"error"})})),[2]}))}))}},{children:R("TUIConversation.Create")}))}))]}):i(N,{groupType:B,setGroupType:H,setPageState:G})}export{j as ConversationCreateGroupDetail};
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import { Profile } from '@tencentcloud/chat';
4
+
5
+ interface ValueProps {
6
+ profile: Profile;
7
+ domList: HTMLInputElement[];
8
+ }
9
+ interface ConversationCreateSelectViewProps {
10
+ selectList: ValueProps[];
11
+ setSelectList: React__default.Dispatch<React__default.SetStateAction<ValueProps[]>>;
12
+ }
13
+ declare function ConversationCreateSelectView(props: ConversationCreateSelectViewProps): react_jsx_runtime.JSX.Element;
14
+
15
+ export { ConversationCreateSelectView, ConversationCreateSelectViewProps };
@@ -0,0 +1,18 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import { ConversationCreateSelectViewProps } from './ConversationCreateSelectView.js';
4
+ import { PageStateTypes } from './ConversationCreate.js';
5
+ import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
6
+
7
+ interface ConversationCreateUserSelectListProps extends ConversationCreateSelectViewProps {
8
+ isCreateGroup: boolean;
9
+ setIsCreateGroup: React__default.Dispatch<React__default.SetStateAction<boolean>>;
10
+ className?: string;
11
+ conversationList: IConversationModel[];
12
+ setPageState: React__default.Dispatch<React__default.SetStateAction<PageStateTypes>>;
13
+ onBeforeCreateConversation?: (userID: string) => void;
14
+ onConversationCreated?: (conversation: IConversationModel) => void;
15
+ }
16
+ declare function ConversationCreateUserSelectList(props: ConversationCreateUserSelectListProps): react_jsx_runtime.JSX.Element;
17
+
18
+ export { ConversationCreateUserSelectList, ConversationCreateUserSelectListProps };
@@ -1 +1 @@
1
- import{__assign as e,__awaiter as t,__generator as r,__spreadArray as n}from"tslib";import{jsxs as o,Fragment as i,jsx as c}from"react/jsx-runtime";import{useState as a,useRef as s}from"react";import{useTranslation as u}from"react-i18next";import{TUIConversationService as l}from"@tencentcloud/chat-uikit-engine";import{Input as m}from"../Input/Input.js";import{Icon as p}from"../Icon/Icon.js";import{IconTypes as v}from"../Icon/type.js";import{ConversationCreateSelectView as h}from"./ConversationCreateSelectView.js";import{Avatar as d}from"../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../Avatar/default.js";import{useConversationCreate as C}from"./hooks/useConversationCreate.js";import{useUIKit as x}from"../../context/UIKitContext.js";import{useUIManager as I}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";import{PageStateTypes as g}from"./ConversationCreate.js";import{useConversation as N}from"../../hooks/useConversation.js";import{Toast as j}from"../Toast/index.js";function k(k){var b=this,y=k.isCreateGroup,A=k.selectList,D=k.setSelectList,L=k.className,S=k.conversationList,T=k.setIsCreateGroup,w=k.setConversationCreated,U=k.setPageState,E=u().t,M=a(""),R=M[0],F=M[1],G=x().chat,P=I().setActiveConversation,z=a({}),H=z[0],K=z[1],O=C(G,S,(function(e){K(e)})).getFriendListSortSearchResult,V=N(G).createConversation,_=s(new Map);return o(i,{children:[c(m,{className:"tui-conversation-create-search-input",placeholder:E("TUIConversation.Search"),clearable:!0,value:R,onChange:function(e){return t(b,void 0,void 0,(function(){var t,n;return r(this,(function(r){switch(r.label){case 0:return t=e.target.value,F(t),n=K,[4,O(t)];case 1:return n.apply(void 0,[r.sent()]),[2]}}))}))},prefix:c(p,{type:v.SEARCH,height:16,width:16})}),y&&c(h,{selectList:A,setSelectList:D}),!y&&o("div",e({role:"presentation",className:"tui-user",onClick:function(){T(!0),_.current.clear(),D([])}},{children:[c(p,{type:v.ADD}),c("div",e({className:"tui-user-name active"},{children:E("TUIConversation.New group chat")}))]})),c("div",e({className:"tui-conversation-create ".concat(L)},{children:c("div",e({className:"tui-conversation-create-container"},{children:c("div",e({className:"tui-group-container"},{children:Object.keys(H).map((function(i){return 0!==H[i].length&&o("div",e({className:"tui-group-box"},{children:[c("div",e({className:"title"},{children:i})),H[i].map((function(a,s){var u=a.userID,m=a.nick,p=a.avatar;return o("label",e({role:"presentation",className:"tui-user tui-user-checkbox-label",htmlFor:"userChecked-".concat(i,"-").concat(u),onClick:function(e){!function(e){t(b,void 0,void 0,(function(){var t,n;return r(this,(function(r){switch(r.label){case 0:return y?[2]:(t=e.userID,[4,V("C2C".concat(t))]);case 1:return n=r.sent(),w(!1),P(n),l.switchConversation(null==n?void 0:n.conversationID),[2]}}))}))}(a)}},{children:[c(d,{size:30,image:p||f}),c("div",e({className:"tui-user-name text-ellipsis"},{children:m||"".concat(u)})),y&&c("input",{onChange:function(e){!function(e,t,r){void 0===r&&(r=[]);var o=t.userID,i=e.target.checked;r.forEach((function(e){e.checked=i})),i?A.push({profile:t,domList:r}):A.splice(A.findIndex((function(e){return e.profile.userID===o})),1),D(n([],A,!0))}(e,a,_.current.get(u))},type:"checkbox",ref:function(e){!function(e,t){if(t){_.current.has(e)||_.current.set(e,[]);var r=_.current.get(e);0!==r.length&&r.some((function(e){return e.id===t.id}))||r.push(t)}}(u,e)},id:"userChecked-".concat(i,"-").concat(u),className:"tui-user-checkbox"})]}),u)}))]}),i)}))}))}))})),y&&c("div",e({className:"tui-conversation-create-next-container"},{children:c("div",e({role:"presentation",className:"tui-conversation-create-next",onClick:function(){A&&0===A.length?j({text:E("TUIConversation.Participant cannot be empty"),type:"error"}):U(g.CREATE_DETAIL)}},{children:E("TUIConversation.Next")}))}))]})}export{k as ConversationCreateUserSelectList};
1
+ import{__assign as e,__awaiter as t,__generator as r,__spreadArray as n}from"tslib";import{jsxs as i,Fragment as o,jsx as c}from"react/jsx-runtime";import{useState as a,useRef as s}from"react";import{useTranslation as u}from"react-i18next";import{Input as l}from"../Input/Input.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as p}from"../Icon/type.js";import{ConversationCreateSelectView as h}from"./ConversationCreateSelectView.js";import{Avatar as f}from"../Avatar/Avatar.js";import{defaultUserAvatar as v}from"../Avatar/default.js";import{useConversationCreate as d}from"./hooks/useConversationCreate.js";import{createC2CConversation as C}from"../../hooks/useConversation.js";import{useUIKit as x}from"../../context/UIKitContext.js";import"@tencentcloud/chat-uikit-engine";import"../../context/MessageContext.js";import{PageStateTypes as g}from"./ConversationCreate.js";import{Toast as I}from"../Toast/index.js";function N(N){var k=this,j=N.isCreateGroup,b=N.selectList,y=N.setSelectList,L=N.className,S=N.conversationList,A=N.setIsCreateGroup,D=N.setPageState,T=N.onBeforeCreateConversation,w=N.onConversationCreated,E=u().t,U=a(""),R=U[0],F=U[1];x().chat;var G=a({}),M=G[0],P=G[1],z=d(S,(function(e){P(e)})).getFriendListSortSearchResult,B=s(new Map);return i(o,{children:[c(l,{className:"tui-conversation-create-search-input",placeholder:E("TUIConversation.Search"),clearable:!0,value:R,onChange:function(e){return t(k,void 0,void 0,(function(){var t,n;return r(this,(function(r){switch(r.label){case 0:return t=e.target.value,F(t),n=P,[4,z(t)];case 1:return n.apply(void 0,[r.sent()]),[2]}}))}))},prefix:c(m,{type:p.SEARCH,height:16,width:16})}),j&&c(h,{selectList:b,setSelectList:y}),!j&&i("div",e({role:"presentation",className:"tui-user",onClick:function(){A(!0),B.current.clear(),y([])}},{children:[c(m,{type:p.ADD}),c("div",e({className:"tui-user-name active"},{children:E("TUIConversation.New group chat")}))]})),c("div",e({className:"tui-conversation-create-select-list-container ".concat(L)},{children:c("div",e({className:"tui-conversation-create-select-list"},{children:c("div",e({className:"tui-group-container"},{children:Object.keys(M).map((function(o){return 0!==M[o].length&&i("div",e({className:"tui-group-box"},{children:[c("div",e({className:"title"},{children:o})),M[o].map((function(a,s){var u=a.userID,l=a.nick,m=a.avatar;return i("label",e({role:"presentation",className:"tui-user tui-user-checkbox-label",htmlFor:"userChecked-".concat(o,"-").concat(u),onClick:function(){!function(e){t(k,void 0,void 0,(function(){var t;return r(this,(function(r){return j||(t=e.userID,null==T||T(t),C(t).then((function(e){null==w||w(e)})).catch((function(e){I({text:e.message,type:"error"})}))),[2]}))}))}(a)}},{children:[c(f,{size:30,image:m||v}),c("div",e({className:"tui-user-name text-ellipsis"},{children:l||"".concat(u)})),j&&c("input",{onChange:function(e){!function(e,t,r){void 0===r&&(r=[]);var i=t.userID,o=e.target.checked;r.forEach((function(e){e.checked=o})),o?b.push({profile:t,domList:r}):b.splice(b.findIndex((function(e){return e.profile.userID===i})),1),y(n([],b,!0))}(e,a,B.current.get(u))},type:"checkbox",ref:function(e){!function(e,t){if(t){B.current.has(e)||B.current.set(e,[]);var r=B.current.get(e);0!==r.length&&r.some((function(e){return e.id===t.id}))||r.push(t)}}(u,e)},id:"userChecked-".concat(o,"-").concat(u),className:"tui-user-checkbox"})]}),u)}))]}),o)}))}))}))})),j&&c("div",e({className:"tui-conversation-create-next-container"},{children:c("div",e({role:"presentation",className:"tui-conversation-create-next",onClick:function(){b&&0===b.length?I({text:E("TUIConversation.Participant cannot be empty"),type:"error"}):D(g.CREATE_DETAIL)}},{children:E("TUIConversation.Next")}))}))]})}export{N as ConversationCreateUserSelectList};
@@ -0,0 +1,24 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import { PageStateTypes } from './ConversationCreate.js';
4
+
5
+ declare enum GroupType {
6
+ Work,
7
+ Public,
8
+ Meeting,
9
+ AVChatRoom,
10
+ Community
11
+ }
12
+ interface ConversationGroupTypeInfoProps {
13
+ groupType: GroupType;
14
+ setGroupType: React__default.Dispatch<React__default.SetStateAction<GroupType>>;
15
+ setPageState: React__default.Dispatch<React__default.SetStateAction<PageStateTypes>>;
16
+ }
17
+ declare const typeInfoList: Array<{
18
+ type: GroupType;
19
+ name: string;
20
+ des: string;
21
+ }>;
22
+ declare function ConversationGroupTypeInfo(props: ConversationGroupTypeInfoProps): react_jsx_runtime.JSX.Element;
23
+
24
+ export { ConversationGroupTypeInfo, ConversationGroupTypeInfoProps, GroupType, typeInfoList };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useTranslation as n}from"react-i18next";import{PageStateTypes as r}from"./ConversationCreate.js";import{Icon as i}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";var s;!function(e){e.Work="Private",e.Public="Public",e.Meeting="ChatRoom",e.AVChatRoom="AVChatRoom",e.Community="Community"}(s||(s={}));var c=[{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."},{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."},{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."},{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."},{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."}];function u(s){var u=s.groupType,p=s.setGroupType,d=s.setPageState,m=n().t;return t("div",e({className:"tui-conversation-group-type-info"},{children:[c.map((function(n){var s=n.type,c=n.des;return t("div",e({role:"presentation",className:"group-type-info-box ".concat(s===u?"group-type-info-box--active":""," "),onClick:function(){!function(e){p(e),d(r.CREATE_DETAIL)}(s)}},{children:[t("div",e({className:"group-type-info-title"},{children:[s===u&&o(i,{className:"box-active-icon",type:a.RIGHT,width:16,height:16}),m("TUIConversation.".concat(s))]})),o("div",e({className:"group-type-info-description"},{children:m("TUIConversation.".concat(c))}))]}),s)})),o("a",e({className:"group-type-info-document",target:"_blank",href:"https://www.tencentcloud.com/document/product/1047/33515?lang=en&pg=#group-features",rel:"bookmark noreferrer"},{children:m("TUIConversation.Details")}))]}))}export{u as ConversationGroupTypeInfo,s as GroupType,c as typeInfoList};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useTranslation as n}from"react-i18next";import{TUIChatEngine as r}from"@tencentcloud/chat-uikit-engine";import{PageStateTypes as i}from"./ConversationCreate.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";var c;!function(e){e[e.Work=r.TYPES.GRP_WORK]="Work",e[e.Public=r.TYPES.GRP_PUBLIC]="Public",e[e.Meeting=r.TYPES.GRP_MEETING]="Meeting",e[e.AVChatRoom=r.TYPES.GRP_AVCHATROOM]="AVChatRoom",e[e.Community=r.TYPES.GRP_COMMUNITY]="Community"}(c||(c={}));var u=[{type:c.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."},{type:c.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."},{type:c.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."},{type:c.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."},{type:c.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."}];function p(r){var c=r.groupType,p=r.setGroupType,m=r.setPageState,d=n().t;return t("div",e({className:"tui-conversation-group-type-info"},{children:[u.map((function(n){var r=n.type,u=n.name,h=n.des;return t("div",e({role:"presentation",className:"group-type-info-box ".concat(r===c?"group-type-info-box--active":""," "),onClick:function(){!function(e){p(e),m(i.CREATE_DETAIL)}(r)}},{children:[t("div",e({className:"group-type-info-title"},{children:[r===c&&o(a,{className:"box-active-icon",type:s.RIGHT,width:16,height:16}),d("TUIConversation.".concat(u))]})),o("div",e({className:"group-type-info-description"},{children:d("TUIConversation.".concat(h))}))]}),r)})),o("a",e({className:"group-type-info-document",target:"_blank",href:"https://trtc.io/document/33529?platform=web&product=chat&menulabel=uikit#group-types",rel:"bookmark noreferrer"},{children:d("TUIConversation.Details")}))]}))}export{p as ConversationGroupTypeInfo,c as GroupType,u as typeInfoList};
@@ -0,0 +1,14 @@
1
+ import React__default from 'react';
2
+ import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
3
+ import { Friend } from '@tencentcloud/chat';
4
+
5
+ declare const useConversationCreate: (conversationList: IConversationModel[], setFriendListResultHandler?: ((newFriendListResult: object, setFriendListResult: React__default.Dispatch<React__default.SetStateAction<{
6
+ string: object[];
7
+ }>>) => void) | undefined) => {
8
+ getFirstLetter: (str: string) => string;
9
+ queryFriendList: (friendList: Friend[]) => Promise<void>;
10
+ getFriendListSortSearchResult: (searchValue: string) => Promise<any>;
11
+ friendListSortResult: any;
12
+ };
13
+
14
+ export { useConversationCreate };
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from"tslib";import{useState as r,useEffect as o}from"react";import n from"@tencentcloud/chat";import{strChineseFirstPy as i}from"../static/word.js";import"react/jsx-runtime";import"react-i18next";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import"../../../context/TUIMessageContext.js";import"../../../utils/env.js";import"../../Icon/config.js";import"../../Icon/type.js";import"date-fns";import"date-fns/locale";import"../ConversationCreate.js";import"../ConversationGroupTypeInfo.js";import"../../TUIChat/index.js";import"../../../constants.js";import"../../TUIMessage/hooks/useMessageReply.js";import"../../TUIMessage/MessagePlugins.js";import"../../TUIMessage/MessageContext.js";import"../../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../../TUIProfile/TUIProfileDefault.js";import{useProfile as s}from"../../../hooks/useProfile.js";var u=function(u,c,a){var l=r(),f=l[0],p=l[1],m=function(e){var t=e.trim(),r=t.charCodeAt(0);return r>40869||r<19968?t.charAt(0):i.charAt(r-19968)},d=function(){return e(void 0,void 0,void 0,(function(){var e,r,o,i;return t(this,(function(t){switch(t.label){case 0:return c.filter((function(e){return(null==e?void 0:e.type)===n.TYPES.CONV_C2C})).slice(0,5).map((function(e){return null==e?void 0:e.userProfile})),[4,null==u?void 0:u.getFriendList()];case 1:return e=t.sent()||{},r=e.code,o=e.data,0===r&&(i=v(o.map((function(e){return e.profile}))),p(i),a&&a(i,p)),[2]}}))}))},v=function(e,t){for(var r={"#":[]},o=65;o<=90;o+=1)r[String.fromCharCode(o)]=[];return e.forEach((function(e){var t=e.nick,o=e.userID,n=m(t||o);n>="a"&&n<="z"?r[n.toLocaleUpperCase()].push(e):n<"A"||n>"z"?r["#"].push(e):r[n].push(e)})),Object.keys(r).forEach((function(e){r[e].sort((function(e,t){var r=e.nick,o=e.userID,n=t.nick,i=t.userID;return r||o<n||i||r||o===n||i?1:-1}))})),r},h=s(u).getUserProfile;return o((function(){d()}),[u]),{getFirstLetter:m,queryFriendList:d,getFriendListSortSearchResult:function(r){return e(void 0,void 0,void 0,(function(){var e,o,n,i;return t(this,(function(t){switch(t.label){case 0:return r?[4,h([r])]:[2,f];case 1:return e=t.sent().data,o={},n=!1,Object.keys(f).forEach((function(e){o[e]=f[e].filter((function(e){var t,o,i=e.nick,s=e.userID,u=null==i?void 0:i.toLocaleLowerCase(),c=r.toLocaleLowerCase(),a=s.toLocaleLowerCase();return o="TencentCloudDemo"===(null===(t=process.env)||void 0===t?void 0:t.REACT_APP_ONLINE)?u?u.includes(c):a.includes(c):a===c,n=n||o,o}))})),"TencentCloudDemo"===(null===(i=process.env)||void 0===i?void 0:i.REACT_APP_ONLINE)?[2,o]:[2,n?o:v(e)]}}))}))},friendListSortResult:f}};export{u as useConversationCreate};
1
+ import{__awaiter as r,__generator as t}from"tslib";import{useState as n,useEffect as e}from"react";import{TUIStore as o,StoreName as i,TUIUserService as u}from"@tencentcloud/chat-uikit-engine";import c from"@tencentcloud/chat";import{strChineseFirstPy as s}from"../static/word.js";var a=function(a,f){var l=n(),d=l[0],v=l[1],h=function(r){var t=r.trim(),n=t.charCodeAt(0);return n>40869||n<19968?t.charAt(0):s.charAt(n-19968)},p=function(n){return r(void 0,void 0,void 0,(function(){var r;return t(this,(function(t){return a.filter((function(r){return(null==r?void 0:r.type)===c.TYPES.CONV_C2C})).slice(0,5).map((function(r){return null==r?void 0:r.userProfile})),r=m(null==n?void 0:n.map((function(r){return r.profile}))),v(r),f&&f(r,v),[2]}))}))};function m(r,t){for(var n={"#":[]},e=65;e<=90;e+=1)n[String.fromCharCode(e)]=[];return null==r||r.forEach((function(r){var t=r.nick,e=r.userID,o=h(t||e);o>="a"&&o<="z"?n[o.toLocaleUpperCase()].push(r):o<"A"||o>"z"?n["#"].push(r):n[o].push(r)})),Object.keys(n).forEach((function(r){n[r].sort((function(r,t){var n=r.nick,e=r.userID,o=t.nick,i=t.userID;return n||e<=o||i?1:-1}))})),n}function L(r){p(r)}return e((function(){return o.watch(i.FRIEND,{friendList:L}),function(){o.unwatch(i.FRIEND,{friendList:L})}}),[]),{getFirstLetter:h,queryFriendList:p,getFriendListSortSearchResult:function(n){return r(void 0,void 0,void 0,(function(){var r,e,o,i;return t(this,(function(t){switch(t.label){case 0:return n?[4,u.getUserProfile({userIDList:[n]})]:[2,d];case 1:return r=t.sent().data,e={},o=!1,Object.keys(d).forEach((function(r){e[r]=d[r].filter((function(r){var t,e,i=r.nick,u=r.userID,c=null==i?void 0:i.toLocaleLowerCase(),s=n.toLocaleLowerCase(),a=u.toLocaleLowerCase();return e="TencentCloudDemo"===(null===(t=process.env)||void 0===t?void 0:t.REACT_APP_ONLINE)?c?c.includes(s):a.includes(s):a===s,o=o||e,e}))})),"TencentCloudDemo"===(null===(i=process.env)||void 0===i?void 0:i.REACT_APP_ONLINE)?[2,e]:[2,o?e:m(r)]}}))}))},friendListSortResult:d}};export{a as useConversationCreate};
@@ -0,0 +1,57 @@
1
+ import React__default, { PropsWithChildren } from 'react';
2
+ import { IConversationModel, CreateGroupParams } from '@tencentcloud/chat-uikit-engine';
3
+ import { IConversationListHeaderProps } from './ConversationListHeader/ConversationListHeader.js';
4
+ import { IConversationListContentProps } from './ConversationListContent/ConversationListContent.js';
5
+ import { IConversationPreviewUIProps } from '../ConversationPreview/ConversationPreview.js';
6
+ import { AvatarProps } from '../Avatar/Avatar.js';
7
+ import { IConversationSearchProps } from '../ConversationSearch/ConversationSearch.js';
8
+ import { IConversationCreateProps } from '../ConversationCreate/ConversationCreate.js';
9
+ import { IConversationActionsConfig, IConversationActionsProps } from '../ConversationActions/ConversationActions.js';
10
+
11
+ interface IConversationListProps {
12
+ /** Determines whether the conversation search input appears on the conversation list view. (Default: True) */
13
+ enableSearch?: boolean;
14
+ /** Determines whether the conversation creation button appears on the conversation list view. (Default: True) */
15
+ enableCreate?: boolean;
16
+ /** Determines whether the conversation action button appears on the conversation list view. (Default: True) */
17
+ enableActions?: boolean;
18
+ /** Specifies the prop to customize action on the conversation list item. */
19
+ actionsConfig?: IConversationActionsConfig;
20
+ /** Specifies a react component to customize the header of the conversation list. */
21
+ Header?: React__default.ComponentType<IConversationListHeaderProps>;
22
+ /** Specifies a react component to customize the conversation list component. */
23
+ List?: React__default.ComponentType<IConversationListContentProps>;
24
+ /** Specifies a react component to customize the conversation preview. */
25
+ Preview?: React__default.ComponentType<IConversationPreviewUIProps>;
26
+ /** Specifies a react component to customize the conversation create component. */
27
+ ConversationCreate?: React__default.ComponentType<IConversationCreateProps>;
28
+ /** Specifies a react component to customize the conversation search. */
29
+ ConversationSearch?: React__default.ComponentType<IConversationSearchProps>;
30
+ /** Specifies a react component to customize the conversation actions in conversation preview. */
31
+ ConversationActions?: React__default.ComponentType<IConversationActionsProps>;
32
+ /** Specifies a react component to customize the placeholder when the conversation list is empty. */
33
+ PlaceholderEmptyList?: React__default.ReactNode;
34
+ /** Specifies a react component to customize the placeholder when the conversation list is loading. */
35
+ PlaceholderLoading?: React__default.ReactNode;
36
+ /** Specifies a react component to customize the placeholder when the conversation list loaded error. */
37
+ PlaceholderLoadError?: React__default.ReactNode;
38
+ /** Specifies a react component to customize the avatar in list. */
39
+ Avatar?: React__default.ComponentType<AvatarProps>;
40
+ /** Specifies a function to filter conversations in the conversation list. */
41
+ filter?: (conversationList: IConversationModel[]) => IConversationModel[];
42
+ /** Specifies a function to sort conversations in the conversation list. */
43
+ sort?: (conversationList: IConversationModel[]) => IConversationModel[];
44
+ /** Specifies the prop to receive callback when a user clicks a conversation in the conversation list. */
45
+ onSelectConversation?: (conversation: IConversationModel) => void;
46
+ /** Specifies the prop to execute custom operations before creating a channel. */
47
+ onBeforeCreateConversation?: (params: string | CreateGroupParams) => string | CreateGroupParams;
48
+ /** Specifies the prop to receive callback when a conversation is created. */
49
+ onConversationCreated?: (conversation: IConversationModel) => void;
50
+ /** The custom class name */
51
+ className?: string;
52
+ /** The custom css style */
53
+ style?: React__default.CSSProperties;
54
+ }
55
+ declare function ConversationList<T extends IConversationListProps>(props: PropsWithChildren<T>): React__default.ReactElement;
56
+
57
+ export { ConversationList, IConversationListProps };
@@ -0,0 +1 @@
1
+ import{__assign as o}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r}from"react";import{ConversationListProvider as i,useConversationList as n}from"../../context/ConversationListContext.js";import{ConversationListHeader as a}from"./ConversationListHeader/ConversationListHeader.js";import{ConversationListContent as s}from"./ConversationListContent/ConversationListContent.js";import"react-i18next";import"../Icon/config.js";import"../Icon/type.js";import c from"classnames";import{ConversationPreview as v,ConversationPreviewUI as l}from"../ConversationPreview/ConversationPreview.js";import{Avatar as d}from"../Avatar/Avatar.js";import{PlaceHolder as m,PlaceHolderTypes as C}from"../PlaceHolder/index.js";import{ConversationSearch as p}from"../ConversationSearch/ConversationSearch.js";import{ConversationCreate as f}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import"../../context/MessageContext.js";import"@tencentcloud/chat";import{ConversationActions as h}from"../ConversationActions/ConversationActions.js";import{isH5 as u}from"../../utils/env.js";function L(i){var L=i.enableSearch,j=void 0===L||L,A=i.enableCreate,g=void 0===A||A,P=i.enableActions,y=void 0===P||P,b=i.actionsConfig,S=i.Header,x=void 0===S?a:S,N=i.List,E=void 0===N?s:N,I=i.Preview,w=void 0===I?l:I,O=i.ConversationCreate,k=void 0===O?f:O,H=i.ConversationSearch,G=void 0===H?p:H,R=i.ConversationActions,_=void 0===R?h:R,B=i.PlaceholderEmptyList,D=void 0===B?e(m,{type:C.NO_CONVERSATIONS}):B,M=i.PlaceholderLoading,T=void 0===M?e(m,{type:C.LOADING}):M,V=i.PlaceholderLoadError,W=void 0===V?e(m,{type:C.WRONG}):V,q=i.Avatar,z=void 0===q?d:q,F=i.onSelectConversation,J=i.onBeforeCreateConversation,K=i.onConversationCreated,Q=i.className,U=i.style,X=n(),Y=X.conversationList,Z=X.filteredAndSortedConversationList,$=X.isLoading,oo=X.isLoadError,eo=r(!1),to=eo[0],ro=eo[1];return t("div",o({className:c(Q,"uikit-chat-list",{"uikit-chat-list--mobile":u}),style:U},{children:[t(x,{children:[e(G,{visible:j,conversationList:Y,Avatar:z,ResultPreview:v}),e(k,{className:c({"uikit-chat-list__header--creating":to}),visible:g,onChangeCreateModelVisible:function(o){return ro(o)},onBeforeCreateConversation:J,onConversationCreated:K})]}),e(E,o({empty:0===Z.length,loading:$,error:oo,PlaceholderEmptyList:D,PlaceholderLoadError:W,PlaceholderLoading:T},{children:Z.map((function(o){return e(v,{conversation:o,enableActions:y,Preview:w,Avatar:z,ConversationActions:_,onSelectConversation:F,actionsConfig:b},o.conversationID)}))}))]}))}function j(t){return e(i,o({filter:t.filter,sort:t.sort},{children:e(L,o({},t))}))}export{j as ConversationList};
@@ -0,0 +1,23 @@
1
+ interface IConversationListContentProps {
2
+ /** Renders a customized component in the conversation list main. */
3
+ children: React.ReactNode;
4
+ /** Indicates whether the chat list is empty */
5
+ empty?: boolean;
6
+ /** Indicates whether the chat list is currently loading */
7
+ loading?: boolean;
8
+ /** Indicates whether there was an error loading the chat list */
9
+ error?: boolean;
10
+ /** A custom component to display when the chat list is empty */
11
+ PlaceholderEmptyList?: React.ReactNode;
12
+ /** A custom component to display while the chat list is loading */
13
+ PlaceholderLoading?: React.ReactNode;
14
+ /** A custom component to display when there is an error loading the chat list */
15
+ PlaceholderLoadError?: React.ReactNode;
16
+ /** The custom class name */
17
+ className?: string;
18
+ /** The custom css style */
19
+ style?: React.CSSProperties;
20
+ }
21
+ declare function ConversationListContent<T extends IConversationListContentProps>(props: T): React.ReactElement;
22
+
23
+ export { ConversationListContent, IConversationListContentProps };
@@ -0,0 +1 @@
1
+ import{__assign as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"classnames";import{PlaceHolder as i,PlaceHolderTypes as t}from"../../PlaceHolder/index.js";function l(l){var a,d=l.children,m=l.empty,s=void 0!==m&&m,c=l.loading,n=void 0!==c&&c,p=l.error,v=void 0!==p&&p,y=l.PlaceholderEmptyList,N=void 0===y?e(i,{type:t.NO_CONVERSATIONS}):y,h=l.PlaceholderLoading,f=void 0===h?e(i,{type:t.LOADING}):h,O=l.PlaceholderLoadError,u=void 0===O?e(i,{type:t.WRONG}):O,L=l.className,P=l.style;return a=v?u:n?f:s?N:d,e("div",r({className:o("uikit-chat-list__container",L),style:P},{children:a}))}export{l as ConversationListContent};
@@ -0,0 +1,15 @@
1
+ interface IConversationListHeaderProps {
2
+ /** The main of the conversation list header */
3
+ children: React.ReactNode;
4
+ /** A custom component to display in the left area of header */
5
+ left?: React.ReactNode;
6
+ /** A custom component to display in the right area of header */
7
+ right?: React.ReactNode;
8
+ /** The custom class name */
9
+ className?: string;
10
+ /** The custom css style */
11
+ style?: React.CSSProperties;
12
+ }
13
+ declare function ConversationListHeader<T extends IConversationListHeaderProps>(props: T): React.ReactElement;
14
+
15
+ export { ConversationListHeader, IConversationListHeaderProps };
@@ -0,0 +1 @@
1
+ import{__assign as i}from"tslib";import{jsxs as t,jsx as e}from"react/jsx-runtime";import r from"classnames";function a(a){var s=a.children,l=a.left,c=a.right,h=a.className,m=a.style;return t("div",i({className:r("uikit-chat-list__header",h),style:m},{children:[e("div",i({className:"uikit-chat-list__header__left"},{children:l})),s,e("div",i({className:"uikit-chat-list__header__right"},{children:c}))]}))}export{a as ConversationListHeader};
@@ -1,33 +1,45 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React__default from 'react';
3
- import { Conversation } from '@tencentcloud/chat';
1
+ import React__default, { CSSProperties } from 'react';
2
+ import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
4
3
  import { AvatarProps } from '../Avatar/Avatar.js';
4
+ import { IConversationActionsProps, IConversationActionsConfig } from '../ConversationActions/ConversationActions.js';
5
5
 
6
- interface ConversationPreviewUIComponentProps extends ConversationPreviewProps {
6
+ interface IConversationPreviewUIProps {
7
+ /** The conversation to be displayed */
8
+ conversation: IConversationModel;
7
9
  /** If the component's Conversation is the active (selected) Conversation */
8
- active?: boolean;
9
- /** Image of Conversation to display */
10
- displayImage?: string;
11
- /** Title of Conversation to display */
12
- displayTitle?: string | React__default.ReactElement;
13
- /** Message of Conversation to display */
14
- displayMessage?: string | React__default.ReactElement;
15
- /** Time of Conversation to display */
16
- displayTime?: string;
17
- /** Number of unread Messages */
18
- unread?: number;
19
- }
20
- interface ConversationPreviewProps {
21
- conversation: Conversation;
22
- activeConversation?: Conversation;
23
- Preview?: React__default.ComponentType<ConversationPreviewUIComponentProps>;
10
+ isSelected?: boolean;
11
+ /** Whether to show the ConversationActions */
12
+ enableActions?: boolean;
13
+ /** The string to be highlighted in the title */
14
+ highlightMatchString?: string;
15
+ /** The custom Avatar component */
24
16
  Avatar?: React__default.ComponentType<AvatarProps>;
25
- setActiveConversation?: (conversation: Conversation | undefined) => void;
26
- searchValue?: string;
27
- conversationUpdateCount?: number;
28
- activeConversationID?: string;
29
- setActiveConversationID?: (conversationID: string) => void;
17
+ /** The custom Title component */
18
+ Title?: string | JSX.Element;
19
+ /** The custom last message abstract component */
20
+ LastMessageAbstract?: string | JSX.Element;
21
+ /** The custom last message abstract component */
22
+ LastMessageTimestamp?: string | JSX.Element;
23
+ /** The custom Unread component */
24
+ Unread?: string | JSX.Element;
25
+ /** The custom ConversationActions component */
26
+ ConversationActions?: React__default.ComponentType<IConversationActionsProps>;
27
+ /** Callback when the user click a conversation from conversation list */
28
+ onSelectConversation?: (conversation: IConversationModel) => void;
29
+ /** The custom ConversationActions config */
30
+ actionsConfig?: IConversationActionsConfig;
31
+ /** The custom class name */
32
+ className?: string;
33
+ /** The custom class style */
34
+ style?: CSSProperties;
35
+ /** The custom children node to override UI */
36
+ children?: React__default.ReactNode;
37
+ }
38
+ interface IConversationPreviewProps extends IConversationPreviewUIProps {
39
+ /** The custom Preview UI component */
40
+ Preview?: React__default.ComponentType<IConversationPreviewUIProps>;
30
41
  }
31
- declare function ConversationPreview<T extends ConversationPreviewProps>(props: T): react_jsx_runtime.JSX.Element;
42
+ declare function ConversationPreview<T extends IConversationPreviewProps>(props: T): React__default.ReactElement;
43
+ declare function ConversationPreviewUI<T extends IConversationPreviewUIProps>(props: T): React__default.ReactElement;
32
44
 
33
- export { ConversationPreview, ConversationPreviewProps, ConversationPreviewUIComponentProps };
45
+ export { ConversationPreview, ConversationPreviewUI, IConversationPreviewProps, IConversationPreviewUIProps };
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as o,Fragment as e}from"react/jsx-runtime";import{useState as n,useEffect as i}from"react";import{useUIKit as r}from"../../context/UIKitContext.js";import{useUIManager as a}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";import{ConversationPreviewContent as s}from"./ConversationPreviewContent.js";import{getDisplayImage as m,getDisplayTitle as v,getDisplayMessage as c,getDisplayTime as u}from"./utils.js";function l(l){var p=l.activeConversation,d=l.conversation,C=l.Preview,f=void 0===C?s:C,x=l.searchValue,g=l.conversationUpdateCount,j=r().language,I=a(),y=I.setActiveConversation,U=I.myProfile,M=n(m(d)),P=M[0],T=M[1],w=n(v(d,x)),A=w[0],D=w[1],b=n(U&&c(d,U)),h=b[0],K=b[1],V=n(u(d,j)),k=V[0],q=V[1],z=n(d.unreadCount),B=z[0],E=z[1],F=(null==p?void 0:p.conversationID)===(null==d?void 0:d.conversationID);return f?(i((function(){D(v(d,x)),U&&K(c(d,U)),T(m(d)),q(u(d,j)),E(d.unreadCount)}),[d,x,g,j]),o(f,t({},l,{active:F,displayImage:P,displayTitle:A,displayMessage:h,displayTime:k,unread:B,setActiveConversation:y}))):o(e,{})}export{l as ConversationPreview};
1
+ import{__assign as i}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useState as r,useEffect as s}from"react";import a from"classnames";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as v}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{ConversationActions as u}from"../ConversationActions/ConversationActions.js";import{useConversationList as m}from"../../context/ConversationListContext.js";import{useUIManager as d}from"../../context/UIManagerContext.js";import{useUIKit as h}from"../../context/UIKitContext.js";import"../../context/MessageContext.js";import p from"../../hooks/useLongPress.js";import g from"../../hooks/useMouseHover.js";import{generateHighlightTitle as f,getLatestMessagePreview as C}from"./utils.js";import{getTimeStamp as k}from"../utils.js";import{isH5 as M}from"../../utils/env.js";function _(t){var n=t.conversation,o=t.isSelected,r=void 0!==o&&o,s=t.enableActions,p=void 0===s||s,g=t.highlightMatchString,M=t.Preview,_=void 0===M?w:M,A=t.Avatar,j=void 0===A?l:A,x=t.ConversationActions,N=void 0===x?u:x,S=t.Title,b=void 0===S?function(t){var n=t.conversation,o=t.highlightMatchString;return e("div",i({className:"uikit-conversation-preview__title text-ellipsis"},{children:f(n,o).map((function(t,n){return e("span",i({className:a({"uikit-conversation-preview__title--highlight":t.isHighlight,"uikit-conversation-preview__title--normal":!t.isHighlight})},{children:t.text}),n)}))}))}({conversation:n,highlightMatchString:g}):S,L=t.LastMessageTimestamp,y=void 0===L?function(t){var n,o=t.conversation,r=h().language;return e("div",i({className:"uikit-conversation-preview__time"},{children:k(1e3*+((null===(n=o.lastMessage)||void 0===n?void 0:n.lastTime)||0),r)}))}({conversation:n}):L,T=t.LastMessageAbstract,I=void 0===T?function(t){var n=t.conversation,o=d().myProfile;return e("div",i({className:"uikit-conversation-preview__abstract"},{children:C(n,o)}))}({conversation:n}):T,P=t.Unread,U=void 0===P?function(t){var n,o=t.conversation;return n=o.isMuted?e(c,{type:v.MUTE,width:16,height:16}):o.unreadCount>99?"99+":0===o.unreadCount?null:o.unreadCount,e("div",i({className:"uikit-conversation-preview__unread"},{children:n}))}({conversation:n}):P,D=t.onSelectConversation,H=t.actionsConfig,z=t.className,E=t.style,K=t.children;return m().setCurrentConversation,e(_,{conversation:n,isSelected:r,enableActions:p,highlightMatchString:g,Avatar:j,ConversationActions:N,Title:b,LastMessageTimestamp:y,LastMessageAbstract:I,Unread:U,onSelectConversation:D,actionsConfig:H,className:z,style:E,children:K})}function w(c){var v=c.conversation,d=c.isSelected,h=c.enableActions,f=c.Avatar,C=void 0===f?l:f,k=c.ConversationActions,_=void 0===k?u:k,w=c.Title,A=c.LastMessageTimestamp,j=c.LastMessageAbstract,x=c.Unread,N=c.onSelectConversation,S=c.actionsConfig,b=c.className,L=c.style,y=c.children,T=m(),I=T.currentConversation,P=T.setCurrentConversation,U=o(null),D=r(!1),H=D[0],z=D[1],E=g(U),K=p({},{delay:500,shouldPreventDefault:!0}).isLongPressing;s((function(){z(E||K)}),[E,K]);return e("div",i({ref:U,className:a("uikit-conversation-preview",b,{"uikit-conversation-preview--mobile":M,"uikit-conversation-preview--active":d||v.conversationID===(null==I?void 0:I.conversationID),"uikit-conversation-preview--unread":!v.isMuted&&v.unreadCount>0,"uikit-conversation-preview--pin":v.isPinned,"uikit-conversation-preview--mute":v.isMuted}),style:L,onClick:function(){null==N||N(v),P(v)}},{children:y||t(n,{children:[e("div",i({className:"uikit-conversation-preview__avatar"},{children:e(C,{image:v.getAvatar(),size:40})})),t("div",i({className:"uikit-conversation-preview__content"},{children:[w,j]})),t("div",i({className:"uikit-conversation-preview__external"},{children:[x,h&&H?e(_,i({conversation:v},S)):A]}))]})}))}export{_ as ConversationPreview,w as ConversationPreviewUI};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as r,jsx as o,Fragment as a}from"react/jsx-runtime";import t from"@tencentcloud/chat";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as i,defaultUserAvatar as n}from"../Avatar/default.js";import{formatEmojiString as s}from"../TUIMessage/utils/emojiMap.js";import{getTimeStamp as c}from"../utils.js";var l=function(e){if(!e)return null;var r={},o=e.type,a=e.groupProfile,i=e.userProfile;switch(o){case t.TYPES.CONV_C2C:r=i;break;case t.TYPES.CONV_GROUP:r=a;case t.TYPES.CONV_SYSTEM:}return r},p=function(i,n,s){void 0===s&&(s="#147AFF");var c=l(i),p=c.name,u=c.nick,d=c.groupID,m=c.userID,f=i.type,C=i.remark,v="";switch(f){case t.TYPES.CONV_C2C:v=C||u||m;break;case t.TYPES.CONV_GROUP:v=p||d;break;default:v=""}var O,P,S,h;return n?(P=(O=v).toLocaleLowerCase(),S=n&&P.indexOf(n.toLocaleLowerCase()),h=O.split(new RegExp("(".concat(n,")"),"gi")),""===S?o(a,{}):r("div",{children:[n&&h.map((function(r,a){return r.toLowerCase()===n.toLowerCase()?o("span",e({style:{color:s}},{children:r}),a):o("span",{children:r},a)})),";"]})):v},u=function(e){var r=e.type,o=l(e).avatar,a=o;if(!o)switch(r){case t.TYPES.CONV_C2C:a=n;break;case t.TYPES.CONV_GROUP:default:a=i}return a},d=function(a,i,n){var c,l=a.lastMessage,p=a.type,u=l.fromAccount,d=l.nick,m=l.nameCard,f=l.isRevoked,C=l.messageForShow;l.type===t.TYPES.MSG_CUSTOM&&(null===(c=l.payload)||void 0===c?void 0:c.description)&&(C=l.payload.description);var v="";switch(p){case t.TYPES.CONV_GROUP:v=(null==l?void 0:l.fromAccount)===(null==i?void 0:i.userID)?"You":"".concat(m||d||u||""),v="".concat(v?"".concat(v,":"):"");break;case t.TYPES.CONV_C2C:v=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[o("span",{children:v}),o("span",{children:l.isRevoked?"recalled a message":s(C,1)})]}))},m=function(e,r){var o=e.lastMessage;return c(1e3*o.lastTime,r)};export{u as getDisplayImage,d as getDisplayMessage,m as getDisplayTime,p as getDisplayTitle,l as getMessageProfile};
1
+ import{__assign as e}from"tslib";import{jsxs as r,jsx as t,Fragment as o}from"react/jsx-runtime";import a from"@tencentcloud/chat-uikit-engine";import{formatEmojiString as i}from"../MessageElement/utils/emojiMap.js";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as n,defaultUserAvatar as c}from"../Avatar/default.js";var s=function(e,r){var t=e.getShowName();if(!r)return[{text:t,isHighlight:!1}];var o=r.toLowerCase();return t.split(new RegExp("(".concat(r,")"),"gi")).map((function(e){return{text:e,isHighlight:e.toLowerCase()===o}}))},l=function(o,n){var c,s=o.lastMessage,l=o.type;if(!s)return"";var u=s.fromAccount,p=s.nick,d=s.nameCard,f=s.isRevoked,m=s.messageForShow;s.type===a.TYPES.MSG_CUSTOM&&(null===(c=s.payload)||void 0===c?void 0:c.description)&&(m=s.payload.description);var C="";switch(l){case a.TYPES.CONV_GROUP:C=(null==s?void 0:s.fromAccount)===(null==n?void 0:n.userID)?"You":"".concat(d||p||u||""),C="".concat(C?"".concat(C,":"):"");break;case a.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[t("span",{children:C}),t("span",{children:s.isRevoked?"recalled a message":i(m,1)})]}))},u=function(e){if(!e)return null;var r={},t=e.type,o=e.groupProfile,i=e.userProfile;switch(t){case a.TYPES.CONV_C2C:r=i;break;case a.TYPES.CONV_GROUP:r=o}return r},p=function(i,n,c){void 0===c&&(c="#147AFF");var s=u(i),l=s.name,p=s.nick,d=s.groupID,f=s.userID,m=i.type,C=i.remark,v="";switch(m){case a.TYPES.CONV_C2C:v=C||p||f||"";break;case a.TYPES.CONV_GROUP:v=l||d||"";break;default:v=""}var h,w,g,O;return n?(w=(h=v).toLocaleLowerCase(),g=n&&w.indexOf(n.toLocaleLowerCase()),O=h.split(new RegExp("(".concat(n,")"),"gi")),""===g?t(o,{}):r("div",{children:[n&&O.map((function(r,o){return r.toLowerCase()===n.toLowerCase()?t("span",e({style:{color:c}},{children:r}),o):t("span",{children:r},o)})),";"]})):v},d=function(e){var r=e.type,t=u(e).avatar,o=t;if(!t)switch(r){case a.TYPES.CONV_C2C:o=c;break;case a.TYPES.CONV_GROUP:default:o=n}return o};export{s as generateHighlightTitle,d as getDisplayImage,p as getDisplayTitle,l as getLatestMessagePreview,u as getMessageProfile};
@@ -0,0 +1,39 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
3
+ import { IConversationSearchInputProps } from './ConversationSearchInput/ConversationSearchInput.js';
4
+ import { IConversationSearchResultProps } from './ConversationSearchResult/ConversationSearchResult.js';
5
+ import { IConversationPreviewProps } from '../ConversationPreview/ConversationPreview.js';
6
+ import { AvatarProps } from '../Avatar/Avatar.js';
7
+
8
+ interface IConversationSearchProps {
9
+ /** The list of conversations to be searched. */
10
+ conversationList: IConversationModel[];
11
+ /** Specifies a react component to customize the avatar in the search results. */
12
+ Avatar?: React.ComponentType<AvatarProps>;
13
+ /** Specifies a react component to customize the preview of search results. */
14
+ ResultPreview?: React.ComponentType<IConversationPreviewProps>;
15
+ /** Specifies a react component to customize the search input. */
16
+ ConversationSearchInput?: React.ComponentType<IConversationSearchInputProps>;
17
+ /** Specifies a react component to customize the search result. */
18
+ ConversationSearchResult?: React.ComponentType<IConversationSearchResultProps>;
19
+ /** Specifies a function to customize the search algorithm. This function takes the search value and the conversation list as parameters and returns the search results. */
20
+ searchFn?: (searchValue: string, conversationList: IConversationModel[]) => IConversationModel[];
21
+ /** Specifies a function to be called when the search input changes. This function takes the current search value as a parameter. */
22
+ onSearchChange?: (searchValue: string) => void;
23
+ /** Specifies a function to be called when the search input is focused. */
24
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
25
+ /** Specifies a function to be called when the search input is blurred. */
26
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
27
+ /** Specifies a function to be called when a search result is selected. This function takes the selected conversation as a parameter. */
28
+ onSelectResult?: (conversation: IConversationModel) => void;
29
+ /** Specifies whether the search component is visible. */
30
+ visible?: boolean;
31
+ /** Specifies a custom class name for the search component. */
32
+ className?: string;
33
+ /** The custom css style */
34
+ style?: React.CSSProperties;
35
+ }
36
+ declare function defaultSearchFn(searchValue: string, conversationList: IConversationModel[]): IConversationModel[];
37
+ declare function ConversationSearch(props: IConversationSearchProps): react_jsx_runtime.JSX.Element | null;
38
+
39
+ export { ConversationSearch, IConversationSearchProps, defaultSearchFn };
@@ -0,0 +1 @@
1
+ import{__assign as e}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import i from"classnames";import{ConversationSearchInput as a}from"./ConversationSearchInput/ConversationSearchInput.js";import{ConversationSearchResult as l}from"./ConversationSearchResult/ConversationSearchResult.js";import{ConversationPreview as s}from"../ConversationPreview/ConversationPreview.js";import{Avatar as u}from"../Avatar/Avatar.js";function v(e,o){return e&&0!==(null==o?void 0:o.length)?o.filter((function(o){return o.getShowName().toLocaleLowerCase().includes(e.toLocaleLowerCase())})):[]}function c(c){var m=c.visible,f=void 0===m||m,h=c.conversationList,d=c.Avatar,p=void 0===d?u:d,C=c.searchFn,S=void 0===C?v:C,g=c.ResultPreview,R=void 0===g?s:g,w=c.ConversationSearchInput,j=void 0===w?a:w,L=c.ConversationSearchResult,b=void 0===L?l:L,A=c.onSearchChange,P=c.onFocus,F=c.onBlur,I=c.onSelectResult,N=c.className,k=c.style,x=t(""),y=x[0],B=x[1],V=t(h),q=V[0],z=V[1],D=t(!1),E=D[0],G=D[1],H=t(!1),J=H[0],K=H[1],M=t(!0),O=M[0],Q=M[1];return r((function(){null==A||A(y)}),[y,A]),r((function(){z(S(y,h))}),[h,S,y]),r((function(){G(!O)}),[J,O]),f?o("div",e({className:i("uikit-conversation-search",N,{"uikit-conversation-search--active":E}),style:k},{children:[n(j,{value:y,clearable:!0,onChange:function(e){var o,n,t;B(null===(o=e.target)||void 0===o?void 0:o.value),Q(0===(null===(n=e.target)||void 0===n?void 0:n.value.length)),null==A||A(null===(t=e.target)||void 0===t?void 0:t.value)},onFocus:function(e){K(!0),null==P||P(e)},onBlur:function(e){K(!1),null==F||F(e)}}),n(b,{visible:E,Avatar:p,searchResult:q,searchValue:y,ResultPreview:R,onSelectResult:I})]})):null}export{c as ConversationSearch,v as defaultSearchFn};
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { InputProps } from '../../Input/Input.js';
3
+
4
+ type IConversationSearchInputProps = InputProps;
5
+ declare function ConversationSearchInput(props: IConversationSearchInputProps): react_jsx_runtime.JSX.Element;
6
+
7
+ export { ConversationSearchInput, IConversationSearchInputProps };
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{useTranslation as r}from"react-i18next";import{Icon as e}from"../../Icon/Icon.js";import{IconTypes as n}from"../../Icon/type.js";import{Input as t}from"../../Input/Input.js";import a from"classnames";function i(i){var c=i.className,m=i.placeholder,p=i.clearable,s=i.value,l=i.onChange,u=i.prefix,f=void 0===u?o(e,{type:n.SEARCH,height:16,width:16}):u,h=i.onFocus,v=i.onBlur,I=r().t;return o(t,{className:a("uikit-conversation-search-input",c),placeholder:m||I("TUIConversation.Search"),clearable:p,value:s,onChange:l,onFocus:h,onBlur:v,prefix:f})}export{i as ConversationSearchInput};
@@ -0,0 +1,29 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
4
+ import { IConversationPreviewProps } from '../../ConversationPreview/ConversationPreview.js';
5
+ import { AvatarProps } from '../../Avatar/Avatar.js';
6
+
7
+ interface IConversationSearchResultProps {
8
+ /** Whether to show the search result */
9
+ visible?: boolean;
10
+ /** The search result */
11
+ searchResult?: IConversationModel[];
12
+ /** The search input value */
13
+ searchValue?: string;
14
+ /** The custom ResultPreview component */
15
+ ResultPreview?: React__default.ComponentType<IConversationPreviewProps>;
16
+ /** The custom Avatar component */
17
+ Avatar?: React__default.ComponentType<AvatarProps>;
18
+ /** The custom no result Placeholder component */
19
+ PlaceholderNoResult?: React__default.ReactNode;
20
+ /** Callback when the ResultPreview is clicked */
21
+ onSelectResult?: (conversation: IConversationModel) => void;
22
+ /** The custom class name */
23
+ className?: string;
24
+ /** The custom css style */
25
+ style?: React__default.CSSProperties;
26
+ }
27
+ declare function ConversationSearchResult(props: IConversationSearchResultProps): react_jsx_runtime.JSX.Element | null;
28
+
29
+ export { ConversationSearchResult, IConversationSearchResultProps };
@@ -0,0 +1 @@
1
+ import{__assign as e}from"tslib";import{jsx as r}from"react/jsx-runtime";import t from"classnames";import{ConversationPreview as o}from"../../ConversationPreview/ConversationPreview.js";import{Avatar as i}from"../../Avatar/Avatar.js";import{PlaceHolder as a,PlaceHolderTypes as n}from"../../PlaceHolder/index.js";function s(s){var l=s.visible,v=void 0!==l&&l,c=s.searchResult,m=s.searchValue,u=s.Avatar,d=void 0===u?i:u,h=s.ResultPreview,p=void 0===h?o:h,f=s.PlaceholderNoResult,S=void 0===f?r(a,{type:n.NO_RESULTS,searchString:m}):f,g=s.onSelectResult,P=s.className,R=s.style;return v?r("div",e({className:t("uikit-conversation-search-result",P),style:R},{children:0===(null==c?void 0:c.length)?S:null==c?void 0:c.map((function(e){return r(p,{conversation:e,Avatar:d,highlightMatchString:m,onSelectConversation:g},e.conversationID)}))})):null}export{s as ConversationSearchResult};
@@ -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(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
+ 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 o&&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};