@planningcenter/chat-react-native 3.42.2-qa-821.0 → 3.42.2-qa-staging.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/conversation/attachments/attachment_card.d.ts +3 -3
- package/build/components/conversation/attachments/attachment_card.d.ts.map +1 -1
- package/build/components/conversation/attachments/attachment_card.js +7 -3
- package/build/components/conversation/attachments/attachment_card.js.map +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts +2 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts.map +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.js +7 -12
- package/build/components/conversation/attachments/attachment_deleting_overlay.js.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.d.ts +2 -1
- package/build/components/conversation/attachments/audio_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.js +23 -6
- package/build/components/conversation/attachments/audio_attachment.js.map +1 -1
- package/build/components/conversation/attachments/expanded_link.d.ts +2 -1
- package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -1
- package/build/components/conversation/attachments/expanded_link.js +8 -2
- package/build/components/conversation/attachments/expanded_link.js.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts +2 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.js +12 -2
- package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts +2 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.js +7 -2
- package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
- package/build/components/conversation/attachments/image_attachment.d.ts +2 -1
- package/build/components/conversation/attachments/image_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/image_attachment.js +53 -16
- package/build/components/conversation/attachments/image_attachment.js.map +1 -1
- package/build/components/conversation/attachments/video_attachment.d.ts +2 -1
- package/build/components/conversation/attachments/video_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/video_attachment.js +13 -3
- package/build/components/conversation/attachments/video_attachment.js.map +1 -1
- package/build/components/conversation/conversation_start_banner.d.ts +2 -1
- package/build/components/conversation/conversation_start_banner.d.ts.map +1 -1
- package/build/components/conversation/conversation_start_banner.js +14 -2
- package/build/components/conversation/conversation_start_banner.js.map +1 -1
- package/build/components/conversation/empty_conversation_blank_state.d.ts +1 -1
- package/build/components/conversation/empty_conversation_blank_state.d.ts.map +1 -1
- package/build/components/conversation/empty_conversation_blank_state.js +9 -2
- package/build/components/conversation/empty_conversation_blank_state.js.map +1 -1
- package/build/components/conversation/jump_to_bottom_button.d.ts +1 -1
- package/build/components/conversation/jump_to_bottom_button.d.ts.map +1 -1
- package/build/components/conversation/jump_to_bottom_button.js +10 -2
- package/build/components/conversation/jump_to_bottom_button.js.map +1 -1
- package/build/components/conversation/message.d.ts +2 -1
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +53 -2
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_attachments.d.ts +2 -1
- package/build/components/conversation/message_attachments.d.ts.map +1 -1
- package/build/components/conversation/message_attachments.js +21 -17
- package/build/components/conversation/message_attachments.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_file.d.ts +2 -1
- package/build/components/conversation/message_form/message_form_attachment_file.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_file.js +2 -2
- package/build/components/conversation/message_form/message_form_attachment_file.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts +2 -1
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_image.js +2 -2
- package/build/components/conversation/message_form/message_form_attachment_image.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_video.d.ts +2 -1
- package/build/components/conversation/message_form/message_form_attachment_video.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_video.js +2 -2
- package/build/components/conversation/message_form/message_form_attachment_video.js.map +1 -1
- package/build/components/conversation/message_form.d.ts +6 -5
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +82 -20
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_markdown.d.ts +2 -1
- package/build/components/conversation/message_markdown.d.ts.map +1 -1
- package/build/components/conversation/message_markdown.js +16 -8
- package/build/components/conversation/message_markdown.js.map +1 -1
- package/build/components/conversation/message_reaction.d.ts +2 -1
- package/build/components/conversation/message_reaction.d.ts.map +1 -1
- package/build/components/conversation/message_reaction.js +5 -3
- package/build/components/conversation/message_reaction.js.map +1 -1
- package/build/components/conversation/message_read_receipts.d.ts +2 -1
- package/build/components/conversation/message_read_receipts.d.ts.map +1 -1
- package/build/components/conversation/message_read_receipts.js +13 -3
- package/build/components/conversation/message_read_receipts.js.map +1 -1
- package/build/components/conversation/messages_disabled_banners.d.ts +3 -3
- package/build/components/conversation/messages_disabled_banners.d.ts.map +1 -1
- package/build/components/conversation/messages_disabled_banners.js +8 -5
- package/build/components/conversation/messages_disabled_banners.js.map +1 -1
- package/build/components/conversation/reply_connectors.d.ts +2 -2
- package/build/components/conversation/reply_connectors.d.ts.map +1 -1
- package/build/components/conversation/reply_connectors.js +50 -18
- package/build/components/conversation/reply_connectors.js.map +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts +2 -1
- package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
- package/build/components/conversation/reply_shadow_message.js +46 -16
- package/build/components/conversation/reply_shadow_message.js.map +1 -1
- package/build/components/conversation/system_message.d.ts +2 -1
- package/build/components/conversation/system_message.d.ts.map +1 -1
- package/build/components/conversation/system_message.js +12 -3
- package/build/components/conversation/system_message.js.map +1 -1
- package/build/components/conversation/typing_indicator.d.ts +2 -1
- package/build/components/conversation/typing_indicator.d.ts.map +1 -1
- package/build/components/conversation/typing_indicator.js +13 -3
- package/build/components/conversation/typing_indicator.js.map +1 -1
- package/build/components/conversations/conversation_actions.d.ts +2 -2
- package/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +10 -4
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts +3 -2
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +76 -12
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/conversations.d.ts +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +17 -16
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/conversations/conversations_blank_state.d.ts +2 -1
- package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
- package/build/components/conversations/conversations_blank_state.js +12 -2
- package/build/components/conversations/conversations_blank_state.js.map +1 -1
- package/build/components/conversations/mute_indicator.d.ts +2 -1
- package/build/components/conversations/mute_indicator.d.ts.map +1 -1
- package/build/components/conversations/mute_indicator.js +2 -2
- package/build/components/conversations/mute_indicator.js.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts +2 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.js +10 -3
- package/build/components/conversations/swipeable_toggle_button.js.map +1 -1
- package/build/components/conversations/unread_count_badge.d.ts +4 -2
- package/build/components/conversations/unread_count_badge.d.ts.map +1 -1
- package/build/components/conversations/unread_count_badge.js +12 -7
- package/build/components/conversations/unread_count_badge.js.map +1 -1
- package/build/components/display/action_button.d.ts +1 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +13 -3
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/adult_requirement_notice.d.ts +2 -1
- package/build/components/display/adult_requirement_notice.d.ts.map +1 -1
- package/build/components/display/adult_requirement_notice.js +4 -2
- package/build/components/display/adult_requirement_notice.js.map +1 -1
- package/build/components/display/avatar.d.ts +2 -1
- package/build/components/display/avatar.d.ts.map +1 -1
- package/build/components/display/avatar.js +7 -2
- package/build/components/display/avatar.js.map +1 -1
- package/build/components/display/avatar_group.d.ts +2 -1
- package/build/components/display/avatar_group.d.ts.map +1 -1
- package/build/components/display/avatar_group.js +9 -2
- package/build/components/display/avatar_group.js.map +1 -1
- package/build/components/display/badge.d.ts +2 -1
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +37 -6
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/banner.d.ts +3 -3
- package/build/components/display/banner.d.ts.map +1 -1
- package/build/components/display/banner.js +11 -4
- package/build/components/display/banner.js.map +1 -1
- package/build/components/display/banner_collapsible.d.ts +2 -2
- package/build/components/display/banner_collapsible.d.ts.map +1 -1
- package/build/components/display/banner_collapsible.js +10 -2
- package/build/components/display/banner_collapsible.js.map +1 -1
- package/build/components/display/button.d.ts +2 -1
- package/build/components/display/button.d.ts.map +1 -1
- package/build/components/display/button.js +14 -3
- package/build/components/display/button.js.map +1 -1
- package/build/components/display/child_notice.d.ts +2 -1
- package/build/components/display/child_notice.d.ts.map +1 -1
- package/build/components/display/child_notice.js +15 -3
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/display/conversation_avatar.d.ts +2 -1
- package/build/components/display/conversation_avatar.d.ts.map +1 -1
- package/build/components/display/conversation_avatar.js +9 -5
- package/build/components/display/conversation_avatar.js.map +1 -1
- package/build/components/display/emoji_avatar.d.ts +2 -1
- package/build/components/display/emoji_avatar.d.ts.map +1 -1
- package/build/components/display/emoji_avatar.js +12 -2
- package/build/components/display/emoji_avatar.js.map +1 -1
- package/build/components/display/file_attachment_preview.d.ts +1 -1
- package/build/components/display/file_attachment_preview.d.ts.map +1 -1
- package/build/components/display/file_attachment_preview.js +17 -3
- package/build/components/display/file_attachment_preview.js.map +1 -1
- package/build/components/display/heading.d.ts +2 -1
- package/build/components/display/heading.d.ts.map +1 -1
- package/build/components/display/heading.js +4 -2
- package/build/components/display/heading.js.map +1 -1
- package/build/components/display/icon.d.ts +2 -1
- package/build/components/display/icon.d.ts.map +1 -1
- package/build/components/display/icon.js +4 -4
- package/build/components/display/icon.js.map +1 -1
- package/build/components/display/icon_avatar.d.ts +2 -1
- package/build/components/display/icon_avatar.d.ts.map +1 -1
- package/build/components/display/icon_avatar.js +12 -2
- package/build/components/display/icon_avatar.js.map +1 -1
- package/build/components/display/icon_button.d.ts +2 -1
- package/build/components/display/icon_button.d.ts.map +1 -1
- package/build/components/display/icon_button.js +5 -3
- package/build/components/display/icon_button.js.map +1 -1
- package/build/components/display/image.d.ts +2 -1
- package/build/components/display/image.d.ts.map +1 -1
- package/build/components/display/image.js +7 -3
- package/build/components/display/image.js.map +1 -1
- package/build/components/display/image_attachment_preview.d.ts +1 -1
- package/build/components/display/image_attachment_preview.d.ts.map +1 -1
- package/build/components/display/image_attachment_preview.js +7 -2
- package/build/components/display/image_attachment_preview.js.map +1 -1
- package/build/components/display/keyboard_view.d.ts +2 -1
- package/build/components/display/keyboard_view.d.ts.map +1 -1
- package/build/components/display/keyboard_view.js +9 -4
- package/build/components/display/keyboard_view.js.map +1 -1
- package/build/components/display/person.d.ts +2 -1
- package/build/components/display/person.d.ts.map +1 -1
- package/build/components/display/person.js +12 -2
- package/build/components/display/person.js.map +1 -1
- package/build/components/display/platform_modal_header_buttons.d.ts +3 -3
- package/build/components/display/platform_modal_header_buttons.d.ts.map +1 -1
- package/build/components/display/platform_modal_header_buttons.js +10 -5
- package/build/components/display/platform_modal_header_buttons.js.map +1 -1
- package/build/components/display/pressable_row.d.ts +1 -1
- package/build/components/display/pressable_row.d.ts.map +1 -1
- package/build/components/display/pressable_row.js +7 -2
- package/build/components/display/pressable_row.js.map +1 -1
- package/build/components/display/spinner.d.ts +2 -1
- package/build/components/display/spinner.d.ts.map +1 -1
- package/build/components/display/spinner.js +9 -3
- package/build/components/display/spinner.js.map +1 -1
- package/build/components/display/switch.d.ts +2 -1
- package/build/components/display/switch.d.ts.map +1 -1
- package/build/components/display/switch.js +2 -2
- package/build/components/display/switch.js.map +1 -1
- package/build/components/display/tabs.d.ts +1 -1
- package/build/components/display/tabs.d.ts.map +1 -1
- package/build/components/display/tabs.js +31 -21
- package/build/components/display/tabs.js.map +1 -1
- package/build/components/display/text.d.ts +2 -1
- package/build/components/display/text.d.ts.map +1 -1
- package/build/components/display/text.js +4 -2
- package/build/components/display/text.js.map +1 -1
- package/build/components/display/text_button.d.ts +2 -1
- package/build/components/display/text_button.d.ts.map +1 -1
- package/build/components/display/text_button.js +8 -3
- package/build/components/display/text_button.js.map +1 -1
- package/build/components/display/text_inline_button.d.ts +2 -1
- package/build/components/display/text_inline_button.d.ts.map +1 -1
- package/build/components/display/text_inline_button.js +5 -4
- package/build/components/display/text_inline_button.js.map +1 -1
- package/build/components/display/text_input.d.ts +1 -1
- package/build/components/display/text_input.d.ts.map +1 -1
- package/build/components/display/text_input.js +1 -2
- package/build/components/display/text_input.js.map +1 -1
- package/build/components/display/toggle_button.d.ts +2 -1
- package/build/components/display/toggle_button.d.ts.map +1 -1
- package/build/components/display/toggle_button.js +9 -3
- package/build/components/display/toggle_button.js.map +1 -1
- package/build/components/display/video_attachment_preview.d.ts +1 -1
- package/build/components/display/video_attachment_preview.d.ts.map +1 -1
- package/build/components/display/video_attachment_preview.js +20 -3
- package/build/components/display/video_attachment_preview.js.map +1 -1
- package/build/components/group_conversation_list.d.ts +1 -1
- package/build/components/group_conversation_list.d.ts.map +1 -1
- package/build/components/group_conversation_list.js +14 -4
- package/build/components/group_conversation_list.js.map +1 -1
- package/build/components/page/component_error_boundary.d.ts +2 -2
- package/build/components/page/component_error_boundary.d.ts.map +1 -1
- package/build/components/page/component_error_boundary.js +4 -2
- package/build/components/page/component_error_boundary.js.map +1 -1
- package/build/components/page/loading.d.ts +2 -1
- package/build/components/page/loading.d.ts.map +1 -1
- package/build/components/page/loading.js +4 -2
- package/build/components/page/loading.js.map +1 -1
- package/build/components/page/page_error_boundary.d.ts +2 -2
- package/build/components/page/page_error_boundary.d.ts.map +1 -1
- package/build/components/page/page_error_boundary.js +32 -11
- package/build/components/page/page_error_boundary.js.map +1 -1
- package/build/components/primitive/avatar_primitive.js +41 -14
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/components/primitive/banner_primitive.js +18 -10
- package/build/components/primitive/banner_primitive.js.map +1 -1
- package/build/components/primitive/blank_state_primitive.js +12 -8
- package/build/components/primitive/blank_state_primitive.js.map +1 -1
- package/build/components/primitive/form_sheet.d.ts +1 -1
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.js +22 -9
- package/build/components/primitive/form_sheet.js.map +1 -1
- package/build/components/safe_area_modal.d.ts +1 -1
- package/build/components/safe_area_modal.d.ts.map +1 -1
- package/build/components/safe_area_modal.js +3 -2
- package/build/components/safe_area_modal.js.map +1 -1
- package/build/contexts/api_provider.d.ts +2 -1
- package/build/contexts/api_provider.d.ts.map +1 -1
- package/build/contexts/api_provider.js +5 -3
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts +1 -1
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +1 -2
- package/build/contexts/chat_context.js.map +1 -1
- package/build/contexts/conversation_context.d.ts +2 -2
- package/build/contexts/conversation_context.d.ts.map +1 -1
- package/build/contexts/conversation_context.js +2 -3
- package/build/contexts/conversation_context.js.map +1 -1
- package/build/contexts/conversations_context.d.ts +2 -2
- package/build/contexts/conversations_context.d.ts.map +1 -1
- package/build/contexts/conversations_context.js +2 -3
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/contexts/session_context.d.ts +1 -1
- package/build/contexts/session_context.d.ts.map +1 -1
- package/build/contexts/session_context.js +2 -3
- package/build/contexts/session_context.js.map +1 -1
- package/build/hooks/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 +2 -0
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +4 -19
- package/build/hooks/use_conversation_jolt_events.js.map +1 -1
- package/build/hooks/use_conversation_membership.d.ts +1 -1
- package/build/hooks/use_conversation_membership.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts +0 -1
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +2 -2
- package/build/hooks/use_conversation_messages.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts +36 -36
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.js +3 -1
- package/build/hooks/use_conversations_actions.js.map +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
- package/build/hooks/use_mark_latest_message_read.js +3 -4
- package/build/hooks/use_mark_latest_message_read.js.map +1 -1
- package/build/hooks/use_person_settings.d.ts +1 -1
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +1 -7
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/index.d.ts +1 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/navigation/chat_access_gate.d.ts +2 -2
- package/build/navigation/chat_access_gate.d.ts.map +1 -1
- package/build/navigation/chat_access_gate.js +5 -6
- package/build/navigation/chat_access_gate.js.map +1 -1
- package/build/navigation/index.d.ts +36 -35
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +21 -19
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/screenLayout.d.ts +2 -2
- package/build/navigation/screenLayout.d.ts.map +1 -1
- package/build/navigation/screenLayout.js +9 -3
- package/build/navigation/screenLayout.js.map +1 -1
- package/build/polyfills/events/EventTarget.d.ts +1 -1
- package/build/polyfills/events/EventTarget.d.ts.map +1 -1
- package/build/polyfills/events/EventTarget.js.map +1 -1
- package/build/screens/age_check/age_check_required_screen.d.ts +2 -1
- package/build/screens/age_check/age_check_required_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_required_screen.js +46 -3
- package/build/screens/age_check/age_check_required_screen.js.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.d.ts +2 -1
- package/build/screens/age_check/age_check_underage_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.js +25 -2
- package/build/screens/age_check/age_check_underage_screen.js.map +1 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts +2 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts.map +1 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js +25 -6
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts +2 -1
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js +5 -3
- package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts +2 -1
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts.map +1 -1
- package/build/screens/avatar_picker/avatar_picker_screen.js +36 -9
- package/build/screens/avatar_picker/avatar_picker_screen.js.map +1 -1
- package/build/screens/avatar_picker/avatar_preview.d.ts +1 -1
- package/build/screens/avatar_picker/avatar_preview.d.ts.map +1 -1
- package/build/screens/avatar_picker/avatar_preview.js +9 -5
- package/build/screens/avatar_picker/avatar_preview.js.map +1 -1
- package/build/screens/avatar_picker/color_picker.d.ts +2 -1
- package/build/screens/avatar_picker/color_picker.d.ts.map +1 -1
- package/build/screens/avatar_picker/color_picker.js +5 -4
- package/build/screens/avatar_picker/color_picker.js.map +1 -1
- package/build/screens/avatar_picker/emoji_tab.d.ts +2 -1
- package/build/screens/avatar_picker/emoji_tab.d.ts.map +1 -1
- package/build/screens/avatar_picker/emoji_tab.js +13 -12
- package/build/screens/avatar_picker/emoji_tab.js.map +1 -1
- package/build/screens/avatar_picker/icon_grid.d.ts +2 -1
- package/build/screens/avatar_picker/icon_grid.d.ts.map +1 -1
- package/build/screens/avatar_picker/icon_grid.js +5 -4
- package/build/screens/avatar_picker/icon_grid.js.map +1 -1
- package/build/screens/avatar_picker/upload_tab.d.ts +2 -1
- package/build/screens/avatar_picker/upload_tab.d.ts.map +1 -1
- package/build/screens/avatar_picker/upload_tab.js +4 -3
- package/build/screens/avatar_picker/upload_tab.js.map +1 -1
- package/build/screens/bug_report_screen.d.ts +2 -1
- package/build/screens/bug_report_screen.d.ts.map +1 -1
- package/build/screens/bug_report_screen.js +117 -11
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.d.ts +2 -1
- package/build/screens/conversation/message_read_receipts_screen.d.ts.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.js +20 -4
- package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts +2 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +106 -43
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js +9 -3
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.js +12 -2
- package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +2 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +44 -20
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts +2 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +11 -10
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts +6 -6
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +34 -7
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.js +1 -2
- package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts +2 -1
- package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/group_filters.js +2 -2
- package/build/screens/conversation_filters/group_filters.js.map +1 -1
- package/build/screens/conversation_filters/team_filters.d.ts +2 -1
- package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/team_filters.js +2 -2
- package/build/screens/conversation_filters/team_filters.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts +2 -1
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +16 -4
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/conversation_new/components/avatar_selection_row.d.ts +3 -2
- package/build/screens/conversation_new/components/avatar_selection_row.d.ts.map +1 -1
- package/build/screens/conversation_new/components/avatar_selection_row.js +16 -6
- package/build/screens/conversation_new/components/avatar_selection_row.js.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.d.ts +4 -3
- package/build/screens/conversation_new/components/filter_by_plan.d.ts.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.js +46 -22
- package/build/screens/conversation_new/components/filter_by_plan.js.map +1 -1
- package/build/screens/conversation_new/components/form_list.d.ts +3 -2
- package/build/screens/conversation_new/components/form_list.d.ts.map +1 -1
- package/build/screens/conversation_new/components/form_list.js +6 -4
- package/build/screens/conversation_new/components/form_list.js.map +1 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts +2 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts.map +1 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.js +20 -4
- package/build/screens/conversation_new/components/gender_filter_toggle.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts +2 -1
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +30 -4
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts +2 -1
- package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +61 -27
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.d.ts +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.d.ts.map +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.js +3 -2
- package/build/screens/conversation_new/components/source_app_error_card.js.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts +2 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.js +4 -4
- package/build/screens/conversation_new/conversation_new_screen.js.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.d.ts +2 -1
- package/build/screens/conversation_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.js +6 -4
- package/build/screens/conversation_notification_level_select_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +3 -2
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +66 -25
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js +1 -2
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts +2 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js +15 -2
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts +2 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js +14 -2
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js +1 -2
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js +5 -2
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts +2 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js +11 -4
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js +83 -11
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts +2 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +14 -7
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts +2 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +18 -15
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_type_screen.d.ts +2 -1
- package/build/screens/conversation_select_type_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_type_screen.js +10 -3
- package/build/screens/conversation_select_type_screen.js.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.d.ts +2 -1
- package/build/screens/conversations/components/chat_group_badge.d.ts.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.js +4 -3
- package/build/screens/conversations/components/chat_group_badge.js.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.d.ts +2 -1
- package/build/screens/conversations/components/list_header_action_button.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.js +5 -3
- package/build/screens/conversations/components/list_header_action_button.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.d.ts +2 -1
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +42 -19
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +2 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +6 -2
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/design_system_screen.d.ts +2 -1
- package/build/screens/design_system_screen.d.ts.map +1 -1
- package/build/screens/design_system_screen.js +558 -35
- package/build/screens/design_system_screen.js.map +1 -1
- package/build/screens/get_help_screen.d.ts +1 -1
- package/build/screens/get_help_screen.d.ts.map +1 -1
- package/build/screens/get_help_screen.js +25 -4
- package/build/screens/get_help_screen.js.map +1 -1
- package/build/screens/group_notification_level_select_screen.d.ts +2 -1
- package/build/screens/group_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/group_notification_level_select_screen.js +4 -2
- package/build/screens/group_notification_level_select_screen.js.map +1 -1
- package/build/screens/group_notification_settings_screen.d.ts +2 -1
- package/build/screens/group_notification_settings_screen.d.ts.map +1 -1
- package/build/screens/group_notification_settings_screen.js +25 -3
- package/build/screens/group_notification_settings_screen.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts +2 -1
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js +28 -12
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/message_report/components/message_preview.d.ts +2 -1
- package/build/screens/message_report/components/message_preview.d.ts.map +1 -1
- package/build/screens/message_report/components/message_preview.js +22 -2
- package/build/screens/message_report/components/message_preview.js.map +1 -1
- package/build/screens/message_report/components/report_reason_list.d.ts +2 -1
- package/build/screens/message_report/components/report_reason_list.d.ts.map +1 -1
- package/build/screens/message_report/components/report_reason_list.js +13 -4
- package/build/screens/message_report/components/report_reason_list.js.map +1 -1
- package/build/screens/message_report_screen.d.ts +2 -1
- package/build/screens/message_report_screen.d.ts.map +1 -1
- package/build/screens/message_report_screen.js +61 -9
- package/build/screens/message_report_screen.js.map +1 -1
- package/build/screens/not_found.d.ts +2 -1
- package/build/screens/not_found.d.ts.map +1 -1
- package/build/screens/not_found.js +5 -2
- package/build/screens/not_found.js.map +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts.map +1 -1
- package/build/screens/notification_settings_screen.d.ts +2 -1
- package/build/screens/notification_settings_screen.d.ts.map +1 -1
- package/build/screens/notification_settings_screen.js +66 -28
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/preferred_app_selection_screen.d.ts +2 -1
- package/build/screens/preferred_app_selection_screen.d.ts.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +21 -3
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/build/screens/reactions_screen.d.ts +2 -1
- package/build/screens/reactions_screen.d.ts.map +1 -1
- package/build/screens/reactions_screen.js +19 -7
- package/build/screens/reactions_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.d.ts +2 -1
- package/build/screens/send_giphy_screen.d.ts.map +1 -1
- package/build/screens/send_giphy_screen.js +31 -5
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/build/screens/settings_screen.d.ts +2 -1
- package/build/screens/settings_screen.d.ts.map +1 -1
- package/build/screens/settings_screen.js +26 -4
- package/build/screens/settings_screen.js.map +1 -1
- package/build/screens/system_message_people_screen.d.ts +2 -1
- package/build/screens/system_message_people_screen.d.ts.map +1 -1
- package/build/screens/system_message_people_screen.js +10 -4
- package/build/screens/system_message_people_screen.js.map +1 -1
- package/build/screens/team_conversation_screen.d.ts +1 -1
- package/build/screens/team_conversation_screen.d.ts.map +1 -1
- package/build/screens/team_conversation_screen.js +12 -4
- package/build/screens/team_conversation_screen.js.map +1 -1
- package/build/types/resources/conversation.d.ts +10 -1
- package/build/types/resources/conversation.d.ts.map +1 -1
- package/build/types/resources/conversation.js.map +1 -1
- package/build/utils/client/client.d.ts.map +1 -1
- package/build/utils/client/client.js +2 -1
- package/build/utils/client/client.js.map +1 -1
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +2 -0
- package/build/utils/request/conversation.js.map +1 -1
- package/build/utils/response_error.d.ts +1 -0
- package/build/utils/response_error.d.ts.map +1 -1
- package/build/utils/response_error.js +20 -1
- package/build/utils/response_error.js.map +1 -1
- package/build/utils/sha_256.js.map +1 -1
- package/build/utils/system_messages.d.ts +1 -1
- package/build/utils/system_messages.d.ts.map +1 -1
- package/build/utils/system_messages.js.map +1 -1
- package/build/utils/theme.d.ts +2 -2
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js.map +1 -1
- package/package.json +12 -12
- package/src/__tests__/hooks/use_attachment_uploader.test.tsx +0 -1
- package/src/__tests__/hooks/use_font_scale.test.ts +3 -7
- package/src/__tests__/utils/native_adapters/configuration.ts +1 -1
- package/src/__tests__/utils/system_messages.ts +1 -1
- package/src/__tests__/utils/uri.ts +50 -8
- package/src/__utils__/handlers.ts +6 -5
- package/src/components/conversation/attachments/attachment_deleting_overlay.tsx +3 -10
- package/src/components/conversations/conversation_preview.tsx +58 -23
- package/src/components/conversations/unread_count_badge.tsx +13 -4
- package/src/components/page/__tests__/component_error_boundary.test.tsx +1 -1
- package/src/components/page/__tests__/error_boundary.test.tsx +2 -6
- package/src/components/page/__tests__/page_error_boundary.test.tsx +1 -1
- package/src/hooks/use_conversation.ts +2 -0
- package/src/hooks/use_conversation_jolt_events.ts +3 -19
- package/src/hooks/use_conversation_messages.ts +5 -6
- package/src/hooks/use_conversations_actions.ts +3 -1
- package/src/hooks/use_mark_latest_message_read.ts +3 -4
- package/src/hooks/use_suspense_api.ts +1 -9
- package/src/index.tsx +1 -2
- package/src/polyfills/events/EventTarget.ts +1 -1
- package/src/screens/conversation_screen.tsx +2 -4
- package/src/screens/conversations/components/list_header_component.tsx +6 -6
- package/src/types/resources/conversation.ts +11 -1
- package/src/utils/__tests__/response_error.test.ts +47 -0
- package/src/utils/client/client.ts +2 -1
- package/src/utils/request/conversation.ts +2 -0
- package/src/utils/response_error.ts +23 -1
- package/src/utils/sha_256.ts +24 -24
- package/src/utils/system_messages.ts +1 -1
- package/src/utils/theme.ts +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team_conversation_screen.js","sourceRoot":"","sources":["../../src/screens/team_conversation_screen.tsx"],"names":[],"mappings":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6B,EAAE,UAAU,CAAC,OAAO,CACrE;QAAA,CAAC,UAAU,CAAC,IAAI,CACd;UAAA,CAAC,MAAM,IAAI,wDAAwD,CACrE;QAAA,EAAE,UAAU,CAAC,IAAI,CACnB;MAAA,EAAE,UAAU,CAAC,OAAO,CACpB;MAAA,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAC1F;IAAA,EAAE,UAAU,CAAC,IAAI,CAAC,CACnB,CAAA;AACH,CAAC","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport { DefaultLoading } from '../components/page/loading'\nimport BlankState from '../components/primitive/blank_state_primitive'\nimport { useApiClient } from '../hooks'\nimport { findOrCreateServicesConversation } from '../hooks/services/use_find_or_create_services_conversation'\nimport { ResponseError } from '../utils/response_error'\n\nexport type TeamConversationRouteProps = {\n plan_id?: number\n team_ids?: number[]\n}\n\nexport type TeamConversationScreenProps = StaticScreenProps<TeamConversationRouteProps>\n\nexport const TeamConversationScreen = ({ route }: TeamConversationScreenProps) => {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const navigation = useNavigation()\n const {\n data: conversation,\n isError,\n error,\n } = useQuery({\n queryKey: ['team-conversation', route.params.team_ids, route.params.plan_id],\n queryFn: () =>\n findOrCreateServicesConversation({\n apiClient,\n teamIds: route.params.team_ids ?? [],\n planId: route.params.plan_id,\n }).then(r => r.conversation),\n retry: (failureCount, err) => !(err instanceof ResponseError) && failureCount < 3,\n })\n\n useEffect(() => {\n if (!conversation?.id) return\n\n navigation.dispatch(\n StackActions.replace('Conversation', {\n conversation_id: conversation.id,\n title: conversation.title,\n })\n )\n\n return () => {\n queryClient.removeQueries({ queryKey: ['team-conversation'] })\n }\n }, [conversation?.id, conversation?.title, navigation, queryClient])\n\n if (isError) return <TeamConversationError error={error} onGoBack={navigation.goBack} />\n\n return <DefaultLoading />\n}\n\nfunction TeamConversationError({ error, onGoBack }: { error: Error; onGoBack: () => void }) {\n const detail =\n error instanceof ResponseError\n ? error.errors\n .map(e => e.detail)\n .filter(Boolean)\n .join('\\n')\n : ''\n\n return (\n <BlankState.Root>\n <BlankState.Imagery name=\"people.noTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>Can't start this conversation</BlankState.Heading>\n <BlankState.Text>\n {detail || 'Something went wrong while starting this conversation.'}\n </BlankState.Text>\n </BlankState.Content>\n <BlankState.Button title=\"Go back\" onPress={onGoBack} size=\"md\" accessibilityRole=\"link\" />\n </BlankState.Root>\n )\n}\n"]}
|
|
@@ -3,13 +3,22 @@ import { ConversationBadgeResource } from './conversation_badge';
|
|
|
3
3
|
import { ConversationMembershipResource } from './conversation_membership';
|
|
4
4
|
import { GroupResource } from './group_resource';
|
|
5
5
|
import { MemberAbilityResource } from './member_ability';
|
|
6
|
+
import { ReactionCountResource } from './reaction';
|
|
6
7
|
export type ConversationDisabledReason = 'safety_check' | 'direct_messages_disabled';
|
|
8
|
+
export interface ConversationPreviewData {
|
|
9
|
+
kind: 'reaction' | 'message';
|
|
10
|
+
authorName: string;
|
|
11
|
+
value: ReactionCountResource['value'] | null;
|
|
12
|
+
text: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
}
|
|
7
15
|
export interface ConversationResource {
|
|
8
16
|
type: 'Conversation';
|
|
9
17
|
id: number;
|
|
10
18
|
badges?: ConversationBadgeResource[];
|
|
11
19
|
analyticsMetadata?: AnalyticsMetadataResource;
|
|
12
20
|
conversationMembership?: Partial<ConversationMembershipResource>;
|
|
21
|
+
conversationPreview: ConversationPreviewData | null;
|
|
13
22
|
createdAt: string;
|
|
14
23
|
deleted?: boolean;
|
|
15
24
|
directMessage?: boolean;
|
|
@@ -32,7 +41,7 @@ export interface ConversationResource {
|
|
|
32
41
|
repliesDisabled: boolean;
|
|
33
42
|
title: string;
|
|
34
43
|
unreadCount: number;
|
|
35
|
-
|
|
44
|
+
unreadReaction: boolean;
|
|
36
45
|
updatedAt: string;
|
|
37
46
|
}
|
|
38
47
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAElD,MAAM,MAAM,0BAA0B,GAAG,cAAc,GAAG,0BAA0B,CAAA;AAEpF,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,qBAAqB,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;IAC5C,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB;AA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ClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnalyticsMetadataResource } from './analytics_metadata'\nimport { ConversationBadgeResource } from './conversation_badge'\nimport { ConversationMembershipResource } from './conversation_membership'\nimport { GroupResource } from './group_resource'\nimport { MemberAbilityResource } from './member_ability'\n\nexport type ConversationDisabledReason = 'safety_check' | 'direct_messages_disabled'\n\nexport interface ConversationResource {\n type: 'Conversation'\n id: number\n badges?: ConversationBadgeResource[]\n analyticsMetadata?: AnalyticsMetadataResource\n conversationMembership?: Partial<ConversationMembershipResource>\n createdAt: string\n deleted?: boolean\n directMessage?: boolean\n disabled?: boolean\n disabledReason?: ConversationDisabledReason\n genderOption?: string | null\n groups?: GroupResource[]\n previewAvatarUrls?: string[]\n customAvatarType?: 'image' | 'icon' | 'emoji' | null\n customAvatarKey?: string | null\n customAvatarColor?: string | null\n customAvatarImageUrl?: string | null\n lastMessageAuthorId?: string\n lastMessageAuthorName?: string\n lastMessageCreatedAt?: string\n lastMessageTextPreview?: string\n latestReadMessageSortKey?: string\n memberAbility?: MemberAbilityResource\n muted: boolean\n repliesDisabled: boolean\n title: string\n unreadCount: number\n
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnalyticsMetadataResource } from './analytics_metadata'\nimport { ConversationBadgeResource } from './conversation_badge'\nimport { ConversationMembershipResource } from './conversation_membership'\nimport { GroupResource } from './group_resource'\nimport { MemberAbilityResource } from './member_ability'\nimport { ReactionCountResource } from './reaction'\n\nexport type ConversationDisabledReason = 'safety_check' | 'direct_messages_disabled'\n\nexport interface ConversationPreviewData {\n kind: 'reaction' | 'message'\n authorName: string\n value: ReactionCountResource['value'] | null\n text: string\n createdAt: string\n}\n\nexport interface ConversationResource {\n type: 'Conversation'\n id: number\n badges?: ConversationBadgeResource[]\n analyticsMetadata?: AnalyticsMetadataResource\n conversationMembership?: Partial<ConversationMembershipResource>\n conversationPreview: ConversationPreviewData | null\n createdAt: string\n deleted?: boolean\n directMessage?: boolean\n disabled?: boolean\n disabledReason?: ConversationDisabledReason\n genderOption?: string | null\n groups?: GroupResource[]\n previewAvatarUrls?: string[]\n customAvatarType?: 'image' | 'icon' | 'emoji' | null\n customAvatarKey?: string | null\n customAvatarColor?: string | null\n customAvatarImageUrl?: string | null\n lastMessageAuthorId?: string\n lastMessageAuthorName?: string\n lastMessageCreatedAt?: string\n lastMessageTextPreview?: string\n latestReadMessageSortKey?: string\n memberAbility?: MemberAbilityResource\n muted: boolean\n repliesDisabled: boolean\n title: string\n unreadCount: number\n unreadReaction: boolean\n updatedAt: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/utils/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/utils/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAUxE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAe,MAAM,SAAS,CAAA;AAE3F,MAAM,MAAM,sBAAsB,GAAG,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAA;AAExE,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,qBAAa,MAAM;IACjB,OAAO,EAAE,MAAM,CAAK;IACpB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAK;IAC3C,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAA;gBAED,EAAE,OAAO,EAAE,cAAmB,EAAE,sBAAsB,EAAE,IAAI,EAAE,EAAE,UAAU;IAOhF,GAAG,CAAC,CAAC,SAAS,aAAa,GAAG,WAAW,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC;IA2CxE,KAAK,CAAC,CAAC,SAAS,aAAa,GAAG,WAAW,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC;IAW5E,IAAI,CAAC,CAAC,SAAS,aAAa,GAAG,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAW1E,MAAM,CAAC,IAAI,EAAE,aAAa;IAShC,WAAW,GAAU,UAAU,QAAQ,GAAG,KAAK,oBAY9C;IAED,kBAAkB,GAAU,UAAU,QAAQ,KAAG,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAMhF;IAED,MAAM,CAAC,GAAG,EAAE,MAAM;IAIlB,IAAI,OAAO;;;;MAOV;CACF;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isResponseLike } from '../response_error';
|
|
1
2
|
import { concatRecords, ensureNoQueryParamsInDev, makeRequest, throwErrorIfFieldsMissing, throwErrorIfQueryParams, } from './request_helpers';
|
|
2
3
|
export class Client {
|
|
3
4
|
version = '';
|
|
@@ -65,7 +66,7 @@ export class Client {
|
|
|
65
66
|
return makeRequest(requestArgs).catch(this.handleNotOk);
|
|
66
67
|
}
|
|
67
68
|
handleNotOk = async (response) => {
|
|
68
|
-
if (!(response
|
|
69
|
+
if (!isResponseLike(response))
|
|
69
70
|
return Promise.reject(response);
|
|
70
71
|
const errorData = await this.parseErrorResponse(response);
|
|
71
72
|
const notOkResponse = response.clone();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/utils/client/client.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,WAAW,EAEX,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,mBAAmB,CAAA;AAY1B,MAAM,OAAO,MAAM;IACjB,OAAO,GAAW,EAAE,CAAA;IACpB,cAAc,GAA2B,EAAE,CAAA;IAC3C,sBAAsB,CAAyB;IAC/C,IAAI,CAAS;IAEb,YAAY,EAAE,OAAO,EAAE,cAAc,GAAG,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAc;QACpF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAA;QACpD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,GAAG,CAAwC,IAAgB;QAC/D,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAA;QACnC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;QAC/B,MAAM,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;QACpD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEjC,MAAM,uBAAuB,CAAC,GAAG,CAAC,CAAA;QAElC,MAAM,WAAW,GAAoB,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;QAE1E,MAAM,WAAW,GAAG,CAAC,EACnB,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,EACxB,GAAG,GA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CAAC;IAED,IAAI,OAAO;QACT,OAAO;YACL,MAAM,EAAE,0BAA0B;YAClC,cAAc,EAAE,kBAAkB;YAClC,mBAAmB,EAAE,IAAI,CAAC,OAAO;YACjC,GAAG,IAAI,CAAC,cAAc;SACvB,CAAA;IACH,CAAC;CACF;AAED,eAAe,MAAM,CAAA","sourcesContent":["import { ApiCollection, ApiResource, FailedResponse } from '../../types'\nimport { isResponseLike } from '../response_error'\nimport {\n concatRecords,\n ensureNoQueryParamsInDev,\n makeRequest,\n MakeRequestArgs,\n throwErrorIfFieldsMissing,\n throwErrorIfQueryParams,\n} from './request_helpers'\nimport { DeleteRequest, GetRequest, PatchRequest, PostRequest, WalkRequest } from './types'\n\nexport type OnUnauthorizedResponse = (_response: FailedResponse) => void\n\ntype ClientArgs = {\n version: string\n defaultHeaders?: Record<string, string>\n onUnauthorizedResponse?: OnUnauthorizedResponse\n root?: string\n}\n\nexport class Client {\n version: string = ''\n defaultHeaders: Record<string, string> = {}\n onUnauthorizedResponse?: OnUnauthorizedResponse\n root?: string\n\n constructor({ version, defaultHeaders = {}, onUnauthorizedResponse, root }: ClientArgs) {\n this.version = version\n this.defaultHeaders = defaultHeaders\n this.onUnauthorizedResponse = onUnauthorizedResponse\n this.root = root\n }\n\n async get<T extends ApiCollection | ApiResource>(args: GetRequest): Promise<T> {\n const { walk, ...data } = args.data\n const isWalking = Boolean(walk)\n const headers = { ...this.headers, ...args.headers }\n const url = this.appUrl(args.url)\n\n await throwErrorIfQueryParams(url)\n\n const requestArgs: MakeRequestArgs = { data, url, action: 'GET', headers }\n\n const walkRequest = ({\n url: requestUrl,\n data: d = { fields: {} },\n acc = { data: [], included: [], meta: {}, links: {} },\n ...options\n }: WalkRequest): Promise<T> => {\n return makeRequest({\n action: 'GET',\n data: d,\n url: requestUrl,\n ...options,\n headers,\n }).then(({ links, ...rest }) => {\n const records = Array.isArray(rest.data) ? concatRecords(acc, rest) : rest\n\n // `next` will have our params in the link so we do not want to pass them back in\n if (links?.next) {\n return walkRequest({ ...options, data: d, url: links.next, acc: records })\n } else {\n return records\n }\n })\n }\n\n const handler = isWalking\n ? (a: MakeRequestArgs | WalkRequest) => walkRequest(a as WalkRequest)\n : (a: MakeRequestArgs | WalkRequest) => makeRequest(a as MakeRequestArgs)\n\n return throwErrorIfFieldsMissing(handler, requestArgs)\n .then(response => response as T)\n .catch(this.handleNotOk)\n }\n\n async patch<T extends ApiCollection | ApiResource>(args: PatchRequest): Promise<T> {\n const headers = { ...this.headers, ...args.headers }\n const url = this.appUrl(args.url)\n\n const requestArgs: MakeRequestArgs = { data: args.data, url, action: 'PATCH', headers }\n\n return ensureNoQueryParamsInDev(makeRequest, requestArgs)\n .then(response => response as T)\n .catch(this.handleNotOk)\n }\n\n async post<T extends ApiCollection | ApiResource>(args: PostRequest): Promise<T> {\n const headers = { ...this.headers, ...args.headers }\n const url = this.appUrl(args.url)\n\n const requestArgs: MakeRequestArgs = { ...args, data: args.data, url, action: 'POST', headers }\n\n return ensureNoQueryParamsInDev(makeRequest, requestArgs)\n .then(response => response as T)\n .catch(this.handleNotOk)\n }\n\n async delete(args: DeleteRequest) {\n const headers = { ...this.headers, ...args.headers }\n const url = this.appUrl(args.url)\n\n const requestArgs: MakeRequestArgs = { url, action: 'DELETE', headers }\n\n return makeRequest(requestArgs).catch(this.handleNotOk)\n }\n\n handleNotOk = async (response: Response | Error) => {\n if (!isResponseLike(response)) return Promise.reject(response)\n\n const errorData = await this.parseErrorResponse(response)\n const notOkResponse = response.clone() as FailedResponse\n notOkResponse.errors = errorData.errors || []\n\n if (response.status === 401) {\n this.onUnauthorizedResponse?.(notOkResponse)\n }\n\n return Promise.reject(notOkResponse)\n }\n\n parseErrorResponse = async (response: Response): Promise<Partial<FailedResponse>> => {\n try {\n return (await response.clone().json()) as FailedResponse\n } catch {\n return {}\n }\n }\n\n appUrl(url: string) {\n return `${this.root}${url}`\n }\n\n get headers() {\n return {\n Accept: 'application/vnd.api+json',\n 'Content-Type': 'application/json',\n 'X-PCO-API-Version': this.version,\n ...this.defaultHeaders,\n }\n }\n}\n\nexport default Client\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/utils/request/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,eAAO,MAAM,2BAA2B,GAAI,8EAKzC,OAAO,CAAC,uBAAuB,CAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/utils/request/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,eAAO,MAAM,2BAA2B,GAAI,8EAKzC,OAAO,CAAC,uBAAuB,CAAM,KAAG,UAoD1C,CAAA"}
|
|
@@ -25,6 +25,7 @@ export const getConversationsRequestArgs = ({ gids, chat_group_graph_id, group_s
|
|
|
25
25
|
Conversation: [
|
|
26
26
|
'created_at',
|
|
27
27
|
'badges',
|
|
28
|
+
'conversation_preview',
|
|
28
29
|
'disabled',
|
|
29
30
|
'disabled_reason',
|
|
30
31
|
'groups',
|
|
@@ -42,6 +43,7 @@ export const getConversationsRequestArgs = ({ gids, chat_group_graph_id, group_s
|
|
|
42
43
|
'replies_disabled',
|
|
43
44
|
'title',
|
|
44
45
|
'unread_count',
|
|
46
|
+
'unread_reaction',
|
|
45
47
|
'updated_at',
|
|
46
48
|
],
|
|
47
49
|
AnalyticsMetadata: ['metadata'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/utils/request/conversation.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAC1C,IAAI,EACJ,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,MACgB,EAAE,EAAc,EAAE;IACtD,IAAI,MAAc,CAAA;IAClB,IAAI,mBAAmB,EAAE,CAAC;QACxB,MAAM,GAAG,yBAAyB,CAAA;IACpC,CAAC;SAAM,IAAI,oBAAoB,EAAE,CAAC;QAChC,MAAM,GAAG,kCAAkC,CAAA;IAC7C,CAAC;SAAM,IAAI,qBAAqB,EAAE,CAAC;QACjC,MAAM,GAAG,yCAAyC,CAAA;IACpD,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,mBAAmB,CAAA;IAC9B,CAAC;IAED,OAAO;QACL,GAAG,EAAE,mBAAmB;QACxB,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,MAAM;YACN,IAAI;YACJ,KAAK,EAAE,mBAAmB;YAC1B,qBAAqB;YACrB,MAAM,EAAE;gBACN,YAAY,EAAE;oBACZ,YAAY;oBACZ,QAAQ;oBACR,UAAU;oBACV,iBAAiB;oBACjB,QAAQ;oBACR,wBAAwB;oBACxB,0BAA0B;oBAC1B,yBAAyB;oBACzB,2BAA2B;oBAC3B,qBAAqB;oBACrB,oBAAoB;oBACpB,mBAAmB;oBACnB,qBAAqB;oBACrB,yBAAyB;oBACzB,gBAAgB;oBAChB,OAAO;oBACP,kBAAkB;oBAClB,OAAO;oBACP,cAAc;oBACd,YAAY;iBACb;gBACD,iBAAiB,EAAE,CAAC,UAAU,CAAC;gBAC/B,iBAAiB,EAAE,CAAC,UAAU,EAAE,mBAAmB,EAAE,MAAM,CAAC;aAC7D;YACD,OAAO,EAAE,CAAC,QAAQ,EAAE,oBAAoB,CAAC;SAC1C;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { GraphId } from '../../types/resources/group_resource'\nimport { GetRequest } from '../client/types'\n\nexport interface ConversationRequestArgs {\n gids: string\n chat_group_graph_id?: GraphId\n group_source_app_name?: string\n show_direct_messages?: boolean\n}\n\nexport const getConversationsRequestArgs = ({\n gids,\n chat_group_graph_id,\n group_source_app_name,\n show_direct_messages,\n}: Partial<ConversationRequestArgs> = {}): GetRequest => {\n let filter: string\n if (chat_group_graph_id) {\n filter = 'mine_or_not_empty,group'\n } else if (show_direct_messages) {\n filter = 'mine_or_not_empty,direct_message'\n } else if (group_source_app_name) {\n filter = 'mine_or_not_empty,group_source_app_name'\n } else {\n filter = 'mine_or_not_empty'\n }\n\n return {\n url: '/me/conversations',\n data: {\n perPage: 20,\n order: '-last_message',\n filter,\n gids,\n group: chat_group_graph_id,\n group_source_app_name,\n fields: {\n Conversation: [\n 'created_at',\n 'badges',\n 'disabled',\n 'disabled_reason',\n 'groups',\n 'last_message_author_id',\n 'last_message_author_name',\n 'last_message_created_at',\n 'last_message_text_preview',\n 'preview_avatar_urls',\n 'custom_avatar_type',\n 'custom_avatar_key',\n 'custom_avatar_color',\n 'custom_avatar_image_url',\n 'member_ability',\n 'muted',\n 'replies_disabled',\n 'title',\n 'unread_count',\n 'updated_at',\n ],\n AnalyticsMetadata: ['metadata'],\n ConversationBadge: ['app_name', 'pco_resource_type', 'text'],\n },\n include: ['badges', 'analytics_metadata'],\n },\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/utils/request/conversation.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAC1C,IAAI,EACJ,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,MACgB,EAAE,EAAc,EAAE;IACtD,IAAI,MAAc,CAAA;IAClB,IAAI,mBAAmB,EAAE,CAAC;QACxB,MAAM,GAAG,yBAAyB,CAAA;IACpC,CAAC;SAAM,IAAI,oBAAoB,EAAE,CAAC;QAChC,MAAM,GAAG,kCAAkC,CAAA;IAC7C,CAAC;SAAM,IAAI,qBAAqB,EAAE,CAAC;QACjC,MAAM,GAAG,yCAAyC,CAAA;IACpD,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,mBAAmB,CAAA;IAC9B,CAAC;IAED,OAAO;QACL,GAAG,EAAE,mBAAmB;QACxB,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,MAAM;YACN,IAAI;YACJ,KAAK,EAAE,mBAAmB;YAC1B,qBAAqB;YACrB,MAAM,EAAE;gBACN,YAAY,EAAE;oBACZ,YAAY;oBACZ,QAAQ;oBACR,sBAAsB;oBACtB,UAAU;oBACV,iBAAiB;oBACjB,QAAQ;oBACR,wBAAwB;oBACxB,0BAA0B;oBAC1B,yBAAyB;oBACzB,2BAA2B;oBAC3B,qBAAqB;oBACrB,oBAAoB;oBACpB,mBAAmB;oBACnB,qBAAqB;oBACrB,yBAAyB;oBACzB,gBAAgB;oBAChB,OAAO;oBACP,kBAAkB;oBAClB,OAAO;oBACP,cAAc;oBACd,iBAAiB;oBACjB,YAAY;iBACb;gBACD,iBAAiB,EAAE,CAAC,UAAU,CAAC;gBAC/B,iBAAiB,EAAE,CAAC,UAAU,EAAE,mBAAmB,EAAE,MAAM,CAAC;aAC7D;YACD,OAAO,EAAE,CAAC,QAAQ,EAAE,oBAAoB,CAAC;SAC1C;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { GraphId } from '../../types/resources/group_resource'\nimport { GetRequest } from '../client/types'\n\nexport interface ConversationRequestArgs {\n gids: string\n chat_group_graph_id?: GraphId\n group_source_app_name?: string\n show_direct_messages?: boolean\n}\n\nexport const getConversationsRequestArgs = ({\n gids,\n chat_group_graph_id,\n group_source_app_name,\n show_direct_messages,\n}: Partial<ConversationRequestArgs> = {}): GetRequest => {\n let filter: string\n if (chat_group_graph_id) {\n filter = 'mine_or_not_empty,group'\n } else if (show_direct_messages) {\n filter = 'mine_or_not_empty,direct_message'\n } else if (group_source_app_name) {\n filter = 'mine_or_not_empty,group_source_app_name'\n } else {\n filter = 'mine_or_not_empty'\n }\n\n return {\n url: '/me/conversations',\n data: {\n perPage: 20,\n order: '-last_message',\n filter,\n gids,\n group: chat_group_graph_id,\n group_source_app_name,\n fields: {\n Conversation: [\n 'created_at',\n 'badges',\n 'conversation_preview',\n 'disabled',\n 'disabled_reason',\n 'groups',\n 'last_message_author_id',\n 'last_message_author_name',\n 'last_message_created_at',\n 'last_message_text_preview',\n 'preview_avatar_urls',\n 'custom_avatar_type',\n 'custom_avatar_key',\n 'custom_avatar_color',\n 'custom_avatar_image_url',\n 'member_ability',\n 'muted',\n 'replies_disabled',\n 'title',\n 'unread_count',\n 'unread_reaction',\n 'updated_at',\n ],\n AnalyticsMetadata: ['metadata'],\n ConversationBadge: ['app_name', 'pco_resource_type', 'text'],\n },\n include: ['badges', 'analytics_metadata'],\n },\n }\n}\n"]}
|
|
@@ -6,5 +6,6 @@ export declare class ResponseError extends Error {
|
|
|
6
6
|
response: FailedResponse;
|
|
7
7
|
constructor(response: FailedResponse);
|
|
8
8
|
}
|
|
9
|
+
export declare const isResponseLike: (value: unknown) => value is Response;
|
|
9
10
|
export declare const throwResponseError: (error: unknown) => Promise<never>;
|
|
10
11
|
//# sourceMappingURL=response_error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response_error.d.ts","sourceRoot":"","sources":["../../src/utils/response_error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,qBAAa,aAAc,SAAQ,KAAK;IACtC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IAChC,QAAQ,EAAE,cAAc,CAAA;gBAEZ,QAAQ,EAAE,cAAc;CAQrC;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,mBAMhD,CAAA"}
|
|
1
|
+
{"version":3,"file":"response_error.d.ts","sourceRoot":"","sources":["../../src/utils/response_error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,qBAAa,aAAc,SAAQ,KAAK;IACtC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IAChC,QAAQ,EAAE,cAAc,CAAA;gBAEZ,QAAQ,EAAE,cAAc;CAQrC;AAKD,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,QAiBxD,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,mBAMhD,CAAA"}
|
|
@@ -12,8 +12,27 @@ export class ResponseError extends Error {
|
|
|
12
12
|
this.response = response;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
// Detect a fetch Response by shape, not `instanceof`: Expo's winter runtime
|
|
16
|
+
// swaps in a `fetch` whose `FetchResponse` isn't an instance of the global
|
|
17
|
+
// `Response`, so `instanceof` silently misses it under Expo.
|
|
18
|
+
export const isResponseLike = (value) => {
|
|
19
|
+
if (typeof value !== 'object' || value === null)
|
|
20
|
+
return false;
|
|
21
|
+
const candidate = value;
|
|
22
|
+
return (typeof candidate.status === 'number' &&
|
|
23
|
+
typeof candidate.statusText === 'string' &&
|
|
24
|
+
typeof candidate.ok === 'boolean' &&
|
|
25
|
+
typeof candidate.redirected === 'boolean' &&
|
|
26
|
+
typeof candidate.url === 'string' &&
|
|
27
|
+
typeof candidate.headers === 'object' &&
|
|
28
|
+
candidate.headers !== null &&
|
|
29
|
+
typeof candidate.clone === 'function' &&
|
|
30
|
+
typeof candidate.json === 'function' &&
|
|
31
|
+
typeof candidate.text === 'function' &&
|
|
32
|
+
typeof candidate.arrayBuffer === 'function');
|
|
33
|
+
};
|
|
15
34
|
export const throwResponseError = (error) => {
|
|
16
|
-
if (error
|
|
35
|
+
if (isResponseLike(error)) {
|
|
17
36
|
throw new ResponseError(error);
|
|
18
37
|
}
|
|
19
38
|
return Promise.reject(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response_error.js","sourceRoot":"","sources":["../../src/utils/response_error.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,MAAM,CAAQ;IACd,UAAU,CAAQ;IAClB,MAAM,CAA0B;IAChC,QAAQ,CAAgB;IAExB,YAAY,QAAwB;QAClC,KAAK,CAAC,kBAAkB,QAAQ,EAAE,MAAM,IAAI,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAA;QACnE,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;QAC3B,IAAI,CAAC,MAAM,GAAG,QAAQ,EAAE,MAAM,CAAA;QAC9B,IAAI,CAAC,UAAU,GAAG,QAAQ,EAAE,UAAU,CAAA;QACtC,IAAI,CAAC,MAAM,GAAG,QAAQ,EAAE,MAAM,IAAI,EAAE,CAAA;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAE,EAAE;IACnD,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"response_error.js","sourceRoot":"","sources":["../../src/utils/response_error.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,MAAM,CAAQ;IACd,UAAU,CAAQ;IAClB,MAAM,CAA0B;IAChC,QAAQ,CAAgB;IAExB,YAAY,QAAwB;QAClC,KAAK,CAAC,kBAAkB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CAAC,CAAA;IAClD,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC,CAAA","sourcesContent":["import { FailedResponse } from '../types/api_primitives'\n\nexport class ResponseError extends Error {\n status: number\n statusText: string\n errors: FailedResponse['errors']\n response: FailedResponse\n\n constructor(response: FailedResponse) {\n super(`ResponseError: ${response?.status} ${response?.statusText}`)\n this.name = 'ResponseError'\n this.status = response?.status\n this.statusText = response?.statusText\n this.errors = response?.errors || []\n this.response = response\n }\n}\n\n// Detect a fetch Response by shape, not `instanceof`: Expo's winter runtime\n// swaps in a `fetch` whose `FetchResponse` isn't an instance of the global\n// `Response`, so `instanceof` silently misses it under Expo.\nexport const isResponseLike = (value: unknown): value is Response => {\n if (typeof value !== 'object' || value === null) return false\n\n const candidate = value as Record<string, unknown>\n return (\n typeof candidate.status === 'number' &&\n typeof candidate.statusText === 'string' &&\n typeof candidate.ok === 'boolean' &&\n typeof candidate.redirected === 'boolean' &&\n typeof candidate.url === 'string' &&\n typeof candidate.headers === 'object' &&\n candidate.headers !== null &&\n typeof candidate.clone === 'function' &&\n typeof candidate.json === 'function' &&\n typeof candidate.text === 'function' &&\n typeof candidate.arrayBuffer === 'function'\n )\n}\n\nexport const throwResponseError = (error: unknown) => {\n if (isResponseLike(error)) {\n throw new ResponseError(error as FailedResponse)\n }\n\n return Promise.reject(error)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sha_256.js","sourceRoot":"","sources":["../../src/utils/sha_256.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,+BAA+B;AAE/B,qGAAqG;AACrG,MAAM,CAAC,GAAG;IACR,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAA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AA","sourcesContent":["/**\n * Pure JavaScript SHA-256 implementation\n * Conforms to the crypto-js API for drop-in replacement\n */\n\n/* eslint-disable no-bitwise */\n\n// SHA-256 constants (first 32 bits of the fractional parts of the cube roots of the first 64 primes)\nconst K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,\n]\n\n// Initial hash values (first 32 bits of the fractional parts of the square roots of the first 8 primes)\nconst H = [\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]\n\n/** Right rotate 32-bit integer */\nfunction rotr(n: number, x: number): number {\n return (x >>> n) | (x << (32 - n))\n}\n\n/** SHA-256 choice function */\nfunction ch(x: number, y: number, z: number): number {\n return (x & y) ^ (~x & z)\n}\n\n/** SHA-256 majority function */\nfunction maj(x: number, y: number, z: number): number {\n return (x & y) ^ (x & z) ^ (y & z)\n}\n\n/** SHA-256 Σ0 function */\nfunction sigma0(x: number): number {\n return rotr(2, x) ^ rotr(13, x) ^ rotr(22, x)\n}\n\n/** SHA-256 Σ1 function */\nfunction sigma1(x: number): number {\n return rotr(6, x) ^ rotr(11, x) ^ rotr(25, x)\n}\n\n/** SHA-256 σ0 function */\nfunction gamma0(x: number): number {\n return rotr(7, x) ^ rotr(18, x) ^ (x >>> 3)\n}\n\n/** SHA-256 σ1 function */\nfunction gamma1(x: number): number {\n return rotr(17, x) ^ rotr(19, x) ^ (x >>> 10)\n}\n\n/** Convert string to UTF-8 byte array */\nfunction stringToBytes(str: string): number[] {\n const bytes: number[] = []\n for (let i = 0; i < str.length; i++) {\n let charCode = str.charCodeAt(i)\n if (charCode < 0x80) {\n bytes.push(charCode)\n } else if (charCode < 0x800) {\n bytes.push(0xc0 | (charCode >> 6), 0x80 | (charCode & 0x3f))\n } else if (charCode < 0xd800 || charCode >= 0xe000) {\n bytes.push(0xe0 | (charCode >> 12), 0x80 | ((charCode >> 6) & 0x3f), 0x80 | (charCode & 0x3f))\n } else {\n // Surrogate pair\n i++\n charCode = 0x10000 + (((charCode & 0x3ff) << 10) | (str.charCodeAt(i) & 0x3ff))\n bytes.push(\n 0xf0 | (charCode >> 18),\n 0x80 | ((charCode >> 12) & 0x3f),\n 0x80 | ((charCode >> 6) & 0x3f),\n 0x80 | (charCode & 0x3f)\n )\n }\n }\n return bytes\n}\n\n/** Preprocess message: pad and convert to 512-bit blocks */\nfunction preprocessMessage(message: number[]): Uint32Array {\n const messageLength = message.length\n const bitLength = messageLength * 8\n\n // Append the '1' bit (plus zero padding to make 8 bits)\n message.push(0x80)\n\n // Append zeros until message length ≡ 448 (mod 512)\n // This leaves 64 bits for the length\n while (message.length % 64 !== 56) {\n message.push(0x00)\n }\n\n // Append original message length as 64-bit big-endian integer\n // JavaScript numbers are 53-bit safe, so we split into two 32-bit parts\n const lengthHigh = Math.floor(bitLength / 0x100000000)\n const lengthLow = bitLength >>> 0\n\n for (let i = 24; i >= 0; i -= 8) {\n message.push((lengthHigh >>> i) & 0xff)\n }\n for (let i = 24; i >= 0; i -= 8) {\n message.push((lengthLow >>> i) & 0xff)\n }\n\n // Convert byte array to 32-bit word array\n const words = new Uint32Array(message.length / 4)\n for (let i = 0; i < message.length; i += 4) {\n words[i / 4] =\n (message[i]! << 24) | (message[i + 1]! << 16) | (message[i + 2]! << 8) | message[i + 3]!\n }\n\n return words\n}\n\n/** Process a single 512-bit chunk */\nfunction processChunk(chunk: Uint32Array, hash: number[]): void {\n const W = new Uint32Array(64)\n\n // Prepare message schedule\n for (let t = 0; t < 16; t++) {\n W[t] = chunk[t]!\n }\n for (let t = 16; t < 64; t++) {\n W[t] = (gamma1(W[t - 2]!) + W[t - 7]! + gamma0(W[t - 15]!) + W[t - 16]!) >>> 0\n }\n\n // Initialize working variables\n let a = hash[0]!\n let b = hash[1]!\n let c = hash[2]!\n let d = hash[3]!\n let e = hash[4]!\n let f = hash[5]!\n let g = hash[6]!\n let h = hash[7]!\n\n // Main loop\n for (let t = 0; t < 64; t++) {\n const T1 = (h + sigma1(e) + ch(e, f, g) + K[t]! + W[t]!) >>> 0\n const T2 = (sigma0(a) + maj(a, b, c)) >>> 0\n h = g\n g = f\n f = e\n e = (d + T1) >>> 0\n d = c\n c = b\n b = a\n a = (T1 + T2) >>> 0\n }\n\n // Add compressed chunk to current hash value\n hash[0] = (hash[0]! + a) >>> 0\n hash[1] = (hash[1]! + b) >>> 0\n hash[2] = (hash[2]! + c) >>> 0\n hash[3] = (hash[3]! + d) >>> 0\n hash[4] = (hash[4]! + e) >>> 0\n hash[5] = (hash[5]! + f) >>> 0\n hash[6] = (hash[6]! + g) >>> 0\n hash[7] = (hash[7]! + h) >>> 0\n}\n\n/** Compute SHA-256 hash and return as byte array */\nfunction sha256Raw(message: string): number[] {\n const bytes = stringToBytes(message)\n const preprocessed = preprocessMessage(bytes)\n const hash = [...H] // Copy initial hash values\n\n // Process each 512-bit chunk\n for (let i = 0; i < preprocessed.length; i += 16) {\n const chunk = preprocessed.subarray(i, i + 16)\n processChunk(chunk, hash)\n }\n\n // Convert hash to byte array\n const result: number[] = []\n for (let i = 0; i < 8; i++) {\n result.push((hash[i]! >>> 24) & 0xff)\n result.push((hash[i]! >>> 16) & 0xff)\n result.push((hash[i]! >>> 8) & 0xff)\n result.push(hash[i]! & 0xff)\n }\n\n return result\n}\n\n/** Hash result object with toString methods */\nclass HashResult {\n private bytes: number[]\n\n constructor(bytes: number[]) {\n this.bytes = bytes\n }\n\n /** Convert hash to hexadecimal string */\n toString(encoding?: { stringify: (bytes: number[]) => string }): string {\n if (encoding === Hex) {\n return this.bytes.map(b => b.toString(16).padStart(2, '0')).join('')\n }\n // Default to hex if no encoding specified\n return this.bytes.map(b => b.toString(16).padStart(2, '0')).join('')\n }\n}\n\n/** Hex encoding object (mimics crypto-js enc.Hex) */\nexport const Hex = {\n stringify: (bytes: number[]) => bytes.map(b => b.toString(16).padStart(2, '0')).join(''),\n}\n\n/**\n * Compute SHA-256 hash of a string\n * @param message - The message to hash\n * @returns HashResult object with toString method\n */\nexport function SHA256(message: string): HashResult {\n const hash = sha256Raw(message)\n return new HashResult(hash)\n}\n\n/** Encoding utilities (mimics crypto-js enc) */\nexport const enc = {\n Hex,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sha_256.js","sourceRoot":"","sources":["../../src/utils/sha_256.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,+BAA+B;AAE/B,qGAAqG;AACrG,MAAM,CAAC,GAAG;IACR,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EA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in replacement\n */\n\n/* eslint-disable no-bitwise */\n\n// SHA-256 constants (first 32 bits of the fractional parts of the cube roots of the first 64 primes)\nconst K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,\n]\n\n// Initial hash values (first 32 bits of the fractional parts of the square roots of the first 8 primes)\nconst H = [\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]\n\n/** Right rotate 32-bit integer */\nfunction rotr(n: number, x: number): number {\n return (x >>> n) | (x << (32 - n))\n}\n\n/** SHA-256 choice function */\nfunction ch(x: number, y: number, z: number): number {\n return (x & y) ^ (~x & z)\n}\n\n/** SHA-256 majority function */\nfunction maj(x: number, y: number, z: number): number {\n return (x & y) ^ (x & z) ^ (y & z)\n}\n\n/** SHA-256 Σ0 function */\nfunction sigma0(x: number): number {\n return rotr(2, x) ^ rotr(13, x) ^ rotr(22, x)\n}\n\n/** SHA-256 Σ1 function */\nfunction sigma1(x: number): number {\n return rotr(6, x) ^ rotr(11, x) ^ rotr(25, x)\n}\n\n/** SHA-256 σ0 function */\nfunction gamma0(x: number): number {\n return rotr(7, x) ^ rotr(18, x) ^ (x >>> 3)\n}\n\n/** SHA-256 σ1 function */\nfunction gamma1(x: number): number {\n return rotr(17, x) ^ rotr(19, x) ^ (x >>> 10)\n}\n\n/** Convert string to UTF-8 byte array */\nfunction stringToBytes(str: string): number[] {\n const bytes: number[] = []\n for (let i = 0; i < str.length; i++) {\n let charCode = str.charCodeAt(i)\n if (charCode < 0x80) {\n bytes.push(charCode)\n } else if (charCode < 0x800) {\n bytes.push(0xc0 | (charCode >> 6), 0x80 | (charCode & 0x3f))\n } else if (charCode < 0xd800 || charCode >= 0xe000) {\n bytes.push(0xe0 | (charCode >> 12), 0x80 | ((charCode >> 6) & 0x3f), 0x80 | (charCode & 0x3f))\n } else {\n // Surrogate pair\n i++\n charCode = 0x10000 + (((charCode & 0x3ff) << 10) | (str.charCodeAt(i) & 0x3ff))\n bytes.push(\n 0xf0 | (charCode >> 18),\n 0x80 | ((charCode >> 12) & 0x3f),\n 0x80 | ((charCode >> 6) & 0x3f),\n 0x80 | (charCode & 0x3f)\n )\n }\n }\n return bytes\n}\n\n/** Preprocess message: pad and convert to 512-bit blocks */\nfunction preprocessMessage(message: number[]): Uint32Array {\n const messageLength = message.length\n const bitLength = messageLength * 8\n\n // Append the '1' bit (plus zero padding to make 8 bits)\n message.push(0x80)\n\n // Append zeros until message length ≡ 448 (mod 512)\n // This leaves 64 bits for the length\n while (message.length % 64 !== 56) {\n message.push(0x00)\n }\n\n // Append original message length as 64-bit big-endian integer\n // JavaScript numbers are 53-bit safe, so we split into two 32-bit parts\n const lengthHigh = Math.floor(bitLength / 0x100000000)\n const lengthLow = bitLength >>> 0\n\n for (let i = 24; i >= 0; i -= 8) {\n message.push((lengthHigh >>> i) & 0xff)\n }\n for (let i = 24; i >= 0; i -= 8) {\n message.push((lengthLow >>> i) & 0xff)\n }\n\n // Convert byte array to 32-bit word array\n const words = new Uint32Array(message.length / 4)\n for (let i = 0; i < message.length; i += 4) {\n words[i / 4] =\n (message[i] << 24) | (message[i + 1] << 16) | (message[i + 2] << 8) | message[i + 3]\n }\n\n return words\n}\n\n/** Process a single 512-bit chunk */\nfunction processChunk(chunk: Uint32Array, hash: number[]): void {\n const W = new Uint32Array(64)\n\n // Prepare message schedule\n for (let t = 0; t < 16; t++) {\n W[t] = chunk[t]\n }\n for (let t = 16; t < 64; t++) {\n W[t] = (gamma1(W[t - 2]) + W[t - 7] + gamma0(W[t - 15]) + W[t - 16]) >>> 0\n }\n\n // Initialize working variables\n let a = hash[0]\n let b = hash[1]\n let c = hash[2]\n let d = hash[3]\n let e = hash[4]\n let f = hash[5]\n let g = hash[6]\n let h = hash[7]\n\n // Main loop\n for (let t = 0; t < 64; t++) {\n const T1 = (h + sigma1(e) + ch(e, f, g) + K[t] + W[t]) >>> 0\n const T2 = (sigma0(a) + maj(a, b, c)) >>> 0\n h = g\n g = f\n f = e\n e = (d + T1) >>> 0\n d = c\n c = b\n b = a\n a = (T1 + T2) >>> 0\n }\n\n // Add compressed chunk to current hash value\n hash[0] = (hash[0] + a) >>> 0\n hash[1] = (hash[1] + b) >>> 0\n hash[2] = (hash[2] + c) >>> 0\n hash[3] = (hash[3] + d) >>> 0\n hash[4] = (hash[4] + e) >>> 0\n hash[5] = (hash[5] + f) >>> 0\n hash[6] = (hash[6] + g) >>> 0\n hash[7] = (hash[7] + h) >>> 0\n}\n\n/** Compute SHA-256 hash and return as byte array */\nfunction sha256Raw(message: string): number[] {\n const bytes = stringToBytes(message)\n const preprocessed = preprocessMessage(bytes)\n const hash = [...H] // Copy initial hash values\n\n // Process each 512-bit chunk\n for (let i = 0; i < preprocessed.length; i += 16) {\n const chunk = preprocessed.subarray(i, i + 16)\n processChunk(chunk, hash)\n }\n\n // Convert hash to byte array\n const result: number[] = []\n for (let i = 0; i < 8; i++) {\n result.push((hash[i] >>> 24) & 0xff)\n result.push((hash[i] >>> 16) & 0xff)\n result.push((hash[i] >>> 8) & 0xff)\n result.push(hash[i] & 0xff)\n }\n\n return result\n}\n\n/** Hash result object with toString methods */\nclass HashResult {\n private bytes: number[]\n\n constructor(bytes: number[]) {\n this.bytes = bytes\n }\n\n /** Convert hash to hexadecimal string */\n toString(encoding?: { stringify: (bytes: number[]) => string }): string {\n if (encoding === Hex) {\n return this.bytes.map(b => b.toString(16).padStart(2, '0')).join('')\n }\n // Default to hex if no encoding specified\n return this.bytes.map(b => b.toString(16).padStart(2, '0')).join('')\n }\n}\n\n/** Hex encoding object (mimics crypto-js enc.Hex) */\nexport const Hex = {\n stringify: (bytes: number[]) => bytes.map(b => b.toString(16).padStart(2, '0')).join(''),\n}\n\n/**\n * Compute SHA-256 hash of a string\n * @param message - The message to hash\n * @returns HashResult object with toString method\n */\nexport function SHA256(message: string): HashResult {\n const hash = sha256Raw(message)\n return new HashResult(hash)\n}\n\n/** Encoding utilities (mimics crypto-js enc) */\nexport const enc = {\n Hex,\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { MessageResource } from '../types';
|
|
2
2
|
declare const SYSTEM_MESSAGE_TYPES: readonly ["user_joined"];
|
|
3
3
|
type SystemMessageType = (typeof SYSTEM_MESSAGE_TYPES)[number];
|
|
4
4
|
export interface SystemMessageResource extends MessageResource {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system_messages.d.ts","sourceRoot":"","sources":["../../src/utils/system_messages.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"system_messages.d.ts","sourceRoot":"","sources":["../../src/utils/system_messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,QAAA,MAAM,oBAAoB,0BAA2B,CAAA;AAErD,KAAK,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9D,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,WAAW,EAAE,iBAAiB,CAAA;IAC9B,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3E,uBAAuB,EAAE,MAAM,EAAE,CAAA;CAClC;AAED,eAAO,MAAM,eAAe,GAAI,SAAS,eAAe,KAAG,OAAO,IAAI,qBAG7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system_messages.js","sourceRoot":"","sources":["../../src/utils/system_messages.ts"],"names":[],"mappings":"AAEA,MAAM,oBAAoB,GAAG,CAAC,aAAa,CAAU,CAAA;AAUrD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAwB,EAAoC,EAAE,CAC5F,oBAAoB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAgC,CAAC;IACvE,OAAO,CAAC,eAAe,IAAI,IAAI;IAC/B,OAAO,CAAC,uBAAuB,IAAI,IAAI,CAAA","sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"system_messages.js","sourceRoot":"","sources":["../../src/utils/system_messages.ts"],"names":[],"mappings":"AAEA,MAAM,oBAAoB,GAAG,CAAC,aAAa,CAAU,CAAA;AAUrD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAwB,EAAoC,EAAE,CAC5F,oBAAoB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAgC,CAAC;IACvE,OAAO,CAAC,eAAe,IAAI,IAAI;IAC/B,OAAO,CAAC,uBAAuB,IAAI,IAAI,CAAA","sourcesContent":["import { MessageResource } from '../types'\n\nconst SYSTEM_MESSAGE_TYPES = ['user_joined'] as const\n\ntype SystemMessageType = (typeof SYSTEM_MESSAGE_TYPES)[number]\n\nexport interface SystemMessageResource extends MessageResource {\n messageType: SystemMessageType\n systemTextParts: { names: string[]; overflowCount: number; action: string }\n personIdsForSystemEvent: number[]\n}\n\nexport const isSystemMessage = (message: MessageResource): message is SystemMessageResource =>\n SYSTEM_MESSAGE_TYPES.includes(message.messageType as SystemMessageType) &&\n message.systemTextParts != null &&\n message.personIdsForSystemEvent != null\n"]}
|
package/build/utils/theme.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ColorSchemeName, ColorValue, OpaqueColorValue } from 'react-native';
|
|
2
2
|
import { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map';
|
|
3
3
|
export interface ChatTheme extends DefaultTheme {
|
|
4
4
|
colors: DefaultTheme['colors'] & (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark);
|
|
@@ -24,7 +24,7 @@ export interface DefaultTheme {
|
|
|
24
24
|
};
|
|
25
25
|
showBadgeProductLogo: boolean;
|
|
26
26
|
}
|
|
27
|
-
export declare const defaultTheme: (colorScheme: ColorSchemeName
|
|
27
|
+
export declare const defaultTheme: (colorScheme: ColorSchemeName) => ChatTheme;
|
|
28
28
|
export type TemporaryDefaultColorsType = Partial<ChatColors>;
|
|
29
29
|
interface ChatColors {
|
|
30
30
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAiB,MAAM,cAAc,CAAA;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAG/E,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAC5B,CAAC,OAAO,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C,wBAAwB;IAChD,iBAAiB,EAAE,MAAM,CAAC,0BAA0B;IACpD,eAAe,EAAE,MAAM,CAAC,6BAA6B;IAErD,wDAAwD;IACxD,sBAAsB,EAAE,MAAM,CAAC,8BAA8B;IAC7D,sBAAsB,EAAE,MAAM,CAAC,uBAAuB;IACtD,4BAA4B,EAAE,MAAM,CAAC,4BAA4B;IACjE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;IACvE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;IACvE,uBAAuB,EAAE,MAAM,CAAC,+BAA+B;IAC/D,uBAAuB,EAAE,MAAM,CAAC,wBAAwB;IACxD,6BAA6B,EAAE,MAAM,CAAC,6BAA6B;IACnE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;CACxE,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;CACrB,CAAA","sourcesContent":["import { PlatformColor } from 'react-native'\nimport type { ColorSchemeName, ColorValue, OpaqueColorValue } from 'react-native'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\nimport { tokens } from '../vendor/tapestry/tokens'\n\nexport interface ChatTheme extends DefaultTheme {\n colors: DefaultTheme['colors'] &\n (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark)\n}\n\n/** =============================================\n NOTE: The specific values for `colors` and the `productBadge` are temporary examples that can be replaced once we start building out UI. This line's comment can be removed at that time too.\n\n The default theme is intended to support two types of customizations:\n 1. Specific color properties for a chat component (eg. `primaryButtonBackgroundColor`)\n 2. Any styles for a specific component. (Use only one level of nesting.)\n ```\n primaryButton: {\n borderRadius: number\n container: ViewStyle\n text: TextStyle\n }\n ```\n============================================= */\n\nexport interface DefaultTheme {\n colors: ChatColors\n button: {\n borderRadius: number\n }\n showBadgeProductLogo: boolean\n}\n\nexport const defaultTheme = (colorScheme: ColorSchemeName | null): ChatTheme => {\n const scheme: 'light' | 'dark' = colorScheme === 'dark' ? 'dark' : 'light'\n\n const defaultColors = {\n ...chatThemeColorMap[scheme],\n ...aliasTokensColorMap[scheme],\n }\n\n return {\n colors: defaultColors,\n button: {\n borderRadius: 40,\n },\n showBadgeProductLogo: true, // Overrides visibility of the product logo in `src/display/badge.tsx`\n }\n}\n\nexport type TemporaryDefaultColorsType = Partial<ChatColors>\n\ninterface ChatColors {\n name: string\n buttonStart: string | undefined\n buttonEnd: string | undefined\n interaction: string\n androidModalHeaderButtonTextColor: ColorValue | string | undefined\n iOSModalHeaderButtonTextColor: OpaqueColorValue | string | undefined\n androidSwitchThumbColor: string | undefined\n conversationActionsBackground: string\n testColor: string\n statusSuccessIcon: string\n statusSuccessText: string\n statusSuccessBorder: string\n statusSuccessFill: string\n statusInfoIcon: string\n statusInfoText: string\n statusInfoBorder: string\n statusInfoFill: string\n statusWarningIcon: string\n statusWarningText: string\n statusWarningBorder: string\n statusWarningFill: string\n statusErrorIcon: string\n statusErrorText: string\n statusErrorBorder: string\n statusErrorFill: string\n statusSuccessComposedIcon: string\n statusSuccessComposedText: string\n statusSuccessComposedBackground: string\n statusInfoComposedIcon: string\n statusInfoComposedText: string\n statusInfoComposedBackground: string\n statusWarningComposedIcon: string\n statusWarningComposedText: string\n statusWarningComposedBackground: string\n statusErrorComposedIcon: string\n statusErrorComposedText: string\n statusErrorComposedBackground: string\n statusNeutralComposedIcon: string\n statusNeutralComposedText: string\n statusNeutralComposedBackground: string\n}\n\nconst colorsChatLight: ChatColors = {\n name: 'light',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefault,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefault,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral100White,\n testColor: 'hotpink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoText: tokens.textColorStatusInfo,\n statusInfoBorder: tokens.borderColorStatusInfo,\n statusInfoFill: tokens.fillColorStatusInfoSolid,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessText: tokens.textColorStatusSuccess,\n statusSuccessBorder: tokens.borderColorStatusSuccess,\n statusSuccessFill: tokens.fillColorStatusSuccessSolid,\n statusWarningIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningText: tokens.textColorStatusWarning,\n statusWarningBorder: tokens.borderColorStatusWarning,\n statusWarningFill: tokens.fillColorStatusWarningSolid,\n statusErrorIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorText: tokens.textColorStatusError,\n statusErrorBorder: tokens.borderColorStatusError,\n statusErrorFill: tokens.fillColorStatusErrorSolid,\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoComposedText: tokens.textColorStatusInfo,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhost,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessComposedText: tokens.textColorStatusSuccess,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhost,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningComposedText: tokens.textColorStatusWarning,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhost,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorComposedText: tokens.textColorStatusError,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhost,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimary,\n statusNeutralComposedText: tokens.textColorStatusNeutral,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhost,\n}\n\nconst colorsChatDark: ChatColors = {\n name: 'dark',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefaultDark,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefaultDark,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral7,\n testColor: 'pink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoText: tokens.textColorStatusInfoDark,\n statusInfoBorder: tokens.borderColorStatusInfoDark,\n statusInfoFill: tokens.fillColorStatusInfoSolidDark,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessText: tokens.textColorStatusSuccessDark,\n statusSuccessBorder: tokens.borderColorStatusSuccessDark,\n statusSuccessFill: tokens.fillColorStatusSuccessSolidDark,\n statusWarningIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningText: tokens.textColorStatusWarningDark,\n statusWarningBorder: tokens.borderColorStatusWarningDark,\n statusWarningFill: tokens.fillColorStatusWarningSolidDark,\n statusErrorIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorText: tokens.textColorStatusErrorDark,\n statusErrorBorder: tokens.borderColorStatusErrorDark,\n statusErrorFill: tokens.fillColorStatusErrorSolidDark,\n\n // Note: CCA inverts composed status colors in dark mode\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoComposedText: tokens.textColorStatusInfoDark,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhostDark,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessComposedText: tokens.textColorStatusSuccessDark,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhostDark,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningComposedText: tokens.textColorStatusWarningDark,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhostDark,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorComposedText: tokens.textColorStatusErrorDark,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhostDark,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimaryDark,\n statusNeutralComposedText: tokens.textColorStatusNeutralDark,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhostDark,\n}\n\nconst chatThemeColorMap = {\n light: colorsChatLight,\n dark: colorsChatDark,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,aAAa,EAAE,MAAM,cAAc,CAAA;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AA8BlD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAA4B,EAAa,EAAE;IACtE,MAAM,MAAM,GAAqB,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;IAE1E,MAAM,aAAa,GAAG;QACpB,GAAG,iBAAiB,CAAC,MAAM,CAAC;QAC5B,GAAG,mBAAmB,CAAC,MAAM,CAAC;KAC/B,CAAA;IAED,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE;YACN,YAAY,EAAE,EAAE;SACjB;QACD,oBAAoB,EAAE,IAAI,EAAE,sEAAsE;KACnG,CAAA;AACH,CAAC,CAAA;AA+CD,MAAM,eAAe,GAAe;IAClC,IAAI,EAAE,OAAO;IACb,iCAAiC,EAAE,MAAM,CAAC,2BAA2B;IACrE,6BAA6B,EAAE,aAAa,CAAC,MAAM,CAAC;IACpD,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,MAAM,CAAC,2BAA2B;IAC/C,uBAAuB,EAAE,SAAS;IAClC,6BAA6B,EAAE,MAAM,CAAC,oBAAoB;IAC1D,SAAS,EAAE,SAAS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B,EAAE,MAAM,CAAC,+BAA+B;IACvE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;IACvE,uBAAuB,EAAE,MAAM,CAAC,+BAA+B;IAC/D,uBAAuB,EAAE,MAAM,CAAC,wBAAwB;IACxD,6BAA6B,EAAE,MAAM,CAAC,6BAA6B;IACnE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;CACxE,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;CACrB,CAAA","sourcesContent":["import { ColorSchemeName, ColorValue, OpaqueColorValue, PlatformColor } from 'react-native'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\nimport { tokens } from '../vendor/tapestry/tokens'\n\nexport interface ChatTheme extends DefaultTheme {\n colors: DefaultTheme['colors'] &\n (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark)\n}\n\n/** =============================================\n NOTE: The specific values for `colors` and the `productBadge` are temporary examples that can be replaced once we start building out UI. This line's comment can be removed at that time too.\n\n The default theme is intended to support two types of customizations:\n 1. Specific color properties for a chat component (eg. `primaryButtonBackgroundColor`)\n 2. Any styles for a specific component. (Use only one level of nesting.)\n ```\n primaryButton: {\n borderRadius: number\n container: ViewStyle\n text: TextStyle\n }\n ```\n============================================= */\n\nexport interface DefaultTheme {\n colors: ChatColors\n button: {\n borderRadius: number\n }\n showBadgeProductLogo: boolean\n}\n\nexport const defaultTheme = (colorScheme: ColorSchemeName): ChatTheme => {\n const scheme: 'light' | 'dark' = colorScheme === 'dark' ? 'dark' : 'light'\n\n const defaultColors = {\n ...chatThemeColorMap[scheme],\n ...aliasTokensColorMap[scheme],\n }\n\n return {\n colors: defaultColors,\n button: {\n borderRadius: 40,\n },\n showBadgeProductLogo: true, // Overrides visibility of the product logo in `src/display/badge.tsx`\n }\n}\n\nexport type TemporaryDefaultColorsType = Partial<ChatColors>\n\ninterface ChatColors {\n name: string\n buttonStart: string | undefined\n buttonEnd: string | undefined\n interaction: string\n androidModalHeaderButtonTextColor: ColorValue | string | undefined\n iOSModalHeaderButtonTextColor: OpaqueColorValue | string | undefined\n androidSwitchThumbColor: string | undefined\n conversationActionsBackground: string\n testColor: string\n statusSuccessIcon: string\n statusSuccessText: string\n statusSuccessBorder: string\n statusSuccessFill: string\n statusInfoIcon: string\n statusInfoText: string\n statusInfoBorder: string\n statusInfoFill: string\n statusWarningIcon: string\n statusWarningText: string\n statusWarningBorder: string\n statusWarningFill: string\n statusErrorIcon: string\n statusErrorText: string\n statusErrorBorder: string\n statusErrorFill: string\n statusSuccessComposedIcon: string\n statusSuccessComposedText: string\n statusSuccessComposedBackground: string\n statusInfoComposedIcon: string\n statusInfoComposedText: string\n statusInfoComposedBackground: string\n statusWarningComposedIcon: string\n statusWarningComposedText: string\n statusWarningComposedBackground: string\n statusErrorComposedIcon: string\n statusErrorComposedText: string\n statusErrorComposedBackground: string\n statusNeutralComposedIcon: string\n statusNeutralComposedText: string\n statusNeutralComposedBackground: string\n}\n\nconst colorsChatLight: ChatColors = {\n name: 'light',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefault,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefault,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral100White,\n testColor: 'hotpink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoText: tokens.textColorStatusInfo,\n statusInfoBorder: tokens.borderColorStatusInfo,\n statusInfoFill: tokens.fillColorStatusInfoSolid,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessText: tokens.textColorStatusSuccess,\n statusSuccessBorder: tokens.borderColorStatusSuccess,\n statusSuccessFill: tokens.fillColorStatusSuccessSolid,\n statusWarningIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningText: tokens.textColorStatusWarning,\n statusWarningBorder: tokens.borderColorStatusWarning,\n statusWarningFill: tokens.fillColorStatusWarningSolid,\n statusErrorIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorText: tokens.textColorStatusError,\n statusErrorBorder: tokens.borderColorStatusError,\n statusErrorFill: tokens.fillColorStatusErrorSolid,\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoComposedText: tokens.textColorStatusInfo,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhost,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessComposedText: tokens.textColorStatusSuccess,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhost,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningComposedText: tokens.textColorStatusWarning,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhost,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorComposedText: tokens.textColorStatusError,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhost,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimary,\n statusNeutralComposedText: tokens.textColorStatusNeutral,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhost,\n}\n\nconst colorsChatDark: ChatColors = {\n name: 'dark',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefaultDark,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefaultDark,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral7,\n testColor: 'pink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoText: tokens.textColorStatusInfoDark,\n statusInfoBorder: tokens.borderColorStatusInfoDark,\n statusInfoFill: tokens.fillColorStatusInfoSolidDark,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessText: tokens.textColorStatusSuccessDark,\n statusSuccessBorder: tokens.borderColorStatusSuccessDark,\n statusSuccessFill: tokens.fillColorStatusSuccessSolidDark,\n statusWarningIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningText: tokens.textColorStatusWarningDark,\n statusWarningBorder: tokens.borderColorStatusWarningDark,\n statusWarningFill: tokens.fillColorStatusWarningSolidDark,\n statusErrorIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorText: tokens.textColorStatusErrorDark,\n statusErrorBorder: tokens.borderColorStatusErrorDark,\n statusErrorFill: tokens.fillColorStatusErrorSolidDark,\n\n // Note: CCA inverts composed status colors in dark mode\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoComposedText: tokens.textColorStatusInfoDark,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhostDark,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessComposedText: tokens.textColorStatusSuccessDark,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhostDark,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningComposedText: tokens.textColorStatusWarningDark,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhostDark,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorComposedText: tokens.textColorStatusErrorDark,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhostDark,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimaryDark,\n statusNeutralComposedText: tokens.textColorStatusNeutralDark,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhostDark,\n}\n\nconst chatThemeColorMap = {\n light: colorsChatLight,\n dark: colorsChatDark,\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.42.2-qa-
|
|
3
|
+
"version": "3.42.2-qa-staging.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"react-native": "./src/index.tsx",
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"./build/icons/font_awesome.js"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "expo-module build
|
|
19
|
+
"build": "expo-module build",
|
|
20
20
|
"clean": "expo-module clean",
|
|
21
21
|
"lint": "expo-module lint",
|
|
22
22
|
"test": "expo-module test",
|
|
23
|
-
"prepublishOnly": "expo-module
|
|
23
|
+
"prepublishOnly": "expo-module prepublishOnly"
|
|
24
24
|
},
|
|
25
25
|
"target": "18",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
28
28
|
"@fortawesome/react-native-fontawesome": "^0.3.2",
|
|
29
|
-
"@planningcenter/emoji-keyboard": "3.42.2-qa-
|
|
29
|
+
"@planningcenter/emoji-keyboard": "3.42.2-qa-staging.3",
|
|
30
30
|
"lodash-inflection": "^1.5.0",
|
|
31
31
|
"react-compiler-runtime": "^1.0.0"
|
|
32
32
|
},
|
|
@@ -52,25 +52,25 @@
|
|
|
52
52
|
"react-native-svg": "*"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@react-native/eslint-config": "~0.
|
|
55
|
+
"@react-native/eslint-config": "~0.83.0",
|
|
56
56
|
"@testing-library/react-native": "^13.2.0",
|
|
57
57
|
"@types/color": "^3.0.0",
|
|
58
58
|
"@types/jest": "^29.5.14",
|
|
59
|
-
"@typescript-eslint/parser": "^8.
|
|
59
|
+
"@typescript-eslint/parser": "^8.36.0",
|
|
60
60
|
"color": "^3.1.2",
|
|
61
61
|
"eslint": "8.57.1",
|
|
62
62
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
63
|
-
"expo-module-scripts": "^
|
|
63
|
+
"expo-module-scripts": "^55.0.0",
|
|
64
64
|
"fast-text-encoding": "^1.0.6",
|
|
65
65
|
"jest": "^29.7.0",
|
|
66
66
|
"jest-fetch-mock": "^3.0.3",
|
|
67
67
|
"msw": "^2.7.3",
|
|
68
68
|
"prettier": "^3.4.2",
|
|
69
|
-
"react": "19.2.
|
|
70
|
-
"react-native": "0.
|
|
71
|
-
"react-native-svg": "15.15.
|
|
69
|
+
"react": "19.2.0",
|
|
70
|
+
"react-native": "0.83.6",
|
|
71
|
+
"react-native-svg": "15.15.3",
|
|
72
72
|
"react-native-url-polyfill": "^2.0.0",
|
|
73
|
-
"typescript": "~
|
|
73
|
+
"typescript": "~5.9.2"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "23fd04aec5a8df8e5e130fb79749d7fc98a7a7f8"
|
|
76
76
|
}
|
|
@@ -38,7 +38,6 @@ const createWrapper = () => {
|
|
|
38
38
|
const setChatConfiguration = (overrides: Partial<ReturnType<typeof useChatConfiguration>> = {}) => {
|
|
39
39
|
mockedUseChatConfiguration.mockReturnValue({
|
|
40
40
|
allowedFileExtensions: ['.pdf', '.jpg'],
|
|
41
|
-
allowedMimeTypes: [],
|
|
42
41
|
maxFileSizeInBytes: 50 * 1024 * 1024,
|
|
43
42
|
maxAttachmentsPerMessage: 10,
|
|
44
43
|
...overrides,
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { renderHook } from '@testing-library/react-native'
|
|
2
2
|
import { useFontScale } from '../../hooks/use_font_scale'
|
|
3
3
|
|
|
4
|
-
jest.mock('react-native', () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
value: jest.fn(),
|
|
8
|
-
configurable: true,
|
|
9
|
-
})
|
|
10
|
-
})
|
|
4
|
+
jest.mock('react-native', () => ({
|
|
5
|
+
useWindowDimensions: jest.fn(),
|
|
6
|
+
}))
|
|
11
7
|
|
|
12
8
|
const mockUseWindowDimensions = require('react-native').useWindowDimensions
|
|
13
9
|
const DEFAULT_NATIVE_FONT_SCALE = 1
|
|
@@ -113,7 +113,7 @@ describe('ChatAdapters', () => {
|
|
|
113
113
|
describe('document picker adapter', () => {
|
|
114
114
|
it('uses the configured adapter when provided', () => {
|
|
115
115
|
const documentPicker = new DocumentPickerAdapter({
|
|
116
|
-
openAsync: jest.fn(async () => ({ canceled: true
|
|
116
|
+
openAsync: jest.fn(async () => ({ canceled: true, assets: null })),
|
|
117
117
|
})
|
|
118
118
|
|
|
119
119
|
ChatAdapters.configure({
|
|
@@ -11,7 +11,7 @@ const makeMessage = (overrides: Partial<MessageResource> = {}): MessageResource
|
|
|
11
11
|
textEditedAt: null,
|
|
12
12
|
mine: false,
|
|
13
13
|
attachments: [],
|
|
14
|
-
author: { id: -1,
|
|
14
|
+
author: { id: -1, name: 'System', avatar: '' },
|
|
15
15
|
reactionCounts: [],
|
|
16
16
|
replyCount: 0,
|
|
17
17
|
replyRootId: null,
|