@imgly/editor-react-native 1.57.0 → 1.58.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.
@@ -79,7 +79,7 @@ repositories {
79
79
  }
80
80
 
81
81
  dependencies {
82
- implementation findProject(":editor") ?: "ly.img:editor:1.57.0"
82
+ implementation findProject(":editor") ?: "ly.img:editor:1.58.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"
@@ -329,14 +329,6 @@ object EditorBuilderDefaults {
329
329
  when (settings.source?.type ?: sourceType) {
330
330
  EditorSourceType.IMAGE -> {
331
331
  engine.scene.createFromImage(uri)
332
- val graphicBlocks = engine.block.findByType(DesignBlockType.Graphic)
333
- require(graphicBlocks.size == 1) { "No image found." }
334
- val graphicBlock = graphicBlocks[0]
335
- val pages = engine.scene.getPages()
336
- require(pages.size == 1) { "No image found." }
337
- val page = pages[0]
338
- engine.block.setFill(page, engine.block.getFill(graphicBlock))
339
- engine.block.destroy(graphicBlock)
340
332
  }
341
333
  EditorSourceType.VIDEO -> {
342
334
  engine.scene.createFromVideo(uri)
@@ -14,7 +14,7 @@ extension OnCreate {
14
14
  public static func load(
15
15
  _ settings: EditorSettings?,
16
16
  _ sourceType: EditorSourceType = .scene,
17
- defaultSource: URL? = nil
17
+ defaultSource: URL? = nil,
18
18
  ) -> OnCreate.Callback {
19
19
  { engine in
20
20
  var url: URL?
@@ -33,11 +33,6 @@ extension OnCreate {
33
33
  switch settings?.source?.type ?? sourceType {
34
34
  case .image:
35
35
  try await engine.scene.create(fromImage: url)
36
- let pages = try engine.scene.getPages()
37
- let images = try engine.block.find(byType: .graphic)
38
- guard let image = images.first, let page = pages.first else { throw "Scene could not be loaded." }
39
- try engine.block.setFill(page, fill: engine.block.getFill(image))
40
- try engine.block.destroy(image)
41
36
  case .video:
42
37
  try await engine.scene.create(fromVideo: url)
43
38
  default:
@@ -67,7 +62,7 @@ extension OnCreate {
67
62
  try await engine.addDemoAssetSources(
68
63
  exclude: [.image, .video, .audio],
69
64
  sceneMode: engine.scene.getMode(),
70
- withUploadAssetSources: true
65
+ withUploadAssetSources: true,
71
66
  )
72
67
  try await engine.asset.addSource(TextAssetSource(engine: engine))
73
68
  }
@@ -27,7 +27,7 @@ public extension OnExport {
27
27
  return EditorResult(
28
28
  scene: localScene?.absoluteString,
29
29
  artifact: file.absoluteString,
30
- thumbnail: thumbnail?.absoluteString
30
+ thumbnail: thumbnail?.absoluteString,
31
31
  )
32
32
  }
33
33
 
@@ -43,7 +43,7 @@ public extension OnExport {
43
43
  _ engine: Engine,
44
44
  _ eventHandler: EditorEventHandler,
45
45
  _ mimeType: MIMEType,
46
- _ thumbnailHeight: CGFloat = 100
46
+ _ thumbnailHeight: CGFloat = 100,
47
47
  ) async throws -> EditorResult {
48
48
  let helper = ExportHelper()
49
49
  let (data, type) = try await OnExport.exportVideo(engine, eventHandler, mimeType: mimeType)
@@ -59,7 +59,7 @@ public extension OnExport {
59
59
  return EditorResult(
60
60
  scene: localScene?.absoluteString,
61
61
  artifact: file.absoluteString,
62
- thumbnail: thumbnail?.absoluteString
62
+ thumbnail: thumbnail?.absoluteString,
63
63
  )
64
64
  }
65
65
  }
@@ -57,7 +57,7 @@ class ExportHelper {
57
57
  id,
58
58
  thumbnailHeight: Int(height * UIScreen.main.scale),
59
59
  timeRange: 0 ... 0.1,
60
- numberOfFrames: 1
60
+ numberOfFrames: 1,
61
61
  )
62
62
  for try await thumbnail in stream {
63
63
  return .init(cgImage: thumbnail.image, scale: UIScreen.main.scale, orientation: .up)
@@ -33,7 +33,7 @@ import UIKit
33
33
  _ preset: EditorPreset,
34
34
  settings: EditorSettings,
35
35
  metadata: [String: Any]?,
36
- completion: @escaping (_ result: EditorResult?, _ error: NSError?) -> Void
36
+ completion: @escaping (_ result: EditorResult?, _ error: NSError?) -> Void,
37
37
  ) {
38
38
  _openEditor(preset, settings: settings, metadata: metadata, completion: completion)
39
39
  }
@@ -46,7 +46,7 @@ import UIKit
46
46
  public func openEditor(
47
47
  settings: EditorSettings,
48
48
  metadata: [String: Any]?,
49
- completion: @escaping (_ result: EditorResult?, _ error: NSError?) -> Void
49
+ completion: @escaping (_ result: EditorResult?, _ error: NSError?) -> Void,
50
50
  ) {
51
51
  _openEditor(nil, settings: settings, metadata: metadata, completion: completion)
52
52
  }
@@ -55,7 +55,7 @@ import UIKit
55
55
  _ preset: EditorPreset?,
56
56
  settings: EditorSettings,
57
57
  metadata: [String: Any]?,
58
- completion: @escaping (_ result: EditorResult?, _ error: NSError?) -> Void
58
+ completion: @escaping (_ result: EditorResult?, _ error: NSError?) -> Void,
59
59
  ) {
60
60
  let builder = builderClosure?(preset, metadata) ?? builderForPreset(preset)
61
61
  // Assign the `currentResultHandler` in order to manage the calls to the completion handler.
@@ -30,7 +30,7 @@ public struct ModalEditor<Editor: View, Label: View>: View {
30
30
  items.replace(id: NavigationBar.Buttons.ID.closeEditor) {
31
31
  NavigationBar.Buttons.closeEditor(
32
32
  action: { _ in onDismiss(true) },
33
- label: { _ in dismissLabel() }
33
+ label: { _ in dismissLabel() },
34
34
  )
35
35
  }
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imgly/editor-react-native",
3
- "version": "1.57.0",
3
+ "version": "1.58.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",