From 40fed036e6ac445d0d7a2cf36eb341b3e478cf93 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Wed, 3 Jul 2024 12:25:55 +0530 Subject: [PATCH 1/6] feat: use react-native-blob-util instead of the react-native-fs and make it optional dependency --- .../docs/reactnative/basics/installation.mdx | 8 +- .../docs/reactnative/basics/overview.mdx | 10 +- .../customization/native-handlers.mdx | 48 +++-- .../guides/audio-messages-support.mdx | 1 + examples/SampleApp/ios/Podfile.lock | 20 +- .../ios/SampleApp.xcodeproj/project.pbxproj | 12 ++ examples/SampleApp/package.json | 6 +- examples/SampleApp/yarn.lock | 199 ++++++++++++++++-- examples/TypeScriptMessaging/ios/Podfile.lock | 16 +- examples/TypeScriptMessaging/package.json | 6 +- examples/TypeScriptMessaging/yarn.lock | 191 +++++++++++++++-- package/expo-package/package.json | 4 +- .../expo-package/src/handlers/deleteFile.ts | 11 - package/expo-package/src/handlers/index.ts | 5 - package/expo-package/src/handlers/saveFile.ts | 11 - package/expo-package/src/index.js | 10 +- .../Audio.ts | 2 +- .../{Video.ts => AudioVideo.ts} | 0 .../Sound.ts | 2 +- .../Video.tsx | 2 +- .../src/optionalDependencies/deleteFile.ts | 25 +++ .../src/optionalDependencies/index.ts | 4 + .../src/optionalDependencies/saveFile.ts | 25 +++ package/expo-package/yarn.lock | 53 +---- package/native-package/package.json | 10 +- .../native-package/src/handlers/deleteFile.ts | 11 - package/native-package/src/handlers/index.ts | 4 - .../native-package/src/handlers/saveFile.ts | 11 - package/native-package/src/index.js | 8 +- .../src/optionalDependencies/Audio.ts | 147 +++++++------ .../{Video.ts => AudioVideo.ts} | 0 .../Sound.tsx | 2 +- .../Video.tsx | 2 +- .../src/optionalDependencies/deleteFile.ts | 19 ++ .../src/optionalDependencies/index.ts | 3 + .../src/optionalDependencies/saveFile.ts | 23 ++ .../src/optionalDependencies/shareImage.ts | 16 +- package/native-package/yarn.lock | 26 +-- .../src/components/Attachment/Attachment.tsx | 4 +- .../Attachment/FileAttachmentGroup.tsx | 4 +- package/src/components/Attachment/Gallery.tsx | 4 +- .../Attachment/__tests__/Attachment.test.js | 6 +- .../Attachment/__tests__/Gallery.test.js | 2 - .../components/ImageGallery/ImageGallery.tsx | 4 +- .../__tests__/AnimatedVideoGallery.test.tsx | 8 - .../__tests__/ImageGallery.test.tsx | 1 - .../__tests__/ImageGalleryFooter.test.tsx | 1 - .../__tests__/ImageGalleryHeader.test.tsx | 1 - .../__tests__/ImageGalleryOverlay.test.tsx | 3 - .../components/AnimatedGalleryVideo.tsx | 5 +- .../components/ImageGalleryFooter.tsx | 3 +- package/src/components/Message/Message.tsx | 4 +- .../MessageInput/FileUploadPreview.tsx | 4 +- .../AudioAttachmentUploadPreviewExpo.test.tsx | 2 +- ...udioAttachmentUploadPreviewNative.test.tsx | 2 +- .../__tests__/FileUploadPreview.test.js | 2 +- .../AudioRecorder/AudioRecordingButton.tsx | 4 +- .../MessageInput/hooks/useAudioController.tsx | 5 - package/src/native.ts | 12 +- 59 files changed, 670 insertions(+), 364 deletions(-) delete mode 100644 package/expo-package/src/handlers/deleteFile.ts delete mode 100644 package/expo-package/src/handlers/saveFile.ts rename package/expo-package/src/{handlers => optionalDependencies}/Audio.ts (99%) rename package/expo-package/src/optionalDependencies/{Video.ts => AudioVideo.ts} (100%) rename package/expo-package/src/{handlers => optionalDependencies}/Sound.ts (85%) rename package/expo-package/src/{handlers => optionalDependencies}/Video.tsx (91%) create mode 100644 package/expo-package/src/optionalDependencies/deleteFile.ts create mode 100644 package/expo-package/src/optionalDependencies/saveFile.ts delete mode 100644 package/native-package/src/handlers/deleteFile.ts delete mode 100644 package/native-package/src/handlers/saveFile.ts rename package/native-package/src/optionalDependencies/{Video.ts => AudioVideo.ts} (100%) rename package/native-package/src/{handlers => optionalDependencies}/Sound.tsx (91%) rename package/native-package/src/{handlers => optionalDependencies}/Video.tsx (90%) create mode 100644 package/native-package/src/optionalDependencies/deleteFile.ts create mode 100644 package/native-package/src/optionalDependencies/saveFile.ts diff --git a/docusaurus/docs/reactnative/basics/installation.mdx b/docusaurus/docs/reactnative/basics/installation.mdx index d399916c34..ae2187f9e6 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 @stream-io/flat-list-mvcp react-native-fs 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 react-native-image-crop-picker @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 @ ```bash title="Terminal" -npx expo install @stream-io/flat-list-mvcp @react-native-community/netinfo expo-file-system 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-image-picker expo-media-library react-native-gesture-handler react-native-reanimated react-native-svg ``` @@ -84,7 +84,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 accessing device gallery. -- [`@stream-io/flat-list-mvcp`](https://github.com/GetStream/flat-list-mvcp) for bi-directional FlatList support. - [`react-native-fs`](https://github.com/itinance/react-native-fs) to perform file operations like save, delete, etc. - [`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. @@ -97,7 +96,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 accessing device gallery. -- [`@stream-io/flat-list-mvcp`](https://github.com/GetStream/flat-list-mvcp) for bi-directional FlatList support. - [`expo-file-system`](https://docs.expo.dev/versions/latest/sdk/filesystem/) to perform file operations like save, delete, etc. - [`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. @@ -124,6 +122,7 @@ values={[ - [`react-native-video`](https://github.com/react-native-video/react-native-video) for Video and Audio playback support. - [`react-native-audio-recorder-player`](https://github.com/hyochan/react-native-audio-recorder-player) for Audio recording and async audio messages support. +- [`react-native-blob-util`](https://github.com/RonRadtke/react-native-blob-util) to perform file operations like save, delete, while sharing or access the cache directory while audio recording. - [`react-native-share`](https://github.com/react-native-share/react-native-share) for Attachment sharing support. - [`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. @@ -134,6 +133,7 @@ values={[ - [`expo-av`](https://docs.expo.dev/versions/latest/sdk/av/) for Video and Audio playback, recording and async audio messages support. +- [`expo-file-system`](https://docs.expo.dev/versions/latest/sdk/filesystem/) to perform file operations like save, delete, while sharing or access the cache directory while audio recording. - [`expo-sharing`](https://docs.expo.dev/versions/latest/sdk/sharing/) for Attachments sharing support. - [`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. diff --git a/docusaurus/docs/reactnative/basics/overview.mdx b/docusaurus/docs/reactnative/basics/overview.mdx index 12e9ab2859..486dc015af 100644 --- a/docusaurus/docs/reactnative/basics/overview.mdx +++ b/docusaurus/docs/reactnative/basics/overview.mdx @@ -62,12 +62,10 @@ The SDK tries to keep the list of external dependencies to a minimum, these are - [`@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 accessing device gallery. -- [`@stream-io/flat-list-mvcp`](https://github.com/GetStream/flat-list-mvcp) for bi-directional FlatList support. -- [`react-native-fs`](https://github.com/itinance/react-native-fs) to perform file operations like save, delete, etc. -- [`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-gesture-handler`](https://github.com/software-mansion/react-native-gesture-handler) to handle gestures within the SDK. - [`react-native-svg`](https://github.com/react-native-svg/react-native-svg) for SVG support. - [`stream-chat`](https://github.com/GetStream/stream-chat-js) for Chat Client. @@ -76,12 +74,10 @@ The SDK tries to keep the list of external dependencies to a minimum, these are - [`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 accessing device gallery. -- [`@stream-io/flat-list-mvcp`](https://github.com/GetStream/flat-list-mvcp) for bi-directional FlatList support. -- [`expo-file-system`](https://docs.expo.dev/versions/latest/sdk/filesystem/) to perform file operations like save, delete, etc. -- [`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-gesture-handler`](https://github.com/software-mansion/react-native-gesture-handler) to handle gestures within the SDK. - [`react-native-svg`](https://docs.expo.dev/versions/latest/sdk/svg/) for SVG support. - [`stream-chat`](https://github.com/GetStream/stream-chat-js) for Chat Client. @@ -104,6 +100,7 @@ There are a few optional dependencies that can be added by our users to have mor - [`react-native-video`](https://github.com/react-native-video/react-native-video) for Video and Audio playback support. - [`react-native-audio-recorder-player`](https://github.com/hyochan/react-native-audio-recorder-player) for Audio recording and async audio messages support. +- [`react-native-blob-util`](https://github.com/RonRadtke/react-native-blob-util) to perform file operations like save, delete, while sharing or access the cache directory while audio recording. - [`react-native-share`](https://github.com/react-native-share/react-native-share) for Attachment sharing support. - [`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. @@ -114,6 +111,7 @@ There are a few optional dependencies that can be added by our users to have mor - [`expo-av`](https://docs.expo.dev/versions/latest/sdk/av/) for Video and Audio playback, recording and async audio messages support. +- [`expo-file-system`](https://docs.expo.dev/versions/latest/sdk/filesystem/) to perform file operations like save, delete, while sharing or access the cache directory while audio recording. - [`expo-sharing`](https://docs.expo.dev/versions/latest/sdk/sharing/) for Attachments sharing support. - [`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. diff --git a/docusaurus/docs/reactnative/customization/native-handlers.mdx b/docusaurus/docs/reactnative/customization/native-handlers.mdx index c39889a204..9a988a498c 100644 --- a/docusaurus/docs/reactnative/customization/native-handlers.mdx +++ b/docusaurus/docs/reactnative/customization/native-handlers.mdx @@ -38,6 +38,14 @@ This should be done outside of the component lifecycle to prevent unnecessarily There are the handlers registered as they interact with different native API packages depending on if the SDK being used on Expo or React Native CLI. +### Audio + +The handler used to play audio files and for voice recording. + +| React Native CLI | Expo | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | +| [`react-native-audio-recorder-player`](https://github.com/hyochan/react-native-audio-recorder-player) & [`react-native-blob-util`](https://github.com/RonRadtke/react-native-blob-util) | [`expo-av`](https://docs.expo.dev/versions/latest/sdk/av/) | + ### `compressImage` An `async` function that compresses an image and returns the local `uri` of the compressed image. @@ -46,29 +54,21 @@ An `async` function that compresses an image and returns the local `uri` of the | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | | [`@bam.tech/react-native-image-resizer`](https://github.com/bamlab/react-native-image-resizer) | [`expo-image-manipulator`](https://docs.expo.io/versions/latest/sdk/imagemanipulator/) | -### `setClipboardString` - -An function to copy strings or text in the message. - -| React Native CLI | Expo | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -| [`react-native-clipboard`](https://github.com/react-native-clipboard/clipboard) | [`expo-clipboard`](https://docs.expo.dev/versions/latest/sdk/clipboard/) | - ### `deleteFile` A function that deletes a file at a given local `uri`. -| React Native CLI | Expo | -| ---------------------------------------------------------------- | -------------------------------------------------------------------------- | -| [`react-native-fs`](https://github.com/itinance/react-native-fs) | [`expo-file-system`](https://docs.expo.io/versions/latest/sdk/filesystem/) | +| React Native CLI | Expo | +| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| [`react-native-blob-util`](https://github.com/RonRadtke/react-native-blob-util) | [`expo-file-system`](https://docs.expo.io/versions/latest/sdk/filesystem/) | ### `getLocalAssetUri` A function that gets the local `uri` of an image or remote asset. -| React Native CLI | Expo | -| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| [`@react-native-community/cameraroll`](https://github.com/react-native-cameraroll/react-native-cameraroll) | [`expo-media-library`](https://docs.expo.io/versions/latest/sdk/media-library/) | +| React Native CLI | Expo | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| [`@react-native-camera-roll/camera-roll`](https://github.com/react-native-cameraroll/react-native-cameraroll) | [`expo-media-library`](https://docs.expo.io/versions/latest/sdk/media-library/) | ### `getPhotos` @@ -90,9 +90,9 @@ A function to open the document picker and return documents picked from it. A function to save a file from a URL to local storage. -| React Native CLI | Expo | -| ---------------------------------------------------------------- | -------------------------------------------------------------------------- | -| [`react-native-fs`](https://github.com/itinance/react-native-fs) | [`expo-file-system`](https://docs.expo.io/versions/latest/sdk/filesystem/) | +| React Native CLI | Expo | +| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| [`react-native-blob-util`](https://github.com/RonRadtke/react-native-blob-util) | [`expo-file-system`](https://docs.expo.io/versions/latest/sdk/filesystem/) | ### SDK @@ -102,13 +102,21 @@ String identifying which package, `stream-chat-react-native` or `stream-chat-exp | -------------------------- | ------------------ | | _stream-chat-react-native_ | _stream-chat-expo_ | +### `setClipboardString` + +An function to copy strings or text in the message. + +| React Native CLI | Expo | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | +| [`react-native-clipboard`](https://github.com/react-native-clipboard/clipboard) | [`expo-clipboard`](https://docs.expo.dev/versions/latest/sdk/clipboard/) | + ### `shareImage` A function to provide a given image to the native sharing functionality of the OS. -| React Native CLI | Expo | -| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | -| [`react-native-fs`](https://github.com/itinance/react-native-fs) & [`react-native-share`](https://github.com/react-native-share/react-native-share) | [`expo-sharing`](https://docs.expo.io/versions/latest/sdk/sharing/) | +| React Native CLI | Expo | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| [`react-native-blob-util`](https://github.com/RonRadtke/react-native-blob-util) & [`react-native-share`](https://github.com/react-native-share/react-native-share) | [`expo-file-system`](https://docs.expo.io/versions/latest/sdk/filesystem/) & [`expo-sharing`](https://docs.expo.io/versions/latest/sdk/sharing/) | ### `takePhoto` diff --git a/docusaurus/docs/reactnative/guides/audio-messages-support.mdx b/docusaurus/docs/reactnative/guides/audio-messages-support.mdx index b1777295c5..4a7d100d0e 100644 --- a/docusaurus/docs/reactnative/guides/audio-messages-support.mdx +++ b/docusaurus/docs/reactnative/guides/audio-messages-support.mdx @@ -28,6 +28,7 @@ values={[ - [`react-native-video`](https://github.com/react-native-video/react-native-video) for Audio playback support. - [`react-native-audio-recorder-player`](https://github.com/hyochan/react-native-audio-recorder-player) for Audio recording and preview. +- [`react-native-blob-util`](https://github.com/RonRadtke/react-native-blob-util) to access the cache directory while audio recording. diff --git a/examples/SampleApp/ios/Podfile.lock b/examples/SampleApp/ios/Podfile.lock index 325311d310..e426462699 100644 --- a/examples/SampleApp/ios/Podfile.lock +++ b/examples/SampleApp/ios/Podfile.lock @@ -1040,13 +1040,15 @@ PODS: - React-Mapbuffer (0.73.5): - glog - React-debug + - react-native-blob-util (0.19.9): + - React-Core - react-native-cameraroll (5.10.0): - React-Core - react-native-document-picker (9.0.1): - React-Core - react-native-image-resizer (3.0.10): - React-Core - - react-native-netinfo (11.3.0): + - react-native-netinfo (11.3.2): - React-Core - react-native-safe-area-context (4.9.0): - React-Core @@ -1245,8 +1247,6 @@ PODS: - FirebaseCoreExtension (= 10.21.0) - React-Core - RNFBApp - - RNFS (2.20.0): - - React-Core - RNGestureHandler (2.15.0): - glog - RCT-Folly (= 2022.05.16.00) @@ -1276,7 +1276,7 @@ PODS: - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - RNShare (10.0.2): + - RNShare (10.2.1): - React-Core - RNSVG (14.1.0): - React-Core @@ -1325,6 +1325,7 @@ DEPENDENCIES: - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector-modern`) - React-logger (from `../node_modules/react-native/ReactCommon/logger`) - React-Mapbuffer (from `../node_modules/react-native/ReactCommon`) + - 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-resizer (from `../node_modules/@bam.tech/react-native-image-resizer`)" @@ -1357,7 +1358,6 @@ DEPENDENCIES: - RNFastImage (from `../node_modules/react-native-fast-image`) - "RNFBApp (from `../node_modules/@react-native-firebase/app`)" - "RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`)" - - RNFS (from `../node_modules/react-native-fs`) - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`) - "RNNotifee (from `../node_modules/@notifee/react-native`)" @@ -1452,6 +1452,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/logger" React-Mapbuffer: :path: "../node_modules/react-native/ReactCommon" + react-native-blob-util: + :path: "../node_modules/react-native-blob-util" react-native-cameraroll: :path: "../node_modules/@react-native-camera-roll/camera-roll" react-native-document-picker: @@ -1516,8 +1518,6 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-firebase/app" RNFBMessaging: :path: "../node_modules/@react-native-firebase/messaging" - RNFS: - :path: "../node_modules/react-native-fs" RNGestureHandler: :path: "../node_modules/react-native-gesture-handler" RNImageCropPicker: @@ -1585,10 +1585,11 @@ SPEC CHECKSUMS: React-jsinspector: 32db5e364bcae8fca8cdf8891830636275add0c5 React-logger: 0331362115f0f5b392bd7ed14636d1a3ea612479 React-Mapbuffer: 30d796a057e4e077d44b4c2ba17869fb8c1064eb + react-native-blob-util: 18b510205c080a453574a7d2344d64673d0ad9af react-native-cameraroll: 4701ae7c3dbcd3f5e9e150ca17f250a276154b35 react-native-document-picker: 2b8f18667caee73a96708a82b284a4f40b30a156 react-native-image-resizer: fd0c333eca55147bd55c5e054cac95dcd0da6814 - react-native-netinfo: 299dad906cdbf3b67bcc6f693c807f98bdd127cc + react-native-netinfo: 076df4f9b07f6670acf4ce9a75aac8d34c2e2ccc react-native-safe-area-context: b97eb6f9e3b7f437806c2ce5983f479f8eb5de4b react-native-video: 2e38d3e0f7382427539b6b436812553480fcf70a React-nativeconfig: 78e2b14c0ee479449845b67bbe103343257cbcc0 @@ -1617,14 +1618,13 @@ SPEC CHECKSUMS: RNFastImage: 5c9c9fed9c076e521b3f509fe79e790418a544e8 RNFBApp: 1c8688e63b58bb57e6a6e9032aa227f8df8371bf RNFBMessaging: 9b16c72d001787aca05e2fb997e5c979b821dbb4 - RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 RNGestureHandler: 2e3251b41d462552997c61afd680220d019fea65 RNImageCropPicker: 14fe1c29298fb4018f3186f455c475ab107da332 RNNotifee: 8e2d3df3f0e9ce8f5d1fe4c967431138190b6175 RNReactNativeHapticFeedback: afa5bf2794aecbb2dba2525329253da0d66656df RNReanimated: 440ca83ef0a79a3376455663fc4a01300e131240 RNScreens: a4d9ce8f68f833f4e42410140eafd88e38bba163 - RNShare: 859ff710211285676b0bcedd156c12437ea1d564 + RNShare: 0fad69ae2d71de9d1f7b9a43acf876886a6cb99c RNSVG: ba3e7232f45e34b7b47e74472386cf4e1a676d0a SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d diff --git a/examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj b/examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj index 4cec7d6c34..2650c8c7ed 100644 --- a/examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj +++ b/examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj @@ -630,6 +630,12 @@ " ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", " ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", " ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", + " ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", + " ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", + " ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", + " ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", + " ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", + " ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", ); IPHONEOS_DEPLOYMENT_TARGET = 13.4; LD_RUNPATH_SEARCH_PATHS = ( @@ -738,6 +744,12 @@ " ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", " ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", " ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", + " ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", + " ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", + " ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", + " ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", + " ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", + " ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", ); IPHONEOS_DEPLOYMENT_TARGET = 13.4; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/examples/SampleApp/package.json b/examples/SampleApp/package.json index 86b10fbda5..d0c662dc9c 100644 --- a/examples/SampleApp/package.json +++ b/examples/SampleApp/package.json @@ -28,7 +28,7 @@ "@react-native-async-storage/async-storage": "^1.21.0", "@react-native-camera-roll/camera-roll": "^5.3.1", "@react-native-community/masked-view": "0.1.11", - "@react-native-community/netinfo": "^11.3.0", + "@react-native-community/netinfo": "^11.3.2", "@react-native-firebase/app": "^19.0.0", "@react-native-firebase/messaging": "^19.0.0", "@react-navigation/bottom-tabs": "6.5.14", @@ -38,9 +38,9 @@ "react": "18.2.0", "react-native": "^0.73.0", "react-native-audio-recorder-player": "^3.6.7", + "react-native-blob-util": "^0.19.9", "react-native-document-picker": "9.0.1", "react-native-fast-image": "^8.6.3", - "react-native-fs": "^2.18.0", "react-native-gesture-handler": "^2.14.0", "react-native-haptic-feedback": "2.0.3", "react-native-image-crop-picker": "0.39.0", @@ -48,7 +48,7 @@ "react-native-reanimated": "^3.7.0", "react-native-safe-area-context": "^4.8.2", "react-native-screens": "^3.29.0", - "react-native-share": "10.0.2", + "react-native-share": "^10.2.1", "react-native-svg": "^14.1.0", "react-native-video": "6.0.0-beta.8", "stream-chat-react-native": "link:../../package/native-package", diff --git a/examples/SampleApp/yarn.lock b/examples/SampleApp/yarn.lock index abfc802565..b1a2a358fc 100644 --- a/examples/SampleApp/yarn.lock +++ b/examples/SampleApp/yarn.lock @@ -1263,6 +1263,18 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz#d9fae00a2d5cb40f92cfe64b47ad749fbc38f917" integrity sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@isaacs/ttlcache@^1.4.1": version "1.4.1" resolved "https://registry.yarnpkg.com/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz#21fb23db34e9b6220c6ba023a0118a2dd3461ea2" @@ -1572,6 +1584,11 @@ resolved "https://registry.yarnpkg.com/@op-engineering/op-sqlite/-/op-sqlite-6.0.4.tgz#482c11e5333776707b72ac0f25ba9b9f09f2091e" integrity sha512-reC9TszzU+ygH+RckXA017SeBEwzhuy/7UxLtGVtXpSlWEJp24MmMUYMcWO++OnNFHZZrpI376M09RjyQkl7xQ== +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@react-native-async-storage/async-storage@^1.21.0": version "1.22.2" resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.22.2.tgz#c6f966f02cc5602e5a768c32295e8009e897c28e" @@ -1740,10 +1757,10 @@ resolved "https://registry.yarnpkg.com/@react-native-community/masked-view/-/masked-view-0.1.11.tgz#2f4c6e10bee0786abff4604e39a37ded6f3980ce" integrity sha512-rQfMIGSR/1r/SyN87+VD8xHHzDYeHaJq6elOSCAD+0iLagXkSI2pfA0LmSXP21uw5i3em7GkkRjfJ8wpqWXZNw== -"@react-native-community/netinfo@^11.3.0": - version "11.3.0" - resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-11.3.0.tgz#9d99ba00138b38350a794eab5eca436f6e209114" - integrity sha512-mR9iqUi0GzuC8ut+goI/lLkgG+a2OViI1mjSdXHKZnkfdJVjHblyWX3xoA8GE4GH8X4r0X/PNM3Vvyf2FH9mVg== +"@react-native-community/netinfo@^11.3.2": + version "11.3.2" + resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-11.3.2.tgz#e63201d0b87ad42d086d1003be48ae7b327f0594" + integrity sha512-YsaS3Dutnzqd1BEoeC+DEcuNJedYRkN6Ef3kftT5Sm8ExnCF94C/nl4laNxuvFli3+Jz8Df3jO25Jn8A9S0h4w== "@react-native-firebase/app@^19.0.0": version "19.0.0" @@ -2394,6 +2411,11 @@ ansi-regex@^5.0.0, ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -2413,6 +2435,11 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + anymatch@^3.0.3: version "3.1.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" @@ -2671,7 +2698,7 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base-64@^0.1.0: +base-64@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA== @@ -2703,6 +2730,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -3070,7 +3104,7 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -3285,6 +3319,11 @@ dooboolab-welcome@^1.3.2: resolved "https://registry.yarnpkg.com/dooboolab-welcome/-/dooboolab-welcome-1.3.2.tgz#4928595312f0429b4ea1b485ba8767bae6acdab7" integrity sha512-2NbMaIIURElxEf/UAoVUFlXrO+7n/FRhLCiQlk4fkbGRh9cJ3/f8VEMPveR9m4Ug2l2Zey+UCXjd6EcBqHJ5bw== +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ecdsa-sig-formatter@1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" @@ -3317,6 +3356,11 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -3938,6 +3982,14 @@ for-own@^1.0.0: dependencies: for-in "^1.0.1" +foreground-child@^3.1.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.2.1.tgz#767004ccf3a5b30df39bed90718bab43fe0a59f7" + integrity sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -4045,6 +4097,18 @@ glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" +glob@^10.3.10: + version "10.4.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.2.tgz#bed6b95dade5c1f80b4434daced233aee76160e5" + integrity sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w== + dependencies: + foreground-child "^3.1.0" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^1.11.1" + glob@^7.1.1, glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -4633,6 +4697,15 @@ iterator.prototype@^1.1.2: reflect.getprototypeof "^1.0.4" set-function-name "^2.0.1" +jackspeak@^3.1.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.4.0.tgz#a75763ff36ad778ede6a156d8ee8b124de445b4a" + integrity sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-changed-files@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" @@ -5306,6 +5379,11 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" +lru-cache@^10.2.0: + version "10.3.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.3.0.tgz#4a4aaf10c84658ab70f79a85a9a3f1e1fb11196b" + integrity sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -5600,11 +5678,23 @@ minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatc dependencies: brace-expansion "^1.1.7" +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + mixin-object@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/mixin-object/-/mixin-object-2.0.1.tgz#4fb949441dab182540f1fe035ba60e1947a5e57e" @@ -5918,6 +6008,11 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +package-json-from-dist@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz#e501cd3094b278495eb4258d4c9f6d5ac3019f00" + integrity sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -5973,6 +6068,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -6172,6 +6275,14 @@ react-native-audio-recorder-player@^3.6.7: dependencies: dooboolab-welcome "^1.3.2" +react-native-blob-util@^0.19.9: + version "0.19.9" + resolved "https://registry.yarnpkg.com/react-native-blob-util/-/react-native-blob-util-0.19.9.tgz#6f2c27d77cd36b9e03c967c54930491404d9d780" + integrity sha512-gIuErPqGbBIAPWf+K07x/8mRZ80Waz9DWgwMdQ8zWgms8kYfAji0GNk2gvZZ0y9MKe61jme7oOdZ7InWLRy2GA== + dependencies: + base-64 "0.1.0" + glob "^10.3.10" + react-native-document-picker@9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/react-native-document-picker/-/react-native-document-picker-9.0.1.tgz#a5ceec157f84dbadb85fe717c657569755f4c6ca" @@ -6184,14 +6295,6 @@ react-native-fast-image@^8.6.3: resolved "https://registry.yarnpkg.com/react-native-fast-image/-/react-native-fast-image-8.6.3.tgz#6edc3f9190092a909d636d93eecbcc54a8822255" integrity sha512-Sdw4ESidXCXOmQ9EcYguNY2swyoWmx53kym2zRsvi+VeFCHEdkO+WG1DK+6W81juot40bbfLNhkc63QnWtesNg== -react-native-fs@^2.18.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/react-native-fs/-/react-native-fs-2.20.0.tgz#05a9362b473bfc0910772c0acbb73a78dbc810f6" - integrity sha512-VkTBzs7fIDUiy/XajOSNk0XazFE9l+QlMAce7lGuebZcag5CnjszB+u4BdqzwaQOdcYb5wsJIsqq4kxInIRpJQ== - dependencies: - base-64 "^0.1.0" - utf8 "^3.0.0" - react-native-gesture-handler@^2.14.0: version "2.15.0" resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.15.0.tgz#f8e6c0451a7bdf065edb7b9be605480db402baa0" @@ -6252,10 +6355,10 @@ react-native-screens@^3.29.0: react-freeze "^1.0.0" warn-once "^0.1.0" -react-native-share@10.0.2: - version "10.0.2" - resolved "https://registry.yarnpkg.com/react-native-share/-/react-native-share-10.0.2.tgz#ba517d20a3bf20385eeeea32d9be9b41395f4dc7" - integrity sha512-EZs4MtsyauAI1zP8xXT1hIFB/pXOZJNDCKcgCpEfTZFXgCUzz8MDVbI1ocP2hA59XHRSkqAQdbJ0BFTpjxOBlg== +react-native-share@^10.2.1: + version "10.2.1" + resolved "https://registry.yarnpkg.com/react-native-share/-/react-native-share-10.2.1.tgz#baf94848c2acee6e52f6b28e05c47fa5fa9402be" + integrity sha512-Z2LWGYWH7raM4H6Oauttv1tEhaB43XSWJAN8iS6oaSG9CnyrUBeYFF4QpU1AH5RgNeylXQdN8CtbizCHHt6coQ== react-native-svg@^14.1.0: version "14.1.0" @@ -6729,6 +6832,11 @@ signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + simple-markdown@^0.7.1: version "0.7.3" resolved "https://registry.yarnpkg.com/simple-markdown/-/simple-markdown-0.7.3.tgz#e32150b2ec6f8287197d09869fd928747a9c5640" @@ -6891,6 +6999,15 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -6900,6 +7017,15 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.matchall@^4.0.8: version "4.0.10" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz#a1553eb532221d4180c51581d6072cd65d1ee100" @@ -6956,6 +7082,13 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^5.0.0, strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" @@ -6970,6 +7103,13 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" @@ -7276,11 +7416,6 @@ use-latest-callback@^0.1.7: resolved "https://registry.yarnpkg.com/use-latest-callback/-/use-latest-callback-0.1.9.tgz#10191dc54257e65a8e52322127643a8940271e2a" integrity sha512-CL/29uS74AwreI/f2oz2hLTW7ZqVeV5+gxFeGudzQrgkCytrHw33G4KbnQOrRlAEzzAFXi7dDLMC9zhWcVpzmw== -utf8@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" - integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== - 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" @@ -7430,6 +7565,15 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -7448,6 +7592,15 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" diff --git a/examples/TypeScriptMessaging/ios/Podfile.lock b/examples/TypeScriptMessaging/ios/Podfile.lock index 10c7e76d57..da28974486 100644 --- a/examples/TypeScriptMessaging/ios/Podfile.lock +++ b/examples/TypeScriptMessaging/ios/Podfile.lock @@ -951,6 +951,8 @@ PODS: - React-Mapbuffer (0.73.6): - glog - React-debug + - react-native-blob-util (0.19.9): + - React-Core - react-native-cameraroll (5.6.0): - React-Core - react-native-document-picker (9.0.1): @@ -1146,8 +1148,6 @@ PODS: - React-Core - RNCMaskedView (0.1.11): - React - - RNFS (2.20.0): - - React-Core - RNGestureHandler (2.15.0): - glog - RCT-Folly (= 2022.05.16.00) @@ -1172,7 +1172,7 @@ PODS: - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - RNShare (8.2.2): + - RNShare (10.2.1): - React-Core - RNSVG (14.1.0): - React-Core @@ -1234,6 +1234,7 @@ DEPENDENCIES: - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector-modern`) - React-logger (from `../node_modules/react-native/ReactCommon/logger`) - React-Mapbuffer (from `../node_modules/react-native/ReactCommon`) + - 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-flipper (from `../node_modules/react-native-flipper`) @@ -1264,7 +1265,6 @@ DEPENDENCIES: - RNAudioRecorderPlayer (from `../node_modules/react-native-audio-recorder-player`) - "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)" - "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)" - - RNFS (from `../node_modules/react-native-fs`) - 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`) @@ -1351,6 +1351,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/logger" React-Mapbuffer: :path: "../node_modules/react-native/ReactCommon" + react-native-blob-util: + :path: "../node_modules/react-native-blob-util" react-native-cameraroll: :path: "../node_modules/@react-native-camera-roll/camera-roll" react-native-document-picker: @@ -1411,8 +1413,6 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-clipboard/clipboard" RNCMaskedView: :path: "../node_modules/@react-native-community/masked-view" - RNFS: - :path: "../node_modules/react-native-fs" RNGestureHandler: :path: "../node_modules/react-native-gesture-handler" RNImageCropPicker: @@ -1473,6 +1473,7 @@ SPEC CHECKSUMS: React-jsinspector: 85583ef014ce53d731a98c66a0e24496f7a83066 React-logger: 3eb80a977f0d9669468ef641a5e1fabbc50a09ec React-Mapbuffer: 84ea43c6c6232049135b1550b8c60b2faac19fab + react-native-blob-util: 18b510205c080a453574a7d2344d64673d0ad9af react-native-cameraroll: 755bcc628148a90a7c9cf3f817a252be3a601bc5 react-native-document-picker: 2b8f18667caee73a96708a82b284a4f40b30a156 react-native-flipper: 9c1957af24b76493ba74f46d000a5c1d485e7731 @@ -1503,13 +1504,12 @@ SPEC CHECKSUMS: RNAudioRecorderPlayer: f790fc1afb118552ae6285d60adde52ee6b5d9ef RNCClipboard: 60fed4b71560d7bfe40e9d35dea9762b024da86d RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489 - RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 RNGestureHandler: 67fb54b3e6ca338a8044e85cd6f340265aa41091 RNImageCropPicker: 14fe1c29298fb4018f3186f455c475ab107da332 RNReactNativeHapticFeedback: afa5bf2794aecbb2dba2525329253da0d66656df RNReanimated: 15a855719335a6b655a214531e86d806edfd49da RNScreens: 17e2f657f1b09a71ec3c821368a04acbb7ebcb46 - RNShare: d82e10f6b7677f4b0048c23709bd04098d5aee6c + RNShare: 0fad69ae2d71de9d1f7b9a43acf876886a6cb99c RNSVG: ba3e7232f45e34b7b47e74472386cf4e1a676d0a SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863 diff --git a/examples/TypeScriptMessaging/package.json b/examples/TypeScriptMessaging/package.json index cdd17edc95..5abca56eec 100644 --- a/examples/TypeScriptMessaging/package.json +++ b/examples/TypeScriptMessaging/package.json @@ -12,8 +12,8 @@ "clean-all": "yarn clean && rm -rf node_modules && rm -rf ios/Pods && rm -rf vendor && bundle install && yarn install && cd ios && bundle exec pod install && cd -" }, "dependencies": { - "@op-engineering/op-sqlite": "^6.0.4", "@bam.tech/react-native-image-resizer": "^3.0.10", + "@op-engineering/op-sqlite": "^6.0.4", "@react-native-camera-roll/camera-roll": "^5.3.1", "@react-native-clipboard/clipboard": "^1.10.0", "@react-native-community/masked-view": "0.1.11", @@ -23,15 +23,15 @@ "react": "18.2.0", "react-native": "^0.73.6", "react-native-audio-recorder-player": "3.6.6", + "react-native-blob-util": "^0.19.9", "react-native-document-picker": "^9.0.1", - "react-native-fs": "^2.18.0", "react-native-gesture-handler": "^2.14.0", "react-native-haptic-feedback": "^2.0.3", "react-native-image-crop-picker": "^0.39.0", "react-native-reanimated": "^3.7.0", "react-native-safe-area-context": "^4.8.2", "react-native-screens": "^3.28.0", - "react-native-share": "^8.2.2", + "react-native-share": "^10.2.1", "react-native-svg": "^14.0.0", "react-native-video": "6.0.0-beta.8", "stream-chat-react-native": "link:../../package/native-package", diff --git a/examples/TypeScriptMessaging/yarn.lock b/examples/TypeScriptMessaging/yarn.lock index 3372d55065..b659d4483b 100644 --- a/examples/TypeScriptMessaging/yarn.lock +++ b/examples/TypeScriptMessaging/yarn.lock @@ -1586,6 +1586,18 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz#d9fae00a2d5cb40f92cfe64b47ad749fbc38f917" integrity sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@isaacs/ttlcache@^1.4.1": version "1.4.1" resolved "https://registry.yarnpkg.com/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz#21fb23db34e9b6220c6ba023a0118a2dd3461ea2" @@ -1908,6 +1920,11 @@ resolved "https://registry.yarnpkg.com/@op-engineering/op-sqlite/-/op-sqlite-6.0.4.tgz#482c11e5333776707b72ac0f25ba9b9f09f2091e" integrity sha512-reC9TszzU+ygH+RckXA017SeBEwzhuy/7UxLtGVtXpSlWEJp24MmMUYMcWO++OnNFHZZrpI376M09RjyQkl7xQ== +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@react-native-camera-roll/camera-roll@^5.3.1": version "5.6.0" resolved "https://registry.yarnpkg.com/@react-native-camera-roll/camera-roll/-/camera-roll-5.6.0.tgz#385082d57d694f3fd5ae386f8b8ce24b0969c5f9" @@ -2748,6 +2765,11 @@ ansi-regex@^5.0.0, ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -2767,6 +2789,11 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + anymatch@^3.0.3: version "3.1.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" @@ -2992,7 +3019,7 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base-64@^0.1.0: +base-64@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA== @@ -3024,6 +3051,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -3398,7 +3432,7 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -3603,6 +3637,11 @@ dooboolab-welcome@^1.3.2: resolved "https://registry.yarnpkg.com/dooboolab-welcome/-/dooboolab-welcome-1.3.2.tgz#4928595312f0429b4ea1b485ba8767bae6acdab7" integrity sha512-2NbMaIIURElxEf/UAoVUFlXrO+7n/FRhLCiQlk4fkbGRh9cJ3/f8VEMPveR9m4Ug2l2Zey+UCXjd6EcBqHJ5bw== +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ecdsa-sig-formatter@1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" @@ -3640,6 +3679,11 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -4207,6 +4251,14 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +foreground-child@^3.1.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.2.1.tgz#767004ccf3a5b30df39bed90718bab43fe0a59f7" + integrity sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -4312,6 +4364,18 @@ glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" +glob@^10.3.10: + version "10.4.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.2.tgz#bed6b95dade5c1f80b4434daced233aee76160e5" + integrity sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w== + dependencies: + foreground-child "^3.1.0" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^1.11.1" + glob@^7.1.1, glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -4835,6 +4899,15 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jackspeak@^3.1.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.4.0.tgz#a75763ff36ad778ede6a156d8ee8b124de445b4a" + integrity sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-changed-files@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" @@ -5448,6 +5521,11 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" +lru-cache@^10.2.0: + version "10.3.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.3.0.tgz#4a4aaf10c84658ab70f79a85a9a3f1e1fb11196b" + integrity sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -5735,11 +5813,23 @@ minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatc dependencies: brace-expansion "^1.1.7" +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + mkdirp@^0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" @@ -6045,6 +6135,11 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +package-json-from-dist@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz#e501cd3094b278495eb4258d4c9f6d5ac3019f00" + integrity sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -6100,6 +6195,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -6294,6 +6397,14 @@ react-native-audio-recorder-player@3.6.6: dependencies: dooboolab-welcome "^1.3.2" +react-native-blob-util@^0.19.9: + version "0.19.9" + resolved "https://registry.yarnpkg.com/react-native-blob-util/-/react-native-blob-util-0.19.9.tgz#6f2c27d77cd36b9e03c967c54930491404d9d780" + integrity sha512-gIuErPqGbBIAPWf+K07x/8mRZ80Waz9DWgwMdQ8zWgms8kYfAji0GNk2gvZZ0y9MKe61jme7oOdZ7InWLRy2GA== + dependencies: + base-64 "0.1.0" + glob "^10.3.10" + react-native-document-picker@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/react-native-document-picker/-/react-native-document-picker-9.0.1.tgz#a5ceec157f84dbadb85fe717c657569755f4c6ca" @@ -6306,14 +6417,6 @@ react-native-flipper@^0.212.0: resolved "https://registry.yarnpkg.com/react-native-flipper/-/react-native-flipper-0.212.0.tgz#b3fdd47676ecd09a25edd77a1466acace6276762" integrity sha512-bDRfIgE3v/jjEEdnvGP0T6maDD+bXhDAQ/SZUYTKd/CQ6YIU1c0EF+e0urU62LNMv6XEFQKz226McdddyVhYZA== -react-native-fs@^2.18.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/react-native-fs/-/react-native-fs-2.20.0.tgz#05a9362b473bfc0910772c0acbb73a78dbc810f6" - integrity sha512-VkTBzs7fIDUiy/XajOSNk0XazFE9l+QlMAce7lGuebZcag5CnjszB+u4BdqzwaQOdcYb5wsJIsqq4kxInIRpJQ== - dependencies: - base-64 "^0.1.0" - utf8 "^3.0.0" - react-native-gesture-handler@^2.14.0: version "2.15.0" resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.15.0.tgz#f8e6c0451a7bdf065edb7b9be605480db402baa0" @@ -6374,10 +6477,10 @@ react-native-screens@^3.28.0: react-freeze "^1.0.0" warn-once "^0.1.0" -react-native-share@^8.2.2: - version "8.2.2" - resolved "https://registry.yarnpkg.com/react-native-share/-/react-native-share-8.2.2.tgz#987d6f164afe57b089950dca42e0555f19045d27" - integrity sha512-kVCI/cT0GnuYUTXe6mAimrjrnt4VWoRfrWqJZjFeoYFqAyOEfos84RC4eZlZnOT5eVtmTXRIkor5vgSkKOlZhw== +react-native-share@^10.2.1: + version "10.2.1" + resolved "https://registry.yarnpkg.com/react-native-share/-/react-native-share-10.2.1.tgz#baf94848c2acee6e52f6b28e05c47fa5fa9402be" + integrity sha512-Z2LWGYWH7raM4H6Oauttv1tEhaB43XSWJAN8iS6oaSG9CnyrUBeYFF4QpU1AH5RgNeylXQdN8CtbizCHHt6coQ== react-native-svg@^14.0.0: version "14.1.0" @@ -6791,6 +6894,11 @@ signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + simple-markdown@^0.7.1: version "0.7.3" resolved "https://registry.yarnpkg.com/simple-markdown/-/simple-markdown-0.7.3.tgz#e32150b2ec6f8287197d09869fd928747a9c5640" @@ -6958,6 +7066,15 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -6967,6 +7084,15 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.matchall@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" @@ -7022,6 +7148,13 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^5.0.0, strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" @@ -7036,6 +7169,13 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" @@ -7302,11 +7442,6 @@ use-latest-callback@^0.1.7: resolved "https://registry.yarnpkg.com/use-latest-callback/-/use-latest-callback-0.1.9.tgz#10191dc54257e65a8e52322127643a8940271e2a" integrity sha512-CL/29uS74AwreI/f2oz2hLTW7ZqVeV5+gxFeGudzQrgkCytrHw33G4KbnQOrRlAEzzAFXi7dDLMC9zhWcVpzmw== -utf8@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" - integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== - 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" @@ -7429,6 +7564,15 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -7447,6 +7591,15 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" diff --git a/package/expo-package/package.json b/package/expo-package/package.json index 7ad2305d8b..1fb62d49ab 100644 --- a/package/expo-package/package.json +++ b/package/expo-package/package.json @@ -34,6 +34,9 @@ "expo-document-picker": { "optional": true }, + "expo-file-system": { + "optional": true + }, "expo-sharing": { "optional": true }, @@ -43,7 +46,6 @@ }, "devDependencies": { "expo": "^44.0.0", - "expo-file-system": "^11.0.2", "expo-image-manipulator": "^9.1.0", "expo-image-picker": "^14.1.1", "expo-media-library": "~15.2.3" diff --git a/package/expo-package/src/handlers/deleteFile.ts b/package/expo-package/src/handlers/deleteFile.ts deleted file mode 100644 index 292091141b..0000000000 --- a/package/expo-package/src/handlers/deleteFile.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as FileSystem from 'expo-file-system'; - -export const deleteFile = async ({ uri }: { uri: string }) => { - try { - await FileSystem.deleteAsync(uri, { idempotent: true }); - return true; - } catch (error) { - console.log('File deletion failed...'); - return false; - } -}; diff --git a/package/expo-package/src/handlers/index.ts b/package/expo-package/src/handlers/index.ts index 4627bff5b1..03cb36ba3f 100644 --- a/package/expo-package/src/handlers/index.ts +++ b/package/expo-package/src/handlers/index.ts @@ -1,11 +1,6 @@ -export * from './Audio'; export * from './compressImage'; -export * from './deleteFile'; export * from './getLocalAssetUri'; export * from './getPhotos'; export * from './iOS14RefreshGallerySelection'; export * from './oniOS14GalleryLibrarySelectionChange'; -export * from './saveFile'; -export * from './Sound'; export * from './takePhoto'; -export * from './Video'; diff --git a/package/expo-package/src/handlers/saveFile.ts b/package/expo-package/src/handlers/saveFile.ts deleted file mode 100644 index fe4d8abcd0..0000000000 --- a/package/expo-package/src/handlers/saveFile.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as FileSystem from 'expo-file-system'; - -export const saveFile = async ({ fileName, fromUrl }: { fileName: string; fromUrl: string }) => { - try { - const path = FileSystem.cacheDirectory + encodeURIComponent(fileName); - const downloadedImage = await FileSystem.downloadAsync(fromUrl, path); - return downloadedImage.uri; - } catch (error) { - throw new Error('Downloading image failed...'); - } -}; diff --git a/package/expo-package/src/index.js b/package/expo-package/src/index.js index b243d14c35..662400acad 100644 --- a/package/expo-package/src/index.js +++ b/package/expo-package/src/index.js @@ -1,24 +1,24 @@ import { registerNativeHandlers } from 'stream-chat-react-native-core'; import { - Audio, compressImage, - deleteFile, getLocalAssetUri, getPhotos, iOS14RefreshGallerySelection, oniOS14GalleryLibrarySelectionChange, - saveFile, - Sound, takePhoto, - Video, } from './handlers'; import { + Audio, + deleteFile, pickDocument, + saveFile, setClipboardString, shareImage, + Sound, triggerHaptic, + Video, } from './optionalDependencies'; registerNativeHandlers({ diff --git a/package/expo-package/src/handlers/Audio.ts b/package/expo-package/src/optionalDependencies/Audio.ts similarity index 99% rename from package/expo-package/src/handlers/Audio.ts rename to package/expo-package/src/optionalDependencies/Audio.ts index 5283131e8f..a4ab20f995 100644 --- a/package/expo-package/src/handlers/Audio.ts +++ b/package/expo-package/src/optionalDependencies/Audio.ts @@ -1,4 +1,4 @@ -import { AudioComponent } from '../optionalDependencies/Video'; +import { AudioComponent } from './AudioVideo'; export enum AndroidOutputFormat { DEFAULT = 0, diff --git a/package/expo-package/src/optionalDependencies/Video.ts b/package/expo-package/src/optionalDependencies/AudioVideo.ts similarity index 100% rename from package/expo-package/src/optionalDependencies/Video.ts rename to package/expo-package/src/optionalDependencies/AudioVideo.ts diff --git a/package/expo-package/src/handlers/Sound.ts b/package/expo-package/src/optionalDependencies/Sound.ts similarity index 85% rename from package/expo-package/src/handlers/Sound.ts rename to package/expo-package/src/optionalDependencies/Sound.ts index 76fae07354..5b92b762ac 100644 --- a/package/expo-package/src/handlers/Sound.ts +++ b/package/expo-package/src/optionalDependencies/Sound.ts @@ -1,4 +1,4 @@ -import { AudioComponent } from '../optionalDependencies/Video'; +import { AudioComponent } from './AudioVideo'; export const Sound = { initializeSound: AudioComponent diff --git a/package/expo-package/src/handlers/Video.tsx b/package/expo-package/src/optionalDependencies/Video.tsx similarity index 91% rename from package/expo-package/src/handlers/Video.tsx rename to package/expo-package/src/optionalDependencies/Video.tsx index 29407e9071..ee56a3da2e 100644 --- a/package/expo-package/src/handlers/Video.tsx +++ b/package/expo-package/src/optionalDependencies/Video.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; -import { AudioComponent, VideoComponent } from '../optionalDependencies'; +import { AudioComponent, VideoComponent } from './AudioVideo'; export const Video = VideoComponent ? ({ onPlaybackStatusUpdate, paused, resizeMode, style, uri, videoRef }) => { diff --git a/package/expo-package/src/optionalDependencies/deleteFile.ts b/package/expo-package/src/optionalDependencies/deleteFile.ts new file mode 100644 index 0000000000..bf696160a8 --- /dev/null +++ b/package/expo-package/src/optionalDependencies/deleteFile.ts @@ -0,0 +1,25 @@ +let FileSystem; + +try { + FileSystem = require('expo-file-system'); +} catch (e) { + // do nothing +} + +if (!FileSystem) { + console.log( + 'expo-file-system is not installed. Installing this package will allow your users to save/delete file locally and access the cache dir for android/iOS.', + ); +} + +export const deleteFile = FileSystem + ? async ({ uri }: { uri: string }) => { + try { + await FileSystem.deleteAsync(uri, { idempotent: true }); + return true; + } catch (error) { + console.log('File deletion failed...'); + return false; + } + } + : null; diff --git a/package/expo-package/src/optionalDependencies/index.ts b/package/expo-package/src/optionalDependencies/index.ts index 1dcd987add..808bd3655e 100644 --- a/package/expo-package/src/optionalDependencies/index.ts +++ b/package/expo-package/src/optionalDependencies/index.ts @@ -2,4 +2,8 @@ export * from './setClipboardString'; export * from './shareImage'; export * from './pickDocument'; export * from './triggerHaptic'; +export * from './deleteFile'; +export * from './saveFile'; +export * from './Audio'; +export * from './Sound'; export * from './Video'; diff --git a/package/expo-package/src/optionalDependencies/saveFile.ts b/package/expo-package/src/optionalDependencies/saveFile.ts new file mode 100644 index 0000000000..d92d0d206e --- /dev/null +++ b/package/expo-package/src/optionalDependencies/saveFile.ts @@ -0,0 +1,25 @@ +let FileSystem; + +try { + FileSystem = require('expo-file-system'); +} catch (e) { + // do nothing +} + +if (!FileSystem) { + console.log( + 'expo-file-system is not installed. Installing this package will allow your users to save/delete file locally and access the cache dir for android/iOS.', + ); +} + +export const saveFile = FileSystem + ? async ({ fileName, fromUrl }: { fileName: string; fromUrl: string }) => { + try { + const path = FileSystem.cacheDirectory + encodeURIComponent(fileName); + const downloadedImage = await FileSystem.downloadAsync(fromUrl, path); + return downloadedImage.uri; + } catch (error) { + throw new Error('Downloading image failed...'); + } + } + : null; diff --git a/package/expo-package/yarn.lock b/package/expo-package/yarn.lock index 3ec683d238..5646029895 100644 --- a/package/expo-package/yarn.lock +++ b/package/expo-package/yarn.lock @@ -1180,31 +1180,6 @@ xcode "^3.0.1" xml2js "0.4.23" -"@expo/config-plugins@^3.0.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-3.1.0.tgz#0752ff33c5eab21cf42034a44e79df97f0f867f8" - integrity sha512-V5qxaxCAExBM0TXmbU1QKiZcAGP3ecu7KXede8vByT15cro5PkcWu2sSdJCYbHQ/gw6Vf/i8sr8gKlN8V8TSLg== - dependencies: - "@expo/config-types" "^42.0.0" - "@expo/json-file" "8.2.33" - "@expo/plist" "0.0.14" - chalk "^4.1.2" - debug "^4.3.1" - find-up "~5.0.0" - fs-extra "9.0.0" - getenv "^1.0.0" - glob "7.1.6" - resolve-from "^5.0.0" - semver "^7.3.5" - slash "^3.0.0" - xcode "^3.0.1" - xml2js "^0.4.23" - -"@expo/config-types@^42.0.0": - version "42.0.0" - resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-42.0.0.tgz#3e3e125ec092c0c34dbfaf19be5480402de3d677" - integrity sha512-Rj02OMZke2MrGa/1Y/EScmR7VuWbDEHPJyvfFyyLbadUt+Yv6isCdeFzDt71I7gJlPR9T4fzixeYLrtXXOTq0w== - "@expo/config-types@^43.0.1": version "43.0.1" resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-43.0.1.tgz#3e047dccb371741a540980eaff26fb0c95039c30" @@ -1278,15 +1253,6 @@ getenv "^1.0.0" sucrase "^3.20.0" -"@expo/plist@0.0.14": - version "0.0.14" - resolved "https://registry.yarnpkg.com/@expo/plist/-/plist-0.0.14.tgz#a756903bd28aabe0a961222df2e7858a39a218c9" - integrity sha512-bb4Ua1M/OdNgS8KiGdSDUjZ/bbPfv3xdPY/lz8Ctp/adlj/QgB8xA7tVPeqSSfJPZqFRwU0qLCnRhpUOnP51VQ== - dependencies: - "@xmldom/xmldom" "~0.7.0" - base64-js "^1.2.3" - xmlbuilder "^14.0.0" - "@expo/plist@0.0.15": version "0.0.15" resolved "https://registry.yarnpkg.com/@expo/plist/-/plist-0.0.15.tgz#41ef37b7bbe6b81c48bf4a5c359661c766bb9e90" @@ -1866,15 +1832,6 @@ expo-error-recovery@~3.0.5: resolved "https://registry.yarnpkg.com/expo-error-recovery/-/expo-error-recovery-3.0.5.tgz#1802b733e998606a8fcfb0abe6682c334319ef75" integrity sha512-VM6OOecjt0aPu5/eCdGGJfNjvAZIemaQym0JF/+SA5IlLiPpEfbVCDTO/5yiS8Zb5fKpeABx+GCRmtfnFqvRRw== -expo-file-system@^11.0.2: - version "11.1.3" - resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-11.1.3.tgz#f344bd175a5f65e2a97d2d6a1fd4c8da06386639" - integrity sha512-FBRcD6ojrkrZiTZ8O7Fbo833HhZtkhKtLDj4RNZIMpF1i+ZBD2bmeMcfLMeRHNYcBeJno9C4AVXoNQFqDCGQDg== - dependencies: - "@expo/config-plugins" "^3.0.0" - expo-modules-core "~0.2.0" - uuid "^3.4.0" - expo-file-system@~13.1.3: version "13.1.4" resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-13.1.4.tgz#08fc20d49b2182e1fd195d95c40cf7eddfe7bd91" @@ -2941,10 +2898,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.32.1: - version "5.32.1" - resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.32.1.tgz#bfc61cb37eb66ffe748984be38e1041b27a55d98" - integrity sha512-3HK9sqXv4I0XTiyMxee0HkvLyKgraE4SkiRYO4ReI0B+D465trl3Uch1OWHKYRcaji97Ne322BMP+rMIm2b4OA== +stream-chat-react-native-core@5.33.0: + version "5.33.0" + resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.33.0.tgz#14f04de90cbc8db011bab8db3fa84abe2dc2eaec" + integrity sha512-V9OJA9MrHzaCw5q16ZRbEktA1HamITbXPOkVZOjpDbb0OBcmedmOnD9C2NFIprc770lhllS/1MKBDr0GdQ9NXQ== dependencies: "@gorhom/bottom-sheet" "4.4.8" dayjs "1.10.5" @@ -3161,7 +3118,7 @@ xcode@^3.0.1: simple-plist "^1.1.0" uuid "^7.0.3" -xml2js@0.4.23, xml2js@^0.4.23: +xml2js@0.4.23: version "0.4.23" resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== diff --git a/package/native-package/package.json b/package/native-package/package.json index 7c28106974..6cdc062167 100644 --- a/package/native-package/package.json +++ b/package/native-package/package.json @@ -16,14 +16,14 @@ "peerDependencies": { "@bam.tech/react-native-image-resizer": ">=3.0.10", "@react-native-camera-roll/camera-roll": ">=5.0.0", - "@react-native-clipboard/clipboard": "^1.11.1", + "@react-native-clipboard/clipboard": ">=1.14.1", "react-native": ">=0.73.6", "react-native-audio-recorder-player": ">=3.6.4", + "react-native-blob-util": ">=0.19.9", "react-native-document-picker": ">=9.0.1", - "react-native-fs": ">=2.16.6", "react-native-haptic-feedback": ">=1.11.0", "react-native-image-crop-picker": ">=0.33.2", - "react-native-share": ">=4.1.0", + "react-native-share": ">=10.2.1", "react-native-video": ">=5.2.1" }, "peerDependenciesMeta": { @@ -44,6 +44,9 @@ }, "react-native-video": { "optional": true + }, + "react-native-blob-util": { + "optional": true } }, "scripts": { @@ -54,7 +57,6 @@ "@bam.tech/react-native-image-resizer": "^3.0.10", "@react-native-camera-roll/camera-roll": "^5.0.2", "react-native": ">=0.73.6", - "react-native-fs": ">=2.16.6", "react-native-image-crop-picker": "^0.38.0" } } diff --git a/package/native-package/src/handlers/deleteFile.ts b/package/native-package/src/handlers/deleteFile.ts deleted file mode 100644 index bfda20a8ed..0000000000 --- a/package/native-package/src/handlers/deleteFile.ts +++ /dev/null @@ -1,11 +0,0 @@ -import RNFS from 'react-native-fs'; - -export const deleteFile = async ({ uri }: { uri: string }) => { - try { - await RNFS.unlink(uri); - return true; - } catch (error) { - console.log('File deletion failed...'); - return false; - } -}; diff --git a/package/native-package/src/handlers/index.ts b/package/native-package/src/handlers/index.ts index ed6bb32e07..e6e7c6ac3f 100644 --- a/package/native-package/src/handlers/index.ts +++ b/package/native-package/src/handlers/index.ts @@ -1,10 +1,6 @@ -export * from './deleteFile'; export * from './compressImage'; export * from './getLocalAssetUri'; export * from './getPhotos'; -export * from './saveFile'; export * from './takePhoto'; -export * from './Sound'; -export * from './Video'; export * from './oniOS14GalleryLibrarySelectionChange'; export * from './iOS14RefreshGallerySelection'; diff --git a/package/native-package/src/handlers/saveFile.ts b/package/native-package/src/handlers/saveFile.ts deleted file mode 100644 index a26b9fedc1..0000000000 --- a/package/native-package/src/handlers/saveFile.ts +++ /dev/null @@ -1,11 +0,0 @@ -import RNFS from 'react-native-fs'; - -export const saveFile = async ({ fileName, fromUrl }: { fileName: string; fromUrl: string }) => { - try { - const path = RNFS.CachesDirectoryPath + '/' + encodeURIComponent(fileName); - await RNFS.downloadFile({ fromUrl, toFile: path }).promise; - return 'file://' + path; - } catch (error) { - throw new Error('Downloading image failed...'); - } -}; diff --git a/package/native-package/src/index.js b/package/native-package/src/index.js index 4c02a19f47..b8880b3479 100644 --- a/package/native-package/src/index.js +++ b/package/native-package/src/index.js @@ -4,23 +4,23 @@ import { registerNativeHandlers } from 'stream-chat-react-native-core'; import { compressImage, - deleteFile, getLocalAssetUri, getPhotos, iOS14RefreshGallerySelection, oniOS14GalleryLibrarySelectionChange, - saveFile, - Sound, takePhoto, - Video, } from './handlers'; import { Audio, + deleteFile, pickDocument, + saveFile, setClipboardString, shareImage, + Sound, triggerHaptic, + Video, } from './optionalDependencies'; registerNativeHandlers({ diff --git a/package/native-package/src/optionalDependencies/Audio.ts b/package/native-package/src/optionalDependencies/Audio.ts index 7de216b604..7129c6198d 100644 --- a/package/native-package/src/optionalDependencies/Audio.ts +++ b/package/native-package/src/optionalDependencies/Audio.ts @@ -1,8 +1,15 @@ import { PermissionsAndroid, Platform } from 'react-native'; -import RNFS from 'react-native-fs'; let AudioRecorderPackage; let audioRecorderPlayer; +let RNBlobUtil; + +try { + RNBlobUtil = require('react-native-blob-util').default; +} catch (e) { + console.log('react-native-blob-util is not installed'); +} + try { AudioRecorderPackage = require('react-native-audio-recorder-player').default; audioRecorderPlayer = new AudioRecorderPackage(); @@ -168,74 +175,74 @@ const verifyAndroidPermissions = async () => { return true; }; -export const Audio = AudioRecorderPackage - ? { - pausePlayer: async () => { - await audioRecorderPlayer.pausePlayer(); - }, - resumePlayer: async () => { - await audioRecorderPlayer.resumePlayer(); - }, - startPlayer: async (uri, _, onPlaybackStatusUpdate) => { - try { - const playback = await audioRecorderPlayer.startPlayer(uri); - console.log({ playback }); - audioRecorderPlayer.addPlayBackListener((status) => { - onPlaybackStatusUpdate(status); - }); - } catch (error) { - console.log('Error starting player', error); - } - }, - startRecording: async (options: RecordingOptions, onRecordingStatusUpdate) => { - if (Platform.OS === 'android') { +export const Audio = + AudioRecorderPackage && RNBlobUtil + ? { + pausePlayer: async () => { + await audioRecorderPlayer.pausePlayer(); + }, + resumePlayer: async () => { + await audioRecorderPlayer.resumePlayer(); + }, + startPlayer: async (uri, _, onPlaybackStatusUpdate) => { try { - await verifyAndroidPermissions(); - } catch (err) { - console.warn('Audio Recording Permissions error', err); - return; + await audioRecorderPlayer.startPlayer(uri); + audioRecorderPlayer.addPlayBackListener((status) => { + onPlaybackStatusUpdate(status); + }); + } catch (error) { + console.log('Error starting player', error); } - } - try { - const path = Platform.select({ - android: `${RNFS.CachesDirectoryPath}/sound.aac`, - ios: 'sound.aac', - }); - const audioSet = { - AudioEncoderAndroid: AudioEncoderAndroidType.AAC, - AudioSourceAndroid: AudioSourceAndroidType.MIC, - AVEncoderAudioQualityKeyIOS: AVEncoderAudioQualityIOSType.high, - AVFormatIDKeyIOS: AVEncodingOption.aac, - AVModeIOS: AVModeIOSOption.measurement, - AVNumberOfChannelsKeyIOS: 2, - OutputFormatAndroid: OutputFormatAndroidType.AAC_ADTS, - }; - const recording = await audioRecorderPlayer.startRecorder( - path, - audioSet, - options?.isMeteringEnabled, - ); - - audioRecorderPlayer.addRecordBackListener((status) => { - onRecordingStatusUpdate(status); - }); - return { accessGranted: true, recording }; - } catch (error) { - console.error('Failed to start recording', error); - return { accessGranted: false, recording: null }; - } - }, - stopPlayer: async () => { - try { - await audioRecorderPlayer.stopPlayer(); - audioRecorderPlayer.removePlayBackListener(); - } catch (error) { - console.log(error); - } - }, - stopRecording: async () => { - await audioRecorderPlayer.stopRecorder(); - audioRecorderPlayer.removeRecordBackListener(); - }, - } - : null; + }, + startRecording: async (options: RecordingOptions, onRecordingStatusUpdate) => { + if (Platform.OS === 'android') { + try { + await verifyAndroidPermissions(); + } catch (err) { + console.warn('Audio Recording Permissions error', err); + return; + } + } + try { + const path = Platform.select({ + android: `${RNBlobUtil.fs.dirs.CacheDir}/sound.aac`, + ios: 'sound.aac', + }); + const audioSet = { + AudioEncoderAndroid: AudioEncoderAndroidType.AAC, + AudioSourceAndroid: AudioSourceAndroidType.MIC, + AVEncoderAudioQualityKeyIOS: AVEncoderAudioQualityIOSType.high, + AVFormatIDKeyIOS: AVEncodingOption.aac, + AVModeIOS: AVModeIOSOption.measurement, + AVNumberOfChannelsKeyIOS: 2, + OutputFormatAndroid: OutputFormatAndroidType.AAC_ADTS, + }; + const recording = await audioRecorderPlayer.startRecorder( + path, + audioSet, + options?.isMeteringEnabled, + ); + + audioRecorderPlayer.addRecordBackListener((status) => { + onRecordingStatusUpdate(status); + }); + return { accessGranted: true, recording }; + } catch (error) { + console.error('Failed to start recording', error); + return { accessGranted: false, recording: null }; + } + }, + stopPlayer: async () => { + try { + await audioRecorderPlayer.stopPlayer(); + audioRecorderPlayer.removePlayBackListener(); + } catch (error) { + console.log(error); + } + }, + stopRecording: async () => { + await audioRecorderPlayer.stopRecorder(); + audioRecorderPlayer.removeRecordBackListener(); + }, + } + : null; diff --git a/package/native-package/src/optionalDependencies/Video.ts b/package/native-package/src/optionalDependencies/AudioVideo.ts similarity index 100% rename from package/native-package/src/optionalDependencies/Video.ts rename to package/native-package/src/optionalDependencies/AudioVideo.ts diff --git a/package/native-package/src/handlers/Sound.tsx b/package/native-package/src/optionalDependencies/Sound.tsx similarity index 91% rename from package/native-package/src/handlers/Sound.tsx rename to package/native-package/src/optionalDependencies/Sound.tsx index 14638c0641..cbae1be31a 100644 --- a/package/native-package/src/handlers/Sound.tsx +++ b/package/native-package/src/optionalDependencies/Sound.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import AudioVideoPlayer from '../optionalDependencies/Video'; +import AudioVideoPlayer from './AudioVideo'; export const Sound = { initializeSound: null, diff --git a/package/native-package/src/handlers/Video.tsx b/package/native-package/src/optionalDependencies/Video.tsx similarity index 90% rename from package/native-package/src/handlers/Video.tsx rename to package/native-package/src/optionalDependencies/Video.tsx index 26759ded21..69ae2b7acb 100644 --- a/package/native-package/src/handlers/Video.tsx +++ b/package/native-package/src/optionalDependencies/Video.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import AudioVideoPlayer from '../optionalDependencies/Video'; +import AudioVideoPlayer from './AudioVideo'; export const Video = AudioVideoPlayer ? ({ onBuffer, onEnd, onLoad, onProgress, paused, repeat, resizeMode, style, uri, videoRef }) => ( { + try { + await RNBlobUtil.fs.unlink(uri); + return true; + } catch (error) { + console.log('File deletion failed...'); + return false; + } + } + : null; diff --git a/package/native-package/src/optionalDependencies/index.ts b/package/native-package/src/optionalDependencies/index.ts index fbb2228b1f..fde8d55680 100644 --- a/package/native-package/src/optionalDependencies/index.ts +++ b/package/native-package/src/optionalDependencies/index.ts @@ -4,3 +4,6 @@ export * from './Video'; export * from './triggerHaptic'; export * from './setClipboardString'; export * from './pickDocument'; +export * from './saveFile'; +export * from './deleteFile'; +export * from './Sound'; diff --git a/package/native-package/src/optionalDependencies/saveFile.ts b/package/native-package/src/optionalDependencies/saveFile.ts new file mode 100644 index 0000000000..7dff9f4b79 --- /dev/null +++ b/package/native-package/src/optionalDependencies/saveFile.ts @@ -0,0 +1,23 @@ +let RNBlobUtil; + +try { + RNBlobUtil = require('react-native-blob-util').default; +} catch (e) { + console.log('react-native-blob-util is not installed'); +} + +export const saveFile = RNBlobUtil + ? async ({ fileName, fromUrl }) => { + try { + const path = RNBlobUtil.fs.dirs.CacheDir + '/' + encodeURIComponent(fileName); + await RNBlobUtil.config({ + fileCache: true, + path, + }).fetch('GET', fromUrl); + + return path; + } catch (error) { + throw new Error('Downloading image failed...'); + } + } + : null; diff --git a/package/native-package/src/optionalDependencies/shareImage.ts b/package/native-package/src/optionalDependencies/shareImage.ts index 53d6564649..2a960b5c84 100644 --- a/package/native-package/src/optionalDependencies/shareImage.ts +++ b/package/native-package/src/optionalDependencies/shareImage.ts @@ -1,5 +1,4 @@ import { Platform } from 'react-native'; -import RNFS from 'react-native-fs'; let RNShare; @@ -9,10 +8,18 @@ try { console.log('react-native-share is not installed'); } +let RNBlobUtil; + +try { + RNBlobUtil = require('react-native-blob-util').default; +} catch (e) { + console.log('react-native-blob-util is not installed'); +} + export const shareImage = RNShare ? async ({ type, url }) => { try { - const base64Image = await RNFS.readFile(url, 'base64'); + const base64Image = await RNBlobUtil.fs.readFile(url, 'base64'); const base64Url = `data:${type};base64,${base64Image}`; await RNShare.open({ activityItemSources: @@ -35,9 +42,6 @@ export const shareImage = RNShare }, ] : undefined, - // react-native-share has a typing issue, where their docs confirm that - // this property should be an array of strings, but the type is a string - // in the @types/react-native-share package. excludedActivityTypes: [] as unknown as string, failOnCancel: false, type, @@ -45,7 +49,7 @@ export const shareImage = RNShare }); return true; } catch (error) { - console.warn('Sharing failed...'); + console.warn('Sharing failed...', error); } } : null; diff --git a/package/native-package/yarn.lock b/package/native-package/yarn.lock index df5d541b1d..7aab6ffcda 100644 --- a/package/native-package/yarn.lock +++ b/package/native-package/yarn.lock @@ -1722,11 +1722,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base-64@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" - integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA== - base64-js@^1.3.1, base64-js@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" @@ -3647,14 +3642,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-fs@>=2.16.6: - version "2.20.0" - resolved "https://registry.yarnpkg.com/react-native-fs/-/react-native-fs-2.20.0.tgz#05a9362b473bfc0910772c0acbb73a78dbc810f6" - integrity sha512-VkTBzs7fIDUiy/XajOSNk0XazFE9l+QlMAce7lGuebZcag5CnjszB+u4BdqzwaQOdcYb5wsJIsqq4kxInIRpJQ== - dependencies: - base-64 "^0.1.0" - utf8 "^3.0.0" - react-native-image-crop-picker@^0.38.0: version "0.38.1" resolved "https://registry.yarnpkg.com/react-native-image-crop-picker/-/react-native-image-crop-picker-0.38.1.tgz#5973b4a8b55835b987e6be2064de411e849ac005" @@ -4083,10 +4070,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.32.1: - version "5.32.1" - resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.32.1.tgz#bfc61cb37eb66ffe748984be38e1041b27a55d98" - integrity sha512-3HK9sqXv4I0XTiyMxee0HkvLyKgraE4SkiRYO4ReI0B+D465trl3Uch1OWHKYRcaji97Ne322BMP+rMIm2b4OA== +stream-chat-react-native-core@5.33.0: + version "5.33.0" + resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.33.0.tgz#14f04de90cbc8db011bab8db3fa84abe2dc2eaec" + integrity sha512-V9OJA9MrHzaCw5q16ZRbEktA1HamITbXPOkVZOjpDbb0OBcmedmOnD9C2NFIprc770lhllS/1MKBDr0GdQ9NXQ== dependencies: "@gorhom/bottom-sheet" "4.4.8" dayjs "1.10.5" @@ -4327,11 +4314,6 @@ update-browserslist-db@^1.0.11: escalade "^3.1.1" picocolors "^1.0.0" -utf8@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" - integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== - 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/package/src/components/Attachment/Attachment.tsx b/package/src/components/Attachment/Attachment.tsx index e7ace05600..85a3faa99f 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 { isVideoPackageAvailable } from '../../native'; +import { Video } from '../../native'; import type { DefaultStreamChatGenerics } from '../../types/types'; @@ -75,7 +75,7 @@ const AttachmentWithContext = < } if (attachment.type === 'video' && !attachment.og_scrape_url) { - return isVideoPackageAvailable() ? ( + return Video ? ( <> {hasAttachmentActions && ( diff --git a/package/src/components/Attachment/FileAttachmentGroup.tsx b/package/src/components/Attachment/FileAttachmentGroup.tsx index d8898162c5..38e14fead2 100644 --- a/package/src/components/Attachment/FileAttachmentGroup.tsx +++ b/package/src/components/Attachment/FileAttachmentGroup.tsx @@ -15,7 +15,7 @@ import { useMessagesContext, } from '../../contexts/messagesContext/MessagesContext'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; -import { isAudioPackageAvailable } from '../../native'; +import { isSoundPackageAvailable } from '../../native'; import type { DefaultStreamChatGenerics } from '../../types/types'; @@ -123,7 +123,7 @@ const FileAttachmentGroupWithContext = < ]} > {(file.type === 'audio' || file.type === 'voiceRecording') && - isAudioPackageAvailable() ? ( + isSoundPackageAvailable() ? ( { // If the url is defined then only try to open the file. if (thumbnail.url) { - if (thumbnail.type === 'video' && !isVideoPackageAvailable()) { + if (thumbnail.type === 'video' && !Video) { // 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 357e71bb9f..3c8c01e112 100644 --- a/package/src/components/Attachment/__tests__/Attachment.test.js +++ b/package/src/components/Attachment/__tests__/Attachment.test.js @@ -14,13 +14,16 @@ import { generateVideoAttachment, } from '../../../mock-builders/generator/attachment'; import { generateMessage } from '../../../mock-builders/generator/message'; -import * as NativeUtils from '../../../native'; import { ImageLoadingFailedIndicator } from '../../Attachment/ImageLoadingFailedIndicator'; import { ImageLoadingIndicator } from '../../Attachment/ImageLoadingIndicator'; import { Attachment } from '../Attachment'; import { AttachmentActions } from '../AttachmentActions'; +jest.mock('../../../native.ts', () => ({ + Video: null, +})); + const getAttachmentComponent = (props) => { const message = generateMessage(); return ( @@ -50,7 +53,6 @@ describe('Attachment', () => { }); it('should render File component for "video" type attachment', async () => { - jest.spyOn(NativeUtils, 'isVideoPackageAvailable').mockImplementation(jest.fn(() => false)); const attachment = generateVideoAttachment(); const { getByTestId } = render(getAttachmentComponent({ attachment })); diff --git a/package/src/components/Attachment/__tests__/Gallery.test.js b/package/src/components/Attachment/__tests__/Gallery.test.js index cff285fc44..57a06a0f3c 100644 --- a/package/src/components/Attachment/__tests__/Gallery.test.js +++ b/package/src/components/Attachment/__tests__/Gallery.test.js @@ -21,7 +21,6 @@ import { generateMember } from '../../../mock-builders/generator/member'; import { generateMessage } from '../../../mock-builders/generator/message'; import { generateUser } from '../../../mock-builders/generator/user'; import { getTestClientWithUser } from '../../../mock-builders/mock'; -import * as NativeUtils from '../../../native'; import { Channel } from '../../Channel/Channel'; import { Chat } from '../../Chat/Chat'; import { MessageList } from '../../MessageList/MessageList'; @@ -81,7 +80,6 @@ describe('Gallery', () => { }); it('should render one image and one video attachment', async () => { - jest.spyOn(NativeUtils, 'isVideoPackageAvailable').mockImplementation(jest.fn(() => true)); const attachment1 = generateImageAttachment({ original_height: 600, original_width: 400, diff --git a/package/src/components/ImageGallery/ImageGallery.tsx b/package/src/components/ImageGallery/ImageGallery.tsx index bf6f52690d..ca76d87adf 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 { isVideoPackageAvailable, VideoType } from '../../native'; +import { Video, 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)) || - (isVideoPackageAvailable() && attachment.type === 'video'), + (Video && attachment.type === 'video'), ) .reverse() || []; diff --git a/package/src/components/ImageGallery/__tests__/AnimatedVideoGallery.test.tsx b/package/src/components/ImageGallery/__tests__/AnimatedVideoGallery.test.tsx index 015d5f6152..f3673201ce 100644 --- a/package/src/components/ImageGallery/__tests__/AnimatedVideoGallery.test.tsx +++ b/package/src/components/ImageGallery/__tests__/AnimatedVideoGallery.test.tsx @@ -10,14 +10,6 @@ import { ThemeProvider } from '../../../contexts/themeContext/ThemeContext'; import { defaultTheme } from '../../../contexts/themeContext/utils/theme'; import { AnimatedGalleryVideo, AnimatedGalleryVideoType } from '../components/AnimatedGalleryVideo'; -jest.mock('../../../native.ts', () => { - const View = require('react-native/Libraries/Components/View/View'); - return { - isVideoPackageAvailable: jest.fn(() => true), - Video: View, - }; -}); - const getComponent = (props: Partial) => ( diff --git a/package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx b/package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx index a6d919ec82..dd84a9dcbf 100644 --- a/package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +++ b/package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx @@ -24,7 +24,6 @@ import { ImageGallery } from '../ImageGallery'; jest.mock('../../../native.ts', () => { const View = require('react-native/Libraries/Components/View/View'); return { - isVideoPackageAvailable: 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 7b17012ba5..e56892963b 100644 --- a/package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +++ b/package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx @@ -28,7 +28,6 @@ jest.mock('../../../native.ts', () => { const View = require('react-native/Libraries/Components/View/View'); return { deleteFile: jest.fn(), - isVideoPackageAvailable: 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 dd30cb5b6b..2021feb50c 100644 --- a/package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx +++ b/package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx @@ -30,7 +30,6 @@ import { ImageGallery, ImageGalleryCustomComponents } from '../ImageGallery'; jest.mock('../../../native.ts', () => { const View = require('react-native/Libraries/Components/View/View'); return { - isVideoPackageAvailable: jest.fn(() => true), Video: View, }; }); diff --git a/package/src/components/ImageGallery/__tests__/ImageGalleryOverlay.test.tsx b/package/src/components/ImageGallery/__tests__/ImageGalleryOverlay.test.tsx index 20111f1eed..b008904e67 100644 --- a/package/src/components/ImageGallery/__tests__/ImageGalleryOverlay.test.tsx +++ b/package/src/components/ImageGallery/__tests__/ImageGalleryOverlay.test.tsx @@ -19,14 +19,11 @@ import { import { generateImageAttachment } from '../../../mock-builders/generator/attachment'; import { generateMessage } from '../../../mock-builders/generator/message'; import { getTestClientWithUser } from '../../../mock-builders/mock'; -import * as NativeUtils from '../../../native'; import type { DefaultStreamChatGenerics } from '../../../types/types'; import type { MessageType } from '../../MessageList/hooks/useMessageList'; import { ImageGalleryOverlay } from '../components/ImageGalleryOverlay'; describe('ImageGalleryOverlay', () => { - jest.spyOn(NativeUtils, 'isVideoPackageAvailable').mockImplementation(() => true); - it('should have currentBottomSheetIndex as a prop', async () => { const chatClient = await getTestClientWithUser({ id: 'testID' }); const setOverlayMock = jest.fn(); diff --git a/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx b/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx index 0768a5286b..cc9519e6d8 100644 --- a/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +++ b/package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx @@ -5,7 +5,6 @@ import Animated, { useAnimatedStyle } from 'react-native-reanimated'; import { useViewport } from '../../../hooks/useViewport'; import { - isVideoPackageAvailable, PlaybackStatus, Video, VideoPayloadData, @@ -187,7 +186,7 @@ export const AnimatedGalleryVideo = React.memo( }, ]} > - {isVideoPackageAvailable() && ( + {Video ? (