@tencentcloud/chat-uikit-react 2.1.0 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/.eslintrc.js +0 -1
  2. package/CHANGELOG.md +10 -0
  3. package/dist/cjs/components/Avatar/Avatar.js +1 -1
  4. package/dist/cjs/components/Checkbox/index.d.ts +2 -1
  5. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  6. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  7. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  8. package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
  9. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
  10. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  11. package/dist/cjs/components/ConversationPreview/utils.js +1 -1
  12. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
  13. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
  14. package/dist/cjs/components/DivWithEdit/DivWithEdit.d.ts +3 -2
  15. package/dist/cjs/components/DivWithEdit/DivWithEdit.js +1 -1
  16. package/dist/cjs/components/DivWithEdit/WithText.js +1 -1
  17. package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
  18. package/dist/cjs/components/Icon/Icon.d.ts +2 -1
  19. package/dist/cjs/components/Icon/Icon.js +1 -1
  20. package/dist/cjs/components/Icon/config.js +1 -1
  21. package/dist/cjs/components/Input/Input.js +1 -1
  22. package/dist/cjs/components/Model/index.d.ts +1 -1
  23. package/dist/cjs/components/Model/index.js +1 -1
  24. package/dist/cjs/components/Plugins/index.js +1 -1
  25. package/dist/cjs/components/Popup/index.d.ts +1 -1
  26. package/dist/cjs/components/Popup/index.js +1 -1
  27. package/dist/cjs/components/Switch/Switch.d.ts +2 -6
  28. package/dist/cjs/components/Switch/Switch.js +1 -1
  29. package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
  30. package/dist/cjs/components/TUIChat/TUIChatState.js +1 -1
  31. package/dist/cjs/components/TUIChat/hooks/useHandleMessage.js +1 -1
  32. package/dist/cjs/components/TUIChat/hooks/useHandleMessageList.js +1 -1
  33. package/dist/cjs/components/TUIChat/unitls.js +1 -1
  34. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  35. package/dist/cjs/components/TUIContact/TUIContact.js +1 -1
  36. package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
  37. package/dist/cjs/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
  38. package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
  39. package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  40. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  41. package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
  42. package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  43. package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  44. package/dist/cjs/components/TUIKit/TUIKit.d.ts +2 -2
  45. package/dist/cjs/components/TUIKit/TUIKit.js +1 -1
  46. package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
  47. package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
  48. package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +1 -1
  49. package/dist/cjs/components/TUIManage/TUIManage.d.ts +4 -1
  50. package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
  51. package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
  52. package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
  53. package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
  54. package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
  55. package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
  56. package/dist/cjs/components/TUIMessage/MessageFace.js +1 -1
  57. package/dist/cjs/components/TUIMessage/MessageFile.js +1 -1
  58. package/dist/cjs/components/TUIMessage/MessageImage.js +1 -1
  59. package/dist/cjs/components/TUIMessage/MessageLocation.js +1 -1
  60. package/dist/cjs/components/TUIMessage/MessageMerger.js +1 -1
  61. package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
  62. package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
  63. package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
  64. package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
  65. package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
  66. package/dist/cjs/components/TUIMessage/MessageVideo.js +1 -1
  67. package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
  68. package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
  69. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  70. package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
  71. package/dist/cjs/components/TUIMessage/utils/index.js +1 -1
  72. package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +1 -1
  73. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  74. package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  75. package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
  76. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  77. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  78. package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  79. package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  80. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
  81. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  82. package/dist/cjs/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
  83. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
  84. package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  85. package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
  86. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
  87. package/dist/cjs/components/TUIProfile/hooks/useMyProfile.js +1 -1
  88. package/dist/cjs/components/Toast/index.js +1 -1
  89. package/dist/cjs/constants.js +1 -1
  90. package/dist/cjs/context/ComponentContext.d.ts +3 -2
  91. package/dist/cjs/context/TUIChatActionContext.d.ts +1 -1
  92. package/dist/cjs/context/TUIChatStateContext.d.ts +4 -4
  93. package/dist/cjs/context/TUIContactContext.js +1 -1
  94. package/dist/cjs/context/TUIConversationContext.js +1 -1
  95. package/dist/cjs/context/TUIKitContext.d.ts +1 -1
  96. package/dist/cjs/context/TUIMessageContext.js +1 -1
  97. package/dist/cjs/context/TUIMessageInputContext.js +1 -1
  98. package/dist/cjs/hooks/useProfile.d.ts +1 -1
  99. package/dist/cjs/index.css +1 -1
  100. package/dist/cjs/index.d.css +20 -3
  101. package/dist/cjs/index.d.ts +1 -1
  102. package/dist/esm/components/Avatar/Avatar.js +1 -1
  103. package/dist/esm/components/Checkbox/index.d.ts +2 -1
  104. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  105. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  106. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  107. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
  108. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
  109. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  110. package/dist/esm/components/ConversationPreview/utils.js +1 -1
  111. package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
  112. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
  113. package/dist/esm/components/DivWithEdit/DivWithEdit.d.ts +3 -2
  114. package/dist/esm/components/DivWithEdit/DivWithEdit.js +1 -1
  115. package/dist/esm/components/DivWithEdit/WithText.js +1 -1
  116. package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
  117. package/dist/esm/components/Icon/Icon.d.ts +2 -1
  118. package/dist/esm/components/Icon/Icon.js +1 -1
  119. package/dist/esm/components/Icon/config.js +1 -1
  120. package/dist/esm/components/Input/Input.js +1 -1
  121. package/dist/esm/components/Model/index.d.ts +1 -1
  122. package/dist/esm/components/Model/index.js +1 -1
  123. package/dist/esm/components/Plugins/index.js +1 -1
  124. package/dist/esm/components/Popup/index.d.ts +1 -1
  125. package/dist/esm/components/Popup/index.js +1 -1
  126. package/dist/esm/components/Switch/Switch.d.ts +2 -6
  127. package/dist/esm/components/Switch/Switch.js +1 -1
  128. package/dist/esm/components/TUIChat/TUIChat.js +1 -1
  129. package/dist/esm/components/TUIChat/TUIChatState.js +1 -1
  130. package/dist/esm/components/TUIChat/hooks/useHandleMessage.js +1 -1
  131. package/dist/esm/components/TUIChat/hooks/useHandleMessageList.js +1 -1
  132. package/dist/esm/components/TUIChat/unitls.js +1 -1
  133. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  134. package/dist/esm/components/TUIContact/TUIContact.js +1 -1
  135. package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
  136. package/dist/esm/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
  137. package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
  138. package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  139. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  140. package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
  141. package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  142. package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  143. package/dist/esm/components/TUIKit/TUIKit.d.ts +2 -2
  144. package/dist/esm/components/TUIKit/TUIKit.js +1 -1
  145. package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
  146. package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
  147. package/dist/esm/components/TUIKit/hooks/useTUIKit.js +1 -1
  148. package/dist/esm/components/TUIManage/TUIManage.d.ts +4 -1
  149. package/dist/esm/components/TUIManage/TUIManage.js +1 -1
  150. package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
  151. package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
  152. package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
  153. package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
  154. package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
  155. package/dist/esm/components/TUIMessage/MessageFace.js +1 -1
  156. package/dist/esm/components/TUIMessage/MessageFile.js +1 -1
  157. package/dist/esm/components/TUIMessage/MessageImage.js +1 -1
  158. package/dist/esm/components/TUIMessage/MessageLocation.js +1 -1
  159. package/dist/esm/components/TUIMessage/MessageMerger.js +1 -1
  160. package/dist/esm/components/TUIMessage/MessageName.js +1 -1
  161. package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
  162. package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
  163. package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
  164. package/dist/esm/components/TUIMessage/MessageText.js +1 -1
  165. package/dist/esm/components/TUIMessage/MessageVideo.js +1 -1
  166. package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
  167. package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
  168. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  169. package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
  170. package/dist/esm/components/TUIMessage/utils/index.js +1 -1
  171. package/dist/esm/components/TUIMessageInput/EmojiPicker.js +1 -1
  172. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  173. package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  174. package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
  175. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  176. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  177. package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  178. package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  179. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
  180. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  181. package/dist/esm/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
  182. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
  183. package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  184. package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
  185. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
  186. package/dist/esm/components/TUIProfile/hooks/useMyProfile.js +1 -1
  187. package/dist/esm/components/Toast/index.js +1 -1
  188. package/dist/esm/constants.js +1 -1
  189. package/dist/esm/context/ComponentContext.d.ts +3 -2
  190. package/dist/esm/context/TUIChatActionContext.d.ts +1 -1
  191. package/dist/esm/context/TUIChatStateContext.d.ts +4 -4
  192. package/dist/esm/context/TUIContactContext.js +1 -1
  193. package/dist/esm/context/TUIConversationContext.js +1 -1
  194. package/dist/esm/context/TUIKitContext.d.ts +1 -1
  195. package/dist/esm/context/TUIMessageContext.js +1 -1
  196. package/dist/esm/context/TUIMessageInputContext.js +1 -1
  197. package/dist/esm/hooks/useProfile.d.ts +1 -1
  198. package/dist/esm/index.css +1 -1
  199. package/dist/esm/index.d.css +20 -3
  200. package/dist/esm/index.d.ts +1 -1
  201. package/index.ts +1 -0
  202. package/package.json +7 -6
  203. package/rollup.config.js +2 -1
  204. package/src/components/Avatar/Avatar.tsx +7 -3
  205. package/src/components/Avatar/styles/index.scss +1 -1
  206. package/src/components/Checkbox/index.tsx +1 -1
  207. package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +14 -7
  208. package/src/components/ConversationCreate/ConversationCreate.tsx +5 -1
  209. package/src/components/ConversationCreate/ConversationCreateSelectView.tsx +2 -2
  210. package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +11 -10
  211. package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +14 -12
  212. package/src/components/ConversationPreview/ConversationPreview.tsx +3 -3
  213. package/src/components/ConversationPreview/ConversationPreviewContent.tsx +9 -5
  214. package/src/components/ConversationPreview/utils.tsx +6 -3
  215. package/src/components/DivWithEdit/DivWithEdit.tsx +6 -5
  216. package/src/components/DivWithEdit/WithText.tsx +3 -1
  217. package/src/components/DivWithEdit/styles/index.scss +1 -1
  218. package/src/components/Icon/Icon.tsx +2 -2
  219. package/src/components/Icon/config.ts +3 -4
  220. package/src/components/Input/Input.tsx +15 -12
  221. package/src/components/Model/index.tsx +2 -2
  222. package/src/components/Plugins/index.tsx +15 -12
  223. package/src/components/Popup/index.tsx +13 -9
  224. package/src/components/Switch/Switch.tsx +5 -7
  225. package/src/components/TUIChat/TUIChat.tsx +20 -5
  226. package/src/components/TUIChat/TUIChatState.tsx +3 -3
  227. package/src/components/TUIChat/hooks/useHandleMessage.tsx +5 -5
  228. package/src/components/TUIChat/hooks/useHandleMessageList.tsx +2 -2
  229. package/src/components/TUIChat/unitls.ts +2 -2
  230. package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +3 -2
  231. package/src/components/TUIContact/TUIContact.tsx +2 -1
  232. package/src/components/TUIContact/TUIContactInfo/TUIContactInfo.tsx +2 -1
  233. package/src/components/TUIContact/TUIContactInfo/addFriendInfo.tsx +2 -2
  234. package/src/components/TUIContact/TUIContactInfo/basicInfo.tsx +18 -0
  235. package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +1 -2
  236. package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +0 -10
  237. package/src/components/TUIContact/TUIContactInfo/index.scss +5 -0
  238. package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +7 -4
  239. package/src/components/TUIContact/TUIContactList/index.scss +5 -0
  240. package/src/components/TUIContact/hooks/useTUIContact.tsx +3 -4
  241. package/src/components/TUIContact/index.scss +5 -0
  242. package/src/components/TUIContactSearch/TUIContactSearch.tsx +6 -7
  243. package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +1 -3
  244. package/src/components/TUIConversationList/TUIConversationList.tsx +1 -1
  245. package/src/components/TUIConversationList/hooks/useConversationList.tsx +1 -1
  246. package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
  247. package/src/components/TUIKit/TUIKit.tsx +35 -17
  248. package/src/components/TUIKit/hooks/useTUIKit.tsx +4 -4
  249. package/src/components/TUIManage/TUIManage.tsx +20 -13
  250. package/src/components/TUIMessage/MessageAudio.tsx +8 -6
  251. package/src/components/TUIMessage/MessageAvatar.tsx +2 -2
  252. package/src/components/TUIMessage/MessageBubble.tsx +7 -5
  253. package/src/components/TUIMessage/MessageContext.tsx +3 -3
  254. package/src/components/TUIMessage/MessageCustom.tsx +5 -3
  255. package/src/components/TUIMessage/MessageFace.tsx +2 -2
  256. package/src/components/TUIMessage/MessageFile.tsx +5 -5
  257. package/src/components/TUIMessage/MessageImage.tsx +4 -2
  258. package/src/components/TUIMessage/MessageLocation.tsx +3 -3
  259. package/src/components/TUIMessage/MessageMerger.tsx +3 -3
  260. package/src/components/TUIMessage/MessageName.tsx +1 -1
  261. package/src/components/TUIMessage/MessagePlugins.tsx +12 -10
  262. package/src/components/TUIMessage/MessageProgress.tsx +5 -4
  263. package/src/components/TUIMessage/MessageRevoke.tsx +1 -1
  264. package/src/components/TUIMessage/MessageText.tsx +4 -4
  265. package/src/components/TUIMessage/MessageVideo.tsx +3 -3
  266. package/src/components/TUIMessage/TUIMessage.tsx +1 -1
  267. package/src/components/TUIMessage/TUIMessageDefault.tsx +3 -1
  268. package/src/components/TUIMessage/hooks/useMessageHandler.ts +13 -13
  269. package/src/components/TUIMessage/hooks/useMessageReply.ts +6 -4
  270. package/src/components/TUIMessage/utils/decodeText.ts +2 -3
  271. package/src/components/TUIMessage/utils/index.ts +1 -2
  272. package/src/components/TUIMessageInput/EmojiPicker.tsx +4 -4
  273. package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +8 -8
  274. package/src/components/TUIMessageInput/InputQuoteDefalut.tsx +4 -2
  275. package/src/components/TUIMessageInput/TUIForward.tsx +22 -15
  276. package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +15 -9
  277. package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +2 -2
  278. package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +4 -4
  279. package/src/components/TUIMessageInput/hooks/useHandleQuoteMessage.tsx +5 -5
  280. package/src/components/TUIMessageInput/hooks/useMessageInputState.tsx +3 -3
  281. package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +12 -9
  282. package/src/components/TUIMessageInput/hooks/useUploadElement.tsx +2 -2
  283. package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +1 -1
  284. package/src/components/TUIMessageList/TUIMessageList.tsx +5 -6
  285. package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +5 -2
  286. package/src/components/TUIProfile/TUIProfile.tsx +3 -1
  287. package/src/components/TUIProfile/TUIProfileDefault.tsx +15 -15
  288. package/src/components/TUIProfile/hooks/useMyProfile.tsx +6 -6
  289. package/src/components/Toast/index.tsx +3 -3
  290. package/src/components/Toast/styles/layout.scss +1 -1
  291. package/src/components/untils.ts +1 -1
  292. package/src/constants.ts +5 -0
  293. package/src/context/TUIChatStateContext.tsx +4 -4
  294. package/src/context/TUIContactContext.tsx +1 -1
  295. package/src/context/TUIConversationContext.tsx +2 -2
  296. package/src/context/TUIMessageContext.tsx +1 -1
  297. package/src/context/TUIMessageInputContext.tsx +1 -1
  298. package/src/hooks/useConversation.tsx +1 -1
  299. package/src/hooks/useProfile.tsx +2 -2
  300. package/tsconfig.json +1 -0
  301. package/dist/cjs/components/Icon/images/create.png.js +0 -1
  302. package/dist/esm/components/Icon/images/create.png.js +0 -1
@@ -1,3 +1,4 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
 
3
4
  interface onChangeParams {
@@ -11,6 +12,6 @@ interface SelectProps {
11
12
  value?: any;
12
13
  id?: string;
13
14
  }
14
- declare function Checkbox<T extends SelectProps>(props: React.PropsWithChildren<T>): JSX.Element;
15
+ declare function Checkbox<T extends SelectProps>(props: React.PropsWithChildren<T>): react_jsx_runtime.JSX.Element;
15
16
 
16
17
  export { Checkbox };
@@ -1 +1 @@
1
- import{__spreadArray as e,__assign as t,__awaiter as r,__generator as o}from"tslib";import{jsxs as a,Fragment as n,jsx as i}from"react/jsx-runtime";import{useState as c}from"react";import{useTranslation as s}from"react-i18next";import{TUIConversationService as u}from"@tencentcloud/chat-uikit-engine";import{Input as p}from"../Input/Input.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{Avatar as v}from"../Avatar/Avatar.js";import{defaultUserAvatar as d,defaultGroupAvatarAVChatRoom as f,defaultGroupAvatarMeeting as g,defaultGroupAvatarPublic as h,defaultGroupAvatarWork as C}from"../Avatar/default.js";import{PageStateTypes as I}from"./ConversationCreate.js";import{ConversationGroupTypeInfo as x,typeInfoList as N,GroupType as b}from"./ConversationGroupTypeInfo.js";import{useTUIKitContext as T}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function y(y){var k=this,U=y.profileList,j=y.pageState,P=y.setPageState,G=y.createConversation,D=y.setConversationCreated,A=s().t,R=T(),w=R.setActiveConversation,O=R.myProfile,S=e([],U,!0);S.unshift(O);var L=S.map((function(e){return e.nick||e.userID})).toString(),W=c(L.length>=15?"".concat(L.slice(0,12),"..."):L),_=W[0],E=W[1],M=c(""),Y=M[0],q=M[1],z=c("Work"),H=z[0],K=z[1],V=function(e,t){var r=e.target.value;switch(t){case"name":E(r);break;case"id":q(r);break;case"type":K(r)}},B=function(){P(I.GROUP_TYPE)};return j!==I.GROUP_TYPE?a(n,{children:[a("div",t({className:"tui-conversation-create-group-detail"},{children:[i("div",t({className:"create-group-box create-group-name"},{children:i(p,{maxLength:15,value:_,onChange:function(e){V(e,"name")},border:"bottom",customClassName:"input-group-name",clearable:!0,prefix:i("div",t({className:"input-group-title"},{children:A("TUIConversation.Group Name")}))})})),i("div",t({className:"create-group-box create-group-id"},{children:i(p,{border:"bottom",customClassName:"input-group-text",clearable:!0,value:Y,onChange:function(e){V(e,"id")},prefix:i("div",t({className:"input-group-title"},{children:A("TUIConversation.Group ID")}))})})),i("div",t({className:"create-group-box create-group-type",onClick:B},{children:i(p,{readOnly:!0,border:"bottom",customClassName:"input-group-text",prefix:i("div",t({className:"input-group-title"},{children:A("TUIConversation.Group Type")})),suffix:i(l,{onClick:B,type:m.ARROW_RIGHT,width:7,height:12}),value:A("TUIConversation.".concat(H)),onChange:function(e){V(e,"type")}})})),i("div",t({className:"create-group-illustrate"},{children:A("TUIConversation.".concat(N.find((function(e){return e.type===H})).des))})),a("div",t({className:"create-group-portrait"},{children:[i("div",t({className:"create-group-portrait-title"},{children:A("TUIConversation.Participants")})),i("div",t({className:"create-group-portrait-info-container"},{children:U.map((function(e){var r=e.avatar,o=e.userID,n=e.nick;return a("div",t({className:"create-group-portrait-info"},{children:[i(v,{shape:"square",size:50,image:r||d}),i("div",t({className:"create-group-portrait-info-nick"},{children:n}))]}),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;return o(this,(function(o){switch(o.label){case 0:return e=U.map((function(e){return{userID:e.userID}})),t=function(e){switch(e){case"Work":return C;case"Public":return h;case"Meeting":return g;case"AVChatRoom":return f;default:return""}}(H),[4,G({name:_,type:b[H],groupID:Y,avatar:t,memberList:e})];case 1:return r=o.sent(),w(r),u.switchConversation(null==r?void 0:r.conversationID),D(!1),[2]}}))}))}},{children:A("TUIConversation.Create")}))}))]}):i(x,{groupType:H,setGroupType:K,setPageState:P})}export{y as ConversationCreatGroupDetail};
1
+ import{__spreadArray as e,__assign as t,__awaiter as r,__generator as o}from"tslib";import{jsxs as a,Fragment as n,jsx as i}from"react/jsx-runtime";import{useState as c}from"react";import{useTranslation as s}from"react-i18next";import{TUIConversationService as u}from"@tencentcloud/chat-uikit-engine";import{Input as p}from"../Input/Input.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{Avatar as v}from"../Avatar/Avatar.js";import{defaultUserAvatar as d,defaultGroupAvatarAVChatRoom as f,defaultGroupAvatarMeeting as g,defaultGroupAvatarPublic as h,defaultGroupAvatarWork as C}from"../Avatar/default.js";import{PageStateTypes as I}from"./ConversationCreate.js";import{ConversationGroupTypeInfo as x,typeInfoList as N,GroupType as b}from"./ConversationGroupTypeInfo.js";import{useTUIKitContext as T}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function y(y){var k=this,U=y.profileList,j=y.pageState,P=y.setPageState,G=y.createConversation,D=y.setConversationCreated,A=s().t,R=T(),w=R.setActiveConversation,O=R.myProfile,S=e([],U,!0);O&&S.unshift(O);var L=S.map((function(e){return e.nick||e.userID})).toString(),W=c(L.length>=15?"".concat(L.slice(0,12),"..."):L),_=W[0],E=W[1],M=c(""),Y=M[0],q=M[1],z=c("Work"),H=z[0],K=z[1],V=function(e,t){var r=e.target.value;switch(t){case"name":E(r);break;case"id":q(r);break;case"type":K(r)}},B=function(){P(I.GROUP_TYPE)};return j!==I.GROUP_TYPE?a(n,{children:[a("div",t({className:"tui-conversation-create-group-detail"},{children:[i("div",t({className:"create-group-box create-group-name"},{children:i(p,{maxLength:15,value:_,onChange:function(e){V(e,"name")},border:"bottom",customClassName:"input-group-name",clearable:!0,prefix:i("div",t({className:"input-group-title"},{children:A("TUIConversation.Group Name")}))})})),i("div",t({className:"create-group-box create-group-id"},{children:i(p,{border:"bottom",customClassName:"input-group-text",clearable:!0,value:Y,onChange:function(e){V(e,"id")},prefix:i("div",t({className:"input-group-title"},{children:A("TUIConversation.Group ID")}))})})),i("div",t({className:"create-group-box create-group-type",onClick:B},{children:i(p,{readOnly:!0,border:"bottom",customClassName:"input-group-text",prefix:i("div",t({className:"input-group-title"},{children:A("TUIConversation.Group Type")})),suffix:i(l,{onClick:B,type:m.ARROW_RIGHT,width:7,height:12}),value:A("TUIConversation.".concat(H)),onChange:function(e){V(e,"type")}})})),i("div",t({className:"create-group-illustrate"},{children:A("TUIConversation.".concat(null==N?void 0:N.find((function(e){return e.type===H})).des))})),a("div",t({className:"create-group-portrait"},{children:[i("div",t({className:"create-group-portrait-title"},{children:A("TUIConversation.Participants")})),i("div",t({className:"create-group-portrait-info-container"},{children:U.map((function(e){var r=e.avatar,o=e.userID,n=e.nick;return a("div",t({className:"create-group-portrait-info"},{children:[i(v,{shape:"square",size:50,image:r||d}),i("div",t({className:"create-group-portrait-info-nick"},{children:n}))]}),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;return o(this,(function(o){switch(o.label){case 0:return e=U.map((function(e){return{userID:e.userID}})),t=function(e){switch(e){case"Work":return C;case"Public":return h;case"Meeting":return g;case"AVChatRoom":return f;default:return""}}(H),[4,G({name:_,type:b[H],groupID:Y,avatar:t,memberList:e})];case 1:return r=o.sent(),w(r),u.switchConversation(null==r?void 0:r.conversationID),D(!1),[2]}}))}))}},{children:A("TUIConversation.Create")}))}))]}):i(x,{groupType:H,setGroupType:K,setPageState:P})}export{y as ConversationCreatGroupDetail};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as i,useMemo as a}from"react";import{useTranslation as s}from"react-i18next";import{Icon as n}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{useTUIKitContext as E}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{useConversation as p}from"../../hooks/useConversation.js";var v;function f(f){var T=f.className,l=void 0===T?"":T,S=f.setConversationCreated,u=f.conversationList,d=void 0===u?[]:u,L=s().t,U=i(!1),h=U[0],I=U[1],R=i(v.USER_SELECT),_=R[0],j=R[1],x=i([]),A=x[0],P=x[1],G=E().chat,g=p(G).createConversation,N=function(){if(h)switch(_){case v.USER_SELECT:I(!1);break;case v.CREATE_DETAIL:j(v.USER_SELECT),P([]);break;case v.GROUP_TYPE:j(v.CREATE_DETAIL)}else S(!1)};return a((function(){return e(r,{children:[e("div",t({className:"tui-conversation-create-header"},{children:[o(n,{onClick:N,type:c.BACK,width:9,height:16}),o("div",t({className:"title"},{children:L(h?"TUIConversation.Add Participants":"TUIConversation.Start chat")}))]})),_===v.USER_SELECT?o(C,{isCreateGroup:h,setIsCreateGroup:I,className:l,selectList:A,setSelectList:P,conversationList:d,setConversationCreated:S,setPageState:j}):o(m,{pageState:_,setPageState:j,profileList:A.map((function(t){return t.profile})),createConversation:g,setConversationCreated:S})]})}),[h,A,_])}!function(t){t.USER_SELECT="Next",t.CREATE_DETAIL="Create",t.GROUP_TYPE="GroupType"}(v||(v={}));export{f as ConversationCreate,v as PageStateTypes};
1
+ import{__assign as t}from"tslib";import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as i,useMemo as a}from"react";import{useTranslation as s}from"react-i18next";import{Icon as n}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{useTUIKitContext as E}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{useConversation as p}from"../../hooks/useConversation.js";var v;function l(l){var f=l.className,T=void 0===f?"":f,u=l.setConversationCreated,S=l.conversationList,d=void 0===S?[]:S,L=s().t,U=i(!1),h=U[0],I=U[1],R=i(v.USER_SELECT),_=R[0],j=R[1],x=i([]),A=x[0],P=x[1],G=E().chat,g=p(G).createConversation,N=function(){if(h)switch(_){case v.USER_SELECT:I(!1);break;case v.CREATE_DETAIL:j(v.USER_SELECT),P([]);break;case v.GROUP_TYPE:j(v.CREATE_DETAIL)}else u(!1)};return a((function(){return e(r,{children:[e("div",t({className:"tui-conversation-create-header"},{children:[o(n,{onClick:N,type:c.BACK,width:9,height:16}),o("div",t({className:"title"},{children:L(h?"TUIConversation.Add Participants":"TUIConversation.Start chat")}))]})),_===v.USER_SELECT?o(C,{isCreateGroup:h,setIsCreateGroup:I,className:T,selectList:A,setSelectList:P,conversationList:d,setConversationCreated:u,setPageState:j}):o(m,{pageState:_,setPageState:j,profileList:A.map((function(t){return null==t?void 0:t.profile})),createConversation:g,setConversationCreated:u})]})}),[h,A,_])}!function(t){t.USER_SELECT="Next",t.CREATE_DETAIL="Create",t.GROUP_TYPE="GroupType"}(v||(v={}));export{l as ConversationCreate,v as PageStateTypes};
@@ -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"@tencentcloud/chat-uikit-engine";import"react-i18next";import"../../../utils/env.js";import"../../../context/TUIMessageContext.js";import"../../Icon/config.js";import"../../Icon/type.js";import"date-fns";import"date-fns/locale";import"../ConversationCreate.js";import"../ConversationGroupTypeInfo.js";import"../../../constants.js";import"../../TUIMessage/hooks/useMessageReply.js";import"../../TUIMessage/MessagePlugins.js";import"../../TUIMessage/MessageContext.js";import"../../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../../Switch/Switch.js";import"../../TUIProfile/TUIProfileDefault.js";import"../../../locales/index.js";import{useProfile as s}from"../../../hooks/useProfile.js";var c=function(c,u,a){var f=r({}),p=f[0],l=f[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 u.filter((function(e){return e.type===n.TYPES.CONV_C2C})).slice(0,5).map((function(e){return e.userProfile})),[4,c.getFriendList()];case 1:return e=t.sent(),r=e.code,o=e.data,0===r&&(i=v(o.map((function(e){return e.profile}))),l(i),a&&a(i,l)),[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(c).getUserProfile;return o((function(){d()}),[c]),{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,p];case 1:return e=t.sent().data,o={},n=!1,Object.keys(p).forEach((function(e){o[e]=p[e].filter((function(e){var t,o,i=e.nick,s=e.userID,c=i.toLocaleLowerCase(),u=r.toLocaleLowerCase(),a=s.toLocaleLowerCase();return o="TencentCloudDemo"===(null===(t=process.env)||void 0===t?void 0:t.REACT_APP_ONLINE)?c?c.includes(u):a.includes(u):a===u,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:p}};export{c as useConversationCreate};
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"../../TUIKit/TUIKit.js";import"react-i18next";import"../../../context/TUIMessageContext.js";import"../../../utils/env.js";import"@tencentcloud/chat-uikit-engine";import"../../Icon/config.js";import"../../Icon/type.js";import"date-fns";import"date-fns/locale";import"../ConversationCreate.js";import"../ConversationGroupTypeInfo.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,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 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import{useState as e,useEffect as n}from"react";import{useTUIKitContext as i}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{ConversationPreviewContent as r}from"./ConversationPreviewContent.js";import{getDisplayImage as a,getDisplayTitle as s,getDisplayMessage as v,getDisplayTime as m}from"./utils.js";function l(l){var u=l.activeConversation,c=l.conversation,p=l.Preview,C=void 0===p?r:p,d=l.searchValue,f=l.conversationUpdateCount,x=i("TUIConversation").language,I=i("ConversationPreview"),g=I.setActiveConversation,j=I.myProfile,y=e(a(c)),T=y[0],P=y[1],U=e(s(c,d)),w=U[0],A=U[1],D=e(v(c,j)),M=D[0],b=D[1],h=e(m(c,x)),K=h[0],V=h[1],k=e(c.unreadCount),q=k[0],z=k[1],B=(null==u?void 0:u.conversationID)===(null==c?void 0:c.conversationID);return C?(n((function(){A(s(c,d)),b(v(c,j)),P(a(c)),V(m(c,x)),z(c.unreadCount)}),[c,d,f,x]),t(C,o({},l,{active:B,displayImage:T,displayTitle:w,displayMessage:M,displayTime:K,unread:q,setActiveConversation:g}))):null}export{l as ConversationPreview};
1
+ import{__assign as o}from"tslib";import{jsx as t,Fragment as e}from"react/jsx-runtime";import{useState as n,useEffect as i}from"react";import{useTUIKitContext as r}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{ConversationPreviewContent as a}from"./ConversationPreviewContent.js";import{getDisplayImage as s,getDisplayTitle as v,getDisplayMessage as m,getDisplayTime as c}from"./utils.js";function u(u){var l=u.activeConversation,p=u.conversation,C=u.Preview,d=void 0===C?a:C,f=u.searchValue,x=u.conversationUpdateCount,I=r("TUIConversation").language,g=r("ConversationPreview"),j=g.setActiveConversation,y=g.myProfile,T=n(s(p)),P=T[0],U=T[1],w=n(v(p,f)),A=w[0],D=w[1],M=n(y&&m(p,y)),b=M[0],h=M[1],K=n(c(p,I)),V=K[0],k=K[1],q=n(p.unreadCount),z=q[0],B=q[1],E=(null==l?void 0:l.conversationID)===(null==p?void 0:p.conversationID);return d?(i((function(){D(v(p,f)),y&&h(m(p,y)),U(s(p)),k(c(p,I)),B(p.unreadCount)}),[p,f,x,I]),t(d,o({},u,{active:E,displayImage:P,displayTitle:A,displayMessage:b,displayTime:V,unread:z,setActiveConversation:j}))):t(e,{})}export{u as ConversationPreview};
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
2
  import { ConversationPreviewUIComponentProps } from './ConversationPreview.js';
3
3
 
4
+ interface IPluginsRef {
5
+ closeMore?: () => void;
6
+ }
4
7
  declare function unMemoConversationPreviewContent<T extends ConversationPreviewUIComponentProps>(props: T): React.ReactElement;
5
8
  declare const ConversationPreviewContent: typeof unMemoConversationPreviewContent;
6
9
 
7
- export { ConversationPreviewContent, unMemoConversationPreviewContent };
10
+ export { ConversationPreviewContent, IPluginsRef, unMemoConversationPreviewContent };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t,{useRef as i,useState as r,useEffect as a}from"react";import{useTranslation as c}from"react-i18next";import{TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import{isPC as l}from"../../utils/env.js";import{Avatar as m}from"../Avatar/Avatar.js";import{Icon as v}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{Plugins as d}from"../Plugins/index.js";import{useConversation as p}from"../../hooks/useConversation.js";import{useTUIKitContext as h}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function f(t){var f,C=t.conversation,I=t.Avatar,N=void 0===I?m:I,T=t.displayImage,x=t.displayTitle,g=t.displayMessage,w=t.displayTime,j=t.unread,b=t.active,y=t.activeConversationID,D=t.setActiveConversationID,P=t.setActiveConversation,k=c().t,M=i(null),U=h("ConversationPreviewContent"),A=U.chat,E=U.conversation,F=p(A),z=F.pinConversation,K=F.deleteConversation,L=b?"conversation-preview-content--active":"",O=j&&j>=1?"conversation-preview-content--unread":"",R=C.isPinned?"conversation-preview-content--pin":"",S=r(!1),q=S[0],B=S[1],G=i(null);a((function(){y!==C.conversationID&&B(!1)}),[y]);var H=function(e){if(!l){var n=C.conversationID;switch(D(n),e){case"touchstart":f=setTimeout(o,500);break;case"touchend":clearTimeout(f),setTimeout((function(){}),200)}}function o(){clearTimeout(f),B(!0)}},J=function(e,n){var o=C.conversationID,t=C.isPinned;switch(e.stopPropagation(),B(!1),G.current.closeMore(),n){case"pin":z({conversationID:o,isPinned:!t});break;case"delete":K(o),C===E&&P(null)}};return n("button",e({type:"button","aria-selected":b,role:"option",className:"conversation-preview-container ".concat(L," ").concat(O," ").concat(R),onClick:function(){s.switchConversation(null==C?void 0:C.conversationID),P&&P(C),(null==M?void 0:M.current)&&M.current.blur()},onMouseEnter:function(){B(!0)},onMouseLeave:function(){B(!1)},onTouchStart:function(){return H("touchstart")},onTouchEnd:function(){return H("touchend")},ref:M},{children:[o("div",e({className:"avatar"},{children:o(N,{image:T,name:x,size:40})})),n("div",e({className:"content"},{children:[o("div",e({className:"title text-ellipsis"},{children:x})),o("div",e({className:"message"},{children:g}))]})),n("div",e({className:"external"},{children:[o("div",j?e({className:"unread"},{children:j<=99?j:"99+"}):{className:"unread"}),o("div",q?e({className:"".concat(q?"more--hover":"more")},{children:o(d,{customClass:"more-handle-box",ref:G,plugins:[o("div",e({role:"presentation",className:"more-handle-item",onClick:function(e){J(e,"pin")}},{children:k(C.isPinned?"TUIConversation.Unpin":"TUIConversation.Pin")})),o("div",e({className:"more-handle-item",style:{color:"#FF584C"},onClick:function(e){J(e,"delete")},role:"presentation"},{children:k("TUIConversation.Delete")}))],showNumber:0,MoreIcon:o(v,{className:"icon-more",width:16,height:16,type:u.MORE})})}):e({className:"time"},{children:w}))]}))]}))}var C=t.memo(f);export{C as ConversationPreviewContent,f as unMemoConversationPreviewContent};
1
+ import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t,{useRef as i,useState as r,useEffect as a}from"react";import{useTranslation as c}from"react-i18next";import{TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import{isPC as l}from"../../utils/env.js";import{Avatar as m}from"../Avatar/Avatar.js";import{Icon as v}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{Plugins as d}from"../Plugins/index.js";import{useConversation as p}from"../../hooks/useConversation.js";import{useTUIKitContext as h}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function f(t){var f,C=t.conversation,I=t.Avatar,N=void 0===I?m:I,T=t.displayImage,x=t.displayTitle,g=t.displayMessage,w=t.displayTime,j=t.unread,b=t.active,y=t.activeConversationID,D=t.setActiveConversationID,M=t.setActiveConversation,P=c().t,k=i(null),U=h("ConversationPreviewContent"),A=U.chat,E=U.conversation,F=p(A),z=F.pinConversation,K=F.deleteConversation,L=b?"conversation-preview-content--active":"",O=j&&j>=1?"conversation-preview-content--unread":"",R=C.isPinned?"conversation-preview-content--pin":"",S=r(!1),q=S[0],B=S[1],G=i(null);a((function(){y!==C.conversationID&&B(!1)}),[y]);var H=function(e){if(!l){var n=C.conversationID;switch(D&&D(n),e){case"touchstart":f=setTimeout(o,500);break;case"touchend":clearTimeout(f),setTimeout((function(){}),200)}}function o(){clearTimeout(f),B(!0)}},J=function(e,n){var o,t=C.conversationID,i=C.isPinned;switch(e.stopPropagation(),B(!1),(null===(o=null==G?void 0:G.current)||void 0===o?void 0:o.closeMore)&&G.current.closeMore(),n){case"pin":z({conversationID:t,isPinned:!i});break;case"delete":K(t),M&&C===E&&M(void 0)}};return n("button",e({type:"button","aria-selected":b,role:"option",className:"conversation-preview-container ".concat(L," ").concat(O," ").concat(R),onClick:function(){s.switchConversation(null==C?void 0:C.conversationID),M&&M(C),(null==k?void 0:k.current)&&k.current.blur()},onMouseEnter:function(){B(!0)},onMouseLeave:function(){B(!1)},onTouchStart:function(){return H("touchstart")},onTouchEnd:function(){return H("touchend")},ref:k},{children:[o("div",e({className:"avatar"},{children:o(N,{image:T,name:x,size:40})})),n("div",e({className:"content"},{children:[o("div",e({className:"title text-ellipsis"},{children:x})),o("div",e({className:"message"},{children:g}))]})),n("div",e({className:"external"},{children:[o("div",j?e({className:"unread"},{children:j<=99?j:"99+"}):{className:"unread"}),o("div",q?e({className:"".concat(q?"more--hover":"more")},{children:o(d,{customClass:"more-handle-box",ref:G,plugins:[o("div",e({role:"presentation",className:"more-handle-item",onClick:function(e){J(e,"pin")}},{children:P(C.isPinned?"TUIConversation.Unpin":"TUIConversation.Pin")})),o("div",e({className:"more-handle-item",style:{color:"#FF584C"},onClick:function(e){J(e,"delete")},role:"presentation"},{children:P("TUIConversation.Delete")}))],showNumber:0,MoreIcon:o(v,{className:"icon-more",width:16,height:16,type:u.MORE})})}):e({className:"time"},{children:w}))]}))]}))}var C=t.memo(f);export{C as ConversationPreviewContent,f as unMemoConversationPreviewContent};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as r,jsx as a}from"react/jsx-runtime";import o from"@tencentcloud/chat";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as t,defaultUserAvatar as i}from"../Avatar/default.js";import{formatEmojiString as s}from"../TUIMessage/utils/emojiMap.js";import{getTimeStamp as c}from"../untils.js";var n=function(t,i,s){void 0===s&&(s="#147AFF");var c=u(t),n=c.name,l=c.nick,p=c.groupID,d=c.userID,m=t.type,f=t.remark,v="";switch(m){case o.TYPES.CONV_C2C:v=f||l||d;break;case o.TYPES.CONV_GROUP:v=n||p;break;default:v=""}var C,h;return i?(h=(C=v).toLocaleLowerCase().indexOf(i.toLocaleLowerCase()),r("div",{children:[a("span",{children:C.slice(0,h)}),a("span",e({style:{color:s}},{children:C.slice(h,h+i.length)})),a("span",{children:C.slice(h+i.length)})]})):v},l=function(e){var r=e.type,a=u(e).avatar,s=a;if(!a)switch(r){case o.TYPES.CONV_C2C:s=i;break;case o.TYPES.CONV_GROUP:default:s=t}return s},p=function(t,i,c){var n,l=t.lastMessage,p=t.type,u=l.fromAccount,d=l.nick,m=l.nameCard,f=l.isRevoked,v=l.messageForShow;l.type===o.TYPES.MSG_CUSTOM&&(null===(n=l.payload)||void 0===n?void 0:n.description)&&(v=l.payload.description);var C="";switch(p){case o.TYPES.CONV_GROUP:C=(null==l?void 0:l.fromAccount)===(null==i?void 0:i.userID)?"You":"".concat(m||d||u||""),C="".concat(C?"".concat(C,":"):"");break;case o.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[a("span",{children:C}),a("span",{children:l.isRevoked?"recalled a message":s(v,1)})]}))},u=function(e){if(!e)return null;var r={},a=e.type,t=e.groupProfile,i=e.userProfile;switch(a){case o.TYPES.CONV_C2C:r=i;break;case o.TYPES.CONV_GROUP:r=t;case o.TYPES.CONV_SYSTEM:}return r},d=function(e,r){var a=e.lastMessage;return c(1e3*a.lastTime,r)};export{l as getDisplayImage,p as getDisplayMessage,d as getDisplayTime,n as getDisplayTitle,u as getMessageProfile};
1
+ import{__assign as e}from"tslib";import{jsxs as r,jsx as a,Fragment as o}from"react/jsx-runtime";import t from"@tencentcloud/chat";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as i,defaultUserAvatar as s}from"../Avatar/default.js";import{formatEmojiString as c}from"../TUIMessage/utils/emojiMap.js";import{getTimeStamp as n}from"../untils.js";var l=function(i,s,c){void 0===c&&(c="#147AFF");var n=d(i),l=n.name,p=n.nick,u=n.groupID,m=n.userID,f=i.type,v=i.remark,C="";switch(f){case t.TYPES.CONV_C2C:C=v||p||m;break;case t.TYPES.CONV_GROUP:C=l||u;break;default:C=""}var h,O,P;return s?(O=(h=C).toLocaleLowerCase(),""===(P=s&&O.indexOf(s.toLocaleLowerCase()))?a(o,{}):r("div",{children:[a("span",{children:h.slice(0,P)}),a("span",e({style:{color:c}},{children:P&&h.slice(P,P+s.length)})),a("span",{children:P&&h.slice(P+s.length)})]})):C},p=function(e){var r=e.type,a=d(e).avatar,o=a;if(!a)switch(r){case t.TYPES.CONV_C2C:o=s;break;case t.TYPES.CONV_GROUP:default:o=i}return o},u=function(o,i,s){var n,l=o.lastMessage,p=o.type,u=l.fromAccount,d=l.nick,m=l.nameCard,f=l.isRevoked,v=l.messageForShow;l.type===t.TYPES.MSG_CUSTOM&&(null===(n=l.payload)||void 0===n?void 0:n.description)&&(v=l.payload.description);var C="";switch(p){case t.TYPES.CONV_GROUP:C=(null==l?void 0:l.fromAccount)===(null==i?void 0:i.userID)?"You":"".concat(m||d||u||""),C="".concat(C?"".concat(C,":"):"");break;case t.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[a("span",{children:C}),a("span",{children:l.isRevoked?"recalled a message":c(v,1)})]}))},d=function(e){if(!e)return null;var r={},a=e.type,o=e.groupProfile,i=e.userProfile;switch(a){case t.TYPES.CONV_C2C:r=i;break;case t.TYPES.CONV_GROUP:r=o;case t.TYPES.CONV_SYSTEM:}return r},m=function(e,r){var a=e.lastMessage;return n(1e3*a.lastTime,r)};export{p as getDisplayImage,u as getDisplayMessage,m as getDisplayTime,l as getDisplayTitle,d as getMessageProfile};
@@ -1,5 +1,6 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { InputProps } from '../Input/Input.js';
2
3
 
3
- declare function ConversationSearchInput(props: InputProps): JSX.Element;
4
+ declare function ConversationSearchInput(props: InputProps): react_jsx_runtime.JSX.Element;
4
5
 
5
6
  export { ConversationSearchInput };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{ConversationPreview as s}from"../ConversationPreview/ConversationPreview.js";import"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../utils/env.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as i}from"../Icon/type.js";import"@tencentcloud/chat";import"../../context/TUIMessageContext.js";import"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"date-fns";import"date-fns/locale";import"../../constants.js";import"../TUIMessage/hooks/useMessageReply.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import"../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../Switch/Switch.js";import"../TUIProfile/TUIProfileDefault.js";import"../../locales/index.js";function n(n){var a=n.result,c=n.searchValue,m=n.Preview;return t("div",{children:0===(null==a?void 0:a.length)?o("div",e({className:"conversation-search-result no-result"},{children:[t(r,{className:"no-result-icon",type:i.CRY,width:42,height:42}),t("span",e({className:"no-result-message"},{children:'No results for "'.concat(c,'"')}))]})):a.map((function(o){return t(s,e({searchValue:c},{conversation:o,Preview:m}),o.conversationID)}))})}export{n as ConversationSearchResult};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{ConversationPreview as s}from"../ConversationPreview/ConversationPreview.js";import"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../utils/env.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as i}from"../Icon/type.js";import"@tencentcloud/chat";import"../TUIKit/TUIKit.js";import"../../context/TUIMessageContext.js";import"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"date-fns";import"date-fns/locale";import"../../constants.js";import"../TUIMessage/hooks/useMessageReply.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import"../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../TUIProfile/TUIProfileDefault.js";function n(n){var a=n.result,m=n.searchValue,c=n.Preview;return t("div",{children:0===(null==a?void 0:a.length)?o("div",e({className:"conversation-search-result no-result"},{children:[t(r,{className:"no-result-icon",type:i.CRY,width:42,height:42}),t("span",e({className:"no-result-message"},{children:'No results for "'.concat(m,'"')}))]})):a.map((function(o){return t(s,e({searchValue:m},{conversation:o,Preview:c}),o.conversationID)}))})}export{n as ConversationSearchResult};
@@ -1,3 +1,4 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { PropsWithChildren } from 'react';
2
3
 
3
4
  interface DivWithEditProps {
@@ -9,8 +10,8 @@ interface DivWithEditProps {
9
10
  type?: string;
10
11
  isEdit?: boolean;
11
12
  toggle?: (name: string) => void;
12
- close?: () => void;
13
+ close: () => void;
13
14
  }
14
- declare function DivWithEdit<T extends DivWithEditProps>(props: PropsWithChildren<T>): JSX.Element;
15
+ declare function DivWithEdit<T extends DivWithEditProps>(props: PropsWithChildren<T>): react_jsx_runtime.JSX.Element;
15
16
 
16
17
  export { DivWithEdit };
@@ -1 +1 @@
1
- import{__assign as i}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o,useLayoutEffect as c}from"react";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Popup as m}from"../Popup/index.js";import{WithSelect as n}from"./WithSelect.js";import{WithText as a}from"./WithText.js";var l={text:a,select:n};function d(n){var d=n.value,p=n.className,h=n.classEditName,f=n.confirm,u=n.type,v=n.isEdit,N=n.toggle,j=n.children,w=n.name,x=n.close,I=o(d),g=I[0],y=I[1],E=l[u]||a;c((function(){y(d)}),[d]);return e("div",i({className:"div-with-edit ".concat(p)},{children:t(m,i({className:"div-with-edit-popup",show:!0,close:x},{children:[!v&&t("div",i({className:"show"},{children:[e("p",{children:g||"-"}),e("div",i({className:"icon"},{children:e(r,{className:"icon-edit",width:12,height:12,type:s.EDIT,onClick:function(){N(w)}})}))]})),v&&e(E,i({value:g,confirm:function(i){f({name:w,value:i})},className:h,close:x},{children:j}))]}))}))}export{d as DivWithEdit};
1
+ import{__assign as i}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o,useLayoutEffect as c}from"react";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Popup as m}from"../Popup/index.js";import{WithSelect as n}from"./WithSelect.js";import{WithText as a}from"./WithText.js";var l={text:a,select:n};function d(n){var d=n.value,p=n.className,h=n.classEditName,f=n.confirm,u=n.type,v=n.isEdit,N=n.toggle,j=n.children,w=n.name,x=n.close,I=o(d),g=I[0],y=I[1],E=l[u]||a;c((function(){y(d)}),[d]);return e("div",i({className:"div-with-edit ".concat(p)},{children:t(m,i({className:"div-with-edit-popup",show:!0,close:x},{children:[!v&&t("div",i({className:"show"},{children:[e("p",{children:g||"-"}),e("div",i({className:"icon"},{children:e(r,{className:"icon-edit",width:12,height:12,type:s.EDIT,onClick:function(){N&&w&&N(w)}})}))]})),v&&e(E,i({value:g,confirm:function(i){f&&f({name:w,value:i})},className:h,close:x},{children:j}))]}))}))}export{d as DivWithEdit};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useRef as r,useState as e,useLayoutEffect as i}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";function m(m){var u=m.value,l=m.confirm,f=m.className,s=r(),p=e(u),v=p[0],d=p[1];i((function(){var t;null===(t=null==s?void 0:s.current)||void 0===t||t.focus(),d(v)}),[s,u]);return o("div",t({className:"edit ".concat(f)},{children:[n("input",{ref:s,type:"text",value:v,onChange:function(t){d(t.target.value)}}),n(c,{className:"icon",width:15,height:10.5,type:a.CONFIRM,onClick:function(){l(v)}})]}))}export{m as WithText};
1
+ import{__assign as t}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useRef as r,useState as e,useLayoutEffect as i}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";function m(m){var u=m.value,l=m.confirm,f=m.className,s=r(),p=e(u),v=p[0],d=p[1];i((function(){var t;null===(t=null==s?void 0:s.current)||void 0===t||t.focus(),d(v)}),[s,u]);return o("div",t({className:"edit ".concat(f)},{children:[n("input",{ref:s,type:"text",value:v,onChange:function(t){d(t.target.value)}}),n(c,{className:"icon",width:15,height:10.5,type:a.CONFIRM,onClick:function(){l&&l(v)}})]}))}export{m as WithText};
@@ -1,10 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { PropsWithChildren } from 'react';
2
3
 
3
4
  interface EmptyStateIndicatorProps {
4
5
  /** List Type: conversation | message */
5
6
  listType?: 'conversation' | 'message' | 'chat';
6
7
  }
7
- declare function UnMemoizedEmptyStateIndicator<T extends EmptyStateIndicatorProps>(props: PropsWithChildren<T>): JSX.Element;
8
+ declare function UnMemoizedEmptyStateIndicator<T extends EmptyStateIndicatorProps>(props: PropsWithChildren<T>): react_jsx_runtime.JSX.Element | null;
8
9
  declare const EmptyStateIndicator: typeof UnMemoizedEmptyStateIndicator;
9
10
 
10
11
  export { EmptyStateIndicator, EmptyStateIndicatorProps };
@@ -1,3 +1,4 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
  import { IconTypes } from './type.js';
3
4
 
@@ -9,6 +10,6 @@ interface IconProps {
9
10
  onClick?: (event: React.BaseSyntheticEvent) => void;
10
11
  className?: string;
11
12
  }
12
- declare function Icon(props: React.PropsWithChildren<IconProps>): JSX.Element;
13
+ declare function Icon(props: React.PropsWithChildren<IconProps>): react_jsx_runtime.JSX.Element;
13
14
 
14
15
  export { Icon, IconProps, changeTypeToIconClassName };
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as i}from"react/jsx-runtime";import{ICON_CONFIG as n}from"./config.js";var o=function(t){var o=n[t].url||"";return i("img",{className:"icon-image icon-image-".concat(t),src:o,alt:t})},c=function(t){var i;return(null===(i=n[t])||void 0===i?void 0:i.className)||""};function r(n){var r=n.children,e=n.type,a=n.height,s=void 0===a?24:a,m=n.width,l=void 0===m?24:m,p=n.onClick,d=n.className,f=void 0===d?"":d,g={width:"string"==typeof l?l:"".concat(l,"px"),minWidth:"string"==typeof l?l:"".concat(l,"px"),height:"string"==typeof s?s:"".concat(s,"px"),minHeight:"string"==typeof s?s:"".concat(s,"px")};return i("div",t({className:"tui-kit-icon ".concat(c(e)," ").concat(f),role:"button",tabIndex:0,style:g,onClick:p},{children:r||o(e)}))}export{r as Icon,c as changeTypeToIconClassName};
1
+ import{__assign as t}from"tslib";import{jsx as i}from"react/jsx-runtime";import{ICON_CONFIG as n}from"./config.js";var o=function(t){var o=n[t].url||"";return i("img",{className:"icon-image icon-image-".concat(t),src:o,alt:t})},c=function(t){var i;return(null===(i=n[t])||void 0===i?void 0:i.className)||""};function r(n){var r=n.children,e=n.type,a=n.height,s=void 0===a?24:a,m=n.width,l=void 0===m?24:m,p=n.onClick,d=n.className,f=void 0===d?"":d,g={width:"string"==typeof l?l:"".concat(l,"px"),minWidth:"string"==typeof l?l:"".concat(l,"px"),height:"string"==typeof s?s:"".concat(s,"px"),minHeight:"string"==typeof s?s:"".concat(s,"px")};return i("div",t({className:"tui-kit-icon ".concat(e&&c(e)," ").concat(f),role:"button",tabIndex:0,style:g,onClick:p},{children:r||e&&o(e)}))}export{r as Icon,c as changeTypeToIconClassName};
@@ -1 +1 @@
1
- import i from"./images/more.png.js";import m from"./images/create.png.js";import s from"./images/clear.png.js";import r from"./images/search.png.js";import o from"./images/back.png.js";import a from"./images/emoji.png.js";import e from"./images/progress.png.js";import t from"./images/file.png.js";import n from"./images/add.png.js";import c from"./images/image.png.js";import l from"./images/video.png.js";import u from"./images/files.png.js";import g from"./images/star.png.js";import p from"./images/copy.png.js";import N from"./images/del.png.js";import f from"./images/forward.png.js";import k from"./images/reply.png.js";import j from"./images/close.png.js";import E from"./images/arrow-right.png.js";import d from"./images/right.png.js";import R from"./images/ellipse.png.js";import O from"./images/cancel.png.js";import I from"./images/arrow-down.png.js";import C from"./images/edit.png.js";import A from"./images/confirm.png.js";import v from"./images/camera.png.js";import D from"./images/quote.png.js";import L from"./images/revocation.png.js";import T from"./images/effort.png.js";import w from"./images/cry.png.js";import M from"./images/send.png.js";import U from"./images/owner.png.js";import y from"./images/living.png.js";import S from"./images/member.png.js";import h from"./images/like.png.js";import F from"./images/unlike.png.js";import V from"./images/liked.png.js";import G from"./images/unliked.png.js";import K from"./images/union.png.js";import W from"./images/ununion.png.js";import b from"./images/vector.png.js";import P from"./images/unvector.png.js";import H from"./images/voice.png.js";import Y from"./images/add-friend.svg.js";import{IconTypes as q}from"./type.js";var B,_=((B={})[q.MORE]={url:i,className:"tui-kit-icon-more"},B[q.CREATE]={url:m,className:"tui-kit-icon-create"},B[q.CLEAR]={url:s,className:"tui-kit-icon-clear"},B[q.SEARCH]={url:r,className:"tui-kit-icon-search"},B[q.BACK]={url:o,className:"tui-kit-icon-back"},B[q.EMOJI]={url:a,className:"tui-kit-icon-emoji"},B[q.PROGRESS]={url:e,className:"tui-kit-icon-progress"},B[q.FILE]={url:t,className:"tui-kit-icon-file"},B[q.ADD]={url:n,className:"tui-kit-icon-add"},B[q.IMAGE]={url:c,className:"tui-kit-icon-image"},B[q.VIDEO]={url:l,className:"tui-kit-icon-video"},B[q.DOCUMENT]={url:u,className:"tui-kit-icon-document"},B[q.STAR]={url:g,className:"tui-kit-icon-star"},B[q.COPY]={url:p,className:"tui-kit-icon-copy"},B[q.DEL]={url:N,className:"tui-kit-icon-del"},B[q.FORWARD]={url:f,className:"tui-kit-icon-forward"},B[q.REPLY]={url:k,className:"tui-kit-icon-reply"},B[q.CLOSE]={url:j,className:"tui-kit-icon-close"},B[q.ARROW_RIGHT]={url:E,className:"tui-kit-icon-arrow-right"},B[q.RIGHT]={url:d,className:"tui-kit-icon-right"},B[q.ELLIPSE]={url:R,className:"tui-kit-icon-ellipse"},B[q.CANCEL]={url:O,className:"tui-kit-icon-cancel"},B[q.ARROW_DOWN]={url:I,className:"tui-kit-icon-arrow-down"},B[q.EDIT]={url:C,className:"tui-kit-icon-edit"},B[q.CONFIRM]={url:A,className:"tui-kit-icon-confirm"},B[q.CAMERA]={url:v,className:"tui-kit-icon-camera"},B[q.QUOTE]={url:D,className:"tui-kit-icon-quote"},B[q.REVOCATION]={url:L,className:"tui-kit-icon-revocation"},B[q.EFFORT]={url:T,className:"tui-kit-icon-effort"},B[q.CRY]={url:w,className:"tui-kit-icon-cry"},B[q.OWNER]={url:U,className:"tui-kit-icon-owner"},B[q.SEND]={url:M,className:"tui-kit-icon-send"},B[q.LIVING]={url:y,className:"tui-kit-icon-living"},B[q.MEMBER]={url:S,className:"tui-kit-icon-member"},B[q.LIKE]={url:h,className:"tui-kit-icon-like"},B[q.UNLIKE]={url:F,className:"tui-kit-icon-unlike"},B[q.LIKED]={url:V,className:"tui-kit-icon-liked"},B[q.UNLIKED]={url:G,className:"tui-kit-icon-unliked"},B[q.UNION]={url:K,className:"tui-kit-icon-union"},B[q.UNUNION]={url:W,className:"tui-kit-icon-ununion"},B[q.VECTOR]={url:b,className:"tui-kit-icon-vector"},B[q.UNVECTOR]={url:P,className:"tui-kit-icon-unvector"},B[q.VOICE]={url:H,className:"tui-kit-icon-voice"},B[q.ADDFRIEND]={url:Y,className:"tui-kit-icon-add-friend"},B);export{_ as ICON_CONFIG};
1
+ import i from"./images/more.png.js";import s from"./images/clear.png.js";import m from"./images/search.png.js";import r from"./images/back.png.js";import o from"./images/emoji.png.js";import a from"./images/progress.png.js";import e from"./images/file.png.js";import t from"./images/add.png.js";import n from"./images/image.png.js";import c from"./images/video.png.js";import l from"./images/files.png.js";import u from"./images/star.png.js";import g from"./images/copy.png.js";import p from"./images/del.png.js";import N from"./images/forward.png.js";import f from"./images/reply.png.js";import k from"./images/close.png.js";import j from"./images/arrow-right.png.js";import E from"./images/right.png.js";import d from"./images/ellipse.png.js";import R from"./images/cancel.png.js";import O from"./images/arrow-down.png.js";import I from"./images/edit.png.js";import C from"./images/confirm.png.js";import A from"./images/camera.png.js";import v from"./images/quote.png.js";import D from"./images/revocation.png.js";import L from"./images/effort.png.js";import T from"./images/cry.png.js";import w from"./images/send.png.js";import M from"./images/owner.png.js";import U from"./images/living.png.js";import y from"./images/member.png.js";import S from"./images/like.png.js";import h from"./images/unlike.png.js";import F from"./images/liked.png.js";import V from"./images/unliked.png.js";import G from"./images/union.png.js";import K from"./images/ununion.png.js";import W from"./images/vector.png.js";import b from"./images/unvector.png.js";import P from"./images/voice.png.js";import H from"./images/add-friend.svg.js";import{IconTypes as Y}from"./type.js";var q,B=((q={})[Y.MORE]={url:i,className:"tui-kit-icon-more"},q[Y.CREATE]={url:H,className:"tui-kit-icon-create"},q[Y.CLEAR]={url:s,className:"tui-kit-icon-clear"},q[Y.SEARCH]={url:m,className:"tui-kit-icon-search"},q[Y.BACK]={url:r,className:"tui-kit-icon-back"},q[Y.EMOJI]={url:o,className:"tui-kit-icon-emoji"},q[Y.PROGRESS]={url:a,className:"tui-kit-icon-progress"},q[Y.FILE]={url:e,className:"tui-kit-icon-file"},q[Y.ADD]={url:t,className:"tui-kit-icon-add"},q[Y.IMAGE]={url:n,className:"tui-kit-icon-image"},q[Y.VIDEO]={url:c,className:"tui-kit-icon-video"},q[Y.DOCUMENT]={url:l,className:"tui-kit-icon-document"},q[Y.STAR]={url:u,className:"tui-kit-icon-star"},q[Y.COPY]={url:g,className:"tui-kit-icon-copy"},q[Y.DEL]={url:p,className:"tui-kit-icon-del"},q[Y.FORWARD]={url:N,className:"tui-kit-icon-forward"},q[Y.REPLY]={url:f,className:"tui-kit-icon-reply"},q[Y.CLOSE]={url:k,className:"tui-kit-icon-close"},q[Y.ARROW_RIGHT]={url:j,className:"tui-kit-icon-arrow-right"},q[Y.RIGHT]={url:E,className:"tui-kit-icon-right"},q[Y.ELLIPSE]={url:d,className:"tui-kit-icon-ellipse"},q[Y.CANCEL]={url:R,className:"tui-kit-icon-cancel"},q[Y.ARROW_DOWN]={url:O,className:"tui-kit-icon-arrow-down"},q[Y.EDIT]={url:I,className:"tui-kit-icon-edit"},q[Y.CONFIRM]={url:C,className:"tui-kit-icon-confirm"},q[Y.CAMERA]={url:A,className:"tui-kit-icon-camera"},q[Y.QUOTE]={url:v,className:"tui-kit-icon-quote"},q[Y.REVOCATION]={url:D,className:"tui-kit-icon-revocation"},q[Y.EFFORT]={url:L,className:"tui-kit-icon-effort"},q[Y.CRY]={url:T,className:"tui-kit-icon-cry"},q[Y.OWNER]={url:M,className:"tui-kit-icon-owner"},q[Y.SEND]={url:w,className:"tui-kit-icon-send"},q[Y.LIVING]={url:U,className:"tui-kit-icon-living"},q[Y.MEMBER]={url:y,className:"tui-kit-icon-member"},q[Y.LIKE]={url:S,className:"tui-kit-icon-like"},q[Y.UNLIKE]={url:h,className:"tui-kit-icon-unlike"},q[Y.LIKED]={url:F,className:"tui-kit-icon-liked"},q[Y.UNLIKED]={url:V,className:"tui-kit-icon-unliked"},q[Y.UNION]={url:G,className:"tui-kit-icon-union"},q[Y.UNUNION]={url:K,className:"tui-kit-icon-ununion"},q[Y.VECTOR]={url:W,className:"tui-kit-icon-vector"},q[Y.UNVECTOR]={url:b,className:"tui-kit-icon-unvector"},q[Y.VOICE]={url:P,className:"tui-kit-icon-voice"},q[Y.ADDFRIEND]={url:H,className:"tui-kit-icon-add-friend"},q);export{B as ICON_CONFIG};
@@ -1 +1 @@
1
- import{__assign as n}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import e,{useState as r,useRef as u,useImperativeHandle as i}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";var a=e.forwardRef((function(e,a){var d=e.className,f=void 0===d?"":d,s=e.customClassName,v=void 0===s?"":s,p=e.placeholder,m=e.clearable,b=void 0!==m&&m,h=e.prefix,x=e.suffix,g=e.onChange,k=e.onBlur,N=e.onFocus,y=e.onKeyDown,C=e.value,j=void 0===C?"":C,w=e.border,D=void 0===w?"":w,E=e.disabled,I=void 0!==E&&E,L=e.maxLength,B=void 0===L?void 0:L,F=r(!1),K=F[0],O=F[1],R=["Enter","NumpadEnter"],A=r(j),T=A[0],q=A[1],z=u(null),G=function(){z.current&&z.current.focus()};return i(a,(function(){return{focus:G,blur:function(){var n;null===(n=z.current)||void 0===n||n.blur()},input:z.current}})),t("div",n({className:"".concat(f," tui-kit-input-container")},{children:o("div",n({className:"tui-kit-input-box ".concat(D&&"tui-kit-input-border--".concat(D)," ").concat(K?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[h,t("input",{maxLength:B,disabled:I,className:"tui-kit-input ".concat(v),placeholder:p,ref:z,value:T,onFocus:function(n){O(!0),null==N||N(n)},onBlur:function(n){O(!1),null==k||k(n)},onChange:function(n){q(n.target.value),z.current&&(null==g||g(n))},onKeyDown:function(n){R.indexOf(null==n?void 0:n.key)>-1&&y&&(null==n||n.preventDefault(),y(n))}}),x,b&&T&&t(c,{type:l.CLEAR,height:13,width:13,onClick:function(n){q(""),G();var t=z.current.cloneNode(!0),o=Object.create(n,{target:{value:t},currentTarget:{value:t}});t.value="",null==g||g(o)}})]}))}))}));export{a as Input};
1
+ import{__assign as n}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import e,{useState as u,useRef as i,useImperativeHandle as r}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";var a=e.forwardRef((function(e,a){var d=e.className,v=void 0===d?"":d,f=e.customClassName,s=void 0===f?"":f,p=e.placeholder,m=e.clearable,b=void 0!==m&&m,h=e.prefix,x=e.suffix,g=e.onChange,k=e.onBlur,N=e.onFocus,y=e.onKeyDown,C=e.value,j=void 0===C?"":C,w=e.border,D=void 0===w?"":w,E=e.disabled,I=void 0!==E&&E,L=e.maxLength,B=void 0===L?void 0:L,F=u(!1),K=F[0],O=F[1],R=["Enter","NumpadEnter"],A=u(j),T=A[0],q=A[1],z=i(null),G=function(){z.current&&z.current.focus()};return r(a,(function(){return{focus:G,blur:function(){var n;null===(n=z.current)||void 0===n||n.blur()},input:z.current}})),t("div",n({className:"".concat(v," tui-kit-input-container")},{children:o("div",n({className:"tui-kit-input-box ".concat(D&&"tui-kit-input-border--".concat(D)," ").concat(K?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[h,t("input",{maxLength:B,disabled:I,className:"tui-kit-input ".concat(s),placeholder:p,ref:z,value:T,onFocus:function(n){O(!0),null==N||N(n)},onBlur:function(n){O(!1),null==k||k(n)},onChange:function(n){q(n.target.value),z.current&&(null==g||g(n))},onKeyDown:function(n){R.indexOf(null==n?void 0:n.key)>-1&&y&&(null==n||n.preventDefault(),y(n))}}),x,b&&T&&t(c,{type:l.CLEAR,height:13,width:13,onClick:function(n){!function(n){var t;q(""),G();var o=null===(t=null==z?void 0:z.current)||void 0===t?void 0:t.cloneNode(!0),e=Object.create(n,{target:{value:o},currentTarget:{value:o}});o.value="",null==g||g(e)}(n)}})]}))}))}));export{a as Input};
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  interface PopupProps {
4
4
  className?: string;
5
- onClick?: (e?: any) => void;
5
+ onClick?: (e: Event) => void;
6
6
  }
7
7
  declare function Model<T extends PopupProps>(props: React.PropsWithChildren<T>): React.ReactElement;
8
8
 
@@ -1 +1 @@
1
- import{__assign as r}from"tslib";import{jsx as o}from"react/jsx-runtime";function t(t){var e=t.className,n=t.onClick,c=t.children;return o("div",r({role:"button",tabIndex:0,className:"model ".concat(e),onClick:n},{children:c}))}export{t as Model};
1
+ import{__assign as r}from"tslib";import{jsx as n}from"react/jsx-runtime";function t(t){var o=t.className,e=t.onClick,c=t.children;return n("div",r({role:"button",tabIndex:0,className:"model ".concat(o),onClick:function(r){return e&&e(r)}},{children:c}))}export{t as Model};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import{forwardRef as t,useImperativeHandle as i,useRef as r,useState as l}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Popup as u}from"../Popup/index.js";import{usePluginsElement as a}from"./hooks/usePluginsElement.js";function m(t,m){var d=t.plugins,p=void 0===d?[]:d,h=t.showNumber,f=t.MoreIcon,g=t.className,v=void 0===g?"":g,N=t.style,b=t.customClass,w=void 0===b?"":b,x=t.root,y=t.handleVisible;i(m,(function(){return{closeMore:function(e){B(!1)}}}));var P=a({plugins:p,showNumber:h}),j=P.showPicker,I=P.elements,C=r(null),k=l(!1),E=k[0],B=k[1],D=function e(n){n.stopPropagation(),B(!E),E||C.current.offsetParent.removeEventListener("scroll",e)};return(j.length>0||(null==I?void 0:I.length)>0)&&n("ul",e({className:"plugin ".concat(v)},{children:[(null==j?void 0:j.length)>0&&j.map((function(n,t){var i="".concat(n).concat(t);return o("li",e({className:"plugin-item"},{children:n}),i)})),(null==I?void 0:I.length)>0&&n("div",e({className:"plugin-popup",ref:C},{children:[n("div",e({role:"menuitem",tabIndex:0,className:"more",onClick:D},{children:[!f&&o(c,{width:20,height:20,type:s.ADD}),f&&f]})),o(u,e({className:"plugin-popup-box ".concat(w),style:N,show:E,close:D,root:x,handleVisible:function(n){if(y){var o=C.current.children[1].getBoundingClientRect(),t=o.width,i=o.height,r=C.current.getBoundingClientRect(),l=r.x,c=void 0===l?0:l,s=r.y,u=void 0===s?0:s;C.current.offsetParent.addEventListener("scroll",D),y(e(e({},n),{width:t,height:i,x:c,y:u}))}}},{children:o("ul",{children:I.map((function(n,t){var i="".concat(n).concat(t);return o("li",e({className:"plugin-item"},{children:n}),i)}))})}))]}))]}))}var d=t(m);export{d as Plugins};
1
+ import{__assign as n}from"tslib";import{jsxs as o,jsx as e}from"react/jsx-runtime";import{forwardRef as i,useImperativeHandle as l,useRef as t,useState as r}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{Popup as s}from"../Popup/index.js";import{usePluginsElement as d}from"./hooks/usePluginsElement.js";function a(i,a){var m=i.plugins,v=void 0===m?[]:m,p=i.showNumber,h=i.MoreIcon,f=i.className,g=void 0===f?"":f,N=i.style,b=i.customClass,w=void 0===b?"":b,x=i.root,y=i.handleVisible;l(a,(function(){return{closeMore:function(n){B(!1)}}}));var P=d({plugins:v,showNumber:p}),j=P.showPicker,I=P.elements,C=t(null),k=r(!1),E=k[0],B=k[1],D=function n(o){var e,i;o.stopPropagation(),B(!E),E||null===(i=null===(e=null==C?void 0:C.current)||void 0===e?void 0:e.offsetParent)||void 0===i||i.removeEventListener("scroll",n)};return(j&&j.length>0||I&&(null==I?void 0:I.length)>0)&&o("ul",n({className:"plugin ".concat(g)},{children:[j&&(null==j?void 0:j.length)>0&&j.map((function(o,i){var l="".concat(o).concat(i);return e("li",n({className:"plugin-item"},{children:o}),l)})),I&&(null==I?void 0:I.length)>0&&o("div",n({className:"plugin-popup",ref:C},{children:[o("div",n({role:"menuitem",tabIndex:0,className:"more",onClick:D},{children:[!h&&e(c,{width:20,height:20,type:u.ADD}),h&&h]})),e(s,n({className:"plugin-popup-box ".concat(w),style:N,show:E,close:D,root:x,handleVisible:function(o){var e,i,l,t;if(y){var r=(null===(e=null==C?void 0:C.current)||void 0===e?void 0:e.children[1].getBoundingClientRect())||{},c=r.width,u=r.height,s=(null===(i=null==C?void 0:C.current)||void 0===i?void 0:i.getBoundingClientRect())||{},d=s.x,a=void 0===d?0:d,m=s.y,v=void 0===m?0:m;null===(t=null===(l=C.current)||void 0===l?void 0:l.offsetParent)||void 0===t||t.addEventListener("scroll",D),y(n(n({},o),{width:c,height:u,x:a,y:v}))}}},{children:e("ul",{children:I.map((function(o,i){var l="".concat(o).concat(i);return e("li",n({className:"plugin-item"},{children:o}),l)}))})}))]}))]}))}var m=i(a);export{m as Plugins};
@@ -4,7 +4,7 @@ interface PopupProps {
4
4
  className?: string;
5
5
  style?: any;
6
6
  show?: boolean;
7
- close?: (e: any) => void;
7
+ close: (e: any) => void;
8
8
  root?: any;
9
9
  handleVisible?: (isVisible: any) => void;
10
10
  }
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import{useRef as n,useState as o,useLayoutEffect as r}from"react";function i(i){var u=i.show,l=i.close,s=i.children,c=i.className,d=i.style,v=i.root,a=i.handleVisible,m=n(),p=o(!1),h=p[0],f=p[1];r((function(){var e,t;return u?(window.addEventListener("mouseup",l,!1),null===(e=null==m?void 0:m.current)||void 0===e||e.addEventListener("mouseup",w)):(window.removeEventListener("mouseup",l,!1),null===(t=null==m?void 0:m.current)||void 0===t||t.removeEventListener("mouseup",w)),function(){var e;window.removeEventListener("mouseup",l,!1),null===(e=null==m?void 0:m.current)||void 0===e||e.removeEventListener("mouseup",w)}}),[u]),r((function(){var t=new IntersectionObserver((function(t){var n=t[0],o=n.boundingClientRect,r=n.rootBounds,i=n.intersectionRatio,u=m.current.getBoundingClientRect()||{},l=(null==v?void 0:v.getBoundingClientRect())||{},s=e(e({},o),u),c=e(e({},r),l);a&&i<1&&a({left:s.left-s.width<c.left,top:s.bottom+s.height<c.bottom,width:s.width,height:s.height}),f(!0)}),{root:v,threshold:[1]});return m&&u&&t.observe(null==m?void 0:m.current),function(){t.disconnect(),f(!1)}}),[m,u]);var w=function(e){e.stopPropagation()};return u&&t("div",e({role:"button",tabIndex:0,style:d,className:"popup ".concat(c," ").concat(h&&"popup-show"),ref:m},{children:s}))}export{i as Popup};
1
+ import{__assign as e}from"tslib";import{jsx as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useState as r,useLayoutEffect as i}from"react";function u(u){var l=u.show,d=u.close,c=u.children,s=u.className,v=u.style,a=u.root,m=u.handleVisible,p=o(),h=r(!1),f=h[0],w=h[1];i((function(){var e,t;return l?(window.addEventListener("mouseup",d,!1),null===(e=null==p?void 0:p.current)||void 0===e||e.addEventListener("mouseup",b)):(window.removeEventListener("mouseup",d,!1),null===(t=null==p?void 0:p.current)||void 0===t||t.removeEventListener("mouseup",b)),function(){var e;window.removeEventListener("mouseup",d,!1),null===(e=null==p?void 0:p.current)||void 0===e||e.removeEventListener("mouseup",b)}}),[l]),i((function(){var t=new IntersectionObserver((function(t){var n,o=t[0],r=o.boundingClientRect,i=o.rootBounds,u=o.intersectionRatio,l=(null===(n=p.current)||void 0===n?void 0:n.getBoundingClientRect())||{},d=(null==a?void 0:a.getBoundingClientRect())||{},c=e(e({},r),l),s=e(e({},i),d);m&&u<1&&m({left:c.left-c.width<s.left,top:c.bottom+c.height<s.bottom,width:c.width,height:c.height}),w(!0)}),{root:a,threshold:[1]});return(null==p?void 0:p.current)&&l&&t.observe(null==p?void 0:p.current),function(){t.disconnect(),w(!1)}}),[p,l]);var b=function(e){e.stopPropagation()};return t(n,{children:l&&t("div",e({role:"button",tabIndex:0,style:v,className:"popup ".concat(s," ").concat(f&&"popup-show"),ref:p},{children:c}))})}export{u as Popup};
@@ -1,3 +1,4 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
 
3
4
  interface Props {
@@ -6,11 +7,6 @@ interface Props {
6
7
  checkedColor?: string;
7
8
  className?: string;
8
9
  }
9
- declare function Switch(props: Props): JSX.Element;
10
- declare namespace Switch {
11
- var defaultProps: {
12
- checkedColor: string;
13
- };
14
- }
10
+ declare function Switch(props: Props): react_jsx_runtime.JSX.Element;
15
11
 
16
12
  export { Switch };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as c,jsxs as r}from"react/jsx-runtime";import{useRef as t}from"react";import{creteNewId as o}from"./utils/newId.js";function s(s){var i=s.checked,l=s.onChange,a=s.checkedColor,n=s.className,m=t(o());return c("div",e({className:"self-ui-switch"},{children:r("label",e({style:{backgroundColor:i?a:void 0},className:"self-ui-switch-label ".concat(n),htmlFor:m.current},{children:[c("input",{checked:i,onChange:l,id:m.current,className:"self-ui-switch-input",type:"checkbox"}),c("span",{className:"self-ui-switch-button"})]}))}))}s.defaultProps={checkedColor:"#34C759"};export{s as Switch};
1
+ import{__assign as e}from"tslib";import{jsx as c,jsxs as t}from"react/jsx-runtime";import{useRef as r}from"react";import{creteNewId as i}from"./utils/newId.js";function s(s){var o=s.checked,l=s.onChange,a=s.checkedColor,n=void 0===a?"#34C759":a,m=s.className,u=r(i());return c("div",e({className:"self-ui-switch"},{children:t("label",e({style:{backgroundColor:o?n:void 0},className:"self-ui-switch-label ".concat(m),htmlFor:u.current},{children:[c("input",{checked:o,onChange:l,id:u.current,className:"self-ui-switch-input",type:"checkbox"}),c("span",{className:"self-ui-switch-button"})]}))}))}export{s as Switch};
@@ -1 +1 @@
1
- import{__assign as e,__awaiter as t,__generator as s}from"tslib";import o,{createElement as a,useReducer as n,useRef as i,useEffect as r,useMemo as u}from"react";import{jsx as c,jsxs as g,Fragment as m}from"react/jsx-runtime";import{TUIStore as p,StoreName as d,TUIChatService as l}from"@tencentcloud/chat-uikit-engine";import{JSONStringToParse as M}from"../untils.js";import{useTUIKitContext as I}from"../../context/TUIKitContext.js";import{TUIChatStateContextProvider as f}from"../../context/TUIChatStateContext.js";import{TUIChatActionProvider as h}from"../../context/TUIChatActionContext.js";import{ComponentProvider as v}from"../../context/ComponentContext.js";import T from"./hooks/useCreateTUIChatStateContext.js";import{TUIMessage as C}from"../TUIMessage/TUIMessage.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import{CONSTANT_DISPATCH_TYPE as U}from"../../constants.js";import{chatReducer as j,initialState as S}from"./TUIChatState.js";import{useHandleMessageList as x}from"./hooks/useHandleMessageList.js";import{useHandleMessage as L}from"./hooks/useHandleMessage.js";import{TUIChatHeader as E}from"../TUIChatHeader/TUIChatHeader.js";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"../../utils/env.js";import"../../context/TUIMessageContext.js";import{TUIMessageList as P}from"../TUIMessageList/TUIMessageList.js";import{TUIMessageInput as y}from"../TUIMessageInput/TUIMessageInput.js";import"react-i18next";import{EmptyStateIndicator as H}from"../EmptyStateIndicator/EmptyStateIndicator.js";function A(t){var s=t.conversation,o=t.EmptyPlaceholder,n=void 0===o?c(H,{listType:"chat"}):o,i=I("TUIChat"),r=i.conversation,u=i.chat,g=s||r;return(null==g?void 0:g.conversationID)?a(D,e({chat:u},t,{conversation:g,key:g.conversationID})):n}function D(o){var a=this,I=o.chat,H=o.conversation,A=o.className,D=o.children,k=o.TUIMessage,_=o.TUIChatHeader,R=o.TUIMessageInput,N=o.InputPlugins,w=o.MessagePlugins,F=o.MessageContext,G=o.MessageCustomPlugins,O=o.MessageTextPlugins,Q=o.InputQuote;o.onMessageRecevied,o.sendMessage;var V=o.revokeMessage;o.selectedConversation;var b=o.filterMessage,K=o.messageConfig,q=o.cloudCustomData,z=o.TUIMessageInputConfig,B=o.TUIMessageListConfig,J=n(j,e(e({},S),{conversation:H})),W=J[0],X=J[1],Y=i(null),Z=i(),$=T(e({chat:I,conversation:H,messageListRef:Y,textareaRef:Z,messageConfig:K,cloudCustomData:q,TUIMessageInputConfig:z,TUIMessageListConfig:B},W)),ee=x({chat:I,conversation:H,state:W,dispatch:X,filterMessage:b}),te=ee.editLocalMessage,se=ee.updateUploadPendingMessageList,oe=L({state:W,dispatch:X}),ae=oe.operateMessage,ne=oe.setAudioSource,ie=oe.setVideoSource,re=oe.setHighlightedMessageId,ue=oe.setActiveMessageID;r((function(){return p.watch(d.CHAT,{messageList:ce,isCompleted:ge}),function(){p.unwatch(d.CHAT,{messageList:ce,isCompleted:ge})}}),[]);var ce=function(e){var t=e.filter((function(e){return!e.isDeleted}));X({type:U.SET_MESSAGELIST,value:b?b(t):t})},ge=function(e){e&&X({type:U.SET_NO_MORE,value:e})},me=function(){return t(a,void 0,void 0,(function(){return s(this,(function(e){return l.getMessageList(),[2]}))}))},pe=function(e){return t(a,void 0,void 0,(function(){var t;return s(this,(function(s){return"TIMCustomElem"===e.type&&7===(null===(t=M(e.payload.data))||void 0===t?void 0:t.src)||W.firstSendMessage||X({type:U.SET_FIRST_SEND_MESSAGE,value:e}),[2]}))}))},de=u((function(){return{editLocalMessage:te,operateMessage:ae,loadMore:me,revokeMessage:V,setAudioSource:ne,setVideoSource:ie,setHighlightedMessageId:re,setActiveMessageID:ue,updateUploadPendingMessageList:se,setFirstSendMessage:pe}}),[te,ae,me,V,ne,ie,re,ue,se,pe]),le=u((function(){return{TUIMessage:k||C,MessageContext:F,InputPlugins:N,MessagePlugins:w,MessageCustomPlugins:G,MessageTextPlugins:O,TUIChatHeader:_,TUIMessageInput:R,InputQuote:Q}}),[]);return c("div",e({className:"chat ".concat(A)},{children:c(f,e({value:$},{children:c(h,e({value:de},{children:c(v,e({value:le},{children:D||g(m,{children:[c(E,{}),c(P,{}),c(y,{})]})}))}))}))}))}var k=o.memo(A);export{k as TUIChat};
1
+ import{__assign as e,__awaiter as t,__generator as s}from"tslib";import o,{createElement as a,useReducer as n,useRef as i,useEffect as r,useMemo as u}from"react";import{jsx as c,jsxs as g,Fragment as m}from"react/jsx-runtime";import{TUIStore as p,StoreName as d,TUIChatService as l}from"@tencentcloud/chat-uikit-engine";import{JSONStringToParse as M}from"../untils.js";import{useTUIKitContext as I}from"../../context/TUIKitContext.js";import{TUIChatStateContextProvider as f}from"../../context/TUIChatStateContext.js";import{TUIChatActionProvider as h}from"../../context/TUIChatActionContext.js";import{ComponentProvider as v}from"../../context/ComponentContext.js";import T from"./hooks/useCreateTUIChatStateContext.js";import{TUIMessage as C}from"../TUIMessage/TUIMessage.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import{CONSTANT_DISPATCH_TYPE as U}from"../../constants.js";import{chatReducer as j,initialState as S}from"./TUIChatState.js";import{useHandleMessageList as x}from"./hooks/useHandleMessageList.js";import{useHandleMessage as L}from"./hooks/useHandleMessage.js";import{TUIChatHeader as E}from"../TUIChatHeader/TUIChatHeader.js";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"../../utils/env.js";import"../../context/TUIMessageContext.js";import{TUIMessageList as P}from"../TUIMessageList/TUIMessageList.js";import{TUIMessageInput as y}from"../TUIMessageInput/TUIMessageInput.js";import"react-i18next";import{EmptyStateIndicator as H}from"../EmptyStateIndicator/EmptyStateIndicator.js";function A(t){var s=t.conversation,o=t.EmptyPlaceholder,n=void 0===o?c(H,{listType:"chat"}):o,i=I("TUIChat"),r=i.conversation,u=i.chat,g=s||r;return(null==g?void 0:g.conversationID)?a(D,e({chat:u},t,{conversation:g,key:g.conversationID})):n}function D(o){var a=this,I=o.chat,H=o.conversation,A=o.className,D=o.children,k=o.TUIMessage,_=o.TUIChatHeader,R=o.TUIMessageInput,N=o.InputPlugins,w=o.MessagePlugins,F=o.MessageContext,G=o.MessageCustomPlugins,O=o.MessageTextPlugins,Q=o.InputQuote;o.onMessageRecevied,o.sendMessage;var V=o.revokeMessage;o.selectedConversation;var b=o.filterMessage,K=o.messageConfig,q=o.cloudCustomData,z=o.TUIMessageInputConfig,B=o.TUIMessageListConfig,J=n(j,e(e({},S),{conversation:H})),W=J[0],X=J[1],Y=i(null),Z=i(),$=W&&T(e({chat:I,conversation:H,messageListRef:Y,textareaRef:Z,messageConfig:K,cloudCustomData:q,TUIMessageInputConfig:z,TUIMessageListConfig:B},W)),ee=x({chat:I,conversation:H,state:W,dispatch:X,filterMessage:b}),te=ee.editLocalMessage,se=ee.updateUploadPendingMessageList,oe=L({state:W,dispatch:X}),ae=oe.operateMessage,ne=oe.setAudioSource,ie=oe.setVideoSource,re=oe.setHighlightedMessageId,ue=oe.setActiveMessageID;r((function(){return p.watch(d.CHAT,{messageList:ce,isCompleted:ge}),function(){p.unwatch(d.CHAT,{messageList:ce,isCompleted:ge})}}),[]);var ce=function(e){var t=e.filter((function(e){return!e.isDeleted}));X({type:U.SET_MESSAGELIST,value:b?b(t):t})},ge=function(e){e&&X({type:U.SET_NO_MORE,value:e})},me=function(){return t(a,void 0,void 0,(function(){return s(this,(function(e){return l.getMessageList(),[2]}))}))},pe=function(e){return t(a,void 0,void 0,(function(){var t;return s(this,(function(s){return"TIMCustomElem"===e.type&&7===(null===(t=M(e.payload.data))||void 0===t?void 0:t.src)||W.firstSendMessage||X({type:U.SET_FIRST_SEND_MESSAGE,value:e}),[2]}))}))},de=u((function(){return{editLocalMessage:te,operateMessage:ae,loadMore:me,revokeMessage:V,setAudioSource:ne,setVideoSource:ie,setHighlightedMessageId:re,setActiveMessageID:ue,updateUploadPendingMessageList:se,setFirstSendMessage:pe}}),[te,ae,me,V,ne,ie,re,ue,se,pe]),le=u((function(){return{TUIMessage:k||C,MessageContext:F,InputPlugins:N,MessagePlugins:w,MessageCustomPlugins:G,MessageTextPlugins:O,TUIChatHeader:_,TUIMessageInput:R,InputQuote:Q}}),[]);return c("div",e({className:"chat ".concat(A)},{children:c(f,e({value:$},{children:c(h,e({value:de},{children:c(v,e({value:le},{children:D||g(m,{children:[c(E,{}),c(P,{}),c(y,{})]})}))}))}))}))}var k=o.memo(A);export{k as TUIChat};
@@ -1 +1 @@
1
- import{__assign as e,__spreadArray as s}from"tslib";import{CONSTANT_DISPATCH_TYPE as a}from"../../constants.js";import{handleUploadPendingMessage as t,handleEditMessage as r}from"./unitls.js";var E=function(E,S){switch(null==S?void 0:S.type){case a.SET_CONVERSATION_PRPFILE:return e(e({},E),{conversation:S.value});case a.SET_MESSAGELIST:return e(e({},E),{messageList:S.value});case a.SET_EDIT_MESSAGE:return e(e({},E),{messageList:s([],r(E.messageList,S.value),!0)});case a.SET_IS_COMPLETE:return e(e({},E),{isCompleted:S.value});case a.RESET:return e({},u);case a.SET_HIGH_LIGHTED_MESSAGE_ID:return e(e({},E),{highlightedMessageId:S.value});case a.OPERATE_MESSAGE:return e(e({},E),{operateData:e({},S.value)});case a.SET_NO_MORE:return e(e({},E),{noMore:S.value});case a.SET_AUDIO_SOURCE:return e(e({},E),{audioSource:S.value});case a.SET_VIDEO_SOURCE:return e(e({},E),{vidoeSource:S.value});case a.UPDATE_UPLOAD_PENDING_MESSAGE_LIST:return e(e({},E),{uploadPendingMessageList:s([],t(E.uploadPendingMessageList,S.value),!0)});case a.SET_FIRST_SEND_MESSAGE:return e(e({},E),{firstSendMessage:S.value});case a.SET_ACTIVE_MESSAGE_ID:return e(e({},E),{activeMessageID:S.value})}},u={conversation:{},messageList:[],nextReqMessageID:"",isCompleted:!1,init:!1,highlightedMessageId:"",lastMessageID:"",isSameLastMessageID:!1,operateData:{},noMore:!1,audioSource:null,vidoeSource:null,uploadPendingMessageList:[],firstSendMessage:null,activeMessageID:""};export{E as chatReducer,u as initialState};
1
+ import{__assign as e,__spreadArray as s}from"tslib";import{CONSTANT_DISPATCH_TYPE as a}from"../../constants.js";import{handleUploadPendingMessage as t,handleEditMessage as r}from"./unitls.js";var u=function(u,i){switch(null==i?void 0:i.type){case a.SET_CONVERSATION_PRPFILE:return e(e({},u),{conversation:i.value});case a.SET_MESSAGELIST:return e(e({},u),{messageList:i.value});case a.SET_EDIT_MESSAGE:return u.messageList&&i.value&&e(e({},u),{messageList:s([],r(u.messageList,i.value),!0)});case a.SET_IS_COMPLETE:return e(e({},u),{isCompleted:i.value});case a.RESET:return e({},E);case a.SET_HIGH_LIGHTED_MESSAGE_ID:return e(e({},u),{highlightedMessageId:i.value});case a.OPERATE_MESSAGE:return e(e({},u),{operateData:e({},i.value)});case a.SET_NO_MORE:return e(e({},u),{noMore:i.value});case a.SET_AUDIO_SOURCE:return e(e({},u),{audioSource:i.value});case a.SET_VIDEO_SOURCE:return e(e({},u),{vidoeSource:i.value});case a.UPDATE_UPLOAD_PENDING_MESSAGE_LIST:return(null==u?void 0:u.uploadPendingMessageList)&&i.value&&e(e({},u),{uploadPendingMessageList:s([],t(u.uploadPendingMessageList,i.value),!0)});case a.SET_FIRST_SEND_MESSAGE:return e(e({},u),{firstSendMessage:i.value});case a.SET_ACTIVE_MESSAGE_ID:return e(e({},u),{activeMessageID:i.value})}},E={conversation:{},messageList:[],nextReqMessageID:"",isCompleted:!1,init:!1,highlightedMessageId:"",lastMessageID:"",isSameLastMessageID:!1,operateData:{},noMore:!1,audioSource:null,vidoeSource:null,uploadPendingMessageList:[],firstSendMessage:null,activeMessageID:""};export{u as chatReducer,E as initialState};
@@ -1 +1 @@
1
- import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as t}from"../../../constants.js";function o(o){o.state;var E=o.dispatch;return{operateMessage:e((function(e){E({type:t.OPERATE_MESSAGE,value:e})}),[E]),setAudioSource:e((function(e){E({type:t.SET_AUDIO_SOURCE,value:e})}),[E]),setVideoSource:e((function(e){E({type:t.SET_VIDEO_SOURCE,value:e})}),[E]),setHighlightedMessageId:e((function(e){E({type:t.SET_HIGH_LIGHTED_MESSAGE_ID,value:e})}),[E]),setActiveMessageID:e((function(e){E({type:t.SET_ACTIVE_MESSAGE_ID,value:e})}),[E])}}export{o as useHandleMessage};
1
+ import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as t}from"../../../constants.js";function o(o){o.state;var E=o.dispatch;return{operateMessage:e((function(e){E&&E({type:t.OPERATE_MESSAGE,value:e})}),[E]),setAudioSource:e((function(e){E&&E({type:t.SET_AUDIO_SOURCE,value:e})}),[E]),setVideoSource:e((function(e){E&&E({type:t.SET_VIDEO_SOURCE,value:e})}),[E]),setHighlightedMessageId:e((function(e){E&&E({type:t.SET_HIGH_LIGHTED_MESSAGE_ID,value:e})}),[E]),setActiveMessageID:e((function(e){E&&E({type:t.SET_ACTIVE_MESSAGE_ID,value:e})}),[E])}}export{o as useHandleMessage};
@@ -1 +1 @@
1
- import{useCallback as t}from"react";import{CONSTANT_DISPATCH_TYPE as e}from"../../../constants.js";function a(a){a.chat,a.conversation,a.state;var n=a.dispatch;return a.filterMessage,{editLocalMessage:t((function(t){n({type:e.SET_EDIT_MESSAGE,value:t})}),[n]),updateUploadPendingMessageList:t((function(t){n({type:e.UPDATE_UPLOAD_PENDING_MESSAGE_LIST,value:t})}),[n])}}export{a as useHandleMessageList};
1
+ import{useCallback as t}from"react";import{CONSTANT_DISPATCH_TYPE as e}from"../../../constants.js";function a(a){a.chat,a.conversation,a.state;var n=a.dispatch;return a.filterMessage,{editLocalMessage:t((function(t){n&&n({type:e.SET_EDIT_MESSAGE,value:t})}),[n]),updateUploadPendingMessageList:t((function(t){n&&n({type:e.UPDATE_UPLOAD_PENDING_MESSAGE_LIST,value:t})}),[n])}}export{a as useHandleMessageList};
@@ -1 +1 @@
1
- import{__spreadArray as n}from"tslib";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import"react/jsx-runtime";import"react";import"../Icon/config.js";import"../Icon/type.js";var t=function(t,o){var r=n([],t,!0),i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r},o=function(t,o){var r=n([],t,!0);r.some((function(n){return n.ID===o.ID}))||r.push(o);var i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r};export{t as handleEditMessage,o as handleUploadPendingMessage};
1
+ import{__spreadArray as n}from"tslib";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import"react/jsx-runtime";import"react";import"../Icon/config.js";import"../Icon/type.js";var t=function(t,o){var r=n([],t,!0),i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r},o=function(t,o){var r=n([],t,!0);r.some((function(n){return n.ID===(null==o?void 0:o.ID)}))||r.push(o);var i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r};export{t as handleEditMessage,o as handleUploadPendingMessage};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import r,{useState as a,useEffect as o}from"react";import n from"@tencentcloud/chat";import{TUIConversationService as c}from"@tencentcloud/chat-uikit-engine";import{Avatar as l}from"../Avatar/Avatar.js";import{handleDisplayAvatar as s}from"../untils.js";import{isH5 as m}from"../../utils/env.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as h}from"../Icon/type.js";import{useTUIKitContext as u}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function v(r){var v=r.title,p=void 0===v?"":v,f=r.avatar;r.isOnline;var S=r.conversation,C=r.isLive,N=r.opateIcon,g=a(p),T=g[0],E=g[1],I=a(""),P=I[0],y=I[1];o((function(){switch(E(p),f&&y(f),null==S?void 0:S.type){case n.TYPES.CONV_C2C:O(S.userProfile,null==S?void 0:S.remark);break;case n.TYPES.CONV_GROUP:Y(S.groupProfile);break;case n.TYPES.CONV_SYSTEM:E("System Notice");break;default:E("")}}),[S]);var O=function(e,i){T||E(i||(null==e?void 0:e.nick)||(null==e?void 0:e.userID)),f||y(t(l,{size:32,image:s(e.avatar)}))},Y=function(e){T||E((null==e?void 0:e.name)||(null==e?void 0:e.groupID)),f||y(t(l,{size:32,image:s(e.avatar,n.TYPES.CONV_GROUP)}))},j=u().setTUIManageShow;return i("header",e({className:"tui-chat-header ".concat(C?"tui-chat-live-header":"")},{children:[m&&t("div",e({style:{paddingRight:"10px"}},{children:t(d,{onClick:function(){c.switchConversation("")},type:h.BACK,width:9,height:16})})),t("div",e({className:"tui-chat-header-left ".concat((null==S?void 0:S.type)===n.TYPES.CONV_SYSTEM?"system":"")},{children:(null==S?void 0:S.type)!==n.TYPES.CONV_SYSTEM&&P})),t("div",e({className:"header-content"},{children:t("h3",e({className:"title"},{children:T}))})),t("div",e({className:"tui-chat-header-right"},{children:t("div",e({className:"header-handle"},{children:N||t(d,{className:"header-handle-more",onClick:function(){j(!0)},type:h.ELLIPSE,width:18,height:5})}))}))]}),null==S?void 0:S.conversationID)}var p=r.memo(v);function f(i){var r=e({},i);return t(p,e({},r))}export{f as TUIChatHeaderDefault};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import a,{useState as o,useEffect as r}from"react";import n from"@tencentcloud/chat";import{TUIConversationService as c}from"@tencentcloud/chat-uikit-engine";import{Avatar as l}from"../Avatar/Avatar.js";import{handleDisplayAvatar as s}from"../untils.js";import{isH5 as m}from"../../utils/env.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as h}from"../Icon/type.js";import{useTUIKitContext as u}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function v(a){var v=a.title,p=void 0===v?"":v,f=a.avatar;a.isOnline;var C=a.conversation,S=a.isLive,N=a.opateIcon,T=u("TUIContact").setActiveContact,g=o(p),I=g[0],E=g[1],P=o(""),y=P[0],O=P[1];r((function(){switch(E(p),f&&O(f),null==C?void 0:C.type){case n.TYPES.CONV_C2C:Y(C.userProfile,null==C?void 0:C.remark);break;case n.TYPES.CONV_GROUP:j(C.groupProfile);break;case n.TYPES.CONV_SYSTEM:E("System Notice");break;default:E("")}}),[C]);var Y=function(e,i){I||E(i||(null==e?void 0:e.nick)||(null==e?void 0:e.userID)),f||O(t(l,{size:32,image:s(e.avatar)}))},j=function(e){I||E((null==e?void 0:e.name)||(null==e?void 0:e.groupID)),f||O(t(l,{size:32,image:s(e.avatar,n.TYPES.CONV_GROUP)}))},k=u().setTUIManageShow;return i("header",e({className:"tui-chat-header ".concat(S?"tui-chat-live-header":"")},{children:[m&&t("div",e({style:{paddingRight:"10px"}},{children:t(d,{onClick:function(){c.switchConversation(""),T()},type:h.BACK,width:9,height:16})})),t("div",e({className:"tui-chat-header-left ".concat((null==C?void 0:C.type)===n.TYPES.CONV_SYSTEM?"system":"")},{children:(null==C?void 0:C.type)!==n.TYPES.CONV_SYSTEM&&y})),t("div",e({className:"header-content"},{children:t("h3",e({className:"title"},{children:I}))})),t("div",e({className:"tui-chat-header-right"},{children:t("div",e({className:"header-handle"},{children:N||t(d,{className:"header-handle-more",onClick:function(){k&&k(!0)},type:h.ELLIPSE,width:18,height:5})}))}))]}),null==C?void 0:C.conversationID)}var p=a.memo(v);function f(i){var a=e({},i);return t(p,e({},a))}export{f as TUIChatHeaderDefault};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as i,jsxs as o,Fragment as c}from"react/jsx-runtime";import e,{useState as n,useMemo as r}from"react";import{useTranslation as s}from"react-i18next";import{TUIContactContextProvider as a}from"../../context/TUIContactContext.js";import{useTUIKitContext as m}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import d from"./hooks/useTUIContact.js";import{TUIContactList as l}from"./TUIContactList/TUIContactList.js";import{TUIContactSearch as h}from"../TUIContactSearch/TUIContactSearch.js";import{Icon as f}from"../Icon/Icon.js";import{IconTypes as p}from"../Icon/type.js";function C(e){var C=e.children,u=s().t,I=m("TUIContact").setActiveContact,L=n(!1),T=L[0],U=L[1],j=d(),v=j.friendList,x=j.blockList,k=j.blocklistProfile,w=j.friendApplicationList,A=j.isShowContactList,N=j.setShowContactList,S=r((function(){return{friendList:v,blockList:x,blocklistProfile:k,friendApplicationList:w,isShowContactList:A,setShowContactList:N}}),[v,k,w,A,N]);return i(a,t({value:S},{children:C||o("div",t({className:"tui-contacts"},{children:[!T&&o(c,{children:[o("div",t({className:"tui-contacts-header"},{children:[i("div",t({className:"tui-contact-input"},{children:i(h,{})})),i(f,{onClick:function(){I(),U(!0)},type:p.ADDFRIEND,width:24,height:24})]})),i(l,{})]}),T&&o(c,{children:[o("div",t({className:"tui-contacts-add-header"},{children:[i(f,{onClick:function(){I(),U(!1)},type:p.BACK,width:9,height:16}),i("div",t({className:"tui-contacts-add-header-title"},{children:u("TUIContact.Add Friend")}))]})),i(h,{})]})]}))}))}var u=e.memo(C);export{u as TUIContact,C as UnMemoizedTUIContact};
1
+ import{__assign as t}from"tslib";import{jsx as i,jsxs as o,Fragment as c}from"react/jsx-runtime";import n,{useState as e,useMemo as r}from"react";import{useTranslation as s}from"react-i18next";import{TUIContactContextProvider as a}from"../../context/TUIContactContext.js";import{isH5 as m}from"../../utils/env.js";import{useTUIKitContext as d}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import l from"./hooks/useTUIContact.js";import{TUIContactList as h}from"./TUIContactList/TUIContactList.js";import{TUIContactSearch as f}from"../TUIContactSearch/TUIContactSearch.js";import{Icon as p}from"../Icon/Icon.js";import{IconTypes as C}from"../Icon/type.js";function u(n){var u=n.children,I=s().t,L=d("TUIContact").setActiveContact,j=e(!1),v=j[0],T=j[1],U=l(),x=U.friendList,k=U.blockList,w=U.blocklistProfile,A=U.friendApplicationList,N=U.isShowContactList,S=U.setShowContactList,b=r((function(){return{friendList:x,blockList:k,blocklistProfile:w,friendApplicationList:A,isShowContactList:N,setShowContactList:S}}),[x,w,A,N,S]);return i(a,t({value:b},{children:u||o("div",t({className:"tui-contacts ".concat(m?"tui-contacts-h5":""," ")},{children:[!v&&o(c,{children:[o("div",t({className:"tui-contacts-header"},{children:[i("div",t({className:"tui-contact-input"},{children:i(f,{})})),i(p,{onClick:function(){L(),T(!0)},type:C.ADDFRIEND,width:24,height:24})]})),i(h,{})]}),v&&o(c,{children:[o("div",t({className:"tui-contacts-add-header"},{children:[i(p,{onClick:function(){L(),T(!1)},type:C.BACK,width:9,height:16}),i("div",t({className:"tui-contacts-add-header-title"},{children:I("TUIContact.Add Friend")}))]})),i(f,{})]})]}))}))}var I=n.memo(u);export{I as TUIContact,u as UnMemoizedTUIContact};
@@ -1 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as t,Fragment as i,jsxs as n}from"react/jsx-runtime";import r from"react";import{useTUIKitContext as e}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{FriendInfo as l}from"./friendInfo.js";import{BlockInfo as a}from"./blockInfo.js";import{AddFriendInfo as d}from"./addFriendInfo.js";import{FriendApplicationInfo as p}from"./friendApplication.js";function m(r){var m=r.showChat,f=e("TUIContact").contactData;return(null==f?void 0:f.type)?n("div",o({className:"tui-contact-info"},{children:["addFriend"===(null==f?void 0:f.type)&&t(d,{profile:null==f?void 0:f.data}),"friend"===(null==f?void 0:f.type)&&t(l,{openChat:m,friend:null==f?void 0:f.data}),"block"===(null==f?void 0:f.type)&&t(a,{profile:null==f?void 0:f.data}),"friendApplication"===(null==f?void 0:f.type)&&t(p,{application:null==f?void 0:f.data})]})):t(i,{children:" "})}var f=r.memo(m);export{f as TUIContactInfo,m as UnMemoizedTUIContactInfo};
1
+ import{__assign as o}from"tslib";import{jsx as t,Fragment as i,jsxs as n}from"react/jsx-runtime";import r from"react";import{useTUIKitContext as e}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{isH5 as a}from"../../../utils/env.js";import{FriendInfo as l}from"./friendInfo.js";import{BlockInfo as d}from"./blockInfo.js";import{AddFriendInfo as p}from"./addFriendInfo.js";import{FriendApplicationInfo as m}from"./friendApplication.js";function c(r){var c=r.showChat,f=e("TUIContact").contactData;return(null==f?void 0:f.type)?n("div",o({className:"tui-contact-info ".concat(a?"tui-contact-info-h5":""," ")},{children:["addFriend"===(null==f?void 0:f.type)&&t(p,{profile:null==f?void 0:f.data}),"friend"===(null==f?void 0:f.type)&&t(l,{openChat:c,friend:null==f?void 0:f.data}),"block"===(null==f?void 0:f.type)&&t(d,{profile:null==f?void 0:f.data}),"friendApplication"===(null==f?void 0:f.type)&&t(m,{application:null==f?void 0:f.data})]})):t(i,{children:" "})}var f=r.memo(c);export{f as TUIContactInfo,c as UnMemoizedTUIContactInfo};
@@ -1 +1 @@
1
- import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as c}from"react/jsx-runtime";import r,{useState as a}from"react";import{useTranslation as m}from"react-i18next";import l from"./hooks/useContactInfo.js";import{BasicInfo as s}from"./basicInfo.js";import{DivWithEdit as d}from"../../DivWithEdit/DivWithEdit.js";function f(r){var f=this,u=r.profile,h=u.userID,v=m().t,p=a(""),N=p[0],b=p[1],x=a(""),I=x[0],g=x[1],k=a(""),C=k[0],j=k[1],w=a(!1),D=w[0],E=w[1],T=l().addFriend;return i(o,{children:[c(s,{profile:u}),D?c("div",t({className:"tui-contact-info-content"},{children:i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.verification info")})),c("p",t({className:"content-item-text"},{children:C}))]}))})):i("div",t({className:"tui-contact-info-content"},{children:[i("div",t({className:"content-item-wording"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.Enter the verification info")})),c("textarea",{className:"content-item-wording-text",value:C,onChange:function(t){j(t.target.value)}})]})),i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.remark")})),c(d,{name:"remark",className:"content-item-text",value:I,type:"text",toggle:function(){b("remark")},isEdit:"remark"===N,confirm:function(t){g(null==t?void 0:t.value),b("")},close:function(){b("")}})]})),c("div",t({className:"content-btn-container"},{children:c("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(f,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,T({userID:h,remark:I,wording:C})];case 1:return t.sent(),E(!0),[2]}}))}))}},{children:v("TUIContact.Send application")}))}))]}))]})}var u=r.memo(f);export{u as AddFriendInfo,f as UnMemoizedAddFriendInfo};
1
+ import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as c}from"react/jsx-runtime";import r,{useState as a}from"react";import{useTranslation as m}from"react-i18next";import l from"./hooks/useContactInfo.js";import{BasicInfo as s}from"./basicInfo.js";import{DivWithEdit as d}from"../../DivWithEdit/DivWithEdit.js";function f(r){var f=this,u=r.profile,h=u.userID,v=m().t,p=a(""),N=p[0],b=p[1],x=a(""),I=x[0],g=x[1],k=a(""),C=k[0],j=k[1],w=a(!1),D=w[0],E=w[1],T=l().addFriend;return i(o,{children:[c(s,{profile:u}),D?c("div",t({className:"tui-contact-info-content"},{children:i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.verification info")})),c("p",t({className:"content-item-text"},{children:C}))]}))})):i("div",t({className:"tui-contact-info-content"},{children:[i("div",t({className:"content-item-wording"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.Enter the verification info")})),c("textarea",{className:"content-item-wording-text",value:C,onChange:function(t){!function(t){j(t.target.value)}(t)}})]})),i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.remark")})),c(d,{name:"remark",className:"content-item-text",value:I,type:"text",toggle:function(){b("remark")},isEdit:"remark"===N,confirm:function(t){g(null==t?void 0:t.value),b("")},close:function(){b("")}})]})),c("div",t({className:"content-btn-container"},{children:c("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(f,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,T({userID:h,remark:I,wording:C})];case 1:return t.sent(),E(!0),[2]}}))}))}},{children:v("TUIContact.Send application")}))}))]}))]})}var u=r.memo(f);export{u as AddFriendInfo,f as UnMemoizedAddFriendInfo};
@@ -1 +1 @@
1
- import{__assign as a}from"tslib";import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"react";import{useTranslation as i}from"react-i18next";import{Avatar as n}from"../../Avatar/Avatar.js";import{defaultUserAvatar as c}from"../../Avatar/default.js";function o(t){var o=t.profile,m=i().t,d=o.userID,s=o.nick,l=o.selfSignature,v=o.avatar;return e("div",a({className:"tui-contact-info-header"},{children:r("div",a({className:"header-container"},{children:[r("div",a({className:"header-container-avatar"},{children:[e(n,{size:60,image:v||c}),e("div",a({className:"header-container-name"},{children:s||d}))]})),e("div",a({className:"header-container-text"},{children:"ID:".concat(d)})),r("div",a({className:"header-container-text"},{children:[m("TUIContact.Signature"),":",l||""]}))]}))}))}var m=t.memo(o);export{m as BasicInfo,o as UnMemoizedBasicInfo};
1
+ import{__assign as t}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import a from"react";import{useTranslation as i}from"react-i18next";import{TUIConversationService as o}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as n}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{Icon as c}from"../../Icon/Icon.js";import{IconTypes as m}from"../../Icon/type.js";import{isH5 as s}from"../../../utils/env.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as l}from"../../Avatar/default.js";function f(a){var f=a.profile,h=i().t,p=f.userID,v=f.nick,u=f.selfSignature,x=f.avatar,I=n("TUIContact").setActiveContact;return e("div",t({className:"tui-contact-info-header"},{children:[s&&r(c,{width:9,height:16,type:m.BACK,onClick:function(){o.switchConversation(""),I()}}),e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[r(d,{size:60,image:x||l}),r("div",t({className:"header-container-name"},{children:v||p}))]})),r("div",t({className:"header-container-text"},{children:"ID:".concat(p)})),e("div",t({className:"header-container-text"},{children:[h("TUIContact.Signature"),":",u||""]}))]}))]}))}var h=a.memo(f);export{h as BasicInfo,f as UnMemoizedBasicInfo};
@@ -1 +1 @@
1
- import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as o,Fragment as i,jsx as r}from"react/jsx-runtime";import c,{useState as a,useEffect as s}from"react";import{useTranslation as m}from"react-i18next";import{TUIConversationService as l}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as u}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as d}from"./basicInfo.js";import{Switch as f}from"../../Switch/Switch.js";import h from"./hooks/useContactInfo.js";import{DivWithEdit as v}from"../../DivWithEdit/DivWithEdit.js";import{useConversation as p}from"../../../hooks/useConversation.js";function C(c){var C=this,b=u("TUIContact"),k=b.chat,I=b.contactData,x=b.setActiveContact,N=b.setActiveConversation,j=m().t,T=c.friend,U=c.openChat,g=T.userID,w=T.profile,D=T.remark,E=a(""),S=E[0],A=E[1],F=a(""),M=F[0],W=F[1],y=a(!1),B=y[0],K=y[1],q=h(),z=q.addToBlocklist,G=q.deleteFriend,H=p(k).createConversation;s((function(){K(!1),W(D)}),[I,D]);return o(i,{children:[r(d,{profile:w}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.remark")})),r(v,{name:"remark",className:"content-item-text",value:M,type:"text",toggle:function(){A("remark")},isEdit:"remark"===S,confirm:function(t){k.updateFriend({userID:g,remark:null==t?void 0:t.value}),W(null==t?void 0:t.value),A("")},close:function(){A("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.block")})),r(f,{className:"content-item-text",onChange:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(g)];case 1:return t.sent(),K(!0),x(),[2]}}))}))},checked:B})]})),o("div",t({className:"content-btn-container"},{children:[r("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,G(g)];case 1:return t.sent(),x(),[2]}}))}))}},{children:j("TUIContact.Delete friend")})),r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){var t,e;return n(this,(function(n){switch(n.label){case 0:return t="C2C".concat(g),[4,H(t)];case 1:return e=n.sent(),l.switchConversation(t),N(e),U(),[2]}}))}))}},{children:j("TUIContact.Send Message")}))]}))]}))]})}var b=c.memo(C);export{b as FriendInfo,C as UnMemoizedFriendInfo};
1
+ import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as o,Fragment as i,jsx as r}from"react/jsx-runtime";import c,{useState as a,useEffect as s}from"react";import{useTranslation as m}from"react-i18next";import{TUIConversationService as l}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as u}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as d}from"./basicInfo.js";import{Switch as f}from"../../Switch/Switch.js";import h from"./hooks/useContactInfo.js";import{DivWithEdit as v}from"../../DivWithEdit/DivWithEdit.js";import{useConversation as p}from"../../../hooks/useConversation.js";function C(c){var C=this,b=u("TUIContact"),k=b.chat,I=b.contactData,x=b.setActiveContact,N=b.setActiveConversation,j=m().t,T=c.friend,U=c.openChat,g=T.userID,w=T.profile,D=T.remark,E=a(""),S=E[0],A=E[1],F=a(""),M=F[0],W=F[1],y=a(!1),B=y[0],K=y[1],q=h(),z=q.addToBlocklist,G=q.deleteFriend,H=p(k).createConversation;s((function(){K(!1),W(D)}),[I,D]);return o(i,{children:[r(d,{profile:w}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.remark")})),r(v,{name:"remark",className:"content-item-text",value:M,type:"text",toggle:function(){A("remark")},isEdit:"remark"===S,confirm:function(t){k.updateFriend({userID:g,remark:null==t?void 0:t.value}),W(null==t?void 0:t.value),A("")},close:function(){A("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.block")})),r(f,{className:"content-item-text",onChange:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(g)];case 1:return t.sent(),K(!0),x(),[2]}}))}))},checked:B})]})),o("div",t({className:"content-btn-container"},{children:[r("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,G(g)];case 1:return t.sent(),x(),[2]}}))}))}},{children:j("TUIContact.Delete friend")})),r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){var t,e;return n(this,(function(n){switch(n.label){case 0:return t="C2C".concat(g),[4,H(t)];case 1:return e=n.sent(),l.switchConversation(t),N(e),U&&U(),[2]}}))}))}},{children:j("TUIContact.Send Message")}))]}))]}))]})}var b=c.memo(C);export{b as FriendInfo,C as UnMemoizedFriendInfo};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import c,{useState as a}from"react";import{useTranslation as e}from"react-i18next";import o from"@tencentcloud/chat";import{useTUIKitContext as s}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as r}from"../../../context/TUIContactContext.js";import l from"../TUIContactInfo/hooks/useContactInfo.js";import{Avatar as m}from"../../Avatar/Avatar.js";import{defaultUserAvatar as d}from"../../Avatar/default.js";import u from"../../Icon/images/right-arrow.svg.js";import p from"../../Icon/images/down-arrow.png.js";function f(){var c=s().setActiveContact,f=e().t,v=r("TUIContactList"),N=v.isShowContactList,I=v.friendList,h=v.blocklistProfile,C=v.friendApplicationList,x=l().acceptFriendApplication,b=a(!1),g=b[0],T=b[1],k=a(!1),A=k[0],U=k[1],j=a(!1),P=j[0],S=j[1];return N&&i("div",t({className:"tui-contacts-list"},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return T(!g)}},{children:[n("p",t({className:"tui-contacts-list-title"},{children:f("TUIContact.New Contacts")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:g?p:u,alt:""})}))]})),g&&C.map((function(a,e){var s=a.userID,r=a.avatar,l=a.nick,u=a.wording,p=a.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),c({type:"friendApplication",data:a})}},{children:[n(m,{size:30,image:r||d}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[n("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||s})),""!==u&&n("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:u}))]}),p===o.TYPES.SNS_APPLICATION_SENT_BY_ME&&n("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:f("TUIContact.waiting for verification")})),p===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&n("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),x(i),c()}(t,s)}},{children:f("TUIContact.Agree")}))]}))]}),s)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return S(!P)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:f("TUIContact.Blocked List")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:P?p:u,alt:""})}))]})),P&&h.map((function(a,e){var o=a.userID,s=a.avatar,r=a.nick;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){c({type:"block",data:a})}},{children:[n(m,{size:30,image:s||d}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:r||o}))}))]}),o)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return U(!A)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:f("TUIContact.Friends")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:A?p:u,alt:""})}))]})),A&&I.map((function(a,e){var o=a.profile,s=o.userID,r=o.avatar,l=o.nick;return i("div",t({className:"tui-contacts-list-item",role:"button",tabIndex:0,onClick:function(){c({type:"friend",data:a})}},{children:[n(m,{size:30,image:r||d}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:a.remark||l||s}))}))]}),s)}))]}))}var v=c.memo(f);export{v as TUIContactList};
1
+ import{__assign as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import c,{useState as a}from"react";import{useTranslation as e}from"react-i18next";import o from"@tencentcloud/chat";import{isH5 as s}from"../../../utils/env.js";import{useTUIKitContext as r}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as l}from"../../../context/TUIContactContext.js";import m from"../TUIContactInfo/hooks/useContactInfo.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as u}from"../../Avatar/default.js";import p from"../../Icon/images/right-arrow.svg.js";import f from"../../Icon/images/down-arrow.png.js";function v(){var c=r().setActiveContact,v=e().t,N=l("TUIContactList"),h=N.isShowContactList,I=N.friendList,C=N.blocklistProfile,x=N.friendApplicationList,b=m().acceptFriendApplication,g=a(!1),T=g[0],k=g[1],A=a(!1),j=A[0],U=A[1],P=a(!1),S=P[0],_=P[1];return h&&i("div",t({className:"tui-contacts-list ".concat(s?"tui-contacts-list-h5":""," ")},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return k(!T)}},{children:[n("p",t({className:"tui-contacts-list-title"},{children:v("TUIContact.New Contacts")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:T?f:p,alt:""})}))]})),T&&(null==x?void 0:x.map((function(a,e){var s=a.userID,r=a.avatar,l=a.nick,m=a.wording,p=a.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),c({type:"friendApplication",data:a})}},{children:[n(d,{size:30,image:r||u}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[n("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||s})),""!==m&&n("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:m}))]}),p===o.TYPES.SNS_APPLICATION_SENT_BY_ME&&n("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:v("TUIContact.waiting for verification")})),p===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&n("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),b(i),c()}(t,s)}},{children:v("TUIContact.Agree")}))]}))]}),s)}))),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return _(!S)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Blocked List")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:S?f:p,alt:""})}))]})),S&&(null==C?void 0:C.map((function(a,e){var o=a.userID,s=a.avatar,r=a.nick;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){c({type:"block",data:a})}},{children:[n(d,{size:30,image:s||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:r||o}))}))]}),o)}))),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return U(!j)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Friends")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:j?f:p,alt:""})}))]})),j&&(null==I?void 0:I.map((function(a,e){var o=a.profile,s=o.userID,r=o.avatar,l=o.nick;return i("div",t({className:"tui-contacts-list-item",role:"button",tabIndex:0,onClick:function(){c({type:"friend",data:a})}},{children:[n(d,{size:30,image:r||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:a.remark||l||s}))}))]}),s)})))]}))}var N=c.memo(v);export{N as TUIContactList};
@@ -1 +1 @@
1
- import{__assign as t,__awaiter as e,__generator as r}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import a,{useState as i}from"react";import{useTranslation as c}from"react-i18next";import{useTUIKitContext as s}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{useTUIContactContext as u}from"../../context/TUIContactContext.js";import m from"./hooks/useContactSearch.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{Avatar as v}from"../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../Avatar/default.js";import{Input as h}from"../Input/Input.js";function p(){var a=this,p=s("TUIContactSearch");p.chat;var I=p.setActiveContact,C=c().t,x=u("TUIContactList"),j=x.friendList,g=x.setShowContactList,U=i(!1),T=U[0],b=U[1],k=m(),y=k.checkFriend,N=k.isBlock,A=k.getUserProfile,D=i(""),w=D[0],S=D[1],F=i([]),L=F[0],B=F[1];return n("div",t({className:"tui-contact-search"},{children:[o(h,{className:"tui-contact-search-input",placeholder:C("TUIContact.Enter a userID"),clearable:!0,value:w,onBlur:function(t){var e;S(null===(e=t.target)||void 0===e?void 0:e.value)},onFocus:function(){I()},onChange:function(t){var e,r;if(""===(null===(e=t.target)||void 0===e?void 0:e.value))return g(!0),b(!1),void B([]);b(!0),S(null===(r=t.target)||void 0===r?void 0:r.value),g(!1)},onKeyDown:function(){return e(a,void 0,void 0,(function(){return r(this,(function(t){return w&&A(w).then((function(t){var e=t.data;B(e)})),[2]}))}))},prefix:o(l,{type:d.SEARCH,height:16,width:16})}),T&&0===L.length?o("div",t({className:"tui-contact-search-item"},{children:C("TUIContact.No Result")})):L.map((function(i,c){var s=i.userID,u=i.avatar,m=i.nick;return n("div",t({className:"tui-contact-search-item",role:"button",tabIndex:0,onClick:function(){var t;t=i,e(a,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,y(t)];case 1:return r.sent()?(e=j.find((function(t){return t.userID===w})),I({type:"friend",data:e}),[2]):N(t.userID)?(I({type:"block",data:t}),[2]):(I({type:"addFriend",data:t}),[2])}}))}))}},{children:[o(v,{size:30,image:u||f}),o("div",t({className:"search-item-name"},{children:m||s}))]}),s)}))]}))}var I=a.memo(p);export{I as TUIContactSearch,p as UnMemoizedTUIContactSearch};
1
+ import{__assign as t,__awaiter as e,__generator as r}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import a,{useState as i}from"react";import{useTranslation as c}from"react-i18next";import{useTUIKitContext as s}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{useTUIContactContext as u}from"../../context/TUIContactContext.js";import m from"./hooks/useContactSearch.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{Avatar as v}from"../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../Avatar/default.js";import{Input as h}from"../Input/Input.js";function p(){var a=this,p=s("TUIContactSearch");p.chat;var I=p.setActiveContact,C=c().t,x=u("TUIContactList"),j=x.friendList,g=x.setShowContactList,U=i(!1),T=U[0],b=U[1],k=m(),y=k.checkFriend,N=k.isBlock,A=k.getUserProfile,D=i(""),w=D[0],S=D[1],F=i([]),L=F[0],B=F[1];return n("div",t({className:"tui-contact-search"},{children:[o(h,{className:"tui-contact-search-input",placeholder:C("TUIContact.Enter a userID"),clearable:!0,value:w,onBlur:function(t){var e;S(null===(e=t.target)||void 0===e?void 0:e.value)},onFocus:function(){I()},onChange:function(t){var e,r;if(""===(null===(e=t.target)||void 0===e?void 0:e.value))return g&&g(!0),b(!1),void B([]);b(!0),S(null===(r=t.target)||void 0===r?void 0:r.value),g&&g(!1)},onKeyDown:function(){return e(a,void 0,void 0,(function(){return r(this,(function(t){return w&&A(w).then((function(t){var e=t.data;B(e)})),[2]}))}))},prefix:o(l,{type:d.SEARCH,height:16,width:16})}),T&&0===L.length?o("div",t({className:"tui-contact-search-item"},{children:C("TUIContact.No Result")})):L.map((function(i,c){var s=i.userID,u=i.avatar,m=i.nick;return n("div",t({className:"tui-contact-search-item",role:"button",tabIndex:0,onClick:function(){var t;t=i,e(a,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,y(t)];case 1:return r.sent()?((e=null==j?void 0:j.find((function(t){return t.userID===w})))&&I({type:"friend",data:e}),[2]):N(t.userID)?(I({type:"block",data:t}),[2]):(I({type:"addFriend",data:t}),[2])}}))}))}},{children:[o(v,{size:30,image:u||f}),o("div",t({className:"search-item-name"},{children:m||s}))]}),s)}))]}))}var I=a.memo(p);export{I as TUIContactSearch,p as UnMemoizedTUIContactSearch};
@@ -1 +1 @@
1
- import t from"@tencentcloud/chat";import{useTUIKitContext as e}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"react";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as r}from"../../../context/TUIContactContext.js";function o(){var o=r("TUIContactList").blockList,n=e("TUIContactSearch").chat;return{checkFriend:function(e){return n.checkFriend({userIDList:[null==e?void 0:e.userID],type:t.TYPES.SNS_CHECK_TYPE_BOTH}).then((function(e){var r,o;return(null===(o=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.successUserIDList[0])||void 0===o?void 0:o.relation)===t.TYPES.SNS_TYPE_BOTH_WAY}))},isBlock:function(t){return o.includes(t)},getUserProfile:function(t){return n.getUserProfile({userIDList:[t]})}}}export{o as default};
1
+ import t from"@tencentcloud/chat";import{useTUIKitContext as e}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"react";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as o}from"../../../context/TUIContactContext.js";function r(){var r=o("TUIContactList").blockList,n=e("TUIContactSearch").chat;return{checkFriend:function(e){return n.checkFriend({userIDList:[null==e?void 0:e.userID],type:t.TYPES.SNS_CHECK_TYPE_BOTH}).then((function(e){var o,r;return(null===(r=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.successUserIDList[0])||void 0===r?void 0:r.relation)===t.TYPES.SNS_TYPE_BOTH_WAY}))},isBlock:function(t){return null==r?void 0:r.includes(t)},getUserProfile:function(t){return n.getUserProfile({userIDList:[t]})}}}export{r as default};
@@ -1 +1 @@
1
- import{useEffect as t}from"react";import n from"@tencentcloud/chat";import{useTUIKitContext as o}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";var r=function(r,e,i,a){var c=o("useConversationUpdate").chat;t((function(){var t=function(t){r&&r(a?a(t.data):t.data.filter((function(t){return t.type!==n.TYPES.CONV_SYSTEM}))),i&&i(),e&&"function"==typeof e&&e(r,t)};return null==c||c.on(n.EVENT.CONVERSATION_LIST_UPDATED,t),function(){null==c||c.off(n.EVENT.CONVERSATION_LIST_UPDATED,t)}}),[c,e])};export{r as useConversationUpdate};
1
+ import{useEffect as t}from"react";import n from"@tencentcloud/chat";import{useTUIKitContext as o}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";var r=function(r,e,i,a){var c=o("useConversationUpdate").chat;t((function(){var t=function(t){r&&r(a?a(t.data):t.data.filter((function(t){return t.type!==n.TYPES.CONV_SYSTEM}))),i&&i(),e&&"function"==typeof e&&r&&e(r,t)};return null==c||c.on(n.EVENT.CONVERSATION_LIST_UPDATED,t),function(){null==c||c.off(n.EVENT.CONVERSATION_LIST_UPDATED,t)}}),[c,e])};export{r as useConversationUpdate};