@planningcenter/chat-react-native 3.2.0-rc.2 → 3.2.0-rc.21

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 (349) hide show
  1. package/build/components/conversation/message_form.d.ts +2 -2
  2. package/build/components/conversation/message_form.d.ts.map +1 -1
  3. package/build/components/conversation/message_form.js +95 -41
  4. package/build/components/conversation/message_form.js.map +1 -1
  5. package/build/components/conversations/action_toggle_button.d.ts +1 -1
  6. package/build/components/conversations/action_toggle_button.d.ts.map +1 -1
  7. package/build/components/conversations/action_toggle_button.js +2 -1
  8. package/build/components/conversations/action_toggle_button.js.map +1 -1
  9. package/build/components/conversations/conversation_actions.d.ts.map +1 -1
  10. package/build/components/conversations/conversation_actions.js +25 -11
  11. package/build/components/conversations/conversation_actions.js.map +1 -1
  12. package/build/components/conversations/conversations.d.ts +3 -6
  13. package/build/components/conversations/conversations.d.ts.map +1 -1
  14. package/build/components/conversations/conversations.js +8 -18
  15. package/build/components/conversations/conversations.js.map +1 -1
  16. package/build/components/display/action_button.d.ts +2 -1
  17. package/build/components/display/action_button.d.ts.map +1 -1
  18. package/build/components/display/action_button.js +3 -4
  19. package/build/components/display/action_button.js.map +1 -1
  20. package/build/components/display/banner.d.ts +6 -1
  21. package/build/components/display/banner.d.ts.map +1 -1
  22. package/build/components/display/banner.js +2 -2
  23. package/build/components/display/banner.js.map +1 -1
  24. package/build/components/display/banner_collapsible.d.ts +1 -1
  25. package/build/components/display/banner_collapsible.d.ts.map +1 -1
  26. package/build/components/display/banner_collapsible.js +2 -2
  27. package/build/components/display/banner_collapsible.js.map +1 -1
  28. package/build/components/display/child_notice.d.ts +3 -1
  29. package/build/components/display/child_notice.d.ts.map +1 -1
  30. package/build/components/display/child_notice.js +2 -2
  31. package/build/components/display/child_notice.js.map +1 -1
  32. package/build/components/display/person.d.ts +3 -1
  33. package/build/components/display/person.d.ts.map +1 -1
  34. package/build/components/display/person.js +2 -2
  35. package/build/components/display/person.js.map +1 -1
  36. package/build/components/primitive/banner_primitive.d.ts +3 -0
  37. package/build/components/primitive/banner_primitive.d.ts.map +1 -1
  38. package/build/components/primitive/banner_primitive.js +4 -5
  39. package/build/components/primitive/banner_primitive.js.map +1 -1
  40. package/build/contexts/api_provider.d.ts +1 -1
  41. package/build/contexts/api_provider.d.ts.map +1 -1
  42. package/build/contexts/api_provider.js +3 -3
  43. package/build/contexts/api_provider.js.map +1 -1
  44. package/build/contexts/chat_context.d.ts +5 -3
  45. package/build/contexts/chat_context.d.ts.map +1 -1
  46. package/build/contexts/chat_context.js +8 -3
  47. package/build/contexts/chat_context.js.map +1 -1
  48. package/build/contexts/conversations_context.d.ts +14 -0
  49. package/build/contexts/conversations_context.d.ts.map +1 -0
  50. package/build/contexts/conversations_context.js +38 -0
  51. package/build/contexts/conversations_context.js.map +1 -0
  52. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +226 -0
  53. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -0
  54. package/build/hooks/groups/use_group_members_for_new_conversation.js +54 -0
  55. package/build/hooks/groups/use_group_members_for_new_conversation.js.map +1 -0
  56. package/build/hooks/groups/use_groups_conversation_create.d.ts +9 -0
  57. package/build/hooks/groups/use_groups_conversation_create.d.ts.map +1 -0
  58. package/build/hooks/groups/use_groups_conversation_create.js +36 -0
  59. package/build/hooks/groups/use_groups_conversation_create.js.map +1 -0
  60. package/build/hooks/use_api.d.ts +41 -41
  61. package/build/hooks/use_api.d.ts.map +1 -1
  62. package/build/hooks/use_api.js +5 -0
  63. package/build/hooks/use_api.js.map +1 -1
  64. package/build/hooks/use_api_client.d.ts.map +1 -1
  65. package/build/hooks/use_api_client.js +5 -3
  66. package/build/hooks/use_api_client.js.map +1 -1
  67. package/build/hooks/use_chat_permissions.d.ts +14 -14
  68. package/build/hooks/use_conversations.d.ts +6 -32
  69. package/build/hooks/use_conversations.d.ts.map +1 -1
  70. package/build/hooks/use_conversations.js +15 -14
  71. package/build/hooks/use_conversations.js.map +1 -1
  72. package/build/hooks/use_conversations_actions.d.ts +221 -0
  73. package/build/hooks/use_conversations_actions.d.ts.map +1 -0
  74. package/build/hooks/use_conversations_actions.js +103 -0
  75. package/build/hooks/use_conversations_actions.js.map +1 -0
  76. package/build/hooks/use_conversations_cache.d.ts +18 -0
  77. package/build/hooks/use_conversations_cache.d.ts.map +1 -0
  78. package/build/hooks/{use_conversation_jolt_events.js → use_conversations_cache.js} +27 -17
  79. package/build/hooks/use_conversations_cache.js.map +1 -0
  80. package/build/hooks/use_conversations_jolt_events.d.ts +3 -0
  81. package/build/hooks/use_conversations_jolt_events.d.ts.map +1 -0
  82. package/build/hooks/use_conversations_jolt_events.js +15 -0
  83. package/build/hooks/use_conversations_jolt_events.js.map +1 -0
  84. package/build/hooks/use_current_person.d.ts +15 -0
  85. package/build/hooks/use_current_person.d.ts.map +1 -1
  86. package/build/hooks/use_current_person.js +26 -9
  87. package/build/hooks/use_current_person.js.map +1 -1
  88. package/build/hooks/use_giphy.d.ts +9 -0
  89. package/build/hooks/use_giphy.d.ts.map +1 -0
  90. package/build/hooks/use_giphy.js +63 -0
  91. package/build/hooks/use_giphy.js.map +1 -0
  92. package/build/hooks/use_groups.d.ts +26 -26
  93. package/build/hooks/use_groups_groups.d.ts +26 -26
  94. package/build/hooks/use_jolt.d.ts.map +1 -1
  95. package/build/hooks/use_jolt.js +42 -20
  96. package/build/hooks/use_jolt.js.map +1 -1
  97. package/build/hooks/use_message_create.d.ts +11 -0
  98. package/build/hooks/use_message_create.d.ts.map +1 -0
  99. package/build/hooks/use_message_create.js +35 -0
  100. package/build/hooks/use_message_create.js.map +1 -0
  101. package/build/hooks/use_suspense_api.d.ts.map +1 -1
  102. package/build/hooks/use_suspense_api.js +5 -0
  103. package/build/hooks/use_suspense_api.js.map +1 -1
  104. package/build/hooks/use_teams.d.ts +26 -26
  105. package/build/index.d.ts +2 -2
  106. package/build/index.d.ts.map +1 -1
  107. package/build/index.js +2 -2
  108. package/build/index.js.map +1 -1
  109. package/build/navigation/index.d.ts +65 -38
  110. package/build/navigation/index.d.ts.map +1 -1
  111. package/build/navigation/index.js +29 -10
  112. package/build/navigation/index.js.map +1 -1
  113. package/build/screens/conversation_details_screen.js +2 -2
  114. package/build/screens/conversation_details_screen.js.map +1 -1
  115. package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +10 -0
  116. package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -0
  117. package/build/screens/conversation_filter_recipients/components/checkbox_row.js +74 -0
  118. package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -0
  119. package/build/screens/conversation_filter_recipients/components/header_row.d.ts +10 -0
  120. package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -0
  121. package/build/screens/conversation_filter_recipients/components/header_row.js +69 -0
  122. package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -0
  123. package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts +5 -0
  124. package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts.map +1 -0
  125. package/build/screens/conversation_filter_recipients/components/navigation_header.js +46 -0
  126. package/build/screens/conversation_filter_recipients/components/navigation_header.js.map +1 -0
  127. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts +17 -0
  128. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts.map +1 -0
  129. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js +37 -0
  130. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js.map +1 -0
  131. package/build/screens/{create → conversation_filter_recipients}/conversation_filter_recipients_screen.d.ts +1 -3
  132. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -0
  133. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +87 -0
  134. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -0
  135. package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts +10 -0
  136. package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts.map +1 -0
  137. package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js +32 -0
  138. package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js.map +1 -0
  139. package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts +8 -0
  140. package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts.map +1 -0
  141. package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js +65 -0
  142. package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js.map +1 -0
  143. package/build/screens/conversation_filter_recipients/types.d.ts +38 -0
  144. package/build/screens/conversation_filter_recipients/types.d.ts.map +1 -0
  145. package/build/screens/conversation_filter_recipients/types.js +6 -0
  146. package/build/screens/conversation_filter_recipients/types.js.map +1 -0
  147. package/build/screens/conversation_filters/hooks/filters.d.ts +40 -40
  148. package/build/screens/conversation_filters/hooks/filters.js +1 -1
  149. package/build/screens/conversation_filters/hooks/filters.js.map +1 -1
  150. package/build/screens/conversation_new/components/form_list.d.ts +12 -0
  151. package/build/screens/conversation_new/components/form_list.d.ts.map +1 -0
  152. package/build/screens/conversation_new/components/form_list.js +42 -0
  153. package/build/screens/conversation_new/components/form_list.js.map +1 -0
  154. package/build/screens/conversation_new/components/groups_form.d.ts +7 -0
  155. package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -0
  156. package/build/screens/conversation_new/components/groups_form.js +105 -0
  157. package/build/screens/conversation_new/components/groups_form.js.map +1 -0
  158. package/build/screens/conversation_new/components/source_app_error_card.d.ts +2 -0
  159. package/build/screens/conversation_new/components/source_app_error_card.d.ts.map +1 -0
  160. package/build/screens/conversation_new/components/source_app_error_card.js +16 -0
  161. package/build/screens/conversation_new/components/source_app_error_card.js.map +1 -0
  162. package/build/screens/conversation_new/components/team_form.d.ts +8 -0
  163. package/build/screens/conversation_new/components/team_form.d.ts.map +1 -0
  164. package/build/screens/conversation_new/components/team_form.js +11 -0
  165. package/build/screens/conversation_new/components/team_form.js.map +1 -0
  166. package/build/screens/conversation_new/conversation_new_screen.d.ts +15 -0
  167. package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -0
  168. package/build/screens/conversation_new/conversation_new_screen.js +16 -0
  169. package/build/screens/conversation_new/conversation_new_screen.js.map +1 -0
  170. package/build/screens/conversation_screen.d.ts +1 -0
  171. package/build/screens/conversation_screen.d.ts.map +1 -1
  172. package/build/screens/conversation_screen.js +1 -1
  173. package/build/screens/conversation_screen.js.map +1 -1
  174. package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.d.ts +2 -0
  175. package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.d.ts.map +1 -0
  176. package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.js +17 -0
  177. package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.js.map +1 -0
  178. package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts +12 -0
  179. package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts.map +1 -0
  180. package/build/screens/conversation_select_recipients/components/recipient_link_row.js +61 -0
  181. package/build/screens/conversation_select_recipients/components/recipient_link_row.js.map +1 -0
  182. package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts +7 -0
  183. package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts.map +1 -0
  184. package/build/screens/conversation_select_recipients/components/view_more_link_row.js +21 -0
  185. package/build/screens/conversation_select_recipients/components/view_more_link_row.js.map +1 -0
  186. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts +4 -0
  187. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -0
  188. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +48 -0
  189. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -0
  190. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts +4 -0
  191. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -0
  192. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +86 -0
  193. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -0
  194. package/build/screens/conversation_select_recipients/types/screen_props.d.ts +9 -0
  195. package/build/screens/conversation_select_recipients/types/screen_props.d.ts.map +1 -0
  196. package/build/screens/conversation_select_recipients/types/screen_props.js +2 -0
  197. package/build/screens/conversation_select_recipients/types/screen_props.js.map +1 -0
  198. package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
  199. package/build/screens/conversations/components/list_header_component.js +22 -4
  200. package/build/screens/conversations/components/list_header_component.js.map +1 -1
  201. package/build/screens/conversations/conversations_screen.d.ts +2 -1
  202. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  203. package/build/screens/conversations/conversations_screen.js +35 -11
  204. package/build/screens/conversations/conversations_screen.js.map +1 -1
  205. package/build/screens/message_actions_screen.d.ts +2 -2
  206. package/build/screens/message_actions_screen.d.ts.map +1 -1
  207. package/build/screens/message_actions_screen.js.map +1 -1
  208. package/build/screens/send_giphy_screen.d.ts +10 -0
  209. package/build/screens/send_giphy_screen.d.ts.map +1 -0
  210. package/build/screens/send_giphy_screen.js +126 -0
  211. package/build/screens/send_giphy_screen.js.map +1 -0
  212. package/build/types/resources/groups/groups_group_resource.d.ts +1 -1
  213. package/build/types/resources/groups/groups_group_resource.js.map +1 -1
  214. package/build/types/resources/groups/groups_member_resource_with_person.d.ts +14 -0
  215. package/build/types/resources/groups/groups_member_resource_with_person.d.ts.map +1 -0
  216. package/build/types/resources/groups/groups_member_resource_with_person.js +2 -0
  217. package/build/types/resources/groups/groups_member_resource_with_person.js.map +1 -0
  218. package/build/types/resources/member.d.ts +0 -10
  219. package/build/types/resources/member.d.ts.map +1 -1
  220. package/build/types/resources/member.js.map +1 -1
  221. package/build/types/resources/oauth_token.d.ts +4 -4
  222. package/build/types/resources/oauth_token.d.ts.map +1 -1
  223. package/build/types/resources/oauth_token.js.map +1 -1
  224. package/build/utils/cache/page_mutations.d.ts +18 -0
  225. package/build/utils/cache/page_mutations.d.ts.map +1 -1
  226. package/build/utils/cache/page_mutations.js +13 -0
  227. package/build/utils/cache/page_mutations.js.map +1 -1
  228. package/build/utils/client/client.d.ts +4 -8
  229. package/build/utils/client/client.d.ts.map +1 -1
  230. package/build/utils/client/client.js +10 -9
  231. package/build/utils/client/client.js.map +1 -1
  232. package/build/utils/destructure_chat_group_graph_id.d.ts +10 -0
  233. package/build/utils/destructure_chat_group_graph_id.d.ts.map +1 -0
  234. package/build/utils/destructure_chat_group_graph_id.js +8 -0
  235. package/build/utils/destructure_chat_group_graph_id.js.map +1 -0
  236. package/build/utils/index.d.ts +1 -0
  237. package/build/utils/index.d.ts.map +1 -1
  238. package/build/utils/index.js +1 -0
  239. package/build/utils/index.js.map +1 -1
  240. package/build/utils/request/conversation.d.ts +1 -3
  241. package/build/utils/request/conversation.d.ts.map +1 -1
  242. package/build/utils/request/conversation.js +37 -30
  243. package/build/utils/request/conversation.js.map +1 -1
  244. package/build/utils/session.d.ts +6 -2
  245. package/build/utils/session.d.ts.map +1 -1
  246. package/build/utils/session.js +6 -1
  247. package/build/utils/session.js.map +1 -1
  248. package/build/utils/uri.d.ts +10 -2
  249. package/build/utils/uri.d.ts.map +1 -1
  250. package/build/utils/uri.js +24 -6
  251. package/build/utils/uri.js.map +1 -1
  252. package/build/vendor/tapestry/alias_tokens_color_map.d.ts +2 -0
  253. package/build/vendor/tapestry/alias_tokens_color_map.d.ts.map +1 -1
  254. package/build/vendor/tapestry/alias_tokens_color_map.js +2 -0
  255. package/build/vendor/tapestry/alias_tokens_color_map.js.map +1 -1
  256. package/package.json +4 -3
  257. package/src/__tests__/hooks/useTheme.tsx +1 -1
  258. package/src/__tests__/utils/cache/page_mutations.ts +49 -15
  259. package/src/__tests__/{client.ts → utils/client.ts} +7 -115
  260. package/src/__tests__/{session.ts → utils/session.ts} +4 -4
  261. package/src/__tests__/utils/uri.ts +107 -0
  262. package/src/components/conversation/message_form.tsx +127 -58
  263. package/src/components/conversations/action_toggle_button.tsx +2 -1
  264. package/src/components/conversations/conversation_actions.tsx +41 -14
  265. package/src/components/conversations/conversations.tsx +39 -52
  266. package/src/components/display/action_button.tsx +4 -3
  267. package/src/components/display/banner.tsx +7 -1
  268. package/src/components/display/banner_collapsible.tsx +6 -1
  269. package/src/components/display/child_notice.tsx +9 -3
  270. package/src/components/display/person.tsx +4 -3
  271. package/src/components/primitive/banner_primitive.tsx +12 -6
  272. package/src/contexts/api_provider.tsx +3 -3
  273. package/src/contexts/chat_context.tsx +13 -6
  274. package/src/contexts/conversations_context.tsx +69 -0
  275. package/src/hooks/groups/use_group_members_for_new_conversation.ts +62 -0
  276. package/src/hooks/groups/use_groups_conversation_create.ts +50 -0
  277. package/src/hooks/use_api.ts +11 -5
  278. package/src/hooks/use_api_client.ts +7 -3
  279. package/src/hooks/use_conversations.ts +34 -16
  280. package/src/hooks/use_conversations_actions.ts +119 -0
  281. package/src/hooks/{use_conversation_jolt_events.ts → use_conversations_cache.ts} +35 -20
  282. package/src/hooks/use_conversations_jolt_events.ts +25 -0
  283. package/src/hooks/use_current_person.ts +37 -9
  284. package/src/hooks/use_giphy.ts +97 -0
  285. package/src/hooks/use_jolt.ts +56 -20
  286. package/src/hooks/use_message_create.ts +55 -0
  287. package/src/hooks/use_suspense_api.ts +6 -0
  288. package/src/index.tsx +2 -1
  289. package/src/navigation/index.tsx +39 -10
  290. package/src/screens/conversation_details_screen.tsx +2 -2
  291. package/src/screens/conversation_filter_recipients/components/checkbox_row.tsx +101 -0
  292. package/src/screens/conversation_filter_recipients/components/header_row.tsx +99 -0
  293. package/src/screens/conversation_filter_recipients/components/navigation_header.tsx +68 -0
  294. package/src/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.tsx +53 -0
  295. package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +120 -0
  296. package/src/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.tsx +50 -0
  297. package/src/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.ts +90 -0
  298. package/src/screens/conversation_filter_recipients/types.tsx +47 -0
  299. package/src/screens/conversation_filters/hooks/filters.ts +1 -1
  300. package/src/screens/conversation_new/components/form_list.tsx +67 -0
  301. package/src/screens/conversation_new/components/groups_form.tsx +163 -0
  302. package/src/screens/conversation_new/components/source_app_error_card.tsx +24 -0
  303. package/src/screens/conversation_new/components/team_form.tsx +18 -0
  304. package/src/screens/conversation_new/conversation_new_screen.tsx +29 -0
  305. package/src/screens/conversation_screen.tsx +2 -1
  306. package/src/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.tsx +21 -0
  307. package/src/screens/conversation_select_recipients/components/recipient_link_row.tsx +91 -0
  308. package/src/screens/conversation_select_recipients/components/view_more_link_row.tsx +30 -0
  309. package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +79 -0
  310. package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +121 -0
  311. package/src/screens/conversation_select_recipients/types/screen_props.tsx +11 -0
  312. package/src/screens/conversations/components/list_header_component.tsx +25 -4
  313. package/src/screens/conversations/conversations_screen.tsx +39 -17
  314. package/src/screens/message_actions_screen.tsx +2 -2
  315. package/src/screens/send_giphy_screen.tsx +184 -0
  316. package/src/types/resources/groups/groups_group_resource.ts +1 -1
  317. package/src/types/resources/groups/groups_member_resource_with_person.ts +13 -0
  318. package/src/types/resources/member.ts +0 -11
  319. package/src/types/resources/oauth_token.ts +4 -4
  320. package/src/utils/cache/page_mutations.ts +22 -0
  321. package/src/utils/client/client.ts +13 -13
  322. package/src/utils/destructure_chat_group_graph_id.ts +25 -0
  323. package/src/utils/index.ts +1 -0
  324. package/src/utils/request/conversation.ts +39 -34
  325. package/src/utils/session.ts +10 -4
  326. package/src/utils/uri.ts +30 -6
  327. package/src/vendor/tapestry/alias_tokens_color_map.ts +3 -0
  328. package/build/contexts/swipeable_active_conversation.d.ts +0 -11
  329. package/build/contexts/swipeable_active_conversation.d.ts.map +0 -1
  330. package/build/contexts/swipeable_active_conversation.js +0 -16
  331. package/build/contexts/swipeable_active_conversation.js.map +0 -1
  332. package/build/hooks/use_conversation_jolt_events.d.ts +0 -2
  333. package/build/hooks/use_conversation_jolt_events.d.ts.map +0 -1
  334. package/build/hooks/use_conversation_jolt_events.js.map +0 -1
  335. package/build/screens/create/conversation_create_screen.d.ts +0 -9
  336. package/build/screens/create/conversation_create_screen.d.ts.map +0 -1
  337. package/build/screens/create/conversation_create_screen.js +0 -122
  338. package/build/screens/create/conversation_create_screen.js.map +0 -1
  339. package/build/screens/create/conversation_filter_recipients_screen.d.ts.map +0 -1
  340. package/build/screens/create/conversation_filter_recipients_screen.js +0 -52
  341. package/build/screens/create/conversation_filter_recipients_screen.js.map +0 -1
  342. package/build/screens/create/conversation_select_recipients_screen.d.ts +0 -8
  343. package/build/screens/create/conversation_select_recipients_screen.d.ts.map +0 -1
  344. package/build/screens/create/conversation_select_recipients_screen.js +0 -97
  345. package/build/screens/create/conversation_select_recipients_screen.js.map +0 -1
  346. package/src/contexts/swipeable_active_conversation.tsx +0 -27
  347. package/src/screens/create/conversation_create_screen.tsx +0 -151
  348. package/src/screens/create/conversation_filter_recipients_screen.tsx +0 -79
  349. package/src/screens/create/conversation_select_recipients_screen.tsx +0 -128
@@ -7,3 +7,4 @@ export * from './uri'
7
7
  export * from './cache'
8
8
  export * from './native_adapters'
9
9
  export * from './pluralize'
10
+ export * from './destructure_chat_group_graph_id'
@@ -1,46 +1,51 @@
1
1
  import { GetRequest } from '../client/types'
2
2
 
3
3
  export interface ConversationRequestArgs {
4
- filter: string
5
4
  gids: string
6
- group: string
7
5
  chat_group_graph_id?: string
8
6
  group_source_app_name?: string
9
7
  }
10
8
 
11
9
  export const getConversationsRequestArgs = ({
12
- filter,
13
10
  gids,
14
- group,
11
+ chat_group_graph_id,
15
12
  group_source_app_name,
16
- }: Partial<ConversationRequestArgs> = {}): GetRequest => ({
17
- url: '/me/conversations',
18
- data: {
19
- perPage: 20,
20
- order: '-last_message',
21
- filter,
22
- group,
23
- gids,
24
- group_source_app_name,
25
- fields: {
26
- Conversation: [
27
- 'created_at',
28
- 'badges',
29
- 'groups',
30
- 'last_message_author_id',
31
- 'last_message_author_name',
32
- 'last_message_created_at',
33
- 'last_message_text_preview',
34
- 'preview_avatar_urls',
35
- 'member_ability',
36
- 'muted',
37
- 'replies_disabled',
38
- 'title',
39
- 'unread_count',
40
- 'updated_at',
41
- ],
42
- ConversationBadge: ['app_name', 'pco_resource_type', 'text'],
13
+ }: Partial<ConversationRequestArgs> = {}): GetRequest => {
14
+ const filter = chat_group_graph_id
15
+ ? 'group'
16
+ : group_source_app_name
17
+ ? 'group_source_app_name'
18
+ : 'mine_or_not_empty'
19
+
20
+ return {
21
+ url: '/me/conversations',
22
+ data: {
23
+ perPage: 20,
24
+ order: '-last_message',
25
+ filter,
26
+ gids,
27
+ group: chat_group_graph_id,
28
+ group_source_app_name,
29
+ fields: {
30
+ Conversation: [
31
+ 'created_at',
32
+ 'badges',
33
+ 'groups',
34
+ 'last_message_author_id',
35
+ 'last_message_author_name',
36
+ 'last_message_created_at',
37
+ 'last_message_text_preview',
38
+ 'preview_avatar_urls',
39
+ 'member_ability',
40
+ 'muted',
41
+ 'replies_disabled',
42
+ 'title',
43
+ 'unread_count',
44
+ 'updated_at',
45
+ ],
46
+ ConversationBadge: ['app_name', 'pco_resource_type', 'text'],
47
+ },
48
+ include: ['badges'],
43
49
  },
44
- include: ['badges'],
45
- },
46
- })
50
+ }
51
+ }
@@ -1,28 +1,34 @@
1
1
  import { OAuthToken } from '../types'
2
2
 
3
3
  export type ENV = 'production' | 'staging' | 'development'
4
-
4
+ export type OauthType = 'OAuth' | 'ChurchCenterOauth'
5
5
  export type PartialToken = Pick<OAuthToken, 'access_token'> & Partial<OAuthToken>
6
- export type SessionProps<T = PartialToken> = { env?: ENV; token?: T }
6
+ export type SessionProps<T extends PartialToken> = { env?: ENV; token?: T; type?: OauthType }
7
7
 
8
8
  /**
9
9
  * Session class to track the environment and token
10
10
  * Not intended to make network requests or handle authentication
11
11
  */
12
- export class Session<T = PartialToken> {
12
+ export class Session<T extends PartialToken = PartialToken> {
13
13
  env: ENV
14
14
  token: T | undefined
15
+ type: OauthType
15
16
 
16
17
  constructor(props?: SessionProps<T>) {
17
- const { env = 'production', token } = props || {}
18
+ const { env = 'production', token, type } = props || {}
18
19
  this.env = env
19
20
  this.token = token
21
+ this.type = type || 'OAuth'
20
22
  }
21
23
 
22
24
  get isAuthenticated() {
23
25
  return Boolean(this.token)
24
26
  }
25
27
 
28
+ get isChurchCenterToken() {
29
+ return this.type === 'ChurchCenterOauth'
30
+ }
31
+
26
32
  toString() {
27
33
  return JSON.stringify({ env: this.env, token: this.token })
28
34
  }
package/src/utils/uri.ts CHANGED
@@ -7,13 +7,16 @@ const systemVersion = DeviceInfo.getSystemVersion()
7
7
  const readableVersion = DeviceInfo.getReadableVersion()
8
8
  const appName = DeviceInfo.getApplicationName()
9
9
 
10
+ type Graph = 'churchcenter' | 'planningcenter'
10
11
  export class Uri {
11
12
  session: Session
13
+ graph: Graph = 'planningcenter'
12
14
  app?: string
13
15
 
14
- constructor({ session, app }: { session: Session; app?: string }) {
16
+ constructor({ session, app, graph }: { session: Session; app?: string; graph?: Graph }) {
15
17
  this.session = session
16
18
  this.app = app
19
+ this.graph = graph || 'planningcenter'
17
20
  }
18
21
 
19
22
  get schema() {
@@ -25,18 +28,39 @@ export class Uri {
25
28
  }
26
29
 
27
30
  get host() {
31
+ return `${this.subdomain}.${this.domain}.${this.tld}`
32
+ }
33
+
34
+ get subdomain() {
28
35
  switch (this.env) {
29
- case 'production':
30
- return 'api.planningcenteronline.com'
31
36
  case 'staging':
32
- return 'api-staging.planningcenteronline.com'
37
+ return this.isChurchCenter ? 'api.staging' : 'api-staging'
38
+ default:
39
+ return 'api'
40
+ }
41
+ }
42
+
43
+ get domain(): 'pco' | 'planningcenteronline' | 'churchcenter' {
44
+ if (this.isChurchCenter) {
45
+ return 'churchcenter'
46
+ }
47
+
48
+ return this.env === 'development' ? 'pco' : 'planningcenteronline'
49
+ }
50
+
51
+ get tld() {
52
+ switch (this.env) {
33
53
  case 'development':
34
- return 'api.pco.test'
54
+ return 'test'
35
55
  default:
36
- return 'api.planningcenteronline.com'
56
+ return 'com'
37
57
  }
38
58
  }
39
59
 
60
+ get isChurchCenter() {
61
+ return this.session.isChurchCenterToken
62
+ }
63
+
40
64
  get env() {
41
65
  return this.session?.env || 'production'
42
66
  }
@@ -77,6 +77,7 @@ interface SemanticAliasesColors {
77
77
  surfaceColorCanvas: string
78
78
  surfaceColor100: string
79
79
  surfaceColor090: string
80
+ surfaceColor080: string
80
81
  needsDesignPass: string
81
82
  }
82
83
 
@@ -108,6 +109,7 @@ const semanticAliasesLight: SemanticAliasesColors = {
108
109
  surfaceColorCanvas: neutralsLight.fillColorNeutral090,
109
110
  surfaceColor100: neutralsLight.fillColorNeutral100Inverted,
110
111
  surfaceColor090: neutralsLight.fillColorNeutral090,
112
+ surfaceColor080: neutralsLight.fillColorNeutral080,
111
113
  needsDesignPass: 'hotpink',
112
114
  } as const
113
115
 
@@ -139,6 +141,7 @@ const semanticAliasesDark: SemanticAliasesColors = {
139
141
  surfaceColorCanvas: neutralsDark.fillColorNeutral090,
140
142
  surfaceColor100: neutralsDark.fillColorNeutral100Inverted,
141
143
  surfaceColor090: neutralsDark.fillColorNeutral090,
144
+ surfaceColor080: neutralsDark.fillColorNeutral080,
142
145
  needsDesignPass: 'pink',
143
146
  }
144
147
 
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- type ConversationActionsValue = {
3
- activeConversationId?: number;
4
- setActiveConversationId: (_id: number) => void;
5
- };
6
- export declare const ConversationActionsProvider: ({ children }: {
7
- children: React.ReactNode;
8
- }) => React.JSX.Element;
9
- export declare const useConversationActionsContext: () => ConversationActionsValue;
10
- export {};
11
- //# sourceMappingURL=swipeable_active_conversation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"swipeable_active_conversation.d.ts","sourceRoot":"","sources":["../../src/contexts/swipeable_active_conversation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAA;AAElE,KAAK,wBAAwB,GAAG;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,uBAAuB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/C,CAAA;AAMD,eAAO,MAAM,2BAA2B,iBAAkB;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,sBAatF,CAAA;AAED,eAAO,MAAM,6BAA6B,gCAA+C,CAAA"}
@@ -1,16 +0,0 @@
1
- import React, { createContext, useContext, useState } from 'react';
2
- const ConversationActionsContext = createContext({
3
- activeConversationId: undefined,
4
- setActiveConversationId: () => { },
5
- });
6
- export const ConversationActionsProvider = ({ children }) => {
7
- const [activeConversationId, setActiveConversationId] = useState();
8
- return (<ConversationActionsContext.Provider value={{
9
- activeConversationId,
10
- setActiveConversationId,
11
- }}>
12
- {children}
13
- </ConversationActionsContext.Provider>);
14
- };
15
- export const useConversationActionsContext = () => useContext(ConversationActionsContext);
16
- //# sourceMappingURL=swipeable_active_conversation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"swipeable_active_conversation.js","sourceRoot":"","sources":["../../src/contexts/swipeable_active_conversation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAMlE,MAAM,0BAA0B,GAAG,aAAa,CAA2B;IACzE,oBAAoB,EAAE,SAAS;IAC/B,uBAAuB,EAAE,GAAG,EAAE,GAAE,CAAC;CAClC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IACzF,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,EAAsB,CAAA;IAEtF,OAAO,CACL,CAAC,0BAA0B,CAAC,QAAQ,CAClC,KAAK,CAAC,CAAC;YACL,oBAAoB;YACpB,uBAAuB;SACxB,CAAC,CAEF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,0BAA0B,CAAC,QAAQ,CAAC,CACvC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAA","sourcesContent":["import React, { createContext, useContext, useState } from 'react'\n\ntype ConversationActionsValue = {\n activeConversationId?: number\n setActiveConversationId: (_id: number) => void\n}\nconst ConversationActionsContext = createContext<ConversationActionsValue>({\n activeConversationId: undefined,\n setActiveConversationId: () => {},\n})\n\nexport const ConversationActionsProvider = ({ children }: { children: React.ReactNode }) => {\n const [activeConversationId, setActiveConversationId] = useState<number | undefined>()\n\n return (\n <ConversationActionsContext.Provider\n value={{\n activeConversationId,\n setActiveConversationId,\n }}\n >\n {children}\n </ConversationActionsContext.Provider>\n )\n}\n\nexport const useConversationActionsContext = () => useContext(ConversationActionsContext)\n"]}
@@ -1,2 +0,0 @@
1
- export declare function useConversationsJoltEvents(): void;
2
- //# sourceMappingURL=use_conversation_jolt_events.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use_conversation_jolt_events.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation_jolt_events.ts"],"names":[],"mappings":"AAaA,wBAAgB,0BAA0B,SAiDzC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"use_conversation_jolt_events.js","sourceRoot":"","sources":["../../src/hooks/use_conversation_jolt_events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEpE,OAAO,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAA;AACnF,OAAO,E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AC,CAAC,CAAC,CAAA;QAEzF,WAAW,CAAC,YAAY,CAAY,oBAAoB,EAAE,IAAI,CAAC,EAAE,CAC/D,+BAA+B,CAAC;YAC9B,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,YAAY;YACpB,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;gBACjC,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,EAAE,CAAA;YAClC,CAAC;SACF,CAAC,CACH,CAAA;IACH,CAAC,CAAA;IAED,MAAM,yBAAyB,GAAG,CAAC,CAA2B,EAAE,EAAE;QAChE,WAAW,CAAC,YAAY,CAAY,oBAAoB,EAAE,IAAI,CAAC,EAAE,CAC/D,uBAAuB,CAAC;YACtB,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;SAC/B,CAAC,CACH,CAAA;IACH,CAAC,CAAA;IAED,YAAY,CAAC,WAAW,EAAE,sBAAsB,EAAE,gCAAgC,CAAC,CAAA;IACnF,YAAY,CAAC,WAAW,EAAE,sBAAsB,EAAE,gCAAgC,CAAC,CAAA;IACnF,YAAY,CAAC,WAAW,EAAE,wBAAwB,EAAE,yBAAyB,CAAC,CAAA;AAChF,CAAC","sourcesContent":["import { InfiniteData, useQueryClient } from '@tanstack/react-query'\nimport { ApiCollection, ApiResource, ConversationResource } from '../types'\nimport { deleteRecordInPagesData, updateOrCreateRecordInPagesData } from '../utils'\nimport { useApiClient } from './use_api_client'\nimport { useCurrentPerson } from './use_current_person'\nimport { useJoltChannel, useJoltEvent } from './use_jolt'\nimport { getRequestQueryKey } from './use_suspense_api'\nimport { JoltConversationEvent } from '../types/jolt_events'\nimport { ConversationDeletedEvent } from '../types/jolt_events/conversation_events'\nimport { getConversationsRequestArgs } from '../utils/request/conversation'\n\ntype QueryData = InfiniteData<ApiCollection<ConversationResource>>\n\nexport function useConversationsJoltEvents() {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const currentPerson = useCurrentPerson()\n const joltChannel = useJoltChannel(`chat.people.${currentPerson.id}`)\n\n const conversationsRequestArgs = getConversationsRequestArgs()\n const conversationQueryKey = getRequestQueryKey(conversationsRequestArgs)\n\n const fetchConversation = async (id: number) => {\n const { data: argsData } = conversationsRequestArgs\n const { data } = await apiClient.chat.get<ApiResource<ConversationResource>>({\n url: `/me/conversations/${id}`,\n data: {\n fields: argsData.fields,\n include: argsData.include,\n },\n })\n\n return data\n }\n\n const handleConversationUpdateOrCreate = async (e: JoltConversationEvent) => {\n const { data } = e.data\n const conversation: ConversationResource = await fetchConversation(data.id).catch(c => c)\n\n queryClient.setQueryData<QueryData>(conversationQueryKey, prev =>\n updateOrCreateRecordInPagesData({\n data: prev,\n record: conversation,\n processRecord: (record, current) => {\n return { ...current, ...record }\n },\n })\n )\n }\n\n const handleConversationDestroy = (e: ConversationDeletedEvent) => {\n queryClient.setQueryData<QueryData>(conversationQueryKey, prev =>\n deleteRecordInPagesData({\n data: prev,\n record: { id: e.data.data.id },\n })\n )\n }\n\n useJoltEvent(joltChannel, 'conversation.updated', handleConversationUpdateOrCreate)\n useJoltEvent(joltChannel, 'conversation.created', handleConversationUpdateOrCreate)\n useJoltEvent(joltChannel, 'conversation.destroyed', handleConversationDestroy)\n}\n"]}
@@ -1,9 +0,0 @@
1
- import { StaticScreenProps } from '@react-navigation/native';
2
- import React from 'react';
3
- type ConversationCreateScreenProps = StaticScreenProps<{
4
- group_id?: string;
5
- team_ids?: string[];
6
- }>;
7
- export declare const ConversationCreateScreen: ({ route }: ConversationCreateScreenProps) => React.JSX.Element;
8
- export {};
9
- //# sourceMappingURL=conversation_create_screen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversation_create_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/create/conversation_create_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAAgC,MAAM,OAAO,CAAA;AAUpD,KAAK,6BAA6B,GAAG,iBAAiB,CAAC;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB,CAAC,CAAA;AAMF,eAAO,MAAM,wBAAwB,cAAe,6BAA6B,sBAqFhF,CAAA"}
@@ -1,122 +0,0 @@
1
- import { StackActions, useNavigation } from '@react-navigation/native';
2
- import React, { useCallback, useState } from 'react';
3
- import { StyleSheet, TextInput, View } from 'react-native';
4
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
- import { Text } from '../../components';
6
- import { ActionButton } from '../../components/display/action_button';
7
- import { useSuspenseGet, useTheme } from '../../hooks';
8
- import { useApiClient } from '../../hooks/use_api_client';
9
- import { useMutation } from '@tanstack/react-query';
10
- export const ConversationCreateScreen = ({ route }) => {
11
- const styles = useStyles();
12
- const navigation = useNavigation();
13
- const [title, setTitle] = useState();
14
- const apiClient = useApiClient();
15
- const { data: group } = useSuspenseGet({
16
- url: `/me/groups/${route.params.group_id}`,
17
- data: {
18
- fields: {
19
- Group: [],
20
- },
21
- },
22
- app: 'groups',
23
- });
24
- const { mutate: handleSave } = useMutation({
25
- throwOnError: true,
26
- onSuccess: result => {
27
- handleRedirectToConversation({ conversation_id: result.data.id });
28
- },
29
- mutationFn: () => apiClient.groups
30
- .post({
31
- url: `/me/groups/${route.params.group_id}/chat_conversation_payload`,
32
- data: {
33
- data: {
34
- type: '',
35
- attributes: {
36
- title,
37
- },
38
- },
39
- },
40
- })
41
- .then(res => res.data.value)
42
- .then(payload => apiClient.chat.post({
43
- url: '/me/conversations',
44
- data: {
45
- data: {
46
- type: 'Conversation',
47
- attributes: {
48
- payload,
49
- },
50
- },
51
- },
52
- })),
53
- });
54
- const handleRedirectToConversation = useCallback(({ conversation_id }) => {
55
- // exit from the create stack
56
- navigation.getParent()?.goBack();
57
- // navigate to the conversation screen
58
- navigation.dispatch(StackActions.push('Conversation', {
59
- conversation_id,
60
- }));
61
- }, [navigation]);
62
- return (<View style={styles.container}>
63
- <View style={styles.section}>
64
- <View style={styles.to}>
65
- <Text>To:</Text>
66
- <View>
67
- <Text>{group.name}</Text>
68
- <Text>{group.membershipsCount} members</Text>
69
- </View>
70
- </View>
71
- <View style={styles.titleContainer}>
72
- <Text style={styles.titleLabel}>Title</Text>
73
- <TextInput placeholder="Topic of conversation (required)" value={title} onChangeText={setTitle} style={styles.titleInput}/>
74
- </View>
75
- </View>
76
- <ActionButton title="Start Conversation" onPress={() => handleSave()}/>
77
- </View>);
78
- };
79
- const useStyles = () => {
80
- const { bottom } = useSafeAreaInsets();
81
- const theme = useTheme();
82
- return StyleSheet.create({
83
- container: {
84
- flex: 1,
85
- gap: 8,
86
- },
87
- section: {
88
- padding: 16,
89
- flex: 1,
90
- },
91
- sectionHeader: {
92
- flexDirection: 'row',
93
- justifyContent: 'space-between',
94
- },
95
- selectTeamsButton: {},
96
- routeDebug: {
97
- alignContent: 'center',
98
- padding: 16,
99
- paddingBottom: bottom,
100
- borderTopWidth: 1,
101
- borderTopColor: theme.colors.fillColorNeutral050Base,
102
- },
103
- titleContainer: {
104
- paddingVertical: 12,
105
- borderBottomWidth: 1,
106
- borderBottomColor: theme.colors.fillColorNeutral050Base,
107
- gap: 8,
108
- },
109
- titleInput: {
110
- fontSize: 18,
111
- },
112
- titleLabel: {},
113
- to: {
114
- flexDirection: 'row',
115
- gap: 8,
116
- paddingVertical: 12,
117
- borderBottomWidth: 1,
118
- borderBottomColor: theme.colors.fillColorNeutral050Base,
119
- },
120
- });
121
- };
122
- //# sourceMappingURL=conversation_create_screen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversation_create_screen.js","sourceRoot":"","sources":["../../../src/screens/create/conversation_create_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,Q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YACnB,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;YACvD,GAAG,EAAE,CAAC;SACP;QACD,UAAU,EAAE;YACV,QAAQ,EAAE,EAAE;SACb;QACD,UAAU,EAAE,EAAE;QACd,EAAE,EAAE;YACF,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;YACN,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACxD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback, useState } from 'react'\nimport { StyleSheet, TextInput, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Text } from '../../components'\nimport { ActionButton } from '../../components/display/action_button'\nimport { useSuspenseGet, useTheme } from '../../hooks'\nimport { useApiClient } from '../../hooks/use_api_client'\nimport { useMutation } from '@tanstack/react-query'\nimport { ApiResource, ConversationResource, GroupsGroupResource, ResourceObject } from '../../types'\n\ntype ConversationCreateScreenProps = StaticScreenProps<{\n group_id?: string\n team_ids?: string[]\n}>\n\ninterface ChatConversationPayload extends ResourceObject {\n value: string\n}\n\nexport const ConversationCreateScreen = ({ route }: ConversationCreateScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n const [title, setTitle] = useState<string>()\n const apiClient = useApiClient()\n const { data: group } = useSuspenseGet<GroupsGroupResource>({\n url: `/me/groups/${route.params.group_id}`,\n data: {\n fields: {\n Group: [],\n },\n },\n app: 'groups',\n })\n const { mutate: handleSave } = useMutation({\n throwOnError: true,\n onSuccess: result => {\n handleRedirectToConversation({ conversation_id: result.data.id })\n },\n mutationFn: () =>\n apiClient.groups\n .post<ApiResource<ChatConversationPayload>>({\n url: `/me/groups/${route.params.group_id}/chat_conversation_payload`,\n data: {\n data: {\n type: '',\n attributes: {\n title,\n },\n },\n },\n })\n .then(res => res.data.value)\n .then(payload =>\n apiClient.chat.post<ApiResource<ConversationResource>>({\n url: '/me/conversations',\n data: {\n data: {\n type: 'Conversation',\n attributes: {\n payload,\n },\n },\n },\n })\n ),\n })\n\n const handleRedirectToConversation = useCallback(\n ({ conversation_id }: { conversation_id: number }) => {\n // exit from the create stack\n navigation.getParent()?.goBack()\n // navigate to the conversation screen\n navigation.dispatch(\n StackActions.push('Conversation', {\n conversation_id,\n })\n )\n },\n [navigation]\n )\n\n return (\n <View style={styles.container}>\n <View style={styles.section}>\n <View style={styles.to}>\n <Text>To:</Text>\n <View>\n <Text>{group.name}</Text>\n <Text>{group.membershipsCount} members</Text>\n </View>\n </View>\n <View style={styles.titleContainer}>\n <Text style={styles.titleLabel}>Title</Text>\n <TextInput\n placeholder=\"Topic of conversation (required)\"\n value={title}\n onChangeText={setTitle}\n style={styles.titleInput}\n />\n </View>\n </View>\n <ActionButton title=\"Start Conversation\" onPress={() => handleSave()} />\n </View>\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n const theme = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n gap: 8,\n },\n section: {\n padding: 16,\n flex: 1,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n selectTeamsButton: {},\n routeDebug: {\n alignContent: 'center',\n padding: 16,\n paddingBottom: bottom,\n borderTopWidth: 1,\n borderTopColor: theme.colors.fillColorNeutral050Base,\n },\n titleContainer: {\n paddingVertical: 12,\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.fillColorNeutral050Base,\n gap: 8,\n },\n titleInput: {\n fontSize: 18,\n },\n titleLabel: {},\n to: {\n flexDirection: 'row',\n gap: 8,\n paddingVertical: 12,\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.fillColorNeutral050Base,\n },\n })\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversation_filter_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/create/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,0CAA0C,EAAE,4BAKxD,CAAA;AAED,KAAK,uCAAuC,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAA;AAEpE,eAAO,MAAM,kCAAkC,OAAQ,uCAAuC,sBAmC7F,CAAA"}
@@ -1,52 +0,0 @@
1
- import { StackActions, useNavigation } from '@react-navigation/native';
2
- import React from 'react';
3
- import { StyleSheet, View } from 'react-native';
4
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
- import { Button } from '../../components';
6
- import { useTheme } from '../../hooks';
7
- export const ConversationFilterReceipientsScreenOptions = {
8
- presentation: 'formSheet',
9
- headerShown: false,
10
- sheetAllowedDetents: [0.75],
11
- sheetGrabberVisible: true,
12
- };
13
- export const ConversationFilterRecipientsScreen = ({}) => {
14
- const styles = useStyles();
15
- const navigation = useNavigation();
16
- return (<View style={styles.container}>
17
- <View style={styles.section}>
18
- <Button style={styles.selectTeamsButton} onPress={() => navigation.dispatch(StackActions.popTo('ConversationSelectRecipients', {
19
- chat_group_graph_id: 'TBD',
20
- }))} title="Redirect to select" variant="outline"/>
21
-
22
- <Button style={styles.selectTeamsButton} onPress={() => navigation.dispatch(StackActions.popTo('ConversationCreate', {
23
- chat_group_graph_id: 'TBD',
24
- }))} title="Redirect to form" variant="outline"/>
25
- </View>
26
- </View>);
27
- };
28
- const useStyles = () => {
29
- const { bottom } = useSafeAreaInsets();
30
- const theme = useTheme();
31
- return StyleSheet.create({
32
- container: {
33
- flex: 1,
34
- gap: 8,
35
- },
36
- section: {
37
- padding: 16,
38
- flexDirection: 'row',
39
- justifyContent: 'space-between',
40
- flex: 1,
41
- },
42
- selectTeamsButton: {},
43
- routeDebug: {
44
- alignContent: 'center',
45
- padding: 16,
46
- paddingBottom: bottom,
47
- borderTopWidth: 1,
48
- borderTopColor: theme.colors.fillColorNeutral050Base,
49
- },
50
- });
51
- };
52
- //# sourceMappingURL=conversation_filter_recipients_screen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversation_filter_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/create/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAEzF,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,CAAC,MAAM,0CAA0C,GAAiC;IACtF,YAAY,EAAE,WAAW;IACzB,WAAW,EAAE,KAAK;IAClB,mBAAmB,EAAE,CAAC,IAAI,CAAC;IAC3B,mBAAmB,EAAE,IAAI;CAC1B,CAAA;AAID,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,EAA2C,EAAE,EAAE;IAChG,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAElC,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAC1B;QAAA,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAChC,OAAO,CAAC,CAAC,GAAG,EAAE,CACZ,UAAU,CAAC,QAAQ,CACjB,YAAY,CAAC,KAAK,CAAC,8BAA8B,EAAE;YACjD,mBAAmB,EAAE,KAAK;SAC3B,CAAC,CAEN,CAAC,CACD,KAAK,CAAC,oBAAoB,CAC1B,OAAO,CAAC,SAAS,EAGnB;;QAAA,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAChC,OAAO,CAAC,CAAC,GAAG,EAAE,CACZ,UAAU,CAAC,QAAQ,CACjB,YAAY,CAAC,KAAK,CAAC,oBAAoB,EAAE;YACvC,mBAAmB,EAAE,KAAK;SAC3B,CAAC,CAEN,CAAC,CACD,KAAK,CAAC,kBAAkB,CACxB,OAAO,CAAC,SAAS,EAErB;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IACtC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IAExB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;SACP;QACD,OAAO,EAAE;YACP,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,IAAI,EAAE,CAAC;SACR;QACD,iBAAiB,EAAE,EAAE;QACrB,UAAU,EAAE;YACV,YAAY,EAAE,QAAQ;YACtB,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,MAAM;YACrB,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACrD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Button } from '../../components'\nimport { useTheme } from '../../hooks'\n\nexport const ConversationFilterReceipientsScreenOptions: NativeStackNavigationOptions = {\n presentation: 'formSheet',\n headerShown: false,\n sheetAllowedDetents: [0.75],\n sheetGrabberVisible: true,\n}\n\ntype ConversationFilterRecipientsScreenProps = StaticScreenProps<{}>\n\nexport const ConversationFilterRecipientsScreen = ({}: ConversationFilterRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n\n return (\n <View style={styles.container}>\n <View style={styles.section}>\n <Button\n style={styles.selectTeamsButton}\n onPress={() =>\n navigation.dispatch(\n StackActions.popTo('ConversationSelectRecipients', {\n chat_group_graph_id: 'TBD',\n })\n )\n }\n title=\"Redirect to select\"\n variant=\"outline\"\n />\n\n <Button\n style={styles.selectTeamsButton}\n onPress={() =>\n navigation.dispatch(\n StackActions.popTo('ConversationCreate', {\n chat_group_graph_id: 'TBD',\n })\n )\n }\n title=\"Redirect to form\"\n variant=\"outline\"\n />\n </View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n const theme = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n gap: 8,\n },\n section: {\n padding: 16,\n flexDirection: 'row',\n justifyContent: 'space-between',\n flex: 1,\n },\n selectTeamsButton: {},\n routeDebug: {\n alignContent: 'center',\n padding: 16,\n paddingBottom: bottom,\n borderTopWidth: 1,\n borderTopColor: theme.colors.fillColorNeutral050Base,\n },\n })\n}\n"]}
@@ -1,8 +0,0 @@
1
- import { StaticScreenProps } from '@react-navigation/native';
2
- import React from 'react';
3
- type ConversationSelectRecipientsScreenProps = StaticScreenProps<{
4
- chat_group_graph_id?: string;
5
- }>;
6
- export declare const ConversationSelectRecipientsScreen: ({}: ConversationSelectRecipientsScreenProps) => React.JSX.Element;
7
- export {};
8
- //# sourceMappingURL=conversation_select_recipients_screen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversation_select_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/create/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,KAAK,uCAAuC,GAAG,iBAAiB,CAAC;IAC/D,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAC,CAAA;AAMF,eAAO,MAAM,kCAAkC,OAAQ,uCAAuC,sBAgE7F,CAAA"}
@@ -1,97 +0,0 @@
1
- import { PlatformPressable } from '@react-navigation/elements';
2
- import { useNavigation } from '@react-navigation/native';
3
- import React from 'react';
4
- import { ScrollView, StyleSheet, View } from 'react-native';
5
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
- import { Button, Heading, Icon, Image, Text } from '../../components';
7
- import { useTheme } from '../../hooks';
8
- import { useGroupsGroups } from '../../hooks/use_groups_groups';
9
- const ASPECT_RATIO = 16 / 9;
10
- const THUMBNAIL_WIDTH = 80;
11
- const THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO;
12
- export const ConversationSelectRecipientsScreen = ({}) => {
13
- const styles = useStyles();
14
- const navigation = useNavigation();
15
- const { data: groups = [] } = useGroupsGroups();
16
- const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation);
17
- const handleNavigateToCreateConversation = (group) => {
18
- navigation.navigate('Create', {
19
- screen: 'ConversationCreate',
20
- params: {
21
- group_id: group.id,
22
- },
23
- });
24
- };
25
- return (<ScrollView style={styles.container}>
26
- <View style={styles.section}>
27
- <View style={styles.sectionHeader}>
28
- <Heading>My groups</Heading>
29
- </View>
30
- <View>
31
- {groupsWithCreatePermission.map(group => (<PlatformPressable key={group.id} style={styles.row} onPress={() => handleNavigateToCreateConversation(group)}>
32
- <Image source={{ uri: group.headerImage?.thumbnail }} resizeMode="cover" style={styles.rowImage} alt={`Image for ${group.name}`}/>
33
- <View>
34
- <Heading variant="h3">{group.name}</Heading>
35
- <Text>{group.membershipsCount} members</Text>
36
- </View>
37
- <Icon name="general.rightChevron" size={16} style={styles.rowIconRight}/>
38
- </PlatformPressable>))}
39
- </View>
40
- </View>
41
- <View style={styles.section}>
42
- <View style={styles.sectionHeader}>
43
- <Heading>Teams I lead</Heading>
44
- <Button style={styles.selectTeamsButton} onPress={() => navigation.navigate('Create', {
45
- screen: 'ConversationFilterRecipients',
46
- params: {
47
- conversation_id: '2196252',
48
- },
49
- })} title="Select teams" variant="outline" iconNameLeft="general.search"/>
50
- </View>
51
- </View>
52
- </ScrollView>);
53
- };
54
- const useStyles = () => {
55
- const { bottom } = useSafeAreaInsets();
56
- const theme = useTheme();
57
- return StyleSheet.create({
58
- container: {
59
- flex: 1,
60
- gap: 8,
61
- },
62
- section: {
63
- padding: 16,
64
- flex: 1,
65
- },
66
- sectionHeader: {
67
- flexDirection: 'row',
68
- justifyContent: 'space-between',
69
- },
70
- selectTeamsButton: {},
71
- row: {
72
- flexDirection: 'row',
73
- alignItems: 'center',
74
- gap: 12,
75
- paddingVertical: 16,
76
- borderBottomWidth: 1,
77
- borderColor: theme.colors.fillColorNeutral050Base,
78
- },
79
- rowImage: {
80
- width: THUMBNAIL_WIDTH,
81
- height: THUMBNAIL_HEIGHT,
82
- borderRadius: 4,
83
- },
84
- rowIconRight: {
85
- marginLeft: 'auto',
86
- color: theme.colors.fillColorNeutral030,
87
- },
88
- routeDebug: {
89
- alignContent: 'center',
90
- padding: 16,
91
- paddingBottom: bottom,
92
- borderTopWidth: 1,
93
- borderTopColor: theme.colors.fillColorNeutral050Base,
94
- },
95
- });
96
- };
97
- //# sourceMappingURL=conversation_select_recipients_screen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversation_select_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/create/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,O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AE,KAAK,CAAC,MAAM,CAAC,mBAAmB;SACxC;QACD,UAAU,EAAE;YACV,YAAY,EAAE,QAAQ;YACtB,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,MAAM;YACrB,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACrD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { ScrollView, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Button, Heading, Icon, Image, Text } from '../../components'\nimport { useTheme } from '../../hooks'\nimport { GroupsGroupResource } from '../../types'\nimport { useGroupsGroups } from '../../hooks/use_groups_groups'\n\ntype ConversationSelectRecipientsScreenProps = StaticScreenProps<{\n chat_group_graph_id?: string\n}>\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nexport const ConversationSelectRecipientsScreen = ({}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n const { data: groups = [] } = useGroupsGroups()\n const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)\n\n const handleNavigateToCreateConversation = (group: GroupsGroupResource) => {\n navigation.navigate('Create', {\n screen: 'ConversationCreate',\n params: {\n group_id: group.id,\n },\n })\n }\n\n return (\n <ScrollView style={styles.container}>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading>My groups</Heading>\n </View>\n <View>\n {groupsWithCreatePermission.map(group => (\n <PlatformPressable\n key={group.id}\n style={styles.row}\n onPress={() => handleNavigateToCreateConversation(group)}\n >\n <Image\n source={{ uri: group.headerImage?.thumbnail }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt={`Image for ${group.name}`}\n />\n <View>\n <Heading variant=\"h3\">{group.name}</Heading>\n <Text>{group.membershipsCount} members</Text>\n </View>\n <Icon name=\"general.rightChevron\" size={16} style={styles.rowIconRight} />\n </PlatformPressable>\n ))}\n </View>\n </View>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading>Teams I lead</Heading>\n <Button\n style={styles.selectTeamsButton}\n onPress={() =>\n navigation.navigate('Create', {\n screen: 'ConversationFilterRecipients',\n params: {\n conversation_id: '2196252',\n },\n })\n }\n title=\"Select teams\"\n variant=\"outline\"\n iconNameLeft=\"general.search\"\n />\n </View>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n const theme = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n gap: 8,\n },\n section: {\n padding: 16,\n flex: 1,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n selectTeamsButton: {},\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderColor: theme.colors.fillColorNeutral050Base,\n },\n rowImage: {\n width: THUMBNAIL_WIDTH,\n height: THUMBNAIL_HEIGHT,\n borderRadius: 4,\n },\n rowIconRight: {\n marginLeft: 'auto',\n color: theme.colors.fillColorNeutral030,\n },\n routeDebug: {\n alignContent: 'center',\n padding: 16,\n paddingBottom: bottom,\n borderTopWidth: 1,\n borderTopColor: theme.colors.fillColorNeutral050Base,\n },\n })\n}\n"]}