@tencentcloud/chat-uikit-react 0.0.2 → 1.0.0

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 (338) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -0
  3. package/dist/cjs/components/Checkbox/index.d.ts +16 -0
  4. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  5. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  6. package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.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.js +1 -1
  10. package/dist/cjs/components/ConversationPreview/utils.js +1 -1
  11. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
  12. package/dist/cjs/components/DivWithEdit/DivWithEdit.d.ts +16 -0
  13. package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +5 -1
  14. package/dist/cjs/components/Icon/Icon.d.ts +14 -0
  15. package/dist/cjs/components/Icon/config.js +1 -1
  16. package/dist/cjs/components/Icon/images/like.png.js +1 -0
  17. package/dist/cjs/components/Icon/images/liked.png.js +1 -0
  18. package/dist/cjs/components/Icon/images/living.png.js +1 -0
  19. package/dist/cjs/components/Icon/images/member.png.js +1 -0
  20. package/dist/cjs/components/Icon/images/owner.png.js +1 -0
  21. package/dist/cjs/components/Icon/images/send.png.js +1 -0
  22. package/dist/cjs/components/Icon/images/union.png.js +1 -0
  23. package/dist/cjs/components/Icon/images/unlike.png.js +1 -0
  24. package/dist/cjs/components/Icon/images/unliked.png.js +1 -0
  25. package/dist/cjs/components/Icon/images/ununion.png.js +1 -0
  26. package/dist/cjs/components/Icon/images/unvector.png.js +1 -0
  27. package/dist/cjs/components/Icon/images/vector.png.js +1 -0
  28. package/dist/cjs/components/Icon/images/voice.png.js +1 -0
  29. package/dist/cjs/components/Icon/type.d.ts +47 -0
  30. package/dist/cjs/components/Icon/type.js +1 -1
  31. package/dist/cjs/components/Input/Input.d.ts +7 -1
  32. package/dist/cjs/components/Model/index.d.ts +9 -0
  33. package/dist/cjs/components/Plugins/index.d.ts +17 -0
  34. package/dist/cjs/components/Plugins/index.js +1 -1
  35. package/dist/cjs/components/Popup/index.d.ts +12 -0
  36. package/dist/cjs/components/Switch/Switch.d.ts +16 -0
  37. package/dist/cjs/components/TUIChat/TUIChat.d.ts +8 -2
  38. package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
  39. package/dist/cjs/components/TUIChat/TUIChatState.js +1 -1
  40. package/dist/cjs/components/TUIChat/hooks/useCreateMessage.d.ts +29 -1
  41. package/dist/cjs/components/TUIChat/hooks/useCreateMessage.js +1 -1
  42. package/dist/cjs/components/TUIChat/hooks/useCreateTUIChatStateContext.js +1 -1
  43. package/dist/cjs/components/TUIChat/hooks/useHandleMessage.js +1 -1
  44. package/dist/cjs/components/TUIChat/hooks/useHandleMessageList.js +1 -1
  45. package/dist/cjs/components/TUIChat/hooks/useMessageReceviedListener.js +1 -1
  46. package/dist/cjs/components/TUIChat/unitls.js +1 -1
  47. package/dist/cjs/components/TUIChatHeader/TUIChatHeader.d.ts +2 -0
  48. package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +1 -1
  49. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +7 -3
  50. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  51. package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
  52. package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  53. package/dist/cjs/components/TUIKit/TUIKit.d.ts +2 -1
  54. package/dist/cjs/components/TUIKit/TUIKit.js +1 -1
  55. package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +2 -1
  56. package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +1 -1
  57. package/dist/cjs/components/TUILive/TUILive.d.ts +29 -0
  58. package/dist/cjs/components/TUILive/TUILive.js +1 -0
  59. package/dist/cjs/components/TUILive/TUILiveContent.d.ts +13 -0
  60. package/dist/cjs/components/TUILive/TUILiveContent.js +1 -0
  61. package/dist/cjs/components/TUILive/TUILiveFooter.d.ts +29 -0
  62. package/dist/cjs/components/TUILive/TUILiveFooter.js +1 -0
  63. package/dist/cjs/components/TUILive/TUILiveHeader.d.ts +20 -0
  64. package/dist/cjs/components/TUILive/TUILiveHeader.js +1 -0
  65. package/dist/cjs/components/TUILive/TUILiveMemberList.d.ts +11 -0
  66. package/dist/cjs/components/TUILive/TUILiveMemberList.js +1 -0
  67. package/dist/cjs/components/TUILive/hooks/useLiveAtiveElements.js +1 -0
  68. package/dist/cjs/components/TUILive/hooks/useLivePlayer.js +1 -0
  69. package/dist/cjs/components/TUILive/hooks/useLiveState.js +1 -0
  70. package/dist/cjs/components/TUILive/untils.js +1 -0
  71. package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
  72. package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
  73. package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -0
  74. package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
  75. package/dist/cjs/components/TUIMessage/MessageContext.d.ts +3 -1
  76. package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
  77. package/dist/cjs/components/TUIMessage/MessageFile.js +1 -1
  78. package/dist/cjs/components/TUIMessage/MessageImage.js +1 -1
  79. package/dist/cjs/components/TUIMessage/MessageMerger.js +1 -1
  80. package/dist/cjs/components/TUIMessage/MessageName.js +1 -0
  81. package/dist/cjs/components/TUIMessage/MessagePlugins.d.ts +24 -0
  82. package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
  83. package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -0
  84. package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
  85. package/dist/cjs/components/TUIMessage/MessageStatus.js +1 -1
  86. package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
  87. package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
  88. package/dist/cjs/components/TUIMessage/MessageTip.js +1 -1
  89. package/dist/cjs/components/TUIMessage/TUIMessage.d.ts +23 -3
  90. package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
  91. package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
  92. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  93. package/dist/cjs/components/TUIMessage/hooks/useMessagePluginElement.js +1 -1
  94. package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
  95. package/dist/cjs/components/TUIMessage/utils/emojiMap.js +1 -1
  96. package/dist/cjs/components/TUIMessage/utils/index.js +1 -1
  97. package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +1 -1
  98. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  99. package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  100. package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
  101. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.d.ts +18 -7
  102. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
  103. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  104. package/dist/cjs/components/TUIMessageInput/Transmitter.js +1 -0
  105. package/dist/cjs/components/TUIMessageInput/hooks/useCreateMessageInputContext.js +1 -1
  106. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  107. package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  108. package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  109. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputState.js +1 -1
  110. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  111. package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
  112. package/dist/cjs/components/TUIMessageList/TUIMessageList.d.ts +3 -1
  113. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
  114. package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  115. package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
  116. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
  117. package/dist/cjs/components/TUIProfile/hooks/useMyProfile.js +1 -1
  118. package/dist/cjs/components/Toast/index.d.ts +11 -0
  119. package/dist/cjs/constants.js +1 -1
  120. package/dist/cjs/context/ComponentContext.d.ts +1 -1
  121. package/dist/cjs/context/TUIChatActionContext.d.ts +11 -2
  122. package/dist/cjs/context/TUIChatStateContext.d.ts +10 -0
  123. package/dist/cjs/context/TUIConversationContext.js +1 -1
  124. package/dist/cjs/context/TUILiveContext.d.ts +51 -0
  125. package/dist/cjs/context/TUILiveContext.js +1 -0
  126. package/dist/cjs/context/TUIMessageContext.d.ts +22 -1
  127. package/dist/cjs/context/TUIMessageContext.js +1 -1
  128. package/dist/cjs/context/TUIMessageInputContext.d.ts +4 -5
  129. package/dist/cjs/index.css +1 -1
  130. package/dist/cjs/index.d.css +547 -7
  131. package/dist/cjs/index.d.ts +18 -4
  132. package/dist/cjs/index.js +1 -1
  133. package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +1 -0
  134. package/dist/esm/components/Checkbox/index.d.ts +16 -0
  135. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  136. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  137. package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  138. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  139. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
  140. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  141. package/dist/esm/components/ConversationPreview/utils.js +1 -1
  142. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
  143. package/dist/esm/components/DivWithEdit/DivWithEdit.d.ts +16 -0
  144. package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +5 -1
  145. package/dist/esm/components/Icon/Icon.d.ts +14 -0
  146. package/dist/esm/components/Icon/config.js +1 -1
  147. package/dist/esm/components/Icon/images/like.png.js +1 -0
  148. package/dist/esm/components/Icon/images/liked.png.js +1 -0
  149. package/dist/esm/components/Icon/images/living.png.js +1 -0
  150. package/dist/esm/components/Icon/images/member.png.js +1 -0
  151. package/dist/esm/components/Icon/images/owner.png.js +1 -0
  152. package/dist/esm/components/Icon/images/send.png.js +1 -0
  153. package/dist/esm/components/Icon/images/union.png.js +1 -0
  154. package/dist/esm/components/Icon/images/unlike.png.js +1 -0
  155. package/dist/esm/components/Icon/images/unliked.png.js +1 -0
  156. package/dist/esm/components/Icon/images/ununion.png.js +1 -0
  157. package/dist/esm/components/Icon/images/unvector.png.js +1 -0
  158. package/dist/esm/components/Icon/images/vector.png.js +1 -0
  159. package/dist/esm/components/Icon/images/voice.png.js +1 -0
  160. package/dist/esm/components/Icon/type.d.ts +47 -0
  161. package/dist/esm/components/Icon/type.js +1 -1
  162. package/dist/esm/components/Input/Input.d.ts +7 -1
  163. package/dist/esm/components/Model/index.d.ts +9 -0
  164. package/dist/esm/components/Plugins/index.d.ts +17 -0
  165. package/dist/esm/components/Plugins/index.js +1 -1
  166. package/dist/esm/components/Popup/index.d.ts +12 -0
  167. package/dist/esm/components/Switch/Switch.d.ts +16 -0
  168. package/dist/esm/components/TUIChat/TUIChat.d.ts +8 -2
  169. package/dist/esm/components/TUIChat/TUIChat.js +1 -1
  170. package/dist/esm/components/TUIChat/TUIChatState.js +1 -1
  171. package/dist/esm/components/TUIChat/hooks/useCreateMessage.d.ts +29 -1
  172. package/dist/esm/components/TUIChat/hooks/useCreateMessage.js +1 -1
  173. package/dist/esm/components/TUIChat/hooks/useCreateTUIChatStateContext.js +1 -1
  174. package/dist/esm/components/TUIChat/hooks/useHandleMessage.js +1 -1
  175. package/dist/esm/components/TUIChat/hooks/useHandleMessageList.js +1 -1
  176. package/dist/esm/components/TUIChat/hooks/useMessageReceviedListener.js +1 -1
  177. package/dist/esm/components/TUIChat/unitls.js +1 -1
  178. package/dist/esm/components/TUIChatHeader/TUIChatHeader.d.ts +2 -0
  179. package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +1 -1
  180. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +7 -3
  181. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  182. package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
  183. package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  184. package/dist/esm/components/TUIKit/TUIKit.d.ts +2 -1
  185. package/dist/esm/components/TUIKit/TUIKit.js +1 -1
  186. package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +2 -1
  187. package/dist/esm/components/TUIKit/hooks/useTUIKit.js +1 -1
  188. package/dist/esm/components/TUILive/TUILive.d.ts +29 -0
  189. package/dist/esm/components/TUILive/TUILive.js +1 -0
  190. package/dist/esm/components/TUILive/TUILiveContent.d.ts +13 -0
  191. package/dist/esm/components/TUILive/TUILiveContent.js +1 -0
  192. package/dist/esm/components/TUILive/TUILiveFooter.d.ts +29 -0
  193. package/dist/esm/components/TUILive/TUILiveFooter.js +1 -0
  194. package/dist/esm/components/TUILive/TUILiveHeader.d.ts +20 -0
  195. package/dist/esm/components/TUILive/TUILiveHeader.js +1 -0
  196. package/dist/esm/components/TUILive/TUILiveMemberList.d.ts +11 -0
  197. package/dist/esm/components/TUILive/TUILiveMemberList.js +1 -0
  198. package/dist/esm/components/TUILive/hooks/useLiveAtiveElements.js +1 -0
  199. package/dist/esm/components/TUILive/hooks/useLivePlayer.js +1 -0
  200. package/dist/esm/components/TUILive/hooks/useLiveState.js +1 -0
  201. package/dist/esm/components/TUILive/untils.js +1 -0
  202. package/dist/esm/components/TUIManage/TUIManage.js +1 -1
  203. package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
  204. package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -0
  205. package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
  206. package/dist/esm/components/TUIMessage/MessageContext.d.ts +3 -1
  207. package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
  208. package/dist/esm/components/TUIMessage/MessageFile.js +1 -1
  209. package/dist/esm/components/TUIMessage/MessageImage.js +1 -1
  210. package/dist/esm/components/TUIMessage/MessageMerger.js +1 -1
  211. package/dist/esm/components/TUIMessage/MessageName.js +1 -0
  212. package/dist/esm/components/TUIMessage/MessagePlugins.d.ts +24 -0
  213. package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
  214. package/dist/esm/components/TUIMessage/MessageProgress.js +1 -0
  215. package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
  216. package/dist/esm/components/TUIMessage/MessageStatus.js +1 -1
  217. package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
  218. package/dist/esm/components/TUIMessage/MessageText.js +1 -1
  219. package/dist/esm/components/TUIMessage/MessageTip.js +1 -1
  220. package/dist/esm/components/TUIMessage/TUIMessage.d.ts +23 -3
  221. package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
  222. package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
  223. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  224. package/dist/esm/components/TUIMessage/hooks/useMessagePluginElement.js +1 -1
  225. package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
  226. package/dist/esm/components/TUIMessage/utils/emojiMap.js +1 -1
  227. package/dist/esm/components/TUIMessage/utils/index.js +1 -1
  228. package/dist/esm/components/TUIMessageInput/EmojiPicker.js +1 -1
  229. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  230. package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  231. package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
  232. package/dist/esm/components/TUIMessageInput/TUIMessageInput.d.ts +18 -7
  233. package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
  234. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  235. package/dist/esm/components/TUIMessageInput/Transmitter.js +1 -0
  236. package/dist/esm/components/TUIMessageInput/hooks/useCreateMessageInputContext.js +1 -1
  237. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  238. package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  239. package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  240. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputState.js +1 -1
  241. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  242. package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
  243. package/dist/esm/components/TUIMessageList/TUIMessageList.d.ts +3 -1
  244. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
  245. package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  246. package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
  247. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
  248. package/dist/esm/components/TUIProfile/hooks/useMyProfile.js +1 -1
  249. package/dist/esm/components/Toast/index.d.ts +11 -0
  250. package/dist/esm/constants.js +1 -1
  251. package/dist/esm/context/ComponentContext.d.ts +1 -1
  252. package/dist/esm/context/TUIChatActionContext.d.ts +11 -2
  253. package/dist/esm/context/TUIChatStateContext.d.ts +10 -0
  254. package/dist/esm/context/TUIConversationContext.js +1 -1
  255. package/dist/esm/context/TUILiveContext.d.ts +51 -0
  256. package/dist/esm/context/TUILiveContext.js +1 -0
  257. package/dist/esm/context/TUIMessageContext.d.ts +22 -1
  258. package/dist/esm/context/TUIMessageContext.js +1 -1
  259. package/dist/esm/context/TUIMessageInputContext.d.ts +4 -5
  260. package/dist/esm/index.css +1 -1
  261. package/dist/esm/index.d.css +547 -7
  262. package/dist/esm/index.d.ts +18 -4
  263. package/dist/esm/index.js +1 -1
  264. package/package.json +5 -2
  265. package/src/components/ConversationPreview/utils.tsx +2 -1
  266. package/src/components/Icon/config.ts +65 -0
  267. package/src/components/Icon/images/like.png +0 -0
  268. package/src/components/Icon/images/liked.png +0 -0
  269. package/src/components/Icon/images/living.png +0 -0
  270. package/src/components/Icon/images/member.png +0 -0
  271. package/src/components/Icon/images/owner.png +0 -0
  272. package/src/components/Icon/images/send.png +0 -0
  273. package/src/components/Icon/images/union.png +0 -0
  274. package/src/components/Icon/images/unlike.png +0 -0
  275. package/src/components/Icon/images/unliked.png +0 -0
  276. package/src/components/Icon/images/ununion.png +0 -0
  277. package/src/components/Icon/images/unvector.png +0 -0
  278. package/src/components/Icon/images/vector.png +0 -0
  279. package/src/components/Icon/images/voice.png +0 -0
  280. package/src/components/Icon/type.ts +13 -0
  281. package/src/components/Plugins/index.tsx +13 -11
  282. package/src/components/Plugins/styles/layout.scss +2 -1
  283. package/src/components/TUIChat/TUIChat.tsx +47 -8
  284. package/src/components/TUIChat/TUIChatState.tsx +27 -0
  285. package/src/components/TUIChat/hooks/useCreateMessage.tsx +85 -4
  286. package/src/components/TUIChat/hooks/useCreateTUIChatStateContext.tsx +12 -0
  287. package/src/components/TUIChat/hooks/useHandleMessage.tsx +24 -0
  288. package/src/components/TUIChat/hooks/useHandleMessageList.tsx +8 -0
  289. package/src/components/TUIChat/unitls.ts +13 -0
  290. package/src/components/TUIChatHeader/TUIChatHeader.tsx +6 -0
  291. package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +36 -16
  292. package/src/components/TUIChatHeader/styles/color.scss +0 -3
  293. package/src/components/TUIChatHeader/styles/layout.scss +8 -4
  294. package/src/components/TUIKit/TUIKit.tsx +8 -5
  295. package/src/components/TUIKit/hooks/useTUIKit.tsx +7 -3
  296. package/src/components/TUIKit/styles/reset.scss +4 -0
  297. package/src/components/TUIMessage/MessageAudio.tsx +61 -2
  298. package/src/components/TUIMessage/MessageAvatar.tsx +38 -0
  299. package/src/components/TUIMessage/MessageBubble.tsx +24 -6
  300. package/src/components/TUIMessage/MessageContext.tsx +5 -2
  301. package/src/components/TUIMessage/MessageCustom.tsx +2 -1
  302. package/src/components/TUIMessage/MessageFile.tsx +9 -3
  303. package/src/components/TUIMessage/MessageImage.tsx +2 -1
  304. package/src/components/TUIMessage/MessageMerger.tsx +2 -1
  305. package/src/components/TUIMessage/MessageName.tsx +41 -0
  306. package/src/components/TUIMessage/MessagePlugins.tsx +81 -14
  307. package/src/components/TUIMessage/MessageProgress.tsx +88 -0
  308. package/src/components/TUIMessage/MessageRevoke.tsx +1 -1
  309. package/src/components/TUIMessage/MessageStatus.tsx +6 -1
  310. package/src/components/TUIMessage/MessageText.tsx +3 -3
  311. package/src/components/TUIMessage/TUIMessage.tsx +68 -16
  312. package/src/components/TUIMessage/TUIMessageDefault.tsx +25 -15
  313. package/src/components/TUIMessage/hooks/useMessagePluginElement.tsx +15 -1
  314. package/src/components/TUIMessage/styles/layout.scss +87 -2
  315. package/src/components/TUIMessage/utils/emojiMap.ts +181 -0
  316. package/src/components/TUIMessage/utils/index.ts +14 -14
  317. package/src/components/TUIMessageInput/EmojiPicker.tsx +9 -2
  318. package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +76 -8
  319. package/src/components/TUIMessageInput/InputQuoteDefalut.tsx +2 -1
  320. package/src/components/TUIMessageInput/TUIMessageInput.tsx +42 -22
  321. package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +2 -1
  322. package/src/components/TUIMessageInput/Transmitter.tsx +15 -0
  323. package/src/components/TUIMessageInput/hooks/useCreateMessageInputContext.ts +3 -9
  324. package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +2 -1
  325. package/src/components/TUIMessageInput/hooks/useMessageInputState.tsx +8 -7
  326. package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +30 -31
  327. package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +2 -0
  328. package/src/components/TUIMessageInput/styles/layout.scss +16 -0
  329. package/src/components/TUIMessageList/TUIMessageList.tsx +32 -10
  330. package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +26 -6
  331. package/src/components/TUIMessageList/styles/layout.scss +13 -1
  332. package/src/components/index.ts +11 -0
  333. package/src/constants.ts +3 -0
  334. package/src/context/ComponentContext.tsx +1 -1
  335. package/src/context/TUIChatActionContext.tsx +14 -1
  336. package/src/context/TUIChatStateContext.tsx +8 -0
  337. package/src/context/TUIMessageContext.tsx +20 -0
  338. package/src/context/TUIMessageInputContext.tsx +2 -3
@@ -27,5 +27,33 @@ interface CreateForwardMessageProps extends BasicCreateMessageProps {
27
27
  conversation: Conversation;
28
28
  message: Message;
29
29
  }
30
+ interface CreateCustomMessageProps extends BasicCreateMessageProps {
31
+ payload: {
32
+ data: string;
33
+ description: string;
34
+ extension: string;
35
+ };
36
+ }
37
+ interface CreateTextAtMessageProps extends BasicCreateMessageProps {
38
+ payload: {
39
+ text: string;
40
+ atUserList: Array<string>;
41
+ };
42
+ }
43
+ interface CreateLocationMessageProps extends BasicCreateMessageProps {
44
+ payload: {
45
+ description: string;
46
+ longitude: number;
47
+ latitude: number;
48
+ };
49
+ }
50
+ interface CreateMergerMessageProps extends BasicCreateMessageProps {
51
+ payload: {
52
+ messageList: Array<Message>;
53
+ title: string;
54
+ abstractList: string;
55
+ compatibleText: string;
56
+ };
57
+ }
30
58
 
31
- export { BasicCreateMessageProps, CreateFaceMessageProps, CreateForwardMessageProps, CreateTextMessageProps, CreateUploadMessageProps };
59
+ export { BasicCreateMessageProps, CreateCustomMessageProps, CreateFaceMessageProps, CreateForwardMessageProps, CreateLocationMessageProps, CreateMergerMessageProps, CreateTextAtMessageProps, CreateTextMessageProps, CreateUploadMessageProps };
@@ -1 +1 @@
1
- import{__assign as e,__rest as r}from"tslib";import{useCallback as t}from"react";import o from"tim-js-sdk";function a(a){var s=a.tim,n=a.conversation,i=a.to,c=void 0===i?"":i,u=a.type,g=n.type,l=n.userProfile,f=n.groupProfile,p=u||g,m={to:c||(p===o.TYPES.CONV_C2C?null==l?void 0:l.userID:null==f?void 0:f.groupID),conversationType:p};return{createTextMessage:t((function(r){return s.createTextMessage(e(e({},m),r))}),[s]),createFaceMessage:t((function(r){return s.createFaceMessage(e(e({},m),r))}),[s]),createImageMessage:t((function(r){return s.createImageMessage(e(e({},m),r))}),[s]),createVideoMessage:t((function(r){return s.createVideoMessage(e(e({},m),r))}),[s]),createFileMessage:t((function(r){return s.createFileMessage(e(e({},m),r))}),[s]),createForwardMessage:t((function(t){var a=t.conversation,n=t.message,i=r(t,["conversation","message"]),c=a.type,u=a.userProfile,g=a.groupProfile,l=c===o.TYPES.CONV_C2C?null==u?void 0:u.userID:null==g?void 0:g.groupID;return s.createForwardMessage(e({to:l,conversationType:c,payload:n},i))}),[s])}}export{a as useCreateMessage};
1
+ import{__assign as e,__rest as t}from"tslib";import{useState as r,useEffect as a,useCallback as o}from"react";import s from"tim-js-sdk";function n(n){var c=n.tim,u=n.conversation,i=n.to,g=void 0===i?"":i,M=n.type,f=n.cloudCustomData,l=u.type,m=u.userProfile,d=u.groupProfile,p=M||l,v=r({to:g||(p===s.TYPES.CONV_C2C?null==m?void 0:m.userID:null==d?void 0:d.groupID),conversationType:p,cloudCustomData:f}),C=v[0],T=v[1];return a((function(){C.cloudCustomData=f,T(C)}),[f]),{createTextMessage:o((function(t){return c.createTextMessage(e(e({},C),t))}),[c]),createFaceMessage:o((function(t){return c.createFaceMessage(e(e({},C),t))}),[c]),createImageMessage:o((function(t){return c.createImageMessage(e(e({},C),t))}),[c]),createVideoMessage:o((function(t){return c.createVideoMessage(e(e({},C),t))}),[c]),createFileMessage:o((function(t){return c.createFileMessage(e(e({},C),t))}),[c]),createForwardMessage:o((function(r){var a=r.conversation,o=r.message,n=t(r,["conversation","message"]),u=a.type,i=a.userProfile,g=a.groupProfile,M=u===s.TYPES.CONV_C2C?null==i?void 0:i.userID:null==g?void 0:g.groupID;return c.createForwardMessage(e({to:M,conversationType:u,payload:o},n))}),[c]),createCustomMessage:o((function(t){return c.createCustomMessage(e(e({},C),t))}),[c]),createAudioMessage:o((function(t){return c.createAudioMessage(e(e({},C),t))}),[c]),createTextAtMessage:o((function(t){return c.createTextAtMessage(e(e({},C),t))}),[c]),createLocationMessage:o((function(t){return c.createLocationMessage(e(e({},C),t))}),[c]),createMergerMessage:o((function(t){return c.createMergerMessage(e(e({},C),t))}),[c])}}export{n as useCreateMessage};
@@ -1 +1 @@
1
- import{__rest as e,__assign as s}from"tslib";import{useMemo as t}from"react";function i(i){var r=i.tim,a=i.conversation,m=i.messageList,o=i.messageListRef,n=e(i,["tim","conversation","messageList","messageListRef"]);return t((function(){return s({tim:r,conversation:a,messageList:m,messageListRef:o},n)}),[r,a,m,o,n])}export{i as default};
1
+ import{__rest as s,__assign as e}from"tslib";import{useMemo as t}from"react";function i(i){var a=i.tim,o=i.conversation,g=i.messageList,n=i.messageListRef,m=i.messageConfig,f=i.cloudCustomData,r=i.TUIMessageInputConfig,u=i.TUIMessageListConfig,C=s(i,["tim","conversation","messageList","messageListRef","messageConfig","cloudCustomData","TUIMessageInputConfig","TUIMessageListConfig"]);return t((function(){return e({tim:a,conversation:o,messageList:g,messageListRef:n,messageConfig:m,cloudCustomData:f,TUIMessageInputConfig:r,TUIMessageListConfig:u},C)}),[a,o,g,n,m,f,r,u,C])}export{i as default};
@@ -1 +1 @@
1
- import{useCallback as t}from"react";import{CONSTANT_DISPATCH_TYPE as e}from"../../../constants.js";function r(r){r.state;var o=r.dispatch;return{operateMessage:t((function(t){o({type:e.OPERATE_MESSAGE,value:t})}),[o])}}export{r as useHandleMessage};
1
+ import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as t}from"../../../constants.js";function o(o){o.state;var n=o.dispatch;return{operateMessage:e((function(e){n({type:t.OPERATE_MESSAGE,value:e})}),[n]),setAudioSource:e((function(e){n({type:t.SET_AUDIO_SOURCE,value:e})}),[n]),setVideoSource:e((function(e){n({type:t.SET_VIDEO_SOURCE,value:e})}),[n]),setHighlightedMessageId:e((function(e){n({type:t.SET_HIGH_LIGHTED_MESSAGE_ID,value:e})}),[n])}}export{o as useHandleMessage};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as n}from"../../../constants.js";function o(o){var r=o.tim,s=o.conversation;o.state;var a=o.dispatch,i=s.conversationID,c={conversationID:i};return{getMessageList:e((function(e){var n=e||{};return r.getMessageList(t(t({},c),n))}),[r]),updateMessage:e((function(t){a({type:n.SET_UPDATE_MESSAGE,value:t.filter((function(t){return(null==t?void 0:t.conversationID)===i}))})}),[a]),removeMessage:e((function(t){a({type:n.SET_REMOVE_MESSAGE,value:t})}),[a]),editLocalmessage:e((function(t){a({type:n.SET_EDIT_MESSAGE,value:t})}),[a])}}export{o as useHandleMessageList};
1
+ import{__assign as t}from"tslib";import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as n}from"../../../constants.js";function o(o){var a=o.tim,s=o.conversation;o.state;var i=o.dispatch,r=s.conversationID,u={conversationID:r};return{getMessageList:e((function(e){var n=e||{};return a.getMessageList(t(t({},u),n))}),[a]),updateMessage:e((function(t){i({type:n.SET_UPDATE_MESSAGE,value:t.filter((function(t){return(null==t?void 0:t.conversationID)===r}))})}),[i]),removeMessage:e((function(t){i({type:n.SET_REMOVE_MESSAGE,value:t})}),[i]),editLocalmessage:e((function(t){i({type:n.SET_EDIT_MESSAGE,value:t})}),[i]),updataUploadPenddingMessageList:e((function(t){i({type:n.UPDATE_UPLOAD_PENDDING_MESSAGE_LIST,value:t})}),[i])}}export{o as useHandleMessageList};
@@ -1 +1 @@
1
- import{useLayoutEffect as t}from"react";import o from"tim-js-sdk";import{useTUIKitContext as i}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";function r(r,e){var n=this,E=i("useMessageReceviedListener").tim;t((function(){var t=function(t){e&&"function"==typeof e?e(r,t):r(t.data)};return E.on(o.EVENT.MESSAGE_RECEIVED,t,n),function(){E.off(o.EVENT.MESSAGE_RECEIVED,t,n)}}),[E])}export{r as useMessageReceviedListener};
1
+ import{useLayoutEffect as t}from"react";import o from"tim-js-sdk";import{useTUIKitContext as e}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";function i(i,n){var r=this,E=e("useMessageReceviedListener").tim;t((function(){var t=function(t){n&&"function"==typeof n?n(i,t):i(t.data)};return E.on(o.EVENT.MESSAGE_RECEIVED,t,r),function(){E.off(o.EVENT.MESSAGE_RECEIVED,t,r)}}),[E])}export{i as useMessageReceviedListener};
@@ -1 +1 @@
1
- import{__spreadArray as s}from"tslib";import e from"tim-js-sdk";import n from"../../constants.js";import{JSONStringToParse as t}from"../untils.js";var i=function(s){var i=null;return s.filter((function(s){var l;return s.type===e.TYPES.MSG_CUSTOM&&(i=t(null===(l=null==s?void 0:s.payload)||void 0===l?void 0:l.data)),!i||(null==i?void 0:i.businessID)!==n.TYPE_TYPING}))},l=function(s,e){var n,t={messageList:[],lastMessageID:"",isSameLastMessageID:!1};return t.messageList=s,t.messageList.length>=1&&(t.lastMessageID=null===(n=null==t?void 0:t.messageList[t.messageList.length-1])||void 0===n?void 0:n.ID),t.messageList=t.messageList.filter((function(s){return!(null==s?void 0:s.isDeleted)})),t.isSameLastMessageID=(null==t?void 0:t.lastMessageID)===(null==e?void 0:e.lastMessageID),t},o=function(e,n){var t=s([],e,!0),i=t.findIndex((function(s){return(null==s?void 0:s.ID)===(null==n?void 0:n.ID)}));return t[i]=n,t},r=function(e,n){var t=s([],e,!0),i=t.findIndex((function(s){return(null==s?void 0:s.ID)===(null==n?void 0:n.ID)}));return t.splice(i,1),t};export{o as handleEditMessage,i as handleMessage,l as handleMessageList,r as handleRemoveMessage};
1
+ import{__spreadArray as n}from"tslib";import s from"tim-js-sdk";import e from"../../constants.js";import{JSONStringToParse as t}from"../untils.js";var i=function(n){var i=null;return n.filter((function(n){var l;return n.type===s.TYPES.MSG_CUSTOM&&(i=t(null===(l=null==n?void 0:n.payload)||void 0===l?void 0:l.data)),!i||(null==i?void 0:i.businessID)!==e.TYPE_TYPING}))},l=function(n,s){var e,t={messageList:[],lastMessageID:"",isSameLastMessageID:!1};return t.messageList=n,t.messageList.length>=1&&(t.lastMessageID=null===(e=null==t?void 0:t.messageList[t.messageList.length-1])||void 0===e?void 0:e.ID),t.messageList=t.messageList.filter((function(n){return!(null==n?void 0:n.isDeleted)})),t.isSameLastMessageID=(null==t?void 0:t.lastMessageID)===(null==s?void 0:s.lastMessageID),t},r=function(s,e){var t=n([],s,!0),i=t.findIndex((function(n){return(null==n?void 0:n.ID)===(null==e?void 0:e.ID)}));return t[i]=e,t},u=function(s,e){var t=n([],s,!0),i=t.findIndex((function(n){return(null==n?void 0:n.ID)===(null==e?void 0:e.ID)}));return t.splice(i,1),t},o=function(s,e){var t=n([],s,!0);t.some((function(n){return n.ID===e.ID}))||t.push(e);var i=t.findIndex((function(n){return(null==n?void 0:n.ID)===(null==e?void 0:e.ID)}));return t[i]=e,t};export{r as handleEditMessage,i as handleMessage,l as handleMessageList,u as handleRemoveMessage,o as handleUploadPenddingMessage};
@@ -6,6 +6,8 @@ interface TUIChatHeaderProps {
6
6
  title?: string;
7
7
  TUIChatHeader?: React.ComponentType<TUIChatHeaderDefaultProps>;
8
8
  conversation?: Conversation;
9
+ avatar?: React.ReactElement | string;
10
+ headerOpateIcon?: React.ReactElement | string;
9
11
  }
10
12
  declare function UnMemoizedTUIChatHeader<T extends TUIChatHeaderProps>(props: PropsWithChildren<T>): React.ReactElement;
11
13
  declare const TUIChatHeader: typeof UnMemoizedTUIChatHeader;
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import e from"react";import{useTUIChatStateContext as o}from"../../context/TUIChatStateContext.js";import{TUIChatHeaderDefault as r}from"./TUIChatHeaderDefault.js";import"tslib";import{useComponentContext as a}from"../../context/ComponentContext.js";function n(e){var n=e.title,m=e.conversation,i=e.TUIChatHeader,c=o("TUIChatHeader").conversation,p=a().TUIChatHeader;return t(i||p||r,{title:n,conversation:m||c})}var m=e.memo(n);export{m as TUIChatHeader};
1
+ import{jsx as t}from"react/jsx-runtime";import e from"react";import{useTUIChatStateContext as o}from"../../context/TUIChatStateContext.js";import{TUIChatHeaderDefault as r}from"./TUIChatHeaderDefault.js";import"tslib";import"../../context/TUIMessageContext.js";import{useComponentContext as a}from"../../context/ComponentContext.js";function n(e){var n=e.title,m=e.conversation,i=e.TUIChatHeader,c=e.avatar,p=e.headerOpateIcon,s=o("TUIChatHeader").conversation,C=a().TUIChatHeader;return t(i||C||r,{title:n,conversation:m||s,avatar:c,opateIcon:p})}var m=e.memo(n);export{m as TUIChatHeader};
@@ -3,11 +3,15 @@ import { Conversation } from 'tim-js-sdk';
3
3
 
4
4
  interface TUIChatHeaderDefaultProps {
5
5
  title?: string;
6
- avatar?: string;
6
+ avatar?: React.ReactElement | string;
7
7
  isOnline?: boolean;
8
8
  conversation?: Conversation;
9
9
  pluginComponentList?: Array<React.ComponentType>;
10
10
  }
11
- declare function TUIChatHeaderDefault(props: TUIChatHeaderDefaultProps): React.ReactElement;
11
+ interface TUIChatHeaderBasicProps extends TUIChatHeaderDefaultProps {
12
+ isLive?: boolean;
13
+ opateIcon?: React.ReactElement | string;
14
+ }
15
+ declare function TUIChatHeaderDefault(props: TUIChatHeaderBasicProps): React.ReactElement;
12
16
 
13
- export { TUIChatHeaderDefault, TUIChatHeaderDefaultProps };
17
+ export { TUIChatHeaderBasicProps, TUIChatHeaderDefault, TUIChatHeaderDefaultProps };
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as r}from"react/jsx-runtime";import a,{useState as i,useEffect as o}from"react";import n from"tim-js-sdk";import{Avatar as l}from"../Avatar/Avatar.js";import{handleDisplayAvatar as c}from"../untils.js";import{Icon as s}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{useTUIKitContext as d}from"../../context/TUIKitContext.js";function u(a){var u=a.title,h=a.avatar;a.isOnline;var v=a.conversation,f=i(""),p=f[0],S=f[1],N=i(""),E=N[0],P=N[1];o((function(){switch(S(u),P(h),null==v?void 0:v.type){case n.TYPES.CONV_C2C:T(v.userProfile);break;case n.TYPES.CONV_GROUP:C(v.groupProfile);break;case n.TYPES.CONV_SYSTEM:S("System Notice");break;default:S("")}}),[v]);var T=function(e){p||S((null==e?void 0:e.nick)||(null==e?void 0:e.userID)),E||P(c(e.avatar))},C=function(e){p||S((null==e?void 0:e.name)||(null==e?void 0:e.groupID)),E||P(c(e.avatar,n.TYPES.CONV_GROUP))},I=d().setTUIManageShow;return r("header",e({className:"tui-chat-header"},{children:[r("div",e({className:"tui-chat-header-left ".concat((null==v?void 0:v.type)===n.TYPES.CONV_SYSTEM?"system":"")},{children:[(null==v?void 0:v.type)!==n.TYPES.CONV_SYSTEM&&t(l,{size:32,image:E}),t("div",e({className:"header-content"},{children:t("h3",e({className:"title"},{children:p}))}))]})),t("div",e({className:"tui-chat-header-right"},{children:t("div",e({className:"header-handle"},{children:t(s,{className:"header-handle-more",onClick:function(){I(!0)},type:m.ELLIPSE,width:18,height:5})}))}))]}),null==v?void 0:v.conversationID)}var h=a.memo(u);function v(r){var a=e({},r);return t(h,e({},a))}export{v as TUIChatHeaderDefault};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as a}from"react/jsx-runtime";import i,{useState as r,useEffect as o}from"react";import n from"tim-js-sdk";import{Avatar as c}from"../Avatar/Avatar.js";import{handleDisplayAvatar as s}from"../untils.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{useTUIKitContext as d}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function h(i){var h=i.title,u=i.avatar;i.isOnline;var v=i.conversation,f=i.isLive,p=i.opateIcon,S=r(""),N=S[0],T=S[1],C=r(""),E=C[0],I=C[1];o((function(){switch(T(h),u&&I(u),null==v?void 0:v.type){case n.TYPES.CONV_C2C:P(v.userProfile);break;case n.TYPES.CONV_GROUP:O(v.groupProfile);break;case n.TYPES.CONV_SYSTEM:T("System Notice");break;default:T("")}}),[v]);var P=function(e){N||T((null==e?void 0:e.nick)||(null==e?void 0:e.userID)),u||I(t(c,{size:32,image:s(e.avatar)}))},O=function(e){N||T((null==e?void 0:e.name)||(null==e?void 0:e.groupID)),u||I(t(c,{size:32,image:s(e.avatar,n.TYPES.CONV_GROUP)}))},Y=d().setTUIManageShow;return a("header",e({className:"tui-chat-header ".concat(f?"tui-chat-live-header":"")},{children:[t("div",e({className:"tui-chat-header-left ".concat((null==v?void 0:v.type)===n.TYPES.CONV_SYSTEM?"system":"")},{children:(null==v?void 0:v.type)!==n.TYPES.CONV_SYSTEM&&E})),t("div",e({className:"header-content"},{children:t("h3",e({className:"title"},{children:N}))})),t("div",e({className:"tui-chat-header-right"},{children:t("div",e({className:"header-handle"},{children:p||t(l,{className:"header-handle-more",onClick:function(){Y(!0)},type:m.ELLIPSE,width:18,height:5})}))}))]}),null==v?void 0:v.conversationID)}var u=i.memo(h);function v(a){var i=e({},a);return t(u,e({},i))}export{v as TUIChatHeaderDefault};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as o,jsxs as t,Fragment as r}from"react/jsx-runtime";import i,{useState as n,useRef as s}from"react";import{useTUIKitContext as a}from"../../context/TUIKitContext.js";import v from"./hooks/useConversationList.js";import{ConversationPreview as c}from"../ConversationPreview/ConversationPreview.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import"tim-js-sdk";import{ConversationListContainer as u}from"../ConversationPreview/ConversationListContainer.js";import{Profile as p}from"../Profile/Profile.js";import{ConversationSearchInput as C}from"../ConversationSearch/ConversationSearchInput.js";import{ConversationSearchResult as f}from"../ConversationSearch/ConversationSearchResult.js";import{ConversationCreate as d}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import{getDisplayTitle as h}from"../ConversationPreview/utils.js";import{useConversationUpdate as j}from"./hooks/useConversationUpdate.js";import"../TUIProfile/TUIProfileDefault.js";import"../../constants.js";import"date-fns";import"../TUIMessage/hooks/useMessageReply.js";import"../TUIMessage/MessageContext.js";import"../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../Switch/Switch.js";function g(i){var g=i.Preview,I=i.Container,w=void 0===I?u:I,P=i.onConversationListUpdated,L=a("TUIConversationList"),T=L.tim,U=L.customClasses,N=L.conversation,S=L.setActiveConversation,k=L.setTUIProfileShow,y=n(0),M=y[0],x=y[1],A=v(T,(function(e,o){e.length&&S(N)})),R=A.conversationList,E=A.setConversationList;j(E,P,(function(){return x((function(e){return e+1}))}));var b=n(""),D=b[0],F=b[1],G=n(R),H=G[0],K=G[1],O=n(!1),Q=O[0],V=O[1],q=a().myProfile,z=s(null);return o("div",e({className:"tui-conversation ".concat(U||""),ref:z},{children:Q?o(d,{conversationList:R,setConversationCreated:V}):t(r,{children:[o(p,{profile:q,handleAvatar:function(){k(!0)}}),t("div",e({className:"tui-conversation-header"},{children:[o(C,{value:D,clearable:!0,onChange:function(e){var o,t;if(F(null===(o=e.target)||void 0===o?void 0:o.value),null===(t=e.target)||void 0===t?void 0:t.value){var r=R.filter((function(o){var t;return h(o).toLocaleLowerCase().includes(null===(t=e.target)||void 0===t?void 0:t.value.toLocaleLowerCase())}));K(r)}else K([])}}),o("div",e({className:"tui-conversation-create-icon"},{children:o(l,{onClick:function(){F(""),V(!0)},type:m.CREATE,height:24,width:24})}))]})),o(w,e({setConversationList:E},{children:0===R.length?t("div",e({className:"no-result"},{children:[o(l,{className:"no-result-icon",type:m.EFFORT,width:42,height:42}),o("div",e({className:"no-result-message"},{children:"No conversation"}))]})):D?o(f,{Preview:g,searchValue:D,result:H}):R.map((function(t){return o(c,e({},{activeConversation:N,conversation:t,setActiveConversation:S,Preview:g,conversationUpdateCount:M}),t.conversationID)}))}))]})}))}var I=i.memo(g);export{I as TUIConversationList,g as UnMemoTUIConversationList};
1
+ import{__assign as e}from"tslib";import{jsx as o,jsxs as t,Fragment as r}from"react/jsx-runtime";import i,{useState as n,useRef as s}from"react";import{useTUIKitContext as a}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import v from"./hooks/useConversationList.js";import{ConversationPreview as c}from"../ConversationPreview/ConversationPreview.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import"tim-js-sdk";import{ConversationListContainer as u}from"../ConversationPreview/ConversationListContainer.js";import{Profile as p}from"../Profile/Profile.js";import{ConversationSearchInput as C}from"../ConversationSearch/ConversationSearchInput.js";import{ConversationSearchResult as f}from"../ConversationSearch/ConversationSearchResult.js";import{ConversationCreate as d}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import{getDisplayTitle as h}from"../ConversationPreview/utils.js";import{useConversationUpdate as j}from"./hooks/useConversationUpdate.js";import"../TUIProfile/TUIProfileDefault.js";import"../../constants.js";import"date-fns";import"../TUIMessage/hooks/useMessageReply.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import"../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../Switch/Switch.js";function g(i){var g=i.Preview,I=i.Container,w=void 0===I?u:I,P=i.onConversationListUpdated,T=a("TUIConversationList"),U=T.tim,L=T.customClasses,M=T.conversation,x=T.setActiveConversation,N=T.setTUIProfileShow,S=n(0),k=S[0],y=S[1],A=v(U,(function(e,o){e.length&&x(M)})),R=A.conversationList,E=A.setConversationList;j(E,P,(function(){return y((function(e){return e+1}))}));var b=n(""),D=b[0],F=b[1],G=n(R),H=G[0],K=G[1],O=n(!1),Q=O[0],V=O[1],q=a().myProfile,z=s(null);return o("div",e({className:"tui-conversation ".concat(L||""),ref:z},{children:Q?o(d,{conversationList:R,setConversationCreated:V}):t(r,{children:[o(p,{profile:q,handleAvatar:function(){N(!0)}}),t("div",e({className:"tui-conversation-header"},{children:[o(C,{value:D,clearable:!0,onChange:function(e){var o,t;if(F(null===(o=e.target)||void 0===o?void 0:o.value),null===(t=e.target)||void 0===t?void 0:t.value){var r=R.filter((function(o){var t;return h(o).toLocaleLowerCase().includes(null===(t=e.target)||void 0===t?void 0:t.value.toLocaleLowerCase())}));K(r)}else K([])}}),o("div",e({className:"tui-conversation-create-icon"},{children:o(l,{onClick:function(){F(""),V(!0)},type:m.CREATE,height:24,width:24})}))]})),o(w,e({setConversationList:E},{children:0===R.length?t("div",e({className:"no-result"},{children:[o(l,{className:"no-result-icon",type:m.EFFORT,width:42,height:42}),o("div",e({className:"no-result-message"},{children:"No conversation"}))]})):D?o(f,{Preview:g,searchValue:D,result:H}):R.map((function(t){return o(c,e({},{activeConversation:M,conversation:t,setActiveConversation:x,Preview:g,conversationUpdateCount:k}),t.conversationID)}))}))]})}))}var I=i.memo(g);export{I as TUIConversationList,g as UnMemoTUIConversationList};
@@ -1 +1 @@
1
- import{useEffect as t}from"react";import n from"tim-js-sdk";import{useTUIKitContext as o}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";var r=function(r,i,e){var f=o("useConversationUpdate").tim;t((function(){var t=function(t){r&&r(t.data.filter((function(t){return t.type!==n.TYPES.CONV_SYSTEM}))),e&&e(),i&&"function"==typeof i&&i(r,t)};return null==f||f.on(n.EVENT.CONVERSATION_LIST_UPDATED,t),function(){null==f||f.off(n.EVENT.CONVERSATION_LIST_UPDATED,t)}}),[f,i])};export{r as useConversationUpdate};
1
+ import{useEffect as t}from"react";import o from"tim-js-sdk";import{useTUIKitContext as n}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";var r=function(r,i,e){var f=n("useConversationUpdate").tim;t((function(){var t=function(t){r&&r(t.data.filter((function(t){return t.type!==o.TYPES.CONV_SYSTEM}))),e&&e(),i&&"function"==typeof i&&i(r,t)};return null==f||f.on(o.EVENT.CONVERSATION_LIST_UPDATED,t),function(){null==f||f.off(o.EVENT.CONVERSATION_LIST_UPDATED,t)}}),[f,i])};export{r as useConversationUpdate};
@@ -1,9 +1,10 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- import { ChatSDK } from 'tim-js-sdk';
2
+ import { ChatSDK, Conversation } from 'tim-js-sdk';
3
3
 
4
4
  interface ChatProps {
5
5
  tim?: ChatSDK | null;
6
6
  customClasses?: unknown;
7
+ activeConversation?: Conversation;
7
8
  }
8
9
  declare function TUIKit<T extends ChatProps>(props: PropsWithChildren<T>): React.ReactElement;
9
10
 
@@ -1 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as t,jsxs as e,Fragment as i}from"react/jsx-runtime";import{useTUIKit as r}from"./hooks/useTUIKit.js";import{useCreateTUIKitContext as s}from"./hooks/useCreateTUIKitContext.js";import{TUIKitProvider as a}from"../../context/TUIKitContext.js";import{TUIConversation as n}from"../TUIConversation/TUIConversation.js";import{TUIChat as m}from"../TUIChat/TUIChat.js";import"react";import{TUIManage as c}from"../TUIManage/TUIManage.js";function I(I){var T=I.children,U=I.tim,h=I.customClasses;window.tencent_cloud_im_csig_react_uikit_23F_xa=!0;var l=r({tim:U}),f=l.conversation,v=l.setActiveConversation,u=l.myProfile,C=l.TUIManageShow,p=l.setTUIManageShow,w=l.TUIProfileShow,S=l.setTUIProfileShow,d=s({tim:U,conversation:f,setActiveConversation:v,customClasses:h,myProfile:u,TUIManageShow:C,setTUIManageShow:p,TUIProfileShow:w,setTUIProfileShow:S});return t(a,o({value:d},{children:t("div",o({className:"tui-kit"},{children:T||e(i,{children:[t(n,{}),t(m,{}),t(c,{})]})}))}))}export{I as TUIKit};
1
+ import{__assign as o}from"tslib";import{jsx as t,jsxs as e,Fragment as i}from"react/jsx-runtime";import{useTUIKit as r}from"./hooks/useTUIKit.js";import{useCreateTUIKitContext as s}from"./hooks/useCreateTUIKitContext.js";import{TUIKitProvider as a}from"../../context/TUIKitContext.js";import{TUIConversation as n}from"../TUIConversation/TUIConversation.js";import{TUIChat as m}from"../TUIChat/TUIChat.js";import"react";import{TUIManage as c}from"../TUIManage/TUIManage.js";function I(I){var T=I.children,U=I.tim,h=I.customClasses,l=I.activeConversation;window.tencent_cloud_im_csig_react_uikit_23F_xa=!0;var v=r({tim:U,activeConversation:l}),f=v.conversation,C=v.setActiveConversation,u=v.myProfile,p=v.TUIManageShow,w=v.setTUIManageShow,S=v.TUIProfileShow,d=v.setTUIProfileShow,g=s({tim:U,conversation:f,setActiveConversation:C,customClasses:h,myProfile:u,TUIManageShow:p,setTUIManageShow:w,TUIProfileShow:S,setTUIProfileShow:d});return t(a,o({value:g},{children:t("div",o({className:"tui-kit"},{children:T||e(i,{children:[t(n,{}),t(m,{}),t(c,{})]})}))}))}export{I as TUIKit};
@@ -3,8 +3,9 @@ import { ChatSDK, Conversation, Profile } from 'tim-js-sdk';
3
3
 
4
4
  interface UseChatParams {
5
5
  tim: ChatSDK;
6
+ activeConversation?: Conversation;
6
7
  }
7
- declare const useTUIKit: ({ tim }: UseChatParams) => {
8
+ declare const useTUIKit: ({ tim, activeConversation: paramsActiveConversation }: UseChatParams) => {
8
9
  conversation: Conversation;
9
10
  setActiveConversation: (activeConversation?: Conversation) => void;
10
11
  myProfile: Profile;
@@ -1 +1 @@
1
- import{__awaiter as o,__generator as n}from"tslib";import{useState as e,useEffect as t,useCallback as r}from"react";var i=function(i){var a=i.tim,s=e(),v=s[0],c=s[1],l=e(),u=l[0],f=l[1],I=e(!1),d=I[0],h=I[1],m=e(!1),w=m[0],g=m[1];t((function(){o(void 0,void 0,void 0,(function(){var o;return n(this,(function(n){switch(n.label){case 0:return[4,null==a?void 0:a.getMyProfile()];case 1:return o=n.sent(),f(null==o?void 0:o.data),[2]}}))}))}),[a]);var D=r((function(o){o&&(null==a||a.setMessageRead({conversationID:o.conversationID})),v&&o.conversationID!==v.conversationID&&h(!1),c(o)}),[a]);return{conversation:v,setActiveConversation:D,myProfile:u,TUIManageShow:d,setTUIManageShow:h,TUIProfileShow:w,setTUIProfileShow:g}};export{i as useTUIKit};
1
+ import{__awaiter as o,__generator as n}from"tslib";import{useState as t,useEffect as e,useCallback as i}from"react";var r=function(r){var a=r.tim,s=r.activeConversation,v=t(s),c=v[0],l=v[1],u=t(),f=u[0],I=u[1],d=t(!1),h=d[0],m=d[1],w=t(!1),g=w[0],D=w[1];e((function(){o(void 0,void 0,void 0,(function(){var o;return n(this,(function(n){switch(n.label){case 0:return[4,null==a?void 0:a.getMyProfile()];case 1:return o=n.sent(),I(null==o?void 0:o.data),[2]}}))}))}),[a]);var M=i((function(o){o&&(null==a||a.setMessageRead({conversationID:o.conversationID})),c&&o.conversationID!==c.conversationID&&m(!1),l(o)}),[a]);return e((function(){l(s)}),[s]),{conversation:c,setActiveConversation:M,myProfile:f,TUIManageShow:h,setTUIManageShow:m,TUIProfileShow:g,setTUIProfileShow:D}};export{r as useTUIKit};
@@ -0,0 +1,29 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { Conversation, Profile, GroupMember } from 'tim-js-sdk';
3
+ import { TUILiveActivePorps, TUILiveCallbackParams, TUILiveTagParam, TUILiveMemberListItemParams } from '../../context/TUILiveContext.js';
4
+ import { OwnerLabelListItem } from './TUILiveFooter.js';
5
+
6
+ interface TUILiveProps {
7
+ className?: string;
8
+ url?: string;
9
+ conversation?: Conversation;
10
+ myProfile?: Profile;
11
+ ownerProfile?: GroupMember;
12
+ follow?: TUILiveActivePorps;
13
+ subscribe?: TUILiveActivePorps;
14
+ like?: TUILiveActivePorps;
15
+ unlike?: TUILiveActivePorps;
16
+ activePlugins?: Array<React.ReactElement>;
17
+ menuIcon?: React.ReactElement;
18
+ callback?: (data: TUILiveCallbackParams) => void;
19
+ headerTag?: Array<string>;
20
+ footerTag?: Array<string>;
21
+ onTagClick?: (data?: TUILiveTagParam) => void;
22
+ groupID?: string;
23
+ memberGroupList?: Array<TUILiveMemberListItemParams>;
24
+ ownerLabelList?: Array<OwnerLabelListItem>;
25
+ }
26
+ declare function UnMemoizedTUILive<T extends TUILiveProps>(props: PropsWithChildren<T>): React.ReactElement;
27
+ declare const TUILive: typeof UnMemoizedTUILive;
28
+
29
+ export { TUILive };
@@ -0,0 +1 @@
1
+ import{__assign as e}from"tslib";import{jsx as o,jsxs as i,Fragment as r}from"react/jsx-runtime";import t,{useMemo as n}from"react";import{useTUIKitContext as m}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{TUILiveContextProvider as l}from"../../context/TUILiveContext.js";import{useLiveState as s}from"./hooks/useLiveState.js";import{TUILiveContent as u}from"./TUILiveContent.js";import{TUILiveFooter as c}from"./TUILiveFooter.js";import{TUILiveHeader as a}from"./TUILiveHeader.js";function v(t){var v=t.className,p=t.url,f=t.conversation,b=t.ownerProfile,L=t.myProfile,w=t.children,k=t.follow,I=t.subscribe,C=t.like,g=t.unlike,h=t.activePlugins,T=void 0===h?[]:h,j=t.callback,x=t.menuIcon,P=t.onTagClick,d=t.groupID,y=t.memberGroupList,U=t.ownerLabelList,S=m("TUILive"),A=S.tim,D=S.conversation,G=S.myProfile,N=S.setActiveConversation,F=L||G,H=f||D,K=s({tim:A,conversation:f||D,groupID:d,setActiveConversation:N}),M=K.group,q=K.ownerProfile,z=K.memberCount,B=K.memberList,E=b||q,J=e({type:"follow",isShow:!0,value:!1,num:0},k),O=e({type:"subscribe",isShow:!0,value:!1,num:0},I),Q=e({type:"like",isShow:!0,value:!1,num:0},C),R=e({type:"unlike",isShow:!0,value:!1,num:0},g),V=n((function(){return{url:p,group:M,conversation:H,ownerProfile:E,myProfile:F,follow:J,subscribe:O,like:Q,unlike:R,activePlugins:T,menuIcon:x,callback:j,onTagClick:P,memberCount:z,memberList:B,memberGroupList:y,ownerLabelList:U}}),[p,M,H,E,F,J,O,Q,R,T,x,j,y,P,z,B,U]);return o(l,e({value:V},{children:i(r,{children:[i("div",e({className:"tui-live ".concat(v)},{children:[o(a,{}),o(u,{}),o(c,{})]})),w&&w]})}))}var p=t.memo(v);export{p as TUILive};
@@ -0,0 +1,13 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+
3
+ interface TUILiveContentBaseProps {
4
+ url?: string;
5
+ className?: string;
6
+ }
7
+ interface TUILiveContentProps extends TUILiveContentBaseProps {
8
+ TUILiveContent?: React.ComponentType<TUILiveContentBaseProps>;
9
+ }
10
+ declare function UnMemoizedTUILiveContent<T extends TUILiveContentProps>(props: PropsWithChildren<T>): React.ReactElement;
11
+ declare const TUILiveContent: typeof UnMemoizedTUILiveContent;
12
+
13
+ export { TUILiveContent, TUILiveContentBaseProps };
@@ -0,0 +1 @@
1
+ import{__assign as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import t,{useRef as o,useEffect as i}from"react";import{useTUILiveContext as a}from"../../context/TUILiveContext.js";import{useLivePlayer as l}from"./hooks/useLivePlayer.js";function n(t){var n=t.className,m=t.url,c=t.TUILiveContent,s=o(),u=a("TUILiveHeader").url,v=m||u;if(!/(http(s)?:\/\/)?\w+(\.\w+)+\/(\w+\/)*(.*?\.)+(swf|avi|flv|mpg|mov|wav|3gp|mkv|rmvb|mp3|mp4)/.test(v))throw new Error("The url is invalid, please fill in the correct url");c&&e(c,{url:v});var p=l(null==s?void 0:s.current).TCPlayer,f="player-container-".concat((new Date).getTime());return i((function(){s&&p&&p.src(v)}),[s,p]),e("video",r({autoPlay:!0,muted:!0,loop:!0,controls:!0,className:"tui-live-content ".concat(n),id:f,preload:"auto",playsInline:!0,ref:s},{children:e("source",{src:""})}))}var m=t.memo(n);export{m as TUILiveContent};
@@ -0,0 +1,29 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { Conversation, Group, GroupMember, Profile } from 'tim-js-sdk';
3
+ import { TUILiveActivePorps, TUILiveCallbackParams } from '../../context/TUILiveContext.js';
4
+
5
+ interface OwnerLabelListItem {
6
+ key?: string;
7
+ value?: string;
8
+ }
9
+ interface TUILiveFooterBaseProps {
10
+ className?: string;
11
+ conversation?: Conversation;
12
+ group?: Group;
13
+ ownerProfile?: GroupMember;
14
+ myProfile?: Profile;
15
+ ownerLabelList?: Array<OwnerLabelListItem>;
16
+ }
17
+ interface TUILiveFooterProps extends TUILiveFooterBaseProps {
18
+ TUILiveFooter?: React.ComponentType<TUILiveFooterBaseProps>;
19
+ follow?: TUILiveActivePorps;
20
+ subscribe?: TUILiveActivePorps;
21
+ like?: TUILiveActivePorps;
22
+ unlike?: TUILiveActivePorps;
23
+ activePlugins?: Array<React.ReactElement>;
24
+ callback?: (data: TUILiveCallbackParams) => void;
25
+ }
26
+ declare function UnMemoizedTUILiveFooter<T extends TUILiveFooterProps>(props: PropsWithChildren<T>): React.ReactElement;
27
+ declare const TUILiveFooter: typeof UnMemoizedTUILiveFooter;
28
+
29
+ export { OwnerLabelListItem, TUILiveFooter, TUILiveFooterBaseProps };
@@ -0,0 +1 @@
1
+ import{__spreadArray as e,__assign as i}from"tslib";import{jsx as l,jsxs as o}from"react/jsx-runtime";import n,{useState as t}from"react";import{useTUILiveContext as r}from"../../context/TUILiveContext.js";import{useLiveAtiveElements as u}from"./hooks/useLiveAtiveElements.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Avatar as c}from"../Avatar/Avatar.js";import{handleNumber as v}from"./untils.js";function m(n){var m=n.className,f=n.conversation,k=n.group,b=n.ownerLabelList,p=n.ownerProfile,d=n.myProfile,w=n.TUILiveFooter,h=n.activePlugins,I=n.follow,N=n.subscribe,y=n.like,L=n.unlike,g=n.callback,U=r("TUILiveHeader"),C=U.group,E=U.ownerProfile,j=U.myProfile,x=U.activePlugins,P=U.follow,T=U.subscribe,K=U.like,O=U.unlike,S=U.callback,V=U.ownerLabelList,A=h||x,D=I||P,F=N||T,R=y||K,H=L||O,W=g||S;w&&l(w,{conversation:f,group:k||C,myProfile:d||j});var q=p||E,z=b||V||((null==q?void 0:q.memberCustomField)||[]).filter((function(e){return null==e?void 0:e.value})),_=t({follow:D.value,subscribe:F.value,like:R.value,unlike:H.value}),B=_[0];_[1];var G=D.isShow&&u({icon:s.UNUNION,activeIcon:s.UNION,name:"Follow",type:"follow",iconWidth:12,iconHeight:12,value:B.follow,onClick:function(){return B.follow=!B.follow,W({type:"follow",value:B.follow}),{value:B.follow}}}),J=F.isShow&&u({icon:s.UNVECTOR,activeIcon:s.VECTOR,name:"Subscribe",type:"subscribe",value:B.subscribe,onClick:function(){return B.subscribe=!B.subscribe,W({type:"subscribe",value:B.subscribe}),{value:B.subscribe}}}),M=R.isShow&&u({icon:s.LIKE,activeIcon:s.LIKED,name:v(R.num,1),type:"like",value:!B.unlike&&B.like,suffix:H.isShow&&{icon:s.UNLIKE,activeIcon:s.UNLIKED,type:"unlike",value:!B.like&&B.unlike,onClick:function(){return B.like&&W({type:"like",value:!B.like}),B.like=!1,B.unlike=!B.unlike,{value:B.like,suffixValue:B.unlike}}},onClick:function(){return B.unlike=!1,B.like=!B.like,W({type:"like",value:B.like}),{value:B.like,suffixValue:B.unlike}}}),Q=e([G,J,M],A,!0).filter((function(e){return e}));return o("footer",i({className:"tui-live-footer ".concat(m)},{children:[l(c,{size:40,image:(null==q?void 0:q.avatar)||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png"}),o("div",i({className:"tui-live-footer-main"},{children:[o("div",i({className:"owner-name"},{children:[l("h1",{children:(null==q?void 0:q.nick)||(null==q?void 0:q.userID)}),l(a,{type:s.OWNER,width:15,height:15})]})),l("ul",i({className:"tui-live-list tag-list"},{children:null==z?void 0:z.map((function(e){return l("li",i({className:"tui-live-item tag-item"},{children:null==e?void 0:e.value}),e.value)}))}))]})),l("ul",i({className:"tui-live-list opate-list"},{children:Q}))]}))}var f=n.memo(m);export{f as TUILiveFooter};
@@ -0,0 +1,20 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { Conversation, Group } from 'tim-js-sdk';
3
+ import { TUILiveActivePorps, TUILiveTagParam } from '../../context/TUILiveContext.js';
4
+
5
+ interface TUILiveHeaderBaseProps {
6
+ className?: string;
7
+ conversation?: Conversation;
8
+ group?: Group;
9
+ }
10
+ interface TUILiveHeaderProps extends TUILiveHeaderBaseProps {
11
+ TUILiveHeader?: React.ComponentType<TUILiveHeaderBaseProps>;
12
+ menuIcon?: React.ReactElement;
13
+ follow?: TUILiveActivePorps;
14
+ subscribe?: TUILiveActivePorps;
15
+ onTagClick?: (data?: TUILiveTagParam) => void;
16
+ }
17
+ declare function UnMemoizedTUILiveHeader<T extends TUILiveHeaderProps>(props: PropsWithChildren<T>): React.ReactElement;
18
+ declare const TUILiveHeader: typeof UnMemoizedTUILiveHeader;
19
+
20
+ export { TUILiveHeader, TUILiveHeaderBaseProps };
@@ -0,0 +1 @@
1
+ import{__assign as e}from"tslib";import{jsx as i,jsxs as l}from"react/jsx-runtime";import n from"react";import{useTUILiveContext as o}from"../../context/TUILiveContext.js";import{Icon as t}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";import{handleNumber as r}from"./untils.js";function c(n){var c=n.className,u=n.conversation,m=n.group,s=n.TUILiveHeader,v=n.menuIcon,d=n.follow,h=n.subscribe,p=n.onTagClick,f=o("TUILiveHeader"),N=f.group,I=f.follow,g=f.subscribe,b=f.menuIcon,C=f.onTagClick,x=f.memberCount,T=m||N,j=v||b,L=d||I,w=h||g,U=p||C;s&&i(s,{conversation:u,group:T});var k=((null==T?void 0:T.groupCustomField)||[]).filter((function(e){return null==e?void 0:e.value})),y=[{icon:a.MEMBER,value:x},{icon:a.UNION,value:L.num},{icon:a.VECTOR,value:w.num}];return l("header",e({className:"tui-live-header ".concat(c)},{children:[l("div",e({className:"tui-live-header-name"},{children:[i("h1",{children:(null==T?void 0:T.name)||(null==T?void 0:T.groupID)}),j]})),l("div",e({className:"tui-live-header-content"},{children:[l("div",e({className:"tui-live-header-label"},{children:[i(t,{className:"icon",type:a.LIVING,width:12,height:12}),i("p",{children:"Living"})]})),i("ul",e({className:"tui-live-list tag-list"},{children:null==k?void 0:k.map((function(l,n){return i("li",e({role:"menuitem",tabIndex:n,className:"tui-live-item tag-item",onClick:function(e){U({value:l.value,ele:e})}},{children:null==l?void 0:l.value}),l.value)}))})),i("ul",e({className:"tui-live-list"},{children:null==y?void 0:y.map((function(n){return l("li",e({className:"tui-live-item"},{children:[i(t,{className:"icon",type:n.icon,width:12,height:12}),i("span",e({className:"list-item-text"},{children:r(n.value)}))]}),n.icon)}))}))]}))]}))}var u=n.memo(c);export{u as TUILiveHeader};
@@ -0,0 +1,11 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { TUILiveMemberListItemParams } from '../../context/TUILiveContext.js';
3
+
4
+ interface TUILiveMemberListProps {
5
+ className?: string;
6
+ memberGroupList?: Array<TUILiveMemberListItemParams>;
7
+ }
8
+ declare function UnMemoizedTUILiveMemberList<T extends TUILiveMemberListProps>(props: PropsWithChildren<T>): React.ReactElement;
9
+ declare const TUILiveMemberList: typeof UnMemoizedTUILiveMemberList;
10
+
11
+ export { TUILiveMemberList, TUILiveMemberListProps };
@@ -0,0 +1 @@
1
+ import{__assign as l}from"tslib";import{jsx as i,jsxs as e}from"react/jsx-runtime";import n,{useState as t,useEffect as o}from"react";import{useTUILiveContext as r}from"../../context/TUILiveContext.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{Avatar as s}from"../Avatar/Avatar.js";function u(n){n.className;var u=n.memberGroupList,v=r("TUILiveHeader"),c=v.memberGroupList,d=v.memberList,h=v.ownerProfile,p=t([]),f=p[0],g=p[1];return o((function(){var i=u||c;if((null==i?void 0:i.length)>0&&(null==d?void 0:d.length)>0&&0===(null==f?void 0:f.length)){var e=i.map((function(i){var e=l(l({},i),{list:[],show:!0});return e.filter&&(e.list=null==e?void 0:e.filter(d,h)),e}));g(e)}0===(null==i?void 0:i.length)&&(null==d?void 0:d.length)>0&&0===(null==f?void 0:f.length)&&g(e=[{title:"All",name:"All",show:!0,list:d}])}),[u,c,h,f,d]),i("main",l({className:"tui-live-members"},{children:null==f?void 0:f.map((function(n,t){var o;return e("ul",l({className:"list"},{children:[e("div",l({role:"menuitem",tabIndex:t,className:"list-header",onClick:function(){var i,e;i=t,e=f.map((function(e,n){return n===i?l(l({},e),{show:!e.show}):e})),g(e)}},{children:[i("h1",{children:null==n?void 0:n.title}),i(a,{type:m.ARROW_DOWN,width:12,height:7})]})),(null==n?void 0:n.show)&&(null===(o=null==n?void 0:n.list)||void 0===o?void 0:o.map((function(n){return e("li",l({className:"list-item"},{children:[i(s,{size:18,image:(null==n?void 0:n.avatar)||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png"}),i("span",l({className:"nick"},{children:(null==n?void 0:n.nick)||(null==n?void 0:n.userID)}))]}),null==n?void 0:n.userID)})))]}),null==n?void 0:n.name)}))}))}var v=n.memo(u);export{v as TUILiveMemberList};
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as i,__assign as t}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import{useState as l,useCallback as a}from"react";import{Icon as c}from"../../Icon/Icon.js";import"../../Icon/type.js";function r(r){var u=this,s=r.name;r.type;var m=r.icon,v=r.activeIcon,d=r.value,f=r.onClick;r.className;var h=r.suffix,p=r.iconWidth,x=r.iconHeight,b=l(d),I=b[0],k=b[1],C=l(null==h?void 0:h.value),N=C[0],w=C[1],y=a((function(){return e(u,void 0,void 0,(function(){var e;return i(this,(function(i){switch(i.label){case 0:return f?[4,f()]:[3,2];case 1:e=i.sent(),k(null==e?void 0:e.value),w(e.suffixValue),i.label=2;case 2:return[2]}}))}))}),[f]),g=a((function(){return e(u,void 0,void 0,(function(){var e;return i(this,(function(i){switch(i.label){case 0:return(null==h?void 0:h.onClick)?[4,null==h?void 0:h.onClick()]:[3,2];case 1:e=i.sent(),k(null==e?void 0:e.value),w(e.suffixValue),i.label=2;case 2:return[2]}}))}))}),[null==h?void 0:h.onClick]);return n("li",t({className:"tui-live-item opate-item"},{children:[n("div",t({className:"opate-box",role:"menuitem",tabIndex:0,onClick:y},{children:[o(c,{type:I?v:m,width:p||15,height:x||15}),o("span",t({className:"list-item-text"},{children:s}))]})),h&&o("div",t({role:"menuitem",tabIndex:0,className:"opate-item-suffix line opate-box",onClick:g},{children:o(c,{type:N?h.activeIcon:h.icon,width:p||15,height:x||15})}))]}),s)}export{r as useLiveAtiveElements};
@@ -0,0 +1 @@
1
+ import{__awaiter as n,__generator as i}from"tslib";import{useState as l,useEffect as t}from"react";var e="https://web.sdk.qcloud.com/player/tcplayer/release",r={link:{type:"link",url:"tcplayer.min.css",isOnload:!1},TXLivePlayer:{type:"script",url:"libs/TXLivePlayer-1.2.3.min.js",isOnload:!1},hls:{type:"script",url:"libs/hls.min.1.1.5.js",isOnload:!1},flv:{type:"script",url:"libs/flv.min.1.6.3.js",isOnload:!1},dash:{type:"script",url:"libs/dash.all.min.4.4.1.js",isOnload:!1},tcplayer:{type:"script",url:"tcplayer.v4.6.0.min.js",isOnload:!1}};function o(o){var s=this,c=l(null),a=c[0],d=c[1],u=l(r),p=u[0],y=u[1],v=l(!1),m=v[0],f=v[1];return t((function(){n(s,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,void((null===window||void 0===window?void 0:window.TCPlayer)?f(!0):Object.keys(p).map((function(n){var i=document.createElement(p[n].type);return"link"===p[n].type?(i.href="".concat(e,"/").concat("v4.6.0","/").concat(p[n].url),i.rel="stylesheet"):i.src="".concat(e,"/").concat("v4.6.0","/").concat(p[n].url),document.body.appendChild(i),i.onload=function(){p[n].isOnload=!0,y(p),f(Object.keys(p).every((function(n){return p[n].isOnload})))},n})))];case 1:return n.sent(),[2]}}))}))}),[]),t((function(){if(m&&o){var n=null===window||void 0===window?void 0:window.TCPlayer(null==o?void 0:o.id,{});d(n)}}),[m,o]),{TCPlayer:a}}export{o as useLivePlayer};
@@ -0,0 +1 @@
1
+ import{__awaiter as n,__generator as t}from"tslib";import{useState as e,useCallback as o,useEffect as r}from"react";import i from"tim-js-sdk";function u(u){var l=this,a=u.tim,s=u.conversation,c=u.groupID,v=u.setActiveConversation,d=e(null),f=d[0],b=d[1],m=e(null),p=m[0],h=m[1],g=e(null),D=g[0],G=g[1],I=e(0),P=I[0],T=I[1],w=e(null),E=w[0],U=w[1],A=o((function(){return n(l,void 0,void 0,(function(){var n,e,o;return t(this,(function(t){switch(t.label){case 0:return!c||p?[3,3]:[4,null==a?void 0:a.getGroupProfile({groupID:c})];case 1:return n=t.sent(),h(null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.group),[4,C(null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.group)];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}),[a,c]),C=function(e){return n(l,void 0,void 0,(function(){var n,o;return t(this,(function(t){switch(t.label){case 0:return(null==e?void 0:e.ownerID)?[4,null==a?void 0:a.getGroupMemberProfile({groupID:c,userIDList:[null==e?void 0:e.ownerID]})]:[3,2];case 1:n=t.sent(),G(null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.memberList[0]),t.label=2;case 2:return[2]}}))}))},R=o((function(){return n(l,void 0,void 0,(function(){var n,e,o,r,i;return t(this,(function(t){switch(t.label){case 0:return c?[4,null==a?void 0:a.getGroupOnlineMemberCount(c)]:[3,3];case 1:return n=t.sent(),T(null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.memberCount),(null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.memberCount)>0?[4,null==a?void 0:a.getGroupMemberList({groupID:c,offset:0})]:[3,3];case 2:e=t.sent(),U(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.memberList),t.label=3;case 3:return[2]}}))}))}),[a]),O=function(n){console.log("onGroupAttributesUpdated",null==n?void 0:n.data)};return r((function(){return n(l,void 0,void 0,(function(){var n,e,o;return t(this,(function(t){switch(t.label){case 0:return f?[2]:s?(v(s),b(s),[3,3]):[3,1];case 1:return[4,null==a?void 0:a.getConversationProfile("GROUP".concat(c))];case 2:n=t.sent(),v(null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.conversation),b(null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.conversation),t.label=3;case 3:return[2]}}))})),function(){n(l,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return f?[4,null==a?void 0:a.deleteConversation("GROUP".concat(c))]:[3,3];case 1:return n.sent(),b(null),[4,null==a?void 0:a.quitGroup(c)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}}),[a,s,f]),r((function(){var e=null;return n(l,void 0,void 0,(function(){var o=this;return t(this,(function(r){switch(r.label){case 0:return[4,A()];case 1:return r.sent(),[4,R()];case 2:return r.sent(),e=setInterval((function(){return n(o,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return[4,R()];case 1:return n.sent(),[2]}}))}))}),1e4),[2]}}))})),null==a||a.on(i.EVENT.GROUP_ATTRIBUTES_UPDATED,O),function(){null==a||a.off(i.EVENT.GROUP_ATTRIBUTES_UPDATED,O),e&&clearInterval(e)}}),[a,c]),r((function(){n(l,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return f&&p?[4,null==a?void 0:a.joinGroup({groupID:c,type:i.TYPES.GRP_AVCHATROOM})]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}),[a,f,p]),{group:p,ownerProfile:D,memberCount:P,memberList:E}}export{u as useLiveState};
@@ -0,0 +1 @@
1
+ var e=function(e,o){void 0===o&&(o=0);var t="".concat(e);return 0===o&&(e>1e3&&e<1e4?t="".concat((e/1e3).toFixed(1),"K"):e>1e4&&(t="".concat((e/1e3).toFixed(0),"K"))),1===o&&e>1e4&&(t="".concat((e/1e4).toFixed(1),"W")),t};export{e as handleNumber};
@@ -1 +1 @@
1
- import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as a,useEffect as o}from"react";import{Icon as t}from"../Icon/Icon.js";import{IconTypes as r}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{defaultGroupAvatarWork as s,defaultUserAvatar as c}from"../Avatar/default.js";import{Switch as m}from"../Switch/Switch.js";import{useTUIKitContext as d}from"../../context/TUIKitContext.js";import{getMessageProfile as v}from"../ConversationPreview/utils.js";import{useConversationUpdate as u}from"../TUIConversationList/hooks/useConversationUpdate.js";import{useConversation as h}from"../../hooks/useConversation.js";function f(){var f=a(null),p=f[0],g=f[1],I=a(null),C=I[0],N=I[1],j=a(!1),k=j[0],D=j[1],w=a(0),x=w[0],U=w[1],A=d("TUIManage"),T=A.conversation,P=A.setActiveConversation,S=A.tim,b=A.TUIManageShow,M=A.setTUIManageShow;u(null,(function(){U((function(n){return n+1}))}));var y=h(S),L=y.pinConversation,z=y.deleteConversation;return o((function(){g(T),N(v(T)),D(!!T&&T.isPinned)}),[T,x]),b&&T&&e("div",n({className:"tui-manage"},{children:[e("div",n({className:"tui-manage-title"},{children:[i(t,{type:r.CANCEL,width:16,height:16,onClick:function(){M(!1)}}),i("span",{children:"Conversation Information"})]})),e("div",n({className:"tui-manage-container"},{children:[e("div",n({className:"tui-manage-info"},{children:[i("div",n({className:"info-avatar"},{children:i(l,{size:64,image:(null==C?void 0:C.avatar)||((null==C?void 0:C.groupID)?s:c)})})),i("div",n({className:"info-name"},{children:(null==C?void 0:C.nick)||(null==C?void 0:C.name)})),e("div",n({className:"info-id"},{children:["ID:",(null==C?void 0:C.userID)||(null==C?void 0:C.groupID)]}))]})),e("div",n({className:"tui-manage-handle"},{children:[e("div",n({className:"manage-handle-box"},{children:[i("div",n({className:"manage-handle-title"},{children:"Pin"})),i(m,{onChange:function(n){D(n.target.checked),L({conversationID:p.conversationID,isPinned:n.target.checked})},checked:k})]})),i("div",n({className:"manage-handle-box",role:"presentation",onClick:function(){z(p.conversationID),P(null)}},{children:i("div",n({className:"manage-handle-title red"},{children:"Delete"}))}))]}))]}))]}))}export{f as TUIManage};
1
+ import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as a,useEffect as o}from"react";import{Icon as t}from"../Icon/Icon.js";import{IconTypes as r}from"../Icon/type.js";import{Avatar as s}from"../Avatar/Avatar.js";import{defaultGroupAvatarWork as l,defaultUserAvatar as c}from"../Avatar/default.js";import{Switch as m}from"../Switch/Switch.js";import{useTUIKitContext as d}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{getMessageProfile as v}from"../ConversationPreview/utils.js";import{useConversationUpdate as u}from"../TUIConversationList/hooks/useConversationUpdate.js";import{useConversation as h}from"../../hooks/useConversation.js";function f(){var f=a(null),p=f[0],g=f[1],I=a(null),C=I[0],N=I[1],j=a(!1),k=j[0],x=j[1],D=a(0),U=D[0],w=D[1],T=d("TUIManage"),A=T.conversation,M=T.setActiveConversation,P=T.tim,S=T.TUIManageShow,b=T.setTUIManageShow;u(null,(function(){w((function(n){return n+1}))}));var y=h(P),L=y.pinConversation,z=y.deleteConversation;return o((function(){g(A),N(v(A)),x(!!A&&A.isPinned)}),[A,U]),S&&A&&e("div",n({className:"tui-manage"},{children:[e("div",n({className:"tui-manage-title"},{children:[i(t,{type:r.CANCEL,width:16,height:16,onClick:function(){b(!1)}}),i("span",{children:"Conversation Information"})]})),e("div",n({className:"tui-manage-container"},{children:[e("div",n({className:"tui-manage-info"},{children:[i("div",n({className:"info-avatar"},{children:i(s,{size:64,image:(null==C?void 0:C.avatar)||((null==C?void 0:C.groupID)?l:c)})})),i("div",n({className:"info-name"},{children:(null==C?void 0:C.nick)||(null==C?void 0:C.name)})),e("div",n({className:"info-id"},{children:["ID:",(null==C?void 0:C.userID)||(null==C?void 0:C.groupID)]}))]})),e("div",n({className:"tui-manage-handle"},{children:[e("div",n({className:"manage-handle-box"},{children:[i("div",n({className:"manage-handle-title"},{children:"Pin"})),i(m,{onChange:function(n){x(n.target.checked),L({conversationID:p.conversationID,isPinned:n.target.checked})},checked:k})]})),i("div",n({className:"manage-handle-box",role:"presentation",onClick:function(){z(p.conversationID),M(null)}},{children:i("div",n({className:"manage-handle-title red"},{children:"Delete"}))}))]}))]}))]}))}export{f as TUIManage};
@@ -1 +1 @@
1
- import{__assign as r}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import m from"react";function o(m){var o=m.context;m.message;var i=m.children;return t("div",r({className:"message-audio"},{children:[e("audio",{muted:!0,src:o.url}),i]}))}var i=m.memo(o);function a(t){return e(i,r({},t))}export{a as MessageAudio};
1
+ import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as c,useCallback as i,useEffect as u}from"react";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as s}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";function m(r){var m=r.context,p=r.message,f=r.children,v=s().setAudioSource,h=a("MessageAudioWithContext").audioSource,x=o(0),g=x[0],C=x[1],I=c(null),j=o(!1),E=j[0],y=j[1],L=i((function(){h&&h!==(null==I?void 0:I.current)&&(h.pause(),h.currentTime=0,v(null)),(null==I?void 0:I.current)&&(I.current.paused?(I.current.play(),y(!0),v(I.current)):(I.current.pause(),N()))}),[I,h]),T=function(){y(!1)},N=function(){v(null),I.current.currentTime=0,T()};return u((function(){return(null==I?void 0:I.current)&&(I.current.addEventListener("pause",T),I.current.addEventListener("ended",N),I.current.addEventListener("canplay",(function(){C(parseInt("".concat(I.current.duration),10))}))),function(){(null==I?void 0:I.current)&&(I.current.removeEventListener("pause",T),I.current.removeEventListener("ended",N))}}),[I]),t("div",e({className:"message-audio"},{children:[t("div",e({className:"message-audio-content message-audio-".concat(p.flow)},{children:[n(l,{className:"".concat(null==p?void 0:p.flow," ").concat(E?"playing":""),type:d.VOICE,width:16,height:16,onClick:L}),n("span",{children:"".concat(g,"s")})]})),n("audio",e({src:null==m?void 0:m.url,ref:I,controls:!0,className:"message-audio-none"},{children:n("track",{kind:"captions"})})),f]}))}var p=r.memo(m);function f(t){return n(p,e({},t))}export{f as MessageAudio};
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import"tslib";import"react";import{messageShowType as r}from"../../context/TUIMessageContext.js";import{Avatar as o}from"../Avatar/Avatar.js";import{handleDisplayAvatar as a}from"../untils.js";function e(e){e.className;var m=e.CustomAvatar,s=e.message,i=e.showType;return(i===r.ALL||(null==s?void 0:s.flow)===i)&&i!==r.NONE?m||t(o,{size:32,image:a(null==s?void 0:s.avatar)}):null}export{e as MessageAvatar};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as s,jsxs as l}from"react/jsx-runtime";import n,{useState as o}from"react";import t from"tim-js-sdk";import{MESSAGE_STATUS as a}from"../../constants.js";import{Icon as i}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{useMessageReply as r}from"./hooks/useMessageReply.js";function c(n){var c=n.message,u=n.children,d=n.Context,p=n.Plugins,b=o(!1),g=b[0],v=b[1],f=r({message:c}),h=f.messageReply,N=f.replyMessage,y=f.sender;return l("div",e({className:"meesage-bubble"},{children:[l("div",e({className:"meesage-bubble-context ".concat(null==c?void 0:c.flow),onMouseEnter:function(){v(!0)},onMouseLeave:function(){v(!1)}},{children:[l("div",e({className:"message-context\n ".concat(h?"meesage-bubble-reply meesage-bubble-reply-".concat(null==c?void 0:c.flow):"","\n ").concat((null==c?void 0:c.type)!==t.TYPES.MSG_IMAGE&&(null==c?void 0:c.type)!==t.TYPES.MSG_VIDEO&&(null==c?void 0:c.type)!==t.TYPES.MSG_FILE||(null==c?void 0:c.status)!==a.UNSEND?"":"loading")},{children:[h&&l("main",e({className:"meesage-bubble-reply-main"},{children:[s("header",e({className:"title"},{children:y})),d&&s(d,{message:N})]})),u]})),s("div",e({className:"message-plugin"},{children:g&&p&&s(p,{})}))]})),l("div",e({className:"message-bubble-status icon"},{children:[(null==c?void 0:c.status)===a.FAIL&&s("i",{className:"icon-fail"}),(null==c?void 0:c.status)===a.UNSEND&&s(i,{width:10,height:10,type:m.PROGRESS})]}))]}))}var u=n.memo(c);function d(l){return s(u,e({},l))}export{d as MessageBubble};
1
+ import{__assign as e}from"tslib";import{jsx as s,jsxs as t}from"react/jsx-runtime";import o,{useState as n}from"react";import i from"tim-js-sdk";import{MESSAGE_STATUS as l}from"../../constants.js";import{useTUIChatActionContext as a}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as r}from"../Icon/type.js";import{useMessageReply as c}from"./hooks/useMessageReply.js";import{MessageProgress as u}from"./MessageProgress.js";function d(o){var d=o.message,g=o.children,p=o.Context,b=o.Plugins,f=n(!1),v=f[0],h=f[1],I=c({message:d}),N=I.messageReply,y=I.replyMessage,M=I.sender,x=a().setHighlightedMessageId;return t("div",e({className:"meesage-bubble"},{children:[t("div",e({className:"meesage-bubble-context ".concat(null==d?void 0:d.flow),onMouseEnter:function(){h(!0)},onMouseLeave:function(){h(!1)}},{children:[t("div",e({className:"message-context\n ".concat(N?"meesage-bubble-reply meesage-bubble-reply-".concat(null==d?void 0:d.flow):"","\n ").concat((null==d?void 0:d.type)!==i.TYPES.MSG_IMAGE&&(null==d?void 0:d.type)!==i.TYPES.MSG_VIDEO&&(null==d?void 0:d.type)!==i.TYPES.MSG_FILE||(null==d?void 0:d.status)!==l.UNSEND?"":"loading")},{children:[N&&t("div",e({className:"meesage-bubble-reply-main",role:"menuitem",tabIndex:0,onClick:function(){x(null==y?void 0:y.ID)}},{children:[s("header",e({className:"title"},{children:M})),p&&s(p,{message:y})]})),g,s(u,{message:d})]})),b&&s("div",e({className:"message-plugin"},{children:v&&s(b,{})}))]})),t("div",e({className:"message-bubble-status icon"},{children:[(null==d?void 0:d.status)===l.FAIL&&s("i",{className:"icon-fail"}),(null==d?void 0:d.status)===l.UNSEND&&s(m,{width:10,height:10,type:r.PROGRESS})]}))]}))}var g=o.memo(d);function p(t){return s(g,e({},t))}export{p as MessageBubble};
@@ -1,7 +1,9 @@
1
+ import React from 'react';
1
2
  import { Message } from 'tim-js-sdk';
2
3
 
3
4
  interface MessageContextProps {
4
5
  message?: Message;
5
6
  }
7
+ declare function MessageContext(props: MessageContextProps): React.ReactElement;
6
8
 
7
- export { MessageContextProps };
9
+ export { MessageContext, MessageContextProps };
@@ -1 +1 @@
1
- import{__assign as r}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import t from"react";import{JSONStringToParse as o}from"../untils.js";function i(t){var i=t.context,a=t.message,l=t.children;return n("div",r({className:"bubble message-custom bubble-".concat(a.flow)},{children:[function(n){if("Hyperlink"===n.data){var t=o(null==n?void 0:n.extension);return null==t?void 0:t.item.map((function(n){return e("a",r({target:"_blank",href:n.value,rel:"noreferrer"},{children:n.value}),n.value)}))}return"group_create"===n.data?"".concat((null==a?void 0:a.nick)||(null==a?void 0:a.from)," Create a group"):n.extension}(null==i?void 0:i.custom),l]}))}var a=t.memo(i);function l(n){return e(a,r({},n))}export{l as MessageCustom};
1
+ import{__assign as r}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import o from"react";import t from"tim-js-sdk";import{JSONStringToParse as i}from"../untils.js";function a(o){var a=o.context,l=o.message,u=o.children;return n("div",r({className:"bubble message-custom bubble-".concat(l.flow," ").concat((null==l?void 0:l.conversationType)===t.TYPES.CONV_GROUP?"group":"")},{children:[function(n){if("Hyperlink"===n.data){var o=i(null==n?void 0:n.extension);return null==o?void 0:o.item.map((function(n){return e("a",r({target:"_blank",href:n.value,rel:"noreferrer"},{children:n.value}),n.value)}))}return"group_create"===n.data?"".concat((null==l?void 0:l.nick)||(null==l?void 0:l.from)," Create a group"):n.extension}(null==a?void 0:a.custom),u]}))}var l=o.memo(a);function u(n){return e(l,r({},n))}export{u as MessageCustom};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as i,jsxs as s}from"react/jsx-runtime";import m from"react";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";function o(m){var o=m.context,l=m.message,n=m.children;return s("div",e({className:"bubble message-file bubble-".concat(l.flow)},{children:[s("main",e({className:"message-file-main"},{children:[i(r,{className:"icon",width:15,height:20,type:a.FILE}),i("label",e({htmlFor:"message-file"},{children:o.name}))]})),s("div",e({className:"message-file-footer"},{children:[i("span",e({className:"message-file-size"},{children:o.size})),n]}))]}))}var l=m.memo(o);function n(s){return i(l,e({},s))}export{n as MessageFile};
1
+ import{__assign as e}from"tslib";import{jsx as r,jsxs as o}from"react/jsx-runtime";import a from"react";import i from"tim-js-sdk";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";function n(a){var n=a.context,t=a.message,l=a.children;return o("a",e({href:n.url,download:n.name,target:"_parent",className:"bubble message-file bubble-".concat(t.flow," ").concat((null==t?void 0:t.conversationType)===i.TYPES.CONV_GROUP?"group":""),rel:"noreferrer"},{children:[o("main",e({className:"message-file-main"},{children:[r(m,{className:"icon",width:15,height:20,type:s.FILE}),r("label",e({htmlFor:"message-file"},{children:n.name}))]})),o("div",e({className:"message-file-footer"},{children:[r("span",e({className:"message-file-size"},{children:n.size})),l]}))]}))}var t=a.memo(n);function l(o){return r(t,e({},o))}export{l as MessageFile};
@@ -1 +1 @@
1
- import{__assign as i}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import e,{useState as n}from"react";import{Model as l}from"../Model/index.js";function t(e){var t,a,m,c=e.context,d=e.message,u=e.children,s=n(!1),f=s[0],v=s[1],g=null===(a=null===(t=null==d?void 0:d.payload)||void 0===t?void 0:t.imageInfoArray)||void 0===a?void 0:a.filter((function(i){return 0===i.type}));return r("div",i({className:"message-image"},{children:[o("div",i({role:"button",tabIndex:0,onClick:function(){v(!0)}},{children:o("img",{className:"img bubble-".concat(d.flow),src:c.url,alt:""})})),u,f&&o(l,i({onClick:function(){v(!1)}},{children:o("img",{className:"big-image",src:null===(m=g[0])||void 0===m?void 0:m.url,alt:""})}))]}))}var a=e.memo(t);function m(r){return o(a,i({},r))}export{m as MessageImage};
1
+ import{__assign as i}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import n,{useState as e}from"react";import t from"tim-js-sdk";import{Model as l}from"../Model/index.js";function m(n){var m,a,c,d=n.context,u=n.message,s=n.children,f=e(!1),v=f[0],g=f[1],p=null===(a=null===(m=null==u?void 0:u.payload)||void 0===m?void 0:m.imageInfoArray)||void 0===a?void 0:a.filter((function(i){return 0===i.type}));return r("div",i({className:"message-image"},{children:[o("div",i({role:"button",tabIndex:0,onClick:function(){g(!0)}},{children:o("img",{className:"img bubble-".concat(u.flow," ").concat((null==u?void 0:u.conversationType)===t.TYPES.CONV_GROUP?"group":""),src:d.url,alt:""})})),s,v&&o(l,i({onClick:function(){g(!1)}},{children:o("img",{className:"big-image",src:null===(c=p[0])||void 0===c?void 0:c.url,alt:""})}))]}))}var a=n.memo(m);function c(r){return o(a,i({},r))}export{c as MessageImage};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as r,jsxs as t}from"react/jsx-runtime";import a from"react";function i(a){var i=a.context,m=a.message,s=a.children;return t("div",e({className:"bubble message-merger bubble-".concat(m.flow)},{children:[r("h3",{children:i.title}),r("ul",e({className:"message-merger-list"},{children:(null==i?void 0:i.abstractList.length)>0&&i.abstractList.map((function(t,a){var i=t+a;return r("li",e({className:"message-merger-item"},{children:t}),i)}))})),s]}))}var m=a.memo(i);function s(t){return r(m,e({},t))}export{s as MessageMerger};
1
+ import{__assign as e}from"tslib";import{jsx as r,jsxs as t}from"react/jsx-runtime";import i from"react";import m from"tim-js-sdk";function s(i){var s=i.context,a=i.message,n=i.children;return t("div",e({className:"bubble message-merger bubble-".concat(a.flow," ").concat((null==a?void 0:a.conversationType)===m.TYPES.CONV_GROUP?"group":"")},{children:[r("h3",{children:s.title}),r("ul",e({className:"message-merger-list"},{children:(null==s?void 0:s.abstractList.length)>0&&s.abstractList.map((function(t,i){var m=t+i;return r("li",e({className:"message-merger-item"},{children:t}),m)}))})),n]}))}var a=i.memo(s);function n(t){return r(a,e({},t))}export{n as MessageMerger};
@@ -0,0 +1 @@
1
+ import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import e from"tim-js-sdk";import"react";import{messageShowType as r}from"../../context/TUIMessageContext.js";function m(m){m.className;var l=m.CustomName,n=m.message,i=m.showType;return(i===r.ALL||(null==n?void 0:n.flow)===i)&&(null==n?void 0:n.conversationType)===e.TYPES.CONV_GROUP&&i!==r.NONE?l||t("label",o({htmlFor:"content",className:"name"},{children:(null==n?void 0:n.nick)||(null==n?void 0:n.from)})):null}export{m as MessageName};
@@ -0,0 +1,24 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import tim_js_sdk__default from 'tim-js-sdk';
3
+ import { PluginsProps } from '../Plugins/index.js';
4
+
5
+ declare enum PluginsNameEnum {
6
+ quote = "quote",
7
+ forward = "forward",
8
+ copy = "copy",
9
+ delete = "delete",
10
+ resend = "resend",
11
+ revoke = "revoke"
12
+ }
13
+ type MessagePluginConfigProps = {
14
+ [propsName in PluginsNameEnum]?: {
15
+ isShow?: boolean;
16
+ relateMessageType?: tim_js_sdk__default.TYPES[];
17
+ };
18
+ };
19
+ interface MessagePluginsProps extends PluginsProps {
20
+ config?: MessagePluginConfigProps;
21
+ }
22
+ declare function MessagePlugins<T extends MessagePluginsProps>(props: PropsWithChildren<T>): React.ReactElement;
23
+
24
+ export { MessagePluginConfigProps, MessagePlugins, MessagePluginsProps };
@@ -1 +1 @@
1
- import{__assign as e,__spreadArray as s}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import{useState as i,useRef as l}from"react";import o from"tim-js-sdk";import{Plugins as a}from"../Plugins/index.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as c}from"../Icon/type.js";import{useTUIChatStateContext as m}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as d}from"../../context/TUIMessageContext.js";import{useMessageHandler as h}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as g,MESSAGE_FLOW as p}from"../../constants.js";import"date-fns";import{useMessagePluginElement as u}from"./hooks/useMessagePluginElement.js";function f(f){var M=f.plugins,v=f.showNumber,N=void 0===v?0:v,C=f.MoreIcon,y=i(""),w=y[0],E=y[1],R=l(null),j=d("MessagePlugins").message,S=m("MessageBubbleWithContext").messageListRef,x=h({message:j}),I=x.handleDelMessage,T=x.handleRevokeMessage,O=x.handleReplyMessage,U=x.handleCopyMessage,b=x.handleResendMessage,P=x.handleForWardMessage,D=u({children:n("div",e({className:"message-plugin-item"},{children:[t("span",{children:"Recall"}),t(r,{width:20,height:20,type:c.REVOCATION})]})),handle:function(e){R.current.closeMore(),T(e)},message:j}),k=u({children:n("div",e({className:"message-plugin-item"},{children:[t("span",e({className:"del"},{children:"Delete"})),t(r,{width:20,height:20,type:c.DEL})]})),handle:function(e){R.current.closeMore(),I(e)},message:j}),F=u({children:n("div",e({className:"message-plugin-item"},{children:[t("span",{children:"Quote"}),t(r,{width:20,height:20,type:c.QUOTE})]})),handle:function(e){R.current.closeMore(),O(e)},message:j}),L=u({children:n("div",e({className:"message-plugin-item"},{children:[t("span",{children:"Copy"}),t(r,{width:20,height:20,type:c.COPY})]})),handle:function(e){R.current.closeMore(),U(e)},message:j}),W=u({children:n("div",e({className:"message-plugin-item"},{children:[t("span",{children:"Resend"}),t(r,{width:20,height:20,type:c.REPLY})]})),handle:function(e){R.current.closeMore(),b(e)},message:j}),Y=u({children:n("div",e({className:"message-plugin-item"},{children:[t("span",{children:"Forward"}),t(r,{width:20,height:20,type:c.FORWARD})]})),handle:function(e){R.current.closeMore(),P(e)},message:j}),A=(null==j?void 0:j.status)===g.SUCCESS?[F,Y,k]:[W];(null==j?void 0:j.status)===g.SUCCESS&&j.flow===p.OUT&&(A=s([D],A,!0)),j.type===o.TYPES.MSG_TEXT&&A.splice(-1,0,L);var Q=M||A,V=C||t(r,{className:"icon-more",width:16,height:16,type:c.MORE});return(null==j?void 0:j.status)!==g.UNSEND&&t(a,{className:"message-plugin",customClass:w,ref:R,plugins:Q,showNumber:N,MoreIcon:V,root:null==S?void 0:S.current,handleVisible:function(e){E("".concat(!e.top&&"message-plugin-top"," ").concat(!e.left&&"message-plugin-left"))}})}export{f as MessagePlugins};
1
+ import{__assign as e}from"tslib";import{jsxs as s,jsx as o}from"react/jsx-runtime";import{useState as l,useRef as i}from"react";import n from"tim-js-sdk";import{Plugins as t}from"../Plugins/index.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";import{useTUIChatStateContext as d}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as u}from"../../context/TUIMessageContext.js";import{useMessageHandler as c}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as h,MESSAGE_FLOW as g}from"../../constants.js";import"date-fns";import{useMessagePluginElement as m}from"./hooks/useMessagePluginElement.js";var p;function v(p){var v,f,S,w,M,y,C=p.plugins,T=p.showNumber,E=p.MoreIcon,N=p.config,k=l(""),R=k[0],U=k[1],j=i(null),I=u("MessagePlugins"),x=I.message,b=I.plugin,q=d("MessageBubbleWithContext").messageListRef,O=c({message:x}),P=O.handleDelMessage,D=O.handleRevokeMessage,F=O.handleReplyMessage,L=O.handleCopyMessage,W=O.handleResendMessage,Y=O.handleForWardMessage,A={quote:e(e({isShow:!0},null==N?void 0:N.quote),null===(v=null==b?void 0:b.config)||void 0===v?void 0:v.quote),forward:e(e({isShow:!0},null==N?void 0:N.forward),null===(f=null==b?void 0:b.config)||void 0===f?void 0:f.forward),copy:e(e({isShow:!0,relateMessageType:[n.TYPES.MSG_TEXT]},null==N?void 0:N.copy),null===(S=null==b?void 0:b.config)||void 0===S?void 0:S.copy),delete:e(e({isShow:!0},null==N?void 0:N.delete),null===(w=null==b?void 0:b.config)||void 0===w?void 0:w.delete),revoke:e(e({isShow:!0},null==N?void 0:N.revoke),null===(M=null==b?void 0:b.config)||void 0===M?void 0:M.revoke),resend:e(e({isShow:!0},null==N?void 0:N.resend),null===(y=null==b?void 0:b.config)||void 0===y?void 0:y.resend)},Q=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:"Recall"}),o(r,{width:20,height:20,type:a.REVOCATION})]})),handle:function(e){j.current.closeMore(),D(e)},message:x,isShow:A.revoke.isShow&&(null==x?void 0:x.status)===h.SUCCESS&&x.flow===g.OUT,relateMessageType:A.revoke.relateMessageType}),V=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",e({className:"del"},{children:"Delete"})),o(r,{width:20,height:20,type:a.DEL})]})),handle:function(e){j.current.closeMore(),P(e)},message:x,isShow:A.delete.isShow&&(null==x?void 0:x.status)===h.SUCCESS,relateMessageType:A.delete.relateMessageType}),B=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:"Quote"}),o(r,{width:20,height:20,type:a.QUOTE})]})),handle:function(e){j.current.closeMore(),F(e)},message:x,isShow:A.quote.isShow&&(null==x?void 0:x.status)===h.SUCCESS,relateMessageType:A.quote.relateMessageType}),G=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:"Copy"}),o(r,{width:20,height:20,type:a.COPY})]})),handle:function(e){j.current.closeMore(),L(e)},message:x,isShow:A.copy.isShow&&(null==x?void 0:x.status)===h.SUCCESS,relateMessageType:A.copy.relateMessageType}),H=m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:"Resend"}),o(r,{width:20,height:20,type:a.REPLY})]})),handle:function(e){j.current.closeMore(),W(e)},message:x,isShow:A.resend.isShow&&(null==x?void 0:x.status)!==h.SUCCESS,relateMessageType:A.resend.relateMessageType}),X=[Q,B,m({children:s("div",e({className:"message-plugin-item"},{children:[o("span",{children:"Forward"}),o(r,{width:20,height:20,type:a.FORWARD})]})),handle:function(e){j.current.closeMore(),Y(e)},message:x,isShow:A.forward.isShow&&(null==x?void 0:x.status)===h.SUCCESS,relateMessageType:A.forward.relateMessageType}),V,H,G],_=(C||(null==b?void 0:b.plugins)||X).filter((function(e){return e})),z=E||(null==b?void 0:b.MoreIcon)||o(r,{className:"icon-more",width:16,height:16,type:a.MORE}),J=T||(null==b?void 0:b.showNumber)||0;return(null==x?void 0:x.status)!==h.UNSEND&&o(t,{className:"message-plugin",customClass:R,ref:j,plugins:_,showNumber:J,MoreIcon:z,root:null==q?void 0:q.current,handleVisible:function(e){U("".concat(!e.top&&"message-plugin-top"," ").concat(!e.left&&"message-plugin-left"))}})}!function(e){e.quote="quote",e.forward="forward",e.copy="copy",e.delete="delete",e.resend="resend",e.revoke="revoke"}(p||(p={}));export{v as MessagePlugins};
@@ -0,0 +1 @@
1
+ import{__assign as o}from"tslib";import{jsx as t,jsxs as s}from"react/jsx-runtime";import e,{useState as r,useEffect as n}from"react";import i from"tim-js-sdk";import{MESSAGE_STATUS as l}from"../../constants.js";import{useTUIChatStateContext as m}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as a}from"../../context/TUIMessageContext.js";function u(e){var u=e.message,d=e.children,p=e.Progress,g=e.isShow,c=void 0!==g&&g,v=r(),f=v[0],S=v[1],h=r(0),x=h[0],P=h[1],M=m("MessageProgressWithContext").uploadPenddingMessageList,E=a("MessageProgressWithContext"),I=E.isShowProgress,j=void 0!==I&&I,C=E.Progress,T=p||C,y=c||j;return n((function(){M&&M.length>0&&M.map((function(o){return(null==o?void 0:o.ID)===(null==u?void 0:u.ID)&&(S(o),P(null==o?void 0:o.progress)),o}))}),[M]),y?T?t(T,{message:f}):!((null==u?void 0:u.type)!==i.TYPES.MSG_IMAGE&&(null==u?void 0:u.type)!==i.TYPES.MSG_VIDEO&&(null==u?void 0:u.type)!==i.TYPES.MSG_FILE||(null==u?void 0:u.status)!==l.UNSEND)&&s("div",o({className:"progress-box"},{children:[t("span",{className:"progress",style:{width:"".concat(100*x,"%")}}),d]})):null}var d=e.memo(u);function p(s){return t(d,o({},s))}export{p as MessageProgress};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as o,jsxs as n}from"react/jsx-runtime";import r,{useCallback as t}from"react";import i from"tim-js-sdk";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import{useTUIChatActionContext as a}from"../../context/TUIChatActionContext.js";function m(r){var m=r.message,c=a().operateMessage,d=t((function(){var e;c(((e={})[l.REVOKE]=m,e))}),[c]);return n("div",e({className:"bubble message-system message-revoke"},{children:[(null==m?void 0:m.flow)===s.IN&&o("span",{children:(null==m?void 0:m.nick)||(null==m?void 0:m.from)}),(null==m?void 0:m.flow)!==s.IN&&o("span",{children:"you "}),o("span",{children:"recalled a message"}),(null==m?void 0:m.flow)===s.OUT&&(null==m?void 0:m.type)===i.TYPES.MSG_TEXT&&o("span",e({className:"edit",role:"button",tabIndex:0,onClick:d},{children:" Re-edit"}))]}))}var c=r.memo(m);function d(n){return o(c,e({},n))}export{d as MessageRevoke};
1
+ import{__assign as e}from"tslib";import{jsx as o,jsxs as t}from"react/jsx-runtime";import n,{useCallback as r}from"react";import s from"tim-js-sdk";import{MESSAGE_OPERATE as i,MESSAGE_FLOW as l}from"../../constants.js";import{useTUIChatActionContext as a}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function m(n){var m=n.message,c=a().operateMessage,d=r((function(){var e;c(((e={})[i.REVOKE]=m,e))}),[c]);return t("div",e({className:"bubble message-system message-revoke"},{children:[(null==m?void 0:m.flow)===l.IN&&o("span",{children:(null==m?void 0:m.nick)||(null==m?void 0:m.from)}),(null==m?void 0:m.flow)!==l.IN&&o("span",{children:"you "}),o("span",{children:" recalled a message"}),(null==m?void 0:m.flow)===l.OUT&&(null==m?void 0:m.type)===s.TYPES.MSG_TEXT&&o("span",e({className:"edit",role:"button",tabIndex:0,onClick:d},{children:" Re-edit"}))]}))}var c=n.memo(m);function d(t){return o(c,e({},t))}export{d as MessageRevoke};
@@ -1 +1 @@
1
- import{__assign as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import t from"react";import{getTimeStamp as m}from"../untils.js";function i(t){var i=t.message,s=e("div",r({className:"time"},{children:(null==i?void 0:i.time)?m(1e3*i.time):0}));return e("div",r({className:"message-status"},{children:s}))}var s=t.memo(i);function o(t){return e(s,r({},t))}export{o as MessageStatus};
1
+ import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import i from"react";import{useTUIMessageContext as r}from"../../context/TUIMessageContext.js";import{getTimeStamp as m}from"../untils.js";function s(i){var s=i.message,o=r("MessageStatustWithContext").isShowTime,a=(void 0===o||o)&&e("div",t({className:"time"},{children:(null==s?void 0:s.time)?m(1e3*s.time):0}));return e("div",t({className:"message-status"},{children:a}))}var o=i.memo(s);function a(i){return e(o,t({},i))}export{a as MessageStatus};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as r}from"react/jsx-runtime";import t from"react";import"../../constants.js";import{useMessageContextHandler as s}from"./hooks/useMessageContextHandler.js";function o(t){var o=t.message,m=s({message:o}).context;return r("div",e({className:"bubble message-system"},{children:r("div",{children:m})}))}var m=t.memo(o);function n(t){return r(m,e({},t))}export{n as MessageSystem};
1
+ import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import r from"react";import"../../constants.js";import"../../context/TUIMessageContext.js";import{useMessageContextHandler as s}from"./hooks/useMessageContextHandler.js";function o(r){var o=r.message,m=s({message:o}).context;return t("div",e({className:"bubble message-system"},{children:t("div",{children:m})}))}var m=r.memo(o);function n(r){return t(m,e({},r))}export{n as MessageSystem};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,jsxs as r}from"react/jsx-runtime";import m from"react";function a(m){var a=m.context,c=m.message,n=m.children;return e("div",t({className:"bubble message-text bubble-".concat(c.flow)},{children:r("div",t({className:"message-text-content"},{children:[a.text.map((function(t,r){var m=c.ID+r;return"text"===t.name?t.text:e("img",{className:"text-img",src:t.src,alt:""},t.src+m)})),n]}))}))}var c=m.memo(a);function n(r){return e(c,t({},r))}export{n as MessageText};
1
+ import{__assign as t}from"tslib";import{jsx as e,jsxs as r}from"react/jsx-runtime";import c from"react";import n from"tim-js-sdk";function s(c){var s=c.context,m=c.message,a=c.children;return e("div",t({className:"bubble message-text bubble-".concat(m.flow," ").concat((null==m?void 0:m.conversationType)===n.TYPES.CONV_GROUP?"group":"")},{children:r("div",t({className:"message-text-content"},{children:[s.text.map((function(r,c){var n=m.ID+c;return"text"===r.name?e("p",t({className:"message-text-content-p"},{children:r.text}),r.src+n):e("img",{className:"text-img",src:r.src,alt:""},r.src+n)})),a]}))}))}var m=c.memo(s);function a(r){return e(m,t({},r))}export{a as MessageText};