@imgly/camera-react-native 1.48.0 → 1.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,16 +6,38 @@ buildscript {
6
6
  google()
7
7
  gradlePluginPortal()
8
8
  }
9
- dependencies {
10
- classpath("com.android.tools.build:gradle:7.3.1")
11
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22")
12
- }
13
9
  }
14
10
 
15
11
  def isNewArchitectureEnabled() {
16
12
  return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
17
13
  }
18
14
 
15
+ def getKotlinVersion() {
16
+ return project.plugins.findPlugin("kotlin-android")?.class?.package?.implementationVersion
17
+ }
18
+
19
+ def isKotlin2OrHigher() {
20
+ def kotlinVersion = getKotlinVersion()
21
+ if (kotlinVersion) {
22
+ def mainVersion = kotlinVersion.split('-')[0]
23
+ def versionParts = mainVersion.tokenize('.').collect { it.toInteger() }
24
+ return versionParts[0] >= 2
25
+ }
26
+ return false
27
+ }
28
+
29
+ def getComposeVersion() {
30
+ if (isKotlin2OrHigher()) {
31
+ def mainVersion = getKotlinVersion().split('-')[0]
32
+ return mainVersion
33
+ }
34
+ return gradle.ext.has("kotlinCompilerExtensionVersion") ? gradle.ext.kotlinCompilerExtensionVersion : "1.5.10"
35
+ }
36
+
37
+ if (isKotlin2OrHigher()) {
38
+ project.plugins.apply('org.jetbrains.kotlin.plugin.compose')
39
+ }
40
+
19
41
  apply plugin: 'com.android.library'
20
42
  apply plugin: 'com.facebook.react'
21
43
  apply plugin: 'org.jetbrains.kotlin.android'
@@ -43,8 +65,10 @@ android {
43
65
  compose true
44
66
  }
45
67
 
46
- composeOptions {
47
- kotlinCompilerExtensionVersion = "1.5.10"
68
+ if (!isKotlin2OrHigher()) {
69
+ composeOptions {
70
+ kotlinCompilerExtensionVersion = getComposeVersion()
71
+ }
48
72
  }
49
73
  }
50
74
 
@@ -54,7 +78,7 @@ repositories {
54
78
  }
55
79
 
56
80
  dependencies {
57
- implementation findProject(":camera") ?: "ly.img:camera:1.48.0"
81
+ implementation findProject(":camera") ?: "ly.img:camera:1.50.0"
58
82
  implementation platform("androidx.compose:compose-bom:2023.05.01")
59
83
  implementation "androidx.activity:activity-compose:1.6.1"
60
84
  implementation "androidx.activity:activity:1.7.0"
@@ -26,12 +26,8 @@ RCT_EXPORT_MODULE(IMGLYCamera)
26
26
  }
27
27
 
28
28
  #else
29
- RCT_EXPORT_METHOD(openCamera
30
- : (nonnull NSDictionary*)settings video
31
- : (nullable NSString*)video metadata
32
- : (NSDictionary*)metadata resolve
33
- : (RCTPromiseResolveBlock)resolve reject
34
- : (RCTPromiseRejectBlock)reject) {
29
+ RCT_EXPORT_METHOD(openCamera : (nonnull NSDictionary*)settings video : (nullable NSString*)video metadata : (
30
+ NSDictionary*)metadata resolve : (RCTPromiseResolveBlock)resolve reject : (RCTPromiseRejectBlock)reject) {
35
31
  [self open:settings video:video metadata:metadata resolve:resolve reject:reject];
36
32
  }
37
33
  #endif
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imgly/camera-react-native",
3
- "version": "1.48.0",
3
+ "version": "1.50.0",
4
4
  "description": "Camera SDK for React Native - provide a versatile video camera to your users on iOS and Android.",
5
5
  "react-native": "index.js",
6
6
  "source": "index.js",