@planningcenter/chat-react-native 3.42.2-qa-staging.2 → 3.42.2-qa-821.1
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 +3 -3
- package/build/components/conversation/messages_disabled_banners.d.ts.map +1 -1
- package/build/components/conversation/messages_disabled_banners.js +5 -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 +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 +12 -76
- 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 +2 -4
- package/build/components/conversations/unread_count_badge.d.ts.map +1 -1
- package/build/components/conversations/unread_count_badge.js +7 -12
- 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 +1 -1
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +2 -1
- 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/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 +0 -2
- 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 +19 -4
- 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 +1 -0
- 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 +1 -3
- 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 +4 -3
- 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 +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 +35 -36
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +19 -21
- 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 +10 -11
- 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 +25 -66
- 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 +11 -83
- 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_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 +3 -10
- 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 +19 -42
- 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 +4 -26
- 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/conversation.d.ts +1 -10
- package/build/types/resources/conversation.d.ts.map +1 -1
- package/build/types/resources/conversation.js.map +1 -1
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +0 -2
- package/build/utils/request/conversation.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/use_attachment_uploader.test.tsx +1 -0
- package/src/__tests__/hooks/use_font_scale.test.ts +7 -3
- 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/conversations/conversation_preview.tsx +23 -58
- package/src/components/conversations/unread_count_badge.tsx +4 -13
- 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/hooks/use_conversation.ts +0 -2
- package/src/hooks/use_conversation_jolt_events.ts +19 -3
- package/src/hooks/use_conversation_messages.ts +6 -5
- package/src/hooks/use_conversations_actions.ts +1 -3
- package/src/hooks/use_mark_latest_message_read.ts +4 -3
- package/src/index.tsx +2 -1
- package/src/polyfills/events/EventTarget.ts +1 -1
- package/src/screens/conversation_screen.tsx +4 -2
- package/src/screens/conversations/components/list_header_component.tsx +6 -6
- package/src/types/resources/conversation.ts +1 -11
- package/src/utils/request/conversation.ts +0 -2
- package/src/utils/sha_256.ts +24 -24
- package/src/utils/system_messages.ts +1 -1
- package/src/utils/theme.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reply_shadow_message.js","sourceRoot":"","sources":["../../../src/components/conversation/reply_shadow_message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EACL,iCAAiC,EACjC,YAAY,EACZ,wBAAwB,EACxB,QAAQ,GACT,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,sBAAsB,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;SACb;QACD,KAAK,EAAE;YACL,YAAY,EAAE,CAAC;SAChB;QACD,cAAc,EAAE;YACd,KAAK,EAAE,MAAM,CAAC,mBAAmB;YACjC,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport { some } from 'lodash'\nimport React from 'react'\nimport { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport {\n useAnimatedMessageBackgroundColor,\n useFontScale,\n useScalableNumberOfLines,\n useTheme,\n} from '../../hooks'\nimport { useConversationMessage } from '../../hooks/use_conversation_message'\nimport { useLiveRelativeTime } from '../../hooks/use_live_relative_time'\nimport { MessageResource } from '../../types'\nimport {\n DenormalizedAttachmentResource,\n DenormalizedGiphyAttachmentResource,\n DenormalizedExpandedLinkAttachmentResource,\n DenormalizedMessageAttachmentResource,\n} from '../../types/resources/denormalized_attachment_resource'\nimport { assertKeysAreNumbers, pluralize } from '../../utils'\nimport {\n CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n MAX_FONT_SIZE_MULTIPLIER,\n MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n platformFontWeightMedium,\n} from '../../utils/styles'\nimport { Avatar, Icon, IconProps, Image, Text } from '../display'\nimport { TheirReplyConnector, MyReplyConnector } from './reply_connectors'\n\ninterface ReplyShadowMessageProps extends MessageResource {\n messageId: string\n conversation_id: number\n inReplyScreen?: boolean\n isReplyShadowMessage: boolean\n nextRendersAuthor: boolean\n}\n\nexport function ReplyShadowMessage({\n conversation_id,\n inReplyScreen,\n messageId,\n isReplyShadowMessage,\n nextRendersAuthor,\n}: ReplyShadowMessageProps) {\n const { message, isError, isLoading } = useConversationMessage({ conversation_id, messageId })\n\n if (inReplyScreen) return null\n if (isLoading) return <ShadowMessageFallback text=\"Loading...\" />\n if (isError || !message) return <ShadowMessageFallback text=\"Message deleted\" />\n\n const enrichedMessage = {\n ...message,\n isReplyShadowMessage,\n nextRendersAuthor,\n }\n\n return <ShadowMessageContent conversation_id={conversation_id} {...enrichedMessage} />\n}\n\ninterface ShadowMessageContentProps extends MessageResource {\n conversation_id: number\n}\n\nfunction ShadowMessageContent({ conversation_id, ...message }: ShadowMessageContentProps) {\n const { text, deletedAt, author, attachments } = message\n const styles = useStyles(message)\n const { colors } = useTheme()\n const navigation = useNavigation()\n const timestamp = useLiveRelativeTime(message.createdAt)\n\n const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0)\n const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =\n useAnimatedMessageBackgroundColor()\n const scalableNumberOfLines = useScalableNumberOfLines(2)\n const replyCountText = pluralize(message.replyCount, 'reply')\n const isDeleted = !!deletedAt\n const messageText = isDeleted ? 'Message deleted' : text\n\n const handleNavigateToReplies = () => {\n navigation.navigate('ConversationReply', {\n conversation_id,\n reply_root_id: message.replyRootId,\n reply_root_author_name: message.author.name,\n })\n }\n\n const attachmentLabel = some(attachments) ? pluralize(attachments.length, 'attachment') : ''\n const accessibilityLabel = `${author?.name || ''} Reply Preview ${attachmentLabel} ${\n messageText || ''\n } ${timestamp} ${replyCountText}`\n\n return (\n <Pressable\n android_ripple={{ color: colors.androidRippleNeutral }}\n onPress={handleNavigateToReplies}\n onPressIn={handleMessagePressIn}\n onPressOut={handleMessagePressOut}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint=\"Navigate to reply screen for this message\"\n accessibilityRole=\"link\"\n >\n <Animated.View style={[styles.message, animatedBackgroundColor]}>\n {!message.mine && (\n <View>\n <View style={[styles.avatarWrapper, !isDeleted && styles.avatarOpacity]}>\n <Avatar\n size=\"xs\"\n sourceUri={message.author.avatar}\n style={styles.avatar}\n maxFontSizeMultiplier={1}\n fallbackIconName={isDeleted ? 'publishing.trash' : 'general.person'}\n showFallback={isDeleted}\n />\n </View>\n <TheirReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n </View>\n )}\n <View style={styles.messageContent}>\n <View\n style={styles.messageBubble}\n onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}\n >\n <MessageAttachmentImagery attachments={attachments} />\n {text && (\n <Text\n variant=\"footnote\"\n style={styles.messageText}\n numberOfLines={scalableNumberOfLines}\n >\n {messageText}\n </Text>\n )}\n </View>\n <View style={styles.messageMeta}>\n <Text variant=\"footnote\" style={styles.replyCountText}>\n {replyCountText}\n </Text>\n </View>\n </View>\n {message.mine && (\n <MyReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n )}\n </Animated.View>\n </Pressable>\n )\n}\n\nfunction MessageAttachmentImagery({\n attachments,\n}: {\n attachments: DenormalizedAttachmentResource[]\n}) {\n if (!attachments || attachments.length === 0) return null\n\n const attachment = attachments[0]\n\n if (attachment.type === 'giphy') {\n return <GiphyImage attachment={attachment} />\n }\n if (attachment.type === 'ExpandedLink') {\n return <ExpandedLinkImage attachment={attachment} />\n }\n if (attachment.type === 'MessageAttachment') {\n const contentType = attachment.attributes?.contentType\n const basicType = contentType?.split('/')[0]\n\n switch (basicType) {\n case 'image':\n return <MessageAttachmentImage attachment={attachment} />\n case 'video':\n return <MessageAttachmentIcon iconName=\"general.outlinedVideoFile\" />\n case 'audio':\n return <MessageAttachmentIcon iconName=\"general.outlinedMusicFile\" />\n case 'application':\n return <MessageAttachmentIcon iconName=\"general.outlinedGenericFile\" />\n default:\n return null\n }\n }\n\n return null\n}\n\nfunction GiphyImage({ attachment }: { attachment: DenormalizedGiphyAttachmentResource }) {\n const { title, giphy } = attachment\n const { url } = giphy.fixedWidth\n const { width, height } = assertKeysAreNumbers(giphy.fixedWidth)\n const styles = useStyles({ imageWidth: width, imageHeight: height })\n\n return (\n <Image\n source={{ uri: url }}\n wrapperStyle={styles.imageWrapper}\n style={styles.image}\n alt={title}\n loaderSize={16}\n />\n )\n}\n\nfunction ExpandedLinkImage({\n attachment,\n}: {\n attachment: DenormalizedExpandedLinkAttachmentResource\n}) {\n const { title = '', imageUrl, imageHeight, imageWidth } = attachment.attributes\n const styles = useStyles({ imageWidth, imageHeight })\n\n return (\n <Image\n source={{ uri: imageUrl }}\n wrapperStyle={styles.imageWrapper}\n style={styles.image}\n alt={title}\n loaderSize={16}\n />\n )\n}\n\nfunction MessageAttachmentImage({\n attachment,\n}: {\n attachment: DenormalizedMessageAttachmentResource\n}) {\n const { url, urlMedium, filename, metadata = {} } = attachment.attributes\n const styles = useStyles({ imageWidth: metadata.width, imageHeight: metadata.height })\n\n return (\n <Image\n source={{ uri: urlMedium || url }}\n style={styles.image}\n wrapperStyle={styles.imageWrapper}\n alt={filename}\n loaderSize={16}\n />\n )\n}\n\nfunction MessageAttachmentIcon({ iconName }: { iconName: IconProps['name'] }) {\n const styles = useStyles()\n return (\n <Icon\n name={iconName}\n style={styles.attachmentIcon}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n )\n}\n\n// TODO: The mine prop is not used yet, but in the future we will be adding a way to find the `mine` value for this fallback.\nfunction ShadowMessageFallback({ text, mine }: { text: string; mine?: boolean }) {\n const styles = useStyles({ mine })\n\n return (\n <View style={styles.message}>\n <View style={styles.messageContent}>\n <View style={styles.messageBubble}>\n <Text variant=\"footnote\" style={styles.messageText}>\n {text}\n </Text>\n </View>\n </View>\n </View>\n )\n}\n\ninterface StylesProps {\n imageWidth?: number\n imageHeight?: number\n mine?: boolean\n}\n\nconst useStyles = ({ mine, imageWidth = 32, imageHeight = 32 }: StylesProps = {}) => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })\n const { width } = useWindowDimensions()\n const tabletWidth = width >= 744 // Smallest iPad Mini's width\n\n return StyleSheet.create({\n message: {\n gap: 8,\n flexDirection: mine ? 'row-reverse' : 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n },\n messageContent: {\n flex: 1,\n gap: 4,\n marginBottom: 12,\n },\n avatarWrapper: {\n width: MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n alignItems: 'center',\n },\n avatar: {\n marginBottom: 8,\n },\n avatarOpacity: {\n opacity: 0.5,\n },\n messageBubble: {\n flexDirection: 'row',\n alignSelf: mine ? 'flex-end' : 'flex-start',\n alignItems: 'center',\n gap: 8,\n borderColor: colors.borderColorDefaultBase,\n borderWidth: 1,\n borderRadius: 8,\n maxWidth: tabletWidth ? 360 : '80%',\n paddingVertical: 6,\n paddingHorizontal: 8,\n },\n messageText: {\n color: colors.textColorDefaultPlaceholder,\n flexShrink: 1,\n },\n messageMeta: {\n flexDirection: 'row',\n justifyContent: mine ? 'flex-end' : 'flex-start',\n },\n replyCountText: {\n color: colors.interaction,\n fontWeight: platformFontWeightMedium,\n },\n imageWrapper: {\n width: 32 * fontScale,\n aspectRatio: imageWidth / imageHeight,\n opacity: 0.5,\n },\n image: {\n borderRadius: 4,\n },\n attachmentIcon: {\n color: colors.iconColorDefaultDim,\n fontSize: 16,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reply_shadow_message.js","sourceRoot":"","sources":["../../../src/components/conversation/reply_shadow_message.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EACL,iCAAiC,EACjC,YAAY,EACZ,wBAAwB,EACxB,QAAQ,GACT,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAQxE,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,aAAa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E,EAAE,GAAG,SAAS;YACrB,WAAW,EAAE,UAAU,GAAG,WAAW;YACrC,OAAO,EAAE,GAAG;SACb;QACD,KAAK,EAAE;YACL,YAAY,EAAE,CAAC;SAChB;QACD,cAAc,EAAE;YACd,KAAK,EAAE,MAAM,CAAC,mBAAmB;YACjC,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport { some } from 'lodash'\nimport React from 'react'\nimport { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport {\n useAnimatedMessageBackgroundColor,\n useFontScale,\n useScalableNumberOfLines,\n useTheme,\n} from '../../hooks'\nimport { useConversationMessage } from '../../hooks/use_conversation_message'\nimport { useLiveRelativeTime } from '../../hooks/use_live_relative_time'\nimport { MessageResource } from '../../types'\nimport {\n DenormalizedAttachmentResource,\n DenormalizedGiphyAttachmentResource,\n DenormalizedExpandedLinkAttachmentResource,\n DenormalizedMessageAttachmentResource,\n} from '../../types/resources/denormalized_attachment_resource'\nimport { assertKeysAreNumbers, pluralize } from '../../utils'\nimport {\n CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n MAX_FONT_SIZE_MULTIPLIER,\n MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n platformFontWeightMedium,\n} from '../../utils/styles'\nimport { Avatar, Icon, IconProps, Image, Text } from '../display'\nimport { TheirReplyConnector, MyReplyConnector } from './reply_connectors'\n\ninterface ReplyShadowMessageProps extends MessageResource {\n messageId: string\n conversation_id: number\n inReplyScreen?: boolean\n isReplyShadowMessage: boolean\n nextRendersAuthor: boolean\n}\n\nexport function ReplyShadowMessage({\n conversation_id,\n inReplyScreen,\n messageId,\n isReplyShadowMessage,\n nextRendersAuthor,\n}: ReplyShadowMessageProps) {\n const { message, isError, isLoading } = useConversationMessage({ conversation_id, messageId })\n\n if (inReplyScreen) return null\n if (isLoading) return <ShadowMessageFallback text=\"Loading...\" />\n if (isError || !message) return <ShadowMessageFallback text=\"Message deleted\" />\n\n const enrichedMessage = {\n ...message,\n isReplyShadowMessage,\n nextRendersAuthor,\n }\n\n return <ShadowMessageContent conversation_id={conversation_id} {...enrichedMessage} />\n}\n\ninterface ShadowMessageContentProps extends MessageResource {\n conversation_id: number\n}\n\nfunction ShadowMessageContent({ conversation_id, ...message }: ShadowMessageContentProps) {\n const { text, deletedAt, author, attachments } = message\n const styles = useStyles(message)\n const { colors } = useTheme()\n const navigation = useNavigation()\n const timestamp = useLiveRelativeTime(message.createdAt)\n\n const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0)\n const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =\n useAnimatedMessageBackgroundColor()\n const scalableNumberOfLines = useScalableNumberOfLines(2)\n const replyCountText = pluralize(message.replyCount, 'reply')\n const isDeleted = !!deletedAt\n const messageText = isDeleted ? 'Message deleted' : text\n\n const handleNavigateToReplies = () => {\n navigation.navigate('ConversationReply', {\n conversation_id,\n reply_root_id: message.replyRootId,\n reply_root_author_name: message.author.name,\n })\n }\n\n const attachmentLabel = some(attachments) ? pluralize(attachments.length, 'attachment') : ''\n const accessibilityLabel = `${author?.name || ''} Reply Preview ${attachmentLabel} ${\n messageText || ''\n } ${timestamp} ${replyCountText}`\n\n return (\n <Pressable\n android_ripple={{ color: colors.androidRippleNeutral }}\n onPress={handleNavigateToReplies}\n onPressIn={handleMessagePressIn}\n onPressOut={handleMessagePressOut}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint=\"Navigate to reply screen for this message\"\n accessibilityRole=\"link\"\n >\n <Animated.View style={[styles.message, animatedBackgroundColor]}>\n {!message.mine && (\n <View>\n <View style={[styles.avatarWrapper, !isDeleted && styles.avatarOpacity]}>\n <Avatar\n size=\"xs\"\n sourceUri={message.author.avatar}\n style={styles.avatar}\n maxFontSizeMultiplier={1}\n fallbackIconName={isDeleted ? 'publishing.trash' : 'general.person'}\n showFallback={isDeleted}\n />\n </View>\n <TheirReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n </View>\n )}\n <View style={styles.messageContent}>\n <View\n style={styles.messageBubble}\n onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}\n >\n <MessageAttachmentImagery attachments={attachments} />\n {text && (\n <Text\n variant=\"footnote\"\n style={styles.messageText}\n numberOfLines={scalableNumberOfLines}\n >\n {messageText}\n </Text>\n )}\n </View>\n <View style={styles.messageMeta}>\n <Text variant=\"footnote\" style={styles.replyCountText}>\n {replyCountText}\n </Text>\n </View>\n </View>\n {message.mine && (\n <MyReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n )}\n </Animated.View>\n </Pressable>\n )\n}\n\nfunction MessageAttachmentImagery({\n attachments,\n}: {\n attachments: DenormalizedAttachmentResource[]\n}) {\n if (!attachments || attachments.length === 0) return null\n\n const attachment = attachments[0]\n\n if (attachment.type === 'giphy') {\n return <GiphyImage attachment={attachment} />\n }\n if (attachment.type === 'ExpandedLink') {\n return <ExpandedLinkImage attachment={attachment} />\n }\n if (attachment.type === 'MessageAttachment') {\n const contentType = attachment.attributes?.contentType\n const basicType = contentType?.split('/')[0]\n\n switch (basicType) {\n case 'image':\n return <MessageAttachmentImage attachment={attachment} />\n case 'video':\n return <MessageAttachmentIcon iconName=\"general.outlinedVideoFile\" />\n case 'audio':\n return <MessageAttachmentIcon iconName=\"general.outlinedMusicFile\" />\n case 'application':\n return <MessageAttachmentIcon iconName=\"general.outlinedGenericFile\" />\n default:\n return null\n }\n }\n\n return null\n}\n\nfunction GiphyImage({ attachment }: { attachment: DenormalizedGiphyAttachmentResource }) {\n const { title, giphy } = attachment\n const { url } = giphy.fixedWidth\n const { width, height } = assertKeysAreNumbers(giphy.fixedWidth)\n const styles = useStyles({ imageWidth: width, imageHeight: height })\n\n return (\n <Image\n source={{ uri: url }}\n wrapperStyle={styles.imageWrapper}\n style={styles.image}\n alt={title}\n loaderSize={16}\n />\n )\n}\n\nfunction ExpandedLinkImage({\n attachment,\n}: {\n attachment: DenormalizedExpandedLinkAttachmentResource\n}) {\n const { title = '', imageUrl, imageHeight, imageWidth } = attachment.attributes\n const styles = useStyles({ imageWidth, imageHeight })\n\n return (\n <Image\n source={{ uri: imageUrl }}\n wrapperStyle={styles.imageWrapper}\n style={styles.image}\n alt={title}\n loaderSize={16}\n />\n )\n}\n\nfunction MessageAttachmentImage({\n attachment,\n}: {\n attachment: DenormalizedMessageAttachmentResource\n}) {\n const { url, urlMedium, filename, metadata = {} } = attachment.attributes\n const styles = useStyles({ imageWidth: metadata.width, imageHeight: metadata.height })\n\n return (\n <Image\n source={{ uri: urlMedium || url }}\n style={styles.image}\n wrapperStyle={styles.imageWrapper}\n alt={filename}\n loaderSize={16}\n />\n )\n}\n\nfunction MessageAttachmentIcon({ iconName }: { iconName: IconProps['name'] }) {\n const styles = useStyles()\n return (\n <Icon\n name={iconName}\n style={styles.attachmentIcon}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n )\n}\n\n// TODO: The mine prop is not used yet, but in the future we will be adding a way to find the `mine` value for this fallback.\nfunction ShadowMessageFallback({ text, mine }: { text: string; mine?: boolean }) {\n const styles = useStyles({ mine })\n\n return (\n <View style={styles.message}>\n <View style={styles.messageContent}>\n <View style={styles.messageBubble}>\n <Text variant=\"footnote\" style={styles.messageText}>\n {text}\n </Text>\n </View>\n </View>\n </View>\n )\n}\n\ninterface StylesProps {\n imageWidth?: number\n imageHeight?: number\n mine?: boolean\n}\n\nconst useStyles = ({ mine, imageWidth = 32, imageHeight = 32 }: StylesProps = {}) => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })\n const { width } = useWindowDimensions()\n const tabletWidth = width >= 744 // Smallest iPad Mini's width\n\n return StyleSheet.create({\n message: {\n gap: 8,\n flexDirection: mine ? 'row-reverse' : 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n },\n messageContent: {\n flex: 1,\n gap: 4,\n marginBottom: 12,\n },\n avatarWrapper: {\n width: MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n alignItems: 'center',\n },\n avatar: {\n marginBottom: 8,\n },\n avatarOpacity: {\n opacity: 0.5,\n },\n messageBubble: {\n flexDirection: 'row',\n alignSelf: mine ? 'flex-end' : 'flex-start',\n alignItems: 'center',\n gap: 8,\n borderColor: colors.borderColorDefaultBase,\n borderWidth: 1,\n borderRadius: 8,\n maxWidth: tabletWidth ? 360 : '80%',\n paddingVertical: 6,\n paddingHorizontal: 8,\n },\n messageText: {\n color: colors.textColorDefaultPlaceholder,\n flexShrink: 1,\n },\n messageMeta: {\n flexDirection: 'row',\n justifyContent: mine ? 'flex-end' : 'flex-start',\n },\n replyCountText: {\n color: colors.interaction,\n fontWeight: platformFontWeightMedium,\n },\n imageWrapper: {\n width: 32 * fontScale,\n aspectRatio: imageWidth / imageHeight,\n opacity: 0.5,\n },\n image: {\n borderRadius: 4,\n },\n attachmentIcon: {\n color: colors.iconColorDefaultDim,\n fontSize: 16,\n },\n })\n}\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { SystemMessageResource } from '../../utils/system_messages';
|
|
3
2
|
interface SystemMessageProps {
|
|
4
3
|
message: SystemMessageResource;
|
|
5
4
|
conversationId: number;
|
|
6
5
|
}
|
|
7
|
-
export declare function SystemMessage({ message, conversationId }: SystemMessageProps):
|
|
6
|
+
export declare function SystemMessage({ message, conversationId }: SystemMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
|
9
8
|
//# sourceMappingURL=system_message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system_message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/system_message.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"system_message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/system_message.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAInE,UAAU,kBAAkB;IAC1B,OAAO,EAAE,qBAAqB,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,kBAAkB,2CAuE5E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useNavigation } from '@react-navigation/native';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { Pressable, StyleSheet, View } from 'react-native';
|
|
4
4
|
import Animated from 'react-native-reanimated';
|
|
5
5
|
import { useAnimatedMessageBackgroundColor, useTheme } from '../../hooks';
|
|
@@ -38,18 +38,9 @@ export function SystemMessage({ message, conversationId }) {
|
|
|
38
38
|
reaction_value: reaction.value,
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
|
-
return (
|
|
41
|
+
return (_jsx(Pressable, { onPress: hasPeople ? handlePress : undefined, onLongPress: handleLongPress, onPressIn: handleMessagePressIn, onPressOut: handleMessagePressOut, android_ripple: { color: colors.androidRippleNeutral, borderless: false, foreground: true }, accessibilityRole: "button", accessibilityHint: hasPeople
|
|
42
42
|
? 'Tap to see people. Long press for message actions.'
|
|
43
|
-
: 'Long press for message actions.'}
|
|
44
|
-
<Animated.View style={[styles.container, animatedBackgroundColor]}>
|
|
45
|
-
<Text variant="tertiary" style={styles.text}>
|
|
46
|
-
{text}
|
|
47
|
-
</Text>
|
|
48
|
-
{hasReactions && (<View style={styles.reactions}>
|
|
49
|
-
{message.reactionCounts.map(reaction => (<MessageReaction key={reaction.value} reaction={reaction} onLongPress={handleReactionLongPress} message={message} conversationId={conversationId}/>))}
|
|
50
|
-
</View>)}
|
|
51
|
-
</Animated.View>
|
|
52
|
-
</Pressable>);
|
|
43
|
+
: 'Long press for message actions.', children: _jsxs(Animated.View, { style: [styles.container, animatedBackgroundColor], children: [_jsx(Text, { variant: "tertiary", style: styles.text, children: text }), hasReactions && (_jsx(View, { style: styles.reactions, children: message.reactionCounts.map(reaction => (_jsx(MessageReaction, { reaction: reaction, onLongPress: handleReactionLongPress, message: message, conversationId: conversationId }, reaction.value))) }))] }) }));
|
|
53
44
|
}
|
|
54
45
|
function systemMessageText(names, overflowCount, action) {
|
|
55
46
|
if (overflowCount > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system_message.js","sourceRoot":"","sources":["../../../src/components/conversation/system_message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"system_message.js","sourceRoot":"","sources":["../../../src/components/conversation/system_message.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAExD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EAAE,iCAAiC,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAOpD,MAAM,UAAU,aAAa,CAAC,EAAE,OAAO,EAAE,cAAc,EAAsB;IAC3E,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,uBAAuB,EAAE,GAAG,OAAO,CAAA;IAC5E,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,eAAe,CAAA;IACxD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,MAAM,EAAE,GAAG,Q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KAAK,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAA;QAChD,gEAAgE;QAChE,qCAAqC;QACrC;YACE,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAA;IAChE,CAAC;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,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,QAAQ;SACrB;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,SAAS,EAAE,QAAQ;SACpB;QACD,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,MAAM;YAChB,cAAc,EAAE,QAAQ;YACxB,GAAG,EAAE,CAAC;YACN,SAAS,EAAE,CAAC;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { Pressable, StyleSheet, View } from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport { useAnimatedMessageBackgroundColor, useTheme } from '../../hooks'\nimport { ReactionCountResource } from '../../types/resources/reaction'\nimport { Haptic } from '../../utils/native_adapters'\nimport { SystemMessageResource } from '../../utils/system_messages'\nimport { Text } from '../display'\nimport { MessageReaction } from './message_reaction'\n\ninterface SystemMessageProps {\n message: SystemMessageResource\n conversationId: number\n}\n\nexport function SystemMessage({ message, conversationId }: SystemMessageProps) {\n const { reactionCounts, systemTextParts, personIdsForSystemEvent } = message\n const { names, overflowCount, action } = systemTextParts\n const styles = useStyles()\n const navigation = useNavigation()\n const { colors } = useTheme()\n const text = systemMessageText(names, overflowCount, action)\n const hasPeople = personIdsForSystemEvent.length > 0\n const hasReactions = reactionCounts.length > 0\n const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =\n useAnimatedMessageBackgroundColor()\n\n const handlePress = () => {\n navigation.navigate('SystemMessagePeople', {\n conversation_id: conversationId,\n person_ids: personIdsForSystemEvent,\n })\n }\n\n const handleLongPress = () => {\n Haptic.impactLight()\n navigation.navigate('MessageActions', {\n message_id: message.id,\n conversation_id: conversationId,\n isSystemMessage: true,\n })\n }\n\n const handleReactionLongPress = (reaction: ReactionCountResource) => {\n Haptic.impactLight()\n navigation.navigate('Reactions', {\n message_id: message.id,\n conversation_id: conversationId,\n reaction_value: reaction.value,\n })\n }\n\n return (\n <Pressable\n onPress={hasPeople ? handlePress : undefined}\n onLongPress={handleLongPress}\n onPressIn={handleMessagePressIn}\n onPressOut={handleMessagePressOut}\n android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }}\n accessibilityRole=\"button\"\n accessibilityHint={\n hasPeople\n ? 'Tap to see people. Long press for message actions.'\n : 'Long press for message actions.'\n }\n >\n <Animated.View style={[styles.container, animatedBackgroundColor]}>\n <Text variant=\"tertiary\" style={styles.text}>\n {text}\n </Text>\n {hasReactions && (\n <View style={styles.reactions}>\n {message.reactionCounts.map(reaction => (\n <MessageReaction\n key={reaction.value}\n reaction={reaction}\n onLongPress={handleReactionLongPress}\n message={message}\n conversationId={conversationId}\n />\n ))}\n </View>\n )}\n </Animated.View>\n </Pressable>\n )\n}\n\nfunction systemMessageText(names: string[], overflowCount: number, action: string): string {\n if (overflowCount > 0) {\n const overflowLabel = `${overflowCount} ${overflowCount === 1 ? 'other' : 'others'}`\n return `${names.join(', ')}, and ${overflowLabel} ${action}`\n }\n\n switch (names.length) {\n case 0:\n return `Someone ${action}`\n case 1:\n return `${names[0]} ${action}`\n case 2:\n return `${names[0]} and ${names[1]} ${action}`\n // Backend guarantees names.length <= 3 when overflowCount is 0;\n // overflow branch handles 4+ people.\n default:\n return `${names[0]}, ${names[1]}, and ${names[2]} ${action}`\n }\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n container: {\n paddingVertical: 12,\n paddingHorizontal: 16,\n alignItems: 'center',\n },\n text: {\n color: colors.textColorDefaultSecondary,\n textAlign: 'center',\n },\n reactions: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'center',\n gap: 4,\n marginTop: 8,\n },\n })\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
/**
|
|
3
2
|
* Component to display typing indicators in a conversation
|
|
4
3
|
* Shows "X is typing..." with animated dots
|
|
5
4
|
*/
|
|
6
|
-
export declare const TypingIndicator: () =>
|
|
5
|
+
export declare const TypingIndicator: () => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
//# sourceMappingURL=typing_indicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typing_indicator.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/typing_indicator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typing_indicator.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/typing_indicator.tsx"],"names":[],"mappings":"AA2CA;;;GAGG;AACH,eAAO,MAAM,eAAe,sDAiB3B,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React, { useEffect } from 'react';
|
|
2
3
|
import { StyleSheet, View, Animated } from 'react-native';
|
|
3
4
|
import { useTheme } from '../../hooks';
|
|
@@ -25,11 +26,7 @@ const TypingDots = () => {
|
|
|
25
26
|
dot3Opacity.stopAnimation();
|
|
26
27
|
};
|
|
27
28
|
}, [dot1Opacity, dot2Opacity, dot3Opacity]);
|
|
28
|
-
return (
|
|
29
|
-
<Animated.View style={[styles.dots, { opacity: dot1Opacity }]}/>
|
|
30
|
-
<Animated.View style={[styles.dots, { opacity: dot2Opacity }]}/>
|
|
31
|
-
<Animated.View style={[styles.dots, { opacity: dot3Opacity }]}/>
|
|
32
|
-
</View>);
|
|
29
|
+
return (_jsxs(View, { style: styles.dotsContainer, children: [_jsx(Animated.View, { style: [styles.dots, { opacity: dot1Opacity }] }), _jsx(Animated.View, { style: [styles.dots, { opacity: dot2Opacity }] }), _jsx(Animated.View, { style: [styles.dots, { opacity: dot3Opacity }] })] }));
|
|
33
30
|
};
|
|
34
31
|
/**
|
|
35
32
|
* Component to display typing indicators in a conversation
|
|
@@ -41,14 +38,7 @@ export const TypingIndicator = () => {
|
|
|
41
38
|
const enabled = typingPeople.length > 0;
|
|
42
39
|
if (!typingPeople.length)
|
|
43
40
|
return null;
|
|
44
|
-
return (
|
|
45
|
-
<View style={styles.container}>
|
|
46
|
-
{enabled && <TypingDots />}
|
|
47
|
-
<Text variant="footnote" style={styles.text}>
|
|
48
|
-
{getTypingIndicatorText(typingPeople)}
|
|
49
|
-
</Text>
|
|
50
|
-
</View>
|
|
51
|
-
</View>);
|
|
41
|
+
return (_jsx(View, { style: styles.relativeWrapper, children: _jsxs(View, { style: styles.container, children: [enabled && _jsx(TypingDots, {}), _jsx(Text, { variant: "footnote", style: styles.text, children: getTypingIndicatorText(typingPeople) })] }) }));
|
|
52
42
|
};
|
|
53
43
|
const useStyles = () => {
|
|
54
44
|
const { colors } = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typing_indicator.js","sourceRoot":"","sources":["../../../src/components/conversation/typing_indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAA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,CAAC,mBAAmB;YAC3C,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,EAAE;SACX;QACD,aAAa,EAAE;YACb,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,MAAM,CAAC,yBAAyB;YACjD,gBAAgB,EAAE,CAAC;SACpB;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAC,yBAAyB;SACxC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,SAAS,UAAU,CAAC,GAAmB,EAAE,KAAa;IACpD,OAAO,QAAQ,CAAC,QAAQ,CAAC;QACvB,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,GAAG;YACb,KAAK;YACL,eAAe,EAAE,IAAI;SACtB,CAAC;QACF,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,OAAO,EAAE,GAAG;YACZ,QAAQ,EAAE,GAAG;YACb,eAAe,EAAE,IAAI;SACtB,CAAC;KACH,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import React, { useEffect } from 'react'\nimport { StyleSheet, View, Animated } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { useTypingIndicators, getTypingIndicatorText } from '../../hooks/use_typing_indicators'\nimport { Text } from '../display'\n\n/**\n * Animated dots to indicate typing\n */\nconst TypingDots = () => {\n const styles = useStyles()\n\n // Create animated values for each dot\n const dot1Opacity = React.useRef(new Animated.Value(0.3)).current\n const dot2Opacity = React.useRef(new Animated.Value(0.3)).current\n const dot3Opacity = React.useRef(new Animated.Value(0.3)).current\n\n // Animation sequence for dots\n useEffect(() => {\n Animated.loop(\n Animated.parallel([\n animateDot(dot1Opacity, 0),\n animateDot(dot2Opacity, 200),\n animateDot(dot3Opacity, 400),\n ])\n ).start()\n\n return () => {\n dot1Opacity.stopAnimation()\n dot2Opacity.stopAnimation()\n dot3Opacity.stopAnimation()\n }\n }, [dot1Opacity, dot2Opacity, dot3Opacity])\n\n return (\n <View style={styles.dotsContainer}>\n <Animated.View style={[styles.dots, { opacity: dot1Opacity }]} />\n <Animated.View style={[styles.dots, { opacity: dot2Opacity }]} />\n <Animated.View style={[styles.dots, { opacity: dot3Opacity }]} />\n </View>\n )\n}\n\n/**\n * Component to display typing indicators in a conversation\n * Shows \"X is typing...\" with animated dots\n */\nexport const TypingIndicator = () => {\n const typingPeople = useTypingIndicators()\n const styles = useStyles()\n const enabled = typingPeople.length > 0\n\n if (!typingPeople.length) return null\n\n return (\n <View style={styles.relativeWrapper}>\n <View style={styles.container}>\n {enabled && <TypingDots />}\n <Text variant=\"footnote\" style={styles.text}>\n {getTypingIndicatorText(typingPeople)}\n </Text>\n </View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n relativeWrapper: {\n position: 'relative',\n },\n container: {\n flexDirection: 'row',\n alignItems: 'center',\n padding: 8,\n backgroundColor: colors.fillColorNeutral090,\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n zIndex: 10,\n },\n dotsContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n marginRight: 8,\n },\n dots: {\n width: 4,\n height: 4,\n borderRadius: 2,\n backgroundColor: colors.textColorDefaultSecondary,\n marginHorizontal: 2,\n },\n text: {\n color: colors.textColorDefaultSecondary,\n },\n })\n}\n\nfunction animateDot(dot: Animated.Value, delay: number) {\n return Animated.sequence([\n Animated.timing(dot, {\n toValue: 1,\n duration: 400,\n delay,\n useNativeDriver: true,\n }),\n Animated.timing(dot, {\n toValue: 0.3,\n duration: 400,\n useNativeDriver: true,\n }),\n ])\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { ConversationResource } from '../../types';
|
|
4
4
|
export declare function ConversationActions({ children, conversation, style, onPress, accessibilityLabel, }: {
|
|
@@ -7,5 +7,5 @@ export declare function ConversationActions({ children, conversation, style, onP
|
|
|
7
7
|
onPress: () => void;
|
|
8
8
|
style?: StyleProp<ViewStyle>;
|
|
9
9
|
accessibilityLabel?: string;
|
|
10
|
-
}):
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
//# sourceMappingURL=conversation_actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_actions.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/conversation_actions.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"conversation_actions.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/conversation_actions.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAA4C,MAAM,OAAO,CAAA;AAClF,OAAO,EAIL,SAAS,EAGT,SAAS,EACV,MAAM,cAAc,CAAA;AAUrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAKlD,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,OAAO,EACP,kBAAkB,GACnB,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,YAAY,EAAE,oBAAoB,CAAA;IAClC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,2CA4HA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
3
|
import { Platform, Pressable, StyleSheet, View, } from 'react-native';
|
|
3
4
|
import ReanimatedSwipeable from 'react-native-gesture-handler/ReanimatedSwipeable';
|
|
4
5
|
import { useConversationsContext } from '../../contexts/conversations_context';
|
|
@@ -78,11 +79,7 @@ export function ConversationActions({ children, conversation, style, onPress, ac
|
|
|
78
79
|
return;
|
|
79
80
|
handleSwipeableClose();
|
|
80
81
|
}, [activeConversationId, conversation.id, handleSwipeableClose]);
|
|
81
|
-
return (
|
|
82
|
-
<Pressable onPress={handlePress} style={({ pressed }) => [style, pressed && platformPressedOpacityStyle]} android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }} accessibilityLabel={accessibilityLabel} accessibilityRole="button" accessibilityActions={accessibilityActions} onAccessibilityAction={handleAccessibilityAction}>
|
|
83
|
-
{children}
|
|
84
|
-
</Pressable>
|
|
85
|
-
</ReanimatedSwipeable>);
|
|
82
|
+
return (_jsx(ReanimatedSwipeable, { ref: swipeableRef, childrenContainerStyle: styles.swipeableChildContainer, containerStyle: styles.swipeableContainer, overshootFriction: 8, overshootLeft: overshootLeft, overshootRight: false, onSwipeableOpenStartDrag: handleSwipeableOpen, onSwipeableClose: () => setDisabled(false), renderRightActions: () => _jsx(_Fragment, {}), renderLeftActions: () => (_jsx(LeftActions, { isConversationEmpty: isConversationEmpty, handleMute: handleMute, handleLatestMessageUnread: handleLatestMessageUnread, muted: muted, read: read, isMutedPending: isMutedPending, isMarkReadPending: isMarkReadPending })), children: _jsx(Pressable, { onPress: handlePress, style: ({ pressed }) => [style, pressed && platformPressedOpacityStyle], android_ripple: { color: androidRippleColor, borderless: false, foreground: true }, accessibilityLabel: accessibilityLabel, accessibilityRole: "button", accessibilityActions: accessibilityActions, onAccessibilityAction: handleAccessibilityAction, children: children }) }));
|
|
86
83
|
}
|
|
87
84
|
function LeftActions({ isConversationEmpty, handleMute, handleLatestMessageUnread, muted, read, isMutedPending, isMarkReadPending, }) {
|
|
88
85
|
const styles = useStyles();
|
|
@@ -94,10 +91,7 @@ function LeftActions({ isConversationEmpty, handleMute, handleLatestMessageUnrea
|
|
|
94
91
|
true: { iconName: 'general.outlinedTextMessage', label: 'Mark read' },
|
|
95
92
|
false: { iconName: 'general.textMessageNotifications', label: 'Mark unread' },
|
|
96
93
|
};
|
|
97
|
-
return (
|
|
98
|
-
<SwipeableToggleButton loading={isMarkReadPending} disabled={isConversationEmpty} toggled={!read} onPress={handleLatestMessageUnread} toggleContent={latestMessageUnreadToggleContent} backgroundColor={tokens.fillColorInteractionSwipeDefault}/>
|
|
99
|
-
<SwipeableToggleButton loading={isMutedPending} toggled={muted} onPress={handleMute} toggleContent={muteToggleContent} backgroundColor={tokens.fillColorInteractionSwipeSecondary}/>
|
|
100
|
-
</View>);
|
|
94
|
+
return (_jsxs(View, { style: styles.actionButtonContainer, children: [_jsx(SwipeableToggleButton, { loading: isMarkReadPending, disabled: isConversationEmpty, toggled: !read, onPress: handleLatestMessageUnread, toggleContent: latestMessageUnreadToggleContent, backgroundColor: tokens.fillColorInteractionSwipeDefault }), _jsx(SwipeableToggleButton, { loading: isMutedPending, toggled: muted, onPress: handleMute, toggleContent: muteToggleContent, backgroundColor: tokens.fillColorInteractionSwipeSecondary })] }));
|
|
101
95
|
}
|
|
102
96
|
const ACTION_BUTTON_WIDTH = 120;
|
|
103
97
|
const ACTION_BUTTON_COUNT = 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_actions.js","sourceRoot":"","sources":["../../../src/components/conversations/conversation_actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClF,OAAO,EAEL,QAAQ,EACR,SAAS,EAET,UAAU,EACV,IAAI,GAEL,MAAM,cAAc,CAAA;AACrB,OAAO,mBAEN,MAAM,kDAAkD,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE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sourcesContent":["import React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport {\n AccessibilityActionEvent,\n Platform,\n Pressable,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native'\nimport ReanimatedSwipeable, {\n SwipeableMethods,\n} from 'react-native-gesture-handler/ReanimatedSwipeable'\nimport { useConversationsContext } from '../../contexts/conversations_context'\nimport { useTheme, useCreateAndroidRippleColor } from '../../hooks'\nimport {\n useConversationsMarkRead,\n useConversationsMute,\n} from '../../hooks/use_conversations_actions'\nimport { ConversationResource } from '../../types'\nimport { platformPressedOpacityStyle } from '../../utils'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { SwipeableToggleButton } from './swipeable_toggle_button'\n\nexport function ConversationActions({\n children,\n conversation,\n style,\n onPress,\n accessibilityLabel,\n}: {\n children: ReactNode\n conversation: ConversationResource\n onPress: () => void\n style?: StyleProp<ViewStyle>\n accessibilityLabel?: string\n}) {\n const swipeableRef = useRef<SwipeableMethods>(null)\n const styles = useStyles()\n const { activeConversationId, setActiveConversationId } = useConversationsContext()\n const [disabled, setDisabled] = useState(false)\n const overshootLeft = Platform.OS === 'ios'\n const androidRippleColor = useCreateAndroidRippleColor({\n color: styles.swipeableChildContainer.backgroundColor,\n })\n const { muted, setMuted, isPending: isMutedPending } = useConversationsMute({ conversation })\n const {\n read,\n markRead,\n isPending: isMarkReadPending,\n } = useConversationsMarkRead({\n conversation,\n })\n\n const isConversationEmpty = conversation.lastMessageCreatedAt === null\n\n const handleSwipeableClose = useCallback(() => {\n setDisabled(false)\n swipeableRef.current?.close()\n }, [setDisabled])\n\n const handleSwipeableOpen = () => {\n setDisabled(true)\n setActiveConversationId(conversation.id)\n }\n\n const handlePress = useCallback(() => {\n if (disabled || !onPress) return\n onPress()\n }, [disabled, onPress])\n\n const handleMute = useCallback(() => {\n setMuted(!muted)\n handleSwipeableClose()\n }, [muted, handleSwipeableClose, setMuted])\n\n const handleLatestMessageUnread = useCallback(() => {\n markRead(!read)\n handleSwipeableClose()\n }, [read, handleSwipeableClose, markRead])\n\n const readAccessibilityAction = !isConversationEmpty\n ? [\n {\n name: read ? 'markUnread' : 'markRead',\n label: read ? 'Mark unread' : 'Mark read',\n },\n ]\n : []\n\n const accessibilityActions = [\n {\n name: muted ? 'unmute' : 'mute',\n label: muted ? 'Enable' : 'Silence',\n },\n ...readAccessibilityAction,\n ]\n\n const handleAccessibilityAction = useCallback(\n (event: AccessibilityActionEvent) => {\n switch (event.nativeEvent.actionName) {\n case 'markRead':\n handleLatestMessageUnread()\n break\n case 'markUnread':\n handleLatestMessageUnread()\n break\n case 'mute':\n handleMute()\n break\n case 'unmute':\n handleMute()\n break\n }\n },\n [handleLatestMessageUnread, handleMute]\n )\n\n useEffect(() => {\n if (activeConversationId === conversation.id) return\n\n handleSwipeableClose()\n }, [activeConversationId, conversation.id, handleSwipeableClose])\n\n return (\n <ReanimatedSwipeable\n ref={swipeableRef}\n childrenContainerStyle={styles.swipeableChildContainer}\n containerStyle={styles.swipeableContainer}\n overshootFriction={8}\n overshootLeft={overshootLeft}\n overshootRight={false}\n onSwipeableOpenStartDrag={handleSwipeableOpen}\n onSwipeableClose={() => setDisabled(false)}\n renderRightActions={() => <></>}\n renderLeftActions={() => (\n <LeftActions\n isConversationEmpty={isConversationEmpty}\n handleMute={handleMute}\n handleLatestMessageUnread={handleLatestMessageUnread}\n muted={muted}\n read={read}\n isMutedPending={isMutedPending}\n isMarkReadPending={isMarkReadPending}\n />\n )}\n >\n <Pressable\n onPress={handlePress}\n style={({ pressed }) => [style, pressed && platformPressedOpacityStyle]}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"button\"\n accessibilityActions={accessibilityActions}\n onAccessibilityAction={handleAccessibilityAction}\n >\n {children}\n </Pressable>\n </ReanimatedSwipeable>\n )\n}\n\ninterface LeftActionsProps {\n isConversationEmpty: boolean\n handleMute: () => void\n handleLatestMessageUnread: () => void\n muted: boolean\n read: boolean\n isMutedPending: boolean\n isMarkReadPending: boolean\n}\n\nfunction LeftActions({\n isConversationEmpty,\n handleMute,\n handleLatestMessageUnread,\n muted,\n read,\n isMutedPending,\n isMarkReadPending,\n}: LeftActionsProps) {\n const styles = useStyles()\n\n const muteToggleContent = {\n true: { iconName: 'general.bell', label: 'Enable' },\n false: { iconName: 'general.bellMuted', label: 'Silence' },\n } as const\n\n const latestMessageUnreadToggleContent = {\n true: { iconName: 'general.outlinedTextMessage', label: 'Mark read' },\n false: { iconName: 'general.textMessageNotifications', label: 'Mark unread' },\n } as const\n\n return (\n <View style={styles.actionButtonContainer}>\n <SwipeableToggleButton\n loading={isMarkReadPending}\n disabled={isConversationEmpty}\n toggled={!read}\n onPress={handleLatestMessageUnread}\n toggleContent={latestMessageUnreadToggleContent}\n backgroundColor={tokens.fillColorInteractionSwipeDefault}\n />\n <SwipeableToggleButton\n loading={isMutedPending}\n toggled={muted}\n onPress={handleMute}\n toggleContent={muteToggleContent}\n backgroundColor={tokens.fillColorInteractionSwipeSecondary}\n />\n </View>\n )\n}\n\nconst ACTION_BUTTON_WIDTH = 120\nconst ACTION_BUTTON_COUNT = 2\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n swipeableChildContainer: {\n backgroundColor: colors.conversationActionsBackground,\n },\n actionButtonContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n width: ACTION_BUTTON_WIDTH * ACTION_BUTTON_COUNT,\n alignContent: 'stretch',\n },\n swipeableContainer: {\n backgroundColor: colors.surfaceColor090,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation_actions.js","sourceRoot":"","sources":["../../../src/components/conversations/conversation_actions.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAa,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClF,OAAO,EAEL,QAAQ,EACR,SAAS,EAET,UAAU,EACV,IAAI,GAEL,MAAM,c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IAAI,EACd,OAAO,EAAE,yBAAyB,EAClC,aAAa,EAAE,gCAAgC,EAC/C,eAAe,EAAE,MAAM,CAAC,gCAAgC,GACxD,EACF,KAAC,qBAAqB,IACpB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,KAAK,EACd,OAAO,EAAE,UAAU,EACnB,aAAa,EAAE,iBAAiB,EAChC,eAAe,EAAE,MAAM,CAAC,kCAAkC,GAC1D,IACG,CACR,CAAA;AACH,CAAC;AAED,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAC/B,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAE7B,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,uBAAuB,EAAE;YACvB,eAAe,EAAE,MAAM,CAAC,6BAA6B;SACtD;QACD,qBAAqB,EAAE;YACrB,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,mBAAmB,GAAG,mBAAmB;YAChD,YAAY,EAAE,SAAS;SACxB;QACD,kBAAkB,EAAE;YAClB,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport {\n AccessibilityActionEvent,\n Platform,\n Pressable,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native'\nimport ReanimatedSwipeable, {\n SwipeableMethods,\n} from 'react-native-gesture-handler/ReanimatedSwipeable'\nimport { useConversationsContext } from '../../contexts/conversations_context'\nimport { useTheme, useCreateAndroidRippleColor } from '../../hooks'\nimport {\n useConversationsMarkRead,\n useConversationsMute,\n} from '../../hooks/use_conversations_actions'\nimport { ConversationResource } from '../../types'\nimport { platformPressedOpacityStyle } from '../../utils'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { SwipeableToggleButton } from './swipeable_toggle_button'\n\nexport function ConversationActions({\n children,\n conversation,\n style,\n onPress,\n accessibilityLabel,\n}: {\n children: ReactNode\n conversation: ConversationResource\n onPress: () => void\n style?: StyleProp<ViewStyle>\n accessibilityLabel?: string\n}) {\n const swipeableRef = useRef<SwipeableMethods>(null)\n const styles = useStyles()\n const { activeConversationId, setActiveConversationId } = useConversationsContext()\n const [disabled, setDisabled] = useState(false)\n const overshootLeft = Platform.OS === 'ios'\n const androidRippleColor = useCreateAndroidRippleColor({\n color: styles.swipeableChildContainer.backgroundColor,\n })\n const { muted, setMuted, isPending: isMutedPending } = useConversationsMute({ conversation })\n const {\n read,\n markRead,\n isPending: isMarkReadPending,\n } = useConversationsMarkRead({\n conversation,\n })\n\n const isConversationEmpty = conversation.lastMessageCreatedAt === null\n\n const handleSwipeableClose = useCallback(() => {\n setDisabled(false)\n swipeableRef.current?.close()\n }, [setDisabled])\n\n const handleSwipeableOpen = () => {\n setDisabled(true)\n setActiveConversationId(conversation.id)\n }\n\n const handlePress = useCallback(() => {\n if (disabled || !onPress) return\n onPress()\n }, [disabled, onPress])\n\n const handleMute = useCallback(() => {\n setMuted(!muted)\n handleSwipeableClose()\n }, [muted, handleSwipeableClose, setMuted])\n\n const handleLatestMessageUnread = useCallback(() => {\n markRead(!read)\n handleSwipeableClose()\n }, [read, handleSwipeableClose, markRead])\n\n const readAccessibilityAction = !isConversationEmpty\n ? [\n {\n name: read ? 'markUnread' : 'markRead',\n label: read ? 'Mark unread' : 'Mark read',\n },\n ]\n : []\n\n const accessibilityActions = [\n {\n name: muted ? 'unmute' : 'mute',\n label: muted ? 'Enable' : 'Silence',\n },\n ...readAccessibilityAction,\n ]\n\n const handleAccessibilityAction = useCallback(\n (event: AccessibilityActionEvent) => {\n switch (event.nativeEvent.actionName) {\n case 'markRead':\n handleLatestMessageUnread()\n break\n case 'markUnread':\n handleLatestMessageUnread()\n break\n case 'mute':\n handleMute()\n break\n case 'unmute':\n handleMute()\n break\n }\n },\n [handleLatestMessageUnread, handleMute]\n )\n\n useEffect(() => {\n if (activeConversationId === conversation.id) return\n\n handleSwipeableClose()\n }, [activeConversationId, conversation.id, handleSwipeableClose])\n\n return (\n <ReanimatedSwipeable\n ref={swipeableRef}\n childrenContainerStyle={styles.swipeableChildContainer}\n containerStyle={styles.swipeableContainer}\n overshootFriction={8}\n overshootLeft={overshootLeft}\n overshootRight={false}\n onSwipeableOpenStartDrag={handleSwipeableOpen}\n onSwipeableClose={() => setDisabled(false)}\n renderRightActions={() => <></>}\n renderLeftActions={() => (\n <LeftActions\n isConversationEmpty={isConversationEmpty}\n handleMute={handleMute}\n handleLatestMessageUnread={handleLatestMessageUnread}\n muted={muted}\n read={read}\n isMutedPending={isMutedPending}\n isMarkReadPending={isMarkReadPending}\n />\n )}\n >\n <Pressable\n onPress={handlePress}\n style={({ pressed }) => [style, pressed && platformPressedOpacityStyle]}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"button\"\n accessibilityActions={accessibilityActions}\n onAccessibilityAction={handleAccessibilityAction}\n >\n {children}\n </Pressable>\n </ReanimatedSwipeable>\n )\n}\n\ninterface LeftActionsProps {\n isConversationEmpty: boolean\n handleMute: () => void\n handleLatestMessageUnread: () => void\n muted: boolean\n read: boolean\n isMutedPending: boolean\n isMarkReadPending: boolean\n}\n\nfunction LeftActions({\n isConversationEmpty,\n handleMute,\n handleLatestMessageUnread,\n muted,\n read,\n isMutedPending,\n isMarkReadPending,\n}: LeftActionsProps) {\n const styles = useStyles()\n\n const muteToggleContent = {\n true: { iconName: 'general.bell', label: 'Enable' },\n false: { iconName: 'general.bellMuted', label: 'Silence' },\n } as const\n\n const latestMessageUnreadToggleContent = {\n true: { iconName: 'general.outlinedTextMessage', label: 'Mark read' },\n false: { iconName: 'general.textMessageNotifications', label: 'Mark unread' },\n } as const\n\n return (\n <View style={styles.actionButtonContainer}>\n <SwipeableToggleButton\n loading={isMarkReadPending}\n disabled={isConversationEmpty}\n toggled={!read}\n onPress={handleLatestMessageUnread}\n toggleContent={latestMessageUnreadToggleContent}\n backgroundColor={tokens.fillColorInteractionSwipeDefault}\n />\n <SwipeableToggleButton\n loading={isMutedPending}\n toggled={muted}\n onPress={handleMute}\n toggleContent={muteToggleContent}\n backgroundColor={tokens.fillColorInteractionSwipeSecondary}\n />\n </View>\n )\n}\n\nconst ACTION_BUTTON_WIDTH = 120\nconst ACTION_BUTTON_COUNT = 2\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n swipeableChildContainer: {\n backgroundColor: colors.conversationActionsBackground,\n },\n actionButtonContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n width: ACTION_BUTTON_WIDTH * ACTION_BUTTON_COUNT,\n alignContent: 'stretch',\n },\n swipeableContainer: {\n backgroundColor: colors.surfaceColor090,\n },\n })\n}\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ViewStyle } from 'react-native';
|
|
3
2
|
import { ConversationResource } from '../../types';
|
|
4
3
|
interface ConversationPreviewProps {
|
|
@@ -7,7 +6,7 @@ interface ConversationPreviewProps {
|
|
|
7
6
|
showBadges?: boolean;
|
|
8
7
|
style?: ViewStyle;
|
|
9
8
|
}
|
|
10
|
-
export declare const ConversationPreview: ({ conversation, onPress, showBadges, style, }: ConversationPreviewProps) =>
|
|
11
|
-
export declare const ConversationPreviewSkeleton: () =>
|
|
9
|
+
export declare const ConversationPreview: ({ conversation, onPress, showBadges, style, }: ConversationPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const ConversationPreviewSkeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export {};
|
|
13
12
|
//# sourceMappingURL=conversation_preview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_preview.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/conversation_preview.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation_preview.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/conversation_preview.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAA;AAO1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AASlD,UAAU,wBAAwB;IAChC,YAAY,EAAE,oBAAoB,CAAA;IAClC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,eAAO,MAAM,mBAAmB,GAAI,+CAKjC,wBAAwB,4CAiE1B,CAAA;AAqCD,eAAO,MAAM,2BAA2B,+CAqBvC,CAAA"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
import { useTheme, useAtFontScaleBreakpoint, useFontScale, useScalableNumberOfLines, } from '../../hooks';
|
|
4
|
-
import { REACTION_EMOJIS, platformFontWeightBold } from '../../utils';
|
|
5
4
|
import { formatDatePreview } from '../../utils/date';
|
|
6
|
-
import { tokens } from '../../vendor/tapestry/tokens';
|
|
7
5
|
import { AvatarGroup, ConversationAvatar, Heading, Text, Badge } from '../display';
|
|
8
6
|
import { ConversationActions } from './conversation_actions';
|
|
9
7
|
import { MuteIndicator } from './mute_indicator';
|
|
@@ -11,42 +9,20 @@ import { UnreadCountBadge } from './unread_count_badge';
|
|
|
11
9
|
const EMPTY_CONVERSATION_PREVIEW_TEXT = 'Send your first message';
|
|
12
10
|
export const ConversationPreview = ({ conversation, onPress, showBadges = true, style, }) => {
|
|
13
11
|
const styles = useStyles();
|
|
14
|
-
const {
|
|
12
|
+
const { lastMessageAuthorName, lastMessageCreatedAt, lastMessageTextPreview, title, unreadCount, badges, muted, disabled, } = conversation;
|
|
15
13
|
const emptyConversation = !lastMessageCreatedAt;
|
|
16
14
|
const fallbackIconName = emptyConversation ? 'people.noTextMessage' : 'general.person';
|
|
17
15
|
const hasMetaContent = lastMessageCreatedAt || unreadCount > 0 || muted;
|
|
18
|
-
const isUnread = unreadCount > 0 || unreadReaction;
|
|
19
16
|
const numberOfLinesScaledTitle = useScalableNumberOfLines(1);
|
|
20
17
|
const numberOfLinesScaledPreviewText = useScalableNumberOfLines(2);
|
|
21
|
-
const conversationPreviewText =
|
|
22
|
-
?
|
|
18
|
+
const conversationPreviewText = lastMessageTextPreview
|
|
19
|
+
? `${lastMessageAuthorName}: ${lastMessageTextPreview}`
|
|
23
20
|
: EMPTY_CONVERSATION_PREVIEW_TEXT;
|
|
24
21
|
const conversationAccessibilityLabel = getConversationAccessibilityLabel({
|
|
25
22
|
conversation,
|
|
26
23
|
showBadges,
|
|
27
24
|
});
|
|
28
|
-
return (
|
|
29
|
-
<ConversationAvatar conversation={conversation} size="lg" fallbackIconName={fallbackIconName}/>
|
|
30
|
-
<View style={styles.conversationBody}>
|
|
31
|
-
<Heading numberOfLines={numberOfLinesScaledTitle} variant="h3" style={[styles.title, isUnread && styles.unreadTitle]}>
|
|
32
|
-
{title}
|
|
33
|
-
</Heading>
|
|
34
|
-
<Text variant="tertiary" numberOfLines={numberOfLinesScaledPreviewText} style={[
|
|
35
|
-
emptyConversation && styles.emptyConversationPreviewText,
|
|
36
|
-
isUnread && styles.unreadText,
|
|
37
|
-
]}>
|
|
38
|
-
{conversationPreviewText}
|
|
39
|
-
</Text>
|
|
40
|
-
<ConversationBadges visible={showBadges} badges={badges}/>
|
|
41
|
-
</View>
|
|
42
|
-
{hasMetaContent && (<View style={styles.metaContainer}>
|
|
43
|
-
<Text variant="tertiary">{formatDatePreview(conversationPreview?.createdAt)}</Text>
|
|
44
|
-
<View style={styles.statusContainer}>
|
|
45
|
-
<UnreadCountBadge count={unreadCount} unreadReaction={unreadReaction} showDot={muted}/>
|
|
46
|
-
<MuteIndicator muted={muted}/>
|
|
47
|
-
</View>
|
|
48
|
-
</View>)}
|
|
49
|
-
</ConversationActions>);
|
|
25
|
+
return (_jsxs(ConversationActions, { conversation: conversation, style: [styles.previewRow, disabled && styles.disabled, style], onPress: onPress, accessibilityLabel: conversationAccessibilityLabel, children: [_jsx(ConversationAvatar, { conversation: conversation, size: "lg", fallbackIconName: fallbackIconName }), _jsxs(View, { style: styles.conversationBody, children: [_jsx(Heading, { numberOfLines: numberOfLinesScaledTitle, variant: "h3", style: styles.title, children: title }), _jsx(Text, { variant: "tertiary", numberOfLines: numberOfLinesScaledPreviewText, style: emptyConversation && styles.emptyConversationPreviewText, children: conversationPreviewText }), _jsx(ConversationBadges, { visible: showBadges, badges: badges })] }), hasMetaContent && (_jsxs(View, { style: styles.metaContainer, children: [_jsx(Text, { variant: "tertiary", children: formatDatePreview(lastMessageCreatedAt) }), _jsxs(View, { style: styles.statusContainer, children: [_jsx(UnreadCountBadge, { count: unreadCount, showDot: muted }), _jsx(MuteIndicator, { muted: muted })] })] }))] }));
|
|
50
26
|
};
|
|
51
27
|
const ConversationBadges = ({ visible, badges }) => {
|
|
52
28
|
const styles = useStyles();
|
|
@@ -54,9 +30,7 @@ const ConversationBadges = ({ visible, badges }) => {
|
|
|
54
30
|
if (!visible || !badges || badges.length === 0) {
|
|
55
31
|
return null;
|
|
56
32
|
}
|
|
57
|
-
return (
|
|
58
|
-
{badges.map(badge => (<Badge key={badge.text} variant="meta" productLogoName={badge.appName} label={badge.pcoResourceType} metaLabel={badge.text || ''} numberOfLinesMetaLabel={numberOfLinesScaled}/>))}
|
|
59
|
-
</View>);
|
|
33
|
+
return (_jsx(View, { style: styles.badges, children: badges.map(badge => (_jsx(Badge, { variant: "meta", productLogoName: badge.appName, label: badge.pcoResourceType, metaLabel: badge.text || '', numberOfLinesMetaLabel: numberOfLinesScaled }, badge.text))) }));
|
|
60
34
|
};
|
|
61
35
|
const skeletonBadges = [
|
|
62
36
|
{
|
|
@@ -66,53 +40,21 @@ const skeletonBadges = [
|
|
|
66
40
|
];
|
|
67
41
|
export const ConversationPreviewSkeleton = () => {
|
|
68
42
|
const styles = useStyles();
|
|
69
|
-
return (
|
|
70
|
-
<AvatarGroup size="lg" sourceUris={[]} showFallback={true} fallbackIconName={'general.person'}/>
|
|
71
|
-
<View style={styles.conversationBody}>
|
|
72
|
-
<View style={styles.titleLoading}/>
|
|
73
|
-
<View style={styles.subtitleLoading}/>
|
|
74
|
-
<ConversationBadges visible={true} badges={skeletonBadges}/>
|
|
75
|
-
</View>
|
|
76
|
-
<View style={styles.metaContainer}>
|
|
77
|
-
<View style={styles.dateLoading}/>
|
|
78
|
-
</View>
|
|
79
|
-
</View>);
|
|
43
|
+
return (_jsxs(View, { style: styles.previewRow, children: [_jsx(AvatarGroup, { size: "lg", sourceUris: [], showFallback: true, fallbackIconName: 'general.person' }), _jsxs(View, { style: styles.conversationBody, children: [_jsx(View, { style: styles.titleLoading }), _jsx(View, { style: styles.subtitleLoading }), _jsx(ConversationBadges, { visible: true, badges: skeletonBadges })] }), _jsx(View, { style: styles.metaContainer, children: _jsx(View, { style: styles.dateLoading }) })] }));
|
|
80
44
|
};
|
|
81
|
-
function reactionEmoji(value) {
|
|
82
|
-
if (!value)
|
|
83
|
-
return null;
|
|
84
|
-
return REACTION_EMOJIS[value] ?? null;
|
|
85
|
-
}
|
|
86
|
-
function formatConversationPreviewText(preview) {
|
|
87
|
-
if (preview.kind === 'reaction') {
|
|
88
|
-
const emoji = reactionEmoji(preview.value);
|
|
89
|
-
return `${preview.authorName}${emoji ? ` ${emoji}` : ' reacted'} to: "${preview.text}"`;
|
|
90
|
-
}
|
|
91
|
-
return `${preview.authorName}: ${preview.text}`;
|
|
92
|
-
}
|
|
93
|
-
function formatConversationPreviewAccessibilityLabel(preview) {
|
|
94
|
-
const date = formatDatePreview(preview.createdAt);
|
|
95
|
-
if (preview.kind === 'reaction') {
|
|
96
|
-
return `${preview.authorName} reacted to your message sent ${date} and says ${preview.text}`;
|
|
97
|
-
}
|
|
98
|
-
return `Last message sent ${date} from ${preview.authorName} and says ${preview.text}`;
|
|
99
|
-
}
|
|
100
45
|
const getConversationAccessibilityLabel = ({ conversation, showBadges, }) => {
|
|
101
|
-
const { badges, title,
|
|
46
|
+
const { badges, title, lastMessageAuthorName, lastMessageTextPreview, muted, disabled, unreadCount, lastMessageCreatedAt, } = conversation;
|
|
102
47
|
const hasBadges = badges && showBadges;
|
|
103
48
|
const hasUnreadMessages = unreadCount > 0;
|
|
49
|
+
const hasLastMessage = lastMessageCreatedAt;
|
|
104
50
|
const label = {
|
|
105
51
|
title,
|
|
106
52
|
badge: hasBadges ? `for ${badges[0]?.pcoResourceType} ${badges[0]?.text || ''}` : '',
|
|
107
53
|
disabled: disabled ? 'Disabled' : '',
|
|
108
54
|
muted: muted ? 'Muted' : '',
|
|
109
|
-
readStatus: hasUnreadMessages
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
? 'unread reaction'
|
|
113
|
-
: '',
|
|
114
|
-
lastMessage: conversationPreview
|
|
115
|
-
? formatConversationPreviewAccessibilityLabel(conversationPreview)
|
|
55
|
+
readStatus: hasUnreadMessages ? `${unreadCount} unread messages` : '',
|
|
56
|
+
lastMessage: hasLastMessage
|
|
57
|
+
? `Last message sent ${formatDatePreview(lastMessageCreatedAt)} from ${lastMessageAuthorName} and says ${lastMessageTextPreview}`
|
|
116
58
|
: EMPTY_CONVERSATION_PREVIEW_TEXT,
|
|
117
59
|
};
|
|
118
60
|
return [
|
|
@@ -149,12 +91,6 @@ const useStyles = () => {
|
|
|
149
91
|
fontSize: 16,
|
|
150
92
|
color: colors.textColorDefaultPrimary,
|
|
151
93
|
},
|
|
152
|
-
unreadTitle: {
|
|
153
|
-
fontWeight: tokens.fontWeightBold,
|
|
154
|
-
},
|
|
155
|
-
unreadText: {
|
|
156
|
-
fontWeight: platformFontWeightBold,
|
|
157
|
-
},
|
|
158
94
|
titleLoading: {
|
|
159
95
|
width: 120,
|
|
160
96
|
height: 20,
|