@imgly/editor-react-native 1.74.0 → 1.76.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.
@@ -143,7 +143,7 @@ repositories {
143
143
  }
144
144
 
145
145
  dependencies {
146
- api "ly.img:editor:1.74.0"
146
+ api "ly.img:editor:1.76.0"
147
147
 
148
148
  implementation "androidx.activity:activity-ktx:1.9.0"
149
149
  implementation "androidx.appcompat:appcompat:1.7.1"
@@ -65,7 +65,7 @@ class ApparelConfigurationBuilder : BasicConfigurationBuilder() {
65
65
  * The configuration of the component that is displayed as horizontal list of items at the bottom of the editor.
66
66
  * Check parent class declaration for more details.
67
67
  */
68
- override var dock: ScopedProperty<EditorScope, EditorComponent<*>>? = {
68
+ override var dock: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
69
69
  rememberDock()
70
70
  }
71
71
 
@@ -73,7 +73,7 @@ class ApparelConfigurationBuilder : BasicConfigurationBuilder() {
73
73
  * The configuration of the component that is displayed as horizontal list of items at the top of the editor.
74
74
  * Check parent class declaration for more details.
75
75
  */
76
- override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
76
+ override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
77
77
  rememberNavigationBar()
78
78
  }
79
79
 
@@ -82,7 +82,7 @@ class ApparelConfigurationBuilder : BasicConfigurationBuilder() {
82
82
  * bottom of the editor when a design block is selected.
83
83
  * Check parent class declaration for more details.
84
84
  */
85
- override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
85
+ override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
86
86
  rememberInspectorBar()
87
87
  }
88
88
 
@@ -91,7 +91,7 @@ class ApparelConfigurationBuilder : BasicConfigurationBuilder() {
91
91
  * the selected design block.
92
92
  * Check parent class declaration for more details.
93
93
  */
94
- override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>>? = {
94
+ override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
95
95
  rememberCanvasMenu()
96
96
  }
97
97
 
@@ -100,7 +100,7 @@ class ApparelConfigurationBuilder : BasicConfigurationBuilder() {
100
100
  * overlay.
101
101
  * Check parent class declaration for more details.
102
102
  */
103
- override var overlay: ScopedProperty<EditorScope, EditorComponent<*>>? = {
103
+ override var overlay: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
104
104
  rememberOverlay()
105
105
  }
106
106
 
@@ -111,6 +111,7 @@ suspend fun ApparelConfigurationBuilder.onLoadAssetSources() {
111
111
  "image/heif",
112
112
  "image/svg+xml",
113
113
  "image/gif",
114
+ "image/apng",
114
115
  "image/bmp",
115
116
  ),
116
117
  )
@@ -65,7 +65,7 @@ class DesignConfigurationBuilder : BasicConfigurationBuilder() {
65
65
  * The configuration of the component that is displayed as horizontal list of items at the bottom of the editor.
66
66
  * Check parent class declaration for more details.
67
67
  */
68
- override var dock: ScopedProperty<EditorScope, EditorComponent<*>>? = {
68
+ override var dock: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
69
69
  rememberDock()
70
70
  }
71
71
 
@@ -73,7 +73,7 @@ class DesignConfigurationBuilder : BasicConfigurationBuilder() {
73
73
  * The configuration of the component that is displayed as horizontal list of items at the top of the editor.
74
74
  * Check parent class declaration for more details.
75
75
  */
76
- override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
76
+ override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
77
77
  rememberNavigationBar()
78
78
  }
79
79
 
@@ -82,7 +82,7 @@ class DesignConfigurationBuilder : BasicConfigurationBuilder() {
82
82
  * bottom of the editor when a design block is selected.
83
83
  * Check parent class declaration for more details.
84
84
  */
85
- override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
85
+ override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
86
86
  rememberInspectorBar()
87
87
  }
88
88
 
@@ -91,7 +91,7 @@ class DesignConfigurationBuilder : BasicConfigurationBuilder() {
91
91
  * the selected design block.
92
92
  * Check parent class declaration for more details.
93
93
  */
94
- override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>>? = {
94
+ override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
95
95
  rememberCanvasMenu()
96
96
  }
97
97
 
@@ -100,7 +100,7 @@ class DesignConfigurationBuilder : BasicConfigurationBuilder() {
100
100
  * overlay.
101
101
  * Check parent class declaration for more details.
102
102
  */
103
- override var overlay: ScopedProperty<EditorScope, EditorComponent<*>>? = {
103
+ override var overlay: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
104
104
  rememberOverlay()
105
105
  }
106
106
  }
@@ -106,6 +106,7 @@ suspend fun DesignConfigurationBuilder.onLoadAssetSources() {
106
106
  "image/heif",
107
107
  "image/svg+xml",
108
108
  "image/gif",
109
+ "image/apng",
109
110
  "image/bmp",
110
111
  ),
111
112
  )
@@ -65,7 +65,7 @@ class PhotoConfigurationBuilder : BasicConfigurationBuilder() {
65
65
  * The configuration of the component that is displayed as horizontal list of items at the bottom of the editor.
66
66
  * Check parent class declaration for more details.
67
67
  */
68
- override var dock: ScopedProperty<EditorScope, EditorComponent<*>>? = {
68
+ override var dock: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
69
69
  rememberDock()
70
70
  }
71
71
 
@@ -73,7 +73,7 @@ class PhotoConfigurationBuilder : BasicConfigurationBuilder() {
73
73
  * The configuration of the component that is displayed as horizontal list of items at the top of the editor.
74
74
  * Check parent class declaration for more details.
75
75
  */
76
- override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
76
+ override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
77
77
  rememberNavigationBar()
78
78
  }
79
79
 
@@ -82,7 +82,7 @@ class PhotoConfigurationBuilder : BasicConfigurationBuilder() {
82
82
  * bottom of the editor when a design block is selected.
83
83
  * Check parent class declaration for more details.
84
84
  */
85
- override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
85
+ override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
86
86
  rememberInspectorBar()
87
87
  }
88
88
 
@@ -91,7 +91,7 @@ class PhotoConfigurationBuilder : BasicConfigurationBuilder() {
91
91
  * the selected design block.
92
92
  * Check parent class declaration for more details.
93
93
  */
94
- override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>>? = {
94
+ override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
95
95
  rememberCanvasMenu()
96
96
  }
97
97
 
@@ -100,7 +100,7 @@ class PhotoConfigurationBuilder : BasicConfigurationBuilder() {
100
100
  * overlay.
101
101
  * Check parent class declaration for more details.
102
102
  */
103
- override var overlay: ScopedProperty<EditorScope, EditorComponent<*>>? = {
103
+ override var overlay: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
104
104
  rememberOverlay()
105
105
  }
106
106
  }
@@ -65,7 +65,7 @@ class PostcardConfigurationBuilder : BasicConfigurationBuilder() {
65
65
  * The configuration of the component that is displayed as horizontal list of items at the bottom of the editor.
66
66
  * Check parent class declaration for more details.
67
67
  */
68
- override var dock: ScopedProperty<EditorScope, EditorComponent<*>>? = {
68
+ override var dock: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
69
69
  rememberDock()
70
70
  }
71
71
 
@@ -73,7 +73,7 @@ class PostcardConfigurationBuilder : BasicConfigurationBuilder() {
73
73
  * The configuration of the component that is displayed as horizontal list of items at the top of the editor.
74
74
  * Check parent class declaration for more details.
75
75
  */
76
- override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
76
+ override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
77
77
  rememberNavigationBar()
78
78
  }
79
79
 
@@ -82,7 +82,7 @@ class PostcardConfigurationBuilder : BasicConfigurationBuilder() {
82
82
  * bottom of the editor when a design block is selected.
83
83
  * Check parent class declaration for more details.
84
84
  */
85
- override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
85
+ override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
86
86
  rememberInspectorBar()
87
87
  }
88
88
 
@@ -91,7 +91,7 @@ class PostcardConfigurationBuilder : BasicConfigurationBuilder() {
91
91
  * the selected design block.
92
92
  * Check parent class declaration for more details.
93
93
  */
94
- override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>>? = {
94
+ override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
95
95
  rememberCanvasMenu()
96
96
  }
97
97
 
@@ -100,7 +100,7 @@ class PostcardConfigurationBuilder : BasicConfigurationBuilder() {
100
100
  * overlay.
101
101
  * Check parent class declaration for more details.
102
102
  */
103
- override var overlay: ScopedProperty<EditorScope, EditorComponent<*>>? = {
103
+ override var overlay: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
104
104
  rememberOverlay()
105
105
  }
106
106
  }
@@ -103,6 +103,7 @@ suspend fun PostcardConfigurationBuilder.onLoadAssetSources() {
103
103
  "image/heif",
104
104
  "image/svg+xml",
105
105
  "image/gif",
106
+ "image/apng",
106
107
  "image/bmp",
107
108
  ),
108
109
  )
@@ -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 = "ly.img.editor.configuration.video.state.exportStatus",
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 = "ly.img.editor.configuration.video.state.showCancelExportConfirmationDialog",
39
+ key = KEY_STATE_SHOW_CANCEL_EXPORT_CONFIRMATION_DIALOG,
40
40
  initial = false,
41
41
  )
42
42
 
@@ -85,7 +85,7 @@ class VideoConfigurationBuilder : BasicConfigurationBuilder() {
85
85
  * The configuration of the component that is displayed as horizontal list of items at the bottom of the editor.
86
86
  * Check parent class declaration for more details.
87
87
  */
88
- override var dock: ScopedProperty<EditorScope, EditorComponent<*>>? = {
88
+ override var dock: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
89
89
  rememberDock()
90
90
  }
91
91
 
@@ -93,7 +93,7 @@ class VideoConfigurationBuilder : BasicConfigurationBuilder() {
93
93
  * The configuration of the component that is displayed as horizontal list of items at the top of the editor.
94
94
  * Check parent class declaration for more details.
95
95
  */
96
- override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
96
+ override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
97
97
  rememberNavigationBar()
98
98
  }
99
99
 
@@ -102,7 +102,7 @@ class VideoConfigurationBuilder : BasicConfigurationBuilder() {
102
102
  * bottom of the editor when a design block is selected.
103
103
  * Check parent class declaration for more details.
104
104
  */
105
- override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
105
+ override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
106
106
  rememberInspectorBar()
107
107
  }
108
108
 
@@ -111,7 +111,7 @@ class VideoConfigurationBuilder : BasicConfigurationBuilder() {
111
111
  * the selected design block.
112
112
  * Check parent class declaration for more details.
113
113
  */
114
- override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>>? = {
114
+ override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
115
115
  rememberCanvasMenu()
116
116
  }
117
117
 
@@ -120,7 +120,7 @@ class VideoConfigurationBuilder : BasicConfigurationBuilder() {
120
120
  * overlay.
121
121
  * Check parent class declaration for more details.
122
122
  */
123
- override var bottomPanel: ScopedProperty<EditorScope, EditorComponent<*>>? = {
123
+ override var bottomPanel: ScopedProperty<EditorScope, EditorComponent<*>?>? = {
124
124
  rememberBottomPanel()
125
125
  }
126
126
 
@@ -129,7 +129,13 @@ class VideoConfigurationBuilder : BasicConfigurationBuilder() {
129
129
  * overlay.
130
130
  * Check parent class declaration for more details.
131
131
  */
132
- override var overlay: ScopedProperty<EditorScope, EditorComponent<*>>? = {
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
  }
@@ -130,6 +130,7 @@ suspend fun VideoConfigurationBuilder.onLoadAssetSources() {
130
130
  "image/heif",
131
131
  "image/svg+xml",
132
132
  "image/gif",
133
+ "image/apng",
133
134
  "image/bmp",
134
135
  ),
135
136
  )
@@ -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
- File.createTempFile(UUID.randomUUID().toString(), ".tmp").apply {
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.74.0",
3
+ "version": "1.76.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",
@@ -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.74.0/assets';
99
+ 'https://cdn.img.ly/packages/imgly/cesdk-react-native/1.76.0/assets';
100
100
 
101
101
  /**
102
102
  * Unique ID tied to your application's user.