@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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const SUPPORTED_EXTENSIONS = [
|
|
2
|
+
'.3ga',
|
|
3
|
+
'.3gp',
|
|
4
|
+
'.aac',
|
|
5
|
+
'.amr',
|
|
6
|
+
'.avi',
|
|
7
|
+
'.bmp',
|
|
8
|
+
'.doc',
|
|
9
|
+
'.docx',
|
|
10
|
+
'.gif',
|
|
11
|
+
'.h263',
|
|
12
|
+
'.h264',
|
|
13
|
+
'.heic',
|
|
14
|
+
'.heif',
|
|
15
|
+
'.jpeg',
|
|
16
|
+
'.jpg',
|
|
17
|
+
'.key',
|
|
18
|
+
'.m4a',
|
|
19
|
+
'.m4b',
|
|
20
|
+
'.m4p',
|
|
21
|
+
'.m4r',
|
|
22
|
+
'.m4v',
|
|
23
|
+
'.mkv',
|
|
24
|
+
'.mov',
|
|
25
|
+
'.mp3',
|
|
26
|
+
'.mp4',
|
|
27
|
+
'.mp4-latm',
|
|
28
|
+
'.mpeg',
|
|
29
|
+
'.mpeg4',
|
|
30
|
+
'.mpg',
|
|
31
|
+
'.numbers',
|
|
32
|
+
'.ogg',
|
|
33
|
+
'.pages',
|
|
34
|
+
'.pdf',
|
|
35
|
+
'.png',
|
|
36
|
+
'.ppt',
|
|
37
|
+
'.pptx',
|
|
38
|
+
'.rtf',
|
|
39
|
+
'.txt',
|
|
40
|
+
'.vcf',
|
|
41
|
+
'.wav',
|
|
42
|
+
'.webm',
|
|
43
|
+
'.webp',
|
|
44
|
+
'.wmv',
|
|
45
|
+
'.xls',
|
|
46
|
+
'.xlsx',
|
|
47
|
+
];
|
|
48
|
+
//# sourceMappingURL=supported_extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supported_extensions.js","sourceRoot":"","sources":["../../../src/hooks/attachments/supported_extensions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,WAAW;IACX,OAAO;IACP,QAAQ;IACR,MAAM;IACN,UAAU;IACV,MAAM;IACN,QAAQ;IACR,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;CACR,CAAA","sourcesContent":["export const SUPPORTED_EXTENSIONS = [\n '.3ga',\n '.3gp',\n '.aac',\n '.amr',\n '.avi',\n '.bmp',\n '.doc',\n '.docx',\n '.gif',\n '.h263',\n '.h264',\n '.heic',\n '.heif',\n '.jpeg',\n '.jpg',\n '.key',\n '.m4a',\n '.m4b',\n '.m4p',\n '.m4r',\n '.m4v',\n '.mkv',\n '.mov',\n '.mp3',\n '.mp4',\n '.mp4-latm',\n '.mpeg',\n '.mpeg4',\n '.mpg',\n '.numbers',\n '.ogg',\n '.pages',\n '.pdf',\n '.png',\n '.ppt',\n '.pptx',\n '.rtf',\n '.txt',\n '.vcf',\n '.wav',\n '.webm',\n '.webp',\n '.wmv',\n '.xls',\n '.xlsx',\n]\n"]}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { MemberResource, ResourceObject } from '../../types';
|
|
2
|
+
import { GroupsGroupMemberResource } from '../../types/resources/groups/groups_member_resource_with_person';
|
|
3
|
+
import { useApiPaginator } from '../use_api';
|
|
4
|
+
type UseApiPaginatorResult<T extends ResourceObject> = ReturnType<typeof useApiPaginator<T>>;
|
|
5
|
+
export type GroupMembersForNewConversationResult = Omit<UseApiPaginatorResult<GroupsGroupMemberResource>, // We are passing our own "members" data shape
|
|
6
|
+
'data'> & {
|
|
7
|
+
data: MemberResource[];
|
|
8
|
+
adultMembers: MemberResource[];
|
|
9
|
+
childMembers: MemberResource[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* This is specifically for the new conversation screen because we assign
|
|
13
|
+
* the "Conversation owner" badge to the current person.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useGroupMembersForNewConversation({ id }: {
|
|
16
|
+
id: number;
|
|
17
|
+
}): {
|
|
18
|
+
data: MemberResource[];
|
|
19
|
+
adultMembers: MemberResource[];
|
|
20
|
+
childMembers: MemberResource[];
|
|
21
|
+
error: import("../../types").ApiError;
|
|
22
|
+
isError: true;
|
|
23
|
+
isPending: false;
|
|
24
|
+
isLoading: false;
|
|
25
|
+
isLoadingError: false;
|
|
26
|
+
isRefetchError: true;
|
|
27
|
+
isSuccess: false;
|
|
28
|
+
isPlaceholderData: false;
|
|
29
|
+
status: "error";
|
|
30
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
31
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
32
|
+
hasNextPage: boolean;
|
|
33
|
+
hasPreviousPage: boolean;
|
|
34
|
+
isFetchNextPageError: boolean;
|
|
35
|
+
isFetchingNextPage: boolean;
|
|
36
|
+
isFetchPreviousPageError: boolean;
|
|
37
|
+
isFetchingPreviousPage: boolean;
|
|
38
|
+
dataUpdatedAt: number;
|
|
39
|
+
errorUpdatedAt: number;
|
|
40
|
+
failureCount: number;
|
|
41
|
+
failureReason: import("../../types").ApiError | null;
|
|
42
|
+
errorUpdateCount: number;
|
|
43
|
+
isFetched: boolean;
|
|
44
|
+
isFetchedAfterMount: boolean;
|
|
45
|
+
isFetching: boolean;
|
|
46
|
+
isInitialLoading: boolean;
|
|
47
|
+
isPaused: boolean;
|
|
48
|
+
isRefetching: boolean;
|
|
49
|
+
isStale: boolean;
|
|
50
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
51
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
52
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>>;
|
|
53
|
+
} | {
|
|
54
|
+
data: MemberResource[];
|
|
55
|
+
adultMembers: MemberResource[];
|
|
56
|
+
childMembers: MemberResource[];
|
|
57
|
+
error: null;
|
|
58
|
+
isError: false;
|
|
59
|
+
isPending: false;
|
|
60
|
+
isLoading: false;
|
|
61
|
+
isLoadingError: false;
|
|
62
|
+
isRefetchError: false;
|
|
63
|
+
isFetchNextPageError: false;
|
|
64
|
+
isFetchPreviousPageError: false;
|
|
65
|
+
isSuccess: true;
|
|
66
|
+
isPlaceholderData: false;
|
|
67
|
+
status: "success";
|
|
68
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
69
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
70
|
+
hasNextPage: boolean;
|
|
71
|
+
hasPreviousPage: boolean;
|
|
72
|
+
isFetchingNextPage: boolean;
|
|
73
|
+
isFetchingPreviousPage: boolean;
|
|
74
|
+
dataUpdatedAt: number;
|
|
75
|
+
errorUpdatedAt: number;
|
|
76
|
+
failureCount: number;
|
|
77
|
+
failureReason: import("../../types").ApiError | null;
|
|
78
|
+
errorUpdateCount: number;
|
|
79
|
+
isFetched: boolean;
|
|
80
|
+
isFetchedAfterMount: boolean;
|
|
81
|
+
isFetching: boolean;
|
|
82
|
+
isInitialLoading: boolean;
|
|
83
|
+
isPaused: boolean;
|
|
84
|
+
isRefetching: boolean;
|
|
85
|
+
isStale: boolean;
|
|
86
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
87
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
88
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>>;
|
|
89
|
+
} | {
|
|
90
|
+
data: MemberResource[];
|
|
91
|
+
adultMembers: MemberResource[];
|
|
92
|
+
childMembers: MemberResource[];
|
|
93
|
+
error: import("../../types").ApiError;
|
|
94
|
+
isError: true;
|
|
95
|
+
isPending: false;
|
|
96
|
+
isLoading: false;
|
|
97
|
+
isLoadingError: true;
|
|
98
|
+
isRefetchError: false;
|
|
99
|
+
isFetchNextPageError: false;
|
|
100
|
+
isFetchPreviousPageError: false;
|
|
101
|
+
isSuccess: false;
|
|
102
|
+
isPlaceholderData: false;
|
|
103
|
+
status: "error";
|
|
104
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
105
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
106
|
+
hasNextPage: boolean;
|
|
107
|
+
hasPreviousPage: boolean;
|
|
108
|
+
isFetchingNextPage: boolean;
|
|
109
|
+
isFetchingPreviousPage: boolean;
|
|
110
|
+
dataUpdatedAt: number;
|
|
111
|
+
errorUpdatedAt: number;
|
|
112
|
+
failureCount: number;
|
|
113
|
+
failureReason: import("../../types").ApiError | null;
|
|
114
|
+
errorUpdateCount: number;
|
|
115
|
+
isFetched: boolean;
|
|
116
|
+
isFetchedAfterMount: boolean;
|
|
117
|
+
isFetching: boolean;
|
|
118
|
+
isInitialLoading: boolean;
|
|
119
|
+
isPaused: boolean;
|
|
120
|
+
isRefetching: boolean;
|
|
121
|
+
isStale: boolean;
|
|
122
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
123
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
124
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>>;
|
|
125
|
+
} | {
|
|
126
|
+
data: MemberResource[];
|
|
127
|
+
adultMembers: MemberResource[];
|
|
128
|
+
childMembers: MemberResource[];
|
|
129
|
+
error: null;
|
|
130
|
+
isError: false;
|
|
131
|
+
isPending: true;
|
|
132
|
+
isLoading: true;
|
|
133
|
+
isLoadingError: false;
|
|
134
|
+
isRefetchError: false;
|
|
135
|
+
isFetchNextPageError: false;
|
|
136
|
+
isFetchPreviousPageError: false;
|
|
137
|
+
isSuccess: false;
|
|
138
|
+
isPlaceholderData: false;
|
|
139
|
+
status: "pending";
|
|
140
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
141
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
142
|
+
hasNextPage: boolean;
|
|
143
|
+
hasPreviousPage: boolean;
|
|
144
|
+
isFetchingNextPage: boolean;
|
|
145
|
+
isFetchingPreviousPage: boolean;
|
|
146
|
+
dataUpdatedAt: number;
|
|
147
|
+
errorUpdatedAt: number;
|
|
148
|
+
failureCount: number;
|
|
149
|
+
failureReason: import("../../types").ApiError | null;
|
|
150
|
+
errorUpdateCount: number;
|
|
151
|
+
isFetched: boolean;
|
|
152
|
+
isFetchedAfterMount: boolean;
|
|
153
|
+
isFetching: boolean;
|
|
154
|
+
isInitialLoading: boolean;
|
|
155
|
+
isPaused: boolean;
|
|
156
|
+
isRefetching: boolean;
|
|
157
|
+
isStale: boolean;
|
|
158
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
159
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
160
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>>;
|
|
161
|
+
} | {
|
|
162
|
+
data: MemberResource[];
|
|
163
|
+
adultMembers: MemberResource[];
|
|
164
|
+
childMembers: MemberResource[];
|
|
165
|
+
error: null;
|
|
166
|
+
isError: false;
|
|
167
|
+
isPending: true;
|
|
168
|
+
isLoadingError: false;
|
|
169
|
+
isRefetchError: false;
|
|
170
|
+
isFetchNextPageError: false;
|
|
171
|
+
isFetchPreviousPageError: false;
|
|
172
|
+
isSuccess: false;
|
|
173
|
+
isPlaceholderData: false;
|
|
174
|
+
status: "pending";
|
|
175
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
176
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
177
|
+
hasNextPage: boolean;
|
|
178
|
+
hasPreviousPage: boolean;
|
|
179
|
+
isFetchingNextPage: boolean;
|
|
180
|
+
isFetchingPreviousPage: boolean;
|
|
181
|
+
dataUpdatedAt: number;
|
|
182
|
+
errorUpdatedAt: number;
|
|
183
|
+
failureCount: number;
|
|
184
|
+
failureReason: import("../../types").ApiError | null;
|
|
185
|
+
errorUpdateCount: number;
|
|
186
|
+
isFetched: boolean;
|
|
187
|
+
isFetchedAfterMount: boolean;
|
|
188
|
+
isFetching: boolean;
|
|
189
|
+
isLoading: boolean;
|
|
190
|
+
isInitialLoading: boolean;
|
|
191
|
+
isPaused: boolean;
|
|
192
|
+
isRefetching: boolean;
|
|
193
|
+
isStale: boolean;
|
|
194
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
195
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
196
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>>;
|
|
197
|
+
} | {
|
|
198
|
+
data: MemberResource[];
|
|
199
|
+
adultMembers: MemberResource[];
|
|
200
|
+
childMembers: MemberResource[];
|
|
201
|
+
isError: false;
|
|
202
|
+
error: null;
|
|
203
|
+
isPending: false;
|
|
204
|
+
isLoading: false;
|
|
205
|
+
isLoadingError: false;
|
|
206
|
+
isRefetchError: false;
|
|
207
|
+
isSuccess: true;
|
|
208
|
+
isPlaceholderData: true;
|
|
209
|
+
isFetchNextPageError: false;
|
|
210
|
+
isFetchPreviousPageError: false;
|
|
211
|
+
status: "success";
|
|
212
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
213
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
214
|
+
hasNextPage: boolean;
|
|
215
|
+
hasPreviousPage: boolean;
|
|
216
|
+
isFetchingNextPage: boolean;
|
|
217
|
+
isFetchingPreviousPage: boolean;
|
|
218
|
+
dataUpdatedAt: number;
|
|
219
|
+
errorUpdatedAt: number;
|
|
220
|
+
failureCount: number;
|
|
221
|
+
failureReason: import("../../types").ApiError | null;
|
|
222
|
+
errorUpdateCount: number;
|
|
223
|
+
isFetched: boolean;
|
|
224
|
+
isFetchedAfterMount: boolean;
|
|
225
|
+
isFetching: boolean;
|
|
226
|
+
isInitialLoading: boolean;
|
|
227
|
+
isPaused: boolean;
|
|
228
|
+
isRefetching: boolean;
|
|
229
|
+
isStale: boolean;
|
|
230
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>, import("../../types").ApiError>>;
|
|
231
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
232
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../../types").ApiCollection<GroupsGroupMemberResource>, unknown>>;
|
|
233
|
+
};
|
|
234
|
+
export {};
|
|
235
|
+
//# sourceMappingURL=use_group_members_for_new_conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_group_members_for_new_conversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/groups/use_group_members_for_new_conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAA;AAC3G,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAG5C,KAAK,qBAAqB,CAAC,CAAC,SAAS,cAAc,IAAI,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;AAE5F,MAAM,MAAM,oCAAoC,GAAG,IAAI,CACrD,qBAAqB,CAAC,yBAAyB,CAAC,EAAE,8CAA8C;AAChG,MAAM,CACP,GAAG;IACF,IAAI,EAAE,cAAc,EAAE,CAAA;IACtB,YAAY,EAAE,cAAc,EAAE,CAAA;IAC9B,YAAY,EAAE,cAAc,EAAE,CAAA;CAC/B,CAAA;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCvE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useApiPaginator } from '../use_api';
|
|
2
|
+
import { useCurrentPerson } from '../use_current_person';
|
|
3
|
+
/**
|
|
4
|
+
* This is specifically for the new conversation screen because we assign
|
|
5
|
+
* the "Conversation owner" badge to the current person.
|
|
6
|
+
*/
|
|
7
|
+
export function useGroupMembersForNewConversation({ id }) {
|
|
8
|
+
const currentPerson = useCurrentPerson();
|
|
9
|
+
const response = useApiPaginator({
|
|
10
|
+
url: `/me/groups/${id}/memberships`,
|
|
11
|
+
data: {
|
|
12
|
+
perPage: 100,
|
|
13
|
+
include: ['person'],
|
|
14
|
+
fields: {
|
|
15
|
+
Membership: ['person, role'],
|
|
16
|
+
Person: ['avatar_url', 'name', 'first_name', 'last_name', 'child'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
app: 'groups',
|
|
20
|
+
});
|
|
21
|
+
const { data: memberships = [] } = response;
|
|
22
|
+
const members = memberships.map(membership => {
|
|
23
|
+
const { person } = membership;
|
|
24
|
+
return {
|
|
25
|
+
type: 'Member',
|
|
26
|
+
avatar: person.avatarUrl,
|
|
27
|
+
badges: buildBadges(membership, currentPerson.id),
|
|
28
|
+
child: person.child,
|
|
29
|
+
id: +person.id,
|
|
30
|
+
name: `${person.firstName} ${person.lastName}`,
|
|
31
|
+
source: [],
|
|
32
|
+
role: membership.role,
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
const adultMembers = members.filter(member => !member.child);
|
|
36
|
+
const childMembers = members.filter(member => member.child);
|
|
37
|
+
return {
|
|
38
|
+
...response,
|
|
39
|
+
data: members,
|
|
40
|
+
adultMembers,
|
|
41
|
+
childMembers,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function buildBadges(membership, currentPersonId) {
|
|
45
|
+
const { person } = membership;
|
|
46
|
+
const badges = [];
|
|
47
|
+
if (membership.role === 'leader') {
|
|
48
|
+
badges.push({ title: 'Leader' });
|
|
49
|
+
}
|
|
50
|
+
if (person.id === currentPersonId) {
|
|
51
|
+
badges.push({ title: 'Conversation owner' });
|
|
52
|
+
}
|
|
53
|
+
return badges;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=use_group_members_for_new_conversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_group_members_for_new_conversation.js","sourceRoot":"","sources":["../../../src/hooks/groups/use_group_members_for_new_conversation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAaxD;;;GAGG;AACH,MAAM,UAAU,iCAAiC,CAAC,EAAE,EAAE,EAAkB;IACtE,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IACxC,MAAM,QAAQ,GAAG,eAAe,CAA4B;QAC1D,GAAG,EAAE,cAAc,EAAE,cAAc;QACnC,IAAI,EAAE;YACJ,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,UAAU,EAAE,CAAC,cAAc,CAAC;gBAC5B,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,CAAC;aACnE;SACF;QACD,GAAG,EAAE,QAAQ;KACd,CAAC,CAAA;IAEF,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,QAAQ,CAAA;IAC3C,MAAM,OAAO,GAAqB,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;QAC7B,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,MAAM,CAAC,SAAS;YACxB,MAAM,EAAE,WAAW,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,CAAC;YACjD,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE;YACd,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE;YAC9C,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,UAAU,CAAC,IAAI;SACtB,CAAA;IACH,CAAC,CAAC,CAAA;IACF,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC5D,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAE3D,OAAO;QACL,GAAG,QAAQ;QACX,IAAI,EAAE,OAAO;QACb,YAAY;QACZ,YAAY;KACb,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAClB,UAAqC,EACrC,eAAuB;IAEvB,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;IAC7B,MAAM,MAAM,GAAG,EAAE,CAAA;IACjB,IAAI,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;IAClC,CAAC;IACD,IAAI,MAAM,CAAC,EAAE,KAAK,eAAe,EAAE,CAAC;QAClC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC,CAAA;IAC9C,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { MemberBadge, MemberResource, ResourceObject } from '../../types'\nimport { GroupsGroupMemberResource } from '../../types/resources/groups/groups_member_resource_with_person'\nimport { useApiPaginator } from '../use_api'\nimport { useCurrentPerson } from '../use_current_person'\n\ntype UseApiPaginatorResult<T extends ResourceObject> = ReturnType<typeof useApiPaginator<T>>\n\nexport type GroupMembersForNewConversationResult = Omit<\n UseApiPaginatorResult<GroupsGroupMemberResource>, // We are passing our own \"members\" data shape\n 'data'\n> & {\n data: MemberResource[]\n adultMembers: MemberResource[]\n childMembers: MemberResource[]\n}\n\n/**\n * This is specifically for the new conversation screen because we assign\n * the \"Conversation owner\" badge to the current person.\n */\nexport function useGroupMembersForNewConversation({ id }: { id: number }) {\n const currentPerson = useCurrentPerson()\n const response = useApiPaginator<GroupsGroupMemberResource>({\n url: `/me/groups/${id}/memberships`,\n data: {\n perPage: 100,\n include: ['person'],\n fields: {\n Membership: ['person, role'],\n Person: ['avatar_url', 'name', 'first_name', 'last_name', 'child'],\n },\n },\n app: 'groups',\n })\n\n const { data: memberships = [] } = response\n const members: MemberResource[] = memberships.map(membership => {\n const { person } = membership\n return {\n type: 'Member',\n avatar: person.avatarUrl,\n badges: buildBadges(membership, currentPerson.id),\n child: person.child,\n id: +person.id,\n name: `${person.firstName} ${person.lastName}`,\n source: [],\n role: membership.role,\n }\n })\n const adultMembers = members.filter(member => !member.child)\n const childMembers = members.filter(member => member.child)\n\n return {\n ...response,\n data: members,\n adultMembers,\n childMembers,\n }\n}\n\nfunction buildBadges(\n membership: GroupsGroupMemberResource,\n currentPersonId: number\n): MemberBadge[] {\n const { person } = membership\n const badges = []\n if (membership.role === 'leader') {\n badges.push({ title: 'Leader' })\n }\n if (person.id === currentPersonId) {\n badges.push({ title: 'Conversation owner' })\n }\n return badges\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ApiResource, ConversationResource } from '../../types';
|
|
2
|
+
interface Props {
|
|
3
|
+
groupId: number;
|
|
4
|
+
title?: string;
|
|
5
|
+
onSuccess: (conversationId: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function useGroupsConversationCreate({ groupId, title, onSuccess }: Props): import("@tanstack/react-query").UseMutationResult<ApiResource<ConversationResource>, Error, void, unknown>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=use_groups_conversation_create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_groups_conversation_create.d.ts","sourceRoot":"","sources":["../../../src/hooks/groups/use_groups_conversation_create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAkB,MAAM,aAAa,CAAA;AAG/E,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5C;AAED,wBAAgB,2BAA2B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,8GAmC/E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../use_api_client';
|
|
3
|
+
export function useGroupsConversationCreate({ groupId, title, onSuccess }) {
|
|
4
|
+
const apiClient = useApiClient();
|
|
5
|
+
return useMutation({
|
|
6
|
+
throwOnError: true,
|
|
7
|
+
onSuccess: result => {
|
|
8
|
+
onSuccess && onSuccess(result.data.id);
|
|
9
|
+
},
|
|
10
|
+
mutationFn: () => apiClient.groups
|
|
11
|
+
.post({
|
|
12
|
+
url: `/me/groups/${groupId}/chat_conversation_payload`,
|
|
13
|
+
data: {
|
|
14
|
+
data: {
|
|
15
|
+
type: '',
|
|
16
|
+
attributes: {
|
|
17
|
+
title,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
.then(res => res.data.value)
|
|
23
|
+
.then(payload => apiClient.chat.post({
|
|
24
|
+
url: '/me/conversations',
|
|
25
|
+
data: {
|
|
26
|
+
data: {
|
|
27
|
+
type: 'Conversation',
|
|
28
|
+
attributes: {
|
|
29
|
+
payload,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
})),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=use_groups_conversation_create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_groups_conversation_create.js","sourceRoot":"","sources":["../../../src/hooks/groups/use_groups_conversation_create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAQhD,MAAM,UAAU,2BAA2B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAS;IAC9E,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,OAAO,WAAW,CAAC;QACjB,YAAY,EAAE,IAAI;QAClB,SAAS,EAAE,MAAM,CAAC,EAAE;YAClB,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACxC,CAAC;QACD,UAAU,EAAE,GAAG,EAAE,CACf,SAAS,CAAC,MAAM;aACb,IAAI,CAAuC;YAC1C,GAAG,EAAE,cAAc,OAAO,4BAA4B;YACtD,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ,IAAI,EAAE,EAAE;oBACR,UAAU,EAAE;wBACV,KAAK;qBACN;iBACF;aACF;SACF,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;aAC3B,IAAI,CAAC,OAAO,CAAC,EAAE,CACd,SAAS,CAAC,IAAI,CAAC,IAAI,CAAoC;YACrD,GAAG,EAAE,mBAAmB;YACxB,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACV,OAAO;qBACR;iBACF;aACF;SACF,CAAC,CACH;KACN,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { useMutation } from '@tanstack/react-query'\nimport { ApiResource, ConversationResource, ResourceObject } from '../../types'\nimport { useApiClient } from '../use_api_client'\n\ninterface Props {\n groupId: number\n title?: string\n onSuccess: (conversationId: number) => void\n}\n\nexport function useGroupsConversationCreate({ groupId, title, onSuccess }: Props) {\n const apiClient = useApiClient()\n return useMutation({\n throwOnError: true,\n onSuccess: result => {\n onSuccess && onSuccess(result.data.id)\n },\n mutationFn: () =>\n apiClient.groups\n .post<ApiResource<ChatConversationPayload>>({\n url: `/me/groups/${groupId}/chat_conversation_payload`,\n data: {\n data: {\n type: '',\n attributes: {\n title,\n },\n },\n },\n })\n .then(res => res.data.value)\n .then(payload =>\n apiClient.chat.post<ApiResource<ConversationResource>>({\n url: '/me/conversations',\n data: {\n data: {\n type: 'Conversation',\n attributes: {\n payload,\n },\n },\n },\n })\n ),\n })\n}\n\ninterface ChatConversationPayload extends ResourceObject {\n value: string\n}\n"]}
|
package/build/hooks/index.d.ts
CHANGED
|
@@ -6,4 +6,8 @@ export * from './use_font_scale';
|
|
|
6
6
|
export * from './use_create_android_ripple_color';
|
|
7
7
|
export * from './use_chat_permissions';
|
|
8
8
|
export * from './use_api_client';
|
|
9
|
+
export * from './use_groups_groups';
|
|
10
|
+
export * from './use_groups';
|
|
11
|
+
export * from './use_api';
|
|
12
|
+
export * from './use_api_client';
|
|
9
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA"}
|
package/build/hooks/index.js
CHANGED
|
@@ -6,4 +6,8 @@ export * from './use_font_scale';
|
|
|
6
6
|
export * from './use_create_android_ripple_color';
|
|
7
7
|
export * from './use_chat_permissions';
|
|
8
8
|
export * from './use_api_client';
|
|
9
|
+
export * from './use_groups_groups';
|
|
10
|
+
export * from './use_groups';
|
|
11
|
+
export * from './use_api';
|
|
12
|
+
export * from './use_api_client';
|
|
9
13
|
//# sourceMappingURL=index.js.map
|
package/build/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA","sourcesContent":["export * from './use_async_storage'\nexport * from './use_theme'\nexport * from './use_suspense_api'\nexport * from './use_current_person'\nexport * from './use_font_scale'\nexport * from './use_create_android_ripple_color'\nexport * from './use_chat_permissions'\nexport * from './use_api_client'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA","sourcesContent":["export * from './use_async_storage'\nexport * from './use_theme'\nexport * from './use_suspense_api'\nexport * from './use_current_person'\nexport * from './use_font_scale'\nexport * from './use_create_android_ripple_color'\nexport * from './use_chat_permissions'\nexport * from './use_api_client'\nexport * from './use_groups_groups'\nexport * from './use_groups'\nexport * from './use_api'\nexport * from './use_api_client'\n"]}
|