@planningcenter/chat-react-native 3.42.2-qa-staging.2 → 3.42.2-qa-821.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 (646) hide show
  1. package/build/components/conversation/attachments/attachment_card.d.ts +3 -3
  2. package/build/components/conversation/attachments/attachment_card.d.ts.map +1 -1
  3. package/build/components/conversation/attachments/attachment_card.js +3 -7
  4. package/build/components/conversation/attachments/attachment_card.js.map +1 -1
  5. package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts +1 -2
  6. package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts.map +1 -1
  7. package/build/components/conversation/attachments/attachment_deleting_overlay.js +12 -7
  8. package/build/components/conversation/attachments/attachment_deleting_overlay.js.map +1 -1
  9. package/build/components/conversation/attachments/audio_attachment.d.ts +1 -2
  10. package/build/components/conversation/attachments/audio_attachment.d.ts.map +1 -1
  11. package/build/components/conversation/attachments/audio_attachment.js +6 -23
  12. package/build/components/conversation/attachments/audio_attachment.js.map +1 -1
  13. package/build/components/conversation/attachments/expanded_link.d.ts +1 -2
  14. package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -1
  15. package/build/components/conversation/attachments/expanded_link.js +2 -8
  16. package/build/components/conversation/attachments/expanded_link.js.map +1 -1
  17. package/build/components/conversation/attachments/generic_file_attachment.d.ts +1 -2
  18. package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
  19. package/build/components/conversation/attachments/generic_file_attachment.js +2 -12
  20. package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
  21. package/build/components/conversation/attachments/giphy_attachment.d.ts +1 -2
  22. package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
  23. package/build/components/conversation/attachments/giphy_attachment.js +2 -7
  24. package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
  25. package/build/components/conversation/attachments/image_attachment.d.ts +1 -2
  26. package/build/components/conversation/attachments/image_attachment.d.ts.map +1 -1
  27. package/build/components/conversation/attachments/image_attachment.js +16 -53
  28. package/build/components/conversation/attachments/image_attachment.js.map +1 -1
  29. package/build/components/conversation/attachments/video_attachment.d.ts +1 -2
  30. package/build/components/conversation/attachments/video_attachment.d.ts.map +1 -1
  31. package/build/components/conversation/attachments/video_attachment.js +3 -13
  32. package/build/components/conversation/attachments/video_attachment.js.map +1 -1
  33. package/build/components/conversation/conversation_start_banner.d.ts +1 -2
  34. package/build/components/conversation/conversation_start_banner.d.ts.map +1 -1
  35. package/build/components/conversation/conversation_start_banner.js +2 -14
  36. package/build/components/conversation/conversation_start_banner.js.map +1 -1
  37. package/build/components/conversation/empty_conversation_blank_state.d.ts +1 -1
  38. package/build/components/conversation/empty_conversation_blank_state.d.ts.map +1 -1
  39. package/build/components/conversation/empty_conversation_blank_state.js +2 -9
  40. package/build/components/conversation/empty_conversation_blank_state.js.map +1 -1
  41. package/build/components/conversation/jump_to_bottom_button.d.ts +1 -1
  42. package/build/components/conversation/jump_to_bottom_button.d.ts.map +1 -1
  43. package/build/components/conversation/jump_to_bottom_button.js +2 -10
  44. package/build/components/conversation/jump_to_bottom_button.js.map +1 -1
  45. package/build/components/conversation/message.d.ts +1 -2
  46. package/build/components/conversation/message.d.ts.map +1 -1
  47. package/build/components/conversation/message.js +2 -53
  48. package/build/components/conversation/message.js.map +1 -1
  49. package/build/components/conversation/message_attachments.d.ts +1 -2
  50. package/build/components/conversation/message_attachments.d.ts.map +1 -1
  51. package/build/components/conversation/message_attachments.js +17 -21
  52. package/build/components/conversation/message_attachments.js.map +1 -1
  53. package/build/components/conversation/message_form/message_form_attachment_file.d.ts +1 -2
  54. package/build/components/conversation/message_form/message_form_attachment_file.d.ts.map +1 -1
  55. package/build/components/conversation/message_form/message_form_attachment_file.js +2 -2
  56. package/build/components/conversation/message_form/message_form_attachment_file.js.map +1 -1
  57. package/build/components/conversation/message_form/message_form_attachment_image.d.ts +1 -2
  58. package/build/components/conversation/message_form/message_form_attachment_image.d.ts.map +1 -1
  59. package/build/components/conversation/message_form/message_form_attachment_image.js +2 -2
  60. package/build/components/conversation/message_form/message_form_attachment_image.js.map +1 -1
  61. package/build/components/conversation/message_form/message_form_attachment_video.d.ts +1 -2
  62. package/build/components/conversation/message_form/message_form_attachment_video.d.ts.map +1 -1
  63. package/build/components/conversation/message_form/message_form_attachment_video.js +2 -2
  64. package/build/components/conversation/message_form/message_form_attachment_video.js.map +1 -1
  65. package/build/components/conversation/message_form.d.ts +5 -6
  66. package/build/components/conversation/message_form.d.ts.map +1 -1
  67. package/build/components/conversation/message_form.js +20 -82
  68. package/build/components/conversation/message_form.js.map +1 -1
  69. package/build/components/conversation/message_markdown.d.ts +1 -2
  70. package/build/components/conversation/message_markdown.d.ts.map +1 -1
  71. package/build/components/conversation/message_markdown.js +8 -16
  72. package/build/components/conversation/message_markdown.js.map +1 -1
  73. package/build/components/conversation/message_reaction.d.ts +1 -2
  74. package/build/components/conversation/message_reaction.d.ts.map +1 -1
  75. package/build/components/conversation/message_reaction.js +3 -5
  76. package/build/components/conversation/message_reaction.js.map +1 -1
  77. package/build/components/conversation/message_read_receipts.d.ts +1 -2
  78. package/build/components/conversation/message_read_receipts.d.ts.map +1 -1
  79. package/build/components/conversation/message_read_receipts.js +3 -13
  80. package/build/components/conversation/message_read_receipts.js.map +1 -1
  81. package/build/components/conversation/messages_disabled_banners.d.ts +3 -3
  82. package/build/components/conversation/messages_disabled_banners.d.ts.map +1 -1
  83. package/build/components/conversation/messages_disabled_banners.js +5 -8
  84. package/build/components/conversation/messages_disabled_banners.js.map +1 -1
  85. package/build/components/conversation/reply_connectors.d.ts +2 -2
  86. package/build/components/conversation/reply_connectors.d.ts.map +1 -1
  87. package/build/components/conversation/reply_connectors.js +18 -50
  88. package/build/components/conversation/reply_connectors.js.map +1 -1
  89. package/build/components/conversation/reply_shadow_message.d.ts +1 -2
  90. package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
  91. package/build/components/conversation/reply_shadow_message.js +16 -46
  92. package/build/components/conversation/reply_shadow_message.js.map +1 -1
  93. package/build/components/conversation/system_message.d.ts +1 -2
  94. package/build/components/conversation/system_message.d.ts.map +1 -1
  95. package/build/components/conversation/system_message.js +3 -12
  96. package/build/components/conversation/system_message.js.map +1 -1
  97. package/build/components/conversation/typing_indicator.d.ts +1 -2
  98. package/build/components/conversation/typing_indicator.d.ts.map +1 -1
  99. package/build/components/conversation/typing_indicator.js +3 -13
  100. package/build/components/conversation/typing_indicator.js.map +1 -1
  101. package/build/components/conversations/conversation_actions.d.ts +2 -2
  102. package/build/components/conversations/conversation_actions.d.ts.map +1 -1
  103. package/build/components/conversations/conversation_actions.js +4 -10
  104. package/build/components/conversations/conversation_actions.js.map +1 -1
  105. package/build/components/conversations/conversation_preview.d.ts +2 -3
  106. package/build/components/conversations/conversation_preview.d.ts.map +1 -1
  107. package/build/components/conversations/conversation_preview.js +12 -76
  108. package/build/components/conversations/conversation_preview.js.map +1 -1
  109. package/build/components/conversations/conversations.d.ts +1 -1
  110. package/build/components/conversations/conversations.d.ts.map +1 -1
  111. package/build/components/conversations/conversations.js +16 -17
  112. package/build/components/conversations/conversations.js.map +1 -1
  113. package/build/components/conversations/conversations_blank_state.d.ts +1 -2
  114. package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
  115. package/build/components/conversations/conversations_blank_state.js +2 -12
  116. package/build/components/conversations/conversations_blank_state.js.map +1 -1
  117. package/build/components/conversations/mute_indicator.d.ts +1 -2
  118. package/build/components/conversations/mute_indicator.d.ts.map +1 -1
  119. package/build/components/conversations/mute_indicator.js +2 -2
  120. package/build/components/conversations/mute_indicator.js.map +1 -1
  121. package/build/components/conversations/swipeable_toggle_button.d.ts +1 -2
  122. package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -1
  123. package/build/components/conversations/swipeable_toggle_button.js +3 -10
  124. package/build/components/conversations/swipeable_toggle_button.js.map +1 -1
  125. package/build/components/conversations/unread_count_badge.d.ts +2 -4
  126. package/build/components/conversations/unread_count_badge.d.ts.map +1 -1
  127. package/build/components/conversations/unread_count_badge.js +7 -12
  128. package/build/components/conversations/unread_count_badge.js.map +1 -1
  129. package/build/components/display/action_button.d.ts +1 -1
  130. package/build/components/display/action_button.d.ts.map +1 -1
  131. package/build/components/display/action_button.js +3 -13
  132. package/build/components/display/action_button.js.map +1 -1
  133. package/build/components/display/adult_requirement_notice.d.ts +1 -2
  134. package/build/components/display/adult_requirement_notice.d.ts.map +1 -1
  135. package/build/components/display/adult_requirement_notice.js +2 -4
  136. package/build/components/display/adult_requirement_notice.js.map +1 -1
  137. package/build/components/display/avatar.d.ts +1 -2
  138. package/build/components/display/avatar.d.ts.map +1 -1
  139. package/build/components/display/avatar.js +2 -7
  140. package/build/components/display/avatar.js.map +1 -1
  141. package/build/components/display/avatar_group.d.ts +1 -2
  142. package/build/components/display/avatar_group.d.ts.map +1 -1
  143. package/build/components/display/avatar_group.js +2 -9
  144. package/build/components/display/avatar_group.js.map +1 -1
  145. package/build/components/display/badge.d.ts +1 -2
  146. package/build/components/display/badge.d.ts.map +1 -1
  147. package/build/components/display/badge.js +6 -37
  148. package/build/components/display/badge.js.map +1 -1
  149. package/build/components/display/banner.d.ts +3 -3
  150. package/build/components/display/banner.d.ts.map +1 -1
  151. package/build/components/display/banner.js +4 -11
  152. package/build/components/display/banner.js.map +1 -1
  153. package/build/components/display/banner_collapsible.d.ts +2 -2
  154. package/build/components/display/banner_collapsible.d.ts.map +1 -1
  155. package/build/components/display/banner_collapsible.js +2 -10
  156. package/build/components/display/banner_collapsible.js.map +1 -1
  157. package/build/components/display/button.d.ts +1 -2
  158. package/build/components/display/button.d.ts.map +1 -1
  159. package/build/components/display/button.js +3 -14
  160. package/build/components/display/button.js.map +1 -1
  161. package/build/components/display/child_notice.d.ts +1 -2
  162. package/build/components/display/child_notice.d.ts.map +1 -1
  163. package/build/components/display/child_notice.js +3 -15
  164. package/build/components/display/child_notice.js.map +1 -1
  165. package/build/components/display/conversation_avatar.d.ts +1 -2
  166. package/build/components/display/conversation_avatar.d.ts.map +1 -1
  167. package/build/components/display/conversation_avatar.js +5 -9
  168. package/build/components/display/conversation_avatar.js.map +1 -1
  169. package/build/components/display/emoji_avatar.d.ts +1 -2
  170. package/build/components/display/emoji_avatar.d.ts.map +1 -1
  171. package/build/components/display/emoji_avatar.js +2 -12
  172. package/build/components/display/emoji_avatar.js.map +1 -1
  173. package/build/components/display/file_attachment_preview.d.ts +1 -1
  174. package/build/components/display/file_attachment_preview.d.ts.map +1 -1
  175. package/build/components/display/file_attachment_preview.js +3 -17
  176. package/build/components/display/file_attachment_preview.js.map +1 -1
  177. package/build/components/display/heading.d.ts +1 -2
  178. package/build/components/display/heading.d.ts.map +1 -1
  179. package/build/components/display/heading.js +2 -4
  180. package/build/components/display/heading.js.map +1 -1
  181. package/build/components/display/icon.d.ts +1 -2
  182. package/build/components/display/icon.d.ts.map +1 -1
  183. package/build/components/display/icon.js +4 -4
  184. package/build/components/display/icon.js.map +1 -1
  185. package/build/components/display/icon_avatar.d.ts +1 -2
  186. package/build/components/display/icon_avatar.d.ts.map +1 -1
  187. package/build/components/display/icon_avatar.js +2 -12
  188. package/build/components/display/icon_avatar.js.map +1 -1
  189. package/build/components/display/icon_button.d.ts +1 -2
  190. package/build/components/display/icon_button.d.ts.map +1 -1
  191. package/build/components/display/icon_button.js +3 -5
  192. package/build/components/display/icon_button.js.map +1 -1
  193. package/build/components/display/image.d.ts +1 -2
  194. package/build/components/display/image.d.ts.map +1 -1
  195. package/build/components/display/image.js +3 -7
  196. package/build/components/display/image.js.map +1 -1
  197. package/build/components/display/image_attachment_preview.d.ts +1 -1
  198. package/build/components/display/image_attachment_preview.d.ts.map +1 -1
  199. package/build/components/display/image_attachment_preview.js +2 -7
  200. package/build/components/display/image_attachment_preview.js.map +1 -1
  201. package/build/components/display/keyboard_view.d.ts +1 -2
  202. package/build/components/display/keyboard_view.d.ts.map +1 -1
  203. package/build/components/display/keyboard_view.js +4 -9
  204. package/build/components/display/keyboard_view.js.map +1 -1
  205. package/build/components/display/person.d.ts +1 -2
  206. package/build/components/display/person.d.ts.map +1 -1
  207. package/build/components/display/person.js +2 -12
  208. package/build/components/display/person.js.map +1 -1
  209. package/build/components/display/platform_modal_header_buttons.d.ts +3 -3
  210. package/build/components/display/platform_modal_header_buttons.d.ts.map +1 -1
  211. package/build/components/display/platform_modal_header_buttons.js +5 -10
  212. package/build/components/display/platform_modal_header_buttons.js.map +1 -1
  213. package/build/components/display/pressable_row.d.ts +1 -1
  214. package/build/components/display/pressable_row.d.ts.map +1 -1
  215. package/build/components/display/pressable_row.js +2 -7
  216. package/build/components/display/pressable_row.js.map +1 -1
  217. package/build/components/display/spinner.d.ts +1 -2
  218. package/build/components/display/spinner.d.ts.map +1 -1
  219. package/build/components/display/spinner.js +3 -9
  220. package/build/components/display/spinner.js.map +1 -1
  221. package/build/components/display/switch.d.ts +1 -2
  222. package/build/components/display/switch.d.ts.map +1 -1
  223. package/build/components/display/switch.js +2 -2
  224. package/build/components/display/switch.js.map +1 -1
  225. package/build/components/display/tabs.d.ts +1 -1
  226. package/build/components/display/tabs.d.ts.map +1 -1
  227. package/build/components/display/tabs.js +21 -31
  228. package/build/components/display/tabs.js.map +1 -1
  229. package/build/components/display/text.d.ts +1 -2
  230. package/build/components/display/text.d.ts.map +1 -1
  231. package/build/components/display/text.js +2 -4
  232. package/build/components/display/text.js.map +1 -1
  233. package/build/components/display/text_button.d.ts +1 -2
  234. package/build/components/display/text_button.d.ts.map +1 -1
  235. package/build/components/display/text_button.js +3 -8
  236. package/build/components/display/text_button.js.map +1 -1
  237. package/build/components/display/text_inline_button.d.ts +1 -2
  238. package/build/components/display/text_inline_button.d.ts.map +1 -1
  239. package/build/components/display/text_inline_button.js +4 -5
  240. package/build/components/display/text_inline_button.js.map +1 -1
  241. package/build/components/display/text_input.d.ts +1 -1
  242. package/build/components/display/text_input.d.ts.map +1 -1
  243. package/build/components/display/text_input.js +2 -1
  244. package/build/components/display/text_input.js.map +1 -1
  245. package/build/components/display/toggle_button.d.ts +1 -2
  246. package/build/components/display/toggle_button.d.ts.map +1 -1
  247. package/build/components/display/toggle_button.js +3 -9
  248. package/build/components/display/toggle_button.js.map +1 -1
  249. package/build/components/display/video_attachment_preview.d.ts +1 -1
  250. package/build/components/display/video_attachment_preview.d.ts.map +1 -1
  251. package/build/components/display/video_attachment_preview.js +3 -20
  252. package/build/components/display/video_attachment_preview.js.map +1 -1
  253. package/build/components/group_conversation_list.d.ts +1 -1
  254. package/build/components/group_conversation_list.d.ts.map +1 -1
  255. package/build/components/group_conversation_list.js +4 -14
  256. package/build/components/group_conversation_list.js.map +1 -1
  257. package/build/components/page/component_error_boundary.d.ts +2 -2
  258. package/build/components/page/component_error_boundary.d.ts.map +1 -1
  259. package/build/components/page/component_error_boundary.js +2 -4
  260. package/build/components/page/component_error_boundary.js.map +1 -1
  261. package/build/components/page/loading.d.ts +1 -2
  262. package/build/components/page/loading.d.ts.map +1 -1
  263. package/build/components/page/loading.js +2 -4
  264. package/build/components/page/loading.js.map +1 -1
  265. package/build/components/page/page_error_boundary.d.ts +2 -2
  266. package/build/components/page/page_error_boundary.d.ts.map +1 -1
  267. package/build/components/page/page_error_boundary.js +11 -32
  268. package/build/components/page/page_error_boundary.js.map +1 -1
  269. package/build/components/primitive/avatar_primitive.js +14 -41
  270. package/build/components/primitive/avatar_primitive.js.map +1 -1
  271. package/build/components/primitive/banner_primitive.js +10 -18
  272. package/build/components/primitive/banner_primitive.js.map +1 -1
  273. package/build/components/primitive/blank_state_primitive.js +8 -12
  274. package/build/components/primitive/blank_state_primitive.js.map +1 -1
  275. package/build/components/primitive/form_sheet.d.ts +1 -1
  276. package/build/components/primitive/form_sheet.d.ts.map +1 -1
  277. package/build/components/primitive/form_sheet.js +9 -22
  278. package/build/components/primitive/form_sheet.js.map +1 -1
  279. package/build/components/safe_area_modal.d.ts +1 -1
  280. package/build/components/safe_area_modal.d.ts.map +1 -1
  281. package/build/components/safe_area_modal.js +2 -3
  282. package/build/components/safe_area_modal.js.map +1 -1
  283. package/build/contexts/api_provider.d.ts +1 -2
  284. package/build/contexts/api_provider.d.ts.map +1 -1
  285. package/build/contexts/api_provider.js +3 -5
  286. package/build/contexts/api_provider.js.map +1 -1
  287. package/build/contexts/chat_context.d.ts +1 -1
  288. package/build/contexts/chat_context.d.ts.map +1 -1
  289. package/build/contexts/chat_context.js +2 -1
  290. package/build/contexts/chat_context.js.map +1 -1
  291. package/build/contexts/conversation_context.d.ts +2 -2
  292. package/build/contexts/conversation_context.d.ts.map +1 -1
  293. package/build/contexts/conversation_context.js +3 -2
  294. package/build/contexts/conversation_context.js.map +1 -1
  295. package/build/contexts/conversations_context.d.ts +2 -2
  296. package/build/contexts/conversations_context.d.ts.map +1 -1
  297. package/build/contexts/conversations_context.js +3 -2
  298. package/build/contexts/conversations_context.js.map +1 -1
  299. package/build/contexts/session_context.d.ts +1 -1
  300. package/build/contexts/session_context.d.ts.map +1 -1
  301. package/build/contexts/session_context.js +3 -2
  302. package/build/contexts/session_context.js.map +1 -1
  303. package/build/hooks/use_animated_message_background_color.d.ts +2 -2
  304. package/build/hooks/use_conversation.d.ts +1 -1
  305. package/build/hooks/use_conversation.d.ts.map +1 -1
  306. package/build/hooks/use_conversation.js +0 -2
  307. package/build/hooks/use_conversation.js.map +1 -1
  308. package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
  309. package/build/hooks/use_conversation_jolt_events.js +19 -4
  310. package/build/hooks/use_conversation_jolt_events.js.map +1 -1
  311. package/build/hooks/use_conversation_membership.d.ts +1 -1
  312. package/build/hooks/use_conversation_membership.d.ts.map +1 -1
  313. package/build/hooks/use_conversation_messages.d.ts +1 -0
  314. package/build/hooks/use_conversation_messages.d.ts.map +1 -1
  315. package/build/hooks/use_conversation_messages.js +2 -2
  316. package/build/hooks/use_conversation_messages.js.map +1 -1
  317. package/build/hooks/use_conversations_actions.d.ts +36 -36
  318. package/build/hooks/use_conversations_actions.d.ts.map +1 -1
  319. package/build/hooks/use_conversations_actions.js +1 -3
  320. package/build/hooks/use_conversations_actions.js.map +1 -1
  321. package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
  322. package/build/hooks/use_mark_latest_message_read.js +4 -3
  323. package/build/hooks/use_mark_latest_message_read.js.map +1 -1
  324. package/build/hooks/use_person_settings.d.ts +1 -1
  325. package/build/hooks/use_suspense_api.d.ts.map +1 -1
  326. package/build/hooks/use_suspense_api.js +7 -1
  327. package/build/hooks/use_suspense_api.js.map +1 -1
  328. package/build/index.d.ts +2 -1
  329. package/build/index.d.ts.map +1 -1
  330. package/build/index.js.map +1 -1
  331. package/build/navigation/chat_access_gate.d.ts +2 -2
  332. package/build/navigation/chat_access_gate.d.ts.map +1 -1
  333. package/build/navigation/chat_access_gate.js +6 -5
  334. package/build/navigation/chat_access_gate.js.map +1 -1
  335. package/build/navigation/index.d.ts +35 -36
  336. package/build/navigation/index.d.ts.map +1 -1
  337. package/build/navigation/index.js +19 -21
  338. package/build/navigation/index.js.map +1 -1
  339. package/build/navigation/screenLayout.d.ts +2 -2
  340. package/build/navigation/screenLayout.d.ts.map +1 -1
  341. package/build/navigation/screenLayout.js +3 -9
  342. package/build/navigation/screenLayout.js.map +1 -1
  343. package/build/polyfills/events/EventTarget.d.ts +1 -1
  344. package/build/polyfills/events/EventTarget.d.ts.map +1 -1
  345. package/build/polyfills/events/EventTarget.js.map +1 -1
  346. package/build/screens/age_check/age_check_required_screen.d.ts +1 -2
  347. package/build/screens/age_check/age_check_required_screen.d.ts.map +1 -1
  348. package/build/screens/age_check/age_check_required_screen.js +3 -46
  349. package/build/screens/age_check/age_check_required_screen.js.map +1 -1
  350. package/build/screens/age_check/age_check_underage_screen.d.ts +1 -2
  351. package/build/screens/age_check/age_check_underage_screen.d.ts.map +1 -1
  352. package/build/screens/age_check/age_check_underage_screen.js +2 -25
  353. package/build/screens/age_check/age_check_underage_screen.js.map +1 -1
  354. package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts +1 -2
  355. package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts.map +1 -1
  356. package/build/screens/age_check/components/age_check_select_birthdate_modal.js +6 -25
  357. package/build/screens/age_check/components/age_check_select_birthdate_modal.js.map +1 -1
  358. package/build/screens/attachment_actions/attachment_actions_screen.d.ts +1 -2
  359. package/build/screens/attachment_actions/attachment_actions_screen.d.ts.map +1 -1
  360. package/build/screens/attachment_actions/attachment_actions_screen.js +3 -5
  361. package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
  362. package/build/screens/avatar_picker/avatar_picker_screen.d.ts +1 -2
  363. package/build/screens/avatar_picker/avatar_picker_screen.d.ts.map +1 -1
  364. package/build/screens/avatar_picker/avatar_picker_screen.js +9 -36
  365. package/build/screens/avatar_picker/avatar_picker_screen.js.map +1 -1
  366. package/build/screens/avatar_picker/avatar_preview.d.ts +1 -1
  367. package/build/screens/avatar_picker/avatar_preview.d.ts.map +1 -1
  368. package/build/screens/avatar_picker/avatar_preview.js +5 -9
  369. package/build/screens/avatar_picker/avatar_preview.js.map +1 -1
  370. package/build/screens/avatar_picker/color_picker.d.ts +1 -2
  371. package/build/screens/avatar_picker/color_picker.d.ts.map +1 -1
  372. package/build/screens/avatar_picker/color_picker.js +4 -5
  373. package/build/screens/avatar_picker/color_picker.js.map +1 -1
  374. package/build/screens/avatar_picker/emoji_tab.d.ts +1 -2
  375. package/build/screens/avatar_picker/emoji_tab.d.ts.map +1 -1
  376. package/build/screens/avatar_picker/emoji_tab.js +12 -13
  377. package/build/screens/avatar_picker/emoji_tab.js.map +1 -1
  378. package/build/screens/avatar_picker/icon_grid.d.ts +1 -2
  379. package/build/screens/avatar_picker/icon_grid.d.ts.map +1 -1
  380. package/build/screens/avatar_picker/icon_grid.js +4 -5
  381. package/build/screens/avatar_picker/icon_grid.js.map +1 -1
  382. package/build/screens/avatar_picker/upload_tab.d.ts +1 -2
  383. package/build/screens/avatar_picker/upload_tab.d.ts.map +1 -1
  384. package/build/screens/avatar_picker/upload_tab.js +3 -4
  385. package/build/screens/avatar_picker/upload_tab.js.map +1 -1
  386. package/build/screens/bug_report_screen.d.ts +1 -2
  387. package/build/screens/bug_report_screen.d.ts.map +1 -1
  388. package/build/screens/bug_report_screen.js +11 -117
  389. package/build/screens/bug_report_screen.js.map +1 -1
  390. package/build/screens/conversation/message_read_receipts_screen.d.ts +1 -2
  391. package/build/screens/conversation/message_read_receipts_screen.d.ts.map +1 -1
  392. package/build/screens/conversation/message_read_receipts_screen.js +4 -20
  393. package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
  394. package/build/screens/conversation_details_screen.d.ts +1 -2
  395. package/build/screens/conversation_details_screen.d.ts.map +1 -1
  396. package/build/screens/conversation_details_screen.js +43 -106
  397. package/build/screens/conversation_details_screen.js.map +1 -1
  398. package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +1 -1
  399. package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -1
  400. package/build/screens/conversation_filter_recipients/components/checkbox_row.js +3 -9
  401. package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -1
  402. package/build/screens/conversation_filter_recipients/components/header_row.d.ts +1 -1
  403. package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -1
  404. package/build/screens/conversation_filter_recipients/components/header_row.js +2 -12
  405. package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -1
  406. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +1 -2
  407. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
  408. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +20 -44
  409. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
  410. package/build/screens/conversation_filters/components/conversation_filters.d.ts +1 -2
  411. package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
  412. package/build/screens/conversation_filters/components/conversation_filters.js +10 -11
  413. package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
  414. package/build/screens/conversation_filters/components/rows.d.ts +6 -6
  415. package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
  416. package/build/screens/conversation_filters/components/rows.js +7 -34
  417. package/build/screens/conversation_filters/components/rows.js.map +1 -1
  418. package/build/screens/conversation_filters/context/conversation_filter_context.d.ts +1 -1
  419. package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
  420. package/build/screens/conversation_filters/context/conversation_filter_context.js +2 -1
  421. package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
  422. package/build/screens/conversation_filters/group_filters.d.ts +1 -2
  423. package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
  424. package/build/screens/conversation_filters/group_filters.js +2 -2
  425. package/build/screens/conversation_filters/group_filters.js.map +1 -1
  426. package/build/screens/conversation_filters/team_filters.d.ts +1 -2
  427. package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
  428. package/build/screens/conversation_filters/team_filters.js +2 -2
  429. package/build/screens/conversation_filters/team_filters.js.map +1 -1
  430. package/build/screens/conversation_filters_screen.d.ts +1 -2
  431. package/build/screens/conversation_filters_screen.d.ts.map +1 -1
  432. package/build/screens/conversation_filters_screen.js +4 -16
  433. package/build/screens/conversation_filters_screen.js.map +1 -1
  434. package/build/screens/conversation_new/components/avatar_selection_row.d.ts +2 -3
  435. package/build/screens/conversation_new/components/avatar_selection_row.d.ts.map +1 -1
  436. package/build/screens/conversation_new/components/avatar_selection_row.js +6 -16
  437. package/build/screens/conversation_new/components/avatar_selection_row.js.map +1 -1
  438. package/build/screens/conversation_new/components/filter_by_plan.d.ts +3 -4
  439. package/build/screens/conversation_new/components/filter_by_plan.d.ts.map +1 -1
  440. package/build/screens/conversation_new/components/filter_by_plan.js +22 -46
  441. package/build/screens/conversation_new/components/filter_by_plan.js.map +1 -1
  442. package/build/screens/conversation_new/components/form_list.d.ts +2 -3
  443. package/build/screens/conversation_new/components/form_list.d.ts.map +1 -1
  444. package/build/screens/conversation_new/components/form_list.js +4 -6
  445. package/build/screens/conversation_new/components/form_list.js.map +1 -1
  446. package/build/screens/conversation_new/components/gender_filter_toggle.d.ts +1 -2
  447. package/build/screens/conversation_new/components/gender_filter_toggle.d.ts.map +1 -1
  448. package/build/screens/conversation_new/components/gender_filter_toggle.js +4 -20
  449. package/build/screens/conversation_new/components/gender_filter_toggle.js.map +1 -1
  450. package/build/screens/conversation_new/components/groups_form.d.ts +1 -2
  451. package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
  452. package/build/screens/conversation_new/components/groups_form.js +4 -30
  453. package/build/screens/conversation_new/components/groups_form.js.map +1 -1
  454. package/build/screens/conversation_new/components/services_form.d.ts +1 -2
  455. package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
  456. package/build/screens/conversation_new/components/services_form.js +27 -61
  457. package/build/screens/conversation_new/components/services_form.js.map +1 -1
  458. package/build/screens/conversation_new/components/source_app_error_card.d.ts +1 -1
  459. package/build/screens/conversation_new/components/source_app_error_card.d.ts.map +1 -1
  460. package/build/screens/conversation_new/components/source_app_error_card.js +2 -3
  461. package/build/screens/conversation_new/components/source_app_error_card.js.map +1 -1
  462. package/build/screens/conversation_new/conversation_new_screen.d.ts +1 -2
  463. package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
  464. package/build/screens/conversation_new/conversation_new_screen.js +4 -4
  465. package/build/screens/conversation_new/conversation_new_screen.js.map +1 -1
  466. package/build/screens/conversation_notification_level_select_screen.d.ts +1 -2
  467. package/build/screens/conversation_notification_level_select_screen.d.ts.map +1 -1
  468. package/build/screens/conversation_notification_level_select_screen.js +4 -6
  469. package/build/screens/conversation_notification_level_select_screen.js.map +1 -1
  470. package/build/screens/conversation_screen.d.ts +2 -3
  471. package/build/screens/conversation_screen.d.ts.map +1 -1
  472. package/build/screens/conversation_screen.js +25 -66
  473. package/build/screens/conversation_screen.js.map +1 -1
  474. package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts +1 -1
  475. package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts.map +1 -1
  476. package/build/screens/conversation_select_recipients/components/groups_recipient_row.js +2 -1
  477. package/build/screens/conversation_select_recipients/components/groups_recipient_row.js.map +1 -1
  478. package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts +1 -2
  479. package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts.map +1 -1
  480. package/build/screens/conversation_select_recipients/components/recipient_link_row.js +2 -15
  481. package/build/screens/conversation_select_recipients/components/recipient_link_row.js.map +1 -1
  482. package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts +1 -2
  483. package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts.map +1 -1
  484. package/build/screens/conversation_select_recipients/components/restricted_group_row.js +2 -14
  485. package/build/screens/conversation_select_recipients/components/restricted_group_row.js.map +1 -1
  486. package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts +1 -1
  487. package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts.map +1 -1
  488. package/build/screens/conversation_select_recipients/components/team_recipient_row.js +2 -1
  489. package/build/screens/conversation_select_recipients/components/team_recipient_row.js.map +1 -1
  490. package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts +1 -1
  491. package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts.map +1 -1
  492. package/build/screens/conversation_select_recipients/components/view_more_link_row.js +2 -5
  493. package/build/screens/conversation_select_recipients/components/view_more_link_row.js.map +1 -1
  494. package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts +1 -2
  495. package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts.map +1 -1
  496. package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js +4 -11
  497. package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js.map +1 -1
  498. package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts +1 -1
  499. package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts.map +1 -1
  500. package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js +11 -83
  501. package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js.map +1 -1
  502. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts +1 -2
  503. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -1
  504. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +7 -14
  505. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -1
  506. package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts +1 -2
  507. package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +1 -1
  508. package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +15 -18
  509. package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
  510. package/build/screens/conversation_select_type_screen.d.ts +1 -2
  511. package/build/screens/conversation_select_type_screen.d.ts.map +1 -1
  512. package/build/screens/conversation_select_type_screen.js +3 -10
  513. package/build/screens/conversation_select_type_screen.js.map +1 -1
  514. package/build/screens/conversations/components/chat_group_badge.d.ts +1 -2
  515. package/build/screens/conversations/components/chat_group_badge.d.ts.map +1 -1
  516. package/build/screens/conversations/components/chat_group_badge.js +3 -4
  517. package/build/screens/conversations/components/chat_group_badge.js.map +1 -1
  518. package/build/screens/conversations/components/list_header_action_button.d.ts +1 -2
  519. package/build/screens/conversations/components/list_header_action_button.d.ts.map +1 -1
  520. package/build/screens/conversations/components/list_header_action_button.js +3 -5
  521. package/build/screens/conversations/components/list_header_action_button.js.map +1 -1
  522. package/build/screens/conversations/components/list_header_component.d.ts +1 -2
  523. package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
  524. package/build/screens/conversations/components/list_header_component.js +19 -42
  525. package/build/screens/conversations/components/list_header_component.js.map +1 -1
  526. package/build/screens/conversations/conversations_screen.d.ts +1 -2
  527. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  528. package/build/screens/conversations/conversations_screen.js +2 -6
  529. package/build/screens/conversations/conversations_screen.js.map +1 -1
  530. package/build/screens/design_system_screen.d.ts +1 -2
  531. package/build/screens/design_system_screen.d.ts.map +1 -1
  532. package/build/screens/design_system_screen.js +35 -558
  533. package/build/screens/design_system_screen.js.map +1 -1
  534. package/build/screens/get_help_screen.d.ts +1 -1
  535. package/build/screens/get_help_screen.d.ts.map +1 -1
  536. package/build/screens/get_help_screen.js +4 -25
  537. package/build/screens/get_help_screen.js.map +1 -1
  538. package/build/screens/group_notification_level_select_screen.d.ts +1 -2
  539. package/build/screens/group_notification_level_select_screen.d.ts.map +1 -1
  540. package/build/screens/group_notification_level_select_screen.js +2 -4
  541. package/build/screens/group_notification_level_select_screen.js.map +1 -1
  542. package/build/screens/group_notification_settings_screen.d.ts +1 -2
  543. package/build/screens/group_notification_settings_screen.d.ts.map +1 -1
  544. package/build/screens/group_notification_settings_screen.js +3 -25
  545. package/build/screens/group_notification_settings_screen.js.map +1 -1
  546. package/build/screens/message_actions_screen.d.ts +1 -2
  547. package/build/screens/message_actions_screen.d.ts.map +1 -1
  548. package/build/screens/message_actions_screen.js +12 -28
  549. package/build/screens/message_actions_screen.js.map +1 -1
  550. package/build/screens/message_report/components/message_preview.d.ts +1 -2
  551. package/build/screens/message_report/components/message_preview.d.ts.map +1 -1
  552. package/build/screens/message_report/components/message_preview.js +2 -22
  553. package/build/screens/message_report/components/message_preview.js.map +1 -1
  554. package/build/screens/message_report/components/report_reason_list.d.ts +1 -2
  555. package/build/screens/message_report/components/report_reason_list.d.ts.map +1 -1
  556. package/build/screens/message_report/components/report_reason_list.js +4 -13
  557. package/build/screens/message_report/components/report_reason_list.js.map +1 -1
  558. package/build/screens/message_report_screen.d.ts +1 -2
  559. package/build/screens/message_report_screen.d.ts.map +1 -1
  560. package/build/screens/message_report_screen.js +9 -61
  561. package/build/screens/message_report_screen.js.map +1 -1
  562. package/build/screens/not_found.d.ts +1 -2
  563. package/build/screens/not_found.d.ts.map +1 -1
  564. package/build/screens/not_found.js +2 -5
  565. package/build/screens/not_found.js.map +1 -1
  566. package/build/screens/notification_settings/hooks/groups.d.ts +1 -1
  567. package/build/screens/notification_settings/hooks/groups.d.ts.map +1 -1
  568. package/build/screens/notification_settings_screen.d.ts +1 -2
  569. package/build/screens/notification_settings_screen.d.ts.map +1 -1
  570. package/build/screens/notification_settings_screen.js +28 -66
  571. package/build/screens/notification_settings_screen.js.map +1 -1
  572. package/build/screens/preferred_app_selection_screen.d.ts +1 -2
  573. package/build/screens/preferred_app_selection_screen.d.ts.map +1 -1
  574. package/build/screens/preferred_app_selection_screen.js +3 -21
  575. package/build/screens/preferred_app_selection_screen.js.map +1 -1
  576. package/build/screens/reactions_screen.d.ts +1 -2
  577. package/build/screens/reactions_screen.d.ts.map +1 -1
  578. package/build/screens/reactions_screen.js +7 -19
  579. package/build/screens/reactions_screen.js.map +1 -1
  580. package/build/screens/send_giphy_screen.d.ts +1 -2
  581. package/build/screens/send_giphy_screen.d.ts.map +1 -1
  582. package/build/screens/send_giphy_screen.js +5 -31
  583. package/build/screens/send_giphy_screen.js.map +1 -1
  584. package/build/screens/settings_screen.d.ts +1 -2
  585. package/build/screens/settings_screen.d.ts.map +1 -1
  586. package/build/screens/settings_screen.js +4 -26
  587. package/build/screens/settings_screen.js.map +1 -1
  588. package/build/screens/system_message_people_screen.d.ts +1 -2
  589. package/build/screens/system_message_people_screen.d.ts.map +1 -1
  590. package/build/screens/system_message_people_screen.js +4 -10
  591. package/build/screens/system_message_people_screen.js.map +1 -1
  592. package/build/screens/team_conversation_screen.d.ts +1 -1
  593. package/build/screens/team_conversation_screen.d.ts.map +1 -1
  594. package/build/screens/team_conversation_screen.js +4 -12
  595. package/build/screens/team_conversation_screen.js.map +1 -1
  596. package/build/types/resources/conversation.d.ts +1 -10
  597. package/build/types/resources/conversation.d.ts.map +1 -1
  598. package/build/types/resources/conversation.js.map +1 -1
  599. package/build/utils/client/client.d.ts.map +1 -1
  600. package/build/utils/client/client.js +1 -2
  601. package/build/utils/client/client.js.map +1 -1
  602. package/build/utils/request/conversation.d.ts.map +1 -1
  603. package/build/utils/request/conversation.js +0 -2
  604. package/build/utils/request/conversation.js.map +1 -1
  605. package/build/utils/response_error.d.ts +0 -1
  606. package/build/utils/response_error.d.ts.map +1 -1
  607. package/build/utils/response_error.js +1 -10
  608. package/build/utils/response_error.js.map +1 -1
  609. package/build/utils/sha_256.js.map +1 -1
  610. package/build/utils/system_messages.d.ts +1 -1
  611. package/build/utils/system_messages.d.ts.map +1 -1
  612. package/build/utils/system_messages.js.map +1 -1
  613. package/build/utils/theme.d.ts +2 -2
  614. package/build/utils/theme.d.ts.map +1 -1
  615. package/build/utils/theme.js.map +1 -1
  616. package/package.json +12 -12
  617. package/src/__tests__/hooks/use_attachment_uploader.test.tsx +1 -0
  618. package/src/__tests__/hooks/use_font_scale.test.ts +7 -3
  619. package/src/__tests__/utils/native_adapters/configuration.ts +1 -1
  620. package/src/__tests__/utils/system_messages.ts +1 -1
  621. package/src/__tests__/utils/uri.ts +8 -50
  622. package/src/__utils__/handlers.ts +5 -6
  623. package/src/components/conversation/attachments/attachment_deleting_overlay.tsx +10 -3
  624. package/src/components/conversations/conversation_preview.tsx +23 -58
  625. package/src/components/conversations/unread_count_badge.tsx +4 -13
  626. package/src/components/page/__tests__/component_error_boundary.test.tsx +1 -1
  627. package/src/components/page/__tests__/error_boundary.test.tsx +6 -2
  628. package/src/components/page/__tests__/page_error_boundary.test.tsx +1 -1
  629. package/src/hooks/use_conversation.ts +0 -2
  630. package/src/hooks/use_conversation_jolt_events.ts +19 -3
  631. package/src/hooks/use_conversation_messages.ts +6 -5
  632. package/src/hooks/use_conversations_actions.ts +1 -3
  633. package/src/hooks/use_mark_latest_message_read.ts +4 -3
  634. package/src/hooks/use_suspense_api.ts +9 -1
  635. package/src/index.tsx +2 -1
  636. package/src/polyfills/events/EventTarget.ts +1 -1
  637. package/src/screens/conversation_screen.tsx +4 -2
  638. package/src/screens/conversations/components/list_header_component.tsx +6 -6
  639. package/src/types/resources/conversation.ts +1 -11
  640. package/src/utils/client/client.ts +1 -2
  641. package/src/utils/request/conversation.ts +0 -2
  642. package/src/utils/response_error.ts +1 -12
  643. package/src/utils/sha_256.ts +24 -24
  644. package/src/utils/system_messages.ts +1 -1
  645. package/src/utils/theme.ts +3 -2
  646. package/src/utils/__tests__/response_error.test.ts +0 -40
@@ -1 +1 @@
1
- {"version":3,"file":"use_conversation_jolt_events.js","sourceRoot":"","sources":["../../src/hooks/use_conversation_jolt_events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAG5C,OAAO,EAAE,2CAA2C,EAAE,MAAM,+BAA+B,CAAA;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAMvD,MAAM,UAAU,yBAAyB,CAAC,EAAE,cAAc,EAAS;IACjE,MAAM,WAAW,GAAG,cAAc,CAAC,sBAAsB,cAAc,EAAE,CAAC,CAAA;IAC1E,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IACpC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IACxC,MAAM,eAAe,GAAG,aAAa,EAAE,EAAE,CAAA;IACzC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,QAAQ,GAAG,OAAO,CACtB,GAAG,EAAE,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC,CAAC,EACzF,CAAC,cAAc,CAAC,CACjB,CAAA;IA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EAAE;oBACJ,GAAG,IAAI,CAAC,IAAI;oBACZ,wBAAwB,EAAE,4BAA4B;oBACtD,cAAc,EAAE,KAAK;iBACtB;aACF,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,EACD,CAAC,WAAW,EAAE,QAAQ,CAAC,CACxB,CAAA;IAED,MAAM,2BAA2B,GAAG,WAAW,CAAC,GAAG,EAAE;QACnD,WAAW,CAAC,YAAY,CAAoC,QAAQ,EAAE,IAAI,CAAC,EAAE;YAC3E,IAAI,CAAC,IAAI,EAAE,IAAI;gBAAE,OAAO,IAAI,CAAA;YAE5B,OAAO;gBACL,GAAG,IAAI;gBACP,IAAI,EAAE;oBACJ,GAAG,IAAI,CAAC,IAAI;oBACZ,OAAO,EAAE,IAAI;iBACd;aACF,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAA;IAE3B,MAAM,uBAAuB,GAAG,WAAW,CACzC,CAAC,KAAwB,EAAE,EAAE;QAC3B,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,KAAK,eAAe;YAAE,OAAM;QAEzD,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;IAC7C,CAAC,EACD,CAAC,WAAW,EAAE,QAAQ,EAAE,eAAe,CAAC,CACzC,CAAA;IAED,YAAY,CAAC,WAAW,EAAE,sBAAsB,EAAE,yBAAyB,CAAC,CAAA;IAC5E,YAAY,CAAC,WAAW,EAAE,mBAAmB,EAAE,sBAAsB,CAAC,CAAA;IACtE,YAAY,CAAC,WAAW,EAAE,wBAAwB,EAAE,2BAA2B,CAAC,CAAA;IAChF,YAAY,CAAC,WAAW,EAAE,YAAY,EAAE,uBAAuB,CAAC,CAAA;AAClE,CAAC","sourcesContent":["import { useQueryClient } from '@tanstack/react-query'\nimport { useCallback, useMemo } from 'react'\nimport { ApiResource, ConversationResource } from '../types'\nimport { JoltConversationEvent, JoltReactionEvent } from '../types/jolt_events'\nimport { completeMessageCreationConversationTracking } from '../utils/performance_tracking'\nimport { useApiClient } from './use_api_client'\nimport { getConversationRequestArgs } from './use_conversation'\nimport { useCurrentPerson } from './use_current_person'\nimport { useJoltChannel, useJoltEvent } from './use_jolt'\nimport { getRequestQueryKey } from './use_suspense_api'\n\ninterface Props {\n conversationId: number\n}\n\nexport function useConversationJoltEvents({ conversationId }: Props) {\n const joltChannel = useJoltChannel(`chat.conversations.${conversationId}`)\n const queryClient = useQueryClient()\n const currentPerson = useCurrentPerson()\n const currentPersonId = currentPerson?.id\n const apiClient = useApiClient()\n const queryKey = useMemo(\n () => getRequestQueryKey(getConversationRequestArgs({ conversation_id: conversationId })),\n [conversationId]\n )\n\n const handleUpdatedConversation = useCallback(\n (e: JoltConversationEvent) => {\n const { last_message_idempotent_key, last_message_author_id, disabled, disabled_reason } =\n e.data.data\n\n if (last_message_idempotent_key && last_message_author_id === currentPersonId) {\n completeMessageCreationConversationTracking({\n apiClient,\n idempotentKey: last_message_idempotent_key,\n })\n }\n\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n return { ...prev, data: { ...prev.data, disabled, disabledReason: disabled_reason } }\n })\n\n queryClient.invalidateQueries({ queryKey })\n },\n [queryClient, queryKey, currentPersonId, apiClient]\n )\n\n const handleConversationRead = useCallback(\n (e: JoltConversationEvent) => {\n const { latest_read_message_sort_key } = e.data.data\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data || !latest_read_message_sort_key) return prev\n if (\n prev.data.latestReadMessageSortKey &&\n prev.data.latestReadMessageSortKey >= latest_read_message_sort_key\n ) {\n return prev\n }\n\n return {\n ...prev,\n data: {\n ...prev.data,\n latestReadMessageSortKey: latest_read_message_sort_key,\n unreadReaction: false,\n },\n }\n })\n },\n [queryClient, queryKey]\n )\n\n const handleConversationDestroyed = useCallback(() => {\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n\n return {\n ...prev,\n data: {\n ...prev.data,\n deleted: true,\n },\n }\n })\n }, [queryClient, queryKey])\n\n const handleReactionJoltEvent = useCallback(\n (event: JoltReactionEvent) => {\n if (event.data.data.author_id === currentPersonId) return\n\n queryClient.invalidateQueries({ queryKey })\n },\n [queryClient, queryKey, currentPersonId]\n )\n\n useJoltEvent(joltChannel, 'conversation.updated', handleUpdatedConversation)\n useJoltEvent(joltChannel, 'conversation.read', handleConversationRead)\n useJoltEvent(joltChannel, 'conversation.destroyed', handleConversationDestroyed)\n useJoltEvent(joltChannel, 'reaction.*', handleReactionJoltEvent)\n}\n"]}
1
+ {"version":3,"file":"use_conversation_jolt_events.js","sourceRoot":"","sources":["../../src/hooks/use_conversation_jolt_events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAG5C,OAAO,EAAE,2CAA2C,EAAE,MAAM,+BAA+B,CAAA;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAMvD,MAAM,UAAU,yBAAyB,CAAC,EAAE,cAAc,EAAS;IACjE,MAAM,WAAW,GAAG,cAAc,CAAC,sBAAsB,cAAc,EAAE,CAAC,CAAA;IAC1E,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IACpC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IACxC,MAAM,eAAe,GAAG,aAAa,EAAE,EAAE,CAAA;IACzC,MAAM,SAAS,GAAG,YAAY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,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,GAAG,CAAC;wBACnC,CAAC,CAAC,CAAC;iBACN;aACF,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,EACD,CAAC,WAAW,EAAE,QAAQ,EAAE,eAAe,CAAC,CACzC,CAAA;IAED,YAAY,CAAC,WAAW,EAAE,sBAAsB,EAAE,yBAAyB,CAAC,CAAA;IAC5E,YAAY,CAAC,WAAW,EAAE,mBAAmB,EAAE,sBAAsB,CAAC,CAAA;IACtE,YAAY,CAAC,WAAW,EAAE,wBAAwB,EAAE,2BAA2B,CAAC,CAAA;IAChF,YAAY,CAAC,WAAW,EAAE,YAAY,EAAE,uBAAuB,CAAC,CAAA;AAClE,CAAC","sourcesContent":["import { useQueryClient } from '@tanstack/react-query'\nimport { useCallback, useMemo } from 'react'\nimport { ApiResource, ConversationResource } from '../types'\nimport { JoltConversationEvent, JoltReactionEvent } from '../types/jolt_events'\nimport { completeMessageCreationConversationTracking } from '../utils/performance_tracking'\nimport { useApiClient } from './use_api_client'\nimport { getConversationRequestArgs } from './use_conversation'\nimport { useCurrentPerson } from './use_current_person'\nimport { useJoltChannel, useJoltEvent } from './use_jolt'\nimport { getRequestQueryKey } from './use_suspense_api'\n\ninterface Props {\n conversationId: number\n}\n\nexport function useConversationJoltEvents({ conversationId }: Props) {\n const joltChannel = useJoltChannel(`chat.conversations.${conversationId}`)\n const queryClient = useQueryClient()\n const currentPerson = useCurrentPerson()\n const currentPersonId = currentPerson?.id\n const apiClient = useApiClient()\n const queryKey = useMemo(\n () => getRequestQueryKey(getConversationRequestArgs({ conversation_id: conversationId })),\n [conversationId]\n )\n\n const handleUpdatedConversation = useCallback(\n (e: JoltConversationEvent) => {\n const { last_message_idempotent_key, last_message_author_id, disabled, disabled_reason } =\n e.data.data\n\n if (last_message_idempotent_key && last_message_author_id === currentPersonId) {\n completeMessageCreationConversationTracking({\n apiClient,\n idempotentKey: last_message_idempotent_key,\n })\n }\n\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n return { ...prev, data: { ...prev.data, disabled, disabledReason: disabled_reason } }\n })\n\n queryClient.invalidateQueries({ queryKey })\n },\n [queryClient, queryKey, currentPersonId, apiClient]\n )\n\n const handleConversationRead = useCallback(\n (e: JoltConversationEvent) => {\n const { latest_read_message_sort_key } = e.data.data\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data || !latest_read_message_sort_key) return prev\n if (\n prev.data.latestReadMessageSortKey &&\n prev.data.latestReadMessageSortKey >= latest_read_message_sort_key\n ) {\n return prev\n }\n\n return {\n ...prev,\n data: {\n ...prev.data,\n latestReadMessageSortKey: latest_read_message_sort_key,\n unreadReactionCount: 0,\n },\n }\n })\n },\n [queryClient, queryKey]\n )\n\n const handleConversationDestroyed = useCallback(() => {\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n\n return {\n ...prev,\n data: {\n ...prev.data,\n deleted: true,\n },\n }\n })\n }, [queryClient, queryKey])\n\n const handleReactionJoltEvent = useCallback(\n (event: JoltReactionEvent) => {\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n\n if (event.data.data.author_id === currentPersonId) {\n return prev\n }\n\n return {\n ...prev,\n data: {\n ...prev.data,\n // Not a real count, just a derived value from Jolt events so we can\n // determine if we should mark the conversation as read\n unreadReactionCount: prev.data.unreadReactionCount\n ? prev.data.unreadReactionCount + 1\n : 1,\n },\n }\n })\n },\n [queryClient, queryKey, currentPersonId]\n )\n\n useJoltEvent(joltChannel, 'conversation.updated', handleUpdatedConversation)\n useJoltEvent(joltChannel, 'conversation.read', handleConversationRead)\n useJoltEvent(joltChannel, 'conversation.destroyed', handleConversationDestroyed)\n useJoltEvent(joltChannel, 'reaction.*', handleReactionJoltEvent)\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { ApiResource, ConversationMembershipResource } from '../types';
2
2
  export declare const useConversationMembershipUpdate: ({ conversation_id, }: {
3
3
  conversation_id: number;
4
- }) => import("@tanstack/react-query").UseMutationResult<ApiResource<ConversationMembershipResource>, Error, Partial<ConversationMembershipResource>, void>;
4
+ }) => import("@tanstack/react-query").UseMutationResult<ApiResource<ConversationMembershipResource>, Error, Partial<ConversationMembershipResource>, Promise<undefined> | undefined>;
5
5
  //# sourceMappingURL=use_conversation_membership.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use_conversation_membership.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation_membership.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAwB,MAAM,UAAU,CAAA;AAO5F,eAAO,MAAM,+BAA+B,GAAI,sBAE7C;IACD,eAAe,EAAE,MAAM,CAAA;CACxB,yJAyCA,CAAA"}
1
+ {"version":3,"file":"use_conversation_membership.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation_membership.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAwB,MAAM,UAAU,CAAA;AAO5F,eAAO,MAAM,+BAA+B,GAAI,sBAE7C;IACD,eAAe,EAAE,MAAM,CAAA;CACxB,mLAyCA,CAAA"}
@@ -8,6 +8,7 @@ export declare const useConversationMessages: ({ conversation_id, reply_root_id
8
8
  refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<MessageResource>, unknown>, Response>>;
9
9
  isRefetching: boolean;
10
10
  fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<MessageResource>, unknown>, Response>>;
11
+ hasNextPage: boolean;
11
12
  queryKey: import("./use_suspense_api").RequestQueryKey;
12
13
  };
13
14
  //# sourceMappingURL=use_conversation_messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use_conversation_messages.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation_messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,OAAO,EAAE,wBAAwB,EAAwB,MAAM,oBAAoB,CAAA;AAEnF,eAAO,MAAM,uBAAuB,GAClC,oCAAoC;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAC9F,OAAO,wBAAwB;;;;;;CAoBhC,CAAA"}
1
+ {"version":3,"file":"use_conversation_messages.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation_messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,OAAO,EAAE,wBAAwB,EAAwB,MAAM,oBAAoB,CAAA;AAEnF,eAAO,MAAM,uBAAuB,GAClC,oCAAoC;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAC9F,OAAO,wBAAwB;;;;;;;CAqBhC,CAAA"}
@@ -2,12 +2,12 @@ import { useMemo } from 'react';
2
2
  import { getMessagesQueryKey, getMessagesRequestArgs } from '../utils/request/get_messages';
3
3
  import { useSuspensePaginator } from './use_suspense_api';
4
4
  export const useConversationMessages = ({ conversation_id, reply_root_id }, opts) => {
5
- const { data, refetch, isRefetching, fetchNextPage } = useSuspensePaginator(getMessagesRequestArgs({ conversation_id, reply_root_id }), opts);
5
+ const { data, refetch, isRefetching, fetchNextPage, hasNextPage } = useSuspensePaginator(getMessagesRequestArgs({ conversation_id, reply_root_id }), opts);
6
6
  const queryKey = getMessagesQueryKey({ conversation_id, reply_root_id });
7
7
  const messages = useMemo(() => data
8
8
  .filter(message => (!message.deletedAt || message.replyRootId) &&
9
9
  (message.attachments?.length || message.text?.length))
10
10
  .sort((a, b) => -a.id.localeCompare(b.id)), [data]);
11
- return { messages, refetch, isRefetching, fetchNextPage, queryKey };
11
+ return { messages, refetch, isRefetching, fetchNextPage, hasNextPage, queryKey };
12
12
  };
13
13
  //# sourceMappingURL=use_conversation_messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use_conversation_messages.js","sourceRoot":"","sources":["../../src/hooks/use_conversation_messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAC3F,OAAO,EAA4B,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEnF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,EAAE,eAAe,EAAE,aAAa,EAA8D,EAC9F,IAA+B,EAC/B,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,oBAAoB,CACzE,sBAAsB,CAAC,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC,EAC1D,IAAI,CACL,CAAA;IACD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC,CAAA;IACxE,MAAM,QAAQ,GAAG,OAAO,CACtB,GAAG,EAAE,CACH,IAAI;SACD,MAAM,CACL,OAAO,CAAC,EAAE,CACR,CAAC,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC;QAC3C,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CACxD;SACA,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAC9C,CAAC,IAAI,CAAC,CACP,CAAA;IAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAA;AACrE,CAAC,CAAA","sourcesContent":["import { useMemo } from 'react'\nimport { MessageResource } from '../types'\nimport { getMessagesQueryKey, getMessagesRequestArgs } from '../utils/request/get_messages'\nimport { SuspensePaginatorOptions, useSuspensePaginator } from './use_suspense_api'\n\nexport const useConversationMessages = (\n { conversation_id, reply_root_id }: { conversation_id: number; reply_root_id?: string | null },\n opts?: SuspensePaginatorOptions\n) => {\n const { data, refetch, isRefetching, fetchNextPage } = useSuspensePaginator<MessageResource>(\n getMessagesRequestArgs({ conversation_id, reply_root_id }),\n opts\n )\n const queryKey = getMessagesQueryKey({ conversation_id, reply_root_id })\n const messages = useMemo(\n () =>\n data\n .filter(\n message =>\n (!message.deletedAt || message.replyRootId) &&\n (message.attachments?.length || message.text?.length)\n )\n .sort((a, b) => -a.id.localeCompare(b.id)),\n [data]\n )\n\n return { messages, refetch, isRefetching, fetchNextPage, queryKey }\n}\n"]}
1
+ {"version":3,"file":"use_conversation_messages.js","sourceRoot":"","sources":["../../src/hooks/use_conversation_messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAC3F,OAAO,EAA4B,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEnF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,EAAE,eAAe,EAAE,aAAa,EAA8D,EAC9F,IAA+B,EAC/B,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,GAC/D,oBAAoB,CAClB,sBAAsB,CAAC,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC,EAC1D,IAAI,CACL,CAAA;IACH,MAAM,QAAQ,GAAG,mBAAmB,CAAC,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC,CAAA;IACxE,MAAM,QAAQ,GAAG,OAAO,CACtB,GAAG,EAAE,CACH,IAAI;SACD,MAAM,CACL,OAAO,CAAC,EAAE,CACR,CAAC,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC;QAC3C,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CACxD;SACA,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAC9C,CAAC,IAAI,CAAC,CACP,CAAA;IAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAA;AAClF,CAAC,CAAA","sourcesContent":["import { useMemo } from 'react'\nimport { MessageResource } from '../types'\nimport { getMessagesQueryKey, getMessagesRequestArgs } from '../utils/request/get_messages'\nimport { SuspensePaginatorOptions, useSuspensePaginator } from './use_suspense_api'\n\nexport const useConversationMessages = (\n { conversation_id, reply_root_id }: { conversation_id: number; reply_root_id?: string | null },\n opts?: SuspensePaginatorOptions\n) => {\n const { data, refetch, isRefetching, fetchNextPage, hasNextPage } =\n useSuspensePaginator<MessageResource>(\n getMessagesRequestArgs({ conversation_id, reply_root_id }),\n opts\n )\n const queryKey = getMessagesQueryKey({ conversation_id, reply_root_id })\n const messages = useMemo(\n () =>\n data\n .filter(\n message =>\n (!message.deletedAt || message.replyRootId) &&\n (message.attachments?.length || message.text?.length)\n )\n .sort((a, b) => -a.id.localeCompare(b.id)),\n [data]\n )\n\n return { messages, refetch, isRefetching, fetchNextPage, hasNextPage, queryKey }\n}\n"]}
@@ -11,14 +11,14 @@ export declare const useConversationsMarkRead: ({ conversation, }: {
11
11
  isSuccess: false;
12
12
  status: "idle";
13
13
  reset: () => void;
14
- context: void | undefined;
14
+ context: Promise<undefined> | undefined;
15
15
  failureCount: number;
16
16
  failureReason: Error | null;
17
17
  isPaused: boolean;
18
18
  submittedAt: number;
19
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, boolean, void>;
19
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, boolean, Promise<undefined> | undefined>;
20
20
  read: boolean;
21
- markRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, boolean, void>;
21
+ markRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, boolean, Promise<undefined> | undefined>;
22
22
  } | {
23
23
  data: undefined;
24
24
  variables: boolean;
@@ -29,14 +29,14 @@ export declare const useConversationsMarkRead: ({ conversation, }: {
29
29
  isSuccess: false;
30
30
  status: "pending";
31
31
  reset: () => void;
32
- context: void | undefined;
32
+ context: Promise<undefined> | undefined;
33
33
  failureCount: number;
34
34
  failureReason: Error | null;
35
35
  isPaused: boolean;
36
36
  submittedAt: number;
37
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, boolean, void>;
37
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, boolean, Promise<undefined> | undefined>;
38
38
  read: boolean;
39
- markRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, boolean, void>;
39
+ markRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, boolean, Promise<undefined> | undefined>;
40
40
  } | {
41
41
  data: undefined;
42
42
  error: Error;
@@ -47,14 +47,14 @@ export declare const useConversationsMarkRead: ({ conversation, }: {
47
47
  isSuccess: false;
48
48
  status: "error";
49
49
  reset: () => void;
50
- context: void | undefined;
50
+ context: Promise<undefined> | undefined;
51
51
  failureCount: number;
52
52
  failureReason: Error | null;
53
53
  isPaused: boolean;
54
54
  submittedAt: number;
55
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, boolean, void>;
55
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, boolean, Promise<undefined> | undefined>;
56
56
  read: boolean;
57
- markRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, boolean, void>;
57
+ markRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, boolean, Promise<undefined> | undefined>;
58
58
  } | {
59
59
  data: import("..").ApiCollection | ApiResource;
60
60
  error: null;
@@ -65,14 +65,14 @@ export declare const useConversationsMarkRead: ({ conversation, }: {
65
65
  isSuccess: true;
66
66
  status: "success";
67
67
  reset: () => void;
68
- context: void | undefined;
68
+ context: Promise<undefined> | undefined;
69
69
  failureCount: number;
70
70
  failureReason: Error | null;
71
71
  isPaused: boolean;
72
72
  submittedAt: number;
73
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, boolean, void>;
73
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, boolean, Promise<undefined> | undefined>;
74
74
  read: boolean;
75
- markRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, boolean, void>;
75
+ markRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, boolean, Promise<undefined> | undefined>;
76
76
  };
77
77
  export declare const useConversationsMute: ({ conversation }: {
78
78
  conversation: ConversationResource;
@@ -86,14 +86,14 @@ export declare const useConversationsMute: ({ conversation }: {
86
86
  isSuccess: false;
87
87
  status: "idle";
88
88
  reset: () => void;
89
- context: void | undefined;
89
+ context: Promise<undefined> | undefined;
90
90
  failureCount: number;
91
91
  failureReason: Error | null;
92
92
  isPaused: boolean;
93
93
  submittedAt: number;
94
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, void>;
94
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, Promise<undefined> | undefined>;
95
95
  muted: boolean;
96
- setMuted: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, void>;
96
+ setMuted: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, Promise<undefined> | undefined>;
97
97
  } | {
98
98
  data: undefined;
99
99
  variables: boolean;
@@ -104,14 +104,14 @@ export declare const useConversationsMute: ({ conversation }: {
104
104
  isSuccess: false;
105
105
  status: "pending";
106
106
  reset: () => void;
107
- context: void | undefined;
107
+ context: Promise<undefined> | undefined;
108
108
  failureCount: number;
109
109
  failureReason: Error | null;
110
110
  isPaused: boolean;
111
111
  submittedAt: number;
112
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, void>;
112
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, Promise<undefined> | undefined>;
113
113
  muted: boolean;
114
- setMuted: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, void>;
114
+ setMuted: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, Promise<undefined> | undefined>;
115
115
  } | {
116
116
  data: undefined;
117
117
  error: Error;
@@ -122,14 +122,14 @@ export declare const useConversationsMute: ({ conversation }: {
122
122
  isSuccess: false;
123
123
  status: "error";
124
124
  reset: () => void;
125
- context: void | undefined;
125
+ context: Promise<undefined> | undefined;
126
126
  failureCount: number;
127
127
  failureReason: Error | null;
128
128
  isPaused: boolean;
129
129
  submittedAt: number;
130
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, void>;
130
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, Promise<undefined> | undefined>;
131
131
  muted: boolean;
132
- setMuted: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, void>;
132
+ setMuted: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, Promise<undefined> | undefined>;
133
133
  } | {
134
134
  data: ApiResource<ConversationResource>;
135
135
  error: null;
@@ -140,14 +140,14 @@ export declare const useConversationsMute: ({ conversation }: {
140
140
  isSuccess: true;
141
141
  status: "success";
142
142
  reset: () => void;
143
- context: void | undefined;
143
+ context: Promise<undefined> | undefined;
144
144
  failureCount: number;
145
145
  failureReason: Error | null;
146
146
  isPaused: boolean;
147
147
  submittedAt: number;
148
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, void>;
148
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, Promise<undefined> | undefined>;
149
149
  muted: boolean;
150
- setMuted: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, void>;
150
+ setMuted: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, Promise<undefined> | undefined>;
151
151
  };
152
152
  export declare const useMarkAllRead: () => {
153
153
  data: undefined;
@@ -159,13 +159,13 @@ export declare const useMarkAllRead: () => {
159
159
  isSuccess: false;
160
160
  status: "idle";
161
161
  reset: () => void;
162
- context: void | undefined;
162
+ context: undefined;
163
163
  failureCount: number;
164
164
  failureReason: Error | null;
165
165
  isPaused: boolean;
166
166
  submittedAt: number;
167
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, void, void>;
168
- markAllRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, void, void>;
167
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, void, undefined>;
168
+ markAllRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, void, undefined>;
169
169
  } | {
170
170
  data: undefined;
171
171
  variables: void;
@@ -176,13 +176,13 @@ export declare const useMarkAllRead: () => {
176
176
  isSuccess: false;
177
177
  status: "pending";
178
178
  reset: () => void;
179
- context: void | undefined;
179
+ context: undefined;
180
180
  failureCount: number;
181
181
  failureReason: Error | null;
182
182
  isPaused: boolean;
183
183
  submittedAt: number;
184
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, void, void>;
185
- markAllRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, void, void>;
184
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, void, undefined>;
185
+ markAllRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, void, undefined>;
186
186
  } | {
187
187
  data: undefined;
188
188
  error: Error;
@@ -193,13 +193,13 @@ export declare const useMarkAllRead: () => {
193
193
  isSuccess: false;
194
194
  status: "error";
195
195
  reset: () => void;
196
- context: void | undefined;
196
+ context: undefined;
197
197
  failureCount: number;
198
198
  failureReason: Error | null;
199
199
  isPaused: boolean;
200
200
  submittedAt: number;
201
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, void, void>;
202
- markAllRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, void, void>;
201
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, void, undefined>;
202
+ markAllRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, void, undefined>;
203
203
  } | {
204
204
  data: import("..").ApiCollection | ApiResource;
205
205
  error: null;
@@ -210,12 +210,12 @@ export declare const useMarkAllRead: () => {
210
210
  isSuccess: true;
211
211
  status: "success";
212
212
  reset: () => void;
213
- context: void | undefined;
213
+ context: undefined;
214
214
  failureCount: number;
215
215
  failureReason: Error | null;
216
216
  isPaused: boolean;
217
217
  submittedAt: number;
218
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, void, void>;
219
- markAllRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, void, void>;
218
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("..").ApiCollection | ApiResource, Error, void, undefined>;
219
+ markAllRead: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | ApiResource, Error, void, undefined>;
220
220
  };
221
221
  //# sourceMappingURL=use_conversations_actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use_conversations_actions.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversations_actions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAK5D,eAAO,MAAM,wBAAwB,GAAI,mBAEtC;IACD,YAAY,EAAE,oBAAoB,CAAA;CACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CA,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,kBAAkB;IAAE,YAAY,EAAE,oBAAoB,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC5F,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuB1B,CAAA"}
1
+ {"version":3,"file":"use_conversations_actions.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversations_actions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAK5D,eAAO,MAAM,wBAAwB,GAAI,mBAEtC;IACD,YAAY,EAAE,oBAAoB,CAAA;CACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CA,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,kBAAkB;IAAE,YAAY,EAAE,oBAAoB,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC5F,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsB1B,CAAA"}
@@ -13,7 +13,7 @@ export const useConversationsMarkRead = ({ conversation, }) => {
13
13
  currentPersonCache.update({}, person => {
14
14
  const currentUnread = person.unreadCount;
15
15
  const updatedUnread = read ? Math.max(currentUnread - 1, 0) : currentUnread + 1;
16
- return { ...person, unreadCount: updatedUnread };
16
+ return { ...person, unreadCount: updatedUnread, unreadReactionCount: 0 };
17
17
  });
18
18
  }
19
19
  const { mutate: handleMarkRead, ...mutation } = useMutation({
@@ -21,7 +21,6 @@ export const useConversationsMarkRead = ({ conversation, }) => {
21
21
  update({
22
22
  ...conversation,
23
23
  unreadCount: read ? 0 : 1,
24
- ...(read ? { unreadReaction: false } : {}),
25
24
  });
26
25
  handlePersonUnreadCount(read);
27
26
  },
@@ -92,7 +91,6 @@ export const useMarkAllRead = () => {
92
91
  onMutate: () => {
93
92
  updateAll({
94
93
  unreadCount: 0,
95
- unreadReaction: false,
96
94
  });
97
95
  },
98
96
  mutationKey: ['markAllRead', args],
@@ -1 +1 @@
1
- {"version":3,"file":"use_conversations_actions.js","sourceRoot":"","sources":["../../src/hooks/use_conversations_actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAE3E,OAAO,EAA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CAAC,CAAA;IAC7D,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW,CAAC;QACpD,QAAQ,EAAE,GAAG,EAAE;YACb,SAAS,CAAC;gBACR,WAAW,EAAE,CAAC;gBACd,cAAc,EAAE,KAAK;aACtB,CAAC,CAAA;QACJ,CAAC;QACD,WAAW,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC;QAClC,UAAU,EAAE,GAAG,EAAE,CACf,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;YAClB,GAAG,EAAE,mBAAmB;SACzB,CAAC;QACJ,SAAS,EAAE,UAAU;KACtB,CAAC,CAAA;IAEF,OAAO;QACL,WAAW;QACX,GAAG,KAAK;KACT,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { useMutation } from '@tanstack/react-query'\nimport { Alert } from 'react-native'\nimport { useConversationsContext } from '../contexts/conversations_context'\nimport { ApiResource, ConversationResource } from '../types'\nimport { useApiClient } from './use_api_client'\nimport { useConversationsCache } from './use_conversations_cache'\nimport { useCurrentPersonCache } from './use_current_person'\n\nexport const useConversationsMarkRead = ({\n conversation,\n}: {\n conversation: ConversationResource\n}) => {\n const apiClient = useApiClient()\n const { args } = useConversationsContext()\n const currentPersonCache = useCurrentPersonCache()\n const { update, invalidate, fetchUpdate } = useConversationsCache(args)\n\n function handlePersonUnreadCount(read: boolean) {\n currentPersonCache.update({}, person => {\n const currentUnread = person.unreadCount\n const updatedUnread = read ? Math.max(currentUnread - 1, 0) : currentUnread + 1\n return { ...person, unreadCount: updatedUnread }\n })\n }\n\n const { mutate: handleMarkRead, ...mutation } = useMutation({\n onMutate: async (read: boolean) => {\n update({\n ...conversation,\n unreadCount: read ? 0 : 1,\n ...(read ? { unreadReaction: false } : {}),\n })\n handlePersonUnreadCount(read)\n },\n mutationKey: ['markRead', conversation.id],\n mutationFn: async (read: boolean) => {\n const action = read ? 'mark_read' : 'mark_unread'\n\n return apiClient.chat.post({\n url: `/me/conversations/${conversation.id}/${action}`,\n data: { data: { type: '', attributes: {} }, fields: { Conversation: 'unread_count,id' } },\n })\n },\n onSuccess: () => {\n fetchUpdate(conversation)\n },\n onError: () => {\n Alert.alert('Oops', 'Something went wrong updating this conversation, please try again')\n invalidate()\n },\n })\n\n return {\n read: conversation.unreadCount < 1, // prefer cache\n markRead: handleMarkRead,\n ...mutation,\n }\n}\n\nexport const useConversationsMute = ({ conversation }: { conversation: ConversationResource }) => {\n const apiClient = useApiClient()\n const { args } = useConversationsContext()\n const { update, invalidate } = useConversationsCache(args)\n\n const { mutate: setMuted, ...mutation } = useMutation({\n onMutate: async (muted: boolean) => {\n update({\n ...conversation,\n muted,\n conversationMembership: {\n ...conversation?.conversationMembership,\n muted,\n },\n })\n },\n mutationKey: ['muteConversation'],\n mutationFn: async (muted: boolean) => {\n const action = muted ? 'mute' : 'unmute'\n\n return apiClient.chat.post<ApiResource<ConversationResource>>({\n url: `/me/conversations/${conversation.id}/${action}`,\n data: { data: { type: '', attributes: {} }, fields: { Conversation: 'muted' } },\n })\n },\n onSuccess: (response: ApiResource<ConversationResource>) => {\n update(response.data)\n },\n onError: () => {\n Alert.alert('Oops', 'Something went wrong muting this conversation, please try again')\n invalidate()\n },\n })\n\n return {\n muted: conversation.muted, // prefer cache\n setMuted,\n ...mutation,\n }\n}\n\nexport const useMarkAllRead = () => {\n const apiClient = useApiClient()\n const { args } = useConversationsContext()\n const { invalidate, updateAll } = useConversationsCache(args)\n const { mutate: markAllRead, ...query } = useMutation({\n onMutate: () => {\n updateAll({\n unreadCount: 0,\n unreadReaction: false,\n })\n },\n mutationKey: ['markAllRead', args],\n mutationFn: () =>\n apiClient.chat.post({\n url: '/me/mark_all_read',\n }),\n onSettled: invalidate,\n })\n\n return {\n markAllRead,\n ...query,\n }\n}\n"]}
1
+ {"version":3,"file":"use_conversations_actions.js","sourceRoot":"","sources":["../../src/hooks/use_conversations_actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MA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AM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAA;IAC7D,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW,CAAC;QACpD,QAAQ,EAAE,GAAG,EAAE;YACb,SAAS,CAAC;gBACR,WAAW,EAAE,CAAC;aACf,CAAC,CAAA;QACJ,CAAC;QACD,WAAW,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC;QAClC,UAAU,EAAE,GAAG,EAAE,CACf,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;YAClB,GAAG,EAAE,mBAAmB;SACzB,CAAC;QACJ,SAAS,EAAE,UAAU;KACtB,CAAC,CAAA;IAEF,OAAO;QACL,WAAW;QACX,GAAG,KAAK;KACT,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { useMutation } from '@tanstack/react-query'\nimport { Alert } from 'react-native'\nimport { useConversationsContext } from '../contexts/conversations_context'\nimport { ApiResource, ConversationResource } from '../types'\nimport { useApiClient } from './use_api_client'\nimport { useConversationsCache } from './use_conversations_cache'\nimport { useCurrentPersonCache } from './use_current_person'\n\nexport const useConversationsMarkRead = ({\n conversation,\n}: {\n conversation: ConversationResource\n}) => {\n const apiClient = useApiClient()\n const { args } = useConversationsContext()\n const currentPersonCache = useCurrentPersonCache()\n const { update, invalidate, fetchUpdate } = useConversationsCache(args)\n\n function handlePersonUnreadCount(read: boolean) {\n currentPersonCache.update({}, person => {\n const currentUnread = person.unreadCount\n const updatedUnread = read ? Math.max(currentUnread - 1, 0) : currentUnread + 1\n return { ...person, unreadCount: updatedUnread, unreadReactionCount: 0 }\n })\n }\n\n const { mutate: handleMarkRead, ...mutation } = useMutation({\n onMutate: async (read: boolean) => {\n update({\n ...conversation,\n unreadCount: read ? 0 : 1,\n })\n handlePersonUnreadCount(read)\n },\n mutationKey: ['markRead', conversation.id],\n mutationFn: async (read: boolean) => {\n const action = read ? 'mark_read' : 'mark_unread'\n\n return apiClient.chat.post({\n url: `/me/conversations/${conversation.id}/${action}`,\n data: { data: { type: '', attributes: {} }, fields: { Conversation: 'unread_count,id' } },\n })\n },\n onSuccess: () => {\n fetchUpdate(conversation)\n },\n onError: () => {\n Alert.alert('Oops', 'Something went wrong updating this conversation, please try again')\n invalidate()\n },\n })\n\n return {\n read: conversation.unreadCount < 1, // prefer cache\n markRead: handleMarkRead,\n ...mutation,\n }\n}\n\nexport const useConversationsMute = ({ conversation }: { conversation: ConversationResource }) => {\n const apiClient = useApiClient()\n const { args } = useConversationsContext()\n const { update, invalidate } = useConversationsCache(args)\n\n const { mutate: setMuted, ...mutation } = useMutation({\n onMutate: async (muted: boolean) => {\n update({\n ...conversation,\n muted,\n conversationMembership: {\n ...conversation?.conversationMembership,\n muted,\n },\n })\n },\n mutationKey: ['muteConversation'],\n mutationFn: async (muted: boolean) => {\n const action = muted ? 'mute' : 'unmute'\n\n return apiClient.chat.post<ApiResource<ConversationResource>>({\n url: `/me/conversations/${conversation.id}/${action}`,\n data: { data: { type: '', attributes: {} }, fields: { Conversation: 'muted' } },\n })\n },\n onSuccess: (response: ApiResource<ConversationResource>) => {\n update(response.data)\n },\n onError: () => {\n Alert.alert('Oops', 'Something went wrong muting this conversation, please try again')\n invalidate()\n },\n })\n\n return {\n muted: conversation.muted, // prefer cache\n setMuted,\n ...mutation,\n }\n}\n\nexport const useMarkAllRead = () => {\n const apiClient = useApiClient()\n const { args } = useConversationsContext()\n const { invalidate, updateAll } = useConversationsCache(args)\n const { mutate: markAllRead, ...query } = useMutation({\n onMutate: () => {\n updateAll({\n unreadCount: 0,\n })\n },\n mutationKey: ['markAllRead', args],\n mutationFn: () =>\n apiClient.chat.post({\n url: '/me/mark_all_read',\n }),\n onSettled: invalidate,\n })\n\n return {\n markAllRead,\n ...query,\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use_mark_latest_message_read.d.ts","sourceRoot":"","sources":["../../src/hooks/use_mark_latest_message_read.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAIhE,UAAU,KAAK;IACb,YAAY,EAAE,oBAAoB,CAAA;IAClC,QAAQ,EAAE,eAAe,EAAE,CAAA;CAC5B;AAED,wBAAgB,wBAAwB,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,QAqB/D"}
1
+ {"version":3,"file":"use_mark_latest_message_read.d.ts","sourceRoot":"","sources":["../../src/hooks/use_mark_latest_message_read.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAIhE,UAAU,KAAK;IACb,YAAY,EAAE,oBAAoB,CAAA;IAClC,QAAQ,EAAE,eAAe,EAAE,CAAA;CAC5B;AAED,wBAAgB,wBAAwB,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,QAsB/D"}
@@ -7,8 +7,8 @@ export function useMarkLatestMessageRead({ conversation }) {
7
7
  const { markRead } = useConversationsMarkRead({ conversation });
8
8
  const debouncedMarkRead = useMemo(() => debounce(markRead, 1000, { leading: true, trailing: true }), [markRead]);
9
9
  const unreadCount = conversation.unreadCount;
10
- const unreadReaction = conversation.unreadReaction;
11
- const shouldMarkRead = Boolean(unreadCount >= 1 || unreadReaction || !firedOnce.current);
10
+ const unreadReactionCount = conversation.unreadReactionCount || 0;
11
+ const shouldMarkRead = Boolean(unreadCount >= 1 || unreadReactionCount > 0 || !firedOnce.current);
12
12
  const appState = useAppState();
13
13
  const isActive = appState === 'active';
14
14
  useEffect(() => {
@@ -16,6 +16,7 @@ export function useMarkLatestMessageRead({ conversation }) {
16
16
  return;
17
17
  firedOnce.current = true;
18
18
  debouncedMarkRead(true);
19
- }, [debouncedMarkRead, isActive, shouldMarkRead, unreadReaction]);
19
+ // keeping unreadReactionCount in the dependency array to watch for changes
20
+ }, [debouncedMarkRead, isActive, shouldMarkRead, unreadReactionCount]);
20
21
  }
21
22
  //# sourceMappingURL=use_mark_latest_message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AQ,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC,CAAA;AACnE,CAAC","sourcesContent":["import { debounce } from 'lodash'\nimport { useEffect, useMemo, useRef } from 'react'\nimport { ConversationResource, MessageResource } from '../types'\nimport { useAppState } from './use_app_state'\nimport { useConversationsMarkRead } from './use_conversations_actions'\n\ninterface Props {\n conversation: ConversationResource\n messages: MessageResource[]\n}\n\nexport function useMarkLatestMessageRead({ conversation }: Props) {\n const firedOnce = useRef<boolean>(false)\n const { markRead } = useConversationsMarkRead({ conversation })\n const debouncedMarkRead = useMemo(\n () => debounce(markRead, 1000, { leading: true, trailing: true }),\n [markRead]\n )\n const unreadCount = conversation.unreadCount\n const unreadReaction = conversation.unreadReaction\n\n const shouldMarkRead = Boolean(unreadCount >= 1 || unreadReaction || !firedOnce.current)\n const appState = useAppState()\n const isActive = appState === 'active'\n\n useEffect(() => {\n if (!isActive || !shouldMarkRead) return\n\n firedOnce.current = true\n\n debouncedMarkRead(true)\n }, [debouncedMarkRead, isActive, shouldMarkRead, unreadReaction])\n}\n"]}
1
+ {"version":3,"file":"use_mark_latest_message_read.js","sourceRoot":"","sources":["../../src/hooks/use_mark_latest_message_read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAOtE,MAAM,UAAU,wBAAwB,CAAC,EAAE,YAAY,EAAS;IAC9D,MAAM,SAAS,GAAG,MAAM,CAAU,KAAK,CAAC,CAAA;IACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,wBAAwB,CAAC,EAAE,YAAY,EAAE,CAAC,CAAA;IAC/D,MAAM,iBAAiB,GAAG,OAAO,CAC/B,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EACjE,CAAC,QAAQ,CAAC,CACX,CAAA;IACD,MAAM,WAAW,GAAG,YAAY,CAAC,WAAW,CAAA;IAC5C,MAAM,mBAAmB,GAAG,YAAY,CAAC,mBAAmB,IAAI,CAAC,CAAA;IAEjE,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,IAAI,CAAC,IAAI,mBAAmB,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;IACjG,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,MAAM,QAAQ,GAAG,QAAQ,KAAK,QAAQ,CAAA;IAEtC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,IAAI,CAAC,cAAc;YAAE,OAAM;QAExC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAA;QAExB,iBAAiB,CAAC,IAAI,CAAC,CAAA;QACvB,2EAA2E;IAC7E,CAAC,EAAE,CAAC,iBAAiB,EAAE,QAAQ,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC,CAAA;AACxE,CAAC","sourcesContent":["import { debounce } from 'lodash'\nimport { useEffect, useMemo, useRef } from 'react'\nimport { ConversationResource, MessageResource } from '../types'\nimport { useAppState } from './use_app_state'\nimport { useConversationsMarkRead } from './use_conversations_actions'\n\ninterface Props {\n conversation: ConversationResource\n messages: MessageResource[]\n}\n\nexport function useMarkLatestMessageRead({ conversation }: Props) {\n const firedOnce = useRef<boolean>(false)\n const { markRead } = useConversationsMarkRead({ conversation })\n const debouncedMarkRead = useMemo(\n () => debounce(markRead, 1000, { leading: true, trailing: true }),\n [markRead]\n )\n const unreadCount = conversation.unreadCount\n const unreadReactionCount = conversation.unreadReactionCount || 0\n\n const shouldMarkRead = Boolean(unreadCount >= 1 || unreadReactionCount > 0 || !firedOnce.current)\n const appState = useAppState()\n const isActive = appState === 'active'\n\n useEffect(() => {\n if (!isActive || !shouldMarkRead) return\n\n firedOnce.current = true\n\n debouncedMarkRead(true)\n // keeping unreadReactionCount in the dependency array to watch for changes\n }, [debouncedMarkRead, isActive, shouldMarkRead, unreadReactionCount])\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  export declare function usePersonSettings(): {
2
2
  directMessagesDisabled: boolean;
3
- setDirectMessagesDisabled: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | import("..").ApiResource, Error, boolean, void>;
3
+ setDirectMessagesDisabled: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | import("..").ApiResource, Error, boolean, undefined>;
4
4
  isMutating: boolean;
5
5
  };
6
6
  //# sourceMappingURL=use_person_settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use_suspense_api.d.ts","sourceRoot":"","sources":["../../src/hooks/use_suspense_api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,YAAY,EAGZ,uBAAuB,EACxB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,UAAU,EAAe,MAAM,iBAAiB,CAAA;AAGzD,OAAO,EAAE,GAAG,EAAgB,MAAM,kBAAkB,CAAA;AAEpD,UAAU,kBAAmB,SAAQ,UAAU;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,EAAE,IAAI,IAAI,CACrF,uBAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,EACvD,UAAU,GAAG,SAAS,CACvB,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EAAE,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AI,CACrF,uBAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,EACvD,UAAU,GAAG,SAAS,CACvB,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EAAE,EACxE,MAAM,kBAAkB,EACxB,UAAU,uBAAuB,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBrC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,kCAAkC,EAClC,kBAAkB,GAAG,kBAAkB,GAAG,SAAS,GAAG,UAAU,CACjE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,cAAc,EAC3D,MAAM,kBAAkB,EACxB,OAAO,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqChC,CAAA;AAUD,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,CAAC,KAAK,CAAC;IACzB,kBAAkB,CAAC,MAAM,CAAC;IAC1B,kBAAkB,CAAC,SAAS,CAAC;IAC7B,kBAAkB,CAAC,KAAK,CAAC;IACzB,kBAAkB,CAAC,eAAe,CAAC;CACpC,CAAA;AACD,eAAO,MAAM,kBAAkB,GAAI,MAAM,kBAAkB,KAAG,eAM7D,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { useSuspenseInfiniteQuery, useSuspenseQuery, } from '@tanstack/react-query';
2
2
  import { Log } from '../utils';
3
- import { throwResponseError } from '../utils/response_error';
3
+ import { ResponseError } from '../utils/response_error';
4
4
  import { getNextPageParamFromMeta } from './paginator_meta';
5
5
  import { useApiClient } from './use_api_client';
6
6
  export const useSuspenseGet = (args, options) => {
@@ -44,6 +44,12 @@ export const useSuspensePaginator = (args, opts) => {
44
44
  const totalCount = query.data?.pages[0]?.meta?.totalCount || data.length;
45
45
  return { ...query, data, totalCount };
46
46
  };
47
+ const throwResponseError = (error) => {
48
+ if (error instanceof Response) {
49
+ throw new ResponseError(error);
50
+ }
51
+ return Promise.reject(error);
52
+ };
47
53
  export const getRequestQueryKey = (args) => [
48
54
  args.url,
49
55
  args.data,
@@ -1 +1 @@
1
- {"version":3,"file":"use_suspense_api.js","sourceRoot":"","sources":["../../src/hooks/use_suspense_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,GAEjB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAO,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAYpD,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,IAAwB,EACxB,OAAoC,EACpC,EAAE;IAEF,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,gBAAgB,CAA2B;QACpE,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC;QAClC,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;YACxB,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,MAAM,CAAC,GAAG,QAA2B,CAAA;YACnE,OAAO,SAAS,CAAC,GAAG,CAAC;iBAClB,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;iBAC9B,KAAK,CAAC,kBAAkB,CAAsB,CAAA;QACnD,CAAC;QACD,GAAG,OAAO;KACX,CAAC,CAAA;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,CAAA;AAC9B,CAAC,CAAA;AAOD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,IAAwB,EACxB,IAA+B,EAC/B,EAAE;IACF,MAAM,SAAS,GAAG,YAAY,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AC,EAAE,IAAI,EAAE,UAAU,IAAI,IAAI,CAAC,MAAM,CAAA;IAExE,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;AACvC,CAAC,CAAA;AASD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAwB,EAAmB,EAAE,CAAC;IAC/E,IAAI,CAAC,GAAG;IACR,IAAI,CAAC,IAAI;IACT,IAAI,CAAC,OAAO;IACZ,IAAI,CAAC,GAAG,IAAI,MAAM;IAClB,IAAI,CAAC,aAAa;CACnB,CAAA","sourcesContent":["import {\n AnyUseSuspenseInfiniteQueryOptions,\n InfiniteData,\n useSuspenseInfiniteQuery,\n useSuspenseQuery,\n UseSuspenseQueryOptions,\n} from '@tanstack/react-query'\nimport { ApiCollection, ApiResource, ResourceObject } from '../types'\nimport { FailedResponse } from '../types/api_primitives'\nimport { Log } from '../utils'\nimport { GetRequest, RequestData } from '../utils/client'\nimport { throwResponseError } from '../utils/response_error'\nimport { getNextPageParamFromMeta } from './paginator_meta'\nimport { App, useApiClient } from './use_api_client'\n\ninterface SuspenseGetOptions extends GetRequest {\n app?: App\n reply_root_id?: string | null\n}\n\nexport type SuspenseGetQueryOptions<T extends ResourceObject | ResourceObject[]> = Omit<\n UseSuspenseQueryOptions<ApiResource<T>, FailedResponse>,\n 'queryKey' | 'queryFn'\n>\n\nexport const useSuspenseGet = <T extends ResourceObject | ResourceObject[]>(\n args: SuspenseGetOptions,\n options?: SuspenseGetQueryOptions<T>\n) => {\n type Resource = ApiResource<T>\n const apiClient = useApiClient()\n\n const { data, ...query } = useSuspenseQuery<Resource, FailedResponse>({\n queryKey: getRequestQueryKey(args),\n queryFn: ({ queryKey }) => {\n const [url, d, headers, app = 'chat'] = queryKey as RequestQueryKey\n return apiClient[app]\n .get({ url, data: d, headers })\n .catch(throwResponseError) as Promise<Resource>\n },\n ...options,\n })\n\n return { ...data, ...query }\n}\n\nexport type SuspensePaginatorOptions = Omit<\n AnyUseSuspenseInfiniteQueryOptions,\n 'getNextPageParam' | 'initialPageParam' | 'queryFn' | 'queryKey'\n>\n\nexport const useSuspensePaginator = <T extends ResourceObject>(\n args: SuspenseGetOptions,\n opts?: SuspensePaginatorOptions\n) => {\n const apiClient = useApiClient()\n const query = useSuspenseInfiniteQuery<\n ApiCollection<T>,\n Response,\n InfiniteData<ApiCollection<T>>,\n any,\n Partial<RequestData> | undefined\n >({\n queryKey: getRequestQueryKey(args),\n queryFn: ({ pageParam }) => {\n Log.info('useSuspenseGet', { pageParam })\n\n const pageParmWhere = pageParam?.where || {}\n const argsWhere = args.data.where || {}\n const where = { ...argsWhere, ...pageParmWhere }\n const app = args.app || 'chat'\n const offset = pageParam?.offset || args.data.offset\n const data = { ...args.data, where, offset }\n\n return apiClient[app]\n .get<ApiCollection<T>>({\n url: args.url,\n data,\n })\n .catch(throwResponseError)\n },\n initialPageParam: {} as Partial<RequestData>,\n getNextPageParam: lastPage => getNextPageParamFromMeta(lastPage.meta?.next),\n ...(opts || {}),\n })\n\n const data: T[] = query.data?.pages.flatMap(page => page.data) || []\n const totalCount = query.data?.pages[0]?.meta?.totalCount || data.length\n\n return { ...query, data, totalCount }\n}\n\nexport type RequestQueryKey = [\n SuspenseGetOptions['url'],\n SuspenseGetOptions['data'],\n SuspenseGetOptions['headers'],\n SuspenseGetOptions['app'],\n SuspenseGetOptions['reply_root_id'],\n]\nexport const getRequestQueryKey = (args: SuspenseGetOptions): RequestQueryKey => [\n args.url,\n args.data,\n args.headers,\n args.app || 'chat',\n args.reply_root_id,\n]\n"]}
1
+ {"version":3,"file":"use_suspense_api.js","sourceRoot":"","sources":["../../src/hooks/use_suspense_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,GAEjB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO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AAC,CAAA;AASD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAwB,EAAmB,EAAE,CAAC;IAC/E,IAAI,CAAC,GAAG;IACR,IAAI,CAAC,IAAI;IACT,IAAI,CAAC,OAAO;IACZ,IAAI,CAAC,GAAG,IAAI,MAAM;IAClB,IAAI,CAAC,aAAa;CACnB,CAAA","sourcesContent":["import {\n AnyUseSuspenseInfiniteQueryOptions,\n InfiniteData,\n useSuspenseInfiniteQuery,\n useSuspenseQuery,\n UseSuspenseQueryOptions,\n} from '@tanstack/react-query'\nimport { ApiCollection, ApiResource, ResourceObject } from '../types'\nimport { FailedResponse } from '../types/api_primitives'\nimport { Log } from '../utils'\nimport { GetRequest, RequestData } from '../utils/client'\nimport { ResponseError } from '../utils/response_error'\nimport { getNextPageParamFromMeta } from './paginator_meta'\nimport { App, useApiClient } from './use_api_client'\n\ninterface SuspenseGetOptions extends GetRequest {\n app?: App\n reply_root_id?: string | null\n}\n\nexport type SuspenseGetQueryOptions<T extends ResourceObject | ResourceObject[]> = Omit<\n UseSuspenseQueryOptions<ApiResource<T>, FailedResponse>,\n 'queryKey' | 'queryFn'\n>\n\nexport const useSuspenseGet = <T extends ResourceObject | ResourceObject[]>(\n args: SuspenseGetOptions,\n options?: SuspenseGetQueryOptions<T>\n) => {\n type Resource = ApiResource<T>\n const apiClient = useApiClient()\n\n const { data, ...query } = useSuspenseQuery<Resource, FailedResponse>({\n queryKey: getRequestQueryKey(args),\n queryFn: ({ queryKey }) => {\n const [url, d, headers, app = 'chat'] = queryKey as RequestQueryKey\n return apiClient[app]\n .get({ url, data: d, headers })\n .catch(throwResponseError) as Promise<Resource>\n },\n ...options,\n })\n\n return { ...data, ...query }\n}\n\nexport type SuspensePaginatorOptions = Omit<\n AnyUseSuspenseInfiniteQueryOptions,\n 'getNextPageParam' | 'initialPageParam' | 'queryFn' | 'queryKey'\n>\n\nexport const useSuspensePaginator = <T extends ResourceObject>(\n args: SuspenseGetOptions,\n opts?: SuspensePaginatorOptions\n) => {\n const apiClient = useApiClient()\n const query = useSuspenseInfiniteQuery<\n ApiCollection<T>,\n Response,\n InfiniteData<ApiCollection<T>>,\n any,\n Partial<RequestData> | undefined\n >({\n queryKey: getRequestQueryKey(args),\n queryFn: ({ pageParam }) => {\n Log.info('useSuspenseGet', { pageParam })\n\n const pageParmWhere = pageParam?.where || {}\n const argsWhere = args.data.where || {}\n const where = { ...argsWhere, ...pageParmWhere }\n const app = args.app || 'chat'\n const offset = pageParam?.offset || args.data.offset\n const data = { ...args.data, where, offset }\n\n return apiClient[app]\n .get<ApiCollection<T>>({\n url: args.url,\n data,\n })\n .catch(throwResponseError)\n },\n initialPageParam: {} as Partial<RequestData>,\n getNextPageParam: lastPage => getNextPageParamFromMeta(lastPage.meta?.next),\n ...(opts || {}),\n })\n\n const data: T[] = query.data?.pages.flatMap(page => page.data) || []\n const totalCount = query.data?.pages[0]?.meta?.totalCount || data.length\n\n return { ...query, data, totalCount }\n}\n\nconst throwResponseError = (error: unknown) => {\n if (error instanceof Response) {\n throw new ResponseError(error as FailedResponse)\n }\n\n return Promise.reject(error)\n}\n\nexport type RequestQueryKey = [\n SuspenseGetOptions['url'],\n SuspenseGetOptions['data'],\n SuspenseGetOptions['headers'],\n SuspenseGetOptions['app'],\n SuspenseGetOptions['reply_root_id'],\n]\nexport const getRequestQueryKey = (args: SuspenseGetOptions): RequestQueryKey => [\n args.url,\n args.data,\n args.headers,\n args.app || 'chat',\n args.reply_root_id,\n]\n"]}
package/build/index.d.ts CHANGED
@@ -11,7 +11,8 @@ export { default as Event } from './polyfills/events/Event';
11
11
  export * from './screens';
12
12
  export { AgeCheckUnderageScreen } from './screens/age_check/age_check_underage_screen';
13
13
  export * from './types';
14
- export { ENV, platformFontWeightBold, Session, TemporaryDefaultColorsType, Uri } from './utils';
14
+ export { platformFontWeightBold, Session, Uri } from './utils';
15
+ export type { ENV, TemporaryDefaultColorsType } from './utils';
15
16
  export * from './utils/client';
16
17
  export * from './utils/host_bridge';
17
18
  export * from './utils/native_adapters';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAE7B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACvF,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC3D,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA;AACtF,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,GAAG,EAAE,sBAAsB,EAAE,OAAO,EAAE,0BAA0B,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAC/F,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAE7B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACvF,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAg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BAAwB,CAAA","sourcesContent":["import './icons/font_awesome'\n\nexport * from './components'\nexport * from './hooks'\nexport { ApiProvider, chatQueryClient, useFocusManager } from './contexts/api_provider'\nexport * from './contexts/chat_context'\nexport * from './contexts/session_context'\nexport * from './navigation'\nexport { ScreenLayout } from './navigation/screenLayout'\nexport { CustomEvent } from './polyfills/events/CustomEvent'\nexport { default as Event } from './polyfills/events/Event'\nexport * from './screens'\nexport { AgeCheckUnderageScreen } from './screens/age_check/age_check_underage_screen' // TODO: add to barrel\nexport * from './types'\nexport { ENV, platformFontWeightBold, Session, TemporaryDefaultColorsType, Uri } from './utils'\nexport * from './utils/client'\nexport * from './utils/host_bridge'\nexport * from './utils/native_adapters'\nexport { ResponseError } from './utils/response_error'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAE7B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACvF,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC3D,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA,CAAC,sBAAsB;AAC7G,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAE9D,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA","sourcesContent":["import './icons/font_awesome'\n\nexport * from './components'\nexport * from './hooks'\nexport { ApiProvider, chatQueryClient, useFocusManager } from './contexts/api_provider'\nexport * from './contexts/chat_context'\nexport * from './contexts/session_context'\nexport * from './navigation'\nexport { ScreenLayout } from './navigation/screenLayout'\nexport { CustomEvent } from './polyfills/events/CustomEvent'\nexport { default as Event } from './polyfills/events/Event'\nexport * from './screens'\nexport { AgeCheckUnderageScreen } from './screens/age_check/age_check_underage_screen' // TODO: add to barrel\nexport * from './types'\nexport { platformFontWeightBold, Session, Uri } from './utils'\nexport type { ENV, TemporaryDefaultColorsType } from './utils'\nexport * from './utils/client'\nexport * from './utils/host_bridge'\nexport * from './utils/native_adapters'\nexport { ResponseError } from './utils/response_error'\n"]}
@@ -1,3 +1,3 @@
1
- import React, { PropsWithChildren } from 'react';
2
- export declare function ChatAccessGate({ children }: PropsWithChildren): React.JSX.Element;
1
+ import { PropsWithChildren } from 'react';
2
+ export declare function ChatAccessGate({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=chat_access_gate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat_access_gate.d.ts","sourceRoot":"","sources":["../../src/navigation/chat_access_gate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAqB,MAAM,OAAO,CAAA;AASnE,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,qBA0B7D"}
1
+ {"version":3,"file":"chat_access_gate.d.ts","sourceRoot":"","sources":["../../src/navigation/chat_access_gate.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAqB,MAAM,OAAO,CAAA;AASnE,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CA0B7D"}
@@ -1,4 +1,5 @@
1
- import React, { useEffect, useRef } from 'react';
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from 'react';
2
3
  import { DefaultLoading } from '../components/page/loading';
3
4
  import { useChatContext } from '../contexts/chat_context';
4
5
  import { useApiGet, useOrganization } from '../hooks';
@@ -13,18 +14,18 @@ export function ChatAccessGate({ children }) {
13
14
  const contactEmail = organization?.contactEmail;
14
15
  useAgeDisqualification(ageQualificationStatus, contactEmail);
15
16
  if (!isFetched) {
16
- return <DefaultLoading />;
17
+ return _jsx(DefaultLoading, {});
17
18
  }
18
19
  if (!person) {
19
20
  throw new Error('Current person not found');
20
21
  }
21
22
  if (ageQualificationStatus === AgeQualificationStatus.DISQUALIFIED) {
22
- return <AgeCheckUnderageScreen contactEmail={contactEmail}/>;
23
+ return _jsx(AgeCheckUnderageScreen, { contactEmail: contactEmail });
23
24
  }
24
25
  if (ageQualificationStatus === AgeQualificationStatus.UNKNOWN) {
25
- return <AgeCheckRequiredScreen />;
26
+ return _jsx(AgeCheckRequiredScreen, {});
26
27
  }
27
- return <>{children}</>;
28
+ return _jsx(_Fragment, { children: children });
28
29
  }
29
30
  /**
30
31
  * Helper hook that handles the age disqualification logic.
@@ -1 +1 @@
1
- {"version":3,"file":"chat_access_gate.js","sourceRoot":"","sources":["../../src/navigation/chat_access_gate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqB,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAyB,MAAM,UAAU,C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AAI,CAAA;YACnC,qBAAqB,CAAC,EAAE,YAAY,EAAE,YAAY,IAAI,EAAE,EAAE,CAAC,CAAA;QAC7D,CAAC;IACH,CAAC,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,EAAE,YAAY,CAAC,CAAC,CAAA;AACnE,CAAC","sourcesContent":["import React, { PropsWithChildren, useEffect, useRef } from 'react'\nimport { DefaultLoading } from '../components/page/loading'\nimport { useChatContext } from '../contexts/chat_context'\nimport { useApiGet, useOrganization } from '../hooks'\nimport { currentPersonRequestArgs } from '../hooks/use_current_person'\nimport { AgeCheckRequiredScreen } from '../screens/age_check/age_check_required_screen'\nimport { AgeCheckUnderageScreen } from '../screens/age_check/age_check_underage_screen'\nimport { AgeQualificationStatus, CurrentPersonResource } from '../types'\n\nexport function ChatAccessGate({ children }: PropsWithChildren) {\n const { data: person, isFetched } = useApiGet<CurrentPersonResource>(currentPersonRequestArgs)\n const { data: organization } = useOrganization()\n\n const ageQualificationStatus = person?.ageQualificationStatus\n const contactEmail = organization?.contactEmail\n\n useAgeDisqualification(ageQualificationStatus, contactEmail)\n\n if (!isFetched) {\n return <DefaultLoading />\n }\n\n if (!person) {\n throw new Error('Current person not found')\n }\n\n if (ageQualificationStatus === AgeQualificationStatus.DISQUALIFIED) {\n return <AgeCheckUnderageScreen contactEmail={contactEmail} />\n }\n\n if (ageQualificationStatus === AgeQualificationStatus.UNKNOWN) {\n return <AgeCheckRequiredScreen />\n }\n\n return <>{children}</>\n}\n\n/**\n * Helper hook that handles the age disqualification logic.\n *\n * If a host app provides an onAgeDisqualification callback, it will be called\n * when a user is found to be disqualified by their age.\n */\nfunction useAgeDisqualification(\n ageQualificationStatus: CurrentPersonResource['ageQualificationStatus'],\n contactEmail: string | undefined\n) {\n const { onAgeDisqualification } = useChatContext()\n const hasCalledCallbackRef = useRef(false)\n\n useEffect(() => {\n if (\n ageQualificationStatus === AgeQualificationStatus.DISQUALIFIED &&\n !hasCalledCallbackRef.current\n ) {\n hasCalledCallbackRef.current = true\n onAgeDisqualification({ contactEmail: contactEmail || '' })\n }\n }, [ageQualificationStatus, onAgeDisqualification, contactEmail])\n}\n"]}
1
+ {"version":3,"file":"chat_access_gate.js","sourceRoot":"","sources":["../../src/navigation/chat_access_gate.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAqB,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAyB,MAAM,UAAU,CAAA;AAExE,MAAM,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAqB;IAC5D,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAwB,wBAAwB,CAAC,CAAA;IAC9F,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAA;IAEhD,MAAM,sBAAsB,GAAG,MAAM,EAAE,sBAAsB,CAAA;IAC7D,MAAM,YAAY,GAAG,YAAY,EAAE,YAAY,CAAA;IAE/C,sBAAsB,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAA;IAE5D,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,KAAC,cAAc,KAAG,CAAA;IAC3B,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;IAC7C,CAAC;IAED,IAAI,sBAAsB,KAAK,sBAAsB,CAAC,YAAY,EAAE,CAAC;QACnE,OAAO,KAAC,sBAAsB,IAAC,YAAY,EAAE,YAAY,GAAI,CAAA;IAC/D,CAAC;IAED,IAAI,sBAAsB,KAAK,sBAAsB,CAAC,OAAO,EAAE,CAAC;QAC9D,OAAO,KAAC,sBAAsB,KAAG,CAAA;IACnC,CAAC;IAED,OAAO,4BAAG,QAAQ,GAAI,CAAA;AACxB,CAAC;AAED;;;;;GAKG;AACH,SAAS,sBAAsB,CAC7B,sBAAuE,EACvE,YAAgC;IAEhC,MAAM,EAAE,qBAAqB,EAAE,GAAG,cAAc,EAAE,CAAA;IAClD,MAAM,oBAAoB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAE1C,SAAS,CAAC,GAAG,EAAE;QACb,IACE,sBAAsB,KAAK,sBAAsB,CAAC,YAAY;YAC9D,CAAC,oBAAoB,CAAC,OAAO,EAC7B,CAAC;YACD,oBAAoB,CAAC,OAAO,GAAG,IAAI,CAAA;YACnC,qBAAqB,CAAC,EAAE,YAAY,EAAE,YAAY,IAAI,EAAE,EAAE,CAAC,CAAA;QAC7D,CAAC;IACH,CAAC,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,EAAE,YAAY,CAAC,CAAC,CAAA;AACnE,CAAC","sourcesContent":["import React, { PropsWithChildren, useEffect, useRef } from 'react'\nimport { DefaultLoading } from '../components/page/loading'\nimport { useChatContext } from '../contexts/chat_context'\nimport { useApiGet, useOrganization } from '../hooks'\nimport { currentPersonRequestArgs } from '../hooks/use_current_person'\nimport { AgeCheckRequiredScreen } from '../screens/age_check/age_check_required_screen'\nimport { AgeCheckUnderageScreen } from '../screens/age_check/age_check_underage_screen'\nimport { AgeQualificationStatus, CurrentPersonResource } from '../types'\n\nexport function ChatAccessGate({ children }: PropsWithChildren) {\n const { data: person, isFetched } = useApiGet<CurrentPersonResource>(currentPersonRequestArgs)\n const { data: organization } = useOrganization()\n\n const ageQualificationStatus = person?.ageQualificationStatus\n const contactEmail = organization?.contactEmail\n\n useAgeDisqualification(ageQualificationStatus, contactEmail)\n\n if (!isFetched) {\n return <DefaultLoading />\n }\n\n if (!person) {\n throw new Error('Current person not found')\n }\n\n if (ageQualificationStatus === AgeQualificationStatus.DISQUALIFIED) {\n return <AgeCheckUnderageScreen contactEmail={contactEmail} />\n }\n\n if (ageQualificationStatus === AgeQualificationStatus.UNKNOWN) {\n return <AgeCheckRequiredScreen />\n }\n\n return <>{children}</>\n}\n\n/**\n * Helper hook that handles the age disqualification logic.\n *\n * If a host app provides an onAgeDisqualification callback, it will be called\n * when a user is found to be disqualified by their age.\n */\nfunction useAgeDisqualification(\n ageQualificationStatus: CurrentPersonResource['ageQualificationStatus'],\n contactEmail: string | undefined\n) {\n const { onAgeDisqualification } = useChatContext()\n const hasCalledCallbackRef = useRef(false)\n\n useEffect(() => {\n if (\n ageQualificationStatus === AgeQualificationStatus.DISQUALIFIED &&\n !hasCalledCallbackRef.current\n ) {\n hasCalledCallbackRef.current = true\n onAgeDisqualification({ contactEmail: contactEmail || '' })\n }\n }, [ageQualificationStatus, onAgeDisqualification, contactEmail])\n}\n"]}