From 512f9affb15e6af96af5e5b3ad7a8ee68ad1c3a2 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Thu, 9 Nov 2023 16:22:49 +0530 Subject: [PATCH 01/21] refactor: iOS Gallery refresh files change (#2298) --- .../handlers/iOS14RefreshGallerySelection.ts | 17 -------------- package/expo-package/src/handlers/index.ts | 1 + .../oniOS14GalleryLibrarySelectionChange.ts | 22 +++++++++++++++++++ 3 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 package/expo-package/src/handlers/oniOS14GalleryLibrarySelectionChange.ts diff --git a/package/expo-package/src/handlers/iOS14RefreshGallerySelection.ts b/package/expo-package/src/handlers/iOS14RefreshGallerySelection.ts index ce890b7d91..f724987222 100644 --- a/package/expo-package/src/handlers/iOS14RefreshGallerySelection.ts +++ b/package/expo-package/src/handlers/iOS14RefreshGallerySelection.ts @@ -4,23 +4,6 @@ import * as MediaLibrary from 'expo-media-library'; const isAboveIOS14 = Platform.OS === 'ios' && parseInt(Platform.Version as string, 10) >= 14; -export function oniOS14GalleryLibrarySelectionChange(callback: () => void): { - unsubscribe: () => void; -} { - if (isAboveIOS14) { - const subscription = MediaLibrary.addListener(callback); - return { - unsubscribe: () => { - subscription.remove(); - }, - }; - } - return { - // eslint-disable-next-line @typescript-eslint/no-empty-function - unsubscribe: () => {}, - }; -} - export const iOS14RefreshGallerySelection = (): Promise => { if (isAboveIOS14) { return MediaLibrary.presentPermissionsPickerAsync(); diff --git a/package/expo-package/src/handlers/index.ts b/package/expo-package/src/handlers/index.ts index 3bf2396a36..ede055d7b3 100644 --- a/package/expo-package/src/handlers/index.ts +++ b/package/expo-package/src/handlers/index.ts @@ -4,6 +4,7 @@ export * from './getLocalAssetUri'; export * from './getPhotos'; export * from './iOS14RefreshGallerySelection'; export * from './NetInfo'; +export * from './oniOS14GalleryLibrarySelectionChange'; export * from './saveFile'; export * from './Sound'; export * from './takePhoto'; diff --git a/package/expo-package/src/handlers/oniOS14GalleryLibrarySelectionChange.ts b/package/expo-package/src/handlers/oniOS14GalleryLibrarySelectionChange.ts new file mode 100644 index 0000000000..f41a57d28f --- /dev/null +++ b/package/expo-package/src/handlers/oniOS14GalleryLibrarySelectionChange.ts @@ -0,0 +1,22 @@ +import { Platform } from 'react-native'; + +import * as MediaLibrary from 'expo-media-library'; + +const isAboveIOS14 = Platform.OS === 'ios' && parseInt(Platform.Version as string, 10) >= 14; + +export function oniOS14GalleryLibrarySelectionChange(callback: () => void): { + unsubscribe: () => void; +} { + if (isAboveIOS14) { + const subscription = MediaLibrary.addListener(callback); + return { + unsubscribe: () => { + subscription.remove(); + }, + }; + } + return { + // eslint-disable-next-line @typescript-eslint/no-empty-function + unsubscribe: () => {}, + }; +} From 899aaf2219ff8f2d0c536000f93ea584c0ee7a7a Mon Sep 17 00:00:00 2001 From: Manuel de la Torre Date: Sun, 12 Nov 2023 23:16:42 -0600 Subject: [PATCH 02/21] feat: Add Spanish translations (#2292) --- .../docs/reactnative/basics/translations.mdx | 16 +++-- package/src/i18n/es.json | 72 +++++++++++++++++++ package/src/utils/Streami18n.ts | 19 +++-- 3 files changed, 95 insertions(+), 12 deletions(-) create mode 100644 package/src/i18n/es.json diff --git a/docusaurus/docs/reactnative/basics/translations.mdx b/docusaurus/docs/reactnative/basics/translations.mdx index eabd6e7551..c318435a16 100644 --- a/docusaurus/docs/reactnative/basics/translations.mdx +++ b/docusaurus/docs/reactnative/basics/translations.mdx @@ -10,14 +10,16 @@ The React Native SDK's UI Components are available in multiple languages out-of- At the moment we support the following languages (and more will be added in the future): - [English (en)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/en.json) +- [Spanish (es)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/es.json) - [French (fr)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/fr.json) +- [Hebrew (he)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/he.json) - [Hindi (hi)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/hi.json) - [Italian (it)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/it.json) -- [Dutch (nl)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/nl.json) -- [Turkish (tr)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/tr.json) -- [Russian (ru)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/ru.json) - [Japanese (ja)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/ja.json) - [Korean (ko)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/ko.json) +- [Dutch (nl)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/nl.json) +- [Russian (ru)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/ru.json) +- [Turkish (tr)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/tr.json) ## Usage @@ -252,14 +254,16 @@ Language code for language to be used. The following options are available: - English (`en`) +- Spanish (`es`) - French (`fr`) +- Hebrew (`he`) - Hindi (`hi`) - Italian (`it`) -- Dutch (`nl`) -- Turkish (`tr`) -- Russian (`ru`) - Japanese (`ja`) - Korean (`ko`) +- Dutch (`nl`) +- Russian (`ru`) +- Turkish (`tr`) | TYPE | DEFAULT | | ------ | ------- | diff --git a/package/src/i18n/es.json b/package/src/i18n/es.json new file mode 100644 index 0000000000..e1e044a46d --- /dev/null +++ b/package/src/i18n/es.json @@ -0,0 +1,72 @@ +{ + "1 Reply": "1 respuesta", + "1 Thread Reply": "1 respuesta de hilo", + "Allow access to your Gallery": "Permitir acceso a tu galería", + "Also send to channel": "También enviar al canal", + "Are you sure you want to permanently delete this message?": "¿Estás seguro de que deseas eliminar permanentemente este mensaje?", + "Block User": "Bloquear usuario", + "Cancel": "Cancelar", + "Cannot Flag Message": "No se puede reportar el mensaje", + "Copy Message": "Copiar mensaje", + "Delete": "Eliminar", + "Delete Message": "Eliminar mensaje", + "Do you want to send a copy of this message to a moderator for further investigation?": "¿Deseas enviar una copia de este mensaje a un moderador para una investigación adicional?", + "Edit Message": "Editar mensaje", + "Editing Message": "Editando mensaje", + "Emoji matching": "Coincidencia de emoji", + "Empty message...": "Mensaje vacío...", + "Error loading": "Error al cargar", + "Error loading channel list...": "Error al cargar la lista de canales...", + "Error loading messages for this channel...": "Error al cargar los mensajes de este canal...", + "Error while loading, please reload/refresh": "Error al cargar, por favor recarga/actualiza", + "File type not supported": "Tipo de archivo no admitido", + "Flag": "Reportar", + "Flag Message": "Reportar mensaje", + "Flag action failed either due to a network issue or the message is already flagged": "El reporte falló debido a un problema de red o el mensaje ya fue reportado.", + "Instant Commands": "Comandos instantáneos", + "Links are disabled": "Los enlaces están desactivados", + "Loading channels...": "Cargando canales...", + "Loading messages...": "Cargando mensajes...", + "Loading...": "Cargando...", + "Message Reactions": "Reacciones al mensaje", + "Message deleted": "Mensaje eliminado", + "Message flagged": "Mensaje reportado", + "Mute User": "Silenciar usuario", + "Not supported": "No admitido", + "Nothing yet...": "Aún no hay nada...", + "Ok": "Aceptar", + "Only visible to you": "Solo visible para ti", + "Photo": "Foto", + "Photos": "Fotos", + "Photos and Videos": "Fotos y videos", + "Pin to Conversation": "Fijar a la conversación", + "Pinned by": "Fijado por", + "Please enable access to your photos and videos so you can share them.": "Por favor, habilita el acceso a tus fotos y videos para poder compartirlos.", + "Please select a channel first": "Por favor, selecciona primero un canal", + "Reconnecting...": "Reconectando...", + "Reply": "Responder", + "Reply to Message": "Responder al mensaje", + "Resend": "Reenviar", + "Search GIFs": "Buscar GIFs", + "Send a message": "Enviar un mensaje", + "Sending links is not allowed in this conversation": "No está permitido enviar enlaces en esta conversación", + "Slow mode ON": "Modo lento ACTIVADO", + "The message has been reported to a moderator.": "El mensaje ha sido reportado a un moderador.", + "Thread Reply": "Respuesta de hilo", + "Unblock User": "Desbloquear usuario", + "Unknown User": "Usuario desconocido", + "Unmute User": "Activar sonido del usuario", + "Unpin from Conversation": "Desmarcar de la conversación", + "Unread Messages": "Mensajes no leídos", + "Video": "Video", + "You": "Tú", + "You can't send messages in this channel": "No puedes enviar mensajes en este canal", + "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} y {{ nonSelfUserLength }} más están escribiendo", + "{{ index }} of {{ photoLength }}": "{{ index }} de {{ photoLength }}", + "{{ replyCount }} Replies": "{{ replyCount }} Respuestas", + "{{ replyCount }} Thread Replies": "{{ replyCount }} respuestas de hilo", + "{{ user }} is typing": "{{ user }} está escribiendo", + "Select More Photos": "Seleccionar más fotos", + "🏙 Attachment...": "🏙 Adjunto...", + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "El archivo supera el tamaño máximo permitido. Por favor, selecciona un archivo menor a {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB." +} diff --git a/package/src/utils/Streami18n.ts b/package/src/utils/Streami18n.ts index 1dbc2359a9..99775aabf8 100644 --- a/package/src/utils/Streami18n.ts +++ b/package/src/utils/Streami18n.ts @@ -10,6 +10,7 @@ import type moment from 'moment'; import type { TDateTimeParser } from '../contexts/translationContext/TranslationContext'; import enTranslations from '../i18n/en.json'; +import esTranslations from '../i18n/es.json'; import frTranslations from '../i18n/fr.json'; import heTranslations from '../i18n/he.json'; import hiTranslations from '../i18n/hi.json'; @@ -20,7 +21,9 @@ import nlTranslations from '../i18n/nl.json'; import ruTranslations from '../i18n/ru.json'; import trTranslations from '../i18n/tr.json'; +import 'dayjs/locale/es'; import 'dayjs/locale/fr'; +import 'dayjs/locale/he'; import 'dayjs/locale/hi'; import 'dayjs/locale/it'; import 'dayjs/locale/ja'; @@ -28,7 +31,6 @@ import 'dayjs/locale/ko'; import 'dayjs/locale/nl'; import 'dayjs/locale/ru'; import 'dayjs/locale/tr'; -import 'dayjs/locale/he'; /** * These locale imports also set these locales globally. @@ -192,12 +194,16 @@ type I18NextConfig = { * Instance of this class should be provided to Chat component to handle translations. * Stream provides following list of in-built translations: * 1. English (en) - * 2. Dutch (nl) - * 3. Russian (ru) - * 4. Turkish (tr) - * 5. French (fr) + * 2. Spanish (es) + * 3. French (fr) + * 4. Hebrew (he) + * 5. Hindi (hi) * 6. Italian (it) - * 7. Hindi (hi) + * 7. Japanese (ja) + * 8. Korean (ko) + * 9. Dutch (nl) + * 10. Russian (ru) + * 11. Turkish (tr) * * Simplest way to start using chat components in one of the in-built languages would be following: * @@ -370,6 +376,7 @@ export class Streami18n { }; } = { en: { [defaultNS]: enTranslations }, + es: { [defaultNS]: esTranslations }, fr: { [defaultNS]: frTranslations }, he: { [defaultNS]: heTranslations }, hi: { [defaultNS]: hiTranslations }, From 9bfa40873d6996bb5f08818f7a78e02d3b0edc9a Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Mon, 13 Nov 2023 17:07:05 +0530 Subject: [PATCH 03/21] fix: auto restart video in gallery when end reached on Expo (#2304) --- .../components/ImageGallery/ImageGallery.tsx | 1 + .../components/ImageGalleryFooter.tsx | 8 ++++++-- .../components/ImageGalleryVideoControl.tsx | 19 ++++++++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/package/src/components/ImageGallery/ImageGallery.tsx b/package/src/components/ImageGallery/ImageGallery.tsx index 74743fd7f0..da2ad0d50f 100644 --- a/package/src/components/ImageGallery/ImageGallery.tsx +++ b/package/src/components/ImageGallery/ImageGallery.tsx @@ -669,6 +669,7 @@ export const ImageGallery = < photoLength={imageGalleryAttachments.length} progress={imageGalleryAttachments[selectedIndex].progress || 0} selectedIndex={selectedIndex} + videoRef={videoRef} visible={headerFooterVisible} {...imageGalleryCustomComponents?.footer} /> diff --git a/package/src/components/ImageGallery/components/ImageGalleryFooter.tsx b/package/src/components/ImageGallery/components/ImageGalleryFooter.tsx index ba90c2dcdc..f8fac5cd32 100644 --- a/package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +++ b/package/src/components/ImageGallery/components/ImageGalleryFooter.tsx @@ -7,7 +7,7 @@ import { ImageGalleryVideoControl } from './ImageGalleryVideoControl'; import { useTheme } from '../../../contexts/themeContext/ThemeContext'; import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext'; import { Grid as GridIconDefault, Share as ShareIconDefault } from '../../../icons'; -import { deleteFile, saveFile, shareImage } from '../../../native'; +import { deleteFile, saveFile, shareImage, VideoType } from '../../../native'; import type { DefaultStreamChatGenerics } from '../../../types/types'; import type { Photo } from '../ImageGallery'; @@ -67,6 +67,7 @@ export type ImageGalleryFooterVideoControlProps = { onPlayPause: (status?: boolean) => void; paused: boolean; progress: number; + videoRef: React.RefObject; }; export type ImageGalleryFooterVideoControlComponent = ({ @@ -100,6 +101,7 @@ type ImageGalleryFooterPropsWithContext< photoLength: number; progress: number; selectedIndex: number; + videoRef: React.RefObject; visible: Animated.SharedValue; }; @@ -125,6 +127,7 @@ export const ImageGalleryFooterWithContext = < selectedIndex, ShareIcon, videoControlElement, + videoRef, visible, } = props; @@ -181,13 +184,14 @@ export const ImageGalleryFooterWithContext = < {photo.type === 'video' ? ( videoControlElement ? ( - videoControlElement({ duration, onPlayPause, paused, progress }) + videoControlElement({ duration, onPlayPause, paused, progress, videoRef }) ) : ( ) ) : null} diff --git a/package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx b/package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx index 3de10f858e..d80798d0c5 100644 --- a/package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +++ b/package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx @@ -35,7 +35,7 @@ const styles = StyleSheet.create({ export const ImageGalleryVideoControl: React.FC = React.memo( (props) => { - const { duration, onPlayPause, paused, progress } = props; + const { duration, onPlayPause, paused, progress, videoRef } = props; const videoDuration = duration ? duration / 3600 >= 1 @@ -60,14 +60,19 @@ export const ImageGalleryVideoControl: React.FC { + if (progress === 1) { + // For expo CLI + if (videoRef.current?.setPositionAsync) { + await videoRef.current.setPositionAsync(0); + } + } + onPlayPause(); + }; + return ( - { - onPlayPause(); - }} - > + {paused ? ( From c30bd361716d94fd8a3b85cb46a5ad63a8211044 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Tue, 14 Nov 2023 12:20:20 +0530 Subject: [PATCH 04/21] feat: add theme to override the reaction list icon color (#2306) --- package/src/components/Message/MessageSimple/ReactionList.tsx | 3 ++- package/src/contexts/themeContext/utils/theme.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package/src/components/Message/MessageSimple/ReactionList.tsx b/package/src/components/Message/MessageSimple/ReactionList.tsx index f517b9136b..ca8b7576df 100644 --- a/package/src/components/Message/MessageSimple/ReactionList.tsx +++ b/package/src/components/Message/MessageSimple/ReactionList.tsx @@ -121,6 +121,7 @@ const ReactionListWithContext = < avatarWrapper: { leftAlign, spacer }, reactionList: { container, + iconFillColor, middleIcon, radius: themeRadius, reactionBubble, @@ -263,7 +264,7 @@ const ReactionListWithContext = < {reactions.map((reaction) => ( Date: Tue, 14 Nov 2023 12:57:46 +0530 Subject: [PATCH 05/21] feat: add empty channel list translations (#2307) --- package/src/components/Indicators/EmptyStateIndicator.tsx | 6 ++++-- package/src/i18n/en.json | 4 +++- package/src/i18n/es.json | 4 +++- package/src/i18n/fr.json | 4 +++- package/src/i18n/he.json | 4 +++- package/src/i18n/hi.json | 4 +++- package/src/i18n/it.json | 4 +++- package/src/i18n/ja.json | 4 +++- package/src/i18n/ko.json | 4 +++- package/src/i18n/nl.json | 4 +++- package/src/i18n/ru.json | 4 +++- package/src/i18n/tr.json | 4 +++- 12 files changed, 37 insertions(+), 13 deletions(-) diff --git a/package/src/components/Indicators/EmptyStateIndicator.tsx b/package/src/components/Indicators/EmptyStateIndicator.tsx index e5d369e0be..d020e89bd2 100644 --- a/package/src/components/Indicators/EmptyStateIndicator.tsx +++ b/package/src/components/Indicators/EmptyStateIndicator.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; +import { useTranslationContext } from '../../contexts/translationContext/TranslationContext'; import { MessageIcon } from '../../icons/MessageIcon'; import { vw } from '../../utils/utils'; @@ -36,6 +37,7 @@ export const EmptyStateIndicator: React.FC = ({ listType }) => emptyStateIndicator: { channelContainer, channelDetails, channelTitle }, }, } = useTheme(); + const { t } = useTranslationContext(); switch (listType) { case 'channel': @@ -46,13 +48,13 @@ export const EmptyStateIndicator: React.FC = ({ listType }) => style={[styles.channelTitle, { color: black }, channelTitle]} testID='empty-channel-state-title' > - {"Let's start chatting!"} + {t("Let's start chatting!")} - {'How about sending your first message to a friend?'} + {t('How about sending your first message to a friend?')} ); diff --git a/package/src/i18n/en.json b/package/src/i18n/en.json index 85b5329002..212cfff0d3 100644 --- a/package/src/i18n/en.json +++ b/package/src/i18n/en.json @@ -68,5 +68,7 @@ "{{ user }} is typing": "{{ user }} is typing", "Select More Photos": "Select More Photos", "🏙 Attachment...": "🏙 Attachment...", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB." + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.", + "Let's start chatting!": "Let's start chatting!", + "How about sending your first message to a friend?": "How about sending your first message to a friend?" } diff --git a/package/src/i18n/es.json b/package/src/i18n/es.json index e1e044a46d..ca42b9754a 100644 --- a/package/src/i18n/es.json +++ b/package/src/i18n/es.json @@ -68,5 +68,7 @@ "{{ user }} is typing": "{{ user }} está escribiendo", "Select More Photos": "Seleccionar más fotos", "🏙 Attachment...": "🏙 Adjunto...", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "El archivo supera el tamaño máximo permitido. Por favor, selecciona un archivo menor a {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB." + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "El archivo supera el tamaño máximo permitido. Por favor, selecciona un archivo menor a {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.", + "Let's start chatting!": "¡Empecemos a charlar!", + "How about sending your first message to a friend?": "¿Qué tal enviar tu primer mensaje a un amigo?" } diff --git a/package/src/i18n/fr.json b/package/src/i18n/fr.json index 51c0e4335f..676565342c 100644 --- a/package/src/i18n/fr.json +++ b/package/src/i18n/fr.json @@ -68,5 +68,7 @@ "{{ user }} is typing": "{{ user }} est en train d'écrire", "Select More Photos": "Sélectionner plus de photos", "🏙 Attachment...": "🏙 Pièce jointe...", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Taille maximale de téléchargement de fichier atteinte. Veuillez télécharger un fichier inférieur à {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} Mo." + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Taille maximale de téléchargement de fichier atteinte. Veuillez télécharger un fichier inférieur à {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} Mo.", + "Let's start chatting!": "Commençons à discuter !", + "How about sending your first message to a friend?": "Et si vous envoyiez votre premier message à un ami ?" } diff --git a/package/src/i18n/he.json b/package/src/i18n/he.json index 91294e330a..4c98660cd6 100644 --- a/package/src/i18n/he.json +++ b/package/src/i18n/he.json @@ -68,5 +68,7 @@ "{{ user }} is typing": "{{ user }} מקליד/ה", "Select More Photos": "בחר עוד תמונות", "🏙 Attachment...": "🏙 קובץ מצורף...", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "הגעת למגבלת העלאת גודל הקובץ המקסימלית. אנא העלה קובץ מתחת ל-{{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB" + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "הגעת למגבלת העלאת גודל הקובץ המקסימלית. אנא העלה קובץ מתחת ל-{{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB", + "Let's start chatting!": "בואו נתחיל לשוחח!", + "How about sending your first message to a friend?": "מה דעתך לשלוח את ההודעה הראשונה שלך לחבר?" } diff --git a/package/src/i18n/hi.json b/package/src/i18n/hi.json index 01ea7a6ac7..02e01c61a7 100644 --- a/package/src/i18n/hi.json +++ b/package/src/i18n/hi.json @@ -68,5 +68,7 @@ "{{ user }} is typing": "{{ user }} टाइप कर रहा है", "Select More Photos": "अधिक फ़ोटो चुनें", "🏙 Attachment...": "🏙 अटैचमेंट...", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "अधिकतम फ़ाइल आकार अपलोड सीमा पूरी हो गई। कृपया {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} एमबी से नीचे की फ़ाइल अपलोड करें।" + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "अधिकतम फ़ाइल आकार अपलोड सीमा पूरी हो गई। कृपया {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} एमबी से नीचे की फ़ाइल अपलोड करें।", + "Let's start chatting!": "आइए चैट करना शुरू करें!", + "How about sending your first message to a friend?": "किसी मित्र को अपना पहला संदेश भेजने के बारे में क्या ख़याल है?" } diff --git a/package/src/i18n/it.json b/package/src/i18n/it.json index 13be6ade53..ece4490731 100644 --- a/package/src/i18n/it.json +++ b/package/src/i18n/it.json @@ -68,5 +68,7 @@ "{{ user }} is typing": "{{ user }} sta scrivendo", "Select More Photos": "Seleziona Altre foto", "🏙 Attachment...": "🏙 Allegato...", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "È stato raggiunto il limite massimo di caricamento delle dimensioni del file. Carica un file inferiore a {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB." + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "È stato raggiunto il limite massimo di caricamento delle dimensioni del file. Carica un file inferiore a {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.", + "Let's start chatting!": "Iniziamo a chattare!", + "How about sending your first message to a friend?": "Che ne dici di inviare il tuo primo messaggio ad un amico?" } diff --git a/package/src/i18n/ja.json b/package/src/i18n/ja.json index 1fbf267d07..ba17b73fbe 100644 --- a/package/src/i18n/ja.json +++ b/package/src/i18n/ja.json @@ -71,5 +71,7 @@ "Not supported": "サポートしていません", "Select More Photos": "さらに写真を選択", "File type not supported": "サポートされていないファイルです", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "最大ファイル サイズのアップロード制限に達しました。 {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB 以下のファイルをアップロードしてください" + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "最大ファイル サイズのアップロード制限に達しました。 {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB 以下のファイルをアップロードしてください", + "Let's start chatting!": "チャットを始めましょう!", + "How about sending your first message to a friend?": "初めてのメッセージを友達に送ってみてはいかがでしょうか?" } diff --git a/package/src/i18n/ko.json b/package/src/i18n/ko.json index 35caeb85be..983bf34104 100644 --- a/package/src/i18n/ko.json +++ b/package/src/i18n/ko.json @@ -70,5 +70,7 @@ "File type not supported": "지원하지 않는 파일입니다.", "Select More Photos": "추가 사진 선택", "Not supported": "지원하지 않습니다", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "최대 파일 크기 업로드 제한에 도달했습니다. {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}}MB 미만의 파일을 업로드하세요." + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "최대 파일 크기 업로드 제한에 도달했습니다. {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}}MB 미만의 파일을 업로드하세요.", + "Let's start chatting!": "채팅을 시작합시다!", + "How about sending your first message to a friend?": "친구에게 첫 번째 메시지를 보내는 것은 어떻습니까?" } diff --git a/package/src/i18n/nl.json b/package/src/i18n/nl.json index c077854cc4..a4078d6280 100644 --- a/package/src/i18n/nl.json +++ b/package/src/i18n/nl.json @@ -68,5 +68,7 @@ "{{ user }} is typing": "{{ user }} is aan het typen", "Select More Photos": "Selecteer Meer foto's", "🏙 Attachment...": "🏙 Bijlage...", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maximale uploadlimiet voor bestandsgrootte bereikt. Upload een bestand van minder dan {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB." + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maximale uploadlimiet voor bestandsgrootte bereikt. Upload een bestand van minder dan {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.", + "Let's start chatting!": "Laten we beginnen met chatten!", + "How about sending your first message to a friend?": "Wat dacht je ervan om je eerste bericht naar een vriend te sturen?" } diff --git a/package/src/i18n/ru.json b/package/src/i18n/ru.json index 8cdada4215..fd2eadbe06 100644 --- a/package/src/i18n/ru.json +++ b/package/src/i18n/ru.json @@ -68,5 +68,7 @@ "{{ user }} is typing": "{{ user }} пишет", "Select More Photos": "Выбрать больше фотографий", "🏙 Attachment...": "🏙 Вложение...", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Достигнут предел максимального размера файла для загрузки. Загрузите файл размером менее {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} МБ." + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Достигнут предел максимального размера файла для загрузки. Загрузите файл размером менее {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} МБ.", + "Let's start chatting!": "Давайте начнем общаться!", + "How about sending your first message to a friend?": "Как насчет отправки первого сообщения другу?" } diff --git a/package/src/i18n/tr.json b/package/src/i18n/tr.json index c301b8c2b8..15e64f5b0d 100644 --- a/package/src/i18n/tr.json +++ b/package/src/i18n/tr.json @@ -68,5 +68,7 @@ "{{ user }} is typing": "{{ user }} yazıyor", "Select More Photos": "Daha Fazla Fotoğraf Seçin", "🏙 Attachment...": "🏙 Ek...", - "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maksimum dosya boyutu yükleme sınırına ulaşıldı. Lütfen {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB'ın altında bir dosya yükleyin." + "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maksimum dosya boyutu yükleme sınırına ulaşıldı. Lütfen {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB'ın altında bir dosya yükleyin.", + "Let's start chatting!": "Haydi sohbete başlayalım!", + "How about sending your first message to a friend?": "İlk mesajınızı bir arkadaşınıza göndermeye ne dersiniz?" } From 2ee39bf44791b174803319b5a121d7e72b914736 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Tue, 14 Nov 2023 13:43:12 +0530 Subject: [PATCH 06/21] chore: update yarn lock deps for packages and example apps (#2308) --- examples/ExpoMessaging/package.json | 4 +- examples/ExpoMessaging/yarn.lock | 927 ++++-------------- .../ios/SampleApp.xcodeproj/project.pbxproj | 12 +- examples/SampleApp/yarn.lock | 37 +- examples/TypeScriptMessaging/yarn.lock | 42 +- package/expo-package/yarn.lock | 8 +- package/native-package/yarn.lock | 8 +- 7 files changed, 233 insertions(+), 805 deletions(-) diff --git a/examples/ExpoMessaging/package.json b/examples/ExpoMessaging/package.json index 54e49570f0..7e65819907 100644 --- a/examples/ExpoMessaging/package.json +++ b/examples/ExpoMessaging/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@react-native-community/netinfo": "9.3.7", - "expo": "~48.0.18", + "expo": "~48.0.21", "expo-av": "~13.2.1", "expo-clipboard": "^4.1.2", "expo-constants": "~14.2.1", @@ -28,7 +28,7 @@ "expo-status-bar": "~1.4.4", "react": "18.2.0", "react-dom": "18.2.0", - "react-native": "0.71.8", + "react-native": "0.71.14", "react-native-gesture-handler": "~2.9.0", "react-native-quick-sqlite": "^8.0.2", "react-native-reanimated": "~2.14.4", diff --git a/examples/ExpoMessaging/yarn.lock b/examples/ExpoMessaging/yarn.lock index 7aba513c44..2fe61d78b8 100644 --- a/examples/ExpoMessaging/yarn.lock +++ b/examples/ExpoMessaging/yarn.lock @@ -1327,7 +1327,24 @@ resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-48.0.0.tgz#15a46921565ffeda3c3ba010701398f05193d5b3" integrity sha512-DwyV4jTy/+cLzXGAo1xftS6mVlSiLIWZjl9DjTCLPFVgNYQxnh7htPilRv4rBhiNs7KaznWqKU70+4zQoKVT9A== -"@expo/config@8.0.2", "@expo/config@~8.0.0": +"@expo/config@8.0.5": + version "8.0.5" + resolved "https://registry.yarnpkg.com/@expo/config/-/config-8.0.5.tgz#71380a7a20f2e27fe386d7bb73428a437b27a96b" + integrity sha512-3CnLmtAQUWqLZwTRliS23QoFwdyhg4AWtp6gZ0qfcXthR84RvlZKcCDQQIyPiRUgu8dZa+gQDcdRJtgE+GM5XQ== + dependencies: + "@babel/code-frame" "~7.10.4" + "@expo/config-plugins" "~6.0.0" + "@expo/config-types" "^48.0.0" + "@expo/json-file" "^8.2.37" + getenv "^1.0.0" + glob "7.1.6" + require-from-string "^2.0.2" + resolve-from "^5.0.0" + semver "7.3.2" + slugify "^1.3.4" + sucrase "^3.20.0" + +"@expo/config@~8.0.0": version "8.0.2" resolved "https://registry.yarnpkg.com/@expo/config/-/config-8.0.2.tgz#53ecfa9bafc97b990ff9e34e210205b0e3f05751" integrity sha512-WubrzTNNdAXy1FU8TdyQ7D9YtDj2tN3fWXDq+C8In+nB7Qc08zwH9cVdaGZ+rBVmjFZBh5ACfObKq/m9cm4QQA== @@ -1776,13 +1793,13 @@ dependencies: serve-static "^1.13.1" -"@react-native-community/cli-doctor@^10.2.2": - version "10.2.2" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-doctor/-/cli-doctor-10.2.2.tgz#b1893604fa9fc8971064e7c00042350f96868bfe" - integrity sha512-49Ep2aQOF0PkbAR/TcyMjOm9XwBa8VQr+/Zzf4SJeYwiYLCT1NZRAVAVjYRXl0xqvq5S5mAGZZShS4AQl4WsZw== +"@react-native-community/cli-doctor@^10.2.4": + version "10.2.5" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-doctor/-/cli-doctor-10.2.5.tgz#e5e28c66c2373f05a94b296a8ec637f8df736707" + integrity sha512-1YbzXvsldBmSw1MmBsXB74bKiHXKNCjlb2ByLgkfTiarpSvETYam3g5vex0N+qc0Cdkzkq+8NznE744LFhnUpw== dependencies: "@react-native-community/cli-config" "^10.1.1" - "@react-native-community/cli-platform-ios" "^10.2.1" + "@react-native-community/cli-platform-ios" "^10.2.5" "@react-native-community/cli-tools" "^10.1.1" chalk "^4.1.2" command-exists "^1.2.8" @@ -1820,10 +1837,10 @@ glob "^7.1.3" logkitty "^0.7.1" -"@react-native-community/cli-platform-ios@10.2.1", "@react-native-community/cli-platform-ios@^10.2.1": - version "10.2.1" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-10.2.1.tgz#2e6bd2cb6d48cbb8720d7b7265bb1bab80745f72" - integrity sha512-hz4zu4Y6eyj7D0lnZx8Mf2c2si8y+zh/zUTgCTaPPLzQD8jSZNNBtUUiA1cARm2razpe8marCZ1QbTMAGbf3mg== +"@react-native-community/cli-platform-ios@10.2.4": + version "10.2.4" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-10.2.4.tgz#6af05cd4258438422a3a50d1c0cc757acd6be375" + integrity sha512-/6K+jeRhcGojFIJMWMXV2eY5n/In+YUzBr/DKWQOeHBOHkESRNheG310xSAIjgB46YniSSUKhSyeuhalTbm9OQ== dependencies: "@react-native-community/cli-tools" "^10.1.1" chalk "^4.1.2" @@ -1832,21 +1849,33 @@ glob "^7.1.3" ora "^5.4.1" -"@react-native-community/cli-plugin-metro@^10.2.2": - version "10.2.2" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-plugin-metro/-/cli-plugin-metro-10.2.2.tgz#766914e3c8007dfe52b253544c4f6cd8549919ac" - integrity sha512-sTGjZlD3OGqbF9v1ajwUIXhGmjw9NyJ/14Lo0sg7xH8Pv4qUd5ZvQ6+DWYrQn3IKFUMfGFWYyL81ovLuPylrpw== +"@react-native-community/cli-platform-ios@^10.2.5": + version "10.2.5" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-10.2.5.tgz#7888c74b83099885bf9e6d52170c6e663ad971ee" + integrity sha512-hq+FZZuSBK9z82GLQfzdNDl8vbFx5UlwCLFCuTtNCROgBoapFtVZQKRP2QBftYNrQZ0dLAb01gkwxagHsQCFyg== + dependencies: + "@react-native-community/cli-tools" "^10.1.1" + chalk "^4.1.2" + execa "^1.0.0" + fast-xml-parser "^4.0.12" + glob "^7.1.3" + ora "^5.4.1" + +"@react-native-community/cli-plugin-metro@^10.2.3": + version "10.2.3" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-plugin-metro/-/cli-plugin-metro-10.2.3.tgz#419e0155a50951c3329818fba51cb5021a7294f1" + integrity sha512-jHi2oDuTePmW4NEyVT8JEGNlIYcnFXCSV2ZMp4rnDrUk4TzzyvS3IMvDlESEmG8Kry8rvP0KSUx/hTpy37Sbkw== dependencies: "@react-native-community/cli-server-api" "^10.1.1" "@react-native-community/cli-tools" "^10.1.1" chalk "^4.1.2" execa "^1.0.0" - metro "0.73.9" - metro-config "0.73.9" - metro-core "0.73.9" - metro-react-native-babel-transformer "0.73.9" - metro-resolver "0.73.9" - metro-runtime "0.73.9" + metro "0.73.10" + metro-config "0.73.10" + metro-core "0.73.10" + metro-react-native-babel-transformer "0.73.10" + metro-resolver "0.73.10" + metro-runtime "0.73.10" readline "^1.3.0" "@react-native-community/cli-server-api@^10.1.1": @@ -1886,17 +1915,17 @@ dependencies: joi "^17.2.1" -"@react-native-community/cli@10.2.2": - version "10.2.2" - resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-10.2.2.tgz#3fa438ba7f19f83e07bc337765fc1cabdcf2cac2" - integrity sha512-aZVcVIqj+OG6CrliR/Yn8wHxrvyzbFBY9cj7n0MvRw/P54QUru2nNqUTSSbqv0Qaa297yHJbe6kFDojDMSTM8Q== +"@react-native-community/cli@10.2.4": + version "10.2.4" + resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-10.2.4.tgz#c6afe723055d430061a32bd31644fc56eb9ba330" + integrity sha512-E9BUDHfLEsnjkjeJqECuCjl4E/1Ox9Nl6hkQBhEqjZm4AaQxgU7M6AyFfOgaXn5v3am16/R4ZOUTrJnGJWS3GA== dependencies: "@react-native-community/cli-clean" "^10.1.1" "@react-native-community/cli-config" "^10.1.1" "@react-native-community/cli-debugger-ui" "^10.0.0" - "@react-native-community/cli-doctor" "^10.2.2" + "@react-native-community/cli-doctor" "^10.2.4" "@react-native-community/cli-hermes" "^10.2.0" - "@react-native-community/cli-plugin-metro" "^10.2.2" + "@react-native-community/cli-plugin-metro" "^10.2.3" "@react-native-community/cli-server-api" "^10.1.1" "@react-native-community/cli-tools" "^10.1.1" "@react-native-community/cli-types" "^10.0.0" @@ -2301,45 +2330,20 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA== - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== - array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== - asap@~2.0.3, asap@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== - -ast-types@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.14.2.tgz#600b882df8583e3cd4f2df5fa20fa83759d4bdfd" - integrity sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA== +ast-types@0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.15.2.tgz#39ae4809393c4b16df751ee563411423e85fb49d" + integrity sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg== dependencies: tslib "^2.0.1" @@ -2368,18 +2372,6 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -axios@^0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.22.0.tgz#bf702c41fb50fbca4539589d839a077117b79b25" - integrity sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w== - dependencies: - follow-redirects "^1.14.4" - axios@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" @@ -2502,19 +2494,6 @@ base64-js@^1.1.2, base64-js@^1.2.3, base64-js@^1.3.1, base64-js@^1.5.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - better-opn@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/better-opn/-/better-opn-3.0.2.tgz#f96f35deaaf8f34144a4102651babcf00d1d8817" @@ -2598,22 +2577,6 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -2713,21 +2676,6 @@ cacache@^15.3.0: tar "^6.0.2" unique-filename "^1.1.1" -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - call-bind@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -2807,16 +2755,6 @@ ci-info@^3.2.0, ci-info@^3.3.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" @@ -2878,14 +2816,6 @@ clone@^2.1.2: resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -2983,11 +2913,6 @@ compare-versions@^3.4.0: resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62" integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - component-type@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-type/-/component-type-1.2.1.tgz#8a47901700238e4fc32269771230226f24b415a9" @@ -3038,11 +2963,6 @@ convert-source-map@^1.7.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== - core-js-compat@^3.30.1, core-js-compat@^3.30.2: version "3.30.2" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.30.2.tgz#83f136e375babdb8c80ad3c22d67c69098c1dd8b" @@ -3166,7 +3086,7 @@ dayjs@^1.8.15: resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ== -debug@2.6.9, debug@^2.2.0, debug@^2.3.3: +debug@2.6.9, debug@^2.2.0: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -3192,7 +3112,7 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -decode-uri-component@^0.2.0, decode-uri-component@^0.2.2: +decode-uri-component@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== @@ -3227,28 +3147,6 @@ define-lazy-prop@^2.0.0: resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - del@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/del/-/del-6.1.1.tgz#3b70314f1ec0aa325c6b14eb36b95786671edb7a" @@ -3473,19 +3371,6 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - expo-application@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/expo-application/-/expo-application-5.1.1.tgz#5206bf0cf89cb0e32d1f5037a0481e5c86b951ab" @@ -3639,14 +3524,14 @@ expo-status-bar@~1.4.4: resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.4.4.tgz#6874ccfda5a270d66f123a9f220735a76692d114" integrity sha512-5DV0hIEWgatSC3UgQuAZBoQeaS9CqeWRZ3vzBR9R/+IUD87Adbi4FGhU10nymRqFXOizGsureButGZIXPs7zEA== -expo@~48.0.18: - version "48.0.19" - resolved "https://registry.yarnpkg.com/expo/-/expo-48.0.19.tgz#0f13be65d3cac99922666e5939388fc22b147e6a" - integrity sha512-Pmz2HEwcDdjWPq5fM3vF++je0hjZIBX9aTZEkm6sBv09Vfhe4+CuiuKDq3iE+N6G9l2+eFYoRCApDwLqcRMiPA== +expo@~48.0.21: + version "48.0.21" + resolved "https://registry.yarnpkg.com/expo/-/expo-48.0.21.tgz#40c5795c738ef05f8a7ddf466a53d73d86a3c456" + integrity sha512-Z211SC4wZP4Xd5/RBJhEw4uwSgpfzAvMh6IVdzwEVAJAcV1s48CACcSmIUe+7QJjEPzmb3T5Yo4EJ/JJXJ2o9A== dependencies: "@babel/runtime" "^7.20.0" "@expo/cli" "0.7.3" - "@expo/config" "8.0.2" + "@expo/config" "8.0.5" "@expo/config-plugins" "6.0.2" "@expo/vector-icons" "^13.0.0" babel-preset-expo "~9.3.2" @@ -3667,35 +3552,6 @@ expo@~48.0.18: pretty-format "^26.5.2" uuid "^3.4.0" -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -3781,16 +3637,6 @@ file-loader@6.2.0: loader-utils "^2.0.0" schema-utils "^3.0.0" -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -3873,11 +3719,6 @@ flow-parser@^0.185.0: resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.185.2.tgz#cb7ee57f77377d6c5d69a469e980f6332a15e492" integrity sha512-2hJ5ACYeJCzNtiVULov6pljKOLygy0zddoqSI1fFetM+XRPpRshFdGEijtqlamA1XwyZ+7rhryI6FQFzvtLWUQ== -follow-redirects@^1.14.4: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - follow-redirects@^1.15.0: version "1.15.3" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" @@ -3888,11 +3729,6 @@ fontfaceobserver@^2.1.0: resolved "https://registry.yarnpkg.com/fontfaceobserver/-/fontfaceobserver-2.3.0.tgz#5fb392116e75d5024b7ec8e4f2ce92106d1488c8" integrity sha512-6FPvD/IVyT4ZlNe7Wcn5Fb/4ChigpucKYSvD6a+0iMoLn2inpo711eyIcKjmDtE5XNcgAkSH9uN/nfAeZzHEfg== -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== - form-data@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" @@ -3911,13 +3747,6 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== - dependencies: - map-cache "^0.2.2" - freeport-async@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/freeport-async/-/freeport-async-2.0.0.tgz#6adf2ec0c629d11abff92836acd04b399135bab4" @@ -4011,11 +3840,6 @@ get-stream@^4.0.0: dependencies: pump "^3.0.0" -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== - getenv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/getenv/-/getenv-1.0.0.tgz#874f2e7544fbca53c7a4738f37de8605c3fcfc31" @@ -4117,37 +3941,6 @@ has-symbols@^1.0.3: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -4325,20 +4118,6 @@ ipaddr.js@^1.9.0: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A== - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -4349,7 +4128,7 @@ is-arrayish@^0.3.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== -is-buffer@^1.1.5, is-buffer@~1.1.1, is-buffer@~1.1.6: +is-buffer@~1.1.1, is-buffer@~1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== @@ -4361,38 +4140,6 @@ is-core-module@^2.11.0: dependencies: has "^1.0.3" -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg== - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - is-directory@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" @@ -4403,18 +4150,6 @@ is-docker@^2.0.0, is-docker@^2.1.1: resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" @@ -4461,13 +4196,6 @@ is-invalid-path@^0.1.0: dependencies: is-glob "^2.0.0" -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== - dependencies: - kind-of "^3.0.2" - is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" @@ -4483,7 +4211,7 @@ is-path-inside@^3.0.2: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== -is-plain-object@^2.0.3, is-plain-object@^2.0.4: +is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== @@ -4517,11 +4245,6 @@ is-valid-path@^0.1.1: dependencies: is-invalid-path "^0.1.0" -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - is-wsl@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" @@ -4534,7 +4257,7 @@ is-wsl@^2.1.1, is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" -isarray@1.0.0, isarray@~1.0.0: +isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== @@ -4544,14 +4267,7 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: +isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== @@ -4706,10 +4422,10 @@ jsc-android@^250231.0.0: resolved "https://registry.yarnpkg.com/jsc-android/-/jsc-android-250231.0.0.tgz#91720f8df382a108872fa4b3f558f33ba5e95262" integrity sha512-rS46PvsjYmdmuz1OAWXY/1kCYG7pnf1TBqeTiOJr1iDz7s5DLxxC9n/ZMknLDxzYzNVfI7R95MH10emSSG1Wuw== -jscodeshift@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.13.1.tgz#69bfe51e54c831296380585c6d9e733512aecdef" - integrity sha512-lGyiEbGOvmMRKgWk4vf+lUrCWO/8YR8sUR3FKF1Cq5fovjZDlIcw3Hu5ppLHAnEXshVffvaM0eyuY/AbOeYpnQ== +jscodeshift@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.14.0.tgz#7542e6715d6d2e8bde0b4e883f0ccea358b46881" + integrity sha512-7eCC1knD7bLUPuSCwXsMZUH51O8jIcoVyKtI6P0XM0IVzlGjckPy3FIwQlorzbN0Sg79oK+RlohN32Mqf/lrYA== dependencies: "@babel/core" "^7.13.16" "@babel/parser" "^7.13.16" @@ -4724,10 +4440,10 @@ jscodeshift@^0.13.1: chalk "^4.1.2" flow-parser "0.*" graceful-fs "^4.2.4" - micromatch "^3.1.10" + micromatch "^4.0.4" neo-async "^2.5.0" node-dir "^0.1.17" - recast "^0.20.4" + recast "^0.21.0" temp "^0.8.4" write-file-atomic "^2.3.0" @@ -4818,26 +4534,7 @@ jws@^3.2.2: jwa "^1.4.1" safe-buffer "^5.0.1" -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: +kind-of@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -4978,18 +4675,6 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== - dependencies: - object-visit "^1.0.0" - md5-file@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/md5-file/-/md5-file-3.2.3.tgz#f9bceb941eca2214a4c0727f5e700314e770f06f" @@ -5050,14 +4735,14 @@ merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -metro-babel-transformer@0.73.9: - version "0.73.9" - resolved "https://registry.yarnpkg.com/metro-babel-transformer/-/metro-babel-transformer-0.73.9.tgz#bec8aaaf1bbdc2e469fde586fde455f8b2a83073" - integrity sha512-DlYwg9wwYIZTHtic7dyD4BP0SDftoltZ3clma76nHu43blMWsCnrImHeHsAVne3XsQ+RJaSRxhN5nkG2VyVHwA== +metro-babel-transformer@0.73.10: + version "0.73.10" + resolved "https://registry.yarnpkg.com/metro-babel-transformer/-/metro-babel-transformer-0.73.10.tgz#b27732fa3869f397246ee8ecf03b64622ab738c1" + integrity sha512-Yv2myTSnpzt/lTyurLvqYbBkytvUJcLHN8XD3t7W6rGiLTQPzmf1zypHQLphvcAXtCWBOXFtH7KLOSi2/qMg+A== dependencies: "@babel/core" "^7.20.0" hermes-parser "0.8.0" - metro-source-map "0.73.9" + metro-source-map "0.73.10" nullthrows "^1.1.1" metro-babel-transformer@0.76.0: @@ -5075,12 +4760,12 @@ metro-cache-key@0.76.0: resolved "https://registry.yarnpkg.com/metro-cache-key/-/metro-cache-key-0.76.0.tgz#0ab9513c8fc0392e7fde5d4473f220a9352e2cf0" integrity sha512-Oyz+Yo/CG56kMXsDuioLf80MHwUqRzhOjaFsDvam3+gpc9rIGhnFL4ODhc6Qlum5auPRMT9XsksScErouft2tA== -metro-cache@0.73.9: - version "0.73.9" - resolved "https://registry.yarnpkg.com/metro-cache/-/metro-cache-0.73.9.tgz#773c2df6ba53434e58ccbe421b0c54e6da8d2890" - integrity sha512-upiRxY8rrQkUWj7ieACD6tna7xXuXdu2ZqrheksT79ePI0aN/t0memf6WcyUtJUMHZetke3j+ppELNvlmp3tOw== +metro-cache@0.73.10: + version "0.73.10" + resolved "https://registry.yarnpkg.com/metro-cache/-/metro-cache-0.73.10.tgz#02e9cb7c1e42aab5268d2ecce35ad8f2c08891de" + integrity sha512-wPGlQZpdVlM404m7MxJqJ+hTReDr5epvfPbt2LerUAHY9RN99w61FeeAe25BMZBwgUgDtAsfGlJ51MBHg8MAqw== dependencies: - metro-core "0.73.9" + metro-core "0.73.10" rimraf "^3.0.2" metro-cache@0.76.0: @@ -5091,17 +4776,17 @@ metro-cache@0.76.0: metro-core "0.76.0" rimraf "^3.0.2" -metro-config@0.73.9: - version "0.73.9" - resolved "https://registry.yarnpkg.com/metro-config/-/metro-config-0.73.9.tgz#6b43c70681bdd6b00f44400fc76dddbe53374500" - integrity sha512-NiWl1nkYtjqecDmw77tbRbXnzIAwdO6DXGZTuKSkH+H/c1NKq1eizO8Fe+NQyFtwR9YLqn8Q0WN1nmkwM1j8CA== +metro-config@0.73.10: + version "0.73.10" + resolved "https://registry.yarnpkg.com/metro-config/-/metro-config-0.73.10.tgz#a9ec3d0a1290369e3f46c467a4c4f6dd43acc223" + integrity sha512-wIlybd1Z9I8K2KcStTiJxTB7OK529dxFgogNpKCTU/3DxkgAASqSkgXnZP6kVyqjh5EOWAKFe5U6IPic7kXDdQ== dependencies: cosmiconfig "^5.0.5" jest-validate "^26.5.2" - metro "0.73.9" - metro-cache "0.73.9" - metro-core "0.73.9" - metro-runtime "0.73.9" + metro "0.73.10" + metro-cache "0.73.10" + metro-core "0.73.10" + metro-runtime "0.73.10" metro-config@0.76.0: version "0.76.0" @@ -5115,13 +4800,13 @@ metro-config@0.76.0: metro-core "0.76.0" metro-runtime "0.76.0" -metro-core@0.73.9: - version "0.73.9" - resolved "https://registry.yarnpkg.com/metro-core/-/metro-core-0.73.9.tgz#410c5c0aeae840536c10039f68098fdab3da568e" - integrity sha512-1NTs0IErlKcFTfYyRT3ljdgrISWpl1nys+gaHkXapzTSpvtX9F1NQNn5cgAuE+XIuTJhbsCdfIJiM2JXbrJQaQ== +metro-core@0.73.10: + version "0.73.10" + resolved "https://registry.yarnpkg.com/metro-core/-/metro-core-0.73.10.tgz#feb3c228aa8c0dde71d8e4cef614cc3a1dc3bbd7" + integrity sha512-5uYkajIxKyL6W45iz/ftNnYPe1l92CvF2QJeon1CHsMXkEiOJxEjo41l+iSnO/YodBGrmMCyupSO4wOQGUc0lw== dependencies: lodash.throttle "^4.1.1" - metro-resolver "0.73.9" + metro-resolver "0.73.10" metro-core@0.76.0: version "0.76.0" @@ -5228,6 +4913,50 @@ metro-react-native-babel-preset@0.66.2: "@babel/template" "^7.0.0" react-refresh "^0.4.0" +metro-react-native-babel-preset@0.73.10: + version "0.73.10" + resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.73.10.tgz#304b24bb391537d2c987732cc0a9774be227d3f6" + integrity sha512-1/dnH4EHwFb2RKEKx34vVDpUS3urt2WEeR8FYim+ogqALg4sTpG7yeQPxWpbgKATezt4rNfqAANpIyH19MS4BQ== + dependencies: + "@babel/core" "^7.20.0" + "@babel/plugin-proposal-async-generator-functions" "^7.0.0" + "@babel/plugin-proposal-class-properties" "^7.0.0" + "@babel/plugin-proposal-export-default-from" "^7.0.0" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.0.0" + "@babel/plugin-proposal-object-rest-spread" "^7.0.0" + "@babel/plugin-proposal-optional-catch-binding" "^7.0.0" + "@babel/plugin-proposal-optional-chaining" "^7.0.0" + "@babel/plugin-syntax-dynamic-import" "^7.0.0" + "@babel/plugin-syntax-export-default-from" "^7.0.0" + "@babel/plugin-syntax-flow" "^7.18.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.0.0" + "@babel/plugin-syntax-optional-chaining" "^7.0.0" + "@babel/plugin-transform-arrow-functions" "^7.0.0" + "@babel/plugin-transform-async-to-generator" "^7.0.0" + "@babel/plugin-transform-block-scoping" "^7.0.0" + "@babel/plugin-transform-classes" "^7.0.0" + "@babel/plugin-transform-computed-properties" "^7.0.0" + "@babel/plugin-transform-destructuring" "^7.0.0" + "@babel/plugin-transform-flow-strip-types" "^7.0.0" + "@babel/plugin-transform-function-name" "^7.0.0" + "@babel/plugin-transform-literals" "^7.0.0" + "@babel/plugin-transform-modules-commonjs" "^7.0.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.0.0" + "@babel/plugin-transform-parameters" "^7.0.0" + "@babel/plugin-transform-react-display-name" "^7.0.0" + "@babel/plugin-transform-react-jsx" "^7.0.0" + "@babel/plugin-transform-react-jsx-self" "^7.0.0" + "@babel/plugin-transform-react-jsx-source" "^7.0.0" + "@babel/plugin-transform-runtime" "^7.0.0" + "@babel/plugin-transform-shorthand-properties" "^7.0.0" + "@babel/plugin-transform-spread" "^7.0.0" + "@babel/plugin-transform-sticky-regex" "^7.0.0" + "@babel/plugin-transform-template-literals" "^7.0.0" + "@babel/plugin-transform-typescript" "^7.5.0" + "@babel/plugin-transform-unicode-regex" "^7.0.0" + "@babel/template" "^7.0.0" + react-refresh "^0.4.0" + metro-react-native-babel-preset@0.73.9: version "0.73.9" resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.73.9.tgz#ef54637dd20f025197beb49e71309a9c539e73e2" @@ -5317,28 +5046,28 @@ metro-react-native-babel-preset@0.76.0: babel-plugin-transform-flow-enums "^0.0.2" react-refresh "^0.4.0" -metro-react-native-babel-transformer@0.73.9: - version "0.73.9" - resolved "https://registry.yarnpkg.com/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.73.9.tgz#4f4f0cfa5119bab8b53e722fabaf90687d0cbff0" - integrity sha512-DSdrEHuQ22ixY7DyipyKkIcqhOJrt5s6h6X7BYJCP9AMUfXOwLe2biY3BcgJz5GOXv8/Akry4vTCvQscVS1otQ== +metro-react-native-babel-transformer@0.73.10: + version "0.73.10" + resolved "https://registry.yarnpkg.com/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.73.10.tgz#4e20a9ce131b873cda0b5a44d3eb4002134a64b8" + integrity sha512-4G/upwqKdmKEjmsNa92/NEgsOxUWOygBVs+FXWfXWKgybrmcjh3NoqdRYrROo9ZRA/sB9Y/ZXKVkWOGKHtGzgg== dependencies: "@babel/core" "^7.20.0" babel-preset-fbjs "^3.4.0" hermes-parser "0.8.0" - metro-babel-transformer "0.73.9" - metro-react-native-babel-preset "0.73.9" - metro-source-map "0.73.9" + metro-babel-transformer "0.73.10" + metro-react-native-babel-preset "0.73.10" + metro-source-map "0.73.10" nullthrows "^1.1.1" -metro-resolver@0.73.9, metro-resolver@0.76.0: +metro-resolver@0.73.10, metro-resolver@0.76.0: version "0.76.0" resolved "https://registry.yarnpkg.com/metro-resolver/-/metro-resolver-0.76.0.tgz#3fa778adbab30859023a89e7a1241f4eb68171f2" integrity sha512-bU6HvKzPJOHGoe9na+tUa0g3pZqMUaSGE+noFx2qeSMtoIgOYkDzmuU9ZOAGcUOz0qJJtGs+QmgM+nBqfSS/pQ== -metro-runtime@0.73.9: - version "0.73.9" - resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.73.9.tgz#0b24c0b066b8629ee855a6e5035b65061fef60d5" - integrity sha512-d5Hs83FpKB9r8q8Vb95+fa6ESpwysmPr4lL1I2rM2qXAFiO7OAPT9Bc23WmXgidkBtD0uUFdB2lG+H1ATz8rZg== +metro-runtime@0.73.10: + version "0.73.10" + resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.73.10.tgz#c3de19d17e75ffe1a145778d99422e7ffc208768" + integrity sha512-EpVKm4eN0Fgx2PEWpJ5NiMArV8zVoOin866jIIvzFLpmkZz1UEqgjf2JAfUJnjgv3fjSV3JqeGG2vZCaGQBTow== dependencies: "@babel/runtime" "^7.0.0" react-refresh "^0.4.0" @@ -5351,17 +5080,17 @@ metro-runtime@0.76.0: "@babel/runtime" "^7.0.0" react-refresh "^0.4.0" -metro-source-map@0.73.9: - version "0.73.9" - resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.73.9.tgz#89ca41f6346aeb12f7f23496fa363e520adafebe" - integrity sha512-l4VZKzdqafipriETYR6lsrwtavCF1+CMhCOY9XbyWeTrpGSNgJQgdeJpttzEZTHQQTLR0csQo0nD1ef3zEP6IQ== +metro-source-map@0.73.10: + version "0.73.10" + resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.73.10.tgz#28e09a28f1a2f7a4f8d0845b845cbed74e2f48f9" + integrity sha512-NAGv14701p/YaFZ76KzyPkacBw/QlEJF1f8elfs23N1tC33YyKLDKvPAzFJiYqjdcFvuuuDCA8JCXd2TgLxNPw== dependencies: "@babel/traverse" "^7.20.0" "@babel/types" "^7.20.0" invariant "^2.2.4" - metro-symbolicate "0.73.9" + metro-symbolicate "0.73.10" nullthrows "^1.1.1" - ob1 "0.73.9" + ob1 "0.73.10" source-map "^0.5.6" vlq "^1.0.0" @@ -5379,13 +5108,13 @@ metro-source-map@0.76.0: source-map "^0.5.6" vlq "^1.0.0" -metro-symbolicate@0.73.9: - version "0.73.9" - resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.73.9.tgz#cb452299a36e5b86b2826e7426d51221635c48bf" - integrity sha512-4TUOwxRHHqbEHxRqRJ3wZY5TA8xq7AHMtXrXcjegMH9FscgYztsrIG9aNBUBS+VLB6g1qc6BYbfIgoAnLjCDyw== +metro-symbolicate@0.73.10: + version "0.73.10" + resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.73.10.tgz#7853a9a8fbfd615a5c9db698fffc685441ac880f" + integrity sha512-PmCe3TOe1c/NVwMlB+B17me951kfkB3Wve5RqJn+ErPAj93od1nxicp6OJe7JT4QBRnpUP8p9tw2sHKqceIzkA== dependencies: invariant "^2.2.4" - metro-source-map "0.73.9" + metro-source-map "0.73.10" nullthrows "^1.1.1" source-map "^0.5.6" through2 "^2.0.1" @@ -5433,7 +5162,7 @@ metro-transform-worker@0.76.0: metro-transform-plugins "0.76.0" nullthrows "^1.1.1" -metro@0.73.9, metro@0.76.0: +metro@0.73.10, metro@0.76.0: version "0.76.0" resolved "https://registry.yarnpkg.com/metro/-/metro-0.76.0.tgz#eedb7a48c79a222faa953de902f3d81e529eb4c2" integrity sha512-Pm9eMGyNQKnAaDOCmG+26YnodCh34gyl9ZD4UMKSBZA0ent2uUIZWGfZ5Bznljx1WH7JvPvn48VuZVJhctAhLQ== @@ -5488,25 +5217,6 @@ metro@0.73.9, metro@0.76.0: ws "^7.5.1" yargs "^17.5.1" -micromatch@^3.1.10: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - micromatch@^4.0.2, micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" @@ -5607,14 +5317,6 @@ minizlib@^2.1.1: minipass "^3.0.0" yallist "^4.0.0" -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - mkdirp@^0.5.1, mkdirp@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" @@ -5665,23 +5367,6 @@ nanoid@^3.1.23, nanoid@^3.3.1: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - ncp@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" @@ -5785,10 +5470,10 @@ nullthrows@^1.1.1: resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1" integrity sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw== -ob1@0.73.9: - version "0.73.9" - resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.73.9.tgz#d5677a0dd3e2f16ad84231278d79424436c38c59" - integrity sha512-kHOzCOFXmAM26fy7V/YuXNKne2TyRiXbFAvPBIbuedJCZZWQZHLdPzMeXJI4Egt6IcfDttRzN3jQ90wOwq1iNw== +ob1@0.73.10: + version "0.73.10" + resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.73.10.tgz#bf0a2e8922bb8687ddca82327c5cf209414a1bd4" + integrity sha512-aO6EYC+QRRCkZxVJhCWhLKgVjhNuD6Gu1riGjxrIm89CqLsmKgxzYDDEsktmKsoDeRdWGQM5EdMzXDl5xcVfsw== ob1@0.76.0: version "0.76.0" @@ -5800,34 +5485,11 @@ object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - object-inspect@^1.9.0: version "1.12.3" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== - dependencies: - isobject "^3.0.0" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== - dependencies: - isobject "^3.0.1" - on-finished@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" @@ -6001,11 +5663,6 @@ parseurl@~1.3.3: resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== - password-prompt@^1.0.4: version "1.1.2" resolved "https://registry.yarnpkg.com/password-prompt/-/password-prompt-1.1.2.tgz#85b2f93896c5bd9e9f2d6ff0627fa5af3dc00923" @@ -6114,11 +5771,6 @@ pngjs@^5.0.0: resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" integrity sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw== -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== - postcss-value-parser@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" @@ -6343,14 +5995,14 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -react-native-codegen@^0.71.5: - version "0.71.5" - resolved "https://registry.yarnpkg.com/react-native-codegen/-/react-native-codegen-0.71.5.tgz#454a42a891cd4ca5fc436440d301044dc1349c14" - integrity sha512-rfsuc0zkuUuMjFnrT55I1mDZ+pBRp2zAiRwxck3m6qeGJBGK5OV5JH66eDQ4aa+3m0of316CqrJDRzVlYufzIg== +react-native-codegen@^0.71.6: + version "0.71.6" + resolved "https://registry.yarnpkg.com/react-native-codegen/-/react-native-codegen-0.71.6.tgz#481a610c3af9135b09e1e031da032e7270e0cc1b" + integrity sha512-e5pR4VldIhEaFctfSAEgxbng0uG4gjBQxAHes3EKLdosH/Av90pQfSe9IDVdFIngvNPzt8Y14pNjrtqov/yNIg== dependencies: "@babel/parser" "^7.14.0" flow-parser "^0.185.0" - jscodeshift "^0.13.1" + jscodeshift "^0.14.0" nullthrows "^1.1.1" react-native-gesture-handler@~2.9.0: @@ -6364,10 +6016,10 @@ react-native-gesture-handler@~2.9.0: lodash "^4.17.21" prop-types "^15.7.2" -react-native-gradle-plugin@^0.71.18: - version "0.71.18" - resolved "https://registry.yarnpkg.com/react-native-gradle-plugin/-/react-native-gradle-plugin-0.71.18.tgz#20ef199bc85be32e45bb6cc069ec2e7dcb1a74a6" - integrity sha512-7F6bD7B8Xsn3JllxcwHhFcsl9aHIig47+3eN4IHFNqfLhZr++3ElDrcqfMzugM+niWbaMi7bJ0kAkAL8eCpdWg== +react-native-gradle-plugin@^0.71.19: + version "0.71.19" + resolved "https://registry.yarnpkg.com/react-native-gradle-plugin/-/react-native-gradle-plugin-0.71.19.tgz#3379e28341fcd189bc1f4691cefc84c1a4d7d232" + integrity sha512-1dVk9NwhoyKHCSxcrM6vY6cxmojeATsBobDicX0ZKr7DgUF2cBQRTKsimQFvzH8XhOVXyH8p4HyDSZNIFI8OlQ== react-native-lightbox@^0.7.0: version "0.7.0" @@ -6444,20 +6096,21 @@ react-native-web@~0.18.10: postcss-value-parser "^4.2.0" styleq "^0.1.2" -react-native@0.71.8: - version "0.71.8" - resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.71.8.tgz#4314145341c49448cf7465b93ced52a433a5e191" - integrity sha512-ftMAuhpgTkbHU9brrqsEyxcNrpYvXKeATY+if22Nfhhg1zW+6wn95w9otwTnA3xHkljPCbng8mUhmmERjGEl7g== +react-native@0.71.14: + version "0.71.14" + resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.71.14.tgz#df12b405a7913b736de01b0347af14e4be7bf324" + integrity sha512-7uhzas8aKpU2EARhlONt7yiclh+7PXEOJk469ewpQyId8Owq5WNtZvQm/z3k4mHUriMeQ37vgSGkOInSKcCazw== dependencies: "@jest/create-cache-key-function" "^29.2.1" - "@react-native-community/cli" "10.2.2" + "@react-native-community/cli" "10.2.4" "@react-native-community/cli-platform-android" "10.2.0" - "@react-native-community/cli-platform-ios" "10.2.1" + "@react-native-community/cli-platform-ios" "10.2.4" "@react-native/assets" "1.0.0" "@react-native/normalize-color" "2.1.0" "@react-native/polyfills" "2.0.0" abort-controller "^3.0.0" anser "^1.4.9" + ansi-regex "^5.0.0" base64-js "^1.1.2" deprecated-react-native-prop-types "^3.0.1" event-target-shim "^5.0.1" @@ -6465,16 +6118,16 @@ react-native@0.71.8: jest-environment-node "^29.2.1" jsc-android "^250231.0.0" memoize-one "^5.0.0" - metro-react-native-babel-transformer "0.73.9" - metro-runtime "0.73.9" - metro-source-map "0.73.9" + metro-react-native-babel-transformer "0.73.10" + metro-runtime "0.73.10" + metro-source-map "0.73.10" mkdirp "^0.5.1" nullthrows "^1.1.1" pretty-format "^26.5.2" promise "^8.3.0" react-devtools-core "^4.26.1" - react-native-codegen "^0.71.5" - react-native-gradle-plugin "^0.71.18" + react-native-codegen "^0.71.6" + react-native-gradle-plugin "^0.71.19" react-refresh "^0.4.0" react-shallow-renderer "^16.15.0" regenerator-runtime "^0.13.2" @@ -6531,12 +6184,12 @@ readline@^1.3.0: resolved "https://registry.yarnpkg.com/readline/-/readline-1.3.0.tgz#c580d77ef2cfc8752b132498060dc9793a7ac01c" integrity sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg== -recast@^0.20.4: - version "0.20.5" - resolved "https://registry.yarnpkg.com/recast/-/recast-0.20.5.tgz#8e2c6c96827a1b339c634dd232957d230553ceae" - integrity sha512-E5qICoPoNL4yU0H0NoBDntNB0Q5oMSNh9usFctYniLBluTthi3RsQVBXIJNbApOlvSwW/RGxIuokPcAc59J5fQ== +recast@^0.21.0: + version "0.21.5" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.21.5.tgz#e8cd22bb51bcd6130e54f87955d33a2b2e57b495" + integrity sha512-hjMmLaUXAm1hIuTqOdeYObMslq/q+Xff6QE3Y2P+uoHAg2nmVlLBps2hzh1UJDdMtDTMXOFewK6ky51JQIeECg== dependencies: - ast-types "0.14.2" + ast-types "0.15.2" esprima "~4.0.0" source-map "~0.6.1" tslib "^2.0.1" @@ -6565,14 +6218,6 @@ regenerator-transform@^0.15.1: dependencies: "@babel/runtime" "^7.8.4" -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - regexpu-core@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" @@ -6597,16 +6242,6 @@ remove-trailing-slash@^0.1.0: resolved "https://registry.yarnpkg.com/remove-trailing-slash/-/remove-trailing-slash-0.1.1.tgz#be2285a59f39c74d1bce4f825950061915e3780d" integrity sha512-o4S4Qh6L2jpnCy83ysZDau+VORNvnFw07CKSAymkd6ICNVEPisMyzlc00KlvvicsxKck94SEwhDnMNdICzO+tA== -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -6651,11 +6286,6 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== - resolve@^1.13.1, resolve@^1.14.2: version "1.22.2" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" @@ -6688,11 +6318,6 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -6753,13 +6378,6 @@ safe-json-stringify@~1: resolved "https://registry.yarnpkg.com/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz#356e44bc98f1f93ce45df14bcd7c01cda86e0afd" integrity sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg== -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== - dependencies: - ret "~0.1.10" - "safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -6854,16 +6472,6 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -6976,47 +6584,6 @@ slugify@^1.3.4: resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.6.6.tgz#2d4ac0eacb47add6af9e04d3be79319cbcc7924b" integrity sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw== -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - source-map-support@^0.5.16, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -7025,11 +6592,6 @@ source-map-support@^0.5.16, source-map-support@~0.5.20: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -7050,13 +6612,6 @@ split-on-first@^1.0.0: resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - split@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" @@ -7095,14 +6650,6 @@ stacktrace-parser@^0.1.3: dependencies: type-fest "^0.7.1" -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - statuses@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" @@ -7122,10 +6669,10 @@ stream-buffers@2.2.x: version "0.0.0" uid "" -stream-chat-react-native-core@5.19.3: - version "5.19.3" - resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.19.3.tgz#6f99af372bce8414998d4cce13ce0855a1a20386" - integrity sha512-uOJC1tq9VqzaPdv5TL6PWbLar2mCGQ1nYKQ3tdcnQhL3T/3130oizoP0rh/3LB2HUqn19NcngfnzE2FBXTI++w== +stream-chat-react-native-core@5.21.0: + version "5.21.0" + resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.21.0.tgz#de8b5eca351eb7e5905b48b09a90eb5357c321cb" + integrity sha512-JOa7giYrQMUHdCqu8rPlSgtWQZyi/oG3EhdOArkUB2WUAFlKScmOfcYEIFRJCGYmKOsihBqqIwF6xPckJ+bpcQ== dependencies: "@babel/runtime" "^7.12.5" "@gorhom/bottom-sheet" "4.4.8" @@ -7139,27 +6686,12 @@ stream-chat-react-native-core@5.19.3: path "0.12.7" react-native-markdown-package "1.8.2" react-native-url-polyfill "^1.3.0" - stream-chat "~8.13.1" + stream-chat "~8.14.0" "stream-chat-react-native-core@link:../../package": version "0.0.0" uid "" -stream-chat@~8.13.1: - version "8.13.1" - resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.13.1.tgz#9781a456487f376d7c9c98271a4f4c926a9e6cf8" - integrity sha512-k0tOmtlLsvVxpZ2EuR+Z/qQiyCHOIjACqwnBZnT1ERA1t3549U2vzkUE6l2tN2VGAgUP1tDl00FhZO5JrAkMKw== - dependencies: - "@babel/runtime" "^7.16.3" - "@types/jsonwebtoken" "~9.0.0" - "@types/ws" "^7.4.0" - axios "^0.22.0" - base64-js "^1.5.1" - form-data "^4.0.0" - isomorphic-ws "^4.0.1" - jsonwebtoken "~9.0.0" - ws "^7.4.4" - stream-chat@~8.14.0: version "8.14.1" resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.14.1.tgz#f6560c2aa2ce754928d41d6059c61d7cfe770e0a" @@ -7438,21 +6970,6 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -7460,16 +6977,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - toidentifier@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" @@ -7574,16 +7081,6 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" @@ -7632,14 +7129,6 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - update-browserslist-db@^1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" @@ -7655,11 +7144,6 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== - url-join@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.0.tgz#4d3340e807d3773bda9991f8305acdcc2a665d2a" @@ -7691,11 +7175,6 @@ use-sync-external-store@^1.0.0: resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" diff --git a/examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj b/examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj index 84fe7bbfef..d520e1ed20 100644 --- a/examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj +++ b/examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj @@ -646,7 +646,11 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; @@ -724,7 +728,11 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/examples/SampleApp/yarn.lock b/examples/SampleApp/yarn.lock index 0b727630df..e7d388aada 100644 --- a/examples/SampleApp/yarn.lock +++ b/examples/SampleApp/yarn.lock @@ -2941,13 +2941,6 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -axios@^0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.22.0.tgz#bf702c41fb50fbca4539589d839a077117b79b25" - integrity sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w== - dependencies: - follow-redirects "^1.14.4" - axios@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" @@ -4370,11 +4363,6 @@ flow-parser@^0.206.0: resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.206.0.tgz#f4f794f8026535278393308e01ea72f31000bfef" integrity sha512-HVzoK3r6Vsg+lKvlIZzaWNBVai+FXTX1wdYhz/wVlH13tb/gOdLXmlTqy6odmTBhT5UoWUbq0k8263Qhr9d88w== -follow-redirects@^1.14.4: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - follow-redirects@^1.15.0: version "1.15.3" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" @@ -7387,10 +7375,10 @@ statuses@~1.5.0: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== -stream-chat-react-native-core@5.19.3: - version "5.19.3" - resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.19.3.tgz#6f99af372bce8414998d4cce13ce0855a1a20386" - integrity sha512-uOJC1tq9VqzaPdv5TL6PWbLar2mCGQ1nYKQ3tdcnQhL3T/3130oizoP0rh/3LB2HUqn19NcngfnzE2FBXTI++w== +stream-chat-react-native-core@5.21.0: + version "5.21.0" + resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.21.0.tgz#de8b5eca351eb7e5905b48b09a90eb5357c321cb" + integrity sha512-JOa7giYrQMUHdCqu8rPlSgtWQZyi/oG3EhdOArkUB2WUAFlKScmOfcYEIFRJCGYmKOsihBqqIwF6xPckJ+bpcQ== dependencies: "@babel/runtime" "^7.12.5" "@gorhom/bottom-sheet" "4.4.8" @@ -7404,7 +7392,7 @@ stream-chat-react-native-core@5.19.3: path "0.12.7" react-native-markdown-package "1.8.2" react-native-url-polyfill "^1.3.0" - stream-chat "~8.13.1" + stream-chat "~8.14.0" "stream-chat-react-native-core@link:../../package": version "0.0.0" @@ -7414,21 +7402,6 @@ stream-chat-react-native-core@5.19.3: version "0.0.0" uid "" -stream-chat@~8.13.1: - version "8.13.1" - resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.13.1.tgz#9781a456487f376d7c9c98271a4f4c926a9e6cf8" - integrity sha512-k0tOmtlLsvVxpZ2EuR+Z/qQiyCHOIjACqwnBZnT1ERA1t3549U2vzkUE6l2tN2VGAgUP1tDl00FhZO5JrAkMKw== - dependencies: - "@babel/runtime" "^7.16.3" - "@types/jsonwebtoken" "~9.0.0" - "@types/ws" "^7.4.0" - axios "^0.22.0" - base64-js "^1.5.1" - form-data "^4.0.0" - isomorphic-ws "^4.0.1" - jsonwebtoken "~9.0.0" - ws "^7.4.4" - stream-chat@~8.14.0: version "8.14.1" resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.14.1.tgz#f6560c2aa2ce754928d41d6059c61d7cfe770e0a" diff --git a/examples/TypeScriptMessaging/yarn.lock b/examples/TypeScriptMessaging/yarn.lock index 7e80ecf93a..b0b7a046f8 100644 --- a/examples/TypeScriptMessaging/yarn.lock +++ b/examples/TypeScriptMessaging/yarn.lock @@ -2436,13 +2436,6 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -axios@^0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.22.0.tgz#bf702c41fb50fbca4539589d839a077117b79b25" - integrity sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w== - dependencies: - follow-redirects "^1.14.4" - axios@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" @@ -3942,11 +3935,6 @@ flow-parser@^0.185.0: resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.185.2.tgz#cb7ee57f77377d6c5d69a469e980f6332a15e492" integrity sha512-2hJ5ACYeJCzNtiVULov6pljKOLygy0zddoqSI1fFetM+XRPpRshFdGEijtqlamA1XwyZ+7rhryI6FQFzvtLWUQ== -follow-redirects@^1.14.4: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - follow-redirects@^1.15.0: version "1.15.3" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" @@ -5294,11 +5282,6 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -linkify-plugin-mention@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/linkify-plugin-mention/-/linkify-plugin-mention-4.1.1.tgz#3ff4a45edc43d56e14582bf66dcadd152a45aeaa" - integrity sha512-7qIOT3FhU4+WlbdRC5sZYZJckOSgBI4Hg6pDXtIOtyaJOYKK3vos4L86yb1veVbyAO2hf4CKoEAGrEvIqKviIA== - linkifyjs@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/linkifyjs/-/linkifyjs-4.1.1.tgz#73d427e3bbaaf4ca8e71c589ad4ffda11a9a5fde" @@ -7205,10 +7188,10 @@ statuses@~1.5.0: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== -stream-chat-react-native-core@5.19.3: - version "5.19.3" - resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.19.3.tgz#6f99af372bce8414998d4cce13ce0855a1a20386" - integrity sha512-uOJC1tq9VqzaPdv5TL6PWbLar2mCGQ1nYKQ3tdcnQhL3T/3130oizoP0rh/3LB2HUqn19NcngfnzE2FBXTI++w== +stream-chat-react-native-core@5.21.0: + version "5.21.0" + resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.21.0.tgz#de8b5eca351eb7e5905b48b09a90eb5357c321cb" + integrity sha512-JOa7giYrQMUHdCqu8rPlSgtWQZyi/oG3EhdOArkUB2WUAFlKScmOfcYEIFRJCGYmKOsihBqqIwF6xPckJ+bpcQ== dependencies: "@babel/runtime" "^7.12.5" "@gorhom/bottom-sheet" "4.4.8" @@ -7222,7 +7205,7 @@ stream-chat-react-native-core@5.19.3: path "0.12.7" react-native-markdown-package "1.8.2" react-native-url-polyfill "^1.3.0" - stream-chat "~8.13.1" + stream-chat "~8.14.0" "stream-chat-react-native-core@link:../../package": version "0.0.0" @@ -7237,21 +7220,6 @@ stream-chat-react-native-devtools@^1.1.0: version "0.0.0" uid "" -stream-chat@~8.13.1: - version "8.13.1" - resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.13.1.tgz#9781a456487f376d7c9c98271a4f4c926a9e6cf8" - integrity sha512-k0tOmtlLsvVxpZ2EuR+Z/qQiyCHOIjACqwnBZnT1ERA1t3549U2vzkUE6l2tN2VGAgUP1tDl00FhZO5JrAkMKw== - dependencies: - "@babel/runtime" "^7.16.3" - "@types/jsonwebtoken" "~9.0.0" - "@types/ws" "^7.4.0" - axios "^0.22.0" - base64-js "^1.5.1" - form-data "^4.0.0" - isomorphic-ws "^4.0.1" - jsonwebtoken "~9.0.0" - ws "^7.4.4" - stream-chat@~8.14.0: version "8.14.1" resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.14.1.tgz#f6560c2aa2ce754928d41d6059c61d7cfe770e0a" diff --git a/package/expo-package/yarn.lock b/package/expo-package/yarn.lock index 6705fc7e7b..3125a55645 100644 --- a/package/expo-package/yarn.lock +++ b/package/expo-package/yarn.lock @@ -3041,10 +3041,10 @@ stream-buffers@2.2.x: resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg== -stream-chat-react-native-core@5.20.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.20.0.tgz#d8e6bb07d9f6c68dc28b106abf571d2c24ac044c" - integrity sha512-mNooiZsV9ZV/7EcpeekoDLr9BN/rYvAq3Ni0/VfXqh511mWEB0WcCBWVnBBy+qaeki/cga+eqHm3jpzV8u2P0w== +stream-chat-react-native-core@5.21.0: + version "5.21.0" + resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.21.0.tgz#de8b5eca351eb7e5905b48b09a90eb5357c321cb" + integrity sha512-JOa7giYrQMUHdCqu8rPlSgtWQZyi/oG3EhdOArkUB2WUAFlKScmOfcYEIFRJCGYmKOsihBqqIwF6xPckJ+bpcQ== dependencies: "@babel/runtime" "^7.12.5" "@gorhom/bottom-sheet" "4.4.8" diff --git a/package/native-package/yarn.lock b/package/native-package/yarn.lock index 9054663780..46738eca99 100644 --- a/package/native-package/yarn.lock +++ b/package/native-package/yarn.lock @@ -4386,10 +4386,10 @@ statuses@~1.5.0: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== -stream-chat-react-native-core@5.20.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.20.0.tgz#d8e6bb07d9f6c68dc28b106abf571d2c24ac044c" - integrity sha512-mNooiZsV9ZV/7EcpeekoDLr9BN/rYvAq3Ni0/VfXqh511mWEB0WcCBWVnBBy+qaeki/cga+eqHm3jpzV8u2P0w== +stream-chat-react-native-core@5.21.0: + version "5.21.0" + resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.21.0.tgz#de8b5eca351eb7e5905b48b09a90eb5357c321cb" + integrity sha512-JOa7giYrQMUHdCqu8rPlSgtWQZyi/oG3EhdOArkUB2WUAFlKScmOfcYEIFRJCGYmKOsihBqqIwF6xPckJ+bpcQ== dependencies: "@babel/runtime" "^7.12.5" "@gorhom/bottom-sheet" "4.4.8" From 813cb12b82b8f8d6298c9e5e42b788b057c6068e Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Tue, 14 Nov 2023 17:33:07 +0530 Subject: [PATCH 07/21] fix: update dimensions dynamically in the SDK (#2310) * fix: update dimensions dynamically in the SDK * docs: add comment for the hook * refactor: improve useViewPort hook --- .../components/Attachment/FileAttachment.tsx | 15 +++++-- .../AttachmentPicker/AttachmentPicker.tsx | 6 ++- .../components/AttachmentPickerItem.tsx | 4 +- .../ChannelPreviewMessenger.tsx | 7 ++-- .../hooks/useChannelPreviewDisplayName.ts | 7 ++-- .../components/ImageGallery/ImageGallery.tsx | 12 ++++-- .../components/AnimatedGalleryImage.tsx | 8 ++-- .../components/AnimatedGalleryVideo.tsx | 8 ++-- .../ImageGallery/components/ImageGrid.tsx | 3 +- .../Indicators/EmptyStateIndicator.tsx | 9 ++-- .../Message/MessageSimple/MessageContent.tsx | 4 +- .../MessageList/InlineUnreadIndicator.tsx | 3 +- .../MessageOverlay/MessageActionList.tsx | 14 ++----- .../MessageOverlay/MessageActionListItem.tsx | 7 +++- .../MessageOverlay/MessageOverlay.tsx | 8 ++-- .../components/ThreadFooterComponent.tsx | 3 +- .../src/contexts/themeContext/utils/theme.ts | 7 ---- package/src/hooks/useViewport.ts | 41 +++++++++++++++++++ package/src/utils/utils.ts | 13 ------ 19 files changed, 112 insertions(+), 67 deletions(-) create mode 100644 package/src/hooks/useViewport.ts diff --git a/package/src/components/Attachment/FileAttachment.tsx b/package/src/components/Attachment/FileAttachment.tsx index 6640523c95..38675a0b41 100644 --- a/package/src/components/Attachment/FileAttachment.tsx +++ b/package/src/components/Attachment/FileAttachment.tsx @@ -24,8 +24,8 @@ import { useMessagesContext, } from '../../contexts/messagesContext/MessagesContext'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; +import { useViewport } from '../../hooks/useViewport'; import type { DefaultStreamChatGenerics } from '../../types/types'; -import { vw } from '../../utils/utils'; const styles = StyleSheet.create({ container: { @@ -35,7 +35,6 @@ const styles = StyleSheet.create({ padding: 8, }, details: { - maxWidth: vw(60), paddingLeft: 16, }, size: { @@ -94,6 +93,7 @@ const FileAttachmentWithContext = < }, }, } = useTheme(); + const { vw } = useViewport(); const defaultOnPress = () => openUrlSafely(attachment.asset_url); @@ -134,7 +134,16 @@ const FileAttachmentWithContext = < > - + {attachment.title} diff --git a/package/src/components/AttachmentPicker/AttachmentPicker.tsx b/package/src/components/AttachmentPicker/AttachmentPicker.tsx index 7bbc35926e..fb9b76ca21 100644 --- a/package/src/components/AttachmentPicker/AttachmentPicker.tsx +++ b/package/src/components/AttachmentPicker/AttachmentPicker.tsx @@ -20,13 +20,13 @@ import { renderAttachmentPickerItem } from './components/AttachmentPickerItem'; import { useAttachmentPickerContext } from '../../contexts/attachmentPickerContext/AttachmentPickerContext'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; import { useTranslationContext } from '../../contexts/translationContext/TranslationContext'; +import { useViewport } from '../../hooks/useViewport'; import { getPhotos, iOS14RefreshGallerySelection, oniOS14GalleryLibrarySelectionChange, } from '../../native'; import type { Asset } from '../../types/types'; -import { vh } from '../../utils/utils'; dayjs.extend(duration); @@ -36,7 +36,6 @@ const styles = StyleSheet.create({ }, }); -const screenHeight = vh(100); const fullScreenHeight = Dimensions.get('window').height; export type AttachmentPickerProps = { @@ -106,6 +105,9 @@ export const AttachmentPicker = React.forwardRef( setSelectedPicker, topInset, } = useAttachmentPickerContext(); + const { vh } = useViewport(); + + const screenHeight = vh(100); const [currentIndex, setCurrentIndex] = useState(-1); const endCursorRef = useRef(); diff --git a/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx b/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx index 42f3a9a5c1..53bcffe42b 100644 --- a/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +++ b/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx @@ -8,10 +8,10 @@ import { lookup } from 'mime-types'; import type { AttachmentPickerContextValue } from '../../../contexts/attachmentPickerContext/AttachmentPickerContext'; import { useTheme } from '../../../contexts/themeContext/ThemeContext'; +import { useViewport } from '../../../hooks/useViewport'; import { Recorder } from '../../../icons'; import { getLocalAssetUri } from '../../../native'; import type { Asset, File } from '../../../types/types'; -import { vw } from '../../../utils/utils'; type AttachmentPickerItemType = Pick< AttachmentPickerContextValue, @@ -39,6 +39,7 @@ const AttachmentVideo: React.FC = (props) => { selectedFiles, setSelectedFiles, } = props; + const { vw } = useViewport(); const { theme: { @@ -152,6 +153,7 @@ const AttachmentImage: React.FC = (props) => { colors: { overlay }, }, } = useTheme(); + const { vw } = useViewport(); const size = vw(100) / (numberOfAttachmentPickerImageColumns || 3) - 2; diff --git a/package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx b/package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx index 12866f2b1c..9cb3fd3927 100644 --- a/package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +++ b/package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx @@ -19,8 +19,8 @@ import { } from '../../contexts/channelsContext/ChannelsContext'; import { useChatContext } from '../../contexts/chatContext/ChatContext'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; +import { useViewport } from '../../hooks/useViewport'; import type { DefaultStreamChatGenerics } from '../../types/types'; -import { vw } from '../../utils/utils'; const styles = StyleSheet.create({ container: { @@ -45,8 +45,6 @@ const styles = StyleSheet.create({ title: { fontSize: 14, fontWeight: '700' }, }); -const maxWidth = vw(80) - 16 - 40; - export type ChannelPreviewMessengerPropsWithContext< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Pick, 'channel'> & @@ -120,6 +118,9 @@ const ChannelPreviewMessengerWithContext = < PreviewMutedStatus = ChannelPreviewMutedStatus, unread, } = props; + const { vw } = useViewport(); + + const maxWidth = vw(80) - 16 - 40; const { theme: { diff --git a/package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts b/package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts index ffc37d8b8c..ea79980116 100644 --- a/package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts +++ b/package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts @@ -3,11 +3,9 @@ import { useEffect, useState } from 'react'; import type { Channel, ChannelMemberResponse } from 'stream-chat'; import { useChatContext } from '../../../contexts/chatContext/ChatContext'; +import { useViewport } from '../../../hooks/useViewport'; import type { DefaultStreamChatGenerics } from '../../../types/types'; -import { vw } from '../../../utils/utils'; - -const DEFAULT_MAX_CHARACTER_LENGTH = (vw(100) - 16) / 6; const ELLIPSIS = `...`; @@ -81,6 +79,9 @@ export const useChannelPreviewDisplayName = < characterLength?: number, ) => { const { client } = useChatContext(); + const { vw } = useViewport(); + + const DEFAULT_MAX_CHARACTER_LENGTH = (vw(100) - 16) / 6; const currentUserId = client?.userID; const members = channel?.state?.members; diff --git a/package/src/components/ImageGallery/ImageGallery.tsx b/package/src/components/ImageGallery/ImageGallery.tsx index da2ad0d50f..ba0567e8f3 100644 --- a/package/src/components/ImageGallery/ImageGallery.tsx +++ b/package/src/components/ImageGallery/ImageGallery.tsx @@ -55,18 +55,16 @@ import { useOverlayContext, } from '../../contexts/overlayContext/OverlayContext'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; +import { useViewport } from '../../hooks/useViewport'; import { isVideoPackageAvailable, VideoType } from '../../native'; import type { DefaultStreamChatGenerics } from '../../types/types'; import { getResizedImageUrl } from '../../utils/getResizedImageUrl'; import { getUrlOfImageAttachment } from '../../utils/getUrlOfImageAttachment'; -import { vh, vw } from '../../utils/utils'; import { getGiphyMimeType } from '../Attachment/utils/getGiphyMimeType'; const isAndroid = Platform.OS === 'android'; const fullScreenHeight = Dimensions.get('screen').height; -const measuredScreenHeight = vh(100); -const screenWidth = vw(100); -const halfScreenWidth = vw(50); + const MARGIN = 32; export enum HasPinched { @@ -162,6 +160,12 @@ export const ImageGallery = < const { messages, selectedMessage, setSelectedMessage } = useImageGalleryContext(); + const { vh, vw } = useViewport(); + + const measuredScreenHeight = vh(100); + const screenWidth = vw(100); + const halfScreenWidth = vw(50); + /** * Height constants */ diff --git a/package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx b/package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx index 5b79dfe844..575626cd26 100644 --- a/package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +++ b/package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx @@ -3,10 +3,8 @@ import { View } from 'react-native'; import type { ImageStyle, StyleProp } from 'react-native'; import Animated, { useAnimatedStyle } from 'react-native-reanimated'; -import { vw } from '../../../utils/utils'; +import { useViewport } from '../../../hooks/useViewport'; -const screenWidth = vw(100); -const halfScreenWidth = vw(50); const oneEighth = 1 / 8; type Props = { @@ -40,6 +38,10 @@ export const AnimatedGalleryImage: React.FC = React.memo( translateX, translateY, } = props; + const { vw } = useViewport(); + + const screenWidth = vw(100); + const halfScreenWidth = vw(50); /** * The current image, designated by selected is scaled and translated diff --git a/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx b/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx index 6f944ce0da..2bc8701564 100644 --- a/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +++ b/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx @@ -3,6 +3,7 @@ import { StyleSheet, View, ViewStyle } from 'react-native'; import type { StyleProp } from 'react-native'; import Animated, { useAnimatedStyle } from 'react-native-reanimated'; +import { useViewport } from '../../../hooks/useViewport'; import { isVideoPackageAvailable, PlaybackStatus, @@ -12,11 +13,8 @@ import { VideoType, } from '../../../native'; -import { vw } from '../../../utils/utils'; import { Spinner } from '../../Spinner/Spinner'; -const screenWidth = vw(100); -const halfScreenWidth = vw(50); const oneEighth = 1 / 8; export type AnimatedGalleryVideoType = { @@ -74,6 +72,10 @@ export const AnimatedGalleryVideo: React.FC = React.me translateY, videoRef, } = props; + const { vw } = useViewport(); + + const screenWidth = vw(100); + const halfScreenWidth = vw(50); const onLoadStart = () => { setOpacity(1); diff --git a/package/src/components/ImageGallery/components/ImageGrid.tsx b/package/src/components/ImageGallery/components/ImageGrid.tsx index debc9dd76f..1fa93fbe71 100644 --- a/package/src/components/ImageGallery/components/ImageGrid.tsx +++ b/package/src/components/ImageGallery/components/ImageGrid.tsx @@ -5,8 +5,8 @@ import { BottomSheetFlatList, TouchableOpacity } from '@gorhom/bottom-sheet'; import { VideoThumbnail } from '../../../components/Attachment/VideoThumbnail'; import { useTheme } from '../../../contexts/themeContext/ThemeContext'; +import { useViewport } from '../../../hooks/useViewport'; import type { DefaultStreamChatGenerics } from '../../../types/types'; -import { vw } from '../../../utils/utils'; import type { Photo } from '../ImageGallery'; @@ -71,6 +71,7 @@ const GridImage = < }, }, } = useTheme(); + const { vw } = useViewport(); const { imageComponent, ...restItem } = item; const { numberOfImageGalleryGridColumns, selectAndClose, type, uri } = restItem; diff --git a/package/src/components/Indicators/EmptyStateIndicator.tsx b/package/src/components/Indicators/EmptyStateIndicator.tsx index d020e89bd2..a70e98a1c2 100644 --- a/package/src/components/Indicators/EmptyStateIndicator.tsx +++ b/package/src/components/Indicators/EmptyStateIndicator.tsx @@ -3,10 +3,8 @@ import { StyleSheet, Text, View } from 'react-native'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; import { useTranslationContext } from '../../contexts/translationContext/TranslationContext'; +import { useViewport } from '../../hooks/useViewport'; import { MessageIcon } from '../../icons/MessageIcon'; -import { vw } from '../../utils/utils'; - -const width = vw(33); const styles = StyleSheet.create({ channelContainer: { @@ -17,7 +15,6 @@ const styles = StyleSheet.create({ channelDetails: { fontSize: 14, textAlign: 'center', - width: vw(66), }, channelTitle: { fontSize: 16, @@ -37,6 +34,8 @@ export const EmptyStateIndicator: React.FC = ({ listType }) => emptyStateIndicator: { channelContainer, channelDetails, channelTitle }, }, } = useTheme(); + const { vw } = useViewport(); + const width = vw(33); const { t } = useTranslationContext(); switch (listType) { @@ -51,7 +50,7 @@ export const EmptyStateIndicator: React.FC = ({ listType }) => {t("Let's start chatting!")} {t('How about sending your first message to a friend?')} diff --git a/package/src/components/Message/MessageSimple/MessageContent.tsx b/package/src/components/Message/MessageSimple/MessageContent.tsx index a567978614..7ecb02dbe6 100644 --- a/package/src/components/Message/MessageSimple/MessageContent.tsx +++ b/package/src/components/Message/MessageSimple/MessageContent.tsx @@ -19,8 +19,9 @@ import { useTranslationContext, } from '../../../contexts/translationContext/TranslationContext'; +import { useViewport } from '../../../hooks/useViewport'; import type { DefaultStreamChatGenerics } from '../../../types/types'; -import { MessageStatusTypes, vw } from '../../../utils/utils'; +import { MessageStatusTypes } from '../../../utils/utils'; const styles = StyleSheet.create({ containerInner: { @@ -164,6 +165,7 @@ const MessageContentWithContext = < }, }, } = useTheme(); + const { vw } = useViewport(); const getDateText = (formatter?: (date: TDateTimeParserInput) => string) => { if (!message.created_at) return ''; diff --git a/package/src/components/MessageList/InlineUnreadIndicator.tsx b/package/src/components/MessageList/InlineUnreadIndicator.tsx index 626469fcce..9d711126d5 100644 --- a/package/src/components/MessageList/InlineUnreadIndicator.tsx +++ b/package/src/components/MessageList/InlineUnreadIndicator.tsx @@ -4,7 +4,7 @@ import Svg, { Defs, LinearGradient, Rect, Stop } from 'react-native-svg'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; import { useTranslationContext } from '../../contexts/translationContext/TranslationContext'; -import { vw } from '../../utils/utils'; +import { useViewport } from '../../hooks/useViewport'; const styles = StyleSheet.create({ container: { @@ -28,6 +28,7 @@ export const InlineUnreadIndicator: React.FC = () => { }, } = useTheme(); const { t } = useTranslationContext(); + const { vw } = useViewport(); return ( diff --git a/package/src/components/MessageOverlay/MessageActionList.tsx b/package/src/components/MessageOverlay/MessageActionList.tsx index c0036bfd96..43a70d7dd7 100644 --- a/package/src/components/MessageOverlay/MessageActionList.tsx +++ b/package/src/components/MessageOverlay/MessageActionList.tsx @@ -10,8 +10,8 @@ import { } from '../../contexts/messageOverlayContext/MessageOverlayContext'; import type { OverlayProviderProps } from '../../contexts/overlayContext/OverlayContext'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; +import { useViewport } from '../../hooks/useViewport'; import type { DefaultStreamChatGenerics } from '../../types/types'; -import { vw } from '../../utils/utils'; export type MessageActionListPropsWithContext< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, @@ -52,6 +52,7 @@ const MessageActionListWithContext = < message, messageReactions, }; + const { vw } = useViewport(); const { theme: { @@ -89,7 +90,7 @@ const MessageActionListWithContext = < width.value = layout.width; height.value = layout.height; }} - style={[styles.container, { backgroundColor: white_snow }, showScreenStyle]} + style={[styles.container, { backgroundColor: white_snow, minWidth: vw(65) }, showScreenStyle]} testID='message-action-list' > {messageActions?.map((messageAction, index) => ( @@ -154,17 +155,8 @@ const styles = StyleSheet.create({ container: { borderRadius: 16, marginTop: 8, - minWidth: vw(65), overflow: 'hidden', }, - row: { - alignItems: 'center', - flexDirection: 'row', - justifyContent: 'flex-start', - minWidth: vw(65), - paddingHorizontal: 20, - paddingVertical: 10, - }, titleStyle: { paddingLeft: 20, }, diff --git a/package/src/components/MessageOverlay/MessageActionListItem.tsx b/package/src/components/MessageOverlay/MessageActionListItem.tsx index 01b15bfb8e..fc0e8cba9e 100644 --- a/package/src/components/MessageOverlay/MessageActionListItem.tsx +++ b/package/src/components/MessageOverlay/MessageActionListItem.tsx @@ -6,8 +6,8 @@ import Animated from 'react-native-reanimated'; import { useMessageActionAnimation } from './hooks/useMessageActionAnimation'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; +import { useViewport } from '../../hooks/useViewport'; import type { DefaultStreamChatGenerics } from '../../types/types'; -import { vw } from '../../utils/utils'; import type { MessageOverlayPropsWithContext } from '../MessageOverlay/MessageOverlay'; export type ActionType = @@ -50,6 +50,7 @@ const MessageActionListItemWithContext = < props: MessageActionListItemProps, ) => { const { action, actionType, icon, index, length, title, titleStyle } = props; + const { vw } = useViewport(); const { theme: { @@ -65,6 +66,9 @@ const MessageActionListItemWithContext = < { const { Message, thread } = props; const { t } = useTranslationContext(); + const { vw } = useViewport(); const { theme: { diff --git a/package/src/contexts/themeContext/utils/theme.ts b/package/src/contexts/themeContext/utils/theme.ts index ec1fb90228..f386221119 100644 --- a/package/src/contexts/themeContext/utils/theme.ts +++ b/package/src/contexts/themeContext/utils/theme.ts @@ -2,7 +2,6 @@ import type { ImageStyle, TextStyle, ViewStyle } from 'react-native'; import type { CircleProps, Color, StopProps } from 'react-native-svg'; import type { IconProps } from '../../../icons/utils/base'; -import { vh } from '../../../utils/utils'; export const DEFAULT_STATUS_ICON_SIZE = 16; @@ -302,9 +301,6 @@ export type Theme = { iconContainer: ViewStyle; title: TextStyle; }; - container: ViewStyle & { - maxHeight: number; - }; emoji: { container: ViewStyle; text: TextStyle; @@ -810,9 +806,6 @@ export const defaultTheme: Theme = { iconContainer: {}, title: {}, }, - container: { - maxHeight: vh(25), - }, emoji: { container: {}, text: {}, diff --git a/package/src/hooks/useViewport.ts b/package/src/hooks/useViewport.ts new file mode 100644 index 0000000000..05d672da3b --- /dev/null +++ b/package/src/hooks/useViewport.ts @@ -0,0 +1,41 @@ +import { useEffect, useMemo, useState } from 'react'; +import { Dimensions } from 'react-native'; + +/** + * A custom hook that provides functions to calculate dimensions based on + * a percentage of the viewport height (vh) and viewport width (vw). It + * dynamically updates dimensions on changes in device orientation. + * + * @returns {Object} An object containing functions vh and vw. + */ +export const useViewport = (rounded?: boolean) => { + const [viewportDimensions, setViewportDimensions] = useState(Dimensions.get('window')); + + useEffect(() => { + const subscriptions = Dimensions.addEventListener('change', ({ window }) => { + setViewportDimensions((prev) => { + const { height, width } = window; + if (prev.height !== height || prev.width !== width) { + return window; + } + return prev; + }); + }); + + return () => subscriptions?.remove(); + }, []); + + const vw = (percentageWidth: number) => { + const value = viewportDimensions.width * (percentageWidth / 100); + return rounded ? Math.round(value) : value; + }; + + const vh = (percentageHeight: number) => { + const value = viewportDimensions.height * (percentageHeight / 100); + return rounded ? Math.round(value) : value; + }; + + const viewportFunctions = useMemo(() => ({ vh, vw }), [vh, vw]); + + return viewportFunctions; +}; diff --git a/package/src/utils/utils.ts b/package/src/utils/utils.ts index 88b881061d..ecfaef33af 100644 --- a/package/src/utils/utils.ts +++ b/package/src/utils/utils.ts @@ -1,5 +1,4 @@ import type React from 'react'; -import { Dimensions } from 'react-native'; import type { DebouncedFunc } from 'lodash'; import debounce from 'lodash/debounce'; @@ -519,18 +518,6 @@ export const getUrlWithoutParams = (url?: string) => { export const isLocalUrl = (url: string) => url.indexOf('http') !== 0; -export const vw = (percentageWidth: number, rounded = false) => { - const value = Dimensions.get('window').width * (percentageWidth / 100); - return rounded ? Math.round(value) : value; -}; - -export const vh = (percentageHeight: number, rounded = false) => { - const height = Dimensions.get('window').height; - - const value = height * (percentageHeight / 100); - return rounded ? Math.round(value) : value; -}; - export const generateRandomId = (a = ''): string => a ? /* eslint-disable no-bitwise */ From 80c2c3677211c6e87c9f697df30034e39ff338a1 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri <3846977+santhoshvai@users.noreply.github.com> Date: Tue, 14 Nov 2023 13:42:54 +0100 Subject: [PATCH 08/21] fix: if camera permission cannot be requested go to settings (#2299) * fix: if camera permission cannot be requested go to settings * chore: fix suggestion --- .../expo-package/src/handlers/takePhoto.ts | 19 ++-- .../native-package/src/handlers/takePhoto.ts | 97 ++++++++++++------- 2 files changed, 74 insertions(+), 42 deletions(-) diff --git a/package/expo-package/src/handlers/takePhoto.ts b/package/expo-package/src/handlers/takePhoto.ts index 1aa388ffb7..6259636ac8 100644 --- a/package/expo-package/src/handlers/takePhoto.ts +++ b/package/expo-package/src/handlers/takePhoto.ts @@ -1,4 +1,4 @@ -import { Image, Platform } from 'react-native'; +import { Image, Linking, Platform } from 'react-native'; import * as ImagePicker from 'expo-image-picker'; @@ -10,12 +10,19 @@ type Size = { export const takePhoto = async ({ compressImageQuality = 1 }) => { try { const permissionCheck = await ImagePicker.getCameraPermissionsAsync(); - const permissionGranted = - permissionCheck?.status === 'granted' - ? permissionCheck - : await ImagePicker.requestCameraPermissionsAsync(); + const canRequest = permissionCheck.canAskAgain; + let permissionGranted = permissionCheck.granted; + if (!permissionGranted) { + if (canRequest) { + const response = await ImagePicker.requestCameraPermissionsAsync(); + permissionGranted = response.granted; + } else { + Linking.openSettings(); + return { cancelled: true }; + } + } - if (permissionGranted?.status === 'granted' || permissionGranted?.granted === true) { + if (permissionGranted) { const imagePickerSuccessResult = await ImagePicker.launchCameraAsync({ quality: Math.min(Math.max(0, compressImageQuality), 1), }); diff --git a/package/native-package/src/handlers/takePhoto.ts b/package/native-package/src/handlers/takePhoto.ts index a8336eccd6..72d02acd0e 100644 --- a/package/native-package/src/handlers/takePhoto.ts +++ b/package/native-package/src/handlers/takePhoto.ts @@ -1,47 +1,72 @@ -import { Image, Platform } from 'react-native'; +import { AppState, Image, Linking, PermissionsAndroid, Platform } from 'react-native'; import ImagePicker from 'react-native-image-crop-picker'; -export const takePhoto = async ({ compressImageQuality = Platform.OS === 'ios' ? 0.8 : 1 }) => { - const photo = await ImagePicker.openCamera({ - compressImageQuality: Math.min(Math.max(0, compressImageQuality), 1), - }); +let hadDeniedAndroidPermission = false; - if (photo.height && photo.width && photo.path) { - let size: { height?: number; width?: number } = {}; - if (Platform.OS === 'android') { - // Height and width returned by ImagePicker are incorrect on Android. - // The issue is described in following github issue: - // https://github.com/ivpusic/react-native-image-crop-picker/issues/901 - // This we can't rely on them as it is, and we need to use Image.getSize - // to get accurate size. - const getSize = (): Promise<{ height: number; width: number }> => - new Promise((resolve) => { - Image.getSize(photo.path, (width, height) => { - resolve({ height, width }); +export const takePhoto = async ({ compressImageQuality = Platform.OS === 'ios' ? 0.8 : 1 }) => { + if (Platform.OS === 'android') { + const cameraPermissions = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.CAMERA); + if (!cameraPermissions) { + const androidPermissionStatus = await PermissionsAndroid.request( + PermissionsAndroid.PERMISSIONS.CAMERA, + ); + if (androidPermissionStatus === PermissionsAndroid.RESULTS.DENIED) { + hadDeniedAndroidPermission = true; + return { cancelled: true }; + } else if (androidPermissionStatus === PermissionsAndroid.RESULTS.NEVER_ASK_AGAIN) { + if (!hadDeniedAndroidPermission) { + Linking.openSettings(); + } + return { cancelled: true }; + } + } + } + try { + const photo = await ImagePicker.openCamera({ + compressImageQuality: Math.min(Math.max(0, compressImageQuality), 1), + }); + if (photo.height && photo.width && photo.path) { + let size: { height?: number; width?: number } = {}; + if (Platform.OS === 'android') { + // Height and width returned by ImagePicker are incorrect on Android. + // The issue is described in following github issue: + // https://github.com/ivpusic/react-native-image-crop-picker/issues/901 + // This we can't rely on them as it is, and we need to use Image.getSize + // to get accurate size. + const getSize = (): Promise<{ height: number; width: number }> => + new Promise((resolve) => { + Image.getSize(photo.path, (width, height) => { + resolve({ height, width }); + }); }); - }); - try { - const { height, width } = await getSize(); - size.height = height; - size.width = width; - } catch (e) { - // do nothing - console.warn('Error get image size of picture caputred from camera ', e); + try { + const { height, width } = await getSize(); + size.height = height; + size.width = width; + } catch (e) { + // do nothing + console.warn('Error get image size of picture caputred from camera ', e); + } + } else { + size = { + height: photo.height, + width: photo.width, + }; } - } else { - size = { - height: photo.height, - width: photo.width, + return { + cancelled: false, + source: 'camera', + uri: photo.path, + ...size, }; } - - return { - cancelled: false, - source: 'camera', - uri: photo.path, - ...size, - }; + } catch (e: unknown) { + // on iOS: if it was in inactive state, then the user had just denied the permissions + if (Platform.OS === 'ios' && AppState.currentState === 'active') { + await Linking.openSettings(); + } } + return { cancelled: true }; }; From e723d163be4056ad72d694789ce7fb7c45e2ea0f Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri <3846977+santhoshvai@users.noreply.github.com> Date: Tue, 14 Nov 2023 15:04:25 +0100 Subject: [PATCH 09/21] fix: unnecessary reanimated warning (#2311) --- .../src/components/ImageGallery/ImageGallery.tsx | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/package/src/components/ImageGallery/ImageGallery.tsx b/package/src/components/ImageGallery/ImageGallery.tsx index ba0567e8f3..af4795708b 100644 --- a/package/src/components/ImageGallery/ImageGallery.tsx +++ b/package/src/components/ImageGallery/ImageGallery.tsx @@ -575,21 +575,7 @@ export const ImageGallery = < simultaneousHandlers={[pinchRef]} > - + {imageGalleryAttachments.map((photo, i) => photo.type === 'video' ? ( Date: Tue, 14 Nov 2023 23:21:07 +0530 Subject: [PATCH 10/21] docs: update build status badge in README.md (#2312) --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 057c7e063a..56b4e1c192 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![NPM](https://img.shields.io/npm/v/stream-chat-react-native.svg)](https://www.npmjs.com/package/stream-chat-react-native) -[![Build Status](https://github.com/GetStream/stream-chat-react-native/workflows/build/badge.svg)](https://github.com/GetStream/stream-chat-react-native/actions) +[![Build Status](https://github.com/GetStream/stream-chat-react-native/actions/workflows/release.yml/badge.svg)](https://github.com/GetStream/stream-chat-react-native/actions) [![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.io/chat/docs/sdk/reactnative) @@ -25,10 +25,15 @@ ## Contents -- [React Native Chat Tutorial](#-react-native-chat-tutorial) -- [Example Apps](#-example-apps) -- [Keep in mind](#-keep-in-mind) -- [Contributing](#-contributing) +- [Official React Native SDK for Stream Chat](#official-react-native-sdk-for-stream-chat) + - [Contents](#contents) + - [📖 React Native Chat Tutorial](#-react-native-chat-tutorial) + - [Free for Makers](#free-for-makers) + - [🔮 Example Apps](#-example-apps) + - [💬 Keep in mind](#-keep-in-mind) + - [👏 Contributing](#-contributing) + - [Git flow \& Release process](#git-flow--release-process) + - [We are hiring](#we-are-hiring) ## 📖 React Native Chat Tutorial From be241e16690d85fc6d7a123ce304a355ff19e01c Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Wed, 15 Nov 2023 20:49:40 +0530 Subject: [PATCH 11/21] fix: sample-app crash because of viewport changes (#2313) --- .../SampleApp/src/components/BottomSheetOverlay.tsx | 6 +++--- .../SampleApp/src/components/ChannelInfoOverlay.tsx | 12 ++++++------ .../SampleApp/src/components/UserInfoOverlay.tsx | 9 +++++---- package/src/hooks/index.ts | 1 + 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/examples/SampleApp/src/components/BottomSheetOverlay.tsx b/examples/SampleApp/src/components/BottomSheetOverlay.tsx index e84ab42e24..403082a028 100644 --- a/examples/SampleApp/src/components/BottomSheetOverlay.tsx +++ b/examples/SampleApp/src/components/BottomSheetOverlay.tsx @@ -19,7 +19,7 @@ import Animated, { withSpring, withTiming, } from 'react-native-reanimated'; -import { KeyboardCompatibleView, useTheme, vh } from 'stream-chat-react-native'; +import { KeyboardCompatibleView, useTheme, useViewport } from 'stream-chat-react-native'; import { AddMemberBottomSheet } from './AddMemberBottomSheet'; import { ConfirmationBottomSheet } from './ConfirmationBottomSheet'; @@ -44,12 +44,12 @@ export type BottomSheetOverlayProps = { visible: boolean; }; -const screenHeight = vh(100); - export const BottomSheetOverlay = (props: BottomSheetOverlayProps) => { const { overlayOpacity, visible } = props; const { overlay, setOverlay } = useAppOverlayContext(); + const { vh } = useViewport(); + const screenHeight = vh(100); const { reset } = useBottomSheetOverlayContext(); diff --git a/examples/SampleApp/src/components/ChannelInfoOverlay.tsx b/examples/SampleApp/src/components/ChannelInfoOverlay.tsx index 1b1f71b4bc..ac14c1c97e 100644 --- a/examples/SampleApp/src/components/ChannelInfoOverlay.tsx +++ b/examples/SampleApp/src/components/ChannelInfoOverlay.tsx @@ -27,8 +27,7 @@ import { User, UserMinus, useTheme, - vh, - vw, + useViewport, } from 'stream-chat-react-native'; import { useAppOverlayContext } from '../context/AppOverlayContext'; @@ -94,10 +93,6 @@ const styles = StyleSheet.create({ }, }); -const screenHeight = vh(100); -const halfScreenHeight = vh(50); -const width = vw(100) - 60; - export type ChannelInfoOverlayProps = { overlayOpacity: Animated.SharedValue; visible?: boolean; @@ -109,6 +104,11 @@ export const ChannelInfoOverlay = (props: ChannelInfoOverlayProps) => { const { overlay, setOverlay } = useAppOverlayContext(); const { setData } = useBottomSheetOverlayContext(); const { data, reset } = useChannelInfoOverlayContext(); + const { vh, vw } = useViewport(); + + const screenHeight = vh(100); + const halfScreenHeight = vh(50); + const width = vw(100) - 60; const { channel, clientId, navigation } = data || {}; diff --git a/examples/SampleApp/src/components/UserInfoOverlay.tsx b/examples/SampleApp/src/components/UserInfoOverlay.tsx index 47c81ec193..3d7e79d30a 100644 --- a/examples/SampleApp/src/components/UserInfoOverlay.tsx +++ b/examples/SampleApp/src/components/UserInfoOverlay.tsx @@ -28,7 +28,7 @@ import { User, UserMinus, useTheme, - vh, + useViewport, } from 'stream-chat-react-native'; import { useAppOverlayContext } from '../context/AppOverlayContext'; @@ -96,9 +96,6 @@ const styles = StyleSheet.create({ }, }); -const screenHeight = vh(100); -const halfScreenHeight = vh(50); - export type UserInfoOverlayProps = { overlayOpacity: Animated.SharedValue; visible?: boolean; @@ -111,6 +108,10 @@ export const UserInfoOverlay = (props: UserInfoOverlayProps) => { const { client } = useChatContext(); const { setData } = useBottomSheetOverlayContext(); const { data, reset } = useUserInfoOverlayContext(); + const { vh } = useViewport(); + + const screenHeight = vh(100); + const halfScreenHeight = vh(50); const { channel, member, navigation } = data || {}; diff --git a/package/src/hooks/index.ts b/package/src/hooks/index.ts index 2976442b21..ae05c13853 100644 --- a/package/src/hooks/index.ts +++ b/package/src/hooks/index.ts @@ -1,2 +1,3 @@ export * from './useAppStateListener'; export * from './useStreami18n'; +export * from './useViewport'; From 2e3914221319917a9f8e3d4b7c18c6810796748e Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Mon, 20 Nov 2023 21:04:03 +0530 Subject: [PATCH 12/21] fix: issue with camera permissions when clicking the camera picker (#2315) * fix: issue with camera permissions when clicking the camera picker * fix: open settings logic * feat: show alert before opening settings --- .../expo-package/src/handlers/takePhoto.ts | 5 ++--- .../native-package/src/handlers/takePhoto.ts | 22 +++++++++---------- .../components/AttachmentSelectionBar.tsx | 14 +++++++++++- package/src/i18n/en.json | 5 ++++- package/src/i18n/es.json | 5 ++++- package/src/i18n/fr.json | 5 ++++- package/src/i18n/he.json | 5 ++++- package/src/i18n/hi.json | 5 ++++- package/src/i18n/it.json | 5 ++++- package/src/i18n/ja.json | 5 ++++- package/src/i18n/ko.json | 5 ++++- package/src/i18n/nl.json | 5 ++++- package/src/i18n/ru.json | 5 ++++- package/src/i18n/tr.json | 5 ++++- package/src/native.ts | 6 ++++- 15 files changed, 75 insertions(+), 27 deletions(-) diff --git a/package/expo-package/src/handlers/takePhoto.ts b/package/expo-package/src/handlers/takePhoto.ts index 6259636ac8..b30d351ef5 100644 --- a/package/expo-package/src/handlers/takePhoto.ts +++ b/package/expo-package/src/handlers/takePhoto.ts @@ -1,4 +1,4 @@ -import { Image, Linking, Platform } from 'react-native'; +import { Image, Platform } from 'react-native'; import * as ImagePicker from 'expo-image-picker'; @@ -17,8 +17,7 @@ export const takePhoto = async ({ compressImageQuality = 1 }) => { const response = await ImagePicker.requestCameraPermissionsAsync(); permissionGranted = response.granted; } else { - Linking.openSettings(); - return { cancelled: true }; + return { askToOpenSettings: true, cancelled: true }; } } diff --git a/package/native-package/src/handlers/takePhoto.ts b/package/native-package/src/handlers/takePhoto.ts index 72d02acd0e..344b215291 100644 --- a/package/native-package/src/handlers/takePhoto.ts +++ b/package/native-package/src/handlers/takePhoto.ts @@ -1,8 +1,6 @@ -import { AppState, Image, Linking, PermissionsAndroid, Platform } from 'react-native'; +import { AppState, Image, PermissionsAndroid, Platform } from 'react-native'; import ImagePicker from 'react-native-image-crop-picker'; -let hadDeniedAndroidPermission = false; - export const takePhoto = async ({ compressImageQuality = Platform.OS === 'ios' ? 0.8 : 1 }) => { if (Platform.OS === 'android') { const cameraPermissions = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.CAMERA); @@ -11,13 +9,9 @@ export const takePhoto = async ({ compressImageQuality = Platform.OS === 'ios' ? PermissionsAndroid.PERMISSIONS.CAMERA, ); if (androidPermissionStatus === PermissionsAndroid.RESULTS.DENIED) { - hadDeniedAndroidPermission = true; return { cancelled: true }; } else if (androidPermissionStatus === PermissionsAndroid.RESULTS.NEVER_ASK_AGAIN) { - if (!hadDeniedAndroidPermission) { - Linking.openSettings(); - } - return { cancelled: true }; + return { askToOpenSettings: true, cancelled: true }; } } } @@ -62,9 +56,15 @@ export const takePhoto = async ({ compressImageQuality = Platform.OS === 'ios' ? }; } } catch (e: unknown) { - // on iOS: if it was in inactive state, then the user had just denied the permissions - if (Platform.OS === 'ios' && AppState.currentState === 'active') { - await Linking.openSettings(); + if (e instanceof Error) { + // on iOS: if it was in inactive state, then the user had just denied the permissions + if (Platform.OS === 'ios' && AppState.currentState === 'active') { + const cameraPermissionDeniedMsg = 'User did not grant camera permission.'; + // Open settings when the user did not allow camera permissions + if (e.message === cameraPermissionDeniedMsg) { + return { askToOpenSettings: true, cancelled: true }; + } + } } } diff --git a/package/src/components/AttachmentPicker/components/AttachmentSelectionBar.tsx b/package/src/components/AttachmentPicker/components/AttachmentSelectionBar.tsx index 8501b8cb10..c1568af526 100644 --- a/package/src/components/AttachmentPicker/components/AttachmentSelectionBar.tsx +++ b/package/src/components/AttachmentPicker/components/AttachmentSelectionBar.tsx @@ -1,9 +1,10 @@ import React from 'react'; -import { StyleSheet, TouchableOpacity, View } from 'react-native'; +import { Alert, Linking, StyleSheet, TouchableOpacity, View } from 'react-native'; import { useAttachmentPickerContext } from '../../../contexts/attachmentPickerContext/AttachmentPickerContext'; import { useMessageInputContext } from '../../../contexts/messageInputContext/MessageInputContext'; import { useTheme } from '../../../contexts/themeContext/ThemeContext'; +import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext'; import { takePhoto } from '../../../native'; @@ -29,6 +30,7 @@ export const AttachmentSelectionBar: React.FC = () => { setSelectedImages, setSelectedPicker, } = useAttachmentPickerContext(); + const { t } = useTranslationContext(); const { compressImageQuality, hasFilePicker, imageUploads, pickFile } = useMessageInputContext(); @@ -57,6 +59,16 @@ export const AttachmentSelectionBar: React.FC = () => { setSelectedPicker(undefined); closePicker(); const photo = await takePhoto({ compressImageQuality }); + if (photo.askToOpenSettings) { + Alert.alert( + t('Allow camera access in device settings'), + t('Device camera is used to take photos or videos.'), + [ + { style: 'cancel', text: t('Cancel') }, + { onPress: () => Linking.openSettings(), style: 'default', text: t('Open Settings') }, + ], + ); + } if (!photo.cancelled) { setSelectedImages((images) => [...images, photo]); } diff --git a/package/src/i18n/en.json b/package/src/i18n/en.json index 212cfff0d3..99fcacd7c7 100644 --- a/package/src/i18n/en.json +++ b/package/src/i18n/en.json @@ -70,5 +70,8 @@ "🏙 Attachment...": "🏙 Attachment...", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.", "Let's start chatting!": "Let's start chatting!", - "How about sending your first message to a friend?": "How about sending your first message to a friend?" + "How about sending your first message to a friend?": "How about sending your first message to a friend?", + "Allow camera access in device settings": "Allow camera access in device settings", + "Device camera is used to take photos or videos.": "Device camera is used to take photos or videos.", + "Open Settings": "Open Settings" } diff --git a/package/src/i18n/es.json b/package/src/i18n/es.json index ca42b9754a..dc099a3f87 100644 --- a/package/src/i18n/es.json +++ b/package/src/i18n/es.json @@ -70,5 +70,8 @@ "🏙 Attachment...": "🏙 Adjunto...", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "El archivo supera el tamaño máximo permitido. Por favor, selecciona un archivo menor a {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.", "Let's start chatting!": "¡Empecemos a charlar!", - "How about sending your first message to a friend?": "¿Qué tal enviar tu primer mensaje a un amigo?" + "How about sending your first message to a friend?": "¿Qué tal enviar tu primer mensaje a un amigo?", + "Allow camera access in device settings": "Permitir el acceso a la cámara en la configuración del dispositivo", + "Device camera is used to take photos or videos.": "La cámara del dispositivo se utiliza para tomar fotografías o vídeos.", + "Open Settings": "Configuración abierta" } diff --git a/package/src/i18n/fr.json b/package/src/i18n/fr.json index 676565342c..22ed265d7b 100644 --- a/package/src/i18n/fr.json +++ b/package/src/i18n/fr.json @@ -70,5 +70,8 @@ "🏙 Attachment...": "🏙 Pièce jointe...", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Taille maximale de téléchargement de fichier atteinte. Veuillez télécharger un fichier inférieur à {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} Mo.", "Let's start chatting!": "Commençons à discuter !", - "How about sending your first message to a friend?": "Et si vous envoyiez votre premier message à un ami ?" + "How about sending your first message to a friend?": "Et si vous envoyiez votre premier message à un ami ?", + "Allow camera access in device settings": "Autoriser l'accès à la caméra dans les paramètres de l'appareil", + "Device camera is used to take photos or videos.": "L'appareil photo de l'appareil est utilisé pour prendre des photos ou des vidéos.", + "Open Settings": "Ouvrir les paramètres" } diff --git a/package/src/i18n/he.json b/package/src/i18n/he.json index 4c98660cd6..7f949c7380 100644 --- a/package/src/i18n/he.json +++ b/package/src/i18n/he.json @@ -70,5 +70,8 @@ "🏙 Attachment...": "🏙 קובץ מצורף...", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "הגעת למגבלת העלאת גודל הקובץ המקסימלית. אנא העלה קובץ מתחת ל-{{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB", "Let's start chatting!": "בואו נתחיל לשוחח!", - "How about sending your first message to a friend?": "מה דעתך לשלוח את ההודעה הראשונה שלך לחבר?" + "How about sending your first message to a friend?": "מה דעתך לשלוח את ההודעה הראשונה שלך לחבר?", + "Allow camera access in device settings": "אפשר גישה למצלמה בהגדרות המכשיר", + "Device camera is used to take photos or videos.": "מצלמת המכשיר משמשת לצילום תמונות או סרטונים.", + "Open Settings": "פתח את ההגדרות" } diff --git a/package/src/i18n/hi.json b/package/src/i18n/hi.json index 02e01c61a7..25abc3d34b 100644 --- a/package/src/i18n/hi.json +++ b/package/src/i18n/hi.json @@ -70,5 +70,8 @@ "🏙 Attachment...": "🏙 अटैचमेंट...", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "अधिकतम फ़ाइल आकार अपलोड सीमा पूरी हो गई। कृपया {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} एमबी से नीचे की फ़ाइल अपलोड करें।", "Let's start chatting!": "आइए चैट करना शुरू करें!", - "How about sending your first message to a friend?": "किसी मित्र को अपना पहला संदेश भेजने के बारे में क्या ख़याल है?" + "How about sending your first message to a friend?": "किसी मित्र को अपना पहला संदेश भेजने के बारे में क्या ख़याल है?", + "Allow camera access in device settings": "डिवाइस सेटिंग्स में कैमरा एक्सेस की अनुमति दें", + "Device camera is used to take photos or videos.": "डिवाइस कैमरे का उपयोग फ़ोटो या वीडियो लेने के लिए किया जाता है।", + "Open Settings": "सेटिंग्स खोलें" } diff --git a/package/src/i18n/it.json b/package/src/i18n/it.json index ece4490731..43abf8611e 100644 --- a/package/src/i18n/it.json +++ b/package/src/i18n/it.json @@ -70,5 +70,8 @@ "🏙 Attachment...": "🏙 Allegato...", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "È stato raggiunto il limite massimo di caricamento delle dimensioni del file. Carica un file inferiore a {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.", "Let's start chatting!": "Iniziamo a chattare!", - "How about sending your first message to a friend?": "Che ne dici di inviare il tuo primo messaggio ad un amico?" + "How about sending your first message to a friend?": "Che ne dici di inviare il tuo primo messaggio ad un amico?", + "Allow camera access in device settings": "Consenti l'accesso alla fotocamera nelle impostazioni del dispositivo", + "Device camera is used to take photos or videos.": "La fotocamera del dispositivo viene utilizzata per scattare foto o video.", + "Open Settings": "Apri Impostazioni" } diff --git a/package/src/i18n/ja.json b/package/src/i18n/ja.json index ba17b73fbe..1b24e20471 100644 --- a/package/src/i18n/ja.json +++ b/package/src/i18n/ja.json @@ -73,5 +73,8 @@ "File type not supported": "サポートされていないファイルです", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "最大ファイル サイズのアップロード制限に達しました。 {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB 以下のファイルをアップロードしてください", "Let's start chatting!": "チャットを始めましょう!", - "How about sending your first message to a friend?": "初めてのメッセージを友達に送ってみてはいかがでしょうか?" + "How about sending your first message to a friend?": "初めてのメッセージを友達に送ってみてはいかがでしょうか?", + "Allow camera access in device settings": "デバイス設定でカメラへのアクセスを許可する", + "Device camera is used to take photos or videos.": "デバイスのカメラは写真やビデオの撮影に使用されます。", + "Open Settings": "設定を開く" } diff --git a/package/src/i18n/ko.json b/package/src/i18n/ko.json index 983bf34104..7451b0a1bc 100644 --- a/package/src/i18n/ko.json +++ b/package/src/i18n/ko.json @@ -72,5 +72,8 @@ "Not supported": "지원하지 않습니다", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "최대 파일 크기 업로드 제한에 도달했습니다. {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}}MB 미만의 파일을 업로드하세요.", "Let's start chatting!": "채팅을 시작합시다!", - "How about sending your first message to a friend?": "친구에게 첫 번째 메시지를 보내는 것은 어떻습니까?" + "How about sending your first message to a friend?": "친구에게 첫 번째 메시지를 보내는 것은 어떻습니까?", + "Allow camera access in device settings": "기기 설정에서 카메라 액세스를 허용하세요.", + "Device camera is used to take photos or videos.": "기기 카메라는 사진이나 동영상을 촬영하는 데 사용됩니다.", + "Open Settings": "설정 열기" } diff --git a/package/src/i18n/nl.json b/package/src/i18n/nl.json index a4078d6280..6e21fc3880 100644 --- a/package/src/i18n/nl.json +++ b/package/src/i18n/nl.json @@ -70,5 +70,8 @@ "🏙 Attachment...": "🏙 Bijlage...", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maximale uploadlimiet voor bestandsgrootte bereikt. Upload een bestand van minder dan {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.", "Let's start chatting!": "Laten we beginnen met chatten!", - "How about sending your first message to a friend?": "Wat dacht je ervan om je eerste bericht naar een vriend te sturen?" + "How about sending your first message to a friend?": "Wat dacht je ervan om je eerste bericht naar een vriend te sturen?", + "Allow camera access in device settings": "Sta cameratoegang toe in de apparaatinstellingen", + "Device camera is used to take photos or videos.": "De camera van het apparaat wordt gebruikt om foto's of video's te maken.", + "Open Settings": "Open instellingen" } diff --git a/package/src/i18n/ru.json b/package/src/i18n/ru.json index fd2eadbe06..0d953978a5 100644 --- a/package/src/i18n/ru.json +++ b/package/src/i18n/ru.json @@ -70,5 +70,8 @@ "🏙 Attachment...": "🏙 Вложение...", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Достигнут предел максимального размера файла для загрузки. Загрузите файл размером менее {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} МБ.", "Let's start chatting!": "Давайте начнем общаться!", - "How about sending your first message to a friend?": "Как насчет отправки первого сообщения другу?" + "How about sending your first message to a friend?": "Как насчет отправки первого сообщения другу?", + "Allow camera access in device settings": "Разрешите доступ к камере в настройках устройства.", + "Device camera is used to take photos or videos.": "Камера устройства используется для съемки фотографий или видео.", + "Open Settings": "Открыть настройки" } diff --git a/package/src/i18n/tr.json b/package/src/i18n/tr.json index 15e64f5b0d..37cf6c3694 100644 --- a/package/src/i18n/tr.json +++ b/package/src/i18n/tr.json @@ -70,5 +70,8 @@ "🏙 Attachment...": "🏙 Ek...", "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maksimum dosya boyutu yükleme sınırına ulaşıldı. Lütfen {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB'ın altında bir dosya yükleyin.", "Let's start chatting!": "Haydi sohbete başlayalım!", - "How about sending your first message to a friend?": "İlk mesajınızı bir arkadaşınıza göndermeye ne dersiniz?" + "How about sending your first message to a friend?": "İlk mesajınızı bir arkadaşınıza göndermeye ne dersiniz?", + "Allow camera access in device settings": "Cihaz ayarlarında kamera erişimine izin ver", + "Device camera is used to take photos or videos.": "Cihaz kamerası fotoğraf veya video çekmek için kullanılır.", + "Open Settings": "Ayarları aç" } diff --git a/package/src/native.ts b/package/src/native.ts index ad48d5354a..5b9693bef2 100644 --- a/package/src/native.ts +++ b/package/src/native.ts @@ -87,8 +87,12 @@ type Photo = | (Omit & { cancelled: false; source: 'camera'; + askToOpenSettings?: boolean; }) - | { cancelled: true }; + | { + cancelled: true; + askToOpenSettings?: boolean; + }; type TakePhoto = (options: { compressImageQuality?: number }) => Promise | never; export let takePhoto: TakePhoto = fail; From c9d7d4ec5b446dbe9347f2914ea9f6be1832fb98 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Tue, 21 Nov 2023 15:22:15 +0530 Subject: [PATCH 13/21] fix: sample-app crash because of viewport changes (#2323) --- .../MessageSearch/MessageSearchList.tsx | 11 ++- .../UserSearch/UserSearchResults.tsx | 3 +- .../UserSearch/UserSearchResultsGrid.tsx | 99 ++++++++++--------- .../NewGroupChannelAssignNameScreen.tsx | 3 +- 4 files changed, 61 insertions(+), 55 deletions(-) diff --git a/examples/SampleApp/src/components/MessageSearch/MessageSearchList.tsx b/examples/SampleApp/src/components/MessageSearch/MessageSearchList.tsx index 6786a47e85..ef48f22cfc 100644 --- a/examples/SampleApp/src/components/MessageSearch/MessageSearchList.tsx +++ b/examples/SampleApp/src/components/MessageSearch/MessageSearchList.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { FlatList, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import dayjs from 'dayjs'; -import { Avatar, Spinner, useTheme, vw } from 'stream-chat-react-native'; +import { Avatar, Spinner, useTheme, useViewport } from 'stream-chat-react-native'; import { MESSAGE_SEARCH_LIMIT } from '../../hooks/usePaginatedSearchedMessages'; @@ -43,9 +43,6 @@ const styles = StyleSheet.create({ paddingLeft: 8, }, title: { fontSize: 14, fontWeight: '700' }, - titleContainer: { - maxWidth: vw(80) - 16 - 40, - }, }); export type MessageSearchListProps = { @@ -73,6 +70,7 @@ export const MessageSearchList: React.FC = React.forward colors: { black, border, grey, white_snow }, }, } = useTheme(); + const { vw } = useViewport(); const navigation = useNavigation(); if (loading && !refreshing && (!messages || messages.length === 0)) { @@ -134,7 +132,10 @@ export const MessageSearchList: React.FC = React.forward /> - + {`${item.user?.name} `} {!!item.channel?.name && ( diff --git a/examples/SampleApp/src/components/UserSearch/UserSearchResults.tsx b/examples/SampleApp/src/components/UserSearch/UserSearchResults.tsx index 68ce09de2d..f856f86c64 100644 --- a/examples/SampleApp/src/components/UserSearch/UserSearchResults.tsx +++ b/examples/SampleApp/src/components/UserSearch/UserSearchResults.tsx @@ -9,7 +9,7 @@ import { } from 'react-native'; import dayjs from 'dayjs'; import Svg, { Defs, LinearGradient, Rect, Stop } from 'react-native-svg'; -import { Avatar, CheckSend, Close, useTheme, vw } from 'stream-chat-react-native'; +import { Avatar, CheckSend, Close, useTheme, useViewport } from 'stream-chat-react-native'; import { useUserSearchContext } from '../../context/UserSearchContext'; @@ -103,6 +103,7 @@ export const UserSearchResults: React.FC = ({ }, }, } = useTheme(); + const { vw } = useViewport(); const results = resultsProp || resultsContext; const resultsLength = results.length; diff --git a/examples/SampleApp/src/components/UserSearch/UserSearchResultsGrid.tsx b/examples/SampleApp/src/components/UserSearch/UserSearchResultsGrid.tsx index 3f97d79d80..840438257a 100644 --- a/examples/SampleApp/src/components/UserSearch/UserSearchResultsGrid.tsx +++ b/examples/SampleApp/src/components/UserSearch/UserSearchResultsGrid.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { ActivityIndicator, FlatList, StyleSheet, Text, View } from 'react-native'; -import { vw } from 'stream-chat-react-native'; +import { useViewport } from 'stream-chat-react-native'; import { UserGridItem } from './UserGridItem'; @@ -10,8 +10,6 @@ import type { UserResponse } from 'stream-chat'; import type { StreamChatGenerics } from '../../types'; -const totalUserSpace = vw(100) - 56; // 36 = outside margin 8 * 2 + inner padding 20 * 2; - const styles = StyleSheet.create({ container: { flex: 1, @@ -47,48 +45,53 @@ export const UserSearchResultsGrid: React.FC = ({ onPress, results, searchText, -}) => ( - - {loading && results.length === 0 && searchText === '' ? ( - - ) : ( - `${item.id}-${index}`} - ListEmptyComponent={() => ( - - - No user matches these keywords - {loading ? 'true' : 'false'} - {results.length} - - )} - numColumns={gridSize} - onEndReached={loadMore} - renderItem={({ index, item: user }) => ( - - { - onPress(user); - }} - removeButton={false} - user={user} - /> - - )} - showsVerticalScrollIndicator={false} - style={styles.flex} - /> - )} - -); +}) => { + const { vw } = useViewport(); + const totalUserSpace = vw(100) - 56; // 36 = outside margin 8 * 2 + inner padding 20 * 2; + + return ( + + {loading && results.length === 0 && searchText === '' ? ( + + ) : ( + `${item.id}-${index}`} + ListEmptyComponent={() => ( + + + No user matches these keywords + {loading ? 'true' : 'false'} + {results.length} + + )} + numColumns={gridSize} + onEndReached={loadMore} + renderItem={({ index, item: user }) => ( + + { + onPress(user); + }} + removeButton={false} + user={user} + /> + + )} + showsVerticalScrollIndicator={false} + style={styles.flex} + /> + )} + + ); +}; diff --git a/examples/SampleApp/src/screens/NewGroupChannelAssignNameScreen.tsx b/examples/SampleApp/src/screens/NewGroupChannelAssignNameScreen.tsx index fa62c65f3b..a4229e2f77 100644 --- a/examples/SampleApp/src/screens/NewGroupChannelAssignNameScreen.tsx +++ b/examples/SampleApp/src/screens/NewGroupChannelAssignNameScreen.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { StyleSheet, Text, TextInput, View } from 'react-native'; import Svg, { Defs, LinearGradient, Rect, Stop } from 'react-native-svg'; -import { Check, generateRandomId, useTheme, vw } from 'stream-chat-react-native'; +import { Check, generateRandomId, useTheme, useViewport } from 'stream-chat-react-native'; import { RoundButton } from '../components/RoundButton'; import { ScreenHeader } from '../components/ScreenHeader'; @@ -89,6 +89,7 @@ export const NewGroupChannelAssignNameScreen: React.FC Date: Tue, 21 Nov 2023 22:08:42 +0530 Subject: [PATCH 14/21] fix: upload progress indicator component type (#2325) --- .../src/components/MessageInput/UploadProgressIndicator.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/src/components/MessageInput/UploadProgressIndicator.tsx b/package/src/components/MessageInput/UploadProgressIndicator.tsx index 7a820e99ed..1ee506f480 100644 --- a/package/src/components/MessageInput/UploadProgressIndicator.tsx +++ b/package/src/components/MessageInput/UploadProgressIndicator.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { PropsWithChildren } from 'react'; import { ActivityIndicator, GestureResponderEvent, @@ -24,7 +24,7 @@ export type UploadProgressIndicatorProps = { type?: 'in_progress' | 'retry' | 'not_supported' | 'inactive' | null; }; -export const UploadProgressIndicator: React.FC = (props) => { +export const UploadProgressIndicator = (props: PropsWithChildren) => { const { action, children, style, type } = props; const { From 8cbc9279d4440083751602d0d4f5565dcc9ebea7 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Thu, 23 Nov 2023 10:58:27 +0530 Subject: [PATCH 15/21] fix: inability to handle long URLs with params properly when clicked on message (#2321) * fix: inability to handle long URLs with params properly when clicked on message * fix: add comments for the change --- .../Message/MessageSimple/utils/renderText.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/package/src/components/Message/MessageSimple/utils/renderText.tsx b/package/src/components/Message/MessageSimple/utils/renderText.tsx index 4722e6389c..bb98bf791e 100644 --- a/package/src/components/Message/MessageSimple/utils/renderText.tsx +++ b/package/src/components/Message/MessageSimple/utils/renderText.tsx @@ -141,8 +141,17 @@ export const renderText = < : Linking.canOpenURL(url).then((canOpenUrl) => canOpenUrl && Linking.openURL(url)); }; + let previousLink: string | undefined; const linkReact: ReactNodeOutput = (node, output, { ...state }) => { - const url = node.target; + let url: string; + // Some long URLs with `&` separated parameters are trimmed and the url only until first param is taken. + // This is done because of internal link been taken from the original URL in react-native-markdown-package. So, we check for `withinLink` and take the previous full URL. + if (state?.withinLink && previousLink) { + url = previousLink; + } else { + url = node.target; + previousLink = node.target; + } const onPress = (event: GestureResponderEvent) => { if (!preventPress && onPressParam) { onPressParam({ From 2567900ff5e3ef7ff2519abd064b607e21b1ec23 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Thu, 23 Nov 2023 22:38:54 +0530 Subject: [PATCH 16/21] refactor: change filename and fileSize to name and size respectively for Asset type (#2329) --- package/expo-package/src/handlers/getPhotos.ts | 2 +- .../native-package/src/handlers/getPhotos.ts | 4 ++-- .../components/AttachmentPickerItem.tsx | 6 +++--- .../components/MessageInput/MessageInput.tsx | 2 +- .../__tests__/MessageInput.test.js | 4 ++-- .../MessageInputContext.tsx | 4 ++-- package/src/types/types.ts | 18 +++++++----------- 7 files changed, 18 insertions(+), 22 deletions(-) diff --git a/package/expo-package/src/handlers/getPhotos.ts b/package/expo-package/src/handlers/getPhotos.ts index dc6cc41755..1e5bdb9310 100644 --- a/package/expo-package/src/handlers/getPhotos.ts +++ b/package/expo-package/src/handlers/getPhotos.ts @@ -32,9 +32,9 @@ export const getPhotos = async ({ }); const assets = results.assets.map((asset) => ({ duration: asset.duration, - filename: asset.filename, height: asset.height, id: asset.id, + name: asset.filename, source: 'picker' as const, type: asset.mediaType, uri: asset.uri, diff --git a/package/native-package/src/handlers/getPhotos.ts b/package/native-package/src/handlers/getPhotos.ts index e263200447..7e80865a3b 100644 --- a/package/native-package/src/handlers/getPhotos.ts +++ b/package/native-package/src/handlers/getPhotos.ts @@ -78,8 +78,8 @@ export const getPhotos = async ({ ...edge.node.image, duration: edge.node.image.playableDuration, // since we include filename, fileSize in the query, we can safely assume it will be defined - filename: edge.node.image.filename as string, - fileSize: edge.node.image.fileSize as number, + name: edge.node.image.filename as string, + size: edge.node.image.fileSize as number, source: 'picker' as const, type: edge.node.type, })); diff --git a/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx b/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx index 53bcffe42b..62ec9be735 100644 --- a/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +++ b/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx @@ -71,15 +71,15 @@ const AttachmentVideo: React.FC = (props) => { const localAssetURI = Platform.OS === 'ios' && asset.id && (await getLocalAssetUri(asset.id)); const uri = localAssetURI || asset.uri || ''; // We need a mime-type to upload a video file. - const mimeType = lookup(asset.filename) || 'multipart/form-data'; + const mimeType = lookup(asset.name) || 'multipart/form-data'; return [ ...files, { duration: durationLabel, id: asset.id, mimeType, - name: asset.filename, - size: asset.fileSize, + name: asset.name, + size: asset.size, uri, }, ]; diff --git a/package/src/components/MessageInput/MessageInput.tsx b/package/src/components/MessageInput/MessageInput.tsx index 22f5733913..bdb354a15a 100644 --- a/package/src/components/MessageInput/MessageInput.tsx +++ b/package/src/components/MessageInput/MessageInput.tsx @@ -288,7 +288,7 @@ const MessageInputWithContext = < // Check if the file size of the image exceeds the threshold of 100MB if ( imageToUpload && - Number(imageToUpload.fileSize) / MEGA_BYTES_TO_BYTES > MAX_FILE_SIZE_TO_UPLOAD_IN_MB + Number(imageToUpload.size) / MEGA_BYTES_TO_BYTES > MAX_FILE_SIZE_TO_UPLOAD_IN_MB ) { Alert.alert( t( diff --git a/package/src/components/MessageInput/__tests__/MessageInput.test.js b/package/src/components/MessageInput/__tests__/MessageInput.test.js index 0169b9cd08..0d756cf944 100644 --- a/package/src/components/MessageInput/__tests__/MessageInput.test.js +++ b/package/src/components/MessageInput/__tests__/MessageInput.test.js @@ -39,12 +39,12 @@ describe('MessageInput', () => { selectedImages: [ generateImageAttachment({ file: { height: 100, uri: 'https://picsum.photos/200/300', width: 100 }, - fileSize: 500000000, + size: 500000000, uri: 'https://picsum.photos/200/300', }), generateImageAttachment({ file: { height: 100, uri: 'https://picsum.photos/200/300', width: 100 }, - fileSize: 600000000, + size: 600000000, uri: 'https://picsum.photos/200/300', }), ], diff --git a/package/src/contexts/messageInputContext/MessageInputContext.tsx b/package/src/contexts/messageInputContext/MessageInputContext.tsx index bd4e97637c..cfdd46af0f 100644 --- a/package/src/contexts/messageInputContext/MessageInputContext.tsx +++ b/package/src/contexts/messageInputContext/MessageInputContext.tsx @@ -641,7 +641,7 @@ export const MessageInputProvider = < }; const mapImageUploadToAttachment = (image: ImageUpload) => { - const mime_type: string | boolean = lookup(image.file.filename as string); + const mime_type: string | boolean = lookup(image.file.name as string); return { fallback: image.file.name, image_url: image.url, @@ -1006,7 +1006,7 @@ export const MessageInputProvider = < uri, width: file.width, })); - const filename = file.filename ?? uri.replace(/^(file:\/\/|content:\/\/)/, ''); + const filename = file.name ?? uri.replace(/^(file:\/\/|content:\/\/)/, ''); const contentType = lookup(filename) || 'multipart/form-data'; if (value.doImageUploadRequest) { response = await value.doImageUploadRequest(file, channel); diff --git a/package/src/types/types.ts b/package/src/types/types.ts index 16cfeb9643..0c6c1a5f50 100644 --- a/package/src/types/types.ts +++ b/package/src/types/types.ts @@ -2,32 +2,28 @@ import type { ExtendableGenerics, LiteralStringForUnion } from 'stream-chat'; export type Asset = { duration: number | null; - filename: string; height: number; + name: string; source: 'camera' | 'picker'; type: string; uri: string; width: number; - fileSize?: number; id?: string; - size?: number | string; + size?: number; }; -export type FileAssetType = { +export type File = { name: string; + duration?: string | null; + id?: string; mimeType?: string; - size?: number | string; + size?: number; // The uri should be of type `string`. But is `string|undefined` because the same type is used for the response from Stream's Attachment. This shall be fixed. uri?: string; }; -export type File = FileAssetType & { - duration?: string | null; - id?: string; -}; - export type DefaultAttachmentType = UnknownType & { - file_size?: number | string; + file_size?: number; mime_type?: string; originalFile?: File; }; From 2b13bd514610efeda660d1a893097eecaf334cdc Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Fri, 24 Nov 2023 10:31:13 +0530 Subject: [PATCH 17/21] refactor: change duration type to number for both Asset and File type (#2330) --- .../components/AttachmentPickerItem.tsx | 2 +- .../MessageInput/FileUploadPreview.tsx | 17 ++++++++++++++++- package/src/types/types.ts | 4 ++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx b/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx index 62ec9be735..9c8ab31630 100644 --- a/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +++ b/package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx @@ -75,7 +75,7 @@ const AttachmentVideo: React.FC = (props) => { return [ ...files, { - duration: durationLabel, + duration: asset.duration, id: asset.id, mimeType, name: asset.name, diff --git a/package/src/components/MessageInput/FileUploadPreview.tsx b/package/src/components/MessageInput/FileUploadPreview.tsx index 3d13227d2d..a141223cb5 100644 --- a/package/src/components/MessageInput/FileUploadPreview.tsx +++ b/package/src/components/MessageInput/FileUploadPreview.tsx @@ -1,6 +1,8 @@ import React, { useEffect, useRef, useState } from 'react'; import { FlatList, I18nManager, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; +import dayjs from 'dayjs'; + import { UploadProgressIndicator } from './UploadProgressIndicator'; import { ChatContextValue, useChatContext } from '../../contexts'; @@ -101,6 +103,19 @@ const UnsupportedFileTypeOrFileSizeIndicator = ({ }, } = useTheme(); + const ONE_HOUR_IN_SECONDS = 3600; + let durationLabel = '00:00'; + const videoDuration = item.file.duration; + + if (videoDuration) { + const isDurationLongerThanHour = videoDuration / ONE_HOUR_IN_SECONDS >= 1; + const formattedDurationParam = isDurationLongerThanHour ? 'HH:mm:ss' : 'mm:ss'; + const formattedVideoDuration = dayjs + .duration(videoDuration, 'second') + .format(formattedDurationParam); + durationLabel = formattedVideoDuration; + } + const { t } = useTranslationContext(); return indicatorType === ProgressIndicatorTypes.NOT_SUPPORTED ? ( @@ -117,7 +132,7 @@ const UnsupportedFileTypeOrFileSizeIndicator = ({ ) : ( - {item.file.duration || getFileSizeDisplayText(item.file.size)} + {videoDuration ? durationLabel : getFileSizeDisplayText(item.file.size)} ); }; diff --git a/package/src/types/types.ts b/package/src/types/types.ts index 0c6c1a5f50..3810db34c8 100644 --- a/package/src/types/types.ts +++ b/package/src/types/types.ts @@ -1,7 +1,7 @@ import type { ExtendableGenerics, LiteralStringForUnion } from 'stream-chat'; export type Asset = { - duration: number | null; + duration: number; height: number; name: string; source: 'camera' | 'picker'; @@ -14,7 +14,7 @@ export type Asset = { export type File = { name: string; - duration?: string | null; + duration?: number; id?: string; mimeType?: string; size?: number; From b54afeefa5f6cb86a7a84c4d0d9b47c2b60602fc Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Fri, 24 Nov 2023 14:39:09 +0530 Subject: [PATCH 18/21] fix: app crash when the message links have special characters in it (#2318) * fix: app crash when the message links have special characters in it * refactor: added comments for the escapeRegExp function --- .../utils/generateMarkdownText.test.ts | 23 +++++++++++++++++ .../utils/generateMarkdownText.ts | 25 +++++++++---------- .../MessageSimple/utils/renderText.tsx | 3 ++- 3 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 package/src/components/Message/MessageSimple/utils/generateMarkdownText.test.ts diff --git a/package/src/components/Message/MessageSimple/utils/generateMarkdownText.test.ts b/package/src/components/Message/MessageSimple/utils/generateMarkdownText.test.ts new file mode 100644 index 0000000000..f7eb12d8c6 --- /dev/null +++ b/package/src/components/Message/MessageSimple/utils/generateMarkdownText.test.ts @@ -0,0 +1,23 @@ +import { generateMarkdownText } from './generateMarkdownText'; + +describe('generateMarkdownText', () => { + it.each([ + ['', null], + [' test message ', 'test message'], + ['https://www.getstream.io', '[https://www.getstream.io](https://www.getstream.io)'], + [ + 'https://getstream-production.s3-accelerate.amazonaws.com/N336903591601695/33e78ef89e64642862a75c5cca2541eaf6b1c924/trimmedVideos/alert/2_270_881/outputVideo.mp4?AWSAccessKeyId=AKIAVJAW2AD2SQVQCBXV&Expires=1699998768&Signature=zdEMCGzf4Pq++16YkPprvN5NAds=', + '[https://getstream-production.s3-accelerate.amazonaws.com/N336903591601695/33e78ef89e64642862a75c5cca2541eaf6b1c924/trimmedVideos/alert/2_270_881/outputVideo.mp4?AWSAccessKeyId=AKIAVJAW2AD2SQVQCBXV&...](https://getstream-production.s3-accelerate.amazonaws.com/N336903591601695/33e78ef89e64642862a75c5cca2541eaf6b1c924/trimmedVideos/alert/2_270_881/outputVideo.mp4?AWSAccessKeyId=AKIAVJAW2AD2SQVQCBXV&Expires=1699998768&Signature=zdEMCGzf4Pq++16YkPprvN5NAds=)', + ], + ['Hi @getstream.io', 'Hi @getstream.io'], + [ + 'Hi test@gmail.com @test@gmail.com', + 'Hi [test@gmail.com](mailto:test@gmail.com) @test@gmail.com', + ], + ['Hi @getstream.io getstream.io', 'Hi @getstream.io [getstream.io](http://getstream.io)'], + ['Hi ', 'Hi \\'], + ])('Returns the generated markdown text for %p and %p', (text, expected) => { + const result = generateMarkdownText(text); + expect(result).toBe(expected); + }); +}); diff --git a/package/src/components/Message/MessageSimple/utils/generateMarkdownText.ts b/package/src/components/Message/MessageSimple/utils/generateMarkdownText.ts index 020b9311b7..964b0d02dd 100644 --- a/package/src/components/Message/MessageSimple/utils/generateMarkdownText.ts +++ b/package/src/components/Message/MessageSimple/utils/generateMarkdownText.ts @@ -2,16 +2,12 @@ import truncate from 'lodash/truncate'; import { parseLinksFromText } from './parseLinks'; -import type { DefaultStreamChatGenerics } from '../../../../types/types'; -import type { MessageType } from '../../../MessageList/hooks/useMessageList'; - -export const generateMarkdownText = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, ->( - message: MessageType, -) => { - const { text } = message; +// If you need to use any of the special characters literally (actually searching for a "*", for instance), you must escape it by putting a backslash in front of it. +function escapeRegExp(text: string) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +} +export const generateMarkdownText = (text?: string) => { if (!text) return null; // Trim the extra spaces from the text. @@ -26,18 +22,21 @@ export const generateMarkdownText = < omission: '...', }); // Convert raw links/emails in the text to respective markdown syntax. - // Eg: Hi getstream.io -> Hi [getstream.io](getstream.io). - const normalRegEx = new RegExp(linkInfo.raw, 'g'); + // Eg: Hi @getstream.io -> Hi @[getstream.io](getstream.io). + const normalRegEx = new RegExp(escapeRegExp(linkInfo.raw), 'g'); const markdown = `[${displayLink}](${linkInfo.encodedUrl})`; resultText = text.replace(normalRegEx, markdown); // After previous step, in some cases, the mentioned user after `@` might have a link/email so we convert it back to normal raw text. // Eg: Hi, @[test.user@gmail.com](mailto:test.user@gmail.com) to @test.user@gmail.com. - const mentionsRegex = new RegExp(`@\\[${displayLink}\\]\\(${linkInfo.encodedUrl}\\)`, 'g'); + const mentionsRegex = new RegExp( + `@\\[${escapeRegExp(displayLink)}\\]\\(${escapeRegExp(linkInfo.encodedUrl)}\\)`, + 'g', + ); resultText = resultText.replace(mentionsRegex, `@${displayLink}`); } - resultText = resultText.replace(/[<&"'>]/g, '\\$&'); + resultText = resultText.replace(/[<"'>]/g, '\\$&'); return resultText; }; diff --git a/package/src/components/Message/MessageSimple/utils/renderText.tsx b/package/src/components/Message/MessageSimple/utils/renderText.tsx index bb98bf791e..c246c0a6ee 100644 --- a/package/src/components/Message/MessageSimple/utils/renderText.tsx +++ b/package/src/components/Message/MessageSimple/utils/renderText.tsx @@ -100,8 +100,9 @@ export const renderText = < onPress: onPressParam, preventPress, } = params; + const { text } = message; - const markdownText = generateMarkdownText(message); + const markdownText = generateMarkdownText(text); const styles: MarkdownStyle = { ...defaultMarkdownStyles, From 89b5efa4e9afca8880cf1ecd2a3c7f775aad7355 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Fri, 24 Nov 2023 10:35:58 +0100 Subject: [PATCH 19/21] feat: update stream-chat package to 8.14.3 --- examples/ExpoMessaging/yarn.lock | 15 +++++++++++++++ examples/SampleApp/yarn.lock | 15 +++++++++++++++ examples/TypeScriptMessaging/ios/Podfile.lock | 4 ++-- examples/TypeScriptMessaging/yarn.lock | 15 +++++++++++++++ package/package.json | 2 +- package/yarn.lock | 8 ++++---- 6 files changed, 52 insertions(+), 7 deletions(-) diff --git a/examples/ExpoMessaging/yarn.lock b/examples/ExpoMessaging/yarn.lock index 2fe61d78b8..e8ac6dafd8 100644 --- a/examples/ExpoMessaging/yarn.lock +++ b/examples/ExpoMessaging/yarn.lock @@ -6707,6 +6707,21 @@ stream-chat@~8.14.0: jsonwebtoken "~9.0.0" ws "^7.4.4" +stream-chat@~8.14.3: + version "8.14.3" + resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.14.3.tgz#165402d2ed6fc4085f0cc0121b28c664159f8976" + integrity sha512-GYYf4bfpSdl4Itaw981D7R3OUiSBWUUOQypvUd6tvhs20O76Pu+gR/eOUkpl40jBfYSAFVkbhd/CnDFxJJafug== + dependencies: + "@babel/runtime" "^7.16.3" + "@types/jsonwebtoken" "~9.0.0" + "@types/ws" "^7.4.0" + axios "^1.6.0" + base64-js "^1.5.1" + form-data "^4.0.0" + isomorphic-ws "^4.0.1" + jsonwebtoken "~9.0.0" + ws "^7.4.4" + strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" diff --git a/examples/SampleApp/yarn.lock b/examples/SampleApp/yarn.lock index e7d388aada..de29248fe7 100644 --- a/examples/SampleApp/yarn.lock +++ b/examples/SampleApp/yarn.lock @@ -7417,6 +7417,21 @@ stream-chat@~8.14.0: jsonwebtoken "~9.0.0" ws "^7.4.4" +stream-chat@~8.14.3: + version "8.14.3" + resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.14.3.tgz#165402d2ed6fc4085f0cc0121b28c664159f8976" + integrity sha512-GYYf4bfpSdl4Itaw981D7R3OUiSBWUUOQypvUd6tvhs20O76Pu+gR/eOUkpl40jBfYSAFVkbhd/CnDFxJJafug== + dependencies: + "@babel/runtime" "^7.16.3" + "@types/jsonwebtoken" "~9.0.0" + "@types/ws" "^7.4.0" + axios "^1.6.0" + base64-js "^1.5.1" + form-data "^4.0.0" + isomorphic-ws "^4.0.1" + jsonwebtoken "~9.0.0" + ws "^7.4.4" + strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" diff --git a/examples/TypeScriptMessaging/ios/Podfile.lock b/examples/TypeScriptMessaging/ios/Podfile.lock index 8fae91e9ae..51988bce18 100644 --- a/examples/TypeScriptMessaging/ios/Podfile.lock +++ b/examples/TypeScriptMessaging/ios/Podfile.lock @@ -708,7 +708,7 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: 57d2868c099736d80fcd648bf211b4431e51a558 + boost: a7c83b31436843459a1961bfd74b96033dc77234 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 FBLazyVector: a89a0525bc7ca174675045c2b492b5280d5a2470 @@ -729,7 +729,7 @@ SPEC CHECKSUMS: OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 PromisesSwift: 28dca69a9c40779916ac2d6985a0192a5cb4a265 - RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 + RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda RCTRequired: 5a4a30ac20c86eeadd6844a9328f78d4168cf9b2 RCTTypeSafety: 279fc5861a89f0f37db3a585f27f971485b4b734 React: 88307a9be3bd0e71a6822271cf28b84a587fb97f diff --git a/examples/TypeScriptMessaging/yarn.lock b/examples/TypeScriptMessaging/yarn.lock index b0b7a046f8..e5cfa678c2 100644 --- a/examples/TypeScriptMessaging/yarn.lock +++ b/examples/TypeScriptMessaging/yarn.lock @@ -7235,6 +7235,21 @@ stream-chat@~8.14.0: jsonwebtoken "~9.0.0" ws "^7.4.4" +stream-chat@~8.14.3: + version "8.14.3" + resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.14.3.tgz#165402d2ed6fc4085f0cc0121b28c664159f8976" + integrity sha512-GYYf4bfpSdl4Itaw981D7R3OUiSBWUUOQypvUd6tvhs20O76Pu+gR/eOUkpl40jBfYSAFVkbhd/CnDFxJJafug== + dependencies: + "@babel/runtime" "^7.16.3" + "@types/jsonwebtoken" "~9.0.0" + "@types/ws" "^7.4.0" + axios "^1.6.0" + base64-js "^1.5.1" + form-data "^4.0.0" + isomorphic-ws "^4.0.1" + jsonwebtoken "~9.0.0" + ws "^7.4.4" + strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" diff --git a/package/package.json b/package/package.json index 974d97e117..b6b1025dd0 100644 --- a/package/package.json +++ b/package/package.json @@ -79,7 +79,7 @@ "path": "0.12.7", "react-native-markdown-package": "1.8.2", "react-native-url-polyfill": "^1.3.0", - "stream-chat": "~8.14.0" + "stream-chat": "~8.14.3" }, "peerDependencies": { "react-native-quick-sqlite": ">=5.1.0", diff --git a/package/yarn.lock b/package/yarn.lock index d11548287b..6506f6b2af 100644 --- a/package/yarn.lock +++ b/package/yarn.lock @@ -9506,10 +9506,10 @@ stream-buffers@2.2.x: resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg== -stream-chat@~8.14.0: - version "8.14.0" - resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.14.0.tgz#ba96badaaf6c2d3025f31a6d5c0c5545d883c691" - integrity sha512-WEAssYcY/qSJXVK4B39JZJjyBzLSE4Wn+Gliywm8Nc2cmM0+fJF0853H5jZNy6AEeZhzxzRfxwq71r0FfZKudQ== +stream-chat@~8.14.3: + version "8.14.3" + resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.14.3.tgz#165402d2ed6fc4085f0cc0121b28c664159f8976" + integrity sha512-GYYf4bfpSdl4Itaw981D7R3OUiSBWUUOQypvUd6tvhs20O76Pu+gR/eOUkpl40jBfYSAFVkbhd/CnDFxJJafug== dependencies: "@babel/runtime" "^7.16.3" "@types/jsonwebtoken" "~9.0.0" From c05b3350c470fcdc553bff50cf97337d95459cea Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri <3846977+santhoshvai@users.noreply.github.com> Date: Fri, 24 Nov 2023 10:49:30 +0100 Subject: [PATCH 20/21] fix: do not send two upload requests when offline support is enabled (#2328) * fix: do not send two upload requests when offline support is enabled * fix: filenames * fix: catch axios canceled error * fix: types import for FileUpload and ImageUpload * fix: image compress logic when uploading image while offline support is enabled (#2331) --------- Co-authored-by: Khushal Agarwal --- .../components/Attachment/AudioAttachment.tsx | 3 +- package/src/components/Channel/Channel.tsx | 31 +++- .../Channel/hooks/useCreateChannelContext.ts | 2 + .../MessageInput/FileUploadPreview.tsx | 3 +- .../MessageInput/ImageUploadPreview.tsx | 3 +- .../AudioAttachmentUploadPreviewExpo.test.tsx | 2 +- ...udioAttachmentUploadPreviewNative.test.tsx | 2 +- .../channelContext/ChannelContext.tsx | 5 + .../MessageInputContext.tsx | 148 ++++++++++-------- .../__snapshots__/sendMessage.test.tsx.snap | 6 +- .../hooks/useMessageDetailsForState.ts | 4 +- package/src/types/types.ts | 23 +++ package/src/utils/compressImage.ts | 32 ++++ 13 files changed, 180 insertions(+), 84 deletions(-) create mode 100644 package/src/utils/compressImage.ts diff --git a/package/src/components/Attachment/AudioAttachment.tsx b/package/src/components/Attachment/AudioAttachment.tsx index 39eefcd5d2..e470c96ad4 100644 --- a/package/src/components/Attachment/AudioAttachment.tsx +++ b/package/src/components/Attachment/AudioAttachment.tsx @@ -4,7 +4,7 @@ import { I18nManager, StyleSheet, Text, TouchableOpacity, View } from 'react-nat import dayjs from 'dayjs'; import duration from 'dayjs/plugin/duration'; -import { FileUpload, useTheme } from '../../contexts'; +import { useTheme } from '../../contexts'; import { Pause, Play } from '../../icons'; import { PlaybackStatus, @@ -13,6 +13,7 @@ import { VideoPayloadData, VideoProgressData, } from '../../native'; +import type { FileUpload } from '../../types/types'; import { ProgressControl } from '../ProgressControl/ProgressControl'; dayjs.extend(duration); diff --git a/package/src/components/Channel/Channel.tsx b/package/src/components/Channel/Channel.tsx index 9e82389378..45d372b2af 100644 --- a/package/src/components/Channel/Channel.tsx +++ b/package/src/components/Channel/Channel.tsx @@ -78,6 +78,7 @@ import { FlatList as FlatListDefault, pickDocument } from '../../native'; import * as dbApi from '../../store/apis'; import type { DefaultStreamChatGenerics } from '../../types/types'; import { addReactionToLocalState } from '../../utils/addReactionToLocalState'; +import { compressedImageURI } from '../../utils/compressImage'; import { DBSyncManager } from '../../utils/DBSyncManager'; import { patchMessageTextCommand } from '../../utils/patchMessageTextCommand'; import { removeReactionFromLocalState } from '../../utils/removeReactionFromLocalState'; @@ -589,6 +590,13 @@ const ChannelWithContext = < const { setTargetedMessage, targetedMessage } = useTargetedMessage(); + /** + * This ref will hold the abort controllers for + * requests made for uploading images/files in the messageInputContext + * Its a map of filename to AbortController + */ + const uploadAbortControllerRef = useRef>(new Map()); + const channelId = channel?.id || ''; useEffect(() => { const initChannel = () => { @@ -1290,20 +1298,28 @@ const ChannelWithContext = < if (updatedMessage.attachments?.length) { for (let i = 0; i < updatedMessage.attachments?.length; i++) { const attachment = updatedMessage.attachments[i]; + const image = attachment.originalImage; const file = attachment.originalFile; // check if image_url is not a remote url if ( attachment.type === 'image' && - file?.uri && + image?.uri && attachment.image_url && isLocalUrl(attachment.image_url) ) { - const filename = file.name ?? file.uri.replace(/^(file:\/\/|content:\/\/)/, ''); + const filename = image.name ?? image.uri.replace(/^(file:\/\/|content:\/\/)/, ''); + // if any upload is in progress, cancel it + const controller = uploadAbortControllerRef.current.get(filename); + if (controller) { + controller.abort(); + uploadAbortControllerRef.current.delete(filename); + } + const compressedUri = await compressedImageURI(image, compressImageQuality); const contentType = lookup(filename) || 'multipart/form-data'; const uploadResponse = doImageUploadRequest - ? await doImageUploadRequest(file, channel) - : await channel.sendImage(file.uri, filename, contentType); + ? await doImageUploadRequest(image, channel) + : await channel.sendImage(compressedUri, filename, contentType); attachment.image_url = uploadResponse.file; delete attachment.originalFile; @@ -1321,6 +1337,12 @@ const ChannelWithContext = < isLocalUrl(attachment.asset_url) && file?.uri ) { + // if any upload is in progress, cancel it + const controller = uploadAbortControllerRef.current.get(file.name); + if (controller) { + controller.abort(); + uploadAbortControllerRef.current.delete(file.name); + } const response = doDocUploadRequest ? await doDocUploadRequest(file, channel) : await channel.sendFile(file.uri, file.name, file.mimeType); @@ -1851,6 +1873,7 @@ const ChannelWithContext = < StickyHeader, targetedMessage, threadList, + uploadAbortControllerRef, watcherCount, watchers, }); diff --git a/package/src/components/Channel/hooks/useCreateChannelContext.ts b/package/src/components/Channel/hooks/useCreateChannelContext.ts index 4be120dfa6..ea484fdadd 100644 --- a/package/src/components/Channel/hooks/useCreateChannelContext.ts +++ b/package/src/components/Channel/hooks/useCreateChannelContext.ts @@ -36,6 +36,7 @@ export const useCreateChannelContext = < StickyHeader, targetedMessage, threadList, + uploadAbortControllerRef, watcherCount, watchers, }: ChannelContextValue) => { @@ -79,6 +80,7 @@ export const useCreateChannelContext = < StickyHeader, targetedMessage, threadList, + uploadAbortControllerRef, watcherCount, watchers, }), diff --git a/package/src/components/MessageInput/FileUploadPreview.tsx b/package/src/components/MessageInput/FileUploadPreview.tsx index a141223cb5..3d1f9ee414 100644 --- a/package/src/components/MessageInput/FileUploadPreview.tsx +++ b/package/src/components/MessageInput/FileUploadPreview.tsx @@ -7,7 +7,6 @@ import { UploadProgressIndicator } from './UploadProgressIndicator'; import { ChatContextValue, useChatContext } from '../../contexts'; import { - FileUpload, MessageInputContextValue, useMessageInputContext, } from '../../contexts/messageInputContext/MessageInputContext'; @@ -20,7 +19,7 @@ import { useTranslationContext } from '../../contexts/translationContext/Transla import { Close } from '../../icons/Close'; import { Warning } from '../../icons/Warning'; import { isAudioPackageAvailable } from '../../native'; -import type { DefaultStreamChatGenerics } from '../../types/types'; +import type { DefaultStreamChatGenerics, FileUpload } from '../../types/types'; import { FileState, getIndicatorTypeForFileState, ProgressIndicatorTypes } from '../../utils/utils'; import { getFileSizeDisplayText } from '../Attachment/FileAttachment'; import { WritingDirectionAwareText } from '../RTLComponents/WritingDirectionAwareText'; diff --git a/package/src/components/MessageInput/ImageUploadPreview.tsx b/package/src/components/MessageInput/ImageUploadPreview.tsx index 9acf6f2fbf..8d9c7da57d 100644 --- a/package/src/components/MessageInput/ImageUploadPreview.tsx +++ b/package/src/components/MessageInput/ImageUploadPreview.tsx @@ -13,7 +13,6 @@ import { UploadProgressIndicator } from './UploadProgressIndicator'; import { ChatContextValue, useChatContext } from '../../contexts'; import { - ImageUpload, MessageInputContextValue, useMessageInputContext, } from '../../contexts/messageInputContext/MessageInputContext'; @@ -21,7 +20,7 @@ import { useTheme } from '../../contexts/themeContext/ThemeContext'; import { useTranslationContext } from '../../contexts/translationContext/TranslationContext'; import { Close } from '../../icons/Close'; import { Warning } from '../../icons/Warning'; -import type { DefaultStreamChatGenerics } from '../../types/types'; +import type { DefaultStreamChatGenerics, ImageUpload } from '../../types/types'; import { getIndicatorTypeForFileState, ProgressIndicatorTypes } from '../../utils/utils'; const IMAGE_PREVIEW_SIZE = 100; diff --git a/package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.tsx b/package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.tsx index 615893fb30..897f7c9047 100644 --- a/package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.tsx +++ b/package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.tsx @@ -5,7 +5,6 @@ import { act } from 'react-test-renderer'; import { fireEvent, render } from '@testing-library/react-native'; import { - FileUpload, MessageInputContext, MessageInputContextValue, } from '../../../contexts/messageInputContext/MessageInputContext'; @@ -13,6 +12,7 @@ import { ThemeProvider } from '../../../contexts/themeContext/ThemeContext'; import { defaultTheme } from '../../../contexts/themeContext/utils/theme'; import { generateFileUploadPreview } from '../../../mock-builders/generator/attachment'; +import type { FileUpload } from '../../../types/types'; import { AudioAttachment, AudioAttachmentProps } from '../../Attachment/AudioAttachment'; jest.mock('../../../native.ts', () => ({ diff --git a/package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.tsx b/package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.tsx index bbbda6d7bf..718446d308 100644 --- a/package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.tsx +++ b/package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.tsx @@ -5,7 +5,6 @@ import { act } from 'react-test-renderer'; import { fireEvent, render } from '@testing-library/react-native'; import { - FileUpload, MessageInputContext, MessageInputContextValue, } from '../../../contexts/messageInputContext/MessageInputContext'; @@ -13,6 +12,7 @@ import { ThemeProvider } from '../../../contexts/themeContext/ThemeContext'; import { defaultTheme } from '../../../contexts/themeContext/utils/theme'; import { generateFileUploadPreview } from '../../../mock-builders/generator/attachment'; +import type { FileUpload } from '../../../types/types'; import { AudioAttachment, AudioAttachmentProps } from '../../Attachment/AudioAttachment'; jest.mock('../../../native.ts', () => { diff --git a/package/src/contexts/channelContext/ChannelContext.tsx b/package/src/contexts/channelContext/ChannelContext.tsx index a134119281..6b8b776333 100644 --- a/package/src/contexts/channelContext/ChannelContext.tsx +++ b/package/src/contexts/channelContext/ChannelContext.tsx @@ -137,6 +137,11 @@ export type ChannelContextValue< scrollToFirstUnreadThreshold: number; setLastRead: React.Dispatch>; setTargetedMessage: (messageId: string) => void; + /** + * Abort controller for cancelling async requests made for uploading images/files + * Its a map of filename and AbortController + */ + uploadAbortControllerRef: React.MutableRefObject>; /** * * ```json diff --git a/package/src/contexts/messageInputContext/MessageInputContext.tsx b/package/src/contexts/messageInputContext/MessageInputContext.tsx index cfdd46af0f..297814ca32 100644 --- a/package/src/contexts/messageInputContext/MessageInputContext.tsx +++ b/package/src/contexts/messageInputContext/MessageInputContext.tsx @@ -35,8 +35,16 @@ import type { MoreOptionsButtonProps } from '../../components/MessageInput/MoreO import type { SendButtonProps } from '../../components/MessageInput/SendButton'; import type { UploadProgressIndicatorProps } from '../../components/MessageInput/UploadProgressIndicator'; import type { MessageType } from '../../components/MessageList/hooks/useMessageList'; -import { compressImage, pickDocument } from '../../native'; -import type { Asset, DefaultStreamChatGenerics, File, UnknownType } from '../../types/types'; +import { pickDocument } from '../../native'; +import type { + Asset, + DefaultStreamChatGenerics, + File, + FileUpload, + ImageUpload, + UnknownType, +} from '../../types/types'; +import { compressedImageURI } from '../../utils/compressImage'; import { removeReservedFields } from '../../utils/removeReservedFields'; import { ACITriggerSettings, @@ -58,28 +66,6 @@ import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue'; import { getDisplayName } from '../utils/getDisplayName'; import { isTestEnvironment } from '../utils/isTestEnvironment'; -export type FileUpload = { - file: File; - id: string; - state: FileStateValue; - duration?: number; - paused?: boolean; - progress?: number; - thumb_url?: string; - url?: string; -}; - -export type ImageUpload = { - file: Partial & { - name?: string; - }; - id: string; - state: FileStateValue; - height?: number; - url?: string; - width?: number; -}; - export type MentionAllAppUsersQuery< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { @@ -438,7 +424,8 @@ export const MessageInputProvider = < const channelCapabities = useOwnCapabilitiesContext(); - const { channel, giphyEnabled } = useChannelContext(); + const { channel, giphyEnabled, uploadAbortControllerRef } = + useChannelContext(); const { thread } = useThreadContext(); const { t } = useTranslationContext(); const inputBoxRef = useRef(null); @@ -640,20 +627,21 @@ export const MessageInputProvider = < setText(''); }; - const mapImageUploadToAttachment = (image: ImageUpload) => { + const mapImageUploadToAttachment = (image: ImageUpload): Attachment => { const mime_type: string | boolean = lookup(image.file.name as string); + const name = image.file.name as string; return { - fallback: image.file.name, + fallback: name, image_url: image.url, mime_type: mime_type ? mime_type : undefined, original_height: image.height, original_width: image.width, - originalFile: image.file, + originalImage: image.file, type: 'image', - } as Attachment; + }; }; - const mapFileUploadToAttachment = (file: FileUpload) => { + const mapFileUploadToAttachment = (file: FileUpload): Attachment => { if (file.file.mimeType?.startsWith('image/')) { return { fallback: file.file.name, @@ -968,11 +956,24 @@ export const MessageInputProvider = < if (value.doDocUploadRequest) { response = await value.doDocUploadRequest(file, channel); } else if (channel && file.uri) { + uploadAbortControllerRef.current.set( + file.name, + client.createAbortControllerForNextRequest(), + ); response = await channel.sendFile(file.uri, file.name, file.mimeType); + uploadAbortControllerRef.current.delete(file.name); } const extraData: Partial = { thumb_url: response.thumb_url, url: response.file }; setFileUploads(getUploadSetStateAction(id, FileState.UPLOADED, extraData)); } catch (error: unknown) { + if ( + error instanceof Error && + (error.name === 'AbortError' || error.name === 'CanceledError') + ) { + // nothing to do + uploadAbortControllerRef.current.delete(file.name); + return; + } handleFileOrImageUploadError(error, false, id); } }; @@ -986,52 +987,55 @@ export const MessageInputProvider = < let response = {} as SendFileAPIResponse; + const uri = file.uri || ''; + const filename = file.name ?? uri.replace(/^(file:\/\/|content:\/\/)/, ''); + try { - const uri = file.uri || ''; - /** - * We skip compression if: - * - the file is from the camera as that should already be compressed - * - the file has no height/width value to maintain for compression - * - the compressImageQuality number is not present or is 1 (meaning no compression) - */ - const compressedUri = await (file.source === 'camera' || - !file.height || - !file.width || - typeof value.compressImageQuality !== 'number' || - value.compressImageQuality === 1 - ? uri - : compressImage({ - compressImageQuality: value.compressImageQuality, - height: file.height, - uri, - width: file.width, - })); - const filename = file.name ?? uri.replace(/^(file:\/\/|content:\/\/)/, ''); + const compressedUri = await compressedImageURI(file, value.compressImageQuality); const contentType = lookup(filename) || 'multipart/form-data'; if (value.doImageUploadRequest) { response = await value.doImageUploadRequest(file, channel); } else if (compressedUri && channel) { if (value.sendImageAsync) { - channel.sendImage(compressedUri, filename, contentType).then((res) => { - if (asyncIds.includes(id)) { - // Evaluates to true if user hit send before image successfully uploaded - setAsyncUploads((prevAsyncUploads) => { - prevAsyncUploads[id] = { - ...prevAsyncUploads[id], - state: FileState.UPLOADED, - url: res.file, - }; - return prevAsyncUploads; - }); - } else { - const newImageUploads = getUploadSetStateAction(id, FileState.UPLOADED, { - url: res.file, - }); - setImageUploads(newImageUploads); - } - }); + uploadAbortControllerRef.current.set( + filename, + client.createAbortControllerForNextRequest(), + ); + channel.sendImage(compressedUri, filename, contentType).then( + (res) => { + uploadAbortControllerRef.current.delete(filename); + if (asyncIds.includes(id)) { + // Evaluates to true if user hit send before image successfully uploaded + setAsyncUploads((prevAsyncUploads) => { + prevAsyncUploads[id] = { + ...prevAsyncUploads[id], + state: FileState.UPLOADED, + url: res.file, + }; + return prevAsyncUploads; + }); + } else { + const newImageUploads = getUploadSetStateAction( + id, + FileState.UPLOADED, + { + url: res.file, + }, + ); + setImageUploads(newImageUploads); + } + }, + () => { + uploadAbortControllerRef.current.delete(filename); + }, + ); } else { + uploadAbortControllerRef.current.set( + filename, + client.createAbortControllerForNextRequest(), + ); response = await channel.sendImage(compressedUri, filename, contentType); + uploadAbortControllerRef.current.delete(filename); } } @@ -1044,6 +1048,14 @@ export const MessageInputProvider = < setImageUploads(newImageUploads); } } catch (error) { + if ( + error instanceof Error && + (error.name === 'AbortError' || error.name === 'CanceledError') + ) { + // nothing to do + uploadAbortControllerRef.current.delete(filename); + return; + } handleFileOrImageUploadError(error, true, id); } }; diff --git a/package/src/contexts/messageInputContext/__tests__/__snapshots__/sendMessage.test.tsx.snap b/package/src/contexts/messageInputContext/__tests__/__snapshots__/sendMessage.test.tsx.snap index 24e0bca9bd..30139cf763 100644 --- a/package/src/contexts/messageInputContext/__tests__/__snapshots__/sendMessage.test.tsx.snap +++ b/package/src/contexts/messageInputContext/__tests__/__snapshots__/sendMessage.test.tsx.snap @@ -7,7 +7,7 @@ Object { "fallback": undefined, "image_url": undefined, "mime_type": undefined, - "originalFile": Object { + "originalImage": Object { "uri": "http://www.jackblack.com/tenac_iousd.bmp", }, "original_height": undefined, @@ -106,7 +106,7 @@ Object { "fallback": undefined, "image_url": undefined, "mime_type": undefined, - "originalFile": Object { + "originalImage": Object { "uri": "http://www.jackblack.com/tenac_iousd.bmp", }, "original_height": undefined, @@ -117,7 +117,7 @@ Object { "fallback": undefined, "image_url": undefined, "mime_type": undefined, - "originalFile": Object { + "originalImage": Object { "uri": "http://www.jackblack.com/tenac_iousd.bmp", }, "original_height": undefined, diff --git a/package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts b/package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts index e4678b04f6..c79292fc77 100644 --- a/package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +++ b/package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts @@ -1,9 +1,9 @@ import { useEffect, useState } from 'react'; -import type { DefaultStreamChatGenerics } from '../../../types/types'; +import type { DefaultStreamChatGenerics, FileUpload, ImageUpload } from '../../../types/types'; import { generateRandomId } from '../../../utils/utils'; -import type { FileUpload, ImageUpload, MessageInputContextValue } from '../MessageInputContext'; +import type { MessageInputContextValue } from '../MessageInputContext'; export const isEditingBoolean = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, diff --git a/package/src/types/types.ts b/package/src/types/types.ts index 3810db34c8..1da03c17bb 100644 --- a/package/src/types/types.ts +++ b/package/src/types/types.ts @@ -1,5 +1,7 @@ import type { ExtendableGenerics, LiteralStringForUnion } from 'stream-chat'; +import type { FileStateValue } from '../utils/utils'; + export type Asset = { duration: number; height: number; @@ -22,10 +24,31 @@ export type File = { uri?: string; }; +export type FileUpload = { + file: File; + id: string; + state: FileStateValue; + duration?: number; + paused?: boolean; + progress?: number; + thumb_url?: string; + url?: string; +}; + +export type ImageUpload = { + file: Partial; + id: string; + state: FileStateValue; + height?: number; + url?: string; + width?: number; +}; + export type DefaultAttachmentType = UnknownType & { file_size?: number; mime_type?: string; originalFile?: File; + originalImage?: Partial; }; interface DefaultUserType extends UnknownType { diff --git a/package/src/utils/compressImage.ts b/package/src/utils/compressImage.ts new file mode 100644 index 0000000000..da5b915885 --- /dev/null +++ b/package/src/utils/compressImage.ts @@ -0,0 +1,32 @@ +import { compressImage } from '../native'; +import type { Asset } from '../types/types'; + +/** + * Function to compress and Image and return the compressed Image URI + * @param image + * @param compressImageQuality + * @returns string + */ +export const compressedImageURI = async (image: Partial, compressImageQuality?: number) => { + const uri = image.uri || ''; + /** + * We skip compression if: + * - the file is from the camera as that should already be compressed + * - the file has no height/width value to maintain for compression + * - the compressImageQuality number is not present or is 1 (meaning no compression) + */ + const compressedUri = await (image.source === 'camera' || + !image.height || + !image.width || + typeof compressImageQuality !== 'number' || + compressImageQuality === 1 + ? uri + : compressImage({ + compressImageQuality, + height: image.height, + uri, + width: image.width, + })); + + return compressedUri; +}; From 2c50dc89981c1326560acbf51302b23cc8dea032 Mon Sep 17 00:00:00 2001 From: Vishal Narkhede Date: Mon, 27 Nov 2023 10:42:41 +0100 Subject: [PATCH 21/21] fix: update editing and quoted state within context correctly (#2333) --- package/src/components/Channel/Channel.tsx | 9 +++++---- .../hooks/useCreateInputMessageInputContext.ts | 11 ++--------- .../hooks/useCreateMessageInputContext.ts | 4 ++-- .../src/contexts/messagesContext/MessagesContext.tsx | 4 ++-- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/package/src/components/Channel/Channel.tsx b/package/src/components/Channel/Channel.tsx index 45d372b2af..c69f0eada3 100644 --- a/package/src/components/Channel/Channel.tsx +++ b/package/src/components/Channel/Channel.tsx @@ -1609,15 +1609,16 @@ const ChannelWithContext = < : client.updateMessage(updatedMessage); const setEditingState: MessagesContextValue['setEditingState'] = ( - message, + messageOrBoolean, ) => { - setEditing(message); + clearQuotedMessageState(); + setEditing(messageOrBoolean); }; const setQuotedMessageState: MessagesContextValue['setQuotedMessageState'] = ( - message, + messageOrBoolean, ) => { - setQuotedMessage(message); + setQuotedMessage(messageOrBoolean); }; const clearEditingState: InputMessageInputContextValue['clearEditingState'] = diff --git a/package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts b/package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts index 456704e144..18f1af0b7c 100644 --- a/package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +++ b/package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts @@ -53,7 +53,7 @@ export const useCreateInputMessageInputContext = < */ channelId?: string; }) => { - const editingExists = !!editing; + const editingDep = typeof editing === 'boolean' ? editing : editing?.id; const quotedMessageId = quotedMessage ? typeof quotedMessage === 'boolean' ? '' @@ -103,14 +103,7 @@ export const useCreateInputMessageInputContext = < ShowThreadMessageInChannelButton, UploadProgressIndicator, }), - [ - compressImageQuality, - channelId, - editingExists, - initialValue, - maxMessageLength, - quotedMessageId, - ], + [compressImageQuality, channelId, editingDep, initialValue, maxMessageLength, quotedMessageId], ); return inputMessageInputContext; diff --git a/package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts b/package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts index 5b428c1ff6..2d00bdb9d2 100644 --- a/package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +++ b/package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts @@ -95,7 +95,7 @@ export const useCreateMessageInputContext = < UploadProgressIndicator, }: MessageInputContextValue & Pick, 'thread'>) => { - const editingExists = !!editing; + const editingdep = typeof editing === 'boolean' ? editing : editing?.id; const fileUploadsValue = fileUploads .map(({ duration, paused, progress, state }) => `${state},${paused},${progress},${duration}`) .join(); @@ -198,7 +198,7 @@ export const useCreateMessageInputContext = < }), [ cooldownEndsAt, - editingExists, + editingdep, fileUploadsValue, giphyActive, imageUploadsValue, diff --git a/package/src/contexts/messagesContext/MessagesContext.tsx b/package/src/contexts/messagesContext/MessagesContext.tsx index 1686b5d87e..59cdab88b0 100644 --- a/package/src/contexts/messagesContext/MessagesContext.tsx +++ b/package/src/contexts/messagesContext/MessagesContext.tsx @@ -234,8 +234,8 @@ export type MessagesContextValue< */ ScrollToBottomButton: React.ComponentType; sendReaction: (type: string, messageId: string) => Promise; - setEditingState: (message: MessageType) => void; - setQuotedMessageState: (message: MessageType) => void; + setEditingState: (message: MessageType | boolean) => void; + setQuotedMessageState: (message: MessageType | boolean) => void; supportedReactions: ReactionData[]; /** * UI component for TypingIndicator