@droppii-org/chat-mobile 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +101 -0
  3. package/lib/module/assets/images/icon_bot.png +0 -0
  4. package/lib/module/assets/images/index.js +9 -0
  5. package/lib/module/assets/images/index.js.map +1 -0
  6. package/lib/module/assets/images/tag_bot.png +0 -0
  7. package/lib/module/assets/images/tag_mall.png +0 -0
  8. package/lib/module/build-ignore.d.js +2 -0
  9. package/lib/module/build-ignore.d.js.map +1 -0
  10. package/lib/module/components/Avatar/Avatar.js +81 -0
  11. package/lib/module/components/Avatar/Avatar.js.map +1 -0
  12. package/lib/module/components/Avatar/Avatar.types.js +2 -0
  13. package/lib/module/components/Avatar/Avatar.types.js.map +1 -0
  14. package/lib/module/components/Avatar/Avatar.utils.js +44 -0
  15. package/lib/module/components/Avatar/Avatar.utils.js.map +1 -0
  16. package/lib/module/components/Avatar/AvatarBadge.js +28 -0
  17. package/lib/module/components/Avatar/AvatarBadge.js.map +1 -0
  18. package/lib/module/components/Avatar/DoubleAvatar.js +74 -0
  19. package/lib/module/components/Avatar/DoubleAvatar.js.map +1 -0
  20. package/lib/module/components/Avatar/SingleAvatar.js +53 -0
  21. package/lib/module/components/Avatar/SingleAvatar.js.map +1 -0
  22. package/lib/module/components/Avatar/index.js +7 -0
  23. package/lib/module/components/Avatar/index.js.map +1 -0
  24. package/lib/module/components/ThreadCard/AvatarSection.js +37 -0
  25. package/lib/module/components/ThreadCard/AvatarSection.js.map +1 -0
  26. package/lib/module/components/ThreadCard/NamePrefixIcon.js +36 -0
  27. package/lib/module/components/ThreadCard/NamePrefixIcon.js.map +1 -0
  28. package/lib/module/components/ThreadCard/ThreadCard.js +132 -0
  29. package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -0
  30. package/lib/module/components/ThreadCard/UnreadBadge.js +35 -0
  31. package/lib/module/components/ThreadCard/UnreadBadge.js.map +1 -0
  32. package/lib/module/components/ThreadCard/index.js +7 -0
  33. package/lib/module/components/ThreadCard/index.js.map +1 -0
  34. package/lib/module/components/ThreadCard/thread-card.utils.js +51 -0
  35. package/lib/module/components/ThreadCard/thread-card.utils.js.map +1 -0
  36. package/lib/module/core/index.js +11 -0
  37. package/lib/module/core/index.js.map +1 -0
  38. package/lib/module/core/useChatListener.js +62 -0
  39. package/lib/module/core/useChatListener.js.map +1 -0
  40. package/lib/module/core/useUserListener.js +72 -0
  41. package/lib/module/core/useUserListener.js.map +1 -0
  42. package/lib/module/hooks/query-keys.js +10 -0
  43. package/lib/module/hooks/query-keys.js.map +1 -0
  44. package/lib/module/hooks/useChatMessages.js +163 -0
  45. package/lib/module/hooks/useChatMessages.js.map +1 -0
  46. package/lib/module/hooks/useConversationList.js +51 -0
  47. package/lib/module/hooks/useConversationList.js.map +1 -0
  48. package/lib/module/index.js +14 -0
  49. package/lib/module/index.js.map +1 -0
  50. package/lib/module/package.json +1 -0
  51. package/lib/module/screens/chat-detail/ChatAttachmentPanel.js +106 -0
  52. package/lib/module/screens/chat-detail/ChatAttachmentPanel.js.map +1 -0
  53. package/lib/module/screens/chat-detail/ChatComposer.js +288 -0
  54. package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -0
  55. package/lib/module/screens/chat-detail/ChatDay.js +65 -0
  56. package/lib/module/screens/chat-detail/ChatDay.js.map +1 -0
  57. package/lib/module/screens/chat-detail/ChatDetail.js +104 -0
  58. package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -0
  59. package/lib/module/screens/chat-detail/ChatDetailHeader.js +92 -0
  60. package/lib/module/screens/chat-detail/ChatDetailHeader.js.map +1 -0
  61. package/lib/module/screens/chat-detail/ChatList.js +145 -0
  62. package/lib/module/screens/chat-detail/ChatList.js.map +1 -0
  63. package/lib/module/screens/chat-detail/ChatLoadEarlier.js +23 -0
  64. package/lib/module/screens/chat-detail/ChatLoadEarlier.js.map +1 -0
  65. package/lib/module/screens/chat-detail/ChatQuickActions.js +85 -0
  66. package/lib/module/screens/chat-detail/ChatQuickActions.js.map +1 -0
  67. package/lib/module/screens/chat-detail/ChatScrollToBottom.js +12 -0
  68. package/lib/module/screens/chat-detail/ChatScrollToBottom.js.map +1 -0
  69. package/lib/module/screens/chat-detail/ChatTextBubble.js +62 -0
  70. package/lib/module/screens/chat-detail/ChatTextBubble.js.map +1 -0
  71. package/lib/module/screens/chat-detail/constants.js +59 -0
  72. package/lib/module/screens/chat-detail/constants.js.map +1 -0
  73. package/lib/module/screens/chat-detail/index.js +12 -0
  74. package/lib/module/screens/chat-detail/index.js.map +1 -0
  75. package/lib/module/screens/chat-detail/messages/ChatMessageBubble.js +24 -0
  76. package/lib/module/screens/chat-detail/messages/ChatMessageBubble.js.map +1 -0
  77. package/lib/module/screens/chat-detail/messages/types.js +4 -0
  78. package/lib/module/screens/chat-detail/messages/types.js.map +1 -0
  79. package/lib/module/screens/chat-detail/types.js +4 -0
  80. package/lib/module/screens/chat-detail/types.js.map +1 -0
  81. package/lib/module/screens/chat-detail/useChatActionPress.js +11 -0
  82. package/lib/module/screens/chat-detail/useChatActionPress.js.map +1 -0
  83. package/lib/module/screens/inbox/Inbox.js +134 -0
  84. package/lib/module/screens/inbox/Inbox.js.map +1 -0
  85. package/lib/module/screens/inbox/MessagesTab.js +58 -0
  86. package/lib/module/screens/inbox/MessagesTab.js.map +1 -0
  87. package/lib/module/screens/inbox/index.js +5 -0
  88. package/lib/module/screens/inbox/index.js.map +1 -0
  89. package/lib/module/services/apis.js +41 -0
  90. package/lib/module/services/apis.js.map +1 -0
  91. package/lib/module/services/index.js +5 -0
  92. package/lib/module/services/index.js.map +1 -0
  93. package/lib/module/services/message.js +38 -0
  94. package/lib/module/services/message.js.map +1 -0
  95. package/lib/module/store/conversation.js +89 -0
  96. package/lib/module/store/conversation.js.map +1 -0
  97. package/lib/module/store/index.js +6 -0
  98. package/lib/module/store/index.js.map +1 -0
  99. package/lib/module/store/storeConfig.js +19 -0
  100. package/lib/module/store/storeConfig.js.map +1 -0
  101. package/lib/module/store/user.js +25 -0
  102. package/lib/module/store/user.js.map +1 -0
  103. package/lib/module/translation/index.js +24 -0
  104. package/lib/module/translation/index.js.map +1 -0
  105. package/lib/module/translation/resources/i18n.js +10 -0
  106. package/lib/module/translation/resources/i18n.js.map +1 -0
  107. package/lib/module/types/auth.js +9 -0
  108. package/lib/module/types/auth.js.map +1 -0
  109. package/lib/module/types/chat.js +26 -0
  110. package/lib/module/types/chat.js.map +1 -0
  111. package/lib/module/types/message.js +16 -0
  112. package/lib/module/types/message.js.map +1 -0
  113. package/lib/module/utils/conversation.js +61 -0
  114. package/lib/module/utils/conversation.js.map +1 -0
  115. package/lib/module/utils/giftedChatMessage.js +90 -0
  116. package/lib/module/utils/giftedChatMessage.js.map +1 -0
  117. package/lib/module/utils/message.js +68 -0
  118. package/lib/module/utils/message.js.map +1 -0
  119. package/lib/module/utils/resolveMessageType.js +44 -0
  120. package/lib/module/utils/resolveMessageType.js.map +1 -0
  121. package/lib/typescript/package.json +1 -0
  122. package/lib/typescript/src/assets/images/index.d.ts +7 -0
  123. package/lib/typescript/src/assets/images/index.d.ts.map +1 -0
  124. package/lib/typescript/src/components/Avatar/Avatar.d.ts +4 -0
  125. package/lib/typescript/src/components/Avatar/Avatar.d.ts.map +1 -0
  126. package/lib/typescript/src/components/Avatar/Avatar.types.d.ts +18 -0
  127. package/lib/typescript/src/components/Avatar/Avatar.types.d.ts.map +1 -0
  128. package/lib/typescript/src/components/Avatar/Avatar.utils.d.ts +14 -0
  129. package/lib/typescript/src/components/Avatar/Avatar.utils.d.ts.map +1 -0
  130. package/lib/typescript/src/components/Avatar/AvatarBadge.d.ts +7 -0
  131. package/lib/typescript/src/components/Avatar/AvatarBadge.d.ts.map +1 -0
  132. package/lib/typescript/src/components/Avatar/DoubleAvatar.d.ts +13 -0
  133. package/lib/typescript/src/components/Avatar/DoubleAvatar.d.ts.map +1 -0
  134. package/lib/typescript/src/components/Avatar/SingleAvatar.d.ts +12 -0
  135. package/lib/typescript/src/components/Avatar/SingleAvatar.d.ts.map +1 -0
  136. package/lib/typescript/src/components/Avatar/index.d.ts +6 -0
  137. package/lib/typescript/src/components/Avatar/index.d.ts.map +1 -0
  138. package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts +8 -0
  139. package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts.map +1 -0
  140. package/lib/typescript/src/components/ThreadCard/NamePrefixIcon.d.ts +8 -0
  141. package/lib/typescript/src/components/ThreadCard/NamePrefixIcon.d.ts.map +1 -0
  142. package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts +11 -0
  143. package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -0
  144. package/lib/typescript/src/components/ThreadCard/UnreadBadge.d.ts +6 -0
  145. package/lib/typescript/src/components/ThreadCard/UnreadBadge.d.ts.map +1 -0
  146. package/lib/typescript/src/components/ThreadCard/index.d.ts +5 -0
  147. package/lib/typescript/src/components/ThreadCard/index.d.ts.map +1 -0
  148. package/lib/typescript/src/components/ThreadCard/thread-card.utils.d.ts +4 -0
  149. package/lib/typescript/src/components/ThreadCard/thread-card.utils.d.ts.map +1 -0
  150. package/lib/typescript/src/core/index.d.ts +3 -0
  151. package/lib/typescript/src/core/index.d.ts.map +1 -0
  152. package/lib/typescript/src/core/useChatListener.d.ts +2 -0
  153. package/lib/typescript/src/core/useChatListener.d.ts.map +1 -0
  154. package/lib/typescript/src/core/useUserListener.d.ts +2 -0
  155. package/lib/typescript/src/core/useUserListener.d.ts.map +1 -0
  156. package/lib/typescript/src/hooks/query-keys.d.ts +9 -0
  157. package/lib/typescript/src/hooks/query-keys.d.ts.map +1 -0
  158. package/lib/typescript/src/hooks/useChatMessages.d.ts +21 -0
  159. package/lib/typescript/src/hooks/useChatMessages.d.ts.map +1 -0
  160. package/lib/typescript/src/hooks/useConversationList.d.ts +8 -0
  161. package/lib/typescript/src/hooks/useConversationList.d.ts.map +1 -0
  162. package/lib/typescript/src/index.d.ts +14 -0
  163. package/lib/typescript/src/index.d.ts.map +1 -0
  164. package/lib/typescript/src/screens/chat-detail/ChatAttachmentPanel.d.ts +3 -0
  165. package/lib/typescript/src/screens/chat-detail/ChatAttachmentPanel.d.ts.map +1 -0
  166. package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts +3 -0
  167. package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -0
  168. package/lib/typescript/src/screens/chat-detail/ChatDay.d.ts +3 -0
  169. package/lib/typescript/src/screens/chat-detail/ChatDay.d.ts.map +1 -0
  170. package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts +4 -0
  171. package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -0
  172. package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts +4 -0
  173. package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts.map +1 -0
  174. package/lib/typescript/src/screens/chat-detail/ChatList.d.ts +3 -0
  175. package/lib/typescript/src/screens/chat-detail/ChatList.d.ts.map +1 -0
  176. package/lib/typescript/src/screens/chat-detail/ChatLoadEarlier.d.ts +3 -0
  177. package/lib/typescript/src/screens/chat-detail/ChatLoadEarlier.d.ts.map +1 -0
  178. package/lib/typescript/src/screens/chat-detail/ChatQuickActions.d.ts +3 -0
  179. package/lib/typescript/src/screens/chat-detail/ChatQuickActions.d.ts.map +1 -0
  180. package/lib/typescript/src/screens/chat-detail/ChatScrollToBottom.d.ts +2 -0
  181. package/lib/typescript/src/screens/chat-detail/ChatScrollToBottom.d.ts.map +1 -0
  182. package/lib/typescript/src/screens/chat-detail/ChatTextBubble.d.ts +3 -0
  183. package/lib/typescript/src/screens/chat-detail/ChatTextBubble.d.ts.map +1 -0
  184. package/lib/typescript/src/screens/chat-detail/constants.d.ts +17 -0
  185. package/lib/typescript/src/screens/chat-detail/constants.d.ts.map +1 -0
  186. package/lib/typescript/src/screens/chat-detail/index.d.ts +13 -0
  187. package/lib/typescript/src/screens/chat-detail/index.d.ts.map +1 -0
  188. package/lib/typescript/src/screens/chat-detail/messages/ChatMessageBubble.d.ts +3 -0
  189. package/lib/typescript/src/screens/chat-detail/messages/ChatMessageBubble.d.ts.map +1 -0
  190. package/lib/typescript/src/screens/chat-detail/messages/types.d.ts +13 -0
  191. package/lib/typescript/src/screens/chat-detail/messages/types.d.ts.map +1 -0
  192. package/lib/typescript/src/screens/chat-detail/types.d.ts +86 -0
  193. package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -0
  194. package/lib/typescript/src/screens/chat-detail/useChatActionPress.d.ts +3 -0
  195. package/lib/typescript/src/screens/chat-detail/useChatActionPress.d.ts.map +1 -0
  196. package/lib/typescript/src/screens/inbox/Inbox.d.ts +10 -0
  197. package/lib/typescript/src/screens/inbox/Inbox.d.ts.map +1 -0
  198. package/lib/typescript/src/screens/inbox/MessagesTab.d.ts +7 -0
  199. package/lib/typescript/src/screens/inbox/MessagesTab.d.ts.map +1 -0
  200. package/lib/typescript/src/screens/inbox/index.d.ts +3 -0
  201. package/lib/typescript/src/screens/inbox/index.d.ts.map +1 -0
  202. package/lib/typescript/src/services/apis.d.ts +12 -0
  203. package/lib/typescript/src/services/apis.d.ts.map +1 -0
  204. package/lib/typescript/src/services/index.d.ts +3 -0
  205. package/lib/typescript/src/services/index.d.ts.map +1 -0
  206. package/lib/typescript/src/services/message.d.ts +21 -0
  207. package/lib/typescript/src/services/message.d.ts.map +1 -0
  208. package/lib/typescript/src/store/conversation.d.ts +24 -0
  209. package/lib/typescript/src/store/conversation.d.ts.map +1 -0
  210. package/lib/typescript/src/store/index.d.ts +4 -0
  211. package/lib/typescript/src/store/index.d.ts.map +1 -0
  212. package/lib/typescript/src/store/storeConfig.d.ts +4 -0
  213. package/lib/typescript/src/store/storeConfig.d.ts.map +1 -0
  214. package/lib/typescript/src/store/user.d.ts +12 -0
  215. package/lib/typescript/src/store/user.d.ts.map +1 -0
  216. package/lib/typescript/src/translation/index.d.ts +4 -0
  217. package/lib/typescript/src/translation/index.d.ts.map +1 -0
  218. package/lib/typescript/src/translation/resources/i18n.d.ts +5 -0
  219. package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -0
  220. package/lib/typescript/src/types/auth.d.ts +24 -0
  221. package/lib/typescript/src/types/auth.d.ts.map +1 -0
  222. package/lib/typescript/src/types/chat.d.ts +99 -0
  223. package/lib/typescript/src/types/chat.d.ts.map +1 -0
  224. package/lib/typescript/src/types/message.d.ts +15 -0
  225. package/lib/typescript/src/types/message.d.ts.map +1 -0
  226. package/lib/typescript/src/utils/conversation.d.ts +10 -0
  227. package/lib/typescript/src/utils/conversation.d.ts.map +1 -0
  228. package/lib/typescript/src/utils/giftedChatMessage.d.ts +10 -0
  229. package/lib/typescript/src/utils/giftedChatMessage.d.ts.map +1 -0
  230. package/lib/typescript/src/utils/message.d.ts +15 -0
  231. package/lib/typescript/src/utils/message.d.ts.map +1 -0
  232. package/lib/typescript/src/utils/resolveMessageType.d.ts +4 -0
  233. package/lib/typescript/src/utils/resolveMessageType.d.ts.map +1 -0
  234. package/package.json +209 -0
  235. package/src/assets/images/icon_bot.png +0 -0
  236. package/src/assets/images/index.ts +7 -0
  237. package/src/assets/images/tag_bot.png +0 -0
  238. package/src/assets/images/tag_mall.png +0 -0
  239. package/src/build-ignore.d.ts +24 -0
  240. package/src/components/Avatar/Avatar.tsx +105 -0
  241. package/src/components/Avatar/Avatar.types.ts +17 -0
  242. package/src/components/Avatar/Avatar.utils.ts +49 -0
  243. package/src/components/Avatar/AvatarBadge.tsx +29 -0
  244. package/src/components/Avatar/DoubleAvatar.tsx +89 -0
  245. package/src/components/Avatar/SingleAvatar.tsx +74 -0
  246. package/src/components/Avatar/index.ts +5 -0
  247. package/src/components/ThreadCard/AvatarSection.tsx +42 -0
  248. package/src/components/ThreadCard/NamePrefixIcon.tsx +45 -0
  249. package/src/components/ThreadCard/ThreadCard.tsx +145 -0
  250. package/src/components/ThreadCard/UnreadBadge.tsx +35 -0
  251. package/src/components/ThreadCard/index.ts +4 -0
  252. package/src/components/ThreadCard/thread-card.utils.ts +68 -0
  253. package/src/core/index.ts +10 -0
  254. package/src/core/useChatListener.ts +85 -0
  255. package/src/core/useUserListener.ts +86 -0
  256. package/src/hooks/query-keys.ts +11 -0
  257. package/src/hooks/useChatMessages.ts +243 -0
  258. package/src/hooks/useConversationList.ts +57 -0
  259. package/src/index.tsx +36 -0
  260. package/src/screens/chat-detail/ChatAttachmentPanel.tsx +142 -0
  261. package/src/screens/chat-detail/ChatComposer.tsx +412 -0
  262. package/src/screens/chat-detail/ChatDay.tsx +73 -0
  263. package/src/screens/chat-detail/ChatDetail.tsx +118 -0
  264. package/src/screens/chat-detail/ChatDetailHeader.tsx +114 -0
  265. package/src/screens/chat-detail/ChatList.tsx +187 -0
  266. package/src/screens/chat-detail/ChatLoadEarlier.tsx +20 -0
  267. package/src/screens/chat-detail/ChatQuickActions.tsx +108 -0
  268. package/src/screens/chat-detail/ChatScrollToBottom.tsx +8 -0
  269. package/src/screens/chat-detail/ChatTextBubble.tsx +73 -0
  270. package/src/screens/chat-detail/constants.ts +76 -0
  271. package/src/screens/chat-detail/index.ts +33 -0
  272. package/src/screens/chat-detail/messages/ChatMessageBubble.tsx +24 -0
  273. package/src/screens/chat-detail/messages/types.ts +14 -0
  274. package/src/screens/chat-detail/types.ts +97 -0
  275. package/src/screens/chat-detail/useChatActionPress.ts +17 -0
  276. package/src/screens/inbox/Inbox.tsx +164 -0
  277. package/src/screens/inbox/MessagesTab.tsx +62 -0
  278. package/src/screens/inbox/index.ts +2 -0
  279. package/src/services/apis.ts +60 -0
  280. package/src/services/index.ts +2 -0
  281. package/src/services/message.ts +61 -0
  282. package/src/store/conversation.ts +116 -0
  283. package/src/store/index.ts +3 -0
  284. package/src/store/storeConfig.ts +19 -0
  285. package/src/store/user.ts +26 -0
  286. package/src/translation/index.ts +30 -0
  287. package/src/translation/resources/i18n.ts +8 -0
  288. package/src/types/auth.ts +25 -0
  289. package/src/types/chat.ts +118 -0
  290. package/src/types/message.ts +17 -0
  291. package/src/utils/conversation.ts +106 -0
  292. package/src/utils/giftedChatMessage.ts +137 -0
  293. package/src/utils/message.ts +136 -0
  294. package/src/utils/resolveMessageType.ts +49 -0
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ export let DChatApplicationType = /*#__PURE__*/function (DChatApplicationType) {
4
+ DChatApplicationType["BIZ"] = "BIZ";
5
+ DChatApplicationType["MALL"] = "MALL";
6
+ return DChatApplicationType;
7
+ }({});
8
+ export let DChatCategory = /*#__PURE__*/function (DChatCategory) {
9
+ DChatCategory["BIZ_BIZ"] = "BIZ_BIZ";
10
+ DChatCategory["BIZ_MALL"] = "BIZ_MALL";
11
+ DChatCategory["GROUP"] = "GROUP";
12
+ DChatCategory["BIZ_BOT_PDP"] = "BIZ_BOT_PDP";
13
+ DChatCategory["BIZ_BOT_CRM"] = "BIZ_BOT_CRM";
14
+ return DChatCategory;
15
+ }({});
16
+ export let DChatType = /*#__PURE__*/function (DChatType) {
17
+ DChatType["SINGLE"] = "SINGLE";
18
+ DChatType["GROUP"] = "GROUP";
19
+ return DChatType;
20
+ }({});
21
+ export let DMemberRole = /*#__PURE__*/function (DMemberRole) {
22
+ DMemberRole["AGENT"] = "AGENT";
23
+ DMemberRole["MEMBER"] = "MEMBER";
24
+ return DMemberRole;
25
+ }({});
26
+ //# sourceMappingURL=chat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DChatApplicationType","DChatCategory","DChatType","DMemberRole"],"sourceRoot":"../../../src","sources":["types/chat.ts"],"mappings":";;AAWA,WAAYA,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAKhC,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAQzB,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AAKrB,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ export const DChatMessageType = {
4
+ Text: 'TEXT',
5
+ Link: 'LINK',
6
+ Image: 'IMAGE',
7
+ Video: 'VIDEO',
8
+ File: 'FILE',
9
+ Order: 'ORDER',
10
+ Unsupported: 'UNSUPPORTED'
11
+ };
12
+ export const CUSTOM_MESSAGE_DATA_TYPE = {
13
+ LINK: 'LINK',
14
+ ORDER: 'ORDER'
15
+ };
16
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DChatMessageType","Text","Link","Image","Video","File","Order","Unsupported","CUSTOM_MESSAGE_DATA_TYPE","LINK","ORDER"],"sourceRoot":"../../../src","sources":["types/message.ts"],"mappings":";;AAAA,OAAO,MAAMA,gBAAgB,GAAG;EAC9BC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,WAAW,EAAE;AACf,CAAU;AAKV,OAAO,MAAMC,wBAAwB,GAAG;EACtCC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACT,CAAU","ignoreList":[]}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ import { SessionType } from '@droppii/openim-rn-client-sdk';
4
+ import { DChatCategory } from "../types/chat.js";
5
+ export const conversationCompare = (a, b) => {
6
+ if (a.isPinned !== b.isPinned) return a.isPinned ? -1 : 1;
7
+ const aCompare = a.draftTextTime > a.latestMsgSendTime ? a.draftTextTime : a.latestMsgSendTime;
8
+ const bCompare = b.draftTextTime > b.latestMsgSendTime ? b.draftTextTime : b.latestMsgSendTime;
9
+ return bCompare - aCompare;
10
+ };
11
+ export const dConversationCompare = (a, b) => {
12
+ const aIsPinned = a.pinnedAt != null;
13
+ const bIsPinned = b.pinnedAt != null;
14
+ if (aIsPinned !== bIsPinned) return aIsPinned ? -1 : 1;
15
+ const aCreateTime = a.lastMessage?.createTime ?? 0;
16
+ const bCreateTime = b.lastMessage?.createTime ?? 0;
17
+ return bCreateTime - aCreateTime;
18
+ };
19
+ export const mergeOpenIMIntoConversation = (droppii, openim) => {
20
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
21
+ const {
22
+ latestMsg,
23
+ conversationID,
24
+ ...openimRest
25
+ } = openim;
26
+ let lastMessage = droppii.lastMessage;
27
+ if (latestMsg) {
28
+ try {
29
+ lastMessage = JSON.parse(latestMsg);
30
+ } catch {
31
+ // keep droppii lastMessage if parse fails
32
+ }
33
+ }
34
+ return {
35
+ ...droppii,
36
+ ...openimRest,
37
+ lastMessage
38
+ };
39
+ };
40
+ export const getConversationID = (sessionType, senderID, receiverID) => {
41
+ const prefix = sessionType === SessionType.Single ? 'si' : sessionType === SessionType.Notification ? 'sn' : 'sg';
42
+ return [prefix, senderID, receiverID].filter(Boolean).join('_');
43
+ };
44
+ export const isBotCrmChat = chatCategory => chatCategory === DChatCategory.BIZ_BOT_CRM || chatCategory === DChatCategory.BIZ_BOT_PDP;
45
+ export const resolveDisplayName = (item, t) => {
46
+ if (isBotCrmChat(item.chatCategory)) {
47
+ const botName = item.peer.botName?.trim();
48
+ if (botName) return botName;
49
+ return t('thread_card_bot_crm_name');
50
+ }
51
+ const fullName = item.peer.fullName?.trim();
52
+ if (fullName) return fullName;
53
+ const username = item.peer.username?.trim();
54
+ if (username) return username;
55
+ return t('thread_card_fallback_name');
56
+ };
57
+ export const resolveAvatarUrl = item => {
58
+ if (isBotCrmChat(item.chatCategory)) return null;
59
+ return item.peer.avatar;
60
+ };
61
+ //# sourceMappingURL=conversation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SessionType","DChatCategory","conversationCompare","a","b","isPinned","aCompare","draftTextTime","latestMsgSendTime","bCompare","dConversationCompare","aIsPinned","pinnedAt","bIsPinned","aCreateTime","lastMessage","createTime","bCreateTime","mergeOpenIMIntoConversation","droppii","openim","latestMsg","conversationID","openimRest","JSON","parse","getConversationID","sessionType","senderID","receiverID","prefix","Single","Notification","filter","Boolean","join","isBotCrmChat","chatCategory","BIZ_BOT_CRM","BIZ_BOT_PDP","resolveDisplayName","item","t","botName","peer","trim","fullName","username","resolveAvatarUrl","avatar"],"sourceRoot":"../../../src","sources":["utils/conversation.ts"],"mappings":";;AAAA,SACEA,WAAW,QAEN,+BAA+B;AACtC,SAGEC,aAAa,QACR,kBAAe;AAEtB,OAAO,MAAMC,mBAAmB,GAAGA,CACjCC,CAAmB,EACnBC,CAAmB,KAChB;EACH,IAAID,CAAC,CAACE,QAAQ,KAAKD,CAAC,CAACC,QAAQ,EAAE,OAAOF,CAAC,CAACE,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC;EAEzD,MAAMC,QAAQ,GACZH,CAAC,CAACI,aAAa,GAAGJ,CAAC,CAACK,iBAAiB,GACjCL,CAAC,CAACI,aAAa,GACfJ,CAAC,CAACK,iBAAiB;EACzB,MAAMC,QAAQ,GACZL,CAAC,CAACG,aAAa,GAAGH,CAAC,CAACI,iBAAiB,GACjCJ,CAAC,CAACG,aAAa,GACfH,CAAC,CAACI,iBAAiB;EAEzB,OAAOC,QAAQ,GAAGH,QAAQ;AAC5B,CAAC;AAED,OAAO,MAAMI,oBAAoB,GAAGA,CAClCP,CAAoB,EACpBC,CAAoB,KACjB;EACH,MAAMO,SAAS,GAAGR,CAAC,CAACS,QAAQ,IAAI,IAAI;EACpC,MAAMC,SAAS,GAAGT,CAAC,CAACQ,QAAQ,IAAI,IAAI;EAEpC,IAAID,SAAS,KAAKE,SAAS,EAAE,OAAOF,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC;EAEtD,MAAMG,WAAW,GAAGX,CAAC,CAACY,WAAW,EAAEC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,IAAIF,OAAO,EAAE,OAAOA,OAAO;IAC3B,OAAOD,CAAC,CAAC,0BAA0B,CAAC;EACtC;EAEA,MAAMI,QAAQ,GAAGL,IAAI,CAACG,IAAI,CAACE,QAAQ,EAAED,IAAI,CAAC,CAAC;EAC3C,IAAIC,QAAQ,EAAE,OAAOA,QAAQ;EAC7B,MAAMC,QAAQ,GAAGN,IAAI,CAACG,IAAI,CAACG,QAAQ,EAAEF,IAAI,CAAC,CAAC;EAC3C,IAAIE,QAAQ,EAAE,OAAOA,QAAQ;EAC7B,OAAOL,CAAC,CAAC,2BAA2B,CAAC;AACvC,CAAC;AAED,OAAO,MAAMM,gBAAgB,GAAIP,IAAuB,IAAK;EAC3D,IAAIL,YAAY,CAACK,IAAI,CAACJ,YAAY,CAAC,EAAE,OAAO,IAAI;EAChD,OAAOI,IAAI,CAACG,IAAI,CAACK,MAAM;AACzB,CAAC","ignoreList":[]}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ import { MessageStatus, MessageType } from '@droppii/openim-rn-client-sdk';
4
+ import { resolveChatMessageType } from "./resolveMessageType.js";
5
+ const SYSTEM_MESSAGE_TYPES = new Set([MessageType.FriendAdded, MessageType.OANotification, MessageType.GroupCreated, MessageType.GroupInfoUpdated, MessageType.MemberQuit, MessageType.GroupOwnerTransferred, MessageType.MemberKicked, MessageType.MemberInvited, MessageType.MemberEnter, MessageType.GroupDismissed, MessageType.GroupMemberMuted, MessageType.GroupMemberCancelMuted, MessageType.GroupMuted, MessageType.GroupCancelMuted, MessageType.GroupAnnouncementUpdated, MessageType.GroupNameUpdated, MessageType.RevokeMessage]);
6
+ const getMessageText = message => {
7
+ switch (message.contentType) {
8
+ case MessageType.TextMessage:
9
+ return message.textElem?.content ?? message.content;
10
+ case MessageType.AtTextMessage:
11
+ return message.atTextElem?.text ?? message.content;
12
+ case MessageType.QuoteMessage:
13
+ return message.quoteElem?.text ?? message.content;
14
+ case MessageType.PictureMessage:
15
+ return '';
16
+ case MessageType.VoiceMessage:
17
+ return message.soundElem?.sourceUrl ? '' : '[Tin nhắn thoại]';
18
+ case MessageType.VideoMessage:
19
+ return message.videoElem?.videoUrl ? '' : '[Video]';
20
+ case MessageType.FileMessage:
21
+ return message.fileElem?.fileName ?? message.content;
22
+ case MessageType.CardMessage:
23
+ return message.cardElem?.nickname ?? message.content;
24
+ case MessageType.LocationMessage:
25
+ return message.locationElem?.description ?? message.content;
26
+ case MessageType.CustomMessage:
27
+ return message.customElem?.description ?? message.content;
28
+ case MessageType.FaceMessage:
29
+ return '[Sticker]';
30
+ default:
31
+ if (message.notificationElem?.detail) {
32
+ return message.notificationElem.detail;
33
+ }
34
+ return message.content || '';
35
+ }
36
+ };
37
+ const mapMessageStatus = message => {
38
+ switch (message.status) {
39
+ case MessageStatus.Sending:
40
+ return {
41
+ pending: true
42
+ };
43
+ case MessageStatus.Succeed:
44
+ return {
45
+ sent: true,
46
+ received: message.isRead
47
+ };
48
+ case MessageStatus.Failed:
49
+ return {
50
+ pending: true
51
+ };
52
+ default:
53
+ return {};
54
+ }
55
+ };
56
+ export const mapOpenIMMessageToGiftedChat = message => {
57
+ const gifted = {
58
+ _id: message.clientMsgID || message.serverMsgID,
59
+ text: getMessageText(message),
60
+ createdAt: new Date(message.sendTime || message.createTime),
61
+ user: {
62
+ _id: String(message.sendID),
63
+ name: message.senderNickname,
64
+ avatar: message.senderFaceUrl || undefined
65
+ },
66
+ openIMMessage: message,
67
+ messageType: resolveChatMessageType(message),
68
+ ...mapMessageStatus(message)
69
+ };
70
+ if (SYSTEM_MESSAGE_TYPES.has(message.contentType)) {
71
+ gifted.system = true;
72
+ }
73
+ if (message.contentType === MessageType.PictureMessage) {
74
+ const imageUrl = message.pictureElem?.snapshotPicture?.url || message.pictureElem?.bigPicture?.url || message.pictureElem?.sourcePicture?.url;
75
+ if (imageUrl) {
76
+ gifted.image = imageUrl;
77
+ }
78
+ }
79
+ if (message.contentType === MessageType.VideoMessage && message.videoElem?.videoUrl) {
80
+ gifted.video = message.videoElem.videoUrl;
81
+ }
82
+ if (message.contentType === MessageType.VoiceMessage && message.soundElem?.sourceUrl) {
83
+ gifted.audio = message.soundElem.sourceUrl;
84
+ }
85
+ return gifted;
86
+ };
87
+ export const mapOpenIMMessagesToGiftedChat = messages => {
88
+ return messages.map(mapOpenIMMessageToGiftedChat).sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
89
+ };
90
+ //# sourceMappingURL=giftedChatMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MessageStatus","MessageType","resolveChatMessageType","SYSTEM_MESSAGE_TYPES","Set","FriendAdded","OANotification","GroupCreated","GroupInfoUpdated","MemberQuit","GroupOwnerTransferred","MemberKicked","MemberInvited","MemberEnter","GroupDismissed","GroupMemberMuted","GroupMemberCancelMuted","GroupMuted","GroupCancelMuted","GroupAnnouncementUpdated","GroupNameUpdated","RevokeMessage","getMessageText","message","contentType","TextMessage","textElem","content","AtTextMessage","atTextElem","text","QuoteMessage","quoteElem","PictureMessage","VoiceMessage","soundElem","sourceUrl","VideoMessage","videoElem","videoUrl","FileMessage","fileElem","fileName","CardMessage","cardElem","nickname","LocationMessage","locationElem","description","CustomMessage","customElem","FaceMessage","notificationElem","detail","mapMessageStatus","status","Sending","pending","Succeed","sent","received","isRead","Failed","mapOpenIMMessageToGiftedChat","gifted","_id","clientMsgID","serverMsgID","createdAt","Date","sendTime","createTime","user","String","sendID","name","senderNickname","avatar","senderFaceUrl","undefined","openIMMessage","messageType","has","system","imageUrl","pictureElem","snapshotPicture","url","bigPicture","sourcePicture","image","video","audio","mapOpenIMMessagesToGiftedChat","messages","map","sort","a","b","getTime"],"sourceRoot":"../../../src","sources":["utils/giftedChatMessage.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,WAAW,QAAQ,+BAA+B;AAI1E,SAASC,sBAAsB,QAAQ,yBAAsB;AAO7D,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAAc,CAChDH,WAAW,CAACI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,CACZC,GAAG,CAAChC,4BAA4B,CAAC,CACjCiC,IAAI,CACH,CAACC,CAAC,EAAEC,CAAC,KACH,IAAI7B,IAAI,CAAC6B,CAAC,CAAC9B,SAAS,CAAC,CAAC+B,OAAO,CAAC,CAAC,GAAG,IAAI9B,IAAI,CAAC4B,CAAC,CAAC7B,SAAS,CAAC,CAAC+B,OAAO,CAAC,CACpE,CAAC;AACL,CAAC","ignoreList":[]}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ import { SessionType } from '@droppii/openim-rn-client-sdk';
4
+ import { getConversationID } from "./conversation.js";
5
+ const getMessageTime = message => message.sendTime || message.createTime || 0;
6
+ const getMessageKey = message => message.clientMsgID || message.serverMsgID;
7
+ export const mergeMessages = (current, incoming) => {
8
+ const map = new Map();
9
+ for (const message of [...current, ...incoming]) {
10
+ const key = getMessageKey(message);
11
+ if (key) {
12
+ map.set(key, message);
13
+ }
14
+ }
15
+ return Array.from(map.values()).sort((a, b) => getMessageTime(a) - getMessageTime(b));
16
+ };
17
+ export const normalizeCreatedMessage = message => {
18
+ let normalized = message;
19
+ while (typeof normalized === 'string') {
20
+ normalized = JSON.parse(normalized);
21
+ }
22
+ if (normalized == null || typeof normalized !== 'object') {
23
+ throw new Error('Invalid OpenIM message payload');
24
+ }
25
+ return normalized;
26
+ };
27
+ export const resolveHistoryLastMinSeq = (history, fallbackMessage) => {
28
+ if (history.lastMinSeq != null) {
29
+ return history.lastMinSeq;
30
+ }
31
+ return fallbackMessage?.seq ?? 0;
32
+ };
33
+ export const getHistoryPaginationAnchor = messages => {
34
+ if (!messages.length) {
35
+ return null;
36
+ }
37
+ const oldest = messages.reduce((prev, curr) => getMessageTime(curr) < getMessageTime(prev) ? curr : prev, messages[0]);
38
+ if (!oldest?.clientMsgID) {
39
+ return null;
40
+ }
41
+ return {
42
+ clientMsgID: oldest.clientMsgID
43
+ // lastMinSeq: oldest.seq ?? 0,
44
+ };
45
+ };
46
+ export const hasNewHistoryMessages = (current, incoming) => {
47
+ const currentKeys = new Set(current.map(message => getMessageKey(message)).filter(Boolean));
48
+ return incoming.some(message => {
49
+ const key = getMessageKey(message);
50
+ return !!key && !currentKeys.has(key);
51
+ });
52
+ };
53
+ export const belongsToConversation = (message, conversationId, groupID) => {
54
+ const runtimeConversationId = message.conversationID;
55
+ if (runtimeConversationId === conversationId) {
56
+ return true;
57
+ }
58
+ if (groupID) {
59
+ return message.groupID === groupID || conversationId === `sg_${groupID}` || conversationId.endsWith(`_${groupID}`);
60
+ }
61
+ if (message.sessionType !== SessionType.Single) {
62
+ return false;
63
+ }
64
+ const forwardId = getConversationID(message.sessionType, message.sendID, message.recvID);
65
+ const reverseId = getConversationID(message.sessionType, message.recvID, message.sendID);
66
+ return conversationId === forwardId || conversationId === reverseId;
67
+ };
68
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SessionType","getConversationID","getMessageTime","message","sendTime","createTime","getMessageKey","clientMsgID","serverMsgID","mergeMessages","current","incoming","map","Map","key","set","Array","from","values","sort","a","b","normalizeCreatedMessage","normalized","JSON","parse","Error","resolveHistoryLastMinSeq","history","fallbackMessage","lastMinSeq","seq","getHistoryPaginationAnchor","messages","length","oldest","reduce","prev","curr","hasNewHistoryMessages","currentKeys","Set","filter","Boolean","some","has","belongsToConversation","conversationId","groupID","runtimeConversationId","conversationID","endsWith","sessionType","Single","forwardId","sendID","recvID","reverseId"],"sourceRoot":"../../../src","sources":["utils/message.ts"],"mappings":";;AAAA,SAASA,WAAW,QAA0B,+BAA+B;AAE7E,SAASC,iBAAiB,QAAQ,mBAAgB;AAElD,MAAMC,cAAc,GAAIC,OAAqB,IAC3CA,OAAO,CAACC,QAAQ,IAAID,OAAO,CAACE,UAAU,IAAI,CAAC;AAE7C,MAAMC,aAAa,GAAIH,OAAqB,IAC1CA,OAAO,CAACI,WAAW,IAAIJ,OAAO,CAACK,WAAW;AAE5C,OAAO,MAAMC,aAAa,GAAGA,CAC3BC,OAAuB,EAC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iB,CACjCE,OAAO,CAACiD,WAAW,EACnBjD,OAAO,CAACoD,MAAM,EACdpD,OAAO,CAACqD,MACV,CAAC;EACD,MAAMC,SAAS,GAAGxD,iBAAiB,CACjCE,OAAO,CAACiD,WAAW,EACnBjD,OAAO,CAACqD,MAAM,EACdrD,OAAO,CAACoD,MACV,CAAC;EAED,OAAOR,cAAc,KAAKO,SAAS,IAAIP,cAAc,KAAKU,SAAS;AACrE,CAAC","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ import { MessageType } from '@droppii/openim-rn-client-sdk';
4
+ import { CUSTOM_MESSAGE_DATA_TYPE, DChatMessageType } from "../types/message.js";
5
+ const parseCustomDataType = message => {
6
+ const data = message.customElem?.data;
7
+ if (!data) {
8
+ return undefined;
9
+ }
10
+ try {
11
+ const parsed = JSON.parse(data);
12
+ return parsed.type ?? parsed.messageType;
13
+ } catch {
14
+ return undefined;
15
+ }
16
+ };
17
+ export const resolveChatMessageType = message => {
18
+ switch (message.contentType) {
19
+ case MessageType.TextMessage:
20
+ case MessageType.AtTextMessage:
21
+ case MessageType.QuoteMessage:
22
+ return DChatMessageType.Text;
23
+ case MessageType.PictureMessage:
24
+ return DChatMessageType.Image;
25
+ case MessageType.VideoMessage:
26
+ return DChatMessageType.Video;
27
+ case MessageType.FileMessage:
28
+ return DChatMessageType.File;
29
+ case MessageType.CustomMessage:
30
+ {
31
+ const customType = parseCustomDataType(message);
32
+ if (customType === CUSTOM_MESSAGE_DATA_TYPE.ORDER) {
33
+ return DChatMessageType.Order;
34
+ }
35
+ if (customType === CUSTOM_MESSAGE_DATA_TYPE.LINK) {
36
+ return DChatMessageType.Link;
37
+ }
38
+ return DChatMessageType.Unsupported;
39
+ }
40
+ default:
41
+ return DChatMessageType.Unsupported;
42
+ }
43
+ };
44
+ //# sourceMappingURL=resolveMessageType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MessageType","CUSTOM_MESSAGE_DATA_TYPE","DChatMessageType","parseCustomDataType","message","data","customElem","undefined","parsed","JSON","parse","type","messageType","resolveChatMessageType","contentType","TextMessage","AtTextMessage","QuoteMessage","Text","PictureMessage","Image","VideoMessage","Video","FileMessage","File","CustomMessage","customType","ORDER","Order","LINK","Link","Unsupported"],"sourceRoot":"../../../src","sources":["utils/resolveMessageType.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,+BAA+B;AAE3D,SAASC,wBAAwB,EAAEC,gBAAgB,QAAQ,qBAAkB;AAE7E,MAAMC,mBAAmB,GAAIC,OAAqB,IAAyB;EACzE,MAAMC,IAAI,GAAGD,OAAO,CAACE,UAAU,EAAED,IAAI;EACrC,IAAI,CAACA,IAAI,EAAE;IACT,OAAOE,SAAS;EAClB;EAEA,IAAI;IACF,MAAMC,MAAM,GAAGC,IAAI,CAACC,KAAK,CAACL,IAAI,CAA4C;IAC1E,OAAOG,MAAM,CAACG,IAAI,IAAIH,MAAM,CAACI,WAAW;EAC1C,CAAC,CAAC,MAAM;IACN,OAAOL,SAAS;EAClB;AACF,CAAC;AAED,OAAO,MAAMM,sBAAsB,GACjCT,OAAqB,IACA;EACrB,QAAQA,OAAO,CAACU,WAAW;IACzB,KAAKd,WAAW,CAACe,WAAW;IAC5B,KAAKf,WAAW,CAACgB,aAAa;IAC9B,KAAKhB,WAAW,CAACiB,YAAY;MAC3B,OAAOf,gBAAgB,CAACgB,IAAI;IAC9B,KAAKlB,WAAW,CAACmB,cAAc;MAC7B,OAAOjB,gBAAgB,CAACkB,KAAK;IAC/B,KAAKpB,WAAW,CAACqB,YAAY;MAC3B,OAAOnB,gBAAgB,CAACoB,KAAK;IAC/B,KAAKtB,WAAW,CAACuB,WAAW;MAC1B,OAAOrB,gBAAgB,CAACsB,IAAI;IAC9B,KAAKxB,WAAW,CAACyB,aAAa;MAAE;QAC9B,MAAMC,UAAU,GAAGvB,mBAAmB,CAACC,OAAO,CAAC;QAE/C,IAAIsB,UAAU,KAAKzB,wBAAwB,CAAC0B,KAAK,EAAE;UACjD,OAAOzB,gBAAgB,CAAC0B,KAAK;QAC/B;QAEA,IAAIF,UAAU,KAAKzB,wBAAwB,CAAC4B,IAAI,EAAE;UAChD,OAAO3B,gBAAgB,CAAC4B,IAAI;QAC9B;QAEA,OAAO5B,gBAAgB,CAAC6B,WAAW;MACrC;IACA;MACE,OAAO7B,gBAAgB,CAAC6B,WAAW;EACvC;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,7 @@
1
+ declare const Images: {
2
+ ICON_BOT: any;
3
+ TAG_BOT: any;
4
+ TAG_MALL: any;
5
+ };
6
+ export default Images;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/assets/images/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM;;;;CAIX,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { AvatarProps } from './Avatar.types';
2
+ declare const Avatar: import("react").MemoExoticComponent<({ source, size, type, secondarySource, badge, fullName, borderColor, borderWidth, placeholderColor, onPress, }: AvatarProps) => import("react/jsx-runtime").JSX.Element>;
3
+ export default Avatar;
4
+ //# sourceMappingURL=Avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,QAAA,MAAM,MAAM,uJAYP,WAAW,6CAmEf,CAAC;AAIF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,18 @@
1
+ export interface AvatarProps {
2
+ userId?: string;
3
+ source?: string | null;
4
+ size?: 'sm' | 'md' | 'lg';
5
+ type?: 'single' | 'double';
6
+ secondarySource?: string | null;
7
+ badge?: {
8
+ label?: string;
9
+ variant?: 'bot' | 'support' | 'mall' | 'custom';
10
+ };
11
+ fullName?: string;
12
+ borderColor?: string;
13
+ borderWidth?: number;
14
+ placeholderColor?: string;
15
+ backgroundColor?: string;
16
+ onPress?: () => void;
17
+ }
18
+ //# sourceMappingURL=Avatar.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/Avatar/Avatar.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;KACjD,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
@@ -0,0 +1,14 @@
1
+ declare const SIZE_MAP: {
2
+ readonly sm: 24;
3
+ readonly md: 48;
4
+ readonly lg: 64;
5
+ };
6
+ declare const TYPO_MAP: {
7
+ readonly 24: "TextXsBold";
8
+ readonly 48: "TextNmBold";
9
+ readonly 64: "TextLgBold";
10
+ };
11
+ export declare const getInitials: (fullName?: string) => string;
12
+ export declare const getBadgeImage: (variant?: string) => any;
13
+ export { SIZE_MAP, TYPO_MAP };
14
+ //# sourceMappingURL=Avatar.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/Avatar/Avatar.utils.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,QAAQ;;;;CAIJ,CAAC;AAEX,QAAA,MAAM,QAAQ;;;;CAIJ,CAAC;AAEX,eAAO,MAAM,WAAW,GAAI,WAAW,MAAM,KAAG,MAqB/C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,QAW7C,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ interface AvatarBadgeProps {
2
+ variant?: 'bot' | 'support' | 'mall' | 'custom';
3
+ size: number;
4
+ }
5
+ export declare const AvatarBadge: import("react").MemoExoticComponent<({ variant, size: _size }: AvatarBadgeProps) => import("react/jsx-runtime").JSX.Element>;
6
+ export {};
7
+ //# sourceMappingURL=AvatarBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarBadge.d.ts","sourceRoot":"","sources":["../../../../../src/components/Avatar/AvatarBadge.tsx"],"names":[],"mappings":"AAIA,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,WAAW,iEACK,gBAAgB,6CAK5C,CAAC"}
@@ -0,0 +1,13 @@
1
+ interface DoubleAvatarProps {
2
+ primarySource: string | null | undefined;
3
+ secondarySource: string | null | undefined;
4
+ size: number;
5
+ borderColor: string;
6
+ borderWidth: number;
7
+ placeholderColor: string;
8
+ primaryFullName?: string;
9
+ secondaryFullName?: string;
10
+ }
11
+ export declare const DoubleAvatar: import("react").MemoExoticComponent<({ primarySource, secondarySource, size, borderColor, borderWidth, placeholderColor, primaryFullName, secondaryFullName, }: DoubleAvatarProps) => import("react/jsx-runtime").JSX.Element>;
12
+ export {};
13
+ //# sourceMappingURL=DoubleAvatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DoubleAvatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Avatar/DoubleAvatar.tsx"],"names":[],"mappings":"AAKA,UAAU,iBAAiB;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,YAAY,kKAUpB,iBAAiB,6CA6CrB,CAAC"}
@@ -0,0 +1,12 @@
1
+ interface SingleAvatarProps {
2
+ source: string | null | undefined;
3
+ size: number;
4
+ borderColor: string;
5
+ borderWidth: number;
6
+ placeholderColor: string;
7
+ backgroundColor: string;
8
+ fullName?: string;
9
+ }
10
+ export declare const SingleAvatar: import("react").MemoExoticComponent<({ source, size, borderColor, borderWidth, placeholderColor, backgroundColor, fullName, }: SingleAvatarProps) => import("react/jsx-runtime").JSX.Element>;
11
+ export {};
12
+ //# sourceMappingURL=SingleAvatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleAvatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Avatar/SingleAvatar.tsx"],"names":[],"mappings":"AAKA,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,iIASpB,iBAAiB,6CAwCrB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { default as Avatar } from './Avatar';
2
+ export { SingleAvatar } from './SingleAvatar';
3
+ export { DoubleAvatar } from './DoubleAvatar';
4
+ export { AvatarBadge } from './AvatarBadge';
5
+ export type { AvatarProps } from './Avatar.types';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { DConversationItem } from '../../types/chat';
2
+ interface AvatarSectionProps extends Partial<Pick<DConversationItem, 'chatCategory' | 'applicationType' | 'chatType'>> {
3
+ avatar: string | null;
4
+ fullName: string;
5
+ }
6
+ export declare const AvatarSection: import("react").MemoExoticComponent<({ avatar, fullName, chatCategory, applicationType }: AvatarSectionProps) => import("react/jsx-runtime").JSX.Element>;
7
+ export {};
8
+ //# sourceMappingURL=AvatarSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarSection.d.ts","sourceRoot":"","sources":["../../../../../src/components/ThreadCard/AvatarSection.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,UAAU,kBAAmB,SAAQ,OAAO,CAC1C,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,iBAAiB,GAAG,UAAU,CAAC,CACzE;IACC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,4FAC8B,kBAAkB,6CA0BzE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { DChatCategory, DChatType } from '../../types/chat';
2
+ interface NamePrefixIconProps {
3
+ chatCategory?: DChatCategory;
4
+ chatType?: DChatType;
5
+ }
6
+ export declare const NamePrefixIcon: import("react").MemoExoticComponent<({ chatCategory, chatType }: NamePrefixIconProps) => import("react/jsx-runtime").JSX.Element>;
7
+ export {};
8
+ //# sourceMappingURL=NamePrefixIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NamePrefixIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/ThreadCard/NamePrefixIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5D,UAAU,mBAAmB;IAC3B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,mEACI,mBAAmB,6CAgCjD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type GestureResponderEvent } from 'react-native';
2
+ interface ThreadCardProps {
3
+ item: string;
4
+ onPress?: (params: {
5
+ item: string;
6
+ event: GestureResponderEvent;
7
+ }) => void;
8
+ }
9
+ declare const ThreadCard: import("react").MemoExoticComponent<({ item, onPress }: ThreadCardProps) => import("react/jsx-runtime").JSX.Element>;
10
+ export default ThreadCard;
11
+ //# sourceMappingURL=ThreadCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreadCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/ThreadCard/ThreadCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAUtE,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,qBAAqB,CAAA;KAAE,KAAK,IAAI,CAAC;CAC5E;AAED,QAAA,MAAM,UAAU,0DAA4B,eAAe,6CAoHzD,CAAC;AAIH,eAAe,UAAU,CAAC"}
@@ -0,0 +1,6 @@
1
+ interface UnreadBadgeProps {
2
+ count: number;
3
+ }
4
+ export declare const UnreadBadge: import("react").MemoExoticComponent<({ count }: UnreadBadgeProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export {};
6
+ //# sourceMappingURL=UnreadBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnreadBadge.d.ts","sourceRoot":"","sources":["../../../../../src/components/ThreadCard/UnreadBadge.tsx"],"names":[],"mappings":"AAIA,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,WAAW,kDAAoB,gBAAgB,6CAY1D,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { default as ThreadCard } from './ThreadCard';
2
+ export { AvatarSection } from './AvatarSection';
3
+ export { NamePrefixIcon } from './NamePrefixIcon';
4
+ export { UnreadBadge } from './UnreadBadge';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ThreadCard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DMessageItem } from '../../types/chat';
2
+ export declare const getLastMessageText: (message: DMessageItem | undefined, currentUserId?: string) => string;
3
+ export declare const formatTimestamp: (ts: number | string | null) => string;
4
+ //# sourceMappingURL=thread-card.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread-card.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/ThreadCard/thread-card.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAYrD,eAAO,MAAM,kBAAkB,GAC7B,SAAS,YAAY,GAAG,SAAS,EACjC,gBAAgB,MAAM,KACrB,MASF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,GAAG,MAAM,GAAG,IAAI,KAAG,MAwC5D,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const initChatSdk: any;
2
+ export declare const useChatSdk: () => void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,KAAoC,CAAC;AAE7D,eAAO,MAAM,UAAU,YAGtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const useChatListener: () => void;
2
+ //# sourceMappingURL=useChatListener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChatListener.d.ts","sourceRoot":"","sources":["../../../../src/core/useChatListener.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe,YAyE3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const useUserListener: () => void;
2
+ //# sourceMappingURL=useUserListener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUserListener.d.ts","sourceRoot":"","sources":["../../../../src/core/useUserListener.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,YA4E3B,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const conversationQueryKeys: {
2
+ all: readonly ["conversations"];
3
+ lists: () => readonly ["conversations", "list"];
4
+ list: (applicationType: string) => readonly ["conversations", "list", string];
5
+ details: () => readonly ["conversations", "detail"];
6
+ detail: (conversationId: string) => readonly ["conversations", "detail", string];
7
+ };
8
+ export type ConversationQueryKeys = typeof conversationQueryKeys;
9
+ //# sourceMappingURL=query-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../../../../src/hooks/query-keys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB;;;4BAGR,MAAM;;6BAGL,MAAM;CAEhC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAC"}