@planningcenter/chat-react-native 3.30.0-rc.1 → 3.30.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/conversation/attachments/attachment_card.js +3 -3
- package/build/components/conversation/attachments/attachment_card.js.map +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.js +2 -2
- package/build/components/conversation/attachments/attachment_deleting_overlay.js.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.d.ts +1 -1
- package/build/components/conversation/attachments/audio_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.js +3 -3
- package/build/components/conversation/attachments/audio_attachment.js.map +1 -1
- package/build/components/conversation/attachments/expanded_link.d.ts +1 -1
- package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -1
- package/build/components/conversation/attachments/expanded_link.js +3 -3
- package/build/components/conversation/attachments/expanded_link.js.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.js +4 -4
- package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts +1 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.js +4 -4
- package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
- package/build/components/conversation/attachments/image_attachment.d.ts +1 -1
- package/build/components/conversation/attachments/image_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/image_attachment.js +5 -5
- package/build/components/conversation/attachments/image_attachment.js.map +1 -1
- package/build/components/conversation/attachments/video_attachment.d.ts +1 -1
- package/build/components/conversation/attachments/video_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/video_attachment.js +4 -4
- package/build/components/conversation/attachments/video_attachment.js.map +1 -1
- package/build/components/conversation/empty_conversation_blank_state.js +1 -1
- package/build/components/conversation/empty_conversation_blank_state.js.map +1 -1
- package/build/components/conversation/jump_to_bottom_button.js +3 -3
- package/build/components/conversation/jump_to_bottom_button.js.map +1 -1
- package/build/components/conversation/message.d.ts +1 -1
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +12 -12
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_attachments.d.ts +1 -1
- package/build/components/conversation/message_attachments.d.ts.map +1 -1
- package/build/components/conversation/message_attachments.js +1 -1
- package/build/components/conversation/message_attachments.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts +1 -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 +1 -1
- package/build/components/conversation/message_form/message_form_attachment_image.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_video.d.ts +1 -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 +1 -1
- package/build/components/conversation/message_form/message_form_attachment_video.js.map +1 -1
- package/build/components/conversation/message_form.d.ts +1 -1
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +12 -12
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_markdown.js +3 -3
- package/build/components/conversation/message_markdown.js.map +1 -1
- package/build/components/conversation/message_reaction.d.ts +2 -2
- package/build/components/conversation/message_reaction.d.ts.map +1 -1
- package/build/components/conversation/message_reaction.js +6 -6
- package/build/components/conversation/message_reaction.js.map +1 -1
- package/build/components/conversation/message_read_receipts.d.ts +1 -1
- package/build/components/conversation/message_read_receipts.d.ts.map +1 -1
- package/build/components/conversation/message_read_receipts.js +2 -2
- package/build/components/conversation/message_read_receipts.js.map +1 -1
- package/build/components/conversation/messages_disabled_banners.js +2 -2
- package/build/components/conversation/messages_disabled_banners.js.map +1 -1
- package/build/components/conversation/reply_connectors.d.ts +1 -1
- package/build/components/conversation/reply_connectors.d.ts.map +1 -1
- package/build/components/conversation/reply_connectors.js +2 -2
- package/build/components/conversation/reply_connectors.js.map +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
- package/build/components/conversation/reply_shadow_message.js +6 -6
- package/build/components/conversation/reply_shadow_message.js.map +1 -1
- package/build/components/conversation/typing_indicator.js +3 -3
- package/build/components/conversation/typing_indicator.js.map +1 -1
- package/build/components/conversations/conversation_actions.d.ts +1 -1
- package/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +5 -5
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts +1 -1
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +3 -3
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/conversations.js +5 -5
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/conversations/mute_indicator.js +3 -3
- package/build/components/conversations/mute_indicator.js.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts +1 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.js +5 -5
- package/build/components/conversations/swipeable_toggle_button.js.map +1 -1
- package/build/components/conversations/unread_count_badge.js +3 -3
- package/build/components/conversations/unread_count_badge.js.map +1 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +2 -2
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/avatar.d.ts +1 -1
- package/build/components/display/avatar.d.ts.map +1 -1
- package/build/components/display/avatar.js +1 -1
- package/build/components/display/avatar.js.map +1 -1
- package/build/components/display/avatar_group.d.ts +1 -1
- package/build/components/display/avatar_group.d.ts.map +1 -1
- package/build/components/display/avatar_group.js +1 -1
- package/build/components/display/avatar_group.js.map +1 -1
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +3 -3
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/banner.d.ts +1 -1
- package/build/components/display/banner.d.ts.map +1 -1
- package/build/components/display/banner.js +1 -1
- package/build/components/display/banner.js.map +1 -1
- package/build/components/display/banner_collapsible.d.ts.map +1 -1
- package/build/components/display/banner_collapsible.js +1 -1
- package/build/components/display/banner_collapsible.js.map +1 -1
- package/build/components/display/button.d.ts.map +1 -1
- package/build/components/display/button.js +3 -3
- package/build/components/display/button.js.map +1 -1
- package/build/components/display/child_notice.d.ts +1 -1
- package/build/components/display/child_notice.d.ts.map +1 -1
- package/build/components/display/child_notice.js +2 -2
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/display/heading.js +3 -3
- package/build/components/display/heading.js.map +1 -1
- package/build/components/display/icon.js +1 -1
- package/build/components/display/icon.js.map +1 -1
- package/build/components/display/icon_button.d.ts.map +1 -1
- package/build/components/display/icon_button.js +2 -2
- package/build/components/display/icon_button.js.map +1 -1
- package/build/components/display/image.js +1 -1
- package/build/components/display/image.js.map +1 -1
- package/build/components/display/image_attachment_preview.js +2 -2
- package/build/components/display/image_attachment_preview.js.map +1 -1
- package/build/components/display/keyboard_view.js +1 -1
- package/build/components/display/keyboard_view.js.map +1 -1
- package/build/components/display/person.d.ts +1 -1
- package/build/components/display/person.d.ts.map +1 -1
- package/build/components/display/person.js +1 -1
- package/build/components/display/person.js.map +1 -1
- package/build/components/display/platform_modal_header_buttons.js +1 -1
- package/build/components/display/platform_modal_header_buttons.js.map +1 -1
- package/build/components/display/pressable_row.d.ts.map +1 -1
- package/build/components/display/pressable_row.js +1 -1
- package/build/components/display/pressable_row.js.map +1 -1
- package/build/components/display/spinner.js +1 -1
- package/build/components/display/spinner.js.map +1 -1
- package/build/components/display/switch.js +1 -1
- package/build/components/display/switch.js.map +1 -1
- package/build/components/display/tabs.js +1 -1
- package/build/components/display/tabs.js.map +1 -1
- package/build/components/display/text.js +2 -2
- package/build/components/display/text.js.map +1 -1
- package/build/components/display/text_button.d.ts.map +1 -1
- package/build/components/display/text_button.js +2 -2
- package/build/components/display/text_button.js.map +1 -1
- package/build/components/display/text_inline_button.d.ts.map +1 -1
- package/build/components/display/text_inline_button.js +2 -2
- package/build/components/display/text_inline_button.js.map +1 -1
- package/build/components/display/toggle_button.d.ts.map +1 -1
- package/build/components/display/toggle_button.js +4 -4
- package/build/components/display/toggle_button.js.map +1 -1
- package/build/components/display/utils/button_colors.js +1 -1
- package/build/components/display/utils/button_colors.js.map +1 -1
- package/build/components/display/utils/status_colors.js +1 -1
- package/build/components/display/utils/status_colors.js.map +1 -1
- package/build/components/display/video_attachment_preview.js +3 -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 +2 -2
- package/build/components/group_conversation_list.js.map +1 -1
- package/build/components/page/error_boundary.d.ts +1 -1
- package/build/components/page/error_boundary.d.ts.map +1 -1
- package/build/components/page/error_boundary.js +2 -2
- package/build/components/page/error_boundary.js.map +1 -1
- package/build/components/page/loading.js +1 -1
- package/build/components/page/loading.js.map +1 -1
- package/build/components/primitive/avatar_primitive.d.ts +2 -2
- package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
- package/build/components/primitive/avatar_primitive.js +5 -5
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/components/primitive/banner_primitive.d.ts +2 -2
- package/build/components/primitive/banner_primitive.d.ts.map +1 -1
- package/build/components/primitive/banner_primitive.js +8 -8
- package/build/components/primitive/banner_primitive.js.map +1 -1
- package/build/components/primitive/blank_state_primitive.d.ts +1 -1
- package/build/components/primitive/blank_state_primitive.d.ts.map +1 -1
- package/build/components/primitive/blank_state_primitive.js +2 -2
- package/build/components/primitive/blank_state_primitive.js.map +1 -1
- package/build/components/primitive/form_sheet.d.ts +2 -2
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.js +3 -3
- package/build/components/primitive/form_sheet.js.map +1 -1
- package/build/components/safe_area_modal.js +1 -1
- package/build/components/safe_area_modal.js.map +1 -1
- package/build/contexts/api_provider.js +4 -4
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts +6 -6
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +2 -2
- package/build/contexts/chat_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 +1 -1
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/contexts/session_context.d.ts +3 -3
- package/build/contexts/session_context.d.ts.map +1 -1
- package/build/contexts/session_context.js +6 -6
- package/build/contexts/session_context.js.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +7 -7
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.js +2 -2
- package/build/hooks/groups/use_group_members_for_new_conversation.js.map +1 -1
- package/build/hooks/groups/use_groups_conversation_create.d.ts +1 -1
- package/build/hooks/groups/use_groups_conversation_create.d.ts.map +1 -1
- package/build/hooks/groups/use_groups_conversation_create.js +2 -2
- package/build/hooks/groups/use_groups_conversation_create.js.map +1 -1
- package/build/hooks/services/use_find_or_create_services_conversation.d.ts +2 -2
- package/build/hooks/services/use_find_or_create_services_conversation.d.ts.map +1 -1
- package/build/hooks/services/use_find_or_create_services_conversation.js +2 -2
- package/build/hooks/services/use_find_or_create_services_conversation.js.map +1 -1
- package/build/hooks/services/use_services_team.d.ts +1 -1
- package/build/hooks/services/use_services_team.d.ts.map +1 -1
- package/build/hooks/services/use_services_team.js +1 -1
- package/build/hooks/services/use_services_team.js.map +1 -1
- package/build/hooks/services/use_team_members_for_new_conversation.d.ts +21 -21
- package/build/hooks/services/use_team_members_for_new_conversation.d.ts.map +1 -1
- package/build/hooks/services/use_team_members_for_new_conversation.js +1 -1
- package/build/hooks/services/use_team_members_for_new_conversation.js.map +1 -1
- package/build/hooks/services/use_team_plans.d.ts +1 -1
- package/build/hooks/services/use_team_plans.js +1 -1
- package/build/hooks/services/use_team_plans.js.map +1 -1
- package/build/hooks/use_api.d.ts +2 -2
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_api_client.d.ts +1 -1
- package/build/hooks/use_api_client.d.ts.map +1 -1
- package/build/hooks/use_api_client.js +3 -3
- package/build/hooks/use_api_client.js.map +1 -1
- package/build/hooks/use_async_storage.js +1 -1
- package/build/hooks/use_async_storage.js.map +1 -1
- package/build/hooks/use_attachment_uploader.d.ts +1 -1
- package/build/hooks/use_attachment_uploader.d.ts.map +1 -1
- package/build/hooks/use_attachment_uploader.js.map +1 -1
- package/build/hooks/use_broadcast_typing_status.js +1 -1
- package/build/hooks/use_broadcast_typing_status.js.map +1 -1
- package/build/hooks/use_chat_permissions.d.ts +21 -21
- package/build/hooks/use_chat_permissions.d.ts.map +1 -1
- package/build/hooks/use_chat_permissions.js.map +1 -1
- package/build/hooks/use_conversation.d.ts +5 -5
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +4 -3
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +1 -1
- 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_membership.js +2 -2
- package/build/hooks/use_conversation_membership.js.map +1 -1
- package/build/hooks/use_conversation_message.d.ts +1 -1
- package/build/hooks/use_conversation_message.d.ts.map +1 -1
- package/build/hooks/use_conversation_message.js +1 -1
- package/build/hooks/use_conversation_message.js.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts +3 -3
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +1 -1
- package/build/hooks/use_conversation_messages.js.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.js +6 -6
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_conversations.d.ts +2 -2
- package/build/hooks/use_conversations.d.ts.map +1 -1
- package/build/hooks/use_conversations.js +1 -1
- package/build/hooks/use_conversations.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts +19 -19
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.js +1 -1
- package/build/hooks/use_conversations_actions.js.map +1 -1
- package/build/hooks/use_conversations_cache.d.ts +2 -2
- package/build/hooks/use_conversations_cache.d.ts.map +1 -1
- package/build/hooks/use_conversations_cache.js +2 -2
- package/build/hooks/use_conversations_cache.js.map +1 -1
- package/build/hooks/use_conversations_jolt_events.js +2 -2
- package/build/hooks/use_conversations_jolt_events.js.map +1 -1
- package/build/hooks/use_current_person.d.ts +1 -1
- package/build/hooks/use_current_person.d.ts.map +1 -1
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/hooks/use_features.d.ts +2 -2
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +2 -2
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_giphy.d.ts +1 -1
- package/build/hooks/use_giphy.d.ts.map +1 -1
- package/build/hooks/use_giphy.js +1 -1
- package/build/hooks/use_giphy.js.map +1 -1
- package/build/hooks/use_groups.d.ts +2 -2
- package/build/hooks/use_groups.d.ts.map +1 -1
- package/build/hooks/use_groups.js.map +1 -1
- package/build/hooks/use_groups_groups.d.ts +33 -33
- package/build/hooks/use_groups_groups.d.ts.map +1 -1
- package/build/hooks/use_groups_groups.js.map +1 -1
- package/build/hooks/use_jolt.js +2 -2
- package/build/hooks/use_jolt.js.map +1 -1
- package/build/hooks/use_live_relative_time.d.ts +1 -1
- package/build/hooks/use_live_relative_time.d.ts.map +1 -1
- package/build/hooks/use_live_relative_time.js +2 -2
- package/build/hooks/use_live_relative_time.js.map +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
- package/build/hooks/use_mark_latest_message_read.js.map +1 -1
- package/build/hooks/use_message_create_or_update.d.ts +2 -2
- package/build/hooks/use_message_create_or_update.d.ts.map +1 -1
- package/build/hooks/use_message_create_or_update.js +7 -7
- package/build/hooks/use_message_create_or_update.js.map +1 -1
- package/build/hooks/use_message_draft.d.ts +1 -1
- package/build/hooks/use_message_draft.d.ts.map +1 -1
- package/build/hooks/use_message_draft.js +1 -1
- package/build/hooks/use_message_draft.js.map +1 -1
- package/build/hooks/use_message_reaction_toggle.d.ts +2 -2
- package/build/hooks/use_message_reaction_toggle.d.ts.map +1 -1
- package/build/hooks/use_message_reaction_toggle.js +2 -2
- package/build/hooks/use_message_reaction_toggle.js.map +1 -1
- package/build/hooks/use_my_gender.js.map +1 -1
- package/build/hooks/use_organization.d.ts +5 -5
- package/build/hooks/use_organization.d.ts.map +1 -1
- package/build/hooks/use_organization.js.map +1 -1
- package/build/hooks/use_people_person.d.ts +1 -1
- package/build/hooks/use_people_person.d.ts.map +1 -1
- package/build/hooks/use_people_person.js.map +1 -1
- package/build/hooks/use_product_analytics.d.ts +1 -1
- package/build/hooks/use_product_analytics.d.ts.map +1 -1
- package/build/hooks/use_product_analytics.js +3 -3
- package/build/hooks/use_product_analytics.js.map +1 -1
- package/build/hooks/use_qualified_by_age.js +1 -1
- package/build/hooks/use_qualified_by_age.js.map +1 -1
- package/build/hooks/use_read_receipts.d.ts +2 -2
- package/build/hooks/use_read_receipts.d.ts.map +1 -1
- package/build/hooks/use_read_receipts.js.map +1 -1
- package/build/hooks/use_report_message.d.ts +1 -1
- package/build/hooks/use_report_message.d.ts.map +1 -1
- package/build/hooks/use_report_message.js +1 -1
- package/build/hooks/use_report_message.js.map +1 -1
- package/build/hooks/use_storage.d.ts +1 -1
- package/build/hooks/use_storage.d.ts.map +1 -1
- package/build/hooks/use_storage.js.map +1 -1
- package/build/hooks/use_submit_age_check.d.ts +1 -1
- package/build/hooks/use_submit_age_check.d.ts.map +1 -1
- package/build/hooks/use_submit_age_check.js +1 -1
- package/build/hooks/use_submit_age_check.js.map +1 -1
- package/build/hooks/use_suspense_api.d.ts +5 -5
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +2 -2
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/hooks/use_teams.d.ts +1 -1
- package/build/hooks/use_teams.d.ts.map +1 -1
- package/build/hooks/use_teams.js.map +1 -1
- package/build/hooks/use_theme.d.ts +1 -1
- package/build/hooks/use_theme.d.ts.map +1 -1
- package/build/hooks/use_theme.js +1 -1
- package/build/hooks/use_theme.js.map +1 -1
- package/build/hooks/use_typing_indicators.d.ts.map +1 -1
- package/build/hooks/use_typing_indicators.js +1 -1
- package/build/hooks/use_typing_indicators.js.map +1 -1
- package/build/hooks/use_typing_status_cache.d.ts +1 -1
- package/build/hooks/use_typing_status_cache.d.ts.map +1 -1
- package/build/hooks/use_typing_status_cache.js.map +1 -1
- package/build/hooks/use_upload_client.d.ts +1 -1
- package/build/hooks/use_upload_client.d.ts.map +1 -1
- package/build/hooks/use_upload_client.js +3 -3
- package/build/hooks/use_upload_client.js.map +1 -1
- package/build/navigation/chat_access_gate.js +7 -7
- package/build/navigation/chat_access_gate.js.map +1 -1
- package/build/navigation/index.d.ts +25 -25
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +28 -28
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/screenLayout.js +2 -2
- package/build/navigation/screenLayout.js.map +1 -1
- package/build/polyfills/events/Event.d.ts +4 -0
- package/build/polyfills/events/Event.d.ts.map +1 -1
- package/build/polyfills/events/Event.js +1 -5
- package/build/polyfills/events/Event.js.map +1 -1
- package/build/polyfills/events/EventTarget.d.ts +3 -0
- package/build/polyfills/events/EventTarget.d.ts.map +1 -1
- package/build/polyfills/events/EventTarget.js +1 -1
- package/build/polyfills/events/EventTarget.js.map +1 -1
- package/build/polyfills/events/internals/EventInternals.d.ts +2 -2
- package/build/polyfills/events/internals/EventInternals.d.ts.map +1 -1
- package/build/polyfills/events/internals/EventInternals.js.map +1 -1
- package/build/polyfills/events/internals/EventTargetInternals.d.ts +2 -2
- package/build/polyfills/events/internals/EventTargetInternals.d.ts.map +1 -1
- package/build/polyfills/events/internals/EventTargetInternals.js.map +1 -1
- package/build/screens/age_check/age_check_required_screen.js +8 -8
- package/build/screens/age_check/age_check_required_screen.js.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.js +3 -3
- package/build/screens/age_check/age_check_underage_screen.js.map +1 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js +3 -3
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
- package/build/screens/attachment_actions/hooks/useDeleteAttachment.js +3 -3
- package/build/screens/attachment_actions/hooks/useDeleteAttachment.js.map +1 -1
- package/build/screens/bug_report_screen.js +11 -11
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.js +4 -4
- package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +37 -9
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js +3 -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 +4 -4
- 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.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +6 -6
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts +22 -22
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js +2 -2
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js.map +1 -1
- package/build/screens/conversation_filter_recipients/types.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/types.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/types.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +5 -5
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts +4 -4
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +5 -5
- 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.map +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/group_filters.js +1 -1
- package/build/screens/conversation_filters/group_filters.js.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.d.ts +54 -54
- package/build/screens/conversation_filters/hooks/filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.js +3 -3
- package/build/screens/conversation_filters/hooks/filters.js.map +1 -1
- package/build/screens/conversation_filters/screen_props.d.ts +1 -1
- package/build/screens/conversation_filters/screen_props.d.ts.map +1 -1
- package/build/screens/conversation_filters/screen_props.js.map +1 -1
- package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/team_filters.js +1 -1
- package/build/screens/conversation_filters/team_filters.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +1 -1
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.js +7 -7
- package/build/screens/conversation_new/components/filter_by_plan.js.map +1 -1
- package/build/screens/conversation_new/components/form_list.d.ts +1 -1
- package/build/screens/conversation_new/components/form_list.d.ts.map +1 -1
- package/build/screens/conversation_new/components/form_list.js +2 -2
- package/build/screens/conversation_new/components/form_list.js.map +1 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.js +3 -3
- package/build/screens/conversation_new/components/gender_filter_toggle.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +10 -10
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +8 -8
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.js +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.js.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts +3 -3
- package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.js.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.js +5 -5
- package/build/screens/conversation_notification_level_select_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +3 -3
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +21 -21
- 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 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js +3 -3
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts +1 -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 +3 -3
- 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 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js +1 -1
- 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.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js +4 -4
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js.map +1 -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 +2 -2
- 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.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +4 -4
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts +2 -2
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/types/screen_props.js.map +1 -1
- package/build/screens/conversation_select_type_screen.d.ts +2 -2
- package/build/screens/conversation_select_type_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_type_screen.js +2 -2
- package/build/screens/conversation_select_type_screen.js.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.js +2 -2
- package/build/screens/conversations/components/chat_group_badge.js.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.d.ts +1 -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 +4 -4
- package/build/screens/conversations/components/list_header_action_button.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +9 -9
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +2 -2
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +3 -3
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/design_system_screen.js +6 -6
- package/build/screens/design_system_screen.js.map +1 -1
- package/build/screens/get_help_screen.js +4 -4
- package/build/screens/get_help_screen.js.map +1 -1
- package/build/screens/group_notification_level_select_screen.js +3 -3
- package/build/screens/group_notification_level_select_screen.js.map +1 -1
- package/build/screens/group_notification_settings_screen.js +3 -3
- package/build/screens/group_notification_settings_screen.js.map +1 -1
- package/build/screens/message_actions_screen.js +10 -10
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/message_report/components/message_preview.d.ts +1 -1
- package/build/screens/message_report/components/message_preview.d.ts.map +1 -1
- package/build/screens/message_report/components/message_preview.js +2 -2
- package/build/screens/message_report/components/message_preview.js.map +1 -1
- package/build/screens/message_report/components/report_reason_list.d.ts +1 -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 +4 -4
- package/build/screens/message_report/components/report_reason_list.js.map +1 -1
- package/build/screens/message_report_screen.js +7 -7
- package/build/screens/message_report_screen.js.map +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts +7 -7
- package/build/screens/notification_settings/hooks/groups.d.ts.map +1 -1
- package/build/screens/notification_settings/hooks/groups.js +4 -4
- package/build/screens/notification_settings/hooks/groups.js.map +1 -1
- package/build/screens/notification_settings_screen.js +4 -4
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/preferred_app/hooks/use_chat_types.d.ts +5 -5
- package/build/screens/preferred_app/hooks/use_chat_types.d.ts.map +1 -1
- package/build/screens/preferred_app/hooks/use_chat_types.js +1 -1
- package/build/screens/preferred_app/hooks/use_chat_types.js.map +1 -1
- package/build/screens/preferred_app_selection_screen.d.ts.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +7 -7
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/build/screens/reactions_screen.js +7 -7
- package/build/screens/reactions_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.js +8 -8
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/build/screens/team_conversation_screen.js +3 -3
- package/build/screens/team_conversation_screen.js.map +1 -1
- package/build/types/jolt_events/message_events.d.ts +1 -1
- package/build/types/jolt_events/message_events.d.ts.map +1 -1
- package/build/types/jolt_events/message_events.js.map +1 -1
- package/build/types/jolt_events/reaction_events.d.ts +1 -1
- package/build/types/jolt_events/reaction_events.d.ts.map +1 -1
- package/build/types/jolt_events/reaction_events.js.map +1 -1
- package/build/types/resources/app_grant.d.ts +1 -1
- package/build/types/resources/app_grant.d.ts.map +1 -1
- package/build/types/resources/app_grant.js.map +1 -1
- package/build/types/resources/conversation.d.ts +1 -0
- package/build/types/resources/conversation.d.ts.map +1 -1
- package/build/types/resources/conversation.js.map +1 -1
- package/build/types/resources/conversation_membership.d.ts +1 -1
- package/build/types/resources/conversation_membership.d.ts.map +1 -1
- package/build/types/resources/conversation_membership.js.map +1 -1
- package/build/types/resources/group_membership.d.ts +1 -1
- package/build/types/resources/group_membership.d.ts.map +1 -1
- package/build/types/resources/group_membership.js.map +1 -1
- package/build/types/resources/groups/groups_group_resource.d.ts +1 -1
- package/build/types/resources/groups/groups_group_resource.d.ts.map +1 -1
- package/build/types/resources/groups/groups_group_resource.js.map +1 -1
- package/build/types/resources/organization.d.ts +1 -1
- package/build/types/resources/organization.d.ts.map +1 -1
- package/build/types/resources/organization.js.map +1 -1
- package/build/types/resources/person.d.ts +1 -1
- package/build/types/resources/person.d.ts.map +1 -1
- package/build/types/resources/person.js.map +1 -1
- package/build/types/resources/services/chat_resource.d.ts +1 -1
- package/build/types/resources/services/chat_resource.d.ts.map +1 -1
- package/build/types/resources/services/chat_resource.js.map +1 -1
- package/build/types/resources/services/team_resource.d.ts +1 -1
- package/build/types/resources/services/team_resource.d.ts.map +1 -1
- package/build/types/resources/services/team_resource.js.map +1 -1
- package/build/utils/cache/messages_cache.d.ts +3 -3
- package/build/utils/cache/messages_cache.d.ts.map +1 -1
- package/build/utils/cache/messages_cache.js +3 -3
- package/build/utils/cache/messages_cache.js.map +1 -1
- package/build/utils/cache/optimistically_create_message.d.ts +2 -2
- package/build/utils/cache/optimistically_create_message.d.ts.map +1 -1
- package/build/utils/cache/optimistically_create_message.js +4 -4
- package/build/utils/cache/optimistically_create_message.js.map +1 -1
- package/build/utils/cache/optimistically_update_message.d.ts +1 -1
- package/build/utils/cache/optimistically_update_message.d.ts.map +1 -1
- package/build/utils/cache/optimistically_update_message.js +2 -2
- package/build/utils/cache/optimistically_update_message.js.map +1 -1
- package/build/utils/cache/page_mutations.d.ts +5 -5
- package/build/utils/cache/page_mutations.d.ts.map +1 -1
- package/build/utils/cache/page_mutations.js.map +1 -1
- package/build/utils/client/client.d.ts +1 -1
- package/build/utils/client/client.d.ts.map +1 -1
- package/build/utils/client/client.js.map +1 -1
- package/build/utils/convert_attachments_for_create.d.ts +2 -2
- package/build/utils/convert_attachments_for_create.d.ts.map +1 -1
- package/build/utils/convert_attachments_for_create.js.map +1 -1
- package/build/utils/destructure_chat_group_graph_id.d.ts +2 -2
- package/build/utils/destructure_chat_group_graph_id.d.ts.map +1 -1
- package/build/utils/destructure_chat_group_graph_id.js.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts +2 -2
- package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
- package/build/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.d.ts +3 -3
- package/build/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.d.ts.map +1 -1
- package/build/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.js.map +1 -1
- package/build/utils/performance_tracking.d.ts +1 -1
- package/build/utils/performance_tracking.d.ts.map +1 -1
- package/build/utils/performance_tracking.js.map +1 -1
- package/build/utils/reaction_constants.d.ts +1 -1
- package/build/utils/reaction_constants.d.ts.map +1 -1
- package/build/utils/reaction_constants.js.map +1 -1
- package/build/utils/request/conversation.d.ts +2 -2
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js.map +1 -1
- package/build/utils/request/get_features.d.ts +1 -1
- package/build/utils/request/get_features.d.ts.map +1 -1
- package/build/utils/request/get_features.js +1 -1
- package/build/utils/request/get_features.js.map +1 -1
- package/build/utils/request/get_message.d.ts +1 -1
- package/build/utils/request/get_message.d.ts.map +1 -1
- package/build/utils/request/get_message.js +1 -1
- package/build/utils/request/get_message.js.map +1 -1
- package/build/utils/request/get_messages.d.ts +1 -1
- package/build/utils/request/get_messages.d.ts.map +1 -1
- package/build/utils/request/get_messages.js +1 -1
- package/build/utils/request/get_messages.js.map +1 -1
- package/build/utils/response_error.d.ts +1 -1
- package/build/utils/response_error.d.ts.map +1 -1
- package/build/utils/response_error.js.map +1 -1
- package/build/utils/session.d.ts +1 -1
- package/build/utils/session.d.ts.map +1 -1
- package/build/utils/session.js.map +1 -1
- package/build/utils/session_manager.d.ts +1 -1
- package/build/utils/session_manager.d.ts.map +1 -1
- package/build/utils/session_manager.js.map +1 -1
- package/build/utils/styles.js +1 -1
- package/build/utils/styles.js.map +1 -1
- package/build/utils/theme.d.ts +1 -1
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js +2 -2
- package/build/utils/theme.js.map +1 -1
- package/package.json +3 -2
- package/src/__tests__/contexts/session_context.tsx +5 -5
- package/src/__tests__/event-polyfill.test.ts +3 -3
- package/src/__tests__/hooks/useTheme.tsx +2 -2
- package/src/__tests__/hooks/use_async_storage.test.tsx +1 -1
- package/src/__tests__/hooks/use_conversation_messages.ts +2 -2
- package/src/__tests__/hooks/use_font_scale.test.ts +1 -1
- package/src/__tests__/utils/cache/page_mutations.ts +1 -1
- package/src/__tests__/utils/client.ts +5 -5
- package/src/__tests__/utils/native_adapters/configuration.ts +4 -4
- package/src/__tests__/utils/parse_simple_markdown.ts +1 -1
- package/src/__tests__/utils/pluralize.tsx +1 -1
- package/src/__tests__/utils/session.ts +2 -2
- package/src/__tests__/utils/uri.ts +1 -1
- package/src/__utils__/handlers.ts +1 -1
- package/src/components/conversation/attachments/attachment_card.tsx +3 -3
- package/src/components/conversation/attachments/attachment_deleting_overlay.tsx +2 -2
- package/src/components/conversation/attachments/audio_attachment.tsx +4 -4
- package/src/components/conversation/attachments/expanded_link.tsx +4 -4
- package/src/components/conversation/attachments/generic_file_attachment.tsx +5 -5
- package/src/components/conversation/attachments/giphy_attachment.tsx +5 -5
- package/src/components/conversation/attachments/image_attachment.tsx +6 -6
- package/src/components/conversation/attachments/video_attachment.tsx +5 -5
- package/src/components/conversation/empty_conversation_blank_state.tsx +1 -1
- package/src/components/conversation/jump_to_bottom_button.tsx +3 -3
- package/src/components/conversation/message.tsx +19 -19
- package/src/components/conversation/message_attachments.tsx +5 -5
- package/src/components/conversation/message_form/message_form_attachment_image.tsx +2 -2
- package/src/components/conversation/message_form/message_form_attachment_video.tsx +2 -2
- package/src/components/conversation/message_form.tsx +17 -17
- package/src/components/conversation/message_markdown.tsx +3 -3
- package/src/components/conversation/message_reaction.tsx +8 -8
- package/src/components/conversation/message_read_receipts.tsx +3 -3
- package/src/components/conversation/messages_disabled_banners.tsx +2 -2
- package/src/components/conversation/reply_connectors.tsx +3 -3
- package/src/components/conversation/reply_shadow_message.tsx +9 -9
- package/src/components/conversation/typing_indicator.tsx +3 -3
- package/src/components/conversations/conversation_actions.tsx +6 -9
- package/src/components/conversations/conversation_preview.tsx +4 -9
- package/src/components/conversations/conversations.tsx +6 -6
- package/src/components/conversations/mute_indicator.tsx +3 -3
- package/src/components/conversations/swipeable_toggle_button.tsx +5 -5
- package/src/components/conversations/unread_count_badge.tsx +3 -3
- package/src/components/display/action_button.tsx +2 -2
- package/src/components/display/avatar.tsx +2 -2
- package/src/components/display/avatar_group.tsx +2 -2
- package/src/components/display/badge.tsx +3 -3
- package/src/components/display/banner.tsx +1 -1
- package/src/components/display/banner_collapsible.tsx +1 -1
- package/src/components/display/button.tsx +3 -3
- package/src/components/display/child_notice.tsx +3 -3
- package/src/components/display/heading.tsx +3 -3
- package/src/components/display/icon.tsx +1 -1
- package/src/components/display/icon_button.tsx +2 -2
- package/src/components/display/image.tsx +1 -1
- package/src/components/display/image_attachment_preview.tsx +2 -2
- package/src/components/display/keyboard_view.tsx +1 -1
- package/src/components/display/person.tsx +2 -2
- package/src/components/display/platform_modal_header_buttons.tsx +1 -1
- package/src/components/display/pressable_row.tsx +1 -1
- package/src/components/display/spinner.tsx +1 -1
- package/src/components/display/switch.tsx +1 -1
- package/src/components/display/tabs.tsx +1 -1
- package/src/components/display/text.tsx +2 -2
- package/src/components/display/text_button.tsx +2 -2
- package/src/components/display/text_inline_button.tsx +2 -2
- package/src/components/display/toggle_button.tsx +6 -6
- package/src/components/display/utils/button_colors.ts +1 -1
- package/src/components/display/utils/status_colors.ts +1 -1
- package/src/components/display/video_attachment_preview.tsx +3 -3
- package/src/components/group_conversation_list.tsx +5 -5
- package/src/components/page/error_boundary.tsx +2 -2
- package/src/components/page/loading.tsx +1 -1
- package/src/components/primitive/avatar_primitive.tsx +5 -5
- package/src/components/primitive/banner_primitive.tsx +11 -11
- package/src/components/primitive/blank_state_primitive.tsx +2 -2
- package/src/components/primitive/form_sheet.tsx +4 -4
- package/src/components/safe_area_modal.tsx +1 -1
- package/src/contexts/api_provider.tsx +4 -4
- package/src/contexts/chat_context.tsx +6 -6
- package/src/contexts/conversations_context.tsx +3 -3
- package/src/contexts/session_context.tsx +9 -9
- package/src/hooks/groups/use_group_members_for_new_conversation.ts +4 -4
- package/src/hooks/groups/use_groups_conversation_create.ts +3 -3
- package/src/hooks/services/use_find_or_create_services_conversation.ts +3 -3
- package/src/hooks/services/use_services_team.ts +2 -2
- package/src/hooks/services/use_team_members_for_new_conversation.ts +2 -2
- package/src/hooks/services/use_team_plans.ts +2 -2
- package/src/hooks/use_api.ts +2 -2
- package/src/hooks/use_api_client.ts +3 -3
- package/src/hooks/use_async_storage.ts +1 -1
- package/src/hooks/use_attachment_uploader.ts +5 -5
- package/src/hooks/use_broadcast_typing_status.ts +1 -1
- package/src/hooks/use_chat_permissions.ts +1 -1
- package/src/hooks/use_conversation.ts +5 -4
- package/src/hooks/use_conversation_jolt_events.ts +3 -3
- package/src/hooks/use_conversation_membership.ts +3 -3
- package/src/hooks/use_conversation_message.ts +2 -2
- package/src/hooks/use_conversation_messages.ts +2 -2
- package/src/hooks/use_conversation_messages_jolt_events.ts +14 -14
- package/src/hooks/use_conversations.ts +2 -2
- package/src/hooks/use_conversations_actions.ts +2 -2
- package/src/hooks/use_conversations_cache.ts +5 -5
- package/src/hooks/use_conversations_jolt_events.ts +4 -4
- package/src/hooks/use_current_person.ts +2 -2
- package/src/hooks/use_features.ts +4 -4
- package/src/hooks/use_giphy.ts +2 -2
- package/src/hooks/use_groups.ts +2 -2
- package/src/hooks/use_groups_groups.ts +1 -1
- package/src/hooks/use_jolt.ts +3 -3
- package/src/hooks/use_live_relative_time.ts +2 -2
- package/src/hooks/use_mark_latest_message_read.ts +1 -1
- package/src/hooks/use_message_create_or_update.ts +11 -11
- package/src/hooks/use_message_draft.ts +2 -2
- package/src/hooks/use_message_reaction_toggle.ts +4 -4
- package/src/hooks/use_my_gender.ts +1 -1
- package/src/hooks/use_organization.ts +1 -1
- package/src/hooks/use_people_person.ts +1 -1
- package/src/hooks/use_product_analytics.ts +5 -5
- package/src/hooks/use_qualified_by_age.ts +1 -1
- package/src/hooks/use_read_receipts.ts +1 -1
- package/src/hooks/use_report_message.ts +2 -2
- package/src/hooks/use_storage.ts +1 -1
- package/src/hooks/use_submit_age_check.ts +2 -2
- package/src/hooks/use_suspense_api.ts +5 -5
- package/src/hooks/use_teams.ts +1 -1
- package/src/hooks/use_theme.tsx +2 -2
- package/src/hooks/use_typing_indicators.ts +1 -1
- package/src/hooks/use_typing_status_cache.ts +1 -1
- package/src/hooks/use_upload_client.ts +3 -3
- package/src/navigation/chat_access_gate.tsx +7 -7
- package/src/navigation/index.tsx +31 -34
- package/src/navigation/screenLayout.tsx +2 -2
- package/src/polyfills/events/Event.ts +1 -1
- package/src/polyfills/events/EventTarget.ts +1 -1
- package/src/polyfills/events/internals/EventInternals.ts +2 -2
- package/src/polyfills/events/internals/EventTargetInternals.ts +2 -2
- package/src/screens/age_check/age_check_required_screen.tsx +8 -8
- package/src/screens/age_check/age_check_underage_screen.tsx +3 -3
- package/src/screens/age_check/components/age_check_select_birthdate_modal.tsx +3 -3
- package/src/screens/attachment_actions/attachment_actions_screen.tsx +1 -1
- package/src/screens/attachment_actions/hooks/useDeleteAttachment.tsx +3 -3
- package/src/screens/bug_report_screen.tsx +11 -11
- package/src/screens/conversation/message_read_receipts_screen.tsx +5 -5
- package/src/screens/conversation_details_screen.tsx +47 -12
- package/src/screens/conversation_filter_recipients/components/checkbox_row.tsx +8 -4
- package/src/screens/conversation_filter_recipients/components/header_row.tsx +5 -5
- package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +6 -6
- package/src/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.tsx +5 -1
- package/src/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.ts +6 -3
- package/src/screens/conversation_filter_recipients/types.tsx +1 -1
- package/src/screens/conversation_filters/components/conversation_filters.tsx +8 -5
- package/src/screens/conversation_filters/components/rows.tsx +9 -14
- package/src/screens/conversation_filters/context/conversation_filter_context.tsx +4 -1
- package/src/screens/conversation_filters/group_filters.tsx +1 -1
- package/src/screens/conversation_filters/hooks/filters.ts +5 -5
- package/src/screens/conversation_filters/screen_props.ts +1 -1
- package/src/screens/conversation_filters/team_filters.tsx +1 -1
- package/src/screens/conversation_filters_screen.tsx +1 -1
- package/src/screens/conversation_new/components/filter_by_plan.tsx +7 -7
- package/src/screens/conversation_new/components/form_list.tsx +3 -3
- package/src/screens/conversation_new/components/gender_filter_toggle.tsx +3 -3
- package/src/screens/conversation_new/components/groups_form.tsx +14 -14
- package/src/screens/conversation_new/components/services_form.tsx +10 -10
- package/src/screens/conversation_new/components/source_app_error_card.tsx +1 -1
- package/src/screens/conversation_new/conversation_new_screen.tsx +3 -3
- package/src/screens/conversation_notification_level_select_screen.tsx +6 -6
- package/src/screens/conversation_screen.tsx +23 -23
- package/src/screens/conversation_select_recipients/components/groups_recipient_row.tsx +2 -2
- package/src/screens/conversation_select_recipients/components/recipient_link_row.tsx +3 -3
- package/src/screens/conversation_select_recipients/components/restricted_group_row.tsx +4 -4
- package/src/screens/conversation_select_recipients/components/team_recipient_row.tsx +2 -2
- package/src/screens/conversation_select_recipients/components/view_more_link_row.tsx +1 -1
- package/src/screens/conversation_select_recipients/conversation_new_entry_screen.tsx +4 -4
- package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +3 -3
- package/src/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.tsx +7 -4
- package/src/screens/conversation_select_recipients/types/screen_props.tsx +2 -2
- package/src/screens/conversation_select_type_screen.tsx +4 -4
- package/src/screens/conversations/components/chat_group_badge.tsx +4 -4
- package/src/screens/conversations/components/list_header_action_button.tsx +4 -4
- package/src/screens/conversations/components/list_header_component.tsx +10 -10
- package/src/screens/conversations/conversations_screen.tsx +5 -5
- package/src/screens/design_system_screen.tsx +6 -6
- package/src/screens/get_help_screen.tsx +5 -5
- package/src/screens/group_notification_level_select_screen.tsx +3 -3
- package/src/screens/group_notification_settings_screen.tsx +3 -3
- package/src/screens/message_actions_screen.tsx +12 -12
- package/src/screens/message_report/components/message_preview.tsx +3 -3
- package/src/screens/message_report/components/report_reason_list.tsx +4 -7
- package/src/screens/message_report_screen.tsx +11 -11
- package/src/screens/notification_settings/hooks/groups.ts +6 -6
- package/src/screens/notification_settings_screen.tsx +4 -4
- package/src/screens/preferred_app/hooks/use_chat_types.ts +2 -2
- package/src/screens/preferred_app_selection_screen.tsx +7 -7
- package/src/screens/reactions_screen.tsx +9 -9
- package/src/screens/send_giphy_screen.tsx +8 -8
- package/src/screens/team_conversation_screen.tsx +3 -3
- package/src/types/jolt_events/message_events.ts +1 -1
- package/src/types/jolt_events/reaction_events.ts +1 -1
- package/src/types/resources/app_grant.ts +1 -1
- package/src/types/resources/conversation.ts +1 -0
- package/src/types/resources/conversation_membership.ts +1 -1
- package/src/types/resources/group_membership.ts +1 -1
- package/src/types/resources/groups/groups_group_resource.ts +1 -1
- package/src/types/resources/organization.ts +1 -1
- package/src/types/resources/person.ts +1 -1
- package/src/types/resources/services/chat_resource.ts +1 -1
- package/src/types/resources/services/team_resource.ts +1 -1
- package/src/utils/__tests__/convert_attachments_for_create.test.ts +3 -3
- package/src/utils/__tests__/session_manager.test.ts +3 -3
- package/src/utils/__tests__/sha_256.test.ts +1 -1
- package/src/utils/cache/messages_cache.ts +5 -5
- package/src/utils/cache/optimistically_create_message.ts +7 -7
- package/src/utils/cache/optimistically_update_message.ts +3 -3
- package/src/utils/cache/page_mutations.ts +1 -1
- package/src/utils/client/client.ts +1 -1
- package/src/utils/convert_attachments_for_create.ts +2 -2
- package/src/utils/destructure_chat_group_graph_id.ts +2 -2
- package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +4 -4
- package/src/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.ts +3 -3
- package/src/utils/performance_tracking.ts +1 -1
- package/src/utils/reaction_constants.ts +1 -1
- package/src/utils/request/conversation.ts +2 -2
- package/src/utils/request/get_features.ts +1 -1
- package/src/utils/request/get_message.ts +1 -1
- package/src/utils/request/get_messages.ts +1 -1
- package/src/utils/response_error.ts +1 -1
- package/src/utils/session.ts +1 -1
- package/src/utils/session_manager.ts +1 -1
- package/src/utils/styles.ts +1 -1
- package/src/utils/theme.ts +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { MemberResource, TeamPeopleResource } from '
|
|
1
|
+
import { MemberResource, TeamPeopleResource } from '@/types';
|
|
2
2
|
interface Props {
|
|
3
3
|
teamIds: number[];
|
|
4
4
|
planId?: number;
|
|
5
5
|
}
|
|
6
6
|
export declare function useTeamMembersForNewConversation({ teamIds, planId }: Props): {
|
|
7
|
-
error: import("
|
|
7
|
+
error: import("@/types").FailedResponse;
|
|
8
8
|
isError: true;
|
|
9
9
|
isPending: false;
|
|
10
10
|
isLoading: false;
|
|
@@ -16,7 +16,7 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
16
16
|
dataUpdatedAt: number;
|
|
17
17
|
errorUpdatedAt: number;
|
|
18
18
|
failureCount: number;
|
|
19
|
-
failureReason: import("
|
|
19
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
20
20
|
errorUpdateCount: number;
|
|
21
21
|
isFetched: boolean;
|
|
22
22
|
isFetchedAfterMount: boolean;
|
|
@@ -25,9 +25,9 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
25
25
|
isPaused: boolean;
|
|
26
26
|
isRefetching: boolean;
|
|
27
27
|
isStale: boolean;
|
|
28
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
28
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<TeamPeopleResource>, import("@/types").FailedResponse>>;
|
|
29
29
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
30
|
-
promise: Promise<import("
|
|
30
|
+
promise: Promise<import("@/types").ApiResource<TeamPeopleResource>>;
|
|
31
31
|
links?: Record<string, string> | undefined;
|
|
32
32
|
meta?: Record<string, unknown> | undefined;
|
|
33
33
|
members: MemberResource[];
|
|
@@ -44,7 +44,7 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
44
44
|
dataUpdatedAt: number;
|
|
45
45
|
errorUpdatedAt: number;
|
|
46
46
|
failureCount: number;
|
|
47
|
-
failureReason: import("
|
|
47
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
48
48
|
errorUpdateCount: number;
|
|
49
49
|
isFetched: boolean;
|
|
50
50
|
isFetchedAfterMount: boolean;
|
|
@@ -53,14 +53,14 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
53
53
|
isPaused: boolean;
|
|
54
54
|
isRefetching: boolean;
|
|
55
55
|
isStale: boolean;
|
|
56
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
56
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<TeamPeopleResource>, import("@/types").FailedResponse>>;
|
|
57
57
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
58
|
-
promise: Promise<import("
|
|
58
|
+
promise: Promise<import("@/types").ApiResource<TeamPeopleResource>>;
|
|
59
59
|
links?: Record<string, string> | undefined;
|
|
60
60
|
meta?: Record<string, unknown> | undefined;
|
|
61
61
|
members: MemberResource[];
|
|
62
62
|
} | {
|
|
63
|
-
error: import("
|
|
63
|
+
error: import("@/types").FailedResponse;
|
|
64
64
|
isError: true;
|
|
65
65
|
isPending: false;
|
|
66
66
|
isLoading: false;
|
|
@@ -72,7 +72,7 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
72
72
|
dataUpdatedAt: number;
|
|
73
73
|
errorUpdatedAt: number;
|
|
74
74
|
failureCount: number;
|
|
75
|
-
failureReason: import("
|
|
75
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
76
76
|
errorUpdateCount: number;
|
|
77
77
|
isFetched: boolean;
|
|
78
78
|
isFetchedAfterMount: boolean;
|
|
@@ -81,9 +81,9 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
81
81
|
isPaused: boolean;
|
|
82
82
|
isRefetching: boolean;
|
|
83
83
|
isStale: boolean;
|
|
84
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
84
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<TeamPeopleResource>, import("@/types").FailedResponse>>;
|
|
85
85
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
86
|
-
promise: Promise<import("
|
|
86
|
+
promise: Promise<import("@/types").ApiResource<TeamPeopleResource>>;
|
|
87
87
|
links?: Record<string, string> | undefined;
|
|
88
88
|
meta?: Record<string, unknown> | undefined;
|
|
89
89
|
members: MemberResource[];
|
|
@@ -100,7 +100,7 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
100
100
|
dataUpdatedAt: number;
|
|
101
101
|
errorUpdatedAt: number;
|
|
102
102
|
failureCount: number;
|
|
103
|
-
failureReason: import("
|
|
103
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
104
104
|
errorUpdateCount: number;
|
|
105
105
|
isFetched: boolean;
|
|
106
106
|
isFetchedAfterMount: boolean;
|
|
@@ -109,9 +109,9 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
109
109
|
isPaused: boolean;
|
|
110
110
|
isRefetching: boolean;
|
|
111
111
|
isStale: boolean;
|
|
112
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
112
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<TeamPeopleResource>, import("@/types").FailedResponse>>;
|
|
113
113
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
114
|
-
promise: Promise<import("
|
|
114
|
+
promise: Promise<import("@/types").ApiResource<TeamPeopleResource>>;
|
|
115
115
|
links?: Record<string, string> | undefined;
|
|
116
116
|
meta?: Record<string, unknown> | undefined;
|
|
117
117
|
members: MemberResource[];
|
|
@@ -127,7 +127,7 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
127
127
|
dataUpdatedAt: number;
|
|
128
128
|
errorUpdatedAt: number;
|
|
129
129
|
failureCount: number;
|
|
130
|
-
failureReason: import("
|
|
130
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
131
131
|
errorUpdateCount: number;
|
|
132
132
|
isFetched: boolean;
|
|
133
133
|
isFetchedAfterMount: boolean;
|
|
@@ -137,9 +137,9 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
137
137
|
isPaused: boolean;
|
|
138
138
|
isRefetching: boolean;
|
|
139
139
|
isStale: boolean;
|
|
140
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
140
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<TeamPeopleResource>, import("@/types").FailedResponse>>;
|
|
141
141
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
142
|
-
promise: Promise<import("
|
|
142
|
+
promise: Promise<import("@/types").ApiResource<TeamPeopleResource>>;
|
|
143
143
|
links?: Record<string, string> | undefined;
|
|
144
144
|
meta?: Record<string, unknown> | undefined;
|
|
145
145
|
members: MemberResource[];
|
|
@@ -156,7 +156,7 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
156
156
|
dataUpdatedAt: number;
|
|
157
157
|
errorUpdatedAt: number;
|
|
158
158
|
failureCount: number;
|
|
159
|
-
failureReason: import("
|
|
159
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
160
160
|
errorUpdateCount: number;
|
|
161
161
|
isFetched: boolean;
|
|
162
162
|
isFetchedAfterMount: boolean;
|
|
@@ -165,9 +165,9 @@ export declare function useTeamMembersForNewConversation({ teamIds, planId }: Pr
|
|
|
165
165
|
isPaused: boolean;
|
|
166
166
|
isRefetching: boolean;
|
|
167
167
|
isStale: boolean;
|
|
168
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
168
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<TeamPeopleResource>, import("@/types").FailedResponse>>;
|
|
169
169
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
170
|
-
promise: Promise<import("
|
|
170
|
+
promise: Promise<import("@/types").ApiResource<TeamPeopleResource>>;
|
|
171
171
|
links?: Record<string, string> | undefined;
|
|
172
172
|
meta?: Record<string, unknown> | undefined;
|
|
173
173
|
members: MemberResource[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_team_members_for_new_conversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/services/use_team_members_for_new_conversation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use_team_members_for_new_conversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/services/use_team_members_for_new_conversation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAA0B,MAAM,SAAS,CAAA;AAEpF,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,wBAAgB,gCAAgC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2B1E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNil, omitBy } from 'lodash';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { useApiGet } from '
|
|
3
|
+
import { useApiGet } from '@/hooks/use_api';
|
|
4
4
|
export function useTeamMembersForNewConversation({ teamIds, planId }) {
|
|
5
5
|
const params = omitBy({ team_id: teamIds.join(','), plan_id: planId }, isNil);
|
|
6
6
|
const { data, ...rest } = useApiGet({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_team_members_for_new_conversation.js","sourceRoot":"","sources":["../../../src/hooks/services/use_team_members_for_new_conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"use_team_members_for_new_conversation.js","sourceRoot":"","sources":["../../../src/hooks/services/use_team_members_for_new_conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAQ3C,MAAM,UAAU,gCAAgC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAS;IACzE,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,CAAA;IAE7E,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,CAAqB;QACtD,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE;YACJ,GAAG,MAAM;YACT,MAAM,EAAE;gBACN,IAAI,EAAE,CAAC,QAAQ,CAAC;aACjB;SACF;QACD,GAAG,EAAE,UAAU;KAChB,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,sBAAsB,CAAA;IAErD,MAAM,OAAO,GAAqB,OAAO,CAAC,GAAG,EAAE;QAC7C,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC3B,GAAG,MAAM;YACT,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC,CAAA;IACL,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAEZ,OAAO;QACL,OAAO;QACP,GAAG,IAAI;KACR,CAAA;AACH,CAAC;AAED,MAAM,sBAAsB,GAA6B,EAAE,CAAA","sourcesContent":["import { isNil, omitBy } from 'lodash'\nimport { useMemo } from 'react'\nimport { useApiGet } from '@/hooks/use_api'\nimport { MemberResource, TeamPeopleResource, TeamPersonResponseItem } from '@/types'\n\ninterface Props {\n teamIds: number[]\n planId?: number\n}\n\nexport function useTeamMembersForNewConversation({ teamIds, planId }: Props) {\n const params = omitBy({ team_id: teamIds.join(','), plan_id: planId }, isNil)\n\n const { data, ...rest } = useApiGet<TeamPeopleResource>({\n url: '/chat',\n data: {\n ...params,\n fields: {\n Chat: ['people'],\n },\n },\n app: 'services',\n })\n\n const people = data?.people || stableEmptyPersonArray\n\n const members: MemberResource[] = useMemo(() => {\n return people.map(person => ({\n ...person,\n type: 'Member',\n }))\n }, [people])\n\n return {\n members,\n ...rest,\n }\n}\n\nconst stableEmptyPersonArray: TeamPersonResponseItem[] = []\n"]}
|
|
@@ -12,6 +12,6 @@ export declare function useTeamPlans({ teamIds }: {
|
|
|
12
12
|
planOptions: PlanListItem[];
|
|
13
13
|
isFetching: boolean;
|
|
14
14
|
isError: boolean;
|
|
15
|
-
findPlan: (id: number | undefined) => 0 | import("
|
|
15
|
+
findPlan: (id: number | undefined) => 0 | import("@/types").PlansResponseItem | undefined;
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=use_team_plans.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQueries } from '@tanstack/react-query';
|
|
2
2
|
import { groupBy, keyBy, uniqBy } from 'lodash';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { useApiClient } from '
|
|
4
|
+
import { useApiClient } from '@/hooks/use_api_client';
|
|
5
5
|
export function useTeamPlans({ teamIds }) {
|
|
6
6
|
const apiClient = useApiClient();
|
|
7
7
|
const planQueries = useQueries({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_team_plans.js","sourceRoot":"","sources":["../../../src/hooks/services/use_team_plans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"use_team_plans.js","sourceRoot":"","sources":["../../../src/hooks/services/use_team_plans.ts"],"names":[],"mappings":"AA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Q,EAAE,KAAK,EAAE;YACzB,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAgB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;SACjF,EACD,EAAE,CACH,CAAA;QAED,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;IAEjB,OAAO;QACL,WAAW,EAAE,eAAe;QAC5B,UAAU,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC;QAC5D,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC;QACnD,QAAQ,EAAE,CAAC,EAAsB,EAAE,EAAE,CAAC,EAAE,IAAI,SAAS,CAAC,EAAE,CAAC;KAC1D,CAAA;AACH,CAAC;AAED,MAAM,aAAa,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA;AAEvF,SAAS,cAAc,CAAC,SAAoB,EAAE,MAAc;IAC1D,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,CAA6B;QACxD,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,MAAM,EAAE;gBACN,IAAI,EAAE,CAAC,OAAO,CAAC;aAChB;SACF;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { useQueries } from '@tanstack/react-query'\nimport { groupBy, keyBy, uniqBy } from 'lodash'\nimport { useMemo } from 'react'\nimport { ApiClient, useApiClient } from '@/hooks/use_api_client'\nimport { ApiResource, PlansResource } from '@/types'\n\nexport type PlanListItem =\n | { type: 'header'; title: string }\n | { type: 'plan'; value: number; name: string }\n\nexport function useTeamPlans({ teamIds }: { teamIds: number[] }) {\n const apiClient = useApiClient()\n const planQueries = useQueries({\n queries: teamIds.map(teamId => ({\n queryKey: ['plansForTeam', teamId],\n queryFn: () => fetchTeamPlans(apiClient, teamId),\n initialData: NULL_RESPONSE,\n retry: false,\n })),\n })\n\n const [planIndex, flatPlanOptions] = useMemo(() => {\n const planOptions = planQueries.flatMap(({ data }) => data?.data.plans).filter(p => !!p)\n const uniqPlanOptions = uniqBy(planOptions, 'value')\n const groupedPlanOptions = groupBy(uniqPlanOptions, 'group')\n\n const options = Object.entries(groupedPlanOptions).reduce<PlanListItem[]>(\n (acc, [title, plans]): PlanListItem[] => [\n ...acc,\n { type: 'header', title },\n ...plans.map(({ value, name }): PlanListItem => ({ type: 'plan', value, name })),\n ],\n []\n )\n\n return [keyBy(uniqPlanOptions, 'value'), options]\n }, [planQueries])\n\n return {\n planOptions: flatPlanOptions,\n isFetching: planQueries.some(({ isFetching }) => isFetching),\n isError: planQueries.some(({ isError }) => isError),\n findPlan: (id: number | undefined) => id && planIndex[id],\n }\n}\n\nconst NULL_RESPONSE = { data: { id: 0, plans: [], type: 'Chat' }, links: {}, meta: {} }\n\nfunction fetchTeamPlans(apiClient: ApiClient, teamId: number) {\n return apiClient.services.get<ApiResource<PlansResource>>({\n url: '/chat',\n data: {\n team_id: teamId,\n fields: {\n Chat: ['plans'],\n },\n },\n })\n}\n"]}
|
package/build/hooks/use_api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyUseSuspenseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
|
|
2
|
-
import { ApiCollection, ApiResource, FailedResponse, ResourceObject } from '../types';
|
|
3
|
-
import { GetRequest } from '../utils/client';
|
|
4
2
|
import { App } from './use_api_client';
|
|
3
|
+
import { ApiCollection, ApiResource, FailedResponse, ResourceObject } from '@/types';
|
|
4
|
+
import { GetRequest } from '@/utils/client';
|
|
5
5
|
interface ApiGetOptions extends GetRequest {
|
|
6
6
|
app?: App;
|
|
7
7
|
enabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_api.d.ts","sourceRoot":"","sources":["../../src/hooks/use_api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,YAAY,EAGb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use_api.d.ts","sourceRoot":"","sources":["../../src/hooks/use_api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,YAAY,EAGb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAgB,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACpF,OAAO,EAAE,UAAU,EAAe,MAAM,gBAAgB,CAAA;AAExD,UAAU,aAAc,SAAQ,UAAU;IACxC,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EAAE,QAAQ,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAezF,CAAA;AAOD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,kCAAkC,EAClC,kBAAkB,GAAG,kBAAkB,GAAG,SAAS,GAAG,UAAU,CACjE,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,cAAc,QAChD,aAAa,SACZ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCxB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_api.js","sourceRoot":"","sources":["../../src/hooks/use_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAChB,QAAQ,GACT,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"use_api.js","sourceRoot":"","sources":["../../src/hooks/use_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAChB,QAAQ,GACT,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAO,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAmB,MAAM,oBAAoB,CAAA;AASxE,MAAM,CAAC,MAAM,SAAS,GAAG,CAA8C,IAAmB,EAAE,EAAE;IAE5F,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,QAAQ,CAA2B;QAC5D,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC;QAClC,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;YACxB,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,MAAM,CAAC,GAAG,QAA2B,CAAA;YAEnE,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,E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AAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAA;YAC3C,IAAI,MAAM;gBAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAA;YAE7C,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;KAChB,CAAC,CAAA;IAEF,MAAM,IAAI,GAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAErE,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,CAAA;AAC3B,CAAC,CAAA","sourcesContent":["import {\n AnyUseSuspenseInfiniteQueryOptions,\n InfiniteData,\n useInfiniteQuery,\n useQuery,\n} from '@tanstack/react-query'\nimport { App, useApiClient } from './use_api_client'\nimport { getRequestQueryKey, RequestQueryKey } from './use_suspense_api'\nimport { ApiCollection, ApiResource, FailedResponse, ResourceObject } from '@/types'\nimport { GetRequest, RequestData } from '@/utils/client'\n\ninterface ApiGetOptions extends GetRequest {\n app?: App\n enabled?: boolean\n}\n\nexport const useApiGet = <T extends ResourceObject | ResourceObject[]>(args: ApiGetOptions) => {\n type Resource = ApiResource<T>\n const apiClient = useApiClient()\n\n const { data, ...query } = useQuery<Resource, FailedResponse>({\n queryKey: getRequestQueryKey(args),\n queryFn: ({ queryKey }) => {\n const [url, d, headers, app = 'chat'] = queryKey as RequestQueryKey\n\n return apiClient[app].get({ url, data: d, headers }) as Promise<Resource>\n },\n enabled: args.enabled,\n })\n\n return { ...data, ...query }\n}\n\ntype NextMeta = Partial<{\n offset: string\n idLt: string\n}>\n\nexport type PaginatorOptions = Omit<\n AnyUseSuspenseInfiniteQueryOptions,\n 'getNextPageParam' | 'initialPageParam' | 'queryFn' | 'queryKey'\n>\n\nexport const useApiPaginator = <T extends ResourceObject>(\n args: ApiGetOptions,\n opts?: PaginatorOptions\n) => {\n const apiClient = useApiClient()\n const query = useInfiniteQuery<\n ApiCollection<T>,\n FailedResponse,\n InfiniteData<ApiCollection<T>>,\n any,\n Partial<RequestData> | undefined\n >({\n queryKey: getRequestQueryKey(args),\n queryFn: ({ pageParam }) => {\n const pageParmWhere = pageParam?.where || {}\n const argsWhere = args.data.where || {}\n const where = { ...argsWhere, ...pageParmWhere }\n const app = args.app || 'chat'\n const offset = pageParam?.offset || args.data.offset\n const data = { ...args.data, where, offset }\n\n return apiClient[app].get<ApiCollection<T>>({\n url: args.url,\n data,\n })\n },\n initialPageParam: {} as Partial<RequestData>,\n getNextPageParam: lastPage => {\n const next: NextMeta = lastPage.meta?.next || {}\n const { offset, idLt } = next\n\n if (idLt) return { where: { id_lt: idLt } }\n if (offset) return { offset: Number(offset) }\n\n return undefined\n },\n enabled: args.enabled,\n ...(opts || {}),\n })\n\n const data: T[] = query.data?.pages?.flatMap(page => page.data) || []\n\n return { ...query, data }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_api_client.d.ts","sourceRoot":"","sources":["../../src/hooks/use_api_client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use_api_client.d.ts","sourceRoot":"","sources":["../../src/hooks/use_api_client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEvC,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAA;AAG3D,MAAM,MAAM,SAAS,GAAG;KAAG,EAAE,IAAI,GAAG,GAAG,MAAM;CAAE,CAAA;AAE/C,eAAO,MAAM,YAAY,iBAoBxB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContext, useMemo } from 'react';
|
|
2
|
-
import { ChatContext } from '
|
|
3
|
-
import { Uri } from '
|
|
4
|
-
import { Client } from '
|
|
2
|
+
import { ChatContext } from '@/contexts/chat_context';
|
|
3
|
+
import { Uri } from '@/utils';
|
|
4
|
+
import { Client } from '@/utils/client';
|
|
5
5
|
const apps = ['chat', 'groups', 'services', 'people'];
|
|
6
6
|
export const useApiClient = () => {
|
|
7
7
|
const { session, onUnauthorizedResponse } = useContext(ChatContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_api_client.js","sourceRoot":"","sources":["../../src/hooks/use_api_client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use_api_client.js","sourceRoot":"","sources":["../../src/hooks/use_api_client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAGvC,MAAM,IAAI,GAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAA;AAI5D,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IAEnE,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAE1D,MAAM,GAAG,GAAG,OAAO,CACjB,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACvB,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,MAAM,CAAC;YACpB,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC;YAC3B,cAAc,EAAE,GAAG,CAAC,OAAO;YAC3B,OAAO,EAAE,YAAY;YACrB,sBAAsB;SACvB,CAAC,CAAA;QACF,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAAe,CAAC,EACrB,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAC9B,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA","sourcesContent":["import { useContext, useMemo } from 'react'\nimport { ChatContext } from '@/contexts/chat_context'\nimport { Uri } from '@/utils'\nimport { Client } from '@/utils/client'\n\nexport type App = 'chat' | 'groups' | 'services' | 'people'\nconst apps: App[] = ['chat', 'groups', 'services', 'people']\n\nexport type ApiClient = { [_K in App]: Client }\n\nexport const useApiClient = () => {\n const { session, onUnauthorizedResponse } = useContext(ChatContext)\n\n const uri = useMemo(() => new Uri({ session }), [session])\n\n const api = useMemo(\n () =>\n apps.reduce((acc, app) => {\n acc[app] = new Client({\n root: uri.api(`/${app}/v2`),\n defaultHeaders: uri.headers,\n version: '2018-11-01',\n onUnauthorizedResponse,\n })\n return acc\n }, {} as ApiClient),\n [uri, onUnauthorizedResponse]\n )\n\n return api\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Storage } from '../utils/native_adapters';
|
|
2
1
|
import { useStorage } from './use_storage';
|
|
2
|
+
import { Storage } from '@/utils/native_adapters';
|
|
3
3
|
export function useAsyncStorage(key, initialValue, throwOnError = false) {
|
|
4
4
|
return useStorage(Storage, key, initialValue, throwOnError);
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_async_storage.js","sourceRoot":"","sources":["../../src/hooks/use_async_storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use_async_storage.js","sourceRoot":"","sources":["../../src/hooks/use_async_storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAIjD,MAAM,UAAU,eAAe,CAC7B,GAAW,EACX,YAAwB,EACxB,eAAwB,KAAK;IAE7B,OAAO,UAAU,CAAa,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,CAAC,CAAA;AACzE,CAAC","sourcesContent":["import { useStorage } from './use_storage'\nimport { Storage } from '@/utils/native_adapters'\n\ntype SetValue<TCacheData> = (_itemValue?: TCacheData | null) => Promise<void>\n\nexport function useAsyncStorage<TCacheData>(\n key: string,\n initialValue: TCacheData,\n throwOnError: boolean = false\n): [TCacheData, SetValue<TCacheData>] {\n return useStorage<TCacheData>(Storage, key, initialValue, throwOnError)\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileAttachment, NativeAttachmentFile } from '
|
|
1
|
+
import { FileAttachment, NativeAttachmentFile } from '@/types/resources/denormalized_attachment_resource_for_create';
|
|
2
2
|
export interface FileError {
|
|
3
3
|
file_type?: string[];
|
|
4
4
|
file_size?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_attachment_uploader.d.ts","sourceRoot":"","sources":["../../src/hooks/use_attachment_uploader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use_attachment_uploader.d.ts","sourceRoot":"","sources":["../../src/hooks/use_attachment_uploader.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EAEd,oBAAoB,EACrB,MAAM,+DAA+D,CAAA;AAEtE,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAMD,wBAAgB,qBAAqB,CAAC,EACpC,cAAc,EACd,gBAAgB,GACjB,EAAE;IACD,cAAc,EAAE,MAAM,CAAA;IAC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AC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,wBAAwB,GAAG,WAAW,CAAC,GAAG,EAAE;QAChD,cAAc,CAAC,eAAe,CAAC,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IAC5E,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,cAAc,CAAC,EAAE,CAAC,CAAA;QAClB,eAAe,CAAC,IAAI,CAAC,CAAA;IACvB,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;IACnF,MAAM,sBAAsB,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAA;IAExE,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAY,CAAC,EACtF,CAAC,WAAW,CAAC,CACd,CAAA;IAED,OAAO;QACL,WAAW;QACX,aAAa;QACb,mBAAmB;QACnB,gBAAgB;QAChB,wBAAwB;QACxB,KAAK;QACL,cAAc;QACd,YAAY;QACZ,sBAAsB;QACtB,mBAAmB,EAAE,yBAAyB,GAAG,mBAAmB;KACrE,CAAA;AACH,CAAC","sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { ApiResource } from '../types'\nimport {\n FileAttachment,\n FileUploadState,\n NativeAttachmentFile,\n} from '../types/resources/denormalized_attachment_resource_for_create'\nimport { SUPPORTED_EXTENSIONS } from './attachments/supported_extensions'\nimport { useApiClient } from './use_api_client'\nimport { useUploadClient } from './use_upload_client'\n\nexport interface FileError {\n file_type?: string[]\n file_size?: boolean\n}\n\nconst MAX_FILE_SIZE_IN_MB = 50\nconst MAX_FILE_SIZE_IN_BYTES = MAX_FILE_SIZE_IN_MB * 1024 * 1024\nconst MAX_NUMBER_OF_ATTACHMENTS = 10\n\nexport function useAttachmentUploader({\n conversationId,\n draftAttachments,\n}: {\n conversationId: number\n draftAttachments?: FileAttachment[]\n}) {\n const apiClient = useApiClient()\n const uploadApi = useUploadClient()\n const [attachments, setAttachments] = useState<FileAttachment[]>(() => draftAttachments || [])\n const uploadState = useRef<FileUploadState>({})\n const [lastUploadId, setLastUploadId] = useState<string>()\n const numberOfAttachments = attachments.length\n const [errorMessage, setErrorMessage] = useState<string | null>(null)\n\n const handleFilesAttached = useCallback(\n (files: NativeAttachmentFile[]) => {\n const fileErrors = {} as FileError\n\n const validFiles = files.filter(file => {\n const extension = file.name.split('.').pop() as string\n const isValidExtension = SUPPORTED_EXTENSIONS.includes(`.${extension}`)\n const isValidFileSize = file.size <= MAX_FILE_SIZE_IN_BYTES\n\n if (!isValidExtension) {\n fileErrors.file_type ||= []\n fileErrors.file_type.push(extension)\n }\n if (!isValidFileSize) {\n fileErrors.file_size = true\n }\n\n return isValidFileSize && isValidExtension\n })\n\n const errorMessages: string[] = []\n if (fileErrors.file_type) {\n errorMessages.push(\n `The following file types are not supported: ${fileErrors.file_type.join(', ')}`\n )\n }\n if (fileErrors.file_size) {\n errorMessages.push(`File size exceeds ${MAX_FILE_SIZE_IN_MB} MB`)\n }\n if (numberOfAttachments + validFiles.length > MAX_NUMBER_OF_ATTACHMENTS) {\n errorMessages.push(`You can't attach more than ${MAX_NUMBER_OF_ATTACHMENTS} files at once.`)\n }\n if (errorMessages.length > 0) {\n setErrorMessage(errorMessages.join('\\n'))\n return\n }\n\n const newAttachments: FileAttachment[] = validFiles.map(file => ({\n file,\n status: 'uploading',\n uploadedAt: Date.now(),\n }))\n\n if (newAttachments && newAttachments.length > 0) {\n setAttachments(prevAttachments => [...prevAttachments, ...newAttachments])\n\n newAttachments.forEach(attachment => {\n uploadApi\n .uploadFile(attachment.file)\n .then(({ id: uploadedFileId }) =>\n apiClient.chat.post<ApiResource<MessageAttachmentResource>>({\n url: `/me/conversations/${conversationId}/message_attachments`,\n data: {\n data: {\n type: 'MessageAttachment',\n attributes: { uploaded_file_id: uploadedFileId },\n },\n },\n })\n )\n .then(({ data: { id: messageAttachmentId } }) => {\n uploadState.current[attachment.file.name] = {\n status: 'success',\n id: messageAttachmentId,\n }\n setLastUploadId(messageAttachmentId)\n })\n .catch(err => {\n const isFlagged = err?.code === 'image_flagged'\n uploadState.current[attachment.file.name] = {\n status: 'error',\n flagged: isFlagged,\n }\n if (!isFlagged) {\n setErrorMessage('This file could not be uploaded.')\n }\n setLastUploadId(attachment.file.name)\n })\n })\n }\n },\n [numberOfAttachments, uploadApi, apiClient.chat, conversationId]\n )\n\n useEffect(() => {\n if (!lastUploadId) return\n\n setLastUploadId(undefined)\n setAttachments(\n attachments.map(attachment => {\n // Don't risk overwriting ids already set\n if (attachment.id) return attachment\n\n const state = uploadState.current[attachment.file.name]\n if (state) {\n return { ...attachment, id: state.id, status: state.status, flagged: state.flagged }\n }\n return attachment\n })\n )\n }, [attachments, lastUploadId])\n\n const removeAttachment = useCallback((attachment: FileAttachment) => {\n setAttachments(prevAttachments =>\n prevAttachments.filter(a => a.file.uri !== attachment.file.uri)\n )\n }, [])\n\n const removeFlaggedAttachments = useCallback(() => {\n setAttachments(prevAttachments => prevAttachments.filter(a => !a.flagged))\n }, [])\n\n const reset = useCallback(() => {\n setAttachments([])\n setErrorMessage(null)\n }, [])\n\n const pendingUploads = attachments.filter(a => a.status === 'uploading').length > 0\n const flaggedAttachmentCount = attachments.filter(a => a.flagged).length\n\n const attachmentIds = useMemo(\n () => attachments.filter(a => a.status === 'success' && a.id).map(a => a.id as string),\n [attachments]\n )\n\n return {\n attachments,\n attachmentIds,\n handleFilesAttached,\n removeAttachment,\n removeFlaggedAttachments,\n reset,\n pendingUploads,\n errorMessage,\n flaggedAttachmentCount,\n remainingAttachable: MAX_NUMBER_OF_ATTACHMENTS - numberOfAttachments,\n }\n}\n\ninterface MessageAttachmentResource {\n type: 'MessageAttachment'\n id: string\n uploadedFileId: string\n filename: string\n messageSortKey: string\n metadata: Record<string, unknown>\n checksum: string\n contentType: string\n byteSize: number\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use_attachment_uploader.js","sourceRoot":"","sources":["../../src/hooks/use_attachment_uploader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAarD,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAC9B,MAAM,sBAAsB,GAAG,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAAA;AAChE,MAAM,yBAAyB,GAAG,EAAE,CAAA;AAEpC,MAAM,UAAU,qBAAqB,CAAC,EACpC,cAAc,EACd,gBAAgB,GAIjB;IACC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,SAAS,GAAG,eAAe,EAAE,CAAA;IACnC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAmB,GAAG,EAAE,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAA;IAC9F,MAAM,WAAW,GAAG,MAAM,CAAkB,EAAE,CAAC,CAAA;IAC/C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,EAAU,CAAA;IAC1D,MAAM,mB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QACd,YAAY;QACZ,sBAAsB;QACtB,mBAAmB,EAAE,yBAAyB,GAAG,mBAAmB;KACrE,CAAA;AACH,CAAC","sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { SUPPORTED_EXTENSIONS } from './attachments/supported_extensions'\nimport { useApiClient } from './use_api_client'\nimport { useUploadClient } from './use_upload_client'\nimport { ApiResource } from '@/types'\nimport {\n FileAttachment,\n FileUploadState,\n NativeAttachmentFile,\n} from '@/types/resources/denormalized_attachment_resource_for_create'\n\nexport interface FileError {\n file_type?: string[]\n file_size?: boolean\n}\n\nconst MAX_FILE_SIZE_IN_MB = 50\nconst MAX_FILE_SIZE_IN_BYTES = MAX_FILE_SIZE_IN_MB * 1024 * 1024\nconst MAX_NUMBER_OF_ATTACHMENTS = 10\n\nexport function useAttachmentUploader({\n conversationId,\n draftAttachments,\n}: {\n conversationId: number\n draftAttachments?: FileAttachment[]\n}) {\n const apiClient = useApiClient()\n const uploadApi = useUploadClient()\n const [attachments, setAttachments] = useState<FileAttachment[]>(() => draftAttachments || [])\n const uploadState = useRef<FileUploadState>({})\n const [lastUploadId, setLastUploadId] = useState<string>()\n const numberOfAttachments = attachments.length\n const [errorMessage, setErrorMessage] = useState<string | null>(null)\n\n const handleFilesAttached = useCallback(\n (files: NativeAttachmentFile[]) => {\n const fileErrors = {} as FileError\n\n const validFiles = files.filter(file => {\n const extension = file.name.split('.').pop() as string\n const isValidExtension = SUPPORTED_EXTENSIONS.includes(`.${extension}`)\n const isValidFileSize = file.size <= MAX_FILE_SIZE_IN_BYTES\n\n if (!isValidExtension) {\n fileErrors.file_type ||= []\n fileErrors.file_type.push(extension)\n }\n if (!isValidFileSize) {\n fileErrors.file_size = true\n }\n\n return isValidFileSize && isValidExtension\n })\n\n const errorMessages: string[] = []\n if (fileErrors.file_type) {\n errorMessages.push(\n `The following file types are not supported: ${fileErrors.file_type.join(', ')}`\n )\n }\n if (fileErrors.file_size) {\n errorMessages.push(`File size exceeds ${MAX_FILE_SIZE_IN_MB} MB`)\n }\n if (numberOfAttachments + validFiles.length > MAX_NUMBER_OF_ATTACHMENTS) {\n errorMessages.push(`You can't attach more than ${MAX_NUMBER_OF_ATTACHMENTS} files at once.`)\n }\n if (errorMessages.length > 0) {\n setErrorMessage(errorMessages.join('\\n'))\n return\n }\n\n const newAttachments: FileAttachment[] = validFiles.map(file => ({\n file,\n status: 'uploading',\n uploadedAt: Date.now(),\n }))\n\n if (newAttachments && newAttachments.length > 0) {\n setAttachments(prevAttachments => [...prevAttachments, ...newAttachments])\n\n newAttachments.forEach(attachment => {\n uploadApi\n .uploadFile(attachment.file)\n .then(({ id: uploadedFileId }) =>\n apiClient.chat.post<ApiResource<MessageAttachmentResource>>({\n url: `/me/conversations/${conversationId}/message_attachments`,\n data: {\n data: {\n type: 'MessageAttachment',\n attributes: { uploaded_file_id: uploadedFileId },\n },\n },\n })\n )\n .then(({ data: { id: messageAttachmentId } }) => {\n uploadState.current[attachment.file.name] = {\n status: 'success',\n id: messageAttachmentId,\n }\n setLastUploadId(messageAttachmentId)\n })\n .catch(err => {\n const isFlagged = err?.code === 'image_flagged'\n uploadState.current[attachment.file.name] = {\n status: 'error',\n flagged: isFlagged,\n }\n if (!isFlagged) {\n setErrorMessage('This file could not be uploaded.')\n }\n setLastUploadId(attachment.file.name)\n })\n })\n }\n },\n [numberOfAttachments, uploadApi, apiClient.chat, conversationId]\n )\n\n useEffect(() => {\n if (!lastUploadId) return\n\n setLastUploadId(undefined)\n setAttachments(\n attachments.map(attachment => {\n // Don't risk overwriting ids already set\n if (attachment.id) return attachment\n\n const state = uploadState.current[attachment.file.name]\n if (state) {\n return { ...attachment, id: state.id, status: state.status, flagged: state.flagged }\n }\n return attachment\n })\n )\n }, [attachments, lastUploadId])\n\n const removeAttachment = useCallback((attachment: FileAttachment) => {\n setAttachments(prevAttachments =>\n prevAttachments.filter(a => a.file.uri !== attachment.file.uri)\n )\n }, [])\n\n const removeFlaggedAttachments = useCallback(() => {\n setAttachments(prevAttachments => prevAttachments.filter(a => !a.flagged))\n }, [])\n\n const reset = useCallback(() => {\n setAttachments([])\n setErrorMessage(null)\n }, [])\n\n const pendingUploads = attachments.filter(a => a.status === 'uploading').length > 0\n const flaggedAttachmentCount = attachments.filter(a => a.flagged).length\n\n const attachmentIds = useMemo(\n () => attachments.filter(a => a.status === 'success' && a.id).map(a => a.id as string),\n [attachments]\n )\n\n return {\n attachments,\n attachmentIds,\n handleFilesAttached,\n removeAttachment,\n removeFlaggedAttachments,\n reset,\n pendingUploads,\n errorMessage,\n flaggedAttachmentCount,\n remainingAttachable: MAX_NUMBER_OF_ATTACHMENTS - numberOfAttachments,\n }\n}\n\ninterface MessageAttachmentResource {\n type: 'MessageAttachment'\n id: string\n uploadedFileId: string\n filename: string\n messageSortKey: string\n metadata: Record<string, unknown>\n checksum: string\n contentType: string\n byteSize: number\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useRef } from 'react';
|
|
2
|
-
import { useConversationContext } from '../contexts/conversation_context';
|
|
3
2
|
import { useApiClient } from './use_api_client';
|
|
3
|
+
import { useConversationContext } from '@/contexts/conversation_context';
|
|
4
4
|
const THROTTLE_INTERVAL = 3000; // 3 seconds
|
|
5
5
|
/**
|
|
6
6
|
* Hook for broadcasting typing status to other users in a conversation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_broadcast_typing_status.js","sourceRoot":"","sources":["../../src/hooks/use_broadcast_typing_status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use_broadcast_typing_status.js","sourceRoot":"","sources":["../../src/hooks/use_broadcast_typing_status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AAExE,MAAM,iBAAiB,GAAG,IAAI,CAAA,CAAC,YAAY;AAE3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,MAAM,EAAE,cAAc,EAAE,sBAAsB,EAAE,GAAG,sBAAsB,EAAE,CAAA;IAC3E,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,iBAAiB,GAAG,MAAM,CAAS,CAAC,CAAC,CAAA;IAE3C,MAAM,qBAAqB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAEtB,IAAI,GAAG,GAAG,iBAAiB,CAAC,OAAO,GAAG,iBAAiB,EAAE,CAAC;YACxD,OAAM;QACR,CAAC;QAED,iBAAiB,CAAC,OAAO,GAAG,GAAG,CAAA;QAE/B,SAAS,CAAC,IAAI;aACX,IAAI,CAAC;YACJ,GAAG,EAAE,qBAAqB,cAAc,0BAA0B;YAClE,IAAI,EAAE;gBACJ,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,EAAE,aAAa,EAAE,sBAAsB,EAAE,EAAE;aACtF;SACF,CAAC;aACD,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAA;QAC5D,CAAC,CAAC,CAAA;IACN,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,sBAAsB,CAAC,CAAC,CAAA;IAE5D,OAAO,qBAAqB,CAAA;AAC9B,CAAC,CAAA","sourcesContent":["import { useCallback, useRef } from 'react'\nimport { useApiClient } from './use_api_client'\nimport { useConversationContext } from '@/contexts/conversation_context'\n\nconst THROTTLE_INTERVAL = 3000 // 3 seconds\n\n/**\n * Hook for broadcasting typing status to other users in a conversation\n *\n * We only broadcast once every 3 seconds, but we show the typing indicator for 6 seconds\n * after receiving a typing event. This is how we can show a steady typing indicator even\n * if the user types once every 2.9 seconds.\n */\nexport const useBroadcastTypingStatus = () => {\n const { conversationId, currentPageReplyRootId } = useConversationContext()\n const apiClient = useApiClient()\n const lastBroadcastTime = useRef<number>(0)\n\n const broadcastTypingStatus = useCallback(() => {\n const now = Date.now()\n\n if (now - lastBroadcastTime.current < THROTTLE_INTERVAL) {\n return\n }\n\n lastBroadcastTime.current = now\n\n apiClient.chat\n .post({\n url: `/me/conversations/${conversationId}/broadcast_typing_status`,\n data: {\n data: { type: 'TypingStatus', attributes: { reply_root_id: currentPageReplyRootId } },\n },\n })\n .catch(error => {\n console.error('Failed to broadcast typing status:', error)\n })\n }, [apiClient.chat, conversationId, currentPageReplyRootId])\n\n return broadcastTypingStatus\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AppGrantsResource } from '../types';
|
|
2
1
|
import { App } from './use_api_client';
|
|
2
|
+
import { AppGrantsResource } from '@/types';
|
|
3
3
|
export declare const appGrantsRequestArgs: {
|
|
4
4
|
url: string;
|
|
5
5
|
data: {
|
|
@@ -10,7 +10,7 @@ export declare const appGrantsRequestArgs: {
|
|
|
10
10
|
app: App;
|
|
11
11
|
};
|
|
12
12
|
export declare function useAppGrants(): {
|
|
13
|
-
error: import("
|
|
13
|
+
error: import("@/types").FailedResponse;
|
|
14
14
|
isError: true;
|
|
15
15
|
isPending: false;
|
|
16
16
|
isLoading: false;
|
|
@@ -22,7 +22,7 @@ export declare function useAppGrants(): {
|
|
|
22
22
|
dataUpdatedAt: number;
|
|
23
23
|
errorUpdatedAt: number;
|
|
24
24
|
failureCount: number;
|
|
25
|
-
failureReason: import("
|
|
25
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
26
26
|
errorUpdateCount: number;
|
|
27
27
|
isFetched: boolean;
|
|
28
28
|
isFetchedAfterMount: boolean;
|
|
@@ -31,9 +31,9 @@ export declare function useAppGrants(): {
|
|
|
31
31
|
isPaused: boolean;
|
|
32
32
|
isRefetching: boolean;
|
|
33
33
|
isStale: boolean;
|
|
34
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
34
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<AppGrantsResource[]>, import("@/types").FailedResponse>>;
|
|
35
35
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
36
|
-
promise: Promise<import("
|
|
36
|
+
promise: Promise<import("@/types").ApiResource<AppGrantsResource[]>>;
|
|
37
37
|
data?: AppGrantsResource[] | undefined;
|
|
38
38
|
links?: Record<string, string> | undefined;
|
|
39
39
|
meta?: Record<string, unknown> | undefined;
|
|
@@ -50,7 +50,7 @@ export declare function useAppGrants(): {
|
|
|
50
50
|
dataUpdatedAt: number;
|
|
51
51
|
errorUpdatedAt: number;
|
|
52
52
|
failureCount: number;
|
|
53
|
-
failureReason: import("
|
|
53
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
54
54
|
errorUpdateCount: number;
|
|
55
55
|
isFetched: boolean;
|
|
56
56
|
isFetchedAfterMount: boolean;
|
|
@@ -59,14 +59,14 @@ export declare function useAppGrants(): {
|
|
|
59
59
|
isPaused: boolean;
|
|
60
60
|
isRefetching: boolean;
|
|
61
61
|
isStale: boolean;
|
|
62
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
62
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<AppGrantsResource[]>, import("@/types").FailedResponse>>;
|
|
63
63
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
64
|
-
promise: Promise<import("
|
|
64
|
+
promise: Promise<import("@/types").ApiResource<AppGrantsResource[]>>;
|
|
65
65
|
data?: AppGrantsResource[] | undefined;
|
|
66
66
|
links?: Record<string, string> | undefined;
|
|
67
67
|
meta?: Record<string, unknown> | undefined;
|
|
68
68
|
} | {
|
|
69
|
-
error: import("
|
|
69
|
+
error: import("@/types").FailedResponse;
|
|
70
70
|
isError: true;
|
|
71
71
|
isPending: false;
|
|
72
72
|
isLoading: false;
|
|
@@ -78,7 +78,7 @@ export declare function useAppGrants(): {
|
|
|
78
78
|
dataUpdatedAt: number;
|
|
79
79
|
errorUpdatedAt: number;
|
|
80
80
|
failureCount: number;
|
|
81
|
-
failureReason: import("
|
|
81
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
82
82
|
errorUpdateCount: number;
|
|
83
83
|
isFetched: boolean;
|
|
84
84
|
isFetchedAfterMount: boolean;
|
|
@@ -87,9 +87,9 @@ export declare function useAppGrants(): {
|
|
|
87
87
|
isPaused: boolean;
|
|
88
88
|
isRefetching: boolean;
|
|
89
89
|
isStale: boolean;
|
|
90
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
90
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<AppGrantsResource[]>, import("@/types").FailedResponse>>;
|
|
91
91
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
92
|
-
promise: Promise<import("
|
|
92
|
+
promise: Promise<import("@/types").ApiResource<AppGrantsResource[]>>;
|
|
93
93
|
data?: AppGrantsResource[] | undefined;
|
|
94
94
|
links?: Record<string, string> | undefined;
|
|
95
95
|
meta?: Record<string, unknown> | undefined;
|
|
@@ -106,7 +106,7 @@ export declare function useAppGrants(): {
|
|
|
106
106
|
dataUpdatedAt: number;
|
|
107
107
|
errorUpdatedAt: number;
|
|
108
108
|
failureCount: number;
|
|
109
|
-
failureReason: import("
|
|
109
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
110
110
|
errorUpdateCount: number;
|
|
111
111
|
isFetched: boolean;
|
|
112
112
|
isFetchedAfterMount: boolean;
|
|
@@ -115,9 +115,9 @@ export declare function useAppGrants(): {
|
|
|
115
115
|
isPaused: boolean;
|
|
116
116
|
isRefetching: boolean;
|
|
117
117
|
isStale: boolean;
|
|
118
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
118
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<AppGrantsResource[]>, import("@/types").FailedResponse>>;
|
|
119
119
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
120
|
-
promise: Promise<import("
|
|
120
|
+
promise: Promise<import("@/types").ApiResource<AppGrantsResource[]>>;
|
|
121
121
|
data?: AppGrantsResource[] | undefined;
|
|
122
122
|
links?: Record<string, string> | undefined;
|
|
123
123
|
meta?: Record<string, unknown> | undefined;
|
|
@@ -133,7 +133,7 @@ export declare function useAppGrants(): {
|
|
|
133
133
|
dataUpdatedAt: number;
|
|
134
134
|
errorUpdatedAt: number;
|
|
135
135
|
failureCount: number;
|
|
136
|
-
failureReason: import("
|
|
136
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
137
137
|
errorUpdateCount: number;
|
|
138
138
|
isFetched: boolean;
|
|
139
139
|
isFetchedAfterMount: boolean;
|
|
@@ -143,9 +143,9 @@ export declare function useAppGrants(): {
|
|
|
143
143
|
isPaused: boolean;
|
|
144
144
|
isRefetching: boolean;
|
|
145
145
|
isStale: boolean;
|
|
146
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
146
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<AppGrantsResource[]>, import("@/types").FailedResponse>>;
|
|
147
147
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
148
|
-
promise: Promise<import("
|
|
148
|
+
promise: Promise<import("@/types").ApiResource<AppGrantsResource[]>>;
|
|
149
149
|
data?: AppGrantsResource[] | undefined;
|
|
150
150
|
links?: Record<string, string> | undefined;
|
|
151
151
|
meta?: Record<string, unknown> | undefined;
|
|
@@ -162,7 +162,7 @@ export declare function useAppGrants(): {
|
|
|
162
162
|
dataUpdatedAt: number;
|
|
163
163
|
errorUpdatedAt: number;
|
|
164
164
|
failureCount: number;
|
|
165
|
-
failureReason: import("
|
|
165
|
+
failureReason: import("@/types").FailedResponse | null;
|
|
166
166
|
errorUpdateCount: number;
|
|
167
167
|
isFetched: boolean;
|
|
168
168
|
isFetchedAfterMount: boolean;
|
|
@@ -171,9 +171,9 @@ export declare function useAppGrants(): {
|
|
|
171
171
|
isPaused: boolean;
|
|
172
172
|
isRefetching: boolean;
|
|
173
173
|
isStale: boolean;
|
|
174
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("
|
|
174
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@/types").ApiResource<AppGrantsResource[]>, import("@/types").FailedResponse>>;
|
|
175
175
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
176
|
-
promise: Promise<import("
|
|
176
|
+
promise: Promise<import("@/types").ApiResource<AppGrantsResource[]>>;
|
|
177
177
|
data?: AppGrantsResource[] | undefined;
|
|
178
178
|
links?: Record<string, string> | undefined;
|
|
179
179
|
meta?: Record<string, unknown> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_chat_permissions.d.ts","sourceRoot":"","sources":["../../src/hooks/use_chat_permissions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use_chat_permissions.d.ts","sourceRoot":"","sources":["../../src/hooks/use_chat_permissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,oBAAoB;;;;;;;SAOhB,GAAG;CACnB,CAAA;AAED,wBAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE3B;AAED,wBAAgB,yBAAyB,IAAI,OAAO,CAInD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_chat_permissions.js","sourceRoot":"","sources":["../../src/hooks/use_chat_permissions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use_chat_permissions.js","sourceRoot":"","sources":["../../src/hooks/use_chat_permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAIrC,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,GAAG,EAAE,gBAAgB;IACrB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,QAAQ,EAAE,CAAC,sBAAsB,EAAE,UAAU,CAAC;SAC/C;KACF;IACD,GAAG,EAAE,MAAa;CACnB,CAAA;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,SAAS,CAAsB,oBAAoB,CAAC,CAAA;AAC7D,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,YAAY,EAAE,CAAA;IAE/C,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAA;AACjE,CAAC","sourcesContent":["import { useApiGet } from './use_api'\nimport { App } from './use_api_client'\nimport { AppGrantsResource } from '@/types'\n\nexport const appGrantsRequestArgs = {\n url: '/me/app_grants',\n data: {\n fields: {\n AppGrant: ['create_conversations', 'app_name'],\n },\n },\n app: 'chat' as App,\n}\n\nexport function useAppGrants() {\n return useApiGet<AppGrantsResource[]>(appGrantsRequestArgs)\n}\n\nexport function useCanCreateConversations(): boolean {\n const { data: appGrants = [] } = useAppGrants()\n\n return appGrants.some(appGrant => appGrant.createConversations)\n}\n"]}
|