diff --git a/docusaurus/docs/reactnative/basics/installation.mdx b/docusaurus/docs/reactnative/basics/installation.mdx index 39fce1ece..923be34f7 100644 --- a/docusaurus/docs/reactnative/basics/installation.mdx +++ b/docusaurus/docs/reactnative/basics/installation.mdx @@ -56,7 +56,7 @@ Stream Chat React Native SDK requires installing some peer dependencies to provi ```bash title="Terminal" -yarn add @react-native-camera-roll/camera-roll @react-native-community/netinfo react-native-gesture-handler react-native-image-crop-picker @bam.tech/react-native-image-resizer react-native-reanimated react-native-svg +yarn add @react-native-camera-roll/camera-roll @react-native-community/netinfo react-native-gesture-handler @bam.tech/react-native-image-resizer react-native-reanimated react-native-svg ``` @@ -64,7 +64,7 @@ yarn add @react-native-camera-roll/camera-roll @react-native-community/netinfo r ```bash title="Terminal" -npx expo install @react-native-community/netinfo expo-image-manipulator expo-image-picker expo-media-library react-native-gesture-handler react-native-reanimated react-native-svg +npx expo install @react-native-community/netinfo expo-image-manipulator expo-media-library react-native-gesture-handler react-native-reanimated react-native-svg ``` @@ -85,7 +85,6 @@ values={[ - [`@react-native-camera-roll/camera-roll`](https://github.com/react-native-cameraroll/react-native-cameraroll) for accessing device gallery. - [`@react-native-community/netinfo`](https://github.com/react-native-netinfo/react-native-netinfo) for SDK to respond to network changes. - [`react-native-gesture-handler`](https://github.com/software-mansion/react-native-gesture-handler) to handle gestures within the SDK. -- [`react-native-image-crop-picker`](https://github.com/ivpusic/react-native-image-crop-picker) to capture images to attach them in the message. - [`@bam.tech/react-native-image-resizer`](https://github.com/bamlab/react-native-image-resizer) to compress image uploads. - [`react-native-reanimated`](https://github.com/software-mansion/react-native-reanimated) to compress image uploads. - [`react-native-svg`](https://github.com/react-native-svg/react-native-svg) for SVG support. @@ -96,7 +95,6 @@ values={[ - [`expo-media-library`](https://docs.expo.dev/versions/latest/sdk/media-library/) for accessing device gallery. - [`@react-native-community/netinfo`](https://github.com/react-native-netinfo/react-native-netinfo) for SDK to respond to network changes. - [`react-native-gesture-handler`](https://github.com/software-mansion/react-native-gesture-handler) to handle gestures within the SDK. -- [`expo-image-picker`](https://docs.expo.dev/versions/latest/sdk/imagepicker/) to capture images to attach them in the message. - [`expo-image-manipulator`](https://docs.expo.dev/versions/latest/sdk/imagemanipulator/) to compress image uploads. - [`react-native-reanimated`](https://github.com/software-mansion/react-native-reanimated) to compress image uploads. - [`react-native-svg`](https://docs.expo.dev/versions/latest/sdk/svg/) for SVG support. @@ -282,6 +280,36 @@ npx expo install expo-document-picker +### Capture image and upload attachment + +Capture images from the camera and upload them as attachments in the chat. + + + + +```bash title="Terminal" +yarn add react-native-image-picker +``` + + + + + +```bash title="Terminal" +npx expo install expo-image-picker +``` + + + + + ### Offline support Enable offline support in the app. @@ -330,6 +358,7 @@ values={[ - [`react-native-haptic-feedback`](https://github.com/junina-de/react-native-haptic-feedback) for user haptics feedback. - [`@react-native-clipboard/clipboard`](https://github.com/react-native-clipboard/clipboard) for Copy message support. - [`react-native-document-picker`](https://github.com/rnmods/react-native-document-picker) to access device media files. +- [`react-native-image-picker`](https://github.com/react-native-image-picker/react-native-image-picker) to capture images to attach them in the message. - [`@op-engineering/op-sqlite`](https://github.com/OP-Engineering/op-sqlite) to enable Offline support in the app. @@ -341,6 +370,7 @@ values={[ - [`expo-haptics`](https://docs.expo.dev/versions/latest/sdk/haptics/) for user haptics support. - [`expo-clipboard`](https://docs.expo.dev/versions/latest/sdk/clipboard/) for Copy message support. - [`expo-document-picker`](https://docs.expo.dev/versions/latest/sdk/document-picker/) to access device media files. +- [`expo-image-picker`](https://docs.expo.dev/versions/latest/sdk/imagepicker/) to capture images to attach them in the message. - [`@op-engineering/op-sqlite`](https://github.com/OP-Engineering/op-sqlite) to enable Offline support in the app. @@ -365,7 +395,7 @@ values={[ - [`@react-native-camera-roll/camera-roll`](https://github.com/react-native-cameraroll/react-native-cameraroll?tab=readme-ov-file#permissions) for gallery/photo library access. -- [`react-native-image-crop-picker`](https://github.com/ivpusic/react-native-image-crop-picker?tab=readme-ov-file#step-3) for camera access. +- [`react-native-image-picker`](https://github.com/react-native-image-picker/react-native-image-picker?tab=readme-ov-file#post-install-steps) for camera access. - [`react-native-audio-recorder-player`](https://github.com/hyochan/react-native-audio-recorder-player?tab=readme-ov-file#post-installation) for microphone access for voice recording. An example `AndroidManifest.xml` would look like this with permissions: @@ -477,7 +507,7 @@ The entry point of your app exists usually either in `index.js` or `App.tsx` fil Please also follow the steps mentioned in the links below for corresponding dependencies: - `react-native` - [additional installation steps](https://reactnative.dev/docs/image#gif-and-webp-support-on-android) -- `react-native-image-crop-picker` - [additional installation steps](https://github.com/ivpusic/react-native-image-crop-picker#step-3) +- `react-native-image-picker` - [additional installation steps](https://github.com/react-native-image-picker/react-native-image-picker?tab=readme-ov-file#post-install-steps) - `react-native-cameraroll` - [additional installation steps](https://github.com/react-native-cameraroll/react-native-cameraroll#permissions) Now you should be able to run the app on simulator by running following command: diff --git a/docusaurus/docs/reactnative/basics/migrating-from-5.x-to-6.x.mdx b/docusaurus/docs/reactnative/basics/migrating-from-5.x-to-6.x.mdx index c943a256d..623d28b35 100644 --- a/docusaurus/docs/reactnative/basics/migrating-from-5.x-to-6.x.mdx +++ b/docusaurus/docs/reactnative/basics/migrating-from-5.x-to-6.x.mdx @@ -33,6 +33,19 @@ yarn remove react-native-image-resizer yarn add @bam.tech/react-native-image-resizer ``` +### Change `react-native-image-crop-picker` to `react-native-image-picker` + +The `react-native-image-crop-picker` package has been replaced with `react-native-image-picker`. This is a better alternative, and can help us with our new architecture endeavors. + +You can replace it by running the following commands: + +```bash +yarn remove react-native-image-crop-picker +yarn add react-native-image-picker +``` + +Also, the dependency is made optional now, so if you don't want to use the image picker, you can remove it from your project and the camera selector icon on the Attachment picker will be simply hidden for you. + ### Change `react-native-quick-sqlite` to `op-sqlite` The `react-native-quick-sqlite` package has been replaced with `op-sqlite`. This is a faster alternative, and can help us with our new architecture endeavors. diff --git a/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_camera_picker.mdx b/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_camera_picker.mdx new file mode 100644 index 000000000..5896a258d --- /dev/null +++ b/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_camera_picker.mdx @@ -0,0 +1,5 @@ +Enable the file picker on the [`MessageInput`](../../../../ui-components/message-input.mdx) component. + +| Type | Default | +| ------- | ------- | +| Boolean | `true` | diff --git a/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_file_picker.mdx b/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_file_picker.mdx index a3b942555..5896a258d 100644 --- a/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_file_picker.mdx +++ b/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_file_picker.mdx @@ -2,4 +2,4 @@ Enable the file picker on the [`MessageInput`](../../../../ui-components/message | Type | Default | | ------- | ------- | -| boolean | true | +| Boolean | `true` | diff --git a/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_image_picker.mdx b/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_image_picker.mdx index e9689e178..999c8f1ce 100644 --- a/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_image_picker.mdx +++ b/docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_image_picker.mdx @@ -2,4 +2,4 @@ Enable the image picker on the [`MessageInput`](../../../../ui-components/messag | Type | Default | | ------- | ------- | -| boolean | true | +| Boolean | `true` | diff --git a/docusaurus/docs/reactnative/contexts/message-input-context.mdx b/docusaurus/docs/reactnative/contexts/message-input-context.mdx index dba4f6f94..0b1b4d311 100644 --- a/docusaurus/docs/reactnative/contexts/message-input-context.mdx +++ b/docusaurus/docs/reactnative/contexts/message-input-context.mdx @@ -26,6 +26,7 @@ import DoDocUploadRequest from '../common-content/ui-components/channel/props/do import DoImageUploadRequest from '../common-content/ui-components/channel/props/do_image_upload_request.mdx'; import EmojiSearchIndex from '../common-content/ui-components/channel/props/emoji_search_index.mdx'; import FileUploadPreview from '../common-content/ui-components/channel/props/file_upload_preview.mdx'; +import HasCameraPicker from '../common-content/ui-components/channel/props/has_camera_picker.mdx'; import HasCommands from '../common-content/ui-components/channel/props/has_commands.mdx'; import HasFilePicker from '../common-content/ui-components/channel/props/has_file_picker.mdx'; import HasImagePicker from '../common-content/ui-components/channel/props/has_image_picker.mdx'; @@ -182,15 +183,19 @@ const { sendMessage, toggleAttachmentPicker } = useMessageInputContext(); +###
_forwarded from [Channel](../../core-components/channel#hascamerapicker)_ props
`hasCameraPicker` {#hascamerapicker} + + + ###
_forwarded from [Channel](../../core-components/channel#hascommands)_ props
`hasCommands` {#hascommands} -###
_forwarded from [Channel](../../core-components/channel#hasfilepicker)_ props
hasFilePicker {#hasfilepicker} +###
_forwarded from [Channel](../../core-components/channel#hasfilepicker)_ props
`hasFilePicker` {#hasfilepicker} -###
_forwarded from [Channel](../../core-components/channel#hasimagepicker)_ props
hasImagePicker {#hasimagepicker} +###
_forwarded from [Channel](../../core-components/channel#hasimagepicker)_ props
`hasImagePicker` {#hasimagepicker} diff --git a/docusaurus/docs/reactnative/core-components/channel.mdx b/docusaurus/docs/reactnative/core-components/channel.mdx index 9352e0f8f..87fadbd25 100644 --- a/docusaurus/docs/reactnative/core-components/channel.mdx +++ b/docusaurus/docs/reactnative/core-components/channel.mdx @@ -74,6 +74,7 @@ import HandleQuotedReply from '../common-content/ui-components/channel/props/han import HandleReaction from '../common-content/ui-components/channel/props/handle_reaction.mdx'; import HandleRetry from '../common-content/ui-components/channel/props/handle_retry.mdx'; import HandleThreadReply from '../common-content/ui-components/channel/props/handle_thread_reply.mdx'; +import HasCameraPicker from '../common-content/ui-components/channel/props/has_camera_picker.mdx'; import HasCommands from '../common-content/ui-components/channel/props/has_commands.mdx'; import HasFilePicker from '../common-content/ui-components/channel/props/has_file_picker.mdx'; import HasImagePicker from '../common-content/ui-components/channel/props/has_image_picker.mdx'; @@ -524,6 +525,10 @@ The max allowable is 255, which when reached displays as `255+`. +### `hasCameraPicker` + + + ### `hasCommands` diff --git a/docusaurus/docs/reactnative/customization/native-handlers.mdx b/docusaurus/docs/reactnative/customization/native-handlers.mdx index 9a988a498..f34846eb7 100644 --- a/docusaurus/docs/reactnative/customization/native-handlers.mdx +++ b/docusaurus/docs/reactnative/customization/native-handlers.mdx @@ -122,9 +122,9 @@ A function to provide a given image to the native sharing functionality of the O A function that opens the OS specific camera and returns an image when one is taken. -| React Native CLI | Expo | -| --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| [`react-native-image-crop-picker`](https://github.com/ivpusic/react-native-image-crop-picker) | [`expo-image-picker`](https://docs.expo.io/versions/latest/sdk/imagepicker/) | +| React Native CLI | Expo | +| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| [`react-native-image-picker`](https://github.com/react-native-image-picker/react-native-image-picker) | [`expo-image-picker`](https://docs.expo.io/versions/latest/sdk/imagepicker/) | ### `triggerHaptic` diff --git a/docusaurus/docs/reactnative/guides/custom-message-input.mdx b/docusaurus/docs/reactnative/guides/custom-message-input.mdx index 49253d975..0408bee19 100644 --- a/docusaurus/docs/reactnative/guides/custom-message-input.mdx +++ b/docusaurus/docs/reactnative/guides/custom-message-input.mdx @@ -418,8 +418,8 @@ const CustomAttachButton = () => { ``` Now let's hook the relevant action handlers for buttons within ActionSheet. -[`react-native-image-crop-picker`](https://github.com/ivpusic/react-native-image-crop-picker) provides an image picker functionality -with good support for configurable compression, multiple images and cropping. And selected images from image picker or camera can be wired in +[`react-native-image-picker`](https://github.com/react-native-image-picker/react-native-image-picker) provides an image picker functionality +with good support for multiple images. And selected images from image picker or camera can be wired in with upload previews ([`ImageUploadPreview`](../ui-components/image-upload-preview.mdx)) within `MessageInput` component by using a function `uploadNewImage` provided by [`MessageInputContext`](../../contexts/message-input-context#uploadnewimage). @@ -429,15 +429,15 @@ provided by the [`MessageInputContext`](../../contexts/message-input-context#pic ```tsx {4,10,12-21,23-30,43,46,49} import { AttachButton, Channel, useMessageInputContext } from 'stream-chat-react-native'; import { ActionSheetProvider, useActionSheet } from '@expo/react-native-action-sheet'; -import ImagePicker from 'react-native-image-crop-picker'; +import ImagePicker from 'react-native-image-picker'; const CustomAttachButton = () => { const { showActionSheetWithOptions } = useActionSheet(); const { pickFile, uploadNewImage } = useMessageInputContext(); const pickImageFromGallery = () => - ImagePicker.openPicker({ - multiple: true, + ImagePicker.launchImageLibrary({ + selectionLimit: 0, }).then(images => images.forEach(image => uploadNewImage({ @@ -447,9 +447,7 @@ const CustomAttachButton = () => { ); const pickImageFromCamera = () => - ImagePicker.openCamera({ - cropping: true, - }).then(image => + ImagePicker.launchCamera({}).then(image => uploadNewImage({ uri: image.path, }), diff --git a/examples/ExpoMessaging/package.json b/examples/ExpoMessaging/package.json index 69ffce927..6a4bd3d32 100644 --- a/examples/ExpoMessaging/package.json +++ b/examples/ExpoMessaging/package.json @@ -22,7 +22,7 @@ "expo-file-system": "~17.0.1", "expo-haptics": "~13.0.1", "expo-image-manipulator": "~12.0.5", - "expo-image-picker": "~15.0.6", + "expo-image-picker": "~15.0.7", "expo-linking": "~6.3.1", "expo-media-library": "~16.0.4", "expo-router": "~3.5.17", @@ -31,7 +31,7 @@ "expo-status-bar": "~1.12.1", "react": "18.2.0", "react-dom": "18.2.0", - "react-native": "0.74.2", + "react-native": "0.74.3", "react-native-gesture-handler": "~2.16.1", "react-native-reanimated": "~3.10.1", "react-native-safe-area-context": "4.10.1", diff --git a/examples/ExpoMessaging/yarn.lock b/examples/ExpoMessaging/yarn.lock index 47e684d37..cf59f85f9 100644 --- a/examples/ExpoMessaging/yarn.lock +++ b/examples/ExpoMessaging/yarn.lock @@ -2031,45 +2031,45 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-compose-refs" "1.0.0" -"@react-native-community/cli-clean@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-clean/-/cli-clean-13.6.8.tgz#95ce964047f005152ac100394b6dcd5d2cc2a474" - integrity sha512-B1uxlm1N4BQuWFvBL3yRl3LVvydjswsdbTi7tMrHMtSxfRio1p9HjcmDzlzKco09Y+8qBGgakm3jcMZGLbhXQQ== +"@react-native-community/cli-clean@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-clean/-/cli-clean-13.6.9.tgz#b6754f39c2b877c9d730feb848945150e1d52209" + integrity sha512-7Dj5+4p9JggxuVNOjPbduZBAP1SUgNhLKVw5noBUzT/3ZpUZkDM+RCSwyoyg8xKWoE4OrdUAXwAFlMcFDPKykA== dependencies: - "@react-native-community/cli-tools" "13.6.8" + "@react-native-community/cli-tools" "13.6.9" chalk "^4.1.2" execa "^5.0.0" fast-glob "^3.3.2" -"@react-native-community/cli-config@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-config/-/cli-config-13.6.8.tgz#6829ea7cdc237776c300be06f84c222bf17cf4c5" - integrity sha512-RabCkIsWdP4Ex/sf1uSP9qxc30utm+0uIJAjrZkNQynm7T4Lyqn/kT3LKm4yM6M0Qk61YxGguiaXF4601vAduw== +"@react-native-community/cli-config@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-config/-/cli-config-13.6.9.tgz#d609a64d40a173c89bd7d24e31807bb7dcba69f9" + integrity sha512-rFfVBcNojcMm+KKHE/xqpqXg8HoKl4EC7bFHUrahMJ+y/tZll55+oX/PGG37rzB8QzP2UbMQ19DYQKC1G7kXeg== dependencies: - "@react-native-community/cli-tools" "13.6.8" + "@react-native-community/cli-tools" "13.6.9" chalk "^4.1.2" cosmiconfig "^5.1.0" deepmerge "^4.3.0" fast-glob "^3.3.2" joi "^17.2.1" -"@react-native-community/cli-debugger-ui@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-13.6.8.tgz#d52fccd4b3e0860d96d75ff5b0ebb128bdc93dfd" - integrity sha512-2cS+MX/Su6sVSjqpDftFOXbK7EuPg98xzsPkdPhkQnkZwvXqodK9CAMuDMbx3lBHHtrPrpMbBCpFmPN8iVOnlA== +"@react-native-community/cli-debugger-ui@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-13.6.9.tgz#bc5727c51964206a00d417e5148b46331a81d5a5" + integrity sha512-TkN7IdFmGPPvTpAo3nCAH9uwGCPxWBEAwpqEZDrq0NWllI7Tdie8vDpGdrcuCcKalmhq6OYnkXzeBah7O1Ztpw== dependencies: serve-static "^1.13.1" -"@react-native-community/cli-doctor@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-doctor/-/cli-doctor-13.6.8.tgz#05f696d94e975e4dcf7f9a1fde32fb43e4bb8a5f" - integrity sha512-/3Vdy9J3hyiu0y3nd/CU3kBqPlTRxnLXg7V6jrA1jbTOlZAMyV9imEkrqEaGK0SMOyMhh9Pipf98Ozhk0Nl4QA== +"@react-native-community/cli-doctor@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-doctor/-/cli-doctor-13.6.9.tgz#f1d4eeff427ddc8a9d19851042621c10939c35cb" + integrity sha512-5quFaLdWFQB+677GXh5dGU9I5eg2z6Vg4jOX9vKnc9IffwyIFAyJfCZHrxLSRPDGNXD7biDQUdoezXYGwb6P/A== dependencies: - "@react-native-community/cli-config" "13.6.8" - "@react-native-community/cli-platform-android" "13.6.8" - "@react-native-community/cli-platform-apple" "13.6.8" - "@react-native-community/cli-platform-ios" "13.6.8" - "@react-native-community/cli-tools" "13.6.8" + "@react-native-community/cli-config" "13.6.9" + "@react-native-community/cli-platform-android" "13.6.9" + "@react-native-community/cli-platform-apple" "13.6.9" + "@react-native-community/cli-platform-ios" "13.6.9" + "@react-native-community/cli-tools" "13.6.9" chalk "^4.1.2" command-exists "^1.2.8" deepmerge "^4.3.0" @@ -2083,54 +2083,54 @@ wcwidth "^1.0.1" yaml "^2.2.1" -"@react-native-community/cli-hermes@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-hermes/-/cli-hermes-13.6.8.tgz#85f10f663bc79f299146e749c48c06ebc4da9e29" - integrity sha512-lZi/OBFuZUj5cLK94oEgtrtmxGoqeYVRcnHXl/R5c4put9PDl+qH2bEMlGZkFiw57ae3UZKr3TMk+1s4jh3FYQ== +"@react-native-community/cli-hermes@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-hermes/-/cli-hermes-13.6.9.tgz#88c8dfe936a0d4272efc54429eda9ccc3fca3ad8" + integrity sha512-GvwiwgvFw4Ws+krg2+gYj8sR3g05evmNjAHkKIKMkDTJjZ8EdyxbkifRUs1ZCq3TMZy2oeblZBXCJVOH4W7ZbA== dependencies: - "@react-native-community/cli-platform-android" "13.6.8" - "@react-native-community/cli-tools" "13.6.8" + "@react-native-community/cli-platform-android" "13.6.9" + "@react-native-community/cli-tools" "13.6.9" chalk "^4.1.2" hermes-profile-transformer "^0.0.6" -"@react-native-community/cli-platform-android@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-13.6.8.tgz#a3672512a9b844f93d6050537c59dd58e1b12f17" - integrity sha512-vWrqeLRRTwp2kO33nbrAgbYn8HR2c2CpIfyVJY9Ckk7HGUSwDyxdcSu7YBvt2ShdfLZH0HctWFNXsgGrfg6BDw== +"@react-native-community/cli-platform-android@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-13.6.9.tgz#b175b9b11334fc90da3f395432678bd53c30fae4" + integrity sha512-9KsYGdr08QhdvT3Ht7e8phQB3gDX9Fs427NJe0xnoBh+PDPTI2BD5ks5ttsH8CzEw8/P6H8tJCHq6hf2nxd9cw== dependencies: - "@react-native-community/cli-tools" "13.6.8" + "@react-native-community/cli-tools" "13.6.9" chalk "^4.1.2" execa "^5.0.0" fast-glob "^3.3.2" fast-xml-parser "^4.2.4" logkitty "^0.7.1" -"@react-native-community/cli-platform-apple@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-apple/-/cli-platform-apple-13.6.8.tgz#4d46a2d6678a7b3264768f97393f082ed9afb264" - integrity sha512-1JPohnlXPqU44zns3ALEzIbH2cKRw6JtEDJERgLuEUbs2r2NeJgqDbKyZ7fTTO8o+pegDnn6+Rr7qGVVOuUzzg== +"@react-native-community/cli-platform-apple@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-apple/-/cli-platform-apple-13.6.9.tgz#02fb5dc47d62acd85f4d7a852e93216927a772fa" + integrity sha512-KoeIHfhxMhKXZPXmhQdl6EE+jGKWwoO9jUVWgBvibpVmsNjo7woaG/tfJMEWfWF3najX1EkQAoJWpCDBMYWtlA== dependencies: - "@react-native-community/cli-tools" "13.6.8" + "@react-native-community/cli-tools" "13.6.9" chalk "^4.1.2" execa "^5.0.0" fast-glob "^3.3.2" fast-xml-parser "^4.0.12" ora "^5.4.1" -"@react-native-community/cli-platform-ios@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-13.6.8.tgz#2de1bd8529825781108c1cbba4f5b25cb062581c" - integrity sha512-/IIcIRM8qaoD7iZqsvtf6Qq1AwtChWYfB9sTn3mTiolZ5Zd5bXH37g+6liPfAICRkj2Ptq3iXmjrDVUQAxrOXw== +"@react-native-community/cli-platform-ios@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-13.6.9.tgz#f37ceab41c2302e8f0d4bcbd3bf58b3353db4306" + integrity sha512-CiUcHlGs8vE0CAB4oi1f+dzniqfGuhWPNrDvae2nm8dewlahTBwIcK5CawyGezjcJoeQhjBflh9vloska+nlnw== dependencies: - "@react-native-community/cli-platform-apple" "13.6.8" + "@react-native-community/cli-platform-apple" "13.6.9" -"@react-native-community/cli-server-api@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-server-api/-/cli-server-api-13.6.8.tgz#fc654a2990a5f0b6f0b67ef04b25f699bee63f63" - integrity sha512-Lx664oWTzpVfbKUTy+3GIX7e+Mt5Zn+zdkM4ehllNdik/lbB3tM9Nrg8PSvOfI+tTXs2w55+nIydLfH+0FqJVg== +"@react-native-community/cli-server-api@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-server-api/-/cli-server-api-13.6.9.tgz#269e666bc26e9d0b2f42c7f6099559b5f9259e9d" + integrity sha512-W8FSlCPWymO+tlQfM3E0JmM8Oei5HZsIk5S0COOl0MRi8h0NmHI4WSTF2GCfbFZkcr2VI/fRsocoN8Au4EZAug== dependencies: - "@react-native-community/cli-debugger-ui" "13.6.8" - "@react-native-community/cli-tools" "13.6.8" + "@react-native-community/cli-debugger-ui" "13.6.9" + "@react-native-community/cli-tools" "13.6.9" compression "^1.7.1" connect "^3.6.5" errorhandler "^1.5.1" @@ -2139,10 +2139,10 @@ serve-static "^1.13.1" ws "^6.2.2" -"@react-native-community/cli-tools@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-tools/-/cli-tools-13.6.8.tgz#65a9f49ce66f0e639d855e745c8dfa7ae7b6c142" - integrity sha512-1MYlae9EkbjC7DBYOGMH5xF9yDoeNYUKgEdDjL6WAUBoF2gtwiZPM6igLKi/+dhb5sCtC7fiLrLi0Oevdf+RmQ== +"@react-native-community/cli-tools@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-tools/-/cli-tools-13.6.9.tgz#2baee279358ba1a863e737b2fa9f45659ad91929" + integrity sha512-OXaSjoN0mZVw3nrAwcY1PC0uMfyTd9fz7Cy06dh+EJc+h0wikABsVRzV8cIOPrVV+PPEEXE0DBrH20T2puZzgQ== dependencies: appdirsjs "^1.2.4" chalk "^4.1.2" @@ -2156,26 +2156,26 @@ shell-quote "^1.7.3" sudo-prompt "^9.0.0" -"@react-native-community/cli-types@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-types/-/cli-types-13.6.8.tgz#1c357d3290a48232e3e639d48e43e31e422ce436" - integrity sha512-C4mVByy0i+/NPuPhdMLBR7ubEVkjVS1VwoQu/BoG1crJFNE+167QXAzH01eFbXndsjZaMWmD4Gerx7TYc6lHfA== +"@react-native-community/cli-types@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-types/-/cli-types-13.6.9.tgz#08bfb796eacf0daeb31e2de516e81e78a36a1a55" + integrity sha512-RLxDppvRxXfs3hxceW/mShi+6o5yS+kFPnPqZTaMKKR5aSg7LwDpLQW4K2D22irEG8e6RKDkZUeH9aL3vO2O0w== dependencies: joi "^17.2.1" -"@react-native-community/cli@13.6.8": - version "13.6.8" - resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-13.6.8.tgz#d52c22620242e161bddcd2e0b6dbacd8743ca09b" - integrity sha512-0lRdgLNaXixWY4BfFRl1J6Ao9Lapo2z+++iE7TD4GAbuxOWJSyFi+KUA8XNfSDyML4jFO02MZgyBPxAWdaminQ== - dependencies: - "@react-native-community/cli-clean" "13.6.8" - "@react-native-community/cli-config" "13.6.8" - "@react-native-community/cli-debugger-ui" "13.6.8" - "@react-native-community/cli-doctor" "13.6.8" - "@react-native-community/cli-hermes" "13.6.8" - "@react-native-community/cli-server-api" "13.6.8" - "@react-native-community/cli-tools" "13.6.8" - "@react-native-community/cli-types" "13.6.8" +"@react-native-community/cli@13.6.9": + version "13.6.9" + resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-13.6.9.tgz#ba6360b94e0aba9c4001bda256cf7e57e2ecb02c" + integrity sha512-hFJL4cgLPxncJJd/epQ4dHnMg5Jy/7Q56jFvA3MHViuKpzzfTCJCB+pGY54maZbtym53UJON9WTGpM3S81UfjQ== + dependencies: + "@react-native-community/cli-clean" "13.6.9" + "@react-native-community/cli-config" "13.6.9" + "@react-native-community/cli-debugger-ui" "13.6.9" + "@react-native-community/cli-doctor" "13.6.9" + "@react-native-community/cli-hermes" "13.6.9" + "@react-native-community/cli-server-api" "13.6.9" + "@react-native-community/cli-tools" "13.6.9" + "@react-native-community/cli-types" "13.6.9" chalk "^4.1.2" commander "^9.4.1" deepmerge "^4.3.0" @@ -2191,10 +2191,10 @@ resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-11.3.1.tgz#4539371a2f4bd402d932031be82c2449ed63a1a5" integrity sha512-UBnJxyV0b7i9Moa97Av+HKho1ByzX0DtbJXzUQS5E3xhQs6P2D/Os0iw3ouy7joY1TVd6uIhplPbr7l1SJNaNQ== -"@react-native/assets-registry@0.74.84": - version "0.74.84" - resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.74.84.tgz#aa472f82c1b7d8a30098c8ba22fad7b3dbb5be5f" - integrity sha512-dzUhwyaX04QosWZ8zyaaNB/WYZIdeDN1lcpfQbqiOhZJShRH+FLTDVONE/dqlMQrP+EO7lDqF0RrlIt9lnOCQQ== +"@react-native/assets-registry@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.74.85.tgz#ae903c0c25f4d6a751d53d63245d5612c81edd98" + integrity sha512-59YmIQxfGDw4aP9S/nAM+sjSFdW8fUP6fsqczCcXgL2YVEjyER9XCaUT0J1K+PdHep8pi05KUgIKUds8P3jbmA== "@react-native/babel-plugin-codegen@0.74.84": version "0.74.84" @@ -2203,6 +2203,13 @@ dependencies: "@react-native/codegen" "0.74.84" +"@react-native/babel-plugin-codegen@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.74.85.tgz#067224bf5099ee2679babd700c7115822a747004" + integrity sha512-48TSDclRB5OMXiImiJkLxyCfRyLsqkCgI8buugCZzvXcYslfV7gCvcyFyQldtcOmerV+CK4RAj7QS4hmB5Mr8Q== + dependencies: + "@react-native/codegen" "0.74.85" + "@react-native/babel-preset@0.74.84": version "0.74.84" resolved "https://registry.yarnpkg.com/@react-native/babel-preset/-/babel-preset-0.74.84.tgz#703ebfc810d82c9f51f033352abd5f9fa70d492b" @@ -2252,6 +2259,55 @@ babel-plugin-transform-flow-enums "^0.0.2" react-refresh "^0.14.0" +"@react-native/babel-preset@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/babel-preset/-/babel-preset-0.74.85.tgz#3ce6ca77a318dec226fd9e3fff9c2ef7b0aa66e3" + integrity sha512-yMHUlN8INbK5BBwiBuQMftdWkpm1IgCsoJTKcGD2OpSgZhwwm8RUSvGhdRMzB2w7bsqqBmaEMleGtW6aCR7B9w== + dependencies: + "@babel/core" "^7.20.0" + "@babel/plugin-proposal-async-generator-functions" "^7.0.0" + "@babel/plugin-proposal-class-properties" "^7.18.0" + "@babel/plugin-proposal-export-default-from" "^7.0.0" + "@babel/plugin-proposal-logical-assignment-operators" "^7.18.0" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.0" + "@babel/plugin-proposal-numeric-separator" "^7.0.0" + "@babel/plugin-proposal-object-rest-spread" "^7.20.0" + "@babel/plugin-proposal-optional-catch-binding" "^7.0.0" + "@babel/plugin-proposal-optional-chaining" "^7.20.0" + "@babel/plugin-syntax-dynamic-import" "^7.8.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.20.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.20.0" + "@babel/plugin-transform-flow-strip-types" "^7.20.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-private-methods" "^7.22.5" + "@babel/plugin-transform-private-property-in-object" "^7.22.11" + "@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-typescript" "^7.5.0" + "@babel/plugin-transform-unicode-regex" "^7.0.0" + "@babel/template" "^7.0.0" + "@react-native/babel-plugin-codegen" "0.74.85" + babel-plugin-transform-flow-enums "^0.0.2" + react-refresh "^0.14.0" + "@react-native/codegen@0.74.84": version "0.74.84" resolved "https://registry.yarnpkg.com/@react-native/codegen/-/codegen-0.74.84.tgz#d3425a510b7da558ef5088d9b0aa5e0b1c05c783" @@ -2265,15 +2321,28 @@ mkdirp "^0.5.1" nullthrows "^1.1.1" -"@react-native/community-cli-plugin@0.74.84": - version "0.74.84" - resolved "https://registry.yarnpkg.com/@react-native/community-cli-plugin/-/community-cli-plugin-0.74.84.tgz#223a0defe8118dc57c8ac852ddd13517ea10c4e2" - integrity sha512-GBKE+1sUh86fS2XXV46gMCNHMc1KetshMbYJ0AhDhldpaILZHqRBX50mdVsiYVvkzp4QjM0nmYqefuJ9NVwicQ== +"@react-native/codegen@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/codegen/-/codegen-0.74.85.tgz#568464071c0b9be741da1a1ab43b1df88180ca5d" + integrity sha512-N7QwoS4Hq/uQmoH83Ewedy6D0M7xbQsOU3OMcQf0eY3ltQ7S2hd9/R4UTalQWRn1OUJfXR6OG12QJ4FStKgV6Q== dependencies: - "@react-native-community/cli-server-api" "13.6.8" - "@react-native-community/cli-tools" "13.6.8" - "@react-native/dev-middleware" "0.74.84" - "@react-native/metro-babel-transformer" "0.74.84" + "@babel/parser" "^7.20.0" + glob "^7.1.1" + hermes-parser "0.19.1" + invariant "^2.2.4" + jscodeshift "^0.14.0" + mkdirp "^0.5.1" + nullthrows "^1.1.1" + +"@react-native/community-cli-plugin@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/community-cli-plugin/-/community-cli-plugin-0.74.85.tgz#5bf95599166fd2b8bf10612250006e282053f6c4" + integrity sha512-ODzND33eA2owAY3g9jgCdqB+BjAh8qJ7dvmSotXgrgDYr3MJMpd8gvHTIPe2fg4Kab+wk8uipRhrE0i0RYMwtQ== + dependencies: + "@react-native-community/cli-server-api" "13.6.9" + "@react-native-community/cli-tools" "13.6.9" + "@react-native/dev-middleware" "0.74.85" + "@react-native/metro-babel-transformer" "0.74.85" chalk "^4.0.0" execa "^5.1.1" metro "^0.80.3" @@ -2288,6 +2357,11 @@ resolved "https://registry.yarnpkg.com/@react-native/debugger-frontend/-/debugger-frontend-0.74.84.tgz#0bde122a988916b6a50f05a7c3ab1c5db029b149" integrity sha512-YUEA03UNFbiYzHpYxlcS2D9+3eNT5YLGkl5yRg3nOSN6KbCc/OttGnNZme+tuSOJwjMN/vcvtDKYkTqjJw8U0A== +"@react-native/debugger-frontend@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/debugger-frontend/-/debugger-frontend-0.74.85.tgz#a7af94a7b81cb59f241fd1771d1b083445329700" + integrity sha512-gUIhhpsYLUTYWlWw4vGztyHaX/kNlgVspSvKe2XaPA7o3jYKUoNLc3Ov7u70u/MBWfKdcEffWq44eSe3j3s5JQ== + "@react-native/dev-middleware@0.74.84": version "0.74.84" resolved "https://registry.yarnpkg.com/@react-native/dev-middleware/-/dev-middleware-0.74.84.tgz#19ccfece791742f83f4c0a22a8c14593a45562a2" @@ -2307,23 +2381,42 @@ temp-dir "^2.0.0" ws "^6.2.2" -"@react-native/gradle-plugin@0.74.84": - version "0.74.84" - resolved "https://registry.yarnpkg.com/@react-native/gradle-plugin/-/gradle-plugin-0.74.84.tgz#6ff25fad5f78c276afde96ffc42e04e92d6d92b1" - integrity sha512-wYWC5WWXqzCCe4PDogz9pNc4xH5ZamahW5XGSbrrYJ5V3walZ+7z43V6iEBJkZbLjj9YBcSttkXYGr1Xh4veAg== +"@react-native/dev-middleware@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/dev-middleware/-/dev-middleware-0.74.85.tgz#eca35aceb882b1111385f7c20f1aad7a33a2734e" + integrity sha512-BRmgCK5vnMmHaKRO+h8PKJmHHH3E6JFuerrcfE3wG2eZ1bcSr+QTu8DAlpxsDWvJvHpCi8tRJGauxd+Ssj/c7w== + dependencies: + "@isaacs/ttlcache" "^1.4.1" + "@react-native/debugger-frontend" "0.74.85" + "@rnx-kit/chromium-edge-launcher" "^1.0.0" + chrome-launcher "^0.15.2" + connect "^3.6.5" + debug "^2.2.0" + node-fetch "^2.2.0" + nullthrows "^1.1.1" + open "^7.0.3" + selfsigned "^2.4.1" + serve-static "^1.13.1" + temp-dir "^2.0.0" + ws "^6.2.2" -"@react-native/js-polyfills@0.74.84": - version "0.74.84" - resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.74.84.tgz#edf0e8463616a2683269bbfe3957590f7ebd910c" - integrity sha512-+PgxuUjBw9JVlz6m4ECsIJMLbDopnr4rpLmsG32hQaJrg0wMuvHtsgAY/J/aVCSG2GNUXexfjrnhc+O9yGOZXQ== +"@react-native/gradle-plugin@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/gradle-plugin/-/gradle-plugin-0.74.85.tgz#7c7d16655a4c15da87402ae3f7d6566466aea723" + integrity sha512-1VQSLukJzaVMn1MYcs8Weo1nUW8xCas2XU1KuoV7OJPk6xPnEBFJmapmEGP5mWeEy7kcTXJmddEgy1wwW0tcig== -"@react-native/metro-babel-transformer@0.74.84": - version "0.74.84" - resolved "https://registry.yarnpkg.com/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.74.84.tgz#6c2c1632bdf557f176c9d489fbb676522ffb222a" - integrity sha512-YtVGq7jkgyUECv5yt4BOFbOXyW4ddUn8+dnwGGpJKdfhXYL5o5++AxNdE+2x+SZdkj3JUVekGKPwRabFECABaw== +"@react-native/js-polyfills@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.74.85.tgz#1abfeeaec5ff24b6a1b3e2296e760359fce47739" + integrity sha512-gp4Rg9le3lVZeW7Cie6qLfekvRKZuhJ3LKgi1SFB4N154z1wIclypAJXVXgWBsy8JKJfTwRI+sffC4qZDlvzrg== + +"@react-native/metro-babel-transformer@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.74.85.tgz#d530d9a6bd319ece226a2d6aaa00b464a1928089" + integrity sha512-JIrXqEwhTvWPtGArgMptIPGstMdXQIkwSjKVYt+7VC4a9Pw1GurIWanIJheEW6ZuCVvTc0VZkwglFz9JVjzDjA== dependencies: "@babel/core" "^7.20.0" - "@react-native/babel-preset" "0.74.84" + "@react-native/babel-preset" "0.74.85" hermes-parser "0.19.1" nullthrows "^1.1.1" @@ -2337,10 +2430,15 @@ resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.74.84.tgz#4764d59775c17a6ed193509cb01ae2f42dd5c045" integrity sha512-Y5W6x8cC5RuakUcTVUFNAIhUZ/tYpuqHZlRBoAuakrTwVuoNHXfQki8lj1KsYU7rW6e3VWgdEx33AfOQpdNp6A== -"@react-native/virtualized-lists@0.74.84": - version "0.74.84" - resolved "https://registry.yarnpkg.com/@react-native/virtualized-lists/-/virtualized-lists-0.74.84.tgz#cf32fffc93072942532c9c81bd7e4c01a2949626" - integrity sha512-XcV+qdqt2WihaY4iRm/M1FdSy+18lecU9mRXNmy9YK8g9Th/8XbNtmmKI0qWBx3KxyuXMH/zd0ps05YTrX16kw== +"@react-native/normalize-colors@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.74.85.tgz#62bcb9ab1b10b822ca0278fdfdf23d3b18e125da" + integrity sha512-pcE4i0X7y3hsAE0SpIl7t6dUc0B0NZLd1yv7ssm4FrLhWG+CGyIq4eFDXpmPU1XHmL5PPySxTAjEMiwv6tAmOw== + +"@react-native/virtualized-lists@0.74.85": + version "0.74.85" + resolved "https://registry.yarnpkg.com/@react-native/virtualized-lists/-/virtualized-lists-0.74.85.tgz#a6178c7168953807b3b610c9f8d208a6f758407d" + integrity sha512-jx2Zw0qlZteoQ+0KxRc7s4drsljLBEP534FaNZ950e9+CN9nVkLsV6rigcTjDR8wjKMSBWhKf0C0C3egYz7Ehg== dependencies: invariant "^2.2.4" nullthrows "^1.1.1" @@ -4054,10 +4152,10 @@ expo-image-manipulator@~12.0.5: dependencies: expo-image-loader "~4.7.0" -expo-image-picker@~15.0.6: - version "15.0.6" - resolved "https://registry.yarnpkg.com/expo-image-picker/-/expo-image-picker-15.0.6.tgz#7adf19d0e8beff7327c269d93d5b4d5c3cc71916" - integrity sha512-WckDXKlvOwywOr5twCOyqTDwEhYHD2ty6k8V2qCWbHHKEVe6C0iGFQgHHIPFKY4E1yhlEADg1UMTt0mnhV2A9Q== +expo-image-picker@~15.0.7: + version "15.0.7" + resolved "https://registry.yarnpkg.com/expo-image-picker/-/expo-image-picker-15.0.7.tgz#eb25abfdb03cb940f0418add3d9814439526b025" + integrity sha512-u8qiPZNfDb+ap6PJ8pq2iTO7JKX+ikAUQ0K0c7gXGliKLxoXgDdDmXxz9/6QdICTshJBJlBvI0MwY5NWu7A/uw== dependencies: expo-image-loader "~4.7.0" @@ -6740,22 +6838,22 @@ react-native-web@~0.19.6: postcss-value-parser "^4.2.0" styleq "^0.1.3" -react-native@0.74.2: - version "0.74.2" - resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.74.2.tgz#172e64e4e79861e2b3da99b86999e4a4c55b8321" - integrity sha512-EBMBjPPL4/GjHMP4NqsZabT3gI5WU9cSmduABGAGrd8uIcmTZ5F2Ng9k6gFmRm7n8e8CULxDNu98ZpQfBjl7Bw== +react-native@0.74.3: + version "0.74.3" + resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.74.3.tgz#eef32cd10afb1f4b26f75b79eefd6b220c63953c" + integrity sha512-UFutCC6WEw6HkxlcpQ2BemKqi0JkwrgDchYB5Svi8Sp4Xwt4HA6LGEjNQgZ+3KM44bjyFRpofQym0uh0jACGng== dependencies: "@jest/create-cache-key-function" "^29.6.3" - "@react-native-community/cli" "13.6.8" - "@react-native-community/cli-platform-android" "13.6.8" - "@react-native-community/cli-platform-ios" "13.6.8" - "@react-native/assets-registry" "0.74.84" - "@react-native/codegen" "0.74.84" - "@react-native/community-cli-plugin" "0.74.84" - "@react-native/gradle-plugin" "0.74.84" - "@react-native/js-polyfills" "0.74.84" - "@react-native/normalize-colors" "0.74.84" - "@react-native/virtualized-lists" "0.74.84" + "@react-native-community/cli" "13.6.9" + "@react-native-community/cli-platform-android" "13.6.9" + "@react-native-community/cli-platform-ios" "13.6.9" + "@react-native/assets-registry" "0.74.85" + "@react-native/codegen" "0.74.85" + "@react-native/community-cli-plugin" "0.74.85" + "@react-native/gradle-plugin" "0.74.85" + "@react-native/js-polyfills" "0.74.85" + "@react-native/normalize-colors" "0.74.85" + "@react-native/virtualized-lists" "0.74.85" abort-controller "^3.0.0" anser "^1.4.9" ansi-regex "^5.0.0" diff --git a/examples/SampleApp/ios/Podfile.lock b/examples/SampleApp/ios/Podfile.lock index 4551c7f1c..06902023a 100644 --- a/examples/SampleApp/ios/Podfile.lock +++ b/examples/SampleApp/ios/Podfile.lock @@ -1048,6 +1048,10 @@ PODS: - React-Core - react-native-document-picker (9.3.0): - React-Core + - react-native-image-picker (7.1.2): + - glog + - RCT-Folly (= 2022.05.16.00) + - React-Core - react-native-image-resizer (3.0.10): - React-Core - react-native-netinfo (11.3.2): @@ -1251,15 +1255,6 @@ PODS: - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - RNImageCropPicker (0.41.2): - - React-Core - - React-RCTImage - - RNImageCropPicker/QBImagePickerController (= 0.41.2) - - TOCropViewController (~> 2.7.4) - - RNImageCropPicker/QBImagePickerController (0.41.2): - - React-Core - - React-RCTImage - - TOCropViewController (~> 2.7.4) - RNNotifee (7.8.2): - React-Core - RNNotifee/NotifeeCore (= 7.8.2) @@ -1288,7 +1283,6 @@ PODS: - libwebp (~> 1.0) - SDWebImage/Core (~> 5.10) - SocketRocket (0.6.1) - - TOCropViewController (2.7.4) - Yoga (1.14.0) DEPENDENCIES: @@ -1329,6 +1323,7 @@ DEPENDENCIES: - react-native-blob-util (from `../node_modules/react-native-blob-util`) - "react-native-cameraroll (from `../node_modules/@react-native-camera-roll/camera-roll`)" - react-native-document-picker (from `../node_modules/react-native-document-picker`) + - react-native-image-picker (from `../node_modules/react-native-image-picker`) - "react-native-image-resizer (from `../node_modules/@bam.tech/react-native-image-resizer`)" - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) @@ -1359,7 +1354,6 @@ DEPENDENCIES: - "RNFBApp (from `../node_modules/@react-native-firebase/app`)" - "RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`)" - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - - RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`) - "RNNotifee (from `../node_modules/@notifee/react-native`)" - RNReactNativeHapticFeedback (from `../node_modules/react-native-haptic-feedback`) - RNReanimated (from `../node_modules/react-native-reanimated`) @@ -1392,7 +1386,6 @@ SPEC REPOS: - SDWebImage - SDWebImageWebPCoder - SocketRocket - - TOCropViewController EXTERNAL SOURCES: boost: @@ -1458,6 +1451,8 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-camera-roll/camera-roll" react-native-document-picker: :path: "../node_modules/react-native-document-picker" + react-native-image-picker: + :path: "../node_modules/react-native-image-picker" react-native-image-resizer: :path: "../node_modules/@bam.tech/react-native-image-resizer" react-native-netinfo: @@ -1518,8 +1513,6 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-firebase/messaging" RNGestureHandler: :path: "../node_modules/react-native-gesture-handler" - RNImageCropPicker: - :path: "../node_modules/react-native-image-crop-picker" RNNotifee: :path: "../node_modules/@notifee/react-native" RNReactNativeHapticFeedback: @@ -1586,6 +1579,7 @@ SPEC CHECKSUMS: react-native-blob-util: 18b510205c080a453574a7d2344d64673d0ad9af react-native-cameraroll: ecc2a7301b75d1793fb364fd9771c7ed207bfa59 react-native-document-picker: 5b97e24a7f1a1e4a50a72c540a043f32d29a70a2 + react-native-image-picker: 7c3a279e7a518628910f2ea02917bd3b90049465 react-native-image-resizer: fd0c333eca55147bd55c5e054cac95dcd0da6814 react-native-netinfo: 076df4f9b07f6670acf4ce9a75aac8d34c2e2ccc react-native-safe-area-context: 422017db8bcabbada9ad607d010996c56713234c @@ -1616,7 +1610,6 @@ SPEC CHECKSUMS: RNFBApp: 1c8688e63b58bb57e6a6e9032aa227f8df8371bf RNFBMessaging: 9b16c72d001787aca05e2fb997e5c979b821dbb4 RNGestureHandler: 2e3251b41d462552997c61afd680220d019fea65 - RNImageCropPicker: 771e2ca319d2cf92e04ebf334ece892ee9a6728f RNNotifee: 8e2d3df3f0e9ce8f5d1fe4c967431138190b6175 RNReactNativeHapticFeedback: ec56a5f81c3941206fd85625fa669ffc7b4545f9 RNReanimated: 440ca83ef0a79a3376455663fc4a01300e131240 @@ -1626,7 +1619,6 @@ SPEC CHECKSUMS: SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 - TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654 Yoga: 9e6a04eacbd94f97d94577017e9f23b3ab41cf6c PODFILE CHECKSUM: 35eaf6ce44604be195e8eb15532275b5a777ac32 diff --git a/examples/SampleApp/package.json b/examples/SampleApp/package.json index 617642bfc..bfcda8eb7 100644 --- a/examples/SampleApp/package.json +++ b/examples/SampleApp/package.json @@ -42,7 +42,7 @@ "react-native-fast-image": "^8.6.3", "react-native-gesture-handler": "^2.14.0", "react-native-haptic-feedback": "^2.2.0", - "react-native-image-crop-picker": "^0.41.2", + "react-native-image-picker": "^7.1.2", "react-native-reanimated": "^3.7.0", "react-native-safe-area-context": "^4.10.7", "react-native-screens": "^3.32.0", diff --git a/examples/SampleApp/yarn.lock b/examples/SampleApp/yarn.lock index 503f9839a..88259f4de 100644 --- a/examples/SampleApp/yarn.lock +++ b/examples/SampleApp/yarn.lock @@ -6306,10 +6306,10 @@ react-native-haptic-feedback@^2.2.0: resolved "https://registry.yarnpkg.com/react-native-haptic-feedback/-/react-native-haptic-feedback-2.2.0.tgz#bc46edd1f053265bfbe6c32487cbce074e099429" integrity sha512-3tqJOjCguWhIrX0nkURn4yw6kXdsSDjjrvZCRjKXYGlL28hdQmoW2okAHduDTD9FWj9lA+lHgwFWgGs4aFNN7A== -react-native-image-crop-picker@^0.41.2: - version "0.41.2" - resolved "https://registry.yarnpkg.com/react-native-image-crop-picker/-/react-native-image-crop-picker-0.41.2.tgz#824fa8fee8391fbb3e0b5ae2973221a2dff0cafb" - integrity sha512-GcDu/adXU/1y/MrxsbOfqcGRGWC2pTttt5VGy/jyRJ6GXfoC29fTQf8SG5kGtc5schSR6K+mKYO4uW6eJPljlQ== +react-native-image-picker@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/react-native-image-picker/-/react-native-image-picker-7.1.2.tgz#383849d1953caf4578874a1f5e5dd11c737bd5cd" + integrity sha512-b5y5nP60RIPxlAXlptn2QwlIuZWCUDWa/YPUVjgHc0Ih60mRiOg1PSzf0IjHSLeOZShCpirpvSPGnDExIpTRUg== react-native-lightbox@^0.7.0: version "0.7.0" diff --git a/examples/TypeScriptMessaging/ios/Podfile.lock b/examples/TypeScriptMessaging/ios/Podfile.lock index a9eb474d7..250f88398 100644 --- a/examples/TypeScriptMessaging/ios/Podfile.lock +++ b/examples/TypeScriptMessaging/ios/Podfile.lock @@ -961,6 +961,10 @@ PODS: - React-Core - react-native-flipper (0.212.0): - React-Core + - react-native-image-picker (7.1.2): + - glog + - RCT-Folly (= 2022.05.16.00) + - React-Core - react-native-image-resizer (3.0.10): - React-Core - react-native-netinfo (11.3.2): @@ -1152,15 +1156,6 @@ PODS: - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - RNImageCropPicker (0.41.2): - - React-Core - - React-RCTImage - - RNImageCropPicker/QBImagePickerController (= 0.41.2) - - TOCropViewController (~> 2.7.4) - - RNImageCropPicker/QBImagePickerController (0.41.2): - - React-Core - - React-RCTImage - - TOCropViewController (~> 2.7.4) - RNReactNativeHapticFeedback (2.2.0): - React-Core - RNReanimated (3.7.1): @@ -1178,7 +1173,6 @@ PODS: - RNSVG (14.1.0): - React-Core - SocketRocket (0.6.1) - - TOCropViewController (2.7.4) - Yoga (1.14.0) DEPENDENCIES: @@ -1239,6 +1233,7 @@ DEPENDENCIES: - "react-native-cameraroll (from `../node_modules/@react-native-camera-roll/camera-roll`)" - react-native-document-picker (from `../node_modules/react-native-document-picker`) - react-native-flipper (from `../node_modules/react-native-flipper`) + - react-native-image-picker (from `../node_modules/react-native-image-picker`) - "react-native-image-resizer (from `../node_modules/@bam.tech/react-native-image-resizer`)" - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) @@ -1266,7 +1261,6 @@ DEPENDENCIES: - RNAudioRecorderPlayer (from `../node_modules/react-native-audio-recorder-player`) - "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)" - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - - RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`) - RNReactNativeHapticFeedback (from `../node_modules/react-native-haptic-feedback`) - RNReanimated (from `../node_modules/react-native-reanimated`) - RNScreens (from `../node_modules/react-native-screens`) @@ -1291,7 +1285,6 @@ SPEC REPOS: - PromisesObjC - PromisesSwift - SocketRocket - - TOCropViewController EXTERNAL SOURCES: boost: @@ -1359,6 +1352,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-document-picker" react-native-flipper: :path: "../node_modules/react-native-flipper" + react-native-image-picker: + :path: "../node_modules/react-native-image-picker" react-native-image-resizer: :path: "../node_modules/@bam.tech/react-native-image-resizer" react-native-netinfo: @@ -1413,8 +1408,6 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-clipboard/clipboard" RNGestureHandler: :path: "../node_modules/react-native-gesture-handler" - RNImageCropPicker: - :path: "../node_modules/react-native-image-crop-picker" RNReactNativeHapticFeedback: :path: "../node_modules/react-native-haptic-feedback" RNReanimated: @@ -1475,6 +1468,7 @@ SPEC CHECKSUMS: react-native-cameraroll: 433f793bc2eb3bcb65c9e166f4225eae7876d056 react-native-document-picker: 5b97e24a7f1a1e4a50a72c540a043f32d29a70a2 react-native-flipper: 9c1957af24b76493ba74f46d000a5c1d485e7731 + react-native-image-picker: d3db110a3ded6e48c93aef7e8e51afdde8b16ed0 react-native-image-resizer: fd0c333eca55147bd55c5e054cac95dcd0da6814 react-native-netinfo: 076df4f9b07f6670acf4ce9a75aac8d34c2e2ccc react-native-safe-area-context: 422017db8bcabbada9ad607d010996c56713234c @@ -1502,16 +1496,14 @@ SPEC CHECKSUMS: RNAudioRecorderPlayer: f790fc1afb118552ae6285d60adde52ee6b5d9ef RNCClipboard: 60fed4b71560d7bfe40e9d35dea9762b024da86d RNGestureHandler: 67fb54b3e6ca338a8044e85cd6f340265aa41091 - RNImageCropPicker: 771e2ca319d2cf92e04ebf334ece892ee9a6728f RNReactNativeHapticFeedback: ec56a5f81c3941206fd85625fa669ffc7b4545f9 RNReanimated: 15a855719335a6b655a214531e86d806edfd49da RNScreens: e842cdccb23c0a084bd6307f6fa83fd1c1738029 RNShare: 0fad69ae2d71de9d1f7b9a43acf876886a6cb99c RNSVG: ba3e7232f45e34b7b47e74472386cf4e1a676d0a SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 - TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654 Yoga: d17d2cc8105eed528474683b42e2ea310e1daf61 PODFILE CHECKSUM: 90406e1e85c82b37484f5d746afa45c0637bb4b3 -COCOAPODS: 1.14.3 +COCOAPODS: 1.15.2 diff --git a/examples/TypeScriptMessaging/package.json b/examples/TypeScriptMessaging/package.json index 0f8f52a53..d70cd77d3 100644 --- a/examples/TypeScriptMessaging/package.json +++ b/examples/TypeScriptMessaging/package.json @@ -26,7 +26,7 @@ "react-native-document-picker": "^9.3.0", "react-native-gesture-handler": "^2.14.0", "react-native-haptic-feedback": "^2.2.0", - "react-native-image-crop-picker": "^0.41.2", + "react-native-image-picker": "^7.1.2", "react-native-reanimated": "^3.7.0", "react-native-safe-area-context": "^4.10.7", "react-native-screens": "^3.32.0", diff --git a/examples/TypeScriptMessaging/yarn.lock b/examples/TypeScriptMessaging/yarn.lock index bbf89c585..ccb0ab2a4 100644 --- a/examples/TypeScriptMessaging/yarn.lock +++ b/examples/TypeScriptMessaging/yarn.lock @@ -6428,10 +6428,10 @@ react-native-haptic-feedback@^2.2.0: resolved "https://registry.yarnpkg.com/react-native-haptic-feedback/-/react-native-haptic-feedback-2.2.0.tgz#bc46edd1f053265bfbe6c32487cbce074e099429" integrity sha512-3tqJOjCguWhIrX0nkURn4yw6kXdsSDjjrvZCRjKXYGlL28hdQmoW2okAHduDTD9FWj9lA+lHgwFWgGs4aFNN7A== -react-native-image-crop-picker@^0.41.2: - version "0.41.2" - resolved "https://registry.yarnpkg.com/react-native-image-crop-picker/-/react-native-image-crop-picker-0.41.2.tgz#824fa8fee8391fbb3e0b5ae2973221a2dff0cafb" - integrity sha512-GcDu/adXU/1y/MrxsbOfqcGRGWC2pTttt5VGy/jyRJ6GXfoC29fTQf8SG5kGtc5schSR6K+mKYO4uW6eJPljlQ== +react-native-image-picker@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/react-native-image-picker/-/react-native-image-picker-7.1.2.tgz#383849d1953caf4578874a1f5e5dd11c737bd5cd" + integrity sha512-b5y5nP60RIPxlAXlptn2QwlIuZWCUDWa/YPUVjgHc0Ih60mRiOg1PSzf0IjHSLeOZShCpirpvSPGnDExIpTRUg== react-native-lightbox@^0.7.0: version "0.7.0" diff --git a/package/expo-package/package.json b/package/expo-package/package.json index 1492fb778..5ad7ca1dd 100644 --- a/package/expo-package/package.json +++ b/package/expo-package/package.json @@ -37,6 +37,9 @@ "expo-file-system": { "optional": true }, + "expo-image-picker": { + "optional": true + }, "expo-sharing": { "optional": true }, @@ -47,7 +50,6 @@ "devDependencies": { "expo": "^51.0.17", "expo-image-manipulator": "^12.0.5", - "expo-image-picker": "^15.0.6", "expo-media-library": "^16.0.4" }, "scripts": { diff --git a/package/expo-package/src/handlers/index.ts b/package/expo-package/src/handlers/index.ts index 03cb36ba3..cabc4175f 100644 --- a/package/expo-package/src/handlers/index.ts +++ b/package/expo-package/src/handlers/index.ts @@ -3,4 +3,3 @@ export * from './getLocalAssetUri'; export * from './getPhotos'; export * from './iOS14RefreshGallerySelection'; export * from './oniOS14GalleryLibrarySelectionChange'; -export * from './takePhoto'; diff --git a/package/expo-package/src/handlers/takePhoto.ts b/package/expo-package/src/handlers/takePhoto.ts deleted file mode 100644 index b30d351ef..000000000 --- a/package/expo-package/src/handlers/takePhoto.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { Image, Platform } from 'react-native'; - -import * as ImagePicker from 'expo-image-picker'; - -type Size = { - height?: number; - width?: number; -}; - -export const takePhoto = async ({ compressImageQuality = 1 }) => { - try { - const permissionCheck = await ImagePicker.getCameraPermissionsAsync(); - const canRequest = permissionCheck.canAskAgain; - let permissionGranted = permissionCheck.granted; - if (!permissionGranted) { - if (canRequest) { - const response = await ImagePicker.requestCameraPermissionsAsync(); - permissionGranted = response.granted; - } else { - return { askToOpenSettings: true, cancelled: true }; - } - } - - if (permissionGranted) { - const imagePickerSuccessResult = await ImagePicker.launchCameraAsync({ - quality: Math.min(Math.max(0, compressImageQuality), 1), - }); - const canceled = imagePickerSuccessResult.canceled; - const assets = imagePickerSuccessResult.assets; - // since we only support single photo upload for now we will only be focusing on 0'th element. - const photo = assets && assets[0]; - - if (canceled === false && photo && photo.height && photo.width && photo.uri) { - let size: Size = {}; - 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 => - new Promise((resolve) => { - Image.getSize(photo.uri, (width, height) => { - resolve({ height, width }); - }); - }); - - try { - const { height, width } = await getSize(); - size.height = height; - size.width = width; - } catch (e) { - console.warn('Error get image size of picture caputred from camera ', e); - } - } else { - size = { - height: photo.height, - width: photo.width, - }; - } - - return { - cancelled: false, - source: 'camera', - uri: photo.uri, - ...size, - }; - } - } - } catch (error) { - console.log(error); - } - return { cancelled: true }; -}; diff --git a/package/expo-package/src/index.js b/package/expo-package/src/index.js index 662400aca..90c3bba97 100644 --- a/package/expo-package/src/index.js +++ b/package/expo-package/src/index.js @@ -6,7 +6,6 @@ import { getPhotos, iOS14RefreshGallerySelection, oniOS14GalleryLibrarySelectionChange, - takePhoto, } from './handlers'; import { @@ -17,6 +16,7 @@ import { setClipboardString, shareImage, Sound, + takePhoto, triggerHaptic, Video, } from './optionalDependencies'; diff --git a/package/expo-package/src/optionalDependencies/index.ts b/package/expo-package/src/optionalDependencies/index.ts index 808bd3655..f53118944 100644 --- a/package/expo-package/src/optionalDependencies/index.ts +++ b/package/expo-package/src/optionalDependencies/index.ts @@ -7,3 +7,4 @@ export * from './saveFile'; export * from './Audio'; export * from './Sound'; export * from './Video'; +export * from './takePhoto'; diff --git a/package/expo-package/src/optionalDependencies/takePhoto.ts b/package/expo-package/src/optionalDependencies/takePhoto.ts new file mode 100644 index 000000000..2fed2c85f --- /dev/null +++ b/package/expo-package/src/optionalDependencies/takePhoto.ts @@ -0,0 +1,88 @@ +import { Image, Platform } from 'react-native'; + +let ImagePicker; + +try { + ImagePicker = require('expo-image-picker'); +} catch (e) { + // do nothing +} + +if (!ImagePicker) { + console.log( + 'expo-image-picker is not installed. Installing this package will enable campturing photos through the app, and thereby send it.', + ); +} + +type Size = { + height?: number; + width?: number; +}; + +export const takePhoto = ImagePicker + ? async ({ compressImageQuality = 1 }) => { + try { + const permissionCheck = await ImagePicker.getCameraPermissionsAsync(); + const canRequest = permissionCheck.canAskAgain; + let permissionGranted = permissionCheck.granted; + if (!permissionGranted) { + if (canRequest) { + const response = await ImagePicker.requestCameraPermissionsAsync(); + permissionGranted = response.granted; + } else { + return { askToOpenSettings: true, cancelled: true }; + } + } + + if (permissionGranted) { + const imagePickerSuccessResult = await ImagePicker.launchCameraAsync({ + quality: Math.min(Math.max(0, compressImageQuality), 1), + }); + const canceled = imagePickerSuccessResult.canceled; + const assets = imagePickerSuccessResult.assets; + // since we only support single photo upload for now we will only be focusing on 0'th element. + const photo = assets && assets[0]; + + if (canceled === false && photo && photo.height && photo.width && photo.uri) { + let size: Size = {}; + 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 => + new Promise((resolve) => { + Image.getSize(photo.uri, (width, height) => { + resolve({ height, width }); + }); + }); + + try { + const { height, width } = await getSize(); + size.height = height; + size.width = width; + } catch (e) { + console.warn('Error get image size of picture caputred from camera ', e); + } + } else { + size = { + height: photo.height, + width: photo.width, + }; + } + + return { + cancelled: false, + source: 'camera', + uri: photo.uri, + ...size, + }; + } + } + } catch (error) { + console.log(error); + } + return { cancelled: true }; + } + : null; diff --git a/package/expo-package/src/optionalDependencies/triggerHaptic.ts b/package/expo-package/src/optionalDependencies/triggerHaptic.ts index e385bf3ec..fbe8cae4c 100644 --- a/package/expo-package/src/optionalDependencies/triggerHaptic.ts +++ b/package/expo-package/src/optionalDependencies/triggerHaptic.ts @@ -45,5 +45,4 @@ export const triggerHaptic = Haptics Haptics.selectionAsync(); } } - : // eslint-disable-next-line @typescript-eslint/no-empty-function - () => {}; + : () => {}; diff --git a/package/expo-package/yarn.lock b/package/expo-package/yarn.lock index e339b127d..0753e649e 100644 --- a/package/expo-package/yarn.lock +++ b/package/expo-package/yarn.lock @@ -2839,13 +2839,6 @@ expo-image-manipulator@^12.0.5: dependencies: expo-image-loader "~4.7.0" -expo-image-picker@^15.0.6: - version "15.0.6" - resolved "https://registry.yarnpkg.com/expo-image-picker/-/expo-image-picker-15.0.6.tgz#7adf19d0e8beff7327c269d93d5b4d5c3cc71916" - integrity sha512-WckDXKlvOwywOr5twCOyqTDwEhYHD2ty6k8V2qCWbHHKEVe6C0iGFQgHHIPFKY4E1yhlEADg1UMTt0mnhV2A9Q== - dependencies: - expo-image-loader "~4.7.0" - expo-keep-awake@~13.0.2: version "13.0.2" resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-13.0.2.tgz#5ef31311a339671eec9921b934fdd90ab9652b0e" diff --git a/package/native-package/package.json b/package/native-package/package.json index e218fd2a4..a69b1a099 100644 --- a/package/native-package/package.json +++ b/package/native-package/package.json @@ -22,7 +22,7 @@ "react-native-blob-util": ">=0.19.9", "react-native-document-picker": ">=9.3.0", "react-native-haptic-feedback": ">=2.2.0", - "react-native-image-crop-picker": ">=0.41.2", + "react-native-image-picker": ">=7.1.2", "react-native-share": ">=10.2.1", "react-native-video": ">=5.2.1" }, @@ -39,6 +39,9 @@ "react-native-haptic-feedback": { "optional": true }, + "react-native-image-picker": { + "optional": true + }, "react-native-audio-recorder-player": { "optional": true }, @@ -56,7 +59,6 @@ "devDependencies": { "@bam.tech/react-native-image-resizer": "^3.0.10", "@react-native-camera-roll/camera-roll": "^7.8.0", - "react-native": "^0.73.6", - "react-native-image-crop-picker": "^0.41.2" + "react-native": "^0.73.6" } } diff --git a/package/native-package/src/handlers/index.ts b/package/native-package/src/handlers/index.ts index e6e7c6ac3..90427c7c5 100644 --- a/package/native-package/src/handlers/index.ts +++ b/package/native-package/src/handlers/index.ts @@ -1,6 +1,5 @@ export * from './compressImage'; export * from './getLocalAssetUri'; export * from './getPhotos'; -export * from './takePhoto'; export * from './oniOS14GalleryLibrarySelectionChange'; export * from './iOS14RefreshGallerySelection'; diff --git a/package/native-package/src/handlers/takePhoto.ts b/package/native-package/src/handlers/takePhoto.ts deleted file mode 100644 index 344b21529..000000000 --- a/package/native-package/src/handlers/takePhoto.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { AppState, Image, PermissionsAndroid, Platform } from 'react-native'; -import ImagePicker from 'react-native-image-crop-picker'; - -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) { - return { cancelled: true }; - } else if (androidPermissionStatus === PermissionsAndroid.RESULTS.NEVER_ASK_AGAIN) { - return { askToOpenSettings: true, 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); - } - } else { - size = { - height: photo.height, - width: photo.width, - }; - } - return { - cancelled: false, - source: 'camera', - uri: photo.path, - ...size, - }; - } - } catch (e: unknown) { - 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 }; - } - } - } - } - - return { cancelled: true }; -}; diff --git a/package/native-package/src/index.js b/package/native-package/src/index.js index b8880b347..d072e2ab3 100644 --- a/package/native-package/src/index.js +++ b/package/native-package/src/index.js @@ -8,7 +8,6 @@ import { getPhotos, iOS14RefreshGallerySelection, oniOS14GalleryLibrarySelectionChange, - takePhoto, } from './handlers'; import { @@ -19,6 +18,7 @@ import { setClipboardString, shareImage, Sound, + takePhoto, triggerHaptic, Video, } from './optionalDependencies'; diff --git a/package/native-package/src/optionalDependencies/index.ts b/package/native-package/src/optionalDependencies/index.ts index fde8d5568..fcb4eb640 100644 --- a/package/native-package/src/optionalDependencies/index.ts +++ b/package/native-package/src/optionalDependencies/index.ts @@ -7,3 +7,4 @@ export * from './pickDocument'; export * from './saveFile'; export * from './deleteFile'; export * from './Sound'; +export * from './takePhoto'; diff --git a/package/native-package/src/optionalDependencies/takePhoto.ts b/package/native-package/src/optionalDependencies/takePhoto.ts new file mode 100644 index 000000000..f91b477ad --- /dev/null +++ b/package/native-package/src/optionalDependencies/takePhoto.ts @@ -0,0 +1,89 @@ +import { AppState, Image, PermissionsAndroid, Platform } from 'react-native'; + +let ImagePicker; + +try { + ImagePicker = require('react-native-image-picker'); +} catch (e) { + console.log('react-native-image-picker is not installed'); +} + +export const takePhoto = ImagePicker + ? 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) { + return { cancelled: true }; + } else if (androidPermissionStatus === PermissionsAndroid.RESULTS.NEVER_ASK_AGAIN) { + return { askToOpenSettings: true, cancelled: true }; + } + } + } + try { + const result = await ImagePicker.launchCamera({ + quality: Math.min(Math.max(0, compressImageQuality), 1), + }); + if (!result.assets.length) { + return { + cancelled: true, + }; + } + const photo = result.assets[0]; + if (photo.height && photo.width && photo.uri) { + 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.uri, (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); + } + } else { + size = { + height: photo.height, + width: photo.width, + }; + } + return { + cancelled: false, + source: 'camera', + uri: photo.uri, + ...size, + }; + } + } catch (e: unknown) { + 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 }; + } + } + } + } + + return { cancelled: true }; + } + : null; diff --git a/package/native-package/yarn.lock b/package/native-package/yarn.lock index 98d06a66f..d4b68c802 100644 --- a/package/native-package/yarn.lock +++ b/package/native-package/yarn.lock @@ -3541,11 +3541,6 @@ 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-image-crop-picker@^0.41.2: - version "0.41.2" - resolved "https://registry.yarnpkg.com/react-native-image-crop-picker/-/react-native-image-crop-picker-0.41.2.tgz#824fa8fee8391fbb3e0b5ae2973221a2dff0cafb" - integrity sha512-GcDu/adXU/1y/MrxsbOfqcGRGWC2pTttt5VGy/jyRJ6GXfoC29fTQf8SG5kGtc5schSR6K+mKYO4uW6eJPljlQ== - react-native-lightbox@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/react-native-lightbox/-/react-native-lightbox-0.7.0.tgz#e52b4d7fcc141f59d7b23f0180de535e35b20ec9" diff --git a/package/src/components/Attachment/Attachment.tsx b/package/src/components/Attachment/Attachment.tsx index 85a3faa99..1616c38fc 100644 --- a/package/src/components/Attachment/Attachment.tsx +++ b/package/src/components/Attachment/Attachment.tsx @@ -11,7 +11,7 @@ import { MessagesContextValue, useMessagesContext, } from '../../contexts/messagesContext/MessagesContext'; -import { Video } from '../../native'; +import { isVideoPlayerAvailable } from '../../native'; import type { DefaultStreamChatGenerics } from '../../types/types'; @@ -75,7 +75,7 @@ const AttachmentWithContext = < } if (attachment.type === 'video' && !attachment.og_scrape_url) { - return Video ? ( + return isVideoPlayerAvailable() ? ( <> {hasAttachmentActions && ( diff --git a/package/src/components/Attachment/Gallery.tsx b/package/src/components/Attachment/Gallery.tsx index 56dc5e23b..15e31ebc5 100644 --- a/package/src/components/Attachment/Gallery.tsx +++ b/package/src/components/Attachment/Gallery.tsx @@ -31,7 +31,7 @@ import { } from '../../contexts/overlayContext/OverlayContext'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; import { useLoadingImage } from '../../hooks/useLoadingImage'; -import { Video } from '../../native'; +import { isVideoPlayerAvailable } from '../../native'; import type { DefaultStreamChatGenerics } from '../../types/types'; import { getUrlWithoutParams } from '../../utils/utils'; @@ -311,7 +311,7 @@ const GalleryThumbnail = < const defaultOnPress = () => { // If the url is defined then only try to open the file. if (thumbnail.url) { - if (thumbnail.type === 'video' && !Video) { + if (thumbnail.type === 'video' && !isVideoPlayerAvailable()) { // This condition is kinda unreachable, since we render videos as file attachment if the video // library is not installed. But doesn't hurt to have extra safeguard, in case of some customizations. openUrlSafely(thumbnail.url); diff --git a/package/src/components/Attachment/__tests__/Attachment.test.js b/package/src/components/Attachment/__tests__/Attachment.test.js index 3c8c01e11..5b4f72651 100644 --- a/package/src/components/Attachment/__tests__/Attachment.test.js +++ b/package/src/components/Attachment/__tests__/Attachment.test.js @@ -21,7 +21,7 @@ import { Attachment } from '../Attachment'; import { AttachmentActions } from '../AttachmentActions'; jest.mock('../../../native.ts', () => ({ - Video: null, + isVideoPlayerAvailable: jest.fn(() => false), })); const getAttachmentComponent = (props) => { diff --git a/package/src/components/AttachmentPicker/components/AttachmentPickerSelectionBar.tsx b/package/src/components/AttachmentPicker/components/AttachmentPickerSelectionBar.tsx index 12419744f..e95bbe9a2 100644 --- a/package/src/components/AttachmentPicker/components/AttachmentPickerSelectionBar.tsx +++ b/package/src/components/AttachmentPicker/components/AttachmentPickerSelectionBar.tsx @@ -32,7 +32,14 @@ export const AttachmentPickerSelectionBar = () => { } = useAttachmentPickerContext(); const { t } = useTranslationContext(); - const { compressImageQuality, hasFilePicker, imageUploads, pickFile } = useMessageInputContext(); + const { + compressImageQuality, + hasCameraPicker, + hasFilePicker, + hasImagePicker, + imageUploads, + pickFile, + } = useMessageInputContext(); const { theme: { @@ -76,18 +83,20 @@ export const AttachmentPickerSelectionBar = () => { return ( - setPicker('images')} - testID='upload-photo-touchable' - > - - - - + {hasImagePicker && ( + setPicker('images')} + testID='upload-photo-touchable' + > + + + + + )} {hasFilePicker && ( { )} - - - - - + {hasCameraPicker ? ( + + + + + + ) : null} ); }; diff --git a/package/src/components/Channel/Channel.tsx b/package/src/components/Channel/Channel.tsx index aad5a102a..2932cd4dc 100644 --- a/package/src/components/Channel/Channel.tsx +++ b/package/src/components/Channel/Channel.tsx @@ -81,7 +81,11 @@ import { ThumbsUpReaction, WutReaction, } from '../../icons'; -import { pickDocument } from '../../native'; +import { + isAudioRecorderAvailable, + isDocumentPickerAvailable, + isImagePickerAvailable, +} from '../../native'; import * as dbApi from '../../store/apis'; import type { DefaultStreamChatGenerics } from '../../types/types'; import { addReactionToLocalState } from '../../utils/addReactionToLocalState'; @@ -439,7 +443,7 @@ const ChannelWithContext = < AudioAttachment = AudioAttachmentDefault, AudioAttachmentUploadPreview = AudioAttachmentDefault, AudioRecorder = AudioRecorderDefault, - audioRecordingEnabled = false, + audioRecordingEnabled = isAudioRecorderAvailable(), AudioRecordingInProgress = AudioRecordingInProgressDefault, AudioRecordingLockIndicator = AudioRecordingLockIndicatorDefault, AudioRecordingPreview = AudioRecordingPreviewDefault, @@ -497,9 +501,10 @@ const ChannelWithContext = < handleReaction, handleRetry, handleThreadReply, + hasCameraPicker = isImagePickerAvailable(), hasCommands = true, // If pickDocument isn't available, default to hiding the file picker - hasFilePicker = pickDocument !== null, + hasFilePicker = isDocumentPickerAvailable(), hasImagePicker = true, hideDateSeparators = false, hideStickyDateHeader = false, @@ -2232,6 +2237,7 @@ const ChannelWithContext = < editMessage, emojiSearchIndex, FileUploadPreview, + hasCameraPicker, hasCommands, hasFilePicker, hasImagePicker, diff --git a/package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts b/package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts index f633a2ad1..915a8ce46 100644 --- a/package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +++ b/package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts @@ -34,6 +34,7 @@ export const useCreateInputMessageInputContext = < editMessage, emojiSearchIndex, FileUploadPreview, + hasCameraPicker, hasCommands, hasFilePicker, hasImagePicker, @@ -99,6 +100,7 @@ export const useCreateInputMessageInputContext = < editMessage, emojiSearchIndex, FileUploadPreview, + hasCameraPicker, hasCommands, hasFilePicker, hasImagePicker, diff --git a/package/src/components/ImageGallery/ImageGallery.tsx b/package/src/components/ImageGallery/ImageGallery.tsx index ca76d87ad..b46c90e3a 100644 --- a/package/src/components/ImageGallery/ImageGallery.tsx +++ b/package/src/components/ImageGallery/ImageGallery.tsx @@ -40,7 +40,7 @@ import { useImageGalleryContext } from '../../contexts/imageGalleryContext/Image import { OverlayProviderProps } from '../../contexts/overlayContext/OverlayContext'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; import { useViewport } from '../../hooks/useViewport'; -import { Video, VideoType } from '../../native'; +import { isVideoPlayerAvailable, VideoType } from '../../native'; import type { DefaultStreamChatGenerics } from '../../types/types'; import { getResizedImageUrl } from '../../utils/getResizedImageUrl'; import { getUrlOfImageAttachment } from '../../utils/getUrlOfImageAttachment'; @@ -229,7 +229,7 @@ export const ImageGallery = < !attachment.title_link && !attachment.og_scrape_url && getUrlOfImageAttachment(attachment)) || - (Video && attachment.type === 'video'), + (isVideoPlayerAvailable() && attachment.type === 'video'), ) .reverse() || []; diff --git a/package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx b/package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx index dd84a9dcb..1b866b239 100644 --- a/package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +++ b/package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx @@ -24,6 +24,9 @@ import { ImageGallery } from '../ImageGallery'; jest.mock('../../../native.ts', () => { const View = require('react-native/Libraries/Components/View/View'); return { + isFileSystemAvailable: jest.fn(() => true), + isShareImageAvailable: jest.fn(() => true), + isVideoPlayerAvailable: jest.fn(() => true), Video: View, }; }); diff --git a/package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx b/package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx index e56892963..0058ca13b 100644 --- a/package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +++ b/package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx @@ -28,6 +28,9 @@ jest.mock('../../../native.ts', () => { const View = require('react-native/Libraries/Components/View/View'); return { deleteFile: jest.fn(), + isFileSystemAvailable: jest.fn(() => true), + isShareImageAvailable: jest.fn(() => true), + isVideoPlayerAvailable: jest.fn(() => true), saveFile: jest.fn(), shareImage: jest.fn(), Video: View, diff --git a/package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx b/package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx index 2021feb50..5ce717cea 100644 --- a/package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx +++ b/package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx @@ -30,6 +30,9 @@ import { ImageGallery, ImageGalleryCustomComponents } from '../ImageGallery'; jest.mock('../../../native.ts', () => { const View = require('react-native/Libraries/Components/View/View'); return { + isFileSystemAvailable: jest.fn(() => true), + isShareImageAvailable: jest.fn(() => true), + isVideoPlayerAvailable: jest.fn(() => true), Video: View, }; }); diff --git a/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx b/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx index cc9519e6d..fe266e53e 100644 --- a/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +++ b/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx @@ -5,6 +5,7 @@ import Animated, { useAnimatedStyle } from 'react-native-reanimated'; import { useViewport } from '../../../hooks/useViewport'; import { + isVideoPlayerAvailable, PlaybackStatus, Video, VideoPayloadData, @@ -186,7 +187,7 @@ export const AnimatedGalleryVideo = React.memo( }, ]} > - {Video ? ( + {isVideoPlayerAvailable() ? (