@imgly/editor-react-native 1.55.1 → 1.56.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.
- package/android/build.gradle +1 -1
- package/android/src/main/kotlin/ly/img/editor/reactnative/module/IMGLYEditorModule.kt +1 -1
- package/android/src/main/kotlin/ly/img/editor/reactnative/module/model/EditorSettings.kt +2 -2
- package/android/src/main/kotlin/ly/img/editor/reactnative/module/model/Source.kt +1 -1
- package/ios/View/ModalEditor.swift +2 -2
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -79,7 +79,7 @@ repositories {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
dependencies {
|
|
82
|
-
implementation findProject(":editor") ?: "ly.img:editor:1.
|
|
82
|
+
implementation findProject(":editor") ?: "ly.img:editor:1.56.0"
|
|
83
83
|
implementation platform("androidx.compose:compose-bom:2023.05.01")
|
|
84
84
|
implementation "androidx.activity:activity-compose:1.6.1"
|
|
85
85
|
implementation "androidx.activity:activity:1.7.0"
|
|
@@ -128,7 +128,7 @@ class IMGLYEditorModule(
|
|
|
128
128
|
private fun openEditor(
|
|
129
129
|
preset: EditorPreset?,
|
|
130
130
|
config: EditorSettings,
|
|
131
|
-
metadata: Map<String, Any
|
|
131
|
+
metadata: Map<String, Any?>?,
|
|
132
132
|
completion: (Result<EditorResult?>) -> Unit,
|
|
133
133
|
) {
|
|
134
134
|
val activity = this.currentActivity ?: return
|
|
@@ -48,12 +48,12 @@ data class EditorSettings(
|
|
|
48
48
|
|
|
49
49
|
override fun newArray(size: Int): Array<EditorSettings?> = arrayOfNulls(size)
|
|
50
50
|
|
|
51
|
-
fun createFromMap(map: Map<String, Any
|
|
51
|
+
fun createFromMap(map: Map<String, Any?>): EditorSettings? = try {
|
|
52
52
|
val license = map["license"] as? String ?: throw (Exception("Missing value for key 'license.'"))
|
|
53
53
|
val sceneBaseUri = map["sceneBaseUri"] as? String ?: throw (Exception("Missing value for key 'sceneBaseUri.'"))
|
|
54
54
|
val assetBaseUri = map["assetBaseUri"] as? String
|
|
55
55
|
val userId = map["userId"] as? String
|
|
56
|
-
val source = (map["source"] as? Map<String, Any
|
|
56
|
+
val source = (map["source"] as? Map<String, Any?>)?.let { Source.createFromMap(it) }
|
|
57
57
|
EditorSettings(license, sceneBaseUri, assetBaseUri, userId, source)
|
|
58
58
|
} catch (e: Exception) {
|
|
59
59
|
null
|
|
@@ -27,7 +27,7 @@ data class Source(
|
|
|
27
27
|
|
|
28
28
|
override fun newArray(size: Int): Array<Source?> = arrayOfNulls(size)
|
|
29
29
|
|
|
30
|
-
fun createFromMap(map: Map<String, Any
|
|
30
|
+
fun createFromMap(map: Map<String, Any?>): Source? = runCatching {
|
|
31
31
|
val source = map["source"] as? String
|
|
32
32
|
val typeRaw = map["type"] as? String
|
|
33
33
|
|
|
@@ -34,8 +34,8 @@ public struct ModalEditor<Editor: View, Label: View>: View {
|
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
.
|
|
38
|
-
onDismiss(false)
|
|
37
|
+
.imgly.onError { error, eventHandler in
|
|
38
|
+
eventHandler.send(.showErrorAlert(error) { onDismiss(false) })
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
.navigationViewStyle(.stack)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/editor-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.56.0",
|
|
4
4
|
"description": "CreativeEditor SDK for React Native - enable photo, video and design editing for your users on iOS and Android.",
|
|
5
5
|
"react-native": "index.js",
|
|
6
6
|
"source": "index.js",
|