@imgly/editor-react-native 1.50.2 → 1.52.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
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.52.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"
|
|
@@ -120,12 +120,16 @@ class EditorBuilder {
|
|
|
120
120
|
)
|
|
121
121
|
},
|
|
122
122
|
onExport = {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
try {
|
|
124
|
+
val export = EditorBuilderDefaults.onExport(
|
|
125
|
+
engine = editorContext.engine,
|
|
126
|
+
eventHandler = editorContext.eventHandler,
|
|
127
|
+
mimeType = MimeType.PNG,
|
|
128
|
+
)
|
|
129
|
+
result(Result.success(export))
|
|
130
|
+
} catch (e: Exception) {
|
|
131
|
+
result(Result.failure(e))
|
|
132
|
+
}
|
|
129
133
|
},
|
|
130
134
|
)
|
|
131
135
|
PhotoEditor(engineConfiguration = engineConfiguration) {
|
|
@@ -152,12 +156,16 @@ class EditorBuilder {
|
|
|
152
156
|
)
|
|
153
157
|
},
|
|
154
158
|
onExport = {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
try {
|
|
160
|
+
val export = EditorBuilderDefaults.onExport(
|
|
161
|
+
engine = editorContext.engine,
|
|
162
|
+
eventHandler = editorContext.eventHandler,
|
|
163
|
+
mimeType = MimeType.PDF,
|
|
164
|
+
)
|
|
165
|
+
result(Result.success(export))
|
|
166
|
+
} catch (e: Exception) {
|
|
167
|
+
result(Result.failure(e))
|
|
168
|
+
}
|
|
161
169
|
},
|
|
162
170
|
)
|
|
163
171
|
ApparelEditor(engineConfiguration = engineConfiguration) {
|
|
@@ -184,12 +192,16 @@ class EditorBuilder {
|
|
|
184
192
|
)
|
|
185
193
|
},
|
|
186
194
|
onExport = {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
195
|
+
try {
|
|
196
|
+
val export = EditorBuilderDefaults.onExport(
|
|
197
|
+
engine = editorContext.engine,
|
|
198
|
+
eventHandler = editorContext.eventHandler,
|
|
199
|
+
mimeType = MimeType.PDF,
|
|
200
|
+
)
|
|
201
|
+
result(Result.success(export))
|
|
202
|
+
} catch (e: Exception) {
|
|
203
|
+
result(Result.failure(e))
|
|
204
|
+
}
|
|
193
205
|
},
|
|
194
206
|
)
|
|
195
207
|
|
|
@@ -217,12 +229,16 @@ class EditorBuilder {
|
|
|
217
229
|
)
|
|
218
230
|
},
|
|
219
231
|
onExport = {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
232
|
+
try {
|
|
233
|
+
val export = EditorBuilderDefaults.onExport(
|
|
234
|
+
engine = editorContext.engine,
|
|
235
|
+
eventHandler = editorContext.eventHandler,
|
|
236
|
+
mimeType = MimeType.PDF,
|
|
237
|
+
)
|
|
238
|
+
result(Result.success(export))
|
|
239
|
+
} catch (e: Exception) {
|
|
240
|
+
result(Result.failure(e))
|
|
241
|
+
}
|
|
226
242
|
},
|
|
227
243
|
)
|
|
228
244
|
|
|
@@ -337,7 +353,12 @@ object EditorBuilderDefaults {
|
|
|
337
353
|
val baseUri = Uri.parse(if (isValid) assetBaseUri else "https://cdn.img.ly/assets/v3")
|
|
338
354
|
engine.addDefaultAssetSources(baseUri = baseUri)
|
|
339
355
|
val excluded = setOf(DemoAssetSource.IMAGE, DemoAssetSource.VIDEO, DemoAssetSource.AUDIO)
|
|
340
|
-
engine.addDemoAssetSources(
|
|
356
|
+
engine.addDemoAssetSources(
|
|
357
|
+
sceneMode = engine.scene.getMode(),
|
|
358
|
+
withUploadAssetSources = true,
|
|
359
|
+
exclude = excluded,
|
|
360
|
+
baseUri = Uri.parse("https://cdn.img.ly/assets/demo/v2"),
|
|
361
|
+
)
|
|
341
362
|
val defaultTypeface = TypefaceProvider().provideTypeface(engine, "Roboto")
|
|
342
363
|
requireNotNull(defaultTypeface)
|
|
343
364
|
engine.asset.addSource(TextAssetSource(engine, defaultTypeface))
|
|
@@ -22,33 +22,21 @@ public struct ModalEditor<Editor: View, Label: View>: View {
|
|
|
22
22
|
self.onDismiss = onDismiss
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
@Environment(\.dismiss) private var dismiss
|
|
27
|
-
|
|
28
|
-
@ViewBuilder private var dismissButton: some View {
|
|
29
|
-
Button {
|
|
30
|
-
onDismiss(true)
|
|
31
|
-
} label: {
|
|
32
|
-
dismissLabel()
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
25
|
+
/// The body.
|
|
36
26
|
public var body: some View {
|
|
37
27
|
NavigationView {
|
|
38
28
|
editor()
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
dismissButton
|
|
46
|
-
}
|
|
29
|
+
.imgly.modifyNavigationBarItems { _, items in
|
|
30
|
+
items.replace(id: NavigationBar.Buttons.ID.closeEditor) {
|
|
31
|
+
NavigationBar.Buttons.closeEditor(
|
|
32
|
+
action: { _ in onDismiss(true) },
|
|
33
|
+
label: { _ in dismissLabel() }
|
|
34
|
+
)
|
|
47
35
|
}
|
|
48
36
|
}
|
|
49
|
-
.onDisappear
|
|
37
|
+
.onDisappear {
|
|
50
38
|
onDismiss(false)
|
|
51
|
-
}
|
|
39
|
+
}
|
|
52
40
|
}
|
|
53
41
|
.navigationViewStyle(.stack)
|
|
54
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/editor-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.52.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",
|