@tencentcloud/chat-uikit-react 0.0.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 (660) hide show
  1. package/.babelrc +7 -0
  2. package/.eslintrc.js +70 -0
  3. package/README.md +107 -0
  4. package/dist/cjs/_virtual/DateInput.js +1 -0
  5. package/dist/cjs/_virtual/DatePicker.js +1 -0
  6. package/dist/cjs/_virtual/DayInput.js +1 -0
  7. package/dist/cjs/_virtual/Divider.js +1 -0
  8. package/dist/cjs/_virtual/Fit.js +1 -0
  9. package/dist/cjs/_virtual/Input.js +1 -0
  10. package/dist/cjs/_virtual/MonthInput.js +1 -0
  11. package/dist/cjs/_virtual/MonthSelect.js +1 -0
  12. package/dist/cjs/_virtual/NativeInput.js +1 -0
  13. package/dist/cjs/_virtual/YearInput.js +1 -0
  14. package/dist/cjs/_virtual/_commonjsHelpers.js +1 -0
  15. package/dist/cjs/_virtual/clsx.m.js +1 -0
  16. package/dist/cjs/_virtual/dateFormatter.js +1 -0
  17. package/dist/cjs/_virtual/dates.js +1 -0
  18. package/dist/cjs/_virtual/entry.js +1 -0
  19. package/dist/cjs/_virtual/index.js +1 -0
  20. package/dist/cjs/_virtual/index10.js +1 -0
  21. package/dist/cjs/_virtual/index2.js +1 -0
  22. package/dist/cjs/_virtual/index3.js +1 -0
  23. package/dist/cjs/_virtual/index4.js +1 -0
  24. package/dist/cjs/_virtual/index5.js +1 -0
  25. package/dist/cjs/_virtual/index6.js +1 -0
  26. package/dist/cjs/_virtual/index7.js +1 -0
  27. package/dist/cjs/_virtual/index8.js +1 -0
  28. package/dist/cjs/_virtual/index9.js +1 -0
  29. package/dist/cjs/_virtual/propTypes.js +1 -0
  30. package/dist/cjs/_virtual/react-dom.development.js +1 -0
  31. package/dist/cjs/_virtual/react-dom.production.min.js +1 -0
  32. package/dist/cjs/_virtual/react-is.development.js +1 -0
  33. package/dist/cjs/_virtual/react-is.production.min.js +1 -0
  34. package/dist/cjs/_virtual/scheduler.development.js +1 -0
  35. package/dist/cjs/_virtual/scheduler.production.min.js +1 -0
  36. package/dist/cjs/_virtual/tiny-warning.esm.js +1 -0
  37. package/dist/cjs/_virtual/utils.js +1 -0
  38. package/dist/cjs/components/Avatar/Avatar.d.ts +22 -0
  39. package/dist/cjs/components/Avatar/Avatar.js +1 -0
  40. package/dist/cjs/components/Avatar/default.d.ts +7 -0
  41. package/dist/cjs/components/Avatar/default.js +1 -0
  42. package/dist/cjs/components/Checkbox/index.js +1 -0
  43. package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -0
  44. package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -0
  45. package/dist/cjs/components/ConversationCreate/ConversationCreateSelectView.js +1 -0
  46. package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -0
  47. package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -0
  48. package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -0
  49. package/dist/cjs/components/ConversationCreate/static/word.js +1 -0
  50. package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +10 -0
  51. package/dist/cjs/components/ConversationPreview/ConversationListContainer.js +1 -0
  52. package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +31 -0
  53. package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -0
  54. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +7 -0
  55. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -0
  56. package/dist/cjs/components/ConversationPreview/utils.js +1 -0
  57. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +5 -0
  58. package/dist/cjs/components/ConversationSearch/ConversationSearchInput.js +1 -0
  59. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +12 -0
  60. package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -0
  61. package/dist/cjs/components/DivWithEdit/DivWithEdit.js +1 -0
  62. package/dist/cjs/components/DivWithEdit/WithSelect.js +1 -0
  63. package/dist/cjs/components/DivWithEdit/WithText.js +1 -0
  64. package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +6 -0
  65. package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.js +1 -0
  66. package/dist/cjs/components/Icon/Icon.js +1 -0
  67. package/dist/cjs/components/Icon/config.js +1 -0
  68. package/dist/cjs/components/Icon/images/add.png.js +1 -0
  69. package/dist/cjs/components/Icon/images/arrow-down.png.js +1 -0
  70. package/dist/cjs/components/Icon/images/arrow-right.png.js +1 -0
  71. package/dist/cjs/components/Icon/images/back.png.js +1 -0
  72. package/dist/cjs/components/Icon/images/camera.png.js +1 -0
  73. package/dist/cjs/components/Icon/images/cancel.png.js +1 -0
  74. package/dist/cjs/components/Icon/images/clear.png.js +1 -0
  75. package/dist/cjs/components/Icon/images/close.png.js +1 -0
  76. package/dist/cjs/components/Icon/images/confirm.png.js +1 -0
  77. package/dist/cjs/components/Icon/images/copy.png.js +1 -0
  78. package/dist/cjs/components/Icon/images/create.png.js +1 -0
  79. package/dist/cjs/components/Icon/images/cry.png.js +1 -0
  80. package/dist/cjs/components/Icon/images/del.png.js +1 -0
  81. package/dist/cjs/components/Icon/images/document.png.js +1 -0
  82. package/dist/cjs/components/Icon/images/edit.png.js +1 -0
  83. package/dist/cjs/components/Icon/images/effort.png.js +1 -0
  84. package/dist/cjs/components/Icon/images/ellipse.png.js +1 -0
  85. package/dist/cjs/components/Icon/images/emoji.png.js +1 -0
  86. package/dist/cjs/components/Icon/images/file.png.js +1 -0
  87. package/dist/cjs/components/Icon/images/forward.png.js +1 -0
  88. package/dist/cjs/components/Icon/images/image.png.js +1 -0
  89. package/dist/cjs/components/Icon/images/more.png.js +1 -0
  90. package/dist/cjs/components/Icon/images/progress.png.js +1 -0
  91. package/dist/cjs/components/Icon/images/quote.png.js +1 -0
  92. package/dist/cjs/components/Icon/images/reply.png.js +1 -0
  93. package/dist/cjs/components/Icon/images/revocation.png.js +1 -0
  94. package/dist/cjs/components/Icon/images/right.png.js +1 -0
  95. package/dist/cjs/components/Icon/images/search.png.js +1 -0
  96. package/dist/cjs/components/Icon/images/star.png.js +1 -0
  97. package/dist/cjs/components/Icon/images/video.png.js +1 -0
  98. package/dist/cjs/components/Icon/type.js +1 -0
  99. package/dist/cjs/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +20 -0
  100. package/dist/cjs/components/InfiniteScrollPaginator/InfiniteScroll.js +1 -0
  101. package/dist/cjs/components/Input/Input.d.ts +16 -0
  102. package/dist/cjs/components/Input/Input.js +1 -0
  103. package/dist/cjs/components/Model/index.js +1 -0
  104. package/dist/cjs/components/Plugins/hooks/usePluginsElement.js +1 -0
  105. package/dist/cjs/components/Plugins/index.js +1 -0
  106. package/dist/cjs/components/Popup/index.js +1 -0
  107. package/dist/cjs/components/Profile/Profile.js +1 -0
  108. package/dist/cjs/components/Switch/Switch.js +1 -0
  109. package/dist/cjs/components/Switch/utils/newId.js +1 -0
  110. package/dist/cjs/components/TUIChat/TUIChat.d.ts +27 -0
  111. package/dist/cjs/components/TUIChat/TUIChat.js +1 -0
  112. package/dist/cjs/components/TUIChat/TUIChatState.js +1 -0
  113. package/dist/cjs/components/TUIChat/hooks/useCreateMessage.d.ts +31 -0
  114. package/dist/cjs/components/TUIChat/hooks/useCreateMessage.js +1 -0
  115. package/dist/cjs/components/TUIChat/hooks/useCreateTUIChatStateContext.js +1 -0
  116. package/dist/cjs/components/TUIChat/hooks/useHandleMessage.d.ts +7 -0
  117. package/dist/cjs/components/TUIChat/hooks/useHandleMessage.js +1 -0
  118. package/dist/cjs/components/TUIChat/hooks/useHandleMessageList.js +1 -0
  119. package/dist/cjs/components/TUIChat/hooks/useMessageReceviedListener.js +1 -0
  120. package/dist/cjs/components/TUIChat/unitls.js +1 -0
  121. package/dist/cjs/components/TUIChatHeader/TUIChatHeader.d.ts +13 -0
  122. package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +1 -0
  123. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +13 -0
  124. package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -0
  125. package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +10 -0
  126. package/dist/cjs/components/TUIConversation/TUIConversation.js +1 -0
  127. package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +17 -0
  128. package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -0
  129. package/dist/cjs/components/TUIConversationList/hooks/useConversationList.js +1 -0
  130. package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -0
  131. package/dist/cjs/components/TUIKit/TUIKit.d.ts +10 -0
  132. package/dist/cjs/components/TUIKit/TUIKit.js +1 -0
  133. package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +17 -0
  134. package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.js +1 -0
  135. package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +17 -0
  136. package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +1 -0
  137. package/dist/cjs/components/TUIManage/TUIManage.d.ts +3 -0
  138. package/dist/cjs/components/TUIManage/TUIManage.js +1 -0
  139. package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -0
  140. package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -0
  141. package/dist/cjs/components/TUIMessage/MessageContext.d.ts +7 -0
  142. package/dist/cjs/components/TUIMessage/MessageContext.js +1 -0
  143. package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -0
  144. package/dist/cjs/components/TUIMessage/MessageFace.js +1 -0
  145. package/dist/cjs/components/TUIMessage/MessageFile.js +1 -0
  146. package/dist/cjs/components/TUIMessage/MessageImage.js +1 -0
  147. package/dist/cjs/components/TUIMessage/MessageLocation.js +1 -0
  148. package/dist/cjs/components/TUIMessage/MessageMerger.js +1 -0
  149. package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -0
  150. package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -0
  151. package/dist/cjs/components/TUIMessage/MessageStatus.js +1 -0
  152. package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -0
  153. package/dist/cjs/components/TUIMessage/MessageText.js +1 -0
  154. package/dist/cjs/components/TUIMessage/MessageTip.js +1 -0
  155. package/dist/cjs/components/TUIMessage/MessageVideo.js +1 -0
  156. package/dist/cjs/components/TUIMessage/TUIMessage.d.ts +41 -0
  157. package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -0
  158. package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -0
  159. package/dist/cjs/components/TUIMessage/hooks/useMessageContextHandler.js +1 -0
  160. package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -0
  161. package/dist/cjs/components/TUIMessage/hooks/useMessagePluginElement.js +1 -0
  162. package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -0
  163. package/dist/cjs/components/TUIMessage/utils/decodeText.js +1 -0
  164. package/dist/cjs/components/TUIMessage/utils/emojiMap.js +1 -0
  165. package/dist/cjs/components/TUIMessage/utils/index.js +1 -0
  166. package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +1 -0
  167. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.d.ts +5 -0
  168. package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -0
  169. package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -0
  170. package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -0
  171. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.d.ts +18 -0
  172. package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -0
  173. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.d.ts +5 -0
  174. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -0
  175. package/dist/cjs/components/TUIMessageInput/hooks/useCreateMessageInputContext.js +1 -0
  176. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.d.ts +6 -0
  177. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -0
  178. package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -0
  179. package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -0
  180. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputState.d.ts +6 -0
  181. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputState.js +1 -0
  182. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -0
  183. package/dist/cjs/components/TUIMessageInput/hooks/useUploadElement.js +1 -0
  184. package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.d.ts +5 -0
  185. package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +1 -0
  186. package/dist/cjs/components/TUIMessageList/TUIMessageList.d.ts +11 -0
  187. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -0
  188. package/dist/cjs/components/TUIMessageList/hooks/useEnrichedMessageList.js +1 -0
  189. package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -0
  190. package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +10 -0
  191. package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -0
  192. package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +12 -0
  193. package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -0
  194. package/dist/cjs/components/TUIProfile/hooks/useMyProfile.d.ts +17 -0
  195. package/dist/cjs/components/TUIProfile/hooks/useMyProfile.js +1 -0
  196. package/dist/cjs/components/Toast/index.js +1 -0
  197. package/dist/cjs/components/untils.js +1 -0
  198. package/dist/cjs/constants.d.ts +11 -0
  199. package/dist/cjs/constants.js +1 -0
  200. package/dist/cjs/context/ComponentContext.d.ts +26 -0
  201. package/dist/cjs/context/ComponentContext.js +1 -0
  202. package/dist/cjs/context/TUIChatActionContext.d.ts +27 -0
  203. package/dist/cjs/context/TUIChatActionContext.js +1 -0
  204. package/dist/cjs/context/TUIChatStateContext.d.ts +25 -0
  205. package/dist/cjs/context/TUIChatStateContext.js +1 -0
  206. package/dist/cjs/context/TUIConversationContext.js +1 -0
  207. package/dist/cjs/context/TUIKitContext.d.ts +21 -0
  208. package/dist/cjs/context/TUIKitContext.js +1 -0
  209. package/dist/cjs/context/TUIMessageContext.d.ts +41 -0
  210. package/dist/cjs/context/TUIMessageContext.js +1 -0
  211. package/dist/cjs/context/TUIMessageInputContext.d.ts +37 -0
  212. package/dist/cjs/context/TUIMessageInputContext.js +1 -0
  213. package/dist/cjs/hooks/useConversation.d.ts +25 -0
  214. package/dist/cjs/hooks/useConversation.js +1 -0
  215. package/dist/cjs/hooks/useProfile.d.ts +5 -0
  216. package/dist/cjs/hooks/useProfile.js +1 -0
  217. package/dist/cjs/index.css +1 -0
  218. package/dist/cjs/index.d.css +1281 -0
  219. package/dist/cjs/index.d.ts +29 -0
  220. package/dist/cjs/index.js +1 -0
  221. package/dist/esm/_virtual/DateInput.js +1 -0
  222. package/dist/esm/_virtual/DatePicker.js +1 -0
  223. package/dist/esm/_virtual/DayInput.js +1 -0
  224. package/dist/esm/_virtual/Divider.js +1 -0
  225. package/dist/esm/_virtual/Fit.js +1 -0
  226. package/dist/esm/_virtual/Input.js +1 -0
  227. package/dist/esm/_virtual/MonthInput.js +1 -0
  228. package/dist/esm/_virtual/MonthSelect.js +1 -0
  229. package/dist/esm/_virtual/NativeInput.js +1 -0
  230. package/dist/esm/_virtual/YearInput.js +1 -0
  231. package/dist/esm/_virtual/_commonjsHelpers.js +1 -0
  232. package/dist/esm/_virtual/clsx.m.js +1 -0
  233. package/dist/esm/_virtual/dateFormatter.js +1 -0
  234. package/dist/esm/_virtual/dates.js +1 -0
  235. package/dist/esm/_virtual/entry.js +1 -0
  236. package/dist/esm/_virtual/index.js +1 -0
  237. package/dist/esm/_virtual/index10.js +1 -0
  238. package/dist/esm/_virtual/index2.js +1 -0
  239. package/dist/esm/_virtual/index3.js +1 -0
  240. package/dist/esm/_virtual/index4.js +1 -0
  241. package/dist/esm/_virtual/index5.js +1 -0
  242. package/dist/esm/_virtual/index6.js +1 -0
  243. package/dist/esm/_virtual/index7.js +1 -0
  244. package/dist/esm/_virtual/index8.js +1 -0
  245. package/dist/esm/_virtual/index9.js +1 -0
  246. package/dist/esm/_virtual/propTypes.js +1 -0
  247. package/dist/esm/_virtual/react-dom.development.js +1 -0
  248. package/dist/esm/_virtual/react-dom.production.min.js +1 -0
  249. package/dist/esm/_virtual/react-is.development.js +1 -0
  250. package/dist/esm/_virtual/react-is.production.min.js +1 -0
  251. package/dist/esm/_virtual/scheduler.development.js +1 -0
  252. package/dist/esm/_virtual/scheduler.production.min.js +1 -0
  253. package/dist/esm/_virtual/tiny-warning.esm.js +1 -0
  254. package/dist/esm/_virtual/utils.js +1 -0
  255. package/dist/esm/components/Avatar/Avatar.d.ts +22 -0
  256. package/dist/esm/components/Avatar/Avatar.js +1 -0
  257. package/dist/esm/components/Avatar/default.d.ts +7 -0
  258. package/dist/esm/components/Avatar/default.js +1 -0
  259. package/dist/esm/components/Checkbox/index.js +1 -0
  260. package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -0
  261. package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -0
  262. package/dist/esm/components/ConversationCreate/ConversationCreateSelectView.js +1 -0
  263. package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -0
  264. package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -0
  265. package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -0
  266. package/dist/esm/components/ConversationCreate/static/word.js +1 -0
  267. package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +10 -0
  268. package/dist/esm/components/ConversationPreview/ConversationListContainer.js +1 -0
  269. package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +31 -0
  270. package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -0
  271. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +7 -0
  272. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -0
  273. package/dist/esm/components/ConversationPreview/utils.js +1 -0
  274. package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +5 -0
  275. package/dist/esm/components/ConversationSearch/ConversationSearchInput.js +1 -0
  276. package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +12 -0
  277. package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -0
  278. package/dist/esm/components/DivWithEdit/DivWithEdit.js +1 -0
  279. package/dist/esm/components/DivWithEdit/WithSelect.js +1 -0
  280. package/dist/esm/components/DivWithEdit/WithText.js +1 -0
  281. package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +6 -0
  282. package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.js +1 -0
  283. package/dist/esm/components/Icon/Icon.js +1 -0
  284. package/dist/esm/components/Icon/config.js +1 -0
  285. package/dist/esm/components/Icon/images/add.png.js +1 -0
  286. package/dist/esm/components/Icon/images/arrow-down.png.js +1 -0
  287. package/dist/esm/components/Icon/images/arrow-right.png.js +1 -0
  288. package/dist/esm/components/Icon/images/back.png.js +1 -0
  289. package/dist/esm/components/Icon/images/camera.png.js +1 -0
  290. package/dist/esm/components/Icon/images/cancel.png.js +1 -0
  291. package/dist/esm/components/Icon/images/clear.png.js +1 -0
  292. package/dist/esm/components/Icon/images/close.png.js +1 -0
  293. package/dist/esm/components/Icon/images/confirm.png.js +1 -0
  294. package/dist/esm/components/Icon/images/copy.png.js +1 -0
  295. package/dist/esm/components/Icon/images/create.png.js +1 -0
  296. package/dist/esm/components/Icon/images/cry.png.js +1 -0
  297. package/dist/esm/components/Icon/images/del.png.js +1 -0
  298. package/dist/esm/components/Icon/images/document.png.js +1 -0
  299. package/dist/esm/components/Icon/images/edit.png.js +1 -0
  300. package/dist/esm/components/Icon/images/effort.png.js +1 -0
  301. package/dist/esm/components/Icon/images/ellipse.png.js +1 -0
  302. package/dist/esm/components/Icon/images/emoji.png.js +1 -0
  303. package/dist/esm/components/Icon/images/file.png.js +1 -0
  304. package/dist/esm/components/Icon/images/forward.png.js +1 -0
  305. package/dist/esm/components/Icon/images/image.png.js +1 -0
  306. package/dist/esm/components/Icon/images/more.png.js +1 -0
  307. package/dist/esm/components/Icon/images/progress.png.js +1 -0
  308. package/dist/esm/components/Icon/images/quote.png.js +1 -0
  309. package/dist/esm/components/Icon/images/reply.png.js +1 -0
  310. package/dist/esm/components/Icon/images/revocation.png.js +1 -0
  311. package/dist/esm/components/Icon/images/right.png.js +1 -0
  312. package/dist/esm/components/Icon/images/search.png.js +1 -0
  313. package/dist/esm/components/Icon/images/star.png.js +1 -0
  314. package/dist/esm/components/Icon/images/video.png.js +1 -0
  315. package/dist/esm/components/Icon/type.js +1 -0
  316. package/dist/esm/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +20 -0
  317. package/dist/esm/components/InfiniteScrollPaginator/InfiniteScroll.js +1 -0
  318. package/dist/esm/components/Input/Input.d.ts +16 -0
  319. package/dist/esm/components/Input/Input.js +1 -0
  320. package/dist/esm/components/Model/index.js +1 -0
  321. package/dist/esm/components/Plugins/hooks/usePluginsElement.js +1 -0
  322. package/dist/esm/components/Plugins/index.js +1 -0
  323. package/dist/esm/components/Popup/index.js +1 -0
  324. package/dist/esm/components/Profile/Profile.js +1 -0
  325. package/dist/esm/components/Switch/Switch.js +1 -0
  326. package/dist/esm/components/Switch/utils/newId.js +1 -0
  327. package/dist/esm/components/TUIChat/TUIChat.d.ts +27 -0
  328. package/dist/esm/components/TUIChat/TUIChat.js +1 -0
  329. package/dist/esm/components/TUIChat/TUIChatState.js +1 -0
  330. package/dist/esm/components/TUIChat/hooks/useCreateMessage.d.ts +31 -0
  331. package/dist/esm/components/TUIChat/hooks/useCreateMessage.js +1 -0
  332. package/dist/esm/components/TUIChat/hooks/useCreateTUIChatStateContext.js +1 -0
  333. package/dist/esm/components/TUIChat/hooks/useHandleMessage.d.ts +7 -0
  334. package/dist/esm/components/TUIChat/hooks/useHandleMessage.js +1 -0
  335. package/dist/esm/components/TUIChat/hooks/useHandleMessageList.js +1 -0
  336. package/dist/esm/components/TUIChat/hooks/useMessageReceviedListener.js +1 -0
  337. package/dist/esm/components/TUIChat/unitls.js +1 -0
  338. package/dist/esm/components/TUIChatHeader/TUIChatHeader.d.ts +13 -0
  339. package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +1 -0
  340. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +13 -0
  341. package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -0
  342. package/dist/esm/components/TUIConversation/TUIConversation.d.ts +10 -0
  343. package/dist/esm/components/TUIConversation/TUIConversation.js +1 -0
  344. package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +17 -0
  345. package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -0
  346. package/dist/esm/components/TUIConversationList/hooks/useConversationList.js +1 -0
  347. package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -0
  348. package/dist/esm/components/TUIKit/TUIKit.d.ts +10 -0
  349. package/dist/esm/components/TUIKit/TUIKit.js +1 -0
  350. package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +17 -0
  351. package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.js +1 -0
  352. package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +17 -0
  353. package/dist/esm/components/TUIKit/hooks/useTUIKit.js +1 -0
  354. package/dist/esm/components/TUIManage/TUIManage.d.ts +3 -0
  355. package/dist/esm/components/TUIManage/TUIManage.js +1 -0
  356. package/dist/esm/components/TUIMessage/MessageAudio.js +1 -0
  357. package/dist/esm/components/TUIMessage/MessageBubble.js +1 -0
  358. package/dist/esm/components/TUIMessage/MessageContext.d.ts +7 -0
  359. package/dist/esm/components/TUIMessage/MessageContext.js +1 -0
  360. package/dist/esm/components/TUIMessage/MessageCustom.js +1 -0
  361. package/dist/esm/components/TUIMessage/MessageFace.js +1 -0
  362. package/dist/esm/components/TUIMessage/MessageFile.js +1 -0
  363. package/dist/esm/components/TUIMessage/MessageImage.js +1 -0
  364. package/dist/esm/components/TUIMessage/MessageLocation.js +1 -0
  365. package/dist/esm/components/TUIMessage/MessageMerger.js +1 -0
  366. package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -0
  367. package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -0
  368. package/dist/esm/components/TUIMessage/MessageStatus.js +1 -0
  369. package/dist/esm/components/TUIMessage/MessageSystem.js +1 -0
  370. package/dist/esm/components/TUIMessage/MessageText.js +1 -0
  371. package/dist/esm/components/TUIMessage/MessageTip.js +1 -0
  372. package/dist/esm/components/TUIMessage/MessageVideo.js +1 -0
  373. package/dist/esm/components/TUIMessage/TUIMessage.d.ts +41 -0
  374. package/dist/esm/components/TUIMessage/TUIMessage.js +1 -0
  375. package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -0
  376. package/dist/esm/components/TUIMessage/hooks/useMessageContextHandler.js +1 -0
  377. package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -0
  378. package/dist/esm/components/TUIMessage/hooks/useMessagePluginElement.js +1 -0
  379. package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -0
  380. package/dist/esm/components/TUIMessage/utils/decodeText.js +1 -0
  381. package/dist/esm/components/TUIMessage/utils/emojiMap.js +1 -0
  382. package/dist/esm/components/TUIMessage/utils/index.js +1 -0
  383. package/dist/esm/components/TUIMessageInput/EmojiPicker.js +1 -0
  384. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.d.ts +5 -0
  385. package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -0
  386. package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -0
  387. package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -0
  388. package/dist/esm/components/TUIMessageInput/TUIMessageInput.d.ts +18 -0
  389. package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -0
  390. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.d.ts +5 -0
  391. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -0
  392. package/dist/esm/components/TUIMessageInput/hooks/useCreateMessageInputContext.js +1 -0
  393. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.d.ts +6 -0
  394. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -0
  395. package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -0
  396. package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -0
  397. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputState.d.ts +6 -0
  398. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputState.js +1 -0
  399. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -0
  400. package/dist/esm/components/TUIMessageInput/hooks/useUploadElement.js +1 -0
  401. package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.d.ts +5 -0
  402. package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +1 -0
  403. package/dist/esm/components/TUIMessageList/TUIMessageList.d.ts +11 -0
  404. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -0
  405. package/dist/esm/components/TUIMessageList/hooks/useEnrichedMessageList.js +1 -0
  406. package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -0
  407. package/dist/esm/components/TUIProfile/TUIProfile.d.ts +10 -0
  408. package/dist/esm/components/TUIProfile/TUIProfile.js +1 -0
  409. package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +12 -0
  410. package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -0
  411. package/dist/esm/components/TUIProfile/hooks/useMyProfile.d.ts +17 -0
  412. package/dist/esm/components/TUIProfile/hooks/useMyProfile.js +1 -0
  413. package/dist/esm/components/Toast/index.js +1 -0
  414. package/dist/esm/components/untils.js +1 -0
  415. package/dist/esm/constants.d.ts +11 -0
  416. package/dist/esm/constants.js +1 -0
  417. package/dist/esm/context/ComponentContext.d.ts +26 -0
  418. package/dist/esm/context/ComponentContext.js +1 -0
  419. package/dist/esm/context/TUIChatActionContext.d.ts +27 -0
  420. package/dist/esm/context/TUIChatActionContext.js +1 -0
  421. package/dist/esm/context/TUIChatStateContext.d.ts +25 -0
  422. package/dist/esm/context/TUIChatStateContext.js +1 -0
  423. package/dist/esm/context/TUIConversationContext.js +1 -0
  424. package/dist/esm/context/TUIKitContext.d.ts +21 -0
  425. package/dist/esm/context/TUIKitContext.js +1 -0
  426. package/dist/esm/context/TUIMessageContext.d.ts +41 -0
  427. package/dist/esm/context/TUIMessageContext.js +1 -0
  428. package/dist/esm/context/TUIMessageInputContext.d.ts +37 -0
  429. package/dist/esm/context/TUIMessageInputContext.js +1 -0
  430. package/dist/esm/hooks/useConversation.d.ts +25 -0
  431. package/dist/esm/hooks/useConversation.js +1 -0
  432. package/dist/esm/hooks/useProfile.d.ts +5 -0
  433. package/dist/esm/hooks/useProfile.js +1 -0
  434. package/dist/esm/index.css +1 -0
  435. package/dist/esm/index.d.css +1281 -0
  436. package/dist/esm/index.d.ts +29 -0
  437. package/dist/esm/index.js +1 -0
  438. package/package.json +70 -0
  439. package/rollup.config.js +66 -0
  440. package/src/@types/images.d.ts +7 -0
  441. package/src/@types/index.d.ts +1 -0
  442. package/src/@types/index.js +3 -0
  443. package/src/components/Avatar/Avatar.tsx +151 -0
  444. package/src/components/Avatar/default.ts +5 -0
  445. package/src/components/Avatar/index.ts +2 -0
  446. package/src/components/Avatar/styles/index.scss +55 -0
  447. package/src/components/Checkbox/index.tsx +53 -0
  448. package/src/components/Checkbox/styles/color.scss +11 -0
  449. package/src/components/Checkbox/styles/index.scss +2 -0
  450. package/src/components/Checkbox/styles/layout.scss +25 -0
  451. package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +155 -0
  452. package/src/components/ConversationCreate/ConversationCreate.tsx +74 -0
  453. package/src/components/ConversationCreate/ConversationCreateSelectView.tsx +46 -0
  454. package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +158 -0
  455. package/src/components/ConversationCreate/ConversationGroupTypeInfo.tsx +50 -0
  456. package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +105 -0
  457. package/src/components/ConversationCreate/index.ts +6 -0
  458. package/src/components/ConversationCreate/static/word.ts +300 -0
  459. package/src/components/ConversationCreate/styles/ConversationCreatGroupDetail.scss +58 -0
  460. package/src/components/ConversationCreate/styles/conversationCreateSelectView.scss +32 -0
  461. package/src/components/ConversationCreate/styles/conversationGroupTypeInfo.scss +61 -0
  462. package/src/components/ConversationCreate/styles/index.scss +87 -0
  463. package/src/components/ConversationPreview/ConversationListContainer.tsx +20 -0
  464. package/src/components/ConversationPreview/ConversationPreview.tsx +75 -0
  465. package/src/components/ConversationPreview/ConversationPreviewContent.tsx +136 -0
  466. package/src/components/ConversationPreview/index.ts +2 -0
  467. package/src/components/ConversationPreview/styles/index.scss +140 -0
  468. package/src/components/ConversationPreview/utils.tsx +124 -0
  469. package/src/components/ConversationSearch/ConversationSearchInput.tsx +25 -0
  470. package/src/components/ConversationSearch/ConversationSearchResult.tsx +39 -0
  471. package/src/components/ConversationSearch/index.ts +2 -0
  472. package/src/components/ConversationSearch/styles/index.scss +19 -0
  473. package/src/components/DivWithEdit/DivWithEdit.tsx +90 -0
  474. package/src/components/DivWithEdit/WithSelect.tsx +29 -0
  475. package/src/components/DivWithEdit/WithText.tsx +42 -0
  476. package/src/components/DivWithEdit/index.ts +1 -0
  477. package/src/components/DivWithEdit/styles/index.scss +68 -0
  478. package/src/components/EmptyStateIndicator/EmptyStateIndicator.tsx +23 -0
  479. package/src/components/EmptyStateIndicator/index.ts +1 -0
  480. package/src/components/Icon/Icon.tsx +40 -0
  481. package/src/components/Icon/config.ts +164 -0
  482. package/src/components/Icon/images/add.png +0 -0
  483. package/src/components/Icon/images/arrow-down.png +0 -0
  484. package/src/components/Icon/images/arrow-right.png +0 -0
  485. package/src/components/Icon/images/back.png +0 -0
  486. package/src/components/Icon/images/camera.png +0 -0
  487. package/src/components/Icon/images/cancel.png +0 -0
  488. package/src/components/Icon/images/clear.png +0 -0
  489. package/src/components/Icon/images/close.png +0 -0
  490. package/src/components/Icon/images/confirm.png +0 -0
  491. package/src/components/Icon/images/copy.png +0 -0
  492. package/src/components/Icon/images/create.png +0 -0
  493. package/src/components/Icon/images/cry.png +0 -0
  494. package/src/components/Icon/images/del.png +0 -0
  495. package/src/components/Icon/images/document.png +0 -0
  496. package/src/components/Icon/images/edit.png +0 -0
  497. package/src/components/Icon/images/effort.png +0 -0
  498. package/src/components/Icon/images/ellipse.png +0 -0
  499. package/src/components/Icon/images/emoji.png +0 -0
  500. package/src/components/Icon/images/file.png +0 -0
  501. package/src/components/Icon/images/forward.png +0 -0
  502. package/src/components/Icon/images/image.png +0 -0
  503. package/src/components/Icon/images/more.png +0 -0
  504. package/src/components/Icon/images/progress.png +0 -0
  505. package/src/components/Icon/images/quote.png +0 -0
  506. package/src/components/Icon/images/reply.png +0 -0
  507. package/src/components/Icon/images/revocation.png +0 -0
  508. package/src/components/Icon/images/right.png +0 -0
  509. package/src/components/Icon/images/search.png +0 -0
  510. package/src/components/Icon/images/star.png +0 -0
  511. package/src/components/Icon/images/video.png +0 -0
  512. package/src/components/Icon/index.ts +2 -0
  513. package/src/components/Icon/styles/index.scss +31 -0
  514. package/src/components/Icon/type.ts +32 -0
  515. package/src/components/InfiniteScrollPaginator/InfiniteScroll.tsx +115 -0
  516. package/src/components/InfiniteScrollPaginator/index.ts +1 -0
  517. package/src/components/Input/Input.tsx +108 -0
  518. package/src/components/Input/index.ts +1 -0
  519. package/src/components/Input/styles/index.scss +44 -0
  520. package/src/components/Model/index.tsx +24 -0
  521. package/src/components/Model/styles/color.scss +0 -0
  522. package/src/components/Model/styles/index.scss +2 -0
  523. package/src/components/Model/styles/layout.scss +12 -0
  524. package/src/components/Plugins/hooks/index.ts +1 -0
  525. package/src/components/Plugins/hooks/usePluginsElement.tsx +16 -0
  526. package/src/components/Plugins/index.tsx +99 -0
  527. package/src/components/Plugins/styles/color.scss +7 -0
  528. package/src/components/Plugins/styles/index.scss +2 -0
  529. package/src/components/Plugins/styles/layout.scss +18 -0
  530. package/src/components/Popup/index.tsx +76 -0
  531. package/src/components/Popup/styles/color.scss +0 -0
  532. package/src/components/Popup/styles/index.scss +2 -0
  533. package/src/components/Popup/styles/layout.scss +6 -0
  534. package/src/components/Profile/Profile.tsx +25 -0
  535. package/src/components/Profile/hooks/useProfile.tsx +28 -0
  536. package/src/components/Profile/index.ts +2 -0
  537. package/src/components/Profile/styles/index.scss +17 -0
  538. package/src/components/Switch/Switch.scss +37 -0
  539. package/src/components/Switch/Switch.tsx +41 -0
  540. package/src/components/Switch/index.ts +1 -0
  541. package/src/components/Switch/utils/newId.tsx +6 -0
  542. package/src/components/TUIChat/TUIChat.tsx +276 -0
  543. package/src/components/TUIChat/TUIChatState.tsx +129 -0
  544. package/src/components/TUIChat/hooks/useCreateMessage.tsx +117 -0
  545. package/src/components/TUIChat/hooks/useCreateTUIChatStateContext.tsx +34 -0
  546. package/src/components/TUIChat/hooks/useHandleMessage.tsx +33 -0
  547. package/src/components/TUIChat/hooks/useHandleMessageList.tsx +70 -0
  548. package/src/components/TUIChat/hooks/useIsMounted.ts +14 -0
  549. package/src/components/TUIChat/hooks/useMessageReceviedListener.tsx +26 -0
  550. package/src/components/TUIChat/index.ts +2 -0
  551. package/src/components/TUIChat/styles/index.scss +1 -0
  552. package/src/components/TUIChat/styles/layout.scss +9 -0
  553. package/src/components/TUIChat/unitls.ts +55 -0
  554. package/src/components/TUIChatHeader/TUIChatHeader.tsx +41 -0
  555. package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +97 -0
  556. package/src/components/TUIChatHeader/index.ts +2 -0
  557. package/src/components/TUIChatHeader/styles/color.scss +3 -0
  558. package/src/components/TUIChatHeader/styles/index.scss +2 -0
  559. package/src/components/TUIChatHeader/styles/layout.scss +32 -0
  560. package/src/components/TUIConversation/TUIConversation.tsx +44 -0
  561. package/src/components/TUIConversation/index.ts +1 -0
  562. package/src/components/TUIConversationList/TUIConversationList.tsx +142 -0
  563. package/src/components/TUIConversationList/hooks/useConversationList.tsx +41 -0
  564. package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +33 -0
  565. package/src/components/TUIConversationList/index.scss +36 -0
  566. package/src/components/TUIConversationList/index.ts +2 -0
  567. package/src/components/TUIKit/TUIKit.tsx +56 -0
  568. package/src/components/TUIKit/hooks/useCreateTUIKitContext.tsx +40 -0
  569. package/src/components/TUIKit/hooks/useTUIKit.tsx +40 -0
  570. package/src/components/TUIKit/index.ts +3 -0
  571. package/src/components/TUIKit/styles/index.scss +9 -0
  572. package/src/components/TUIKit/styles/reset.scss +43 -0
  573. package/src/components/TUIManage/TUIManage.tsx +86 -0
  574. package/src/components/TUIManage/index.ts +1 -0
  575. package/src/components/TUIManage/styles/index.scss +67 -0
  576. package/src/components/TUIMessage/MessageAudio.tsx +28 -0
  577. package/src/components/TUIMessage/MessageBubble.tsx +99 -0
  578. package/src/components/TUIMessage/MessageContext.tsx +81 -0
  579. package/src/components/TUIMessage/MessageCustom.tsx +40 -0
  580. package/src/components/TUIMessage/MessageFace.tsx +28 -0
  581. package/src/components/TUIMessage/MessageFile.tsx +35 -0
  582. package/src/components/TUIMessage/MessageImage.tsx +42 -0
  583. package/src/components/TUIMessage/MessageLocation.tsx +29 -0
  584. package/src/components/TUIMessage/MessageMerger.tsx +37 -0
  585. package/src/components/TUIMessage/MessagePlugins.tsx +149 -0
  586. package/src/components/TUIMessage/MessageRevoke.tsx +47 -0
  587. package/src/components/TUIMessage/MessageStatus.tsx +34 -0
  588. package/src/components/TUIMessage/MessageSystem.tsx +30 -0
  589. package/src/components/TUIMessage/MessageText.tsx +43 -0
  590. package/src/components/TUIMessage/MessageTip.tsx +28 -0
  591. package/src/components/TUIMessage/MessageVideo.tsx +42 -0
  592. package/src/components/TUIMessage/TUIMessage.tsx +98 -0
  593. package/src/components/TUIMessage/TUIMessageDefault.tsx +93 -0
  594. package/src/components/TUIMessage/hooks/index.ts +3 -0
  595. package/src/components/TUIMessage/hooks/useMessageContextHandler.ts +70 -0
  596. package/src/components/TUIMessage/hooks/useMessageHandler.ts +142 -0
  597. package/src/components/TUIMessage/hooks/useMessagePluginElement.tsx +17 -0
  598. package/src/components/TUIMessage/hooks/useMessageReply.ts +65 -0
  599. package/src/components/TUIMessage/index.ts +3 -0
  600. package/src/components/TUIMessage/styles/color.scss +32 -0
  601. package/src/components/TUIMessage/styles/index.scss +2 -0
  602. package/src/components/TUIMessage/styles/layout.scss +389 -0
  603. package/src/components/TUIMessage/utils/decodeText.ts +61 -0
  604. package/src/components/TUIMessage/utils/emojiMap.ts +311 -0
  605. package/src/components/TUIMessage/utils/index.ts +463 -0
  606. package/src/components/TUIMessageInput/EmojiPicker.tsx +71 -0
  607. package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +69 -0
  608. package/src/components/TUIMessageInput/InputQuoteDefalut.tsx +41 -0
  609. package/src/components/TUIMessageInput/TUIForward.tsx +194 -0
  610. package/src/components/TUIMessageInput/TUIMessageInput.tsx +94 -0
  611. package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +75 -0
  612. package/src/components/TUIMessageInput/hooks/index.ts +6 -0
  613. package/src/components/TUIMessageInput/hooks/useCreateMessageInputContext.ts +51 -0
  614. package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +42 -0
  615. package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +41 -0
  616. package/src/components/TUIMessageInput/hooks/useHandleQuoteMessage.tsx +63 -0
  617. package/src/components/TUIMessageInput/hooks/useMessageInputState.tsx +101 -0
  618. package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +176 -0
  619. package/src/components/TUIMessageInput/hooks/usePluginsElement.tsx +24 -0
  620. package/src/components/TUIMessageInput/hooks/useUploadElement.tsx +35 -0
  621. package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +40 -0
  622. package/src/components/TUIMessageInput/index.ts +3 -0
  623. package/src/components/TUIMessageInput/styles/color.scss +17 -0
  624. package/src/components/TUIMessageInput/styles/index.scss +2 -0
  625. package/src/components/TUIMessageInput/styles/layout.scss +280 -0
  626. package/src/components/TUIMessageList/TUIMessageList.tsx +106 -0
  627. package/src/components/TUIMessageList/hooks/useEnrichedMessageList.tsx +16 -0
  628. package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +24 -0
  629. package/src/components/TUIMessageList/index.ts +2 -0
  630. package/src/components/TUIMessageList/styles/color.scss +0 -0
  631. package/src/components/TUIMessageList/styles/index.scss +2 -0
  632. package/src/components/TUIMessageList/styles/layout.scss +28 -0
  633. package/src/components/TUIProfile/TUIProfile.tsx +37 -0
  634. package/src/components/TUIProfile/TUIProfileDefault.tsx +247 -0
  635. package/src/components/TUIProfile/hooks/index.ts +1 -0
  636. package/src/components/TUIProfile/hooks/useMyProfile.tsx +64 -0
  637. package/src/components/TUIProfile/index.ts +2 -0
  638. package/src/components/TUIProfile/styles/color.scss +6 -0
  639. package/src/components/TUIProfile/styles/index.scss +2 -0
  640. package/src/components/TUIProfile/styles/layout.scss +91 -0
  641. package/src/components/Toast/index.tsx +44 -0
  642. package/src/components/Toast/styles/color.scss +11 -0
  643. package/src/components/Toast/styles/index.scss +2 -0
  644. package/src/components/Toast/styles/layout.scss +11 -0
  645. package/src/components/index.ts +12 -0
  646. package/src/components/untils.ts +72 -0
  647. package/src/constants.ts +84 -0
  648. package/src/context/ComponentContext.tsx +46 -0
  649. package/src/context/TUIChatActionContext.tsx +57 -0
  650. package/src/context/TUIChatStateContext.tsx +40 -0
  651. package/src/context/TUIConversationContext.tsx +27 -0
  652. package/src/context/TUIKitContext.tsx +31 -0
  653. package/src/context/TUIMessageContext.tsx +36 -0
  654. package/src/context/TUIMessageInputContext.tsx +56 -0
  655. package/src/context/index.ts +6 -0
  656. package/src/hooks/index.ts +2 -0
  657. package/src/hooks/useConversation.tsx +78 -0
  658. package/src/hooks/useProfile.tsx +8 -0
  659. package/src/index.ts +3 -0
  660. package/tsconfig.json +12 -0
@@ -0,0 +1,9 @@
1
+ .chat {
2
+ flex: 1;
3
+ width: 100%;
4
+ box-sizing: border-box;
5
+ display: flex;
6
+ flex-direction: column;
7
+ position: relative;
8
+ background: #FFFFFF;
9
+ }
@@ -0,0 +1,55 @@
1
+ import TIM, { Message } from 'tim-js-sdk';
2
+ import constant from '../../constants';
3
+ import type { TUIChatStateContextValue } from '../../context';
4
+ import { JSONStringToParse } from '../untils';
5
+
6
+ export const handleMessage = (messageList:Array<Message>):Array<Message> => {
7
+ let customPayloadData = null;
8
+ return messageList.filter((item) => {
9
+ if (item.type === TIM.TYPES.MSG_CUSTOM) {
10
+ customPayloadData = JSONStringToParse(item?.payload?.data);
11
+ }
12
+ if (customPayloadData && customPayloadData?.businessID === constant.TYPE_TYPING) {
13
+ return false;
14
+ }
15
+ return true;
16
+ });
17
+ };
18
+
19
+ export const handleMessageList = (
20
+ list:Array<Message>,
21
+ state:TUIChatStateContextValue,
22
+ ) => {
23
+ const data = {
24
+ messageList: [],
25
+ lastMessageID: '',
26
+ isSameLastMessageID: false,
27
+ };
28
+ data.messageList = list;
29
+ if (data.messageList.length >= 1) {
30
+ data.lastMessageID = data?.messageList[data.messageList.length - 1]?.ID;
31
+ }
32
+ data.messageList = data.messageList.filter((item) => !item?.isDeleted);
33
+ data.isSameLastMessageID = data?.lastMessageID === state?.lastMessageID;
34
+ return data;
35
+ };
36
+
37
+ export const handleEditMessage = (
38
+ messageList: Array<Message>,
39
+ message: Message,
40
+ ) => {
41
+ const list = [...messageList];
42
+ const index = list.findIndex((item) => item?.ID === message?.ID);
43
+ list[index] = message;
44
+ return list;
45
+ };
46
+
47
+ export const handleRemoveMessage = (
48
+ messageList: Array<Message>,
49
+ message: Message,
50
+ ) => {
51
+ const list = [...messageList];
52
+ const index = list.findIndex((item) => item?.ID === message?.ID);
53
+ list.splice(index, 1);
54
+ return list;
55
+ };
@@ -0,0 +1,41 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { Conversation } from 'tim-js-sdk';
3
+ import { useTUIChatStateContext } from '../../context/TUIChatStateContext';
4
+ import type { TUIChatHeaderDefaultProps } from './TUIChatHeaderDefault';
5
+ import { TUIChatHeaderDefault } from './TUIChatHeaderDefault';
6
+
7
+ import './styles/index.scss';
8
+ import { useComponentContext } from '../../context';
9
+
10
+ interface TUIChatHeaderProps {
11
+ title?: string,
12
+ TUIChatHeader?: React.ComponentType<TUIChatHeaderDefaultProps>,
13
+ conversation?: Conversation,
14
+ }
15
+
16
+ function UnMemoizedTUIChatHeader<T extends TUIChatHeaderProps>(
17
+ props: PropsWithChildren<T>,
18
+ ):React.ReactElement {
19
+ const {
20
+ title,
21
+ conversation: propsConversation,
22
+ TUIChatHeader: propTUIChatHeader,
23
+ } = props;
24
+
25
+ const { conversation: contextConversation } = useTUIChatStateContext('TUIChatHeader');
26
+ const { TUIChatHeader: ContextTUIChatHeader } = useComponentContext('TUIChatHeader');
27
+
28
+ const TUIChatHeaderUIComponent = propTUIChatHeader
29
+ || ContextTUIChatHeader || TUIChatHeaderDefault;
30
+ const conversation = propsConversation || contextConversation;
31
+
32
+ return (
33
+ <TUIChatHeaderUIComponent
34
+ title={title}
35
+ conversation={conversation}
36
+ />
37
+ );
38
+ }
39
+
40
+ export const TUIChatHeader = React.memo(UnMemoizedTUIChatHeader) as
41
+ typeof UnMemoizedTUIChatHeader;
@@ -0,0 +1,97 @@
1
+ import React, { PropsWithChildren, useEffect, useState } from 'react';
2
+ import TIM, { Conversation, Group, Profile } from 'tim-js-sdk';
3
+ import { Avatar } from '../Avatar';
4
+ import { handleDisplayAvatar } from '../untils';
5
+
6
+ import './styles/index.scss';
7
+ import { Icon, IconTypes } from '../Icon';
8
+ import { useTUIKitContext } from '../../context';
9
+
10
+ export interface TUIChatHeaderDefaultProps {
11
+ title?: string,
12
+ avatar?: string,
13
+ isOnline?: boolean,
14
+ conversation?: Conversation,
15
+ pluginComponentList?: Array<React.ComponentType>,
16
+ }
17
+
18
+ function TUIChatHeaderDefaultWithContext <T extends TUIChatHeaderDefaultProps>(
19
+ props: PropsWithChildren<T>,
20
+ ):React.ReactElement {
21
+ const {
22
+ title: propTitle,
23
+ avatar: propAvatar,
24
+ isOnline,
25
+ conversation,
26
+ } = props;
27
+
28
+ const [title, setTitle] = useState('');
29
+ const [avatar, setAvatar] = useState('');
30
+
31
+ useEffect(() => {
32
+ setTitle(propTitle);
33
+ setAvatar(propAvatar);
34
+ switch (conversation?.type) {
35
+ case TIM.TYPES.CONV_C2C:
36
+ handleC2C(conversation.userProfile);
37
+ break;
38
+ case TIM.TYPES.CONV_GROUP:
39
+ handleGroup(conversation.groupProfile);
40
+ break;
41
+ case TIM.TYPES.CONV_SYSTEM:
42
+ setTitle('System Notice');
43
+ break;
44
+ default:
45
+ setTitle('');
46
+ break;
47
+ }
48
+ }, [conversation]);
49
+
50
+ const handleC2C = (userProfile: Profile) => {
51
+ if (!title) {
52
+ setTitle(userProfile?.nick || userProfile?.userID);
53
+ }
54
+ if (!avatar) {
55
+ setAvatar(handleDisplayAvatar(userProfile.avatar));
56
+ }
57
+ };
58
+
59
+ const handleGroup = (groupProfile: Group) => {
60
+ if (!title) {
61
+ setTitle(groupProfile?.name || groupProfile?.groupID);
62
+ }
63
+ if (!avatar) {
64
+ setAvatar(handleDisplayAvatar(groupProfile.avatar, TIM.TYPES.CONV_GROUP));
65
+ }
66
+ };
67
+ const { setTUIManageShow } = useTUIKitContext();
68
+ const openTUIManage = () => {
69
+ setTUIManageShow(true);
70
+ };
71
+
72
+ return (
73
+ <header className="tui-chat-header" key={conversation?.conversationID}>
74
+ <div className={`tui-chat-header-left ${conversation?.type === TIM.TYPES.CONV_SYSTEM ? 'system' : ''}`}>
75
+ {conversation?.type !== TIM.TYPES.CONV_SYSTEM && <Avatar size={32} image={avatar} />}
76
+ <div className="header-content">
77
+ <h3 className="title">{title}</h3>
78
+ </div>
79
+ </div>
80
+ <div className="tui-chat-header-right">
81
+ <div className="header-handle">
82
+ <Icon className="header-handle-more" onClick={openTUIManage} type={IconTypes.ELLIPSE} width={18} height={5} />
83
+ </div>
84
+ </div>
85
+
86
+ </header>
87
+ );
88
+ }
89
+
90
+ const MemoizedTUIChatHeaderDefault = React.memo(TUIChatHeaderDefaultWithContext) as
91
+ typeof TUIChatHeaderDefaultWithContext;
92
+
93
+ export function TUIChatHeaderDefault(props: TUIChatHeaderDefaultProps)
94
+ :React.ReactElement {
95
+ const options = { ...props };
96
+ return <MemoizedTUIChatHeaderDefault {...options} />;
97
+ }
@@ -0,0 +1,2 @@
1
+ export * from './TUIChatHeader';
2
+ export * from './TUIChatHeaderDefault';
@@ -0,0 +1,3 @@
1
+ .tui-chat-header {
2
+ background: #FFFFFF;
3
+ }
@@ -0,0 +1,2 @@
1
+ @import "./layout.scss";
2
+ @import "./color.scss";
@@ -0,0 +1,32 @@
1
+ .tui-chat-header {
2
+ padding: 16px 20px;
3
+ display: flex;
4
+ flex-direction: row;
5
+ justify-content: space-between;
6
+ align-items: center;
7
+ &-left {
8
+ display: flex;
9
+ align-items: center;
10
+ .header-content {
11
+ padding: 0 8px;
12
+ }
13
+
14
+ }
15
+ &-right {
16
+ .header-handle {
17
+ &-more {
18
+ padding: 10px 3px;
19
+ }
20
+ }
21
+ }
22
+ .title {
23
+ font-family: 'SF Pro Text';
24
+ font-style: normal;
25
+ font-weight: 700;
26
+ font-size: 14px;
27
+ line-height: 17px;
28
+ }
29
+ .system {
30
+ height: 32px;
31
+ }
32
+ }
@@ -0,0 +1,44 @@
1
+ import React, { PropsWithChildren, useMemo } from 'react';
2
+ import { TUIConversationProvider, TUIConversationContextValue } from '../../context/TUIConversationContext';
3
+ import { TUIConversationList } from '../TUIConversationList';
4
+ import { TUIProfile } from '../TUIProfile';
5
+
6
+ interface TUIConversationProps {
7
+ createConversation?:(conversationID:string) => Promise<any>,
8
+ deleteConversation?:(conversationID:string) => Promise<any>,
9
+ }
10
+
11
+ export function UnMemoizedTUIConversation<T extends TUIConversationProps>(
12
+ props: PropsWithChildren<T>,
13
+ ):React.ReactElement {
14
+ const {
15
+ children,
16
+ createConversation,
17
+ deleteConversation,
18
+ } = props;
19
+ const TUIConversationValue: TUIConversationContextValue = useMemo(
20
+ () => ({
21
+ createConversation,
22
+ deleteConversation,
23
+ }),
24
+ [
25
+ createConversation,
26
+ deleteConversation,
27
+ ],
28
+ );
29
+
30
+ return (
31
+ <TUIConversationProvider value={TUIConversationValue}>
32
+ {children || (
33
+ <>
34
+ <TUIConversationList />
35
+ <TUIProfile />
36
+ </>
37
+ )}
38
+ </TUIConversationProvider>
39
+ );
40
+ }
41
+
42
+ export const TUIConversation = React.memo(
43
+ UnMemoizedTUIConversation,
44
+ )as typeof UnMemoizedTUIConversation;
@@ -0,0 +1 @@
1
+ export * from './TUIConversation';
@@ -0,0 +1,142 @@
1
+ import React, { useRef, useState } from 'react';
2
+ import { Conversation } from 'tim-js-sdk';
3
+ import { useTUIKitContext } from '../../context';
4
+ import useConversationList from './hooks/useConversationList';
5
+ import './index.scss';
6
+ import { ConversationPreview, ConversationPreviewUIComponentProps } from '../ConversationPreview';
7
+ import {
8
+ ConversationListContainer,
9
+ ConversationListContainerProps,
10
+ } from '../ConversationPreview/ConversationListContainer';
11
+ import { Profile } from '../Profile';
12
+ import { ConversationSearchInput, ConversationSearchResult } from '../ConversationSearch';
13
+ import { ConversationCreate } from '../ConversationCreate';
14
+ import { Icon, IconTypes } from '../Icon';
15
+ import { getDisplayTitle } from '../ConversationPreview/utils';
16
+ import { useConversationUpdate } from './hooks/useConversationUpdate';
17
+
18
+ interface Props {
19
+ filters?: object,
20
+ sort?: object,
21
+ options?: object,
22
+ Preview?: React.ComponentType<ConversationPreviewUIComponentProps>,
23
+ Container?: React.ComponentType<ConversationListContainerProps>,
24
+ onConversationListUpdated?: (
25
+ setConversationList: React.Dispatch<React.SetStateAction<Array<Conversation>>>,
26
+ event: () => void
27
+ ) => void,
28
+ }
29
+ export function UnMemoTUIConversationList<T extends Props>(props: T):React.ReactElement {
30
+ const {
31
+ Preview,
32
+ Container = ConversationListContainer,
33
+ onConversationListUpdated,
34
+ } = props;
35
+ const {
36
+ tim, customClasses, conversation, setActiveConversation, setTUIProfileShow,
37
+ } = useTUIKitContext('TUIConversationList');
38
+ const [conversationUpdateCount, setConversationUpdateCount] = useState(0);
39
+ const forceUpdate = () => setConversationUpdateCount((count) => count + 1);
40
+
41
+ const activeConversationHandler = (
42
+ conversationList: Array<Conversation>,
43
+ setConversationList: React.Dispatch<React.SetStateAction<Array<Conversation>>>,
44
+ ) => {
45
+ if (!conversationList.length) {
46
+ return;
47
+ }
48
+ setActiveConversation(conversation);
49
+ };
50
+ const {
51
+ conversationList,
52
+ setConversationList,
53
+ } = useConversationList(tim, activeConversationHandler);
54
+ useConversationUpdate(setConversationList, onConversationListUpdated, forceUpdate);
55
+ const [searchValue, setSearchValue] = useState('');
56
+ const [searchResult, setSearchResult] = useState(conversationList);
57
+ const [conversationCreated, setConversationCreated] = useState(false);
58
+
59
+ const handleSearchValueChange = (e) => {
60
+ setSearchValue(e.target?.value);
61
+ if (e.target?.value) {
62
+ const result = conversationList.filter(
63
+ // eslint-disable-next-line max-len
64
+ (item) => (getDisplayTitle(item) as string).toLocaleLowerCase().includes(e.target?.value.toLocaleLowerCase()),
65
+ );
66
+ setSearchResult(result);
67
+ } else {
68
+ setSearchResult([]);
69
+ }
70
+ };
71
+
72
+ const handleConversationCreate = () => {
73
+ setSearchValue('');
74
+ setConversationCreated(true);
75
+ };
76
+ const { myProfile } = useTUIKitContext();
77
+ const conversationListRef = useRef(null);
78
+ return (
79
+ <div className={`tui-conversation ${customClasses || ''}`} ref={conversationListRef}>
80
+ {
81
+ conversationCreated
82
+ ? (
83
+ <ConversationCreate
84
+ conversationList={conversationList}
85
+ setConversationCreated={setConversationCreated}
86
+ />
87
+ )
88
+ : (
89
+ <>
90
+ <Profile profile={myProfile} handleAvatar={() => { setTUIProfileShow(true); }} />
91
+ <div className="tui-conversation-header">
92
+ <ConversationSearchInput
93
+ value={searchValue}
94
+ clearable
95
+ onChange={handleSearchValueChange}
96
+ />
97
+ <div className="tui-conversation-create-icon">
98
+ <Icon
99
+ onClick={handleConversationCreate}
100
+ type={IconTypes.CREATE}
101
+ height={24}
102
+ width={24}
103
+ />
104
+ </div>
105
+ </div>
106
+ <Container setConversationList={setConversationList}>
107
+ {/* eslint-disable-next-line no-nested-ternary */}
108
+ {conversationList.length === 0
109
+ ? (
110
+ <div className="no-result">
111
+ <Icon className="no-result-icon" type={IconTypes.EFFORT} width={42} height={42} />
112
+ <div className="no-result-message">No conversation</div>
113
+ </div>
114
+ )
115
+ : searchValue
116
+ ? (
117
+ <ConversationSearchResult
118
+ Preview={Preview}
119
+ searchValue={searchValue}
120
+ result={searchResult}
121
+ />
122
+ )
123
+ : conversationList.map((item) => {
124
+ const previewProps = {
125
+ activeConversation: conversation,
126
+ conversation: item,
127
+ setActiveConversation,
128
+ Preview,
129
+ conversationUpdateCount,
130
+ };
131
+ return (
132
+ <ConversationPreview key={item.conversationID} {...previewProps} />
133
+ );
134
+ })}
135
+ </Container>
136
+ </>
137
+ )
138
+ }
139
+ </div>
140
+ );
141
+ }
142
+ export const TUIConversationList = React.memo(UnMemoTUIConversationList);
@@ -0,0 +1,41 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import TIM, { ChatSDK, Conversation } from 'tim-js-sdk';
3
+
4
+ function useConversationList(
5
+ tim: ChatSDK,
6
+ activeConversationHandler?:(
7
+ conversationList: Array<Conversation>,
8
+ setConversationList: React.Dispatch<React.SetStateAction<Array<Conversation>>>,
9
+ ) => void,
10
+ ) {
11
+ const [conversationList, setConversationList] = useState<Array<Conversation>>([]);
12
+ const queryConversation = async (queryType?: string) => {
13
+ if (queryType === 'reload') {
14
+ setConversationList([]);
15
+ }
16
+ const offset = queryType === 'reload' ? 0 : conversationList.length;
17
+
18
+ const res = await tim?.getConversationList();
19
+ if (res?.code === 0) {
20
+ const resConversationList = res.data.conversationList.filter(
21
+ (item) => item.type !== TIM.TYPES.CONV_SYSTEM,
22
+ );
23
+ const newConversationList = queryType === 'reload'
24
+ ? resConversationList
25
+ : [...conversationList, resConversationList];
26
+ setConversationList(newConversationList);
27
+ if (!offset && activeConversationHandler) {
28
+ activeConversationHandler(newConversationList, setConversationList);
29
+ }
30
+ }
31
+ };
32
+ useEffect(() => {
33
+ queryConversation('reload');
34
+ }, [tim]);
35
+ return {
36
+ conversationList,
37
+ setConversationList,
38
+ };
39
+ }
40
+
41
+ export default useConversationList;
@@ -0,0 +1,33 @@
1
+ import React, { useEffect } from 'react';
2
+ import TIM, { Conversation } from 'tim-js-sdk';
3
+ import { useTUIKitContext } from '../../../context';
4
+
5
+ export const useConversationUpdate = (
6
+ setConversationList?: React.Dispatch<React.SetStateAction<Array<Conversation>>>,
7
+ customHandler?: (
8
+ setConversationList: React.Dispatch<React.SetStateAction<Array<Conversation>>>,
9
+ event: any
10
+ ) => void,
11
+ forceUpdate?: () => void,
12
+ ) => {
13
+ const { tim } = useTUIKitContext('useConversationUpdate');
14
+ useEffect(() => {
15
+ const onConversationListUpdated = (event:any) => {
16
+ if (setConversationList) {
17
+ setConversationList(event.data.filter(
18
+ (item) => item.type !== TIM.TYPES.CONV_SYSTEM,
19
+ ));
20
+ }
21
+ if (forceUpdate) {
22
+ forceUpdate();
23
+ }
24
+ if (customHandler && typeof customHandler === 'function') {
25
+ customHandler(setConversationList, event);
26
+ }
27
+ };
28
+ tim?.on(TIM.EVENT.CONVERSATION_LIST_UPDATED, onConversationListUpdated);
29
+ return () => {
30
+ tim?.off(TIM.EVENT.CONVERSATION_LIST_UPDATED, onConversationListUpdated);
31
+ };
32
+ }, [tim, customHandler]);
33
+ };
@@ -0,0 +1,36 @@
1
+ .tui-conversation {
2
+ height: 100%;
3
+ min-width: 360px;
4
+ max-width: 400px;
5
+ width: 30%;
6
+ display: flex;
7
+ flex-direction: column;
8
+ position: relative;
9
+ border-right: 1px solid #F9FAFB;
10
+ text-align: initial;
11
+ .tui-conversation-header {
12
+ display: flex;
13
+ padding: 10px 20px;
14
+ .tui-conversation-create-icon {
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ margin-left: 10px;
19
+ }
20
+ }
21
+ .no-result {
22
+ padding: 0 20px;
23
+ display: flex;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ &-icon {
27
+ margin: 100px auto 50px;
28
+ }
29
+ &-message {
30
+ color: #999999;
31
+ font-weight: 400;
32
+ font-size: 16px;
33
+ line-height: 22px;
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,2 @@
1
+ export * from './TUIConversationList';
2
+ export * from './hooks/useConversationList';
@@ -0,0 +1,56 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { ChatSDK } from 'tim-js-sdk';
3
+ import { useTUIKit } from './hooks/useTUIKit';
4
+ import { useCreateTUIKitContext } from './hooks/useCreateTUIKitContext';
5
+ import { TUIKitProvider } from '../../context/TUIKitContext';
6
+ import './styles/index.scss';
7
+ import { TUIConversation } from '../TUIConversation';
8
+ import { TUIChat } from '../TUIChat';
9
+ import { TUIManage } from '../TUIManage';
10
+
11
+ export interface ChatProps {
12
+ tim?: ChatSDK | null,
13
+ customClasses?: unknown
14
+ }
15
+ export function TUIKit<
16
+ T extends ChatProps
17
+ >(
18
+ props:PropsWithChildren<T>,
19
+ ):React.ReactElement {
20
+ const { children, tim, customClasses } = props;
21
+ (window as any).tencent_cloud_im_csig_react_uikit_23F_xa = true;
22
+ const {
23
+ conversation,
24
+ setActiveConversation,
25
+ myProfile,
26
+ TUIManageShow,
27
+ setTUIManageShow,
28
+ TUIProfileShow,
29
+ setTUIProfileShow,
30
+ } = useTUIKit({ tim });
31
+ const chatContextValue = useCreateTUIKitContext({
32
+ tim,
33
+ conversation,
34
+ setActiveConversation,
35
+ customClasses,
36
+ myProfile,
37
+ TUIManageShow,
38
+ setTUIManageShow,
39
+ TUIProfileShow,
40
+ setTUIProfileShow,
41
+ });
42
+
43
+ return (
44
+ <TUIKitProvider value={chatContextValue}>
45
+ <div className="tui-kit">
46
+ {children || (
47
+ <>
48
+ <TUIConversation />
49
+ <TUIChat />
50
+ <TUIManage />
51
+ </>
52
+ )}
53
+ </div>
54
+ </TUIKitProvider>
55
+ );
56
+ }
@@ -0,0 +1,40 @@
1
+ import React, { useMemo } from 'react';
2
+ import { TUIKitContextValue } from '../../../context/TUIKitContext';
3
+
4
+ export const useCreateTUIKitContext = (value:TUIKitContextValue) => {
5
+ const {
6
+ tim,
7
+ conversation,
8
+ customClasses,
9
+ setActiveConversation,
10
+ myProfile,
11
+ TUIManageShow,
12
+ setTUIManageShow,
13
+ TUIProfileShow,
14
+ setTUIProfileShow,
15
+ } = value;
16
+
17
+ const TUIKitContext = useMemo(
18
+ () => ({
19
+ tim,
20
+ conversation,
21
+ customClasses,
22
+ setActiveConversation,
23
+ myProfile,
24
+ TUIManageShow,
25
+ setTUIManageShow,
26
+ TUIProfileShow,
27
+ setTUIProfileShow,
28
+ }),
29
+ [
30
+ conversation,
31
+ customClasses,
32
+ tim,
33
+ TUIManageShow,
34
+ TUIProfileShow,
35
+ setTUIProfileShow,
36
+ myProfile,
37
+ ],
38
+ );
39
+ return TUIKitContext;
40
+ };