chat 1.0.8 → 4.0.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 (327) hide show
  1. package/dist/chunk-ACQNDPTB.js +356 -0
  2. package/dist/chunk-ACQNDPTB.js.map +1 -0
  3. package/dist/index.d.ts +1312 -0
  4. package/dist/index.js +1433 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/jsx-runtime-D7zHSnXe.d.ts +349 -0
  7. package/dist/jsx-runtime.d.ts +1 -0
  8. package/dist/jsx-runtime.js +17 -0
  9. package/dist/jsx-runtime.js.map +1 -0
  10. package/package.json +61 -97
  11. package/lib/module/ChatContext/index.js +0 -2
  12. package/lib/module/ChatContext/index.js.map +0 -1
  13. package/lib/module/ChatContext/types.js +0 -2
  14. package/lib/module/ChatContext/types.js.map +0 -1
  15. package/lib/module/classes/Chat/index.js +0 -2
  16. package/lib/module/classes/Chat/index.js.map +0 -1
  17. package/lib/module/classes/Chat/types.js +0 -2
  18. package/lib/module/classes/Chat/types.js.map +0 -1
  19. package/lib/module/classes/Inbox/index.js +0 -2
  20. package/lib/module/classes/Inbox/index.js.map +0 -1
  21. package/lib/module/classes/Inbox/types.js +0 -2
  22. package/lib/module/classes/Inbox/types.js.map +0 -1
  23. package/lib/module/classes/Message/index.js +0 -2
  24. package/lib/module/classes/Message/index.js.map +0 -1
  25. package/lib/module/classes/Message/types.js +0 -2
  26. package/lib/module/classes/Message/types.js.map +0 -1
  27. package/lib/module/classes/Reaction/index.js +0 -2
  28. package/lib/module/classes/Reaction/index.js.map +0 -1
  29. package/lib/module/classes/Reaction/types.js +0 -2
  30. package/lib/module/classes/Reaction/types.js.map +0 -1
  31. package/lib/module/classes/Room/index.js +0 -2
  32. package/lib/module/classes/Room/index.js.map +0 -1
  33. package/lib/module/classes/Room/types.js +0 -2
  34. package/lib/module/classes/Room/types.js.map +0 -1
  35. package/lib/module/classes/index.js +0 -2
  36. package/lib/module/classes/index.js.map +0 -1
  37. package/lib/module/components/Avatar/index.js +0 -2
  38. package/lib/module/components/Avatar/index.js.map +0 -1
  39. package/lib/module/components/Chat/Bubble/index.js +0 -2
  40. package/lib/module/components/Chat/Bubble/index.js.map +0 -1
  41. package/lib/module/components/Chat/Composer/Input/index.js +0 -2
  42. package/lib/module/components/Chat/Composer/Input/index.js.map +0 -1
  43. package/lib/module/components/Chat/Composer/Send/index.js +0 -2
  44. package/lib/module/components/Chat/Composer/Send/index.js.map +0 -1
  45. package/lib/module/components/Chat/Composer/index.js +0 -2
  46. package/lib/module/components/Chat/Composer/index.js.map +0 -1
  47. package/lib/module/components/Chat/Media/Image/index.js +0 -2
  48. package/lib/module/components/Chat/Media/Image/index.js.map +0 -1
  49. package/lib/module/components/Chat/Media/index.js +0 -2
  50. package/lib/module/components/Chat/Media/index.js.map +0 -1
  51. package/lib/module/components/Chat/Message/Swiper/Action/index.js +0 -2
  52. package/lib/module/components/Chat/Message/Swiper/Action/index.js.map +0 -1
  53. package/lib/module/components/Chat/Message/Swiper/index.js +0 -2
  54. package/lib/module/components/Chat/Message/Swiper/index.js.map +0 -1
  55. package/lib/module/components/Chat/Message/Touchable/index.js +0 -2
  56. package/lib/module/components/Chat/Message/Touchable/index.js.map +0 -1
  57. package/lib/module/components/Chat/Message/index.js +0 -2
  58. package/lib/module/components/Chat/Message/index.js.map +0 -1
  59. package/lib/module/components/Chat/SystemMessage/index.js +0 -2
  60. package/lib/module/components/Chat/SystemMessage/index.js.map +0 -1
  61. package/lib/module/components/Chat/TypingFooter/index.js +0 -2
  62. package/lib/module/components/Chat/TypingFooter/index.js.map +0 -1
  63. package/lib/module/components/Chat/index.js +0 -2
  64. package/lib/module/components/Chat/index.js.map +0 -1
  65. package/lib/module/components/Chat/types.js +0 -2
  66. package/lib/module/components/Chat/types.js.map +0 -1
  67. package/lib/module/components/Chat-Old/Bubble/index.js +0 -2
  68. package/lib/module/components/Chat-Old/Bubble/index.js.map +0 -1
  69. package/lib/module/components/Chat-Old/Composer/Input/index.js +0 -2
  70. package/lib/module/components/Chat-Old/Composer/Input/index.js.map +0 -1
  71. package/lib/module/components/Chat-Old/Composer/Send/index.js +0 -2
  72. package/lib/module/components/Chat-Old/Composer/Send/index.js.map +0 -1
  73. package/lib/module/components/Chat-Old/Composer/index.js +0 -2
  74. package/lib/module/components/Chat-Old/Composer/index.js.map +0 -1
  75. package/lib/module/components/Chat-Old/Message/index.js +0 -2
  76. package/lib/module/components/Chat-Old/Message/index.js.map +0 -1
  77. package/lib/module/components/Chat-Old/Swiper/Action/index.js +0 -2
  78. package/lib/module/components/Chat-Old/Swiper/Action/index.js.map +0 -1
  79. package/lib/module/components/Chat-Old/Swiper/index.js +0 -2
  80. package/lib/module/components/Chat-Old/Swiper/index.js.map +0 -1
  81. package/lib/module/components/Chat-Old/SystemMessage/index.js +0 -2
  82. package/lib/module/components/Chat-Old/SystemMessage/index.js.map +0 -1
  83. package/lib/module/components/Chat-Old/index.js +0 -2
  84. package/lib/module/components/Chat-Old/index.js.map +0 -1
  85. package/lib/module/components/Chat-Old/types.js +0 -2
  86. package/lib/module/components/Chat-Old/types.js.map +0 -1
  87. package/lib/module/components/ChatProvider/index.js +0 -2
  88. package/lib/module/components/ChatProvider/index.js.map +0 -1
  89. package/lib/module/components/ChatProvider/types.js +0 -2
  90. package/lib/module/components/ChatProvider/types.js.map +0 -1
  91. package/lib/module/components/Inbox/Item/Circle/index.js +0 -2
  92. package/lib/module/components/Inbox/Item/Circle/index.js.map +0 -1
  93. package/lib/module/components/Inbox/Item/Circle/types.js +0 -2
  94. package/lib/module/components/Inbox/Item/Circle/types.js.map +0 -1
  95. package/lib/module/components/Inbox/Item/Initials/index.js +0 -2
  96. package/lib/module/components/Inbox/Item/Initials/index.js.map +0 -1
  97. package/lib/module/components/Inbox/Item/ItemDate/index.js +0 -2
  98. package/lib/module/components/Inbox/Item/ItemDate/index.js.map +0 -1
  99. package/lib/module/components/Inbox/Item/Separator/index.js +0 -2
  100. package/lib/module/components/Inbox/Item/Separator/index.js.map +0 -1
  101. package/lib/module/components/Inbox/Item/Subtitle/index.js +0 -2
  102. package/lib/module/components/Inbox/Item/Subtitle/index.js.map +0 -1
  103. package/lib/module/components/Inbox/Item/Swipeable/index.js +0 -2
  104. package/lib/module/components/Inbox/Item/Swipeable/index.js.map +0 -1
  105. package/lib/module/components/Inbox/Item/Title/index.js +0 -2
  106. package/lib/module/components/Inbox/Item/Title/index.js.map +0 -1
  107. package/lib/module/components/Inbox/Item/UnreadIndicator/index.js +0 -2
  108. package/lib/module/components/Inbox/Item/UnreadIndicator/index.js.map +0 -1
  109. package/lib/module/components/Inbox/Item/index.js +0 -2
  110. package/lib/module/components/Inbox/Item/index.js.map +0 -1
  111. package/lib/module/components/Inbox/index.js +0 -2
  112. package/lib/module/components/Inbox/index.js.map +0 -1
  113. package/lib/module/components/Inbox/question.md +0 -21
  114. package/lib/module/components/Inbox/readme.md +0 -21
  115. package/lib/module/components/Inbox/types.js +0 -2
  116. package/lib/module/components/Inbox/types.js.map +0 -1
  117. package/lib/module/components/RoomCreator/Content/Footer/Button/index.js +0 -2
  118. package/lib/module/components/RoomCreator/Content/Footer/Button/index.js.map +0 -1
  119. package/lib/module/components/RoomCreator/Content/Footer/Input/index.js +0 -2
  120. package/lib/module/components/RoomCreator/Content/Footer/Input/index.js.map +0 -1
  121. package/lib/module/components/RoomCreator/Content/Footer/index.js +0 -2
  122. package/lib/module/components/RoomCreator/Content/Footer/index.js.map +0 -1
  123. package/lib/module/components/RoomCreator/Content/Item/Icon/index.js +0 -2
  124. package/lib/module/components/RoomCreator/Content/Item/Icon/index.js.map +0 -1
  125. package/lib/module/components/RoomCreator/Content/Item/index.js +0 -2
  126. package/lib/module/components/RoomCreator/Content/Item/index.js.map +0 -1
  127. package/lib/module/components/RoomCreator/Content/index.js +0 -2
  128. package/lib/module/components/RoomCreator/Content/index.js.map +0 -1
  129. package/lib/module/components/RoomCreator/Header/index.js +0 -2
  130. package/lib/module/components/RoomCreator/Header/index.js.map +0 -1
  131. package/lib/module/components/RoomCreator/index.js +0 -2
  132. package/lib/module/components/RoomCreator/index.js.map +0 -1
  133. package/lib/module/components/RoomCreator/types.js +0 -2
  134. package/lib/module/components/RoomCreator/types.js.map +0 -1
  135. package/lib/module/components/TypingIndicator/index.js +0 -2
  136. package/lib/module/components/TypingIndicator/index.js.map +0 -1
  137. package/lib/module/components/index.js +0 -2
  138. package/lib/module/components/index.js.map +0 -1
  139. package/lib/module/helpers/getInitials.js +0 -2
  140. package/lib/module/helpers/getInitials.js.map +0 -1
  141. package/lib/module/helpers/sortByAvatar.js +0 -2
  142. package/lib/module/helpers/sortByAvatar.js.map +0 -1
  143. package/lib/module/hooks/index.js +0 -2
  144. package/lib/module/hooks/index.js.map +0 -1
  145. package/lib/module/hooks/useCreateRoom/index.js +0 -2
  146. package/lib/module/hooks/useCreateRoom/index.js.map +0 -1
  147. package/lib/module/hooks/useCreator/index.js +0 -2
  148. package/lib/module/hooks/useCreator/index.js.map +0 -1
  149. package/lib/module/hooks/useInbox/index.js +0 -2
  150. package/lib/module/hooks/useInbox/index.js.map +0 -1
  151. package/lib/module/hooks/useInbox/types.js +0 -2
  152. package/lib/module/hooks/useInbox/types.js.map +0 -1
  153. package/lib/module/hooks/useMessages/index.js +0 -2
  154. package/lib/module/hooks/useMessages/index.js.map +0 -1
  155. package/lib/module/hooks/useMessages/types.js +0 -2
  156. package/lib/module/hooks/useMessages/types.js.map +0 -1
  157. package/lib/module/hooks/useRoom/index.js +0 -2
  158. package/lib/module/hooks/useRoom/index.js.map +0 -1
  159. package/lib/module/hooks/useRoom/types.js +0 -2
  160. package/lib/module/hooks/useRoom/types.js.map +0 -1
  161. package/lib/module/hooks/useSend/useSendToGroup/index.js +0 -2
  162. package/lib/module/hooks/useSend/useSendToGroup/index.js.map +0 -1
  163. package/lib/module/hooks/useSend/useSendToPeople/index.js +0 -2
  164. package/lib/module/hooks/useSend/useSendToPeople/index.js.map +0 -1
  165. package/lib/module/hooks/useTyping/index.js +0 -2
  166. package/lib/module/hooks/useTyping/index.js.map +0 -1
  167. package/lib/module/hooks/useTypingOLD/index.js +0 -2
  168. package/lib/module/hooks/useTypingOLD/index.js.map +0 -1
  169. package/lib/module/hooks/useTypingOLD/types.js +0 -2
  170. package/lib/module/hooks/useTypingOLD/types.js.map +0 -1
  171. package/lib/module/hooks/useViewMessages/index.js +0 -2
  172. package/lib/module/hooks/useViewMessages/index.js.map +0 -1
  173. package/lib/module/hooks/useViewMessages/types.js +0 -2
  174. package/lib/module/hooks/useViewMessages/types.js.map +0 -1
  175. package/lib/module/hooks/useViewMessagesOld/index.js +0 -2
  176. package/lib/module/hooks/useViewMessagesOld/index.js.map +0 -1
  177. package/lib/module/index.js +0 -2
  178. package/lib/module/index.js.map +0 -1
  179. package/lib/typescript/ChatContext/index.d.ts +0 -2
  180. package/lib/typescript/ChatContext/types.d.ts +0 -4
  181. package/lib/typescript/classes/Chat/index.d.ts +0 -14
  182. package/lib/typescript/classes/Chat/types.d.ts +0 -21
  183. package/lib/typescript/classes/Inbox/types.d.ts +0 -2
  184. package/lib/typescript/classes/Message/index.d.ts +0 -47
  185. package/lib/typescript/classes/Message/types.d.ts +0 -66
  186. package/lib/typescript/classes/Reaction/index.d.ts +0 -17
  187. package/lib/typescript/classes/Reaction/types.d.ts +0 -33
  188. package/lib/typescript/classes/Room/index.d.ts +0 -42
  189. package/lib/typescript/classes/Room/types.d.ts +0 -112
  190. package/lib/typescript/classes/index.d.ts +0 -4
  191. package/lib/typescript/components/Avatar/index.d.ts +0 -4
  192. package/lib/typescript/components/Chat/Bubble/index.d.ts +0 -4
  193. package/lib/typescript/components/Chat/Composer/Input/index.d.ts +0 -7
  194. package/lib/typescript/components/Chat/Composer/Send/index.d.ts +0 -4
  195. package/lib/typescript/components/Chat/Composer/index.d.ts +0 -8
  196. package/lib/typescript/components/Chat/Media/Image/index.d.ts +0 -7
  197. package/lib/typescript/components/Chat/Media/index.d.ts +0 -4
  198. package/lib/typescript/components/Chat/Message/Touchable/index.d.ts +0 -4
  199. package/lib/typescript/components/Chat/Message/index.d.ts +0 -8
  200. package/lib/typescript/components/Chat/SystemMessage/index.d.ts +0 -4
  201. package/lib/typescript/components/Chat/TypingFooter/index.d.ts +0 -4
  202. package/lib/typescript/components/Chat/index.d.ts +0 -8
  203. package/lib/typescript/components/Chat/types.d.ts +0 -843
  204. package/lib/typescript/components/ChatProvider/index.d.ts +0 -10
  205. package/lib/typescript/components/ChatProvider/types.d.ts +0 -7
  206. package/lib/typescript/components/Inbox/Item/Initials/index.d.ts +0 -4
  207. package/lib/typescript/components/Inbox/Item/ItemDate/index.d.ts +0 -4
  208. package/lib/typescript/components/Inbox/Item/Separator/index.d.ts +0 -6
  209. package/lib/typescript/components/Inbox/Item/Subtitle/index.d.ts +0 -3
  210. package/lib/typescript/components/Inbox/Item/Swipeable/index.d.ts +0 -4
  211. package/lib/typescript/components/Inbox/Item/Title/index.d.ts +0 -3
  212. package/lib/typescript/components/Inbox/Item/UnreadIndicator/index.d.ts +0 -4
  213. package/lib/typescript/components/Inbox/Item/index.d.ts +0 -6
  214. package/lib/typescript/components/Inbox/index.d.ts +0 -4
  215. package/lib/typescript/components/Inbox/types.d.ts +0 -304
  216. package/lib/typescript/components/RoomCreator/Content/Footer/Button/index.d.ts +0 -4
  217. package/lib/typescript/components/RoomCreator/Content/Footer/Input/index.d.ts +0 -4
  218. package/lib/typescript/components/RoomCreator/Content/Footer/index.d.ts +0 -3
  219. package/lib/typescript/components/RoomCreator/Content/Item/Icon/index.d.ts +0 -4
  220. package/lib/typescript/components/RoomCreator/Content/Item/index.d.ts +0 -4
  221. package/lib/typescript/components/RoomCreator/Content/index.d.ts +0 -4
  222. package/lib/typescript/components/RoomCreator/Header/index.d.ts +0 -4
  223. package/lib/typescript/components/RoomCreator/index.d.ts +0 -4
  224. package/lib/typescript/components/RoomCreator/types.d.ts +0 -208
  225. package/lib/typescript/components/TypingIndicator/index.d.ts +0 -9
  226. package/lib/typescript/components/index.d.ts +0 -12
  227. package/lib/typescript/helpers/getInitials.d.ts +0 -1
  228. package/lib/typescript/hooks/index.d.ts +0 -8
  229. package/lib/typescript/hooks/useCreator/index.d.ts +0 -27
  230. package/lib/typescript/hooks/useInbox/index.d.ts +0 -29
  231. package/lib/typescript/hooks/useInbox/types.d.ts +0 -5
  232. package/lib/typescript/hooks/useMessages/index.d.ts +0 -24
  233. package/lib/typescript/hooks/useMessages/types.d.ts +0 -5
  234. package/lib/typescript/hooks/useRoom/index.d.ts +0 -26
  235. package/lib/typescript/hooks/useRoom/types.d.ts +0 -5
  236. package/lib/typescript/hooks/useSend/useSendToGroup/index.d.ts +0 -6
  237. package/lib/typescript/hooks/useSend/useSendToPeople/index.d.ts +0 -6
  238. package/lib/typescript/hooks/useTyping/index.d.ts +0 -36
  239. package/lib/typescript/hooks/useViewMessages/index.d.ts +0 -18
  240. package/lib/typescript/hooks/useViewMessages/types.d.ts +0 -20
  241. package/lib/typescript/index.d.ts +0 -11
  242. package/readme.md +0 -201
  243. package/src/ChatContext/index.tsx +0 -9
  244. package/src/ChatContext/types.ts +0 -4
  245. package/src/classes/Chat/index.ts +0 -46
  246. package/src/classes/Chat/types.ts +0 -23
  247. package/src/classes/Inbox/index.ts +0 -12
  248. package/src/classes/Inbox/types.ts +0 -3
  249. package/src/classes/Message/index.ts +0 -310
  250. package/src/classes/Message/types.ts +0 -118
  251. package/src/classes/Reaction/index.ts +0 -108
  252. package/src/classes/Reaction/types.ts +0 -37
  253. package/src/classes/Room/index.ts +0 -323
  254. package/src/classes/Room/types.ts +0 -161
  255. package/src/classes/index.ts +0 -4
  256. package/src/components/Avatar/index.tsx +0 -25
  257. package/src/components/Chat/Bubble/index.tsx +0 -139
  258. package/src/components/Chat/Composer/Input/index.tsx +0 -45
  259. package/src/components/Chat/Composer/Send/index.tsx +0 -51
  260. package/src/components/Chat/Composer/index.tsx +0 -187
  261. package/src/components/Chat/Media/Image/index.tsx +0 -26
  262. package/src/components/Chat/Media/index.tsx +0 -11
  263. package/src/components/Chat/Message/Swiper/Action/index.tsx +0 -7
  264. package/src/components/Chat/Message/Swiper/index.tsx +0 -32
  265. package/src/components/Chat/Message/Touchable/index.tsx +0 -60
  266. package/src/components/Chat/Message/index.tsx +0 -328
  267. package/src/components/Chat/SystemMessage/index.tsx +0 -44
  268. package/src/components/Chat/TypingFooter/index.tsx +0 -48
  269. package/src/components/Chat/index.tsx +0 -596
  270. package/src/components/Chat/types.ts +0 -913
  271. package/src/components/Chat-Old/Bubble/index.tsx +0 -58
  272. package/src/components/Chat-Old/Composer/Input/index.tsx +0 -34
  273. package/src/components/Chat-Old/Composer/Send/index.tsx +0 -37
  274. package/src/components/Chat-Old/Composer/index.tsx +0 -131
  275. package/src/components/Chat-Old/Message/index.tsx +0 -160
  276. package/src/components/Chat-Old/Swiper/Action/index.tsx +0 -7
  277. package/src/components/Chat-Old/Swiper/index.tsx +0 -30
  278. package/src/components/Chat-Old/SystemMessage/index.tsx +0 -44
  279. package/src/components/Chat-Old/index.tsx +0 -356
  280. package/src/components/Chat-Old/types.ts +0 -752
  281. package/src/components/ChatProvider/index.tsx +0 -31
  282. package/src/components/ChatProvider/types.ts +0 -8
  283. package/src/components/Inbox/Item/Circle/index.tsx +0 -47
  284. package/src/components/Inbox/Item/Circle/types.ts +0 -8
  285. package/src/components/Inbox/Item/Initials/index.tsx +0 -41
  286. package/src/components/Inbox/Item/ItemDate/index.tsx +0 -26
  287. package/src/components/Inbox/Item/Separator/index.tsx +0 -13
  288. package/src/components/Inbox/Item/Subtitle/index.tsx +0 -23
  289. package/src/components/Inbox/Item/Swipeable/index.tsx +0 -143
  290. package/src/components/Inbox/Item/Title/index.tsx +0 -23
  291. package/src/components/Inbox/Item/UnreadIndicator/index.tsx +0 -84
  292. package/src/components/Inbox/Item/index.tsx +0 -307
  293. package/src/components/Inbox/index.tsx +0 -315
  294. package/src/components/Inbox/question.md +0 -21
  295. package/src/components/Inbox/readme.md +0 -21
  296. package/src/components/Inbox/types.ts +0 -371
  297. package/src/components/RoomCreator/Content/Footer/Button/index.tsx +0 -55
  298. package/src/components/RoomCreator/Content/Footer/Input/index.tsx +0 -27
  299. package/src/components/RoomCreator/Content/Footer/index.tsx +0 -72
  300. package/src/components/RoomCreator/Content/Item/Icon/index.tsx +0 -16
  301. package/src/components/RoomCreator/Content/Item/index.tsx +0 -87
  302. package/src/components/RoomCreator/Content/index.tsx +0 -75
  303. package/src/components/RoomCreator/Header/index.tsx +0 -74
  304. package/src/components/RoomCreator/index.tsx +0 -177
  305. package/src/components/RoomCreator/types.ts +0 -233
  306. package/src/components/TypingIndicator/index.tsx +0 -169
  307. package/src/components/index.ts +0 -18
  308. package/src/helpers/getInitials.ts +0 -11
  309. package/src/helpers/sortByAvatar.ts +0 -1
  310. package/src/hooks/index.ts +0 -8
  311. package/src/hooks/useCreateRoom/index.ts +0 -34
  312. package/src/hooks/useCreator/index.ts +0 -33
  313. package/src/hooks/useInbox/index.ts +0 -76
  314. package/src/hooks/useInbox/types.ts +0 -6
  315. package/src/hooks/useMessages/index.ts +0 -109
  316. package/src/hooks/useMessages/types.ts +0 -6
  317. package/src/hooks/useRoom/index.ts +0 -82
  318. package/src/hooks/useRoom/types.ts +0 -6
  319. package/src/hooks/useSend/useSendToGroup/index.ts +0 -38
  320. package/src/hooks/useSend/useSendToPeople/index.ts +0 -38
  321. package/src/hooks/useTyping/index.ts +0 -154
  322. package/src/hooks/useTypingOLD/index.ts +0 -67
  323. package/src/hooks/useTypingOLD/types.ts +0 -7
  324. package/src/hooks/useViewMessages/index.ts +0 -61
  325. package/src/hooks/useViewMessages/types.ts +0 -22
  326. package/src/hooks/useViewMessagesOld/index.ts +0 -39
  327. package/src/index.ts +0 -13
@@ -1,8 +0,0 @@
1
- export { default as useMessages } from './useMessages';
2
- export { default as useRoom } from './useRoom';
3
- export { default as useTyping } from './useTyping';
4
- export { default as useInbox } from './useInbox';
5
- export { default as useCreator } from './useCreator';
6
- export { default as useViewMessages } from './useViewMessages';
7
- export { default as useSendToPeople } from './useSend/useSendToPeople';
8
- export { default as useSendToGroup } from './useSend/useSendToGroup';
@@ -1,27 +0,0 @@
1
- import { MutableRefObject } from 'react';
2
- import { RoomCreatorRef } from '../../components/RoomCreator/types';
3
- declare const _default: () => [MutableRefObject<RoomCreatorRef | undefined>, {
4
- open: () => void;
5
- close: () => void;
6
- }];
7
- /**
8
- * React hook for managing RoomCreator component in usechat
9
- *
10
- * @returns An array with a ref and then convenience functions for the creator
11
- * [ref, { open, close }]
12
- *
13
- * **Required** In order for the methods to work, you must pass creator to sheetRef prop.
14
- *
15
- * @example
16
- * ```javascript
17
- * export default () => {
18
- * const [creator, { open, close }]
19
- *
20
- * // ...some other method
21
- * const onPress = () => open()
22
- *
23
- * return <RoomCreator sheetRef={creator} />
24
- * }
25
- * ```
26
- */
27
- export default _default;
@@ -1,29 +0,0 @@
1
- import { QueryDataHandler } from '@nandorojo/fuego/lib/typescript/hooks/useFuego/types';
2
- import { ExistingRoomDocument } from '../../classes/Room/types';
3
- import { InboxModel } from '../../classes/Inbox/types';
4
- import { UseInboxConfig } from './types';
5
- declare const _default: (config?: UseInboxConfig, options?: QueryDataHandler<ExistingRoomDocument>) => {
6
- path: string;
7
- loading: boolean;
8
- error: import("@nandorojo/fuego/lib/typescript/hooks/useFuego/types").QueryError;
9
- db: import("firebase").firestore.Firestore;
10
- ref: import("@nandorojo/fuego").FirestoreRefType;
11
- unsubscribe: (name: string) => void;
12
- exists: boolean | null;
13
- refetch: () => void;
14
- data: InboxModel;
15
- };
16
- /**
17
- * React hook to query the chat inbox in realtime. Used with the [Juice.Inbox] component from Juice.
18
- *
19
- * @example
20
- * ```
21
- * const { data } = useInbox()
22
- *
23
- * return <Juice.Inbox rooms={data} />
24
- * ```
25
- *
26
- * @returns
27
- * { data, loading, path, error } and other values returned by useFuego() hook. Data is properly formatted for rendering.
28
- */
29
- export default _default;
@@ -1,5 +0,0 @@
1
- import { FuegoQueryConfig } from '@nandorojo/fuego/lib/typescript/FuegoQuery/types';
2
- export interface UseInboxConfig extends Omit<FuegoQueryConfig, 'path'> {
3
- uid?: string;
4
- listen?: boolean;
5
- }
@@ -1,24 +0,0 @@
1
- import { UseMessagesConfig } from './types';
2
- import { NewMessageModel, EditMessageModel, MessageModelDocument } from '../../classes/Message/types';
3
- import { QueryDataHandler } from '@nandorojo/fuego/lib/typescript/hooks/useFuego/types';
4
- declare const _default: ({ id, ...config }: UseMessagesConfig, options?: QueryDataHandler<MessageModelDocument>) => {
5
- data: NewMessageModel[];
6
- loading: boolean;
7
- error: import("@nandorojo/fuego/lib/typescript/hooks/useFuego/types").QueryError;
8
- ref: import("@nandorojo/fuego").FirestoreRefType;
9
- path: string;
10
- empty: boolean;
11
- send: (message: NewMessageModel[]) => void;
12
- edit: (message: EditMessageModel) => Promise<void>;
13
- fetchMore: () => void;
14
- fetchingMore: number | false;
15
- };
16
- /**
17
- * React hook to set up a lisener for a room's messages
18
- *
19
- * @param { id } the roomId, along with other query options from `useFuego` hook
20
- *
21
- * @returns { data: formattedMessages, loading, error, ref, path, empty, send, edit, fetchMore }
22
- * data is formatted for rendering.
23
- */
24
- export default _default;
@@ -1,5 +0,0 @@
1
- import { FuegoQueryConfig } from '@nandorojo/fuego/lib/typescript/FuegoQuery/types';
2
- export interface UseMessagesConfig extends Omit<FuegoQueryConfig, 'path'> {
3
- id: string;
4
- listen?: boolean;
5
- }
@@ -1,26 +0,0 @@
1
- import { EditRoomModel, CreateCallableRoomModel, ExistingRoomDocument, ExistingRoomModel } from '../../classes/Room/types';
2
- import { UseRoomType } from './types';
3
- import { QueryDataHandler } from '@nandorojo/fuego/lib/typescript/hooks/useFuego/types';
4
- declare const _default: ({ id, ...config }: UseRoomType, options?: QueryDataHandler<ExistingRoomDocument>) => {
5
- data: ExistingRoomModel | null;
6
- loading: boolean;
7
- error: import("@nandorojo/fuego/lib/typescript/hooks/useFuego/types").QueryError;
8
- ref: import("@nandorojo/fuego").FirestoreRefType;
9
- create: (room: CreateCallableRoomModel) => Promise<import("firebase").functions.HttpsCallableResult>;
10
- edit: (room: EditRoomModel) => Promise<void> | null;
11
- usersAreTyping: boolean;
12
- namesOfUsersTyping: string[];
13
- };
14
- /**
15
- * Fetches or subscribes to a chatroom. It automatically handles unmounts, etc.
16
- *
17
- * @param config - config dictionary.
18
- * @param config.id - Required: the unique ID for this chatroom, typically generated by the backend. If using the [[useInbox]] hook, each item in [[useInbox]]'s data array has this ID.
19
- * @param config.listen Boolean to determine if this room should update state as a subscription. Default false.
20
- * @param options - added options dictionary for useRoom
21
- *
22
- * @remarks Look at the fuego library's useFuego hook to see all the available arguments for config and options.
23
- *
24
- * @returns { data: room, loading, error, ref, create, edit, usersAreTyping, namesOfUsersTyping } data is formatted for rendering room.
25
- */
26
- export default _default;
@@ -1,5 +0,0 @@
1
- import { FuegoQueryConfig } from '@nandorojo/fuego/lib/typescript/FuegoQuery/types';
2
- export interface UseRoomType extends Omit<FuegoQueryConfig, 'path'> {
3
- id: string;
4
- listen?: boolean;
5
- }
@@ -1,6 +0,0 @@
1
- import { NewMessageModel } from '../../../classes/Message/types';
2
- export default function <MessageModel extends NewMessageModel>(): {
3
- send: (message: MessageModel, recipients: string[]) => void;
4
- uploading: boolean;
5
- error: null;
6
- };
@@ -1,6 +0,0 @@
1
- import { NewMessageModel } from '../../../classes/Message/types';
2
- export default function <MessageModel extends NewMessageModel>(): {
3
- send: (message: MessageModel, recipients: string[]) => void;
4
- uploading: boolean;
5
- error: null;
6
- };
@@ -1,36 +0,0 @@
1
- declare const _default: ({ roomId, text, delay }: {
2
- roomId: string;
3
- text: string;
4
- delay?: number | null | undefined;
5
- }) => void;
6
- /**
7
- * useTyping automatically updates the backend whenever a user is typing.
8
- *
9
- * @param options - A dictionary to configure the typing.
10
- * @param options.roomId - **Required** unique id of the room you're typing in.
11
- * @param options.text - **Required** The current text state of your chat input
12
- * @param options.delay (Optional) Set the timeout delay to mark typing false. Set null if you don't want a time out.
13
- *
14
- * @example
15
- * ```javascript
16
- * // input text state
17
- * const [text, setText] = useState('')
18
- * // let's say we're getting our room id from our react-navigation params
19
- * const navigation = useNavigation()
20
- * const roomId = navigation.params.id
21
- *
22
- * useTyping({ roomId, text })
23
- *
24
- * <ChatComponent text={text} onChangeText={setText} />
25
- * ```
26
- *
27
- * @returns
28
- * Doesn't return anything. We live in an undefined world, I suppose.
29
- *
30
- * @remarks
31
- * The actual data of who is typing is stored in the chatroom object.
32
- * If you want to get this data realtime in a room, consider using useRoom({ listen: true }). This data will also be in useInbox().
33
- * See docs for useRoom or useInbox for more.
34
- *
35
- */
36
- export default _default;
@@ -1,18 +0,0 @@
1
- import { NewMessageModel } from '../../classes/Message/types';
2
- import { UseViewMessagesConfig, UseViewMessagesMethods } from './types';
3
- /**
4
- * React hook that returns a function useful for marking messages as viewed on the backend.
5
- * It works by only clearing unread count when you've reached the most recent message, leveraging React Native FlatList's onViewableItemsChanged.
6
- * This is only useful if you're using the Juice chat backend.
7
- *
8
- * @example
9
- * ```js
10
- * const onViewMessages = useViewMessages({ roomId: 'some_chat_room_id' })
11
- *
12
- * return <Juice.Chat onViewMessages={onViewMessages} />
13
- * ```
14
- */
15
- export default function <Model extends NewMessageModel = NewMessageModel>(config: UseViewMessagesConfig, methods?: UseViewMessagesMethods<Model>): ({ visibleMessages, latestMessageId }: {
16
- visibleMessages: Model[] | null;
17
- latestMessageId: string | null;
18
- }) => void;
@@ -1,20 +0,0 @@
1
- import { NewMessageModel } from '../../classes/Message/types';
2
- export interface UseViewMessagesConfig {
3
- roomId: string;
4
- }
5
- /**
6
- * An optional dictionary for using custom callbacks for viewed messages.
7
- */
8
- export interface UseViewMessagesMethods<Model extends NewMessageModel = NewMessageModel> {
9
- /**
10
- * Callback function that is triggered whenever the messages in view changes.
11
- * Since the `useViewMessages` hook is only concerned with updating a chat room's unread count and such, `onViewMessages` might be useful if you want to have your own analytics or message tracking.
12
- *
13
- * @param info - A dictionary containing info about the currently visible messages
14
- * @param info.visibleMessages - An array of messages that are currently in view
15
- *
16
- */
17
- onViewMessages?: (info: {
18
- visibleMessages: Model[];
19
- }) => void;
20
- }
@@ -1,11 +0,0 @@
1
- export * from './components';
2
- export * from './classes';
3
- export * from './hooks';
4
- import * as ChatType from './components/Chat/types';
5
- import * as InboxType from './components/Inbox/types';
6
- import * as MessageType from './classes/Message/types';
7
- import * as RoomType from './classes/Room/types';
8
- export declare const ChatTypes: typeof ChatType;
9
- export declare const InboxTypes: typeof InboxType;
10
- export declare const MessageTypes: typeof MessageType;
11
- export declare const RoomTypes: typeof RoomType;
package/readme.md DELETED
@@ -1,201 +0,0 @@
1
- # `chat` 🍹
2
-
3
- ```sh
4
- yarn add chat
5
- ```
6
-
7
- Build production-ready, full-stack chat in minutes. Drop in our pre-made UI components, connect them to your backend our pre-made logic, and you're good to go.
8
-
9
- **Stop worrying about:**
10
-
11
- ✅ Auth
12
-
13
- ✅ Customizable UI
14
-
15
- ✅ Transitions &amp; animations
16
-
17
- ✅ Websockets, data & fallbacks
18
-
19
- ✅ Offline support (beta)
20
-
21
- ✅ 1-on-1 and group chats
22
-
23
- ```javascript
24
- import * as React
25
- import { useMessages, Messages } from 'usechat'
26
-
27
- const ChatScreen = () => {
28
- const { data, send } = useMessages({ id: 'my-first-chat-room' })
29
-
30
- return <Messages onSend={send} messages={data} />
31
- }
32
-
33
- ```
34
-
35
- ## Backend setup for firebase
36
-
37
- If you only want to use this library for the UI components, there is no further setup required.
38
-
39
- However, if you want to connect your firebase/firestore backend, there is are two added steps.
40
-
41
- **1. Install dependencies**
42
-
43
- ```
44
- yarn add firebase @nandorojo/fuego
45
- ```
46
-
47
- **2. Add the provider to the root of your app**
48
-
49
- Initialize `fuego`'s db first. Then, wrap your app with the `ChatProvider`.
50
-
51
- ```jsx
52
- // App.tsx
53
- import * as React from 'react'
54
- import { ChatProvider } from 'chat'
55
- import { Fuego } from '@nandorojo/fuego'
56
-
57
- const fuego = new Fuego({
58
- //...firebase config here
59
- })
60
-
61
- export default () => {
62
- return <ChatProvider fuego={fuego}>{/* Your app goes here*/}</ChatProvider>
63
- }
64
- ```
65
-
66
- [How to find your firebase config](https://support.google.com/firebase/answer/7015592?hl=en#web)
67
-
68
- _Note_: Make sure you've enabled firebase firestore to use this. See [this tutorial](https://blog.expo.io/how-to-build-a-chat-app-with-react-native-3ef8604ebb3c) for more.
69
-
70
- ## Brief Example
71
-
72
- This is all it takes to build a **full-stack** live chat with `chat` in React/React Native (with some abstraction).
73
-
74
- ```jsx
75
- import * as React
76
- import { useNavigation, useNavigationParam } from 'react-navigation'
77
- import { useInbox, Inbox, useMessages, Messages } from 'usechat'
78
-
79
- const InboxScreen = () => {
80
- const { data } = useInbox()
81
- const navigation = useNavigation()
82
-
83
- return <Inbox rooms={data} onPressItem={id => navigation.navigate('Chat', { id })} >
84
- }
85
-
86
- const ChatScreen = () => {
87
- const id = useNavigationParam('id')
88
- const { data, send } = useMessages({ id })
89
-
90
- return <Messages onSend={send} messages={data} />
91
- }
92
-
93
- ```
94
-
95
- ## Highlights
96
-
97
- 😎 Works with `react` and `react native` **(including Expo!)**
98
-
99
- 🚨 Integrates with Firebase auth (and can also work with your custom auth solutions)
100
-
101
- 📣 Integrates with `expo-notifications`
102
-
103
- 🥐 Fully customizable UI components
104
-
105
- 🍇 Production-level animations, transitions, and swipe gestures.
106
-
107
- 👾 Written in TypeScript
108
-
109
- ---
110
-
111
- # Get Started
112
-
113
- Setup is quick and easy. Jump to the setup guide. Then, check out the hello world and example.
114
-
115
- ---
116
-
117
- ## Chat features included out-of-the-box
118
-
119
- ✏️ Typing indicators
120
-
121
- 💯 Unread count
122
-
123
- 😂 Meme search (powered by Memezy)
124
-
125
- 👻 Image & video, **including** uploading logic & content storage
126
-
127
- 🍪 Online status
128
-
129
- 🕺 Realtime inbox
130
-
131
- 🤯 Realtime chat rooms
132
-
133
- 😇 Room-level user permissions
134
-
135
- 🔥 Group chats
136
-
137
- 👴 Customizable system messages (ex: William Buzzelbees changed the group name to "Frankenstein's Friday Squad")
138
-
139
- 👀 Send a message to multiple people, even if a room with those people doesn't exist yet (like an instagram feed-to-DM flow.)
140
-
141
- 🥇 Room names (coming soon)
142
-
143
- ## Customizable components included
144
-
145
- 🧤 `<AuthGate />` wraps your app and gives it customizable auth, powered by firebase.
146
-
147
- 🧢 `<Inbox />` gives you a real-time list of chat rooms.
148
-
149
- 🎩 `<InboxItem />` List item for `<Inbox />`, including customizable swipe gestures.
150
-
151
- ⛑ `<TypingIndicator />` Show typing, with animations, as it happens
152
-
153
- 🍪 `<UnreadIndicator />` Show an iMessage-like unread indicator, with or without the number of unread messages.
154
-
155
- ⚡️ `<Messages />` Like GiftedChat, to the max.
156
-
157
- ## All the logic you'd need for a chat, handled.
158
-
159
- Functions are pre-made for the following:
160
-
161
- 🐻 Create chat room
162
-
163
- 🎃 Leave chat room
164
-
165
- 🤘 Remove users from chat room
166
-
167
- 👮‍♂️ Customizable avatars for chat rooms
168
-
169
- 🏄🏾‍♂️ Add people to a chat room
170
-
171
- ## Auth integration
172
-
173
- ### If you're using Firebase auth
174
-
175
- Chat will automatically integrate into your Firebase auth if you're using it once you've completed the setup.
176
-
177
- ## Aren't there a lot of chat SDKs already? What makes this better than all the others?
178
-
179
- Yes, there are. The motivation for this library comes down to only one concept: **production-ready** chat.
180
-
181
- If you google `react native chat tutorial`, you'll come up with many smart people writing good articles about building your first chat app. Suggestions range from using firebase's highly-customizable serverless database to more opinionated startups that build SDKs for chat only.
182
-
183
- The thing is, none of these options created a production-ready chat that "thinks in React."
184
-
185
- With a custom option like Firebase, you're having to deal with tons of different socket subscriptions, chat schema changes, etc, and building in features like unread count, online status, or typing indicators becomes non-trivial quickly.
186
-
187
- Meanwhile, existing JavaScript chat SDKs aren't made with React's stateful nature in mind. Companies like Pusher, PubNub, and Stream clearly have something good going for them, but they aren't made for React the way a library like `Apollo` is.
188
-
189
- **You should be able to build a customizable, full-stack chat with only a few lines of code.** If Stripe can do that for accepting payments, we can do it for sending words.
190
-
191
- Tutorials for existing chat SDKs have you typing `setState` dozens of times, and you wonder, would this actually look as good as iMessage in production? What if I want to move my component files around? What if I forget to unmount a listener on a certain screen? And if I want to reorganize my component files, do I have to write all that bulky `setState` logic over? What happens if I want to use a state manager like redux?
192
-
193
- With all those questions in mind, I decided I would go feature-by-feature, headache-by-headache, and make my own chat SDK that was made specifically for `react`/`react-native` (and `expo` in particluar).
194
-
195
- Thanks to the introduction of `react hooks` in React 16.8.3 (and in `expo` after SDK v33 🔥), making a react-first chat SDK went from a massive headache to an elegant, scalable experience.
196
-
197
- This chat library relies on two main APIs: `firebase firestore` for the database, `react hooks` for stateful component logic.
198
-
199
- That means that you can build a serverless chat app that is _actually_ ready for production. And when you need extra customizations like unread counts and typing indicators, you just click that you want them in a GUI.
200
-
201
- A final point: most chat SDKs own your messages and data. With us, we just link into your firebase, so you own all the data.
@@ -1,9 +0,0 @@
1
- import { createContext } from 'react'
2
- import { ChatContextType } from './types'
3
-
4
- // no default necessary with a provider at the top
5
- // @ts-ignore
6
- const context = createContext<ChatContextType>()
7
- context.displayName = 'ChatJS'
8
-
9
- export default context
@@ -1,4 +0,0 @@
1
- export interface ChatContextType {
2
- userId: string
3
- authToken: string
4
- }
@@ -1,46 +0,0 @@
1
- import { ChatConfig } from './types'
2
-
3
- export default class Chat {
4
- private chat: ChatConfig
5
- constructor(chat: ChatConfig = {}) {
6
- this.chat = chat
7
- // this.chat = {
8
- // ...chat,
9
- // httpCallables: {
10
- // sendMessageFromFeed: 'sendMessageFromFeed',
11
- // sendMessageToPeople: 'sendToPeople',
12
- // sendMessageToGroup: 'sendToGroup',
13
- // ...(chat.httpCallables || {})
14
- // }
15
- // }
16
- }
17
- get roomsCollection() {
18
- return this.chat.roomsCollection || 'rooms'
19
- }
20
- get messagesCollection() {
21
- return this.chat.messagesCollection || 'messages'
22
- }
23
- get httpCallables() {
24
- return {
25
- sendMessageFromFeed:
26
- (this.chat.httpCallables &&
27
- this.chat.httpCallables.sendMessageFromFeed) ||
28
- 'sendMessageFromFeed',
29
- sendMessageToPeople:
30
- (this.chat.httpCallables &&
31
- this.chat.httpCallables.sendMessageToPeople) ||
32
- 'sendMessageToPeople',
33
- sendMessageToGroup:
34
- (this.chat.httpCallables &&
35
- this.chat.httpCallables.sendMessageToGroup) ||
36
- 'sendMessageToGroup',
37
- createRoom:
38
- (this.chat.httpCallables && this.chat.httpCallables.createRoom) ||
39
- 'createRoom',
40
- sendMessageToRooms:
41
- (this.chat.httpCallables &&
42
- this.chat.httpCallables.sendMessageToRooms) ||
43
- 'sendMessageToRooms'
44
- }
45
- }
46
- }
@@ -1,23 +0,0 @@
1
- export type RoomPathFunc = (roomId: string) => string
2
-
3
- export interface ChatConfig {
4
- roomsCollection?: string
5
- messagesCollection?: string
6
- httpCallables?: {
7
- sendMessageFromFeed: string
8
- sendMessageToPeople: string
9
- sendMessageToGroup: string
10
- sendMessageToRooms: string
11
- createRoom: string
12
- }
13
- }
14
-
15
- export interface ChatModel {
16
- roomsCollection: string
17
- messagesCollection: string
18
- httpCallables: {
19
- sendMessageFromFeed: string
20
- sendMessageToPeople: string
21
- sendMessageToGroup: string
22
- }
23
- }
@@ -1,12 +0,0 @@
1
- import { InboxModel } from './types'
2
- import { chat } from '../../components/ChatProvider'
3
-
4
- export default class {
5
- private inbox: InboxModel
6
- constructor(inbox: InboxModel) {
7
- this.inbox = inbox
8
- }
9
- get path() {
10
- return chat.messagesCollection
11
- }
12
- }
@@ -1,3 +0,0 @@
1
- import { ExistingRoomModel } from '../Room/types'
2
-
3
- export type InboxModel = ExistingRoomModel[]