@tencentcloud/chat-uikit-react 2.2.4 → 2.2.6

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 (343) hide show
  1. package/.babelrc +2 -2
  2. package/.eslintrc.js +141 -31
  3. package/.lintstagedrc.json +1 -1
  4. package/.stylelintrc.js +17 -18
  5. package/CHANGELOG.md +19 -2
  6. package/README.md +8 -8
  7. package/dist/cjs/assets/fonts/iconfont.ttf +0 -0
  8. package/dist/cjs/assets/fonts/iconfont.woff +0 -0
  9. package/dist/cjs/assets/fonts/iconfont.woff2 +0 -0
  10. package/dist/cjs/components/Avatar/Avatar.d.ts +4 -4
  11. package/dist/cjs/components/Checkbox/index.d.ts +2 -2
  12. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  13. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
  14. package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  15. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  16. package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
  17. package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +8 -8
  18. package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
  19. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
  20. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  21. package/dist/cjs/components/ConversationPreview/utils.js +1 -1
  22. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
  23. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
  24. package/dist/cjs/components/Icon/Icon.d.ts +3 -3
  25. package/dist/cjs/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
  26. package/dist/cjs/components/Input/Input.d.ts +4 -4
  27. package/dist/cjs/components/Model/index.d.ts +2 -2
  28. package/dist/cjs/components/Plugins/index.d.ts +4 -4
  29. package/dist/cjs/components/Popup/index.d.ts +2 -2
  30. package/dist/cjs/components/Switch/Switch.d.ts +2 -2
  31. package/dist/cjs/components/TUIChat/TUIChat.d.ts +12 -12
  32. package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
  33. package/dist/cjs/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
  34. package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +1 -1
  35. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
  36. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  37. package/dist/cjs/components/TUIContact/TUIContact.d.ts +3 -3
  38. package/dist/cjs/components/TUIContact/TUIContact.js +1 -1
  39. package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
  40. package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
  41. package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
  42. package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
  43. package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
  44. package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  45. package/dist/cjs/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
  46. package/dist/cjs/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
  47. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
  48. package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  49. package/dist/cjs/components/TUIContact/hooks/useTUIContact.js +1 -1
  50. package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
  51. package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  52. package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +2 -2
  53. package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +6 -6
  54. package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
  55. package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  56. package/dist/cjs/components/TUIManage/TUIManage.d.ts +2 -2
  57. package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
  58. package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
  59. package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
  60. package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
  61. package/dist/cjs/components/TUIMessage/MessageContext.d.ts +2 -2
  62. package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
  63. package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
  64. package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
  65. package/dist/cjs/components/TUIMessage/MessagePlugins.d.ts +4 -4
  66. package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
  67. package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
  68. package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
  69. package/dist/cjs/components/TUIMessage/MessageStatus.js +1 -1
  70. package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
  71. package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
  72. package/dist/cjs/components/TUIMessage/MessageTip.js +1 -1
  73. package/dist/cjs/components/TUIMessage/TUIMessage.d.ts +19 -19
  74. package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
  75. package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
  76. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  77. package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
  78. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
  79. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  80. package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  81. package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
  82. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
  83. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
  84. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
  85. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  86. package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  87. package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  88. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  89. package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
  90. package/dist/cjs/components/TUIMessageList/TUIMessageList.d.ts +2 -2
  91. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
  92. package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  93. package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +3 -3
  94. package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
  95. package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
  96. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
  97. package/dist/cjs/components/Toast/index.d.ts +2 -2
  98. package/dist/cjs/context/ComponentContext.d.ts +12 -12
  99. package/dist/cjs/context/LanguageContext.js +1 -0
  100. package/dist/cjs/context/TUIChatActionContext.d.ts +3 -3
  101. package/dist/cjs/context/TUIChatStateContext.d.ts +5 -5
  102. package/dist/cjs/context/TUIContactContext.d.ts +4 -4
  103. package/dist/cjs/context/TUIConversationContext.js +1 -1
  104. package/dist/cjs/context/TUIMessageContext.d.ts +17 -17
  105. package/dist/cjs/context/TUIMessageInputContext.d.ts +4 -4
  106. package/dist/cjs/context/ThemeContext.js +1 -0
  107. package/dist/cjs/context/UIKitContext.d.ts +25 -0
  108. package/dist/cjs/context/UIKitContext.js +1 -0
  109. package/dist/cjs/context/UIManagerContext.d.ts +46 -0
  110. package/dist/cjs/context/UIManagerContext.js +1 -0
  111. package/dist/cjs/hooks/useConversation.d.ts +2 -2
  112. package/dist/cjs/index.css +1 -1
  113. package/dist/cjs/index.d.css +984 -1039
  114. package/dist/cjs/index.d.ts +2 -4
  115. package/dist/cjs/index.js +1 -1
  116. package/dist/cjs/locales/en-US/TUIGlobal.js +1 -0
  117. package/dist/cjs/locales/en-US/index.js +1 -1
  118. package/dist/cjs/locales/ja-JP/TUIGlobal.js +1 -0
  119. package/dist/cjs/locales/ja-JP/index.js +1 -1
  120. package/dist/cjs/locales/ko-KR/TUIGlobal.js +1 -0
  121. package/dist/cjs/locales/ko-KR/index.js +1 -1
  122. package/dist/cjs/locales/zh-CN/TUIGlobal.js +1 -0
  123. package/dist/cjs/locales/zh-CN/index.js +1 -1
  124. package/dist/esm/assets/fonts/iconfont.ttf +0 -0
  125. package/dist/esm/assets/fonts/iconfont.woff +0 -0
  126. package/dist/esm/assets/fonts/iconfont.woff2 +0 -0
  127. package/dist/esm/components/Avatar/Avatar.d.ts +4 -4
  128. package/dist/esm/components/Checkbox/index.d.ts +2 -2
  129. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
  130. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
  131. package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
  132. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
  133. package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
  134. package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +8 -8
  135. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
  136. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
  137. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  138. package/dist/esm/components/ConversationPreview/utils.js +1 -1
  139. package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
  140. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
  141. package/dist/esm/components/Icon/Icon.d.ts +3 -3
  142. package/dist/esm/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
  143. package/dist/esm/components/Input/Input.d.ts +4 -4
  144. package/dist/esm/components/Model/index.d.ts +2 -2
  145. package/dist/esm/components/Plugins/index.d.ts +4 -4
  146. package/dist/esm/components/Popup/index.d.ts +2 -2
  147. package/dist/esm/components/Switch/Switch.d.ts +2 -2
  148. package/dist/esm/components/TUIChat/TUIChat.d.ts +12 -12
  149. package/dist/esm/components/TUIChat/TUIChat.js +1 -1
  150. package/dist/esm/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
  151. package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +1 -1
  152. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
  153. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
  154. package/dist/esm/components/TUIContact/TUIContact.d.ts +3 -3
  155. package/dist/esm/components/TUIContact/TUIContact.js +1 -1
  156. package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
  157. package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
  158. package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
  159. package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
  160. package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
  161. package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
  162. package/dist/esm/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
  163. package/dist/esm/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
  164. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
  165. package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
  166. package/dist/esm/components/TUIContact/hooks/useTUIContact.js +1 -1
  167. package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
  168. package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
  169. package/dist/esm/components/TUIConversation/TUIConversation.d.ts +2 -2
  170. package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +6 -6
  171. package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
  172. package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
  173. package/dist/esm/components/TUIManage/TUIManage.d.ts +2 -2
  174. package/dist/esm/components/TUIManage/TUIManage.js +1 -1
  175. package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
  176. package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
  177. package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
  178. package/dist/esm/components/TUIMessage/MessageContext.d.ts +2 -2
  179. package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
  180. package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
  181. package/dist/esm/components/TUIMessage/MessageName.js +1 -1
  182. package/dist/esm/components/TUIMessage/MessagePlugins.d.ts +4 -4
  183. package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
  184. package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
  185. package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
  186. package/dist/esm/components/TUIMessage/MessageStatus.js +1 -1
  187. package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
  188. package/dist/esm/components/TUIMessage/MessageText.js +1 -1
  189. package/dist/esm/components/TUIMessage/MessageTip.js +1 -1
  190. package/dist/esm/components/TUIMessage/TUIMessage.d.ts +19 -19
  191. package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
  192. package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
  193. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
  194. package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
  195. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
  196. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
  197. package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
  198. package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
  199. package/dist/esm/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
  200. package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
  201. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
  202. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  203. package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
  204. package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
  205. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  206. package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
  207. package/dist/esm/components/TUIMessageList/TUIMessageList.d.ts +2 -2
  208. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
  209. package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
  210. package/dist/esm/components/TUIProfile/TUIProfile.d.ts +3 -3
  211. package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
  212. package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
  213. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
  214. package/dist/esm/components/Toast/index.d.ts +2 -2
  215. package/dist/esm/context/ComponentContext.d.ts +12 -12
  216. package/dist/esm/context/LanguageContext.js +1 -0
  217. package/dist/esm/context/TUIChatActionContext.d.ts +3 -3
  218. package/dist/esm/context/TUIChatStateContext.d.ts +5 -5
  219. package/dist/esm/context/TUIContactContext.d.ts +4 -4
  220. package/dist/esm/context/TUIConversationContext.js +1 -1
  221. package/dist/esm/context/TUIMessageContext.d.ts +17 -17
  222. package/dist/esm/context/TUIMessageInputContext.d.ts +4 -4
  223. package/dist/esm/context/ThemeContext.js +1 -0
  224. package/dist/esm/context/UIKitContext.d.ts +25 -0
  225. package/dist/esm/context/UIKitContext.js +1 -0
  226. package/dist/esm/context/UIManagerContext.d.ts +46 -0
  227. package/dist/esm/context/UIManagerContext.js +1 -0
  228. package/dist/esm/hooks/useConversation.d.ts +2 -2
  229. package/dist/esm/index.css +1 -1
  230. package/dist/esm/index.d.css +984 -1039
  231. package/dist/esm/index.d.ts +2 -4
  232. package/dist/esm/index.js +1 -1
  233. package/dist/esm/locales/en-US/TUIGlobal.js +1 -0
  234. package/dist/esm/locales/en-US/index.js +1 -1
  235. package/dist/esm/locales/ja-JP/TUIGlobal.js +1 -0
  236. package/dist/esm/locales/ja-JP/index.js +1 -1
  237. package/dist/esm/locales/ko-KR/TUIGlobal.js +1 -0
  238. package/dist/esm/locales/ko-KR/index.js +1 -1
  239. package/dist/esm/locales/zh-CN/TUIGlobal.js +1 -0
  240. package/dist/esm/locales/zh-CN/index.js +1 -1
  241. package/package.json +9 -7
  242. package/rollup.config.js +13 -2
  243. package/src/assets/fonts/iconfont.ttf +0 -0
  244. package/src/assets/fonts/iconfont.woff +0 -0
  245. package/src/assets/fonts/iconfont.woff2 +0 -0
  246. package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +4 -4
  247. package/src/components/ConversationCreate/ConversationCreate.tsx +2 -2
  248. package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +3 -2
  249. package/src/components/ConversationCreate/styles/ConversationCreatGroupDetail.scss +16 -7
  250. package/src/components/ConversationCreate/styles/index.scss +23 -13
  251. package/src/components/ConversationPreview/ConversationPreview.tsx +21 -21
  252. package/src/components/ConversationPreview/ConversationPreviewContent.tsx +4 -4
  253. package/src/components/ConversationPreview/styles/index.scss +44 -14
  254. package/src/components/ConversationPreview/utils.tsx +36 -28
  255. package/src/components/Input/styles/index.scss +7 -5
  256. package/src/components/Model/styles/layout.scss +3 -3
  257. package/src/components/Plugins/styles/color.scss +17 -3
  258. package/src/components/Popup/styles/layout.scss +2 -1
  259. package/src/components/TUIChat/TUIChat.tsx +4 -3
  260. package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +3 -3
  261. package/src/components/TUIChatHeader/styles/layout.scss +13 -2
  262. package/src/components/TUIContact/TUIContact.tsx +2 -2
  263. package/src/components/TUIContact/TUIContactInfo/TUIContactInfo.tsx +2 -2
  264. package/src/components/TUIContact/TUIContactInfo/basicInfo.tsx +2 -2
  265. package/src/components/TUIContact/TUIContactInfo/blockInfo.tsx +2 -2
  266. package/src/components/TUIContact/TUIContactInfo/friendApplication.tsx +2 -2
  267. package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +4 -3
  268. package/src/components/TUIContact/TUIContactInfo/groupInfo.tsx +3 -3
  269. package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +2 -2
  270. package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -5
  271. package/src/components/TUIContact/hooks/useTUIContact.tsx +2 -2
  272. package/src/components/TUIContactSearch/TUIContactSearch.tsx +2 -2
  273. package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +2 -2
  274. package/src/components/TUIConversationList/TUIConversationList.tsx +3 -4
  275. package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
  276. package/src/components/TUIConversationList/index.scss +25 -7
  277. package/src/components/TUIManage/TUIManage.tsx +3 -3
  278. package/src/components/TUIManage/styles/index.scss +16 -6
  279. package/src/components/TUIMessage/MessageStatus.tsx +2 -2
  280. package/src/components/TUIMessage/MessageText.tsx +16 -15
  281. package/src/components/TUIMessage/hooks/useMessageHandler.ts +2 -2
  282. package/src/components/TUIMessage/hooks/useMessageReply.ts +2 -2
  283. package/src/components/TUIMessage/styles/color.scss +20 -9
  284. package/src/components/TUIMessage/styles/layout.scss +44 -11
  285. package/src/components/TUIMessageInput/TUIMessageInput.tsx +1 -1
  286. package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +2 -2
  287. package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +2 -2
  288. package/src/components/TUIMessageInput/styles/color.scss +25 -6
  289. package/src/components/TUIMessageInput/styles/layout.scss +58 -16
  290. package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +2 -2
  291. package/src/components/TUIMessageList/styles/layout.scss +16 -2
  292. package/src/components/TUIProfile/TUIProfile.tsx +3 -3
  293. package/src/components/TUIProfile/TUIProfileDefault.tsx +2 -2
  294. package/src/components/TUIProfile/styles/layout.scss +33 -16
  295. package/src/components/index.ts +0 -1
  296. package/src/context/LanguageContext.tsx +59 -0
  297. package/src/context/ThemeContext.tsx +61 -0
  298. package/src/context/UIKitContext.tsx +67 -0
  299. package/src/context/UIManagerContext.tsx +163 -0
  300. package/src/context/index.ts +3 -2
  301. package/src/locales/en-US/index.ts +1 -1
  302. package/src/locales/ja-JP/index.ts +2 -0
  303. package/src/locales/ko-KR/TUIGlobal.ts +2 -2
  304. package/src/locales/ko-KR/index.ts +2 -0
  305. package/src/locales/zh-CN/index.ts +2 -2
  306. package/src/styles/colors/_color-dark.scss +35 -0
  307. package/src/styles/colors/_color-light.scss +35 -0
  308. package/src/styles/colors/_color-theme.scss +54 -0
  309. package/src/styles/fonts/icon-font.scss +18 -0
  310. package/src/styles/index.scss +4 -0
  311. package/src/styles/normalize.scss +355 -0
  312. package/dist/cjs/components/Icon/images/chats-selected.svg.js +0 -1
  313. package/dist/cjs/components/Icon/images/chats.svg.js +0 -1
  314. package/dist/cjs/components/Icon/images/contacts-selected.svg.js +0 -1
  315. package/dist/cjs/components/Icon/images/contacts.svg.js +0 -1
  316. package/dist/cjs/components/TUIKit/TUIKit.d.ts +0 -12
  317. package/dist/cjs/components/TUIKit/TUIKit.js +0 -1
  318. package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
  319. package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
  320. package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
  321. package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +0 -1
  322. package/dist/cjs/context/TUIKitContext.d.ts +0 -25
  323. package/dist/cjs/context/TUIKitContext.js +0 -1
  324. package/dist/esm/components/Icon/images/chats-selected.svg.js +0 -1
  325. package/dist/esm/components/Icon/images/chats.svg.js +0 -1
  326. package/dist/esm/components/Icon/images/contacts-selected.svg.js +0 -1
  327. package/dist/esm/components/Icon/images/contacts.svg.js +0 -1
  328. package/dist/esm/components/TUIKit/TUIKit.d.ts +0 -12
  329. package/dist/esm/components/TUIKit/TUIKit.js +0 -1
  330. package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
  331. package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
  332. package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
  333. package/dist/esm/components/TUIKit/hooks/useTUIKit.js +0 -1
  334. package/dist/esm/context/TUIKitContext.d.ts +0 -25
  335. package/dist/esm/context/TUIKitContext.js +0 -1
  336. package/src/components/TUIKit/TUIKit.tsx +0 -228
  337. package/src/components/TUIKit/hooks/useCreateTUIKitContext.tsx +0 -48
  338. package/src/components/TUIKit/hooks/useTUIKit.tsx +0 -99
  339. package/src/components/TUIKit/index.ts +0 -3
  340. package/src/components/TUIKit/styles/h5.scss +0 -34
  341. package/src/components/TUIKit/styles/index.scss +0 -112
  342. package/src/components/TUIKit/styles/reset.scss +0 -67
  343. package/src/context/TUIKitContext.tsx +0 -39
@@ -0,0 +1,67 @@
1
+ import { PropsWithChildren, useContext, createContext } from 'react';
2
+ import type {
3
+ ChatSDK,
4
+ Conversation,
5
+ } from '@tencentcloud/chat';
6
+ import { TUILogin } from '@tencentcloud/tui-core';
7
+ import { ThemeProvider, useTheme } from './ThemeContext';
8
+ import { LanguageProvider, useLanguage } from './LanguageContext';
9
+ import { UIManagerProvider } from './UIManagerContext';
10
+
11
+ interface UIKitContextType {
12
+ chat: ChatSDK;
13
+ }
14
+
15
+ interface UIKitProviderProps {
16
+ chat?: ChatSDK;
17
+ language?: string;
18
+ theme?: string;
19
+ colors?: Record<string, string>;
20
+ customClasses?: string;
21
+ activeConversation?: Conversation;
22
+ }
23
+
24
+ const UIKitContext = createContext<UIKitContextType | null>(null);
25
+
26
+ function UIKitProvider(props: PropsWithChildren<UIKitProviderProps>) {
27
+ const {
28
+ chat = TUILogin.getContext().chat,
29
+ language,
30
+ theme,
31
+ colors,
32
+ customClasses,
33
+ activeConversation,
34
+ children,
35
+ } = props;
36
+
37
+ return (
38
+ <LanguageProvider language={language}>
39
+ <ThemeProvider theme={theme} colors={colors}>
40
+ <UIKitContext.Provider value={{ chat }}>
41
+ <UIManagerProvider activeConversation={activeConversation} customClasses={customClasses}>
42
+ {children}
43
+ </UIManagerProvider>
44
+ </UIKitContext.Provider>
45
+ </ThemeProvider>
46
+ </LanguageProvider>
47
+ );
48
+ }
49
+
50
+ const useUIKit = (componentName?: string) => {
51
+ const languageContext = useLanguage();
52
+ const themeContext = useTheme();
53
+ const uikitContext = useContext(UIKitContext);
54
+ if (!uikitContext) {
55
+ throw new Error('useUIKit must be used within a UIKitProvider');
56
+ }
57
+ return {
58
+ ...themeContext,
59
+ ...languageContext,
60
+ ...uikitContext,
61
+ };
62
+ };
63
+
64
+ export {
65
+ UIKitProvider,
66
+ useUIKit,
67
+ };
@@ -0,0 +1,163 @@
1
+ import React, {
2
+ useState,
3
+ useContext,
4
+ useCallback,
5
+ PropsWithChildren,
6
+ useEffect,
7
+ } from 'react';
8
+ import type {
9
+ Conversation,
10
+ Profile,
11
+ Friend,
12
+ FriendApplication,
13
+ } from '@tencentcloud/chat';
14
+ import {
15
+ TUIStore,
16
+ StoreName,
17
+ type IConversationModel,
18
+ } from '@tencentcloud/chat-uikit-engine';
19
+ import type { IGroupModel } from '@tencentcloud/chat-uikit-engine';
20
+ import { useUIKit } from './UIKitContext';
21
+
22
+ type blockData = {
23
+ type: 'block';
24
+ data: Profile;
25
+ };
26
+
27
+ type friendData = {
28
+ type: 'friend';
29
+ data: Friend;
30
+ };
31
+
32
+ type friendApplicationData = {
33
+ type: 'friendApplication';
34
+ data: FriendApplication;
35
+ };
36
+
37
+ type addFriendData = {
38
+ type: 'addFriend';
39
+ data: Profile;
40
+ };
41
+
42
+ type GroupData = {
43
+ type: 'group';
44
+ data: IGroupModel;
45
+ };
46
+
47
+ type UseContactParams =
48
+ | blockData
49
+ | friendData
50
+ | friendApplicationData
51
+ | addFriendData
52
+ | GroupData
53
+ | undefined;
54
+
55
+ type UIManagerContextType = {
56
+ conversation?: Conversation;
57
+ contactData?: UseContactParams;
58
+ customClasses?: unknown;
59
+ myProfile?: Profile;
60
+ TUIManageShow?: boolean;
61
+ TUIProfileShow?: boolean;
62
+ setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>>;
63
+ setTUIProfileShow: React.Dispatch<React.SetStateAction<boolean>>;
64
+ setActiveConversation: (conversation?: Conversation) => void;
65
+ setActiveContact: (useContactParams?: UseContactParams) => void;
66
+ };
67
+
68
+ type UIManagerProviderProps = {
69
+ customClasses: string;
70
+ activeConversation: Conversation;
71
+ };
72
+
73
+ const UIManagerContext = React.createContext<UIManagerContextType | null>(null);
74
+
75
+ function UIManagerProvider(props: PropsWithChildren<Partial<UIManagerProviderProps>>) {
76
+ const {
77
+ customClasses,
78
+ activeConversation,
79
+ children,
80
+ } = props;
81
+
82
+ const { chat } = useUIKit();
83
+
84
+ const [conversation, setConversation] = useState<Conversation | undefined>(activeConversation);
85
+ const [contactData, setContactData] = useState<UseContactParams>();
86
+ const [myProfile, setMyProfile] = useState<Profile>();
87
+ const [TUIManageShow, setTUIManageShow] = useState<boolean>(false);
88
+ const [TUIProfileShow, setTUIProfileShow] = useState<boolean>(false);
89
+
90
+ useEffect(() => {
91
+ TUIStore.watch(StoreName.USER, {
92
+ userProfile: onMyProfileUpdated,
93
+ });
94
+ TUIStore.watch(StoreName.CONV, {
95
+ currentConversation: onCurrentConversationUpdated,
96
+ });
97
+
98
+ return () => {
99
+ TUIStore.unwatch(StoreName.USER, {
100
+ userProfile: onMyProfileUpdated,
101
+ });
102
+ TUIStore.unwatch(StoreName.CONV, {
103
+ currentConversation: onCurrentConversationUpdated,
104
+ });
105
+ };
106
+ }, []);
107
+
108
+ const setActiveConversation = useCallback((_activeConversation?: Conversation) => {
109
+ if (_activeConversation) {
110
+ chat?.setMessageRead({ conversationID: _activeConversation.conversationID });
111
+ }
112
+
113
+ if (_activeConversation?.conversationID !== conversation?.conversationID) {
114
+ setTUIManageShow(false);
115
+ }
116
+
117
+ setConversation(_activeConversation);
118
+ }, []);
119
+
120
+ function onMyProfileUpdated(userProfileData: unknown) {
121
+ setMyProfile(userProfileData as Profile);
122
+ }
123
+
124
+ function onCurrentConversationUpdated(conversationModel: IConversationModel) {
125
+ setActiveConversation(conversationModel?.getConversation());
126
+ }
127
+
128
+ function setActiveContact(actionContactData?: UseContactParams) {
129
+ setContactData(actionContactData);
130
+ }
131
+
132
+ const value = {
133
+ conversation,
134
+ contactData,
135
+ setActiveConversation,
136
+ myProfile,
137
+ TUIManageShow,
138
+ setTUIManageShow,
139
+ TUIProfileShow,
140
+ setTUIProfileShow,
141
+ setActiveContact,
142
+ };
143
+
144
+ return (
145
+ <UIManagerContext.Provider value={value}>
146
+ {children}
147
+ </UIManagerContext.Provider>
148
+ );
149
+ }
150
+
151
+ const useUIManager = (componentName?: string) => {
152
+ const context = useContext(UIManagerContext);
153
+ if (!context) {
154
+ throw new Error('useUIManager must be used within a UIManagerProvider');
155
+ }
156
+ return context;
157
+ };
158
+
159
+ export {
160
+ UIManagerProvider,
161
+ useUIManager,
162
+ UIManagerContextType,
163
+ };
@@ -1,7 +1,8 @@
1
- export * from './TUIKitContext';
1
+ export * from './UIKitContext';
2
+ export * from './UIManagerContext';
2
3
  export * from './TUIChatStateContext';
3
4
  export * from './TUIChatActionContext';
4
5
  export * from './TUIMessageContext';
5
6
  export * from './ComponentContext';
6
7
  export * from './TUIMessageInputContext';
7
- export * from './TUIContactContext';
8
+ export * from './TUIContactContext';
@@ -1,8 +1,8 @@
1
+ import TUIGlobal from './TUIGlobal';
1
2
  import TUIChat from './TUIChat';
2
3
  import TUIConversation from './TUIConversation';
3
4
  import TUIContact from './TUIContact';
4
5
  import TUIProfile from './TUIProfile';
5
- import TUIGlobal from './TUIProfile';
6
6
 
7
7
 
8
8
  export const message = {
@@ -1,9 +1,11 @@
1
+ import TUIGlobal from './TUIGlobal';
1
2
  import TUIChat from './TUIChat';
2
3
  import TUIConversation from './TUIConversation';
3
4
  import TUIContact from './TUIContact';
4
5
  import TUIProfile from './TUIProfile';
5
6
 
6
7
  export const message = {
8
+ TUIGlobal,
7
9
  TUIChat,
8
10
  TUIConversation,
9
11
  TUIContact,
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable quote-props */
2
2
  export const TUIGlobal = {
3
- 'chats': 'メッセージ',
4
- 'contacts': '連絡先'
3
+ 'chats': '채팅',
4
+ 'contacts': '연락처'
5
5
  }
6
6
  export default TUIGlobal;
@@ -1,9 +1,11 @@
1
+ import TUIGlobal from './TUIGlobal';
1
2
  import TUIChat from './TUIChat';
2
3
  import TUIConversation from './TUIConversation';
3
4
  import TUIContact from './TUIContact';
4
5
  import TUIProfile from './TUIProfile';
5
6
 
6
7
  export const message = {
8
+ TUIGlobal,
7
9
  TUIChat,
8
10
  TUIConversation,
9
11
  TUIContact,
@@ -1,11 +1,11 @@
1
+ import TUIGlobal from './TUIGlobal';
1
2
  import TUIChat from './TUIChat';
2
3
  import TUIConversation from './TUIConversation';
3
4
  import TUIContact from './TUIContact';
4
5
  import TUIProfile from './TUIProfile';
5
6
 
6
7
  export const message = {
7
- 'chats': '消息',
8
- 'contacts': '通讯录',
8
+ TUIGlobal,
9
9
  TUIChat,
10
10
  TUIConversation,
11
11
  TUIContact,
@@ -0,0 +1,35 @@
1
+ $dark-colors: (
2
+ // bg
3
+ --chat-theme-dark-bg-5: #76777e,
4
+ --chat-theme-dark-bg-4: #5d5e67,
5
+ --chat-theme-dark-bg-3: #454650,
6
+ --chat-theme-dark-bg-2: #2e303a,
7
+ --chat-theme-dark-bg-1: #191b26,
8
+ --chat-theme-dark-bg-primary: #191b26,
9
+ --chat-theme-dark-bg-secondary: #2e303a,
10
+ --chat-theme-dark-bg-active: #4e4e4e,
11
+ // text
12
+ --chat-theme-dark-text-5: #000,
13
+ --chat-theme-dark-text-4: #666,
14
+ --chat-theme-dark-text-3: #7a7a7a,
15
+ --chat-theme-dark-text-2: #7a7a7a,
16
+ --chat-theme-dark-text-1: #7a7a7a,
17
+ --chat-theme-dark-text-primary: #fff,
18
+ --chat-theme-dark-text-secondary: #8b8b8b,
19
+ // status
20
+ --chat-theme-dark-status-info: #147aff,
21
+ --chat-theme-dark-status-success: #34c759,
22
+ --chat-theme-dark-status-danger: #ff3742,
23
+ // border
24
+ --chat-theme-dark-border-5: #4e4e4e,
25
+ // box-shadow
26
+ --chat-theme-dark-box-shadow-1: (rgba(203, 203, 203, 0.755) 0 3px 8px),
27
+ );
28
+
29
+ :root {
30
+ @each $name, $color in $dark-colors {
31
+ #{$name}: $color;
32
+ }
33
+
34
+ color-scheme: light dark;
35
+ }
@@ -0,0 +1,35 @@
1
+ $light-colors: (
2
+ // bg
3
+ --chat-theme-light-bg-5: #999,
4
+ --chat-theme-light-bg-4: #b3b3b3,
5
+ --chat-theme-light-bg-3: #e5e7eb,
6
+ --chat-theme-light-bg-2: #f0f0f0,
7
+ --chat-theme-light-bg-1: #fff,
8
+ --chat-theme-light-bg-primary: #fff,
9
+ --chat-theme-light-bg-secondary: #f0f0f0,
10
+ --chat-theme-light-bg-active: #e6f1ff,
11
+ // text
12
+ --chat-theme-light-text-5: #000,
13
+ --chat-theme-light-text-4: #666,
14
+ --chat-theme-light-text-3: #7a7a7a,
15
+ --chat-theme-light-text-2: #7a7a7a,
16
+ --chat-theme-light-text-1: #7a7a7a,
17
+ --chat-theme-light-text-primary: #000,
18
+ --chat-theme-light-text-secondary: #7a7a7a,
19
+ // status
20
+ --chat-theme-light-status-info: #147aff,
21
+ --chat-theme-light-status-success: #34c759,
22
+ --chat-theme-light-status-danger: #ff3742,
23
+ // border
24
+ --chat-theme-light-border-5: #e0e0e0,
25
+ // box-shadow
26
+ --chat-theme-light-box-shadow-1: (rgba(0, 0, 0, 0.24) 0 3px 8px),
27
+ );
28
+
29
+ :root {
30
+ @each $name, $color in $light-colors {
31
+ #{$name}: $color;
32
+ }
33
+
34
+ color-scheme: light dark;
35
+ }
@@ -0,0 +1,54 @@
1
+ @use "sass:map";
2
+ @use "sass:list";
3
+
4
+ $prefix: "--chat-theme";
5
+
6
+ $themes: (
7
+ "light",
8
+ "dark",
9
+ );
10
+
11
+ $colors: (
12
+ "bg-5",
13
+ "bg-4",
14
+ "bg-3",
15
+ "bg-2",
16
+ "bg-1",
17
+ "bg-primary",
18
+ "bg-secondary",
19
+ "bg-active",
20
+ "text-5",
21
+ "text-4",
22
+ "text-3",
23
+ "text-2",
24
+ "text-1",
25
+ "text-primary",
26
+ "text-secondary",
27
+ "status-info",
28
+ "status-success",
29
+ "status-danger",
30
+ "border-5",
31
+ "box-shadow-1",
32
+ );
33
+
34
+ $color-map: ();
35
+
36
+ @mixin theme() {
37
+ @each $theme in $themes {
38
+
39
+ $color-map: () !global;
40
+
41
+ [data-uikit-theme="#{$theme}"] & {
42
+ @each $color in $colors {
43
+ $value: #{$prefix}-#{$theme}-#{$color};
44
+ $color-map: map.merge($color-map, ($color: var($value))) !global;
45
+ }
46
+
47
+ @content;
48
+ }
49
+ }
50
+ }
51
+
52
+ @function get($color) {
53
+ @return map.get($color-map, $color);
54
+ }
@@ -0,0 +1,18 @@
1
+ @font-face {
2
+ font-family: iconfont;
3
+ src:
4
+ url("./assets/fonts/iconfont.woff2?t=1722856322648") format("woff2"),
5
+ url("./assets/fonts/iconfont.woff?t=1722856322648") format("woff"),
6
+ url("./assets/fonts/iconfont.ttf?t=1722856322648") format("truetype");
7
+ }
8
+
9
+ .iconfont {
10
+ font-family: iconfont, Arial, sans-serif !important;
11
+ font-size: 20px;
12
+ font-style: normal;
13
+ line-height: 1;
14
+ vertical-align: bottom;
15
+ -webkit-font-smoothing: antialiased;
16
+ -webkit-text-stroke-width: 0.2px;
17
+ -moz-osx-font-smoothing: grayscale;
18
+ }
@@ -0,0 +1,4 @@
1
+ @import "./normalize";
2
+ @import "./fonts/icon-font";
3
+ @import "./colors/color-light";
4
+ @import "./colors/color-dark";