@droppii-org/chat-sdk 0.1.72 → 0.1.74

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/dist/components/conversation-detail/ConversationDetailInput.d.ts.map +1 -1
  2. package/dist/components/conversation-detail/ConversationDetailInput.js +6 -2
  3. package/dist/components/conversation-detail/PinnedMessageBar.d.ts.map +1 -1
  4. package/dist/components/conversation-detail/PinnedMessageBar.js +23 -20
  5. package/dist/components/conversation-detail/PinnedMessageItem.d.ts.map +1 -1
  6. package/dist/components/conversation-detail/PinnedMessageItem.js +1 -5
  7. package/dist/hooks/conversation/useBotMainMenu.d.ts +0 -1
  8. package/dist/hooks/conversation/useBotMainMenu.d.ts.map +1 -1
  9. package/dist/hooks/conversation/useBotMainMenu.js +0 -10
  10. package/dist/hooks/conversation/useSwitchToCsTeam.d.ts +6 -1
  11. package/dist/hooks/conversation/useSwitchToCsTeam.d.ts.map +1 -1
  12. package/dist/hooks/conversation/useSwitchToCsTeam.js +9 -4
  13. package/dist/hooks/message/useMessage.d.ts.map +1 -1
  14. package/dist/hooks/message/useMessage.js +21 -5
  15. package/dist/index.d.ts +5 -6
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +5 -5
  18. package/dist/services/query.d.ts +0 -1
  19. package/dist/services/query.d.ts.map +1 -1
  20. package/dist/services/query.js +0 -1
  21. package/dist/styles/global.css +1 -1
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +127 -126
  24. package/dist/assets/svg/cannedResponse.d.ts +0 -7
  25. package/dist/assets/svg/cannedResponse.d.ts.map +0 -1
  26. package/dist/assets/svg/cannedResponse.js +0 -3
  27. package/dist/assets/svg/cannedResponse.tsx +0 -48
  28. package/dist/assets/svg/expand.d.ts +0 -7
  29. package/dist/assets/svg/expand.d.ts.map +0 -1
  30. package/dist/assets/svg/expand.js +0 -2
  31. package/dist/assets/svg/expand.tsx +0 -44
  32. package/dist/components/biz-inbox/BizInboxHeader.d.ts +0 -3
  33. package/dist/components/biz-inbox/BizInboxHeader.d.ts.map +0 -1
  34. package/dist/components/biz-inbox/BizInboxHeader.js +0 -8
  35. package/dist/components/biz-inbox/BizThreadAvatar.d.ts +0 -11
  36. package/dist/components/biz-inbox/BizThreadAvatar.d.ts.map +0 -1
  37. package/dist/components/biz-inbox/BizThreadAvatar.js +0 -12
  38. package/dist/components/biz-inbox/BizThreadCard.d.ts +0 -8
  39. package/dist/components/biz-inbox/BizThreadCard.d.ts.map +0 -1
  40. package/dist/components/biz-inbox/BizThreadCard.js +0 -30
  41. package/dist/components/biz-inbox/BizThreadList.d.ts +0 -12
  42. package/dist/components/biz-inbox/BizThreadList.d.ts.map +0 -1
  43. package/dist/components/biz-inbox/BizThreadList.js +0 -36
  44. package/dist/components/biz-inbox/BizThreadTitle.d.ts +0 -10
  45. package/dist/components/biz-inbox/BizThreadTitle.d.ts.map +0 -1
  46. package/dist/components/biz-inbox/BizThreadTitle.js +0 -10
  47. package/dist/components/biz-inbox/index.d.ts +0 -10
  48. package/dist/components/biz-inbox/index.d.ts.map +0 -1
  49. package/dist/components/biz-inbox/index.js +0 -5
  50. package/dist/components/biz-thread-detail/BizAttachmentPreview.d.ts +0 -9
  51. package/dist/components/biz-thread-detail/BizAttachmentPreview.d.ts.map +0 -1
  52. package/dist/components/biz-thread-detail/BizAttachmentPreview.js +0 -70
  53. package/dist/components/biz-thread-detail/BizImagePreview.d.ts +0 -9
  54. package/dist/components/biz-thread-detail/BizImagePreview.d.ts.map +0 -1
  55. package/dist/components/biz-thread-detail/BizImagePreview.js +0 -39
  56. package/dist/components/biz-thread-detail/BizImageViewer.d.ts +0 -8
  57. package/dist/components/biz-thread-detail/BizImageViewer.d.ts.map +0 -1
  58. package/dist/components/biz-thread-detail/BizImageViewer.js +0 -35
  59. package/dist/components/biz-thread-detail/BizLinkInputPreview.d.ts +0 -7
  60. package/dist/components/biz-thread-detail/BizLinkInputPreview.d.ts.map +0 -1
  61. package/dist/components/biz-thread-detail/BizLinkInputPreview.js +0 -16
  62. package/dist/components/biz-thread-detail/BizLinkMessageCard.d.ts +0 -7
  63. package/dist/components/biz-thread-detail/BizLinkMessageCard.d.ts.map +0 -1
  64. package/dist/components/biz-thread-detail/BizLinkMessageCard.js +0 -17
  65. package/dist/components/biz-thread-detail/BizLinkTextContent.d.ts +0 -6
  66. package/dist/components/biz-thread-detail/BizLinkTextContent.d.ts.map +0 -1
  67. package/dist/components/biz-thread-detail/BizLinkTextContent.js +0 -11
  68. package/dist/components/biz-thread-detail/BizMessageBubble.d.ts +0 -11
  69. package/dist/components/biz-thread-detail/BizMessageBubble.d.ts.map +0 -1
  70. package/dist/components/biz-thread-detail/BizMessageBubble.js +0 -15
  71. package/dist/components/biz-thread-detail/BizMessageContent.d.ts +0 -7
  72. package/dist/components/biz-thread-detail/BizMessageContent.d.ts.map +0 -1
  73. package/dist/components/biz-thread-detail/BizMessageContent.js +0 -125
  74. package/dist/components/biz-thread-detail/BizMessageList.d.ts +0 -7
  75. package/dist/components/biz-thread-detail/BizMessageList.d.ts.map +0 -1
  76. package/dist/components/biz-thread-detail/BizMessageList.js +0 -35
  77. package/dist/components/biz-thread-detail/BizMoreOptionItem.d.ts +0 -8
  78. package/dist/components/biz-thread-detail/BizMoreOptionItem.d.ts.map +0 -1
  79. package/dist/components/biz-thread-detail/BizMoreOptionItem.js +0 -19
  80. package/dist/components/biz-thread-detail/BizMoreOptionPanel.d.ts +0 -10
  81. package/dist/components/biz-thread-detail/BizMoreOptionPanel.d.ts.map +0 -1
  82. package/dist/components/biz-thread-detail/BizMoreOptionPanel.js +0 -20
  83. package/dist/components/biz-thread-detail/BizThreadDetailHeader.d.ts +0 -8
  84. package/dist/components/biz-thread-detail/BizThreadDetailHeader.d.ts.map +0 -1
  85. package/dist/components/biz-thread-detail/BizThreadDetailHeader.js +0 -19
  86. package/dist/components/biz-thread-detail/BizThreadDetailInput.d.ts +0 -8
  87. package/dist/components/biz-thread-detail/BizThreadDetailInput.d.ts.map +0 -1
  88. package/dist/components/biz-thread-detail/BizThreadDetailInput.js +0 -251
  89. package/dist/components/biz-thread-detail/BizVideoViewer.d.ts +0 -8
  90. package/dist/components/biz-thread-detail/BizVideoViewer.d.ts.map +0 -1
  91. package/dist/components/biz-thread-detail/BizVideoViewer.js +0 -103
  92. package/dist/components/biz-thread-detail/bot/BotButtonMessage.d.ts +0 -10
  93. package/dist/components/biz-thread-detail/bot/BotButtonMessage.d.ts.map +0 -1
  94. package/dist/components/biz-thread-detail/bot/BotButtonMessage.js +0 -30
  95. package/dist/components/biz-thread-detail/bot/BotFlowContext.d.ts +0 -10
  96. package/dist/components/biz-thread-detail/bot/BotFlowContext.d.ts.map +0 -1
  97. package/dist/components/biz-thread-detail/bot/BotFlowContext.js +0 -11
  98. package/dist/components/biz-thread-detail/bot/BotStartButton.d.ts +0 -8
  99. package/dist/components/biz-thread-detail/bot/BotStartButton.d.ts.map +0 -1
  100. package/dist/components/biz-thread-detail/bot/BotStartButton.js +0 -11
  101. package/dist/components/biz-thread-detail/bot/index.d.ts +0 -5
  102. package/dist/components/biz-thread-detail/bot/index.d.ts.map +0 -1
  103. package/dist/components/biz-thread-detail/bot/index.js +0 -2
  104. package/dist/components/biz-thread-detail/index.d.ts +0 -10
  105. package/dist/components/biz-thread-detail/index.d.ts.map +0 -1
  106. package/dist/components/biz-thread-detail/index.js +0 -5
  107. package/dist/components/biz-thread-detail/item/BizMessageItem.d.ts +0 -9
  108. package/dist/components/biz-thread-detail/item/BizMessageItem.d.ts.map +0 -1
  109. package/dist/components/biz-thread-detail/item/BizMessageItem.js +0 -27
  110. package/dist/components/bizInbox/BizCommunityTabPlaceholder.d.ts +0 -3
  111. package/dist/components/bizInbox/BizCommunityTabPlaceholder.d.ts.map +0 -1
  112. package/dist/components/bizInbox/BizCommunityTabPlaceholder.js +0 -10
  113. package/dist/components/bizInbox/BizContactListSkeleton.d.ts +0 -6
  114. package/dist/components/bizInbox/BizContactListSkeleton.d.ts.map +0 -1
  115. package/dist/components/bizInbox/BizContactListSkeleton.js +0 -8
  116. package/dist/components/bizInbox/BizCreateGroupButton.d.ts +0 -7
  117. package/dist/components/bizInbox/BizCreateGroupButton.d.ts.map +0 -1
  118. package/dist/components/bizInbox/BizCreateGroupButton.js +0 -11
  119. package/dist/components/bizInbox/BizInboxHeader.d.ts +0 -3
  120. package/dist/components/bizInbox/BizInboxHeader.d.ts.map +0 -1
  121. package/dist/components/bizInbox/BizInboxHeader.js +0 -8
  122. package/dist/components/bizInbox/BizInboxTabs.d.ts +0 -8
  123. package/dist/components/bizInbox/BizInboxTabs.d.ts.map +0 -1
  124. package/dist/components/bizInbox/BizInboxTabs.js +0 -27
  125. package/dist/components/bizInbox/BizSearchInput.d.ts +0 -9
  126. package/dist/components/bizInbox/BizSearchInput.d.ts.map +0 -1
  127. package/dist/components/bizInbox/BizSearchInput.js +0 -24
  128. package/dist/components/bizInbox/BizThreadAvatar.d.ts +0 -10
  129. package/dist/components/bizInbox/BizThreadAvatar.d.ts.map +0 -1
  130. package/dist/components/bizInbox/BizThreadAvatar.js +0 -8
  131. package/dist/components/bizInbox/BizThreadCard.d.ts +0 -8
  132. package/dist/components/bizInbox/BizThreadCard.d.ts.map +0 -1
  133. package/dist/components/bizInbox/BizThreadCard.js +0 -25
  134. package/dist/components/bizInbox/BizThreadList.d.ts +0 -11
  135. package/dist/components/bizInbox/BizThreadList.d.ts.map +0 -1
  136. package/dist/components/bizInbox/BizThreadList.js +0 -35
  137. package/dist/components/bizInbox/BizThreadTitle.d.ts +0 -8
  138. package/dist/components/bizInbox/BizThreadTitle.d.ts.map +0 -1
  139. package/dist/components/bizInbox/BizThreadTitle.js +0 -6
  140. package/dist/components/bizInbox/index.d.ts +0 -10
  141. package/dist/components/bizInbox/index.d.ts.map +0 -1
  142. package/dist/components/bizInbox/index.js +0 -5
  143. package/dist/components/bizInbox/states/BizThreadListEmpty.d.ts +0 -7
  144. package/dist/components/bizInbox/states/BizThreadListEmpty.d.ts.map +0 -1
  145. package/dist/components/bizInbox/states/BizThreadListEmpty.js +0 -15
  146. package/dist/components/bizInbox/states/BizThreadListError.d.ts +0 -6
  147. package/dist/components/bizInbox/states/BizThreadListError.d.ts.map +0 -1
  148. package/dist/components/bizInbox/states/BizThreadListError.js +0 -11
  149. package/dist/components/bizInbox/states/BizThreadListLoading.d.ts +0 -6
  150. package/dist/components/bizInbox/states/BizThreadListLoading.d.ts.map +0 -1
  151. package/dist/components/bizInbox/states/BizThreadListLoading.js +0 -8
  152. package/dist/components/bizThreadDetail/BizMessageBubble.d.ts +0 -10
  153. package/dist/components/bizThreadDetail/BizMessageBubble.d.ts.map +0 -1
  154. package/dist/components/bizThreadDetail/BizMessageBubble.js +0 -15
  155. package/dist/components/bizThreadDetail/BizMessageList.d.ts +0 -3
  156. package/dist/components/bizThreadDetail/BizMessageList.d.ts.map +0 -1
  157. package/dist/components/bizThreadDetail/BizMessageList.js +0 -28
  158. package/dist/components/bizThreadDetail/BizThreadDetailHeader.d.ts +0 -8
  159. package/dist/components/bizThreadDetail/BizThreadDetailHeader.d.ts.map +0 -1
  160. package/dist/components/bizThreadDetail/BizThreadDetailHeader.js +0 -18
  161. package/dist/components/bizThreadDetail/BizThreadDetailInput.d.ts +0 -8
  162. package/dist/components/bizThreadDetail/BizThreadDetailInput.d.ts.map +0 -1
  163. package/dist/components/bizThreadDetail/BizThreadDetailInput.js +0 -147
  164. package/dist/components/bizThreadDetail/index.d.ts +0 -8
  165. package/dist/components/bizThreadDetail/index.d.ts.map +0 -1
  166. package/dist/components/bizThreadDetail/index.js +0 -4
  167. package/dist/components/bizThreadDetail/item/BizMessageItem.d.ts +0 -8
  168. package/dist/components/bizThreadDetail/item/BizMessageItem.d.ts.map +0 -1
  169. package/dist/components/bizThreadDetail/item/BizMessageItem.js +0 -20
  170. package/dist/components/cannedResponse/CannedResponseBody.d.ts +0 -8
  171. package/dist/components/cannedResponse/CannedResponseBody.d.ts.map +0 -1
  172. package/dist/components/cannedResponse/CannedResponseBody.js +0 -109
  173. package/dist/components/cannedResponse/CannedResponseFooter.d.ts +0 -6
  174. package/dist/components/cannedResponse/CannedResponseFooter.d.ts.map +0 -1
  175. package/dist/components/cannedResponse/CannedResponseFooter.js +0 -8
  176. package/dist/components/cannedResponse/CannedResponseHeader.d.ts +0 -8
  177. package/dist/components/cannedResponse/CannedResponseHeader.d.ts.map +0 -1
  178. package/dist/components/cannedResponse/CannedResponseHeader.js +0 -11
  179. package/dist/components/cannedResponse/index.d.ts +0 -8
  180. package/dist/components/cannedResponse/index.d.ts.map +0 -1
  181. package/dist/components/cannedResponse/index.js +0 -34
  182. package/dist/components/cannedResponse/team/TeamItem.d.ts +0 -11
  183. package/dist/components/cannedResponse/team/TeamItem.d.ts.map +0 -1
  184. package/dist/components/cannedResponse/team/TeamItem.js +0 -31
  185. package/dist/components/chatBubble/ChatBubble.d.ts +0 -6
  186. package/dist/components/chatBubble/ChatBubble.d.ts.map +0 -1
  187. package/dist/components/chatBubble/ChatBubble.js +0 -35
  188. package/dist/components/mediaCollection/FileCollection.d.ts +0 -3
  189. package/dist/components/mediaCollection/FileCollection.d.ts.map +0 -1
  190. package/dist/components/mediaCollection/FileCollection.js +0 -53
  191. package/dist/components/mediaCollection/ImageCollection.d.ts +0 -3
  192. package/dist/components/mediaCollection/ImageCollection.d.ts.map +0 -1
  193. package/dist/components/mediaCollection/ImageCollection.js +0 -52
  194. package/dist/components/mediaCollection/LinkCollection.d.ts +0 -5
  195. package/dist/components/mediaCollection/LinkCollection.d.ts.map +0 -1
  196. package/dist/components/mediaCollection/LinkCollection.js +0 -92
  197. package/dist/components/mediaCollection/VideoCollection.d.ts +0 -3
  198. package/dist/components/mediaCollection/VideoCollection.d.ts.map +0 -1
  199. package/dist/components/mediaCollection/VideoCollection.js +0 -51
  200. package/dist/components/mediaCollection/index.d.ts +0 -9
  201. package/dist/components/mediaCollection/index.d.ts.map +0 -1
  202. package/dist/components/mediaCollection/index.js +0 -57
  203. package/dist/components/message/footer/QuotedMessage.d.ts +0 -2
  204. package/dist/components/message/footer/QuotedMessage.d.ts.map +0 -1
  205. package/dist/components/message/footer/QuotedMessage.js +0 -24
  206. package/dist/components/richTextEditor/RichTextEditor.d.ts +0 -12
  207. package/dist/components/richTextEditor/RichTextEditor.d.ts.map +0 -1
  208. package/dist/components/richTextEditor/RichTextEditor.js +0 -62
  209. package/dist/components/searchConversation/SearchAll.d.ts +0 -8
  210. package/dist/components/searchConversation/SearchAll.d.ts.map +0 -1
  211. package/dist/components/searchConversation/SearchAll.js +0 -37
  212. package/dist/components/searchConversation/SearchConversationAsMessages.d.ts +0 -6
  213. package/dist/components/searchConversation/SearchConversationAsMessages.d.ts.map +0 -1
  214. package/dist/components/searchConversation/SearchConversationAsMessages.js +0 -23
  215. package/dist/components/searchConversation/SearchConversationAsUsers.d.ts +0 -6
  216. package/dist/components/searchConversation/SearchConversationAsUsers.d.ts.map +0 -1
  217. package/dist/components/searchConversation/SearchConversationAsUsers.js +0 -21
  218. package/dist/components/searchConversation/SearchConversationMyInbox.d.ts +0 -6
  219. package/dist/components/searchConversation/SearchConversationMyInbox.d.ts.map +0 -1
  220. package/dist/components/searchConversation/SearchConversationMyInbox.js +0 -24
  221. package/dist/components/searchConversation/SearchDrawer.d.ts +0 -3
  222. package/dist/components/searchConversation/SearchDrawer.d.ts.map +0 -1
  223. package/dist/components/searchConversation/SearchDrawer.js +0 -33
  224. package/dist/components/searchConversation/SearchMessageOnCurrentConversation.d.ts +0 -7
  225. package/dist/components/searchConversation/SearchMessageOnCurrentConversation.d.ts.map +0 -1
  226. package/dist/components/searchConversation/SearchMessageOnCurrentConversation.js +0 -28
  227. package/dist/components/searchConversation/index.d.ts +0 -12
  228. package/dist/components/searchConversation/index.d.ts.map +0 -1
  229. package/dist/components/searchConversation/index.js +0 -46
  230. package/dist/components/searchConversation/item/SearchItemAsMessage.d.ts +0 -12
  231. package/dist/components/searchConversation/item/SearchItemAsMessage.d.ts.map +0 -1
  232. package/dist/components/searchConversation/item/SearchItemAsMessage.js +0 -72
  233. package/dist/components/searchConversation/item/SearchItemAsUser.d.ts +0 -8
  234. package/dist/components/searchConversation/item/SearchItemAsUser.d.ts.map +0 -1
  235. package/dist/components/searchConversation/item/SearchItemAsUser.js +0 -25
  236. package/dist/constants/bizInbox.d.ts +0 -37
  237. package/dist/constants/bizInbox.d.ts.map +0 -1
  238. package/dist/constants/bizInbox.js +0 -35
  239. package/dist/constants/bizMoreOption.d.ts +0 -9
  240. package/dist/constants/bizMoreOption.d.ts.map +0 -1
  241. package/dist/constants/bizMoreOption.js +0 -37
  242. package/dist/hooks/biz/index.d.ts +0 -8
  243. package/dist/hooks/biz/index.d.ts.map +0 -1
  244. package/dist/hooks/biz/index.js +0 -5
  245. package/dist/hooks/biz/useBizActiveConversation.d.ts +0 -3
  246. package/dist/hooks/biz/useBizActiveConversation.d.ts.map +0 -1
  247. package/dist/hooks/biz/useBizActiveConversation.js +0 -38
  248. package/dist/hooks/biz/useBizConversationList.d.ts +0 -15
  249. package/dist/hooks/biz/useBizConversationList.d.ts.map +0 -1
  250. package/dist/hooks/biz/useBizConversationList.js +0 -48
  251. package/dist/hooks/biz/useBizConversationListItems.d.ts +0 -8
  252. package/dist/hooks/biz/useBizConversationListItems.d.ts.map +0 -1
  253. package/dist/hooks/biz/useBizConversationListItems.js +0 -14
  254. package/dist/hooks/biz/useBizGlobalEvent.d.ts +0 -2
  255. package/dist/hooks/biz/useBizGlobalEvent.d.ts.map +0 -1
  256. package/dist/hooks/biz/useBizGlobalEvent.js +0 -72
  257. package/dist/hooks/biz/useBizSendMessage.d.ts +0 -4
  258. package/dist/hooks/biz/useBizSendMessage.d.ts.map +0 -1
  259. package/dist/hooks/biz/useBizSendMessage.js +0 -70
  260. package/dist/hooks/biz/useBotFlow.d.ts +0 -17
  261. package/dist/hooks/biz/useBotFlow.d.ts.map +0 -1
  262. package/dist/hooks/biz/useBotFlow.js +0 -127
  263. package/dist/hooks/biz/useConversationDetail.d.ts +0 -3
  264. package/dist/hooks/biz/useConversationDetail.d.ts.map +0 -1
  265. package/dist/hooks/biz/useConversationDetail.js +0 -18
  266. package/dist/hooks/biz/useCreateBizConversation.d.ts +0 -8
  267. package/dist/hooks/biz/useCreateBizConversation.d.ts.map +0 -1
  268. package/dist/hooks/biz/useCreateBizConversation.js +0 -15
  269. package/dist/hooks/biz/useResetBotFlow.d.ts +0 -3
  270. package/dist/hooks/biz/useResetBotFlow.d.ts.map +0 -1
  271. package/dist/hooks/biz/useResetBotFlow.js +0 -14
  272. package/dist/hooks/biz/useRunBotFlow.d.ts +0 -7
  273. package/dist/hooks/biz/useRunBotFlow.d.ts.map +0 -1
  274. package/dist/hooks/biz/useRunBotFlow.js +0 -14
  275. package/dist/hooks/cannedResponse/useFetchCannedCategories.d.ts +0 -3
  276. package/dist/hooks/cannedResponse/useFetchCannedCategories.d.ts.map +0 -1
  277. package/dist/hooks/cannedResponse/useFetchCannedCategories.js +0 -13
  278. package/dist/hooks/cannedResponse/useFetchCannedResponse.d.ts +0 -219
  279. package/dist/hooks/cannedResponse/useFetchCannedResponse.d.ts.map +0 -1
  280. package/dist/hooks/cannedResponse/useFetchCannedResponse.js +0 -55
  281. package/dist/hooks/common/useFetchExternalLink.d.ts +0 -2
  282. package/dist/hooks/common/useFetchExternalLink.d.ts.map +0 -1
  283. package/dist/hooks/common/useFetchExternalLink.js +0 -18
  284. package/dist/hooks/common/useIsSdkMessageReady.d.ts +0 -2
  285. package/dist/hooks/common/useIsSdkMessageReady.d.ts.map +0 -1
  286. package/dist/hooks/common/useIsSdkMessageReady.js +0 -7
  287. package/dist/hooks/conversation/useConversationPreview.d.ts +0 -12
  288. package/dist/hooks/conversation/useConversationPreview.d.ts.map +0 -1
  289. package/dist/hooks/conversation/useConversationPreview.js +0 -22
  290. package/dist/hooks/message/useSendCustomMessage.d.ts +0 -7
  291. package/dist/hooks/message/useSendCustomMessage.d.ts.map +0 -1
  292. package/dist/hooks/message/useSendCustomMessage.js +0 -5
  293. package/dist/locales/en/bizInbox.json +0 -41
  294. package/dist/locales/vi/biz-inbox.json +0 -39
  295. package/dist/locales/vi/bizInbox.json +0 -19
  296. package/dist/screens/biz-message/index.d.ts +0 -8
  297. package/dist/screens/biz-message/index.d.ts.map +0 -1
  298. package/dist/screens/biz-message/index.js +0 -30
  299. package/dist/screens/biz-thread-detail/index.d.ts +0 -9
  300. package/dist/screens/biz-thread-detail/index.d.ts.map +0 -1
  301. package/dist/screens/biz-thread-detail/index.js +0 -50
  302. package/dist/screens/bizMessage/index.d.ts +0 -9
  303. package/dist/screens/bizMessage/index.d.ts.map +0 -1
  304. package/dist/screens/bizMessage/index.js +0 -55
  305. package/dist/screens/bizThreadDetail/index.d.ts +0 -9
  306. package/dist/screens/bizThreadDetail/index.d.ts.map +0 -1
  307. package/dist/screens/bizThreadDetail/index.js +0 -36
  308. package/dist/screens/chatBubble/index.d.ts +0 -7
  309. package/dist/screens/chatBubble/index.d.ts.map +0 -1
  310. package/dist/screens/chatBubble/index.js +0 -41
  311. package/dist/screens/deskMessage/index.d.ts +0 -6
  312. package/dist/screens/deskMessage/index.d.ts.map +0 -1
  313. package/dist/screens/deskMessage/index.js +0 -17
  314. package/dist/services/biz/conversationService.d.ts +0 -3
  315. package/dist/services/biz/conversationService.d.ts.map +0 -1
  316. package/dist/services/biz/conversationService.js +0 -10
  317. package/dist/store/bizConversation.d.ts +0 -18
  318. package/dist/store/bizConversation.d.ts.map +0 -1
  319. package/dist/store/bizConversation.js +0 -35
  320. package/dist/store/bizMessageDraft.d.ts +0 -9
  321. package/dist/store/bizMessageDraft.d.ts.map +0 -1
  322. package/dist/store/bizMessageDraft.js +0 -35
  323. package/dist/store/pinnedMessage.d.ts +0 -4
  324. package/dist/store/pinnedMessage.d.ts.map +0 -1
  325. package/dist/store/pinnedMessage.js +0 -17
  326. package/dist/types/biz.d.ts +0 -128
  327. package/dist/types/biz.d.ts.map +0 -1
  328. package/dist/types/biz.js +0 -34
  329. package/dist/utils/bizConversation.d.ts +0 -15
  330. package/dist/utils/bizConversation.d.ts.map +0 -1
  331. package/dist/utils/bizConversation.js +0 -96
  332. package/dist/utils/bizLink.d.ts +0 -13
  333. package/dist/utils/bizLink.d.ts.map +0 -1
  334. package/dist/utils/bizLink.js +0 -77
  335. package/dist/utils/bizMessage.d.ts +0 -15
  336. package/dist/utils/bizMessage.d.ts.map +0 -1
  337. package/dist/utils/bizMessage.js +0 -93
  338. package/dist/utils/messageEx.d.ts +0 -5
  339. package/dist/utils/messageEx.d.ts.map +0 -1
  340. package/dist/utils/messageEx.js +0 -11
  341. package/dist/utils/openBizLink.d.ts +0 -3
  342. package/dist/utils/openBizLink.d.ts.map +0 -1
  343. package/dist/utils/openBizLink.js +0 -19
@@ -1,52 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { MessageType } from "@openim/wasm-client-sdk";
3
- import { useSearchMessage } from "../../hooks/search/useSearchMessage";
4
- import InfiniteScroll from "react-infinite-scroll-component";
5
- import { Button, Empty, Image, Spin } from "antd";
6
- import { useCallback } from "react";
7
- import dayjs from "dayjs";
8
- import useConversationStore from "../../store/conversation";
9
- import { images } from "../../constants/images";
10
- import { useTranslation } from "react-i18next";
11
- import { DownloadOutlined } from "@ant-design/icons";
12
- const ImageCollection = () => {
13
- const { t } = useTranslation();
14
- const selectedSourceId = useConversationStore((state) => state.selectedSourceId);
15
- const { groupedData, fetchNextPage, hasNextPage, dataFlatten, isLoading } = useSearchMessage({
16
- payload: {
17
- recvID: selectedSourceId,
18
- contentType: MessageType.PictureMessage,
19
- },
20
- });
21
- const handleDownload = (imageUrl) => {
22
- if (!imageUrl)
23
- return;
24
- const link = document.createElement("a");
25
- link.href = imageUrl;
26
- link.download = imageUrl.substring(imageUrl.lastIndexOf("/") + 1);
27
- document.body.appendChild(link);
28
- link.click();
29
- document.body.removeChild(link);
30
- };
31
- const renderItem = useCallback((date, items) => {
32
- return (_jsxs("div", { className: "mb-2", children: [_jsx("span", { className: "text-sm font-medium text-gray-500 px-3", children: dayjs(date).format("DD MMMM, YYYY") }), _jsx("div", { className: "grid grid-cols-3 justify-start gap-px py-2", children: items.map((item) => {
33
- var _a, _b, _c, _d;
34
- const imageContent = JSON.parse(((_a = item === null || item === void 0 ? void 0 : item.chatLog) === null || _a === void 0 ? void 0 : _a.content) || "{}");
35
- const sourceUrl = ((_b = imageContent.sourcePicture) === null || _b === void 0 ? void 0 : _b.url) ||
36
- ((_c = imageContent.snapshotPicture) === null || _c === void 0 ? void 0 : _c.url);
37
- return (_jsx("div", { className: "border inline-block w-full h-full aspect-square", children: _jsx(Image, { rootClassName: "cursor-pointer w-full h-full", className: "w-full !h-full object-cover", src: sourceUrl, preview: true, placeholder: _jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }), fallback: images.imageFailed }) }, (_d = item === null || item === void 0 ? void 0 : item.chatLog) === null || _d === void 0 ? void 0 : _d.clientMsgID));
38
- }) })] }, date));
39
- }, []);
40
- if (dataFlatten.length === 0 && !isLoading)
41
- return _jsx(Empty, { description: t("no_media_files") });
42
- if (isLoading)
43
- return (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }));
44
- return (_jsx("div", { id: "scrollableImageDiv", className: "h-full overflow-auto", children: _jsx(Image.PreviewGroup, { preview: {
45
- toolbarRender: (originalNode, info) => {
46
- var _a;
47
- const imageUrl = (_a = info === null || info === void 0 ? void 0 : info.image) === null || _a === void 0 ? void 0 : _a.url;
48
- return (_jsxs("div", { className: "flex flex-col justify-center gap-2", children: [originalNode, imageUrl && (_jsx(Button, { type: "primary", icon: _jsx(DownloadOutlined, {}), className: "self-center", onClick: () => handleDownload(imageUrl), children: t("download") }))] }));
49
- },
50
- }, children: _jsx(InfiniteScroll, { dataLength: dataFlatten.length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableImageDiv", children: Object.entries(groupedData).map(([date, items]) => renderItem(date, items)) }) }) }));
51
- };
52
- export default ImageCollection;
@@ -1,5 +0,0 @@
1
- declare const LinkCollection: ({ onClose }: {
2
- onClose: () => void;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
- export default LinkCollection;
5
- //# sourceMappingURL=LinkCollection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/LinkCollection.tsx"],"names":[],"mappings":"AA8DA,QAAA,MAAM,cAAc,GAAI,aAAa;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,4CAyH3D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,92 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Dropdown, Empty, Spin } from "antd";
3
- import { useTranslation } from "react-i18next";
4
- import useConversationStore from "../../store/conversation";
5
- import { useSearchMessage } from "../../hooks/search/useSearchMessage";
6
- import { useCallback, useEffect, useState } from "react";
7
- import dayjs from "dayjs";
8
- import InfiniteScroll from "react-infinite-scroll-component";
9
- import { MessageType, SessionType } from "@openim/wasm-client-sdk";
10
- import { Icon } from "../../components/icon";
11
- import { DChatSDK } from "../../constants/sdk";
12
- import { useChatContext } from "../../context/ChatContext";
13
- import { message as antdMessage } from "antd";
14
- const LinkPreview = ({ url }) => {
15
- const [title, setTitle] = useState("");
16
- const [isLoading, setIsLoading] = useState(true);
17
- useEffect(() => {
18
- if (!url)
19
- return;
20
- setIsLoading(true);
21
- fetch(`https://api.microlink.io?url=${encodeURIComponent(url)}`)
22
- .then((res) => res.json())
23
- .then((res) => {
24
- var _a;
25
- if ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.title) {
26
- setTitle(res.data.title);
27
- }
28
- })
29
- .catch(() => {
30
- setTitle("");
31
- })
32
- .finally(() => {
33
- setIsLoading(false);
34
- });
35
- }, [url]);
36
- return (_jsxs("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: "flex flex-col truncate text-blue-600 cursor-pointer", title: title || url, children: [isLoading && (_jsx("span", { className: "font-medium truncate text-gray-900", children: url })), !isLoading &&
37
- (title ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "font-medium truncate text-gray-900", children: title }), _jsx("span", { className: "text-sm text-gray-500 truncate", children: url })] })) : (_jsx("span", { className: "font-medium truncate text-gray-900", children: url })))] }));
38
- };
39
- const LinkCollection = ({ onClose }) => {
40
- const { t } = useTranslation();
41
- const selectedSourceId = useConversationStore((state) => state.selectedSourceId);
42
- const { user } = useChatContext();
43
- const onPressItem = async (message) => {
44
- const { data } = await DChatSDK.getOneConversation({
45
- sourceID: message.sessionType === SessionType.Group
46
- ? message.groupID
47
- : (user === null || user === void 0 ? void 0 : user.userID) !== message.sendID
48
- ? message.sendID
49
- : message.recvID,
50
- sessionType: message.sessionType,
51
- });
52
- if (!data) {
53
- return antdMessage.error(t("err_get_conversation"));
54
- }
55
- useConversationStore
56
- .getState()
57
- .setConversationData(data, message.clientMsgID);
58
- useConversationStore
59
- .getState()
60
- .setSelectedConversationId(data.conversationID);
61
- onClose();
62
- };
63
- const { groupedData, fetchNextPage, hasNextPage, dataFlatten, isLoading } = useSearchMessage({
64
- payload: {
65
- recvID: selectedSourceId,
66
- contentType: MessageType.UrlTextMessage,
67
- },
68
- });
69
- const renderItem = useCallback((date, items) => {
70
- return (_jsxs("div", { className: "px-3", children: [_jsx("span", { className: "text-sm font-medium text-gray-500 px-3", children: dayjs(date).format("DD MMMM, YYYY") }), _jsx("div", { className: "flex flex-col gap-1 mt-2", children: items.map((item) => {
71
- var _a, _b, _c;
72
- const urls = ((_b = JSON.parse(((_a = item === null || item === void 0 ? void 0 : item.chatLog) === null || _a === void 0 ? void 0 : _a.content) || "{}")) === null || _b === void 0 ? void 0 : _b.urls) || [];
73
- const menuItems = [
74
- {
75
- key: "open",
76
- label: t("view_message"),
77
- onClick: () => onPressItem(item.chatLog),
78
- },
79
- ];
80
- return (_jsx("div", { children: urls.map((url, index) => {
81
- var _a;
82
- return (_jsxs("div", { className: "bg-gray-100 flex gap-2 items-center p-2 mb-1", children: [_jsx("div", { className: "flex items-center justify-center shrink-0", children: _jsx(Icon, { icon: "link-b", size: 16 }) }), _jsx("div", { className: "flex-1 min-w-0", children: _jsx(LinkPreview, { url: url }) }), _jsx(Dropdown, { menu: { items: menuItems }, trigger: ["click"], placement: "bottomRight", children: _jsx("div", { className: "flex items-center justify-center shrink-0 cursor-pointer p-1 hover:bg-gray-200 rounded ml-2", onClick: (e) => e.stopPropagation(), children: _jsx(Icon, { icon: "more-horizontal-b", size: 16 }) }) })] }, `${(_a = item.chatLog) === null || _a === void 0 ? void 0 : _a.clientMsgID}-${index}`));
83
- }) }, (_c = item.chatLog) === null || _c === void 0 ? void 0 : _c.clientMsgID));
84
- }) })] }, date));
85
- }, []);
86
- if (dataFlatten.length === 0 && !isLoading)
87
- return _jsx(Empty, { description: t("no_media_files") });
88
- if (isLoading)
89
- return (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }));
90
- return (_jsx("div", { id: "scrollableFileDiv", className: "h-full overflow-auto", children: _jsx(InfiniteScroll, { dataLength: Object.keys(groupedData).length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableFileDiv", children: Object.entries(groupedData).map(([date, items]) => renderItem(date, items)) }) }));
91
- };
92
- export default LinkCollection;
@@ -1,3 +0,0 @@
1
- declare const VideoCollection: () => import("react/jsx-runtime").JSX.Element;
2
- export default VideoCollection;
3
- //# sourceMappingURL=VideoCollection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/VideoCollection.tsx"],"names":[],"mappings":"AAaA,QAAA,MAAM,eAAe,+CAyHpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,51 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { MessageType } from "@openim/wasm-client-sdk";
3
- import { useSearchMessage } from "../../hooks/search/useSearchMessage";
4
- import InfiniteScroll from "react-infinite-scroll-component";
5
- import { Carousel, Empty, Image, Modal, Spin } from "antd";
6
- import { useCallback, useState } from "react";
7
- import dayjs from "dayjs";
8
- import useConversationStore from "../../store/conversation";
9
- import { useBoolean } from "ahooks";
10
- import { images } from "../../constants/images";
11
- import { Icon } from "../../components/icon";
12
- import { useTranslation } from "react-i18next";
13
- const VideoCollection = () => {
14
- const { t } = useTranslation();
15
- const selectedSourceId = useConversationStore((state) => state.selectedSourceId);
16
- const { groupedData, fetchNextPage, hasNextPage, dataFlatten, isLoading } = useSearchMessage({
17
- payload: {
18
- recvID: selectedSourceId,
19
- contentType: MessageType.VideoMessage,
20
- },
21
- });
22
- const [open, { setTrue, setFalse }] = useBoolean(false);
23
- const [currentIndex, setCurrentIndex] = useState(0);
24
- const handleOpenPreview = (index) => {
25
- setCurrentIndex(index);
26
- setTrue();
27
- };
28
- const renderItem = useCallback((date, items) => {
29
- return (_jsxs("div", { className: "mb-2", children: [_jsx("span", { className: "text-sm font-medium text-gray-500 px-3", children: dayjs(date).format("DD MMMM, YYYY") }), _jsx("div", { className: "grid grid-cols-3 justify-start gap-px py-2", children: items.map((item) => {
30
- var _a, _b;
31
- const videoContent = JSON.parse(((_a = item === null || item === void 0 ? void 0 : item.chatLog) === null || _a === void 0 ? void 0 : _a.content) || "{}");
32
- const globalIndex = dataFlatten.findIndex((v) => { var _a, _b; return ((_a = v.chatLog) === null || _a === void 0 ? void 0 : _a.clientMsgID) === ((_b = item.chatLog) === null || _b === void 0 ? void 0 : _b.clientMsgID); });
33
- return (_jsxs("div", { className: "border relative w-full h-full aspect-square cursor-pointer", onClick: () => handleOpenPreview(globalIndex), children: [_jsx(Image, { rootClassName: "w-full h-full", src: videoContent.snapshotUrl, alt: "video thumbnail", className: "w-full !h-full object-cover", fallback: images.imageFailed }), _jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/30 text-white text-2xl", children: _jsx(Icon, { icon: "play-b", size: 24, color: "white" }) })] }, (_b = item === null || item === void 0 ? void 0 : item.chatLog) === null || _b === void 0 ? void 0 : _b.clientMsgID));
34
- }) })] }, date));
35
- }, []);
36
- if (dataFlatten.length === 0 && !isLoading)
37
- return _jsx(Empty, { description: t("no_media_files") });
38
- if (isLoading)
39
- return (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }));
40
- return (_jsxs("div", { id: "scrollableVideoDiv", className: "h-full overflow-auto", children: [_jsx(InfiniteScroll, { dataLength: Object.keys(groupedData).length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableVideoDiv", children: Object.entries(groupedData).map(([date, items]) => renderItem(date, items)) }), _jsx(Modal, { open: open, onCancel: setFalse, footer: null, centered: true, styles: {
41
- content: {
42
- padding: 0,
43
- },
44
- }, children: _jsx(Carousel, { dots: true, infinite: false, initialSlide: currentIndex, afterChange: (i) => setCurrentIndex(i), children: dataFlatten.map((item, idx) => {
45
- var _a;
46
- const videoContent = JSON.parse(((_a = item === null || item === void 0 ? void 0 : item.chatLog) === null || _a === void 0 ? void 0 : _a.content) || "{}");
47
- const sourceUrl = videoContent.videoUrl;
48
- return (_jsx("div", { style: { textAlign: "center" }, children: _jsx("video", { src: sourceUrl, controls: true, autoPlay: idx === currentIndex, style: { width: "100%", maxHeight: "80vh" } }) }, idx));
49
- }) }) })] }));
50
- };
51
- export default VideoCollection;
@@ -1,9 +0,0 @@
1
- export declare enum MediaCollectionTabKey {
2
- Image = "image",
3
- Video = "video",
4
- File = "file",
5
- Link = "link"
6
- }
7
- declare const MediaCollection: () => import("react/jsx-runtime").JSX.Element;
8
- export default MediaCollection;
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/index.tsx"],"names":[],"mappings":"AAaA,oBAAY,qBAAqB;IAC/B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,QAAA,MAAM,eAAe,+CA8EpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,57 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useBoolean } from "ahooks";
4
- import { Button, Drawer, Tabs } from "antd";
5
- import { Icon } from "../../components/icon";
6
- import { useTranslation } from "react-i18next";
7
- import ImageCollection from "./ImageCollection";
8
- import VideoCollection from "./VideoCollection";
9
- import { useIsMobile } from "../../hooks/common/useIsMobile";
10
- import { useMemo } from "react";
11
- import FileCollection from "./FileCollection";
12
- import LinkCollection from "./LinkCollection";
13
- export var MediaCollectionTabKey;
14
- (function (MediaCollectionTabKey) {
15
- MediaCollectionTabKey["Image"] = "image";
16
- MediaCollectionTabKey["Video"] = "video";
17
- MediaCollectionTabKey["File"] = "file";
18
- MediaCollectionTabKey["Link"] = "link";
19
- })(MediaCollectionTabKey || (MediaCollectionTabKey = {}));
20
- const MediaCollection = () => {
21
- const { t } = useTranslation();
22
- const [isOpen, { toggle }] = useBoolean(false);
23
- const isMobile = useIsMobile();
24
- const items = useMemo(() => {
25
- if (!isOpen)
26
- return [];
27
- return [
28
- {
29
- key: MediaCollectionTabKey.Image,
30
- label: t("image"),
31
- children: _jsx(ImageCollection, {}),
32
- },
33
- {
34
- key: MediaCollectionTabKey.Video,
35
- label: t("video"),
36
- children: _jsx(VideoCollection, {}),
37
- },
38
- {
39
- key: MediaCollectionTabKey.File,
40
- label: t("file"),
41
- children: _jsx(FileCollection, {}),
42
- },
43
- {
44
- key: MediaCollectionTabKey.Link,
45
- label: t("link"),
46
- children: _jsx(LinkCollection, { onClose: toggle }),
47
- },
48
- ];
49
- }, [isOpen, t]);
50
- return (_jsxs(_Fragment, { children: [_jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: toggle, children: _jsx(Icon, { icon: "folder-o", size: 22 }) }), _jsx(Drawer, { open: isOpen, onClose: toggle, mask: false, closeIcon: false, styles: {
51
- body: {
52
- padding: 0,
53
- height: "100%",
54
- },
55
- }, getContainer: false, width: isMobile ? "100%" : 360, children: _jsxs("div", { className: "flex flex-col h-full", children: [_jsxs("div", { className: "flex items-center justify-between p-3", children: [_jsx("span", { className: "text-lg font-medium", children: t("library") }), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: toggle, children: _jsx(Icon, { icon: "close-b", size: 22 }) })] }), _jsx("div", { className: "flex-1 overflow-hidden", children: _jsx(Tabs, { defaultActiveKey: MediaCollectionTabKey.Image, items: items, className: "h-full" }) })] }) })] }));
56
- };
57
- export default MediaCollection;
@@ -1,2 +0,0 @@
1
- export declare const QuotedMessageFooter: () => import("react/jsx-runtime").JSX.Element | null;
2
- //# sourceMappingURL=QuotedMessage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuotedMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/message/footer/QuotedMessage.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,sDA4C/B,CAAC"}
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useTranslation } from "react-i18next";
3
- import useConversationStore from "../../../store/conversation";
4
- import { Icon } from "../../../components/icon";
5
- import { useCallback } from "react";
6
- import { Button } from "antd";
7
- import { useChatContext } from "../../../context/ChatContext";
8
- import { generateContentBasedOnMessageType } from "../../../utils/common";
9
- export const QuotedMessageFooter = () => {
10
- var _a;
11
- const { t } = useTranslation();
12
- const quotedMessage = useConversationStore((state) => state.quotedMessage);
13
- const setQuotedMessage = useConversationStore((state) => state.setQuotedMessage);
14
- const user = useChatContext().user;
15
- const isMe = (quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.sendID) === (user === null || user === void 0 ? void 0 : user.userID);
16
- const handleClearQuotedMessage = useCallback(() => {
17
- setQuotedMessage(null);
18
- }, [setQuotedMessage]);
19
- if (!quotedMessage)
20
- return null;
21
- return (_jsxs("div", { className: "flex flex-row items-center py-2 px-3 bg-blue-50 flex-1 gap-3", children: [_jsx("div", { className: "flex pr-3 items-center justify-items-center border-r-2 border-blue-500 h-full", children: _jsx(Icon, { icon: "arrow-forward-b", className: "text-blue-500", size: 16 }) }), _jsxs("div", { className: "flex-1", children: [_jsx("p", { className: "text-sm font-medium", children: t("reply_to", {
22
- name: isMe ? t("your_self") : (quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.senderNickname) || "",
23
- }) }), _jsx("p", { className: "text-sm text-gray-500 truncate", children: generateContentBasedOnMessageType(quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.contentType, (_a = quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.textElem) === null || _a === void 0 ? void 0 : _a.content) })] }), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: handleClearQuotedMessage, children: _jsx(Icon, { icon: "close-o", size: 16 }) })] }));
24
- };
@@ -1,12 +0,0 @@
1
- import { UploadFile } from "antd";
2
- interface RichTextEditorProps {
3
- initialHtml?: string;
4
- placeholder?: string;
5
- onChange?: (html: string, plainText: string) => void;
6
- onFilesChange?: (files: UploadFile[]) => void;
7
- minHeight?: string;
8
- showMediaUpload?: boolean;
9
- }
10
- export default function RichTextEditor({ initialHtml, placeholder, onChange, onFilesChange, minHeight, showMediaUpload, }: RichTextEditorProps): import("react/jsx-runtime").JSX.Element;
11
- export {};
12
- //# sourceMappingURL=RichTextEditor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../../../src/components/richTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AA0ClC,UAAU,mBAAmB;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,SAAmB,EACnB,eAAsB,GACvB,EAAE,mBAAmB,2CA6DrB"}
@@ -1,62 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useState } from "react";
4
- import { LexicalComposer } from "@lexical/react/LexicalComposer";
5
- import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
6
- import { ContentEditable } from "@lexical/react/LexicalContentEditable";
7
- import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
8
- import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
9
- import { ListPlugin } from "@lexical/react/LexicalListPlugin";
10
- import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";
11
- import { $generateHtmlFromNodes, $generateNodesFromDOM } from "@lexical/html";
12
- import { $getRoot } from "lexical";
13
- import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
14
- import { useEffect } from "react";
15
- import { ToolbarPlugin } from "../../components/message/footer/ToolbarPlugin";
16
- import MediaActions from "../../components/message/footer/MediaActions";
17
- import { FilePreviewList } from "../../components/message/footer/FilePreview";
18
- import { editorTheme, editorNodes, editorOnError, } from "../../components/message/footer/editorConfig";
19
- const EDITOR_CONFIG = {
20
- namespace: "CannedResponseEditor",
21
- theme: editorTheme,
22
- onError: editorOnError,
23
- nodes: editorNodes,
24
- };
25
- function HtmlPlugin({ initialHtml }) {
26
- const [editor] = useLexicalComposerContext();
27
- useEffect(() => {
28
- if (!initialHtml)
29
- return;
30
- editor.update(() => {
31
- const parser = new DOMParser();
32
- const dom = parser.parseFromString(initialHtml, "text/html");
33
- const nodes = $generateNodesFromDOM(editor, dom);
34
- const root = $getRoot();
35
- root.clear();
36
- root.append(...nodes);
37
- }, { tag: "initial-html" });
38
- }, [editor, initialHtml]);
39
- return null;
40
- }
41
- export default function RichTextEditor({ initialHtml, placeholder, onChange, onFilesChange, minHeight = "160px", showMediaUpload = true, }) {
42
- const [listUploadFiles, setListUploadFiles] = useState([]);
43
- const handleChange = (editorState, editor, tags) => {
44
- if (tags.has("initial-html"))
45
- return;
46
- editorState.read(() => {
47
- const html = $generateHtmlFromNodes(editor);
48
- const plainText = $getRoot().getTextContent().trim();
49
- onChange === null || onChange === void 0 ? void 0 : onChange(html, plainText);
50
- });
51
- };
52
- const handleRemoveFile = (file) => {
53
- const newList = listUploadFiles.filter((f) => f.uid !== file.uid);
54
- setListUploadFiles(newList);
55
- onFilesChange === null || onFilesChange === void 0 ? void 0 : onFilesChange(newList);
56
- };
57
- const handleFilesChange = (files) => {
58
- setListUploadFiles(files);
59
- onFilesChange === null || onFilesChange === void 0 ? void 0 : onFilesChange(files);
60
- };
61
- return (_jsxs(LexicalComposer, { initialConfig: EDITOR_CONFIG, children: [_jsxs("div", { className: "border border-gray-200 rounded-lg", children: [_jsx(FilePreviewList, { files: listUploadFiles, onRemove: handleRemoveFile }), _jsx("div", { className: "relative", children: _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: "px-3 py-2 text-sm outline-none", style: { minHeight } }), ErrorBoundary: LexicalErrorBoundary, placeholder: placeholder ? (_jsx("div", { className: "absolute top-2 left-3 pointer-events-none", children: _jsx("p", { className: "text-gray-400 text-sm", children: placeholder }) })) : null }) }), _jsxs("div", { className: "flex items-center border-t border-gray-100 px-2 py-1", children: [_jsx(ToolbarPlugin, {}), _jsx(MediaActions, { listUploadFiles: listUploadFiles, onFilesChange: handleFilesChange, showMediaUpload: showMediaUpload })] })] }), _jsx(LinkPlugin, {}), _jsx(ListPlugin, {}), _jsx(OnChangePlugin, { onChange: handleChange, ignoreSelectionChange: true }), _jsx(HtmlPlugin, { initialHtml: initialHtml })] }));
62
- }
@@ -1,8 +0,0 @@
1
- import { SearchConversationTabKey } from ".";
2
- interface SearchConversationAllProps {
3
- searchTerm: string;
4
- setActiveKey: (key: SearchConversationTabKey) => void;
5
- }
6
- declare const SearchConversationAll: ({ searchTerm, setActiveKey, }: SearchConversationAllProps) => import("react/jsx-runtime").JSX.Element;
7
- export default SearchConversationAll;
8
- //# sourceMappingURL=SearchAll.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchAll.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchAll.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,wBAAwB,EAAE,MAAM,GAAG,CAAC;AAG7C,UAAU,0BAA0B;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC,GAAG,EAAE,wBAAwB,KAAK,IAAI,CAAC;CACvD;AACD,QAAA,MAAM,qBAAqB,GAAI,+BAG5B,0BAA0B,4CA6G5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1,37 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Empty, Spin } from "antd";
3
- import clsx from "clsx";
4
- import { useTranslation } from "react-i18next";
5
- import { useSearchMessage } from "../../hooks/search/useSearchMessage";
6
- import { MessageType } from "@openim/wasm-client-sdk";
7
- import { Icon } from "../../components/icon";
8
- import SearchItemAsMessage from "./item/SearchItemAsMessage";
9
- import { useGetSession } from "../../hooks/session/useGetSession";
10
- import SearchItemAsUser from "./item/SearchItemAsUser";
11
- import { SearchConversationTabKey } from ".";
12
- import { PAGE_SIZE } from "../../constants";
13
- const SearchConversationAll = ({ searchTerm = "", setActiveKey, }) => {
14
- const { t } = useTranslation();
15
- const { dataFlatten: messages, isLoading: isLoadingMessage, hasNextPage: hasNextPageMessage, } = useSearchMessage({
16
- payload: {
17
- searchTerm: searchTerm.trim(),
18
- contentType: MessageType.TextMessage,
19
- },
20
- options: { pageSize: PAGE_SIZE.xs },
21
- });
22
- const { dataFlatten: sessions, isLoading: isLoadingSession, hasNextPage: hasNextPageSession, } = useGetSession({
23
- filter: {
24
- searchTerm: searchTerm.trim(),
25
- },
26
- options: { pageSize: PAGE_SIZE.xs },
27
- });
28
- if (searchTerm.trim() === "" ||
29
- (messages.length === 0 && sessions.length === 0)) {
30
- return (_jsx("div", { className: "h-full overflow-auto", children: _jsx(Empty, { description: t("no_conversation") }) }));
31
- }
32
- if (isLoadingMessage || isLoadingSession) {
33
- return (_jsx("div", { className: "h-full overflow-auto flex items-center justify-center", children: _jsx(Spin, {}) }));
34
- }
35
- return (_jsxs("div", { className: "h-full overflow-auto", children: [sessions.length > 0 && (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between px-3 min-h-[32px]", children: [_jsx("span", { className: "text-xs font-medium uppercase flex-1 text-gray-600", children: t("users") }), _jsx(Button, { type: "link", icon: _jsx(Icon, { icon: "angle-right-o", size: 18, className: "!align-[-4px]" }), iconPosition: "end", className: clsx("p-0 gap-1", !hasNextPageSession && "invisible"), onClick: () => setActiveKey === null || setActiveKey === void 0 ? void 0 : setActiveKey(SearchConversationTabKey.Users), children: t("see_more") })] }), _jsx("div", { children: sessions.map((session) => (_jsx(SearchItemAsUser, { session: session, searchTerm: searchTerm }))) })] })), messages.length > 0 && (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between px-3 min-h-[32px]", children: [_jsx("span", { className: "text-xs font-medium uppercase flex-1 text-gray-600", children: t("messages") }), _jsx(Button, { type: "link", icon: _jsx(Icon, { icon: "angle-right-o", size: 18, className: "!align-[-4px]" }), iconPosition: "end", className: clsx("p-0 gap-1", !hasNextPageMessage && "invisible"), onClick: () => setActiveKey === null || setActiveKey === void 0 ? void 0 : setActiveKey(SearchConversationTabKey.Messages), children: t("see_more") })] }), _jsx("div", { children: messages.map((message) => (_jsx(SearchItemAsMessage, { message: message.chatLog, searchTerm: searchTerm, displayTag: message.displayTag }))) })] }))] }));
36
- };
37
- export default SearchConversationAll;
@@ -1,6 +0,0 @@
1
- interface SearchConversationAsMessagesProps {
2
- searchTerm: string;
3
- }
4
- declare const SearchConversationAsMessages: (props: SearchConversationAsMessagesProps) => import("react/jsx-runtime").JSX.Element;
5
- export default SearchConversationAsMessages;
6
- //# sourceMappingURL=SearchConversationAsMessages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchConversationAsMessages.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchConversationAsMessages.tsx"],"names":[],"mappings":"AAOA,UAAU,iCAAiC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,QAAA,MAAM,4BAA4B,GAChC,OAAO,iCAAiC,4CA2CzC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Empty, Spin } from "antd";
3
- import { useTranslation } from "react-i18next";
4
- import { useSearchMessage } from "../../hooks/search/useSearchMessage";
5
- import { MessageType } from "@openim/wasm-client-sdk";
6
- import InfiniteScroll from "react-infinite-scroll-component";
7
- import SearchItemAsMessage from "./item/SearchItemAsMessage";
8
- const SearchConversationAsMessages = (props) => {
9
- const { searchTerm = "" } = props;
10
- const { t } = useTranslation();
11
- const { dataFlatten, hasNextPage, fetchNextPage, isLoading } = useSearchMessage({
12
- payload: {
13
- searchTerm: searchTerm.trim(),
14
- contentType: MessageType.TextMessage,
15
- },
16
- });
17
- if ((dataFlatten.length === 0 && !isLoading) || searchTerm.trim() === "")
18
- return _jsx(Empty, { description: t("no_conversation") });
19
- if (isLoading)
20
- return (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }));
21
- return (_jsx("div", { id: "scrollableSearchMessagesTab", className: "h-full overflow-auto", children: _jsx(InfiniteScroll, { dataLength: dataFlatten.length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableSearchMessagesTab", children: dataFlatten.map((item) => (_jsx(SearchItemAsMessage, { message: item.chatLog, searchTerm: searchTerm, displayTag: item.displayTag }))) }) }));
22
- };
23
- export default SearchConversationAsMessages;
@@ -1,6 +0,0 @@
1
- interface SearchConversationAsUsersProps {
2
- searchTerm: string;
3
- }
4
- declare const SearchConversationAsUsers: (props: SearchConversationAsUsersProps) => import("react/jsx-runtime").JSX.Element;
5
- export default SearchConversationAsUsers;
6
- //# sourceMappingURL=SearchConversationAsUsers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchConversationAsUsers.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchConversationAsUsers.tsx"],"names":[],"mappings":"AAMA,UAAU,8BAA8B;IACtC,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,QAAA,MAAM,yBAAyB,GAAI,OAAO,8BAA8B,4CAoCvE,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Empty, Spin } from "antd";
3
- import { useTranslation } from "react-i18next";
4
- import InfiniteScroll from "react-infinite-scroll-component";
5
- import SearchItemAsUser from "./item/SearchItemAsUser";
6
- import { useGetSession } from "../../hooks/session/useGetSession";
7
- const SearchConversationAsUsers = (props) => {
8
- const { searchTerm = "" } = props;
9
- const { t } = useTranslation();
10
- const { dataFlatten, hasNextPage, fetchNextPage, isLoading } = useGetSession({
11
- filter: {
12
- searchTerm: searchTerm.trim(),
13
- },
14
- });
15
- if ((dataFlatten.length === 0 && !isLoading) || searchTerm.trim() === "")
16
- return _jsx(Empty, { description: t("no_conversation") });
17
- if (isLoading)
18
- return (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }));
19
- return (_jsx("div", { id: "scrollableSearchUsersTab", className: "h-full overflow-auto", children: _jsx(InfiniteScroll, { dataLength: dataFlatten.length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableSearchUsersTab", children: dataFlatten.map((item) => (_jsx(SearchItemAsUser, { session: item, searchTerm: searchTerm }))) }) }));
20
- };
21
- export default SearchConversationAsUsers;
@@ -1,6 +0,0 @@
1
- interface SearchConversationMyInboxProps {
2
- searchTerm: string;
3
- }
4
- declare const SearchConversationMyInbox: ({ searchTerm, }: SearchConversationMyInboxProps) => import("react/jsx-runtime").JSX.Element;
5
- export default SearchConversationMyInbox;
6
- //# sourceMappingURL=SearchConversationMyInbox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchConversationMyInbox.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchConversationMyInbox.tsx"],"names":[],"mappings":"AAQA,UAAU,8BAA8B;IACtC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,yBAAyB,GAAI,iBAEhC,8BAA8B,4CA2ChC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Empty, Spin } from "antd";
3
- import { useTranslation } from "react-i18next";
4
- import { useSearchMessage } from "../../hooks/search/useSearchMessage";
5
- import { MessageType } from "@openim/wasm-client-sdk";
6
- import SearchItemAsMessage from "./item/SearchItemAsMessage";
7
- const MY_INBOX_TAG = "MY_INBOX";
8
- const SearchConversationMyInbox = ({ searchTerm = "", }) => {
9
- const { t } = useTranslation();
10
- const { dataFlatten, hasNextPage, fetchNextPage, isLoading, isFetchingNextPage } = useSearchMessage({
11
- payload: {
12
- searchTerm: searchTerm.trim(),
13
- contentType: MessageType.TextMessage,
14
- tag: MY_INBOX_TAG,
15
- },
16
- options: { untilEmptyPage: true },
17
- });
18
- if ((dataFlatten.length === 0 && !isLoading) || searchTerm.trim() === "")
19
- return _jsx(Empty, { description: t("no_conversation") });
20
- if (isLoading)
21
- return (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }));
22
- return (_jsxs("div", { className: "overflow-auto", children: [dataFlatten.map((item) => (_jsx(SearchItemAsMessage, { message: item.chatLog, searchTerm: searchTerm, displayTag: item.displayTag }, item.chatLog.clientMsgID))), _jsx("div", { className: "flex justify-center py-2", children: _jsx(Button, { type: "link", loading: isFetchingNextPage, onClick: () => fetchNextPage(), children: t("see_more") }) })] }));
23
- };
24
- export default SearchConversationMyInbox;
@@ -1,3 +0,0 @@
1
- declare const SearchDrawer: () => import("react/jsx-runtime").JSX.Element;
2
- export default SearchDrawer;
3
- //# sourceMappingURL=SearchDrawer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchDrawer.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,YAAY,+CAgFjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,33 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Drawer, Input } from "antd";
3
- import { Icon } from "../../components/icon";
4
- import { useIsMobile } from "../../hooks/common/useIsMobile";
5
- import useBoolean from "ahooks/lib/useBoolean";
6
- import { useTranslation } from "react-i18next";
7
- import { useRef, useState } from "react";
8
- import SearchMessageOnCurrentConversation from "./SearchMessageOnCurrentConversation";
9
- const SearchDrawer = () => {
10
- const { t } = useTranslation();
11
- const searchInputRef = useRef(null);
12
- const [isOpen, { toggle }] = useBoolean(false);
13
- const [search, setSearch] = useState("");
14
- const isMobile = useIsMobile();
15
- const handleDrawerAfterOpenChange = (opened) => {
16
- if (!opened) {
17
- return;
18
- }
19
- requestAnimationFrame(() => {
20
- var _a;
21
- (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
22
- });
23
- };
24
- return (_jsxs("div", { className: "inline-flex shrink-0", children: [_jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: toggle, children: _jsx(Icon, { icon: "search-o", size: 22 }) }), _jsx(Drawer, { open: isOpen, onClose: toggle, afterOpenChange: handleDrawerAfterOpenChange, mask: false, closeIcon: false, styles: {
25
- body: {
26
- padding: 0,
27
- height: "100%",
28
- },
29
- }, getContainer: false, width: isMobile ? "100%" : 360, children: _jsxs("div", { className: "flex flex-col h-full", children: [_jsxs("div", { className: "flex items-center justify-between p-3", children: [_jsx("span", { className: "text-lg font-medium", children: t("search_message_title") }), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: toggle, children: _jsx(Icon, { icon: "close-b", size: 22 }) })] }), _jsx("div", { className: "px-3", children: _jsx(Input, { ref: searchInputRef, placeholder: t("search"), prefix: _jsx(Icon, { icon: "search-o", size: 18, className: "text-gray-400" }), onChange: (e) => {
30
- setSearch(e.target.value);
31
- }, className: "rounded-lg text-sm", size: "large", allowClear: true, value: search, autoFocus: false }) }), _jsx("div", { className: "flex-1 py-3 overflow-auto", children: _jsx(SearchMessageOnCurrentConversation, { searchTerm: search, onClose: toggle }) })] }) })] }));
32
- };
33
- export default SearchDrawer;