@tencentcloud/chat-uikit-react 2.3.0 → 2.3.1

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 (269) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/cjs/components/Chat/Chat.js +1 -1
  3. package/dist/cjs/components/Chat/index.js +1 -1
  4. package/dist/cjs/components/ChatHeader/ChatHeader.js +1 -1
  5. package/dist/cjs/components/ChatHeader/ChatHeaderDefault.js +1 -1
  6. package/dist/cjs/components/ChatSetting/ChatSetting.js +1 -1
  7. package/dist/cjs/components/Contact/Contact.js +1 -1
  8. package/dist/cjs/components/Contact/ContactInfo/ContactInfo.js +1 -1
  9. package/dist/cjs/components/Contact/ContactInfo/addFriendInfo.js +1 -1
  10. package/dist/cjs/components/Contact/ContactInfo/basicInfo.js +1 -1
  11. package/dist/cjs/components/Contact/ContactInfo/blockInfo.js +1 -1
  12. package/dist/cjs/components/Contact/ContactInfo/friendApplication.js +1 -1
  13. package/dist/cjs/components/Contact/ContactInfo/friendInfo.js +1 -1
  14. package/dist/cjs/components/Contact/ContactInfo/groupInfo.js +1 -1
  15. package/dist/cjs/components/Contact/ContactInfo/hooks/useContactInfo.js +1 -1
  16. package/dist/cjs/components/Contact/ContactList/ContactList.js +1 -1
  17. package/dist/cjs/components/Contact/hooks/useTUIContact.js +1 -1
  18. package/dist/cjs/components/ContactSearch/ContactSearch.js +1 -1
  19. package/dist/cjs/components/ContactSearch/hooks/useContactSearch.js +1 -1
  20. package/dist/cjs/components/ConversationActions/ConversationActions.js +1 -1
  21. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  22. package/dist/cjs/components/ConversationCreate/ConversationCreateGroupDetail.js +1 -1
  23. package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  24. package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
  25. package/dist/cjs/components/ConversationList/ConversationList.js +1 -1
  26. package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
  27. package/dist/cjs/components/ConversationPreview/utils.js +1 -1
  28. package/dist/cjs/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js +1 -1
  29. package/dist/cjs/components/MessageElement/Message.js +1 -1
  30. package/dist/cjs/components/MessageElement/MessageAudio.js +1 -1
  31. package/dist/cjs/components/MessageElement/MessageAvatar.js +1 -1
  32. package/dist/cjs/components/MessageElement/MessageBubble.js +1 -1
  33. package/dist/cjs/components/MessageElement/MessageContext.js +1 -1
  34. package/dist/cjs/components/MessageElement/MessageCustom.js +1 -1
  35. package/dist/cjs/components/MessageElement/MessageDefault.js +1 -1
  36. package/dist/cjs/components/MessageElement/MessageName.js +1 -1
  37. package/dist/cjs/components/MessageElement/MessagePlugins.js +1 -1
  38. package/dist/cjs/components/MessageElement/MessageProgress.js +1 -1
  39. package/dist/cjs/components/MessageElement/MessageRevoke.js +1 -1
  40. package/dist/cjs/components/MessageElement/MessageStatus.js +1 -1
  41. package/dist/cjs/components/MessageElement/MessageSystem.js +1 -1
  42. package/dist/cjs/components/MessageElement/MessageText.js +1 -1
  43. package/dist/cjs/components/MessageElement/MessageTip.js +1 -1
  44. package/dist/cjs/components/MessageElement/hooks/useMessageHandler.js +1 -1
  45. package/dist/cjs/components/MessageElement/hooks/useMessageReply.js +1 -1
  46. package/dist/cjs/components/MessageElement/utils/decodeText.js +1 -1
  47. package/dist/cjs/components/MessageElement/utils/emojiMap.js +1 -1
  48. package/dist/cjs/components/MessageElement/utils/index.js +1 -1
  49. package/dist/cjs/components/MessageInput/EmojiPicker.js +1 -1
  50. package/dist/cjs/components/MessageInput/Forward.js +1 -1
  51. package/dist/cjs/components/MessageInput/InputPluginsDefalut.js +1 -1
  52. package/dist/cjs/components/MessageInput/InputQuoteDefalut.js +1 -1
  53. package/dist/cjs/components/MessageInput/MessageInput.js +1 -1
  54. package/dist/cjs/components/MessageInput/MessageInputDefault.js +1 -1
  55. package/dist/cjs/components/MessageInput/hooks/useEmojiPicker.js +1 -1
  56. package/dist/cjs/components/MessageInput/hooks/useHandleForwardMessage.js +1 -1
  57. package/dist/cjs/components/MessageInput/hooks/useHandleQuoteMessage.js +1 -1
  58. package/dist/cjs/components/MessageInput/hooks/useMessageInputText.js +1 -1
  59. package/dist/cjs/components/MessageList/MessageList.js +1 -1
  60. package/dist/cjs/components/MessageList/hooks/useMessageListElement.js +1 -1
  61. package/dist/cjs/components/Profile/Profile.js +1 -1
  62. package/dist/cjs/components/Profile/ProfileDefault.js +1 -1
  63. package/dist/cjs/context/UIKitContext.js +1 -1
  64. package/dist/cjs/index.css +2 -2
  65. package/dist/cjs/index.d.css +213 -207
  66. package/dist/cjs/index.d.ts +0 -3
  67. package/dist/cjs/index.js +1 -1
  68. package/dist/cjs/locales/en-US/emoji.js +1 -0
  69. package/dist/cjs/locales/en-US/index.js +1 -1
  70. package/dist/cjs/locales/index.js +1 -1
  71. package/dist/cjs/locales/ja-JP/emoji.js +1 -0
  72. package/dist/cjs/locales/ja-JP/index.js +1 -1
  73. package/dist/cjs/locales/ko-KR/emoji.js +1 -0
  74. package/dist/cjs/locales/ko-KR/index.js +1 -1
  75. package/dist/cjs/locales/zh-CN/emoji.js +1 -0
  76. package/dist/cjs/locales/zh-CN/index.js +1 -1
  77. package/dist/cjs/locales/zh-TW/emoji.js +1 -0
  78. package/dist/cjs/locales/zh-TW/index.js +1 -1
  79. package/dist/cjs/node_modules/zustand/esm/react.mjs.js +1 -0
  80. package/dist/cjs/node_modules/zustand/esm/vanilla.mjs.js +1 -0
  81. package/dist/cjs/store/UIManagerStore.js +1 -0
  82. package/dist/esm/components/Chat/Chat.js +1 -1
  83. package/dist/esm/components/Chat/index.js +1 -1
  84. package/dist/esm/components/ChatHeader/ChatHeader.js +1 -1
  85. package/dist/esm/components/ChatHeader/ChatHeaderDefault.js +1 -1
  86. package/dist/esm/components/ChatSetting/ChatSetting.js +1 -1
  87. package/dist/esm/components/Contact/Contact.js +1 -1
  88. package/dist/esm/components/Contact/ContactInfo/ContactInfo.js +1 -1
  89. package/dist/esm/components/Contact/ContactInfo/addFriendInfo.js +1 -1
  90. package/dist/esm/components/Contact/ContactInfo/basicInfo.js +1 -1
  91. package/dist/esm/components/Contact/ContactInfo/blockInfo.js +1 -1
  92. package/dist/esm/components/Contact/ContactInfo/friendApplication.js +1 -1
  93. package/dist/esm/components/Contact/ContactInfo/friendInfo.js +1 -1
  94. package/dist/esm/components/Contact/ContactInfo/groupInfo.js +1 -1
  95. package/dist/esm/components/Contact/ContactInfo/hooks/useContactInfo.js +1 -1
  96. package/dist/esm/components/Contact/ContactList/ContactList.js +1 -1
  97. package/dist/esm/components/Contact/hooks/useTUIContact.js +1 -1
  98. package/dist/esm/components/ContactSearch/ContactSearch.js +1 -1
  99. package/dist/esm/components/ContactSearch/hooks/useContactSearch.js +1 -1
  100. package/dist/esm/components/ConversationActions/ConversationActions.js +1 -1
  101. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  102. package/dist/esm/components/ConversationCreate/ConversationCreateGroupDetail.js +1 -1
  103. package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  104. package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
  105. package/dist/esm/components/ConversationList/ConversationList.js +1 -1
  106. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
  107. package/dist/esm/components/ConversationPreview/utils.js +1 -1
  108. package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js +1 -1
  109. package/dist/esm/components/MessageElement/Message.js +1 -1
  110. package/dist/esm/components/MessageElement/MessageAudio.js +1 -1
  111. package/dist/esm/components/MessageElement/MessageAvatar.js +1 -1
  112. package/dist/esm/components/MessageElement/MessageBubble.js +1 -1
  113. package/dist/esm/components/MessageElement/MessageContext.js +1 -1
  114. package/dist/esm/components/MessageElement/MessageCustom.js +1 -1
  115. package/dist/esm/components/MessageElement/MessageDefault.js +1 -1
  116. package/dist/esm/components/MessageElement/MessageName.js +1 -1
  117. package/dist/esm/components/MessageElement/MessagePlugins.js +1 -1
  118. package/dist/esm/components/MessageElement/MessageProgress.js +1 -1
  119. package/dist/esm/components/MessageElement/MessageRevoke.js +1 -1
  120. package/dist/esm/components/MessageElement/MessageStatus.js +1 -1
  121. package/dist/esm/components/MessageElement/MessageSystem.js +1 -1
  122. package/dist/esm/components/MessageElement/MessageText.js +1 -1
  123. package/dist/esm/components/MessageElement/MessageTip.js +1 -1
  124. package/dist/esm/components/MessageElement/hooks/useMessageHandler.js +1 -1
  125. package/dist/esm/components/MessageElement/hooks/useMessageReply.js +1 -1
  126. package/dist/esm/components/MessageElement/utils/decodeText.js +1 -1
  127. package/dist/esm/components/MessageElement/utils/emojiMap.js +1 -1
  128. package/dist/esm/components/MessageElement/utils/index.js +1 -1
  129. package/dist/esm/components/MessageInput/EmojiPicker.js +1 -1
  130. package/dist/esm/components/MessageInput/Forward.js +1 -1
  131. package/dist/esm/components/MessageInput/InputPluginsDefalut.js +1 -1
  132. package/dist/esm/components/MessageInput/InputQuoteDefalut.js +1 -1
  133. package/dist/esm/components/MessageInput/MessageInput.js +1 -1
  134. package/dist/esm/components/MessageInput/MessageInputDefault.js +1 -1
  135. package/dist/esm/components/MessageInput/hooks/useEmojiPicker.js +1 -1
  136. package/dist/esm/components/MessageInput/hooks/useHandleForwardMessage.js +1 -1
  137. package/dist/esm/components/MessageInput/hooks/useHandleQuoteMessage.js +1 -1
  138. package/dist/esm/components/MessageInput/hooks/useMessageInputText.js +1 -1
  139. package/dist/esm/components/MessageList/MessageList.js +1 -1
  140. package/dist/esm/components/MessageList/hooks/useMessageListElement.js +1 -1
  141. package/dist/esm/components/Profile/Profile.js +1 -1
  142. package/dist/esm/components/Profile/ProfileDefault.js +1 -1
  143. package/dist/esm/context/UIKitContext.js +1 -1
  144. package/dist/esm/index.css +2 -2
  145. package/dist/esm/index.d.css +213 -207
  146. package/dist/esm/index.d.ts +0 -3
  147. package/dist/esm/index.js +1 -1
  148. package/dist/esm/locales/en-US/emoji.js +1 -0
  149. package/dist/esm/locales/en-US/index.js +1 -1
  150. package/dist/esm/locales/index.js +1 -1
  151. package/dist/esm/locales/ja-JP/emoji.js +1 -0
  152. package/dist/esm/locales/ja-JP/index.js +1 -1
  153. package/dist/esm/locales/ko-KR/emoji.js +1 -0
  154. package/dist/esm/locales/ko-KR/index.js +1 -1
  155. package/dist/esm/locales/zh-CN/emoji.js +1 -0
  156. package/dist/esm/locales/zh-CN/index.js +1 -1
  157. package/dist/esm/locales/zh-TW/emoji.js +1 -0
  158. package/dist/esm/locales/zh-TW/index.js +1 -1
  159. package/dist/esm/node_modules/zustand/esm/react.mjs.js +1 -0
  160. package/dist/esm/node_modules/zustand/esm/vanilla.mjs.js +1 -0
  161. package/dist/esm/store/UIManagerStore.js +1 -0
  162. package/package.json +5 -3
  163. package/src/components/Chat/Chat.tsx +3 -3
  164. package/src/components/Chat/styles/layout.scss +1 -1
  165. package/src/components/ChatHeader/ChatHeaderDefault.tsx +4 -3
  166. package/src/components/ChatHeader/styles/layout.scss +1 -1
  167. package/src/components/ChatSetting/ChatSetting.tsx +8 -7
  168. package/src/components/ChatSetting/styles/index.scss +2 -1
  169. package/src/components/Checkbox/styles/color.scss +1 -1
  170. package/src/components/Contact/Contact.tsx +4 -4
  171. package/src/components/Contact/ContactInfo/ContactInfo.tsx +2 -2
  172. package/src/components/Contact/ContactInfo/addFriendInfo.tsx +38 -36
  173. package/src/components/Contact/ContactInfo/basicInfo.tsx +10 -10
  174. package/src/components/Contact/ContactInfo/blockInfo.tsx +4 -4
  175. package/src/components/Contact/ContactInfo/friendApplication.tsx +4 -4
  176. package/src/components/Contact/ContactInfo/friendInfo.tsx +7 -7
  177. package/src/components/Contact/ContactInfo/groupInfo.tsx +23 -23
  178. package/src/components/Contact/ContactInfo/hooks/useContactInfo.tsx +2 -2
  179. package/src/components/Contact/ContactInfo/index.scss +1 -1
  180. package/src/components/Contact/ContactList/ContactList.tsx +5 -4
  181. package/src/components/Contact/ContactList/index.scss +1 -1
  182. package/src/components/Contact/hooks/useTUIContact.tsx +2 -2
  183. package/src/components/Contact/index.scss +1 -1
  184. package/src/components/ContactSearch/ContactSearch.tsx +5 -4
  185. package/src/components/ContactSearch/hooks/useContactSearch.tsx +4 -3
  186. package/src/components/ContactSearch/index.scss +1 -1
  187. package/src/components/ConversationActions/ConversationActions.scss +1 -1
  188. package/src/components/ConversationActions/ConversationActions.tsx +2 -2
  189. package/src/components/ConversationCreate/ConversationCreate.tsx +2 -2
  190. package/src/components/ConversationCreate/ConversationCreateGroupDetail.tsx +4 -4
  191. package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +4 -4
  192. package/src/components/ConversationCreate/ConversationGroupTypeInfo.tsx +2 -2
  193. package/src/components/ConversationCreate/styles/ConversationCreateGroupDetail.scss +1 -1
  194. package/src/components/ConversationCreate/styles/conversationCreateSelectView.scss +1 -1
  195. package/src/components/ConversationCreate/styles/conversationGroupTypeInfo.scss +1 -1
  196. package/src/components/ConversationCreate/styles/index.scss +1 -1
  197. package/src/components/ConversationList/ConversationList.scss +1 -1
  198. package/src/components/ConversationList/ConversationListContent/ConversationListContent.scss +1 -1
  199. package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.scss +1 -1
  200. package/src/components/ConversationPreview/ConversationPreview.scss +1 -1
  201. package/src/components/ConversationPreview/ConversationPreview.tsx +3 -3
  202. package/src/components/ConversationPreview/utils.tsx +2 -2
  203. package/src/components/ConversationSearch/ConversationSearch.scss +1 -1
  204. package/src/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.scss +1 -1
  205. package/src/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.tsx +2 -2
  206. package/src/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.scss +1 -1
  207. package/src/components/DivWithEdit/styles/index.scss +1 -1
  208. package/src/components/Icon/styles/index.scss +1 -1
  209. package/src/components/Input/styles/index.scss +2 -2
  210. package/src/components/MessageElement/MessageCustom.tsx +4 -4
  211. package/src/components/MessageElement/MessagePlugins.tsx +3 -3
  212. package/src/components/MessageElement/MessageRevoke.tsx +5 -5
  213. package/src/components/MessageElement/MessageStatus.tsx +2 -1
  214. package/src/components/MessageElement/hooks/useMessageHandler.ts +9 -6
  215. package/src/components/MessageElement/hooks/useMessageReply.ts +3 -2
  216. package/src/components/MessageElement/styles/color.scss +1 -1
  217. package/src/components/MessageElement/styles/layout.scss +2 -2
  218. package/src/components/MessageElement/utils/decodeText.ts +59 -9
  219. package/src/components/MessageElement/utils/emojiMap.ts +73 -474
  220. package/src/components/MessageElement/utils/index.ts +1 -5
  221. package/src/components/MessageInput/EmojiPicker.tsx +10 -8
  222. package/src/components/MessageInput/Forward.tsx +2 -2
  223. package/src/components/MessageInput/InputPluginsDefalut.tsx +2 -2
  224. package/src/components/MessageInput/InputQuoteDefalut.tsx +6 -6
  225. package/src/components/MessageInput/MessageInput.tsx +0 -1
  226. package/src/components/MessageInput/MessageInputDefault.tsx +5 -5
  227. package/src/components/MessageInput/hooks/useEmojiPicker.tsx +11 -16
  228. package/src/components/MessageInput/hooks/useHandleForwardMessage.tsx +3 -4
  229. package/src/components/MessageInput/hooks/useMessageInputText.tsx +17 -11
  230. package/src/components/MessageInput/styles/color.scss +1 -1
  231. package/src/components/MessageInput/styles/layout.scss +2 -2
  232. package/src/components/MessageList/MessageList.tsx +2 -2
  233. package/src/components/MessageList/hooks/useMessageListElement.tsx +3 -2
  234. package/src/components/MessageList/styles/layout.scss +1 -1
  235. package/src/components/Plugins/styles/color.scss +1 -1
  236. package/src/components/Profile/Profile.tsx +2 -2
  237. package/src/components/Profile/ProfileDefault.tsx +4 -4
  238. package/src/components/Profile/myProfile/styles/index.scss +1 -1
  239. package/src/components/Profile/styles/color.scss +1 -1
  240. package/src/components/Profile/styles/layout.scss +1 -1
  241. package/src/context/UIKitContext.tsx +2 -8
  242. package/src/context/UIManagerContext.tsx +5 -5
  243. package/src/context/index.ts +0 -1
  244. package/src/locales/en-US/emoji.ts +66 -0
  245. package/src/locales/en-US/index.ts +2 -0
  246. package/src/locales/index.ts +4 -22
  247. package/src/locales/ja-JP/emoji.ts +66 -0
  248. package/src/locales/ja-JP/index.ts +2 -0
  249. package/src/locales/ko-KR/emoji.ts +66 -0
  250. package/src/locales/ko-KR/index.ts +2 -0
  251. package/src/locales/zh-CN/emoji.ts +66 -0
  252. package/src/locales/zh-CN/index.ts +2 -0
  253. package/src/locales/zh-TW/emoji.ts +65 -0
  254. package/src/locales/zh-TW/index.ts +2 -0
  255. package/src/store/UIManagerStore.ts +108 -0
  256. package/src/store/index.ts +5 -0
  257. package/.babelrc +0 -7
  258. package/.editorconfig +0 -16
  259. package/.husky/pre-commit +0 -4
  260. package/.lintstagedrc.json +0 -6
  261. package/.stylelintrc.js +0 -40
  262. package/dist/cjs/context/UIManagerContext.d.ts +0 -46
  263. package/dist/cjs/context/UIManagerContext.js +0 -1
  264. package/dist/cjs/locales/index.d.ts +0 -6
  265. package/dist/esm/context/UIManagerContext.d.ts +0 -46
  266. package/dist/esm/context/UIManagerContext.js +0 -1
  267. package/dist/esm/locales/index.d.ts +0 -6
  268. package/rollup.config.js +0 -81
  269. package/scripts/publish-npm.js +0 -22
@@ -1 +1 @@
1
- import{__assign as o}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r}from"react";import{ConversationListProvider as i,useConversationList as n}from"../../context/ConversationListContext.js";import{ConversationListHeader as a}from"./ConversationListHeader/ConversationListHeader.js";import{ConversationListContent as s}from"./ConversationListContent/ConversationListContent.js";import"react-i18next";import"../Icon/config.js";import"../Icon/type.js";import c from"classnames";import{ConversationPreview as v,ConversationPreviewUI as l}from"../ConversationPreview/ConversationPreview.js";import{Avatar as d}from"../Avatar/Avatar.js";import{PlaceHolder as m,PlaceHolderTypes as C}from"../PlaceHolder/index.js";import{ConversationSearch as p}from"../ConversationSearch/ConversationSearch.js";import{ConversationCreate as f}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import"../../context/MessageContext.js";import"@tencentcloud/chat";import{ConversationActions as h}from"../ConversationActions/ConversationActions.js";import{isH5 as u}from"../../utils/env.js";function L(i){var L=i.enableSearch,j=void 0===L||L,A=i.enableCreate,g=void 0===A||A,P=i.enableActions,y=void 0===P||P,b=i.actionsConfig,S=i.Header,x=void 0===S?a:S,N=i.List,E=void 0===N?s:N,I=i.Preview,w=void 0===I?l:I,O=i.ConversationCreate,k=void 0===O?f:O,H=i.ConversationSearch,G=void 0===H?p:H,R=i.ConversationActions,_=void 0===R?h:R,B=i.PlaceholderEmptyList,D=void 0===B?e(m,{type:C.NO_CONVERSATIONS}):B,M=i.PlaceholderLoading,T=void 0===M?e(m,{type:C.LOADING}):M,V=i.PlaceholderLoadError,W=void 0===V?e(m,{type:C.WRONG}):V,q=i.Avatar,z=void 0===q?d:q,F=i.onSelectConversation,J=i.onBeforeCreateConversation,K=i.onConversationCreated,Q=i.className,U=i.style,X=n(),Y=X.conversationList,Z=X.filteredAndSortedConversationList,$=X.isLoading,oo=X.isLoadError,eo=r(!1),to=eo[0],ro=eo[1];return t("div",o({className:c(Q,"uikit-chat-list",{"uikit-chat-list--mobile":u}),style:U},{children:[t(x,{children:[e(G,{visible:j,conversationList:Y,Avatar:z,ResultPreview:v}),e(k,{className:c({"uikit-chat-list__header--creating":to}),visible:g,onChangeCreateModelVisible:function(o){return ro(o)},onBeforeCreateConversation:J,onConversationCreated:K})]}),e(E,o({empty:0===Z.length,loading:$,error:oo,PlaceholderEmptyList:D,PlaceholderLoadError:W,PlaceholderLoading:T},{children:Z.map((function(o){return e(v,{conversation:o,enableActions:y,Preview:w,Avatar:z,ConversationActions:_,onSelectConversation:F,actionsConfig:b},o.conversationID)}))}))]}))}function j(t){return e(i,o({filter:t.filter,sort:t.sort},{children:e(L,o({},t))}))}export{j as ConversationList};
1
+ import{__assign as o}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r}from"react";import{ConversationListProvider as i,useConversationList as n}from"../../context/ConversationListContext.js";import{ConversationListHeader as a}from"./ConversationListHeader/ConversationListHeader.js";import{ConversationListContent as s}from"./ConversationListContent/ConversationListContent.js";import"@tencentcloud/uikit-base-component-react";import"../Icon/config.js";import"../Icon/type.js";import v from"classnames";import{ConversationPreview as c,ConversationPreviewUI as l}from"../ConversationPreview/ConversationPreview.js";import{Avatar as d}from"../Avatar/Avatar.js";import{PlaceHolder as m,PlaceHolderTypes as C}from"../PlaceHolder/index.js";import{ConversationSearch as p}from"../ConversationSearch/ConversationSearch.js";import{ConversationCreate as f}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"../../store/UIManagerStore.js";import"@tencentcloud/chat-uikit-engine";import"@tencentcloud/chat";import{ConversationActions as h}from"../ConversationActions/ConversationActions.js";import{isH5 as u}from"../../utils/env.js";function L(i){var L=i.enableSearch,j=void 0===L||L,A=i.enableCreate,g=void 0===A||A,P=i.enableActions,b=void 0===P||P,y=i.actionsConfig,S=i.Header,N=void 0===S?a:S,I=i.List,E=void 0===I?s:I,k=i.Preview,w=void 0===k?l:k,x=i.ConversationCreate,O=void 0===x?f:x,H=i.ConversationSearch,G=void 0===H?p:H,R=i.ConversationActions,_=void 0===R?h:R,B=i.PlaceholderEmptyList,D=void 0===B?e(m,{type:C.NO_CONVERSATIONS}):B,M=i.PlaceholderLoading,T=void 0===M?e(m,{type:C.LOADING}):M,V=i.PlaceholderLoadError,U=void 0===V?e(m,{type:C.WRONG}):V,W=i.Avatar,q=void 0===W?d:W,z=i.onSelectConversation,F=i.onBeforeCreateConversation,J=i.onConversationCreated,K=i.className,Q=i.style,X=n(),Y=X.conversationList,Z=X.filteredAndSortedConversationList,$=X.isLoading,oo=X.isLoadError,eo=r(!1),to=eo[0],ro=eo[1];return t("div",o({className:v(K,"uikit-chat-list",{"uikit-chat-list--mobile":u}),style:Q},{children:[t(N,{children:[e(G,{visible:j,conversationList:Y,Avatar:q,ResultPreview:c}),e(O,{className:v({"uikit-chat-list__header--creating":to}),visible:g,onChangeCreateModelVisible:function(o){return ro(o)},onBeforeCreateConversation:F,onConversationCreated:J})]}),e(E,o({empty:0===Z.length,loading:$,error:oo,PlaceholderEmptyList:D,PlaceholderLoadError:U,PlaceholderLoading:T},{children:Z.map((function(o){return e(c,{conversation:o,enableActions:b,Preview:w,Avatar:q,ConversationActions:_,onSelectConversation:z,actionsConfig:y},o.conversationID)}))}))]}))}function j(t){return e(i,o({filter:t.filter,sort:t.sort},{children:e(L,o({},t))}))}export{j as ConversationList};
@@ -1 +1 @@
1
- import{__assign as i}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useState as r,useEffect as s}from"react";import a from"classnames";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as v}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{ConversationActions as u}from"../ConversationActions/ConversationActions.js";import{useConversationList as m}from"../../context/ConversationListContext.js";import{useUIManager as d}from"../../context/UIManagerContext.js";import{useUIKit as h}from"../../context/UIKitContext.js";import"../../context/MessageContext.js";import p from"../../hooks/useLongPress.js";import g from"../../hooks/useMouseHover.js";import{generateHighlightTitle as f,getLatestMessagePreview as C}from"./utils.js";import{getTimeStamp as k}from"../utils.js";import{isH5 as M}from"../../utils/env.js";function _(t){var n=t.conversation,o=t.isSelected,r=void 0!==o&&o,s=t.enableActions,p=void 0===s||s,g=t.highlightMatchString,M=t.Preview,_=void 0===M?w:M,A=t.Avatar,j=void 0===A?l:A,x=t.ConversationActions,N=void 0===x?u:x,S=t.Title,b=void 0===S?function(t){var n=t.conversation,o=t.highlightMatchString;return e("div",i({className:"uikit-conversation-preview__title text-ellipsis"},{children:f(n,o).map((function(t,n){return e("span",i({className:a({"uikit-conversation-preview__title--highlight":t.isHighlight,"uikit-conversation-preview__title--normal":!t.isHighlight})},{children:t.text}),n)}))}))}({conversation:n,highlightMatchString:g}):S,L=t.LastMessageTimestamp,y=void 0===L?function(t){var n,o=t.conversation,r=h().language;return e("div",i({className:"uikit-conversation-preview__time"},{children:k(1e3*+((null===(n=o.lastMessage)||void 0===n?void 0:n.lastTime)||0),r)}))}({conversation:n}):L,T=t.LastMessageAbstract,I=void 0===T?function(t){var n=t.conversation,o=d().myProfile;return e("div",i({className:"uikit-conversation-preview__abstract"},{children:C(n,o)}))}({conversation:n}):T,P=t.Unread,U=void 0===P?function(t){var n,o=t.conversation;return n=o.isMuted?e(c,{type:v.MUTE,width:16,height:16}):o.unreadCount>99?"99+":0===o.unreadCount?null:o.unreadCount,e("div",i({className:"uikit-conversation-preview__unread"},{children:n}))}({conversation:n}):P,D=t.onSelectConversation,H=t.actionsConfig,z=t.className,E=t.style,K=t.children;return m().setCurrentConversation,e(_,{conversation:n,isSelected:r,enableActions:p,highlightMatchString:g,Avatar:j,ConversationActions:N,Title:b,LastMessageTimestamp:y,LastMessageAbstract:I,Unread:U,onSelectConversation:D,actionsConfig:H,className:z,style:E,children:K})}function w(c){var v=c.conversation,d=c.isSelected,h=c.enableActions,f=c.Avatar,C=void 0===f?l:f,k=c.ConversationActions,_=void 0===k?u:k,w=c.Title,A=c.LastMessageTimestamp,j=c.LastMessageAbstract,x=c.Unread,N=c.onSelectConversation,S=c.actionsConfig,b=c.className,L=c.style,y=c.children,T=m(),I=T.currentConversation,P=T.setCurrentConversation,U=o(null),D=r(!1),H=D[0],z=D[1],E=g(U),K=p({},{delay:500,shouldPreventDefault:!0}).isLongPressing;s((function(){z(E||K)}),[E,K]);return e("div",i({ref:U,className:a("uikit-conversation-preview",b,{"uikit-conversation-preview--mobile":M,"uikit-conversation-preview--active":d||v.conversationID===(null==I?void 0:I.conversationID),"uikit-conversation-preview--unread":!v.isMuted&&v.unreadCount>0,"uikit-conversation-preview--pin":v.isPinned,"uikit-conversation-preview--mute":v.isMuted}),style:L,onClick:function(){null==N||N(v),P(v)}},{children:y||t(n,{children:[e("div",i({className:"uikit-conversation-preview__avatar"},{children:e(C,{image:v.getAvatar(),size:40})})),t("div",i({className:"uikit-conversation-preview__content"},{children:[w,j]})),t("div",i({className:"uikit-conversation-preview__external"},{children:[x,h&&H?e(_,i({conversation:v},S)):A]}))]})}))}export{_ as ConversationPreview,w as ConversationPreviewUI};
1
+ import{__assign as i}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useState as r,useEffect as s}from"react";import a from"classnames";import{useUIKit as c}from"@tencentcloud/uikit-base-component-react";import{Icon as v}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";import{Avatar as u}from"../Avatar/Avatar.js";import{ConversationActions as m}from"../ConversationActions/ConversationActions.js";import{useConversationList as d}from"../../context/ConversationListContext.js";import{useUIManagerStore as h}from"../../store/UIManagerStore.js";import p from"../../hooks/useLongPress.js";import g from"../../hooks/useMouseHover.js";import{generateHighlightTitle as f,getLatestMessagePreview as C}from"./utils.js";import{getTimeStamp as k}from"../utils.js";import{isH5 as _}from"../../utils/env.js";function w(t){var n=t.conversation,o=t.isSelected,r=void 0!==o&&o,s=t.enableActions,p=void 0===s||s,g=t.highlightMatchString,_=t.Preview,w=void 0===_?A:_,M=t.Avatar,j=void 0===M?u:M,N=t.ConversationActions,S=void 0===N?m:N,b=t.Title,L=void 0===b?function(t){var n=t.conversation,o=t.highlightMatchString;return e("div",i({className:"uikit-conversation-preview__title text-ellipsis"},{children:f(n,o).map((function(t,n){return e("span",i({className:a({"uikit-conversation-preview__title--highlight":t.isHighlight,"uikit-conversation-preview__title--normal":!t.isHighlight})},{children:t.text}),n)}))}))}({conversation:n,highlightMatchString:g}):b,y=t.LastMessageTimestamp,T=void 0===y?function(t){var n,o=t.conversation,r=c().language;return e("div",i({className:"uikit-conversation-preview__time"},{children:k(1e3*+((null===(n=o.lastMessage)||void 0===n?void 0:n.lastTime)||0),r)}))}({conversation:n}):y,x=t.LastMessageAbstract,I=void 0===x?function(t){var n=t.conversation,o=h().myProfile;return e("div",i({className:"uikit-conversation-preview__abstract"},{children:C(n,o)}))}({conversation:n}):x,P=t.Unread,U=void 0===P?function(t){var n,o=t.conversation;return n=o.isMuted?e(v,{type:l.MUTE,width:16,height:16}):o.unreadCount>99?"99+":0===o.unreadCount?null:o.unreadCount,e("div",i({className:"uikit-conversation-preview__unread"},{children:n}))}({conversation:n}):P,D=t.onSelectConversation,H=t.actionsConfig,z=t.className,E=t.style,q=t.children;return d().setCurrentConversation,e(w,{conversation:n,isSelected:r,enableActions:p,highlightMatchString:g,Avatar:j,ConversationActions:S,Title:L,LastMessageTimestamp:T,LastMessageAbstract:I,Unread:U,onSelectConversation:D,actionsConfig:H,className:z,style:E,children:q})}function A(c){var v=c.conversation,l=c.isSelected,h=c.enableActions,f=c.Avatar,C=void 0===f?u:f,k=c.ConversationActions,w=void 0===k?m:k,A=c.Title,M=c.LastMessageTimestamp,j=c.LastMessageAbstract,N=c.Unread,S=c.onSelectConversation,b=c.actionsConfig,L=c.className,y=c.style,T=c.children,x=d(),I=x.currentConversation,P=x.setCurrentConversation,U=o(null),D=r(!1),H=D[0],z=D[1],E=g(U),q=p({},{delay:500,shouldPreventDefault:!0}).isLongPressing;s((function(){z(E||q)}),[E,q]);return e("div",i({ref:U,className:a("uikit-conversation-preview",L,{"uikit-conversation-preview--mobile":_,"uikit-conversation-preview--active":l||v.conversationID===(null==I?void 0:I.conversationID),"uikit-conversation-preview--unread":!v.isMuted&&v.unreadCount>0,"uikit-conversation-preview--pin":v.isPinned,"uikit-conversation-preview--mute":v.isMuted}),style:y,onClick:function(){null==S||S(v),P(v)}},{children:T||t(n,{children:[e("div",i({className:"uikit-conversation-preview__avatar"},{children:e(C,{image:v.getAvatar(),size:40})})),t("div",i({className:"uikit-conversation-preview__content"},{children:[A,j]})),t("div",i({className:"uikit-conversation-preview__external"},{children:[N,h&&H?e(w,i({conversation:v},b)):M]}))]})}))}export{w as ConversationPreview,A as ConversationPreviewUI};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as r,jsx as t,Fragment as o}from"react/jsx-runtime";import a from"@tencentcloud/chat-uikit-engine";import{formatEmojiString as i}from"../MessageElement/utils/emojiMap.js";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as n,defaultUserAvatar as c}from"../Avatar/default.js";var s=function(e,r){var t=e.getShowName();if(!r)return[{text:t,isHighlight:!1}];var o=r.toLowerCase();return t.split(new RegExp("(".concat(r,")"),"gi")).map((function(e){return{text:e,isHighlight:e.toLowerCase()===o}}))},l=function(o,n){var c,s=o.lastMessage,l=o.type;if(!s)return"";var u=s.fromAccount,p=s.nick,d=s.nameCard,f=s.isRevoked,m=s.messageForShow;s.type===a.TYPES.MSG_CUSTOM&&(null===(c=s.payload)||void 0===c?void 0:c.description)&&(m=s.payload.description);var C="";switch(l){case a.TYPES.CONV_GROUP:C=(null==s?void 0:s.fromAccount)===(null==n?void 0:n.userID)?"You":"".concat(d||p||u||""),C="".concat(C?"".concat(C,":"):"");break;case a.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[t("span",{children:C}),t("span",{children:s.isRevoked?"recalled a message":i(m,1)})]}))},u=function(e){if(!e)return null;var r={},t=e.type,o=e.groupProfile,i=e.userProfile;switch(t){case a.TYPES.CONV_C2C:r=i;break;case a.TYPES.CONV_GROUP:r=o}return r},p=function(i,n,c){void 0===c&&(c="#147AFF");var s=u(i),l=s.name,p=s.nick,d=s.groupID,f=s.userID,m=i.type,C=i.remark,v="";switch(m){case a.TYPES.CONV_C2C:v=C||p||f||"";break;case a.TYPES.CONV_GROUP:v=l||d||"";break;default:v=""}var h,w,g,O;return n?(w=(h=v).toLocaleLowerCase(),g=n&&w.indexOf(n.toLocaleLowerCase()),O=h.split(new RegExp("(".concat(n,")"),"gi")),""===g?t(o,{}):r("div",{children:[n&&O.map((function(r,o){return r.toLowerCase()===n.toLowerCase()?t("span",e({style:{color:c}},{children:r}),o):t("span",{children:r},o)})),";"]})):v},d=function(e){var r=e.type,t=u(e).avatar,o=t;if(!t)switch(r){case a.TYPES.CONV_C2C:o=c;break;case a.TYPES.CONV_GROUP:default:o=n}return o};export{s as generateHighlightTitle,d as getDisplayImage,p as getDisplayTitle,l as getLatestMessagePreview,u as getMessageProfile};
1
+ import{__assign as e}from"tslib";import{jsxs as r,jsx as t,Fragment as o}from"react/jsx-runtime";import a from"@tencentcloud/chat-uikit-engine";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as i,defaultUserAvatar as n}from"../Avatar/default.js";import{transformTextWithEmojiKeyToName as c}from"../MessageElement/utils/decodeText.js";var s=function(e,r){var t=e.getShowName();if(!r)return[{text:t,isHighlight:!1}];var o=r.toLowerCase();return t.split(new RegExp("(".concat(r,")"),"gi")).map((function(e){return{text:e,isHighlight:e.toLowerCase()===o}}))},l=function(o,i){var n,s=o.lastMessage,l=o.type;if(!s)return"";var u=s.fromAccount,p=s.nick,d=s.nameCard,f=s.isRevoked,m=s.messageForShow;s.type===a.TYPES.MSG_CUSTOM&&(null===(n=s.payload)||void 0===n?void 0:n.description)&&(m=s.payload.description);var C="";switch(l){case a.TYPES.CONV_GROUP:C=(null==s?void 0:s.fromAccount)===(null==i?void 0:i.userID)?"You":"".concat(d||p||u||""),C="".concat(C?"".concat(C,":"):"");break;case a.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[t("span",{children:C}),t("span",{children:s.isRevoked?"recalled a message":c(m)})]}))},u=function(e){if(!e)return null;var r={},t=e.type,o=e.groupProfile,i=e.userProfile;switch(t){case a.TYPES.CONV_C2C:r=i;break;case a.TYPES.CONV_GROUP:r=o}return r},p=function(i,n,c){void 0===c&&(c="#147AFF");var s=u(i),l=s.name,p=s.nick,d=s.groupID,f=s.userID,m=i.type,C=i.remark,v="";switch(m){case a.TYPES.CONV_C2C:v=C||p||f||"";break;case a.TYPES.CONV_GROUP:v=l||d||"";break;default:v=""}var h,w,g,O;return n?(w=(h=v).toLocaleLowerCase(),g=n&&w.indexOf(n.toLocaleLowerCase()),O=h.split(new RegExp("(".concat(n,")"),"gi")),""===g?t(o,{}):r("div",{children:[n&&O.map((function(r,o){return r.toLowerCase()===n.toLowerCase()?t("span",e({style:{color:c}},{children:r}),o):t("span",{children:r},o)})),";"]})):v},d=function(e){var r=e.type,t=u(e).avatar,o=t;if(!t)switch(r){case a.TYPES.CONV_C2C:o=n;break;case a.TYPES.CONV_GROUP:default:o=i}return o};export{s as generateHighlightTitle,d as getDisplayImage,p as getDisplayTitle,l as getLatestMessagePreview,u as getMessageProfile};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useTranslation as r}from"react-i18next";import{Icon as e}from"../../Icon/Icon.js";import{IconTypes as n}from"../../Icon/type.js";import{Input as t}from"../../Input/Input.js";import a from"classnames";function i(i){var c=i.className,m=i.placeholder,p=i.clearable,s=i.value,l=i.onChange,u=i.prefix,f=void 0===u?o(e,{type:n.SEARCH,height:16,width:16}):u,h=i.onFocus,v=i.onBlur,I=r().t;return o(t,{className:a("uikit-conversation-search-input",c),placeholder:m||I("TUIConversation.Search"),clearable:p,value:s,onChange:l,onFocus:h,onBlur:v,prefix:f})}export{i as ConversationSearchInput};
1
+ import{jsx as o}from"react/jsx-runtime";import{useUIKit as e}from"@tencentcloud/uikit-base-component-react";import{Icon as r}from"../../Icon/Icon.js";import{IconTypes as n}from"../../Icon/type.js";import{Input as t}from"../../Input/Input.js";import a from"classnames";function c(c){var i=c.className,m=c.placeholder,p=c.clearable,s=c.value,l=c.onChange,u=c.prefix,f=void 0===u?o(r,{type:n.SEARCH,height:16,width:16}):u,h=c.onFocus,v=c.onBlur,I=e().t;return o(t,{className:a("uikit-conversation-search-input",i),placeholder:m||I("TUIConversation.Search"),clearable:p,value:s,onChange:l,onFocus:h,onBlur:v,prefix:f})}export{c as ConversationSearchInput};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as l}from"../../context/ChatStateContext.js";import{TUIMessageContextProvider as s}from"../../context/MessageContext.js";import{useComponentContext as n}from"../../context/ComponentContext.js";import{useMessageHandler as i}from"./hooks/useMessageHandler.js";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import{TUIMessageDefault as m}from"./MessageDefault.js";import{MessagePlugins as a}from"./MessagePlugins.js";import{MessageContext as r}from"./MessageContext.js";function u(o){var i=o.message,u=o.TUIMessage,d=o.MessagePlugins,g=o.MessageContext,c=o.handleDelete,v=o.CustemElement,f=o.TextElement,p=o.ImageElement,E=o.VideoElement,h=o.AudioElement,x=o.FileElement,M=o.MergerElement,w=o.LocationElement,C=o.FaceElement,j=o.className,P=o.filter,S=o.isShowTime,A=o.isShowRead,N=o.plugin,T=o.prefix,I=o.suffix,D=o.customName,F=o.showAvatar,L=o.showName,R=o.customAvatar,V=o.isShowProgress,k=o.Progress,U=n(),b=U.MessagePlugins,y=U.MessageContext,H=l("TUIMessage").messageConfig,q=u||m,z=d||b||a,B=g||y||r,G=P||(null==H?void 0:H.filter),J=i||(null==H?void 0:H.message);G&&J&&G(J);var K={message:J,handleDelete:c||(null==H?void 0:H.handleDelete),CustemElement:v||(null==H?void 0:H.CustemElement),TextElement:f||(null==H?void 0:H.TextElement),ImageElement:p||(null==H?void 0:H.ImageElement),VideoElement:E||(null==H?void 0:H.VideoElement),AudioElement:h||(null==H?void 0:H.AudioElement),FileElement:x||(null==H?void 0:H.FileElement),MergerElement:M||(null==H?void 0:H.MergerElement),LocationElement:w||(null==H?void 0:H.LocationElement),FaceElement:C||(null==H?void 0:H.FaceElement),isShowTime:S||(null==H?void 0:H.isShowTime),isShowRead:A||(null==H?void 0:H.isShowRead),plugin:N||(null==H?void 0:H.plugin),prefix:T||(null==H?void 0:H.prefix),suffix:I||(null==H?void 0:H.suffix),customName:D||(null==H?void 0:H.customName),showAvatar:F||(null==H?void 0:H.showAvatar),showName:L||(null==H?void 0:H.showName),customAvatar:R||(null==H?void 0:H.customAvatar),isShowProgress:V||(null==H?void 0:H.isShowProgress),Progress:k||(null==H?void 0:H.Progress)};return t(s,e({value:K},{children:t(q,{message:J,MessageContext:B,MessagePlugins:z,className:j||(null==H?void 0:H.className)})}))}var d=o.memo(u);function g(o){var l=o.message,s=i({message:l}).handleDelMessage;return t(d,e({handleDelete:s},o))}export{g as TUIMessage};
1
+ import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as l}from"../../context/ChatStateContext.js";import{TUIMessageContextProvider as s}from"../../context/MessageContext.js";import{useComponentContext as n}from"../../context/ComponentContext.js";import"@tencentcloud/chat-uikit-engine";import{useMessageHandler as i}from"./hooks/useMessageHandler.js";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import{TUIMessageDefault as m}from"./MessageDefault.js";import{MessagePlugins as a}from"./MessagePlugins.js";import{MessageContext as r}from"./MessageContext.js";function u(o){var i=o.message,u=o.TUIMessage,d=o.MessagePlugins,g=o.MessageContext,c=o.handleDelete,v=o.CustemElement,f=o.TextElement,p=o.ImageElement,E=o.VideoElement,h=o.AudioElement,x=o.FileElement,M=o.MergerElement,w=o.LocationElement,C=o.FaceElement,j=o.className,P=o.filter,S=o.isShowTime,A=o.isShowRead,N=o.plugin,T=o.prefix,I=o.suffix,D=o.customName,F=o.showAvatar,L=o.showName,R=o.customAvatar,V=o.isShowProgress,k=o.Progress,U=n(),b=U.MessagePlugins,y=U.MessageContext,H=l("TUIMessage").messageConfig,q=u||m,z=d||b||a,B=g||y||r,G=P||(null==H?void 0:H.filter),J=i||(null==H?void 0:H.message);G&&J&&G(J);var K={message:J,handleDelete:c||(null==H?void 0:H.handleDelete),CustemElement:v||(null==H?void 0:H.CustemElement),TextElement:f||(null==H?void 0:H.TextElement),ImageElement:p||(null==H?void 0:H.ImageElement),VideoElement:E||(null==H?void 0:H.VideoElement),AudioElement:h||(null==H?void 0:H.AudioElement),FileElement:x||(null==H?void 0:H.FileElement),MergerElement:M||(null==H?void 0:H.MergerElement),LocationElement:w||(null==H?void 0:H.LocationElement),FaceElement:C||(null==H?void 0:H.FaceElement),isShowTime:S||(null==H?void 0:H.isShowTime),isShowRead:A||(null==H?void 0:H.isShowRead),plugin:N||(null==H?void 0:H.plugin),prefix:T||(null==H?void 0:H.prefix),suffix:I||(null==H?void 0:H.suffix),customName:D||(null==H?void 0:H.customName),showAvatar:F||(null==H?void 0:H.showAvatar),showName:L||(null==H?void 0:H.showName),customAvatar:R||(null==H?void 0:H.customAvatar),isShowProgress:V||(null==H?void 0:H.isShowProgress),Progress:k||(null==H?void 0:H.Progress)};return t(s,e({value:K},{children:t(q,{message:J,MessageContext:B,MessagePlugins:z,className:j||(null==H?void 0:H.className)})}))}var d=o.memo(u);function g(o){var l=o.message,s=i({message:l}).handleDelMessage;return t(d,e({handleDelete:s},o))}export{g as TUIMessage};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as c,useCallback as i,useEffect as u}from"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as a}from"../../context/ChatStateContext.js";import{useTUIChatActionContext as s}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";function m(r){var m=r.context,p=r.message,v=r.children,f=s().setAudioSource,h=a("MessageAudioWithContext").audioSource,x=o(0),g=x[0],C=x[1],j=c(null),E=o(!1),y=E[0],I=E[1],L=i((function(){h&&h!==(null==j?void 0:j.current)&&(h.pause(),h.currentTime=0,f&&f(null)),(null==j?void 0:j.current)&&(j.current.paused?(j.current.play(),I(!0),f&&f(j.current)):(j.current.pause(),N()))}),[j,h]),k=function(){I(!1)},N=function(){f&&f(null),j.current&&(j.current.currentTime=0),k()};return u((function(){return(null==j?void 0:j.current)&&(j.current.addEventListener("pause",k),j.current.addEventListener("ended",N),j.current.addEventListener("canplay",(function(){var e;C(parseInt("".concat(null===(e=j.current)||void 0===e?void 0:e.duration),10))}))),function(){(null==j?void 0:j.current)&&(j.current.removeEventListener("pause",k),j.current.removeEventListener("ended",N))}}),[j]),t("div",e({className:"message-audio"},{children:[t("div",e({className:"message-audio-content message-audio-".concat(null==p?void 0:p.flow)},{children:[n(l,{className:"".concat(null==p?void 0:p.flow," ").concat(y?"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:j,controls:!0,className:"message-audio-none"},{children:n("track",{kind:"captions"})})),v]}))}var p=r.memo(m);function v(t){return n(p,e({},t))}export{v as MessageAudio};
1
+ 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"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as a}from"../../context/ChatStateContext.js";import{useTUIChatActionContext as s}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";function m(r){var m=r.context,p=r.message,v=r.children,f=s().setAudioSource,h=a("MessageAudioWithContext").audioSource,x=o(0),g=x[0],C=x[1],j=c(null),E=o(!1),y=E[0],I=E[1],L=i((function(){h&&h!==(null==j?void 0:j.current)&&(h.pause(),h.currentTime=0,f&&f(null)),(null==j?void 0:j.current)&&(j.current.paused?(j.current.play(),I(!0),f&&f(j.current)):(j.current.pause(),N()))}),[j,h]),k=function(){I(!1)},N=function(){f&&f(null),j.current&&(j.current.currentTime=0),k()};return u((function(){return(null==j?void 0:j.current)&&(j.current.addEventListener("pause",k),j.current.addEventListener("ended",N),j.current.addEventListener("canplay",(function(){var e;C(parseInt("".concat(null===(e=j.current)||void 0===e?void 0:e.duration),10))}))),function(){(null==j?void 0:j.current)&&(j.current.removeEventListener("pause",k),j.current.removeEventListener("ended",N))}}),[j]),t("div",e({className:"message-audio"},{children:[t("div",e({className:"message-audio-content message-audio-".concat(null==p?void 0:p.flow)},{children:[n(l,{className:"".concat(null==p?void 0:p.flow," ").concat(y?"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:j,controls:!0,className:"message-audio-none"},{children:n("track",{kind:"captions"})})),v]}))}var p=r.memo(m);function v(t){return n(p,e({},t))}export{v as MessageAudio};
@@ -1 +1 @@
1
- import{jsx as t,Fragment as r}from"react/jsx-runtime";import"tslib";import"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{messageShowType as o}from"../../context/MessageContext.js";import{Avatar as e}from"../Avatar/Avatar.js";import{handleDisplayAvatar as i}from"../utils.js";function a(a){a.className;var m=a.CustomAvatar,n=a.message,s=a.showType;return(s===o.ALL||(null==n?void 0:n.flow)===s)&&s!==o.NONE?m||t(e,{size:32,image:i(null==n?void 0:n.avatar)}):t(r,{})}export{a as MessageAvatar};
1
+ import{jsx as t,Fragment as r}from"react/jsx-runtime";import"tslib";import"react";import"@tencentcloud/tui-core";import"react-i18next";import{messageShowType as o}from"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{Avatar as e}from"../Avatar/Avatar.js";import{handleDisplayAvatar as i}from"../utils.js";function a(a){a.className;var m=a.CustomAvatar,n=a.message,s=a.showType;return(s===o.ALL||(null==n?void 0:n.flow)===s)&&s!==o.NONE?m||t(e,{size:32,image:i(null==n?void 0:n.avatar)}):t(r,{})}export{a as MessageAvatar};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import l from"@tencentcloud/chat";import{MESSAGE_STATUS as a}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as c}from"../../context/ChatStateContext.js";import{useTUIChatActionContext as r}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{useMessageReply as d}from"./hooks/useMessageReply.js";import{MessageProgress as g}from"./MessageProgress.js";function p(s){var p=s.message,b=s.children,v=s.Context,f=s.Plugins,h=n(!1),I=h[0],x=h[1],M=d({message:p}),N=M.messageReply,y=M.replyMessage,S=M.sender,D=r(),E=D.setHighlightedMessageId,j=D.setActiveMessageID,C=c("MessageBubbleWithContext").activeMessageID;i((function(){C!==(null==p?void 0:p.ID)&&x(!1)}),[C]);return o("div",e({className:"meesage-bubble"},{children:[o("div",e({className:"meesage-bubble-context ".concat(null==p?void 0:p.flow),role:"button",tabIndex:0,onMouseEnter:function(){j&&p&&j(null==p?void 0:p.ID),x(!0)},onMouseLeave:function(){j&&p&&j(p.ID),x(!1)},onClick:function(){j&&p&&j(p.ID)}},{children:[o("div",e({className:"message-context\n ".concat(N?"meesage-bubble-reply meesage-bubble-reply-".concat(null==p?void 0:p.flow):"","\n ").concat((null==p?void 0:p.type)!==l.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==l.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==l.TYPES.MSG_FILE||(null==p?void 0:p.status)!==a.UNSEND?"":"loading")},{children:[N&&o("div",e({className:"meesage-bubble-reply-main",role:"menuitem",tabIndex:0,onClick:function(){E&&E(null==y?void 0:y.ID)}},{children:[t("header",e({className:"title"},{children:S})),v&&t(v,{message:y})]})),b,t(g,{message:p})]})),f&&t("div",e({className:"message-plugin"},{children:I&&t(f,{message:p})}))]})),o("div",e({className:"message-bubble-status icon"},{children:[(null==p?void 0:p.status)===a.FAIL&&t("i",{className:"icon-fail"}),(null==p?void 0:p.status)===a.UNSEND&&t(m,{width:10,height:10,type:u.PROGRESS})]}))]}))}var b=s.memo(p);function v(o){return t(b,e({},o))}export{v as MessageBubble};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import l from"@tencentcloud/chat";import{MESSAGE_STATUS as a}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as c}from"../../context/ChatStateContext.js";import{useTUIChatActionContext as r}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{useMessageReply as d}from"./hooks/useMessageReply.js";import{MessageProgress as g}from"./MessageProgress.js";function p(s){var p=s.message,b=s.children,v=s.Context,f=s.Plugins,h=n(!1),I=h[0],x=h[1],M=d({message:p}),N=M.messageReply,y=M.replyMessage,S=M.sender,D=r(),E=D.setHighlightedMessageId,j=D.setActiveMessageID,C=c("MessageBubbleWithContext").activeMessageID;i((function(){C!==(null==p?void 0:p.ID)&&x(!1)}),[C]);return o("div",e({className:"meesage-bubble"},{children:[o("div",e({className:"meesage-bubble-context ".concat(null==p?void 0:p.flow),role:"button",tabIndex:0,onMouseEnter:function(){j&&p&&j(null==p?void 0:p.ID),x(!0)},onMouseLeave:function(){j&&p&&j(p.ID),x(!1)},onClick:function(){j&&p&&j(p.ID)}},{children:[o("div",e({className:"message-context\n ".concat(N?"meesage-bubble-reply meesage-bubble-reply-".concat(null==p?void 0:p.flow):"","\n ").concat((null==p?void 0:p.type)!==l.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==l.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==l.TYPES.MSG_FILE||(null==p?void 0:p.status)!==a.UNSEND?"":"loading")},{children:[N&&o("div",e({className:"meesage-bubble-reply-main",role:"menuitem",tabIndex:0,onClick:function(){E&&E(null==y?void 0:y.ID)}},{children:[t("header",e({className:"title"},{children:S})),v&&t(v,{message:y})]})),b,t(g,{message:p})]})),f&&t("div",e({className:"message-plugin"},{children:I&&t(f,{message:p})}))]})),o("div",e({className:"message-bubble-status icon"},{children:[(null==p?void 0:p.status)===a.FAIL&&t("i",{className:"icon-fail"}),(null==p?void 0:p.status)===a.UNSEND&&t(m,{width:10,height:10,type:u.PROGRESS})]}))]}))}var b=s.memo(p);function v(o){return t(b,e({},o))}export{v as MessageBubble};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import m from"@tencentcloud/chat";import{MessageAudio as s}from"./MessageAudio.js";import{MessageCustom as r}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as n}from"./MessageFile.js";import{MessageImage as E}from"./MessageImage.js";import{MessageLocation as M}from"./MessageLocation.js";import{MessageMerger as S}from"./MessageMerger.js";import{MessageText as a}from"./MessageText.js";import{MessageVideo as p}from"./MessageVideo.js";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import{useTUIMessageContext as T}from"../../context/MessageContext.js";import{useMessageContextHandler as c}from"./hooks/useMessageContextHandler.js";import{MessageStatus as g}from"./MessageStatus.js";var G,f=((G={})[m.TYPES.MSG_TEXT]=a,G[m.TYPES.MSG_FACE]=i,G[m.TYPES.MSG_IMAGE]=E,G[m.TYPES.MSG_AUDIO]=s,G[m.TYPES.MSG_VIDEO]=p,G[m.TYPES.MSG_FILE]=n,G[m.TYPES.MSG_CUSTOM]=r,G[m.TYPES.MSG_MERGER]=S,G[m.TYPES.MSG_LOCATION]=M,G);function l(o){var s,r=o.message,i=c({message:r}).context,n=T("MessageCustom"),E=n.CustemElement,M=n.TextElement,S=n.FaceElement,a=n.ImageElement,p=n.AudioElement,G=n.VideoElement,l=n.FileElement,u=n.MergerElement,P=n.LocationElement,Y=((s={})[m.TYPES.MSG_TEXT]=M,s[m.TYPES.MSG_FACE]=S,s[m.TYPES.MSG_IMAGE]=a,s[m.TYPES.MSG_AUDIO]=p,s[m.TYPES.MSG_VIDEO]=G,s[m.TYPES.MSG_FILE]=l,s[m.TYPES.MSG_CUSTOM]=E,s[m.TYPES.MSG_MERGER]=u,s[m.TYPES.MSG_LOCATION]=P,s),_=(null==r?void 0:r.type)&&(Y[r.type]||f[r.type]);return _&&t(_,e({context:i,message:r},{children:t(g,{message:r})}))}var u=o.memo(l);function P(o){return t(u,e({},o))}export{P as MessageContext};
1
+ import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import r from"@tencentcloud/chat";import{MessageAudio as m}from"./MessageAudio.js";import{MessageCustom as s}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as n}from"./MessageFile.js";import{MessageImage as a}from"./MessageImage.js";import{MessageLocation as E}from"./MessageLocation.js";import{MessageMerger as M}from"./MessageMerger.js";import{MessageText as S}from"./MessageText.js";import{MessageVideo as p}from"./MessageVideo.js";import"@tencentcloud/uikit-base-component-react";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIMessageContext as c}from"../../context/MessageContext.js";import"../../store/UIManagerStore.js";import{useMessageContextHandler as T}from"./hooks/useMessageContextHandler.js";import{MessageStatus as g}from"./MessageStatus.js";var l,G=((l={})[r.TYPES.MSG_TEXT]=S,l[r.TYPES.MSG_FACE]=i,l[r.TYPES.MSG_IMAGE]=a,l[r.TYPES.MSG_AUDIO]=m,l[r.TYPES.MSG_VIDEO]=p,l[r.TYPES.MSG_FILE]=n,l[r.TYPES.MSG_CUSTOM]=s,l[r.TYPES.MSG_MERGER]=M,l[r.TYPES.MSG_LOCATION]=E,l);function f(o){var m,s=o.message,i=T({message:s}).context,n=c("MessageCustom"),a=n.CustemElement,E=n.TextElement,M=n.FaceElement,S=n.ImageElement,p=n.AudioElement,l=n.VideoElement,f=n.FileElement,u=n.MergerElement,P=n.LocationElement,Y=((m={})[r.TYPES.MSG_TEXT]=E,m[r.TYPES.MSG_FACE]=M,m[r.TYPES.MSG_IMAGE]=S,m[r.TYPES.MSG_AUDIO]=p,m[r.TYPES.MSG_VIDEO]=l,m[r.TYPES.MSG_FILE]=f,m[r.TYPES.MSG_CUSTOM]=a,m[r.TYPES.MSG_MERGER]=u,m[r.TYPES.MSG_LOCATION]=P,m),_=(null==s?void 0:s.type)&&(Y[s.type]||G[s.type]);return _&&t(_,e({context:i,message:s},{children:t(g,{message:s})}))}var u=o.memo(f);function P(o){return t(u,e({},o))}export{P as MessageContext};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import n from"react";import l from"@tencentcloud/chat";import{useTranslation as i}from"react-i18next";import{JSONStringToParse as a}from"../utils.js";import{isCallMessage as u}from"./utils/index.js";import"@tencentcloud/tui-core";import{useUIManager as c}from"../../context/UIManagerContext.js";import{useTUIChatActionContext as m}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import{useComponentContext as s}from"../../context/ComponentContext.js";import"@tencentcloud/chat-uikit-engine";import{CallMessage as d}from"@tencentcloud/call-uikit-react";import{startCall as p}from"../Chat/utils.js";function v(n){var v=n.context,f=n.message,g=n.children,C=i().t,x=m().callButtonClicked,h=s().MessageCustomPlugins,y=c().conversation;return r("div",t({className:"bubble message-custom bubble-".concat(null==f?void 0:f.flow," ").concat((null==f?void 0:f.conversationType)===l.TYPES.CONV_GROUP?"group":"")},{children:[function(n){if("Hyperlink"===n.data){var l=a(null==n?void 0:n.extension);if(null==l?void 0:l.item)return null==l?void 0:l.item.map((function(r){return e("a",t({target:"_blank",href:r.value,rel:"noreferrer"},{children:r.value}),r.value)}));if(null==l?void 0:l.hyperlinks_text){var i=l.hyperlinks_text;return r(o,{children:[l.title," ",e("a",t({target:"_blank",href:null==i?void 0:i.value,rel:"noreferrer"},{children:i.key}),null==i?void 0:i.value)]})}}if("group_create"===n.data)return"".concat((null==f?void 0:f.nick)||(null==f?void 0:f.from)," Create a group");var c=a(n.data);if(1===(null==c?void 0:c.chatbotPlugin)&&15===(null==c?void 0:c.src)&&("welcome_msg"===(null==c?void 0:c.subtype)||"clarify_msg"===(null==c?void 0:c.subtype)))return e(h,{data:a(n.data).content});if("C2C"===(null==y?void 0:y.type)&&f&&u(f)){var m=null==y?void 0:y.type,s=null==y?void 0:y.userProfile.userID;return e(d,{callType:m,message:f,onClick:function(t){var e=t.callMediaType;return p({callType:m,callMediaType:e,userIDList:[s],callButtonClicked:x})}})}return"[".concat(C("TUIChat.Custom message"),"]")}(null==v?void 0:v.custom),g]}))}var f=n.memo(v);function g(r){return e(f,t({},r))}export{g as MessageCustom};
1
+ import{__assign as t}from"tslib";import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import n from"react";import l from"@tencentcloud/chat";import{useUIKit as i}from"@tencentcloud/uikit-base-component-react";import{JSONStringToParse as a}from"../utils.js";import{isCallMessage as u}from"./utils/index.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatActionContext as c}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import{useComponentContext as m}from"../../context/ComponentContext.js";import"@tencentcloud/chat-uikit-engine";import{useUIManagerStore as s}from"../../store/UIManagerStore.js";import{CallMessage as d}from"@tencentcloud/call-uikit-react";import{startCall as p}from"../Chat/utils.js";function v(n){var v=n.context,f=n.message,g=n.children,C=i().t,h=c().callButtonClicked,x=m().MessageCustomPlugins,y=s().conversation;return r("div",t({className:"bubble message-custom bubble-".concat(null==f?void 0:f.flow," ").concat((null==f?void 0:f.conversationType)===l.TYPES.CONV_GROUP?"group":"")},{children:[function(n){if("Hyperlink"===n.data){var l=a(null==n?void 0:n.extension);if(null==l?void 0:l.item)return null==l?void 0:l.item.map((function(r){return e("a",t({target:"_blank",href:r.value,rel:"noreferrer"},{children:r.value}),r.value)}));if(null==l?void 0:l.hyperlinks_text){var i=l.hyperlinks_text;return r(o,{children:[l.title," ",e("a",t({target:"_blank",href:null==i?void 0:i.value,rel:"noreferrer"},{children:i.key}),null==i?void 0:i.value)]})}}if("group_create"===n.data)return"".concat((null==f?void 0:f.nick)||(null==f?void 0:f.from)," Create a group");var c=a(n.data);if(1===(null==c?void 0:c.chatbotPlugin)&&15===(null==c?void 0:c.src)&&("welcome_msg"===(null==c?void 0:c.subtype)||"clarify_msg"===(null==c?void 0:c.subtype)))return e(x,{data:a(n.data).content});if("C2C"===(null==y?void 0:y.type)&&f&&u(f)){var m=null==y?void 0:y.type,s=null==y?void 0:y.userProfile.userID;return e(d,{callType:m,message:f,onClick:function(t){var e=t.callMediaType;return p({callType:m,callMediaType:e,userIDList:[s],callButtonClicked:h})}})}return"[".concat(C("TUIChat.Custom message"),"]")}(null==v?void 0:v.custom),g]}))}var f=n.memo(v);function g(r){return e(f,t({},r))}export{g as MessageCustom};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsx as s,jsxs as o}from"react/jsx-runtime";import t from"react";import a from"@tencentcloud/chat";import{MessageBubble as i}from"./MessageBubble.js";import{MessageTip as m}from"./MessageTip.js";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIMessageContext as n,messageShowType as r}from"../../context/MessageContext.js";import{useComponentContext as l}from"../../context/ComponentContext.js";import{MessageSystem as c}from"./MessageSystem.js";import{MessageRevoke as u}from"./MessageRevoke.js";import{MessageName as d}from"./MessageName.js";import{MessageAvatar as g}from"./MessageAvatar.js";function p(t){var p=t.message,v=t.MessageContext,f=t.MessagePlugins,M=t.className,P=l(),S=P.MessageContext,T=P.MessagePlugins,x=n("TUIMessage"),N=x.prefix,_=x.suffix,h=x.customName,C=x.showAvatar,G=void 0===C?r.IN:C,I=x.showName,j=void 0===I?r.IN:I,R=x.customAvatar,y=v||S,E=f||T;return o("div",e({className:"message-default\n ".concat((null==p?void 0:p.type)===a.TYPES.MSG_GRP_TIP||(null==p?void 0:p.isRevoked)?"tip":null==p?void 0:p.flow,"\n ").concat(M,"\n ")},{children:[(null==p?void 0:p.type)===a.TYPES.MSG_GRP_TIP&&s(m,{message:p}),(null==p?void 0:p.type)===a.TYPES.MSG_GRP_SYS_NOTICE&&s(c,{message:p}),(null==p?void 0:p.isRevoked)&&s(u,{message:p}),(null==p?void 0:p.type)!==a.TYPES.MSG_GRP_TIP&&(null==p?void 0:p.type)!==a.TYPES.MSG_GRP_SYS_NOTICE&&!(null==p?void 0:p.isRevoked)&&o("div",e({className:"".concat(null==p?void 0:p.flow)},{children:[N,p&&s(g,{message:p,CustomAvatar:R,showType:G}),o("main",e({"data-message-id":null==p?void 0:p.ID,className:"content"},{children:[s(d,{message:p,CustomName:h,showType:j}),s(i,e({message:p,Context:y,Plugins:E},{children:s(y,{message:p})}))]})),_]}),null==p?void 0:p.ID)]}))}var v=t.memo(p);function f(o){return o.message,s(v,e({},o))}export{f as TUIMessageDefault};
1
+ import{__assign as e}from"tslib";import{jsx as s,jsxs as o}from"react/jsx-runtime";import t from"react";import a from"@tencentcloud/chat";import{MessageBubble as i}from"./MessageBubble.js";import{MessageTip as m}from"./MessageTip.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIMessageContext as n,messageShowType as r}from"../../context/MessageContext.js";import{useComponentContext as l}from"../../context/ComponentContext.js";import"@tencentcloud/chat-uikit-engine";import{MessageSystem as c}from"./MessageSystem.js";import{MessageRevoke as u}from"./MessageRevoke.js";import{MessageName as d}from"./MessageName.js";import{MessageAvatar as g}from"./MessageAvatar.js";function p(t){var p=t.message,v=t.MessageContext,f=t.MessagePlugins,M=t.className,P=l(),S=P.MessageContext,T=P.MessagePlugins,x=n("TUIMessage"),N=x.prefix,_=x.suffix,h=x.customName,C=x.showAvatar,G=void 0===C?r.IN:C,I=x.showName,j=void 0===I?r.IN:I,R=x.customAvatar,y=v||S,E=f||T;return o("div",e({className:"message-default\n ".concat((null==p?void 0:p.type)===a.TYPES.MSG_GRP_TIP||(null==p?void 0:p.isRevoked)?"tip":null==p?void 0:p.flow,"\n ").concat(M,"\n ")},{children:[(null==p?void 0:p.type)===a.TYPES.MSG_GRP_TIP&&s(m,{message:p}),(null==p?void 0:p.type)===a.TYPES.MSG_GRP_SYS_NOTICE&&s(c,{message:p}),(null==p?void 0:p.isRevoked)&&s(u,{message:p}),(null==p?void 0:p.type)!==a.TYPES.MSG_GRP_TIP&&(null==p?void 0:p.type)!==a.TYPES.MSG_GRP_SYS_NOTICE&&!(null==p?void 0:p.isRevoked)&&o("div",e({className:"".concat(null==p?void 0:p.flow)},{children:[N,p&&s(g,{message:p,CustomAvatar:R,showType:G}),o("main",e({"data-message-id":null==p?void 0:p.ID,className:"content"},{children:[s(d,{message:p,CustomName:h,showType:j}),s(i,e({message:p,Context:y,Plugins:E},{children:s(y,{message:p})}))]})),_]}),null==p?void 0:p.ID)]}))}var v=t.memo(p);function f(o){return o.message,s(v,e({},o))}export{f as TUIMessageDefault};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,Fragment as o}from"react/jsx-runtime";import n from"@tencentcloud/chat";import"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{messageShowType as i}from"../../context/MessageContext.js";function r(r){r.className;var l=r.CustomName,m=r.message,c=r.showType;return(c===i.ALL||(null==m?void 0:m.flow)===c)&&(null==m?void 0:m.conversationType)===n.TYPES.CONV_GROUP&&c!==i.NONE?l||e("label",t({htmlFor:"content",className:"text-ellipsis name"},{children:(null==m?void 0:m.nick)||(null==m?void 0:m.from)})):e(o,{})}export{r as MessageName};
1
+ import{__assign as t}from"tslib";import{jsx as e,Fragment as o}from"react/jsx-runtime";import n from"@tencentcloud/chat";import"react";import"@tencentcloud/tui-core";import"react-i18next";import{messageShowType as i}from"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";function r(r){r.className;var l=r.CustomName,m=r.message,c=r.showType;return(c===i.ALL||(null==m?void 0:m.flow)===c)&&(null==m?void 0:m.conversationType)===n.TYPES.CONV_GROUP&&c!==i.NONE?l||e("label",t({htmlFor:"content",className:"text-ellipsis name"},{children:(null==m?void 0:m.nick)||(null==m?void 0:m.from)})):e(o,{})}export{r as MessageName};
@@ -1 +1 @@
1
- import{__assign as e}from"tslib";import{jsxs as o,jsx as l}from"react/jsx-runtime";import{useState as s,useRef as i}from"react";import{useTranslation as n}from"react-i18next";import t from"@tencentcloud/chat";import{Plugins as r}from"../Plugins/index.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as u}from"../../context/ChatStateContext.js";import{useTUIMessageContext as c}from"../../context/MessageContext.js";import{useMessageHandler as h}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as v,MESSAGE_FLOW as g}from"../../constants.js";import"date-fns";import"date-fns/locale";import{useMessagePluginElement as p}from"./hooks/useMessagePluginElement.js";var m;function f(m){var f,M,S,w,y,C,T=m.plugins,x=m.showNumber,E=m.MoreIcon,N=m.config,U=n().t,I=s(""),R=I[0];I[1];var k=s({}),j=k[0],b=k[1],q=i(),O=c("MessagePlugins"),P=O.message,D=O.plugin,F=u("MessageBubbleWithContext").messageListRef,L=h({message:P}),W=L.handleDelMessage,Y=L.handleRevokeMessage,A=L.handleReplyMessage,V=L.handleCopyMessage,B=L.handleResendMessage,G=L.handleForWardMessage,H={quote:e(e({isShow:!0},null==N?void 0:N.quote),null===(f=null==D?void 0:D.config)||void 0===f?void 0:f.quote),forward:e(e({isShow:!0},null==N?void 0:N.forward),null===(M=null==D?void 0:D.config)||void 0===M?void 0:M.forward),copy:e(e({isShow:!0,relateMessageType:[t.TYPES.MSG_TEXT]},null==N?void 0:N.copy),null===(S=null==D?void 0:D.config)||void 0===S?void 0:S.copy),delete:e(e({isShow:!0},null==N?void 0:N.delete),null===(w=null==D?void 0:D.config)||void 0===w?void 0:w.delete),revoke:e(e({isShow:!0},null==N?void 0:N.revoke),null===(y=null==D?void 0:D.config)||void 0===y?void 0:y.revoke),resend:e(e({isShow:!0},null==N?void 0:N.resend),null===(C=null==D?void 0:D.config)||void 0===C?void 0:C.resend)},Q=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Recall")}),l(a,{width:20,height:20,type:d.REVOCATION})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),Y(e)},message:P,isShow:H.revoke.isShow&&(null==P?void 0:P.status)===v.SUCCESS&&P.flow===g.OUT,relateMessageType:H.revoke.relateMessageType}),X=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",e({className:"del"},{children:U("TUIChat.Delete")})),l(a,{width:20,height:20,type:d.DEL})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),W(e)},message:P,isShow:H.delete.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.delete.relateMessageType}),_=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Reference")}),l(a,{width:20,height:20,type:d.QUOTE})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),A(e)},message:P,isShow:H.quote.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.quote.relateMessageType}),z=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Copy")}),l(a,{width:20,height:20,type:d.COPY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),V(e)},message:P,isShow:H.copy.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.copy.relateMessageType}),J=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Resend")}),l(a,{width:20,height:20,type:d.REPLY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),B()},message:P,isShow:H.resend.isShow&&(null==P?void 0:P.status)!==v.SUCCESS,relateMessageType:H.resend.relateMessageType}),K=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Forward")}),l(a,{width:20,height:20,type:d.FORWARD})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),G(e)},message:P,isShow:H.forward.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.forward.relateMessageType}),Z=[Q,_,K,X,J,z],$=(T||(null==D?void 0:D.plugins)||Z).filter((function(e){return e})),ee=E||(null==D?void 0:D.MoreIcon)||l(a,{className:"icon-more",width:16,height:16,type:d.MORE}),oe=x||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==v.UNSEND&&l(r,{className:"message-plugin",customClass:R,style:j,ref:q,plugins:$,showNumber:oe,MoreIcon:ee,root:null==F?void 0:F.current,handleVisible:function(e){if(e.x&&e.y){var o=e.y<e.height||e.top,l=e.x<e.width||e.left;b({position:"fixed",left:"".concat(l?e.x:e.x-e.width,"px"),top:"".concat(o?e.y:e.y-e.height,"px")})}}})}!function(e){e.quote="quote",e.forward="forward",e.copy="copy",e.delete="delete",e.resend="resend",e.revoke="revoke"}(m||(m={}));export{f as MessagePlugins};
1
+ import{__assign as e}from"tslib";import{jsxs as o,jsx as l}from"react/jsx-runtime";import{useState as s,useRef as i}from"react";import{useUIKit as n}from"@tencentcloud/uikit-base-component-react";import t from"@tencentcloud/chat";import{Plugins as r}from"../Plugins/index.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as c}from"../../context/ChatStateContext.js";import{useTUIMessageContext as u}from"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{useMessageHandler as h}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as v,MESSAGE_FLOW as p}from"../../constants.js";import"date-fns";import"date-fns/locale";import{useMessagePluginElement as g}from"./hooks/useMessagePluginElement.js";var m;function f(m){var f,M,S,w,y,C,T=m.plugins,x=m.showNumber,E=m.MoreIcon,N=m.config,U=n().t,I=s(""),k=I[0];I[1];var R=s({}),j=R[0],b=R[1],q=i(),O=u("MessagePlugins"),P=O.message,D=O.plugin,F=c("MessageBubbleWithContext").messageListRef,L=h({message:P}),W=L.handleDelMessage,Y=L.handleRevokeMessage,A=L.handleReplyMessage,V=L.handleCopyMessage,B=L.handleResendMessage,G=L.handleForWardMessage,H={quote:e(e({isShow:!0},null==N?void 0:N.quote),null===(f=null==D?void 0:D.config)||void 0===f?void 0:f.quote),forward:e(e({isShow:!0},null==N?void 0:N.forward),null===(M=null==D?void 0:D.config)||void 0===M?void 0:M.forward),copy:e(e({isShow:!0,relateMessageType:[t.TYPES.MSG_TEXT]},null==N?void 0:N.copy),null===(S=null==D?void 0:D.config)||void 0===S?void 0:S.copy),delete:e(e({isShow:!0},null==N?void 0:N.delete),null===(w=null==D?void 0:D.config)||void 0===w?void 0:w.delete),revoke:e(e({isShow:!0},null==N?void 0:N.revoke),null===(y=null==D?void 0:D.config)||void 0===y?void 0:y.revoke),resend:e(e({isShow:!0},null==N?void 0:N.resend),null===(C=null==D?void 0:D.config)||void 0===C?void 0:C.resend)},Q=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Recall")}),l(a,{width:20,height:20,type:d.REVOCATION})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),Y(e)},message:P,isShow:H.revoke.isShow&&(null==P?void 0:P.status)===v.SUCCESS&&P.flow===p.OUT,relateMessageType:H.revoke.relateMessageType}),X=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",e({className:"del"},{children:U("TUIChat.Delete")})),l(a,{width:20,height:20,type:d.DEL})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),W(e)},message:P,isShow:H.delete.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.delete.relateMessageType}),_=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Reference")}),l(a,{width:20,height:20,type:d.QUOTE})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),A(e)},message:P,isShow:H.quote.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.quote.relateMessageType}),z=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Copy")}),l(a,{width:20,height:20,type:d.COPY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),V(e)},message:P,isShow:H.copy.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.copy.relateMessageType}),J=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Resend")}),l(a,{width:20,height:20,type:d.REPLY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),B()},message:P,isShow:H.resend.isShow&&(null==P?void 0:P.status)!==v.SUCCESS,relateMessageType:H.resend.relateMessageType}),K=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Forward")}),l(a,{width:20,height:20,type:d.FORWARD})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),G(e)},message:P,isShow:H.forward.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.forward.relateMessageType}),Z=[Q,_,K,X,J,z],$=(T||(null==D?void 0:D.plugins)||Z).filter((function(e){return e})),ee=E||(null==D?void 0:D.MoreIcon)||l(a,{className:"icon-more",width:16,height:16,type:d.MORE}),oe=x||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==v.UNSEND&&l(r,{className:"message-plugin",customClass:k,style:j,ref:q,plugins:$,showNumber:oe,MoreIcon:ee,root:null==F?void 0:F.current,handleVisible:function(e){if(e.x&&e.y){var o=e.y<e.height||e.top,l=e.x<e.width||e.left;b({position:"fixed",left:"".concat(l?e.x:e.x-e.width,"px"),top:"".concat(o?e.y:e.y-e.height,"px")})}}})}!function(e){e.quote="quote",e.forward="forward",e.copy="copy",e.delete="delete",e.resend="resend",e.revoke="revoke"}(m||(m={}));export{f as MessagePlugins};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,Fragment as o,jsxs as r}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import a from"@tencentcloud/chat";import{MESSAGE_STATUS as c}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as l}from"../../context/ChatStateContext.js";import{useTUIMessageContext as m}from"../../context/MessageContext.js";function u(s){var u=s.message,p=s.children,d=s.Progress,g=s.isShow,v=void 0!==g&&g,f=n(),h=f[0],x=f[1],S=n(0),P=S[0],M=S[1],E=l("MessageProgressWithContext").uploadPendingMessageList,C=m("MessageProgressWithContext"),I=C.isShowProgress,j=void 0!==I&&I,y=C.Progress,D=d||y,G=v||j;return i((function(){E&&E.length>0&&E.map((function(t){return(null==t?void 0:t.ID)===(null==u?void 0:u.ID)&&(x(t),(null==t?void 0:t.progress)&&M(t.progress)),t}))}),[E]),G?D&&h?e(D,{message:h}):!((null==u?void 0:u.type)!==a.TYPES.MSG_IMAGE&&(null==u?void 0:u.type)!==a.TYPES.MSG_VIDEO&&(null==u?void 0:u.type)!==a.TYPES.MSG_FILE||(null==u?void 0:u.status)!==c.UNSEND)&&r("div",t({className:"progress-box"},{children:[e("span",{className:"progress",style:{width:"".concat(100*P,"%")}}),p]})):e(o,{})}var p=s.memo(u);function d(o){return e(p,t({},o))}export{d as MessageProgress};
1
+ import{__assign as t}from"tslib";import{jsx as e,Fragment as o,jsxs as r}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import a from"@tencentcloud/chat";import{MESSAGE_STATUS as c}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as l}from"../../context/ChatStateContext.js";import{useTUIMessageContext as m}from"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";function u(s){var u=s.message,p=s.children,d=s.Progress,g=s.isShow,v=void 0!==g&&g,f=n(),h=f[0],x=f[1],S=n(0),P=S[0],M=S[1],E=l("MessageProgressWithContext").uploadPendingMessageList,C=m("MessageProgressWithContext"),I=C.isShowProgress,j=void 0!==I&&I,y=C.Progress,D=d||y,G=v||j;return i((function(){E&&E.length>0&&E.map((function(t){return(null==t?void 0:t.ID)===(null==u?void 0:u.ID)&&(x(t),(null==t?void 0:t.progress)&&M(t.progress)),t}))}),[E]),G?D&&h?e(D,{message:h}):!((null==u?void 0:u.type)!==a.TYPES.MSG_IMAGE&&(null==u?void 0:u.type)!==a.TYPES.MSG_VIDEO&&(null==u?void 0:u.type)!==a.TYPES.MSG_FILE||(null==u?void 0:u.status)!==c.UNSEND)&&r("div",t({className:"progress-box"},{children:[e("span",{className:"progress",style:{width:"".concat(100*P,"%")}}),p]})):e(o,{})}var p=s.memo(u);function d(o){return e(p,t({},o))}export{d as MessageProgress};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as r}from"react";import{useTranslation as i}from"react-i18next";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import{useTUIChatActionContext as m}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";function c(n){var c=n.message,u=i().t,d=m().operateMessage,p=r((function(){var t;d&&c&&d(((t={})[l.REVOKE]=c,t))}),[d]);return o("div",t({className:"bubble message-system message-revoke"},{children:[(null==c?void 0:c.flow)===s.IN&&e("span",{children:(null==c?void 0:c.nick)||(null==c?void 0:c.from)}),(null==c?void 0:c.flow)!==s.IN&&e("span",t({style:{marginRight:"5px"}},{children:u("TUIChat.You")})),e("span",t({style:{marginRight:"5px"}},{children:u("TUIChat.recalled a message")})),(null==c?void 0:c.flow)===s.OUT&&(null==c?void 0:c.type)===a.TYPES.MSG_TEXT&&e("span",t({className:"edit",role:"button",tabIndex:0,onClick:p},{children:u("TUIChat.Re-edit")}))]}))}var u=n.memo(c);function d(o){return e(u,t({},o))}export{d as MessageRevoke};
1
+ import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as i}from"react";import{useUIKit as r}from"@tencentcloud/uikit-base-component-react";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as c}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatActionContext as m}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";function s(n){var s=n.message,u=r().t,p=m().operateMessage,d=i((function(){var t;p&&s&&p(((t={})[l.REVOKE]=s,t))}),[p]);return o("div",t({className:"bubble message-system message-revoke"},{children:[(null==s?void 0:s.flow)===c.IN&&e("span",{children:(null==s?void 0:s.nick)||(null==s?void 0:s.from)}),(null==s?void 0:s.flow)!==c.IN&&e("span",t({style:{marginRight:"5px"}},{children:u("TUIChat.You")})),e("span",t({style:{marginRight:"5px"}},{children:u("TUIChat.recalled a message")})),(null==s?void 0:s.flow)===c.OUT&&(null==s?void 0:s.type)===a.TYPES.MSG_TEXT&&e("span",t({className:"edit",role:"button",tabIndex:0,onClick:d},{children:u("TUIChat.Re-edit")}))]}))}var u=n.memo(s);function p(o){return e(u,t({},o))}export{p as MessageRevoke};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import i from"react";import{useUIKit as o}from"../../context/UIKitContext.js";import"@tencentcloud/chat-uikit-engine";import{useTUIMessageContext as r}from"../../context/MessageContext.js";import{getTimeStamp as m}from"../utils.js";function s(i){var s=i.message,n=o().language,a=r("MessageStatustWithContext").isShowTime,c=(void 0===a||a)&&e("div",t({className:"time"},{children:(null==s?void 0:s.time)?m(1e3*s.time,n):0}));return e("div",t({className:"message-status"},{children:c}))}var n=i.memo(s);function a(i){return e(n,t({},i))}export{a as MessageStatus};
1
+ import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import i from"react";import{useUIKit as o}from"@tencentcloud/uikit-base-component-react";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIMessageContext as r}from"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{getTimeStamp as m}from"../utils.js";function n(i){var n=i.message,s=o("TUIChat").language,a=r("MessageStatustWithContext").isShowTime,c=(void 0===a||a)&&e("div",t({className:"time"},{children:(null==n?void 0:n.time)?m(1e3*n.time,s):0}));return e("div",t({className:"message-status"},{children:c}))}var s=i.memo(n);function a(i){return e(s,t({},i))}export{a as MessageStatus};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"../../context/MessageContext.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function n(o){var n=o.message,i=r({message:n}).context;return e("div",t({className:"bubble message-system"},{children:e("div",{children:i})}))}var i=o.memo(n);function s(o){return e(i,t({},o))}export{s as MessageSystem};
1
+ import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"@tencentcloud/uikit-base-component-react";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"react-i18next";import"../../context/MessageContext.js";import"../../store/UIManagerStore.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function n(o){var n=o.message,i=r({message:n}).context;return e("div",t({className:"bubble message-system"},{children:e("div",{children:i})}))}var i=o.memo(n);function s(o){return e(i,t({},o))}export{s as MessageSystem};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import o from"react";import c from"@tencentcloud/chat";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as i}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import{useComponentContext as r}from"../../context/ComponentContext.js";function s(o){var s=o.context,a=o.message,l=o.children,m=r().MessageTextPlugins,u=i("MessageText").firstSendMessage;return m&&"in"===(null==a?void 0:a.flow)&&u&&(null==u?void 0:u.time)<=(null==a?void 0:a.time)?e("div",t({className:"bubble message-text bubble-".concat(a.flow," ").concat((null==a?void 0:a.conversationType)===c.TYPES.CONV_GROUP?"group":"")},{children:e(m,{data:a})})):e("div",t({className:"bubble message-text bubble-".concat(null==a?void 0:a.flow," ").concat((null==a?void 0:a.conversationType)===c.TYPES.CONV_GROUP?"group":"")},{children:n("div",t({className:"message-text-content"},{children:[null==s?void 0:s.text.map((function(n,o){var c=a&&(null==a?void 0:a.ID)+o;return"text"===n.name?e("p",t({className:"message-text-content-p"},{children:n.text}),n.src+c):e("img",{className:"text-img",src:n.src,alt:""},n.src+c)})),l]}))}))}var a=o.memo(s);function l(n){return e(a,t({},n))}export{l as MessageText};
1
+ import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import o from"react";import c from"@tencentcloud/chat";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as i}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import{useComponentContext as r}from"../../context/ComponentContext.js";import"@tencentcloud/chat-uikit-engine";function s(o){var s=o.context,a=o.message,l=o.children,m=r().MessageTextPlugins,u=i("MessageText").firstSendMessage;return m&&"in"===(null==a?void 0:a.flow)&&u&&(null==u?void 0:u.time)<=(null==a?void 0:a.time)?e("div",t({className:"bubble message-text bubble-".concat(a.flow," ").concat((null==a?void 0:a.conversationType)===c.TYPES.CONV_GROUP?"group":"")},{children:e(m,{data:a})})):e("div",t({className:"bubble message-text bubble-".concat(null==a?void 0:a.flow," ").concat((null==a?void 0:a.conversationType)===c.TYPES.CONV_GROUP?"group":"")},{children:n("div",t({className:"message-text-content"},{children:[null==s?void 0:s.text.map((function(n,o){var c=a&&(null==a?void 0:a.ID)+o;return"text"===n.name?e("p",t({className:"message-text-content-p"},{children:n.text}),n.src+c):e("img",{className:"text-img",src:n.src,alt:""},n.src+c)})),l]}))}))}var a=o.memo(s);function l(n){return e(a,t({},n))}export{l as MessageText};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"../../context/MessageContext.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function n(o){var n=o.message,i=r({message:n}).context;return e("div",t({className:"bubble message-tip"},{children:i.text}))}var i=o.memo(n);function m(o){return e(i,t({},o))}export{m as MessageTip};
1
+ import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"@tencentcloud/uikit-base-component-react";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"react-i18next";import"../../context/MessageContext.js";import"../../store/UIManagerStore.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function n(o){var n=o.message,i=r({message:n}).context;return e("div",t({className:"bubble message-tip"},{children:i.text}))}var i=o.memo(n);function m(o){return e(i,t({},o))}export{m as MessageTip};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from"tslib";import{useCallback as r}from"react";import{useTranslation as o}from"react-i18next";import{TUIStore as n}from"@tencentcloud/chat-uikit-engine";import{MESSAGE_FLOW as a,MESSAGE_OPERATE as i}from"../../../constants.js";import{enableSampleTaskStatus as s}from"../../utils.js";import{useUIKit as l}from"../../../context/UIKitContext.js";import"react/jsx-runtime";import{useTUIChatActionContext as u}from"../../../context/ChatActionContext.js";import"../../../context/MessageContext.js";import{Toast as d}from"../../Toast/index.js";var c=function(c){var v=c.message,f=c.handleError,m=u(),p=m.editLocalMessage,g=m.operateMessage;m.revokeMessage;var h=o().t,M=l().chat,x=r((function(r){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return r.preventDefault(),v?(n.getMessageModel(null==v?void 0:v.ID).deleteMessage(),[2]):[2]}))}))}),[v]),y=r((function(r){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return r.preventDefault(),v?(n.getMessageModel(null==v?void 0:v.ID).revokeMessage().then((function(){p&&p(v),s("revokeMessage")})).catch((function(e){if(!f){var t=v.flow===a.OUT?h("TUIChat.The message recall exceeded the time limit (default 2 minutes)"):h("TUIChat.Error revoke Message");throw d({text:t,type:"error"}),new Error(e)}f({functionName:"revokeMessage",error:e})})),[2]):[2]}))}))}),[v]),D=r((function(e){var t;e.preventDefault(),(null==v?void 0:v.ID)&&M&&g&&g(((t={})[i.QUOTE]=v,t))}),[v]),C=r((function(e){if(e.preventDefault(),navigator.clipboard)navigator.clipboard.writeText(null==v?void 0:v.payload.text);else{var t=document.createElement("textarea");document.body.appendChild(t),t.style.position="fixed",t.style.clip="rect(0 0 0 0)",t.style.top="10px",t.value=null==v?void 0:v.payload.text,t.select(),document.execCommand("copy",!0),document.body.removeChild(t)}}),[v]),b=r((function(){return e(void 0,void 0,void 0,(function(){var e,r,o,n;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),(r=v)?[4,M.resendMessage(v)]:[3,2];case 1:r=t.sent(),t.label=2;case 2:return e=r,p&&p(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.message),[3,4];case 3:if(o=t.sent(),!f)throw d({text:o,type:"error"}),new Error(o);return f({functionName:"resendMessage",error:o}),[3,4];case 4:return[2]}}))}))}),[v]),j=r((function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){return r.preventDefault(),(null==v?void 0:v.ID)&&M&&g?(g(((e={})[i.FORWARD]=v,e)),[2]):[2]}))}))}),[v]);return{handleDelMessage:x,handleRevokeMessage:y,handleReplyMessage:D,handleCopyMessage:C,handleResendMessage:b,handleForWardMessage:j}};export{c as useMessageHandler};
1
+ import{__awaiter as e,__generator as t}from"tslib";import{useCallback as r}from"react";import{useUIKit as o}from"@tencentcloud/uikit-base-component-react";import{TUIStore as n}from"@tencentcloud/chat-uikit-engine";import{MESSAGE_FLOW as i,MESSAGE_OPERATE as a}from"../../../constants.js";import{enableSampleTaskStatus as s}from"../../utils.js";import"react/jsx-runtime";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatActionContext as u}from"../../../context/ChatActionContext.js";import"../../../context/MessageContext.js";import{useUIManagerStore as c}from"../../../store/UIManagerStore.js";import{Toast as l}from"../../Toast/index.js";import{transformTextWithEmojiKeyToName as d}from"../utils/decodeText.js";var v=function(v){var m=v.message,f=v.handleError,p=u(),g=p.editLocalMessage,h=p.operateMessage;p.revokeMessage;var M=o().t,x=c().chat,y=r((function(r){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return r.preventDefault(),m?(n.getMessageModel(null==m?void 0:m.ID).deleteMessage(),[2]):[2]}))}))}),[m]),D=r((function(r){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return r.preventDefault(),m?(n.getMessageModel(null==m?void 0:m.ID).revokeMessage().then((function(){g&&g(m),s("revokeMessage")})).catch((function(e){if(!f){var t=m.flow===i.OUT?M("TUIChat.The message recall exceeded the time limit (default 2 minutes)"):M("TUIChat.Error revoke Message");throw l({text:t,type:"error"}),new Error(e)}f({functionName:"revokeMessage",error:e})})),[2]):[2]}))}))}),[m]),C=r((function(e){var t;e.preventDefault(),(null==m?void 0:m.ID)&&x&&h&&h(((t={})[a.QUOTE]=m,t))}),[m]),b=r((function(e){e.preventDefault();var t=d(null==m?void 0:m.payload.text);if(navigator.clipboard)navigator.clipboard.writeText(t);else{var r=document.createElement("textarea");document.body.appendChild(r),r.style.position="fixed",r.style.clip="rect(0 0 0 0)",r.style.top="10px",r.value=t,r.select(),document.execCommand("copy",!0),document.body.removeChild(r)}}),[m]),j=r((function(){return e(void 0,void 0,void 0,(function(){var e,r,o,n;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),(r=m)?[4,x.resendMessage(m)]:[3,2];case 1:r=t.sent(),t.label=2;case 2:return e=r,g&&g(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.message),[3,4];case 3:if(o=t.sent(),!f)throw l({text:o,type:"error"}),new Error(o);return f({functionName:"resendMessage",error:o}),[3,4];case 4:return[2]}}))}))}),[m]),k=r((function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){return r.preventDefault(),(null==m?void 0:m.ID)&&x&&h?(h(((e={})[a.FORWARD]=m,e)),[2]):[2]}))}))}),[m]);return{handleDelMessage:y,handleRevokeMessage:D,handleReplyMessage:C,handleCopyMessage:b,handleResendMessage:j,handleForWardMessage:k}};export{v as useMessageHandler};
@@ -1 +1 @@
1
- import{useState as e,useLayoutEffect as t}from"react";import s from"@tencentcloud/chat";import{useUIKit as o}from"../../../context/UIKitContext.js";import"tslib";import"react/jsx-runtime";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as a}from"../../../context/ChatStateContext.js";import"../../../context/MessageContext.js";import{JSONStringToParse as n}from"../../utils.js";var i,r=((i={})[s.TYPES.MSG_TEXT]=1,i[s.TYPES.MSG_FACE]=8,i[s.TYPES.MSG_IMAGE]=3,i[s.TYPES.MSG_AUDIO]=4,i[s.TYPES.MSG_VIDEO]=5,i[s.TYPES.MSG_FILE]=6,i[s.TYPES.MSG_CUSTOM]=2,i),l=function(i){var l=i.message,m=e(null),u=m[0],c=m[1],S=e(""),p=S[0],g=S[1],d=e(null),v=d[0],E=d[1],M=e(""),T=M[0],f=M[1],I=o().chat,x=a("useMessageReply").messageList;t((function(){l&&D(l)}),[l]);var D=function(e){if(null==e?void 0:e.cloudCustomData){var t=n(null==e?void 0:e.cloudCustomData),o=(null==t?void 0:t.messageReply)||"";if(o){c(o),g(null==o?void 0:o.messageSender),f(null==o?void 0:o.messageID);var a=null==x?void 0:x.filter((function(e){var t=e.ID===(null==o?void 0:o.messageID),a=t&&r[e.type]===o.messageType,n=e.type!==s.TYPES.MSG_TEXT||e.payload.text===o.messageAbstract;return t&&a&&n}));E(a[0]||I.findMessage(null==o?void 0:o.messageID))}}};return{messageReply:u,sender:p,replyMessage:v,messageID:T,message:l}};export{l as useMessageReply};
1
+ import{useState as e,useLayoutEffect as t}from"react";import s from"@tencentcloud/chat";import"tslib";import"react/jsx-runtime";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as o}from"../../../context/ChatStateContext.js";import"../../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{useUIManagerStore as r}from"../../../store/UIManagerStore.js";import{JSONStringToParse as a}from"../../utils.js";var n,i=((n={})[s.TYPES.MSG_TEXT]=1,n[s.TYPES.MSG_FACE]=8,n[s.TYPES.MSG_IMAGE]=3,n[s.TYPES.MSG_AUDIO]=4,n[s.TYPES.MSG_VIDEO]=5,n[s.TYPES.MSG_FILE]=6,n[s.TYPES.MSG_CUSTOM]=2,n),l=function(n){var l=n.message,m=e(null),u=m[0],c=m[1],p=e(""),S=p[0],g=p[1],d=e(null),M=d[0],v=d[1],E=e(""),T=E[0],f=E[1],I=r().chat,D=o("useMessageReply").messageList;t((function(){l&&G(l)}),[l]);var G=function(e){if(null==e?void 0:e.cloudCustomData){var t=a(null==e?void 0:e.cloudCustomData),o=(null==t?void 0:t.messageReply)||"";if(o){c(o),g(null==o?void 0:o.messageSender),f(null==o?void 0:o.messageID);var r=null==D?void 0:D.filter((function(e){var t=e.ID===(null==o?void 0:o.messageID),r=t&&i[e.type]===o.messageType,a=e.type!==s.TYPES.MSG_TEXT||e.payload.text===o.messageAbstract;return t&&r&&a}));v(r[0]||I.findMessage(null==o?void 0:o.messageID))}}};return{messageReply:u,sender:S,replyMessage:M,messageID:T,message:l}};export{l as useMessageReply};
@@ -1 +1 @@
1
- import{emojiMap as e,emojiUrl as t}from"./emojiMap.js";function s(s){for(var a=[],i=s.text,r=-1,n=-1;""!==i;)switch(r=i.indexOf("["),n=i.indexOf("]"),r){case 0:if(-1===n)a.push({name:"text",text:i}),i="";else{var x=i.slice(0,n+1);e[x]?(a.push({name:"img",src:t+e[x]}),i=i.substring(n+1)):(a.push({name:"text",text:"["}),i=i.slice(1))}break;case-1:a.push({name:"text",text:i}),i="";break;default:a.push({name:"text",text:i.slice(0,r)}),i=i.substring(r)}return a}export{s as decodeText};
1
+ import{emojiUrlMap as t}from"./emojiMap.js";import{i18next as r}from"@tencentcloud/uikit-base-component-react";function n(n){if(!n)return"";var e=/(\[.+?\])/g,a=n;return e.test(n)&&(a=n.replace(e,(function(n){return t[n]?r.t("Emoji.".concat(n)):n}))),a}var e={};function a(t){var n;if(!t)return"";var a=/(\[.+?\])/g,i=t;if(a.test(t)){var o=r.language;if(!e[o]){var u=r.getDataByLanguage(o);(null===(n=null==u?void 0:u.translation)||void 0===n?void 0:n.Emoji)&&(e[o]=Object.fromEntries(Object.entries(u.translation.Emoji).map((function(t){var r=t[0];return[t[1],r]}))))}i=t.replace(a,(function(t){var r;return null!==(r=e[o][t])&&void 0!==r?r:t}))}return i}export{n as transformTextWithEmojiKeyToName,a as transformTextWithEmojiNameToKey};
@@ -1 +1 @@
1
- var e="https://web.sdk.qcloud.com/im/assets/emoji/",i={"[NO]":"emoji_0@2x.png","[OK]":"emoji_1@2x.png","[下雨]":"emoji_2@2x.png","[么么哒]":"emoji_3@2x.png","[乒乓]":"emoji_4@2x.png","[便便]":"emoji_5@2x.png","[信封]":"emoji_6@2x.png","[偷笑]":"emoji_7@2x.png","[傲慢]":"emoji_8@2x.png","[再见]":"emoji_9@2x.png","[冷汗]":"emoji_10@2x.png","[凋谢]":"emoji_11@2x.png","[]":"emoji_12@2x.png","[删除]":"emoji_13@2x.png","[勾引]":"emoji_14@2x.png","[发呆]":"emoji_15@2x.png","[发抖]":"emoji_16@2x.png","[可怜]":"emoji_17@2x.png","[可爱]":"emoji_18@2x.png","[右哼哼]":"emoji_19@2x.png","[右太极]":"emoji_20@2x.png","[右车头]":"emoji_21@2x.png","[]":"emoji_22@2x.png","[]":"emoji_23@2x.png","[咒骂]":"emoji_24@2x.png","[咖啡]":"emoji_25@2x.png","[啤酒]":"emoji_26@2x.png","[]":"emoji_27@2x.png","[回头]":"emoji_28@2x.png","[]":"emoji_29@2x.png","[坏笑]":"emoji_30@2x.png","[多云]":"emoji_31@2x.png","[大兵]":"emoji_32@2x.png","[大哭]":"emoji_33@2x.png","[太阳]":"emoji_34@2x.png","[奋斗]":"emoji_35@2x.png","[奶瓶]":"emoji_36@2x.png","[委屈]":"emoji_37@2x.png","[害羞]":"emoji_38@2x.png","[尴尬]":"emoji_39@2x.png","[左哼哼]":"emoji_40@2x.png","[左太极]":"emoji_41@2x.png","[左车头]":"emoji_42@2x.png","[差劲]":"emoji_43@2x.png","[]":"emoji_44@2x.png","[]":"emoji_45@2x.png","[彩带]":"emoji_46@2x.png","[彩球]":"emoji_47@2x.png","[得意]":"emoji_48@2x.png","[微笑]":"emoji_49@2x.png","[心碎了]":"emoji_50@2x.png","[快哭了]":"emoji_51@2x.png","[怄火]":"emoji_52@2x.png","[]":"emoji_53@2x.png","[惊恐]":"emoji_54@2x.png","[惊讶]":"emoji_55@2x.png","[憨笑]":"emoji_56@2x.png","[手枪]":"emoji_57@2x.png","[打哈欠]":"emoji_58@2x.png","[抓狂]":"emoji_59@2x.png","[折磨]":"emoji_60@2x.png","[抠鼻]":"emoji_61@2x.png","[抱抱]":"emoji_62@2x.png","[抱拳]":"emoji_63@2x.png","[拳头]":"emoji_64@2x.png","[挥手]":"emoji_65@2x.png","[握手]":"emoji_66@2x.png","[撇嘴]":"emoji_67@2x.png","[擦汗]":"emoji_68@2x.png","[敲打]":"emoji_69@2x.png","[晕]":"emoji_70@2x.png","[月亮]":"emoji_71@2x.png","[棒棒糖]":"emoji_72@2x.png","[汽车]":"emoji_73@2x.png","[沙发]":"emoji_74@2x.png","[流汗]":"emoji_75@2x.png","[流泪]":"emoji_76@2x.png","[激动]":"emoji_77@2x.png","[灯泡]":"emoji_78@2x.png","[炸弹]":"emoji_79@2x.png","[熊猫]":"emoji_80@2x.png","[爆筋]":"emoji_81@2x.png","[爱你]":"emoji_82@2x.png","[爱心]":"emoji_83@2x.png","[爱情]":"emoji_84@2x.png","[猪头]":"emoji_85@2x.png","[猫咪]":"emoji_86@2x.png","[献吻]":"emoji_87@2x.png","[玫瑰]":"emoji_88@2x.png","[瓢虫]":"emoji_89@2x.png","[疑问]":"emoji_90@2x.png","[白眼]":"emoji_91@2x.png","[皮球]":"emoji_92@2x.png","[睡觉]":"emoji_93@2x.png","[磕头]":"emoji_94@2x.png","[示爱]":"emoji_95@2x.png","[礼品袋]":"emoji_96@2x.png","[礼物]":"emoji_97@2x.png","[篮球]":"emoji_98@2x.png","[米饭]":"emoji_99@2x.png","[糗大了]":"emoji_100@2x.png","[红双喜]":"emoji_101@2x.png","[红灯笼]":"emoji_102@2x.png","[纸巾]":"emoji_103@2x.png","[胜利]":"emoji_104@2x.png","[色]":"emoji_105@2x.png","[药]":"emoji_106@2x.png","[菜刀]":"emoji_107@2x.png","[蛋糕]":"emoji_108@2x.png","[蜡烛]":"emoji_109@2x.png","[街舞]":"emoji_110@2x.png","[衰]":"emoji_111@2x.png","[西瓜]":"emoji_112@2x.png","[调皮]":"emoji_113@2x.png","[象棋]":"emoji_114@2x.png","[跳绳]":"emoji_115@2x.png","[跳跳]":"emoji_116@2x.png","[车厢]":"emoji_117@2x.png","[转圈]":"emoji_118@2x.png","[鄙视]":"emoji_119@2x.png","[酷]":"emoji_120@2x.png","[钞票]":"emoji_121@2x.png","[钻戒]":"emoji_122@2x.png","[闪电]":"emoji_123@2x.png","[闭嘴]":"emoji_124@2x.png","[闹钟]":"emoji_125@2x.png","[阴险]":"emoji_126@2x.png","[难过]":"emoji_127@2x.png","[雨伞]":"emoji_128@2x.png","[青蛙]":"emoji_129@2x.png","[面条]":"emoji_130@2x.png","[鞭炮]":"emoji_131@2x.png","[风车]":"emoji_132@2x.png","[飞吻]":"emoji_133@2x.png","[飞机]":"emoji_134@2x.png","[饥饿]":"emoji_135@2x.png","[香蕉]":"emoji_136@2x.png","[骷髅]":"emoji_137@2x.png","[麦克风]":"emoji_138@2x.png","[麻将]":"emoji_139@2x.png","[鼓掌]":"emoji_140@2x.png","[龇牙]":"emoji_141@2x.png"},o={"[NO]":"[no]","[OK]":"[ok]","[下雨]":"[rain]","[么么哒]":"[muah]","[乒乓]":"[ping pong]","[便便]":"[poo]","[信封]":"[mail]","[偷笑]":"[snicker]","[傲慢]":"[arrogant]","[再见]":"[bye]","[冷汗]":"[sweat]","[凋谢]":"[wither]","[刀]":"[knife]","[删除]":"[delete]","[勾引]":"[hook]","[发呆]":"[daze]","[发抖]":"[shaking]","[可怜]":"[pitiful]","[可爱]":"[cute]","[右哼哼]":"[right hum]","[右太极]":"[right Tai Chi]","[右车头]":"[right head]","[吐]":"[vomit]","[吓]":"[scare]","[咒骂]":"[curse]","[咖啡]":"[cafe]","[啤酒]":"[beer]","[嘘]":"[hiss]","[回头]":"[look back]","[困]":"[sleepy]","[坏笑]":"[bad laugh]","[多云]":"[cloud]","[大兵]":"[soldiers]","[大哭]":"[cry]","[太阳]":"[sun]","[奋斗]":"[struggle]","[奶瓶]":"[feeding bottle]","[委屈]":"[wronged]","[害羞]":"[shy]","[尴尬]":"[awkward]","[左哼哼]":"[left hem]","[左太极]":"[left Tai Chi]","[左车头]":"[left head]","[差劲]":"[poor]","[弱]":"[weak]","[强]":"[stong]","[彩带]":"[ribbon]","[彩球]":"[ball]","[得意]":"[proud]","[微笑]":"[smile]","[心碎了]":"[heartbroken]","[快哭了]":"[almost cry]","[怄火]":"[ire]","[怒]":"[anger]","[惊恐]":"[terrify]","[惊讶]":"[flummox]","[憨笑]":"[smirk]","[手枪]":"[gun]","[打哈欠]":"[yawn]","[抓狂]":"[crazy]","[折磨]":"[torment]","[抠鼻]":"[nose picking]","[抱抱]":"[hug]","[抱拳]":"[hug fist]","[拳头]":"[fist]","[挥手]":"[waving hands]","[握手]":"[shake hands]","[撇嘴]":"[pouted]","[擦汗]":"[wipe sweat]","[敲打]":"[knock on the head]","[晕]":"[faint]","[月亮]":"[moon]","[棒棒糖]":"[lollipop]","[汽车]":"[car]","[沙发]":"[sofa]","[流汗]":"[sweat]","[流泪]":"[tears]","[激动]":"[excitement]","[灯泡]":"[light]","[炸弹]":"[bomb]","[熊猫]":"[panda]","[爆筋]":"[exploding muscle]","[爱你]":"[love you]","[爱心]":"[love heart]","[爱情]":"[love]","[猪头]":"[pig]","[猫咪]":"[cat]","[献吻]":"[kiss]","[玫瑰]":"[rose]","[瓢虫]":"[ladybird]","[疑问]":"[what]","[白眼]":"[rolling eyes]","[皮球]":"[rubber ball]","[睡觉]":"[sleep]","[磕头]":"[kowtow]","[示爱]":"[show love]","[礼品袋]":"[gift bag]","[礼物]":"[gift]","[篮球]":"[basketball]","[米饭]":"[rice]","[糗大了]":"[shame]","[红双喜]":"[happiness]","[红灯笼]":"[lantern]","[纸巾]":"[tissue]","[胜利]":"[victory]","[色]":"[lecherous]","[药]":"[medicine]","[菜刀]":"[kitchen knife]","[蛋糕]":"[coke]","[蜡烛]":"[candle]","[街舞]":"[hip hop]","[衰]":"[decline]","[西瓜]":"[lemon]","[调皮]":"[naughty]","[象棋]":"[chess]","[跳绳]":"[jump rope]","[跳跳]":"[jump]","[车厢]":"[compartment]","[转圈]":"[turn in circles]","[鄙视]":"[contempt]","[酷]":"[cool]","[钞票]":"[money]","[钻戒]":"[diamond]","[闪电]":"[lightning]","[闭嘴]":"[shut up]","[闹钟]":"[clock]","[阴险]":"[sinister]","[难过]":"[sad]","[雨伞]":"[umbrella]","[青蛙]":"[frog]","[面条]":"[noodles]","[鞭炮]":"[firecracker]","[风车]":"[windmill]","[飞吻]":"[blow kisses]","[飞机]":"[air]","[饥饿]":"[hunger]","[香蕉]":"[banana]","[骷髅]":"[skull]","[麦克风]":"[mic]","[麻将]":"[mahjong]","[鼓掌]":"[handclap]","[龇牙]":"[happy]"},n=["[龇牙]","[调皮]","[流汗]","[偷笑]","[再见]","[敲打]","[擦汗]","[猪头]","[玫瑰]","[流泪]","[大哭]","[嘘]","[酷]","[抓狂]","[委屈]","[便便]","[炸弹]","[菜刀]","[可爱]","[色]","[害羞]","[得意]","[吐]","[微笑]","[怒]","[尴尬]","[惊恐]","[冷汗]","[爱心]","[示爱]","[白眼]","[傲慢]","[难过]","[惊讶]","[疑问]","[困]","[么么哒]","[憨笑]","[爱情]","[衰]","[撇嘴]","[阴险]","[奋斗]","[发呆]","[右哼哼]","[抱抱]","[坏笑]","[飞吻]","[鄙视]","[晕]","[大兵]","[可怜]","[强]","[弱]","[握手]","[胜利]","[抱拳]","[凋谢]","[米饭]","[蛋糕]","[西瓜]","[啤酒]","[瓢虫]","[勾引]","[OK]","[爱你]","[咖啡]","[月亮]","[刀]","[发抖]","[差劲]","[拳头]","[心碎了]","[太阳]","[礼物]","[皮球]","[骷髅]","[挥手]","[闪电]","[饥饿]","[咒骂]","[折磨]","[抠鼻]","[鼓掌]","[糗大了]","[左哼哼]","[打哈欠]","[快哭了]","[吓]","[篮球]","[乒乓]","[NO]","[跳跳]","[怄火]","[转圈]","[磕头]","[回头]","[跳绳]","[激动]","[街舞]","[献吻]","[左太极]","[右太极]","[闭嘴]","[猫咪]","[红双喜]","[鞭炮]","[红灯笼]","[麻将]","[麦克风]","[礼品袋]","[信封]","[象棋]","[彩带]","[蜡烛]","[爆筋]","[棒棒糖]","[奶瓶]","[面条]","[香蕉]","[飞机]","[左车头]","[车厢]","[右车头]","[多云]","[下雨]","[钞票]","[熊猫]","[灯泡]","[风车]","[闹钟]","[雨伞]","[彩球]","[钻戒]","[沙发]","[纸巾]","[手枪]","[青蛙]"];function m(e,i,n){void 0===i&&(i=0);var m=e,g=0===i?1:0,j=i;return Object.entries(o).map((function(e){return m.includes(e[g])&&(m=n&&"zh-CN"===n?e[g]:p(m,e[g],e[j])),e})),m}function p(e,i,o){var n=e;return(n=n.replace(i,o)).includes(i)&&(n=p(n,i,o)),n}export{o as emojiEnKey,i as emojiMap,n as emojiName,e as emojiUrl,m as formatEmojiString};
1
+ var i="https://web.sdk.qcloud.com/im/assets/emoji-plugin/",o={"[TUIEmoji_Expect]":"emoji_0@2x.png","[TUIEmoji_Blink]":"emoji_1@2x.png","[TUIEmoji_Guffaw]":"emoji_2@2x.png","[TUIEmoji_KindSmile]":"emoji_3@2x.png","[TUIEmoji_Haha]":"emoji_4@2x.png","[TUIEmoji_Cheerful]":"emoji_5@2x.png","[TUIEmoji_Smile]":"emoji_6@2x.png","[TUIEmoji_Sorrow]":"emoji_7@2x.png","[TUIEmoji_Speechless]":"emoji_8@2x.png","[TUIEmoji_Amazed]":"emoji_9@2x.png","[TUIEmoji_Complacent]":"emoji_10@2x.png","[TUIEmoji_Lustful]":"emoji_11@2x.png","[TUIEmoji_Stareyes]":"emoji_12@2x.png","[TUIEmoji_Giggle]":"emoji_13@2x.png","[TUIEmoji_Daemon]":"emoji_14@2x.png","[TUIEmoji_Rage]":"emoji_15@2x.png","[TUIEmoji_Yawn]":"emoji_16@2x.png","[TUIEmoji_TearsLaugh]":"emoji_17@2x.png","[TUIEmoji_Silly]":"emoji_18@2x.png","[TUIEmoji_Wail]":"emoji_19@2x.png","[TUIEmoji_Kiss]":"emoji_20@2x.png","[TUIEmoji_Trapped]":"emoji_21@2x.png","[TUIEmoji_Fear]":"emoji_22@2x.png","[TUIEmoji_BareTeeth]":"emoji_23@2x.png","[TUIEmoji_FlareUp]":"emoji_24@2x.png","[TUIEmoji_Tact]":"emoji_25@2x.png","[TUIEmoji_Shit]":"emoji_26@2x.png","[TUIEmoji_ShutUp]":"emoji_27@2x.png","[TUIEmoji_Sigh]":"emoji_28@2x.png","[TUIEmoji_Hehe]":"emoji_29@2x.png","[TUIEmoji_Silent]":"emoji_30@2x.png","[TUIEmoji_Skull]":"emoji_31@2x.png","[TUIEmoji_Mask]":"emoji_32@2x.png","[TUIEmoji_Beer]":"emoji_33@2x.png","[TUIEmoji_Cake]":"emoji_34@2x.png","[TUIEmoji_RedPacket]":"emoji_35@2x.png","[TUIEmoji_Bombs]":"emoji_36@2x.png","[TUIEmoji_Ai]":"emoji_37@2x.png","[TUIEmoji_Celebrate]":"emoji_38@2x.png","[TUIEmoji_Bless]":"emoji_39@2x.png","[TUIEmoji_Flower]":"emoji_40@2x.png","[TUIEmoji_Watermelon]":"emoji_41@2x.png","[TUIEmoji_Cow]":"emoji_42@2x.png","[TUIEmoji_Fool]":"emoji_43@2x.png","[TUIEmoji_Surprised]":"emoji_44@2x.png","[TUIEmoji_Askance]":"emoji_45@2x.png","[TUIEmoji_Monster]":"emoji_46@2x.png","[TUIEmoji_Pig]":"emoji_47@2x.png","[TUIEmoji_Coffee]":"emoji_48@2x.png","[TUIEmoji_Ok]":"emoji_49@2x.png","[TUIEmoji_Heart]":"emoji_50@2x.png","[TUIEmoji_Sun]":"emoji_51@2x.png","[TUIEmoji_Moon]":"emoji_52@2x.png","[TUIEmoji_Star]":"emoji_53@2x.png","[TUIEmoji_Rich]":"emoji_54@2x.png","[TUIEmoji_Fortune]":"emoji_55@2x.png","[TUIEmoji_857]":"emoji_56@2x.png","[TUIEmoji_666]":"emoji_57@2x.png","[TUIEmoji_Prohibit]":"emoji_58@2x.png","[TUIEmoji_Convinced]":"emoji_59@2x.png","[TUIEmoji_Knife]":"emoji_60@2x.png","[TUIEmoji_Like]":"emoji_61@2x.png"};export{i as emojiBaseUrl,o as emojiUrlMap};
@@ -1 +1 @@
1
- import{__assign as a}from"tslib";import t from"@tencentcloud/chat";import{decodeText as e}from"./decodeText.js";import{MESSAGE_STATUS as c}from"../../../constants.js";import{JSONStringToParse as o}from"../../utils.js";function n(a){var t=a.split(".");return t[t.length-1]}function s(a){var e,c,o,s,r,i={message:a,text:""},l=a.nick||(null===(e=null==a?void 0:a.payload)||void 0===e?void 0:e.userIDList.join(","));switch((null===(o=null===(c=null==a?void 0:a.payload)||void 0===c?void 0:c.memberList)||void 0===o?void 0:o.length)>0&&(l="",null===(r=null===(s=null==a?void 0:a.payload)||void 0===s?void 0:s.memberList)||void 0===r||r.map((function(a){return l+="".concat((null==a?void 0:a.nick)||(null==a?void 0:a.userID),","),a})),l=l.slice(0,-1)),a.payload.operationType){case t.TYPES.GRP_TIP_MBR_JOIN:i.text="".concat(l," ").concat(n("message.tip.Join in group"));break;case t.TYPES.GRP_TIP_MBR_QUIT:i.text="".concat(n("message.tip.member"),":").concat(l," ").concat(n("message.tip.quit group"));break;case t.TYPES.GRP_TIP_MBR_KICKED_OUT:i.text="".concat(n("message.tip.member"),":").concat(l," ").concat(n("message.tip.by")," ").concat(a.payload.operatorID," ").concat(n("message.tip.kicked out of group"));break;case t.TYPES.GRP_TIP_MBR_SET_ADMIN:i.text="".concat(n("message.tip.member"),":").concat(l," ").concat(n("message.tip.become admin"));break;case t.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:i.text="".concat(n("message.tip.member"),":").concat(l," ").concat(n("message.tip.by revoked administrator"));break;case t.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:i.text=function(a){var t=a.payload,e=t.newGroupProfile,c=t.operatorID,o="",s=Object.keys(e)[0];switch(s){case"muteAllMembers":o=e[s]?"".concat(n("message.tip.admin")," ").concat(c," ").concat(n("message.tip.enable all staff mute")):"".concat(n("message.tip.admin")," ").concat(c," ").concat(n("message.tip.unmute everyone"));break;case"ownerID":o="".concat(e[s]," ").concat(n("message.tip.become the new owner"));break;case"groupName":o="".concat(c," ").concat(n("message.tip.modify group name")," ").concat(e[s]);break;case"notification":o="".concat(c," ").concat(n("message.tip.post a new announcement"))}return o}(a);break;case t.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:a.payload.memberList.map((function(a){return a.muteTime>0?i.text="".concat(n("message.tip.member"),":").concat(a.userID).concat(n("message.tip.muted")):i.text="".concat(n("message.tip.member"),":").concat(a.userID).concat(n("message.tip.unmuted")),a}));break;default:i.text="[".concat(n("message.tip.reminder message"),"]")}return i}function r(a){return{text:e(a.payload)}}function i(a){var t={message:a,name:"",url:""};return t.name=a.payload.data,a.payload.data.indexOf("@2x")<0&&(t.name="".concat(t.name,"@2x")),t.url="https://web.sdk.qcloud.com/im/assets/face-elem/".concat(t.name,".png"),t}function l(a){var t={lon:"",lat:"",href:"",url:"",description:"",message:a};return t.lon=a.payload.longitude.toFixed(6),t.lat=a.payload.latitude.toFixed(6),t.href="https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&"+"pointx=".concat(t.lon,"&pointy=").concat(t.lat,"&name=").concat(a.payload.description),t.url="https://apis.map.qq.com/ws/staticmap/v2/?"+"center=".concat(t.lat,",").concat(t.lon,"&zoom=10&size=300*150&maptype=roadmap&")+"markers=size:large|color:0xFFCCFF|label:k|".concat(t.lat,",").concat(t.lon,"&")+"key=UBNBZ-PTP3P-TE7DB-LHRTI-Y4YLE-VWBBD",t.description=a.payload.description,t}function p(a){return{progress:(null==a?void 0:a.status)===c.UNSEND&&a.progress,url:a.payload.imageInfoArray[1].url,message:a}}function m(a){var t,e;return{progress:(null==a?void 0:a.status)===c.UNSEND&&(null==a?void 0:a.progress),url:null===(t=null==a?void 0:a.payload)||void 0===t?void 0:t.videoUrl,snapshotUrl:null===(e=null==a?void 0:a.payload)||void 0===e?void 0:e.snapshotUrl,message:a}}function u(a){return{progress:(null==a?void 0:a.status)===c.UNSEND&&a.progress,url:a.payload.url,message:a,second:a.payload.second}}function d(a){var t="";return t=a.payload.fileSize>=1048576?"".concat((a.payload.fileSize/1048576).toFixed(2)," Mb"):a.payload.fileSize>=1024?"".concat((a.payload.fileSize/1024).toFixed(2)," Kb"):"".concat(a.payload.fileSize.toFixed(2),"B"),{progress:(null==a?void 0:a.status)===c.UNSEND&&a.progress,url:a.payload.fileUrl,message:a,name:a.payload.fileName,size:t}}function g(t){return a({message:t},t.payload)}function y(a){var t={},e={};try{t=o(a.payload.data)}catch(a){t={}}if(1!==t.businessID)return"";try{e=o(t.data)}catch(a){e={}}switch(t.actionType){case 1:return e.call_end>=0&&!t.groupID?"".concat(n("message.custom.talkTime"),":").concat(v(e.call_end)):t.groupID?"".concat(n("message.custom.groupCallEnd")):e.data&&"switchToAudio"===e.data.cmd?"".concat(n("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(n("message.custom.switchToVideoCall")):"".concat(n("message.custom.all"));case 2:return"".concat(n("message.custom.cancel"));case 3:return e.data&&"switchToAudio"===e.data.cmd?"".concat(n("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(n("message.custom.switchToVideoCall")):"".concat(n("message.custom.accepted"));case 4:return"".concat(n("message.custom.rejected"));case 5:return e.data&&"switchToAudio"===e.data.cmd?"".concat(n("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(n("message.custom.switchToVideoCall")):"".concat(n("message.custom.noResp"));default:return""}}function I(a){return{message:a,custom:y(a)||(null==a?void 0:a.payload)||"[".concat(n("message.custom.custom"),"]")}}function f(a){var t=a.payload.groupProfile.name||a.payload.groupProfile.groupID;switch(a.payload.operationType){case 1:return"".concat(a.payload.operatorID," ").concat(n("message.tip.申请加入群组"),":").concat(t);case 2:return"".concat(n("message.tip.成功加入群组"),":").concat(t);case 3:return"".concat(n("message.tip.申请加入群组"),":").concat(t," ").concat(n("message.tip.被拒绝"));case 4:return"".concat(n("message.tip.你被管理员")).concat(a.payload.operatorID," ").concat(n("message.tip.踢出群组"),":").concat(t);case 5:return"".concat(n("message.tip.群"),":").concat(t," ").concat(n("message.tip.被")," ").concat(a.payload.operatorID," ").concat(n("message.tip.解散"));case 6:return"".concat(a.payload.operatorID," ").concat(n("message.tip.创建群"),":").concat(t);case 7:case 12:return"".concat(a.payload.operatorID," ").concat(n("message.tip.邀请你加群"),":").concat(t);case 8:return"".concat(n("message.tip.你退出群组"),":").concat(t);case 9:return"".concat(n("message.tip.你被")).concat(a.payload.operatorID," ").concat(n("message.tip.设置为群"),":").concat(t," ").concat(n("message.tip.的管理员"));case 10:return"".concat(n("message.tip.你被")).concat(a.payload.operatorID," ").concat(n("message.tip.撤销群"),":").concat(t," ").concat(n("message.tip.的管理员身份"));case 13:return"".concat(a.payload.operatorID," ").concat(n("message.tip.同意加群"),":").concat(t);case 14:return"".concat(a.payload.operatorID," ").concat(n("message.tip.拒接加群"),":").concat(t);case 255:return"".concat(n("message.tip.自定义群系统通知"),": ").concat(a.payload.userDefinedField);default:return""}}function v(a){var t,e,c,o,n=a;return n>=3600?(e=parseInt("".concat(n/3600),10)<10?"0".concat(parseInt("".concat(n/3600),10)):parseInt("".concat(n/3600),10),c=parseInt("".concat(n%60/60),10)<10?"0".concat(parseInt("".concat(n%60/60),10)):parseInt("".concat(n%60/60),10),(o=n%3600<10?parseInt("0".concat(n%3600)):n%3600)>60&&(c=parseInt("".concat(o/60),10)<10?"0".concat(parseInt("".concat(o/60),10)):parseInt("".concat(o/60),10),o=o%60<10?"0".concat(o%60):o%60),t="".concat(e,":").concat(c,":").concat(o)):n>=60&&n<3600?(c=parseInt("".concat(n/60),10)<10?"0".concat(parseInt("".concat(n/60),10)):parseInt("".concat(n/60),10),o=n%60<10?"0".concat(n%60):n%60,t="00:".concat(c,":").concat(o)):n<60&&(o=n<10?"0".concat(n):n,t="00:00:".concat(o)),t}var T=function(a){var t,e=o(null===(t=null==a?void 0:a.payload)||void 0===t?void 0:t.data);if(1===(null==e?void 0:e.businessID)&&(null==e?void 0:e.data)&&"av_call"===o(e.data).businessID)return!0;return!1};export{y as extractCallingInfoFromMessage,v as formatTime,u as handleAudioMessageShowContext,I as handleCustomMessageShowContext,i as handleFaceMessageShowContext,d as handleFileMessageShowContext,p as handleImageMessageShowContext,l as handleLocationMessageShowContext,g as handleMergerMessageShowContext,r as handleTextMessageShowContext,s as handleTipMessageShowContext,m as handleVideoMessageShowContext,T as isCallMessage,f as translateGroupSystemNotice};
1
+ import{__assign as a}from"tslib";import t from"@tencentcloud/chat";import{MESSAGE_STATUS as e}from"../../../constants.js";import{JSONStringToParse as c}from"../../utils.js";function o(a){var t=a.split(".");return t[t.length-1]}function n(a){var e,c,n,s,r,i={message:a,text:""},l=a.nick||(null===(e=null==a?void 0:a.payload)||void 0===e?void 0:e.userIDList.join(","));switch((null===(n=null===(c=null==a?void 0:a.payload)||void 0===c?void 0:c.memberList)||void 0===n?void 0:n.length)>0&&(l="",null===(r=null===(s=null==a?void 0:a.payload)||void 0===s?void 0:s.memberList)||void 0===r||r.map((function(a){return l+="".concat((null==a?void 0:a.nick)||(null==a?void 0:a.userID),","),a})),l=l.slice(0,-1)),a.payload.operationType){case t.TYPES.GRP_TIP_MBR_JOIN:i.text="".concat(l," ").concat(o("message.tip.Join in group"));break;case t.TYPES.GRP_TIP_MBR_QUIT:i.text="".concat(o("message.tip.member"),":").concat(l," ").concat(o("message.tip.quit group"));break;case t.TYPES.GRP_TIP_MBR_KICKED_OUT:i.text="".concat(o("message.tip.member"),":").concat(l," ").concat(o("message.tip.by")," ").concat(a.payload.operatorID," ").concat(o("message.tip.kicked out of group"));break;case t.TYPES.GRP_TIP_MBR_SET_ADMIN:i.text="".concat(o("message.tip.member"),":").concat(l," ").concat(o("message.tip.become admin"));break;case t.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:i.text="".concat(o("message.tip.member"),":").concat(l," ").concat(o("message.tip.by revoked administrator"));break;case t.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:i.text=function(a){var t=a.payload,e=t.newGroupProfile,c=t.operatorID,n="",s=Object.keys(e)[0];switch(s){case"muteAllMembers":n=e[s]?"".concat(o("message.tip.admin")," ").concat(c," ").concat(o("message.tip.enable all staff mute")):"".concat(o("message.tip.admin")," ").concat(c," ").concat(o("message.tip.unmute everyone"));break;case"ownerID":n="".concat(e[s]," ").concat(o("message.tip.become the new owner"));break;case"groupName":n="".concat(c," ").concat(o("message.tip.modify group name")," ").concat(e[s]);break;case"notification":n="".concat(c," ").concat(o("message.tip.post a new announcement"))}return n}(a);break;case t.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:a.payload.memberList.map((function(a){return a.muteTime>0?i.text="".concat(o("message.tip.member"),":").concat(a.userID).concat(o("message.tip.muted")):i.text="".concat(o("message.tip.member"),":").concat(a.userID).concat(o("message.tip.unmuted")),a}));break;default:i.text="[".concat(o("message.tip.reminder message"),"]")}return i}function s(a){return a.getMessageContent()}function r(a){var t={message:a,name:"",url:""};return t.name=a.payload.data,a.payload.data.indexOf("@2x")<0&&(t.name="".concat(t.name,"@2x")),t.url="https://web.sdk.qcloud.com/im/assets/face-elem/".concat(t.name,".png"),t}function i(a){var t={lon:"",lat:"",href:"",url:"",description:"",message:a};return t.lon=a.payload.longitude.toFixed(6),t.lat=a.payload.latitude.toFixed(6),t.href="https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&"+"pointx=".concat(t.lon,"&pointy=").concat(t.lat,"&name=").concat(a.payload.description),t.url="https://apis.map.qq.com/ws/staticmap/v2/?"+"center=".concat(t.lat,",").concat(t.lon,"&zoom=10&size=300*150&maptype=roadmap&")+"markers=size:large|color:0xFFCCFF|label:k|".concat(t.lat,",").concat(t.lon,"&")+"key=UBNBZ-PTP3P-TE7DB-LHRTI-Y4YLE-VWBBD",t.description=a.payload.description,t}function l(a){return{progress:(null==a?void 0:a.status)===e.UNSEND&&a.progress,url:a.payload.imageInfoArray[1].url,message:a}}function p(a){var t,c;return{progress:(null==a?void 0:a.status)===e.UNSEND&&(null==a?void 0:a.progress),url:null===(t=null==a?void 0:a.payload)||void 0===t?void 0:t.videoUrl,snapshotUrl:null===(c=null==a?void 0:a.payload)||void 0===c?void 0:c.snapshotUrl,message:a}}function m(a){return{progress:(null==a?void 0:a.status)===e.UNSEND&&a.progress,url:a.payload.url,message:a,second:a.payload.second}}function u(a){var t="";return t=a.payload.fileSize>=1048576?"".concat((a.payload.fileSize/1048576).toFixed(2)," Mb"):a.payload.fileSize>=1024?"".concat((a.payload.fileSize/1024).toFixed(2)," Kb"):"".concat(a.payload.fileSize.toFixed(2),"B"),{progress:(null==a?void 0:a.status)===e.UNSEND&&a.progress,url:a.payload.fileUrl,message:a,name:a.payload.fileName,size:t}}function d(t){return a({message:t},t.payload)}function g(a){var t={},e={};try{t=c(a.payload.data)}catch(a){t={}}if(1!==t.businessID)return"";try{e=c(t.data)}catch(a){e={}}switch(t.actionType){case 1:return e.call_end>=0&&!t.groupID?"".concat(o("message.custom.talkTime"),":").concat(f(e.call_end)):t.groupID?"".concat(o("message.custom.groupCallEnd")):e.data&&"switchToAudio"===e.data.cmd?"".concat(o("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(o("message.custom.switchToVideoCall")):"".concat(o("message.custom.all"));case 2:return"".concat(o("message.custom.cancel"));case 3:return e.data&&"switchToAudio"===e.data.cmd?"".concat(o("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(o("message.custom.switchToVideoCall")):"".concat(o("message.custom.accepted"));case 4:return"".concat(o("message.custom.rejected"));case 5:return e.data&&"switchToAudio"===e.data.cmd?"".concat(o("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(o("message.custom.switchToVideoCall")):"".concat(o("message.custom.noResp"));default:return""}}function y(a){return{message:a,custom:g(a)||(null==a?void 0:a.payload)||"[".concat(o("message.custom.custom"),"]")}}function I(a){var t=a.payload.groupProfile.name||a.payload.groupProfile.groupID;switch(a.payload.operationType){case 1:return"".concat(a.payload.operatorID," ").concat(o("message.tip.申请加入群组"),":").concat(t);case 2:return"".concat(o("message.tip.成功加入群组"),":").concat(t);case 3:return"".concat(o("message.tip.申请加入群组"),":").concat(t," ").concat(o("message.tip.被拒绝"));case 4:return"".concat(o("message.tip.你被管理员")).concat(a.payload.operatorID," ").concat(o("message.tip.踢出群组"),":").concat(t);case 5:return"".concat(o("message.tip.群"),":").concat(t," ").concat(o("message.tip.被")," ").concat(a.payload.operatorID," ").concat(o("message.tip.解散"));case 6:return"".concat(a.payload.operatorID," ").concat(o("message.tip.创建群"),":").concat(t);case 7:case 12:return"".concat(a.payload.operatorID," ").concat(o("message.tip.邀请你加群"),":").concat(t);case 8:return"".concat(o("message.tip.你退出群组"),":").concat(t);case 9:return"".concat(o("message.tip.你被")).concat(a.payload.operatorID," ").concat(o("message.tip.设置为群"),":").concat(t," ").concat(o("message.tip.的管理员"));case 10:return"".concat(o("message.tip.你被")).concat(a.payload.operatorID," ").concat(o("message.tip.撤销群"),":").concat(t," ").concat(o("message.tip.的管理员身份"));case 13:return"".concat(a.payload.operatorID," ").concat(o("message.tip.同意加群"),":").concat(t);case 14:return"".concat(a.payload.operatorID," ").concat(o("message.tip.拒接加群"),":").concat(t);case 255:return"".concat(o("message.tip.自定义群系统通知"),": ").concat(a.payload.userDefinedField);default:return""}}function f(a){var t,e,c,o,n=a;return n>=3600?(e=parseInt("".concat(n/3600),10)<10?"0".concat(parseInt("".concat(n/3600),10)):parseInt("".concat(n/3600),10),c=parseInt("".concat(n%60/60),10)<10?"0".concat(parseInt("".concat(n%60/60),10)):parseInt("".concat(n%60/60),10),(o=n%3600<10?parseInt("0".concat(n%3600)):n%3600)>60&&(c=parseInt("".concat(o/60),10)<10?"0".concat(parseInt("".concat(o/60),10)):parseInt("".concat(o/60),10),o=o%60<10?"0".concat(o%60):o%60),t="".concat(e,":").concat(c,":").concat(o)):n>=60&&n<3600?(c=parseInt("".concat(n/60),10)<10?"0".concat(parseInt("".concat(n/60),10)):parseInt("".concat(n/60),10),o=n%60<10?"0".concat(n%60):n%60,t="00:".concat(c,":").concat(o)):n<60&&(o=n<10?"0".concat(n):n,t="00:00:".concat(o)),t}var v=function(a){var t,e=c(null===(t=null==a?void 0:a.payload)||void 0===t?void 0:t.data);if(1===(null==e?void 0:e.businessID)&&(null==e?void 0:e.data)&&"av_call"===c(e.data).businessID)return!0;return!1};export{g as extractCallingInfoFromMessage,f as formatTime,m as handleAudioMessageShowContext,y as handleCustomMessageShowContext,r as handleFaceMessageShowContext,u as handleFileMessageShowContext,l as handleImageMessageShowContext,i as handleLocationMessageShowContext,d as handleMergerMessageShowContext,s as handleTextMessageShowContext,n as handleTipMessageShowContext,p as handleVideoMessageShowContext,v as isCallMessage,I as translateGroupSystemNotice};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o}from"react";import{useTUIMessageInputContext as a}from"../../context/MessageInputContext.js";import{Icon as n}from"../Icon/Icon.js";import{IconTypes as r}from"../Icon/type.js";import{Popup as c}from"../Popup/index.js";import{emojiName as m,emojiUrl as p,emojiMap as s}from"../MessageElement/utils/emojiMap.js";function l(){var l=o(!1),u=l[0],f=l[1],d=o(0),g=d[0];d[1];var j=o(""),h=j[0],x=j[1],I=function(){f(!u)},M=a("TUIMessageInputDefault"),v=M.onSelectEmoji,N=M.sendFaceMessage,b=function(t){var e={index:g,data:t.target.dataset.data};e.data&&(0===g?v&&v(e):(N&&N(e),I()))};return e("div",t({className:"emoji-picker input-plugin-popup"},{children:[i(n,{width:20,height:20,type:r.EMOJI,onClick:I}),i(c,t({className:"input-plugin-popup-box ".concat(h),show:u,close:I,handleVisible:function(t){x("".concat(!t.top&&"emoji-plugin-top"," ").concat(!t.left&&"emoji-plugin-right"))}},{children:i("ul",t({className:"face-list"},{children:0===g&&m.map((function(e,o){var a=e+o;return i("li",t({role:"menuitem",className:"face-list-item",onClick:b},{children:i("img",{src:"".concat(p+s[e]),alt:"","data-data":e})}),a)}))}))}))]}))}export{l as EmojiPicker};
1
+ import{__assign as t}from"tslib";import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as i}from"react";import{useUIKit as n}from"@tencentcloud/uikit-base-component-react";import{useTUIMessageInputContext as a}from"../../context/MessageInputContext.js";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as r}from"../Icon/type.js";import{Popup as m}from"../Popup/index.js";import{emojiUrlMap as p,emojiBaseUrl as s}from"../MessageElement/utils/emojiMap.js";function l(){var l=i(!1),u=l[0],f=l[1],d=i(0),j=d[0];d[1];var g=i(""),h=g[0],x=g[1],I=n().t,M=function(){f(!u)},b=a("TUIMessageInputDefault"),k=b.onSelectEmoji,v=b.sendFaceMessage,E=function(t){var e={index:j,data:t.target.dataset.data};e.data&&(0===j?k&&k(e):(v&&v(e),M()))};return e("div",t({className:"emoji-picker input-plugin-popup"},{children:[o(c,{width:20,height:20,type:r.EMOJI,onClick:M}),o(m,t({className:"input-plugin-popup-box ".concat(h),show:u,close:M,handleVisible:function(t){x("".concat(!t.top&&"emoji-plugin-top"," ").concat(!t.left&&"emoji-plugin-right"))}},{children:o("ul",t({className:"face-list"},{children:0===j&&Object.keys(p).map((function(e){return o("li",t({role:"menuitem",className:"face-list-item",onClick:E},{children:o("img",{src:s+p[e],alt:I("Emoji.".concat(e)),"data-data":e})}),e)}))}))}))]}))}export{l as EmojiPicker};
@@ -1 +1 @@
1
- import{__assign as e,__spreadArray as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as i,useCallback as a,useEffect as n}from"react";import{useTranslation as l}from"react-i18next";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import{useTUIChatActionContext as c}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import{Model as s}from"../Model/index.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{Input as u}from"../Input/Input.js";import{Checkbox as h}from"../Checkbox/index.js";import{Avatar as f}from"../Avatar/Avatar.js";import{getDisplayImage as p,getDisplayTitle as v}from"../ConversationPreview/utils.js";import{MESSAGE_OPERATE as g}from"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"./hooks/useHandleQuoteMessage.js";import{useHandleForwardMessage as w}from"./hooks/useHandleForwardMessage.js";function C(C){var N,I=C.handleForward,j=l().t,x=i([]),b=x[0],k=x[1],F=i([]),D=F[0],A=F[1],L=i(""),M=L[0],R=L[1],y=c().operateMessage,S=w(),T=S.message,U=S.sendForwardMessage,H=S.conversationList,z=void 0===H?[]:H,E=a((function(){var e;y&&y(((e={})[g.FORWARD]=null,e))}),[y]),P=z,O=function(e){e.checked?k(t(t([],b,!0),[e.value],!1)):k(b.filter((function(t){return t!==e.value})))};return n((function(){k([]),A([]),R("")}),[T]),T&&z.length>0&&o(s,e({onClick:E},{children:r("div",e({role:"button",tabIndex:0,className:"tui-forward",onClick:function(e){!function(e){e.stopPropagation()}(e)}},{children:[r("header",e({className:"tui-forward-header"},{children:[o(d,{type:m.CANCEL,width:16,height:16,onClick:E}),o("h2",e({className:"tui-forward-title"},{children:j("TUIChat.Forward to")}))]})),o("div",e({className:"tui-forward-search"},{children:o(u,{className:"tui-forward-search-input",placeholder:"Search",clearable:!0,value:M,onChange:function(e){var t,o;if(R(null===(t=e.target)||void 0===t?void 0:t.value),null===(o=e.target)||void 0===o?void 0:o.value){var r=z.filter((function(t){var o,r=v(t).toLocaleLowerCase(),i=null===(o=e.target)||void 0===o?void 0:o.value.toLocaleLowerCase();return r.includes(i)}));A(r)}else A([])},prefix:o(d,{type:m.SEARCH,height:16,width:16})})})),r("main",e({className:"tui-forward-main"},{children:[M&&r("ul",e({className:"tui-forward-list"},{children:[o("h3",e({className:"tui-forward-list-title"},{children:j("TUIChat.Search Result")})),D.length>0&&D.map((function(t){return r("li",e({className:"tui-forward-list-item"},{children:[r("label",e({htmlFor:"".concat(t.conversationID),className:"info"},{children:[o(f,{image:p(t),size:40}),o("div",e({className:"info-nick"},{children:v(t)}))]})),o(h,{onChange:function(e){O(e)},id:"".concat(t.conversationID),value:t})]}),t.conversationID)})),0===D.length&&o("p",e({className:"no-result"},{children:j("TUIChat.No Result")}))]})),!M&&P.length>0&&o("ul",e({className:"tui-forward-list"},{children:P.map((function(t){return r("li",e({className:"tui-forward-list-item"},{children:[r("label",e({htmlFor:"".concat(t.conversationID),className:"info"},{children:[o(f,{image:p(t),size:40}),o("div",e({className:"info-nick"},{children:v(t)}))]})),o(h,{onChange:O,id:"".concat(t.conversationID),value:t})]}),t.conversationID)}))}))]})),r("footer",e({className:"tui-forward-footer"},{children:[o("div",e({className:"tui-forward-footer-name"},{children:b.length>0&&(N=b,(null==N?void 0:N.map((function(e){return v(e)}))).toString())})),o("button",e({type:"button",className:"button",onClick:function(){I?I({list:b,message:T}):U(b),E()},disabled:0===b.length},{children:j("TUIChat.Forward")}))]}))]}))}))}export{C as Forward};
1
+ import{__assign as e,__spreadArray as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as i,useCallback as n,useEffect as a}from"react";import{useUIKit as l}from"@tencentcloud/uikit-base-component-react";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatActionContext as c}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{Model as s}from"../Model/index.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{Input as u}from"../Input/Input.js";import{Checkbox as h}from"../Checkbox/index.js";import{Avatar as f}from"../Avatar/Avatar.js";import{getDisplayImage as p,getDisplayTitle as v}from"../ConversationPreview/utils.js";import{MESSAGE_OPERATE as g}from"../../constants.js";import"../../store/UIManagerStore.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"./hooks/useHandleQuoteMessage.js";import{useHandleForwardMessage as w}from"./hooks/useHandleForwardMessage.js";function C(C){var N,I=C.handleForward,j=l().t,b=i([]),k=b[0],x=b[1],F=i([]),D=F[0],M=F[1],A=i(""),L=A[0],R=A[1],S=c().operateMessage,U=w(),y=U.message,T=U.sendForwardMessage,H=U.conversationList,z=void 0===H?[]:H,E=n((function(){var e;S&&S(((e={})[g.FORWARD]=null,e))}),[S]),P=z,O=function(e){e.checked?x(t(t([],k,!0),[e.value],!1)):x(k.filter((function(t){return t!==e.value})))};return a((function(){x([]),M([]),R("")}),[y]),y&&z.length>0&&o(s,e({onClick:E},{children:r("div",e({role:"button",tabIndex:0,className:"tui-forward",onClick:function(e){!function(e){e.stopPropagation()}(e)}},{children:[r("header",e({className:"tui-forward-header"},{children:[o(d,{type:m.CANCEL,width:16,height:16,onClick:E}),o("h2",e({className:"tui-forward-title"},{children:j("TUIChat.Forward to")}))]})),o("div",e({className:"tui-forward-search"},{children:o(u,{className:"tui-forward-search-input",placeholder:"Search",clearable:!0,value:L,onChange:function(e){var t,o;if(R(null===(t=e.target)||void 0===t?void 0:t.value),null===(o=e.target)||void 0===o?void 0:o.value){var r=z.filter((function(t){var o,r=v(t).toLocaleLowerCase(),i=null===(o=e.target)||void 0===o?void 0:o.value.toLocaleLowerCase();return r.includes(i)}));M(r)}else M([])},prefix:o(d,{type:m.SEARCH,height:16,width:16})})})),r("main",e({className:"tui-forward-main"},{children:[L&&r("ul",e({className:"tui-forward-list"},{children:[o("h3",e({className:"tui-forward-list-title"},{children:j("TUIChat.Search Result")})),D.length>0&&D.map((function(t){return r("li",e({className:"tui-forward-list-item"},{children:[r("label",e({htmlFor:"".concat(t.conversationID),className:"info"},{children:[o(f,{image:p(t),size:40}),o("div",e({className:"info-nick"},{children:v(t)}))]})),o(h,{onChange:function(e){O(e)},id:"".concat(t.conversationID),value:t})]}),t.conversationID)})),0===D.length&&o("p",e({className:"no-result"},{children:j("TUIChat.No Result")}))]})),!L&&P.length>0&&o("ul",e({className:"tui-forward-list"},{children:P.map((function(t){return r("li",e({className:"tui-forward-list-item"},{children:[r("label",e({htmlFor:"".concat(t.conversationID),className:"info"},{children:[o(f,{image:p(t),size:40}),o("div",e({className:"info-nick"},{children:v(t)}))]})),o(h,{onChange:O,id:"".concat(t.conversationID),value:t})]}),t.conversationID)}))}))]})),r("footer",e({className:"tui-forward-footer"},{children:[o("div",e({className:"tui-forward-footer-name"},{children:k.length>0&&(N=k,(null==N?void 0:N.map((function(e){return v(e)}))).toString())})),o("button",e({type:"button",className:"button",onClick:function(){I?I({list:k,message:y}):T(k),E()},disabled:0===k.length},{children:j("TUIChat.Forward")}))]}))]}))}))}export{C as Forward};
@@ -1 +1 @@
1
- import{__assign as i,__spreadArray as o}from"tslib";import{jsxs as n,jsx as e}from"react/jsx-runtime";import{useRef as l}from"react";import{useTranslation as t}from"react-i18next";import{EmojiPicker as r}from"./EmojiPicker.js";import{Plugins as u}from"../Plugins/index.js";import{useUploadElement as c}from"./hooks/useUploadElement.js";import{MESSAGE_TYPE_NAME as d}from"../../constants.js";import{useTUIMessageInputContext as s}from"../../context/MessageInputContext.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as a}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";function p(){var p,v,m,g,f,h,C,I=s("TUIMessageInputDefault"),M=I.sendUploadMessage,j=I.pluginConfig,k=t().t,x=a("TUIMessageInput").TUIMessageInputConfig,P=(null==j?void 0:j.plugins)||(null===(p=null==x?void 0:x.pluginConfig)||void 0===p?void 0:p.plugins)||[],N=(null==j?void 0:j.showNumber)||(null===(v=null==x?void 0:x.pluginConfig)||void 0===v?void 0:v.showNumber)||1,U=(null==j?void 0:j.MoreIcon)||(null===(m=null==x?void 0:x.pluginConfig)||void 0===m?void 0:m.MoreIcon),E=function(i,o,n){return"boolean"==typeof i?i:"boolean"==typeof o?o:n},b=E(null==j?void 0:j.isEmojiPicker,null===(g=null==x?void 0:x.pluginConfig)||void 0===g?void 0:g.isEmojiPicker,!0),T=E(null==j?void 0:j.isImagePicker,null===(f=null==x?void 0:x.pluginConfig)||void 0===f?void 0:f.isImagePicker,!0),y=E(null==j?void 0:j.isVideoPicker,null===(h=null==x?void 0:x.pluginConfig)||void 0===h?void 0:h.isVideoPicker,!0),F=E(null==j?void 0:j.isFilePicker,null===(C=null==x?void 0:x.pluginConfig)||void 0===C?void 0:C.isFilePicker,!0),V=l(),w=T&&c({children:n("div",i({className:"input-plugin-item"},{children:[e("i",i({className:"iconfont input-icon"},{children:""})),e("span",{children:k("TUIChat.Image")})]})),type:"image",accept:"image/*",onChange:function(i){var o;(null===(o=null==V?void 0:V.current)||void 0===o?void 0:o.closeMore)&&V.current.closeMore(),M&&M({file:i},d.IMAGE)}}),D=y&&c({children:n("div",i({className:"input-plugin-item"},{children:[e("i",i({className:"iconfont input-icon"},{children:""})),e("span",{children:k("TUIChat.Video")})]})),type:"video",accept:"video/*",onChange:function(i){var o;(null===(o=null==V?void 0:V.current)||void 0===o?void 0:o.closeMore)&&V.current.closeMore(),M&&M({file:i},d.VIDEO)}}),A=F&&c({children:n("div",i({className:"input-plugin-item"},{children:[e("i",i({className:"iconfont input-icon"},{children:""})),e("span",{children:k("TUIChat.File")})]})),type:"file",accept:"file/*",onChange:function(i){var o;(null===(o=null==V?void 0:V.current)||void 0===o?void 0:o.closeMore)&&V.current.closeMore(),M&&M({file:i},d.FILE)}}),G=o([b&&e(r,{}),w,D,A],P,!0).filter((function(i){return i}));return e(u,{ref:V,plugins:G,showNumber:N,MoreIcon:U})}export{p as InputPluginsDefalut};
1
+ import{__assign as i,__spreadArray as o}from"tslib";import{jsxs as n,jsx as e}from"react/jsx-runtime";import{useRef as l}from"react";import{useUIKit as t}from"@tencentcloud/uikit-base-component-react";import{EmojiPicker as r}from"./EmojiPicker.js";import{Plugins as u}from"../Plugins/index.js";import{useUploadElement as c}from"./hooks/useUploadElement.js";import{MESSAGE_TYPE_NAME as d}from"../../constants.js";import{useTUIMessageInputContext as s}from"../../context/MessageInputContext.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as a}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";function p(){var p,m,v,g,f,h,C,I=s("TUIMessageInputDefault"),M=I.sendUploadMessage,k=I.pluginConfig,j=t().t,x=a("TUIMessageInput").TUIMessageInputConfig,P=(null==k?void 0:k.plugins)||(null===(p=null==x?void 0:x.pluginConfig)||void 0===p?void 0:p.plugins)||[],N=(null==k?void 0:k.showNumber)||(null===(m=null==x?void 0:x.pluginConfig)||void 0===m?void 0:m.showNumber)||1,U=(null==k?void 0:k.MoreIcon)||(null===(v=null==x?void 0:x.pluginConfig)||void 0===v?void 0:v.MoreIcon),b=function(i,o,n){return"boolean"==typeof i?i:"boolean"==typeof o?o:n},E=b(null==k?void 0:k.isEmojiPicker,null===(g=null==x?void 0:x.pluginConfig)||void 0===g?void 0:g.isEmojiPicker,!0),T=b(null==k?void 0:k.isImagePicker,null===(f=null==x?void 0:x.pluginConfig)||void 0===f?void 0:f.isImagePicker,!0),y=b(null==k?void 0:k.isVideoPicker,null===(h=null==x?void 0:x.pluginConfig)||void 0===h?void 0:h.isVideoPicker,!0),F=b(null==k?void 0:k.isFilePicker,null===(C=null==x?void 0:x.pluginConfig)||void 0===C?void 0:C.isFilePicker,!0),V=l(),w=T&&c({children:n("div",i({className:"input-plugin-item"},{children:[e("i",i({className:"iconfont input-icon"},{children:""})),e("span",{children:j("TUIChat.Image")})]})),type:"image",accept:"image/*",onChange:function(i){var o;(null===(o=null==V?void 0:V.current)||void 0===o?void 0:o.closeMore)&&V.current.closeMore(),M&&M({file:i},d.IMAGE)}}),D=y&&c({children:n("div",i({className:"input-plugin-item"},{children:[e("i",i({className:"iconfont input-icon"},{children:""})),e("span",{children:j("TUIChat.Video")})]})),type:"video",accept:"video/*",onChange:function(i){var o;(null===(o=null==V?void 0:V.current)||void 0===o?void 0:o.closeMore)&&V.current.closeMore(),M&&M({file:i},d.VIDEO)}}),A=F&&c({children:n("div",i({className:"input-plugin-item"},{children:[e("i",i({className:"iconfont input-icon"},{children:""})),e("span",{children:j("TUIChat.File")})]})),type:"file",accept:"file/*",onChange:function(i){var o;(null===(o=null==V?void 0:V.current)||void 0===o?void 0:o.closeMore)&&V.current.closeMore(),M&&M({file:i},d.FILE)}}),G=o([E&&e(r,{}),w,D,A],P,!0).filter((function(i){return i}));return e(u,{ref:V,plugins:G,showNumber:N,MoreIcon:U})}export{p as InputPluginsDefalut};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useCallback as n}from"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatActionContext as i}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{MESSAGE_OPERATE as m}from"../../constants.js";import{useHandleQuoteMessage as c}from"./hooks/useHandleQuoteMessage.js";import{formatEmojiString as a}from"../MessageElement/utils/emojiMap.js";function l(l){var u=l.message,p=i().operateMessage,d=c(u),f=d.cloudCustomData,h=d.message,g=n((function(){var t;p&&p(((t={})[m.QUOTE]=null,t))}),[p]),j=null==f?void 0:f.messageReply;return j&&e("div",t({className:"input-quote"},{children:[e("div",t({className:"input-quote-content"},{children:[o("label",t({htmlFor:"input-quote-content"},{children:(null==h?void 0:h.nick)||(null==h?void 0:h.from)})),o("span",{children:a(null==j?void 0:j.messageAbstract,1)})]})),o(r,{className:"icon",width:12,height:12,type:s.CLOSE,onClick:g})]}))}export{l as InputQuoteDefalut};
1
+ import{__assign as t}from"tslib";import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useCallback as n}from"react";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatActionContext as i}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{MESSAGE_OPERATE as m}from"../../constants.js";import{useHandleQuoteMessage as c}from"./hooks/useHandleQuoteMessage.js";import{transformTextWithEmojiKeyToName as a}from"../MessageElement/utils/decodeText.js";function l(l){var u=l.message,p=i().operateMessage,d=c(u),f=d.cloudCustomData,h=d.message,g=n((function(){var t;p&&p(((t={})[m.QUOTE]=null,t))}),[p]),j=null==f?void 0:f.messageReply;return j&&e("div",t({className:"input-quote"},{children:[e("div",t({className:"input-quote-content"},{children:[o("label",t({htmlFor:"input-quote-content"},{children:(null==h?void 0:h.nick)||(null==h?void 0:h.from)})),o("span",{children:a(null==j?void 0:j.messageAbstract)})]})),o(r,{className:"icon",width:12,height:12,type:s.CLOSE,onClick:g})]}))}export{l as InputQuoteDefalut};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n from"react";import s from"@tencentcloud/chat";import{TUIMessageInputContextProvider as i}from"../../context/MessageInputContext.js";import{useCreateMessageInputContext as r}from"./hooks/useCreateMessageInputContext.js";import{useMessageInputState as a}from"./hooks/useMessageInputState.js";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as m}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import{useComponentContext as u}from"../../context/ComponentContext.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import"./hooks/useHandleQuoteMessage.js";import{EmptyStateIndicator as p}from"../EmptyStateIndicator/EmptyStateIndicator.js";import{InputQuoteDefalut as l}from"./InputQuoteDefalut.js";import{TUIMessageInputDefault as c}from"./MessageInputDefault.js";import{InputPluginsDefalut as f}from"./InputPluginsDefalut.js";import{Forward as d}from"./Forward.js";import{Transmitter as I}from"./Transmitter.js";function g(o){var n=o.children,u=o.disabled,p=o.focus,l=o.pluginConfig,c=o.textareaRef,f=a(o),d=m("TUIMessageInput"),I=d.textareaRef,g=d.conversation,j=(null==g?void 0:g.type)===s.TYPES.CONV_SYSTEM,x=m("TUIMessageInput").TUIMessageInputConfig,v=p||(null==x?void 0:x.focus),M=r(t(t(t({},f),o),{textareaRef:c||(null==x?void 0:x.textareaRef)||I,disabled:u||(null==x?void 0:x.disabled)||j,focus:"boolean"!=typeof v||v,pluginConfig:l}));return e(i,t({value:M},{children:n}))}function j(n){var s=n.TUIMessageInput,i=n.InputPlugins,r=n.InputQuote,a=n.isTransmitter,j=n.className,x=m("TUIMessageInput").TUIMessageInputConfig,v=j||(null==x?void 0:x.className),M=a||(null==x?void 0:x.isTransmitter)||!1,C=u(),h=C.TUIMessageInput,T=C.InputPlugins,S=C.InputQuote,U=s||h||c,b=i||T||f||p,N=r||S||l;return e("div",t({className:"tui-message-input ".concat(v)},{children:o(g,t({},n,{children:[e(d,{}),e(N,{}),o("div",t({className:"tui-message-input-main"},{children:[o("div",t({className:"tui-message-input-box"},{children:[e(b,{}),e(U,{})]})),M&&e(I,{})]}))]}))}))}var x=n.memo(j);export{x as MessageInput};
1
+ import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n from"react";import s from"@tencentcloud/chat";import{TUIMessageInputContextProvider as i}from"../../context/MessageInputContext.js";import{useCreateMessageInputContext as r}from"./hooks/useCreateMessageInputContext.js";import{useMessageInputState as a}from"./hooks/useMessageInputState.js";import"@tencentcloud/chat-uikit-engine";import"@tencentcloud/uikit-base-component-react";import"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as m}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import{useComponentContext as u}from"../../context/ComponentContext.js";import"../../store/UIManagerStore.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import"./hooks/useHandleQuoteMessage.js";import{EmptyStateIndicator as p}from"../EmptyStateIndicator/EmptyStateIndicator.js";import{InputQuoteDefalut as c}from"./InputQuoteDefalut.js";import{TUIMessageInputDefault as l}from"./MessageInputDefault.js";import{InputPluginsDefalut as f}from"./InputPluginsDefalut.js";import{Forward as d}from"./Forward.js";import{Transmitter as I}from"./Transmitter.js";function g(o){var n=o.children,u=o.disabled,p=o.focus,c=o.pluginConfig,l=o.textareaRef,f=a(o),d=m("TUIMessageInput"),I=d.textareaRef,g=d.conversation,j=(null==g?void 0:g.type)===s.TYPES.CONV_SYSTEM,x=m("TUIMessageInput").TUIMessageInputConfig,M=p||(null==x?void 0:x.focus),v=r(t(t(t({},f),o),{textareaRef:l||(null==x?void 0:x.textareaRef)||I,disabled:u||(null==x?void 0:x.disabled)||j,focus:"boolean"!=typeof M||M,pluginConfig:c}));return e(i,t({value:v},{children:n}))}function j(n){var s=n.TUIMessageInput,i=n.InputPlugins,r=n.InputQuote,a=n.isTransmitter,j=n.className,x=m("TUIMessageInput").TUIMessageInputConfig,M=j||(null==x?void 0:x.className),v=a||(null==x?void 0:x.isTransmitter)||!1,C=u(),h=C.TUIMessageInput,T=C.InputPlugins,S=C.InputQuote,U=s||h||l,b=i||T||f||p,N=r||S||c;return e("div",t({className:"tui-message-input ".concat(M)},{children:o(g,t({},n,{children:[e(d,{}),e(N,{}),o("div",t({className:"tui-message-input-main"},{children:[o("div",t({className:"tui-message-input-box"},{children:[e(b,{}),e(U,{})]})),v&&e(I,{})]}))]}))}))}var x=n.memo(j);export{x as MessageInput};
@@ -1 +1 @@
1
- import{__assign as t}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useEffect as o,useState as r}from"react";import{useTranslation as i}from"react-i18next";import{MESSAGE_OPERATE as a}from"../../constants.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as u}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import{useTUIMessageInputContext as s}from"../../context/MessageInputContext.js";import{isPC as l}from"../../utils/env.js";import{formatEmojiString as c}from"../MessageElement/utils/emojiMap.js";function d(){var d=s("TUIMessageInputDefault"),m=d.text,p=d.disabled,f=d.handleChange,v=d.handleKeyDown,x=d.handlePasete,g=d.textareaRef,h=d.focus,E=d.setText,b=d.setCursorPos,j=i().t,C=u("TUIMessageInputDefault").operateData;o((function(){C&&C[a.REVOKE]&&E&&E(c(C[a.REVOKE].payload.text,1))}),[C]),o((function(){var t,e;return h&&g&&g.current&&(g.current.autofocus=!0,l&&(null===(t=null==g?void 0:g.current)||void 0===t||t.focus({preventScroll:!0})),null===(e=null==g?void 0:g.current)||void 0===e||e.addEventListener("paste",x)),function(){var t;null===(t=null==g?void 0:g.current)||void 0===t||t.removeEventListener("paste",x)}}),[h,g]);var I=r(!1),M=I[0],D=I[1];return e("div",t({className:"input-box ".concat(p?"disabled":""," ").concat(M?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[n("div",t({className:"input-visibility-content"},{children:m})),!p&&n("textarea",{placeholder:j("TUIChat.Enter a message"),rows:1,value:m,ref:g,onChange:f,onKeyDown:v,onFocus:function(){D(!0)},onBlur:function(t){!function(t){var e;b&&b({start:null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.selectionStart,end:t.target.selectionEnd}),D(!1)}(t)}})]}))}export{d as TUIMessageInputDefault};
1
+ import{__assign as t}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useEffect as o,useState as r}from"react";import{useUIKit as i}from"@tencentcloud/uikit-base-component-react";import{MESSAGE_OPERATE as a}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as u}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import{useTUIMessageInputContext as s}from"../../context/MessageInputContext.js";import"@tencentcloud/chat-uikit-engine";import{isPC as c}from"../../utils/env.js";import{transformTextWithEmojiKeyToName as l}from"../MessageElement/utils/decodeText.js";function d(){var d=s("TUIMessageInputDefault"),m=d.text,p=d.disabled,f=d.handleChange,v=d.handleKeyDown,x=d.handlePasete,g=d.textareaRef,h=d.focus,b=d.setText,E=d.setCursorPos,C=i().t,j=u("TUIMessageInputDefault").operateData;o((function(){j&&j[a.REVOKE]&&b&&b(l(j[a.REVOKE].payload.text))}),[j]),o((function(){var t,e;return h&&g&&g.current&&(g.current.autofocus=!0,c&&(null===(t=null==g?void 0:g.current)||void 0===t||t.focus({preventScroll:!0})),null===(e=null==g?void 0:g.current)||void 0===e||e.addEventListener("paste",x)),function(){var t;null===(t=null==g?void 0:g.current)||void 0===t||t.removeEventListener("paste",x)}}),[h,g]);var I=r(!1),D=I[0],M=I[1];return e("div",t({className:"input-box ".concat(p?"disabled":""," ").concat(D?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[n("div",t({className:"input-visibility-content"},{children:m})),!p&&n("textarea",{placeholder:C("TUIChat.Enter a message"),rows:1,value:m,ref:g,onChange:f,onKeyDown:v,onFocus:function(){M(!0)},onBlur:function(t){!function(t){var e;E&&E({start:null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.selectionStart,end:t.target.selectionEnd}),M(!1)}(t)}})]}))}export{d as TUIMessageInputDefault};
@@ -1 +1 @@
1
- import{useCallback as e}from"react";import{useTranslation as t}from"react-i18next";import{TUIChatService as a}from"@tencentcloud/chat-uikit-engine";import{emojiEnKey as n}from"../../MessageElement/utils/emojiMap.js";function o(o){o.textareaRef;var i=o.insertText,r=t().i18n;return{onSelectEmoji:function(e){"zh-CN"===r.language?i&&i(e.data):i&&i(n[e.data])},sendFaceMessage:e((function(e){a.sendFaceMessage({payload:e})}),[])}}export{o as useEmojiPicker};
1
+ import{useCallback as e}from"react";import{useUIKit as t}from"@tencentcloud/uikit-base-component-react";import{TUIChatService as n}from"@tencentcloud/chat-uikit-engine";function a(a){a.textareaRef;var o=a.insertText,c=t().language;return{onSelectEmoji:e((function(e){o&&o(e.data)}),[o,c]),sendFaceMessage:e((function(e){n.sendFaceMessage({payload:e})}),[])}}export{a as useEmojiPicker};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e}from"tslib";import{useState as n,useEffect as o}from"react";import r from"@tencentcloud/chat";import{TUIChatService as i}from"@tencentcloud/chat-uikit-engine";import{MESSAGE_OPERATE as s}from"../../../constants.js";import{useUIKit as a}from"../../../context/UIKitContext.js";import"react/jsx-runtime";import{useTUIChatStateContext as c}from"../../../context/ChatStateContext.js";import"../../../context/MessageContext.js";function u(u){var m=this,f=c("TUIMessageInputDefault").operateData,p=n([]),d=p[0],l=p[1],v=a().chat,x=u||f&&f[s.FORWARD];return o((function(){v&&t(m,void 0,void 0,(function(){var t,n;return e(this,(function(e){switch(e.label){case 0:return[4,v.getConversationList()];case 1:return t=e.sent(),l(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.conversationList.filter((function(t){return t.type!==r.TYPES.CONV_SYSTEM}))),[2]}}))}))}),[v]),{message:x,conversationList:d,sendForwardMessage:function(t){t.map((function(t){return x&&i.sendForwardMessage([t],[x]),t}))}}}export{u as useHandleForwardMessage};
1
+ import{__awaiter as t,__generator as e}from"tslib";import{useState as o,useEffect as r}from"react";import n from"@tencentcloud/chat";import{TUIChatService as i}from"@tencentcloud/chat-uikit-engine";import{MESSAGE_OPERATE as a}from"../../../constants.js";import"react/jsx-runtime";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as s}from"../../../context/ChatStateContext.js";import"../../../context/MessageContext.js";import{useUIManagerStore as c}from"../../../store/UIManagerStore.js";function u(u){var m=this,f=s("TUIMessageInputDefault").operateData,p=o([]),d=p[0],l=p[1],v=c().chat,g=u||f&&f[a.FORWARD];return r((function(){v&&t(m,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return[4,v.getConversationList()];case 1:return t=e.sent(),l(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.conversationList.filter((function(t){return t.type!==n.TYPES.CONV_SYSTEM}))),[2]}}))}))}),[v]),{message:g,conversationList:d,sendForwardMessage:function(t){t.map((function(t){return g&&i.sendForwardMessage([t],[g]),t}))}}}export{u as useHandleForwardMessage};
@@ -1 +1 @@
1
- import{useState as e,useEffect as t}from"react";import o from"@tencentcloud/chat";import{MESSAGE_OPERATE as n}from"../../../constants.js";import"tslib";import"react/jsx-runtime";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as a}from"../../../context/ChatStateContext.js";import"../../../context/MessageContext.js";var i,r,S=((i={})[o.TYPES.MSG_TEXT]=1,i[o.TYPES.MSG_CUSTOM]=2,i[o.TYPES.MSG_IMAGE]=3,i[o.TYPES.MSG_AUDIO]=4,i[o.TYPES.MSG_VIDEO]=5,i[o.TYPES.MSG_FILE]=6,i[o.TYPES.MSG_FACE]=8,i),l=((r={})[o.TYPES.MSG_CUSTOM]="[custom]",r[o.TYPES.MSG_IMAGE]="[image]",r[o.TYPES.MSG_AUDIO]="[audio]",r[o.TYPES.MSG_VIDEO]="[video]",r[o.TYPES.MSG_FILE]="[file]",r[o.TYPES.MSG_FACE]="[face]",r);function s(i){var r=a("TUIMessageInputDefault").operateData,s=e({messageReply:null}),u=s[0],m=s[1],E=function(e){var t,n=S[null==e?void 0:e.type];return{messageAbstract:(null==e?void 0:e.type)===o.TYPES.MSG_TEXT?null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.text:l[null==e?void 0:e.type],messageSender:(null==e?void 0:e.nick)||(null==e?void 0:e.from),messageID:null==e?void 0:e.ID,messageType:n,version:1}};return t((function(){var e=i||r&&r[n.QUOTE];m({messageReply:e?E(e):null})}),[r,i]),{cloudCustomData:u,handleQuoteMessage:E,message:i||r&&r[n.QUOTE]}}export{s as useHandleQuoteMessage};
1
+ import{useState as e,useEffect as t}from"react";import o from"@tencentcloud/chat";import{MESSAGE_OPERATE as n}from"../../../constants.js";import"tslib";import"react/jsx-runtime";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as a}from"../../../context/ChatStateContext.js";import"../../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";var i,r,S=((i={})[o.TYPES.MSG_TEXT]=1,i[o.TYPES.MSG_CUSTOM]=2,i[o.TYPES.MSG_IMAGE]=3,i[o.TYPES.MSG_AUDIO]=4,i[o.TYPES.MSG_VIDEO]=5,i[o.TYPES.MSG_FILE]=6,i[o.TYPES.MSG_FACE]=8,i),l=((r={})[o.TYPES.MSG_CUSTOM]="[custom]",r[o.TYPES.MSG_IMAGE]="[image]",r[o.TYPES.MSG_AUDIO]="[audio]",r[o.TYPES.MSG_VIDEO]="[video]",r[o.TYPES.MSG_FILE]="[file]",r[o.TYPES.MSG_FACE]="[face]",r);function s(i){var r=a("TUIMessageInputDefault").operateData,s=e({messageReply:null}),u=s[0],m=s[1],E=function(e){var t,n=S[null==e?void 0:e.type];return{messageAbstract:(null==e?void 0:e.type)===o.TYPES.MSG_TEXT?null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.text:l[null==e?void 0:e.type],messageSender:(null==e?void 0:e.nick)||(null==e?void 0:e.from),messageID:null==e?void 0:e.ID,messageType:n,version:1}};return t((function(){var e=i||r&&r[n.QUOTE];m({messageReply:e?E(e):null})}),[r,i]),{cloudCustomData:u,handleQuoteMessage:E,message:i||r&&r[n.QUOTE]}}export{s as useHandleQuoteMessage};