@webinex/chatify 1.0.3-rc3 → 2.0.0-alpha10

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 (362) hide show
  1. package/dist/Chatify-DGRV4QKP.js +2203 -0
  2. package/dist/Chatify-DGRV4QKP.js.map +1 -0
  3. package/dist/Chatify.css +670 -0
  4. package/dist/audit.css +60 -0
  5. package/dist/audit.js +242 -0
  6. package/dist/audit.js.map +1 -0
  7. package/dist/index.js +97 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/types/audit/AuditChatList.d.ts +9 -0
  10. package/dist/types/audit/AuditConversationPanel.d.ts +10 -0
  11. package/dist/types/audit/AuditPanel.d.ts +14 -0
  12. package/dist/types/audit/AuditPanelCustomizeValue.d.ts +9 -0
  13. package/dist/types/audit/AuditSearch.d.ts +5 -0
  14. package/dist/types/audit/AuditSearchValue.d.ts +14 -0
  15. package/dist/types/audit/auditApi.d.ts +97 -0
  16. package/dist/types/audit/index.d.ts +17 -0
  17. package/dist/types/core/api/api.d.ts +17295 -0
  18. package/dist/types/core/api/baseApi.d.ts +15 -0
  19. package/dist/types/core/api/index.d.ts +1 -0
  20. package/dist/types/core/client.d.ts +86 -0
  21. package/dist/types/core/constants.d.ts +1 -0
  22. package/dist/types/core/debounce.d.ts +27 -0
  23. package/dist/types/core/index.d.ts +4 -0
  24. package/dist/types/core/types.d.ts +127 -0
  25. package/dist/{esm/types → types}/index.d.ts +0 -1
  26. package/dist/types/ui/Chat/ChatContext.d.ts +10 -0
  27. package/dist/types/ui/Chat/ChatEditableHeaderName.d.ts +1 -0
  28. package/dist/types/ui/Chat/ChatHeaderActions.d.ts +1 -0
  29. package/dist/types/ui/Chat/ChatPanel.d.ts +13 -0
  30. package/dist/types/ui/Chat/ChatView.d.ts +16 -0
  31. package/dist/types/ui/Chat/Members/ChatMembersButton.d.ts +1 -0
  32. package/dist/types/ui/Chat/Members/ChatMembersPanel.d.ts +1 -0
  33. package/dist/types/ui/Chat/Members/ChatMembersPreview.d.ts +1 -0
  34. package/dist/types/ui/Chat/Members/index.d.ts +11 -0
  35. package/dist/types/ui/Chat/index.d.ts +6 -0
  36. package/dist/types/ui/ChatGroup/ChatGroupContext.d.ts +12 -0
  37. package/dist/types/ui/ChatGroup/ChatGroupPanel.d.ts +15 -0
  38. package/dist/types/ui/ChatGroup/Create/CreateChatButton.d.ts +1 -0
  39. package/dist/{esm/types/ui/CreateChatPanel → types/ui/ChatGroup/Create}/CreateChatForm.d.ts +1 -2
  40. package/dist/types/ui/ChatGroup/Create/CreateChatMemberInput.d.ts +4 -0
  41. package/dist/types/ui/ChatGroup/Create/CreateChatNameInput.d.ts +4 -0
  42. package/dist/types/ui/ChatGroup/Create/CreateChatPanel.d.ts +1 -0
  43. package/dist/types/ui/ChatGroup/Create/index.d.ts +17 -0
  44. package/dist/types/ui/ChatGroup/Layout/ChatGroupAside.d.ts +1 -0
  45. package/dist/types/ui/ChatGroup/Layout/ChatGroupBody.d.ts +1 -0
  46. package/dist/types/ui/ChatGroup/Layout/ChatGroupFooter.d.ts +1 -0
  47. package/dist/types/ui/ChatGroup/Layout/ChatGroupHeader.d.ts +1 -0
  48. package/dist/types/ui/ChatGroup/Layout/ChatGroupMain.d.ts +1 -0
  49. package/dist/types/ui/ChatGroup/Layout/index.d.ts +17 -0
  50. package/dist/types/ui/ChatGroup/List/ChatListPanel.d.ts +1 -0
  51. package/dist/types/ui/ChatGroup/List/index.d.ts +6 -0
  52. package/dist/types/ui/ChatGroup/index.d.ts +5 -0
  53. package/dist/types/ui/Chatify.d.ts +9 -0
  54. package/dist/types/ui/Conversation/Conversation.d.ts +22 -0
  55. package/dist/types/ui/Conversation/ConversationActions.d.ts +1 -0
  56. package/dist/types/ui/Conversation/ConversationBody.d.ts +1 -0
  57. package/dist/types/ui/Conversation/ConversationContext.d.ts +23 -0
  58. package/dist/types/ui/Conversation/ConversationHeader.d.ts +1 -0
  59. package/dist/types/ui/Conversation/ConversationName.d.ts +1 -0
  60. package/dist/types/ui/Conversation/InputBox/InputBox.d.ts +1 -0
  61. package/dist/types/ui/Conversation/InputBox/InputBoxFile.d.ts +7 -0
  62. package/dist/types/ui/Conversation/InputBox/InputBoxFileList.d.ts +7 -0
  63. package/dist/types/ui/Conversation/InputBox/InputFilesBox.d.ts +11 -0
  64. package/dist/types/ui/Conversation/InputBox/InputSubmitButtonBox.d.ts +6 -0
  65. package/dist/types/ui/Conversation/InputBox/InputTextBox.d.ts +9 -0
  66. package/dist/types/ui/Conversation/InputBox/index.d.ts +21 -0
  67. package/dist/types/ui/Conversation/Message/MessageAuthor.d.ts +2 -0
  68. package/dist/types/ui/Conversation/Message/MessageBox.d.ts +5 -0
  69. package/dist/types/ui/Conversation/Message/MessageContent.d.ts +2 -0
  70. package/dist/types/ui/Conversation/Message/MessageFile.d.ts +5 -0
  71. package/dist/types/ui/Conversation/Message/MessageFileList.d.ts +2 -0
  72. package/dist/types/ui/Conversation/Message/MessageInfoBox.d.ts +2 -0
  73. package/dist/{esm/types/ui → types/ui/Conversation}/Message/MessageRow.d.ts +1 -1
  74. package/dist/types/ui/Conversation/Message/MessageText.d.ts +2 -0
  75. package/dist/types/ui/Conversation/Message/index.d.ts +26 -0
  76. package/dist/types/ui/Conversation/NextObserver/NextMessagesObserver.d.ts +5 -0
  77. package/dist/types/ui/Conversation/NextObserver/index.d.ts +1 -0
  78. package/dist/types/ui/Conversation/ReadObserver/MessageReadObserver.d.ts +6 -0
  79. package/dist/types/ui/Conversation/ReadObserver/index.d.ts +1 -0
  80. package/dist/types/ui/Conversation/SendingMessage/SendingMessageBox.d.ts +6 -0
  81. package/dist/types/ui/Conversation/SendingMessage/SendingMessageContent.d.ts +2 -0
  82. package/dist/types/ui/Conversation/SendingMessage/SendingMessageInfoBox.d.ts +2 -0
  83. package/dist/types/ui/Conversation/SendingMessage/SendingMessageText.d.ts +2 -0
  84. package/dist/types/ui/Conversation/SendingMessage/index.d.ts +14 -0
  85. package/dist/types/ui/Conversation/SystemMessage/SystemMessageBox.d.ts +5 -0
  86. package/dist/types/ui/Conversation/SystemMessage/SystemMessageRow.d.ts +9 -0
  87. package/dist/types/ui/Conversation/SystemMessage/index.d.ts +8 -0
  88. package/dist/types/ui/Conversation/index.d.ts +12 -0
  89. package/dist/types/ui/Thread/ThreadActions.d.ts +1 -0
  90. package/dist/types/ui/Thread/ThreadContext.d.ts +8 -0
  91. package/dist/types/ui/Thread/ThreadPanel.d.ts +14 -0
  92. package/dist/types/ui/Thread/index.d.ts +3 -0
  93. package/dist/types/ui/color.d.ts +6 -0
  94. package/dist/types/ui/common/Avatar.d.ts +5 -0
  95. package/dist/types/ui/common/ChatList/ChatList.d.ts +16 -0
  96. package/dist/types/ui/common/ChatList/ChatListItemAvatar.d.ts +2 -0
  97. package/dist/types/ui/common/ChatList/ChatListItemBox.d.ts +9 -0
  98. package/dist/types/ui/common/ChatList/ChatListItemLastMessage.d.ts +2 -0
  99. package/dist/types/ui/common/ChatList/ChatListItemLastMessageAuthor.d.ts +2 -0
  100. package/dist/types/ui/common/ChatList/ChatListItemLastMessageContent.d.ts +2 -0
  101. package/dist/types/ui/common/ChatList/ChatListItemLastMessageSentAt.d.ts +2 -0
  102. package/dist/types/ui/common/ChatList/ChatListItemName.d.ts +2 -0
  103. package/dist/types/ui/common/ChatList/ChatListItemUnreadCount.d.ts +2 -0
  104. package/dist/types/ui/common/ChatList/ChatListValue.d.ts +8 -0
  105. package/dist/types/ui/common/ChatList/index.d.ts +30 -0
  106. package/dist/types/ui/common/Icon.d.ts +21 -0
  107. package/dist/types/ui/common/MessageSkeleton.d.ts +4 -0
  108. package/dist/types/ui/common/index.d.ts +12 -0
  109. package/dist/types/ui/customize.d.ts +9 -0
  110. package/dist/types/ui/index.d.ts +9 -0
  111. package/dist/{esm/types → types}/ui/localizer.d.ts +14 -8
  112. package/dist/types/ui/useFormatter.d.ts +3 -0
  113. package/package.json +81 -92
  114. package/src/audit/AuditChatList.tsx +25 -0
  115. package/src/audit/AuditConversationPanel.tsx +48 -0
  116. package/src/audit/AuditPanel.tsx +76 -0
  117. package/src/audit/AuditPanelCustomizeValue.ts +11 -0
  118. package/src/audit/AuditSearch.tsx +89 -0
  119. package/src/audit/AuditSearchValue.tsx +42 -0
  120. package/src/audit/auditApi.tsx +113 -0
  121. package/src/audit/index.d.ts +18 -0
  122. package/src/audit/index.tsx +28 -0
  123. package/src/audit/styles.scss +72 -0
  124. package/src/core/api/api.ts +655 -0
  125. package/src/core/api/baseApi.ts +38 -0
  126. package/src/core/api/index.ts +1 -0
  127. package/src/core/client.ts +287 -143
  128. package/src/core/constants.ts +1 -0
  129. package/src/core/debounce.ts +90 -0
  130. package/src/core/index.ts +4 -17
  131. package/src/core/types.tsx +182 -0
  132. package/src/index.ts +2 -3
  133. package/src/styles/aside.scss +26 -132
  134. package/src/styles/chat-list.scss +138 -0
  135. package/src/styles/chat.scss +11 -211
  136. package/src/styles/conversation.scss +200 -0
  137. package/src/styles/index.scss +161 -108
  138. package/src/styles/input.scss +148 -72
  139. package/src/styles/keyframes.scss +14 -14
  140. package/src/styles/members.scss +13 -0
  141. package/src/styles/mixins.scss +25 -20
  142. package/src/styles/variables.scss +13 -10
  143. package/src/ui/Chat/ChatContext.tsx +30 -0
  144. package/src/ui/{ChatPanel/ChatHeaderName.tsx → Chat/ChatEditableHeaderName.tsx} +63 -69
  145. package/src/ui/Chat/ChatHeaderActions.tsx +19 -0
  146. package/src/ui/Chat/ChatPanel.tsx +30 -0
  147. package/src/ui/Chat/ChatView.tsx +115 -0
  148. package/src/ui/Chat/Members/ChatMembersButton.tsx +9 -0
  149. package/src/ui/{ChatPanel → Chat/Members}/ChatMembersPanel.tsx +112 -121
  150. package/src/ui/Chat/Members/ChatMembersPreview.tsx +25 -0
  151. package/src/ui/Chat/Members/index.ts +13 -0
  152. package/src/ui/Chat/index.ts +6 -0
  153. package/src/ui/ChatGroup/ChatGroupContext.tsx +50 -0
  154. package/src/ui/ChatGroup/ChatGroupPanel.tsx +73 -0
  155. package/src/ui/ChatGroup/Create/CreateChatButton.tsx +15 -0
  156. package/src/ui/{CreateChatPanel → ChatGroup/Create}/CreateChatForm.tsx +36 -36
  157. package/src/ui/{CreateChatPanel → ChatGroup/Create}/CreateChatMemberInput.tsx +65 -66
  158. package/src/ui/{CreateChatPanel → ChatGroup/Create}/CreateChatNameInput.tsx +25 -25
  159. package/src/ui/{CreateChatPanel → ChatGroup/Create}/CreateChatPanel.tsx +45 -49
  160. package/src/ui/ChatGroup/Create/index.ts +19 -0
  161. package/src/ui/ChatGroup/Layout/ChatGroupAside.tsx +12 -0
  162. package/src/ui/ChatGroup/Layout/ChatGroupBody.tsx +10 -0
  163. package/src/ui/ChatGroup/Layout/ChatGroupFooter.tsx +3 -0
  164. package/src/ui/ChatGroup/Layout/ChatGroupHeader.tsx +5 -0
  165. package/src/ui/ChatGroup/Layout/ChatGroupMain.tsx +17 -0
  166. package/src/ui/ChatGroup/Layout/index.ts +19 -0
  167. package/src/ui/ChatGroup/List/ChatListPanel.tsx +28 -0
  168. package/src/ui/ChatGroup/List/index.ts +8 -0
  169. package/src/ui/ChatGroup/index.ts +5 -0
  170. package/src/ui/Chatify.tsx +15 -154
  171. package/src/ui/Conversation/Conversation.tsx +92 -0
  172. package/src/ui/Conversation/ConversationActions.tsx +12 -0
  173. package/src/ui/Conversation/ConversationBody.tsx +28 -0
  174. package/src/ui/Conversation/ConversationContext.ts +30 -0
  175. package/src/ui/Conversation/ConversationHeader.tsx +19 -0
  176. package/src/ui/Conversation/ConversationName.tsx +7 -0
  177. package/src/ui/Conversation/InputBox/InputBox.tsx +126 -0
  178. package/src/ui/Conversation/InputBox/InputBoxFile.tsx +38 -0
  179. package/src/ui/Conversation/InputBox/InputBoxFileList.tsx +21 -0
  180. package/src/ui/Conversation/InputBox/InputFilesBox.tsx +78 -0
  181. package/src/ui/Conversation/InputBox/InputSubmitButtonBox.tsx +26 -0
  182. package/src/ui/{InputBox → Conversation/InputBox}/InputTextBox.tsx +61 -51
  183. package/src/ui/Conversation/InputBox/index.ts +23 -0
  184. package/src/ui/{Message → Conversation/Message}/MessageAuthor.tsx +13 -13
  185. package/src/ui/{Message → Conversation/Message}/MessageBox.tsx +20 -20
  186. package/src/ui/{Message → Conversation/Message}/MessageContent.tsx +15 -11
  187. package/src/ui/Conversation/Message/MessageFile.tsx +54 -0
  188. package/src/ui/Conversation/Message/MessageFileList.tsx +14 -0
  189. package/src/ui/{Message → Conversation/Message}/MessageInfoBox.tsx +28 -26
  190. package/src/ui/{Message → Conversation/Message}/MessageRow.tsx +28 -28
  191. package/src/ui/{Message → Conversation/Message}/MessageText.tsx +7 -7
  192. package/src/ui/Conversation/Message/index.ts +28 -0
  193. package/src/ui/{Next.tsx → Conversation/NextObserver/NextMessagesObserver.tsx} +47 -48
  194. package/src/ui/Conversation/NextObserver/index.ts +1 -0
  195. package/src/ui/{MessageReadObserver.tsx → Conversation/ReadObserver/MessageReadObserver.tsx} +49 -45
  196. package/src/ui/Conversation/ReadObserver/index.ts +1 -0
  197. package/src/ui/{SendingMessage → Conversation/SendingMessage}/SendingMessageBox.tsx +16 -16
  198. package/src/ui/{SendingMessage → Conversation/SendingMessage}/SendingMessageContent.tsx +13 -13
  199. package/src/ui/{SendingMessage → Conversation/SendingMessage}/SendingMessageInfoBox.tsx +13 -13
  200. package/src/ui/{SendingMessage → Conversation/SendingMessage}/SendingMessageText.tsx +7 -7
  201. package/src/ui/Conversation/SendingMessage/index.ts +16 -0
  202. package/src/ui/{SystemMessage → Conversation/SystemMessage}/SystemMessageBox.tsx +20 -20
  203. package/src/ui/Conversation/SystemMessage/SystemMessageRow.tsx +28 -0
  204. package/src/ui/Conversation/SystemMessage/index.ts +10 -0
  205. package/src/ui/Conversation/index.ts +13 -0
  206. package/src/ui/Thread/ThreadActions.tsx +22 -0
  207. package/src/ui/Thread/ThreadContext.ts +13 -0
  208. package/src/ui/Thread/ThreadPanel.tsx +127 -0
  209. package/src/ui/Thread/index.tsx +3 -0
  210. package/src/ui/color.ts +20 -0
  211. package/src/ui/common/Avatar.tsx +20 -0
  212. package/src/ui/common/ChatList/ChatList.tsx +84 -0
  213. package/src/ui/common/ChatList/ChatListItemAvatar.tsx +22 -0
  214. package/src/ui/common/ChatList/ChatListItemBox.tsx +32 -0
  215. package/src/ui/{ChatList → common/ChatList}/ChatListItemLastMessage.tsx +15 -15
  216. package/src/ui/common/ChatList/ChatListItemLastMessageAuthor.tsx +15 -0
  217. package/src/ui/common/ChatList/ChatListItemLastMessageContent.tsx +21 -0
  218. package/src/ui/{ChatList → common/ChatList}/ChatListItemLastMessageSentAt.tsx +22 -22
  219. package/src/ui/common/ChatList/ChatListItemName.tsx +8 -0
  220. package/src/ui/{ChatList → common/ChatList}/ChatListItemUnreadCount.tsx +12 -12
  221. package/src/ui/common/ChatList/ChatListValue.ts +9 -0
  222. package/src/ui/common/ChatList/index.ts +32 -0
  223. package/src/ui/common/Icon.tsx +46 -0
  224. package/src/ui/{MessageSkeleton.tsx → common/MessageSkeleton.tsx} +20 -19
  225. package/src/ui/common/index.ts +14 -0
  226. package/src/ui/customize.tsx +51 -45
  227. package/src/ui/index.ts +11 -11
  228. package/src/ui/localizer.tsx +108 -84
  229. package/src/ui/useFormatter.tsx +17 -0
  230. package/dist/css/chatify.css +0 -528
  231. package/dist/esm/index.js +0 -2
  232. package/dist/esm/index.js.map +0 -1
  233. package/dist/esm/types/ChatifyContext.d.ts +0 -11
  234. package/dist/esm/types/core/action.d.ts +0 -151
  235. package/dist/esm/types/core/client.d.ts +0 -36
  236. package/dist/esm/types/core/index.d.ts +0 -17
  237. package/dist/esm/types/core/models.d.ts +0 -70
  238. package/dist/esm/types/core/reducer.d.ts +0 -11
  239. package/dist/esm/types/core/state.d.ts +0 -55
  240. package/dist/esm/types/core/useAddChatMutation.d.ts +0 -2
  241. package/dist/esm/types/core/useAddMemberMutation.d.ts +0 -2
  242. package/dist/esm/types/core/useFetchNextMutation.d.ts +0 -3
  243. package/dist/esm/types/core/useGetAccountsQuery.d.ts +0 -3
  244. package/dist/esm/types/core/useGetChatListQuery.d.ts +0 -3
  245. package/dist/esm/types/core/useGetChatQuery.d.ts +0 -5
  246. package/dist/esm/types/core/useGetMessagesQuery.d.ts +0 -4
  247. package/dist/esm/types/core/useReadMonitor.d.ts +0 -1
  248. package/dist/esm/types/core/useRemoveMemberMutation.d.ts +0 -2
  249. package/dist/esm/types/core/useSendMutation.d.ts +0 -2
  250. package/dist/esm/types/core/useSignalRMonitor.d.ts +0 -2
  251. package/dist/esm/types/core/useUpdateChatNameMutation.d.ts +0 -2
  252. package/dist/esm/types/ui/AddChatButton.d.ts +0 -2
  253. package/dist/esm/types/ui/Avatar.d.ts +0 -6
  254. package/dist/esm/types/ui/ChatList/ChatList.d.ts +0 -2
  255. package/dist/esm/types/ui/ChatList/ChatListItemBox.d.ts +0 -6
  256. package/dist/esm/types/ui/ChatList/ChatListItemLastMessage.d.ts +0 -3
  257. package/dist/esm/types/ui/ChatList/ChatListItemLastMessageAuthor.d.ts +0 -3
  258. package/dist/esm/types/ui/ChatList/ChatListItemLastMessageContent.d.ts +0 -3
  259. package/dist/esm/types/ui/ChatList/ChatListItemLastMessageSentAt.d.ts +0 -3
  260. package/dist/esm/types/ui/ChatList/ChatListItemName.d.ts +0 -3
  261. package/dist/esm/types/ui/ChatList/ChatListItemUnreadCount.d.ts +0 -3
  262. package/dist/esm/types/ui/ChatList/index.d.ts +0 -8
  263. package/dist/esm/types/ui/ChatName.d.ts +0 -5
  264. package/dist/esm/types/ui/ChatPanel/ChatBody.d.ts +0 -5
  265. package/dist/esm/types/ui/ChatPanel/ChatHeader.d.ts +0 -5
  266. package/dist/esm/types/ui/ChatPanel/ChatHeaderMembers.d.ts +0 -5
  267. package/dist/esm/types/ui/ChatPanel/ChatHeaderName.d.ts +0 -5
  268. package/dist/esm/types/ui/ChatPanel/ChatMembersButton.d.ts +0 -5
  269. package/dist/esm/types/ui/ChatPanel/ChatMembersPanel.d.ts +0 -5
  270. package/dist/esm/types/ui/ChatPanel/ChatPanel.d.ts +0 -5
  271. package/dist/esm/types/ui/ChatPanel/index.d.ts +0 -6
  272. package/dist/esm/types/ui/Chatify.d.ts +0 -72
  273. package/dist/esm/types/ui/CreateChatPanel/CreateChatMemberInput.d.ts +0 -5
  274. package/dist/esm/types/ui/CreateChatPanel/CreateChatNameInput.d.ts +0 -5
  275. package/dist/esm/types/ui/CreateChatPanel/CreateChatPanel.d.ts +0 -2
  276. package/dist/esm/types/ui/CreateChatPanel/index.d.ts +0 -4
  277. package/dist/esm/types/ui/Icon.d.ts +0 -17
  278. package/dist/esm/types/ui/InputBox/InputBox.d.ts +0 -2
  279. package/dist/esm/types/ui/InputBox/InputFilesBox.d.ts +0 -2
  280. package/dist/esm/types/ui/InputBox/InputSubmitButtonBox.d.ts +0 -5
  281. package/dist/esm/types/ui/InputBox/InputTextBox.d.ts +0 -7
  282. package/dist/esm/types/ui/InputBox/index.d.ts +0 -4
  283. package/dist/esm/types/ui/Layout/Aside.d.ts +0 -2
  284. package/dist/esm/types/ui/Layout/Body.d.ts +0 -2
  285. package/dist/esm/types/ui/Layout/Footer.d.ts +0 -2
  286. package/dist/esm/types/ui/Layout/Header.d.ts +0 -2
  287. package/dist/esm/types/ui/Layout/Main.d.ts +0 -2
  288. package/dist/esm/types/ui/Layout/index.d.ts +0 -5
  289. package/dist/esm/types/ui/Message/MessageAuthor.d.ts +0 -3
  290. package/dist/esm/types/ui/Message/MessageBox.d.ts +0 -6
  291. package/dist/esm/types/ui/Message/MessageContent.d.ts +0 -3
  292. package/dist/esm/types/ui/Message/MessageInfoBox.d.ts +0 -3
  293. package/dist/esm/types/ui/Message/MessageText.d.ts +0 -3
  294. package/dist/esm/types/ui/Message/index.d.ts +0 -6
  295. package/dist/esm/types/ui/MessageReadObserver.d.ts +0 -6
  296. package/dist/esm/types/ui/MessageSkeleton.d.ts +0 -4
  297. package/dist/esm/types/ui/Next.d.ts +0 -4
  298. package/dist/esm/types/ui/SendingMessage/SendingMessageBox.d.ts +0 -7
  299. package/dist/esm/types/ui/SendingMessage/SendingMessageContent.d.ts +0 -3
  300. package/dist/esm/types/ui/SendingMessage/SendingMessageInfoBox.d.ts +0 -3
  301. package/dist/esm/types/ui/SendingMessage/SendingMessageText.d.ts +0 -3
  302. package/dist/esm/types/ui/SendingMessage/index.d.ts +0 -4
  303. package/dist/esm/types/ui/SystemMessage/SystemMessageBox.d.ts +0 -6
  304. package/dist/esm/types/ui/SystemMessage/SystemMessageRow.d.ts +0 -9
  305. package/dist/esm/types/ui/SystemMessage/index.d.ts +0 -2
  306. package/dist/esm/types/ui/customize.d.ts +0 -11
  307. package/dist/esm/types/ui/index.d.ts +0 -11
  308. package/dist/esm/types/util/index.d.ts +0 -2
  309. package/dist/esm/types/util/uniqBy.d.ts +0 -1
  310. package/dist/esm/types/util/uniqId.d.ts +0 -1
  311. package/dist/index.d.ts +0 -637
  312. package/src/ChatifyContext.tsx +0 -41
  313. package/src/core/action.tsx +0 -431
  314. package/src/core/models.tsx +0 -82
  315. package/src/core/reducer.tsx +0 -87
  316. package/src/core/state.ts +0 -93
  317. package/src/core/useAddChatMutation.tsx +0 -28
  318. package/src/core/useAddMemberMutation.tsx +0 -25
  319. package/src/core/useFetchNextMutation.tsx +0 -28
  320. package/src/core/useGetAccountsQuery.tsx +0 -30
  321. package/src/core/useGetChatListQuery.tsx +0 -30
  322. package/src/core/useGetChatQuery.tsx +0 -31
  323. package/src/core/useGetMessagesQuery.tsx +0 -35
  324. package/src/core/useReadMonitor.tsx +0 -32
  325. package/src/core/useRemoveMemberMutation.tsx +0 -23
  326. package/src/core/useSendMutation.tsx +0 -24
  327. package/src/core/useSignalRMonitor.tsx +0 -66
  328. package/src/core/useUpdateChatNameMutation.tsx +0 -23
  329. package/src/ui/AddChatButton.tsx +0 -17
  330. package/src/ui/Avatar.tsx +0 -18
  331. package/src/ui/ChatList/ChatList.tsx +0 -42
  332. package/src/ui/ChatList/ChatListItemBox.tsx +0 -22
  333. package/src/ui/ChatList/ChatListItemLastMessageAuthor.tsx +0 -20
  334. package/src/ui/ChatList/ChatListItemLastMessageContent.tsx +0 -21
  335. package/src/ui/ChatList/ChatListItemName.tsx +0 -13
  336. package/src/ui/ChatList/index.ts +0 -8
  337. package/src/ui/ChatName.tsx +0 -10
  338. package/src/ui/ChatPanel/ChatBody.tsx +0 -44
  339. package/src/ui/ChatPanel/ChatHeader.tsx +0 -31
  340. package/src/ui/ChatPanel/ChatHeaderMembers.tsx +0 -28
  341. package/src/ui/ChatPanel/ChatMembersButton.tsx +0 -21
  342. package/src/ui/ChatPanel/ChatPanel.tsx +0 -27
  343. package/src/ui/ChatPanel/index.ts +0 -6
  344. package/src/ui/CreateChatPanel/index.ts +0 -4
  345. package/src/ui/Icon.tsx +0 -35
  346. package/src/ui/InputBox/InputBox.tsx +0 -38
  347. package/src/ui/InputBox/InputFilesBox.tsx +0 -9
  348. package/src/ui/InputBox/InputSubmitButtonBox.tsx +0 -17
  349. package/src/ui/InputBox/index.ts +0 -4
  350. package/src/ui/Layout/Aside.tsx +0 -12
  351. package/src/ui/Layout/Body.tsx +0 -10
  352. package/src/ui/Layout/Footer.tsx +0 -3
  353. package/src/ui/Layout/Header.tsx +0 -5
  354. package/src/ui/Layout/Main.tsx +0 -15
  355. package/src/ui/Layout/index.ts +0 -5
  356. package/src/ui/Message/index.ts +0 -6
  357. package/src/ui/SendingMessage/index.ts +0 -4
  358. package/src/ui/SystemMessage/SystemMessageRow.tsx +0 -43
  359. package/src/ui/SystemMessage/index.ts +0 -2
  360. package/src/util/index.ts +0 -2
  361. package/src/util/uniqBy.tsx +0 -17
  362. package/src/util/uniqId.tsx +0 -3
@@ -0,0 +1,182 @@
1
+ export interface Optional<TValue> {
2
+ hasValue: boolean;
3
+ value?: TValue | null;
4
+ }
5
+
6
+ export interface File {
7
+ name: string;
8
+ bytes: number;
9
+ ref: string;
10
+ }
11
+
12
+ export interface Period {
13
+ start: string;
14
+ end: string;
15
+ }
16
+
17
+ export interface AutoReply {
18
+ text: string;
19
+ period: Period;
20
+ }
21
+
22
+ export interface Account {
23
+ id: string;
24
+ name: string;
25
+ avatar: string;
26
+ autoReply: AutoReply | null;
27
+ }
28
+
29
+ export interface UpdateAccountRequest {
30
+ id: string;
31
+ autoReply?: Optional<AutoReply> | null;
32
+ name?: Optional<string> | null;
33
+ avatar?: Optional<string> | null;
34
+ active?: Optional<boolean> | null;
35
+ }
36
+
37
+ export interface MessageBase {
38
+ id: string;
39
+ text: string | null;
40
+ files: File[];
41
+ sentAt: string;
42
+ sentBy: Account;
43
+ }
44
+
45
+ export interface ChatMessage extends MessageBase {
46
+ chatId: string;
47
+ }
48
+
49
+ export interface Chat {
50
+ id: string;
51
+ name: string;
52
+ members: Account[];
53
+ active: boolean;
54
+ lastReadMessageId: string | null;
55
+ }
56
+
57
+ export interface ChatListItem {
58
+ id: string;
59
+ name: string;
60
+ message: ChatMessage;
61
+ totalUnreadCount: number;
62
+ active: boolean;
63
+ lastReadMessageId: string | null;
64
+ }
65
+
66
+ export interface SendChatMessageRequest {
67
+ chatId: string;
68
+ text: string | null;
69
+ files: File[];
70
+ }
71
+
72
+ export interface MessageBody {
73
+ text: string | null;
74
+ files: File[];
75
+ }
76
+
77
+ export interface AddChatRequest {
78
+ name: string;
79
+ message?: MessageBody;
80
+ members: string[];
81
+ }
82
+
83
+ export interface ReadChatMessageRequest {
84
+ id: string;
85
+ }
86
+
87
+ export interface ReadChatMessageEvent {
88
+ chatId: string;
89
+ newLastReadMessageId: string;
90
+ readCount: number;
91
+ }
92
+
93
+ export interface RemoveChatMemberRequest {
94
+ chatId: string;
95
+ accountId: string;
96
+ deleteHistory: boolean;
97
+ }
98
+
99
+ export interface AddChatMemberRequest {
100
+ chatId: string;
101
+ accountId: string;
102
+ withHistory: boolean;
103
+ }
104
+
105
+ export interface UpdateChatNameRequest {
106
+ id: string;
107
+ name: string;
108
+ }
109
+
110
+ export function chatId(messageId: string) {
111
+ return messageId.slice(0, 36);
112
+ }
113
+
114
+ export function messageSequencePart(id: string) {
115
+ return id.slice(37);
116
+ }
117
+
118
+ export interface ThreadWatchListItem {
119
+ id: string;
120
+ name: string;
121
+ createdById: string;
122
+ createdAt: string;
123
+ archive: boolean;
124
+ lastMessage: ThreadMessage | null;
125
+ lastReadMessageId: string | null;
126
+ }
127
+
128
+ export interface Thread {
129
+ id: string;
130
+ name: string;
131
+ createdBy: Account;
132
+ createdAt: string;
133
+ archive: boolean;
134
+ lastMessageId: string | null;
135
+ lastReadMessageId: string | null;
136
+ watch: boolean;
137
+ }
138
+
139
+ export interface ThreadMessage extends MessageBase {
140
+ threadId: string;
141
+ }
142
+
143
+ export interface SendThreadMessageRequest {
144
+ threadId: string;
145
+ body: MessageBody;
146
+ }
147
+
148
+ export interface ListSegment<T> {
149
+ items: T[];
150
+ total: number;
151
+ }
152
+
153
+ export type SystemMessageText =
154
+ | 'chatify://chat-created'
155
+ | 'chatify://member-added'
156
+ | 'chatify://member-removed'
157
+ | `chatify://chat-name-changed`;
158
+
159
+ export function parseThreadMessageId(messageId: string) {
160
+ const [threadId, index] = messageId.split('::', 2);
161
+ return [threadId, parseInt(index, 10)] as const;
162
+ }
163
+
164
+ export function calcThreadUnreadCount(
165
+ thread: Pick<ThreadWatchListItem, 'lastMessage' | 'lastReadMessageId'>,
166
+ ) {
167
+ const lastReadMessageIndex =
168
+ thread.lastReadMessageId != null ? parseThreadMessageId(thread.lastReadMessageId)[1] : -1;
169
+
170
+ const lastThreadMessageIndex =
171
+ thread.lastMessage?.id != null ? parseThreadMessageId(thread.lastMessage?.id)[1] : -1;
172
+
173
+ return lastThreadMessageIndex - lastReadMessageIndex;
174
+ }
175
+
176
+ export function calcThreadListUnreadCount(
177
+ threads: Pick<ThreadWatchListItem, 'lastMessage' | 'lastReadMessageId'>[],
178
+ ) {
179
+ return threads.reduce((prev, thread) => {
180
+ return prev + calcThreadUnreadCount(thread);
181
+ }, 0);
182
+ }
package/src/index.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from './ui';
2
- export * from './core';
3
- export * from './ChatifyContext';
1
+ export * from './ui';
2
+ export * from './core';
@@ -1,132 +1,26 @@
1
- .wxchtf-aside {
2
- flex: none;
3
- display: flex;
4
- flex-flow: column nowrap;
5
- background: #ffffff;
6
- border-top-left-radius: $radius;
7
- border-bottom-left-radius: $radius;
8
- padding-top: 15px;
9
- width: 320px;
10
- position: relative;
11
- overflow: hidden;
12
-
13
- &::before {
14
- position: absolute;
15
- content: '';
16
- left: 0;
17
- bottom: 0;
18
- width: calc(100% - 10px);
19
- height: 20px;
20
- z-index: 1;
21
- background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
22
- }
23
-
24
- .wxchtf-chat-list.ant-menu {
25
- flex: 1 1 auto;
26
- height: 100px;
27
- overflow-y: auto;
28
- border-inline-end: none;
29
- padding-bottom: 2rem;
30
-
31
- @include scrollbar();
32
-
33
- .ant-menu-item + .ant-menu-item {
34
- margin-top: 8px;
35
- }
36
-
37
- .ant-menu-item {
38
- padding: 0;
39
- height: unset;
40
- margin: 0;
41
- margin-left: 8px;
42
- width: calc(100% - 16px);
43
- border-radius: 8px;
44
- line-height: 1.5;
45
-
46
- &.ant-menu-item-selected {
47
- background-color: #e4f7f7;
48
-
49
- .wxchtf-chat-name {
50
- font-weight: 600;
51
- }
52
- }
53
-
54
- .wxchtf-chat {
55
- padding-inline: 10px;
56
- padding-block: 8.5px;
57
- position: relative;
58
-
59
- &.--unread {
60
- .wxchtf-chat-last {
61
- font-weight: bold;
62
- }
63
-
64
- .wxchtf-chat-name {
65
- font-weight: bold;
66
- max-width: 100%;
67
- }
68
- }
69
-
70
- .wxchtf-chat-name {
71
- display: inline-block;
72
- font-weight: 500;
73
- }
74
-
75
- .wxchtf-unread-count {
76
- background-color: #ff4d4f;
77
- border-radius: 50%;
78
- width: 16px;
79
- height: 16px;
80
- padding: 0;
81
- font-size: 10px;
82
- position: absolute;
83
- top: 32px;
84
- right: 13px;
85
- color: white;
86
- line-height: 16px;
87
- font-weight: bold;
88
- text-align: center;
89
- }
90
-
91
- .wxchtf-chat-last {
92
- $size: 25px;
93
- color: #0e0f1799;
94
-
95
- font-style: italic;
96
- overflow: hidden;
97
- text-overflow: ellipsis;
98
- white-space: nowrap;
99
- line-height: $size;
100
-
101
- .wxchtf-chat-last-author {
102
- display: inline-block;
103
- margin-right: 0.5rem;
104
-
105
- .ant-avatar {
106
- display: inline-block;
107
- border: none;
108
- margin-right: 5px;
109
-
110
- @include avatarSize($size);
111
- }
112
-
113
- &::after {
114
- content: ':';
115
- }
116
- }
117
-
118
- .wxchtf-chat-last-message {
119
- display: inline;
120
- }
121
-
122
- .wxchtf-chat-last-sent-at {
123
- position: absolute;
124
- top: 7px;
125
- right: 13px;
126
- font-size: 0.8em;
127
- }
128
- }
129
- }
130
- }
131
- }
132
- }
1
+ @use './variables.scss' as vars;
2
+ @use './mixins.scss' as mixins;
3
+
4
+ .wxchtf-aside {
5
+ flex: none;
6
+ display: flex;
7
+ flex-flow: column nowrap;
8
+ background: #ffffff;
9
+ border-top-left-radius: vars.$radius;
10
+ border-bottom-left-radius: vars.$radius;
11
+ padding-top: 15px;
12
+ width: 320px;
13
+ position: relative;
14
+ overflow: hidden;
15
+
16
+ &::before {
17
+ position: absolute;
18
+ content: '';
19
+ left: 0;
20
+ bottom: 0;
21
+ width: calc(100% - 10px);
22
+ height: 20px;
23
+ z-index: 1;
24
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
25
+ }
26
+ }
@@ -0,0 +1,138 @@
1
+ @use './variables.scss' as vars;
2
+ @use './mixins.scss' as mixins;
3
+
4
+ .wxchtf-chat-list.ant-menu {
5
+ flex: 1 1 auto;
6
+ height: 100px;
7
+ overflow-y: auto;
8
+ border-inline-end: none;
9
+ padding-bottom: 2rem;
10
+
11
+ @include mixins.scrollbar();
12
+
13
+ .ant-menu-item + .ant-menu-item {
14
+ margin-top: 8px;
15
+ }
16
+
17
+ .ant-menu-item {
18
+ padding: 0;
19
+ height: unset;
20
+ margin: 0;
21
+ margin-left: 8px;
22
+ width: calc(100% - 16px);
23
+ border-radius: 8px;
24
+ line-height: 1.5;
25
+
26
+ &.ant-menu-item-selected {
27
+ background-color: #e4f7f7;
28
+
29
+ .wxchtf-chat-name {
30
+ font-weight: 600;
31
+ color: inherit;
32
+ }
33
+ }
34
+
35
+ .wxchtf-chat {
36
+ padding-inline: 10px;
37
+ padding-block: 8.5px;
38
+ position: relative;
39
+ display: flex;
40
+ flex-flow: row nowrap;
41
+ align-items: center;
42
+
43
+ &.--unread {
44
+ .wxchtf-chat-last {
45
+ font-weight: bold;
46
+ }
47
+
48
+ .wxchtf-chat-name {
49
+ font-weight: bold;
50
+ max-width: 100%;
51
+ }
52
+ }
53
+
54
+ .wxchtf-chat-info {
55
+ min-width: 0;
56
+ }
57
+
58
+ .wxchtf-chat-name {
59
+ display: inline-block;
60
+ font-weight: 500;
61
+ color: rgba(0, 0, 0, 0.88);
62
+ }
63
+
64
+ .wxchtf-chat-avatar {
65
+ background-color: var(--background-color);
66
+ width: 42px;
67
+ height: 42px;
68
+ line-height: 40px;
69
+ text-align: center;
70
+ color: var(--color);
71
+ border-radius: 50%;
72
+ margin-right: 11px;
73
+ flex: none;
74
+
75
+ .anticon {
76
+ font-size: 20px;
77
+ line-height: 42px;
78
+ height: 42px;
79
+ }
80
+ }
81
+
82
+ .wxchtf-unread-count {
83
+ background-color: #ff4d4f;
84
+ border-radius: 50%;
85
+ width: 16px;
86
+ height: 16px;
87
+ padding: 0;
88
+ font-size: 10px;
89
+ position: absolute;
90
+ top: 32px;
91
+ right: 13px;
92
+ color: white;
93
+ line-height: 16px;
94
+ font-weight: bold;
95
+ text-align: center;
96
+ }
97
+
98
+ .wxchtf-chat-last {
99
+ $size: 25px;
100
+ color: #0e0f1799;
101
+
102
+ font-style: italic;
103
+ overflow: hidden;
104
+ text-overflow: ellipsis;
105
+ white-space: nowrap;
106
+ line-height: $size;
107
+
108
+ .wxchtf-chat-last-author {
109
+ display: inline-block;
110
+ margin-right: 0.5rem;
111
+
112
+ .ant-avatar {
113
+ display: inline-block;
114
+ border: none;
115
+ margin-right: 5px;
116
+
117
+ @include mixins.avatarSize($size);
118
+ }
119
+
120
+ &::after {
121
+ content: ':';
122
+ }
123
+ }
124
+
125
+ .wxchtf-chat-last-message {
126
+ display: inline;
127
+ }
128
+
129
+ .wxchtf-chat-last-sent-at {
130
+ position: absolute;
131
+ top: 7px;
132
+ right: 13px;
133
+ font-size: 0.8em;
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
@@ -1,211 +1,11 @@
1
- .wxchtf-chatify {
2
- .wxchtf-chat-panel {
3
- flex: auto;
4
- display: flex;
5
- flex-flow: row nowrap;
6
-
7
- .wxchtf-chat-main {
8
- flex: 1;
9
- display: flex;
10
- flex-flow: column nowrap;
11
-
12
- .wxchtf-chat-header {
13
- padding: 15px 20px;
14
- line-height: 24px;
15
- z-index: 1;
16
- box-shadow: 0px 2px 4px 0px rgba(88, 99, 107, 0.04), 0px 1px 9px -1px rgba(88, 99, 107, 0.04),
17
- 0px 1px 2px 0px rgba(88, 99, 107, 0.06);
18
-
19
- .wxchtf-chat-name {
20
- font-weight: 600;
21
- font-size: 16px;
22
- flex: none;
23
-
24
- &.--editable {
25
- cursor: pointer;
26
- }
27
- }
28
-
29
- .wxchtf-chat-members {
30
- display: inline-flex;
31
- gap: 6px;
32
- }
33
- }
34
-
35
- .wxchtf-chat-body {
36
- flex: 1 1 auto;
37
- height: 100px;
38
- overflow-y: auto;
39
- background: white;
40
- padding: 2rem 1rem;
41
- padding-right: 1rem;
42
- display: flex;
43
- flex-flow: column-reverse nowrap;
44
- align-items: center;
45
-
46
- @include scrollbar();
47
-
48
- .wxchtf-message,
49
- .wxchtf-sending-message,
50
- .wxchtf-system-message,
51
- .wxchtf-message-skeleton {
52
- margin-bottom: 8px;
53
- max-width: $messageBoxWidth;
54
- width: 100%;
55
-
56
- &:first-child {
57
- margin-bottom: 0;
58
- }
59
- }
60
-
61
- .wxchtf-message,
62
- .wxchtf-sending-message {
63
- display: flex;
64
- flex-flow: row nowrap;
65
- align-items: flex-start;
66
-
67
- &:not(.--my) {
68
- .wxchtf-message-content,
69
- .wxchtf-sending-message-content {
70
- border-bottom-left-radius: 0;
71
- }
72
- }
73
-
74
- &.--my {
75
- direction: rtl;
76
- justify-content: flex-start;
77
-
78
- .wxchtf-message-author {
79
- display: none;
80
- }
81
-
82
- .wxchtf-message-content,
83
- .wxchtf-sending-message-content {
84
- direction: ltr;
85
- border-bottom-right-radius: 0;
86
- background-color: $myMessageBackground;
87
- }
88
-
89
- .wxchtf-message-info-box {
90
- text-align: right;
91
- }
92
- }
93
-
94
- .wxchtf-message-author {
95
- margin-right: 15px;
96
-
97
- .ant-avatar {
98
- @include avatarSize($avatarSize);
99
- }
100
- }
101
-
102
- .wxchtf-message-info-box,
103
- .wxchtf-sending-message-info-box {
104
- text-align: left;
105
- margin-bottom: 3px;
106
-
107
- .wxchtf-message-author-name,
108
- .wxchtf-message-sent-at,
109
- .wxchtf-message-read-box,
110
- .wxchtf-sending-message-sending-box {
111
- display: inline-block;
112
- font-size: 0.85em;
113
- opacity: 0.5;
114
- }
115
-
116
- .wxchtf-message-sent-at,
117
- .wxchtf-message-read-box,
118
- .wxchtf-sending-message-sending-box {
119
- margin-left: 5px;
120
- }
121
- }
122
-
123
- .wxchtf-message-content,
124
- .wxchtf-sending-message-content {
125
- width: fit-content;
126
- min-width: 300px;
127
- max-width: 70%;
128
- padding: 12px 19px;
129
- background: white;
130
- background-color: $messageBackground;
131
- display: block;
132
- white-space: pre-wrap;
133
- overflow-wrap: break-word;
134
- border-radius: 24px;
135
-
136
- .wxchtf-message-text {
137
- line-height: 21px;
138
- }
139
- }
140
- }
141
-
142
- .wxchtf-system-message {
143
- font-style: italic;
144
- position: relative;
145
- text-align: center;
146
- color: #0e0f1799;
147
-
148
- .wxchtf-text,
149
- .wxchtf-timestamp {
150
- position: relative;
151
- z-index: 1;
152
- padding-inline: 8px;
153
- display: inline-block;
154
- font-size: 0.85em;
155
- background-color: white;
156
- }
157
-
158
- .wxchtf-timestamp {
159
- padding-left: 10px;
160
- }
161
-
162
- &::after {
163
- content: '';
164
- position: absolute;
165
- height: 1px;
166
- width: 100%;
167
- left: 0;
168
- top: 50%;
169
- z-index: 0;
170
- background-color: #0000000f;
171
- }
172
- }
173
-
174
- .wxchtf-message-skeleton {
175
- display: flex;
176
- flex-flow: row nowrap;
177
- align-items: flex-end;
178
-
179
- .wxchtf-avatar {
180
- margin-right: 15px;
181
- }
182
-
183
- .wxchtf-avatar .ant-skeleton-avatar {
184
- width: $avatarSize;
185
- height: $avatarSize;
186
- line-height: $avatarSize;
187
- }
188
-
189
- .wxchtf-content {
190
- width: 300px;
191
- height: 100px;
192
- border-radius: $messageBorderRadius;
193
- border-bottom-left-radius: 0;
194
- }
195
- }
196
- }
197
- }
198
-
199
- .wxchtf-chat-members-panel {
200
- min-width: 300px;
201
- box-shadow: -4px 0px 20px -5px #0cd9e214, -2px 1px 12px #006e720f;
202
-
203
- .wxchtf-chat-members-list {
204
- .wxchtf-chat-members-list-item {
205
- padding-inline: 1rem;
206
- border-block-end: none;
207
- }
208
- }
209
- }
210
- }
211
- }
1
+ @use './variables.scss' as vars;
2
+ @use './mixins.scss' as mixins;
3
+
4
+ .wxchtf-chatify {
5
+ .wxchtf-chat {
6
+ flex: auto;
7
+ display: flex;
8
+ flex-flow: row nowrap;
9
+ min-width: 0;
10
+ }
11
+ }