@planningcenter/chat-react-native 3.42.3-qa-staging.0 → 3.42.3-qa-staging.2
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/attachments/attachment_card.d.ts +3 -3
- package/build/components/conversation/attachments/attachment_card.d.ts.map +1 -1
- package/build/components/conversation/attachments/attachment_card.js +3 -7
- package/build/components/conversation/attachments/attachment_card.js.map +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts +1 -2
- package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts.map +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.js +12 -7
- package/build/components/conversation/attachments/attachment_deleting_overlay.js.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.d.ts +1 -2
- package/build/components/conversation/attachments/audio_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.js +6 -23
- package/build/components/conversation/attachments/audio_attachment.js.map +1 -1
- package/build/components/conversation/attachments/expanded_link.d.ts +1 -2
- package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -1
- package/build/components/conversation/attachments/expanded_link.js +2 -8
- package/build/components/conversation/attachments/expanded_link.js.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts +1 -2
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.js +2 -12
- package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts +1 -2
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.js +2 -7
- package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
- package/build/components/conversation/attachments/image_attachment.d.ts +1 -2
- package/build/components/conversation/attachments/image_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/image_attachment.js +16 -53
- package/build/components/conversation/attachments/image_attachment.js.map +1 -1
- package/build/components/conversation/attachments/video_attachment.d.ts +1 -2
- package/build/components/conversation/attachments/video_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/video_attachment.js +3 -13
- package/build/components/conversation/attachments/video_attachment.js.map +1 -1
- package/build/components/conversation/conversation_start_banner.d.ts +1 -2
- package/build/components/conversation/conversation_start_banner.d.ts.map +1 -1
- package/build/components/conversation/conversation_start_banner.js +2 -14
- package/build/components/conversation/conversation_start_banner.js.map +1 -1
- package/build/components/conversation/empty_conversation_blank_state.d.ts +1 -1
- package/build/components/conversation/empty_conversation_blank_state.d.ts.map +1 -1
- package/build/components/conversation/empty_conversation_blank_state.js +2 -9
- package/build/components/conversation/empty_conversation_blank_state.js.map +1 -1
- package/build/components/conversation/jump_to_bottom_button.d.ts +1 -1
- package/build/components/conversation/jump_to_bottom_button.d.ts.map +1 -1
- package/build/components/conversation/jump_to_bottom_button.js +2 -10
- package/build/components/conversation/jump_to_bottom_button.js.map +1 -1
- package/build/components/conversation/message.d.ts +1 -2
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +2 -53
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_attachments.d.ts +1 -2
- package/build/components/conversation/message_attachments.d.ts.map +1 -1
- package/build/components/conversation/message_attachments.js +17 -21
- package/build/components/conversation/message_attachments.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_file.d.ts +1 -2
- package/build/components/conversation/message_form/message_form_attachment_file.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_file.js +2 -2
- package/build/components/conversation/message_form/message_form_attachment_file.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts +1 -2
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_image.js +2 -2
- package/build/components/conversation/message_form/message_form_attachment_image.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_video.d.ts +1 -2
- package/build/components/conversation/message_form/message_form_attachment_video.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_video.js +2 -2
- package/build/components/conversation/message_form/message_form_attachment_video.js.map +1 -1
- package/build/components/conversation/message_form.d.ts +5 -6
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +20 -82
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_markdown.d.ts +1 -2
- package/build/components/conversation/message_markdown.d.ts.map +1 -1
- package/build/components/conversation/message_markdown.js +8 -16
- package/build/components/conversation/message_markdown.js.map +1 -1
- package/build/components/conversation/message_reaction.d.ts +1 -2
- package/build/components/conversation/message_reaction.d.ts.map +1 -1
- package/build/components/conversation/message_reaction.js +3 -5
- package/build/components/conversation/message_reaction.js.map +1 -1
- package/build/components/conversation/message_read_receipts.d.ts +1 -2
- package/build/components/conversation/message_read_receipts.d.ts.map +1 -1
- package/build/components/conversation/message_read_receipts.js +3 -13
- package/build/components/conversation/message_read_receipts.js.map +1 -1
- package/build/components/conversation/messages_disabled_banners.d.ts +7 -3
- package/build/components/conversation/messages_disabled_banners.d.ts.map +1 -1
- package/build/components/conversation/messages_disabled_banners.js +11 -11
- package/build/components/conversation/messages_disabled_banners.js.map +1 -1
- package/build/components/conversation/reply_connectors.d.ts +2 -2
- package/build/components/conversation/reply_connectors.d.ts.map +1 -1
- package/build/components/conversation/reply_connectors.js +18 -50
- package/build/components/conversation/reply_connectors.js.map +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts +1 -2
- package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
- package/build/components/conversation/reply_shadow_message.js +16 -46
- package/build/components/conversation/reply_shadow_message.js.map +1 -1
- package/build/components/conversation/system_message.d.ts +1 -2
- package/build/components/conversation/system_message.d.ts.map +1 -1
- package/build/components/conversation/system_message.js +3 -12
- package/build/components/conversation/system_message.js.map +1 -1
- package/build/components/conversation/typing_indicator.d.ts +1 -2
- package/build/components/conversation/typing_indicator.d.ts.map +1 -1
- package/build/components/conversation/typing_indicator.js +3 -13
- package/build/components/conversation/typing_indicator.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 +4 -10
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts +2 -3
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +7 -37
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/conversations.d.ts +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +16 -17
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/conversations/conversations_blank_state.d.ts +1 -2
- package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
- package/build/components/conversations/conversations_blank_state.js +2 -12
- package/build/components/conversations/conversations_blank_state.js.map +1 -1
- package/build/components/conversations/mute_indicator.d.ts +1 -2
- package/build/components/conversations/mute_indicator.d.ts.map +1 -1
- package/build/components/conversations/mute_indicator.js +2 -2
- package/build/components/conversations/mute_indicator.js.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts +1 -2
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.js +3 -10
- package/build/components/conversations/swipeable_toggle_button.js.map +1 -1
- package/build/components/conversations/unread_count_badge.d.ts +1 -2
- package/build/components/conversations/unread_count_badge.d.ts.map +1 -1
- package/build/components/conversations/unread_count_badge.js +3 -7
- package/build/components/conversations/unread_count_badge.js.map +1 -1
- package/build/components/display/action_button.d.ts +1 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +3 -13
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/adult_requirement_notice.d.ts +1 -2
- package/build/components/display/adult_requirement_notice.d.ts.map +1 -1
- package/build/components/display/adult_requirement_notice.js +2 -4
- package/build/components/display/adult_requirement_notice.js.map +1 -1
- package/build/components/display/avatar.d.ts +1 -2
- package/build/components/display/avatar.d.ts.map +1 -1
- package/build/components/display/avatar.js +2 -7
- package/build/components/display/avatar.js.map +1 -1
- package/build/components/display/avatar_group.d.ts +1 -2
- package/build/components/display/avatar_group.d.ts.map +1 -1
- package/build/components/display/avatar_group.js +2 -9
- package/build/components/display/avatar_group.js.map +1 -1
- package/build/components/display/badge.d.ts +1 -2
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +6 -37
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/banner.d.ts +3 -3
- package/build/components/display/banner.d.ts.map +1 -1
- package/build/components/display/banner.js +4 -11
- package/build/components/display/banner.js.map +1 -1
- package/build/components/display/banner_collapsible.d.ts +2 -2
- package/build/components/display/banner_collapsible.d.ts.map +1 -1
- package/build/components/display/banner_collapsible.js +2 -10
- package/build/components/display/banner_collapsible.js.map +1 -1
- package/build/components/display/button.d.ts +1 -2
- package/build/components/display/button.d.ts.map +1 -1
- package/build/components/display/button.js +3 -14
- package/build/components/display/button.js.map +1 -1
- package/build/components/display/child_notice.d.ts +1 -2
- package/build/components/display/child_notice.d.ts.map +1 -1
- package/build/components/display/child_notice.js +3 -15
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/display/conversation_avatar.d.ts +1 -2
- package/build/components/display/conversation_avatar.d.ts.map +1 -1
- package/build/components/display/conversation_avatar.js +5 -9
- package/build/components/display/conversation_avatar.js.map +1 -1
- package/build/components/display/emoji_avatar.d.ts +1 -2
- package/build/components/display/emoji_avatar.d.ts.map +1 -1
- package/build/components/display/emoji_avatar.js +2 -12
- package/build/components/display/emoji_avatar.js.map +1 -1
- package/build/components/display/file_attachment_preview.d.ts +1 -1
- package/build/components/display/file_attachment_preview.d.ts.map +1 -1
- package/build/components/display/file_attachment_preview.js +3 -17
- package/build/components/display/file_attachment_preview.js.map +1 -1
- package/build/components/display/heading.d.ts +1 -2
- package/build/components/display/heading.d.ts.map +1 -1
- package/build/components/display/heading.js +2 -4
- package/build/components/display/heading.js.map +1 -1
- package/build/components/display/icon.d.ts +1 -2
- package/build/components/display/icon.d.ts.map +1 -1
- package/build/components/display/icon.js +4 -4
- package/build/components/display/icon.js.map +1 -1
- package/build/components/display/icon_avatar.d.ts +1 -2
- package/build/components/display/icon_avatar.d.ts.map +1 -1
- package/build/components/display/icon_avatar.js +2 -12
- package/build/components/display/icon_avatar.js.map +1 -1
- package/build/components/display/icon_button.d.ts +1 -2
- package/build/components/display/icon_button.d.ts.map +1 -1
- package/build/components/display/icon_button.js +3 -5
- package/build/components/display/icon_button.js.map +1 -1
- package/build/components/display/image.d.ts +1 -2
- package/build/components/display/image.d.ts.map +1 -1
- package/build/components/display/image.js +3 -7
- package/build/components/display/image.js.map +1 -1
- package/build/components/display/image_attachment_preview.d.ts +1 -1
- package/build/components/display/image_attachment_preview.d.ts.map +1 -1
- package/build/components/display/image_attachment_preview.js +2 -7
- package/build/components/display/image_attachment_preview.js.map +1 -1
- package/build/components/display/keyboard_view.d.ts +1 -2
- package/build/components/display/keyboard_view.d.ts.map +1 -1
- package/build/components/display/keyboard_view.js +4 -9
- package/build/components/display/keyboard_view.js.map +1 -1
- package/build/components/display/person.d.ts +1 -2
- package/build/components/display/person.d.ts.map +1 -1
- package/build/components/display/person.js +2 -12
- package/build/components/display/person.js.map +1 -1
- package/build/components/display/platform_modal_header_buttons.d.ts +3 -3
- package/build/components/display/platform_modal_header_buttons.d.ts.map +1 -1
- package/build/components/display/platform_modal_header_buttons.js +5 -10
- package/build/components/display/platform_modal_header_buttons.js.map +1 -1
- package/build/components/display/pressable_row.d.ts +1 -1
- package/build/components/display/pressable_row.d.ts.map +1 -1
- package/build/components/display/pressable_row.js +2 -7
- package/build/components/display/pressable_row.js.map +1 -1
- package/build/components/display/spinner.d.ts +1 -2
- package/build/components/display/spinner.d.ts.map +1 -1
- package/build/components/display/spinner.js +3 -9
- package/build/components/display/spinner.js.map +1 -1
- package/build/components/display/switch.d.ts +1 -2
- package/build/components/display/switch.d.ts.map +1 -1
- package/build/components/display/switch.js +2 -2
- package/build/components/display/switch.js.map +1 -1
- package/build/components/display/tabs.d.ts +1 -1
- package/build/components/display/tabs.d.ts.map +1 -1
- package/build/components/display/tabs.js +21 -31
- package/build/components/display/tabs.js.map +1 -1
- package/build/components/display/text.d.ts +1 -2
- package/build/components/display/text.d.ts.map +1 -1
- package/build/components/display/text.js +2 -4
- package/build/components/display/text.js.map +1 -1
- package/build/components/display/text_button.d.ts +1 -2
- package/build/components/display/text_button.d.ts.map +1 -1
- package/build/components/display/text_button.js +3 -8
- package/build/components/display/text_button.js.map +1 -1
- package/build/components/display/text_inline_button.d.ts +1 -2
- package/build/components/display/text_inline_button.d.ts.map +1 -1
- package/build/components/display/text_inline_button.js +4 -5
- package/build/components/display/text_inline_button.js.map +1 -1
- package/build/components/display/text_input.d.ts +1 -1
- package/build/components/display/text_input.d.ts.map +1 -1
- package/build/components/display/text_input.js +2 -1
- package/build/components/display/text_input.js.map +1 -1
- package/build/components/display/toggle_button.d.ts +1 -2
- package/build/components/display/toggle_button.d.ts.map +1 -1
- package/build/components/display/toggle_button.js +3 -9
- package/build/components/display/toggle_button.js.map +1 -1
- package/build/components/display/video_attachment_preview.d.ts +1 -1
- package/build/components/display/video_attachment_preview.d.ts.map +1 -1
- package/build/components/display/video_attachment_preview.js +3 -20
- package/build/components/display/video_attachment_preview.js.map +1 -1
- package/build/components/group_conversation_list.d.ts +1 -1
- package/build/components/group_conversation_list.d.ts.map +1 -1
- package/build/components/group_conversation_list.js +4 -14
- package/build/components/group_conversation_list.js.map +1 -1
- package/build/components/page/component_error_boundary.d.ts +2 -2
- package/build/components/page/component_error_boundary.d.ts.map +1 -1
- package/build/components/page/component_error_boundary.js +2 -4
- package/build/components/page/component_error_boundary.js.map +1 -1
- package/build/components/page/loading.d.ts +1 -2
- package/build/components/page/loading.d.ts.map +1 -1
- package/build/components/page/loading.js +2 -4
- package/build/components/page/loading.js.map +1 -1
- package/build/components/page/page_error_boundary.d.ts +2 -2
- package/build/components/page/page_error_boundary.d.ts.map +1 -1
- package/build/components/page/page_error_boundary.js +11 -32
- package/build/components/page/page_error_boundary.js.map +1 -1
- package/build/components/primitive/avatar_primitive.js +14 -41
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/components/primitive/banner_primitive.js +10 -18
- package/build/components/primitive/banner_primitive.js.map +1 -1
- package/build/components/primitive/blank_state_primitive.js +8 -12
- package/build/components/primitive/blank_state_primitive.js.map +1 -1
- package/build/components/primitive/form_sheet.d.ts +1 -1
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.js +9 -22
- package/build/components/primitive/form_sheet.js.map +1 -1
- package/build/components/safe_area_modal.d.ts +1 -1
- package/build/components/safe_area_modal.d.ts.map +1 -1
- package/build/components/safe_area_modal.js +2 -3
- package/build/components/safe_area_modal.js.map +1 -1
- package/build/contexts/api_provider.d.ts +1 -2
- package/build/contexts/api_provider.d.ts.map +1 -1
- package/build/contexts/api_provider.js +3 -5
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts +2 -1
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +9 -2
- package/build/contexts/chat_context.js.map +1 -1
- package/build/contexts/conversation_context.d.ts +2 -2
- package/build/contexts/conversation_context.d.ts.map +1 -1
- package/build/contexts/conversation_context.js +3 -2
- package/build/contexts/conversation_context.js.map +1 -1
- package/build/contexts/conversations_context.d.ts +2 -2
- package/build/contexts/conversations_context.d.ts.map +1 -1
- package/build/contexts/conversations_context.js +3 -2
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/contexts/session_context.d.ts +1 -1
- package/build/contexts/session_context.d.ts.map +1 -1
- package/build/contexts/session_context.js +3 -2
- package/build/contexts/session_context.js.map +1 -1
- package/build/hooks/direct_messages/find_direct_message_conversation.d.ts +14 -0
- package/build/hooks/direct_messages/find_direct_message_conversation.d.ts.map +1 -0
- package/build/hooks/direct_messages/find_direct_message_conversation.js +10 -0
- package/build/hooks/direct_messages/find_direct_message_conversation.js.map +1 -0
- package/build/hooks/direct_messages/resolve_message_available_members_link.d.ts +16 -0
- package/build/hooks/direct_messages/resolve_message_available_members_link.d.ts.map +1 -0
- package/build/hooks/direct_messages/resolve_message_available_members_link.js +24 -0
- package/build/hooks/direct_messages/resolve_message_available_members_link.js.map +1 -0
- package/build/hooks/direct_messages/use_find_or_create_direct_message_conversation.d.ts.map +1 -1
- package/build/hooks/direct_messages/use_find_or_create_direct_message_conversation.js +1 -8
- package/build/hooks/direct_messages/use_find_or_create_direct_message_conversation.js.map +1 -1
- package/build/hooks/direct_messages/use_message_available_members.d.ts +6 -0
- package/build/hooks/direct_messages/use_message_available_members.d.ts.map +1 -0
- package/build/hooks/direct_messages/use_message_available_members.js +40 -0
- package/build/hooks/direct_messages/use_message_available_members.js.map +1 -0
- package/build/hooks/direct_messages/use_message_available_members_action.d.ts +6 -0
- package/build/hooks/direct_messages/use_message_available_members_action.d.ts.map +1 -0
- package/build/hooks/direct_messages/use_message_available_members_action.js +30 -0
- package/build/hooks/direct_messages/use_message_available_members_action.js.map +1 -0
- package/build/hooks/index.d.ts +1 -1
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use_animated_message_background_color.d.ts +2 -2
- package/build/hooks/use_conversation.d.ts +1 -1
- 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_conversation_membership.d.ts +1 -1
- package/build/hooks/use_conversation_membership.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts +36 -36
- package/build/hooks/use_current_person.d.ts.map +1 -1
- package/build/hooks/use_current_person.js +1 -0
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/hooks/use_direct_messages_eligible.d.ts +2 -0
- package/build/hooks/use_direct_messages_eligible.d.ts.map +1 -0
- package/build/hooks/use_direct_messages_eligible.js +9 -0
- package/build/hooks/use_direct_messages_eligible.js.map +1 -0
- package/build/hooks/use_features.d.ts +0 -1
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +0 -1
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_person_settings.d.ts +1 -1
- package/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/navigation/chat_access_gate.d.ts +2 -2
- package/build/navigation/chat_access_gate.d.ts.map +1 -1
- package/build/navigation/chat_access_gate.js +6 -5
- package/build/navigation/chat_access_gate.js.map +1 -1
- package/build/navigation/index.d.ts +37 -39
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +21 -23
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/screenLayout.d.ts +2 -2
- package/build/navigation/screenLayout.d.ts.map +1 -1
- package/build/navigation/screenLayout.js +3 -9
- package/build/navigation/screenLayout.js.map +1 -1
- package/build/polyfills/events/EventTarget.d.ts +1 -1
- package/build/polyfills/events/EventTarget.d.ts.map +1 -1
- package/build/polyfills/events/EventTarget.js.map +1 -1
- package/build/screens/age_check/age_check_required_screen.d.ts +1 -2
- package/build/screens/age_check/age_check_required_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_required_screen.js +3 -46
- package/build/screens/age_check/age_check_required_screen.js.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.d.ts +1 -2
- package/build/screens/age_check/age_check_underage_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.js +2 -25
- package/build/screens/age_check/age_check_underage_screen.js.map +1 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts +1 -2
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts.map +1 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js +6 -25
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts +1 -2
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js +3 -5
- package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts +1 -2
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts.map +1 -1
- package/build/screens/avatar_picker/avatar_picker_screen.js +9 -36
- package/build/screens/avatar_picker/avatar_picker_screen.js.map +1 -1
- package/build/screens/avatar_picker/avatar_preview.d.ts +1 -1
- package/build/screens/avatar_picker/avatar_preview.d.ts.map +1 -1
- package/build/screens/avatar_picker/avatar_preview.js +5 -9
- package/build/screens/avatar_picker/avatar_preview.js.map +1 -1
- package/build/screens/avatar_picker/color_picker.d.ts +1 -2
- package/build/screens/avatar_picker/color_picker.d.ts.map +1 -1
- package/build/screens/avatar_picker/color_picker.js +4 -5
- package/build/screens/avatar_picker/color_picker.js.map +1 -1
- package/build/screens/avatar_picker/emoji_tab.d.ts +1 -2
- package/build/screens/avatar_picker/emoji_tab.d.ts.map +1 -1
- package/build/screens/avatar_picker/emoji_tab.js +12 -13
- package/build/screens/avatar_picker/emoji_tab.js.map +1 -1
- package/build/screens/avatar_picker/icon_grid.d.ts +1 -2
- package/build/screens/avatar_picker/icon_grid.d.ts.map +1 -1
- package/build/screens/avatar_picker/icon_grid.js +4 -5
- package/build/screens/avatar_picker/icon_grid.js.map +1 -1
- package/build/screens/avatar_picker/upload_tab.d.ts +1 -2
- package/build/screens/avatar_picker/upload_tab.d.ts.map +1 -1
- package/build/screens/avatar_picker/upload_tab.js +3 -4
- package/build/screens/avatar_picker/upload_tab.js.map +1 -1
- package/build/screens/bug_report_screen.d.ts +1 -2
- package/build/screens/bug_report_screen.d.ts.map +1 -1
- package/build/screens/bug_report_screen.js +11 -117
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.d.ts +1 -2
- package/build/screens/conversation/message_read_receipts_screen.d.ts.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.js +4 -20
- package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts +1 -2
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +43 -106
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js +3 -9
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.js +2 -12
- package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +1 -2
- 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 +20 -44
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts +1 -2
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +13 -14
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts +6 -6
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +7 -34
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.js +2 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts +1 -2
- package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/group_filters.js +2 -2
- package/build/screens/conversation_filters/group_filters.js.map +1 -1
- package/build/screens/conversation_filters/team_filters.d.ts +1 -2
- package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/team_filters.js +2 -2
- package/build/screens/conversation_filters/team_filters.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts +1 -2
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +4 -16
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/conversation_new/components/avatar_selection_row.d.ts +2 -3
- package/build/screens/conversation_new/components/avatar_selection_row.d.ts.map +1 -1
- package/build/screens/conversation_new/components/avatar_selection_row.js +6 -16
- package/build/screens/conversation_new/components/avatar_selection_row.js.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.d.ts +3 -4
- package/build/screens/conversation_new/components/filter_by_plan.d.ts.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.js +22 -46
- package/build/screens/conversation_new/components/filter_by_plan.js.map +1 -1
- package/build/screens/conversation_new/components/form_list.d.ts +2 -3
- package/build/screens/conversation_new/components/form_list.d.ts.map +1 -1
- package/build/screens/conversation_new/components/form_list.js +4 -6
- package/build/screens/conversation_new/components/form_list.js.map +1 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts +1 -2
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts.map +1 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.js +4 -20
- package/build/screens/conversation_new/components/gender_filter_toggle.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts +1 -2
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +4 -30
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts +1 -2
- package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +27 -61
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.d.ts +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.d.ts.map +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.js +2 -3
- package/build/screens/conversation_new/components/source_app_error_card.js.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts +1 -2
- package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.js +4 -4
- package/build/screens/conversation_new/conversation_new_screen.js.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.d.ts +1 -2
- package/build/screens/conversation_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.js +4 -6
- package/build/screens/conversation_notification_level_select_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +2 -3
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +26 -65
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js +2 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts +1 -2
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js +2 -15
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts +1 -2
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js +2 -14
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js +2 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js +2 -5
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts +1 -2
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js +4 -11
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js +24 -85
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts +1 -2
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +7 -14
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts +1 -2
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +15 -18
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts +2 -0
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/types/screen_props.js.map +1 -1
- package/build/screens/conversation_select_type_screen.d.ts +1 -2
- package/build/screens/conversation_select_type_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_type_screen.js +7 -17
- package/build/screens/conversation_select_type_screen.js.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.d.ts +1 -2
- package/build/screens/conversations/components/chat_group_badge.d.ts.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.js +3 -4
- package/build/screens/conversations/components/chat_group_badge.js.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.d.ts +1 -2
- package/build/screens/conversations/components/list_header_action_button.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.js +3 -5
- package/build/screens/conversations/components/list_header_action_button.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.d.ts +1 -2
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +22 -45
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +1 -2
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +2 -6
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/design_system_screen.d.ts +1 -2
- package/build/screens/design_system_screen.d.ts.map +1 -1
- package/build/screens/design_system_screen.js +35 -558
- package/build/screens/design_system_screen.js.map +1 -1
- package/build/screens/get_help_screen.d.ts +1 -1
- package/build/screens/get_help_screen.d.ts.map +1 -1
- package/build/screens/get_help_screen.js +4 -25
- package/build/screens/get_help_screen.js.map +1 -1
- package/build/screens/group_notification_level_select_screen.d.ts +1 -2
- package/build/screens/group_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/group_notification_level_select_screen.js +2 -4
- package/build/screens/group_notification_level_select_screen.js.map +1 -1
- package/build/screens/group_notification_settings_screen.d.ts +1 -2
- package/build/screens/group_notification_settings_screen.d.ts.map +1 -1
- package/build/screens/group_notification_settings_screen.js +3 -25
- package/build/screens/group_notification_settings_screen.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts +1 -2
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js +12 -28
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/message_report/components/message_preview.d.ts +1 -2
- package/build/screens/message_report/components/message_preview.d.ts.map +1 -1
- package/build/screens/message_report/components/message_preview.js +2 -22
- package/build/screens/message_report/components/message_preview.js.map +1 -1
- package/build/screens/message_report/components/report_reason_list.d.ts +1 -2
- package/build/screens/message_report/components/report_reason_list.d.ts.map +1 -1
- package/build/screens/message_report/components/report_reason_list.js +4 -13
- package/build/screens/message_report/components/report_reason_list.js.map +1 -1
- package/build/screens/message_report_screen.d.ts +1 -2
- package/build/screens/message_report_screen.d.ts.map +1 -1
- package/build/screens/message_report_screen.js +9 -61
- package/build/screens/message_report_screen.js.map +1 -1
- package/build/screens/not_found.d.ts +1 -2
- package/build/screens/not_found.d.ts.map +1 -1
- package/build/screens/not_found.js +2 -5
- package/build/screens/not_found.js.map +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts.map +1 -1
- package/build/screens/notification_settings_screen.d.ts +1 -2
- package/build/screens/notification_settings_screen.d.ts.map +1 -1
- package/build/screens/notification_settings_screen.js +28 -66
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/preferred_app_selection_screen.d.ts +1 -2
- package/build/screens/preferred_app_selection_screen.d.ts.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +3 -21
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/build/screens/reactions_screen.d.ts +1 -2
- package/build/screens/reactions_screen.d.ts.map +1 -1
- package/build/screens/reactions_screen.js +7 -19
- package/build/screens/reactions_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.d.ts +1 -2
- package/build/screens/send_giphy_screen.d.ts.map +1 -1
- package/build/screens/send_giphy_screen.js +5 -31
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/build/screens/settings_screen.d.ts +1 -2
- package/build/screens/settings_screen.d.ts.map +1 -1
- package/build/screens/settings_screen.js +6 -28
- package/build/screens/settings_screen.js.map +1 -1
- package/build/screens/system_message_people_screen.d.ts +1 -2
- package/build/screens/system_message_people_screen.d.ts.map +1 -1
- package/build/screens/system_message_people_screen.js +4 -10
- package/build/screens/system_message_people_screen.js.map +1 -1
- package/build/screens/team_conversation_screen.d.ts +1 -1
- package/build/screens/team_conversation_screen.d.ts.map +1 -1
- package/build/screens/team_conversation_screen.js +4 -12
- package/build/screens/team_conversation_screen.js.map +1 -1
- package/build/types/resources/direct_message_candidate.d.ts +1 -0
- package/build/types/resources/direct_message_candidate.d.ts.map +1 -1
- package/build/types/resources/direct_message_candidate.js.map +1 -1
- package/build/types/resources/member.d.ts +1 -0
- package/build/types/resources/member.d.ts.map +1 -1
- package/build/types/resources/member.js.map +1 -1
- package/build/types/resources/member_ability.d.ts +1 -0
- package/build/types/resources/member_ability.d.ts.map +1 -1
- package/build/types/resources/member_ability.js.map +1 -1
- package/build/types/resources/person.d.ts +1 -0
- package/build/types/resources/person.d.ts.map +1 -1
- package/build/types/resources/person.js.map +1 -1
- 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/liquid_glass.d.ts +3 -0
- package/build/utils/liquid_glass.d.ts.map +1 -0
- package/build/utils/liquid_glass.js +9 -0
- package/build/utils/liquid_glass.js.map +1 -0
- package/build/utils/sha_256.js.map +1 -1
- package/build/utils/system_messages.d.ts +1 -1
- package/build/utils/system_messages.d.ts.map +1 -1
- package/build/utils/system_messages.js.map +1 -1
- package/build/utils/theme.d.ts +2 -2
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js +1 -1
- package/build/utils/theme.js.map +1 -1
- package/package.json +12 -12
- package/src/__tests__/hooks/resolve_message_available_members_link.test.ts +72 -0
- package/src/__tests__/hooks/use_attachment_uploader.test.tsx +1 -0
- package/src/__tests__/hooks/use_direct_messages_eligible.test.tsx +77 -0
- package/src/__tests__/hooks/use_font_scale.test.ts +7 -3
- package/src/__tests__/utils/liquid_glass.ts +40 -0
- package/src/__tests__/utils/native_adapters/configuration.ts +1 -1
- package/src/__tests__/utils/system_messages.ts +1 -1
- package/src/__tests__/utils/uri.ts +8 -50
- package/src/__utils__/handlers.ts +5 -6
- package/src/components/conversation/attachments/attachment_deleting_overlay.tsx +10 -3
- package/src/components/conversation/messages_disabled_banners.tsx +31 -4
- package/src/components/page/__tests__/component_error_boundary.test.tsx +1 -1
- package/src/components/page/__tests__/error_boundary.test.tsx +6 -2
- package/src/components/page/__tests__/page_error_boundary.test.tsx +1 -1
- package/src/contexts/chat_context.tsx +8 -0
- package/src/hooks/direct_messages/find_direct_message_conversation.ts +16 -0
- package/src/hooks/direct_messages/resolve_message_available_members_link.ts +42 -0
- package/src/hooks/direct_messages/use_find_or_create_direct_message_conversation.ts +2 -11
- package/src/hooks/direct_messages/use_message_available_members.ts +65 -0
- package/src/hooks/direct_messages/use_message_available_members_action.ts +34 -0
- package/src/hooks/index.ts +1 -1
- package/src/hooks/use_conversation.ts +1 -0
- package/src/hooks/use_current_person.ts +1 -0
- package/src/hooks/use_direct_messages_eligible.ts +11 -0
- package/src/hooks/use_features.ts +0 -1
- package/src/index.tsx +2 -1
- package/src/navigation/index.tsx +2 -2
- package/src/polyfills/events/EventTarget.ts +1 -1
- package/src/screens/conversation_filters/components/conversation_filters.tsx +3 -3
- package/src/screens/conversation_screen.tsx +9 -1
- package/src/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.tsx +18 -4
- package/src/screens/conversation_select_recipients/types/screen_props.tsx +2 -0
- package/src/screens/conversation_select_type_screen.tsx +4 -7
- package/src/screens/conversations/components/list_header_component.tsx +3 -3
- package/src/screens/settings_screen.tsx +3 -3
- package/src/types/resources/direct_message_candidate.ts +5 -0
- package/src/types/resources/member.ts +1 -0
- package/src/types/resources/member_ability.ts +1 -0
- package/src/types/resources/person.ts +1 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/liquid_glass.ts +12 -0
- package/src/utils/sha_256.ts +24 -24
- package/src/utils/system_messages.ts +1 -1
- package/src/utils/theme.ts +3 -8
- package/build/hooks/use_direct_messages_enabled.d.ts +0 -2
- package/build/hooks/use_direct_messages_enabled.d.ts.map +0 -1
- package/build/hooks/use_direct_messages_enabled.js +0 -16
- package/build/hooks/use_direct_messages_enabled.js.map +0 -1
- package/src/hooks/use_direct_messages_enabled.ts +0 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"age_check_underage_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/age_check/age_check_underage_screen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"age_check_underage_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/age_check/age_check_underage_screen.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,2BAA2B;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,sBAAsB,CAAC,EAAE,YAAY,EAAE,GAAE,2BAAgC,2CAuDxF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useRoute } from '@react-navigation/native';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { Linking, StyleSheet, View, ScrollView } from 'react-native';
|
|
4
4
|
import { Heading } from '../../components';
|
|
5
5
|
import { Icon, Text, TextInlineButton } from '../../components/display';
|
|
@@ -16,30 +16,7 @@ export function AgeCheckUnderageScreen({ contactEmail } = {}) {
|
|
|
16
16
|
const openTerms = () => {
|
|
17
17
|
Linking.openURL('https://www.planningcenter.com/terms');
|
|
18
18
|
};
|
|
19
|
-
return (
|
|
20
|
-
<Icon name="general.outlinedTextMessage" size={32} style={styles.icon}/>
|
|
21
|
-
|
|
22
|
-
<View style={styles.content}>
|
|
23
|
-
<Heading variant="h3" style={styles.baseText}>
|
|
24
|
-
Chat is only available for users 13 and older.
|
|
25
|
-
</Heading>
|
|
26
|
-
<Text variant="tertiary" style={styles.baseText}>
|
|
27
|
-
If you submitted the wrong birthdate by accident,{` `}
|
|
28
|
-
{email ? (<TextInlineButton onPress={openChurchAdminHelp} accessibilityRole="link" accessibilityHint="Opens email client to contact your church administrator" style={styles.linkText}>
|
|
29
|
-
please contact your church administrator
|
|
30
|
-
</TextInlineButton>) : (<>please contact your church administrator</>)}
|
|
31
|
-
{` `}
|
|
32
|
-
to update your profile.
|
|
33
|
-
</Text>
|
|
34
|
-
<Text variant="tertiary" style={styles.baseText}>
|
|
35
|
-
For more information, view our{` `}
|
|
36
|
-
<TextInlineButton onPress={openTerms} accessibilityRole="link" accessibilityHint="Opens terms of service in browser" style={styles.linkText}>
|
|
37
|
-
terms of service
|
|
38
|
-
</TextInlineButton>
|
|
39
|
-
.
|
|
40
|
-
</Text>
|
|
41
|
-
</View>
|
|
42
|
-
</ScrollView>);
|
|
19
|
+
return (_jsxs(ScrollView, { style: styles.scrollView, contentContainerStyle: styles.container, children: [_jsx(Icon, { name: "general.outlinedTextMessage", size: 32, style: styles.icon }), _jsxs(View, { style: styles.content, children: [_jsx(Heading, { variant: "h3", style: styles.baseText, children: "Chat is only available for users 13 and older." }), _jsxs(Text, { variant: "tertiary", style: styles.baseText, children: ["If you submitted the wrong birthdate by accident,", ` `, email ? (_jsx(TextInlineButton, { onPress: openChurchAdminHelp, accessibilityRole: "link", accessibilityHint: "Opens email client to contact your church administrator", style: styles.linkText, children: "please contact your church administrator" })) : (_jsx(_Fragment, { children: "please contact your church administrator" })), ` `, "to update your profile."] }), _jsxs(Text, { variant: "tertiary", style: styles.baseText, children: ["For more information, view our", ` `, _jsx(TextInlineButton, { onPress: openTerms, accessibilityRole: "link", accessibilityHint: "Opens terms of service in browser", style: styles.linkText, children: "terms of service" }), "."] })] })] }));
|
|
43
20
|
}
|
|
44
21
|
const useStyles = () => {
|
|
45
22
|
const { colors } = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"age_check_underage_screen.js","sourceRoot":"","sources":["../../../src/screens/age_check/age_check_underage_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"age_check_underage_screen.js","sourceRoot":"","sources":["../../../src/screens/age_check/age_check_underage_screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAOtC,MAAM,UAAU,sBAAsB,CAAC,EAAE,YAAY,KAAkC,EAAE;IACvF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,KAAK,GAAG,QAAQ,EAA+C,CAAA;IAErE,MAAM,KAAK,GAAG,YAAY,IAAI,KAAK,EAAE,MAAM,EAAE,YAAY,CAAA;IAEzD,MAAM,mBAAmB,GAAG,GAAG,EAAE;QAC/B,IAAI,CAAC,KAAK;YAAE,OAAM;QAClB,OAAO,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE,CAAC,CAAA;IACpC,CAAC,CAAA;IAED,MAAM,SAAS,GAAG,GAAG,EAAE;QACrB,OAAO,CAAC,OAAO,CAAC,sCAAsC,CAAC,CAAA;IACzD,CAAC,CAAA;IAED,OAAO,CACL,MAAC,UAAU,IAAC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;SAClB;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAC,wBAAwB;SACvC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,GAAG;SACd;QACD,QAAQ,EAAE;YACR,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,MAAM,CAAC,yBAAyB;SACxC;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useRoute, RouteProp } from '@react-navigation/native'\nimport React from 'react'\nimport { Linking, StyleSheet, View, ScrollView } from 'react-native'\nimport { Heading } from '../../components'\nimport { Icon, Text, TextInlineButton } from '../../components/display'\nimport { useTheme } from '../../hooks'\nimport type { AgeCheckParams } from './screen_props'\n\nexport interface AgeCheckUnderageScreenProps {\n contactEmail?: string\n}\n\nexport function AgeCheckUnderageScreen({ contactEmail }: AgeCheckUnderageScreenProps = {}) {\n const styles = useStyles()\n const route = useRoute<RouteProp<AgeCheckParams, 'UnderagePerson'>>()\n\n const email = contactEmail ?? route?.params?.contactEmail\n\n const openChurchAdminHelp = () => {\n if (!email) return\n Linking.openURL(`mailto:${email}`)\n }\n\n const openTerms = () => {\n Linking.openURL('https://www.planningcenter.com/terms')\n }\n\n return (\n <ScrollView style={styles.scrollView} contentContainerStyle={styles.container}>\n <Icon name=\"general.outlinedTextMessage\" size={32} style={styles.icon} />\n\n <View style={styles.content}>\n <Heading variant=\"h3\" style={styles.baseText}>\n Chat is only available for users 13 and older.\n </Heading>\n <Text variant=\"tertiary\" style={styles.baseText}>\n If you submitted the wrong birthdate by accident,{` `}\n {email ? (\n <TextInlineButton\n onPress={openChurchAdminHelp}\n accessibilityRole=\"link\"\n accessibilityHint=\"Opens email client to contact your church administrator\"\n style={styles.linkText}\n >\n please contact your church administrator\n </TextInlineButton>\n ) : (\n <>please contact your church administrator</>\n )}\n {` `}\n to update your profile.\n </Text>\n <Text variant=\"tertiary\" style={styles.baseText}>\n For more information, view our{` `}\n <TextInlineButton\n onPress={openTerms}\n accessibilityRole=\"link\"\n accessibilityHint=\"Opens terms of service in browser\"\n style={styles.linkText}\n >\n terms of service\n </TextInlineButton>\n .\n </Text>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n scrollView: {\n flex: 1,\n },\n container: {\n alignItems: 'center',\n justifyContent: 'center',\n gap: 16,\n padding: 16,\n minHeight: '100%',\n },\n icon: {\n color: colors.iconColorDefaultDisabled,\n },\n content: {\n alignItems: 'center',\n gap: 8,\n maxWidth: 250,\n },\n baseText: {\n textAlign: 'center',\n color: colors.textColorDefaultSecondary,\n },\n linkText: {\n fontSize: 14,\n },\n })\n}\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export type AgeCheckSelectBirthdateProps = {
|
|
3
2
|
onChange: (date: Date) => void;
|
|
4
3
|
onDismiss?: () => void;
|
|
@@ -7,5 +6,5 @@ export type AgeCheckSelectBirthdateProps = {
|
|
|
7
6
|
value?: Date | null;
|
|
8
7
|
visible?: boolean;
|
|
9
8
|
};
|
|
10
|
-
export declare function AgeCheckSelectBirthdateModal(props: AgeCheckSelectBirthdateProps):
|
|
9
|
+
export declare function AgeCheckSelectBirthdateModal(props: AgeCheckSelectBirthdateProps): import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
//# sourceMappingURL=age_check_select_birthdate_modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"age_check_select_birthdate_modal.d.ts","sourceRoot":"","sources":["../../../../src/screens/age_check/components/age_check_select_birthdate_modal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"age_check_select_birthdate_modal.d.ts","sourceRoot":"","sources":["../../../../src/screens/age_check/components/age_check_select_birthdate_modal.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC9B,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,4BAA4B,2CAK/E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { Modal, Platform, StyleSheet, View } from 'react-native';
|
|
@@ -6,10 +7,10 @@ import FormSheet from '../../../components/primitive/form_sheet';
|
|
|
6
7
|
import { useTheme } from '../../../hooks';
|
|
7
8
|
export function AgeCheckSelectBirthdateModal(props) {
|
|
8
9
|
if (Platform.OS === 'ios')
|
|
9
|
-
return
|
|
10
|
+
return _jsx(IOSBirthdateModal, { ...props });
|
|
10
11
|
if (Platform.OS === 'android')
|
|
11
|
-
return
|
|
12
|
-
return
|
|
12
|
+
return _jsx(AndroidBirthdatePicker, { ...props });
|
|
13
|
+
return _jsx(Text, { children: "Birthdate selection is not supported on this platform." });
|
|
13
14
|
}
|
|
14
15
|
const MINIMUM_BIRTHDATE = new Date(1900, 0, 1);
|
|
15
16
|
function IOSBirthdateModal({ onChange, onDismiss, onRequestClose, onSubmit, value, visible, }) {
|
|
@@ -24,27 +25,7 @@ function IOSBirthdateModal({ onChange, onDismiss, onRequestClose, onSubmit, valu
|
|
|
24
25
|
onSubmit(selected);
|
|
25
26
|
onRequestClose();
|
|
26
27
|
};
|
|
27
|
-
return (
|
|
28
|
-
<FormSheet.Root style={styles.formSheet} contentStyle={styles.formSheetContent}>
|
|
29
|
-
<FormSheet.Header>
|
|
30
|
-
<FormSheet.HeaderTitle>Your birthdate</FormSheet.HeaderTitle>
|
|
31
|
-
<FormSheet.HeaderActions>
|
|
32
|
-
<FormSheet.HeaderTextButton onPress={onRequestClose}>Cancel</FormSheet.HeaderTextButton>
|
|
33
|
-
<FormSheet.HeaderButton title="Save" onPress={handleSave}/>
|
|
34
|
-
</FormSheet.HeaderActions>
|
|
35
|
-
</FormSheet.Header>
|
|
36
|
-
<View style={styles.content}>
|
|
37
|
-
<View style={styles.card}>
|
|
38
|
-
<Text nativeID="birthdateLabel" variant="tertiary" style={styles.label}>
|
|
39
|
-
Birthdate
|
|
40
|
-
</Text>
|
|
41
|
-
<View style={styles.pickerContainer}>
|
|
42
|
-
<DateTimePicker timeZoneName="UTC" accessibilityLabelledBy="birthdateLabel" testID="age-check-date-picker" mode="date" display="spinner" value={selected} minimumDate={MINIMUM_BIRTHDATE} maximumDate={today} onChange={handleChange}/>
|
|
43
|
-
</View>
|
|
44
|
-
</View>
|
|
45
|
-
</View>
|
|
46
|
-
</FormSheet.Root>
|
|
47
|
-
</Modal>);
|
|
28
|
+
return (_jsx(Modal, { visible: visible, animationType: "slide", presentationStyle: "pageSheet", onRequestClose: onRequestClose, onDismiss: onDismiss, children: _jsxs(FormSheet.Root, { style: styles.formSheet, contentStyle: styles.formSheetContent, children: [_jsxs(FormSheet.Header, { children: [_jsx(FormSheet.HeaderTitle, { children: "Your birthdate" }), _jsxs(FormSheet.HeaderActions, { children: [_jsx(FormSheet.HeaderTextButton, { onPress: onRequestClose, children: "Cancel" }), _jsx(FormSheet.HeaderButton, { title: "Save", onPress: handleSave })] })] }), _jsx(View, { style: styles.content, children: _jsxs(View, { style: styles.card, children: [_jsx(Text, { nativeID: "birthdateLabel", variant: "tertiary", style: styles.label, children: "Birthdate" }), _jsx(View, { style: styles.pickerContainer, children: _jsx(DateTimePicker, { timeZoneName: "UTC", accessibilityLabelledBy: "birthdateLabel", testID: "age-check-date-picker", mode: "date", display: "spinner", value: selected, minimumDate: MINIMUM_BIRTHDATE, maximumDate: today, onChange: handleChange }) })] }) })] }) }));
|
|
48
29
|
}
|
|
49
30
|
function AndroidBirthdatePicker({ onRequestClose, onSubmit, value, visible, }) {
|
|
50
31
|
if (!visible)
|
|
@@ -57,7 +38,7 @@ function AndroidBirthdatePicker({ onRequestClose, onSubmit, value, visible, }) {
|
|
|
57
38
|
}
|
|
58
39
|
onRequestClose();
|
|
59
40
|
};
|
|
60
|
-
return (
|
|
41
|
+
return (_jsx(DateTimePicker, { timeZoneName: "UTC", testID: "age-check-date-picker-android", mode: "date", display: "spinner", value: selected, minimumDate: MINIMUM_BIRTHDATE, maximumDate: today, onChange: handleAndroidDateChange }));
|
|
61
42
|
}
|
|
62
43
|
const useStyles = () => {
|
|
63
44
|
const { colors } = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"age_check_select_birthdate_modal.js","sourceRoot":"","sources":["../../../../src/screens/age_check/components/age_check_select_birthdate_modal.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAuC,MAAM,wCAAwC,CAAA;AAC5F,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAA;AACvD,OAAO,SAAS,MAAM,0CAA0C,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAWzC,MAAM,UAAU,4BAA4B,CAAC,KAAmC;IAC9E,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"age_check_select_birthdate_modal.js","sourceRoot":"","sources":["../../../../src/screens/age_check/components/age_check_select_birthdate_modal.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAuC,MAAM,wCAAwC,CAAA;AAC5F,O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AQ,GAAG,KAAK,IAAI,KAAK,CAAA;IAE/B,MAAM,uBAAuB,GAAG,CAAC,KAA0B,EAAE,YAAmB,EAAE,EAAE;QAClF,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,YAAY,EAAE,CAAC;YACzC,QAAQ,CAAC,YAAY,CAAC,CAAA;QACxB,CAAC;QACD,cAAc,EAAE,CAAA;IAClB,CAAC,CAAA;IAED,OAAO,CACL,KAAC,cAAc,IACb,YAAY,EAAC,KAAK,EAClB,MAAM,EAAC,+BAA+B,EACtC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,SAAS,EACjB,KAAK,EAAE,QAAQ,EACf,WAAW,EAAE,iBAAiB,EAC9B,WAAW,EAAE,KAAK,EAClB,QAAQ,EAAE,uBAAuB,GACjC,CACH,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,CAAC;SACR;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC;YACP,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,OAAO,EAAE,EAAE;YACX,cAAc,EAAE,YAAY;SAC7B;QACD,IAAI,EAAE;YACJ,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,EAAE;SACZ;QACD,KAAK,EAAE;YACL,YAAY,EAAE,CAAC;YACf,aAAa,EAAE,WAAW;SAC3B;QACD,eAAe,EAAE;YACf,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,YAAY,EAAE,CAAC;SAChB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import DateTimePicker, { DateTimePickerEvent } from '@react-native-community/datetimepicker'\nimport React from 'react'\nimport { Modal, Platform, StyleSheet, View } from 'react-native'\nimport { Text } from '../../../components/display/text'\nimport FormSheet from '../../../components/primitive/form_sheet'\nimport { useTheme } from '../../../hooks'\n\nexport type AgeCheckSelectBirthdateProps = {\n onChange: (date: Date) => void\n onDismiss?: () => void\n onRequestClose: () => void\n onSubmit: (date: Date) => void\n value?: Date | null\n visible?: boolean\n}\n\nexport function AgeCheckSelectBirthdateModal(props: AgeCheckSelectBirthdateProps) {\n if (Platform.OS === 'ios') return <IOSBirthdateModal {...props} />\n if (Platform.OS === 'android') return <AndroidBirthdatePicker {...props} />\n\n return <Text>Birthdate selection is not supported on this platform.</Text>\n}\n\nconst MINIMUM_BIRTHDATE = new Date(1900, 0, 1)\n\nfunction IOSBirthdateModal({\n onChange,\n onDismiss,\n onRequestClose,\n onSubmit,\n value,\n visible,\n}: AgeCheckSelectBirthdateProps) {\n const styles = useStyles()\n const today = React.useMemo(() => new Date(), [])\n const selected = value || today\n\n const handleChange = (_event: DateTimePickerEvent, date?: Date) => {\n if (date) onChange(date)\n }\n\n const handleSave = () => {\n onSubmit(selected)\n onRequestClose()\n }\n\n return (\n <Modal\n visible={visible}\n animationType=\"slide\"\n presentationStyle=\"pageSheet\"\n onRequestClose={onRequestClose}\n onDismiss={onDismiss}\n >\n <FormSheet.Root style={styles.formSheet} contentStyle={styles.formSheetContent}>\n <FormSheet.Header>\n <FormSheet.HeaderTitle>Your birthdate</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>\n <FormSheet.HeaderTextButton onPress={onRequestClose}>Cancel</FormSheet.HeaderTextButton>\n <FormSheet.HeaderButton title=\"Save\" onPress={handleSave} />\n </FormSheet.HeaderActions>\n </FormSheet.Header>\n <View style={styles.content}>\n <View style={styles.card}>\n <Text nativeID=\"birthdateLabel\" variant=\"tertiary\" style={styles.label}>\n Birthdate\n </Text>\n <View style={styles.pickerContainer}>\n <DateTimePicker\n timeZoneName=\"UTC\"\n accessibilityLabelledBy=\"birthdateLabel\"\n testID=\"age-check-date-picker\"\n mode=\"date\"\n display=\"spinner\"\n value={selected}\n minimumDate={MINIMUM_BIRTHDATE}\n maximumDate={today}\n onChange={handleChange}\n />\n </View>\n </View>\n </View>\n </FormSheet.Root>\n </Modal>\n )\n}\n\nfunction AndroidBirthdatePicker({\n onRequestClose,\n onSubmit,\n value,\n visible,\n}: AgeCheckSelectBirthdateProps) {\n if (!visible) return null\n\n const today = new Date()\n const selected = value || today\n\n const handleAndroidDateChange = (event: DateTimePickerEvent, selectedDate?: Date) => {\n if (event.type === 'set' && selectedDate) {\n onSubmit(selectedDate)\n }\n onRequestClose()\n }\n\n return (\n <DateTimePicker\n timeZoneName=\"UTC\"\n testID=\"age-check-date-picker-android\"\n mode=\"date\"\n display=\"spinner\"\n value={selected}\n minimumDate={MINIMUM_BIRTHDATE}\n maximumDate={today}\n onChange={handleAndroidDateChange}\n />\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n formSheet: {\n backgroundColor: colors.surfaceColor080,\n },\n formSheetContent: {\n flex: 1,\n },\n content: {\n flex: 1,\n backgroundColor: colors.surfaceColor080,\n padding: 16,\n justifyContent: 'flex-start',\n },\n card: {\n backgroundColor: colors.surfaceColor100,\n borderRadius: 8,\n padding: 16,\n },\n label: {\n marginBottom: 8,\n textTransform: 'uppercase',\n },\n pickerContainer: {\n backgroundColor: colors.surfaceColor100,\n borderRadius: 8,\n },\n })\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
export declare const AttachmentActionsScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
4
3
|
export type AttachmentActionsScreenProps = StaticScreenProps<{
|
|
5
4
|
attachmentId: string;
|
|
@@ -9,5 +8,5 @@ export type AttachmentActionsScreenProps = StaticScreenProps<{
|
|
|
9
8
|
canDeleteNonAuthoredMessages: boolean;
|
|
10
9
|
myMessage: boolean;
|
|
11
10
|
}>;
|
|
12
|
-
export declare function AttachmentActionsScreen({ route }: AttachmentActionsScreenProps):
|
|
11
|
+
export declare function AttachmentActionsScreen({ route }: AttachmentActionsScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
//# sourceMappingURL=attachment_actions_screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment_actions_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"attachment_actions_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAM3E,eAAO,MAAM,8BAA8B,uEAEzC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC;IAC3D,YAAY,EAAE,MAAM,CAAA;IACpB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,4BAA4B,EAAE,OAAO,CAAA;IACrC,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,wBAAgB,uBAAuB,CAAC,EAAE,KAAK,EAAE,EAAE,4BAA4B,2CAgE9E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useNavigation } from '@react-navigation/native';
|
|
2
|
-
import
|
|
3
|
+
import { useCallback } from 'react';
|
|
3
4
|
import { Alert, Linking, StyleSheet } from 'react-native';
|
|
4
5
|
import FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet';
|
|
5
6
|
import { useDeleteAttachment } from './hooks/useDeleteAttachment';
|
|
@@ -34,10 +35,7 @@ export function AttachmentActionsScreen({ route }) {
|
|
|
34
35
|
Linking.openURL(attachmentUrl);
|
|
35
36
|
navigation.goBack();
|
|
36
37
|
};
|
|
37
|
-
return (
|
|
38
|
-
<FormSheet.Action iconName="general.newWindow" title="Open in browser" accessibilityRole="link" accessibilityLabel={`Open ${attachmentName} in browser`} accessibilityHint={`${attachmentName} can be downloaded and shared through the browser.`} onPress={handleOpenInBrowser}/>
|
|
39
|
-
{canDelete && (<FormSheet.Action appearance="danger" iconName="publishing.trash" title={`Delete ${attachmentName}`} onPress={handleDeleteConfirm}/>)}
|
|
40
|
-
</FormSheet.Root>);
|
|
38
|
+
return (_jsxs(FormSheet.Root, { contentStyle: styles.formSheetContent, children: [_jsx(FormSheet.Action, { iconName: "general.newWindow", title: "Open in browser", accessibilityRole: "link", accessibilityLabel: `Open ${attachmentName} in browser`, accessibilityHint: `${attachmentName} can be downloaded and shared through the browser.`, onPress: handleOpenInBrowser }), canDelete && (_jsx(FormSheet.Action, { appearance: "danger", iconName: "publishing.trash", title: `Delete ${attachmentName}`, onPress: handleDeleteConfirm }))] }));
|
|
41
39
|
}
|
|
42
40
|
const useStyles = () => {
|
|
43
41
|
return StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment_actions_screen.js","sourceRoot":"","sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,
|
|
1
|
+
{"version":3,"file":"attachment_actions_screen.js","sourceRoot":"","sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,SAAS,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EAAE,CAAA;IACrB,CAAC,CAAA;IAED,OAAO,CACL,MAAC,SAAS,CAAC,IAAI,IAAC,YAAY,EAAE,MAAM,CAAC,gBAAgB,aACnD,KAAC,SAAS,CAAC,MAAM,IACf,QAAQ,EAAC,mBAAmB,EAC5B,KAAK,EAAC,iBAAiB,EACvB,iBAAiB,EAAC,MAAM,EACxB,kBAAkB,EAAE,QAAQ,cAAc,aAAa,EACvD,iBAAiB,EAAE,GAAG,cAAc,oDAAoD,EACxF,OAAO,EAAE,mBAAmB,GAC5B,EACD,SAAS,IAAI,CACZ,KAAC,SAAS,CAAC,MAAM,IACf,UAAU,EAAC,QAAQ,EACnB,QAAQ,EAAC,kBAAkB,EAC3B,KAAK,EAAE,UAAU,cAAc,EAAE,EACjC,OAAO,EAAE,mBAAmB,GAC5B,CACH,IACc,CAClB,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,gBAAgB,EAAE;YAChB,UAAU,EAAE,EAAE;SACf;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,SAAS,sBAAsB,CAAC,WAAmB;IACjD,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,OAAO,CAAA;IACpD,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,OAAO,CAAA;IACpD,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,OAAO,CAAA;IACpD,IAAI,WAAW,KAAK,iBAAiB;QAAE,OAAO,KAAK,CAAA;IACnD,IAAI,WAAW,CAAC,UAAU,CAAC,cAAc,CAAC;QAAE,OAAO,MAAM,CAAA;IAEzD,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback } from 'react'\nimport { Alert, Linking, StyleSheet } from 'react-native'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useDeleteAttachment } from './hooks/useDeleteAttachment'\n\nexport const AttachmentActionsScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Attachment actions',\n})\n\nexport type AttachmentActionsScreenProps = StaticScreenProps<{\n attachmentId: string\n attachmentContentType: string\n attachmentUrl: string\n conversation_id: number\n canDeleteNonAuthoredMessages: boolean\n myMessage: boolean\n}>\n\nexport function AttachmentActionsScreen({ route }: AttachmentActionsScreenProps) {\n const navigation = useNavigation()\n const {\n attachmentId,\n attachmentContentType,\n attachmentUrl,\n conversation_id,\n canDeleteNonAuthoredMessages,\n myMessage,\n } = route.params\n\n const attachmentName = getAttachmentLabelName(attachmentContentType)\n const canDelete = myMessage || canDeleteNonAuthoredMessages\n const styles = useStyles()\n\n const { handleDeleteAttachment } = useDeleteAttachment({\n conversation_id,\n attachmentId,\n attachmentName,\n })\n\n const handleDeleteConfirm = useCallback(() => {\n Alert.alert(\n `Delete ${attachmentName}`,\n 'Are you sure you want to permanently delete this attachment?',\n [\n { text: 'Cancel', style: 'cancel' },\n {\n text: 'Delete',\n style: 'destructive',\n onPress: () => {\n handleDeleteAttachment()\n navigation.goBack()\n },\n },\n ]\n )\n }, [attachmentName, handleDeleteAttachment, navigation])\n\n const handleOpenInBrowser = () => {\n Linking.openURL(attachmentUrl)\n navigation.goBack()\n }\n\n return (\n <FormSheet.Root contentStyle={styles.formSheetContent}>\n <FormSheet.Action\n iconName=\"general.newWindow\"\n title=\"Open in browser\"\n accessibilityRole=\"link\"\n accessibilityLabel={`Open ${attachmentName} in browser`}\n accessibilityHint={`${attachmentName} can be downloaded and shared through the browser.`}\n onPress={handleOpenInBrowser}\n />\n {canDelete && (\n <FormSheet.Action\n appearance=\"danger\"\n iconName=\"publishing.trash\"\n title={`Delete ${attachmentName}`}\n onPress={handleDeleteConfirm}\n />\n )}\n </FormSheet.Root>\n )\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n formSheetContent: {\n paddingTop: 16,\n },\n })\n}\n\nfunction getAttachmentLabelName(contentType: string) {\n if (contentType.startsWith('image/')) return 'image'\n if (contentType.startsWith('video/')) return 'video'\n if (contentType.startsWith('audio/')) return 'audio'\n if (contentType === 'application/pdf') return 'PDF'\n if (contentType.startsWith('application/')) return 'file'\n\n return ''\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { type AvatarUpdatePayload } from '../../hooks/use_conversation_avatar_update';
|
|
4
3
|
export declare const AvatarPickerScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
5
4
|
export declare const AvatarPickerCreateScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
@@ -8,5 +7,5 @@ export type AvatarPickerScreenProps = StaticScreenProps<{
|
|
|
8
7
|
source_params?: Record<string, unknown>;
|
|
9
8
|
avatar_selection?: AvatarUpdatePayload;
|
|
10
9
|
}>;
|
|
11
|
-
export declare function AvatarPickerScreen({ route }: AvatarPickerScreenProps):
|
|
10
|
+
export declare function AvatarPickerScreen({ route }: AvatarPickerScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
//# sourceMappingURL=avatar_picker_screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar_picker_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_picker_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"avatar_picker_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_picker_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAWzF,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,4CAA4C,CAAA;AAoBnD,eAAO,MAAM,yBAAyB,uEAIpC,CAAA;AAEF,eAAO,MAAM,+BAA+B,uEAI1C,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACtD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,gBAAgB,CAAC,EAAE,mBAAmB,CAAA;CACvC,CAAC,CAAA;AAUF,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,EAAE,uBAAuB,2CAMpE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { StackActions, useNavigation } from '@react-navigation/native';
|
|
2
|
-
import
|
|
3
|
+
import { useCallback, useReducer } from 'react';
|
|
3
4
|
import { Platform, StyleSheet, View } from 'react-native';
|
|
4
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
6
|
import { ConversationAvatar } from '../../components/display/conversation_avatar';
|
|
@@ -38,9 +39,9 @@ const TAB_LABELS = {
|
|
|
38
39
|
export function AvatarPickerScreen({ route }) {
|
|
39
40
|
const { conversation_id, source_params, avatar_selection } = route.params;
|
|
40
41
|
if (conversation_id) {
|
|
41
|
-
return
|
|
42
|
+
return _jsx(EditModeContent, { conversationId: conversation_id });
|
|
42
43
|
}
|
|
43
|
-
return
|
|
44
|
+
return _jsx(CreateModeContent, { sourceParams: source_params, existingSelection: avatar_selection });
|
|
44
45
|
}
|
|
45
46
|
function EditModeContent({ conversationId }) {
|
|
46
47
|
const navigation = useNavigation();
|
|
@@ -63,14 +64,7 @@ function EditModeContent({ conversationId }) {
|
|
|
63
64
|
const handleRemove = useCallback(() => {
|
|
64
65
|
mutation.mutate({ kind: 'clear' }, { onSuccess: () => dispatch({ type: 'CLEAR' }) });
|
|
65
66
|
}, [mutation, dispatch]);
|
|
66
|
-
return (
|
|
67
|
-
{hasAvatar && (<FormSheet.HeaderTextButton onPress={handleRemove} appearance="danger">
|
|
68
|
-
Remove
|
|
69
|
-
</FormSheet.HeaderTextButton>)}
|
|
70
|
-
<FormSheet.HeaderTextButton onPress={handleDone} disabled={mutation.isPending}>
|
|
71
|
-
Done
|
|
72
|
-
</FormSheet.HeaderTextButton>
|
|
73
|
-
</>} fallbackPreview={<ConversationAvatar conversation={conversation} size="2xl" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK} style={{ width: previewDiameter, height: previewDiameter }}/>}/>);
|
|
67
|
+
return (_jsx(AvatarPickerFormSheet, { state: state, dispatch: dispatch, headerTitle: "Update avatar", headerActions: _jsxs(_Fragment, { children: [hasAvatar && (_jsx(FormSheet.HeaderTextButton, { onPress: handleRemove, appearance: "danger", children: "Remove" })), _jsx(FormSheet.HeaderTextButton, { onPress: handleDone, disabled: mutation.isPending, children: "Done" })] }), fallbackPreview: _jsx(ConversationAvatar, { conversation: conversation, size: "2xl", maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK, style: { width: previewDiameter, height: previewDiameter } }) }));
|
|
74
68
|
}
|
|
75
69
|
function CreateModeContent({ sourceParams, existingSelection }) {
|
|
76
70
|
const navigation = useNavigation();
|
|
@@ -88,40 +82,19 @@ function CreateModeContent({ sourceParams, existingSelection }) {
|
|
|
88
82
|
navigation.goBack();
|
|
89
83
|
}
|
|
90
84
|
}, [state, navigation, sourceParams]);
|
|
91
|
-
return (
|
|
85
|
+
return (_jsx(AvatarPickerFormSheet, { state: state, dispatch: dispatch, headerTitle: "Choose avatar", headerActions: _jsx(FormSheet.HeaderTextButton, { onPress: handleDone, children: "Done" }), fallbackPreview: _jsx(EmptyAvatarPlaceholder, {}) }));
|
|
92
86
|
}
|
|
93
87
|
function AvatarPickerFormSheet({ state, dispatch, headerTitle, headerActions, fallbackPreview, }) {
|
|
94
88
|
const styles = useStyles();
|
|
95
|
-
return (
|
|
96
|
-
<FormSheet.Header style={styles.header}>
|
|
97
|
-
<FormSheet.HeaderTitle>{headerTitle}</FormSheet.HeaderTitle>
|
|
98
|
-
<FormSheet.HeaderActions>{headerActions}</FormSheet.HeaderActions>
|
|
99
|
-
</FormSheet.Header>
|
|
100
|
-
|
|
101
|
-
<AvatarPreview state={state} fallback={fallbackPreview}/>
|
|
102
|
-
|
|
103
|
-
<Tabs data={TABS} activeTab={state.activeTab} onTabPress={tab => dispatch({ type: 'SELECT_TAB', payload: tab })} renderItem={({ item }) => (<Text style={[styles.tabLabel, item === state.activeTab && styles.tabLabelActive]} maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}>
|
|
104
|
-
{TAB_LABELS[item]}
|
|
105
|
-
</Text>)} style={styles.tabs}/>
|
|
106
|
-
|
|
107
|
-
<View style={styles.body}>
|
|
108
|
-
{state.activeTab === 'icon' && (<IconGrid selectedIconKey={state.selectedType === 'icon' ? state.selectedKey : null} onIconSelect={iconKey => dispatch({ type: 'SELECT_ICON', payload: iconKey })}/>)}
|
|
109
|
-
{state.activeTab === 'emoji' && (<EmojiTab onEmojiSelect={emoji => dispatch({ type: 'SELECT_EMOJI', payload: emoji })}/>)}
|
|
110
|
-
{state.activeTab === 'upload' && (<UploadTab imagePreviewUri={state.imagePreviewUri} onImageSelect={asset => dispatch({ type: 'SET_IMAGE', payload: asset })}/>)}
|
|
111
|
-
</View>
|
|
112
|
-
|
|
113
|
-
{state.activeTab !== 'upload' && (<View style={styles.colorPickerWrapper}>
|
|
114
|
-
<ColorPicker selectedColor={state.selectedColor} onColorSelect={color => dispatch({ type: 'SELECT_COLOR', payload: color })}/>
|
|
115
|
-
</View>)}
|
|
116
|
-
</FormSheet.Root>);
|
|
89
|
+
return (_jsxs(FormSheet.Root, { style: styles.formSheetRoot, contentStyle: styles.formSheetContent, showAndroidSheetGrabber: false, children: [_jsxs(FormSheet.Header, { style: styles.header, children: [_jsx(FormSheet.HeaderTitle, { children: headerTitle }), _jsx(FormSheet.HeaderActions, { children: headerActions })] }), _jsx(AvatarPreview, { state: state, fallback: fallbackPreview }), _jsx(Tabs, { data: TABS, activeTab: state.activeTab, onTabPress: tab => dispatch({ type: 'SELECT_TAB', payload: tab }), renderItem: ({ item }) => (_jsx(Text, { style: [styles.tabLabel, item === state.activeTab && styles.tabLabelActive], maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK, children: TAB_LABELS[item] })), style: styles.tabs }), _jsxs(View, { style: styles.body, children: [state.activeTab === 'icon' && (_jsx(IconGrid, { selectedIconKey: state.selectedType === 'icon' ? state.selectedKey : null, onIconSelect: iconKey => dispatch({ type: 'SELECT_ICON', payload: iconKey }) })), state.activeTab === 'emoji' && (_jsx(EmojiTab, { onEmojiSelect: emoji => dispatch({ type: 'SELECT_EMOJI', payload: emoji }) })), state.activeTab === 'upload' && (_jsx(UploadTab, { imagePreviewUri: state.imagePreviewUri, onImageSelect: asset => dispatch({ type: 'SET_IMAGE', payload: asset }) }))] }), state.activeTab !== 'upload' && (_jsx(View, { style: styles.colorPickerWrapper, children: _jsx(ColorPicker, { selectedColor: state.selectedColor, onColorSelect: color => dispatch({ type: 'SELECT_COLOR', payload: color }) }) }))] }));
|
|
117
90
|
}
|
|
118
91
|
function EmptyAvatarPlaceholder() {
|
|
119
92
|
const styles = useStyles();
|
|
120
93
|
const diameter = usePreviewAvatarDiameter();
|
|
121
|
-
return (
|
|
94
|
+
return (_jsx(View, { style: [
|
|
122
95
|
styles.emptyAvatarPlaceholder,
|
|
123
96
|
{ width: diameter, height: diameter, borderRadius: diameter / 2 },
|
|
124
|
-
]}
|
|
97
|
+
] }));
|
|
125
98
|
}
|
|
126
99
|
function hasValidSelection(state) {
|
|
127
100
|
switch (state.selectedType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar_picker_screen.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_picker_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0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ACR,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,eAAe,EAAE,EAAE,GAAG,SAAS;YAC/B,QAAQ,EAAE,EAAE,GAAG,SAAS;YACxB,SAAS,EAAE,QAAQ;SACpB;QACD,cAAc,EAAE;YACd,KAAK,EAAE,MAAM,CAAC,uBAAuB;SACtC;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,QAAQ;SACnB;QACD,kBAAkB,EAAE;YAClB,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC,sBAAsB;SAC9C;QACD,sBAAsB,EAAE;YACtB,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,MAAM,CAAC,sBAAsB;SAC3C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback, useReducer } from 'react'\nimport { Platform, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationAvatar } from '../../components/display/conversation_avatar'\nimport { Tabs } from '../../components/display/tabs'\nimport { Text } from '../../components/display/text'\nimport { coerceColorKey } from '../../components/display/utils/avatar_gradient_colors'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useTheme } from '../../hooks'\nimport { useConversation } from '../../hooks/use_conversation'\nimport {\n useConversationAvatarUpdate,\n type AvatarUpdatePayload,\n} from '../../hooks/use_conversation_avatar_update'\nimport { useFontScale } from '../../hooks/use_font_scale'\nimport { usePreviewAvatarDiameter } from '../../hooks/use_preview_avatar_diameter'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport type { ImagePickerAsset } from '../../utils/native_adapters/image_picker'\nimport {\n avatarPickerReducer,\n initAvatarPickerState,\n initAvatarPickerStateFromPayload,\n initEmptyAvatarPickerState,\n type AvatarPickerAction,\n type AvatarPickerState,\n type AvatarTab,\n} from './avatar_picker_state'\nimport { AvatarPreview } from './avatar_preview'\nimport { ColorPicker } from './color_picker'\nimport { EmojiTab } from './emoji_tab'\nimport { IconGrid } from './icon_grid'\nimport { UploadTab } from './upload_tab'\n\nexport const AvatarPickerScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Update avatar',\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: [1],\n})\n\nexport const AvatarPickerCreateScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Choose avatar',\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: [1],\n})\n\nexport type AvatarPickerScreenProps = StaticScreenProps<{\n conversation_id?: number\n source_params?: Record<string, unknown>\n avatar_selection?: AvatarUpdatePayload\n}>\n\nconst TABS: AvatarTab[] = ['icon', 'emoji', 'upload']\n\nconst TAB_LABELS: Record<AvatarTab, string> = {\n icon: 'Icon',\n emoji: 'Emoji',\n upload: 'Upload',\n}\n\nexport function AvatarPickerScreen({ route }: AvatarPickerScreenProps) {\n const { conversation_id, source_params, avatar_selection } = route.params\n if (conversation_id) {\n return <EditModeContent conversationId={conversation_id} />\n }\n return <CreateModeContent sourceParams={source_params} existingSelection={avatar_selection} />\n}\n\nfunction EditModeContent({ conversationId }: { conversationId: number }) {\n const navigation = useNavigation()\n const { data: conversation } = useConversation({ conversation_id: conversationId })\n const mutation = useConversationAvatarUpdate({ conversationId })\n const previewDiameter = usePreviewAvatarDiameter()\n\n const [state, dispatch] = useReducer(avatarPickerReducer, conversation, initAvatarPickerState)\n\n const hasAvatar = state.selectedType !== null\n\n const handleDone = useCallback(() => {\n if (!state.isDirty) {\n navigation.goBack()\n return\n }\n\n const payload = buildPayload(state)\n if (payload) {\n mutation.mutate(payload)\n }\n navigation.goBack()\n }, [state, mutation, navigation])\n\n const handleRemove = useCallback(() => {\n mutation.mutate({ kind: 'clear' }, { onSuccess: () => dispatch({ type: 'CLEAR' }) })\n }, [mutation, dispatch])\n\n return (\n <AvatarPickerFormSheet\n state={state}\n dispatch={dispatch}\n headerTitle=\"Update avatar\"\n headerActions={\n <>\n {hasAvatar && (\n <FormSheet.HeaderTextButton onPress={handleRemove} appearance=\"danger\">\n Remove\n </FormSheet.HeaderTextButton>\n )}\n <FormSheet.HeaderTextButton onPress={handleDone} disabled={mutation.isPending}>\n Done\n </FormSheet.HeaderTextButton>\n </>\n }\n fallbackPreview={\n <ConversationAvatar\n conversation={conversation}\n size=\"2xl\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n style={{ width: previewDiameter, height: previewDiameter }}\n />\n }\n />\n )\n}\n\ninterface CreateModeContentProps {\n sourceParams?: Record<string, unknown>\n existingSelection?: AvatarUpdatePayload\n}\n\nfunction CreateModeContent({ sourceParams, existingSelection }: CreateModeContentProps) {\n const navigation = useNavigation()\n\n const [state, dispatch] = useReducer(avatarPickerReducer, existingSelection, selection =>\n selection ? initAvatarPickerStateFromPayload(selection) : initEmptyAvatarPickerState()\n )\n\n const handleDone = useCallback(() => {\n if (!state.isDirty) {\n navigation.goBack()\n return\n }\n\n const payload = buildPayload(state)\n if (payload) {\n navigation.dispatch(\n StackActions.popTo('ConversationNew', { ...sourceParams, avatar_selection: payload })\n )\n } else {\n navigation.goBack()\n }\n }, [state, navigation, sourceParams])\n\n return (\n <AvatarPickerFormSheet\n state={state}\n dispatch={dispatch}\n headerTitle=\"Choose avatar\"\n headerActions={\n <FormSheet.HeaderTextButton onPress={handleDone}>Done</FormSheet.HeaderTextButton>\n }\n fallbackPreview={<EmptyAvatarPlaceholder />}\n />\n )\n}\n\ninterface AvatarPickerFormSheetProps {\n state: AvatarPickerState\n dispatch: React.Dispatch<AvatarPickerAction>\n headerTitle: string\n headerActions: React.ReactNode\n fallbackPreview: React.ReactNode\n}\n\nfunction AvatarPickerFormSheet({\n state,\n dispatch,\n headerTitle,\n headerActions,\n fallbackPreview,\n}: AvatarPickerFormSheetProps) {\n const styles = useStyles()\n\n return (\n <FormSheet.Root\n style={styles.formSheetRoot}\n contentStyle={styles.formSheetContent}\n showAndroidSheetGrabber={false}\n >\n <FormSheet.Header style={styles.header}>\n <FormSheet.HeaderTitle>{headerTitle}</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>{headerActions}</FormSheet.HeaderActions>\n </FormSheet.Header>\n\n <AvatarPreview state={state} fallback={fallbackPreview} />\n\n <Tabs\n data={TABS}\n activeTab={state.activeTab}\n onTabPress={tab => dispatch({ type: 'SELECT_TAB', payload: tab })}\n renderItem={({ item }) => (\n <Text\n style={[styles.tabLabel, item === state.activeTab && styles.tabLabelActive]}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n >\n {TAB_LABELS[item]}\n </Text>\n )}\n style={styles.tabs}\n />\n\n <View style={styles.body}>\n {state.activeTab === 'icon' && (\n <IconGrid\n selectedIconKey={state.selectedType === 'icon' ? state.selectedKey : null}\n onIconSelect={iconKey => dispatch({ type: 'SELECT_ICON', payload: iconKey })}\n />\n )}\n {state.activeTab === 'emoji' && (\n <EmojiTab onEmojiSelect={emoji => dispatch({ type: 'SELECT_EMOJI', payload: emoji })} />\n )}\n {state.activeTab === 'upload' && (\n <UploadTab\n imagePreviewUri={state.imagePreviewUri}\n onImageSelect={asset => dispatch({ type: 'SET_IMAGE', payload: asset })}\n />\n )}\n </View>\n\n {state.activeTab !== 'upload' && (\n <View style={styles.colorPickerWrapper}>\n <ColorPicker\n selectedColor={state.selectedColor}\n onColorSelect={color => dispatch({ type: 'SELECT_COLOR', payload: color })}\n />\n </View>\n )}\n </FormSheet.Root>\n )\n}\n\nfunction EmptyAvatarPlaceholder() {\n const styles = useStyles()\n const diameter = usePreviewAvatarDiameter()\n return (\n <View\n style={[\n styles.emptyAvatarPlaceholder,\n { width: diameter, height: diameter, borderRadius: diameter / 2 },\n ]}\n />\n )\n}\n\ntype ValidAvatarPickerState = AvatarPickerState &\n (\n | { selectedType: 'icon' | 'emoji'; selectedKey: string }\n | { selectedType: 'image'; imageAsset: ImagePickerAsset }\n )\n\nfunction hasValidSelection(state: AvatarPickerState): state is ValidAvatarPickerState {\n switch (state.selectedType) {\n case 'icon':\n case 'emoji':\n return state.selectedKey !== null\n case 'image':\n return state.imageAsset !== null\n case null:\n return false\n }\n}\n\nfunction buildPayload(state: AvatarPickerState): AvatarUpdatePayload | null {\n if (!hasValidSelection(state)) return null\n\n const color = coerceColorKey(state.selectedColor)\n\n switch (state.selectedType) {\n case 'icon':\n return { kind: 'icon', key: state.selectedKey, color }\n case 'emoji':\n return { kind: 'emoji', key: state.selectedKey, color }\n case 'image':\n return { kind: 'image', imageAsset: state.imageAsset, color }\n }\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK })\n const { top } = useSafeAreaInsets()\n\n return StyleSheet.create({\n formSheetRoot: {\n flex: 1,\n },\n formSheetContent: {\n flex: 1,\n },\n header: {\n paddingTop: Platform.select({ ios: 20, android: 20 + top }),\n },\n tabs: {\n minHeight: 52 * fontScale,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n backgroundColor: colors.fillColorNeutral100Inverted,\n zIndex: 1,\n },\n tabLabel: {\n fontSize: 14,\n color: colors.textColorDefaultSecondary,\n paddingVertical: 14 * fontScale,\n minWidth: 56 * fontScale,\n textAlign: 'center',\n },\n tabLabelActive: {\n color: colors.textColorDefaultPrimary,\n },\n body: {\n flex: 1,\n overflow: 'hidden',\n },\n colorPickerWrapper: {\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultBase,\n },\n emptyAvatarPlaceholder: {\n borderWidth: 2,\n borderStyle: 'dashed',\n borderColor: colors.borderColorDefaultBase,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"avatar_picker_screen.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_picker_screen.tsx"],"names":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IAAI,EAAE,CAAC;SACR;QACD,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,GAAG,EAAE,CAAC;SAC5D;QACD,IAAI,EAAE;YACJ,SAAS,EAAE,EAAE,GAAG,SAAS;YACzB,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,MAAM,CAAC,sBAAsB;YAChD,eAAe,EAAE,MAAM,CAAC,2BAA2B;YACnD,MAAM,EAAE,CAAC;SACV;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,eAAe,EAAE,EAAE,GAAG,SAAS;YAC/B,QAAQ,EAAE,EAAE,GAAG,SAAS;YACxB,SAAS,EAAE,QAAQ;SACpB;QACD,cAAc,EAAE;YACd,KAAK,EAAE,MAAM,CAAC,uBAAuB;SACtC;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,QAAQ;SACnB;QACD,kBAAkB,EAAE;YAClB,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC,sBAAsB;SAC9C;QACD,sBAAsB,EAAE;YACtB,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,MAAM,CAAC,sBAAsB;SAC3C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback, useReducer } from 'react'\nimport { Platform, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationAvatar } from '../../components/display/conversation_avatar'\nimport { Tabs } from '../../components/display/tabs'\nimport { Text } from '../../components/display/text'\nimport { coerceColorKey } from '../../components/display/utils/avatar_gradient_colors'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useTheme } from '../../hooks'\nimport { useConversation } from '../../hooks/use_conversation'\nimport {\n useConversationAvatarUpdate,\n type AvatarUpdatePayload,\n} from '../../hooks/use_conversation_avatar_update'\nimport { useFontScale } from '../../hooks/use_font_scale'\nimport { usePreviewAvatarDiameter } from '../../hooks/use_preview_avatar_diameter'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport type { ImagePickerAsset } from '../../utils/native_adapters/image_picker'\nimport {\n avatarPickerReducer,\n initAvatarPickerState,\n initAvatarPickerStateFromPayload,\n initEmptyAvatarPickerState,\n type AvatarPickerAction,\n type AvatarPickerState,\n type AvatarTab,\n} from './avatar_picker_state'\nimport { AvatarPreview } from './avatar_preview'\nimport { ColorPicker } from './color_picker'\nimport { EmojiTab } from './emoji_tab'\nimport { IconGrid } from './icon_grid'\nimport { UploadTab } from './upload_tab'\n\nexport const AvatarPickerScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Update avatar',\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: [1],\n})\n\nexport const AvatarPickerCreateScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Choose avatar',\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: [1],\n})\n\nexport type AvatarPickerScreenProps = StaticScreenProps<{\n conversation_id?: number\n source_params?: Record<string, unknown>\n avatar_selection?: AvatarUpdatePayload\n}>\n\nconst TABS: AvatarTab[] = ['icon', 'emoji', 'upload']\n\nconst TAB_LABELS: Record<AvatarTab, string> = {\n icon: 'Icon',\n emoji: 'Emoji',\n upload: 'Upload',\n}\n\nexport function AvatarPickerScreen({ route }: AvatarPickerScreenProps) {\n const { conversation_id, source_params, avatar_selection } = route.params\n if (conversation_id) {\n return <EditModeContent conversationId={conversation_id} />\n }\n return <CreateModeContent sourceParams={source_params} existingSelection={avatar_selection} />\n}\n\nfunction EditModeContent({ conversationId }: { conversationId: number }) {\n const navigation = useNavigation()\n const { data: conversation } = useConversation({ conversation_id: conversationId })\n const mutation = useConversationAvatarUpdate({ conversationId })\n const previewDiameter = usePreviewAvatarDiameter()\n\n const [state, dispatch] = useReducer(avatarPickerReducer, conversation, initAvatarPickerState)\n\n const hasAvatar = state.selectedType !== null\n\n const handleDone = useCallback(() => {\n if (!state.isDirty) {\n navigation.goBack()\n return\n }\n\n const payload = buildPayload(state)\n if (payload) {\n mutation.mutate(payload)\n }\n navigation.goBack()\n }, [state, mutation, navigation])\n\n const handleRemove = useCallback(() => {\n mutation.mutate({ kind: 'clear' }, { onSuccess: () => dispatch({ type: 'CLEAR' }) })\n }, [mutation, dispatch])\n\n return (\n <AvatarPickerFormSheet\n state={state}\n dispatch={dispatch}\n headerTitle=\"Update avatar\"\n headerActions={\n <>\n {hasAvatar && (\n <FormSheet.HeaderTextButton onPress={handleRemove} appearance=\"danger\">\n Remove\n </FormSheet.HeaderTextButton>\n )}\n <FormSheet.HeaderTextButton onPress={handleDone} disabled={mutation.isPending}>\n Done\n </FormSheet.HeaderTextButton>\n </>\n }\n fallbackPreview={\n <ConversationAvatar\n conversation={conversation}\n size=\"2xl\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n style={{ width: previewDiameter, height: previewDiameter }}\n />\n }\n />\n )\n}\n\ninterface CreateModeContentProps {\n sourceParams?: Record<string, unknown>\n existingSelection?: AvatarUpdatePayload\n}\n\nfunction CreateModeContent({ sourceParams, existingSelection }: CreateModeContentProps) {\n const navigation = useNavigation()\n\n const [state, dispatch] = useReducer(avatarPickerReducer, existingSelection, selection =>\n selection ? initAvatarPickerStateFromPayload(selection) : initEmptyAvatarPickerState()\n )\n\n const handleDone = useCallback(() => {\n if (!state.isDirty) {\n navigation.goBack()\n return\n }\n\n const payload = buildPayload(state)\n if (payload) {\n navigation.dispatch(\n StackActions.popTo('ConversationNew', { ...sourceParams, avatar_selection: payload })\n )\n } else {\n navigation.goBack()\n }\n }, [state, navigation, sourceParams])\n\n return (\n <AvatarPickerFormSheet\n state={state}\n dispatch={dispatch}\n headerTitle=\"Choose avatar\"\n headerActions={\n <FormSheet.HeaderTextButton onPress={handleDone}>Done</FormSheet.HeaderTextButton>\n }\n fallbackPreview={<EmptyAvatarPlaceholder />}\n />\n )\n}\n\ninterface AvatarPickerFormSheetProps {\n state: AvatarPickerState\n dispatch: React.Dispatch<AvatarPickerAction>\n headerTitle: string\n headerActions: React.ReactNode\n fallbackPreview: React.ReactNode\n}\n\nfunction AvatarPickerFormSheet({\n state,\n dispatch,\n headerTitle,\n headerActions,\n fallbackPreview,\n}: AvatarPickerFormSheetProps) {\n const styles = useStyles()\n\n return (\n <FormSheet.Root\n style={styles.formSheetRoot}\n contentStyle={styles.formSheetContent}\n showAndroidSheetGrabber={false}\n >\n <FormSheet.Header style={styles.header}>\n <FormSheet.HeaderTitle>{headerTitle}</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>{headerActions}</FormSheet.HeaderActions>\n </FormSheet.Header>\n\n <AvatarPreview state={state} fallback={fallbackPreview} />\n\n <Tabs\n data={TABS}\n activeTab={state.activeTab}\n onTabPress={tab => dispatch({ type: 'SELECT_TAB', payload: tab })}\n renderItem={({ item }) => (\n <Text\n style={[styles.tabLabel, item === state.activeTab && styles.tabLabelActive]}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n >\n {TAB_LABELS[item]}\n </Text>\n )}\n style={styles.tabs}\n />\n\n <View style={styles.body}>\n {state.activeTab === 'icon' && (\n <IconGrid\n selectedIconKey={state.selectedType === 'icon' ? state.selectedKey : null}\n onIconSelect={iconKey => dispatch({ type: 'SELECT_ICON', payload: iconKey })}\n />\n )}\n {state.activeTab === 'emoji' && (\n <EmojiTab onEmojiSelect={emoji => dispatch({ type: 'SELECT_EMOJI', payload: emoji })} />\n )}\n {state.activeTab === 'upload' && (\n <UploadTab\n imagePreviewUri={state.imagePreviewUri}\n onImageSelect={asset => dispatch({ type: 'SET_IMAGE', payload: asset })}\n />\n )}\n </View>\n\n {state.activeTab !== 'upload' && (\n <View style={styles.colorPickerWrapper}>\n <ColorPicker\n selectedColor={state.selectedColor}\n onColorSelect={color => dispatch({ type: 'SELECT_COLOR', payload: color })}\n />\n </View>\n )}\n </FormSheet.Root>\n )\n}\n\nfunction EmptyAvatarPlaceholder() {\n const styles = useStyles()\n const diameter = usePreviewAvatarDiameter()\n return (\n <View\n style={[\n styles.emptyAvatarPlaceholder,\n { width: diameter, height: diameter, borderRadius: diameter / 2 },\n ]}\n />\n )\n}\n\ntype ValidAvatarPickerState = AvatarPickerState &\n (\n | { selectedType: 'icon' | 'emoji'; selectedKey: string }\n | { selectedType: 'image'; imageAsset: ImagePickerAsset }\n )\n\nfunction hasValidSelection(state: AvatarPickerState): state is ValidAvatarPickerState {\n switch (state.selectedType) {\n case 'icon':\n case 'emoji':\n return state.selectedKey !== null\n case 'image':\n return state.imageAsset !== null\n case null:\n return false\n }\n}\n\nfunction buildPayload(state: AvatarPickerState): AvatarUpdatePayload | null {\n if (!hasValidSelection(state)) return null\n\n const color = coerceColorKey(state.selectedColor)\n\n switch (state.selectedType) {\n case 'icon':\n return { kind: 'icon', key: state.selectedKey, color }\n case 'emoji':\n return { kind: 'emoji', key: state.selectedKey, color }\n case 'image':\n return { kind: 'image', imageAsset: state.imageAsset, color }\n }\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK })\n const { top } = useSafeAreaInsets()\n\n return StyleSheet.create({\n formSheetRoot: {\n flex: 1,\n },\n formSheetContent: {\n flex: 1,\n },\n header: {\n paddingTop: Platform.select({ ios: 20, android: 20 + top }),\n },\n tabs: {\n minHeight: 52 * fontScale,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n backgroundColor: colors.fillColorNeutral100Inverted,\n zIndex: 1,\n },\n tabLabel: {\n fontSize: 14,\n color: colors.textColorDefaultSecondary,\n paddingVertical: 14 * fontScale,\n minWidth: 56 * fontScale,\n textAlign: 'center',\n },\n tabLabelActive: {\n color: colors.textColorDefaultPrimary,\n },\n body: {\n flex: 1,\n overflow: 'hidden',\n },\n colorPickerWrapper: {\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultBase,\n },\n emptyAvatarPlaceholder: {\n borderWidth: 2,\n borderStyle: 'dashed',\n borderColor: colors.borderColorDefaultBase,\n },\n })\n}\n"]}
|
|
@@ -4,6 +4,6 @@ interface AvatarPreviewProps {
|
|
|
4
4
|
state: AvatarPickerState;
|
|
5
5
|
fallback: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare function AvatarPreview({ state, fallback }: AvatarPreviewProps):
|
|
7
|
+
export declare function AvatarPreview({ state, fallback }: AvatarPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=avatar_preview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar_preview.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,UAAU,kBAAkB;IAC1B,KAAK,EAAE,iBAAiB,CAAA;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AA8BD,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"avatar_preview.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,UAAU,kBAAkB;IAC1B,KAAK,EAAE,iBAAiB,CAAA;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AA8BD,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,2CAIpE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
import { EmojiAvatar } from '../../components/display/emoji_avatar';
|
|
4
4
|
import { IconAvatar } from '../../components/display/icon_avatar';
|
|
@@ -15,19 +15,15 @@ function getPreviewNode(state, diameter) {
|
|
|
15
15
|
case 'icon':
|
|
16
16
|
if (!state.selectedKey)
|
|
17
17
|
return null;
|
|
18
|
-
return
|
|
18
|
+
return _jsx(IconAvatar, { iconKey: state.selectedKey, color: state.selectedColor, ...sizeProps });
|
|
19
19
|
case 'emoji':
|
|
20
20
|
if (!state.selectedKey)
|
|
21
21
|
return null;
|
|
22
|
-
return
|
|
22
|
+
return _jsx(EmojiAvatar, { emoji: state.selectedKey, color: state.selectedColor, ...sizeProps });
|
|
23
23
|
case 'image':
|
|
24
24
|
if (!state.imagePreviewUri)
|
|
25
25
|
return null;
|
|
26
|
-
return (
|
|
27
|
-
<AvatarPrimitive.Mask>
|
|
28
|
-
<AvatarPrimitive.Image sourceUri={state.imagePreviewUri}/>
|
|
29
|
-
</AvatarPrimitive.Mask>
|
|
30
|
-
</AvatarPrimitive.Root>);
|
|
26
|
+
return (_jsx(AvatarPrimitive.Root, { ...sizeProps, children: _jsx(AvatarPrimitive.Mask, { children: _jsx(AvatarPrimitive.Image, { sourceUri: state.imagePreviewUri }) }) }));
|
|
31
27
|
default:
|
|
32
28
|
return null;
|
|
33
29
|
}
|
|
@@ -35,7 +31,7 @@ function getPreviewNode(state, diameter) {
|
|
|
35
31
|
export function AvatarPreview({ state, fallback }) {
|
|
36
32
|
const diameter = usePreviewAvatarDiameter();
|
|
37
33
|
const preview = getPreviewNode(state, diameter);
|
|
38
|
-
return
|
|
34
|
+
return _jsx(View, { style: styles.container, children: preview ?? fallback });
|
|
39
35
|
}
|
|
40
36
|
const styles = StyleSheet.create({
|
|
41
37
|
container: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar_preview.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_preview.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avatar_preview.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_preview.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjE,OAAO,eAAe,MAAM,6CAA6C,CAAA;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAQ/D,SAAS,cAAc,CAAC,KAAwB,EAAE,QAAgB;IAChE,MAAM,SAAS,GAAG;QAChB,IAAI,EAAE,KAAK;QACX,qBAAqB,EAAE,iCAAiC;QACxD,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE;KACpC,CAAA;IAEV,QAAQ,KAAK,CAAC,YAAY,EAAE,CAAC;QAC3B,KAAK,MAAM;YACT,IAAI,CAAC,KAAK,CAAC,WAAW;gBAAE,OAAO,IAAI,CAAA;YACnC,OAAO,KAAC,UAAU,IAAC,OAAO,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,KAAM,SAAS,GAAI,CAAA;QAC9F,KAAK,OAAO;YACV,IAAI,CAAC,KAAK,CAAC,WAAW;gBAAE,OAAO,IAAI,CAAA;YACnC,OAAO,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,KAAM,SAAS,GAAI,CAAA;QAC7F,KAAK,OAAO;YACV,IAAI,CAAC,KAAK,CAAC,eAAe;gBAAE,OAAO,IAAI,CAAA;YACvC,OAAO,CACL,KAAC,eAAe,CAAC,IAAI,OAAK,SAAS,YACjC,KAAC,eAAe,CAAC,IAAI,cACnB,KAAC,eAAe,CAAC,KAAK,IAAC,SAAS,EAAE,KAAK,CAAC,eAAe,GAAI,GACtC,GACF,CACxB,CAAA;QACH;YACE,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAsB;IACnE,MAAM,QAAQ,GAAG,wBAAwB,EAAE,CAAA;IAC3C,MAAM,OAAO,GAAG,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC/C,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,YAAG,OAAO,IAAI,QAAQ,GAAQ,CAAA;AACpE,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,UAAU,EAAE,QAAQ;QACpB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,EAAE;KAClB;CACF,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { EmojiAvatar } from '../../components/display/emoji_avatar'\nimport { IconAvatar } from '../../components/display/icon_avatar'\nimport AvatarPrimitive from '../../components/primitive/avatar_primitive'\nimport { usePreviewAvatarDiameter } from '../../hooks/use_preview_avatar_diameter'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport type { AvatarPickerState } from './avatar_picker_state'\n\ninterface AvatarPreviewProps {\n state: AvatarPickerState\n fallback: React.ReactNode\n}\n\nfunction getPreviewNode(state: AvatarPickerState, diameter: number): React.ReactNode {\n const sizeProps = {\n size: '2xl',\n maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK,\n style: { width: diameter, height: diameter },\n } as const\n\n switch (state.selectedType) {\n case 'icon':\n if (!state.selectedKey) return null\n return <IconAvatar iconKey={state.selectedKey} color={state.selectedColor} {...sizeProps} />\n case 'emoji':\n if (!state.selectedKey) return null\n return <EmojiAvatar emoji={state.selectedKey} color={state.selectedColor} {...sizeProps} />\n case 'image':\n if (!state.imagePreviewUri) return null\n return (\n <AvatarPrimitive.Root {...sizeProps}>\n <AvatarPrimitive.Mask>\n <AvatarPrimitive.Image sourceUri={state.imagePreviewUri} />\n </AvatarPrimitive.Mask>\n </AvatarPrimitive.Root>\n )\n default:\n return null\n }\n}\n\nexport function AvatarPreview({ state, fallback }: AvatarPreviewProps) {\n const diameter = usePreviewAvatarDiameter()\n const preview = getPreviewNode(state, diameter)\n return <View style={styles.container}>{preview ?? fallback}</View>\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n paddingTop: 24,\n paddingBottom: 16,\n },\n})\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type CustomAvatarColorKey } from '../../components/display/utils/avatar_gradient_colors';
|
|
3
2
|
interface ColorPickerProps {
|
|
4
3
|
selectedColor: string;
|
|
5
4
|
onColorSelect: (color: CustomAvatarColorKey) => void;
|
|
6
5
|
}
|
|
7
|
-
export declare function ColorPicker({ selectedColor, onColorSelect }: ColorPickerProps):
|
|
6
|
+
export declare function ColorPicker({ selectedColor, onColorSelect }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
|
9
8
|
//# sourceMappingURL=color_picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color_picker.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/color_picker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color_picker.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/color_picker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,uDAAuD,CAAA;AAI9D,UAAU,gBAAgB;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CACrD;AAED,wBAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,EAAE,gBAAgB,2CAkC7E"}
|