@planningcenter/chat-react-native 3.2.0-rc.9 → 3.3.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.
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts +13 -0
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts.map +1 -0
- package/build/components/conversation/message_form/message_form_attachment_image.js +78 -0
- package/build/components/conversation/message_form/message_form_attachment_image.js.map +1 -0
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +128 -16
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversations/conversation_actions.d.ts +2 -2
- package/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts +3 -1
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +2 -2
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/display/action_button.d.ts +2 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +3 -4
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/banner.d.ts +6 -1
- package/build/components/display/banner.d.ts.map +1 -1
- package/build/components/display/banner.js +2 -2
- package/build/components/display/banner.js.map +1 -1
- package/build/components/display/banner_collapsible.d.ts +1 -1
- package/build/components/display/banner_collapsible.d.ts.map +1 -1
- package/build/components/display/banner_collapsible.js +2 -2
- package/build/components/display/banner_collapsible.js.map +1 -1
- package/build/components/display/child_notice.d.ts +3 -1
- package/build/components/display/child_notice.d.ts.map +1 -1
- package/build/components/display/child_notice.js +2 -2
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/group_conversation_list.d.ts +19 -0
- package/build/components/group_conversation_list.d.ts.map +1 -0
- package/build/components/group_conversation_list.js +48 -0
- package/build/components/group_conversation_list.js.map +1 -0
- package/build/components/index.d.ts +1 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +1 -0
- package/build/components/index.js.map +1 -1
- package/build/components/primitive/banner_primitive.d.ts +3 -0
- package/build/components/primitive/banner_primitive.d.ts.map +1 -1
- package/build/components/primitive/banner_primitive.js +4 -4
- package/build/components/primitive/banner_primitive.js.map +1 -1
- package/build/contexts/api_provider.d.ts +1 -1
- package/build/contexts/api_provider.d.ts.map +1 -1
- package/build/contexts/api_provider.js +3 -3
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts +4 -4
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +3 -3
- package/build/contexts/chat_context.js.map +1 -1
- package/build/contexts/conversations_context.js +1 -1
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/hooks/attachments/supported_extensions.d.ts +2 -0
- package/build/hooks/attachments/supported_extensions.d.ts.map +1 -0
- package/build/hooks/attachments/supported_extensions.js +48 -0
- package/build/hooks/attachments/supported_extensions.js.map +1 -0
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +235 -0
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -0
- package/build/hooks/groups/use_group_members_for_new_conversation.js +55 -0
- package/build/hooks/groups/use_group_members_for_new_conversation.js.map +1 -0
- package/build/hooks/groups/use_groups_conversation_create.d.ts +9 -0
- package/build/hooks/groups/use_groups_conversation_create.d.ts.map +1 -0
- package/build/hooks/groups/use_groups_conversation_create.js +36 -0
- package/build/hooks/groups/use_groups_conversation_create.js.map +1 -0
- package/build/hooks/index.d.ts +4 -0
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +4 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use_api.d.ts +43 -43
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js +5 -0
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_api_client.d.ts.map +1 -1
- package/build/hooks/use_api_client.js +5 -3
- package/build/hooks/use_api_client.js.map +1 -1
- package/build/hooks/use_attachment_uploader.d.ts +26 -0
- package/build/hooks/use_attachment_uploader.d.ts.map +1 -0
- package/build/hooks/use_attachment_uploader.js +111 -0
- package/build/hooks/use_attachment_uploader.js.map +1 -0
- package/build/hooks/use_chat_permissions.d.ts +14 -14
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +1 -0
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.js +10 -0
- package/build/hooks/use_conversations_actions.js.map +1 -1
- package/build/hooks/use_conversations_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversations_jolt_events.js +4 -1
- package/build/hooks/use_conversations_jolt_events.js.map +1 -1
- package/build/hooks/use_current_person.d.ts +15 -0
- package/build/hooks/use_current_person.d.ts.map +1 -1
- package/build/hooks/use_current_person.js +26 -9
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/hooks/use_groups.d.ts +26 -26
- package/build/hooks/use_groups_groups.d.ts +26 -26
- package/build/hooks/use_jolt.d.ts.map +1 -1
- package/build/hooks/use_jolt.js +15 -22
- package/build/hooks/use_jolt.js.map +1 -1
- package/build/hooks/use_message_create.js +2 -2
- package/build/hooks/use_message_create.js.map +1 -1
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +5 -0
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/hooks/use_teams.d.ts +26 -26
- package/build/hooks/use_upload_client.d.ts +28 -0
- package/build/hooks/use_upload_client.d.ts.map +1 -0
- package/build/hooks/use_upload_client.js +32 -0
- package/build/hooks/use_upload_client.js.map +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -2
- package/build/index.js.map +1 -1
- package/build/navigation/index.d.ts +52 -34
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +16 -2
- package/build/navigation/index.js.map +1 -1
- package/build/screens/conversation_details_screen.js +2 -2
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +10 -0
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js +74 -0
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -0
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts +10 -0
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/components/header_row.js +69 -0
- package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -0
- package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts +5 -0
- package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/components/navigation_header.js +46 -0
- package/build/screens/conversation_filter_recipients/components/navigation_header.js.map +1 -0
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts +17 -0
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js +37 -0
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js.map +1 -0
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +1 -3
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +67 -32
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts +10 -0
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js +32 -0
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js.map +1 -0
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts +8 -0
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js +65 -0
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js.map +1 -0
- package/build/screens/conversation_filter_recipients/types.d.ts +38 -0
- package/build/screens/conversation_filter_recipients/types.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/types.js +6 -0
- package/build/screens/conversation_filter_recipients/types.js.map +1 -0
- package/build/screens/conversation_filters/components/conversation_filters.js +5 -2
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +6 -1
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/group_filters.js +12 -4
- package/build/screens/conversation_filters/group_filters.js.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.d.ts +40 -40
- package/build/screens/conversation_filters/hooks/filters.js +1 -1
- package/build/screens/conversation_filters/hooks/filters.js.map +1 -1
- package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/team_filters.js +12 -4
- package/build/screens/conversation_filters/team_filters.js.map +1 -1
- package/build/screens/conversation_filters_screen.js +1 -0
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts +4 -2
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +40 -55
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/team_form.d.ts +1 -1
- package/build/screens/conversation_new/components/team_form.js.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts +5 -2
- package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.js +2 -2
- package/build/screens/conversation_new/conversation_new_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +7 -0
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +103 -4
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.d.ts +2 -0
- package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.js +17 -0
- package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.js.map +1 -0
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts +12 -0
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js +61 -0
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js.map +1 -0
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts +7 -0
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js +21 -0
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js.map +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts +4 -0
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +48 -0
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts +2 -6
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +37 -49
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts +9 -0
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/types/screen_props.js +2 -0
- package/build/screens/conversation_select_recipients/types/screen_props.js.map +1 -0
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +18 -4
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +2 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +32 -1
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.js +29 -1
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/build/types/resources/groups/groups_group_resource.d.ts +1 -1
- package/build/types/resources/groups/groups_group_resource.js.map +1 -1
- package/build/types/resources/groups/groups_member_resource_with_person.d.ts +14 -0
- package/build/types/resources/groups/groups_member_resource_with_person.d.ts.map +1 -0
- package/build/types/resources/groups/groups_member_resource_with_person.js +2 -0
- package/build/types/resources/groups/groups_member_resource_with_person.js.map +1 -0
- package/build/types/resources/member.d.ts +0 -10
- package/build/types/resources/member.d.ts.map +1 -1
- package/build/types/resources/member.js.map +1 -1
- package/build/types/resources/message.d.ts +2 -0
- package/build/types/resources/message.d.ts.map +1 -1
- package/build/types/resources/message.js.map +1 -1
- package/build/types/resources/oauth_token.d.ts +4 -4
- package/build/types/resources/oauth_token.d.ts.map +1 -1
- package/build/types/resources/oauth_token.js.map +1 -1
- package/build/utils/client/client.d.ts +4 -8
- package/build/utils/client/client.d.ts.map +1 -1
- package/build/utils/client/client.js +10 -9
- package/build/utils/client/client.js.map +1 -1
- package/build/utils/date.d.ts +5 -0
- package/build/utils/date.d.ts.map +1 -1
- package/build/utils/date.js +8 -1
- package/build/utils/date.js.map +1 -1
- package/build/utils/destructure_chat_group_graph_id.d.ts +10 -0
- package/build/utils/destructure_chat_group_graph_id.d.ts.map +1 -0
- package/build/utils/destructure_chat_group_graph_id.js +8 -0
- package/build/utils/destructure_chat_group_graph_id.js.map +1 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +1 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/native_adapters/configuration.d.ts +4 -1
- package/build/utils/native_adapters/configuration.d.ts.map +1 -1
- package/build/utils/native_adapters/configuration.js +13 -1
- package/build/utils/native_adapters/configuration.js.map +1 -1
- package/build/utils/native_adapters/image_picker.d.ts +25 -0
- package/build/utils/native_adapters/image_picker.d.ts.map +1 -0
- package/build/utils/native_adapters/image_picker.js +9 -0
- package/build/utils/native_adapters/image_picker.js.map +1 -0
- package/build/utils/native_adapters/index.d.ts +1 -0
- package/build/utils/native_adapters/index.d.ts.map +1 -1
- package/build/utils/native_adapters/index.js +1 -0
- package/build/utils/native_adapters/index.js.map +1 -1
- package/build/utils/session.d.ts +6 -2
- package/build/utils/session.d.ts.map +1 -1
- package/build/utils/session.js +6 -1
- package/build/utils/session.js.map +1 -1
- package/build/utils/upload_uri.d.ts +23 -0
- package/build/utils/upload_uri.d.ts.map +1 -0
- package/build/utils/upload_uri.js +60 -0
- package/build/utils/upload_uri.js.map +1 -0
- package/build/utils/uri.d.ts +10 -2
- package/build/utils/uri.d.ts.map +1 -1
- package/build/utils/uri.js +24 -6
- package/build/utils/uri.js.map +1 -1
- package/build/vendor/tapestry/alias_tokens_color_map.d.ts +2 -0
- package/build/vendor/tapestry/alias_tokens_color_map.d.ts.map +1 -1
- package/build/vendor/tapestry/alias_tokens_color_map.js +2 -0
- package/build/vendor/tapestry/alias_tokens_color_map.js.map +1 -1
- package/package.json +4 -3
- package/src/__tests__/hooks/useTheme.tsx +1 -1
- package/src/__tests__/{client.ts → utils/client.ts} +7 -115
- package/src/__tests__/{session.ts → utils/session.ts} +4 -4
- package/src/__tests__/utils/uri.ts +107 -0
- package/src/components/conversation/message_form/message_form_attachment_image.tsx +121 -0
- package/src/components/conversation/message_form.tsx +197 -31
- package/src/components/conversations/conversation_actions.tsx +2 -2
- package/src/components/conversations/conversation_preview.tsx +8 -2
- package/src/components/display/action_button.tsx +4 -3
- package/src/components/display/banner.tsx +7 -1
- package/src/components/display/banner_collapsible.tsx +6 -1
- package/src/components/display/child_notice.tsx +9 -3
- package/src/components/group_conversation_list.tsx +82 -0
- package/src/components/index.tsx +1 -0
- package/src/components/primitive/banner_primitive.tsx +12 -5
- package/src/contexts/api_provider.tsx +3 -3
- package/src/contexts/chat_context.tsx +7 -7
- package/src/contexts/conversations_context.tsx +1 -1
- package/src/hooks/attachments/supported_extensions.ts +47 -0
- package/src/hooks/groups/use_group_members_for_new_conversation.ts +74 -0
- package/src/hooks/groups/use_groups_conversation_create.ts +50 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/use_api.ts +13 -7
- package/src/hooks/use_api_client.ts +7 -3
- package/src/hooks/use_attachment_uploader.ts +179 -0
- package/src/hooks/use_conversation.ts +1 -0
- package/src/hooks/use_conversations_actions.ts +11 -0
- package/src/hooks/use_conversations_jolt_events.ts +5 -1
- package/src/hooks/use_current_person.ts +37 -9
- package/src/hooks/use_jolt.ts +18 -23
- package/src/hooks/use_message_create.ts +2 -2
- package/src/hooks/use_suspense_api.ts +6 -0
- package/src/hooks/use_upload_client.ts +67 -0
- package/src/index.tsx +3 -1
- package/src/navigation/index.tsx +23 -2
- package/src/screens/conversation_details_screen.tsx +2 -2
- package/src/screens/conversation_filter_recipients/components/checkbox_row.tsx +101 -0
- package/src/screens/conversation_filter_recipients/components/header_row.tsx +99 -0
- package/src/screens/conversation_filter_recipients/components/navigation_header.tsx +68 -0
- package/src/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.tsx +53 -0
- package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +90 -49
- package/src/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.tsx +50 -0
- package/src/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.ts +90 -0
- package/src/screens/conversation_filter_recipients/types.tsx +47 -0
- package/src/screens/conversation_filters/components/conversation_filters.tsx +5 -2
- package/src/screens/conversation_filters/components/rows.tsx +6 -1
- package/src/screens/conversation_filters/group_filters.tsx +23 -14
- package/src/screens/conversation_filters/hooks/filters.ts +1 -1
- package/src/screens/conversation_filters/team_filters.tsx +23 -14
- package/src/screens/conversation_filters_screen.tsx +1 -0
- package/src/screens/conversation_new/components/groups_form.tsx +66 -72
- package/src/screens/conversation_new/components/team_form.tsx +1 -1
- package/src/screens/conversation_new/conversation_new_screen.tsx +11 -4
- package/src/screens/conversation_screen.tsx +123 -4
- package/src/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.tsx +21 -0
- package/src/screens/conversation_select_recipients/components/recipient_link_row.tsx +91 -0
- package/src/screens/conversation_select_recipients/components/view_more_link_row.tsx +30 -0
- package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +79 -0
- package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +57 -65
- package/src/screens/conversation_select_recipients/types/screen_props.tsx +11 -0
- package/src/screens/conversations/components/list_header_component.tsx +20 -4
- package/src/screens/conversations/conversations_screen.tsx +37 -2
- package/src/screens/send_giphy_screen.tsx +30 -1
- package/src/types/resources/groups/groups_group_resource.ts +1 -1
- package/src/types/resources/groups/groups_member_resource_with_person.ts +13 -0
- package/src/types/resources/member.ts +0 -11
- package/src/types/resources/message.ts +2 -0
- package/src/types/resources/oauth_token.ts +4 -4
- package/src/utils/client/client.ts +13 -13
- package/src/utils/date.ts +11 -1
- package/src/utils/destructure_chat_group_graph_id.ts +25 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/native_adapters/configuration.ts +15 -1
- package/src/utils/native_adapters/image_picker.ts +31 -0
- package/src/utils/native_adapters/index.ts +1 -0
- package/src/utils/session.ts +10 -4
- package/src/utils/upload_uri.ts +69 -0
- package/src/utils/uri.ts +30 -6
- package/src/vendor/tapestry/alias_tokens_color_map.ts +3 -0
- package/build/screens/conversation_new/components/member_error_card.d.ts +0 -5
- package/build/screens/conversation_new/components/member_error_card.d.ts.map +0 -1
- package/build/screens/conversation_new/components/member_error_card.js +0 -17
- package/build/screens/conversation_new/components/member_error_card.js.map +0 -1
- package/build/screens/conversation_new/utils/fake_member_data.d.ts +0 -3
- package/build/screens/conversation_new/utils/fake_member_data.d.ts.map +0 -1
- package/build/screens/conversation_new/utils/fake_member_data.js +0 -129
- package/build/screens/conversation_new/utils/fake_member_data.js.map +0 -1
- package/src/screens/conversation_new/components/member_error_card.tsx +0 -20
- package/src/screens/conversation_new/utils/fake_member_data.ts +0 -130
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import MockServer from '
|
|
2
|
-
import Client from '
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { ApiError, OAuthToken } from '../types'
|
|
1
|
+
import MockServer from '../../__utils__/server'
|
|
2
|
+
import Client from '../../utils/client/client'
|
|
3
|
+
import DefaultFixtures from '../../__utils__/fixtures/defaults'
|
|
4
|
+
import { BASE_URL } from '../../__utils__/handlers'
|
|
5
|
+
import { ApiError } from '../../types'
|
|
7
6
|
|
|
8
7
|
const APP_BASE_URL = BASE_URL
|
|
9
|
-
|
|
10
|
-
let session: Session
|
|
11
8
|
let client: Client
|
|
12
9
|
let clientWithDefaultHeaders: Client
|
|
13
10
|
let fetchSpy: jest.SpyInstance
|
|
@@ -21,20 +18,17 @@ const onUnauthorizedResponse = jest.fn()
|
|
|
21
18
|
beforeEach(() => {
|
|
22
19
|
jest.clearAllMocks()
|
|
23
20
|
fetchSpy = jest.spyOn(globalThis, 'fetch')
|
|
24
|
-
session = new Session({ env: 'development' })
|
|
25
21
|
client = new Client({
|
|
26
|
-
app: 'chat',
|
|
27
22
|
version: '2018-11-01',
|
|
28
|
-
|
|
23
|
+
root: APP_BASE_URL,
|
|
29
24
|
onUnauthorizedResponse,
|
|
30
25
|
})
|
|
31
26
|
clientWithDefaultHeaders = new Client({
|
|
32
|
-
app: 'chat',
|
|
33
27
|
version: '2018-11-01',
|
|
28
|
+
root: APP_BASE_URL,
|
|
34
29
|
defaultHeaders: {
|
|
35
30
|
'X-Custom-Default-Header': 'important data',
|
|
36
31
|
},
|
|
37
|
-
session,
|
|
38
32
|
onUnauthorizedResponse,
|
|
39
33
|
})
|
|
40
34
|
})
|
|
@@ -345,96 +339,6 @@ describe('delete', () => {
|
|
|
345
339
|
})
|
|
346
340
|
})
|
|
347
341
|
|
|
348
|
-
describe('url switching', () => {
|
|
349
|
-
it('Changes to session switches the base url', async () => {
|
|
350
|
-
const devBase = 'http://api.pco.test/chat/v2'
|
|
351
|
-
const prodBase = 'https://api.planningcenteronline.com/chat/v2'
|
|
352
|
-
const stagingBase = 'https://api-staging.planningcenteronline.com/chat/v2'
|
|
353
|
-
|
|
354
|
-
MockServer.get(prodBase + '/records', {}, 200, { once: true })
|
|
355
|
-
MockServer.get(stagingBase + '/records', {}, 200, { once: true })
|
|
356
|
-
|
|
357
|
-
const newClient = new Client({
|
|
358
|
-
app: 'chat',
|
|
359
|
-
session,
|
|
360
|
-
version: '2018-11-01',
|
|
361
|
-
onUnauthorizedResponse: () => {},
|
|
362
|
-
})
|
|
363
|
-
|
|
364
|
-
await newClient.get({
|
|
365
|
-
url: '/records',
|
|
366
|
-
data: { fields: { Record: ['id'] } },
|
|
367
|
-
})
|
|
368
|
-
|
|
369
|
-
expect(fetchSpy).toHaveBeenCalledWith(
|
|
370
|
-
devBase + '/records?fields[Record]=id&per_page=100',
|
|
371
|
-
expect.any(Object)
|
|
372
|
-
)
|
|
373
|
-
|
|
374
|
-
session.env = 'staging'
|
|
375
|
-
|
|
376
|
-
await newClient.get({
|
|
377
|
-
url: '/records',
|
|
378
|
-
data: { fields: { Record: ['id'] } },
|
|
379
|
-
})
|
|
380
|
-
|
|
381
|
-
expect(fetchSpy).toHaveBeenLastCalledWith(
|
|
382
|
-
'https://api-staging.planningcenteronline.com/chat/v2' +
|
|
383
|
-
'/records?fields[Record]=id&per_page=100',
|
|
384
|
-
expect.any(Object)
|
|
385
|
-
)
|
|
386
|
-
|
|
387
|
-
session.env = 'production'
|
|
388
|
-
|
|
389
|
-
await newClient.get({
|
|
390
|
-
url: '/records',
|
|
391
|
-
data: { fields: { Record: ['id'] } },
|
|
392
|
-
})
|
|
393
|
-
|
|
394
|
-
expect(fetchSpy).toHaveBeenLastCalledWith(
|
|
395
|
-
'https://api.planningcenteronline.com/chat/v2' + '/records?fields[Record]=id&per_page=100',
|
|
396
|
-
expect.any(Object)
|
|
397
|
-
)
|
|
398
|
-
})
|
|
399
|
-
|
|
400
|
-
it('Changes to session switches the base url with custom headers', async () => {
|
|
401
|
-
const token: OAuthToken = {
|
|
402
|
-
access_token: 'foo',
|
|
403
|
-
token_type: undefined,
|
|
404
|
-
created_at: 0,
|
|
405
|
-
expires_in: undefined,
|
|
406
|
-
scope: '',
|
|
407
|
-
refresh_token: undefined,
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
session.token = token
|
|
411
|
-
|
|
412
|
-
await client.get({
|
|
413
|
-
url: '/records',
|
|
414
|
-
data: { fields: { Record: ['id'] } },
|
|
415
|
-
})
|
|
416
|
-
|
|
417
|
-
requestHeadersShouldContain({
|
|
418
|
-
...fetchSpy.mock.calls[0][1],
|
|
419
|
-
key: 'Authorization',
|
|
420
|
-
value: 'foo',
|
|
421
|
-
})
|
|
422
|
-
|
|
423
|
-
session.token.access_token = 'bar'
|
|
424
|
-
|
|
425
|
-
await client.get({
|
|
426
|
-
url: '/records',
|
|
427
|
-
data: { fields: { Record: ['id'] } },
|
|
428
|
-
})
|
|
429
|
-
|
|
430
|
-
requestHeadersShouldContain({
|
|
431
|
-
...fetchSpy.mock.calls[1][1],
|
|
432
|
-
key: 'Authorization',
|
|
433
|
-
value: 'bar',
|
|
434
|
-
})
|
|
435
|
-
})
|
|
436
|
-
})
|
|
437
|
-
|
|
438
342
|
describe('error handling', () => {
|
|
439
343
|
describe('401 errors', () => {
|
|
440
344
|
it('defaults', async () => {
|
|
@@ -466,15 +370,3 @@ describe('error handling', () => {
|
|
|
466
370
|
}
|
|
467
371
|
})
|
|
468
372
|
})
|
|
469
|
-
|
|
470
|
-
const requestHeadersShouldContain = ({
|
|
471
|
-
headers,
|
|
472
|
-
key,
|
|
473
|
-
value,
|
|
474
|
-
}: {
|
|
475
|
-
headers: Record<string, unknown>
|
|
476
|
-
key: string
|
|
477
|
-
value: unknown
|
|
478
|
-
}) => {
|
|
479
|
-
expect(headers[key]).toContain(value)
|
|
480
|
-
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { OAuthToken } from '
|
|
2
|
-
import { Session } from '
|
|
1
|
+
import { OAuthToken } from '../../types'
|
|
2
|
+
import { Session } from '../../utils/session'
|
|
3
3
|
|
|
4
4
|
const token: OAuthToken = {
|
|
5
5
|
access_token: 'access_token',
|
|
6
6
|
refresh_token: 'refresh_token',
|
|
7
|
-
token_type: undefined,
|
|
7
|
+
token_type: 'undefined',
|
|
8
8
|
created_at: 0,
|
|
9
|
-
expires_in:
|
|
9
|
+
expires_in: 0,
|
|
10
10
|
scope: '',
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Uri } from '../../utils'
|
|
2
|
+
|
|
3
|
+
describe('URI', () => {
|
|
4
|
+
it('should be defined', () => {
|
|
5
|
+
expect(Uri).toBeDefined()
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
it('should create a new instance', () => {
|
|
9
|
+
const uri = new Uri({
|
|
10
|
+
session: {
|
|
11
|
+
env: 'production',
|
|
12
|
+
token: undefined,
|
|
13
|
+
type: 'OAuth',
|
|
14
|
+
isAuthenticated: false,
|
|
15
|
+
isChurchCenterToken: false,
|
|
16
|
+
},
|
|
17
|
+
})
|
|
18
|
+
expect(uri).toBeDefined()
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
describe('baseUrl', () => {
|
|
22
|
+
describe('planning center', () => {
|
|
23
|
+
it('should return the correct base URL for production', () => {
|
|
24
|
+
const uri = new Uri({
|
|
25
|
+
session: {
|
|
26
|
+
env: 'production',
|
|
27
|
+
token: undefined,
|
|
28
|
+
type: 'OAuth',
|
|
29
|
+
isAuthenticated: false,
|
|
30
|
+
isChurchCenterToken: false,
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
expect(uri.baseUrl).toBe('https://api.planningcenteronline.com')
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('should return the correct base URL for staging', () => {
|
|
37
|
+
const uri = new Uri({
|
|
38
|
+
session: {
|
|
39
|
+
env: 'staging',
|
|
40
|
+
token: undefined,
|
|
41
|
+
type: 'OAuth',
|
|
42
|
+
isAuthenticated: false,
|
|
43
|
+
isChurchCenterToken: false,
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
expect(uri.baseUrl).toBe('https://api-staging.planningcenteronline.com')
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('should return the correct base URL for development', () => {
|
|
50
|
+
const uri = new Uri({
|
|
51
|
+
session: {
|
|
52
|
+
env: 'development',
|
|
53
|
+
token: undefined,
|
|
54
|
+
type: 'OAuth',
|
|
55
|
+
isAuthenticated: false,
|
|
56
|
+
isChurchCenterToken: false,
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
expect(uri.baseUrl).toBe('http://api.pco.test')
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
describe('church center', () => {
|
|
64
|
+
it('should return the correct base URL for production', () => {
|
|
65
|
+
const uri = new Uri({
|
|
66
|
+
session: {
|
|
67
|
+
env: 'production',
|
|
68
|
+
token: undefined,
|
|
69
|
+
type: 'ChurchCenterOauth',
|
|
70
|
+
isAuthenticated: false,
|
|
71
|
+
isChurchCenterToken: true,
|
|
72
|
+
},
|
|
73
|
+
graph: 'churchcenter',
|
|
74
|
+
})
|
|
75
|
+
expect(uri.baseUrl).toBe('https://api.churchcenter.com')
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('should return the correct base URL for staging', () => {
|
|
79
|
+
const uri = new Uri({
|
|
80
|
+
session: {
|
|
81
|
+
env: 'staging',
|
|
82
|
+
token: undefined,
|
|
83
|
+
type: 'ChurchCenterOauth',
|
|
84
|
+
isAuthenticated: false,
|
|
85
|
+
isChurchCenterToken: true,
|
|
86
|
+
},
|
|
87
|
+
graph: 'churchcenter',
|
|
88
|
+
})
|
|
89
|
+
expect(uri.baseUrl).toBe('https://api.staging.churchcenter.com')
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it('should return the correct base URL for development', () => {
|
|
93
|
+
const uri = new Uri({
|
|
94
|
+
session: {
|
|
95
|
+
env: 'development',
|
|
96
|
+
token: undefined,
|
|
97
|
+
type: 'ChurchCenterOauth',
|
|
98
|
+
isAuthenticated: false,
|
|
99
|
+
isChurchCenterToken: true,
|
|
100
|
+
},
|
|
101
|
+
graph: 'churchcenter',
|
|
102
|
+
})
|
|
103
|
+
expect(uri.baseUrl).toBe('http://api.churchcenter.test')
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
})
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {
|
|
3
|
+
AnimatableNumericValue,
|
|
4
|
+
DimensionValue,
|
|
5
|
+
Image as ReactNativeImage,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
View,
|
|
8
|
+
} from 'react-native'
|
|
9
|
+
import { FileAttachment } from '../../../hooks/use_attachment_uploader'
|
|
10
|
+
import { useTheme } from '../../../hooks'
|
|
11
|
+
import { Icon, IconButton, Spinner } from '../../display'
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
uri: string
|
|
15
|
+
alt: string
|
|
16
|
+
status: FileAttachment['status']
|
|
17
|
+
width?: number
|
|
18
|
+
height?: number
|
|
19
|
+
removeAttachment: () => void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function MessageFormAttachmentImage({ uri, alt, status, removeAttachment }: Props) {
|
|
23
|
+
function opacity() {
|
|
24
|
+
if (status === 'uploading') {
|
|
25
|
+
return 0.5
|
|
26
|
+
}
|
|
27
|
+
return 1
|
|
28
|
+
}
|
|
29
|
+
const styles = useStyles({
|
|
30
|
+
width: 50,
|
|
31
|
+
height: 50,
|
|
32
|
+
borderRadius: 8,
|
|
33
|
+
})
|
|
34
|
+
const loading = status === 'uploading'
|
|
35
|
+
const error = status === 'error'
|
|
36
|
+
const ready = status === 'success'
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<View
|
|
40
|
+
accessible={Boolean(alt)}
|
|
41
|
+
accessibilityRole="image"
|
|
42
|
+
accessibilityState={{ busy: loading }}
|
|
43
|
+
>
|
|
44
|
+
<ReactNativeImage source={{ uri }} style={[styles.image, { opacity: opacity() }]} alt={alt} />
|
|
45
|
+
{ready && (
|
|
46
|
+
<IconButton
|
|
47
|
+
name="general.x"
|
|
48
|
+
accessibilityLabel="Remove Attachment"
|
|
49
|
+
size="md"
|
|
50
|
+
style={styles.removeAttachmentIcon}
|
|
51
|
+
onPress={removeAttachment}
|
|
52
|
+
/>
|
|
53
|
+
)}
|
|
54
|
+
{loading && (
|
|
55
|
+
<View style={[styles.loadingBackground]}>
|
|
56
|
+
<Spinner size={24} />
|
|
57
|
+
</View>
|
|
58
|
+
)}
|
|
59
|
+
{error && (
|
|
60
|
+
<View style={styles.errorBackground}>
|
|
61
|
+
<View style={styles.errorIconBackground}>
|
|
62
|
+
<Icon name="churchCenter.exclamationCircle" size={18} color="red" />
|
|
63
|
+
</View>
|
|
64
|
+
</View>
|
|
65
|
+
)}
|
|
66
|
+
</View>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface Styles {
|
|
71
|
+
width: DimensionValue
|
|
72
|
+
height: DimensionValue
|
|
73
|
+
borderRadius: AnimatableNumericValue | string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const useStyles = ({ width, height, borderRadius }: Styles) => {
|
|
77
|
+
const { colors } = useTheme()
|
|
78
|
+
|
|
79
|
+
return StyleSheet.create({
|
|
80
|
+
image: {
|
|
81
|
+
backgroundColor: colors.fillColorNeutral070,
|
|
82
|
+
width,
|
|
83
|
+
height,
|
|
84
|
+
borderRadius,
|
|
85
|
+
},
|
|
86
|
+
removeAttachmentIcon: {
|
|
87
|
+
position: 'absolute',
|
|
88
|
+
top: 4,
|
|
89
|
+
right: 4,
|
|
90
|
+
backgroundColor: 'rgba(255, 255, 255, 0.5)',
|
|
91
|
+
borderRadius: 24,
|
|
92
|
+
width: 24,
|
|
93
|
+
height: 24,
|
|
94
|
+
justifyContent: 'center',
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
},
|
|
97
|
+
loadingBackground: {
|
|
98
|
+
position: 'absolute',
|
|
99
|
+
top: 0,
|
|
100
|
+
left: 0,
|
|
101
|
+
borderRadius,
|
|
102
|
+
width,
|
|
103
|
+
height,
|
|
104
|
+
},
|
|
105
|
+
errorBackground: {
|
|
106
|
+
position: 'absolute',
|
|
107
|
+
top: 0,
|
|
108
|
+
left: 0,
|
|
109
|
+
borderRadius,
|
|
110
|
+
width,
|
|
111
|
+
height,
|
|
112
|
+
justifyContent: 'center',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
},
|
|
115
|
+
errorIconBackground: {
|
|
116
|
+
backgroundColor: 'white',
|
|
117
|
+
padding: 2,
|
|
118
|
+
borderRadius: 50,
|
|
119
|
+
},
|
|
120
|
+
})
|
|
121
|
+
}
|