diff --git a/docs-validation/1_introduction/NativeModules.tsx b/docs-validation/1_introduction/NativeModules.tsx index 3ed692481..e19675848 100644 --- a/docs-validation/1_introduction/NativeModules.tsx +++ b/docs-validation/1_introduction/NativeModules.tsx @@ -25,7 +25,7 @@ import * as DocumentPicker from '@react-native-documents/picker'; import * as FileAccess from 'react-native-file-access'; import * as ImagePicker from 'react-native-image-picker'; import * as Permissions from 'react-native-permissions'; -import * as CreateThumbnail from 'react-native-create-thumbnail'; +import * as CreateThumbnail from '@sendbird/react-native-create-thumbnail'; import * as ImageResizer from '@bam.tech/react-native-image-resizer'; import * as AudioRecorderPlayer from 'react-native-nitro-sound'; diff --git a/docs-validation/1_introduction/SendYourFirstMessage.tsx b/docs-validation/1_introduction/SendYourFirstMessage.tsx index 8b9df89f8..53cca25bf 100644 --- a/docs-validation/1_introduction/SendYourFirstMessage.tsx +++ b/docs-validation/1_introduction/SendYourFirstMessage.tsx @@ -22,7 +22,7 @@ import * as DocumentPicker from '@react-native-documents/picker'; import * as FileAccess from 'react-native-file-access'; import * as ImagePicker from 'react-native-image-picker'; import * as Permissions from 'react-native-permissions'; -import * as CreateThumbnail from 'react-native-create-thumbnail'; +import * as CreateThumbnail from '@sendbird/react-native-create-thumbnail'; import * as ImageResizer from '@bam.tech/react-native-image-resizer'; import * as AudioRecorderPlayer from 'react-native-nitro-sound'; diff --git a/docs-validation/package.json b/docs-validation/package.json index bbcb3e23c..edd78c168 100644 --- a/docs-validation/package.json +++ b/docs-validation/package.json @@ -19,7 +19,7 @@ "date-fns": "^4.1.0", "react": "19.1.1", "react-native": "0.82.1", - "react-native-create-thumbnail": "^2.0.0", + "@sendbird/react-native-create-thumbnail": "^1.0.2", "react-native-file-access": "^3.1.0", "react-native-image-picker": "^8.2.0", "react-native-mmkv": "^4.0.0", diff --git a/packages/uikit-react-native/README.md b/packages/uikit-react-native/README.md index 3d69e1b3c..912cc5188 100644 --- a/packages/uikit-react-native/README.md +++ b/packages/uikit-react-native/README.md @@ -149,12 +149,12 @@ npm install react-native-video \ react-native-file-access \ react-native-image-picker \ react-native-document-picker \ - react-native-create-thumbnail \ react-native-nitro-sound \ @react-native-clipboard/clipboard \ @react-native-camera-roll/camera-roll \ @react-native-firebase/app \ @react-native-firebase/messaging \ + @sendbird/react-native-create-thumbnail \ @bam.tech/react-native-image-resizer npx pod-install @@ -169,7 +169,7 @@ import * as DocumentPicker from '@react-native-documents/picker'; import * as FileAccess from 'react-native-file-access'; import * as ImagePicker from 'react-native-image-picker'; import * as Permissions from 'react-native-permissions'; -import * as CreateThumbnail from 'react-native-create-thumbnail'; +import * as CreateThumbnail from '@sendbird/react-native-create-thumbnail'; import * as ImageResizer from '@bam.tech/react-native-image-resizer'; import * as AudioRecorderPlayer from 'react-native-nitro-sound'; diff --git a/packages/uikit-react-native/package.json b/packages/uikit-react-native/package.json index 29536efcf..6450a8171 100644 --- a/packages/uikit-react-native/package.json +++ b/packages/uikit-react-native/package.json @@ -83,6 +83,7 @@ "@react-native-documents/picker": "^10.1.0", "@react-native-firebase/app": "^19.3.0", "@react-native-firebase/messaging": "^19.3.0", + "@sendbird/react-native-create-thumbnail": "^1.0.2", "@types/react": "*", "@types/react-native": "*", "date-fns": ">=2.28.0", @@ -126,6 +127,7 @@ "@react-native-documents/picker": ">=10.0.0", "@react-native-firebase/messaging": ">=14.4.0", "@sendbird/chat": "^4.20.2", + "@sendbird/react-native-create-thumbnail": ">=1.0.2", "@sendbird/react-native-scrollview-enhancer": "*", "@sendbird/uikit-tools": ">=0.0.10", "date-fns": ">=2.28.0", @@ -173,6 +175,9 @@ "@react-native-firebase/messaging": { "optional": true }, + "@sendbird/react-native-create-thumbnail": { + "optional": true + }, "@sendbird/react-native-scrollview-enhancer": { "optional": true }, diff --git a/packages/uikit-react-native/src/platform/createMediaService.native.tsx b/packages/uikit-react-native/src/platform/createMediaService.native.tsx index d791c5845..8c6634038 100644 --- a/packages/uikit-react-native/src/platform/createMediaService.native.tsx +++ b/packages/uikit-react-native/src/platform/createMediaService.native.tsx @@ -3,14 +3,17 @@ import React from 'react'; import type * as RNCreateThumbnail from 'react-native-create-thumbnail'; import type RNVideo from 'react-native-video'; +import type * as SBCreateThumbnail from '@sendbird/react-native-create-thumbnail'; import { getDownscaleSize, getFileExtension, hash } from '@sendbird/uikit-utils'; import SBUUtils from '../libs/SBUUtils'; import type { MediaServiceInterface } from './types'; +export type ThumbnailModule = typeof SBCreateThumbnail | typeof RNCreateThumbnail; + type Modules = { VideoComponent: typeof RNVideo; - thumbnailModule: typeof RNCreateThumbnail; + thumbnailModule: ThumbnailModule; imageResizerModule: typeof RNImageResizer; }; diff --git a/patches/react-native-create-thumbnail+2.1.1.patch b/patches/react-native-create-thumbnail+2.1.1.patch deleted file mode 100644 index 47898781f..000000000 --- a/patches/react-native-create-thumbnail+2.1.1.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- a/node_modules/react-native-create-thumbnail/android/build.gradle -+++ b/node_modules/react-native-create-thumbnail/android/build.gradle -@@ -38,9 +38,6 @@ - } - } - --apply plugin: 'com.android.library' --apply plugin: 'maven-publish' -- - android { - def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION - if (agpVersion.tokenize('.')[0].toInteger() >= 7) { -@@ -58,6 +55,11 @@ - lintOptions { - abortOnError false - } -+ -+ // Add for Gradle 9.0 compatibility -+ buildFeatures { -+ buildConfig true -+ } - } - - repositories { -@@ -114,9 +116,8 @@ - // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs -- classpath += files(android.bootClasspath) -- project.getConfigurations().implementation.setCanBeResolved(true) -- classpath += files(project.getConfigurations().getByName('implementation').asList()) -+ // Removed deprecated classpath configuration for Gradle 9.0 -+ // These methods are not compatible with newer Gradle versions - include '**/*.java' - } - -@@ -134,7 +135,7 @@ - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - task "jar${name}"(type: Jar, dependsOn: variant.javaCompileProvider) { -- from variant.javaCompileProvider.get().destinationDir -+ from variant.javaCompileProvider.get().destinationDirectory - } - } - -@@ -151,18 +152,3 @@ - } - } - } -- --def myAttribute = Attribute.of("com.android.build.api.attributes.BuildTypeAttr", String) -- --dependencies.attributesSchema { -- // registers this attribute to the attributes schema -- attribute(myAttribute) --} -- --configurations { -- implementation { -- attributes { -- attribute(myAttribute, "release") -- } -- } --} diff --git a/sample/ios/Podfile.lock b/sample/ios/Podfile.lock index ef00b482d..ca254a78a 100644 --- a/sample/ios/Podfile.lock +++ b/sample/ios/Podfile.lock @@ -1995,8 +1995,6 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - react-native-create-thumbnail (2.1.1): - - React-Core - react-native-document-picker (10.1.7): - boost - DoubleConversion @@ -3053,6 +3051,8 @@ PODS: - SDWebImageWebPCoder (0.8.5): - libwebp (~> 1.0) - SDWebImage/Core (~> 5.10) + - sendbird-react-native-create-thumbnail (1.0.2): + - React-Core - SocketRocket (0.7.1) - Yoga (0.0.0) - ZIPFoundation (0.9.20) @@ -3109,7 +3109,6 @@ DEPENDENCIES: - React-Mapbuffer (from `../../node_modules/react-native/ReactCommon`) - React-microtasksnativemodule (from `../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`) - "react-native-cameraroll (from `../../node_modules/@react-native-camera-roll/camera-roll`)" - - react-native-create-thumbnail (from `../../node_modules/react-native-create-thumbnail`) - "react-native-document-picker (from `../../node_modules/@react-native-documents/picker`)" - react-native-image-picker (from `../../node_modules/react-native-image-picker`) - "react-native-image-resizer (from `../../node_modules/@bam.tech/react-native-image-resizer`)" @@ -3161,6 +3160,7 @@ DEPENDENCIES: - "RNNotifeeCore (from `../../node_modules/@notifee/react-native/RNNotifeeCore.podspec`)" - RNPermissions (from `../../node_modules/react-native-permissions`) - RNScreens (from `../../node_modules/react-native-screens`) + - "sendbird-react-native-create-thumbnail (from `../../node_modules/@sendbird/react-native-create-thumbnail`)" - SocketRocket (~> 0.7.1) - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`) @@ -3274,8 +3274,6 @@ EXTERNAL SOURCES: :path: "../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks" react-native-cameraroll: :path: "../../node_modules/@react-native-camera-roll/camera-roll" - react-native-create-thumbnail: - :path: "../../node_modules/react-native-create-thumbnail" react-native-document-picker: :path: "../../node_modules/@react-native-documents/picker" react-native-image-picker: @@ -3378,6 +3376,8 @@ EXTERNAL SOURCES: :path: "../../node_modules/react-native-permissions" RNScreens: :path: "../../node_modules/react-native-screens" + sendbird-react-native-create-thumbnail: + :path: "../../node_modules/@sendbird/react-native-create-thumbnail" Yoga: :path: "../../node_modules/react-native/ReactCommon/yoga" @@ -3439,7 +3439,6 @@ SPEC CHECKSUMS: React-Mapbuffer: 06d59c448da7e34eb05b3fb2189e12f6a30fec57 React-microtasksnativemodule: d1ee999dc9052e23f6488b730fa2d383a4ea40e5 react-native-cameraroll: bb98380ee21115d5fe1ae0f8b80c86e044613746 - react-native-create-thumbnail: 733160dca9a548262e1030e7fcdae90a93d203ca react-native-document-picker: 1734eb0aa3dbd1cd7bf1b105936f9b55031ae616 react-native-image-picker: 0314366753615115fa55c3cc937ac44cb7e75702 react-native-image-resizer: 290b045c34c69db7574e4d08aadfc4abe1ff5a99 @@ -3493,6 +3492,7 @@ SPEC CHECKSUMS: RNScreens: d821082c6dd1cb397cc0c98b026eeafaa68be479 SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d + sendbird-react-native-create-thumbnail: 60f24fb637306b6914307e678435909172fb9143 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: 689c8e04277f3ad631e60fe2a08e41d411daf8eb ZIPFoundation: dfd3d681c4053ff7e2f7350bc4e53b5dba3f5351 diff --git a/sample/package.json b/sample/package.json index 004e63c35..6992d4b5b 100644 --- a/sample/package.json +++ b/sample/package.json @@ -30,6 +30,7 @@ "@react-navigation/native": "^6.1.17", "@react-navigation/native-stack": "^6.10.0", "@sendbird/chat": "^4.20.2", + "@sendbird/react-native-create-thumbnail": "^1.0.2", "@storybook/addon-actions": "^6.4.19", "@storybook/addon-controls": "^6.4.19", "@storybook/addon-ondevice-actions": "^6.0.1-alpha.7", @@ -40,7 +41,6 @@ "fbjs": "^3.0.4", "react": "19.1.1", "react-native": "0.82.1", - "react-native-create-thumbnail": "^2.1.1", "react-native-fast-image": "^8.6.3", "react-native-file-access": "^3.1.1", "react-native-image-picker": "^8.2.0", diff --git a/sample/src/factory/index.ts b/sample/src/factory/index.ts index 8a985e6a2..d248e7bb0 100644 --- a/sample/src/factory/index.ts +++ b/sample/src/factory/index.ts @@ -5,13 +5,13 @@ import * as DocumentPicker from '@react-native-documents/picker'; import RNFBMessaging from '@react-native-firebase/messaging'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { Platform, StatusBar } from 'react-native'; -import * as CreateThumbnail from 'react-native-create-thumbnail'; import * as FileAccess from 'react-native-file-access'; import * as ImagePicker from 'react-native-image-picker'; import * as AudioRecorderPlayer from 'react-native-nitro-sound'; import * as Permissions from 'react-native-permissions'; import Video from 'react-native-video'; +import * as CreateThumbnail from '@sendbird/react-native-create-thumbnail'; import { SendbirdUIKitContainerProps, createNativeClipboardService, diff --git a/sample/yalc.lock b/sample/yalc.lock new file mode 100644 index 000000000..50066c878 --- /dev/null +++ b/sample/yalc.lock @@ -0,0 +1,9 @@ +{ + "version": "v1", + "packages": { + "@sendbird/react-native-create-thumbnail": { + "signature": "1d16a7c126a37e3e3730650bcfd5ffde", + "file": true + } + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index c6b7ac119..ddc05794f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3683,6 +3683,11 @@ resolved "https://registry.yarnpkg.com/@sendbird/chat/-/chat-4.20.2.tgz#7d2f693054e43f699260d466e9342890741d15d9" integrity sha512-yvwYPbiYytmYifFGyFnNO8dX3ceON+HTVLBslsS2wzx/rF8ZJNs8l+gLbRg4KsxhV9AvLmpU9IoJEDipl3rJYg== +"@sendbird/react-native-create-thumbnail@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@sendbird/react-native-create-thumbnail/-/react-native-create-thumbnail-1.0.2.tgz#e5e7de86ebe05d5b40d5ad26a21b631b5043a51e" + integrity sha512-v13kjlRmSpjmGHwHzpk1eFGP5pOr+paxiOfvu01C7fvrmAAAreBL6mG3VW20wr8GxnVtbCLs1nJXBpabGnstog== + "@sendbird/uikit-tools@0.0.15": version "0.0.15" resolved "https://registry.yarnpkg.com/@sendbird/uikit-tools/-/uikit-tools-0.0.15.tgz#86a1ac41fdf1624b984bd8f875d1091ac5842afa" @@ -13219,7 +13224,7 @@ react-native-builder-bob@^0.18.0: optionalDependencies: jetifier "^2.0.0" -react-native-create-thumbnail@^2.0.0, react-native-create-thumbnail@^2.1.1: +react-native-create-thumbnail@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/react-native-create-thumbnail/-/react-native-create-thumbnail-2.1.1.tgz#633fa52ac17fdf78d19c2c5201382d449f296094" integrity sha512-3rawLi0mZiKfPh53C3mbrI9EVVzLWLYiDynUdpAe/I36XbSSFupxP9+g10/rrhhTNX8NSg/4zAC8Z7P9epnt+g==