@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.
- 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/display/person.d.ts +3 -1
- package/build/components/display/person.d.ts.map +1 -1
- package/build/components/display/person.js +2 -2
- package/build/components/display/person.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/form_list.d.ts +12 -0
- package/build/screens/conversation_new/components/form_list.d.ts.map +1 -0
- package/build/screens/conversation_new/components/form_list.js +42 -0
- package/build/screens/conversation_new/components/form_list.js.map +1 -0
- 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 +82 -90
- 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/display/person.tsx +4 -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/form_list.tsx +67 -0
- package/src/screens/conversation_new/components/groups_form.tsx +133 -107
- 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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useMemo } from 'react'
|
|
2
|
+
import { type ViewStyle } from 'react-native'
|
|
3
|
+
import { SectionTypes, type SectionListData, type ServiceTypeWithTeams } from '../types'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
data: ServiceTypeWithTeams[]
|
|
7
|
+
firstRowStyle: ViewStyle
|
|
8
|
+
lastRowStyle: ViewStyle
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function useFlattenedArrayOfServiceTypesWithTeams({
|
|
12
|
+
data,
|
|
13
|
+
firstRowStyle,
|
|
14
|
+
lastRowStyle,
|
|
15
|
+
}: Props) {
|
|
16
|
+
const flattenedData: SectionListData = useMemo(
|
|
17
|
+
() =>
|
|
18
|
+
data.flatMap(serviceType => {
|
|
19
|
+
const teamIdsForServiceType = serviceType.teams.map(team => team.id)
|
|
20
|
+
|
|
21
|
+
return [
|
|
22
|
+
{
|
|
23
|
+
type: SectionTypes.header as const,
|
|
24
|
+
data: {
|
|
25
|
+
serviceTypeName: serviceType.name,
|
|
26
|
+
serviceTypeId: serviceType.id,
|
|
27
|
+
teamIdsForServiceType,
|
|
28
|
+
},
|
|
29
|
+
sectionStyle: firstRowStyle,
|
|
30
|
+
},
|
|
31
|
+
...serviceType.teams.map((team, teamIdx) => {
|
|
32
|
+
const isLastTeamInServiceType = teamIdx === serviceType.teams.length - 1
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
type: SectionTypes.team as const,
|
|
36
|
+
data: {
|
|
37
|
+
teamName: team.name,
|
|
38
|
+
teamId: team.id,
|
|
39
|
+
serviceTypeId: serviceType.id,
|
|
40
|
+
},
|
|
41
|
+
sectionStyle: isLastTeamInServiceType ? lastRowStyle : undefined,
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
]
|
|
45
|
+
}),
|
|
46
|
+
[data, firstRowStyle, lastRowStyle]
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
return flattenedData
|
|
50
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useCallback, useMemo } from 'react'
|
|
2
|
+
import { useApiGet } from '../../../hooks/use_api'
|
|
3
|
+
import { ResourceObject } from '../../../types'
|
|
4
|
+
import { ServiceTypeWithTeams } from '../types'
|
|
5
|
+
import { uniqBy } from 'lodash'
|
|
6
|
+
|
|
7
|
+
export function useServiceTypesWithTeams() {
|
|
8
|
+
const response = useApiGet<ServicesChatResource>({
|
|
9
|
+
url: `/chat`,
|
|
10
|
+
data: {
|
|
11
|
+
fields: {
|
|
12
|
+
Chat: ['teams_i_lead'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
app: 'services',
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const { data, isFetching, isError, error } = response
|
|
19
|
+
|
|
20
|
+
const teamsILead = data?.teamsILead || stableEmptyTeamResponseArray
|
|
21
|
+
|
|
22
|
+
const decoratedResponse = useMemo(() => {
|
|
23
|
+
return decorateTeamResponseItems(teamsILead)
|
|
24
|
+
}, [teamsILead])
|
|
25
|
+
|
|
26
|
+
const hasNoServicesAccess = useCallback(() => {
|
|
27
|
+
if (isError && error) {
|
|
28
|
+
const errorArray = error
|
|
29
|
+
const allErrors = errorArray.errors.map(e => e.detail)
|
|
30
|
+
if (allErrors.some(e => e.includes(NOT_IN_APPLICATION_CODE))) {
|
|
31
|
+
return true
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return false
|
|
35
|
+
}, [isError, error])
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
serviceTypes: decoratedResponse,
|
|
39
|
+
isFetching,
|
|
40
|
+
isError,
|
|
41
|
+
noServicesAccess: hasNoServicesAccess(),
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function decorateTeamResponseItems(teamResponseItems: TeamResponseItem[]) {
|
|
46
|
+
return teamResponseItems
|
|
47
|
+
.map(({ value, serviceTypeName, teamName }) => ({
|
|
48
|
+
service_type: {
|
|
49
|
+
id: value.serviceTypeId,
|
|
50
|
+
name: serviceTypeName,
|
|
51
|
+
},
|
|
52
|
+
team: {
|
|
53
|
+
id: value.teamId,
|
|
54
|
+
name: teamName,
|
|
55
|
+
},
|
|
56
|
+
}))
|
|
57
|
+
.reduce((acc: ServiceTypeWithTeams[], { service_type, team }) => {
|
|
58
|
+
let serviceTypeEntry = acc.find(entry => entry.id === service_type.id)
|
|
59
|
+
|
|
60
|
+
if (!serviceTypeEntry) {
|
|
61
|
+
serviceTypeEntry = {
|
|
62
|
+
id: service_type.id,
|
|
63
|
+
name: service_type.name,
|
|
64
|
+
teams: [],
|
|
65
|
+
}
|
|
66
|
+
acc.push(serviceTypeEntry)
|
|
67
|
+
}
|
|
68
|
+
const initialTeams = serviceTypeEntry.teams
|
|
69
|
+
serviceTypeEntry.teams = uniqBy([...initialTeams, team], 'id')
|
|
70
|
+
return acc
|
|
71
|
+
}, [])
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface TeamResponseItem {
|
|
75
|
+
value: {
|
|
76
|
+
teamId: number
|
|
77
|
+
serviceTypeId: number
|
|
78
|
+
}
|
|
79
|
+
name: string
|
|
80
|
+
teamName: string
|
|
81
|
+
serviceTypeName: string
|
|
82
|
+
order: string[]
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface ServicesChatResource extends ResourceObject {
|
|
86
|
+
teamsILead: TeamResponseItem[]
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const stableEmptyTeamResponseArray: TeamResponseItem[] = []
|
|
90
|
+
const NOT_IN_APPLICATION_CODE = 'TRASH_PANDA'
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ViewStyle } from 'react-native'
|
|
2
|
+
import { AppName } from '../../types/resources/app_name'
|
|
3
|
+
import { StaticScreenProps } from '@react-navigation/native'
|
|
4
|
+
|
|
5
|
+
export interface ServiceTypeWithTeams {
|
|
6
|
+
id: number
|
|
7
|
+
name: string
|
|
8
|
+
teams: {
|
|
9
|
+
id: number
|
|
10
|
+
name: string
|
|
11
|
+
}[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export enum SectionTypes {
|
|
15
|
+
header,
|
|
16
|
+
team,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ServiceTypeProps {
|
|
20
|
+
serviceTypeName: string
|
|
21
|
+
serviceTypeId: number
|
|
22
|
+
teamIdsForServiceType: number[]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface TeamProps {
|
|
26
|
+
teamName: string
|
|
27
|
+
teamId: number
|
|
28
|
+
serviceTypeId: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type SectionListData = Array<
|
|
32
|
+
DataItem<ServiceTypeProps, SectionTypes.header> | DataItem<TeamProps, SectionTypes.team>
|
|
33
|
+
>
|
|
34
|
+
|
|
35
|
+
interface DataItem<T, TName extends SectionTypes> {
|
|
36
|
+
type: TName
|
|
37
|
+
data: T
|
|
38
|
+
sectionStyle?: ViewStyle
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type ConversationFilterRecipientsParams = {
|
|
42
|
+
source_app_name?: AppName
|
|
43
|
+
team_ids?: number[]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ConversationFilterRecipientsScreenProps =
|
|
47
|
+
StaticScreenProps<ConversationFilterRecipientsParams>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react'
|
|
2
|
-
import { FlatList, StyleSheet, View, ViewStyle } from 'react-native'
|
|
2
|
+
import { FlatList, Platform, StyleSheet, View, ViewStyle } from 'react-native'
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
4
4
|
import { Heading } from '../../../components'
|
|
5
5
|
import { useTheme } from '../../../hooks'
|
|
@@ -169,7 +169,10 @@ const useStyles = () => {
|
|
|
169
169
|
|
|
170
170
|
return StyleSheet.create({
|
|
171
171
|
flatlistContainer: {
|
|
172
|
-
paddingBottom:
|
|
172
|
+
paddingBottom: Platform.select({
|
|
173
|
+
ios: 64 + bottom,
|
|
174
|
+
android: 16 + bottom,
|
|
175
|
+
}),
|
|
173
176
|
},
|
|
174
177
|
section: {},
|
|
175
178
|
sectionHeader: {
|
|
@@ -121,7 +121,9 @@ export const ViewMore = ({ routeName }: ViewMoreRowProps) => {
|
|
|
121
121
|
|
|
122
122
|
return (
|
|
123
123
|
<View style={[styles.borderLessRow]}>
|
|
124
|
-
<TextButton onPress={() => navigation.navigate(routeName, {})}
|
|
124
|
+
<TextButton onPress={() => navigation.navigate(routeName, {})} style={styles.viewMoreButton}>
|
|
125
|
+
View more
|
|
126
|
+
</TextButton>
|
|
125
127
|
</View>
|
|
126
128
|
)
|
|
127
129
|
}
|
|
@@ -172,6 +174,9 @@ const useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {
|
|
|
172
174
|
paddingRight: 16,
|
|
173
175
|
paddingLeft: 16,
|
|
174
176
|
},
|
|
177
|
+
viewMoreButton: {
|
|
178
|
+
flex: 1,
|
|
179
|
+
},
|
|
175
180
|
row: {},
|
|
176
181
|
rowImage: {
|
|
177
182
|
width: THUMBNAIL_WIDTH,
|
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { FlatList, RefreshControl,
|
|
2
|
+
import { FlatList, RefreshControl, StyleSheet } from 'react-native'
|
|
3
3
|
import { Text } from '../../components/display'
|
|
4
4
|
import { ConversationFiltersParams } from './screen_props'
|
|
5
5
|
import { StaticScreenProps } from '@react-navigation/native'
|
|
6
6
|
import { useGroupsToFilter } from './hooks/filters'
|
|
7
7
|
import { GroupRow } from './components/rows'
|
|
8
8
|
import { useFilterContext } from './context/conversation_filter_context'
|
|
9
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
9
10
|
|
|
10
11
|
export type GroupFiltersScreenProps = StaticScreenProps<ConversationFiltersParams>
|
|
11
12
|
|
|
12
13
|
export const GroupFilters = () => {
|
|
14
|
+
const styles = useStyles()
|
|
13
15
|
const { groups, fetchNextPage, isRefetching, refetch } = useGroupsToFilter()
|
|
14
16
|
const { params } = useFilterContext()
|
|
15
17
|
const { chat_group_graph_id } = params
|
|
16
|
-
|
|
17
18
|
return (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</View>
|
|
19
|
+
<FlatList
|
|
20
|
+
data={groups}
|
|
21
|
+
renderItem={({ item }) => (
|
|
22
|
+
<GroupRow group={item} isActive={item?.id.toString() === chat_group_graph_id} />
|
|
23
|
+
)}
|
|
24
|
+
ListEmptyComponent={<Text>No groups available</Text>}
|
|
25
|
+
refreshing={isRefetching}
|
|
26
|
+
refreshControl={<RefreshControl refreshing={isRefetching} onRefresh={refetch} />}
|
|
27
|
+
onEndReached={() => fetchNextPage()}
|
|
28
|
+
contentContainerStyle={styles.container}
|
|
29
|
+
/>
|
|
30
30
|
)
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
const useStyles = () => {
|
|
34
|
+
const { bottom } = useSafeAreaInsets()
|
|
35
|
+
return StyleSheet.create({
|
|
36
|
+
container: {
|
|
37
|
+
paddingBottom: bottom + 12,
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
}
|
|
@@ -46,7 +46,7 @@ export const useGroupsToFilter = () => {
|
|
|
46
46
|
() =>
|
|
47
47
|
groups
|
|
48
48
|
.map(group => {
|
|
49
|
-
const groupsGroup = groupsData.find(g => group.id
|
|
49
|
+
const groupsGroup = groupsData.find(g => group.id === `Groups-Group-${g.id}`)
|
|
50
50
|
const { membershipsCount, headerImage } = groupsGroup || {}
|
|
51
51
|
|
|
52
52
|
return {
|
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { FlatList, RefreshControl,
|
|
3
|
+
import { FlatList, RefreshControl, StyleSheet } from 'react-native'
|
|
4
4
|
import { Text } from '../../components/display'
|
|
5
5
|
import { TeamRow } from './components/rows'
|
|
6
6
|
import { useFilterContext } from './context/conversation_filter_context'
|
|
7
7
|
import { useTeamsToFilter } from './hooks/filters'
|
|
8
8
|
import { ConversationFiltersParams } from './screen_props'
|
|
9
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
9
10
|
|
|
10
11
|
export type GroupFiltersScreenProps = StaticScreenProps<ConversationFiltersParams>
|
|
11
12
|
|
|
12
13
|
export const TeamFilters = () => {
|
|
14
|
+
const styles = useStyles()
|
|
13
15
|
const { teams, fetchNextPage, isRefetching, refetch } = useTeamsToFilter()
|
|
14
16
|
const { params } = useFilterContext()
|
|
15
17
|
const { chat_group_graph_id } = params
|
|
16
|
-
|
|
17
18
|
return (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</View>
|
|
19
|
+
<FlatList
|
|
20
|
+
data={teams}
|
|
21
|
+
renderItem={({ item }) => (
|
|
22
|
+
<TeamRow team={item} isActive={item?.id.toString() === chat_group_graph_id} />
|
|
23
|
+
)}
|
|
24
|
+
refreshing={isRefetching}
|
|
25
|
+
refreshControl={<RefreshControl refreshing={isRefetching} onRefresh={refetch} />}
|
|
26
|
+
ListEmptyComponent={<Text>No teams available</Text>}
|
|
27
|
+
onEndReached={() => fetchNextPage()}
|
|
28
|
+
contentContainerStyle={styles.container}
|
|
29
|
+
/>
|
|
30
30
|
)
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
const useStyles = () => {
|
|
34
|
+
const { bottom } = useSafeAreaInsets()
|
|
35
|
+
return StyleSheet.create({
|
|
36
|
+
container: {
|
|
37
|
+
paddingBottom: bottom + 12,
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { StyleSheet, View } from 'react-native'
|
|
3
|
+
import { FlashList, type FlashListProps } from '@shopify/flash-list'
|
|
4
|
+
import { MemberResource } from '../../../types'
|
|
5
|
+
import { Person, Text } from '../../../components/display'
|
|
6
|
+
import { useTheme } from '../../../hooks'
|
|
7
|
+
|
|
8
|
+
interface FormListProps {
|
|
9
|
+
memberData: MemberResource[]
|
|
10
|
+
FormContent?: FlashListProps<MemberResource>['ListHeaderComponent']
|
|
11
|
+
listEmptyText?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const FormList = ({ memberData, FormContent, listEmptyText }: FormListProps) => {
|
|
15
|
+
const styles = useStyles()
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<FlashList
|
|
19
|
+
data={memberData}
|
|
20
|
+
ListHeaderComponent={FormContent}
|
|
21
|
+
renderItem={({ item }) => <Person person={item} style={styles.person} />}
|
|
22
|
+
keyExtractor={item => item.id.toString()}
|
|
23
|
+
estimatedItemSize={45}
|
|
24
|
+
ListEmptyComponent={<ListEmptyText text={listEmptyText || 'No members found'} />}
|
|
25
|
+
/>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const ListEmptyText = ({ text }: { text: string }) => {
|
|
30
|
+
const styles = useStyles()
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<View style={styles.emptyTextContainer}>
|
|
34
|
+
<Text style={styles.emptyText}>{text}</Text>
|
|
35
|
+
</View>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Divider = () => {
|
|
40
|
+
const styles = useStyles()
|
|
41
|
+
|
|
42
|
+
return <View style={styles.divider} />
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const useStyles = () => {
|
|
46
|
+
const { colors } = useTheme()
|
|
47
|
+
|
|
48
|
+
return StyleSheet.create({
|
|
49
|
+
person: {
|
|
50
|
+
paddingHorizontal: 16,
|
|
51
|
+
paddingBottom: 12,
|
|
52
|
+
},
|
|
53
|
+
emptyTextContainer: {
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'center',
|
|
56
|
+
padding: 32,
|
|
57
|
+
},
|
|
58
|
+
emptyText: {
|
|
59
|
+
textAlign: 'center',
|
|
60
|
+
color: colors.textColorDefaultSecondary,
|
|
61
|
+
},
|
|
62
|
+
divider: {
|
|
63
|
+
borderBottomWidth: 1,
|
|
64
|
+
borderBottomColor: colors.fillColorNeutral050Base,
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
}
|