@imgly/editor-react-native 1.78.0 → 1.79.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/configuration/photo/callback/OnCreate.kt +1 -0
- package/ios/Extensions/String+.swift +3 -1
- package/ios/Model/EditorBuilder.swift +6 -5
- package/ios/Model/EditorSettings.swift +1 -2
- package/ios/StarterKits/Apparel/ApparelEditorConfiguration.swift +24 -8
- package/ios/StarterKits/Design/DesignEditorConfiguration.swift +21 -7
- package/ios/StarterKits/Photo/PhotoEditorConfiguration.swift +27 -9
- package/ios/StarterKits/Photo/callbacks/OnCreate+Photo.swift +1 -0
- package/ios/StarterKits/Postcard/PostcardEditorConfiguration.swift +24 -8
- package/ios/StarterKits/Postcard/components/DockButtons+Postcard.swift +15 -4
- package/ios/StarterKits/Video/VideoEditorConfiguration.swift +24 -8
- package/package.json +1 -1
- package/src/NativeIMGLYEditor.ts +1 -1
package/android/build.gradle
CHANGED
|
@@ -19,7 +19,7 @@ public enum EditorBuilder {
|
|
|
19
19
|
_ settings: EditorSettings,
|
|
20
20
|
_ preset: EditorPreset?,
|
|
21
21
|
_ metadata: [String: Any]?,
|
|
22
|
-
_ result: @escaping EditorBuilderResult
|
|
22
|
+
_ result: @escaping EditorBuilderResult,
|
|
23
23
|
) -> UIViewController
|
|
24
24
|
|
|
25
25
|
/// The default design editor.
|
|
@@ -99,7 +99,9 @@ public enum EditorBuilder {
|
|
|
99
99
|
let editorResult = try await OnExport.exportVideo(engine, eventHandler, .mp4)
|
|
100
100
|
result(.success(editorResult))
|
|
101
101
|
} catch {
|
|
102
|
-
if error is CancellationError {
|
|
102
|
+
if error is CancellationError {
|
|
103
|
+
return
|
|
104
|
+
}
|
|
103
105
|
result(.failure(error))
|
|
104
106
|
}
|
|
105
107
|
}
|
|
@@ -175,11 +177,10 @@ public enum EditorBuilder {
|
|
|
175
177
|
_ settings: EditorSettings,
|
|
176
178
|
_ preset: EditorPreset?,
|
|
177
179
|
_ metadata: [String: Any]?,
|
|
178
|
-
_ result: @escaping EditorBuilderResult
|
|
180
|
+
_ result: @escaping EditorBuilderResult,
|
|
179
181
|
) -> some View) -> Builder {
|
|
180
182
|
{ settings, preset, metadata, result in
|
|
181
|
-
|
|
182
|
-
return hostingController
|
|
183
|
+
UIHostingController(rootView: contentProvider(settings, preset, metadata, result))
|
|
183
184
|
}
|
|
184
185
|
}
|
|
185
186
|
}
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
public static func fromDictionary(_ dictionary: [String: Any]) -> EditorSettings? {
|
|
23
23
|
do {
|
|
24
24
|
let data = try JSONSerialization.data(withJSONObject: dictionary, options: [])
|
|
25
|
-
|
|
26
|
-
return settings
|
|
25
|
+
return try JSONDecoder().decode(EditorSettings.self, from: data)
|
|
27
26
|
} catch {
|
|
28
27
|
print("Error decoding dictionary: \(error)")
|
|
29
28
|
return nil
|
|
@@ -15,32 +15,48 @@ public final class ApparelEditorConfiguration: EditorConfiguration {
|
|
|
15
15
|
// MARK: - EditorConfiguration — Settings
|
|
16
16
|
|
|
17
17
|
/// The zoom padding for the canvas.
|
|
18
|
-
override public var zoomPadding: CGFloat? {
|
|
18
|
+
override public var zoomPadding: CGFloat? {
|
|
19
|
+
16
|
|
20
|
+
}
|
|
19
21
|
|
|
20
22
|
// MARK: - EditorConfiguration — Callbacks
|
|
21
23
|
|
|
22
24
|
/// The `onCreate` handler.
|
|
23
|
-
override public var onCreate: OnCreate.Handler? {
|
|
25
|
+
override public var onCreate: OnCreate.Handler? {
|
|
26
|
+
Self.defaultOnCreateHandler
|
|
27
|
+
}
|
|
24
28
|
|
|
25
29
|
/// The `onChanged` handler.
|
|
26
|
-
override public var onChanged: OnChanged.Handler? {
|
|
30
|
+
override public var onChanged: OnChanged.Handler? {
|
|
31
|
+
Self.defaultOnChangedHandler
|
|
32
|
+
}
|
|
27
33
|
|
|
28
34
|
/// The export handler.
|
|
29
35
|
///
|
|
30
36
|
/// Default: Exports the scene as PDF and opens the system share sheet.
|
|
31
|
-
override public var onExport: OnExport.Handler? {
|
|
37
|
+
override public var onExport: OnExport.Handler? {
|
|
38
|
+
Self.defaultOnExportHandler
|
|
39
|
+
}
|
|
32
40
|
|
|
33
41
|
// MARK: - EditorConfiguration — UI Components
|
|
34
42
|
|
|
35
43
|
/// The navigation bar configuration.
|
|
36
|
-
override public var navigationBar: NavigationBar.Configuration? {
|
|
44
|
+
override public var navigationBar: NavigationBar.Configuration? {
|
|
45
|
+
Self.defaultNavigationBar
|
|
46
|
+
}
|
|
37
47
|
|
|
38
48
|
/// The dock configuration.
|
|
39
|
-
override public var dock: Dock.Configuration? {
|
|
49
|
+
override public var dock: Dock.Configuration? {
|
|
50
|
+
Self.defaultDock
|
|
51
|
+
}
|
|
40
52
|
|
|
41
53
|
/// The inspector bar configuration.
|
|
42
|
-
override public var inspectorBar: InspectorBar.Configuration? {
|
|
54
|
+
override public var inspectorBar: InspectorBar.Configuration? {
|
|
55
|
+
Self.defaultInspectorBar
|
|
56
|
+
}
|
|
43
57
|
|
|
44
58
|
/// The canvas menu configuration.
|
|
45
|
-
override public var canvasMenu: CanvasMenu.Configuration? {
|
|
59
|
+
override public var canvasMenu: CanvasMenu.Configuration? {
|
|
60
|
+
Self.defaultCanvasMenu
|
|
61
|
+
}
|
|
46
62
|
}
|
|
@@ -15,29 +15,43 @@ public final class DesignEditorConfiguration: EditorConfiguration {
|
|
|
15
15
|
// MARK: - EditorConfiguration — Settings
|
|
16
16
|
|
|
17
17
|
/// The zoom padding for the canvas.
|
|
18
|
-
override public var zoomPadding: CGFloat? {
|
|
18
|
+
override public var zoomPadding: CGFloat? {
|
|
19
|
+
16
|
|
20
|
+
}
|
|
19
21
|
|
|
20
22
|
// MARK: - EditorConfiguration — Callbacks
|
|
21
23
|
|
|
22
24
|
/// The `onCreate` handler.
|
|
23
|
-
override public var onCreate: OnCreate.Handler? {
|
|
25
|
+
override public var onCreate: OnCreate.Handler? {
|
|
26
|
+
Self.defaultOnCreateHandler
|
|
27
|
+
}
|
|
24
28
|
|
|
25
29
|
/// The export handler.
|
|
26
30
|
///
|
|
27
31
|
/// Default: Exports the scene as PDF and opens the system share sheet.
|
|
28
|
-
override public var onExport: OnExport.Handler? {
|
|
32
|
+
override public var onExport: OnExport.Handler? {
|
|
33
|
+
Self.defaultOnExportHandler
|
|
34
|
+
}
|
|
29
35
|
|
|
30
36
|
// MARK: - EditorConfiguration — UI Components
|
|
31
37
|
|
|
32
38
|
/// The navigation bar configuration.
|
|
33
|
-
override public var navigationBar: NavigationBar.Configuration? {
|
|
39
|
+
override public var navigationBar: NavigationBar.Configuration? {
|
|
40
|
+
Self.defaultNavigationBar
|
|
41
|
+
}
|
|
34
42
|
|
|
35
43
|
/// The dock configuration.
|
|
36
|
-
override public var dock: Dock.Configuration? {
|
|
44
|
+
override public var dock: Dock.Configuration? {
|
|
45
|
+
Self.defaultDock
|
|
46
|
+
}
|
|
37
47
|
|
|
38
48
|
/// The inspector bar configuration.
|
|
39
|
-
override public var inspectorBar: InspectorBar.Configuration? {
|
|
49
|
+
override public var inspectorBar: InspectorBar.Configuration? {
|
|
50
|
+
Self.defaultInspectorBar
|
|
51
|
+
}
|
|
40
52
|
|
|
41
53
|
/// The canvas menu configuration.
|
|
42
|
-
override public var canvasMenu: CanvasMenu.Configuration? {
|
|
54
|
+
override public var canvasMenu: CanvasMenu.Configuration? {
|
|
55
|
+
Self.defaultCanvasMenu
|
|
56
|
+
}
|
|
43
57
|
}
|
|
@@ -14,35 +14,53 @@ public final class PhotoEditorConfiguration: EditorConfiguration {
|
|
|
14
14
|
// MARK: - EditorConfiguration — Settings
|
|
15
15
|
|
|
16
16
|
/// The zoom padding for the canvas.
|
|
17
|
-
override public var zoomPadding: CGFloat? {
|
|
17
|
+
override public var zoomPadding: CGFloat? {
|
|
18
|
+
0
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
// MARK: - EditorConfiguration — Callbacks
|
|
20
22
|
|
|
21
23
|
/// The `onCreate` handler.
|
|
22
|
-
override public var onCreate: OnCreate.Handler? {
|
|
24
|
+
override public var onCreate: OnCreate.Handler? {
|
|
25
|
+
Self.defaultOnCreateHandler
|
|
26
|
+
}
|
|
23
27
|
|
|
24
28
|
/// The `onLoaded` handler.
|
|
25
|
-
override public var onLoaded: OnLoaded.Handler? {
|
|
29
|
+
override public var onLoaded: OnLoaded.Handler? {
|
|
30
|
+
Self.defaultOnLoadedHandler
|
|
31
|
+
}
|
|
26
32
|
|
|
27
33
|
/// The `onChanged` handler.
|
|
28
|
-
override public var onChanged: OnChanged.Handler? {
|
|
34
|
+
override public var onChanged: OnChanged.Handler? {
|
|
35
|
+
Self.defaultOnChangedHandler
|
|
36
|
+
}
|
|
29
37
|
|
|
30
38
|
/// The export handler.
|
|
31
39
|
///
|
|
32
40
|
/// Default: Exports the scene as PNG and opens the system share sheet.
|
|
33
|
-
override public var onExport: OnExport.Handler? {
|
|
41
|
+
override public var onExport: OnExport.Handler? {
|
|
42
|
+
Self.defaultOnExportHandler
|
|
43
|
+
}
|
|
34
44
|
|
|
35
45
|
// MARK: - EditorConfiguration — UI Components
|
|
36
46
|
|
|
37
47
|
/// The navigation bar configuration.
|
|
38
|
-
override public var navigationBar: NavigationBar.Configuration? {
|
|
48
|
+
override public var navigationBar: NavigationBar.Configuration? {
|
|
49
|
+
Self.defaultNavigationBar
|
|
50
|
+
}
|
|
39
51
|
|
|
40
52
|
/// The dock configuration.
|
|
41
|
-
override public var dock: Dock.Configuration? {
|
|
53
|
+
override public var dock: Dock.Configuration? {
|
|
54
|
+
Self.defaultDock
|
|
55
|
+
}
|
|
42
56
|
|
|
43
57
|
/// The inspector bar configuration.
|
|
44
|
-
override public var inspectorBar: InspectorBar.Configuration? {
|
|
58
|
+
override public var inspectorBar: InspectorBar.Configuration? {
|
|
59
|
+
Self.defaultInspectorBar
|
|
60
|
+
}
|
|
45
61
|
|
|
46
62
|
/// The canvas menu configuration.
|
|
47
|
-
override public var canvasMenu: CanvasMenu.Configuration? {
|
|
63
|
+
override public var canvasMenu: CanvasMenu.Configuration? {
|
|
64
|
+
Self.defaultCanvasMenu
|
|
65
|
+
}
|
|
48
66
|
}
|
|
@@ -84,6 +84,7 @@ public extension PhotoEditorConfiguration {
|
|
|
84
84
|
"ly.img.sticker", "ly.img.vector.shape", "ly.img.filter", "ly.img.color.palette",
|
|
85
85
|
"ly.img.effect", "ly.img.blur", "ly.img.typeface", "ly.img.crop.presets",
|
|
86
86
|
"ly.img.page.presets", "ly.img.text", "ly.img.text.styles", "ly.img.text.curves", "ly.img.text.components",
|
|
87
|
+
"ly.img.image",
|
|
87
88
|
]
|
|
88
89
|
try await withThrowingTaskGroup(of: String.self) { group in
|
|
89
90
|
for id in defaultSourceIDs {
|
|
@@ -14,32 +14,48 @@ public final class PostcardEditorConfiguration: EditorConfiguration {
|
|
|
14
14
|
// MARK: - EditorConfiguration — Settings
|
|
15
15
|
|
|
16
16
|
/// The zoom padding for the canvas.
|
|
17
|
-
override public var zoomPadding: CGFloat? {
|
|
17
|
+
override public var zoomPadding: CGFloat? {
|
|
18
|
+
16
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
// MARK: - EditorConfiguration — Callbacks
|
|
20
22
|
|
|
21
23
|
/// The `onCreate` handler.
|
|
22
|
-
override public var onCreate: OnCreate.Handler? {
|
|
24
|
+
override public var onCreate: OnCreate.Handler? {
|
|
25
|
+
Self.defaultOnCreateHandler
|
|
26
|
+
}
|
|
23
27
|
|
|
24
28
|
/// The `onChanged` handler.
|
|
25
|
-
override public var onChanged: OnChanged.Handler? {
|
|
29
|
+
override public var onChanged: OnChanged.Handler? {
|
|
30
|
+
Self.defaultOnChangedHandler
|
|
31
|
+
}
|
|
26
32
|
|
|
27
33
|
/// The export handler.
|
|
28
34
|
///
|
|
29
35
|
/// Default: Exports the scene as PDF and opens the system share sheet.
|
|
30
|
-
override public var onExport: OnExport.Handler? {
|
|
36
|
+
override public var onExport: OnExport.Handler? {
|
|
37
|
+
Self.defaultOnExportHandler
|
|
38
|
+
}
|
|
31
39
|
|
|
32
40
|
// MARK: - EditorConfiguration — UI Components
|
|
33
41
|
|
|
34
42
|
/// The navigation bar configuration.
|
|
35
|
-
override public var navigationBar: NavigationBar.Configuration? {
|
|
43
|
+
override public var navigationBar: NavigationBar.Configuration? {
|
|
44
|
+
Self.defaultNavigationBar
|
|
45
|
+
}
|
|
36
46
|
|
|
37
47
|
/// The dock configuration.
|
|
38
|
-
override public var dock: Dock.Configuration? {
|
|
48
|
+
override public var dock: Dock.Configuration? {
|
|
49
|
+
Self.defaultDock
|
|
50
|
+
}
|
|
39
51
|
|
|
40
52
|
/// The inspector bar configuration.
|
|
41
|
-
override public var inspectorBar: InspectorBar.Configuration? {
|
|
53
|
+
override public var inspectorBar: InspectorBar.Configuration? {
|
|
54
|
+
Self.defaultInspectorBar
|
|
55
|
+
}
|
|
42
56
|
|
|
43
57
|
/// The canvas menu configuration.
|
|
44
|
-
override public var canvasMenu: CanvasMenu.Configuration? {
|
|
58
|
+
override public var canvasMenu: CanvasMenu.Configuration? {
|
|
59
|
+
Self.defaultCanvasMenu
|
|
60
|
+
}
|
|
45
61
|
}
|
|
@@ -6,13 +6,24 @@ import SwiftUI
|
|
|
6
6
|
|
|
7
7
|
extension Dock.Buttons.ID {
|
|
8
8
|
/// The id of the ``Dock/Buttons/designColors(action:title:icon:isEnabled:isVisible:)`` button.
|
|
9
|
-
static var designColors: EditorComponentID {
|
|
9
|
+
static var designColors: EditorComponentID {
|
|
10
|
+
"ly.img.component.dock.button.postcard.designColors"
|
|
11
|
+
}
|
|
12
|
+
|
|
10
13
|
/// The id of the ``Dock/Buttons/greetingColors(action:title:icon:isEnabled:isVisible:)`` button.
|
|
11
|
-
static var greetingColors: EditorComponentID {
|
|
14
|
+
static var greetingColors: EditorComponentID {
|
|
15
|
+
"ly.img.component.dock.button.postcard.namedColors"
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
/// The id of the ``Dock/Buttons/greetingFont(action:title:icon:isEnabled:isVisible:)`` button.
|
|
13
|
-
static var greetingFont: EditorComponentID {
|
|
19
|
+
static var greetingFont: EditorComponentID {
|
|
20
|
+
"ly.img.component.dock.button.postcard.greetingFont"
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
/// The id of the ``Dock/Buttons/greetingSize(action:title:icon:isEnabled:isVisible:)`` button.
|
|
15
|
-
static var greetingSize: EditorComponentID {
|
|
24
|
+
static var greetingSize: EditorComponentID {
|
|
25
|
+
"ly.img.component.dock.button.postcard.greetingSize"
|
|
26
|
+
}
|
|
16
27
|
}
|
|
17
28
|
|
|
18
29
|
// MARK: - Dock Buttons
|
|
@@ -14,7 +14,9 @@ public final class VideoEditorConfiguration: EditorConfiguration {
|
|
|
14
14
|
// MARK: - EditorConfiguration — Settings
|
|
15
15
|
|
|
16
16
|
/// The zoom padding for the canvas.
|
|
17
|
-
override public var zoomPadding: CGFloat? {
|
|
17
|
+
override public var zoomPadding: CGFloat? {
|
|
18
|
+
1
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
/// The asset library configuration.
|
|
20
22
|
///
|
|
@@ -28,27 +30,41 @@ public final class VideoEditorConfiguration: EditorConfiguration {
|
|
|
28
30
|
// MARK: - EditorConfiguration — Callbacks
|
|
29
31
|
|
|
30
32
|
/// The `onCreate` handler.
|
|
31
|
-
override public var onCreate: OnCreate.Handler? {
|
|
33
|
+
override public var onCreate: OnCreate.Handler? {
|
|
34
|
+
Self.defaultOnCreateHandler
|
|
35
|
+
}
|
|
32
36
|
|
|
33
37
|
/// The export handler.
|
|
34
38
|
///
|
|
35
39
|
/// Default: Exports the current page as MP4 and opens the system share sheet.
|
|
36
|
-
override public var onExport: OnExport.Handler? {
|
|
40
|
+
override public var onExport: OnExport.Handler? {
|
|
41
|
+
Self.defaultOnExportHandler
|
|
42
|
+
}
|
|
37
43
|
|
|
38
44
|
// MARK: - EditorConfiguration — UI Components
|
|
39
45
|
|
|
40
46
|
/// The navigation bar configuration.
|
|
41
|
-
override public var navigationBar: NavigationBar.Configuration? {
|
|
47
|
+
override public var navigationBar: NavigationBar.Configuration? {
|
|
48
|
+
Self.defaultNavigationBar
|
|
49
|
+
}
|
|
42
50
|
|
|
43
51
|
/// The dock configuration.
|
|
44
|
-
override public var dock: Dock.Configuration? {
|
|
52
|
+
override public var dock: Dock.Configuration? {
|
|
53
|
+
Self.defaultDock
|
|
54
|
+
}
|
|
45
55
|
|
|
46
56
|
/// The inspector bar configuration.
|
|
47
|
-
override public var inspectorBar: InspectorBar.Configuration? {
|
|
57
|
+
override public var inspectorBar: InspectorBar.Configuration? {
|
|
58
|
+
Self.defaultInspectorBar
|
|
59
|
+
}
|
|
48
60
|
|
|
49
61
|
/// The canvas menu configuration.
|
|
50
|
-
override public var canvasMenu: CanvasMenu.Configuration? {
|
|
62
|
+
override public var canvasMenu: CanvasMenu.Configuration? {
|
|
63
|
+
Self.defaultCanvasMenu
|
|
64
|
+
}
|
|
51
65
|
|
|
52
66
|
/// The bottom panel configuration.
|
|
53
|
-
override public var bottomPanel: BottomPanel.Configuration? {
|
|
67
|
+
override public var bottomPanel: BottomPanel.Configuration? {
|
|
68
|
+
Self.defaultBottomPanel
|
|
69
|
+
}
|
|
54
70
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/editor-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.79.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",
|
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.79.0/assets';
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Unique ID tied to your application's user.
|