@planningcenter/chat-react-native 4.4.0-rc.6 → 4.4.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 (350) hide show
  1. package/build/components/conversation/jump_to_bottom_button.d.ts.map +1 -1
  2. package/build/components/conversation/jump_to_bottom_button.js +42 -40
  3. package/build/components/conversation/jump_to_bottom_button.js.map +1 -1
  4. package/build/components/conversation/message.d.ts +2 -1
  5. package/build/components/conversation/message.d.ts.map +1 -1
  6. package/build/components/conversation/message.js +3 -1
  7. package/build/components/conversation/message.js.map +1 -1
  8. package/build/components/conversation/message_form.d.ts.map +1 -1
  9. package/build/components/conversation/message_form.js +3 -1
  10. package/build/components/conversation/message_form.js.map +1 -1
  11. package/build/components/conversation/message_list.d.ts.map +1 -1
  12. package/build/components/conversation/message_list.js +35 -31
  13. package/build/components/conversation/message_list.js.map +1 -1
  14. package/build/components/conversation/message_reaction.d.ts +2 -1
  15. package/build/components/conversation/message_reaction.d.ts.map +1 -1
  16. package/build/components/conversation/message_reaction.js +67 -60
  17. package/build/components/conversation/message_reaction.js.map +1 -1
  18. package/build/components/conversation/messages_disabled_banners.d.ts +7 -5
  19. package/build/components/conversation/messages_disabled_banners.d.ts.map +1 -1
  20. package/build/components/conversation/messages_disabled_banners.js +15 -14
  21. package/build/components/conversation/messages_disabled_banners.js.map +1 -1
  22. package/build/components/conversation/system_message.d.ts +2 -1
  23. package/build/components/conversation/system_message.d.ts.map +1 -1
  24. package/build/components/conversation/system_message.js +133 -100
  25. package/build/components/conversation/system_message.js.map +1 -1
  26. package/build/components/conversations/archived_results_footer.d.ts +6 -0
  27. package/build/components/conversations/archived_results_footer.d.ts.map +1 -0
  28. package/build/components/conversations/archived_results_footer.js +51 -0
  29. package/build/components/conversations/archived_results_footer.js.map +1 -0
  30. package/build/components/conversations/conversation_actions.d.ts.map +1 -1
  31. package/build/components/conversations/conversation_actions.js +241 -206
  32. package/build/components/conversations/conversation_actions.js.map +1 -1
  33. package/build/components/conversations/conversation_preview.d.ts.map +1 -1
  34. package/build/components/conversations/conversation_preview.js +102 -93
  35. package/build/components/conversations/conversation_preview.js.map +1 -1
  36. package/build/components/conversations/conversations.d.ts.map +1 -1
  37. package/build/components/conversations/conversations.js +66 -41
  38. package/build/components/conversations/conversations.js.map +1 -1
  39. package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
  40. package/build/components/conversations/conversations_blank_state.js +55 -12
  41. package/build/components/conversations/conversations_blank_state.js.map +1 -1
  42. package/build/components/conversations/filtered_results_footer.d.ts +2 -0
  43. package/build/components/conversations/filtered_results_footer.d.ts.map +1 -0
  44. package/build/components/conversations/filtered_results_footer.js +77 -0
  45. package/build/components/conversations/filtered_results_footer.js.map +1 -0
  46. package/build/components/display/action_button.d.ts.map +1 -1
  47. package/build/components/display/action_button.js +18 -16
  48. package/build/components/display/action_button.js.map +1 -1
  49. package/build/components/display/filter_dropdown.d.ts +14 -0
  50. package/build/components/display/filter_dropdown.d.ts.map +1 -0
  51. package/build/components/display/filter_dropdown.js +193 -0
  52. package/build/components/display/filter_dropdown.js.map +1 -0
  53. package/build/components/display/icon_tile.d.ts +13 -0
  54. package/build/components/display/icon_tile.d.ts.map +1 -0
  55. package/build/components/display/icon_tile.js +149 -0
  56. package/build/components/display/icon_tile.js.map +1 -0
  57. package/build/components/display/index.d.ts +2 -0
  58. package/build/components/display/index.d.ts.map +1 -1
  59. package/build/components/display/index.js +2 -0
  60. package/build/components/display/index.js.map +1 -1
  61. package/build/contexts/api_provider.d.ts.map +1 -1
  62. package/build/contexts/api_provider.js +21 -9
  63. package/build/contexts/api_provider.js.map +1 -1
  64. package/build/contexts/conversations_context.d.ts.map +1 -1
  65. package/build/contexts/conversations_context.js +21 -18
  66. package/build/contexts/conversations_context.js.map +1 -1
  67. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +196 -16
  68. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
  69. package/build/hooks/groups/use_group_members_for_new_conversation.js +72 -58
  70. package/build/hooks/groups/use_group_members_for_new_conversation.js.map +1 -1
  71. package/build/hooks/index.d.ts +3 -0
  72. package/build/hooks/index.d.ts.map +1 -1
  73. package/build/hooks/index.js +3 -0
  74. package/build/hooks/index.js.map +1 -1
  75. package/build/hooks/use_animated_message_background_color.d.ts.map +1 -1
  76. package/build/hooks/use_animated_message_background_color.js +5 -3
  77. package/build/hooks/use_animated_message_background_color.js.map +1 -1
  78. package/build/hooks/use_api.d.ts +3 -2
  79. package/build/hooks/use_api.d.ts.map +1 -1
  80. package/build/hooks/use_api.js.map +1 -1
  81. package/build/hooks/use_can_browse_archived_conversations.d.ts +2 -0
  82. package/build/hooks/use_can_browse_archived_conversations.d.ts.map +1 -0
  83. package/build/hooks/use_can_browse_archived_conversations.js +29 -0
  84. package/build/hooks/use_can_browse_archived_conversations.js.map +1 -0
  85. package/build/hooks/use_clear_conversation_filters.d.ts +2 -0
  86. package/build/hooks/use_clear_conversation_filters.d.ts.map +1 -0
  87. package/build/hooks/use_clear_conversation_filters.js +25 -0
  88. package/build/hooks/use_clear_conversation_filters.js.map +1 -0
  89. package/build/hooks/use_conversation.d.ts +73 -1
  90. package/build/hooks/use_conversation.d.ts.map +1 -1
  91. package/build/hooks/use_conversation.js +130 -3
  92. package/build/hooks/use_conversation.js.map +1 -1
  93. package/build/hooks/use_conversation_messages.d.ts.map +1 -1
  94. package/build/hooks/use_conversation_messages.js +29 -26
  95. package/build/hooks/use_conversation_messages.js.map +1 -1
  96. package/build/hooks/use_current_person.d.ts.map +1 -1
  97. package/build/hooks/use_current_person.js +1 -1
  98. package/build/hooks/use_current_person.js.map +1 -1
  99. package/build/hooks/use_features.d.ts +2 -0
  100. package/build/hooks/use_features.d.ts.map +1 -1
  101. package/build/hooks/use_features.js +2 -0
  102. package/build/hooks/use_features.js.map +1 -1
  103. package/build/hooks/use_filter_dropdown_enabled.d.ts +2 -0
  104. package/build/hooks/use_filter_dropdown_enabled.d.ts.map +1 -0
  105. package/build/hooks/use_filter_dropdown_enabled.js +18 -0
  106. package/build/hooks/use_filter_dropdown_enabled.js.map +1 -0
  107. package/build/hooks/use_jolt.d.ts +1 -0
  108. package/build/hooks/use_jolt.d.ts.map +1 -1
  109. package/build/hooks/use_jolt.js +59 -0
  110. package/build/hooks/use_jolt.js.map +1 -1
  111. package/build/hooks/use_manual_archiving_enabled.d.ts +2 -0
  112. package/build/hooks/use_manual_archiving_enabled.d.ts.map +1 -0
  113. package/build/hooks/use_manual_archiving_enabled.js +18 -0
  114. package/build/hooks/use_manual_archiving_enabled.js.map +1 -0
  115. package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
  116. package/build/hooks/use_mark_latest_message_read.js +3 -3
  117. package/build/hooks/use_mark_latest_message_read.js.map +1 -1
  118. package/build/hooks/use_reduce_motion.d.ts +2 -0
  119. package/build/hooks/use_reduce_motion.d.ts.map +1 -0
  120. package/build/hooks/use_reduce_motion.js +28 -0
  121. package/build/hooks/use_reduce_motion.js.map +1 -0
  122. package/build/hooks/use_unarchive_conversation_action.d.ts +7 -0
  123. package/build/hooks/use_unarchive_conversation_action.d.ts.map +1 -0
  124. package/build/hooks/use_unarchive_conversation_action.js +52 -0
  125. package/build/hooks/use_unarchive_conversation_action.js.map +1 -0
  126. package/build/screens/attachment_actions/attachment_actions_screen.d.ts.map +1 -1
  127. package/build/screens/attachment_actions/attachment_actions_screen.js +84 -61
  128. package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
  129. package/build/screens/conversation_details_screen.d.ts.map +1 -1
  130. package/build/screens/conversation_details_screen.js +490 -395
  131. package/build/screens/conversation_details_screen.js.map +1 -1
  132. package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
  133. package/build/screens/conversation_filters/components/conversation_filters.js +88 -18
  134. package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
  135. package/build/screens/conversation_filters/components/rows.d.ts +9 -0
  136. package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
  137. package/build/screens/conversation_filters/components/rows.js +93 -1
  138. package/build/screens/conversation_filters/components/rows.js.map +1 -1
  139. package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
  140. package/build/screens/conversation_filters/context/conversation_filter_context.js +8 -4
  141. package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
  142. package/build/screens/conversation_filters/filter_types.d.ts +1 -0
  143. package/build/screens/conversation_filters/filter_types.d.ts.map +1 -1
  144. package/build/screens/conversation_filters/filter_types.js +1 -0
  145. package/build/screens/conversation_filters/filter_types.js.map +1 -1
  146. package/build/screens/conversation_filters/screen_props.d.ts +1 -0
  147. package/build/screens/conversation_filters/screen_props.d.ts.map +1 -1
  148. package/build/screens/conversation_filters/screen_props.js.map +1 -1
  149. package/build/screens/conversation_filters_screen.d.ts +1 -0
  150. package/build/screens/conversation_filters_screen.d.ts.map +1 -1
  151. package/build/screens/conversation_filters_screen.js +79 -48
  152. package/build/screens/conversation_filters_screen.js.map +1 -1
  153. package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
  154. package/build/screens/conversation_new/components/groups_form.js +37 -34
  155. package/build/screens/conversation_new/components/groups_form.js.map +1 -1
  156. package/build/screens/conversation_screen.d.ts.map +1 -1
  157. package/build/screens/conversation_screen.js +13 -10
  158. package/build/screens/conversation_screen.js.map +1 -1
  159. package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts +2 -0
  160. package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts.map +1 -0
  161. package/build/screens/conversations/components/filter_dropdown_list_header_component.js +580 -0
  162. package/build/screens/conversations/components/filter_dropdown_list_header_component.js.map +1 -0
  163. package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
  164. package/build/screens/conversations/components/list_header_component.js +95 -90
  165. package/build/screens/conversations/components/list_header_component.js.map +1 -1
  166. package/build/screens/conversations/components/search_list_header_component.d.ts.map +1 -1
  167. package/build/screens/conversations/components/search_list_header_component.js +100 -95
  168. package/build/screens/conversations/components/search_list_header_component.js.map +1 -1
  169. package/build/screens/conversations/conversations_screen.d.ts +1 -0
  170. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  171. package/build/screens/conversations/conversations_screen.js +15 -2
  172. package/build/screens/conversations/conversations_screen.js.map +1 -1
  173. package/build/screens/design_system_screen.d.ts.map +1 -1
  174. package/build/screens/design_system_screen.js +275 -215
  175. package/build/screens/design_system_screen.js.map +1 -1
  176. package/build/screens/message_actions_screen.d.ts.map +1 -1
  177. package/build/screens/message_actions_screen.js +112 -92
  178. package/build/screens/message_actions_screen.js.map +1 -1
  179. package/build/screens/search/search_screen.d.ts.map +1 -1
  180. package/build/screens/search/search_screen.js +10 -2
  181. package/build/screens/search/search_screen.js.map +1 -1
  182. package/build/screens/send_giphy_screen.d.ts +1 -0
  183. package/build/screens/send_giphy_screen.d.ts.map +1 -1
  184. package/build/screens/send_giphy_screen.js +108 -106
  185. package/build/screens/send_giphy_screen.js.map +1 -1
  186. package/build/screens/team_conversation_screen.js +1 -1
  187. package/build/screens/team_conversation_screen.js.map +1 -1
  188. package/build/types/jolt_events/message_events.d.ts +2 -0
  189. package/build/types/jolt_events/message_events.d.ts.map +1 -1
  190. package/build/types/jolt_events/message_events.js.map +1 -1
  191. package/build/types/resources/conversation.d.ts +2 -2
  192. package/build/types/resources/conversation.d.ts.map +1 -1
  193. package/build/types/resources/conversation.js.map +1 -1
  194. package/build/types/resources/member_ability.d.ts +2 -0
  195. package/build/types/resources/member_ability.d.ts.map +1 -1
  196. package/build/types/resources/member_ability.js.map +1 -1
  197. package/build/types/resources/message.d.ts +2 -0
  198. package/build/types/resources/message.d.ts.map +1 -1
  199. package/build/types/resources/message.js.map +1 -1
  200. package/build/types/resources/person.d.ts +1 -0
  201. package/build/types/resources/person.d.ts.map +1 -1
  202. package/build/types/resources/person.js.map +1 -1
  203. package/build/utils/archived_conversation.d.ts +5 -0
  204. package/build/utils/archived_conversation.d.ts.map +1 -0
  205. package/build/utils/archived_conversation.js +5 -0
  206. package/build/utils/archived_conversation.js.map +1 -0
  207. package/build/utils/date.d.ts +1 -0
  208. package/build/utils/date.d.ts.map +1 -1
  209. package/build/utils/date.js +9 -0
  210. package/build/utils/date.js.map +1 -1
  211. package/build/utils/index.d.ts +1 -0
  212. package/build/utils/index.d.ts.map +1 -1
  213. package/build/utils/index.js +1 -0
  214. package/build/utils/index.js.map +1 -1
  215. package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts.map +1 -1
  216. package/build/utils/jolt/transform_message_event_data_to_message_resource.js +2 -1
  217. package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
  218. package/build/utils/native_adapters/configuration.d.ts +3 -0
  219. package/build/utils/native_adapters/configuration.d.ts.map +1 -1
  220. package/build/utils/native_adapters/configuration.js +3 -0
  221. package/build/utils/native_adapters/configuration.js.map +1 -1
  222. package/build/utils/native_adapters/index.d.ts +1 -0
  223. package/build/utils/native_adapters/index.d.ts.map +1 -1
  224. package/build/utils/native_adapters/index.js +1 -0
  225. package/build/utils/native_adapters/index.js.map +1 -1
  226. package/build/utils/native_adapters/menu.d.ts +41 -0
  227. package/build/utils/native_adapters/menu.d.ts.map +1 -0
  228. package/build/utils/native_adapters/menu.js +56 -0
  229. package/build/utils/native_adapters/menu.js.map +1 -0
  230. package/build/utils/request/conversation.d.ts +2 -1
  231. package/build/utils/request/conversation.d.ts.map +1 -1
  232. package/build/utils/request/conversation.js +4 -1
  233. package/build/utils/request/conversation.js.map +1 -1
  234. package/build/utils/request/messages_data_options.d.ts.map +1 -1
  235. package/build/utils/request/messages_data_options.js +1 -1
  236. package/build/utils/request/messages_data_options.js.map +1 -1
  237. package/build/utils/system_messages.d.ts +7 -5
  238. package/build/utils/system_messages.d.ts.map +1 -1
  239. package/build/utils/system_messages.js +10 -2
  240. package/build/utils/system_messages.js.map +1 -1
  241. package/build/vendor/font_awesome_pro_solid_icons.d.ts +1 -0
  242. package/build/vendor/font_awesome_pro_solid_icons.d.ts.map +1 -1
  243. package/build/vendor/font_awesome_pro_solid_icons.js +5 -0
  244. package/build/vendor/font_awesome_pro_solid_icons.js.map +1 -1
  245. package/package.json +3 -3
  246. package/src/__tests__/hooks/use_can_browse_archived_conversations.test.tsx +98 -0
  247. package/src/__tests__/hooks/use_filter_dropdown_enabled.test.tsx +42 -0
  248. package/src/__tests__/screens/conversation_filters/components/conversation_filters.test.tsx +132 -0
  249. package/src/__tests__/screens/conversation_filters_screen.test.tsx +76 -0
  250. package/src/__tests__/screens/conversation_new/components/services_form.test.tsx +1 -0
  251. package/src/__tests__/screens/message_actions_screen.test.tsx +65 -2
  252. package/src/__tests__/screens/send_giphy_screen.test.tsx +102 -0
  253. package/src/__tests__/utils/system_messages.ts +19 -32
  254. package/src/components/conversation/__tests__/message_list.test.tsx +68 -2
  255. package/src/components/conversation/__tests__/system_message.test.tsx +106 -0
  256. package/src/components/conversation/jump_to_bottom_button.tsx +4 -3
  257. package/src/components/conversation/message.tsx +3 -0
  258. package/src/components/conversation/message_form.tsx +3 -1
  259. package/src/components/conversation/message_list.tsx +9 -1
  260. package/src/components/conversation/message_reaction.tsx +7 -2
  261. package/src/components/conversation/messages_disabled_banners.tsx +17 -18
  262. package/src/components/conversation/system_message.tsx +44 -16
  263. package/src/components/conversations/__tests__/conversation_actions.test.tsx +67 -0
  264. package/src/components/conversations/__tests__/conversation_preview.test.tsx +105 -0
  265. package/src/components/conversations/__tests__/conversations.test.tsx +93 -0
  266. package/src/components/conversations/__tests__/conversations_blank_state.test.tsx +73 -0
  267. package/src/components/conversations/archived_results_footer.tsx +36 -0
  268. package/src/components/conversations/conversation_actions.tsx +27 -19
  269. package/src/components/conversations/conversation_preview.tsx +39 -10
  270. package/src/components/conversations/conversations.tsx +26 -3
  271. package/src/components/conversations/conversations_blank_state.tsx +21 -0
  272. package/src/components/conversations/filtered_results_footer.tsx +38 -0
  273. package/src/components/display/__tests__/filter_dropdown.test.tsx +114 -0
  274. package/src/components/display/__tests__/icon_tile.test.tsx +16 -0
  275. package/src/components/display/action_button.tsx +4 -3
  276. package/src/components/display/filter_dropdown.tsx +124 -0
  277. package/src/components/display/icon_tile.tsx +67 -0
  278. package/src/components/display/index.ts +2 -0
  279. package/src/contexts/api_provider.tsx +8 -0
  280. package/src/contexts/conversations_context.tsx +2 -1
  281. package/src/hooks/__tests__/use_conversation_archive.test.tsx +152 -0
  282. package/src/hooks/__tests__/use_conversation_jolt_events.test.tsx +74 -0
  283. package/src/hooks/__tests__/use_conversation_messages.test.tsx +10 -2
  284. package/src/hooks/__tests__/use_jolt.test.tsx +100 -1
  285. package/src/hooks/__tests__/use_mark_latest_message_read.test.tsx +21 -7
  286. package/src/hooks/__tests__/use_reduce_motion.test.tsx +61 -0
  287. package/src/hooks/__tests__/use_unarchive_conversation_action.test.tsx +67 -0
  288. package/src/hooks/groups/use_group_members_for_new_conversation.ts +21 -16
  289. package/src/hooks/index.ts +3 -0
  290. package/src/hooks/use_animated_message_background_color.ts +6 -3
  291. package/src/hooks/use_api.ts +9 -2
  292. package/src/hooks/use_can_browse_archived_conversations.ts +17 -0
  293. package/src/hooks/use_clear_conversation_filters.ts +16 -0
  294. package/src/hooks/use_conversation.ts +44 -3
  295. package/src/hooks/use_conversation_messages.ts +7 -5
  296. package/src/hooks/use_current_person.ts +1 -0
  297. package/src/hooks/use_features.ts +2 -0
  298. package/src/hooks/use_filter_dropdown_enabled.ts +10 -0
  299. package/src/hooks/use_jolt.ts +57 -1
  300. package/src/hooks/use_manual_archiving_enabled.ts +10 -0
  301. package/src/hooks/use_mark_latest_message_read.ts +4 -3
  302. package/src/hooks/use_reduce_motion.ts +19 -0
  303. package/src/hooks/use_unarchive_conversation_action.ts +24 -0
  304. package/src/screens/__tests__/conversation_details_screen.test.tsx +305 -0
  305. package/src/screens/attachment_actions/__tests__/attachment_actions_screen.test.tsx +72 -0
  306. package/src/screens/attachment_actions/attachment_actions_screen.tsx +3 -1
  307. package/src/screens/conversation_details_screen.tsx +80 -16
  308. package/src/screens/conversation_filters/__tests__/conversation_filters.test.tsx +101 -0
  309. package/src/screens/conversation_filters/components/conversation_filters.tsx +40 -7
  310. package/src/screens/conversation_filters/components/rows.tsx +29 -1
  311. package/src/screens/conversation_filters/context/conversation_filter_context.tsx +4 -0
  312. package/src/screens/conversation_filters/filter_types.ts +1 -0
  313. package/src/screens/conversation_filters/screen_props.ts +1 -0
  314. package/src/screens/conversation_filters_screen.tsx +25 -5
  315. package/src/screens/conversation_new/components/groups_form.tsx +1 -0
  316. package/src/screens/conversation_screen.tsx +4 -2
  317. package/src/screens/conversations/__tests__/conversations_screen.test.tsx +52 -0
  318. package/src/screens/conversations/components/__tests__/filter_dropdown_list_header_component.test.tsx +259 -0
  319. package/src/screens/conversations/components/__tests__/list_header_component.test.tsx +21 -4
  320. package/src/screens/conversations/components/filter_dropdown_list_header_component.tsx +286 -0
  321. package/src/screens/conversations/components/list_header_component.tsx +17 -12
  322. package/src/screens/conversations/components/search_list_header_component.tsx +17 -12
  323. package/src/screens/conversations/conversations_screen.tsx +15 -2
  324. package/src/screens/design_system_screen.tsx +26 -0
  325. package/src/screens/message_actions_screen.tsx +29 -20
  326. package/src/screens/search/__tests__/search_screen.test.tsx +13 -1
  327. package/src/screens/search/search_screen.tsx +8 -2
  328. package/src/screens/send_giphy_screen.tsx +6 -3
  329. package/src/screens/team_conversation_screen.tsx +1 -1
  330. package/src/types/jolt_events/message_events.ts +2 -0
  331. package/src/types/resources/conversation.ts +2 -2
  332. package/src/types/resources/member_ability.ts +2 -0
  333. package/src/types/resources/message.ts +3 -0
  334. package/src/types/resources/person.ts +1 -0
  335. package/src/utils/__tests__/conversation.test.ts +1 -0
  336. package/src/utils/__tests__/date.test.ts +23 -0
  337. package/src/utils/__tests__/group_messages.test.ts +1 -0
  338. package/src/utils/archived_conversation.ts +13 -0
  339. package/src/utils/date.ts +8 -0
  340. package/src/utils/index.ts +1 -0
  341. package/src/utils/jolt/__tests__/transform_message_event_data_to_message_resource.test.ts +35 -0
  342. package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +1 -0
  343. package/src/utils/native_adapters/__tests__/menu.test.tsx +46 -0
  344. package/src/utils/native_adapters/configuration.ts +5 -0
  345. package/src/utils/native_adapters/index.ts +1 -0
  346. package/src/utils/native_adapters/menu.tsx +70 -0
  347. package/src/utils/request/conversation.ts +4 -0
  348. package/src/utils/request/messages_data_options.ts +1 -0
  349. package/src/utils/system_messages.ts +19 -10
  350. package/src/vendor/font_awesome_pro_solid_icons.ts +12 -0
@@ -0,0 +1,52 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { isArchivedConversation } from '../utils/archived_conversation';
3
+ import { useConversationArchive } from './use_conversation';
4
+ import { availableFeatures, useFeatures } from './use_features';
5
+ export function useUnarchiveConversationAction(conversation) {
6
+ const $ = _c(7);
7
+ const {
8
+ featureEnabled
9
+ } = useFeatures();
10
+ let t0;
11
+ if ($[0] !== conversation.id) {
12
+ t0 = {
13
+ conversation_id: conversation.id
14
+ };
15
+ $[0] = conversation.id;
16
+ $[1] = t0;
17
+ } else {
18
+ t0 = $[1];
19
+ }
20
+ const {
21
+ setArchived,
22
+ isPending
23
+ } = useConversationArchive(t0);
24
+ const manualArchivingEnabled = featureEnabled(availableFeatures.manual_archiving) || featureEnabled(availableFeatures.manual_archiving_rollout);
25
+ const canUnarchive = manualArchivingEnabled && isArchivedConversation(conversation) && !!conversation.memberAbility?.canUnarchive;
26
+ if (!canUnarchive) {
27
+ return;
28
+ }
29
+ let t1;
30
+ if ($[2] !== setArchived) {
31
+ t1 = () => setArchived(false);
32
+ $[2] = setArchived;
33
+ $[3] = t1;
34
+ } else {
35
+ t1 = $[3];
36
+ }
37
+ let t2;
38
+ if ($[4] !== isPending || $[5] !== t1) {
39
+ t2 = {
40
+ label: "Unarchive",
41
+ onPress: t1,
42
+ loading: isPending
43
+ };
44
+ $[4] = isPending;
45
+ $[5] = t1;
46
+ $[6] = t2;
47
+ } else {
48
+ t2 = $[6];
49
+ }
50
+ return t2;
51
+ }
52
+ //# sourceMappingURL=use_unarchive_conversation_action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use_unarchive_conversation_action.js","names":["isArchivedConversation","useConversationArchive","availableFeatures","useFeatures","useUnarchiveConversationAction","conversation","$","_c","featureEnabled","t0","id","conversation_id","setArchived","isPending","manualArchivingEnabled","manual_archiving","manual_archiving_rollout","canUnarchive","memberAbility","t1","t2","label","onPress","loading"],"sources":["../../src/hooks/use_unarchive_conversation_action.ts"],"sourcesContent":["import { ConversationResource } from '../types'\nimport { isArchivedConversation } from '../utils/archived_conversation'\nimport { useConversationArchive } from './use_conversation'\nimport { availableFeatures, useFeatures } from './use_features'\n\nexport function useUnarchiveConversationAction(conversation: ConversationResource) {\n const { featureEnabled } = useFeatures()\n const { setArchived, isPending } = useConversationArchive({ conversation_id: conversation.id })\n const manualArchivingEnabled =\n featureEnabled(availableFeatures.manual_archiving) ||\n featureEnabled(availableFeatures.manual_archiving_rollout)\n const canUnarchive =\n manualArchivingEnabled &&\n isArchivedConversation(conversation) &&\n !!conversation.memberAbility?.canUnarchive\n\n if (!canUnarchive) return undefined\n\n return {\n label: 'Unarchive',\n onPress: () => setArchived(false),\n loading: isPending,\n }\n}\n"],"mappings":";AACA,SAASA,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,sBAAsB,QAAQ,oBAAoB;AAC3D,SAASC,iBAAiB,EAAEC,WAAW,QAAQ,gBAAgB;AAE/D,OAAO,SAAAC,+BAAAC,YAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EACL;IAAAC;EAAA,IAA2BL,WAAW,CAAC,CAAC;EAAA,IAAAM,EAAA;EAAA,IAAAH,CAAA,QAAAD,YAAA,CAAAK,EAAA;IACkBD,EAAA;MAAAE,eAAA,EAAmBN,YAAY,CAAAK;IAAI,CAAC;IAAAJ,CAAA,MAAAD,YAAA,CAAAK,EAAA;IAAAJ,CAAA,MAAAG,EAAA;EAAA;IAAAA,EAAA,GAAAH,CAAA;EAAA;EAA9F;IAAAM,WAAA;IAAAC;EAAA,IAAmCZ,sBAAsB,CAACQ,EAAoC,CAAC;EAC/F,MAAAK,sBAAA,GACEN,cAAc,CAACN,iBAAiB,CAAAa,gBACyB,CAAC,IAA1DP,cAAc,CAACN,iBAAiB,CAAAc,wBAAyB,CAAC;EAC5D,MAAAC,YAAA,GACEH,sBACoC,IAApCd,sBAAsB,CAACK,YAAY,CACO,IAF1C,CAEC,CAACA,YAAY,CAAAa,aAA4B,EAAAD,YAAA;EAE5C,IAAI,CAACA,YAAY;IAAA;EAAA;EAAkB,IAAAE,EAAA;EAAA,IAAAb,CAAA,QAAAM,WAAA;IAIxBO,EAAA,GAAAA,CAAA,KAAMP,WAAW,CAAC,KAAK,CAAC;IAAAN,CAAA,MAAAM,WAAA;IAAAN,CAAA,MAAAa,EAAA;EAAA;IAAAA,EAAA,GAAAb,CAAA;EAAA;EAAA,IAAAc,EAAA;EAAA,IAAAd,CAAA,QAAAO,SAAA,IAAAP,CAAA,QAAAa,EAAA;IAF5BC,EAAA;MAAAC,KAAA,EACE,WAAW;MAAAC,OAAA,EACTH,EAAwB;MAAAI,OAAA,EACxBV;IACX,CAAC;IAAAP,CAAA,MAAAO,SAAA;IAAAP,CAAA,MAAAa,EAAA;IAAAb,CAAA,MAAAc,EAAA;EAAA;IAAAA,EAAA,GAAAd,CAAA;EAAA;EAAA,OAJMc,EAIN;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"attachment_actions_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAM3E,eAAO,MAAM,8BAA8B,6EAEzC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC;IAC3D,YAAY,EAAE,MAAM,CAAA;IACpB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,4BAA4B,EAAE,OAAO,CAAA;IACrC,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,wBAAgB,uBAAuB,CAAC,EAAE,KAAK,EAAE,EAAE,4BAA4B,2CAgE9E"}
1
+ {"version":3,"file":"attachment_actions_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAO3E,eAAO,MAAM,8BAA8B,6EAEzC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC;IAC3D,YAAY,EAAE,MAAM,CAAA;IACpB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,4BAA4B,EAAE,OAAO,CAAA;IACrC,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,wBAAgB,uBAAuB,CAAC,EAAE,KAAK,EAAE,EAAE,4BAA4B,2CAiE9E"}
@@ -3,13 +3,14 @@ import { useNavigation } from '@react-navigation/native';
3
3
  import React, { useCallback } from 'react';
4
4
  import { Alert, Linking, StyleSheet } from 'react-native';
5
5
  import FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet';
6
+ import { useConversation } from '../../hooks/use_conversation';
6
7
  import { useDeleteAttachment } from './hooks/useDeleteAttachment';
7
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
9
  export const AttachmentActionsScreenOptions = getFormSheetScreenOptions({
9
10
  headerTitle: 'Attachment actions'
10
11
  });
11
12
  export function AttachmentActionsScreen(t0) {
12
- const $ = _c(25);
13
+ const $ = _c(28);
13
14
  const {
14
15
  route
15
16
  } = t0;
@@ -23,36 +24,58 @@ export function AttachmentActionsScreen(t0) {
23
24
  myMessage
24
25
  } = route.params;
25
26
  let t1;
26
- if ($[0] !== attachmentContentType) {
27
- t1 = getAttachmentLabelName(attachmentContentType);
28
- $[0] = attachmentContentType;
27
+ if ($[0] !== conversation_id) {
28
+ t1 = {
29
+ conversation_id
30
+ };
31
+ $[0] = conversation_id;
29
32
  $[1] = t1;
30
33
  } else {
31
34
  t1 = $[1];
32
35
  }
33
- const attachmentName = t1;
34
- const canDelete = myMessage || canDeleteNonAuthoredMessages;
35
- const styles = useStyles();
36
36
  let t2;
37
- if ($[2] !== attachmentId || $[3] !== attachmentName || $[4] !== conversation_id) {
37
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
38
38
  t2 = {
39
+ refetchOnMount: false
40
+ };
41
+ $[2] = t2;
42
+ } else {
43
+ t2 = $[2];
44
+ }
45
+ const {
46
+ data: conversation
47
+ } = useConversation(t1, t2);
48
+ let t3;
49
+ if ($[3] !== attachmentContentType) {
50
+ t3 = getAttachmentLabelName(attachmentContentType);
51
+ $[3] = attachmentContentType;
52
+ $[4] = t3;
53
+ } else {
54
+ t3 = $[4];
55
+ }
56
+ const attachmentName = t3;
57
+ const canDelete = !conversation.disabled && (myMessage || canDeleteNonAuthoredMessages);
58
+ const styles = useStyles();
59
+ let t4;
60
+ if ($[5] !== attachmentId || $[6] !== attachmentName || $[7] !== conversation_id) {
61
+ t4 = {
39
62
  conversation_id,
40
63
  attachmentId,
41
64
  attachmentName
42
65
  };
43
- $[2] = attachmentId;
44
- $[3] = attachmentName;
45
- $[4] = conversation_id;
46
- $[5] = t2;
66
+ $[5] = attachmentId;
67
+ $[6] = attachmentName;
68
+ $[7] = conversation_id;
69
+ $[8] = t4;
47
70
  } else {
48
- t2 = $[5];
71
+ t4 = $[8];
49
72
  }
50
73
  const {
51
74
  handleDeleteAttachment
52
- } = useDeleteAttachment(t2);
53
- let t3;
54
- if ($[6] !== attachmentName || $[7] !== handleDeleteAttachment || $[8] !== navigation) {
55
- t3 = () => {
75
+ } = useDeleteAttachment(t4);
76
+ let t5;
77
+ if ($[9] !== attachmentName || $[10] !== handleDeleteAttachment || $[11] !== navigation) {
78
+ t5 = () => {
56
79
  Alert.alert(`Delete ${attachmentName}`, "Are you sure you want to permanently delete this attachment?", [{
57
80
  text: "Cancel",
58
81
  style: "cancel"
@@ -65,75 +88,75 @@ export function AttachmentActionsScreen(t0) {
65
88
  }
66
89
  }]);
67
90
  };
68
- $[6] = attachmentName;
69
- $[7] = handleDeleteAttachment;
70
- $[8] = navigation;
71
- $[9] = t3;
91
+ $[9] = attachmentName;
92
+ $[10] = handleDeleteAttachment;
93
+ $[11] = navigation;
94
+ $[12] = t5;
72
95
  } else {
73
- t3 = $[9];
96
+ t5 = $[12];
74
97
  }
75
- const handleDeleteConfirm = t3;
76
- let t4;
77
- if ($[10] !== attachmentUrl || $[11] !== navigation) {
78
- t4 = () => {
98
+ const handleDeleteConfirm = t5;
99
+ let t6;
100
+ if ($[13] !== attachmentUrl || $[14] !== navigation) {
101
+ t6 = () => {
79
102
  Linking.openURL(attachmentUrl);
80
103
  navigation.goBack();
81
104
  };
82
- $[10] = attachmentUrl;
83
- $[11] = navigation;
84
- $[12] = t4;
105
+ $[13] = attachmentUrl;
106
+ $[14] = navigation;
107
+ $[15] = t6;
85
108
  } else {
86
- t4 = $[12];
109
+ t6 = $[15];
87
110
  }
88
- const handleOpenInBrowser = t4;
89
- const t5 = `Open ${attachmentName} in browser`;
90
- const t6 = `${attachmentName} can be downloaded and shared through the browser.`;
91
- let t7;
92
- if ($[13] !== handleOpenInBrowser || $[14] !== t5 || $[15] !== t6) {
93
- t7 = /*#__PURE__*/_jsx(FormSheet.Action, {
111
+ const handleOpenInBrowser = t6;
112
+ const t7 = `Open ${attachmentName} in browser`;
113
+ const t8 = `${attachmentName} can be downloaded and shared through the browser.`;
114
+ let t9;
115
+ if ($[16] !== handleOpenInBrowser || $[17] !== t7 || $[18] !== t8) {
116
+ t9 = /*#__PURE__*/_jsx(FormSheet.Action, {
94
117
  iconName: "general.newWindow",
95
118
  title: "Open in browser",
96
119
  accessibilityRole: "link",
97
- accessibilityLabel: t5,
98
- accessibilityHint: t6,
120
+ accessibilityLabel: t7,
121
+ accessibilityHint: t8,
99
122
  onPress: handleOpenInBrowser
100
123
  });
101
- $[13] = handleOpenInBrowser;
102
- $[14] = t5;
103
- $[15] = t6;
104
- $[16] = t7;
124
+ $[16] = handleOpenInBrowser;
125
+ $[17] = t7;
126
+ $[18] = t8;
127
+ $[19] = t9;
105
128
  } else {
106
- t7 = $[16];
129
+ t9 = $[19];
107
130
  }
108
- let t8;
109
- if ($[17] !== attachmentName || $[18] !== canDelete || $[19] !== handleDeleteConfirm) {
110
- t8 = canDelete && /*#__PURE__*/_jsx(FormSheet.Action, {
131
+ let t10;
132
+ if ($[20] !== attachmentName || $[21] !== canDelete || $[22] !== handleDeleteConfirm) {
133
+ t10 = canDelete && /*#__PURE__*/_jsx(FormSheet.Action, {
111
134
  appearance: "danger",
112
135
  iconName: "publishing.trash",
113
136
  title: `Delete ${attachmentName}`,
114
137
  onPress: handleDeleteConfirm
115
138
  });
116
- $[17] = attachmentName;
117
- $[18] = canDelete;
118
- $[19] = handleDeleteConfirm;
119
- $[20] = t8;
139
+ $[20] = attachmentName;
140
+ $[21] = canDelete;
141
+ $[22] = handleDeleteConfirm;
142
+ $[23] = t10;
120
143
  } else {
121
- t8 = $[20];
144
+ t10 = $[23];
122
145
  }
123
- let t9;
124
- if ($[21] !== styles.formSheetContent || $[22] !== t7 || $[23] !== t8) {
125
- t9 = /*#__PURE__*/_jsxs(FormSheet.Root, {
146
+ let t11;
147
+ if ($[24] !== styles.formSheetContent || $[25] !== t10 || $[26] !== t9) {
148
+ t11 = /*#__PURE__*/_jsxs(FormSheet.Root, {
126
149
  contentStyle: styles.formSheetContent,
127
- children: [t7, t8]
150
+ children: [t9, t10]
128
151
  });
129
- $[21] = styles.formSheetContent;
130
- $[22] = t7;
131
- $[23] = t8;
132
- $[24] = t9;
152
+ $[24] = styles.formSheetContent;
153
+ $[25] = t10;
154
+ $[26] = t9;
155
+ $[27] = t11;
133
156
  } else {
134
- t9 = $[24];
157
+ t11 = $[27];
135
158
  }
136
- return t9;
159
+ return t11;
137
160
  }
138
161
  const useStyles = () => {
139
162
  return StyleSheet.create({
@@ -1 +1 @@
1
- {"version":3,"file":"attachment_actions_screen.js","names":["useNavigation","React","useCallback","Alert","Linking","StyleSheet","FormSheet","getFormSheetScreenOptions","useDeleteAttachment","jsx","_jsx","jsxs","_jsxs","AttachmentActionsScreenOptions","headerTitle","AttachmentActionsScreen","t0","$","_c","route","navigation","attachmentId","attachmentContentType","attachmentUrl","conversation_id","canDeleteNonAuthoredMessages","myMessage","params","t1","getAttachmentLabelName","attachmentName","canDelete","styles","useStyles","t2","handleDeleteAttachment","t3","alert","text","style","onPress","goBack","handleDeleteConfirm","t4","openURL","handleOpenInBrowser","t5","t6","t7","Action","iconName","title","accessibilityRole","accessibilityLabel","accessibilityHint","t8","appearance","t9","formSheetContent","Root","contentStyle","children","create","paddingTop","contentType","startsWith"],"sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback } from 'react'\nimport { Alert, Linking, StyleSheet } from 'react-native'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useDeleteAttachment } from './hooks/useDeleteAttachment'\n\nexport const AttachmentActionsScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Attachment actions',\n})\n\nexport type AttachmentActionsScreenProps = StaticScreenProps<{\n attachmentId: string\n attachmentContentType: string\n attachmentUrl: string\n conversation_id: number\n canDeleteNonAuthoredMessages: boolean\n myMessage: boolean\n}>\n\nexport function AttachmentActionsScreen({ route }: AttachmentActionsScreenProps) {\n const navigation = useNavigation()\n const {\n attachmentId,\n attachmentContentType,\n attachmentUrl,\n conversation_id,\n canDeleteNonAuthoredMessages,\n myMessage,\n } = route.params\n\n const attachmentName = getAttachmentLabelName(attachmentContentType)\n const canDelete = myMessage || canDeleteNonAuthoredMessages\n const styles = useStyles()\n\n const { handleDeleteAttachment } = useDeleteAttachment({\n conversation_id,\n attachmentId,\n attachmentName,\n })\n\n const handleDeleteConfirm = useCallback(() => {\n Alert.alert(\n `Delete ${attachmentName}`,\n 'Are you sure you want to permanently delete this attachment?',\n [\n { text: 'Cancel', style: 'cancel' },\n {\n text: 'Delete',\n style: 'destructive',\n onPress: () => {\n handleDeleteAttachment()\n navigation.goBack()\n },\n },\n ]\n )\n }, [attachmentName, handleDeleteAttachment, navigation])\n\n const handleOpenInBrowser = () => {\n Linking.openURL(attachmentUrl)\n navigation.goBack()\n }\n\n return (\n <FormSheet.Root contentStyle={styles.formSheetContent}>\n <FormSheet.Action\n iconName=\"general.newWindow\"\n title=\"Open in browser\"\n accessibilityRole=\"link\"\n accessibilityLabel={`Open ${attachmentName} in browser`}\n accessibilityHint={`${attachmentName} can be downloaded and shared through the browser.`}\n onPress={handleOpenInBrowser}\n />\n {canDelete && (\n <FormSheet.Action\n appearance=\"danger\"\n iconName=\"publishing.trash\"\n title={`Delete ${attachmentName}`}\n onPress={handleDeleteConfirm}\n />\n )}\n </FormSheet.Root>\n )\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n formSheetContent: {\n paddingTop: 16,\n },\n })\n}\n\nfunction getAttachmentLabelName(contentType: string) {\n if (contentType.startsWith('image/')) return 'image'\n if (contentType.startsWith('video/')) return 'video'\n if (contentType.startsWith('audio/')) return 'audio'\n if (contentType === 'application/pdf') return 'PDF'\n if (contentType.startsWith('application/')) return 'file'\n\n return ''\n}\n"],"mappings":";AAAA,SAA4BA,aAAa,QAAQ,0BAA0B;AAC3E,OAAOC,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,KAAK,EAAEC,OAAO,EAAEC,UAAU,QAAQ,cAAc;AACzD,OAAOC,SAAS,IAAIC,yBAAyB,QAAQ,uCAAuC;AAC5F,SAASC,mBAAmB,QAAQ,6BAA6B;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAA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,KAAM;EACtB,OAAO5B,UAAU,CAACyD,MAAM,CAAC;IACvBJ,gBAAgB,EAAE;MAChBK,UAAU,EAAE;IACd;EACF,CAAC,CAAC;AACJ,CAAC;AAED,SAASlC,sBAAsBA,CAACmC,WAAmB,EAAE;EACnD,IAAIA,WAAW,CAACC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,OAAO;EACpD,IAAID,WAAW,CAACC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,OAAO;EACpD,IAAID,WAAW,CAACC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,OAAO;EACpD,IAAID,WAAW,KAAK,iBAAiB,EAAE,OAAO,KAAK;EACnD,IAAIA,WAAW,CAACC,UAAU,CAAC,cAAc,CAAC,EAAE,OAAO,MAAM;EAEzD,OAAO,EAAE;AACX","ignoreList":[]}
1
+ {"version":3,"file":"attachment_actions_screen.js","names":["useNavigation","React","useCallback","Alert","Linking","StyleSheet","FormSheet","getFormSheetScreenOptions","useConversation","useDeleteAttachment","jsx","_jsx","jsxs","_jsxs","AttachmentActionsScreenOptions","headerTitle","AttachmentActionsScreen","t0","$","_c","route","navigation","attachmentId","attachmentContentType","attachmentUrl","conversation_id","canDeleteNonAuthoredMessages","myMessage","params","t1","t2","Symbol","for","refetchOnMount","data","conversation","t3","getAttachmentLabelName","attachmentName","canDelete","disabled","styles","useStyles","t4","handleDeleteAttachment","t5","alert","text","style","onPress","goBack","handleDeleteConfirm","t6","openURL","handleOpenInBrowser","t7","t8","t9","Action","iconName","title","accessibilityRole","accessibilityLabel","accessibilityHint","t10","appearance","t11","formSheetContent","Root","contentStyle","children","create","paddingTop","contentType","startsWith"],"sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback } from 'react'\nimport { Alert, Linking, StyleSheet } from 'react-native'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useConversation } from '../../hooks/use_conversation'\nimport { useDeleteAttachment } from './hooks/useDeleteAttachment'\n\nexport const AttachmentActionsScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Attachment actions',\n})\n\nexport type AttachmentActionsScreenProps = StaticScreenProps<{\n attachmentId: string\n attachmentContentType: string\n attachmentUrl: string\n conversation_id: number\n canDeleteNonAuthoredMessages: boolean\n myMessage: boolean\n}>\n\nexport function AttachmentActionsScreen({ route }: AttachmentActionsScreenProps) {\n const navigation = useNavigation()\n const {\n attachmentId,\n attachmentContentType,\n attachmentUrl,\n conversation_id,\n canDeleteNonAuthoredMessages,\n myMessage,\n } = route.params\n\n const { data: conversation } = useConversation({ conversation_id }, { refetchOnMount: false })\n const attachmentName = getAttachmentLabelName(attachmentContentType)\n const canDelete = !conversation.disabled && (myMessage || canDeleteNonAuthoredMessages)\n const styles = useStyles()\n\n const { handleDeleteAttachment } = useDeleteAttachment({\n conversation_id,\n attachmentId,\n attachmentName,\n })\n\n const handleDeleteConfirm = useCallback(() => {\n Alert.alert(\n `Delete ${attachmentName}`,\n 'Are you sure you want to permanently delete this attachment?',\n [\n { text: 'Cancel', style: 'cancel' },\n {\n text: 'Delete',\n style: 'destructive',\n onPress: () => {\n handleDeleteAttachment()\n navigation.goBack()\n },\n },\n ]\n )\n }, [attachmentName, handleDeleteAttachment, navigation])\n\n const handleOpenInBrowser = () => {\n Linking.openURL(attachmentUrl)\n navigation.goBack()\n }\n\n return (\n <FormSheet.Root contentStyle={styles.formSheetContent}>\n <FormSheet.Action\n iconName=\"general.newWindow\"\n title=\"Open in browser\"\n accessibilityRole=\"link\"\n accessibilityLabel={`Open ${attachmentName} in browser`}\n accessibilityHint={`${attachmentName} can be downloaded and shared through the browser.`}\n onPress={handleOpenInBrowser}\n />\n {canDelete && (\n <FormSheet.Action\n appearance=\"danger\"\n iconName=\"publishing.trash\"\n title={`Delete ${attachmentName}`}\n onPress={handleDeleteConfirm}\n />\n )}\n </FormSheet.Root>\n )\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n formSheetContent: {\n paddingTop: 16,\n },\n })\n}\n\nfunction getAttachmentLabelName(contentType: string) {\n if (contentType.startsWith('image/')) return 'image'\n if (contentType.startsWith('video/')) return 'video'\n if (contentType.startsWith('audio/')) return 'audio'\n if (contentType === 'application/pdf') return 'PDF'\n if (contentType.startsWith('application/')) return 'file'\n\n return ''\n}\n"],"mappings":";AAAA,SAA4BA,aAAa,QAAQ,0BAA0B;AAC3E,OAAOC,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,KAAK,EAAEC,OAAO,EAAEC,UAAU,QAAQ,cAAc;AACzD,OAAOC,SAAS,IAAIC,yBAAyB,QAAQ,uCAAuC;AAC5F,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,mBAAmB,QAAQ,6BAA6B;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEjE,OAAO,MAAMC,8BAA8B,GAAGP,yBAAyB,CAAC;EACtEQ,WAAW,EAAE;AACf,CAAC,CAAC;AAWF,OAAO,SAAAC,wBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAiC;IAAAC;EAAA,IAAAH,EAAuC;EAC7E,MAAAI,UAAA,GAAmBrB,aAAa,CAAC,CAAC;EAClC;IAAAsB,YAAA;IAAAC,qBAAA;IAAAC,aAAA;IAAAC,eAAA;IAAAC,4BAAA;IAAAC;EAAA,IAOIP,KAAK,CAAAQ,MAAO;EAAA,IAAAC,EAAA;EAAA,IAAAX,CAAA,QAAAO,eAAA;IAE+BI,EAAA;MAAAJ;IAAkB,CAAC;IAAAP,CAAA,MAAAO,eAAA;IAAAP,CAAA,MAAAW,EAAA;EAAA;IAAAA,EAAA,GAAAX,CAAA;EAAA;EAAA,IAAAY,EAAA;EAAA,IAAAZ,CAAA,QAAAa,MAAA,CAAAC,GAAA;IAAEF,EAAA;MAAAG,cAAA,EAAkB;IAAM,CAAC;IAAAf,CAAA,MA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AAW,CAACC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,OAAO;EACpD,IAAID,WAAW,CAACC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,OAAO;EACpD,IAAID,WAAW,CAACC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,OAAO;EACpD,IAAID,WAAW,KAAK,iBAAiB,EAAE,OAAO,KAAK;EACnD,IAAIA,WAAW,CAACC,UAAU,CAAC,cAAc,CAAC,EAAE,OAAO,MAAM;EAEzD,OAAO,EAAE;AACX","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_details_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_details_screen.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAwFzF,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC7D,eAAe,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,wBAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,EAAE,8BAA8B,2CAkXlF"}
1
+ {"version":3,"file":"conversation_details_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_details_screen.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AA4FzF,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC7D,eAAe,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,wBAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,EAAE,8BAA8B,2CAwalF"}