@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,32 @@
|
|
|
1
|
+
import { useContext, useMemo } from 'react';
|
|
2
|
+
import { ChatContext } from '../contexts/chat_context';
|
|
3
|
+
import { UploadUri } from '../utils/upload_uri';
|
|
4
|
+
import { Client } from '../utils';
|
|
5
|
+
export const useUploadClient = () => {
|
|
6
|
+
const { session, onUnauthorizedResponse } = useContext(ChatContext);
|
|
7
|
+
const uri = useMemo(() => new UploadUri({ session }), [session]);
|
|
8
|
+
const api = useMemo(() => new UploadClient({
|
|
9
|
+
version: '2025-05-16', // not really needed, but required by the Client constructor
|
|
10
|
+
root: uri.baseUrl,
|
|
11
|
+
defaultHeaders: uri.headers,
|
|
12
|
+
onUnauthorizedResponse,
|
|
13
|
+
}), [uri, onUnauthorizedResponse]);
|
|
14
|
+
return api;
|
|
15
|
+
};
|
|
16
|
+
class UploadClient extends Client {
|
|
17
|
+
async uploadFile(file) {
|
|
18
|
+
const formData = new FormData();
|
|
19
|
+
formData.append('file', file);
|
|
20
|
+
const response = await fetch(`${this.root}/v2/files`, {
|
|
21
|
+
method: 'POST',
|
|
22
|
+
headers: this.headers,
|
|
23
|
+
body: formData,
|
|
24
|
+
});
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
return this.handleNotOk(response);
|
|
27
|
+
}
|
|
28
|
+
const jsonResponse = await response.json();
|
|
29
|
+
return jsonResponse.data[0];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=use_upload_client.js.map
|
|
@@ -0,0 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CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QACnC,CAAC;QAED,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QAE1C,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC7B,CAAC;CACF","sourcesContent":["import { useContext, useMemo } from 'react'\nimport { ChatContext } from '../contexts/chat_context'\nimport { UploadUri } from '../utils/upload_uri'\nimport { Client } from '../utils'\n\nexport interface FileForUploadClient {\n uri: string\n name: string\n type: string // Should be a MIME type\n}\n\nexport const useUploadClient = () => {\n const { session, onUnauthorizedResponse } = useContext(ChatContext)\n\n const uri = useMemo(() => new UploadUri({ session }), [session])\n\n const api = useMemo(\n () =>\n new UploadClient({\n version: '2025-05-16', // not really needed, but required by the Client constructor\n root: uri.baseUrl,\n defaultHeaders: uri.headers,\n onUnauthorizedResponse,\n }),\n [uri, onUnauthorizedResponse]\n )\n\n return api\n}\n\nclass UploadClient extends Client {\n async uploadFile(file: FileForUploadClient): Promise<UploadedResource> {\n const formData = new FormData()\n formData.append('file', file as unknown as Blob)\n\n const response = await fetch(`${this.root}/v2/files`, {\n method: 'POST',\n headers: this.headers,\n body: formData,\n })\n\n if (!response.ok) {\n return this.handleNotOk(response)\n }\n\n const jsonResponse = await response.json()\n\n return jsonResponse.data[0]\n }\n}\n\ninterface UploadedResource {\n id: string\n type: string\n attributes: {\n organization_id: string\n person_id: string\n md5: string\n created_at: string\n expires_at: string\n source_ip: string\n name: string\n content_type: string\n file_size: number\n location: string\n }\n}\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './contexts/chat_context';
|
|
2
|
-
export { ApiProvider } from './contexts/api_provider';
|
|
2
|
+
export { ApiProvider, chatQueryClient } from './contexts/api_provider';
|
|
3
3
|
export { DesignSystemScreen } from './screens';
|
|
4
4
|
export * from './navigation';
|
|
5
5
|
export * from './types';
|
|
6
6
|
export * from './utils/client';
|
|
7
|
-
export {
|
|
7
|
+
export { GroupConversations } from './components';
|
|
8
|
+
export { TemporaryDefaultColorsType, ChatAdapters, ClipboardAdapter, Session, Uri, platformFontWeightBold, } from './utils';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEjD,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,GAAG,EACH,sBAAsB,GACvB,MAAM,SAAS,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './contexts/chat_context';
|
|
2
|
-
export { ApiProvider } from './contexts/api_provider';
|
|
2
|
+
export { ApiProvider, chatQueryClient } from './contexts/api_provider';
|
|
3
3
|
export { DesignSystemScreen } from './screens';
|
|
4
4
|
export * from './navigation';
|
|
5
5
|
export * from './types';
|
|
6
6
|
export * from './utils/client';
|
|
7
|
-
export {
|
|
7
|
+
export { GroupConversations } from './components';
|
|
8
|
+
export { ChatAdapters, ClipboardAdapter, Session, Uri, platformFontWeightBold, } from './utils';
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEjD,OAAO,EAEL,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,GAAG,EACH,sBAAsB,GACvB,MAAM,SAAS,CAAA","sourcesContent":["export * from './contexts/chat_context'\nexport { ApiProvider, chatQueryClient } from './contexts/api_provider'\nexport { DesignSystemScreen } from './screens'\nexport * from './navigation'\nexport * from './types'\nexport * from './utils/client'\nexport { GroupConversations } from './components'\n\nexport {\n TemporaryDefaultColorsType,\n ChatAdapters,\n ClipboardAdapter,\n Session,\n Uri,\n platformFontWeightBold,\n} from './utils'\n"]}
|
|
@@ -27,44 +27,53 @@ export declare const NewConversationStack: import("@react-navigation/native").Ty
|
|
|
27
27
|
readonly screenLayout: typeof ScreenLayout;
|
|
28
28
|
readonly screens: {
|
|
29
29
|
readonly ConversationSelectRecipients: {
|
|
30
|
-
readonly screen: ({}:
|
|
31
|
-
route: {
|
|
32
|
-
params: {
|
|
33
|
-
chat_group_graph_id?: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
}) => React.JSX.Element;
|
|
30
|
+
readonly screen: ({ route, }: import("../screens/conversation_select_recipients/types/screen_props").ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
37
31
|
readonly options: ({ navigation }: {
|
|
38
32
|
route: import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>;
|
|
39
33
|
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/native").ParamListBase, string, undefined>;
|
|
40
34
|
theme: ReactNavigation.Theme;
|
|
35
|
+
}) => {
|
|
36
|
+
title: string;
|
|
37
|
+
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
38
|
+
headerBackVisible: false;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly ConversationSelectGroupRecipients: {
|
|
42
|
+
readonly screen: ({ route, }: import("../screens/conversation_select_recipients/types/screen_props").ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
43
|
+
readonly options: ({ navigation, route }: {
|
|
44
|
+
route: import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>;
|
|
45
|
+
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/native").ParamListBase, string, undefined>;
|
|
46
|
+
theme: ReactNavigation.Theme;
|
|
41
47
|
}) => {
|
|
42
48
|
title: string;
|
|
43
49
|
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
44
50
|
};
|
|
45
51
|
};
|
|
46
52
|
readonly ConversationFilterRecipients: {
|
|
47
|
-
readonly screen: ({}:
|
|
48
|
-
route: {
|
|
49
|
-
params: {};
|
|
50
|
-
};
|
|
51
|
-
}) => React.JSX.Element;
|
|
53
|
+
readonly screen: ({}: import("../screens/conversation_filter_recipients/types").ConversationFilterRecipientsScreenProps) => React.JSX.Element;
|
|
52
54
|
readonly options: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
53
55
|
};
|
|
54
56
|
readonly ConversationNew: {
|
|
55
57
|
readonly screen: ({ route }: {
|
|
56
58
|
route: {
|
|
57
59
|
params: {
|
|
58
|
-
group_id?:
|
|
59
|
-
team_ids?:
|
|
60
|
+
group_id?: number;
|
|
61
|
+
team_ids?: number[];
|
|
60
62
|
plan_id?: number;
|
|
61
63
|
source_app_name: import("../types/resources/app_name").AppName;
|
|
64
|
+
chat_group_graph_id?: import("../types/resources/group_resource").GraphId;
|
|
65
|
+
group_source_app_name?: import("../types/resources/app_name").AppName;
|
|
62
66
|
};
|
|
63
67
|
};
|
|
64
68
|
}) => React.JSX.Element;
|
|
65
|
-
readonly options: {
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
readonly options: ({ navigation }: {
|
|
70
|
+
route: import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>;
|
|
71
|
+
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/native").ParamListBase, string, undefined>;
|
|
72
|
+
theme: ReactNavigation.Theme;
|
|
73
|
+
}) => {
|
|
74
|
+
title: string;
|
|
75
|
+
headerLeft: () => null;
|
|
76
|
+
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
68
77
|
};
|
|
69
78
|
};
|
|
70
79
|
};
|
|
@@ -142,44 +151,53 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
|
|
|
142
151
|
readonly screenLayout: typeof ScreenLayout;
|
|
143
152
|
readonly screens: {
|
|
144
153
|
readonly ConversationSelectRecipients: {
|
|
145
|
-
readonly screen: ({}:
|
|
146
|
-
route: {
|
|
147
|
-
params: {
|
|
148
|
-
chat_group_graph_id?: string;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
}) => React.JSX.Element;
|
|
154
|
+
readonly screen: ({ route, }: import("../screens/conversation_select_recipients/types/screen_props").ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
152
155
|
readonly options: ({ navigation }: {
|
|
153
156
|
route: import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>;
|
|
154
157
|
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/native").ParamListBase, string, undefined>;
|
|
155
158
|
theme: ReactNavigation.Theme;
|
|
159
|
+
}) => {
|
|
160
|
+
title: string;
|
|
161
|
+
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
162
|
+
headerBackVisible: false;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
readonly ConversationSelectGroupRecipients: {
|
|
166
|
+
readonly screen: ({ route, }: import("../screens/conversation_select_recipients/types/screen_props").ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
167
|
+
readonly options: ({ navigation, route }: {
|
|
168
|
+
route: import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>;
|
|
169
|
+
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/native").ParamListBase, string, undefined>;
|
|
170
|
+
theme: ReactNavigation.Theme;
|
|
156
171
|
}) => {
|
|
157
172
|
title: string;
|
|
158
173
|
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
159
174
|
};
|
|
160
175
|
};
|
|
161
176
|
readonly ConversationFilterRecipients: {
|
|
162
|
-
readonly screen: ({}:
|
|
163
|
-
route: {
|
|
164
|
-
params: {};
|
|
165
|
-
};
|
|
166
|
-
}) => React.JSX.Element;
|
|
177
|
+
readonly screen: ({}: import("../screens/conversation_filter_recipients/types").ConversationFilterRecipientsScreenProps) => React.JSX.Element;
|
|
167
178
|
readonly options: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
168
179
|
};
|
|
169
180
|
readonly ConversationNew: {
|
|
170
181
|
readonly screen: ({ route }: {
|
|
171
182
|
route: {
|
|
172
183
|
params: {
|
|
173
|
-
group_id?:
|
|
174
|
-
team_ids?:
|
|
184
|
+
group_id?: number;
|
|
185
|
+
team_ids?: number[];
|
|
175
186
|
plan_id?: number;
|
|
176
187
|
source_app_name: import("../types/resources/app_name").AppName;
|
|
188
|
+
chat_group_graph_id?: import("../types/resources/group_resource").GraphId;
|
|
189
|
+
group_source_app_name?: import("../types/resources/app_name").AppName;
|
|
177
190
|
};
|
|
178
191
|
};
|
|
179
192
|
}) => React.JSX.Element;
|
|
180
|
-
readonly options: {
|
|
181
|
-
|
|
182
|
-
|
|
193
|
+
readonly options: ({ navigation }: {
|
|
194
|
+
route: import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>;
|
|
195
|
+
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/native").ParamListBase, string, undefined>;
|
|
196
|
+
theme: ReactNavigation.Theme;
|
|
197
|
+
}) => {
|
|
198
|
+
title: string;
|
|
199
|
+
headerLeft: () => null;
|
|
200
|
+
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
183
201
|
};
|
|
184
202
|
};
|
|
185
203
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AAOnF,OAAO,EACL,oBAAoB,EAErB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,eAAe,EAA0B,MAAM,8BAA8B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAA0B,MAAM,6BAA6B,CAAA;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"A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;;;;;;;;;;;;;;;;;;;EA+FtD,CAAA;AAEF,KAAK,kBAAkB,GAAG,eAAe,CAAC,OAAO,SAAS,CAAC,CAAA;AAE3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,eAAe,CAAC;QACxB,UAAU,aAAc,SAAQ,kBAAkB;SAAG;KACtD;CACF"}
|
|
@@ -15,6 +15,7 @@ import { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_sc
|
|
|
15
15
|
import { HeaderRightButton } from './header';
|
|
16
16
|
import { ScreenLayout } from './screenLayout';
|
|
17
17
|
import { ConversationFiltersScreen, ConversationFiltersScreenOptions, } from '../screens/conversation_filters_screen';
|
|
18
|
+
import { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen';
|
|
18
19
|
export const NewConversationStack = createNativeStackNavigator({
|
|
19
20
|
initialRouteName: 'ConversationSelectRecipients',
|
|
20
21
|
screenOptions: {
|
|
@@ -28,6 +29,16 @@ export const NewConversationStack = createNativeStackNavigator({
|
|
|
28
29
|
title: 'New conversation',
|
|
29
30
|
headerRight: (props) => (<HeaderRightButton {...props} onPress={navigation.goBack}>
|
|
30
31
|
Cancel
|
|
32
|
+
</HeaderRightButton>),
|
|
33
|
+
headerBackVisible: false,
|
|
34
|
+
}),
|
|
35
|
+
},
|
|
36
|
+
ConversationSelectGroupRecipients: {
|
|
37
|
+
screen: ConversationSelectGroupRecipientsScreen,
|
|
38
|
+
options: ({ navigation, route }) => ({
|
|
39
|
+
title: 'New conversation',
|
|
40
|
+
headerRight: (props) => (<HeaderRightButton {...props} onPress={() => navigation.popTo('Conversations', route.params)}>
|
|
41
|
+
Cancel
|
|
31
42
|
</HeaderRightButton>),
|
|
32
43
|
}),
|
|
33
44
|
},
|
|
@@ -37,10 +48,13 @@ export const NewConversationStack = createNativeStackNavigator({
|
|
|
37
48
|
},
|
|
38
49
|
ConversationNew: {
|
|
39
50
|
screen: ConversationNewScreen,
|
|
40
|
-
options: {
|
|
51
|
+
options: ({ navigation }) => ({
|
|
41
52
|
title: 'New conversation',
|
|
42
53
|
headerLeft: () => null,
|
|
43
|
-
|
|
54
|
+
headerRight: (props) => (<HeaderRightButton {...props} onPress={() => navigation.getParent()?.goBack()}>
|
|
55
|
+
Cancel
|
|
56
|
+
</HeaderRightButton>),
|
|
57
|
+
}),
|
|
44
58
|
},
|
|
45
59
|
},
|
|
46
60
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAA;AAC3F,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,GACnC,MAAM,iFAAiF,CAAA;AACxF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iFAAiF,CAAA;AACpI,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA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AAU,CAAC,MAAM,CAAC,CACvD;;UACF,EAAE,iBAAiB,CAAC,CACrB;aACF,CAAC;SACH;QACD,GAAG,EAAE;YACH,MAAM,EAAE,oBAAoB;YAC5B,OAAO,EAAE;gBACP,WAAW,EAAE,KAAK;gBAClB,YAAY,EAAE,OAAO;aACtB;SACF;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,cAAc,EAAE;YACd,MAAM,EAAE,oBAAoB;YAC5B,gEAAgE;YAChE,OAAO,EAAE,2BAA2B;SACrC;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Icon } from '../components'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport { ConversationScreen } from '../screens/conversation_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationSelectRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_recipients_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport { NotFound } from '../screens/not_found'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { HeaderRightButton } from './header'\nimport { ScreenLayout } from './screenLayout'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationSelectRecipients',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n ConversationSelectRecipients: {\n screen: ConversationSelectRecipientsScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: {\n title: 'New conversation',\n headerLeft: () => null,\n },\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerLeft: props => (\n <HeaderBackButton\n displayMode=\"minimal\"\n onPress={() => {\n if ((route.params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n navigation.popTo('Conversations', route.params)\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Done\n </HeaderRightButton>\n ),\n }),\n },\n New: {\n screen: NewConversationStack,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAA;AAC3F,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,GACnC,MAAM,iFAAiF,CAAA;AACxF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iFAAiF,CAAA;AACpI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BAAoB;YAC5B,OAAO,EAAE;gBACP,WAAW,EAAE,KAAK;gBAClB,YAAY,EAAE,OAAO;aACtB;SACF;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,cAAc,EAAE;YACd,MAAM,EAAE,oBAAoB;YAC5B,gEAAgE;YAChE,OAAO,EAAE,2BAA2B;SACrC;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Icon } from '../components'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport { ConversationScreen } from '../screens/conversation_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationSelectRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_recipients_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport { NotFound } from '../screens/not_found'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { HeaderRightButton } from './header'\nimport { ScreenLayout } from './screenLayout'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\nimport { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationSelectRecipients',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n ConversationSelectRecipients: {\n screen: ConversationSelectRecipientsScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Cancel\n </HeaderRightButton>\n ),\n headerBackVisible: false,\n }),\n },\n ConversationSelectGroupRecipients: {\n screen: ConversationSelectGroupRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={() => navigation.getParent()?.goBack()}>\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerLeft: props => (\n <HeaderBackButton\n displayMode=\"minimal\"\n onPress={() => {\n if ((route.params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n navigation.popTo('Conversations', route.params)\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Done\n </HeaderRightButton>\n ),\n }),\n },\n New: {\n screen: NewConversationStack,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
@@ -267,14 +267,14 @@ const useStyles = ({ isStart, isEnd } = {}) => {
|
|
|
267
267
|
return StyleSheet.create({
|
|
268
268
|
listContainer: {
|
|
269
269
|
flex: 1,
|
|
270
|
-
backgroundColor: colors.
|
|
270
|
+
backgroundColor: colors.surfaceColor080,
|
|
271
271
|
},
|
|
272
272
|
contentContainer: {
|
|
273
273
|
padding: space(2),
|
|
274
274
|
},
|
|
275
275
|
sectionOuterBase: {
|
|
276
276
|
paddingLeft: space(2),
|
|
277
|
-
backgroundColor: colors.
|
|
277
|
+
backgroundColor: colors.surfaceColor100,
|
|
278
278
|
borderTopLeftRadius: isStart ? space(1) : 0,
|
|
279
279
|
borderTopRightRadius: isStart ? space(1) : 0,
|
|
280
280
|
borderBottomLeftRadius: isEnd ? space(1) : 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_details_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_details_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EAIR,MAAM,GACP,MAAM,OAAO,CAAA;AACd,OAAO,EACL,UAAU,EACV,SAAS,EACT,IAAI,EAIJ,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAoB,MAAM,4BAA4B,CAAA;AACjG,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACnG,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAkB,SAAS,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIlD,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAK,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,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;SACd;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,CAAC;SACR;QACD,gBAAgB,EAAE;YAChB,UAAU,EAAE,QAAQ;SACrB;QACD,cAAc,EAAE;YACd,UAAU,EAAE,EAAE;SACf;QACD,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,MAAM;SACjB;QACD,gBAAgB,EAAE;YAChB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;YACxE,SAAS,EAAE,CAAC;SACb;QACD,oBAAoB,EAAE;YACpB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;SAC1E;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, {\n useCallback,\n useEffect,\n useState,\n type SetStateAction,\n type Dispatch,\n type ReactNode,\n useRef,\n} from 'react'\nimport {\n StyleSheet,\n TextInput,\n View,\n type TextStyle,\n type ViewStyle,\n type ViewProps,\n Pressable,\n Alert,\n Platform,\n} from 'react-native'\nimport { HeaderTitle as ElementsHeaderTitle, HeaderTitleProps } from '@react-navigation/elements'\nimport { Badge, ChildNotice, Heading, Icon, Person, Switch, Text, TextButton } from '../components'\nimport { useSuspenseGet, useTheme } from '../hooks'\nimport {\n useConversation,\n useConversationDelete,\n useConversationDisableReplies,\n useConversationMute,\n useConversationUpdate,\n} from '../hooks/use_conversation'\nimport { MemberResource, isDefined } from '../types'\nimport { HeaderRightButton } from '../navigation/header'\nimport { FlashList } from '@shopify/flash-list'\nimport { space } from '../utils'\nimport { tokens } from '../vendor/tapestry/tokens'\nimport { ButtonAppearanceUnion } from '../components/display/utils/button_colors'\nimport { GroupResource } from '../types/resources/group_resource'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n header,\n hidden,\n members,\n setting,\n view,\n}\n\ntype SectionListData = Array<\n | DataItem<{ title: string }, SectionTypes.header>\n | DataItem<MemberResource, SectionTypes.members>\n | DataItem<ViewProps, SectionTypes.view>\n | DataItem<SettingRowProps, SectionTypes.setting>\n | DataItem<any, SectionTypes.hidden>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionOuterStyle?: ViewStyle\n sectionInnerStyle?: ViewStyle\n showBottomBorder?: boolean\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport type ConversationDetailsScreenProps = StaticScreenProps<{\n conversation_id: number\n}>\n\nexport function ConversationDetailsScreen({ route }: ConversationDetailsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n\n const { data: conversation } = useConversation(route.params)\n const [title, setTitle] = useState(conversation.title)\n const { muted, setMuted } = useConversationMute(route.params)\n const { repliesDisabled, setRepliesDisabled } = useConversationDisableReplies(route.params)\n const { mutate: saveTitle } = useConversationUpdate(route.params)\n const { mutate: deleteConversation } = useConversationDelete(route.params)\n\n const trimmedTitle = title.trim()\n const emptyTitle = trimmedTitle === '' || title === null\n\n const canUpdate = conversation.memberAbility?.canUpdate || false\n const canDelete = conversation.memberAbility?.canDelete || false\n const isLeader = conversation.memberAbility?.leader || false\n\n const { data: members } = useSuspenseGet<MemberResource[]>({\n url: `/me/conversations/${route.params.conversation_id}/members`,\n data: {\n include: ['person'],\n fields: {\n Member: ['avatar', 'name', 'first_name', 'last_name', 'child', 'badges'],\n },\n },\n })\n\n const memberSectionStyleMap = {\n first: styles.sectionInnerFirstMember,\n middle: styles.sectionInnerMiddleMiddle,\n last: styles.sectionInnerLastMember,\n }\n\n const memberItems = members.map((data, index) => {\n const isFirst = index === 0\n const isLast = index === members.length - 1\n const memberPosition = isFirst ? 'first' : isLast ? 'last' : 'middle'\n const memberSectionStyle = memberSectionStyleMap[memberPosition]\n\n return {\n type: data.child ? SectionTypes.hidden : SectionTypes.members,\n data,\n sectionInnerStyle: memberSectionStyle,\n }\n })\n\n const childMembers = members.filter(member => member.child)\n const hasChildren = childMembers.length > 0\n\n const teamsGroup =\n conversation.groups\n ?.filter(g => g.sourceAppName === 'Services')\n ?.filter(g => ['Team', 'PlanTeam'].includes(g.sourceType))\n ?.filter(g => g.name !== null) || []\n const hasTeams = teamsGroup.length > 0\n\n const badge = conversation.badges?.[0]\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n const handleDelete = useCallback(() => {\n Alert.alert(\n 'Delete conversation',\n `All messages in ${title} will be deleted for everyone. This action cannot be undone.`,\n [\n {\n text: 'Cancel',\n style: 'cancel',\n },\n {\n text: 'Delete',\n style: 'destructive',\n onPress: () => {\n deleteConversation()\n navigation.dispatch(StackActions.popToTop())\n },\n },\n ]\n )\n }, [deleteConversation, navigation, title])\n\n const HeaderTitle = useCallback(\n (props: HeaderTitleProps) => {\n return (\n <View style={styles.headerTitleContainer}>\n <ElementsHeaderTitle {...props} />\n <Badge\n variant=\"metaSubtle\"\n label={resourceType}\n metaLabel={name}\n style={styles.headerTitleBadge}\n productLogoName={productName}\n />\n </View>\n )\n },\n [name, productName, resourceType, styles.headerTitleBadge, styles.headerTitleContainer]\n )\n\n const HeaderRight = useCallback(() => {\n return (\n <HeaderRightButton\n onPress={() => {\n saveTitle({ title: trimmedTitle || conversation.title })\n navigation.goBack()\n }}\n >\n Done\n </HeaderRightButton>\n )\n }, [conversation.title, navigation, saveTitle, trimmedTitle])\n\n useEffect(() => {\n navigation.setOptions({\n headerRight: HeaderRight,\n headerTitle: HeaderTitle,\n })\n }, [HeaderRight, HeaderTitle, navigation])\n\n const listData = [\n {\n type: SectionTypes.view,\n data: {\n children: (\n <TitleInput\n canUpdate={canUpdate}\n title={title}\n setTitle={setTitle}\n isEmpty={emptyTitle}\n />\n ),\n },\n sectionInnerStyle: styles.sectionInnerTitleInput,\n },\n {\n type: SectionTypes.header,\n data: { title: 'Settings' },\n showBottomBorder: true,\n sectionInnerStyle: styles.sectionInnerHeaderWithBottomBorder,\n },\n {\n type: SectionTypes.setting,\n data: {\n title: 'Mute',\n rightItem: <Switch value={muted} onChange={() => setMuted(!muted)} />,\n },\n showBottomBorder: true,\n },\n {\n type: canUpdate ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Freeze converation',\n subtitle: 'Disables replies for everyone except leaders.',\n rightItem: (\n <Switch value={repliesDisabled} onChange={() => setRepliesDisabled(!repliesDisabled)} />\n ),\n },\n showBottomBorder: true,\n },\n {\n type: canDelete ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Delete conversation…',\n buttonTextStyle: styles.deleteButtonText,\n appearance: 'danger',\n onPress: handleDelete,\n },\n },\n {\n type: hasTeams ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Teams' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasTeams ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <TeamsGroup teams={teamsGroup} />,\n },\n },\n {\n type: SectionTypes.header,\n data: { title: 'People' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasChildren && isLeader ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <ChildNotice childMembers={childMembers} />,\n },\n sectionInnerStyle: styles.sectionInnerChildNotice,\n },\n ...memberItems,\n ].filter(item => item.type !== SectionTypes.hidden)\n\n const headerIndices = listData\n .map(({ type }, index) => (type === SectionTypes.header ? index : undefined))\n .filter(isDefined)\n\n return (\n <View style={styles.listContainer}>\n <FlashList\n data={listData as SectionListData}\n estimatedItemSize={52}\n contentContainerStyle={styles.contentContainer}\n renderItem={({ item, index }) => {\n const [isStart, isEnd] = [\n index === 0 || headerIndices.includes(index),\n index === listData.length - 1 || headerIndices.includes(index + 1),\n ]\n\n switch (item.type) {\n case SectionTypes.header:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Heading variant=\"h3\">{item.data.title}</Heading>\n </ListSection>\n )\n case SectionTypes.members:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Person person={{ ...item.data }} />\n </ListSection>\n )\n case SectionTypes.setting:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <SettingRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.view:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <View {...item.data} style={item.data.style} />\n </ListSection>\n )\n default:\n return null\n }\n }}\n />\n </View>\n )\n}\n\ninterface ListSectionProps {\n isStart?: boolean\n isEnd?: boolean\n showBottomBorder?: boolean\n outerStyle?: ViewStyle\n innerStyle?: ViewStyle\n children: ReactNode\n}\n\nfunction ListSection({\n isStart,\n isEnd,\n showBottomBorder,\n outerStyle,\n innerStyle,\n children,\n}: ListSectionProps) {\n const styles = useStyles({ isStart, isEnd })\n const bottomBorder = showBottomBorder ? styles.sectionInnerBottomBorder : {}\n\n return (\n <View style={[styles.sectionOuterBase, outerStyle]}>\n <View style={[styles.sectionInnerBase, bottomBorder, innerStyle]}>{children}</View>\n </View>\n )\n}\n\ninterface InputProps {\n canUpdate: boolean\n title: string\n setTitle: Dispatch<SetStateAction<string>>\n style?: ViewStyle\n isEmpty: boolean\n}\n\nfunction TitleInput({ canUpdate, title, setTitle, style, isEmpty }: InputProps) {\n const styles = useStyles()\n const textRef = useRef<TextInput>(null)\n\n const handleFocus = () => {\n if (textRef.current) {\n textRef.current.focus()\n }\n }\n\n return (\n <Pressable style={[styles.titleContainer, style]} onPress={() => handleFocus()}>\n <View style={styles.titleLabelContainer}>\n <Text variant=\"tertiary\" style={styles.titleLabel}>\n Title\n </Text>\n {!canUpdate && <Icon name=\"general.lock\" style={styles.titleDisabledIcon} />}\n </View>\n <TextInput\n ref={textRef}\n editable={canUpdate}\n onChangeText={setTitle}\n style={[styles.titleInput, !canUpdate && styles.titleInputDisabled]}\n value={title}\n multiline\n maxLength={255} // Matches Chat Web\n enterKeyHint=\"done\"\n submitBehavior=\"blurAndSubmit\"\n />\n {isEmpty && (\n <Text variant=\"footnote\" style={styles.inputValidationText}>\n A title is required for your conversation.\n </Text>\n )}\n </Pressable>\n )\n}\n\ninterface SettingRowProps {\n title: string\n style?: ViewStyle\n rightItem?: ReactNode\n titleStyle?: TextStyle\n buttonTextStyle?: TextStyle\n subtitle?: string\n rightItemStyle?: ViewStyle\n appearance?: ButtonAppearanceUnion\n onPress?: () => void\n}\n\nfunction SettingRow({\n title,\n style,\n titleStyle = {},\n buttonTextStyle = {},\n subtitle,\n rightItem,\n rightItemStyle = {},\n appearance,\n onPress,\n}: SettingRowProps) {\n const styles = useStyles()\n\n if (onPress) {\n return (\n <TextButton\n style={[styles.settingRow, style]}\n textStyle={buttonTextStyle}\n appearance={appearance}\n onPress={onPress}\n >\n {title}\n </TextButton>\n )\n }\n\n return (\n <View style={[styles.settingRow, style]}>\n <View style={styles.settingRowContent}>\n <Text variant=\"plain\" style={[styles.settingRowText, titleStyle]}>\n {title}\n </Text>\n {Boolean(subtitle) && <Text variant=\"footnote\">{subtitle}</Text>}\n </View>\n {Boolean(rightItem) && <View style={rightItemStyle}>{rightItem}</View>}\n </View>\n )\n}\n\nfunction TeamsGroup({ teams }: { teams: GroupResource[] }) {\n const styles = useStyles()\n\n if (teams.length === 0) return null\n\n return (\n <View style={styles.teamGroup}>\n {teams.map((team, index) => (\n <Badge key={index} label={team.name as string} />\n ))}\n </View>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ isStart, isEnd }: { isStart?: boolean; isEnd?: boolean } = {}) => {\n const { colors } = useTheme()\n const headerBottomPadding = space(0.5)\n\n return StyleSheet.create({\n listContainer: {\n flex: 1,\n backgroundColor: colors.fillColorNeutral080,\n },\n contentContainer: {\n padding: space(2),\n },\n sectionOuterBase: {\n paddingLeft: space(2),\n backgroundColor: colors.fillColorNeutral100Inverted,\n borderTopLeftRadius: isStart ? space(1) : 0,\n borderTopRightRadius: isStart ? space(1) : 0,\n borderBottomLeftRadius: isEnd ? space(1) : 0,\n borderBottomRightRadius: isEnd ? space(1) : 0,\n marginBottom: isEnd ? space(2) : 0,\n },\n sectionInnerBase: {\n paddingRight: space(2),\n paddingTop: isStart ? space(2) : space(1.5),\n paddingBottom: isEnd ? space(2) : space(1.5),\n },\n sectionInnerHeader: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerHeaderWithBottomBorder: {\n paddingBottom: space(2),\n },\n sectionInnerBottomBorder: {\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: isEnd ? 0 : 1,\n },\n sectionInnerTitleInput: {\n paddingTop: space(1.5), // paddingVertical doesn't override the sectionInner padding\n paddingBottom: space(1.5),\n },\n sectionInnerChildNotice: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerMiddleMiddle: {\n paddingTop: 0,\n paddingBottom: space(1.5),\n },\n sectionInnerFirstMember: {\n paddingTop: space(1.5),\n paddingBottom: space(1.5),\n },\n sectionInnerLastMember: {\n paddingTop: 0,\n paddingBottom: space(2),\n },\n titleContainer: {\n gap: 4,\n },\n titleLabelContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n titleLabel: {\n color: colors.textColorDefaultSecondary,\n },\n titleDisabledIcon: {\n color: colors.iconColorDefaultSecondary,\n },\n titleInput: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n titleInputDisabled: {\n color: colors.textColorDefaultSecondary,\n },\n inputValidationText: {\n color: colors.statusErrorText,\n paddingTop: 8,\n borderTopWidth: 1,\n borderColor: colors.borderColorStatusError,\n },\n settingRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: space(1),\n },\n settingRowContent: {\n flex: 1,\n },\n deleteButtonText: {\n fontWeight: 'normal',\n },\n settingRowText: {\n lineHeight: 20,\n },\n teamGroup: {\n flexDirection: 'row',\n gap: 4,\n flexWrap: 'wrap',\n },\n headerTitleBadge: {\n alignSelf: Platform.select({ android: 'flex-start', default: 'center' }),\n marginTop: 2,\n },\n headerTitleContainer: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation_details_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_details_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EAIR,MAAM,GACP,MAAM,OAAO,CAAA;AACd,OAAO,EACL,UAAU,EACV,SAAS,EACT,IAAI,EAIJ,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAoB,MAAM,4BAA4B,CAAA;AACjG,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACnG,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,GACtB,MA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AU,EAAE;YACV,KAAK,EAAE,MAAM,CAAC,uBAAuB;YACrC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;QACD,kBAAkB,EAAE;YAClB,KAAK,EAAE,MAAM,CAAC,yBAAyB;SACxC;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,MAAM,CAAC,eAAe;YAC7B,UAAU,EAAE,CAAC;YACb,cAAc,EAAE,CAAC;YACjB,WAAW,EAAE,MAAM,CAAC,sBAAsB;SAC3C;QACD,UAAU,EAAE;YACV,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;SACd;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,CAAC;SACR;QACD,gBAAgB,EAAE;YAChB,UAAU,EAAE,QAAQ;SACrB;QACD,cAAc,EAAE;YACd,UAAU,EAAE,EAAE;SACf;QACD,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,MAAM;SACjB;QACD,gBAAgB,EAAE;YAChB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;YACxE,SAAS,EAAE,CAAC;SACb;QACD,oBAAoB,EAAE;YACpB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;SAC1E;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, {\n useCallback,\n useEffect,\n useState,\n type SetStateAction,\n type Dispatch,\n type ReactNode,\n useRef,\n} from 'react'\nimport {\n StyleSheet,\n TextInput,\n View,\n type TextStyle,\n type ViewStyle,\n type ViewProps,\n Pressable,\n Alert,\n Platform,\n} from 'react-native'\nimport { HeaderTitle as ElementsHeaderTitle, HeaderTitleProps } from '@react-navigation/elements'\nimport { Badge, ChildNotice, Heading, Icon, Person, Switch, Text, TextButton } from '../components'\nimport { useSuspenseGet, useTheme } from '../hooks'\nimport {\n useConversation,\n useConversationDelete,\n useConversationDisableReplies,\n useConversationMute,\n useConversationUpdate,\n} from '../hooks/use_conversation'\nimport { MemberResource, isDefined } from '../types'\nimport { HeaderRightButton } from '../navigation/header'\nimport { FlashList } from '@shopify/flash-list'\nimport { space } from '../utils'\nimport { tokens } from '../vendor/tapestry/tokens'\nimport { ButtonAppearanceUnion } from '../components/display/utils/button_colors'\nimport { GroupResource } from '../types/resources/group_resource'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n header,\n hidden,\n members,\n setting,\n view,\n}\n\ntype SectionListData = Array<\n | DataItem<{ title: string }, SectionTypes.header>\n | DataItem<MemberResource, SectionTypes.members>\n | DataItem<ViewProps, SectionTypes.view>\n | DataItem<SettingRowProps, SectionTypes.setting>\n | DataItem<any, SectionTypes.hidden>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionOuterStyle?: ViewStyle\n sectionInnerStyle?: ViewStyle\n showBottomBorder?: boolean\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport type ConversationDetailsScreenProps = StaticScreenProps<{\n conversation_id: number\n}>\n\nexport function ConversationDetailsScreen({ route }: ConversationDetailsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n\n const { data: conversation } = useConversation(route.params)\n const [title, setTitle] = useState(conversation.title)\n const { muted, setMuted } = useConversationMute(route.params)\n const { repliesDisabled, setRepliesDisabled } = useConversationDisableReplies(route.params)\n const { mutate: saveTitle } = useConversationUpdate(route.params)\n const { mutate: deleteConversation } = useConversationDelete(route.params)\n\n const trimmedTitle = title.trim()\n const emptyTitle = trimmedTitle === '' || title === null\n\n const canUpdate = conversation.memberAbility?.canUpdate || false\n const canDelete = conversation.memberAbility?.canDelete || false\n const isLeader = conversation.memberAbility?.leader || false\n\n const { data: members } = useSuspenseGet<MemberResource[]>({\n url: `/me/conversations/${route.params.conversation_id}/members`,\n data: {\n include: ['person'],\n fields: {\n Member: ['avatar', 'name', 'first_name', 'last_name', 'child', 'badges'],\n },\n },\n })\n\n const memberSectionStyleMap = {\n first: styles.sectionInnerFirstMember,\n middle: styles.sectionInnerMiddleMiddle,\n last: styles.sectionInnerLastMember,\n }\n\n const memberItems = members.map((data, index) => {\n const isFirst = index === 0\n const isLast = index === members.length - 1\n const memberPosition = isFirst ? 'first' : isLast ? 'last' : 'middle'\n const memberSectionStyle = memberSectionStyleMap[memberPosition]\n\n return {\n type: data.child ? SectionTypes.hidden : SectionTypes.members,\n data,\n sectionInnerStyle: memberSectionStyle,\n }\n })\n\n const childMembers = members.filter(member => member.child)\n const hasChildren = childMembers.length > 0\n\n const teamsGroup =\n conversation.groups\n ?.filter(g => g.sourceAppName === 'Services')\n ?.filter(g => ['Team', 'PlanTeam'].includes(g.sourceType))\n ?.filter(g => g.name !== null) || []\n const hasTeams = teamsGroup.length > 0\n\n const badge = conversation.badges?.[0]\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n const handleDelete = useCallback(() => {\n Alert.alert(\n 'Delete conversation',\n `All messages in ${title} will be deleted for everyone. This action cannot be undone.`,\n [\n {\n text: 'Cancel',\n style: 'cancel',\n },\n {\n text: 'Delete',\n style: 'destructive',\n onPress: () => {\n deleteConversation()\n navigation.dispatch(StackActions.popToTop())\n },\n },\n ]\n )\n }, [deleteConversation, navigation, title])\n\n const HeaderTitle = useCallback(\n (props: HeaderTitleProps) => {\n return (\n <View style={styles.headerTitleContainer}>\n <ElementsHeaderTitle {...props} />\n <Badge\n variant=\"metaSubtle\"\n label={resourceType}\n metaLabel={name}\n style={styles.headerTitleBadge}\n productLogoName={productName}\n />\n </View>\n )\n },\n [name, productName, resourceType, styles.headerTitleBadge, styles.headerTitleContainer]\n )\n\n const HeaderRight = useCallback(() => {\n return (\n <HeaderRightButton\n onPress={() => {\n saveTitle({ title: trimmedTitle || conversation.title })\n navigation.goBack()\n }}\n >\n Done\n </HeaderRightButton>\n )\n }, [conversation.title, navigation, saveTitle, trimmedTitle])\n\n useEffect(() => {\n navigation.setOptions({\n headerRight: HeaderRight,\n headerTitle: HeaderTitle,\n })\n }, [HeaderRight, HeaderTitle, navigation])\n\n const listData = [\n {\n type: SectionTypes.view,\n data: {\n children: (\n <TitleInput\n canUpdate={canUpdate}\n title={title}\n setTitle={setTitle}\n isEmpty={emptyTitle}\n />\n ),\n },\n sectionInnerStyle: styles.sectionInnerTitleInput,\n },\n {\n type: SectionTypes.header,\n data: { title: 'Settings' },\n showBottomBorder: true,\n sectionInnerStyle: styles.sectionInnerHeaderWithBottomBorder,\n },\n {\n type: SectionTypes.setting,\n data: {\n title: 'Mute',\n rightItem: <Switch value={muted} onChange={() => setMuted(!muted)} />,\n },\n showBottomBorder: true,\n },\n {\n type: canUpdate ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Freeze converation',\n subtitle: 'Disables replies for everyone except leaders.',\n rightItem: (\n <Switch value={repliesDisabled} onChange={() => setRepliesDisabled(!repliesDisabled)} />\n ),\n },\n showBottomBorder: true,\n },\n {\n type: canDelete ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Delete conversation…',\n buttonTextStyle: styles.deleteButtonText,\n appearance: 'danger',\n onPress: handleDelete,\n },\n },\n {\n type: hasTeams ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Teams' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasTeams ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <TeamsGroup teams={teamsGroup} />,\n },\n },\n {\n type: SectionTypes.header,\n data: { title: 'People' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasChildren && isLeader ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <ChildNotice childMembers={childMembers} />,\n },\n sectionInnerStyle: styles.sectionInnerChildNotice,\n },\n ...memberItems,\n ].filter(item => item.type !== SectionTypes.hidden)\n\n const headerIndices = listData\n .map(({ type }, index) => (type === SectionTypes.header ? index : undefined))\n .filter(isDefined)\n\n return (\n <View style={styles.listContainer}>\n <FlashList\n data={listData as SectionListData}\n estimatedItemSize={52}\n contentContainerStyle={styles.contentContainer}\n renderItem={({ item, index }) => {\n const [isStart, isEnd] = [\n index === 0 || headerIndices.includes(index),\n index === listData.length - 1 || headerIndices.includes(index + 1),\n ]\n\n switch (item.type) {\n case SectionTypes.header:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Heading variant=\"h3\">{item.data.title}</Heading>\n </ListSection>\n )\n case SectionTypes.members:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Person person={{ ...item.data }} />\n </ListSection>\n )\n case SectionTypes.setting:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <SettingRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.view:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <View {...item.data} style={item.data.style} />\n </ListSection>\n )\n default:\n return null\n }\n }}\n />\n </View>\n )\n}\n\ninterface ListSectionProps {\n isStart?: boolean\n isEnd?: boolean\n showBottomBorder?: boolean\n outerStyle?: ViewStyle\n innerStyle?: ViewStyle\n children: ReactNode\n}\n\nfunction ListSection({\n isStart,\n isEnd,\n showBottomBorder,\n outerStyle,\n innerStyle,\n children,\n}: ListSectionProps) {\n const styles = useStyles({ isStart, isEnd })\n const bottomBorder = showBottomBorder ? styles.sectionInnerBottomBorder : {}\n\n return (\n <View style={[styles.sectionOuterBase, outerStyle]}>\n <View style={[styles.sectionInnerBase, bottomBorder, innerStyle]}>{children}</View>\n </View>\n )\n}\n\ninterface InputProps {\n canUpdate: boolean\n title: string\n setTitle: Dispatch<SetStateAction<string>>\n style?: ViewStyle\n isEmpty: boolean\n}\n\nfunction TitleInput({ canUpdate, title, setTitle, style, isEmpty }: InputProps) {\n const styles = useStyles()\n const textRef = useRef<TextInput>(null)\n\n const handleFocus = () => {\n if (textRef.current) {\n textRef.current.focus()\n }\n }\n\n return (\n <Pressable style={[styles.titleContainer, style]} onPress={() => handleFocus()}>\n <View style={styles.titleLabelContainer}>\n <Text variant=\"tertiary\" style={styles.titleLabel}>\n Title\n </Text>\n {!canUpdate && <Icon name=\"general.lock\" style={styles.titleDisabledIcon} />}\n </View>\n <TextInput\n ref={textRef}\n editable={canUpdate}\n onChangeText={setTitle}\n style={[styles.titleInput, !canUpdate && styles.titleInputDisabled]}\n value={title}\n multiline\n maxLength={255} // Matches Chat Web\n enterKeyHint=\"done\"\n submitBehavior=\"blurAndSubmit\"\n />\n {isEmpty && (\n <Text variant=\"footnote\" style={styles.inputValidationText}>\n A title is required for your conversation.\n </Text>\n )}\n </Pressable>\n )\n}\n\ninterface SettingRowProps {\n title: string\n style?: ViewStyle\n rightItem?: ReactNode\n titleStyle?: TextStyle\n buttonTextStyle?: TextStyle\n subtitle?: string\n rightItemStyle?: ViewStyle\n appearance?: ButtonAppearanceUnion\n onPress?: () => void\n}\n\nfunction SettingRow({\n title,\n style,\n titleStyle = {},\n buttonTextStyle = {},\n subtitle,\n rightItem,\n rightItemStyle = {},\n appearance,\n onPress,\n}: SettingRowProps) {\n const styles = useStyles()\n\n if (onPress) {\n return (\n <TextButton\n style={[styles.settingRow, style]}\n textStyle={buttonTextStyle}\n appearance={appearance}\n onPress={onPress}\n >\n {title}\n </TextButton>\n )\n }\n\n return (\n <View style={[styles.settingRow, style]}>\n <View style={styles.settingRowContent}>\n <Text variant=\"plain\" style={[styles.settingRowText, titleStyle]}>\n {title}\n </Text>\n {Boolean(subtitle) && <Text variant=\"footnote\">{subtitle}</Text>}\n </View>\n {Boolean(rightItem) && <View style={rightItemStyle}>{rightItem}</View>}\n </View>\n )\n}\n\nfunction TeamsGroup({ teams }: { teams: GroupResource[] }) {\n const styles = useStyles()\n\n if (teams.length === 0) return null\n\n return (\n <View style={styles.teamGroup}>\n {teams.map((team, index) => (\n <Badge key={index} label={team.name as string} />\n ))}\n </View>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ isStart, isEnd }: { isStart?: boolean; isEnd?: boolean } = {}) => {\n const { colors } = useTheme()\n const headerBottomPadding = space(0.5)\n\n return StyleSheet.create({\n listContainer: {\n flex: 1,\n backgroundColor: colors.surfaceColor080,\n },\n contentContainer: {\n padding: space(2),\n },\n sectionOuterBase: {\n paddingLeft: space(2),\n backgroundColor: colors.surfaceColor100,\n borderTopLeftRadius: isStart ? space(1) : 0,\n borderTopRightRadius: isStart ? space(1) : 0,\n borderBottomLeftRadius: isEnd ? space(1) : 0,\n borderBottomRightRadius: isEnd ? space(1) : 0,\n marginBottom: isEnd ? space(2) : 0,\n },\n sectionInnerBase: {\n paddingRight: space(2),\n paddingTop: isStart ? space(2) : space(1.5),\n paddingBottom: isEnd ? space(2) : space(1.5),\n },\n sectionInnerHeader: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerHeaderWithBottomBorder: {\n paddingBottom: space(2),\n },\n sectionInnerBottomBorder: {\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: isEnd ? 0 : 1,\n },\n sectionInnerTitleInput: {\n paddingTop: space(1.5), // paddingVertical doesn't override the sectionInner padding\n paddingBottom: space(1.5),\n },\n sectionInnerChildNotice: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerMiddleMiddle: {\n paddingTop: 0,\n paddingBottom: space(1.5),\n },\n sectionInnerFirstMember: {\n paddingTop: space(1.5),\n paddingBottom: space(1.5),\n },\n sectionInnerLastMember: {\n paddingTop: 0,\n paddingBottom: space(2),\n },\n titleContainer: {\n gap: 4,\n },\n titleLabelContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n titleLabel: {\n color: colors.textColorDefaultSecondary,\n },\n titleDisabledIcon: {\n color: colors.iconColorDefaultSecondary,\n },\n titleInput: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n titleInputDisabled: {\n color: colors.textColorDefaultSecondary,\n },\n inputValidationText: {\n color: colors.statusErrorText,\n paddingTop: 8,\n borderTopWidth: 1,\n borderColor: colors.borderColorStatusError,\n },\n settingRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: space(1),\n },\n settingRowContent: {\n flex: 1,\n },\n deleteButtonText: {\n fontWeight: 'normal',\n },\n settingRowText: {\n lineHeight: 20,\n },\n teamGroup: {\n flexDirection: 'row',\n gap: 4,\n flexWrap: 'wrap',\n },\n headerTitleBadge: {\n alignSelf: Platform.select({ android: 'flex-start', default: 'center' }),\n marginTop: 2,\n },\n headerTitleContainer: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n },\n })\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ViewStyle } from 'react-native';
|
|
2
|
+
import { TeamProps } from '../types';
|
|
3
|
+
interface TeamRowProps {
|
|
4
|
+
data: TeamProps;
|
|
5
|
+
style?: ViewStyle;
|
|
6
|
+
accessibilityLabelledBy: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const CheckboxRow: ({ data, style, accessibilityLabelledBy }: TeamRowProps) => import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=checkbox_row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/checkbox_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAI1E,OAAO,EAA2C,SAAS,EAAE,MAAM,UAAU,CAAA;AAI7E,UAAU,YAAY;IACpB,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,uBAAuB,EAAE,MAAM,CAAA;CAChC;AAED,eAAO,MAAM,WAAW,6CAA8C,YAAY,gCAiCjF,CAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Pressable, View, StyleSheet } from 'react-native';
|
|
2
|
+
import { useTheme } from '../../../hooks';
|
|
3
|
+
import { Icon, Text } from '../../../components';
|
|
4
|
+
import { tokens } from '../../../vendor/tapestry/tokens';
|
|
5
|
+
import { useRoute } from '@react-navigation/native';
|
|
6
|
+
import { useFilterRecipientsContext } from '../context/conversation_filter_recipients_context';
|
|
7
|
+
export const CheckboxRow = ({ data, style, accessibilityLabelledBy }) => {
|
|
8
|
+
const styles = useStyles();
|
|
9
|
+
const route = useRoute();
|
|
10
|
+
const { setTeamFilters } = useFilterRecipientsContext();
|
|
11
|
+
const { teamId, teamName } = data;
|
|
12
|
+
const { team_ids: currentTeamIds } = route.params;
|
|
13
|
+
const checked = currentTeamIds?.includes(teamId) ?? false;
|
|
14
|
+
const newTeamIdAdded = [...(currentTeamIds ?? []), teamId];
|
|
15
|
+
const newTeamIdRemoved = (currentTeamIds ?? []).filter(currentId => currentId !== teamId);
|
|
16
|
+
const handlePress = () => {
|
|
17
|
+
setTeamFilters({
|
|
18
|
+
team_ids: checked ? newTeamIdRemoved : newTeamIdAdded,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
return (<Pressable style={({ pressed }) => [styles.checkboxRow, pressed && styles.checkboxRowPressed, style]} onPress={handlePress} accessibilityRole="checkbox" accessibilityState={{ checked }} accessibilityLabelledBy={accessibilityLabelledBy} accessibilityLabel={`${teamName} team`}>
|
|
22
|
+
<CheckboxIcon checked={checked}/>
|
|
23
|
+
<Text style={styles.label} numberOfLines={2}>
|
|
24
|
+
{teamName}
|
|
25
|
+
</Text>
|
|
26
|
+
</Pressable>);
|
|
27
|
+
};
|
|
28
|
+
function CheckboxIcon({ checked }) {
|
|
29
|
+
const styles = useStyles();
|
|
30
|
+
const checkedStyle = checked ? styles.checkedContainer : styles.uncheckedContainer;
|
|
31
|
+
return (<View style={checkedStyle}>
|
|
32
|
+
{checked && <Icon name="general.thickCheckmark" style={styles.checkedIcon}/>}
|
|
33
|
+
</View>);
|
|
34
|
+
}
|
|
35
|
+
const useStyles = () => {
|
|
36
|
+
const { colors } = useTheme();
|
|
37
|
+
const baseCheckboxStyles = {
|
|
38
|
+
width: 20,
|
|
39
|
+
height: 20,
|
|
40
|
+
borderRadius: 40,
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
};
|
|
44
|
+
return StyleSheet.create({
|
|
45
|
+
checkboxRow: {
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
gap: 12,
|
|
49
|
+
padding: 16,
|
|
50
|
+
borderTopWidth: 1,
|
|
51
|
+
borderTopColor: colors.borderColorDefaultDim,
|
|
52
|
+
backgroundColor: colors.surfaceColor100,
|
|
53
|
+
},
|
|
54
|
+
checkboxRowPressed: {
|
|
55
|
+
opacity: 0.5,
|
|
56
|
+
},
|
|
57
|
+
label: {
|
|
58
|
+
flex: 1,
|
|
59
|
+
},
|
|
60
|
+
checkedContainer: {
|
|
61
|
+
...baseCheckboxStyles,
|
|
62
|
+
backgroundColor: colors.statusSuccessIcon,
|
|
63
|
+
},
|
|
64
|
+
uncheckedContainer: {
|
|
65
|
+
...baseCheckboxStyles,
|
|
66
|
+
borderWidth: 2,
|
|
67
|
+
borderColor: colors.borderColorDefaultDarker,
|
|
68
|
+
},
|
|
69
|
+
checkedIcon: {
|
|
70
|
+
color: tokens.colorNeutral100White,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=checkbox_row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/checkbox_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAExD,OAAO,EAAkB,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAA;AAQ9F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,uBAAuB,EAAgB,EAAE,EAAE;IACpF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,KAAK,GAAG,QAAQ,EAA+D,CAAA;IACrF,MAAM,EAAE,cAAc,EAAE,GAAG,0BAA0B,EAAE,CAAA;IAEvD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;IACjC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IAEjD,MAAM,OAAO,GAAG,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAA;IACzD,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;IAC1D,MAAM,gBAAgB,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,MAAM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AK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAG,CAC/E;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,MAAM,kBAAkB,GAAc;QACpC,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB,CAAA;IAED,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,WAAW,EAAE;YACX,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,OAAO,EAAE,EAAE;YACX,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC,qBAAqB;YAC5C,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC;QACD,kBAAkB,EAAE;YAClB,OAAO,EAAE,GAAG;SACb;QACD,KAAK,EAAE;YACL,IAAI,EAAE,CAAC;SACR;QACD,gBAAgB,EAAE;YAChB,GAAG,kBAAkB;YACrB,eAAe,EAAE,MAAM,CAAC,iBAAiB;SAC1C;QACD,kBAAkB,EAAE;YAClB,GAAG,kBAAkB;YACrB,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,wBAAwB;SAC7C;QACD,WAAW,EAAE;YACX,KAAK,EAAE,MAAM,CAAC,oBAAoB;SACnC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { Pressable, View, StyleSheet, type ViewStyle } from 'react-native'\nimport { useTheme } from '../../../hooks'\nimport { Icon, Text } from '../../../components'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { ConversationFilterRecipientsScreenProps, TeamProps } from '../types'\nimport { type RouteProp, useRoute } from '@react-navigation/native'\nimport { useFilterRecipientsContext } from '../context/conversation_filter_recipients_context'\n\ninterface TeamRowProps {\n data: TeamProps\n style?: ViewStyle\n accessibilityLabelledBy: string\n}\n\nexport const CheckboxRow = ({ data, style, accessibilityLabelledBy }: TeamRowProps) => {\n const styles = useStyles()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const { setTeamFilters } = useFilterRecipientsContext()\n\n const { teamId, teamName } = data\n const { team_ids: currentTeamIds } = route.params\n\n const checked = currentTeamIds?.includes(teamId) ?? false\n const newTeamIdAdded = [...(currentTeamIds ?? []), teamId]\n const newTeamIdRemoved = (currentTeamIds ?? []).filter(currentId => currentId !== teamId)\n\n const handlePress = () => {\n setTeamFilters({\n team_ids: checked ? newTeamIdRemoved : newTeamIdAdded,\n })\n }\n\n return (\n <Pressable\n style={({ pressed }) => [styles.checkboxRow, pressed && styles.checkboxRowPressed, style]}\n onPress={handlePress}\n accessibilityRole=\"checkbox\"\n accessibilityState={{ checked }}\n accessibilityLabelledBy={accessibilityLabelledBy}\n accessibilityLabel={`${teamName} team`}\n >\n <CheckboxIcon checked={checked} />\n <Text style={styles.label} numberOfLines={2}>\n {teamName}\n </Text>\n </Pressable>\n )\n}\n\nfunction CheckboxIcon({ checked }: { checked: boolean }) {\n const styles = useStyles()\n const checkedStyle = checked ? styles.checkedContainer : styles.uncheckedContainer\n\n return (\n <View style={checkedStyle}>\n {checked && <Icon name=\"general.thickCheckmark\" style={styles.checkedIcon} />}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n const baseCheckboxStyles: ViewStyle = {\n width: 20,\n height: 20,\n borderRadius: 40,\n alignItems: 'center',\n justifyContent: 'center',\n }\n\n return StyleSheet.create({\n checkboxRow: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n padding: 16,\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultDim,\n backgroundColor: colors.surfaceColor100,\n },\n checkboxRowPressed: {\n opacity: 0.5,\n },\n label: {\n flex: 1,\n },\n checkedContainer: {\n ...baseCheckboxStyles,\n backgroundColor: colors.statusSuccessIcon,\n },\n uncheckedContainer: {\n ...baseCheckboxStyles,\n borderWidth: 2,\n borderColor: colors.borderColorDefaultDarker,\n },\n checkedIcon: {\n color: tokens.colorNeutral100White,\n },\n })\n}\n"]}
|