@planningcenter/chat-react-native 3.42.2-qa-821.1 → 3.42.2-qa-staging.4
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 +7 -3
- package/build/components/conversation/attachments/attachment_card.js.map +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts +2 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts.map +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.js +7 -12
- package/build/components/conversation/attachments/attachment_deleting_overlay.js.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.d.ts +2 -1
- package/build/components/conversation/attachments/audio_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.js +23 -6
- package/build/components/conversation/attachments/audio_attachment.js.map +1 -1
- package/build/components/conversation/attachments/expanded_link.d.ts +2 -1
- package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -1
- package/build/components/conversation/attachments/expanded_link.js +8 -2
- package/build/components/conversation/attachments/expanded_link.js.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts +2 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.js +12 -2
- package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts +2 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.js +7 -2
- package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
- package/build/components/conversation/attachments/image_attachment.d.ts +2 -1
- package/build/components/conversation/attachments/image_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/image_attachment.js +53 -16
- package/build/components/conversation/attachments/image_attachment.js.map +1 -1
- package/build/components/conversation/attachments/video_attachment.d.ts +2 -1
- package/build/components/conversation/attachments/video_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/video_attachment.js +13 -3
- package/build/components/conversation/attachments/video_attachment.js.map +1 -1
- package/build/components/conversation/conversation_start_banner.d.ts +2 -1
- package/build/components/conversation/conversation_start_banner.d.ts.map +1 -1
- package/build/components/conversation/conversation_start_banner.js +14 -2
- 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 +9 -2
- 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 +10 -2
- package/build/components/conversation/jump_to_bottom_button.js.map +1 -1
- package/build/components/conversation/message.d.ts +2 -1
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +53 -2
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_attachments.d.ts +2 -1
- package/build/components/conversation/message_attachments.d.ts.map +1 -1
- package/build/components/conversation/message_attachments.js +21 -17
- package/build/components/conversation/message_attachments.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_file.d.ts +2 -1
- 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 +2 -1
- 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 +2 -1
- 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 +6 -5
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +82 -20
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_markdown.d.ts +2 -1
- package/build/components/conversation/message_markdown.d.ts.map +1 -1
- package/build/components/conversation/message_markdown.js +16 -8
- package/build/components/conversation/message_markdown.js.map +1 -1
- package/build/components/conversation/message_reaction.d.ts +2 -1
- package/build/components/conversation/message_reaction.d.ts.map +1 -1
- package/build/components/conversation/message_reaction.js +5 -3
- package/build/components/conversation/message_reaction.js.map +1 -1
- package/build/components/conversation/message_read_receipts.d.ts +2 -1
- package/build/components/conversation/message_read_receipts.d.ts.map +1 -1
- package/build/components/conversation/message_read_receipts.js +13 -3
- 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 +15 -8
- 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 +50 -18
- package/build/components/conversation/reply_connectors.js.map +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts +2 -1
- package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
- package/build/components/conversation/reply_shadow_message.js +46 -16
- package/build/components/conversation/reply_shadow_message.js.map +1 -1
- package/build/components/conversation/system_message.d.ts +2 -1
- package/build/components/conversation/system_message.d.ts.map +1 -1
- package/build/components/conversation/system_message.js +12 -3
- package/build/components/conversation/system_message.js.map +1 -1
- package/build/components/conversation/typing_indicator.d.ts +2 -1
- package/build/components/conversation/typing_indicator.d.ts.map +1 -1
- package/build/components/conversation/typing_indicator.js +13 -3
- 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 +10 -4
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts +3 -2
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +76 -12
- 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 +17 -16
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/conversations/conversations_blank_state.d.ts +2 -1
- package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
- package/build/components/conversations/conversations_blank_state.js +12 -2
- package/build/components/conversations/conversations_blank_state.js.map +1 -1
- package/build/components/conversations/mute_indicator.d.ts +2 -1
- 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 +2 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.js +10 -3
- package/build/components/conversations/swipeable_toggle_button.js.map +1 -1
- package/build/components/conversations/unread_count_badge.d.ts +4 -2
- package/build/components/conversations/unread_count_badge.d.ts.map +1 -1
- package/build/components/conversations/unread_count_badge.js +12 -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 +13 -3
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/adult_requirement_notice.d.ts +2 -1
- package/build/components/display/adult_requirement_notice.d.ts.map +1 -1
- package/build/components/display/adult_requirement_notice.js +4 -2
- package/build/components/display/adult_requirement_notice.js.map +1 -1
- package/build/components/display/avatar.d.ts +2 -1
- package/build/components/display/avatar.d.ts.map +1 -1
- package/build/components/display/avatar.js +7 -2
- package/build/components/display/avatar.js.map +1 -1
- package/build/components/display/avatar_group.d.ts +2 -1
- package/build/components/display/avatar_group.d.ts.map +1 -1
- package/build/components/display/avatar_group.js +9 -2
- package/build/components/display/avatar_group.js.map +1 -1
- package/build/components/display/badge.d.ts +2 -1
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +37 -6
- 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 +11 -4
- 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 +10 -2
- package/build/components/display/banner_collapsible.js.map +1 -1
- package/build/components/display/button.d.ts +2 -1
- package/build/components/display/button.d.ts.map +1 -1
- package/build/components/display/button.js +14 -3
- package/build/components/display/button.js.map +1 -1
- package/build/components/display/child_notice.d.ts +2 -1
- package/build/components/display/child_notice.d.ts.map +1 -1
- package/build/components/display/child_notice.js +15 -3
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/display/conversation_avatar.d.ts +2 -1
- package/build/components/display/conversation_avatar.d.ts.map +1 -1
- package/build/components/display/conversation_avatar.js +9 -5
- package/build/components/display/conversation_avatar.js.map +1 -1
- package/build/components/display/emoji_avatar.d.ts +2 -1
- package/build/components/display/emoji_avatar.d.ts.map +1 -1
- package/build/components/display/emoji_avatar.js +12 -2
- 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 +17 -3
- package/build/components/display/file_attachment_preview.js.map +1 -1
- package/build/components/display/heading.d.ts +2 -1
- package/build/components/display/heading.d.ts.map +1 -1
- package/build/components/display/heading.js +4 -2
- package/build/components/display/heading.js.map +1 -1
- package/build/components/display/icon.d.ts +2 -1
- 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 +2 -1
- package/build/components/display/icon_avatar.d.ts.map +1 -1
- package/build/components/display/icon_avatar.js +12 -2
- package/build/components/display/icon_avatar.js.map +1 -1
- package/build/components/display/icon_button.d.ts +2 -1
- package/build/components/display/icon_button.d.ts.map +1 -1
- package/build/components/display/icon_button.js +5 -3
- package/build/components/display/icon_button.js.map +1 -1
- package/build/components/display/image.d.ts +2 -1
- package/build/components/display/image.d.ts.map +1 -1
- package/build/components/display/image.js +7 -3
- 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 +7 -2
- package/build/components/display/image_attachment_preview.js.map +1 -1
- package/build/components/display/keyboard_view.d.ts +2 -1
- package/build/components/display/keyboard_view.d.ts.map +1 -1
- package/build/components/display/keyboard_view.js +9 -4
- package/build/components/display/keyboard_view.js.map +1 -1
- package/build/components/display/person.d.ts +2 -1
- package/build/components/display/person.d.ts.map +1 -1
- package/build/components/display/person.js +12 -2
- 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 +10 -5
- 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 +7 -2
- package/build/components/display/pressable_row.js.map +1 -1
- package/build/components/display/spinner.d.ts +2 -1
- package/build/components/display/spinner.d.ts.map +1 -1
- package/build/components/display/spinner.js +9 -3
- package/build/components/display/spinner.js.map +1 -1
- package/build/components/display/switch.d.ts +2 -1
- 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 +31 -21
- package/build/components/display/tabs.js.map +1 -1
- package/build/components/display/text.d.ts +2 -1
- package/build/components/display/text.d.ts.map +1 -1
- package/build/components/display/text.js +4 -2
- package/build/components/display/text.js.map +1 -1
- package/build/components/display/text_button.d.ts +2 -1
- package/build/components/display/text_button.d.ts.map +1 -1
- package/build/components/display/text_button.js +8 -3
- package/build/components/display/text_button.js.map +1 -1
- package/build/components/display/text_inline_button.d.ts +2 -1
- package/build/components/display/text_inline_button.d.ts.map +1 -1
- package/build/components/display/text_inline_button.js +5 -4
- 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 +1 -2
- package/build/components/display/text_input.js.map +1 -1
- package/build/components/display/toggle_button.d.ts +2 -1
- package/build/components/display/toggle_button.d.ts.map +1 -1
- package/build/components/display/toggle_button.js +9 -3
- 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 +20 -3
- 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 +14 -4
- 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 +4 -2
- package/build/components/page/component_error_boundary.js.map +1 -1
- package/build/components/page/loading.d.ts +2 -1
- package/build/components/page/loading.d.ts.map +1 -1
- package/build/components/page/loading.js +4 -2
- 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 +32 -11
- package/build/components/page/page_error_boundary.js.map +1 -1
- package/build/components/primitive/avatar_primitive.js +41 -14
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/components/primitive/banner_primitive.js +18 -10
- package/build/components/primitive/banner_primitive.js.map +1 -1
- package/build/components/primitive/blank_state_primitive.js +12 -8
- 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 +22 -9
- 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 +3 -2
- package/build/components/safe_area_modal.js.map +1 -1
- package/build/contexts/api_provider.d.ts +2 -1
- package/build/contexts/api_provider.d.ts.map +1 -1
- package/build/contexts/api_provider.js +5 -3
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts +1 -1
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +1 -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 +2 -3
- 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 +2 -3
- 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 +2 -3
- 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/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 +3 -0
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +4 -19
- package/build/hooks/use_conversation_jolt_events.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_conversation_messages.d.ts +0 -1
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +2 -2
- package/build/hooks/use_conversation_messages.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts +36 -36
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.js +3 -1
- package/build/hooks/use_conversations_actions.js.map +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
- package/build/hooks/use_mark_latest_message_read.js +3 -4
- package/build/hooks/use_mark_latest_message_read.js.map +1 -1
- package/build/hooks/use_person_settings.d.ts +1 -1
- package/build/index.d.ts +1 -2
- 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 +5 -6
- package/build/navigation/chat_access_gate.js.map +1 -1
- package/build/navigation/index.d.ts +36 -35
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +21 -19
- 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 +9 -3
- 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 +2 -1
- package/build/screens/age_check/age_check_required_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_required_screen.js +46 -3
- package/build/screens/age_check/age_check_required_screen.js.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.d.ts +2 -1
- package/build/screens/age_check/age_check_underage_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.js +25 -2
- 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 +2 -1
- 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 +25 -6
- 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 +2 -1
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js +5 -3
- package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts +2 -1
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts.map +1 -1
- package/build/screens/avatar_picker/avatar_picker_screen.js +36 -9
- 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 +9 -5
- package/build/screens/avatar_picker/avatar_preview.js.map +1 -1
- package/build/screens/avatar_picker/color_picker.d.ts +2 -1
- package/build/screens/avatar_picker/color_picker.d.ts.map +1 -1
- package/build/screens/avatar_picker/color_picker.js +5 -4
- package/build/screens/avatar_picker/color_picker.js.map +1 -1
- package/build/screens/avatar_picker/emoji_tab.d.ts +2 -1
- package/build/screens/avatar_picker/emoji_tab.d.ts.map +1 -1
- package/build/screens/avatar_picker/emoji_tab.js +13 -12
- package/build/screens/avatar_picker/emoji_tab.js.map +1 -1
- package/build/screens/avatar_picker/icon_grid.d.ts +2 -1
- package/build/screens/avatar_picker/icon_grid.d.ts.map +1 -1
- package/build/screens/avatar_picker/icon_grid.js +5 -4
- package/build/screens/avatar_picker/icon_grid.js.map +1 -1
- package/build/screens/avatar_picker/upload_tab.d.ts +2 -1
- package/build/screens/avatar_picker/upload_tab.d.ts.map +1 -1
- package/build/screens/avatar_picker/upload_tab.js +4 -3
- package/build/screens/avatar_picker/upload_tab.js.map +1 -1
- package/build/screens/bug_report_screen.d.ts +2 -1
- package/build/screens/bug_report_screen.d.ts.map +1 -1
- package/build/screens/bug_report_screen.js +117 -11
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.d.ts +2 -1
- package/build/screens/conversation/message_read_receipts_screen.d.ts.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.js +20 -4
- package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts +2 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +106 -43
- 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 +9 -3
- 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 +12 -2
- 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 +2 -1
- 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 +44 -20
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts +2 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +11 -10
- 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 +34 -7
- 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 +1 -2
- package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts +2 -1
- 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 +2 -1
- 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 +2 -1
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +16 -4
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/conversation_new/components/avatar_selection_row.d.ts +3 -2
- package/build/screens/conversation_new/components/avatar_selection_row.d.ts.map +1 -1
- package/build/screens/conversation_new/components/avatar_selection_row.js +16 -6
- package/build/screens/conversation_new/components/avatar_selection_row.js.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.d.ts +4 -3
- package/build/screens/conversation_new/components/filter_by_plan.d.ts.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.js +46 -22
- package/build/screens/conversation_new/components/filter_by_plan.js.map +1 -1
- package/build/screens/conversation_new/components/form_list.d.ts +3 -2
- package/build/screens/conversation_new/components/form_list.d.ts.map +1 -1
- package/build/screens/conversation_new/components/form_list.js +6 -4
- package/build/screens/conversation_new/components/form_list.js.map +1 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts +2 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts.map +1 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.js +20 -4
- package/build/screens/conversation_new/components/gender_filter_toggle.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts +2 -1
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +30 -4
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts +2 -1
- package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +61 -27
- 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 +3 -2
- package/build/screens/conversation_new/components/source_app_error_card.js.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts +2 -1
- 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 +2 -1
- package/build/screens/conversation_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.js +6 -4
- package/build/screens/conversation_notification_level_select_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +3 -2
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +68 -25
- 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 +1 -2
- 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 +2 -1
- 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 +15 -2
- 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 +2 -1
- 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 +14 -2
- 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 +1 -2
- 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 +5 -2
- 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 +2 -1
- 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 +11 -4
- 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 +96 -13
- 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 +2 -1
- 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 +14 -7
- 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 +2 -1
- 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 +18 -15
- 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 +2 -1
- package/build/screens/conversation_select_type_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_type_screen.js +10 -3
- package/build/screens/conversation_select_type_screen.js.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.d.ts +2 -1
- package/build/screens/conversations/components/chat_group_badge.d.ts.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.js +4 -3
- package/build/screens/conversations/components/chat_group_badge.js.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.d.ts +2 -1
- package/build/screens/conversations/components/list_header_action_button.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.js +5 -3
- package/build/screens/conversations/components/list_header_action_button.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.d.ts +2 -1
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +42 -19
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +2 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +6 -2
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/design_system_screen.d.ts +2 -1
- package/build/screens/design_system_screen.d.ts.map +1 -1
- package/build/screens/design_system_screen.js +558 -35
- 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 +25 -4
- package/build/screens/get_help_screen.js.map +1 -1
- package/build/screens/group_notification_level_select_screen.d.ts +2 -1
- package/build/screens/group_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/group_notification_level_select_screen.js +4 -2
- package/build/screens/group_notification_level_select_screen.js.map +1 -1
- package/build/screens/group_notification_settings_screen.d.ts +2 -1
- package/build/screens/group_notification_settings_screen.d.ts.map +1 -1
- package/build/screens/group_notification_settings_screen.js +25 -3
- package/build/screens/group_notification_settings_screen.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts +2 -1
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js +28 -12
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/message_report/components/message_preview.d.ts +2 -1
- package/build/screens/message_report/components/message_preview.d.ts.map +1 -1
- package/build/screens/message_report/components/message_preview.js +22 -2
- package/build/screens/message_report/components/message_preview.js.map +1 -1
- package/build/screens/message_report/components/report_reason_list.d.ts +2 -1
- package/build/screens/message_report/components/report_reason_list.d.ts.map +1 -1
- package/build/screens/message_report/components/report_reason_list.js +13 -4
- package/build/screens/message_report/components/report_reason_list.js.map +1 -1
- package/build/screens/message_report_screen.d.ts +2 -1
- package/build/screens/message_report_screen.d.ts.map +1 -1
- package/build/screens/message_report_screen.js +61 -9
- package/build/screens/message_report_screen.js.map +1 -1
- package/build/screens/not_found.d.ts +2 -1
- package/build/screens/not_found.d.ts.map +1 -1
- package/build/screens/not_found.js +5 -2
- 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 +2 -1
- package/build/screens/notification_settings_screen.d.ts.map +1 -1
- package/build/screens/notification_settings_screen.js +66 -28
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/preferred_app_selection_screen.d.ts +2 -1
- package/build/screens/preferred_app_selection_screen.d.ts.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +21 -3
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/build/screens/reactions_screen.d.ts +2 -1
- package/build/screens/reactions_screen.d.ts.map +1 -1
- package/build/screens/reactions_screen.js +19 -7
- package/build/screens/reactions_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.d.ts +2 -1
- package/build/screens/send_giphy_screen.d.ts.map +1 -1
- package/build/screens/send_giphy_screen.js +31 -5
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/build/screens/settings_screen.d.ts +2 -1
- package/build/screens/settings_screen.d.ts.map +1 -1
- package/build/screens/settings_screen.js +26 -4
- package/build/screens/settings_screen.js.map +1 -1
- package/build/screens/system_message_people_screen.d.ts +2 -1
- package/build/screens/system_message_people_screen.d.ts.map +1 -1
- package/build/screens/system_message_people_screen.js +10 -4
- 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 +12 -4
- package/build/screens/team_conversation_screen.js.map +1 -1
- package/build/types/resources/conversation.d.ts +10 -1
- package/build/types/resources/conversation.d.ts.map +1 -1
- package/build/types/resources/conversation.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/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +2 -0
- package/build/utils/request/conversation.js.map +1 -1
- package/build/utils/response_error.d.ts.map +1 -1
- package/build/utils/response_error.js +16 -6
- package/build/utils/response_error.js.map +1 -1
- 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.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 +0 -1
- package/src/__tests__/hooks/use_font_scale.test.ts +3 -7
- 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 +50 -8
- package/src/__utils__/handlers.ts +6 -5
- package/src/components/conversation/attachments/attachment_deleting_overlay.tsx +3 -10
- package/src/components/conversation/messages_disabled_banners.tsx +31 -4
- package/src/components/conversations/conversation_preview.tsx +58 -23
- package/src/components/conversations/unread_count_badge.tsx +13 -4
- package/src/components/page/__tests__/component_error_boundary.test.tsx +1 -1
- package/src/components/page/__tests__/error_boundary.test.tsx +2 -6
- package/src/components/page/__tests__/page_error_boundary.test.tsx +1 -1
- 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/use_conversation.ts +3 -0
- package/src/hooks/use_conversation_jolt_events.ts +3 -19
- package/src/hooks/use_conversation_messages.ts +5 -6
- package/src/hooks/use_conversations_actions.ts +3 -1
- package/src/hooks/use_mark_latest_message_read.ts +3 -4
- package/src/index.tsx +1 -2
- package/src/polyfills/events/EventTarget.ts +1 -1
- package/src/screens/conversation_screen.tsx +11 -5
- 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/conversations/components/list_header_component.tsx +6 -6
- package/src/types/resources/conversation.ts +11 -1
- 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/utils/__tests__/response_error.test.ts +7 -0
- package/src/utils/request/conversation.ts +2 -0
- package/src/utils/response_error.ts +18 -7
- package/src/utils/sha_256.ts +24 -24
- package/src/utils/system_messages.ts +1 -1
- package/src/utils/theme.ts +2 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Pressable, StyleSheet } from 'react-native';
|
|
3
3
|
import { useTheme, useFontScale, useCreateAndroidRippleColor, useInteractionGhostBackgroundColor, } from '../../hooks';
|
|
4
4
|
import { MAX_FONT_SIZE_MULTIPLIER_LANDMARK, platformFontWeightBold, platformPressedOpacityStyle, } from '../../utils';
|
|
@@ -18,11 +18,17 @@ export function ToggleButton({ active, accessibilityLabel, adjustsFontSizeToFit
|
|
|
18
18
|
Haptic.impactLight();
|
|
19
19
|
onPress?.(event);
|
|
20
20
|
};
|
|
21
|
-
return (
|
|
21
|
+
return (<Pressable style={({ pressed }) => ({
|
|
22
22
|
...styles.pressable,
|
|
23
23
|
...(pressed ? platformPressedOpacityStyle : null),
|
|
24
24
|
...overrideStyles,
|
|
25
|
-
})
|
|
25
|
+
})} accessibilityRole="togglebutton" accessibilityLabel={accessibilityLabel} accessibilityState={{ checked: active }} android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }} onPress={handlePress} accessibilityShowsLargeContentViewer accessibilityLargeContentTitle={accessibilityLabel} {...props}>
|
|
26
|
+
{iconNameLeft && (<Icon name={iconNameLeft} style={styles.icon} maxFontSizeMultiplier={maxFontSizeMultiplier}/>)}
|
|
27
|
+
{hasTitle && (<Text allowFontScaling={allowFontScaling} minimumFontScale={minimumFontScale} maxFontSizeMultiplier={maxFontSizeMultiplier} adjustsFontSizeToFit={adjustsFontSizeToFit} numberOfLines={1} style={styles.text} variant="tertiary">
|
|
28
|
+
{title}
|
|
29
|
+
</Text>)}
|
|
30
|
+
{iconNameRight && (<Icon name={iconNameRight} style={styles.icon} maxFontSizeMultiplier={maxFontSizeMultiplier}/>)}
|
|
31
|
+
</Pressable>);
|
|
26
32
|
}
|
|
27
33
|
// =================================
|
|
28
34
|
// ====== Styles ===================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle_button.js","sourceRoot":"","sources":["../../../src/components/display/toggle_button.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"toggle_button.js","sourceRoot":"","sources":["../../../src/components/display/toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEpD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,2BAA2B,EAC3B,kCAAkC,GACnC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,iCAAiC,EACjC,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,IAAI,EAAc,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAiE7B,MAAM,UAAU,YAAY,CAAC,EAC3B,MAAM,EACN,kBAAkB,EAClB,oBAAoB,GAAG,KAAK,EAC5B,gBAAgB,GAAG,IAAI,EACvB,YAAY,EACZ,aAAa,EACb,qBAAqB,GAAG,iCAAiC,EACzD,gBAAgB,EAChB,KAAK,EACL,KAAK,EACL,cAAc,GAAG,IAAI,EACrB,OAAO,EACP,GAAG,KAAK,EACU;IAClB,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;IAC/B,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC,CAAA;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA,CAAC,+CAA+C;IAEhG,M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,iBAAiB,EAAE,EAAE,GAAG,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,MAAM,EAAE,EAAE,GAAG,SAAS;YACtB,GAAG,EAAE,CAAC,GAAG,SAAS;YAClB,QAAQ,EAAE,QAAQ;SACnB;QACD,IAAI,EAAE;YACJ,SAAS,EAAE,QAAQ;YACnB,iBAAiB,EAAE,QAAQ;YAC3B,kBAAkB,EAAE,KAAK;YACzB,UAAU,EAAE,sBAAsB;YAClC,KAAK;SACN;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS;YACvC,KAAK;SACN;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet } from 'react-native'\nimport type { PressableProps, GestureResponderEvent } from 'react-native'\nimport {\n useTheme,\n useFontScale,\n useCreateAndroidRippleColor,\n useInteractionGhostBackgroundColor,\n} from '../../hooks'\nimport {\n MAX_FONT_SIZE_MULTIPLIER_LANDMARK,\n platformFontWeightBold,\n platformPressedOpacityStyle,\n} from '../../utils'\nimport { Haptic } from '../../utils/native_adapters/configuration'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { Icon, IconString } from './icon'\nimport { Text } from './text'\n\n// =================================\n// ====== Constants ================\n// =================================\n\n// We are omitting `onLongPress` because we are instead supporting `accessibilityShowsLargeContentViewer`.\n// This is triggered by an `onLongPress` event when an iOS device is in Apple's accessible font scale range.\n// Triggering this prop will display an almost full screen iOS a11y button.\ntype RestrictedPressableProps = Omit<PressableProps, 'onLongPress'>\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface ToggleButtonProps extends RestrictedPressableProps {\n /**\n * Whether the toggle button is active/checked\n */\n active: boolean\n /**\n * Required accessibility label for screen readers.\n * When title is provided, this provides additional context.\n * When title is omitted (icon-only mode), this is the primary label.\n */\n accessibilityLabel: string\n /**\n * Specifies whether fonts should be scaled down automatically to fit given style constraints.\n */\n adjustsFontSizeToFit?: boolean\n /**\n * Specifies whether fonts should scale to respect the device's text size accessibility settings. The default is true.\n */\n allowFontScaling?: boolean\n /**\n * Generates an icon to the left of the button text\n */\n iconNameLeft?: IconString\n /**\n * Generates an icon to the right of the button text\n */\n iconNameRight?: IconString\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).\n */\n minimumFontScale?: number\n /**\n * Renders as text within the button.\n * When omitted, button displays in icon-only mode.\n */\n title?: string\n /**\n * Pressable container styles\n */\n style?: PressableProps['style']\n /**\n * Specifies whether haptic feedback should be enabled.\n */\n hapticFeedback?: boolean\n}\n\nexport function ToggleButton({\n active,\n accessibilityLabel,\n adjustsFontSizeToFit = false,\n allowFontScaling = true,\n iconNameLeft,\n iconNameRight,\n maxFontSizeMultiplier = MAX_FONT_SIZE_MULTIPLIER_LANDMARK,\n minimumFontScale,\n title,\n style,\n hapticFeedback = true,\n onPress,\n ...props\n}: ToggleButtonProps) {\n const hasTitle = Boolean(title)\n const styles = useStyles({ active, maxFontSizeMultiplier })\n const { colors } = useTheme()\n const overrideStyles = StyleSheet.flatten(style) // Ensures the pressed styles still get applied\n\n const baseRippleColor = active ? colors.interaction : colors.fillColorNeutral050Base\n const androidRippleColor = useCreateAndroidRippleColor({ color: baseRippleColor })\n\n const handlePress = (event: GestureResponderEvent) => {\n if (hapticFeedback) Haptic.impactLight()\n\n onPress?.(event)\n }\n\n return (\n <Pressable\n style={({ pressed }) => ({\n ...styles.pressable,\n ...(pressed ? platformPressedOpacityStyle : null),\n ...overrideStyles,\n })}\n accessibilityRole=\"togglebutton\"\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ checked: active }}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n onPress={handlePress}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle={accessibilityLabel}\n {...props}\n >\n {iconNameLeft && (\n <Icon\n name={iconNameLeft}\n style={styles.icon}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n {hasTitle && (\n <Text\n allowFontScaling={allowFontScaling}\n minimumFontScale={minimumFontScale}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n numberOfLines={1}\n style={styles.text}\n variant=\"tertiary\"\n >\n {title}\n </Text>\n )}\n {iconNameRight && (\n <Icon\n name={iconNameRight}\n style={styles.icon}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n </Pressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ active, maxFontSizeMultiplier }: Partial<ToggleButtonProps>) => {\n const { colors, button } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n\n const activeBackgroundColor = useInteractionGhostBackgroundColor()\n\n const color = active ? colors.interaction : colors.textColorDefaultSecondary\n\n return StyleSheet.create({\n pressable: {\n borderRadius: button.borderRadius * fontScale,\n borderWidth: 1,\n borderColor: active ? colors.interaction : colors.borderColorDefaultBase,\n backgroundColor: active ? activeBackgroundColor : 'transparent',\n paddingHorizontal: 16 * fontScale,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n height: 32 * fontScale,\n gap: 6 * fontScale,\n overflow: 'hidden',\n },\n text: {\n textAlign: 'center',\n textAlignVertical: 'center',\n includeFontPadding: false,\n fontWeight: platformFontWeightBold,\n color,\n },\n icon: {\n fontSize: tokens.fontSizeSm * fontScale,\n color,\n },\n })\n}\n"]}
|
|
@@ -6,6 +6,6 @@ interface VideoAttachmentPreviewProps {
|
|
|
6
6
|
error?: boolean;
|
|
7
7
|
hideRemoveButton?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare const VideoAttachmentPreview: ({ name, duration, onRemovePress, loading, error, hideRemoveButton, }: VideoAttachmentPreviewProps) => import("react
|
|
9
|
+
export declare const VideoAttachmentPreview: ({ name, duration, onRemovePress, loading, error, hideRemoveButton, }: VideoAttachmentPreviewProps) => import("react").JSX.Element;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=video_attachment_preview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video_attachment_preview.d.ts","sourceRoot":"","sources":["../../../src/components/display/video_attachment_preview.tsx"],"names":[],"mappings":"AASA,UAAU,2BAA2B;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,sBAAsB,GAAI,sEAOpC,2BAA2B,
|
|
1
|
+
{"version":3,"file":"video_attachment_preview.d.ts","sourceRoot":"","sources":["../../../src/components/display/video_attachment_preview.tsx"],"names":[],"mappings":"AASA,UAAU,2BAA2B;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,sBAAsB,GAAI,sEAOpC,2BAA2B,gCAqD7B,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { View, StyleSheet } from 'react-native';
|
|
3
2
|
import { useTheme } from '../../hooks';
|
|
4
3
|
import { platformFontWeightMedium } from '../../utils';
|
|
@@ -10,9 +9,27 @@ import { Text } from './text';
|
|
|
10
9
|
export const VideoAttachmentPreview = ({ name, duration, onRemovePress, loading = false, error = false, hideRemoveButton = false, }) => {
|
|
11
10
|
const styles = useStyles({ error });
|
|
12
11
|
if (loading) {
|
|
13
|
-
return (
|
|
12
|
+
return (<View style={styles.container}>
|
|
13
|
+
<Spinner size={20} style={styles.spinner}/>
|
|
14
|
+
</View>);
|
|
14
15
|
}
|
|
15
|
-
return (
|
|
16
|
+
return (<View style={styles.container}>
|
|
17
|
+
<View style={styles.contentContainer}>
|
|
18
|
+
<Icon name="general.outlinedVideoFile" size={18} style={styles.fileIcon}/>
|
|
19
|
+
<View style={styles.textContainer}>
|
|
20
|
+
<Text variant="tertiary" numberOfLines={1} style={styles.nameText} accessibilityLabel={`Video attachment: ${name}`}>
|
|
21
|
+
{name}
|
|
22
|
+
</Text>
|
|
23
|
+
{duration && (<Text variant="tertiary" numberOfLines={1} style={styles.durationText} accessibilityLabel={`Duration: ${duration}`}>
|
|
24
|
+
{duration}
|
|
25
|
+
</Text>)}
|
|
26
|
+
</View>
|
|
27
|
+
</View>
|
|
28
|
+
{!hideRemoveButton && (<IconButton name="general.x" onPress={onRemovePress} size="xxs" appearance="neutral" style={styles.closeButton} accessibilityLabel="Remove video attachment"/>)}
|
|
29
|
+
{error && (<View style={styles.errorBadge}>
|
|
30
|
+
<Icon name="general.exclamationTriangle" size={12} style={styles.errorIcon}/>
|
|
31
|
+
</View>)}
|
|
32
|
+
</View>);
|
|
16
33
|
};
|
|
17
34
|
const useStyles = ({ error }) => {
|
|
18
35
|
const { colors } = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video_attachment_preview.js","sourceRoot":"","sources":["../../../src/components/display/video_attachment_preview.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"video_attachment_preview.js","sourceRoot":"","sources":["../../../src/components/display/video_attachment_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAA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AAS,EAAE,YAAY;SACxB;QACD,UAAU,EAAE;YACV,eAAe,EAAE,MAAM,CAAC,iBAAiB;YACzC,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,sBAAsB,EAAE,YAAY;YACpC,OAAO,EAAE,CAAC;SACX;QACD,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,oBAAoB;YAClC,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;YAC9B,QAAQ,EAAE,EAAE;SACb;QACD,OAAO,EAAE;YACP,gBAAgB,EAAE,MAAM;SACzB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { View, StyleSheet } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { platformFontWeightMedium } from '../../utils'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { Icon } from './icon'\nimport { IconButton } from './icon_button'\nimport { Spinner } from './spinner'\nimport { Text } from './text'\n\ninterface VideoAttachmentPreviewProps {\n name: string\n duration?: string\n onRemovePress: () => void\n loading?: boolean\n error?: boolean\n hideRemoveButton?: boolean\n}\n\nexport const VideoAttachmentPreview = ({\n name,\n duration,\n onRemovePress,\n loading = false,\n error = false,\n hideRemoveButton = false,\n}: VideoAttachmentPreviewProps) => {\n const styles = useStyles({ error })\n\n if (loading) {\n return (\n <View style={styles.container}>\n <Spinner size={20} style={styles.spinner} />\n </View>\n )\n }\n\n return (\n <View style={styles.container}>\n <View style={styles.contentContainer}>\n <Icon name=\"general.outlinedVideoFile\" size={18} style={styles.fileIcon} />\n <View style={styles.textContainer}>\n <Text\n variant=\"tertiary\"\n numberOfLines={1}\n style={styles.nameText}\n accessibilityLabel={`Video attachment: ${name}`}\n >\n {name}\n </Text>\n {duration && (\n <Text\n variant=\"tertiary\"\n numberOfLines={1}\n style={styles.durationText}\n accessibilityLabel={`Duration: ${duration}`}\n >\n {duration}\n </Text>\n )}\n </View>\n </View>\n {!hideRemoveButton && (\n <IconButton\n name=\"general.x\"\n onPress={onRemovePress}\n size=\"xxs\"\n appearance=\"neutral\"\n style={styles.closeButton}\n accessibilityLabel=\"Remove video attachment\"\n />\n )}\n {error && (\n <View style={styles.errorBadge}>\n <Icon name=\"general.exclamationTriangle\" size={12} style={styles.errorIcon} />\n </View>\n )}\n </View>\n )\n}\n\nconst useStyles = ({ error }: Partial<VideoAttachmentPreviewProps>) => {\n const { colors } = useTheme()\n const borderRadius = 8\n\n return StyleSheet.create({\n container: {\n height: 60,\n minWidth: 150,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: 8,\n backgroundColor: colors.fillColorNeutral070,\n borderColor: error ? colors.statusErrorBorder : colors.borderColorDefaultBase,\n borderWidth: error ? 2 : 1,\n borderRadius,\n padding: 4,\n },\n contentContainer: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n flexShrink: 1,\n paddingHorizontal: 8,\n paddingVertical: 4,\n },\n textContainer: {\n flexShrink: 1,\n flexDirection: 'column',\n },\n fileIcon: {\n color: error ? colors.iconColorDefaultDisabled : colors.iconColorDefaultPrimary,\n },\n nameText: {\n color: error ? colors.textColorDefaultDisabled : colors.textColorDefaultPrimary,\n fontWeight: platformFontWeightMedium,\n flexShrink: 1,\n },\n durationText: {\n color: error ? colors.textColorDefaultDisabled : colors.textColorDefaultPrimary,\n },\n closeButton: {\n backgroundColor: colors.fillColorNeutral050Base,\n borderRadius: 16,\n height: 20,\n width: 20,\n alignSelf: 'flex-start',\n },\n errorBadge: {\n backgroundColor: colors.statusErrorBorder,\n position: 'absolute',\n bottom: 0,\n right: 0,\n zIndex: 2,\n borderStartStartRadius: borderRadius,\n padding: 4,\n },\n errorIcon: {\n color: tokens.colorNeutral100White,\n transform: [{ translateX: 1 }],\n fontSize: 10,\n },\n spinner: {\n marginHorizontal: 'auto',\n },\n })\n}\n"]}
|
|
@@ -18,6 +18,6 @@ interface GroupConversationsProps extends Partial<ConversationRequestArgs> {
|
|
|
18
18
|
*
|
|
19
19
|
* Originally designed for use in CCA.
|
|
20
20
|
*/
|
|
21
|
-
export declare const GroupConversations: ({ chat_group_graph_id, ...rest }: GroupConversationsProps) =>
|
|
21
|
+
export declare const GroupConversations: ({ chat_group_graph_id, ...rest }: GroupConversationsProps) => React.JSX.Element;
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=group_conversation_list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_conversation_list.d.ts","sourceRoot":"","sources":["../../src/components/group_conversation_list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAA;AAM1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAIvE,UAAU,uBAAwB,SAAQ,OAAO,CAAC,uBAAuB,CAAC;IACxE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB,EAAE,CAAC,YAAY,EAAE,GAAG,KAAK,IAAI,CAAA;IAChD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,mBAAmB,CAAC,EAAE,CAAC,EAAE,gBAAgB,EAAE,EAAE;QAAE,gBAAgB,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAA;IACnF,mBAAmB,CAAC,EAChB,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACxB,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAA;IACtE,2BAA2B,CAAC,EACxB,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACxB,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAA;IACtE,wBAAwB,CAAC,EACrB,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACxB,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAA;CACvE;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,kCAAkC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"group_conversation_list.d.ts","sourceRoot":"","sources":["../../src/components/group_conversation_list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAA;AAM1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAIvE,UAAU,uBAAwB,SAAQ,OAAO,CAAC,uBAAuB,CAAC;IACxE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB,EAAE,CAAC,YAAY,EAAE,GAAG,KAAK,IAAI,CAAA;IAChD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,mBAAmB,CAAC,EAAE,CAAC,EAAE,gBAAgB,EAAE,EAAE;QAAE,gBAAgB,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAA;IACnF,mBAAmB,CAAC,EAChB,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACxB,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAA;IACtE,2BAA2B,CAAC,EACxB,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACxB,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAA;IACtE,wBAAwB,CAAC,EACrB,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACxB,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAA;CACvE;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,kCAAkC,uBAAuB,sBAM3F,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useEffect } from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
3
2
|
import { StyleSheet, View } from 'react-native';
|
|
4
3
|
import { ConversationsContextProvider, useConversationsContext, } from '../contexts/conversations_context';
|
|
5
4
|
import { useTheme } from '../hooks';
|
|
@@ -12,7 +11,9 @@ import { Icon, Text } from './display';
|
|
|
12
11
|
* Originally designed for use in CCA.
|
|
13
12
|
*/
|
|
14
13
|
export const GroupConversations = ({ chat_group_graph_id, ...rest }) => {
|
|
15
|
-
return (
|
|
14
|
+
return (<ConversationsContextProvider args={{ chat_group_graph_id, group_source_app_name: undefined }}>
|
|
15
|
+
<GroupConversationList {...rest}/>
|
|
16
|
+
</ConversationsContextProvider>);
|
|
16
17
|
};
|
|
17
18
|
const GroupConversationList = ({ limit, onConversationPress, style, onConversationsLoad, ListHeaderComponent, ListOverflowFooterComponent, ListEmptyFooterComponent, }) => {
|
|
18
19
|
const styles = useStyles();
|
|
@@ -22,7 +23,16 @@ const GroupConversationList = ({ limit, onConversationPress, style, onConversati
|
|
|
22
23
|
onConversationsLoad?.({ hasConversations: conversations.length > 0 });
|
|
23
24
|
}
|
|
24
25
|
}, [conversations.length, isFetched, onConversationsLoad]);
|
|
25
|
-
return (
|
|
26
|
+
return (<View style={style}>
|
|
27
|
+
<>{ListHeaderComponent}</>
|
|
28
|
+
{isFetched && conversations.length === 0 && (<View style={styles.listEmpty}>
|
|
29
|
+
<Icon size={24} name="general.textMessage" style={styles.listEmptyIcon}/>
|
|
30
|
+
<Text variant="secondary">No conversations found</Text>
|
|
31
|
+
<>{ListEmptyFooterComponent}</>
|
|
32
|
+
</View>)}
|
|
33
|
+
{conversations.slice(0, limit).map(conversation => (<ConversationPreview style={styles.conversation} key={conversation.id} showBadges={false} conversation={conversation} onPress={() => onConversationPress(conversation)}/>))}
|
|
34
|
+
{conversations.length > (limit || 0) && <>{ListOverflowFooterComponent}</>}
|
|
35
|
+
</View>);
|
|
26
36
|
};
|
|
27
37
|
const useStyles = () => {
|
|
28
38
|
const { colors } = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_conversation_list.js","sourceRoot":"","sources":["../../src/components/group_conversation_list.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"group_conversation_list.js","sourceRoot":"","sources":["../../src/components/group_conversation_list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAC1D,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAA;AAC1E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAkBtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAA2B,EAAE,EAAE;IAC9F,OAAO,CACL,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,SAAS,EAAE,CAAC,CAC5F;MAAA,CAAC,qBAAqB,CAAC,IAAI,IAAI,CAAC,EAClC;IAAA,EAAE,4BAA4B,CAAC,CAChC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,CAAC,EAC7B,KAAK,EACL,mBAAmB,EACnB,KAAK,EACL,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,GACA,EAAE,EAAE;IAC5B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IA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,CACH,CAAC,CACF;MAAA,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,2BAA2B,CAAC,GAAG,CAC5E;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,UAAU,EAAE,EAAE;QACd,YAAY,EAAE;YACZ,iBAAiB,EAAE,CAAC;SACrB;QACD,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,mBAAmB,EAAE;QAC/C,SAAS,EAAE;YACT,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,eAAe,EAAE,EAAE;YACnB,GAAG,EAAE,CAAC;SACP;QACD,aAAa,EAAE;YACb,KAAK,EAAE,MAAM,CAAC,mBAAmB;SAClC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useEffect } from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport {\n ConversationsContextProvider,\n useConversationsContext,\n} from '../contexts/conversations_context'\nimport { useTheme } from '../hooks'\nimport { ConversationRequestArgs } from '../utils/request/conversation'\nimport { ConversationPreview } from './conversations/conversation_preview'\nimport { Icon, Text } from './display'\n\ninterface GroupConversationsProps extends Partial<ConversationRequestArgs> {\n limit?: number\n onConversationPress: (conversation: any) => void\n style?: ViewStyle\n onConversationsLoad?: ({ hasConversations }: { hasConversations: boolean }) => void\n ListHeaderComponent?:\n | React.ComponentType<any>\n | React.ReactElement<any, string | React.JSXElementConstructor<any>>\n ListOverflowFooterComponent?:\n | React.ComponentType<any>\n | React.ReactElement<any, string | React.JSXElementConstructor<any>>\n ListEmptyFooterComponent?:\n | React.ComponentType<any>\n | React.ReactElement<any, string | React.JSXElementConstructor<any>>\n}\n\n/**\n * GroupConversations is a component that displays a list of conversations\n * for a specific group.\n *\n * Originally designed for use in CCA.\n */\nexport const GroupConversations = ({ chat_group_graph_id, ...rest }: GroupConversationsProps) => {\n return (\n <ConversationsContextProvider args={{ chat_group_graph_id, group_source_app_name: undefined }}>\n <GroupConversationList {...rest} />\n </ConversationsContextProvider>\n )\n}\n\nconst GroupConversationList = ({\n limit,\n onConversationPress,\n style,\n onConversationsLoad,\n ListHeaderComponent,\n ListOverflowFooterComponent,\n ListEmptyFooterComponent,\n}: GroupConversationsProps) => {\n const styles = useStyles()\n const { conversations = [], isFetched } = useConversationsContext()\n\n useEffect(() => {\n if (isFetched) {\n onConversationsLoad?.({ hasConversations: conversations.length > 0 })\n }\n }, [conversations.length, isFetched, onConversationsLoad])\n\n return (\n <View style={style}>\n <>{ListHeaderComponent}</>\n {isFetched && conversations.length === 0 && (\n <View style={styles.listEmpty}>\n <Icon size={24} name=\"general.textMessage\" style={styles.listEmptyIcon} />\n <Text variant=\"secondary\">No conversations found</Text>\n <>{ListEmptyFooterComponent}</>\n </View>\n )}\n {conversations.slice(0, limit).map(conversation => (\n <ConversationPreview\n style={styles.conversation}\n key={conversation.id}\n showBadges={false}\n conversation={conversation}\n onPress={() => onConversationPress(conversation)}\n />\n ))}\n {conversations.length > (limit || 0) && <>{ListOverflowFooterComponent}</>}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n constainer: {},\n conversation: {\n borderBottomWidth: 0,\n },\n listItem: { color: colors.fillColorNeutral020 },\n listEmpty: {\n justifyContent: 'center',\n alignItems: 'center',\n paddingVertical: 16,\n gap: 8,\n },\n listEmptyIcon: {\n color: colors.fillColorNeutral020,\n },\n })\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { ErrorBoundaryProps } from './error_boundary';
|
|
3
|
-
export declare function ComponentErrorBoundary({ children, ...props }: PropsWithChildren<ErrorBoundaryProps>):
|
|
3
|
+
export declare function ComponentErrorBoundary({ children, ...props }: PropsWithChildren<ErrorBoundaryProps>): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=component_error_boundary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component_error_boundary.d.ts","sourceRoot":"","sources":["../../../src/components/page/component_error_boundary.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"component_error_boundary.d.ts","sourceRoot":"","sources":["../../../src/components/page/component_error_boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAEpE,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,qBAMvC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { ErrorBoundary } from './error_boundary';
|
|
3
3
|
export function ComponentErrorBoundary({ children, ...props }) {
|
|
4
|
-
return (
|
|
4
|
+
return (<ErrorBoundary scope="component" fallback={null} {...props}>
|
|
5
|
+
{children}
|
|
6
|
+
</ErrorBoundary>);
|
|
5
7
|
}
|
|
6
8
|
//# sourceMappingURL=component_error_boundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component_error_boundary.js","sourceRoot":"","sources":["../../../src/components/page/component_error_boundary.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"component_error_boundary.js","sourceRoot":"","sources":["../../../src/components/page/component_error_boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,aAAa,EAAsB,MAAM,kBAAkB,CAAA;AAEpE,MAAM,UAAU,sBAAsB,CAAC,EACrC,QAAQ,EACR,GAAG,KAAK,EAC8B;IACtC,OAAO,CACL,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CACzD;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,aAAa,CAAC,CACjB,CAAA;AACH,CAAC","sourcesContent":["import React, { PropsWithChildren } from 'react'\nimport { ErrorBoundary, ErrorBoundaryProps } from './error_boundary'\n\nexport function ComponentErrorBoundary({\n children,\n ...props\n}: PropsWithChildren<ErrorBoundaryProps>) {\n return (\n <ErrorBoundary scope=\"component\" fallback={null} {...props}>\n {children}\n </ErrorBoundary>\n )\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../../src/components/page/loading.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../../src/components/page/loading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,wBAAgB,cAAc,sBAQ7B"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { useTheme } from '@react-navigation/native';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { StyleSheet, View } from 'react-native';
|
|
4
4
|
import { Spinner } from '../display';
|
|
5
5
|
export function DefaultLoading() {
|
|
6
6
|
const styles = useStyles();
|
|
7
|
-
return (
|
|
7
|
+
return (<View style={styles.container}>
|
|
8
|
+
<Spinner size={48}/>
|
|
9
|
+
</View>);
|
|
8
10
|
}
|
|
9
11
|
const useStyles = () => {
|
|
10
12
|
const theme = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.js","sourceRoot":"","sources":["../../../src/components/page/loading.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loading.js","sourceRoot":"","sources":["../../../src/components/page/loading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,MAAM,UAAU,cAAc;IAC5B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EACpB;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,SAAS,EAAE,GAAG;YACd,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;SACrB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;SACzB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useTheme } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Spinner } from '../display'\n\nexport function DefaultLoading() {\n const styles = useStyles()\n\n return (\n <View style={styles.container}>\n <Spinner size={48} />\n </View>\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n container: {\n minHeight: 200,\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n loading: {\n color: theme.colors.text,\n },\n })\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { ErrorBoundaryProps } from './error_boundary';
|
|
3
|
-
export declare function PageErrorBoundary({ children, ...props }: PropsWithChildren<ErrorBoundaryProps>):
|
|
3
|
+
export declare function PageErrorBoundary({ children, ...props }: PropsWithChildren<ErrorBoundaryProps>): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=page_error_boundary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page_error_boundary.d.ts","sourceRoot":"","sources":["../../../src/components/page/page_error_boundary.tsx"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"page_error_boundary.d.ts","sourceRoot":"","sources":["../../../src/components/page/page_error_boundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAqD,MAAM,OAAO,CAAA;AAInG,OAAO,EAAwC,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAM3F,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,qBAM9F"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { useNavigation } from '@react-navigation/native';
|
|
3
2
|
import { useQueryErrorResetBoundary } from '@tanstack/react-query';
|
|
4
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
4
|
import { onAuthRefresh } from '../../utils/auth_events';
|
|
6
5
|
import { ResponseError } from '../../utils/response_error';
|
|
7
6
|
import BlankState from '../primitive/blank_state_primitive';
|
|
8
7
|
import { ErrorBoundary } from './error_boundary';
|
|
9
|
-
const renderPageFallback = (error, reset) => (
|
|
8
|
+
const renderPageFallback = (error, reset) => (<ErrorView error={error} reset={reset}/>);
|
|
10
9
|
export function PageErrorBoundary({ children, ...props }) {
|
|
11
|
-
return (
|
|
10
|
+
return (<ErrorBoundary scope="screen" fallback={renderPageFallback} {...props}>
|
|
11
|
+
{children}
|
|
12
|
+
</ErrorBoundary>);
|
|
12
13
|
}
|
|
13
14
|
function ErrorView({ error, reset }) {
|
|
14
15
|
const { reset: resetQueries } = useQueryErrorResetBoundary();
|
|
@@ -18,12 +19,12 @@ function ErrorView({ error, reset }) {
|
|
|
18
19
|
}, [resetQueries, reset]);
|
|
19
20
|
useEffect(() => handleReset, [handleReset]);
|
|
20
21
|
if (error instanceof ResponseError) {
|
|
21
|
-
return
|
|
22
|
+
return <ResponseErrorView response={error.response} onReset={handleReset}/>;
|
|
22
23
|
}
|
|
23
24
|
if (isNetworkError(error)) {
|
|
24
|
-
return (
|
|
25
|
+
return (<ErrorContent heading={'Problem connecting!'} body={'Check your internet connection and try again.'}/>);
|
|
25
26
|
}
|
|
26
|
-
return
|
|
27
|
+
return <ErrorContent heading={'Oops!'} body={'Something unexpected happened.'}/>;
|
|
27
28
|
}
|
|
28
29
|
function isNetworkError(error) {
|
|
29
30
|
const networkFailedMessages = [
|
|
@@ -61,9 +62,9 @@ function ResponseErrorView({ response, onReset }) {
|
|
|
61
62
|
return onAuthRefresh(onReset);
|
|
62
63
|
}, [status, onReset]);
|
|
63
64
|
if (status === 429) {
|
|
64
|
-
return
|
|
65
|
+
return <RateLimitedView response={response} onReset={onReset}/>;
|
|
65
66
|
}
|
|
66
|
-
return
|
|
67
|
+
return <ErrorContent heading={heading} body={body}/>;
|
|
67
68
|
}
|
|
68
69
|
const RATE_LIMIT_WINDOW_S = 20;
|
|
69
70
|
function RateLimitedView({ response, onReset }) {
|
|
@@ -78,10 +79,30 @@ function RateLimitedView({ response, onReset }) {
|
|
|
78
79
|
}, [readyAt]);
|
|
79
80
|
const navigation = useNavigation();
|
|
80
81
|
const secondsLeft = Math.max(0, Math.ceil((readyAt - now) / 1000));
|
|
81
|
-
return (
|
|
82
|
+
return (<BlankState.Root>
|
|
83
|
+
<BlankState.Imagery name="people.noTextMessage"/>
|
|
84
|
+
<BlankState.Content>
|
|
85
|
+
<BlankState.Heading>Too many requests</BlankState.Heading>
|
|
86
|
+
<BlankState.Text>
|
|
87
|
+
Chat is being accessed too frequently. Please wait a moment.
|
|
88
|
+
</BlankState.Text>
|
|
89
|
+
</BlankState.Content>
|
|
90
|
+
<BlankState.Button title={secondsLeft > 0 ? `Retry in ${secondsLeft}s` : 'Try again'} disabled={secondsLeft > 0} onPress={onReset} size="md" accessibilityRole="button"/>
|
|
91
|
+
<BlankState.TextButton onPress={navigation.goBack}>Go back</BlankState.TextButton>
|
|
92
|
+
</BlankState.Root>);
|
|
82
93
|
}
|
|
83
94
|
function ErrorContent({ heading, body }) {
|
|
84
95
|
const navigation = useNavigation();
|
|
85
|
-
return (
|
|
96
|
+
return (<BlankState.Root>
|
|
97
|
+
<BlankState.Imagery name="people.noTextMessage"/>
|
|
98
|
+
<BlankState.Content>
|
|
99
|
+
<BlankState.Heading>{heading}</BlankState.Heading>
|
|
100
|
+
<BlankState.Text>{body}</BlankState.Text>
|
|
101
|
+
</BlankState.Content>
|
|
102
|
+
<BlankState.Button title="Go back" onPress={navigation.goBack} size="md" accessibilityRole="link"/>
|
|
103
|
+
<BlankState.TextButton onPress={() => navigation.navigate('BugReport')}>
|
|
104
|
+
Report a bug
|
|
105
|
+
</BlankState.TextButton>
|
|
106
|
+
</BlankState.Root>);
|
|
86
107
|
}
|
|
87
108
|
//# sourceMappingURL=page_error_boundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page_error_boundary.js","sourceRoot":"","sources":["../../../src/components/page/page_error_boundary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page_error_boundary.js","sourceRoot":"","sources":["../../../src/components/page/page_error_boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAClE,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C;MAAA,CAAC,UAAU,CAAC,OAAO,CACjB;QAAA,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,CACjD;QAAA,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,CAC1C;MAAA,EAAE,UAAU,CAAC,OAAO,CACpB;MAAA,CAAC,UAAU,CAAC,MAAM,CAChB,KAAK,CAAC,SAAS,CACf,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAC3B,IAAI,CAAC,IAAI,CACT,iBAAiB,CAAC,MAAM,EAE1B;MAAA,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CACrE;;MACF,EAAE,UAAU,CAAC,UAAU,CACzB;IAAA,EAAE,UAAU,CAAC,IAAI,CAAC,CACnB,CAAA;AACH,CAAC","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport { useQueryErrorResetBoundary } from '@tanstack/react-query'\nimport React, { PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { onAuthRefresh } from '../../utils/auth_events'\nimport { ResponseError } from '../../utils/response_error'\nimport BlankState from '../primitive/blank_state_primitive'\nimport { ErrorBoundary, ErrorBoundaryFallback, ErrorBoundaryProps } from './error_boundary'\n\nconst renderPageFallback: ErrorBoundaryFallback = (error, reset) => (\n <ErrorView error={error} reset={reset} />\n)\n\nexport function PageErrorBoundary({ children, ...props }: PropsWithChildren<ErrorBoundaryProps>) {\n return (\n <ErrorBoundary scope=\"screen\" fallback={renderPageFallback} {...props}>\n {children}\n </ErrorBoundary>\n )\n}\n\nfunction ErrorView({ error, reset }: { error: Error; reset: () => void }) {\n const { reset: resetQueries } = useQueryErrorResetBoundary()\n\n const handleReset = useCallback(() => {\n resetQueries()\n reset()\n }, [resetQueries, reset])\n\n useEffect(() => handleReset, [handleReset])\n\n if (error instanceof ResponseError) {\n return <ResponseErrorView response={error.response} onReset={handleReset} />\n }\n\n if (isNetworkError(error)) {\n return (\n <ErrorContent\n heading={'Problem connecting!'}\n body={'Check your internet connection and try again.'}\n />\n )\n }\n\n return <ErrorContent heading={'Oops!'} body={'Something unexpected happened.'} />\n}\n\nfunction isNetworkError(error: Error) {\n const networkFailedMessages = [\n 'Network request failed',\n 'Network request timed out',\n 'Failed to fetch',\n ]\n\n return new RegExp(networkFailedMessages.join('|'), 'i').test(error.message)\n}\n\nfunction ResponseErrorView({ response, onReset }: { response: Response; onReset: () => void }) {\n const { status } = response\n\n const heading = useMemo(() => {\n switch (status) {\n case 403:\n return 'Permission required'\n case 404:\n return 'Content not found'\n default:\n return 'Oops!'\n }\n }, [status])\n\n const body = useMemo(() => {\n switch (status) {\n case 403:\n return 'Contact your administrator for access.'\n case 404:\n return 'If you believe something should be here, please reach out to your administrator.'\n default:\n return 'Something unexpected happened.'\n }\n }, [status])\n\n useEffect(() => {\n if (status !== 401) return\n\n return onAuthRefresh(onReset)\n }, [status, onReset])\n\n if (status === 429) {\n return <RateLimitedView response={response} onReset={onReset} />\n }\n\n return <ErrorContent heading={heading} body={body} />\n}\n\nconst RATE_LIMIT_WINDOW_S = 20\n\nfunction RateLimitedView({ response, onReset }: { response: Response; onReset: () => void }) {\n const retryAfterS = parseInt(\n response.headers?.get('Retry-After') ?? String(RATE_LIMIT_WINDOW_S),\n 10\n )\n const readyAt = useRef(Date.now() + retryAfterS * 1000).current\n const [now, setNow] = useState(Date.now)\n\n useEffect(() => {\n const id = setInterval(() => {\n setNow(prev => (prev >= readyAt ? prev : Date.now()))\n }, 1000)\n return () => clearInterval(id)\n }, [readyAt])\n\n const navigation = useNavigation()\n const secondsLeft = Math.max(0, Math.ceil((readyAt - now) / 1000))\n\n return (\n <BlankState.Root>\n <BlankState.Imagery name=\"people.noTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>Too many requests</BlankState.Heading>\n <BlankState.Text>\n Chat is being accessed too frequently. Please wait a moment.\n </BlankState.Text>\n </BlankState.Content>\n <BlankState.Button\n title={secondsLeft > 0 ? `Retry in ${secondsLeft}s` : 'Try again'}\n disabled={secondsLeft > 0}\n onPress={onReset}\n size=\"md\"\n accessibilityRole=\"button\"\n />\n <BlankState.TextButton onPress={navigation.goBack}>Go back</BlankState.TextButton>\n </BlankState.Root>\n )\n}\n\nfunction ErrorContent({ heading, body }: { heading: string; body: string }) {\n const navigation = useNavigation()\n\n return (\n <BlankState.Root>\n <BlankState.Imagery name=\"people.noTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>{heading}</BlankState.Heading>\n <BlankState.Text>{body}</BlankState.Text>\n </BlankState.Content>\n <BlankState.Button\n title=\"Go back\"\n onPress={navigation.goBack}\n size=\"md\"\n accessibilityRole=\"link\"\n />\n <BlankState.TextButton onPress={() => navigation.navigate('BugReport')}>\n Report a bug\n </BlankState.TextButton>\n </BlankState.Root>\n )\n}\n"]}
|