@planningcenter/chat-react-native 3.2.0-rc.8 → 3.2.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 (362) hide show
  1. package/build/components/conversation/message_form/message_form_attachment_image.d.ts +13 -0
  2. package/build/components/conversation/message_form/message_form_attachment_image.d.ts.map +1 -0
  3. package/build/components/conversation/message_form/message_form_attachment_image.js +78 -0
  4. package/build/components/conversation/message_form/message_form_attachment_image.js.map +1 -0
  5. package/build/components/conversation/message_form.d.ts.map +1 -1
  6. package/build/components/conversation/message_form.js +128 -16
  7. package/build/components/conversation/message_form.js.map +1 -1
  8. package/build/components/conversations/conversation_actions.d.ts +2 -2
  9. package/build/components/conversations/conversation_actions.d.ts.map +1 -1
  10. package/build/components/conversations/conversation_actions.js.map +1 -1
  11. package/build/components/conversations/conversation_preview.d.ts +3 -1
  12. package/build/components/conversations/conversation_preview.d.ts.map +1 -1
  13. package/build/components/conversations/conversation_preview.js +2 -2
  14. package/build/components/conversations/conversation_preview.js.map +1 -1
  15. package/build/components/display/action_button.d.ts +2 -1
  16. package/build/components/display/action_button.d.ts.map +1 -1
  17. package/build/components/display/action_button.js +3 -4
  18. package/build/components/display/action_button.js.map +1 -1
  19. package/build/components/display/banner.d.ts +6 -1
  20. package/build/components/display/banner.d.ts.map +1 -1
  21. package/build/components/display/banner.js +2 -2
  22. package/build/components/display/banner.js.map +1 -1
  23. package/build/components/display/banner_collapsible.d.ts +1 -1
  24. package/build/components/display/banner_collapsible.d.ts.map +1 -1
  25. package/build/components/display/banner_collapsible.js +2 -2
  26. package/build/components/display/banner_collapsible.js.map +1 -1
  27. package/build/components/display/child_notice.d.ts +3 -1
  28. package/build/components/display/child_notice.d.ts.map +1 -1
  29. package/build/components/display/child_notice.js +2 -2
  30. package/build/components/display/child_notice.js.map +1 -1
  31. package/build/components/display/person.d.ts +3 -1
  32. package/build/components/display/person.d.ts.map +1 -1
  33. package/build/components/display/person.js +2 -2
  34. package/build/components/display/person.js.map +1 -1
  35. package/build/components/group_conversation_list.d.ts +19 -0
  36. package/build/components/group_conversation_list.d.ts.map +1 -0
  37. package/build/components/group_conversation_list.js +48 -0
  38. package/build/components/group_conversation_list.js.map +1 -0
  39. package/build/components/index.d.ts +1 -0
  40. package/build/components/index.d.ts.map +1 -1
  41. package/build/components/index.js +1 -0
  42. package/build/components/index.js.map +1 -1
  43. package/build/components/primitive/banner_primitive.d.ts +3 -0
  44. package/build/components/primitive/banner_primitive.d.ts.map +1 -1
  45. package/build/components/primitive/banner_primitive.js +4 -4
  46. package/build/components/primitive/banner_primitive.js.map +1 -1
  47. package/build/contexts/api_provider.d.ts +1 -1
  48. package/build/contexts/api_provider.d.ts.map +1 -1
  49. package/build/contexts/api_provider.js +3 -3
  50. package/build/contexts/api_provider.js.map +1 -1
  51. package/build/contexts/chat_context.d.ts +4 -4
  52. package/build/contexts/chat_context.d.ts.map +1 -1
  53. package/build/contexts/chat_context.js +3 -3
  54. package/build/contexts/chat_context.js.map +1 -1
  55. package/build/contexts/conversations_context.js +1 -1
  56. package/build/contexts/conversations_context.js.map +1 -1
  57. package/build/hooks/attachments/supported_extensions.d.ts +2 -0
  58. package/build/hooks/attachments/supported_extensions.d.ts.map +1 -0
  59. package/build/hooks/attachments/supported_extensions.js +48 -0
  60. package/build/hooks/attachments/supported_extensions.js.map +1 -0
  61. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +235 -0
  62. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -0
  63. package/build/hooks/groups/use_group_members_for_new_conversation.js +55 -0
  64. package/build/hooks/groups/use_group_members_for_new_conversation.js.map +1 -0
  65. package/build/hooks/groups/use_groups_conversation_create.d.ts +9 -0
  66. package/build/hooks/groups/use_groups_conversation_create.d.ts.map +1 -0
  67. package/build/hooks/groups/use_groups_conversation_create.js +36 -0
  68. package/build/hooks/groups/use_groups_conversation_create.js.map +1 -0
  69. package/build/hooks/index.d.ts +4 -0
  70. package/build/hooks/index.d.ts.map +1 -1
  71. package/build/hooks/index.js +4 -0
  72. package/build/hooks/index.js.map +1 -1
  73. package/build/hooks/use_api.d.ts +43 -43
  74. package/build/hooks/use_api.d.ts.map +1 -1
  75. package/build/hooks/use_api.js +5 -0
  76. package/build/hooks/use_api.js.map +1 -1
  77. package/build/hooks/use_api_client.d.ts.map +1 -1
  78. package/build/hooks/use_api_client.js +5 -3
  79. package/build/hooks/use_api_client.js.map +1 -1
  80. package/build/hooks/use_attachment_uploader.d.ts +26 -0
  81. package/build/hooks/use_attachment_uploader.d.ts.map +1 -0
  82. package/build/hooks/use_attachment_uploader.js +111 -0
  83. package/build/hooks/use_attachment_uploader.js.map +1 -0
  84. package/build/hooks/use_chat_permissions.d.ts +14 -14
  85. package/build/hooks/use_conversation.d.ts.map +1 -1
  86. package/build/hooks/use_conversation.js +1 -0
  87. package/build/hooks/use_conversation.js.map +1 -1
  88. package/build/hooks/use_conversations_actions.d.ts.map +1 -1
  89. package/build/hooks/use_conversations_actions.js +10 -0
  90. package/build/hooks/use_conversations_actions.js.map +1 -1
  91. package/build/hooks/use_conversations_jolt_events.d.ts.map +1 -1
  92. package/build/hooks/use_conversations_jolt_events.js +4 -1
  93. package/build/hooks/use_conversations_jolt_events.js.map +1 -1
  94. package/build/hooks/use_current_person.d.ts +15 -0
  95. package/build/hooks/use_current_person.d.ts.map +1 -1
  96. package/build/hooks/use_current_person.js +26 -9
  97. package/build/hooks/use_current_person.js.map +1 -1
  98. package/build/hooks/use_groups.d.ts +26 -26
  99. package/build/hooks/use_groups_groups.d.ts +26 -26
  100. package/build/hooks/use_jolt.d.ts.map +1 -1
  101. package/build/hooks/use_jolt.js +15 -22
  102. package/build/hooks/use_jolt.js.map +1 -1
  103. package/build/hooks/use_message_create.js +2 -2
  104. package/build/hooks/use_message_create.js.map +1 -1
  105. package/build/hooks/use_suspense_api.d.ts.map +1 -1
  106. package/build/hooks/use_suspense_api.js +5 -0
  107. package/build/hooks/use_suspense_api.js.map +1 -1
  108. package/build/hooks/use_teams.d.ts +26 -26
  109. package/build/hooks/use_upload_client.d.ts +28 -0
  110. package/build/hooks/use_upload_client.d.ts.map +1 -0
  111. package/build/hooks/use_upload_client.js +32 -0
  112. package/build/hooks/use_upload_client.js.map +1 -0
  113. package/build/index.d.ts +3 -2
  114. package/build/index.d.ts.map +1 -1
  115. package/build/index.js +3 -2
  116. package/build/index.js.map +1 -1
  117. package/build/navigation/index.d.ts +52 -34
  118. package/build/navigation/index.d.ts.map +1 -1
  119. package/build/navigation/index.js +16 -2
  120. package/build/navigation/index.js.map +1 -1
  121. package/build/screens/conversation_details_screen.js +2 -2
  122. package/build/screens/conversation_details_screen.js.map +1 -1
  123. package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +10 -0
  124. package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -0
  125. package/build/screens/conversation_filter_recipients/components/checkbox_row.js +74 -0
  126. package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -0
  127. package/build/screens/conversation_filter_recipients/components/header_row.d.ts +10 -0
  128. package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -0
  129. package/build/screens/conversation_filter_recipients/components/header_row.js +69 -0
  130. package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -0
  131. package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts +5 -0
  132. package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts.map +1 -0
  133. package/build/screens/conversation_filter_recipients/components/navigation_header.js +46 -0
  134. package/build/screens/conversation_filter_recipients/components/navigation_header.js.map +1 -0
  135. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts +17 -0
  136. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts.map +1 -0
  137. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js +37 -0
  138. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js.map +1 -0
  139. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +1 -3
  140. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
  141. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +67 -32
  142. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
  143. package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts +10 -0
  144. package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts.map +1 -0
  145. package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js +32 -0
  146. package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js.map +1 -0
  147. package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts +8 -0
  148. package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts.map +1 -0
  149. package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js +65 -0
  150. package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js.map +1 -0
  151. package/build/screens/conversation_filter_recipients/types.d.ts +38 -0
  152. package/build/screens/conversation_filter_recipients/types.d.ts.map +1 -0
  153. package/build/screens/conversation_filter_recipients/types.js +6 -0
  154. package/build/screens/conversation_filter_recipients/types.js.map +1 -0
  155. package/build/screens/conversation_filters/components/conversation_filters.js +5 -2
  156. package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
  157. package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
  158. package/build/screens/conversation_filters/components/rows.js +6 -1
  159. package/build/screens/conversation_filters/components/rows.js.map +1 -1
  160. package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
  161. package/build/screens/conversation_filters/group_filters.js +12 -4
  162. package/build/screens/conversation_filters/group_filters.js.map +1 -1
  163. package/build/screens/conversation_filters/hooks/filters.d.ts +40 -40
  164. package/build/screens/conversation_filters/hooks/filters.js +1 -1
  165. package/build/screens/conversation_filters/hooks/filters.js.map +1 -1
  166. package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
  167. package/build/screens/conversation_filters/team_filters.js +12 -4
  168. package/build/screens/conversation_filters/team_filters.js.map +1 -1
  169. package/build/screens/conversation_filters_screen.js +1 -0
  170. package/build/screens/conversation_filters_screen.js.map +1 -1
  171. package/build/screens/conversation_new/components/form_list.d.ts +12 -0
  172. package/build/screens/conversation_new/components/form_list.d.ts.map +1 -0
  173. package/build/screens/conversation_new/components/form_list.js +42 -0
  174. package/build/screens/conversation_new/components/form_list.js.map +1 -0
  175. package/build/screens/conversation_new/components/groups_form.d.ts +4 -2
  176. package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
  177. package/build/screens/conversation_new/components/groups_form.js +82 -90
  178. package/build/screens/conversation_new/components/groups_form.js.map +1 -1
  179. package/build/screens/conversation_new/components/team_form.d.ts +1 -1
  180. package/build/screens/conversation_new/components/team_form.js.map +1 -1
  181. package/build/screens/conversation_new/conversation_new_screen.d.ts +5 -2
  182. package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
  183. package/build/screens/conversation_new/conversation_new_screen.js +2 -2
  184. package/build/screens/conversation_new/conversation_new_screen.js.map +1 -1
  185. package/build/screens/conversation_screen.d.ts +7 -0
  186. package/build/screens/conversation_screen.d.ts.map +1 -1
  187. package/build/screens/conversation_screen.js +103 -4
  188. package/build/screens/conversation_screen.js.map +1 -1
  189. package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.d.ts +2 -0
  190. package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.d.ts.map +1 -0
  191. package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.js +17 -0
  192. package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.js.map +1 -0
  193. package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts +12 -0
  194. package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts.map +1 -0
  195. package/build/screens/conversation_select_recipients/components/recipient_link_row.js +61 -0
  196. package/build/screens/conversation_select_recipients/components/recipient_link_row.js.map +1 -0
  197. package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts +7 -0
  198. package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts.map +1 -0
  199. package/build/screens/conversation_select_recipients/components/view_more_link_row.js +21 -0
  200. package/build/screens/conversation_select_recipients/components/view_more_link_row.js.map +1 -0
  201. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts +4 -0
  202. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -0
  203. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +48 -0
  204. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -0
  205. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts +2 -6
  206. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -1
  207. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +37 -49
  208. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -1
  209. package/build/screens/conversation_select_recipients/types/screen_props.d.ts +9 -0
  210. package/build/screens/conversation_select_recipients/types/screen_props.d.ts.map +1 -0
  211. package/build/screens/conversation_select_recipients/types/screen_props.js +2 -0
  212. package/build/screens/conversation_select_recipients/types/screen_props.js.map +1 -0
  213. package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
  214. package/build/screens/conversations/components/list_header_component.js +18 -4
  215. package/build/screens/conversations/components/list_header_component.js.map +1 -1
  216. package/build/screens/conversations/conversations_screen.d.ts +2 -1
  217. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  218. package/build/screens/conversations/conversations_screen.js +32 -1
  219. package/build/screens/conversations/conversations_screen.js.map +1 -1
  220. package/build/screens/send_giphy_screen.js +29 -1
  221. package/build/screens/send_giphy_screen.js.map +1 -1
  222. package/build/types/resources/groups/groups_group_resource.d.ts +1 -1
  223. package/build/types/resources/groups/groups_group_resource.js.map +1 -1
  224. package/build/types/resources/groups/groups_member_resource_with_person.d.ts +14 -0
  225. package/build/types/resources/groups/groups_member_resource_with_person.d.ts.map +1 -0
  226. package/build/types/resources/groups/groups_member_resource_with_person.js +2 -0
  227. package/build/types/resources/groups/groups_member_resource_with_person.js.map +1 -0
  228. package/build/types/resources/member.d.ts +0 -10
  229. package/build/types/resources/member.d.ts.map +1 -1
  230. package/build/types/resources/member.js.map +1 -1
  231. package/build/types/resources/message.d.ts +2 -0
  232. package/build/types/resources/message.d.ts.map +1 -1
  233. package/build/types/resources/message.js.map +1 -1
  234. package/build/types/resources/oauth_token.d.ts +4 -4
  235. package/build/types/resources/oauth_token.d.ts.map +1 -1
  236. package/build/types/resources/oauth_token.js.map +1 -1
  237. package/build/utils/client/client.d.ts +4 -8
  238. package/build/utils/client/client.d.ts.map +1 -1
  239. package/build/utils/client/client.js +10 -9
  240. package/build/utils/client/client.js.map +1 -1
  241. package/build/utils/date.d.ts +5 -0
  242. package/build/utils/date.d.ts.map +1 -1
  243. package/build/utils/date.js +8 -1
  244. package/build/utils/date.js.map +1 -1
  245. package/build/utils/destructure_chat_group_graph_id.d.ts +10 -0
  246. package/build/utils/destructure_chat_group_graph_id.d.ts.map +1 -0
  247. package/build/utils/destructure_chat_group_graph_id.js +8 -0
  248. package/build/utils/destructure_chat_group_graph_id.js.map +1 -0
  249. package/build/utils/index.d.ts +1 -0
  250. package/build/utils/index.d.ts.map +1 -1
  251. package/build/utils/index.js +1 -0
  252. package/build/utils/index.js.map +1 -1
  253. package/build/utils/native_adapters/configuration.d.ts +4 -1
  254. package/build/utils/native_adapters/configuration.d.ts.map +1 -1
  255. package/build/utils/native_adapters/configuration.js +13 -1
  256. package/build/utils/native_adapters/configuration.js.map +1 -1
  257. package/build/utils/native_adapters/image_picker.d.ts +25 -0
  258. package/build/utils/native_adapters/image_picker.d.ts.map +1 -0
  259. package/build/utils/native_adapters/image_picker.js +9 -0
  260. package/build/utils/native_adapters/image_picker.js.map +1 -0
  261. package/build/utils/native_adapters/index.d.ts +1 -0
  262. package/build/utils/native_adapters/index.d.ts.map +1 -1
  263. package/build/utils/native_adapters/index.js +1 -0
  264. package/build/utils/native_adapters/index.js.map +1 -1
  265. package/build/utils/session.d.ts +6 -2
  266. package/build/utils/session.d.ts.map +1 -1
  267. package/build/utils/session.js +6 -1
  268. package/build/utils/session.js.map +1 -1
  269. package/build/utils/upload_uri.d.ts +23 -0
  270. package/build/utils/upload_uri.d.ts.map +1 -0
  271. package/build/utils/upload_uri.js +60 -0
  272. package/build/utils/upload_uri.js.map +1 -0
  273. package/build/utils/uri.d.ts +10 -2
  274. package/build/utils/uri.d.ts.map +1 -1
  275. package/build/utils/uri.js +24 -6
  276. package/build/utils/uri.js.map +1 -1
  277. package/build/vendor/tapestry/alias_tokens_color_map.d.ts +2 -0
  278. package/build/vendor/tapestry/alias_tokens_color_map.d.ts.map +1 -1
  279. package/build/vendor/tapestry/alias_tokens_color_map.js +2 -0
  280. package/build/vendor/tapestry/alias_tokens_color_map.js.map +1 -1
  281. package/package.json +4 -3
  282. package/src/__tests__/hooks/useTheme.tsx +1 -1
  283. package/src/__tests__/{client.ts → utils/client.ts} +7 -115
  284. package/src/__tests__/{session.ts → utils/session.ts} +4 -4
  285. package/src/__tests__/utils/uri.ts +107 -0
  286. package/src/components/conversation/message_form/message_form_attachment_image.tsx +121 -0
  287. package/src/components/conversation/message_form.tsx +197 -31
  288. package/src/components/conversations/conversation_actions.tsx +2 -2
  289. package/src/components/conversations/conversation_preview.tsx +8 -2
  290. package/src/components/display/action_button.tsx +4 -3
  291. package/src/components/display/banner.tsx +7 -1
  292. package/src/components/display/banner_collapsible.tsx +6 -1
  293. package/src/components/display/child_notice.tsx +9 -3
  294. package/src/components/display/person.tsx +4 -3
  295. package/src/components/group_conversation_list.tsx +82 -0
  296. package/src/components/index.tsx +1 -0
  297. package/src/components/primitive/banner_primitive.tsx +12 -5
  298. package/src/contexts/api_provider.tsx +3 -3
  299. package/src/contexts/chat_context.tsx +7 -7
  300. package/src/contexts/conversations_context.tsx +1 -1
  301. package/src/hooks/attachments/supported_extensions.ts +47 -0
  302. package/src/hooks/groups/use_group_members_for_new_conversation.ts +74 -0
  303. package/src/hooks/groups/use_groups_conversation_create.ts +50 -0
  304. package/src/hooks/index.ts +4 -0
  305. package/src/hooks/use_api.ts +13 -7
  306. package/src/hooks/use_api_client.ts +7 -3
  307. package/src/hooks/use_attachment_uploader.ts +179 -0
  308. package/src/hooks/use_conversation.ts +1 -0
  309. package/src/hooks/use_conversations_actions.ts +11 -0
  310. package/src/hooks/use_conversations_jolt_events.ts +5 -1
  311. package/src/hooks/use_current_person.ts +37 -9
  312. package/src/hooks/use_jolt.ts +18 -23
  313. package/src/hooks/use_message_create.ts +2 -2
  314. package/src/hooks/use_suspense_api.ts +6 -0
  315. package/src/hooks/use_upload_client.ts +67 -0
  316. package/src/index.tsx +3 -1
  317. package/src/navigation/index.tsx +23 -2
  318. package/src/screens/conversation_details_screen.tsx +2 -2
  319. package/src/screens/conversation_filter_recipients/components/checkbox_row.tsx +101 -0
  320. package/src/screens/conversation_filter_recipients/components/header_row.tsx +99 -0
  321. package/src/screens/conversation_filter_recipients/components/navigation_header.tsx +68 -0
  322. package/src/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.tsx +53 -0
  323. package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +90 -49
  324. package/src/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.tsx +50 -0
  325. package/src/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.ts +90 -0
  326. package/src/screens/conversation_filter_recipients/types.tsx +47 -0
  327. package/src/screens/conversation_filters/components/conversation_filters.tsx +5 -2
  328. package/src/screens/conversation_filters/components/rows.tsx +6 -1
  329. package/src/screens/conversation_filters/group_filters.tsx +23 -14
  330. package/src/screens/conversation_filters/hooks/filters.ts +1 -1
  331. package/src/screens/conversation_filters/team_filters.tsx +23 -14
  332. package/src/screens/conversation_filters_screen.tsx +1 -0
  333. package/src/screens/conversation_new/components/form_list.tsx +67 -0
  334. package/src/screens/conversation_new/components/groups_form.tsx +133 -107
  335. package/src/screens/conversation_new/components/team_form.tsx +1 -1
  336. package/src/screens/conversation_new/conversation_new_screen.tsx +11 -4
  337. package/src/screens/conversation_screen.tsx +123 -4
  338. package/src/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.tsx +21 -0
  339. package/src/screens/conversation_select_recipients/components/recipient_link_row.tsx +91 -0
  340. package/src/screens/conversation_select_recipients/components/view_more_link_row.tsx +30 -0
  341. package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +79 -0
  342. package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +57 -65
  343. package/src/screens/conversation_select_recipients/types/screen_props.tsx +11 -0
  344. package/src/screens/conversations/components/list_header_component.tsx +20 -4
  345. package/src/screens/conversations/conversations_screen.tsx +37 -2
  346. package/src/screens/send_giphy_screen.tsx +30 -1
  347. package/src/types/resources/groups/groups_group_resource.ts +1 -1
  348. package/src/types/resources/groups/groups_member_resource_with_person.ts +13 -0
  349. package/src/types/resources/member.ts +0 -11
  350. package/src/types/resources/message.ts +2 -0
  351. package/src/types/resources/oauth_token.ts +4 -4
  352. package/src/utils/client/client.ts +13 -13
  353. package/src/utils/date.ts +11 -1
  354. package/src/utils/destructure_chat_group_graph_id.ts +25 -0
  355. package/src/utils/index.ts +1 -0
  356. package/src/utils/native_adapters/configuration.ts +15 -1
  357. package/src/utils/native_adapters/image_picker.ts +31 -0
  358. package/src/utils/native_adapters/index.ts +1 -0
  359. package/src/utils/session.ts +10 -4
  360. package/src/utils/upload_uri.ts +69 -0
  361. package/src/utils/uri.ts +30 -6
  362. package/src/vendor/tapestry/alias_tokens_color_map.ts +3 -0
@@ -1,11 +1,13 @@
1
1
  import { AudioAdapter } from './audio'
2
2
  import { ClipboardAdapter } from './clipboard'
3
+ import { ImagePickerAdapter } from './image_picker'
3
4
  import { VideoAdapter } from './video'
4
5
 
5
6
  type ChatConfigurations = {
6
7
  clipboard: ClipboardAdapter
7
8
  audio: AudioAdapter
8
9
  video: VideoAdapter
10
+ imagePicker: ImagePickerAdapter
9
11
  }
10
12
 
11
13
  export class ChatAdapters {
@@ -13,6 +15,7 @@ export class ChatAdapters {
13
15
  Clipboard = configurations.clipboard
14
16
  Audio = configurations.audio
15
17
  Video = configurations.video
18
+ ImagePicker = configurations.imagePicker
16
19
  }
17
20
  }
18
21
 
@@ -45,4 +48,15 @@ let Video: VideoAdapter = new VideoAdapter({
45
48
  ),
46
49
  })
47
50
 
48
- export { Clipboard, Audio, Video }
51
+ let ImagePicker: ImagePickerAdapter = new ImagePickerAdapter({
52
+ openCameraAsync: async () => {
53
+ methodMissing()
54
+ return { canceled: true, assets: null }
55
+ },
56
+ openImageLibraryAsync: async () => {
57
+ methodMissing()
58
+ return { canceled: true, assets: null }
59
+ },
60
+ })
61
+
62
+ export { Clipboard, Audio, Video, ImagePicker }
@@ -0,0 +1,31 @@
1
+ export type ImagePickerAsset = {
2
+ uri: string
3
+ assetId?: string | null
4
+ width: number
5
+ height: number
6
+ mimeType?: string
7
+ fileName?: string | null
8
+ fileSize?: number
9
+ }
10
+
11
+ type ImagePickerSuccessResult = {
12
+ canceled: false
13
+ assets: ImagePickerAsset[]
14
+ }
15
+
16
+ type ImagePickerCanceledResult = {
17
+ canceled: true
18
+ assets: null
19
+ }
20
+
21
+ export type ImagePickerResult = ImagePickerSuccessResult | ImagePickerCanceledResult
22
+
23
+ export class ImagePickerAdapter {
24
+ openCameraAsync: () => Promise<ImagePickerResult>
25
+ openImageLibraryAsync: () => Promise<ImagePickerResult>
26
+
27
+ constructor(methods: ImagePickerAdapter) {
28
+ this.openCameraAsync = methods.openCameraAsync
29
+ this.openImageLibraryAsync = methods.openImageLibraryAsync
30
+ }
31
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './clipboard'
2
2
  export * from './configuration'
3
3
  export * from './audio'
4
+ export * from './image_picker'
4
5
  export * from './video'
@@ -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
  }
@@ -0,0 +1,69 @@
1
+ import DeviceInfo from 'react-native-device-info'
2
+ import { Session } from './session'
3
+ const brand = DeviceInfo.getBrand()
4
+ const model = DeviceInfo.getModel()
5
+ const systemName = DeviceInfo.getSystemName()
6
+ const systemVersion = DeviceInfo.getSystemVersion()
7
+ const readableVersion = DeviceInfo.getReadableVersion()
8
+ const appName = DeviceInfo.getApplicationName()
9
+
10
+ /**
11
+ * This is for accessing https://github.com/planningcenter/upload
12
+ */
13
+ export class UploadUri {
14
+ session: Session
15
+ app?: string
16
+
17
+ constructor({ session }: { session: Session }) {
18
+ this.session = session
19
+ }
20
+
21
+ get schema() {
22
+ if (this.env === 'development') {
23
+ return 'http'
24
+ } else {
25
+ return 'https'
26
+ }
27
+ }
28
+
29
+ get host() {
30
+ return `${this.subdomain}.${this.domain}.${this.tld}`
31
+ }
32
+
33
+ get subdomain() {
34
+ switch (this.env) {
35
+ case 'staging':
36
+ return 'upload-staging'
37
+ default:
38
+ return 'upload'
39
+ }
40
+ }
41
+
42
+ get domain(): 'pco' | 'planningcenteronline' {
43
+ return this.env === 'development' ? 'pco' : 'planningcenteronline'
44
+ }
45
+
46
+ get tld() {
47
+ switch (this.env) {
48
+ case 'development':
49
+ return 'test'
50
+ default:
51
+ return 'com'
52
+ }
53
+ }
54
+
55
+ get env() {
56
+ return this.session?.env || 'production'
57
+ }
58
+
59
+ get baseUrl() {
60
+ return `${this.schema}://${this.host}`
61
+ }
62
+
63
+ get headers() {
64
+ return {
65
+ 'User-Agent': `${appName}/${readableVersion} (${brand}, ${model}, ${systemName}, ${systemVersion})`,
66
+ Authorization: `Bearer ${this.session.token?.access_token}`,
67
+ }
68
+ }
69
+ }
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