@planningcenter/chat-react-native 3.2.0-rc.1 → 3.2.0-rc.10

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 (322) 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/conversation/message_reaction.d.ts +2 -2
  6. package/build/components/conversations/action_toggle_button.d.ts +21 -0
  7. package/build/components/conversations/action_toggle_button.d.ts.map +1 -0
  8. package/build/components/conversations/action_toggle_button.js +48 -0
  9. package/build/components/conversations/action_toggle_button.js.map +1 -0
  10. package/build/components/conversations/conversation_actions.d.ts +10 -0
  11. package/build/components/conversations/conversation_actions.d.ts.map +1 -0
  12. package/build/components/conversations/conversation_actions.js +84 -0
  13. package/build/components/conversations/conversation_actions.js.map +1 -0
  14. package/build/components/conversations/conversation_preview.d.ts +2 -1
  15. package/build/components/conversations/conversation_preview.d.ts.map +1 -1
  16. package/build/components/conversations/conversation_preview.js +27 -9
  17. package/build/components/conversations/conversation_preview.js.map +1 -1
  18. package/build/components/conversations/conversations.d.ts +2 -3
  19. package/build/components/conversations/conversations.d.ts.map +1 -1
  20. package/build/components/conversations/conversations.js +5 -11
  21. package/build/components/conversations/conversations.js.map +1 -1
  22. package/build/components/conversations/mute_indicator.d.ts +5 -0
  23. package/build/components/conversations/mute_indicator.d.ts.map +1 -0
  24. package/build/components/conversations/mute_indicator.js +19 -0
  25. package/build/components/conversations/mute_indicator.js.map +1 -0
  26. package/build/components/conversations/unread_count_badge.d.ts +2 -1
  27. package/build/components/conversations/unread_count_badge.d.ts.map +1 -1
  28. package/build/components/conversations/unread_count_badge.js +9 -1
  29. package/build/components/conversations/unread_count_badge.js.map +1 -1
  30. package/build/components/display/action_button.js +1 -2
  31. package/build/components/display/action_button.js.map +1 -1
  32. package/build/components/display/badge.d.ts +5 -4
  33. package/build/components/display/badge.d.ts.map +1 -1
  34. package/build/components/display/badge.js +5 -2
  35. package/build/components/display/badge.js.map +1 -1
  36. package/build/components/display/button.d.ts +3 -2
  37. package/build/components/display/button.d.ts.map +1 -1
  38. package/build/components/display/button.js.map +1 -1
  39. package/build/components/display/icon.d.ts +14 -1
  40. package/build/components/display/icon.d.ts.map +1 -1
  41. package/build/components/display/icon.js +9 -0
  42. package/build/components/display/icon.js.map +1 -1
  43. package/build/components/display/icon_button.d.ts +2 -2
  44. package/build/components/display/icon_button.d.ts.map +1 -1
  45. package/build/components/display/icon_button.js.map +1 -1
  46. package/build/components/display/person.d.ts +3 -1
  47. package/build/components/display/person.d.ts.map +1 -1
  48. package/build/components/display/person.js +2 -2
  49. package/build/components/display/person.js.map +1 -1
  50. package/build/components/display/text.js.map +1 -1
  51. package/build/components/display/toggle_button.d.ts +3 -2
  52. package/build/components/display/toggle_button.d.ts.map +1 -1
  53. package/build/components/display/toggle_button.js.map +1 -1
  54. package/build/components/display/utils/button_colors.d.ts +3 -3
  55. package/build/components/display/utils/button_colors.d.ts.map +1 -1
  56. package/build/components/display/utils/button_colors.js +1 -1
  57. package/build/components/display/utils/button_colors.js.map +1 -1
  58. package/build/components/page/error_boundary.d.ts +1 -1
  59. package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
  60. package/build/components/primitive/avatar_primitive.js +3 -2
  61. package/build/components/primitive/avatar_primitive.js.map +1 -1
  62. package/build/components/primitive/banner_primitive.d.ts +2 -1
  63. package/build/components/primitive/banner_primitive.d.ts.map +1 -1
  64. package/build/components/primitive/banner_primitive.js +0 -1
  65. package/build/components/primitive/banner_primitive.js.map +1 -1
  66. package/build/contexts/api_provider.js.map +1 -1
  67. package/build/contexts/chat_context.d.ts +2 -0
  68. package/build/contexts/chat_context.d.ts.map +1 -1
  69. package/build/contexts/chat_context.js +6 -1
  70. package/build/contexts/chat_context.js.map +1 -1
  71. package/build/contexts/conversations_context.d.ts +14 -0
  72. package/build/contexts/conversations_context.d.ts.map +1 -0
  73. package/build/contexts/conversations_context.js +38 -0
  74. package/build/contexts/conversations_context.js.map +1 -0
  75. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +214 -0
  76. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -0
  77. package/build/hooks/groups/use_group_members_for_new_conversation.js +50 -0
  78. package/build/hooks/groups/use_group_members_for_new_conversation.js.map +1 -0
  79. package/build/hooks/use_conversation.d.ts +1 -1
  80. package/build/hooks/use_conversation.d.ts.map +1 -1
  81. package/build/hooks/use_conversation.js +1 -1
  82. package/build/hooks/use_conversation.js.map +1 -1
  83. package/build/hooks/use_conversations.d.ts +6 -32
  84. package/build/hooks/use_conversations.d.ts.map +1 -1
  85. package/build/hooks/use_conversations.js +15 -14
  86. package/build/hooks/use_conversations.js.map +1 -1
  87. package/build/hooks/use_conversations_actions.d.ts +221 -0
  88. package/build/hooks/use_conversations_actions.d.ts.map +1 -0
  89. package/build/hooks/use_conversations_actions.js +93 -0
  90. package/build/hooks/use_conversations_actions.js.map +1 -0
  91. package/build/hooks/use_conversations_cache.d.ts +18 -0
  92. package/build/hooks/use_conversations_cache.d.ts.map +1 -0
  93. package/build/hooks/{use_conversation_jolt_events.js → use_conversations_cache.js} +27 -17
  94. package/build/hooks/use_conversations_cache.js.map +1 -0
  95. package/build/hooks/use_conversations_jolt_events.d.ts +3 -0
  96. package/build/hooks/use_conversations_jolt_events.d.ts.map +1 -0
  97. package/build/hooks/use_conversations_jolt_events.js +12 -0
  98. package/build/hooks/use_conversations_jolt_events.js.map +1 -0
  99. package/build/hooks/use_create_android_ripple_color.d.ts +1 -1
  100. package/build/hooks/use_create_android_ripple_color.d.ts.map +1 -1
  101. package/build/hooks/use_giphy.d.ts +9 -0
  102. package/build/hooks/use_giphy.d.ts.map +1 -0
  103. package/build/hooks/use_giphy.js +63 -0
  104. package/build/hooks/use_giphy.js.map +1 -0
  105. package/build/hooks/use_jolt.d.ts.map +1 -1
  106. package/build/hooks/use_jolt.js +39 -10
  107. package/build/hooks/use_jolt.js.map +1 -1
  108. package/build/hooks/use_message_create.d.ts +11 -0
  109. package/build/hooks/use_message_create.d.ts.map +1 -0
  110. package/build/hooks/use_message_create.js +35 -0
  111. package/build/hooks/use_message_create.js.map +1 -0
  112. package/build/navigation/index.d.ts +23 -6
  113. package/build/navigation/index.d.ts.map +1 -1
  114. package/build/navigation/index.js +25 -8
  115. package/build/navigation/index.js.map +1 -1
  116. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -0
  117. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -0
  118. package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
  119. package/build/screens/conversation_filters/components/rows.d.ts +2 -1
  120. package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
  121. package/build/screens/conversation_filters/components/rows.js +19 -14
  122. package/build/screens/conversation_filters/components/rows.js.map +1 -1
  123. package/build/screens/conversation_filters/hooks/filters.js +1 -1
  124. package/build/screens/conversation_filters/hooks/filters.js.map +1 -1
  125. package/build/screens/conversation_new/components/form_list.d.ts +12 -0
  126. package/build/screens/conversation_new/components/form_list.d.ts.map +1 -0
  127. package/build/screens/conversation_new/components/form_list.js +42 -0
  128. package/build/screens/conversation_new/components/form_list.js.map +1 -0
  129. package/build/screens/conversation_new/components/groups_form.d.ts +7 -0
  130. package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -0
  131. package/build/screens/conversation_new/components/groups_form.js +128 -0
  132. package/build/screens/conversation_new/components/groups_form.js.map +1 -0
  133. package/build/screens/conversation_new/components/member_error_card.d.ts +5 -0
  134. package/build/screens/conversation_new/components/member_error_card.d.ts.map +1 -0
  135. package/build/screens/conversation_new/components/member_error_card.js +17 -0
  136. package/build/screens/conversation_new/components/member_error_card.js.map +1 -0
  137. package/build/screens/conversation_new/components/source_app_error_card.d.ts +2 -0
  138. package/build/screens/conversation_new/components/source_app_error_card.d.ts.map +1 -0
  139. package/build/screens/conversation_new/components/source_app_error_card.js +16 -0
  140. package/build/screens/conversation_new/components/source_app_error_card.js.map +1 -0
  141. package/build/screens/conversation_new/components/team_form.d.ts +8 -0
  142. package/build/screens/conversation_new/components/team_form.d.ts.map +1 -0
  143. package/build/screens/conversation_new/components/team_form.js +11 -0
  144. package/build/screens/conversation_new/components/team_form.js.map +1 -0
  145. package/build/screens/conversation_new/conversation_new_screen.d.ts +12 -0
  146. package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -0
  147. package/build/screens/conversation_new/conversation_new_screen.js +16 -0
  148. package/build/screens/conversation_new/conversation_new_screen.js.map +1 -0
  149. package/build/screens/conversation_new/utils/fake_member_data.d.ts +3 -0
  150. package/build/screens/conversation_new/utils/fake_member_data.d.ts.map +1 -0
  151. package/build/screens/conversation_new/utils/fake_member_data.js +129 -0
  152. package/build/screens/conversation_new/utils/fake_member_data.js.map +1 -0
  153. package/build/screens/conversation_screen.d.ts +1 -0
  154. package/build/screens/conversation_screen.d.ts.map +1 -1
  155. package/build/screens/conversation_screen.js +1 -1
  156. package/build/screens/conversation_screen.js.map +1 -1
  157. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -0
  158. package/build/screens/{create → conversation_select_recipients}/conversation_select_recipients_screen.js +6 -5
  159. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -0
  160. package/build/screens/conversations/components/chat_group_badge.js +1 -1
  161. package/build/screens/conversations/components/chat_group_badge.js.map +1 -1
  162. package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
  163. package/build/screens/conversations/components/list_header_component.js +6 -2
  164. package/build/screens/conversations/components/list_header_component.js.map +1 -1
  165. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  166. package/build/screens/conversations/conversations_screen.js +6 -13
  167. package/build/screens/conversations/conversations_screen.js.map +1 -1
  168. package/build/screens/design_system_screen.js +1 -0
  169. package/build/screens/design_system_screen.js.map +1 -1
  170. package/build/screens/message_actions_screen.d.ts +2 -2
  171. package/build/screens/message_actions_screen.d.ts.map +1 -1
  172. package/build/screens/message_actions_screen.js +1 -1
  173. package/build/screens/message_actions_screen.js.map +1 -1
  174. package/build/screens/send_giphy_screen.d.ts +10 -0
  175. package/build/screens/send_giphy_screen.d.ts.map +1 -0
  176. package/build/screens/send_giphy_screen.js +98 -0
  177. package/build/screens/send_giphy_screen.js.map +1 -0
  178. package/build/types/resources/groups/groups_group_resource.d.ts +1 -1
  179. package/build/types/resources/groups/groups_group_resource.js.map +1 -1
  180. package/build/types/resources/groups/groups_member_resource_with_person.d.ts +14 -0
  181. package/build/types/resources/groups/groups_member_resource_with_person.d.ts.map +1 -0
  182. package/build/types/resources/groups/groups_member_resource_with_person.js +2 -0
  183. package/build/types/resources/groups/groups_member_resource_with_person.js.map +1 -0
  184. package/build/types/resources/member.d.ts +0 -10
  185. package/build/types/resources/member.d.ts.map +1 -1
  186. package/build/types/resources/member.js.map +1 -1
  187. package/build/utils/cache/page_mutations.d.ts +18 -0
  188. package/build/utils/cache/page_mutations.d.ts.map +1 -1
  189. package/build/utils/cache/page_mutations.js +13 -0
  190. package/build/utils/cache/page_mutations.js.map +1 -1
  191. package/build/utils/client/client.d.ts +2 -2
  192. package/build/utils/client/client.d.ts.map +1 -1
  193. package/build/utils/client/client.js +12 -4
  194. package/build/utils/client/client.js.map +1 -1
  195. package/build/utils/client/request_helpers.d.ts +15 -8
  196. package/build/utils/client/request_helpers.d.ts.map +1 -1
  197. package/build/utils/client/request_helpers.js +2 -1
  198. package/build/utils/client/request_helpers.js.map +1 -1
  199. package/build/utils/client/transform_request_data.d.ts +11 -6
  200. package/build/utils/client/transform_request_data.d.ts.map +1 -1
  201. package/build/utils/client/transform_request_data.js +1 -1
  202. package/build/utils/client/transform_request_data.js.map +1 -1
  203. package/build/utils/client/transform_response.d.ts +1 -1
  204. package/build/utils/client/transform_response.d.ts.map +1 -1
  205. package/build/utils/client/transform_response.js +2 -0
  206. package/build/utils/client/transform_response.js.map +1 -1
  207. package/build/utils/client/utils.d.ts +3 -3
  208. package/build/utils/client/utils.d.ts.map +1 -1
  209. package/build/utils/client/utils.js +6 -6
  210. package/build/utils/client/utils.js.map +1 -1
  211. package/build/utils/date.d.ts.map +1 -1
  212. package/build/utils/date.js +1 -0
  213. package/build/utils/date.js.map +1 -1
  214. package/build/utils/deepCamelCaseKeys.d.ts.map +1 -1
  215. package/build/utils/deepCamelCaseKeys.js +3 -1
  216. package/build/utils/deepCamelCaseKeys.js.map +1 -1
  217. package/build/utils/parse_simple_markdown.d.ts +1 -1
  218. package/build/utils/parse_simple_markdown.d.ts.map +1 -1
  219. package/build/utils/parse_simple_markdown.js +2 -1
  220. package/build/utils/parse_simple_markdown.js.map +1 -1
  221. package/build/utils/request/conversation.d.ts +1 -3
  222. package/build/utils/request/conversation.d.ts.map +1 -1
  223. package/build/utils/request/conversation.js +37 -30
  224. package/build/utils/request/conversation.js.map +1 -1
  225. package/build/utils/space.js.map +1 -1
  226. package/build/utils/uri.d.ts +2 -2
  227. package/build/utils/uri.d.ts.map +1 -1
  228. package/build/utils/uri.js +2 -2
  229. package/build/utils/uri.js.map +1 -1
  230. package/build/vendor/tapestry/alias_tokens_color_map.d.ts +8 -0
  231. package/build/vendor/tapestry/alias_tokens_color_map.d.ts.map +1 -1
  232. package/build/vendor/tapestry/alias_tokens_color_map.js +8 -0
  233. package/build/vendor/tapestry/alias_tokens_color_map.js.map +1 -1
  234. package/build/vendor/tapestry/tokens.d.ts +2 -0
  235. package/build/vendor/tapestry/tokens.d.ts.map +1 -1
  236. package/build/vendor/tapestry/tokens.js +2 -0
  237. package/build/vendor/tapestry/tokens.js.map +1 -1
  238. package/package.json +8 -6
  239. package/src/__tests__/utils/cache/page_mutations.ts +49 -15
  240. package/src/components/conversation/message_form.tsx +127 -58
  241. package/src/components/conversations/action_toggle_button.tsx +84 -0
  242. package/src/components/conversations/conversation_actions.tsx +146 -0
  243. package/src/components/conversations/conversation_preview.tsx +46 -16
  244. package/src/components/conversations/conversations.tsx +13 -18
  245. package/src/components/conversations/mute_indicator.tsx +21 -0
  246. package/src/components/conversations/unread_count_badge.tsx +8 -1
  247. package/src/components/display/action_button.tsx +1 -2
  248. package/src/components/display/badge.tsx +12 -8
  249. package/src/components/display/button.tsx +3 -3
  250. package/src/components/display/icon.tsx +16 -3
  251. package/src/components/display/icon_button.tsx +2 -2
  252. package/src/components/display/person.tsx +4 -3
  253. package/src/components/display/text.tsx +1 -1
  254. package/src/components/display/toggle_button.tsx +3 -3
  255. package/src/components/display/utils/button_colors.ts +8 -3
  256. package/src/components/primitive/avatar_primitive.tsx +5 -3
  257. package/src/components/primitive/banner_primitive.tsx +2 -3
  258. package/src/contexts/api_provider.tsx +1 -1
  259. package/src/contexts/chat_context.tsx +8 -1
  260. package/src/contexts/conversations_context.tsx +69 -0
  261. package/src/hooks/groups/use_group_members_for_new_conversation.ts +57 -0
  262. package/src/hooks/use_conversation.ts +5 -5
  263. package/src/hooks/use_conversations.ts +34 -16
  264. package/src/hooks/use_conversations_actions.ts +108 -0
  265. package/src/hooks/{use_conversation_jolt_events.ts → use_conversations_cache.ts} +35 -20
  266. package/src/hooks/use_conversations_jolt_events.ts +21 -0
  267. package/src/hooks/use_giphy.ts +97 -0
  268. package/src/hooks/use_jolt.ts +53 -12
  269. package/src/hooks/use_message_create.ts +55 -0
  270. package/src/navigation/index.tsx +31 -8
  271. package/src/screens/conversation_filters/components/conversation_filters.tsx +1 -1
  272. package/src/screens/conversation_filters/components/rows.tsx +44 -14
  273. package/src/screens/conversation_filters/hooks/filters.ts +1 -1
  274. package/src/screens/conversation_new/components/form_list.tsx +67 -0
  275. package/src/screens/conversation_new/components/groups_form.tsx +191 -0
  276. package/src/screens/conversation_new/components/member_error_card.tsx +20 -0
  277. package/src/screens/conversation_new/components/source_app_error_card.tsx +24 -0
  278. package/src/screens/conversation_new/components/team_form.tsx +18 -0
  279. package/src/screens/conversation_new/conversation_new_screen.tsx +26 -0
  280. package/src/screens/conversation_new/utils/fake_member_data.ts +130 -0
  281. package/src/screens/conversation_screen.tsx +2 -1
  282. package/src/screens/{create → conversation_select_recipients}/conversation_select_recipients_screen.tsx +6 -5
  283. package/src/screens/conversations/components/chat_group_badge.tsx +1 -1
  284. package/src/screens/conversations/components/list_header_component.tsx +7 -2
  285. package/src/screens/conversations/conversations_screen.tsx +6 -19
  286. package/src/screens/design_system_screen.tsx +1 -0
  287. package/src/screens/message_actions_screen.tsx +4 -4
  288. package/src/screens/send_giphy_screen.tsx +155 -0
  289. package/src/types/resources/groups/groups_group_resource.ts +1 -1
  290. package/src/types/resources/groups/groups_member_resource_with_person.ts +13 -0
  291. package/src/types/resources/member.ts +0 -11
  292. package/src/utils/cache/page_mutations.ts +22 -0
  293. package/src/utils/client/client.ts +15 -7
  294. package/src/utils/client/request_helpers.ts +15 -6
  295. package/src/utils/client/transform_request_data.ts +13 -4
  296. package/src/utils/client/transform_response.ts +3 -0
  297. package/src/utils/client/types.d.ts +2 -1
  298. package/src/utils/client/utils.ts +13 -12
  299. package/src/utils/date.ts +1 -0
  300. package/src/utils/deepCamelCaseKeys.ts +3 -2
  301. package/src/utils/parse_simple_markdown.ts +3 -1
  302. package/src/utils/request/conversation.ts +39 -34
  303. package/src/utils/space.ts +1 -1
  304. package/src/utils/uri.ts +2 -2
  305. package/src/vendor/tapestry/alias_tokens_color_map.ts +12 -0
  306. package/src/vendor/tapestry/tokens.ts +2 -0
  307. package/build/hooks/use_conversation_jolt_events.d.ts +0 -2
  308. package/build/hooks/use_conversation_jolt_events.d.ts.map +0 -1
  309. package/build/hooks/use_conversation_jolt_events.js.map +0 -1
  310. package/build/screens/create/conversation_create_screen.d.ts +0 -9
  311. package/build/screens/create/conversation_create_screen.d.ts.map +0 -1
  312. package/build/screens/create/conversation_create_screen.js +0 -123
  313. package/build/screens/create/conversation_create_screen.js.map +0 -1
  314. package/build/screens/create/conversation_filter_recipients_screen.d.ts.map +0 -1
  315. package/build/screens/create/conversation_filter_recipients_screen.js.map +0 -1
  316. package/build/screens/create/conversation_select_recipients_screen.d.ts.map +0 -1
  317. package/build/screens/create/conversation_select_recipients_screen.js.map +0 -1
  318. package/src/screens/create/conversation_create_screen.tsx +0 -148
  319. /package/build/screens/{create → conversation_filter_recipients}/conversation_filter_recipients_screen.d.ts +0 -0
  320. /package/build/screens/{create → conversation_filter_recipients}/conversation_filter_recipients_screen.js +0 -0
  321. /package/build/screens/{create → conversation_select_recipients}/conversation_select_recipients_screen.d.ts +0 -0
  322. /package/src/screens/{create → conversation_filter_recipients}/conversation_filter_recipients_screen.tsx +0 -0
@@ -17,7 +17,10 @@ export const transformRequestData = ({
17
17
  }
18
18
  }
19
19
 
20
- export function flattenAttribute(obj, key) {
20
+ export function flattenAttribute<T extends Record<string, string | string[]>>(
21
+ obj: T | undefined,
22
+ key: keyof T
23
+ ) {
21
24
  if (!isObject(obj)) return { [key]: obj }
22
25
 
23
26
  return reduce(
@@ -25,17 +28,23 @@ export function flattenAttribute(obj, key) {
25
28
  (acc, value, attr) => {
26
29
  return {
27
30
  ...acc,
28
- ...buildQuery({ key: `${key}[${attr}]`, value }),
31
+ ...buildQuery({ key: `${String(key)}[${attr}]`, value }),
29
32
  }
30
33
  },
31
34
  {}
32
35
  )
33
36
  }
34
37
 
35
- export function buildQuery({ key, value }) {
38
+ type QueryArgs = {
39
+ key: string
40
+ value: string | number | boolean | object | any[]
41
+ }
42
+ type QueryReturn = Record<string, string | number | boolean>
43
+
44
+ export function buildQuery({ key, value }: QueryArgs): QueryReturn {
36
45
  if (isArray(value)) return { [key]: value.join(',') }
37
46
  if (isObject(value)) {
38
- const keys = Object.keys(value)
47
+ const keys = Object.keys(value) as Array<keyof typeof value>
39
48
  return keys.reduce(
40
49
  (acc, subKey) => ({
41
50
  ...acc,
@@ -1,3 +1,6 @@
1
+ // @ts-nocheck
2
+ // TODO: Fix this file but write tests first
3
+
1
4
  import _ from 'lodash'
2
5
  import inflection from 'lodash-inflection/lib/lodash-inflection'
3
6
  import { keysToCamelCase } from './utils'
@@ -34,6 +34,7 @@ export interface Relationship {
34
34
  }
35
35
  }
36
36
 
37
+ export type Relationships = Record<string, Relationship | Relationship[]>
37
38
  export interface PostRequest extends GenericRequest {
38
39
  data?: {
39
40
  fields?: Record<string, string> // value should be comma separated string
@@ -41,7 +42,7 @@ export interface PostRequest extends GenericRequest {
41
42
  data?: {
42
43
  type: string
43
44
  attributes: Record<string, unknown>
44
- relationships?: Record<string, Relationship | Relationship[]>
45
+ relationships?: Relationships
45
46
  }
46
47
  }
47
48
  }
@@ -1,34 +1,35 @@
1
1
  import _ from 'lodash'
2
2
 
3
- const toSentence = (words, lastWordConnector = 'and') => {
3
+ const toSentence = (words: string[], lastWordConnector = 'and') => {
4
4
  lastWordConnector = `${words.length > 2 ? ',' : ''} ${lastWordConnector}`
5
5
  return words.join(', ').replace(/,\s([^,]+$)/, `${lastWordConnector} $1`)
6
6
  }
7
7
 
8
- const toCamel = s => s.replace(/(_[a-z])/g, m => m.toUpperCase().replace('_', ''))
8
+ const toCamel = (s: string) =>
9
+ s.replace(/(_[a-z])/g, (m: string) => m.toUpperCase().replace('_', ''))
9
10
 
10
- const toSnake = s => (s.startsWith('_') ? `_${_.snakeCase(s)}` : _.snakeCase(s))
11
+ const toSnake = (s: string) => (s.startsWith('_') ? `_${_.snakeCase(s)}` : _.snakeCase(s))
11
12
 
12
- const actualObject = elem => {
13
+ const actualObject = (elem: unknown): elem is Object => {
13
14
  return !((_.isObject(elem) && (_.isArray(elem) || _.isFunction(elem))) || !_.isObject(elem))
14
15
  }
15
16
 
16
17
  // map over tree (object) and apply f to each key
17
- const walker = f => {
18
- const seen = new WeakMap()
18
+ const walker = (f: (key: string) => string) => {
19
+ const seen = new WeakMap<object, object>()
19
20
 
20
- const convert = elem => {
21
+ const convert = (elem: object): object => {
21
22
  if (actualObject(elem)) {
22
23
  return _.reduce(
23
- elem,
24
- (memo, obj, key) => {
24
+ elem as Record<string, unknown>,
25
+ (memo: Record<string, unknown>, obj: unknown, key: string) => {
25
26
  if (!seen.has(elem)) {
26
27
  seen.set(elem, memo)
27
28
  }
28
- memo[f(key)] = seen.get(obj) || convert(obj)
29
+ memo[f(key)] = seen.get(obj as object) || convert(obj as object)
29
30
  return memo
30
31
  },
31
- {}
32
+ {} as Record<string, unknown>
32
33
  )
33
34
  } else if (_.isArray(elem)) {
34
35
  return _.map(elem, convert)
@@ -40,6 +41,6 @@ const walker = f => {
40
41
  }
41
42
 
42
43
  const keysToCamelCase = walker(toCamel)
43
- const keysToSnakeCase = walker(k => (k < 0 ? k : toSnake(k)))
44
+ const keysToSnakeCase = walker(k => (typeof k !== 'string' ? k : toSnake(k)))
44
45
 
45
46
  export { keysToCamelCase, keysToSnakeCase, toSentence }
package/src/utils/date.ts CHANGED
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import { date as formatDate } from '@planningcenter/datetime-fmt'
2
3
  import moment from 'moment-timezone'
3
4
 
@@ -4,10 +4,11 @@ type ObjType = Record<string, unknown> | unknown[] | unknown
4
4
 
5
5
  export function deepCamelCaseKeys<T extends ObjType>(obj: T): T {
6
6
  if (isArray(obj)) {
7
- return (obj as T & any[]).map(deepCamelCaseKeys) as T
7
+ return obj.map(deepCamelCaseKeys) as T
8
8
  } else if (isObject(obj)) {
9
9
  return mapValues(
10
- mapKeys(obj, (_value, key) => camelCase(key)),
10
+ // @ts-ignore This mutates the object, but we don't care about the type here
11
+ mapKeys(obj, (_value: string, key: string) => camelCase(key)),
11
12
  deepCamelCaseKeys
12
13
  ) as T
13
14
  }
@@ -1,5 +1,5 @@
1
1
  // Supports bold, italic, and links
2
- export const parseSimpleMarkdown = input => {
2
+ export const parseSimpleMarkdown = (input: string) => {
3
3
  const parts: MarkdownPart[] = []
4
4
 
5
5
  const pattern = /(\*\*|__)(.+?)\1|(?<!\*)\*(.+?)\*|(?<!_)_(.+?)_|(https?:\/\/[^\s]+)/g
@@ -25,6 +25,8 @@ export const parseSimpleMarkdown = input => {
25
25
  }
26
26
 
27
27
  lastIndex = offset + match.length
28
+
29
+ return match
28
30
  })
29
31
 
30
32
  if (lastIndex < input.length) {
@@ -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
+ }
@@ -24,7 +24,7 @@ export function space(value: SpacingValues): number {
24
24
  if (value < 1 || value > 7.5) return handleInvalidSpace(value)
25
25
 
26
26
  // Reject fractional values that are not 0 or 0.5
27
- const wholeValue = Math.floor(value)
27
+ const wholeValue = Math.floor(value) as 1 | 2 | 3 | 4 | 5 | 6 | 7
28
28
  const fractionalValue = value % 1
29
29
  if (fractionalValue !== 0 && fractionalValue !== 0.5) return handleInvalidSpace(value)
30
30
 
package/src/utils/uri.ts CHANGED
@@ -56,13 +56,13 @@ export class Uri {
56
56
  }
57
57
  }
58
58
 
59
- appUrl = path => {
59
+ appUrl = (path: string) => {
60
60
  if (path.startsWith(`${this.schema}://`)) return path
61
61
 
62
62
  return `${this.baseUrl}${this.directory}${path || '/'}`
63
63
  }
64
64
 
65
- api = path => {
65
+ api = (path: string) => {
66
66
  if (path.startsWith(`${this.schema}://`)) return path
67
67
 
68
68
  return `${this.baseUrl}${path || '/'}`
@@ -73,6 +73,10 @@ interface SemanticAliasesColors {
73
73
  fillColorStatusErrorMedium: string
74
74
  fillColorButtonNeutralSolidDisabled: string
75
75
  androidRippleNeutral: string
76
+ surfaceColorCard: string
77
+ surfaceColorCanvas: string
78
+ surfaceColor100: string
79
+ surfaceColor090: string
76
80
  needsDesignPass: string
77
81
  }
78
82
 
@@ -100,6 +104,10 @@ const semanticAliasesLight: SemanticAliasesColors = {
100
104
  fillColorStatusErrorMedium: tokens.fillColorStatusErrorMedium,
101
105
  fillColorButtonNeutralSolidDisabled: neutralsLight.fillColorNeutral070,
102
106
  androidRippleNeutral: tokens.fillColorTransparencyDark020,
107
+ surfaceColorCard: neutralsLight.fillColorNeutral100Inverted,
108
+ surfaceColorCanvas: neutralsLight.fillColorNeutral090,
109
+ surfaceColor100: neutralsLight.fillColorNeutral100Inverted,
110
+ surfaceColor090: neutralsLight.fillColorNeutral090,
103
111
  needsDesignPass: 'hotpink',
104
112
  } as const
105
113
 
@@ -127,6 +135,10 @@ const semanticAliasesDark: SemanticAliasesColors = {
127
135
  fillColorStatusErrorMedium: tokens.fillColorStatusErrorMedium,
128
136
  fillColorButtonNeutralSolidDisabled: neutralsDark.fillColorNeutral070,
129
137
  androidRippleNeutral: tokens.fillColorTransparencyLight020,
138
+ surfaceColorCard: neutralsDark.fillColorNeutral100Inverted,
139
+ surfaceColorCanvas: neutralsDark.fillColorNeutral090,
140
+ surfaceColor100: neutralsDark.fillColorNeutral100Inverted,
141
+ surfaceColor090: neutralsDark.fillColorNeutral090,
130
142
  needsDesignPass: 'pink',
131
143
  }
132
144
 
@@ -24,6 +24,8 @@ const colorPrimitives = {
24
24
  borderColorStatusErrorDark: 'hsl(8, 60%, 55%)',
25
25
  colorNeutral100White: 'hsl(0, 0%, 100%)',
26
26
  fillColorInteractionDefault: 'hsl(204, 100%, 40%)',
27
+ fillColorInteractionSwipeDefault: 'hsl(204, 100%, 40%)',
28
+ fillColorInteractionSwipeSecondary: 'hsl(0, 0%, 24%)',
27
29
  fillColorStatusNeutralGhost: 'hsl(0, 0%, 93%)',
28
30
  fillColorStatusNeutralGhostDark: 'hsl(0, 0%, 18%)',
29
31
  textColorStatusNeutral: 'hsl(0, 0%, 24%)',
@@ -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,uB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,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,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;AAEF,eAAO,MAAM,wBAAwB,cAAe,6BAA6B,sBAsFhF,CAAA"}
@@ -1,123 +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
- include: ['location'],
22
- },
23
- app: 'groups',
24
- });
25
- const { mutate: handleSave } = useMutation({
26
- throwOnError: true,
27
- onSuccess: result => {
28
- handleRedirectToConversation({ conversation_id: result.data.id });
29
- },
30
- mutationFn: () => apiClient.groups
31
- .post({
32
- url: `/me/groups/${route.params.group_id}/chat_conversation_payload`,
33
- data: {
34
- data: {
35
- type: '',
36
- attributes: {
37
- title,
38
- },
39
- },
40
- },
41
- })
42
- .then(res => res.data.value)
43
- .then(payload => apiClient.chat.post({
44
- url: '/me/conversations',
45
- data: {
46
- data: {
47
- type: 'Conversation',
48
- attributes: {
49
- payload,
50
- },
51
- },
52
- },
53
- })),
54
- });
55
- const handleRedirectToConversation = useCallback(({ conversation_id }) => {
56
- // exit from the create stack
57
- navigation.getParent()?.goBack();
58
- // navigate to the conversation screen
59
- navigation.dispatch(StackActions.push('Conversation', {
60
- conversation_id,
61
- }));
62
- }, [navigation]);
63
- return (<View style={styles.container}>
64
- <View style={styles.section}>
65
- <View style={styles.to}>
66
- <Text>To:</Text>
67
- <View>
68
- <Text>{group.name}</Text>
69
- <Text>{group.membershipsCount} members</Text>
70
- </View>
71
- </View>
72
- <View style={styles.titleContainer}>
73
- <Text style={styles.titleLabel}>Title</Text>
74
- <TextInput placeholder="Topic of conversation (required)" value={title} onChangeText={setTitle} style={styles.titleInput}/>
75
- </View>
76
- </View>
77
- <ActionButton title="Start Conversation" onPress={() => handleSave()}/>
78
- </View>);
79
- };
80
- const useStyles = () => {
81
- const { bottom } = useSafeAreaInsets();
82
- const theme = useTheme();
83
- return StyleSheet.create({
84
- container: {
85
- flex: 1,
86
- gap: 8,
87
- },
88
- section: {
89
- padding: 16,
90
- flex: 1,
91
- },
92
- sectionHeader: {
93
- flexDirection: 'row',
94
- justifyContent: 'space-between',
95
- },
96
- selectTeamsButton: {},
97
- routeDebug: {
98
- alignContent: 'center',
99
- padding: 16,
100
- paddingBottom: bottom,
101
- borderTopWidth: 1,
102
- borderTopColor: theme.colors.fillColorNeutral050Base,
103
- },
104
- titleContainer: {
105
- paddingVertical: 12,
106
- borderBottomWidth: 1,
107
- borderBottomColor: theme.colors.fillColorNeutral050Base,
108
- gap: 8,
109
- },
110
- titleInput: {
111
- fontSize: 18,
112
- },
113
- titleLabel: {},
114
- to: {
115
- flexDirection: 'row',
116
- gap: 8,
117
- paddingVertical: 12,
118
- borderBottomWidth: 1,
119
- borderBottomColor: theme.colors.fillColorNeutral050Base,
120
- },
121
- });
122
- };
123
- //# 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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,CAAC;YACjB,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACrD;QACD,cAAc,EAAE;YACd,eAAe,EAAE,EAAE;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 { GroupsGroupResource } from '../../types'\n\ntype ConversationCreateScreenProps = StaticScreenProps<{\n group_id?: string\n team_ids?: 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 include: ['location'],\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({\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({\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 +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,KAA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rD;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 +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 +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,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAM/D,MAAM,YAAY,GAAG,EAAE,GAAG,CAAC,CAAA;AAC3B,MAAM,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAM,gBAAgB,GAAG,eAAe,GAAG,YAAY,CAAA;AAEvD,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,EAA2C,EAAE,EAAE;IAChG,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,eAAe,EAAE,CAAA;IAC/C,MAAM,0BAA0B,GAAG,M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AE,EAAE;YACX,IAAI,EAAE,CAAC;SACR;QACD,aAAa,EAAE;YACb,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;SAChC;QACD,iBAAiB,EAAE,EAAE;QACrB,GAAG,EAAE;YACH,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,CAAC;YACpB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SAClD;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,gBAAgB;YACxB,YAAY,EAAE,CAAC;SAChB;QACD,YAAY,EAAE;YACZ,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,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"]}