@imgly/editor-react-native 1.75.1 → 1.76.1
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/IMGLYEditorModule.podspec +21 -0
- package/android/build.gradle +5 -1
- package/android/src/main/kotlin/ly/img/editor/configuration/video/VideoConfigurationBuilder.kt +8 -2
- package/android/src/main/kotlin/ly/img/editor/configuration/video/component/Dock.kt +0 -2
- package/android/src/main/kotlin/ly/img/editor/configuration/video/component/InspectorBar.kt +0 -6
- package/android/src/main/kotlin/ly/img/editor/reactnative/module/builder/EditorBuilder.kt +12 -3
- package/ios/StarterKits/Video/components/Dock+Video.swift +0 -1
- package/ios/StarterKits/Video/components/InspectorBar+Video.swift +0 -3
- package/package.json +1 -1
- package/src/NativeIMGLYEditor.ts +1 -1
|
@@ -13,6 +13,27 @@ Pod::Spec.new do |s|
|
|
|
13
13
|
s.author = package['author']
|
|
14
14
|
s.source = { path: './ios' }
|
|
15
15
|
|
|
16
|
+
# In the monorepo, copy starter kit sources from the shared location.
|
|
17
|
+
# Walk up from __dir__ to find the monorepo root (.ubq-version marker),
|
|
18
|
+
# matching the Android approach in starter-kits-local.gradle.
|
|
19
|
+
ubq_root = nil
|
|
20
|
+
current_dir = File.expand_path(__dir__)
|
|
21
|
+
while current_dir != '/'
|
|
22
|
+
if File.exist?(File.join(current_dir, '.ubq-version'))
|
|
23
|
+
ubq_root = current_dir
|
|
24
|
+
break
|
|
25
|
+
end
|
|
26
|
+
current_dir = File.dirname(current_dir)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
if ubq_root
|
|
30
|
+
copy_script = File.join(ubq_root, 'apps', 'cesdk_swift_examples',
|
|
31
|
+
'starter-kits', 'copy_starter_kits_source_files.sh')
|
|
32
|
+
if File.executable?(copy_script)
|
|
33
|
+
system('bash', copy_script, File.join(__dir__, 'ios', 'StarterKits'))
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
16
37
|
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
17
38
|
s.exclude_files = 'ios/StarterKits/**/*StarterKit.swift'
|
|
18
39
|
s.resources = 'ios/StarterKits/*.{scene,png}'
|
package/android/build.gradle
CHANGED
|
@@ -96,6 +96,10 @@ apply plugin: 'com.android.library'
|
|
|
96
96
|
apply plugin: 'com.facebook.react'
|
|
97
97
|
apply plugin: 'org.jetbrains.kotlin.android'
|
|
98
98
|
|
|
99
|
+
def starterKitsGradleFilePath = "$projectDir/../../../../../../cesdk_android_showcases/starter-kits/starter-kits-local.gradle"
|
|
100
|
+
if (file(starterKitsGradleFilePath).exists()) {
|
|
101
|
+
apply from: starterKitsGradleFilePath
|
|
102
|
+
}
|
|
99
103
|
|
|
100
104
|
if (isKotlin2OrHigher()) {
|
|
101
105
|
try {
|
|
@@ -143,7 +147,7 @@ repositories {
|
|
|
143
147
|
}
|
|
144
148
|
|
|
145
149
|
dependencies {
|
|
146
|
-
api "ly.img:editor:1.
|
|
150
|
+
api "ly.img:editor:1.76.1"
|
|
147
151
|
|
|
148
152
|
implementation "androidx.activity:activity-ktx:1.9.0"
|
|
149
153
|
implementation "androidx.appcompat:appcompat:1.7.1"
|
package/android/src/main/kotlin/ly/img/editor/configuration/video/VideoConfigurationBuilder.kt
CHANGED
|
@@ -28,7 +28,7 @@ class VideoConfigurationBuilder : BasicConfigurationBuilder() {
|
|
|
28
28
|
* Current export status of the editor.
|
|
29
29
|
*/
|
|
30
30
|
var exportStatus: ExportStatus? by editorContext.mutableStateOf(
|
|
31
|
-
key =
|
|
31
|
+
key = KEY_STATE_EXPORT_STATUS,
|
|
32
32
|
initial = null,
|
|
33
33
|
)
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ class VideoConfigurationBuilder : BasicConfigurationBuilder() {
|
|
|
36
36
|
* Whether export cancellation confirmation dialog should be displayed.
|
|
37
37
|
*/
|
|
38
38
|
var showCancelExportConfirmationDialog: Boolean by editorContext.mutableStateOf(
|
|
39
|
-
key =
|
|
39
|
+
key = KEY_STATE_SHOW_CANCEL_EXPORT_CONFIRMATION_DIALOG,
|
|
40
40
|
initial = false,
|
|
41
41
|
)
|
|
42
42
|
|
|
@@ -132,4 +132,10 @@ class VideoConfigurationBuilder : BasicConfigurationBuilder() {
|
|
|
132
132
|
override var overlay: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
|
|
133
133
|
rememberOverlay()
|
|
134
134
|
}
|
|
135
|
+
|
|
136
|
+
companion object {
|
|
137
|
+
const val KEY_STATE_EXPORT_STATUS = "ly.img.editor.configuration.video.state.exportStatus"
|
|
138
|
+
const val KEY_STATE_SHOW_CANCEL_EXPORT_CONFIRMATION_DIALOG =
|
|
139
|
+
"ly.img.editor.configuration.video.state.showCancelExportConfirmationDialog"
|
|
140
|
+
}
|
|
135
141
|
}
|
|
@@ -13,7 +13,6 @@ import ly.img.editor.core.component.EditorTrigger
|
|
|
13
13
|
import ly.img.editor.core.component.remember
|
|
14
14
|
import ly.img.editor.core.component.rememberAudiosLibrary
|
|
15
15
|
import ly.img.editor.core.component.rememberOverlaysLibrary
|
|
16
|
-
import ly.img.editor.core.component.rememberReorder
|
|
17
16
|
import ly.img.editor.core.component.rememberResizeAll
|
|
18
17
|
import ly.img.editor.core.component.rememberStickersAndShapesLibrary
|
|
19
18
|
import ly.img.editor.core.component.rememberSystemCamera
|
|
@@ -64,7 +63,6 @@ fun VideoConfigurationBuilder.rememberDock() = Dock.remember {
|
|
|
64
63
|
add { Dock.Button.rememberAudiosLibrary() }
|
|
65
64
|
add { Dock.Button.rememberVoiceoverRecord() }
|
|
66
65
|
add { Dock.Button.rememberResizeAll() }
|
|
67
|
-
add { Dock.Button.rememberReorder() }
|
|
68
66
|
}
|
|
69
67
|
// highlight-starter-kit-imgly-camera
|
|
70
68
|
}
|
|
@@ -20,9 +20,6 @@ import ly.img.editor.core.component.rememberFillStroke
|
|
|
20
20
|
import ly.img.editor.core.component.rememberFilter
|
|
21
21
|
import ly.img.editor.core.component.rememberFormatText
|
|
22
22
|
import ly.img.editor.core.component.rememberLayer
|
|
23
|
-
import ly.img.editor.core.component.rememberMoveAsClip
|
|
24
|
-
import ly.img.editor.core.component.rememberMoveAsOverlay
|
|
25
|
-
import ly.img.editor.core.component.rememberReorder
|
|
26
23
|
import ly.img.editor.core.component.rememberReplace
|
|
27
24
|
import ly.img.editor.core.component.rememberSelectGroup
|
|
28
25
|
import ly.img.editor.core.component.rememberShape
|
|
@@ -58,9 +55,6 @@ fun VideoConfigurationBuilder.rememberInspectorBar() = InspectorBar.remember {
|
|
|
58
55
|
add { InspectorBar.Button.rememberEnterGroup() } // Group
|
|
59
56
|
add { InspectorBar.Button.rememberLayer() } // Video, Image, Sticker, Shape, Text
|
|
60
57
|
add { InspectorBar.Button.rememberSplit() } // Video, Image, Sticker, Shape, Text, Audio
|
|
61
|
-
add { InspectorBar.Button.rememberMoveAsClip() } // Video, Image, Sticker, Shape, Text
|
|
62
|
-
add { InspectorBar.Button.rememberMoveAsOverlay() } // Video, Image, Sticker, Shape, Text
|
|
63
|
-
add { InspectorBar.Button.rememberReorder() } // Video, Image, Sticker, Shape, Text
|
|
64
58
|
add { InspectorBar.Button.rememberDuplicate() } // Video, Image, Sticker, Shape, Text
|
|
65
59
|
add { InspectorBar.Button.rememberDelete() } // Video, Image, Sticker, Shape, Text
|
|
66
60
|
}
|
|
@@ -37,6 +37,7 @@ import ly.img.engine.DesignBlock
|
|
|
37
37
|
import ly.img.engine.DesignBlockType
|
|
38
38
|
import ly.img.engine.Engine
|
|
39
39
|
import ly.img.engine.FillType
|
|
40
|
+
import ly.img.engine.MimeType
|
|
40
41
|
import java.io.File
|
|
41
42
|
import java.io.FileOutputStream
|
|
42
43
|
import java.nio.ByteBuffer
|
|
@@ -131,6 +132,7 @@ class EditorBuilder {
|
|
|
131
132
|
val result = EditorBuilderDefaults.getExportResult(
|
|
132
133
|
scope = this@Editor,
|
|
133
134
|
byteBuffer = it,
|
|
135
|
+
mimeType = MimeType.PNG,
|
|
134
136
|
)
|
|
135
137
|
result(Result.success(result))
|
|
136
138
|
},
|
|
@@ -175,6 +177,7 @@ class EditorBuilder {
|
|
|
175
177
|
val result = EditorBuilderDefaults.getExportResult(
|
|
176
178
|
scope = this@Editor,
|
|
177
179
|
byteBuffer = it,
|
|
180
|
+
mimeType = MimeType.PDF,
|
|
178
181
|
)
|
|
179
182
|
result(Result.success(result))
|
|
180
183
|
},
|
|
@@ -219,6 +222,7 @@ class EditorBuilder {
|
|
|
219
222
|
val result = EditorBuilderDefaults.getExportResult(
|
|
220
223
|
scope = this@Editor,
|
|
221
224
|
byteBuffer = it,
|
|
225
|
+
mimeType = MimeType.PDF,
|
|
222
226
|
)
|
|
223
227
|
result(Result.success(result))
|
|
224
228
|
},
|
|
@@ -263,6 +267,7 @@ class EditorBuilder {
|
|
|
263
267
|
val result = EditorBuilderDefaults.getExportResult(
|
|
264
268
|
scope = this@Editor,
|
|
265
269
|
byteBuffer = it,
|
|
270
|
+
mimeType = MimeType.PDF,
|
|
266
271
|
)
|
|
267
272
|
result(Result.success(result))
|
|
268
273
|
},
|
|
@@ -307,6 +312,7 @@ class EditorBuilder {
|
|
|
307
312
|
val result = EditorBuilderDefaults.getExportResult(
|
|
308
313
|
scope = this@Editor,
|
|
309
314
|
byteBuffer = it,
|
|
315
|
+
mimeType = MimeType.MP4,
|
|
310
316
|
)
|
|
311
317
|
exportStatus = null
|
|
312
318
|
result(Result.success(result))
|
|
@@ -386,6 +392,7 @@ object EditorBuilderDefaults {
|
|
|
386
392
|
*
|
|
387
393
|
* @param scope the [EditorScope] of the editor.
|
|
388
394
|
* @param byteBuffer the buffer that contains the exported data.
|
|
395
|
+
* @param mimeType the [MimeType] of the exported data, used to derive the artifact file extension.
|
|
389
396
|
* @param thumbnailHeight the height of the generated thumbnail.
|
|
390
397
|
* @return a new [EditorResult] that contains a uri to temporary file with [byteBuffer] content,
|
|
391
398
|
* thumbnail and an exported scene string.
|
|
@@ -393,6 +400,7 @@ object EditorBuilderDefaults {
|
|
|
393
400
|
suspend fun getExportResult(
|
|
394
401
|
scope: EditorScope,
|
|
395
402
|
byteBuffer: ByteBuffer,
|
|
403
|
+
mimeType: MimeType,
|
|
396
404
|
thumbnailHeight: Int = 100,
|
|
397
405
|
) = scope.run {
|
|
398
406
|
val scene = editorContext.engine.scene.get()
|
|
@@ -409,13 +417,14 @@ object EditorBuilderDefaults {
|
|
|
409
417
|
val thumbnail = saveThumbnail(firstPage, editorContext.engine, thumbnailHeight)
|
|
410
418
|
EditorResult(
|
|
411
419
|
scene = sceneUri.toString(),
|
|
412
|
-
artifact = Uri.fromFile(byteBuffer.writeToFile()).toString(),
|
|
420
|
+
artifact = Uri.fromFile(byteBuffer.writeToFile(mimeType)).toString(),
|
|
413
421
|
thumbnail = thumbnail.toString(),
|
|
414
422
|
)
|
|
415
423
|
}
|
|
416
424
|
|
|
417
|
-
private suspend fun ByteBuffer.writeToFile(): File = withContext(Dispatchers.IO) {
|
|
418
|
-
|
|
425
|
+
private suspend fun ByteBuffer.writeToFile(mimeType: MimeType): File = withContext(Dispatchers.IO) {
|
|
426
|
+
val extension = "." + mimeType.key.substringAfterLast('/')
|
|
427
|
+
File.createTempFile(UUID.randomUUID().toString(), extension).apply {
|
|
419
428
|
outputStream().channel.write(this@writeToFile)
|
|
420
429
|
}
|
|
421
430
|
}
|
|
@@ -21,7 +21,6 @@ extension VideoEditorConfiguration {
|
|
|
21
21
|
Dock.Buttons.stickersAndShapesLibrary() // Stickers and shapes
|
|
22
22
|
Dock.Buttons.audioLibrary() // Audio tracks
|
|
23
23
|
Dock.Buttons.voiceover() // Voice recording
|
|
24
|
-
Dock.Buttons.reorder() // Clip reordering
|
|
25
24
|
Dock.Buttons.resize() // Aspect ratio and canvas size
|
|
26
25
|
}
|
|
27
26
|
// highlight-starter-kit-dock
|
|
@@ -31,9 +31,6 @@ extension VideoEditorConfiguration {
|
|
|
31
31
|
|
|
32
32
|
InspectorBar.Buttons.layer()
|
|
33
33
|
InspectorBar.Buttons.split()
|
|
34
|
-
InspectorBar.Buttons.moveAsClip()
|
|
35
|
-
InspectorBar.Buttons.moveAsOverlay()
|
|
36
|
-
InspectorBar.Buttons.reorder()
|
|
37
34
|
InspectorBar.Buttons.duplicate()
|
|
38
35
|
InspectorBar.Buttons.delete()
|
|
39
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/editor-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.76.1",
|
|
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",
|
package/src/NativeIMGLYEditor.ts
CHANGED
|
@@ -96,7 +96,7 @@ export class EditorSettingsModel implements EditorSettings {
|
|
|
96
96
|
* sources (stickers, filters, and more).
|
|
97
97
|
*/
|
|
98
98
|
baseUri: string =
|
|
99
|
-
'https://cdn.img.ly/packages/imgly/cesdk-react-native/1.
|
|
99
|
+
'https://cdn.img.ly/packages/imgly/cesdk-react-native/1.76.1/assets';
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Unique ID tied to your application's user.
|