@imgly/editor-react-native 1.76.1 → 1.77.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/IMGLYEditorModule.podspec +0 -21
- package/android/build.gradle +1 -5
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/callback/OnCreate.kt +21 -32
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/component/InspectorBar.kt +4 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/callback/OnCreate.kt +21 -33
- package/android/src/main/kotlin/ly/img/editor/configuration/design/component/Dock.kt +2 -2
- package/android/src/main/kotlin/ly/img/editor/configuration/design/component/InspectorBar.kt +4 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/callback/OnCreate.kt +19 -31
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/component/InspectorBar.kt +4 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/callback/OnCreate.kt +21 -32
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/component/InspectorBar.kt +4 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/callback/OnCreate.kt +25 -37
- package/android/src/main/kotlin/ly/img/editor/configuration/video/component/InspectorBar.kt +4 -0
- package/android/src/main/kotlin/ly/img/editor/reactnative/module/builder/EditorBuilder.kt +5 -0
- package/ios/Model/EditorBuilder.swift +5 -2
- package/ios/StarterKits/Apparel/callbacks/OnCreate+Apparel.swift +15 -22
- package/ios/StarterKits/Apparel/components/InspectorBar+Apparel.swift +2 -0
- package/ios/StarterKits/Design/callbacks/OnCreate+Design.swift +15 -22
- package/ios/StarterKits/Design/components/Dock+Design.swift +1 -1
- package/ios/StarterKits/Design/components/InspectorBar+Design.swift +2 -0
- package/ios/StarterKits/Photo/callbacks/OnCreate+Photo.swift +12 -19
- package/ios/StarterKits/Photo/components/InspectorBar+Photo.swift +2 -0
- package/ios/StarterKits/Postcard/callbacks/OnCreate+Postcard.swift +15 -22
- package/ios/StarterKits/Postcard/components/InspectorBar+Postcard.swift +2 -0
- package/ios/StarterKits/Video/callbacks/OnCreate+Video.swift +19 -32
- package/ios/StarterKits/Video/components/InspectorBar+Video.swift +2 -0
- package/package.json +1 -1
- package/src/NativeIMGLYEditor.ts +1 -1
|
@@ -13,27 +13,6 @@ 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
|
-
|
|
37
16
|
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
38
17
|
s.exclude_files = 'ios/StarterKits/**/*StarterKit.swift'
|
|
39
18
|
s.resources = 'ios/StarterKits/*.{scene,png}'
|
package/android/build.gradle
CHANGED
|
@@ -96,10 +96,6 @@ 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
|
-
}
|
|
103
99
|
|
|
104
100
|
if (isKotlin2OrHigher()) {
|
|
105
101
|
try {
|
|
@@ -147,7 +143,7 @@ repositories {
|
|
|
147
143
|
}
|
|
148
144
|
|
|
149
145
|
dependencies {
|
|
150
|
-
api "ly.img:editor:1.
|
|
146
|
+
api "ly.img:editor:1.77.0"
|
|
151
147
|
|
|
152
148
|
implementation "androidx.activity:activity-ktx:1.9.0"
|
|
153
149
|
implementation "androidx.appcompat:appcompat:1.7.1"
|
|
@@ -10,16 +10,11 @@ import ly.img.editor.core.UnstableEditorApi
|
|
|
10
10
|
import ly.img.editor.core.library.data.AssetSourceType
|
|
11
11
|
import ly.img.editor.core.library.data.SystemGalleryAssetSource
|
|
12
12
|
import ly.img.editor.core.library.data.SystemGalleryPermission
|
|
13
|
-
import ly.img.editor.core.library.data.TextAssetSource
|
|
14
|
-
import ly.img.editor.core.library.data.TypefaceProvider
|
|
15
13
|
import ly.img.engine.BlendMode
|
|
16
14
|
import ly.img.engine.Color
|
|
17
|
-
import ly.img.engine.DefaultAssetSource
|
|
18
|
-
import ly.img.engine.DemoAssetSource
|
|
19
15
|
import ly.img.engine.DesignBlockType
|
|
20
16
|
import ly.img.engine.ShapeType
|
|
21
17
|
import ly.img.engine.StrokeStyle
|
|
22
|
-
import ly.img.engine.populateAssetSource
|
|
23
18
|
|
|
24
19
|
/**
|
|
25
20
|
* The callback that is invoked when the editor is created.
|
|
@@ -78,24 +73,27 @@ suspend fun ApparelConfigurationBuilder.onCreateScene() {
|
|
|
78
73
|
suspend fun ApparelConfigurationBuilder.onLoadAssetSources() {
|
|
79
74
|
// Load asset sources in parallel from content.json files
|
|
80
75
|
coroutineScope {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
76
|
+
val baseUri = editorContext.baseUri
|
|
77
|
+
val sourceIds = listOf(
|
|
78
|
+
"ly.img.sticker",
|
|
79
|
+
"ly.img.vector.shape",
|
|
80
|
+
"ly.img.filter",
|
|
81
|
+
"ly.img.color.palette",
|
|
82
|
+
"ly.img.effect",
|
|
83
|
+
"ly.img.blur",
|
|
84
|
+
"ly.img.typeface",
|
|
85
|
+
"ly.img.crop.presets",
|
|
86
|
+
"ly.img.page.presets",
|
|
87
|
+
"ly.img.text",
|
|
88
|
+
"ly.img.text.styles",
|
|
89
|
+
"ly.img.text.curves",
|
|
90
|
+
"ly.img.text.components",
|
|
91
|
+
"ly.img.image",
|
|
92
|
+
)
|
|
93
|
+
sourceIds.forEach { id ->
|
|
93
94
|
launch {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
id = assetSource,
|
|
97
|
-
jsonUri = "$baseUri/$assetSource/content.json".toUri(),
|
|
98
|
-
replaceBaseUri = baseUri,
|
|
95
|
+
editorContext.engine.asset.addLocalSourceFromJSON(
|
|
96
|
+
contentUri = "$baseUri/$id/content.json".toUri(),
|
|
99
97
|
)
|
|
100
98
|
}
|
|
101
99
|
}
|
|
@@ -103,7 +101,7 @@ suspend fun ApparelConfigurationBuilder.onLoadAssetSources() {
|
|
|
103
101
|
|
|
104
102
|
// Load local asset sources
|
|
105
103
|
editorContext.engine.asset.addLocalSource(
|
|
106
|
-
sourceId =
|
|
104
|
+
sourceId = "ly.img.image.upload",
|
|
107
105
|
supportedMimeTypes = listOf(
|
|
108
106
|
"image/jpeg",
|
|
109
107
|
"image/png",
|
|
@@ -130,15 +128,6 @@ suspend fun ApparelConfigurationBuilder.onLoadAssetSources() {
|
|
|
130
128
|
)
|
|
131
129
|
}
|
|
132
130
|
SystemGalleryPermission.setMode(systemGalleryConfiguration)
|
|
133
|
-
|
|
134
|
-
// Register text asset source
|
|
135
|
-
TypefaceProvider().provideTypeface(
|
|
136
|
-
engine = editorContext.engine,
|
|
137
|
-
name = "Roboto",
|
|
138
|
-
)?.let {
|
|
139
|
-
val textAssetSource = TextAssetSource(engine = editorContext.engine, typeface = it)
|
|
140
|
-
editorContext.engine.asset.addSource(textAssetSource)
|
|
141
|
-
}
|
|
142
131
|
}
|
|
143
132
|
// highlight-starter-kit-on-load-asset-sources
|
|
144
133
|
|
package/android/src/main/kotlin/ly/img/editor/configuration/apparel/component/InspectorBar.kt
CHANGED
|
@@ -22,6 +22,8 @@ import ly.img.editor.core.component.rememberReplace
|
|
|
22
22
|
import ly.img.editor.core.component.rememberSelectGroup
|
|
23
23
|
import ly.img.editor.core.component.rememberShape
|
|
24
24
|
import ly.img.editor.core.component.rememberTextBackground
|
|
25
|
+
import ly.img.editor.core.component.rememberTextOnPath
|
|
26
|
+
import ly.img.editor.core.component.rememberTextPresets
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* The configuration of the component that is displayed as horizontal list of items at the
|
|
@@ -33,9 +35,11 @@ fun ApparelConfigurationBuilder.rememberInspectorBar() = InspectorBar.remember {
|
|
|
33
35
|
InspectorBar.ListBuilder.remember {
|
|
34
36
|
add { InspectorBar.Button.rememberReplace() } // Image, Sticker, Audio
|
|
35
37
|
add { InspectorBar.Button.rememberEditText() } // Text
|
|
38
|
+
add { InspectorBar.Button.rememberTextPresets() } // Text
|
|
36
39
|
add { InspectorBar.Button.rememberFormatText() } // Text
|
|
37
40
|
add { InspectorBar.Button.rememberFillStroke() } // Page, Image, Shape, Text
|
|
38
41
|
add { InspectorBar.Button.rememberTextBackground() } // Text
|
|
42
|
+
add { InspectorBar.Button.rememberTextOnPath() } // Text
|
|
39
43
|
add { InspectorBar.Button.rememberCrop() } // Image
|
|
40
44
|
add { InspectorBar.Button.rememberAdjustments() } // Image
|
|
41
45
|
add { InspectorBar.Button.rememberFilter() } // Image
|
|
@@ -7,12 +7,7 @@ import ly.img.editor.configuration.design.DesignConfigurationBuilder
|
|
|
7
7
|
import ly.img.editor.core.library.data.AssetSourceType
|
|
8
8
|
import ly.img.editor.core.library.data.SystemGalleryAssetSource
|
|
9
9
|
import ly.img.editor.core.library.data.SystemGalleryPermission
|
|
10
|
-
import ly.img.editor.core.library.data.TextAssetSource
|
|
11
|
-
import ly.img.editor.core.library.data.TypefaceProvider
|
|
12
|
-
import ly.img.engine.DefaultAssetSource
|
|
13
|
-
import ly.img.engine.DemoAssetSource
|
|
14
10
|
import ly.img.engine.DesignBlockType
|
|
15
|
-
import ly.img.engine.populateAssetSource
|
|
16
11
|
|
|
17
12
|
/**
|
|
18
13
|
* The callback that is invoked when the editor is created.
|
|
@@ -72,25 +67,27 @@ suspend fun DesignConfigurationBuilder.onCreateScene() {
|
|
|
72
67
|
suspend fun DesignConfigurationBuilder.onLoadAssetSources() {
|
|
73
68
|
// Load asset sources in parallel from content.json files
|
|
74
69
|
coroutineScope {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
val baseUri = editorContext.baseUri
|
|
71
|
+
val sourceIds = listOf(
|
|
72
|
+
"ly.img.sticker",
|
|
73
|
+
"ly.img.vector.shape",
|
|
74
|
+
"ly.img.filter",
|
|
75
|
+
"ly.img.color.palette",
|
|
76
|
+
"ly.img.effect",
|
|
77
|
+
"ly.img.blur",
|
|
78
|
+
"ly.img.typeface",
|
|
79
|
+
"ly.img.crop.presets",
|
|
80
|
+
"ly.img.page.presets",
|
|
81
|
+
"ly.img.text",
|
|
82
|
+
"ly.img.text.styles",
|
|
83
|
+
"ly.img.text.curves",
|
|
84
|
+
"ly.img.text.components",
|
|
85
|
+
"ly.img.image",
|
|
86
|
+
)
|
|
87
|
+
sourceIds.forEach { id ->
|
|
88
88
|
launch {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
id = assetSource,
|
|
92
|
-
jsonUri = "$baseUri/$assetSource/content.json".toUri(),
|
|
93
|
-
replaceBaseUri = baseUri,
|
|
89
|
+
editorContext.engine.asset.addLocalSourceFromJSON(
|
|
90
|
+
contentUri = "$baseUri/$id/content.json".toUri(),
|
|
94
91
|
)
|
|
95
92
|
}
|
|
96
93
|
}
|
|
@@ -98,7 +95,7 @@ suspend fun DesignConfigurationBuilder.onLoadAssetSources() {
|
|
|
98
95
|
|
|
99
96
|
// Load local asset sources
|
|
100
97
|
editorContext.engine.asset.addLocalSource(
|
|
101
|
-
sourceId =
|
|
98
|
+
sourceId = "ly.img.image.upload",
|
|
102
99
|
supportedMimeTypes = listOf(
|
|
103
100
|
"image/jpeg",
|
|
104
101
|
"image/png",
|
|
@@ -125,15 +122,6 @@ suspend fun DesignConfigurationBuilder.onLoadAssetSources() {
|
|
|
125
122
|
)
|
|
126
123
|
}
|
|
127
124
|
SystemGalleryPermission.setMode(systemGalleryConfiguration)
|
|
128
|
-
|
|
129
|
-
// Register text asset source
|
|
130
|
-
TypefaceProvider().provideTypeface(
|
|
131
|
-
engine = editorContext.engine,
|
|
132
|
-
name = "Roboto",
|
|
133
|
-
)?.let {
|
|
134
|
-
val textAssetSource = TextAssetSource(engine = editorContext.engine, typeface = it)
|
|
135
|
-
editorContext.engine.asset.addSource(textAssetSource)
|
|
136
|
-
}
|
|
137
125
|
}
|
|
138
126
|
// highlight-starter-kit-on-load-asset-sources
|
|
139
127
|
|
|
@@ -8,10 +8,10 @@ import ly.img.editor.core.component.Dock
|
|
|
8
8
|
import ly.img.editor.core.component.remember
|
|
9
9
|
import ly.img.editor.core.component.rememberElementsLibrary
|
|
10
10
|
import ly.img.editor.core.component.rememberImagesLibrary
|
|
11
|
+
import ly.img.editor.core.component.rememberImglyCamera
|
|
11
12
|
import ly.img.editor.core.component.rememberResizeAll
|
|
12
13
|
import ly.img.editor.core.component.rememberShapesLibrary
|
|
13
14
|
import ly.img.editor.core.component.rememberStickersLibrary
|
|
14
|
-
import ly.img.editor.core.component.rememberSystemCamera
|
|
15
15
|
import ly.img.editor.core.component.rememberSystemGallery
|
|
16
16
|
import ly.img.editor.core.component.rememberTextLibrary
|
|
17
17
|
|
|
@@ -24,7 +24,7 @@ fun DesignConfigurationBuilder.rememberDock() = Dock.remember {
|
|
|
24
24
|
Dock.ListBuilder.remember {
|
|
25
25
|
add { Dock.Button.rememberElementsLibrary() }
|
|
26
26
|
add { Dock.Button.rememberSystemGallery() }
|
|
27
|
-
add { Dock.Button.
|
|
27
|
+
add { Dock.Button.rememberImglyCamera() }
|
|
28
28
|
add { Dock.Button.rememberImagesLibrary() }
|
|
29
29
|
add { Dock.Button.rememberTextLibrary() }
|
|
30
30
|
add { Dock.Button.rememberShapesLibrary() }
|
package/android/src/main/kotlin/ly/img/editor/configuration/design/component/InspectorBar.kt
CHANGED
|
@@ -22,6 +22,8 @@ import ly.img.editor.core.component.rememberReplace
|
|
|
22
22
|
import ly.img.editor.core.component.rememberSelectGroup
|
|
23
23
|
import ly.img.editor.core.component.rememberShape
|
|
24
24
|
import ly.img.editor.core.component.rememberTextBackground
|
|
25
|
+
import ly.img.editor.core.component.rememberTextOnPath
|
|
26
|
+
import ly.img.editor.core.component.rememberTextPresets
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* The configuration of the component that is displayed as horizontal list of items at the
|
|
@@ -33,9 +35,11 @@ fun DesignConfigurationBuilder.rememberInspectorBar() = InspectorBar.remember {
|
|
|
33
35
|
InspectorBar.ListBuilder.remember {
|
|
34
36
|
add { InspectorBar.Button.rememberReplace() } // Image, Sticker, Audio
|
|
35
37
|
add { InspectorBar.Button.rememberEditText() } // Text
|
|
38
|
+
add { InspectorBar.Button.rememberTextPresets() } // Text
|
|
36
39
|
add { InspectorBar.Button.rememberFormatText() } // Text
|
|
37
40
|
add { InspectorBar.Button.rememberFillStroke() } // Page, Image, Shape, Text
|
|
38
41
|
add { InspectorBar.Button.rememberTextBackground() } // Text
|
|
42
|
+
add { InspectorBar.Button.rememberTextOnPath() } // Text
|
|
39
43
|
add { InspectorBar.Button.rememberCrop() } // Image
|
|
40
44
|
add { InspectorBar.Button.rememberAdjustments() } // Image
|
|
41
45
|
add { InspectorBar.Button.rememberFilter() } // Image
|
|
@@ -8,13 +8,8 @@ import androidx.core.net.toUri
|
|
|
8
8
|
import kotlinx.coroutines.coroutineScope
|
|
9
9
|
import kotlinx.coroutines.launch
|
|
10
10
|
import ly.img.editor.configuration.photo.PhotoConfigurationBuilder
|
|
11
|
-
import ly.img.editor.core.library.data.TextAssetSource
|
|
12
|
-
import ly.img.editor.core.library.data.TypefaceProvider
|
|
13
|
-
import ly.img.engine.DefaultAssetSource
|
|
14
|
-
import ly.img.engine.DemoAssetSource
|
|
15
11
|
import ly.img.engine.DesignBlock
|
|
16
12
|
import ly.img.engine.SceneLayout
|
|
17
|
-
import ly.img.engine.populateAssetSource
|
|
18
13
|
|
|
19
14
|
/**
|
|
20
15
|
* The callback that is invoked when the editor is created.
|
|
@@ -92,37 +87,30 @@ suspend fun PhotoConfigurationBuilder.getOrCreateSceneFromImage(
|
|
|
92
87
|
suspend fun PhotoConfigurationBuilder.onLoadAssetSources() {
|
|
93
88
|
// Load asset sources in parallel from content.json files
|
|
94
89
|
coroutineScope {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
90
|
+
val baseUri = editorContext.baseUri
|
|
91
|
+
val sourceIds = listOf(
|
|
92
|
+
"ly.img.sticker",
|
|
93
|
+
"ly.img.vector.shape",
|
|
94
|
+
"ly.img.filter",
|
|
95
|
+
"ly.img.color.palette",
|
|
96
|
+
"ly.img.effect",
|
|
97
|
+
"ly.img.blur",
|
|
98
|
+
"ly.img.typeface",
|
|
99
|
+
"ly.img.crop.presets",
|
|
100
|
+
"ly.img.page.presets",
|
|
101
|
+
"ly.img.text",
|
|
102
|
+
"ly.img.text.styles",
|
|
103
|
+
"ly.img.text.curves",
|
|
104
|
+
"ly.img.text.components",
|
|
105
|
+
)
|
|
106
|
+
sourceIds.forEach { id ->
|
|
107
107
|
launch {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
id = assetSource,
|
|
111
|
-
jsonUri = "$baseUri/$assetSource/content.json".toUri(),
|
|
112
|
-
replaceBaseUri = baseUri,
|
|
108
|
+
editorContext.engine.asset.addLocalSourceFromJSON(
|
|
109
|
+
contentUri = "$baseUri/$id/content.json".toUri(),
|
|
113
110
|
)
|
|
114
111
|
}
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
|
-
|
|
118
|
-
// Register text asset source
|
|
119
|
-
TypefaceProvider().provideTypeface(
|
|
120
|
-
engine = editorContext.engine,
|
|
121
|
-
name = "Roboto",
|
|
122
|
-
)?.let {
|
|
123
|
-
val textAssetSource = TextAssetSource(engine = editorContext.engine, typeface = it)
|
|
124
|
-
editorContext.engine.asset.addSource(textAssetSource)
|
|
125
|
-
}
|
|
126
114
|
}
|
|
127
115
|
// highlight-starter-kit-on-load-asset-sources
|
|
128
116
|
|
|
@@ -22,6 +22,8 @@ import ly.img.editor.core.component.rememberReplace
|
|
|
22
22
|
import ly.img.editor.core.component.rememberSelectGroup
|
|
23
23
|
import ly.img.editor.core.component.rememberShape
|
|
24
24
|
import ly.img.editor.core.component.rememberTextBackground
|
|
25
|
+
import ly.img.editor.core.component.rememberTextOnPath
|
|
26
|
+
import ly.img.editor.core.component.rememberTextPresets
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* The configuration of the component that is displayed as horizontal list of items at the
|
|
@@ -33,9 +35,11 @@ fun PhotoConfigurationBuilder.rememberInspectorBar() = InspectorBar.remember {
|
|
|
33
35
|
InspectorBar.ListBuilder.remember {
|
|
34
36
|
add { InspectorBar.Button.rememberReplace() } // Image, Sticker, Audio
|
|
35
37
|
add { InspectorBar.Button.rememberEditText() } // Text
|
|
38
|
+
add { InspectorBar.Button.rememberTextPresets() } // Text
|
|
36
39
|
add { InspectorBar.Button.rememberFormatText() } // Text
|
|
37
40
|
add { InspectorBar.Button.rememberFillStroke() } // Page, Image, Shape, Text
|
|
38
41
|
add { InspectorBar.Button.rememberTextBackground() } // Text
|
|
42
|
+
add { InspectorBar.Button.rememberTextOnPath() } // Text
|
|
39
43
|
add { InspectorBar.Button.rememberCrop() } // Image
|
|
40
44
|
add { InspectorBar.Button.rememberAdjustments() } // Image
|
|
41
45
|
add { InspectorBar.Button.rememberFilter() } // Image
|
|
@@ -9,12 +9,7 @@ import ly.img.editor.configuration.postcard.PostcardConfigurationBuilder
|
|
|
9
9
|
import ly.img.editor.core.library.data.AssetSourceType
|
|
10
10
|
import ly.img.editor.core.library.data.SystemGalleryAssetSource
|
|
11
11
|
import ly.img.editor.core.library.data.SystemGalleryPermission
|
|
12
|
-
import ly.img.editor.core.library.data.TextAssetSource
|
|
13
|
-
import ly.img.editor.core.library.data.TypefaceProvider
|
|
14
|
-
import ly.img.engine.DefaultAssetSource
|
|
15
|
-
import ly.img.engine.DemoAssetSource
|
|
16
12
|
import ly.img.engine.GlobalScope
|
|
17
|
-
import ly.img.engine.populateAssetSource
|
|
18
13
|
|
|
19
14
|
/**
|
|
20
15
|
* The callback that is invoked when the editor is created.
|
|
@@ -70,24 +65,27 @@ suspend fun PostcardConfigurationBuilder.onCreateScene() {
|
|
|
70
65
|
suspend fun PostcardConfigurationBuilder.onLoadAssetSources() {
|
|
71
66
|
// Load asset sources in parallel from content.json files
|
|
72
67
|
coroutineScope {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
68
|
+
val baseUri = editorContext.baseUri
|
|
69
|
+
// Postcard intentionally registers a custom subset of default sources (no
|
|
70
|
+
// ly.img.color.palette / ly.img.page.presets — those are provided by the postcard builder).
|
|
71
|
+
val sourceIds = listOf(
|
|
72
|
+
"ly.img.sticker",
|
|
73
|
+
"ly.img.vector.shape",
|
|
74
|
+
"ly.img.filter",
|
|
75
|
+
"ly.img.crop.presets",
|
|
76
|
+
"ly.img.effect",
|
|
77
|
+
"ly.img.blur",
|
|
78
|
+
"ly.img.typeface",
|
|
79
|
+
"ly.img.text",
|
|
80
|
+
"ly.img.text.styles",
|
|
81
|
+
"ly.img.text.curves",
|
|
82
|
+
"ly.img.text.components",
|
|
83
|
+
"ly.img.image",
|
|
84
|
+
)
|
|
85
|
+
sourceIds.forEach { id ->
|
|
85
86
|
launch {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
id = assetSource,
|
|
89
|
-
jsonUri = "$baseUri/$assetSource/content.json".toUri(),
|
|
90
|
-
replaceBaseUri = baseUri,
|
|
87
|
+
editorContext.engine.asset.addLocalSourceFromJSON(
|
|
88
|
+
contentUri = "$baseUri/$id/content.json".toUri(),
|
|
91
89
|
)
|
|
92
90
|
}
|
|
93
91
|
}
|
|
@@ -95,7 +93,7 @@ suspend fun PostcardConfigurationBuilder.onLoadAssetSources() {
|
|
|
95
93
|
|
|
96
94
|
// Load local asset sources
|
|
97
95
|
editorContext.engine.asset.addLocalSource(
|
|
98
|
-
sourceId =
|
|
96
|
+
sourceId = "ly.img.image.upload",
|
|
99
97
|
supportedMimeTypes = listOf(
|
|
100
98
|
"image/jpeg",
|
|
101
99
|
"image/png",
|
|
@@ -122,15 +120,6 @@ suspend fun PostcardConfigurationBuilder.onLoadAssetSources() {
|
|
|
122
120
|
)
|
|
123
121
|
}
|
|
124
122
|
SystemGalleryPermission.setMode(systemGalleryConfiguration)
|
|
125
|
-
|
|
126
|
-
// Register text asset source
|
|
127
|
-
TypefaceProvider().provideTypeface(
|
|
128
|
-
engine = editorContext.engine,
|
|
129
|
-
name = "Roboto",
|
|
130
|
-
)?.let {
|
|
131
|
-
val textAssetSource = TextAssetSource(engine = editorContext.engine, typeface = it)
|
|
132
|
-
editorContext.engine.asset.addSource(textAssetSource)
|
|
133
|
-
}
|
|
134
123
|
}
|
|
135
124
|
// highlight-starter-kit-on-load-asset-sources
|
|
136
125
|
|
package/android/src/main/kotlin/ly/img/editor/configuration/postcard/component/InspectorBar.kt
CHANGED
|
@@ -22,6 +22,8 @@ import ly.img.editor.core.component.rememberReplace
|
|
|
22
22
|
import ly.img.editor.core.component.rememberSelectGroup
|
|
23
23
|
import ly.img.editor.core.component.rememberShape
|
|
24
24
|
import ly.img.editor.core.component.rememberTextBackground
|
|
25
|
+
import ly.img.editor.core.component.rememberTextOnPath
|
|
26
|
+
import ly.img.editor.core.component.rememberTextPresets
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* The configuration of the component that is displayed as horizontal list of items at the
|
|
@@ -33,9 +35,11 @@ fun PostcardConfigurationBuilder.rememberInspectorBar() = InspectorBar.remember
|
|
|
33
35
|
InspectorBar.ListBuilder.remember {
|
|
34
36
|
add { InspectorBar.Button.rememberReplace() } // Image, Sticker, Audio
|
|
35
37
|
add { InspectorBar.Button.rememberEditText() } // Text
|
|
38
|
+
add { InspectorBar.Button.rememberTextPresets() } // Text
|
|
36
39
|
add { InspectorBar.Button.rememberFormatText() } // Text
|
|
37
40
|
add { InspectorBar.Button.rememberFillStroke() } // Page, Image, Shape, Text
|
|
38
41
|
add { InspectorBar.Button.rememberTextBackground() } // Text
|
|
42
|
+
add { InspectorBar.Button.rememberTextOnPath() } // Text
|
|
39
43
|
add { InspectorBar.Button.rememberCrop() } // Image
|
|
40
44
|
add { InspectorBar.Button.rememberAdjustments() } // Image
|
|
41
45
|
add { InspectorBar.Button.rememberFilter() } // Image
|
|
@@ -11,12 +11,7 @@ import ly.img.editor.core.UnstableEditorApi
|
|
|
11
11
|
import ly.img.editor.core.library.data.AssetSourceType
|
|
12
12
|
import ly.img.editor.core.library.data.SystemGalleryAssetSource
|
|
13
13
|
import ly.img.editor.core.library.data.SystemGalleryPermission
|
|
14
|
-
import ly.img.editor.core.library.data.TextAssetSource
|
|
15
|
-
import ly.img.editor.core.library.data.TypefaceProvider
|
|
16
14
|
import ly.img.engine.Color
|
|
17
|
-
import ly.img.engine.DefaultAssetSource
|
|
18
|
-
import ly.img.engine.DemoAssetSource
|
|
19
|
-
import ly.img.engine.populateAssetSource
|
|
20
15
|
|
|
21
16
|
/**
|
|
22
17
|
* The callback that is invoked when the editor is created.
|
|
@@ -87,27 +82,29 @@ suspend fun VideoConfigurationBuilder.onCreateScene() {
|
|
|
87
82
|
suspend fun VideoConfigurationBuilder.onLoadAssetSources() {
|
|
88
83
|
// Load asset sources in parallel from content.json files
|
|
89
84
|
coroutineScope {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
85
|
+
val baseUri = editorContext.baseUri
|
|
86
|
+
val sourceIds = listOf(
|
|
87
|
+
"ly.img.sticker",
|
|
88
|
+
"ly.img.vector.shape",
|
|
89
|
+
"ly.img.filter",
|
|
90
|
+
"ly.img.color.palette",
|
|
91
|
+
"ly.img.effect",
|
|
92
|
+
"ly.img.blur",
|
|
93
|
+
"ly.img.typeface",
|
|
94
|
+
"ly.img.crop.presets",
|
|
95
|
+
"ly.img.page.presets",
|
|
96
|
+
"ly.img.text",
|
|
97
|
+
"ly.img.text.styles",
|
|
98
|
+
"ly.img.text.curves",
|
|
99
|
+
"ly.img.text.components",
|
|
100
|
+
"ly.img.image",
|
|
101
|
+
"ly.img.audio",
|
|
102
|
+
"ly.img.video",
|
|
103
|
+
)
|
|
104
|
+
sourceIds.forEach { id ->
|
|
105
105
|
launch {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
id = assetSource,
|
|
109
|
-
jsonUri = "$baseUri/$assetSource/content.json".toUri(),
|
|
110
|
-
replaceBaseUri = baseUri,
|
|
106
|
+
editorContext.engine.asset.addLocalSourceFromJSON(
|
|
107
|
+
contentUri = "$baseUri/$id/content.json".toUri(),
|
|
111
108
|
)
|
|
112
109
|
}
|
|
113
110
|
}
|
|
@@ -122,7 +119,7 @@ suspend fun VideoConfigurationBuilder.onLoadAssetSources() {
|
|
|
122
119
|
|
|
123
120
|
// Load local asset sources
|
|
124
121
|
editorContext.engine.asset.addLocalSource(
|
|
125
|
-
sourceId =
|
|
122
|
+
sourceId = "ly.img.image.upload",
|
|
126
123
|
supportedMimeTypes = listOf(
|
|
127
124
|
"image/jpeg",
|
|
128
125
|
"image/png",
|
|
@@ -136,7 +133,7 @@ suspend fun VideoConfigurationBuilder.onLoadAssetSources() {
|
|
|
136
133
|
)
|
|
137
134
|
|
|
138
135
|
editorContext.engine.asset.addLocalSource(
|
|
139
|
-
sourceId =
|
|
136
|
+
sourceId = "ly.img.audio.upload",
|
|
140
137
|
supportedMimeTypes = listOf(
|
|
141
138
|
"audio/x-m4a",
|
|
142
139
|
"audio/mp3",
|
|
@@ -144,7 +141,7 @@ suspend fun VideoConfigurationBuilder.onLoadAssetSources() {
|
|
|
144
141
|
),
|
|
145
142
|
)
|
|
146
143
|
editorContext.engine.asset.addLocalSource(
|
|
147
|
-
sourceId =
|
|
144
|
+
sourceId = "ly.img.video.upload",
|
|
148
145
|
supportedMimeTypes = listOf(
|
|
149
146
|
"video/mp4",
|
|
150
147
|
),
|
|
@@ -164,15 +161,6 @@ suspend fun VideoConfigurationBuilder.onLoadAssetSources() {
|
|
|
164
161
|
)
|
|
165
162
|
}
|
|
166
163
|
SystemGalleryPermission.setMode(systemGalleryConfiguration)
|
|
167
|
-
|
|
168
|
-
// Register text asset source
|
|
169
|
-
TypefaceProvider().provideTypeface(
|
|
170
|
-
engine = editorContext.engine,
|
|
171
|
-
name = "Roboto",
|
|
172
|
-
)?.let {
|
|
173
|
-
val textAssetSource = TextAssetSource(engine = editorContext.engine, typeface = it)
|
|
174
|
-
editorContext.engine.asset.addSource(textAssetSource)
|
|
175
|
-
}
|
|
176
164
|
}
|
|
177
165
|
// highlight-starter-kit-on-load-asset-sources
|
|
178
166
|
|
|
@@ -25,6 +25,8 @@ import ly.img.editor.core.component.rememberSelectGroup
|
|
|
25
25
|
import ly.img.editor.core.component.rememberShape
|
|
26
26
|
import ly.img.editor.core.component.rememberSplit
|
|
27
27
|
import ly.img.editor.core.component.rememberTextBackground
|
|
28
|
+
import ly.img.editor.core.component.rememberTextOnPath
|
|
29
|
+
import ly.img.editor.core.component.rememberTextPresets
|
|
28
30
|
import ly.img.editor.core.component.rememberVoiceover
|
|
29
31
|
import ly.img.editor.core.component.rememberVolume
|
|
30
32
|
|
|
@@ -39,9 +41,11 @@ fun VideoConfigurationBuilder.rememberInspectorBar() = InspectorBar.remember {
|
|
|
39
41
|
add { InspectorBar.Button.rememberVoiceover() } // Voiceover Audio
|
|
40
42
|
add { InspectorBar.Button.rememberReplace() } // Video, Image, Sticker, Audio
|
|
41
43
|
add { InspectorBar.Button.rememberEditText() } // Text
|
|
44
|
+
add { InspectorBar.Button.rememberTextPresets() } // Text
|
|
42
45
|
add { InspectorBar.Button.rememberFormatText() } // Text
|
|
43
46
|
add { InspectorBar.Button.rememberFillStroke() } // Page, Video, Image, Shape, Text
|
|
44
47
|
add { InspectorBar.Button.rememberTextBackground() } // Text
|
|
48
|
+
add { InspectorBar.Button.rememberTextOnPath() } // Text
|
|
45
49
|
add { InspectorBar.Button.rememberVolume() } // Video, Audio
|
|
46
50
|
add { InspectorBar.Button.rememberClipSpeed() } // Video
|
|
47
51
|
add { InspectorBar.Button.rememberCrop() } // Video, Image
|
|
@@ -110,6 +110,7 @@ class EditorBuilder {
|
|
|
110
110
|
) {
|
|
111
111
|
Editor(
|
|
112
112
|
license = settings.license,
|
|
113
|
+
host = "react-native",
|
|
113
114
|
baseUri = settings.baseUri.toUri(),
|
|
114
115
|
userId = settings.userId,
|
|
115
116
|
configuration = {
|
|
@@ -156,6 +157,7 @@ class EditorBuilder {
|
|
|
156
157
|
) {
|
|
157
158
|
Editor(
|
|
158
159
|
license = settings.license,
|
|
160
|
+
host = "react-native",
|
|
159
161
|
baseUri = settings.baseUri.toUri(),
|
|
160
162
|
userId = settings.userId,
|
|
161
163
|
configuration = {
|
|
@@ -201,6 +203,7 @@ class EditorBuilder {
|
|
|
201
203
|
) {
|
|
202
204
|
Editor(
|
|
203
205
|
license = settings.license,
|
|
206
|
+
host = "react-native",
|
|
204
207
|
baseUri = settings.baseUri.toUri(),
|
|
205
208
|
userId = settings.userId,
|
|
206
209
|
configuration = {
|
|
@@ -246,6 +249,7 @@ class EditorBuilder {
|
|
|
246
249
|
) {
|
|
247
250
|
Editor(
|
|
248
251
|
license = settings.license,
|
|
252
|
+
host = "react-native",
|
|
249
253
|
baseUri = settings.baseUri.toUri(),
|
|
250
254
|
userId = settings.userId,
|
|
251
255
|
configuration = {
|
|
@@ -291,6 +295,7 @@ class EditorBuilder {
|
|
|
291
295
|
) {
|
|
292
296
|
Editor(
|
|
293
297
|
license = settings.license,
|
|
298
|
+
host = "react-native",
|
|
294
299
|
baseUri = settings.baseUri.toUri(),
|
|
295
300
|
userId = settings.userId,
|
|
296
301
|
configuration = {
|
|
@@ -191,10 +191,13 @@ extension EditorBuilder {
|
|
|
191
191
|
/// - Parameter settings: The `EditorSettings`.
|
|
192
192
|
/// - Returns: The derived `EngineSettings`.
|
|
193
193
|
private static func engineSettings(for settings: EditorSettings) -> EngineSettings {
|
|
194
|
+
// Identify this engine as React-Native-hosted so v4 licenses scoped to
|
|
195
|
+
// `host: react-native` validate. Hardcoded (not customer-configurable).
|
|
196
|
+
let host = "react-native"
|
|
194
197
|
if let url = URL(string: settings.baseUri) {
|
|
195
|
-
EngineSettings(license: settings.license, userID: settings.userId, baseURL: url)
|
|
198
|
+
return EngineSettings(license: settings.license, userID: settings.userId, baseURL: url, host: host)
|
|
196
199
|
} else {
|
|
197
|
-
EngineSettings(license: settings.license, userID: settings.userId)
|
|
200
|
+
return EngineSettings(license: settings.license, userID: settings.userId, host: host)
|
|
198
201
|
}
|
|
199
202
|
}
|
|
200
203
|
}
|
|
@@ -82,37 +82,30 @@ public extension ApparelEditorConfiguration {
|
|
|
82
82
|
/// Registers all default and demo asset sources, plus text and photo roll sources.
|
|
83
83
|
static let defaultLoadAssetSources: OnCreate.Callback = { engine in
|
|
84
84
|
// highlight-starter-kit-on-load-asset-sources
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
Engine.DefaultAssetSource.blur.rawValue: Engine.assetBaseURL,
|
|
93
|
-
Engine.DefaultAssetSource.typeface.rawValue: Engine.assetBaseURL,
|
|
94
|
-
Engine.DefaultAssetSource.cropPresets.rawValue: Engine.assetBaseURL,
|
|
95
|
-
Engine.DefaultAssetSource.pagePresets.rawValue: Engine.assetBaseURL,
|
|
96
|
-
|
|
97
|
-
Engine.DemoAssetSource.image.rawValue: Engine.assetBaseURL,
|
|
98
|
-
Engine.DemoAssetSource.textComponents.rawValue: Engine.assetBaseURL,
|
|
85
|
+
let basePath = try engine.editor.getSettingString("basePath")
|
|
86
|
+
guard let baseURL = URL(string: basePath) else { return }
|
|
87
|
+
let sourceIDs = [
|
|
88
|
+
"ly.img.sticker", "ly.img.vector.shape", "ly.img.filter", "ly.img.color.palette",
|
|
89
|
+
"ly.img.effect", "ly.img.blur", "ly.img.typeface", "ly.img.crop.presets",
|
|
90
|
+
"ly.img.page.presets", "ly.img.text", "ly.img.text.styles", "ly.img.text.curves", "ly.img.text.components",
|
|
91
|
+
"ly.img.image",
|
|
99
92
|
]
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
for assetSource in assetSources {
|
|
93
|
+
try await withThrowingTaskGroup(of: String.self) { group in
|
|
94
|
+
for id in sourceIDs {
|
|
103
95
|
group.addTask {
|
|
104
|
-
try await engine.
|
|
96
|
+
try await engine.asset.addLocalAssetSourceFromJSON(
|
|
97
|
+
baseURL.appendingPathComponent(id).appendingPathComponent("content.json"),
|
|
98
|
+
)
|
|
105
99
|
}
|
|
106
100
|
}
|
|
107
|
-
try await group
|
|
101
|
+
for try await _ in group {}
|
|
108
102
|
}
|
|
109
103
|
|
|
110
104
|
try engine.asset.addLocalSource(
|
|
111
|
-
sourceID:
|
|
112
|
-
supportedMimeTypes:
|
|
105
|
+
sourceID: "ly.img.image.upload",
|
|
106
|
+
supportedMimeTypes: ["image/jpeg", "image/png", "image/svg+xml", "image/gif", "image/apng", "image/bmp"],
|
|
113
107
|
)
|
|
114
108
|
|
|
115
|
-
try await engine.asset.addSource(TextAssetSource(engine: engine))
|
|
116
109
|
try engine.asset.addSource(PhotoRollAssetSource(engine: engine))
|
|
117
110
|
// highlight-starter-kit-on-load-asset-sources
|
|
118
111
|
}
|
|
@@ -11,9 +11,11 @@ extension ApparelEditorConfiguration {
|
|
|
11
11
|
InspectorBar.Buttons.replace()
|
|
12
12
|
|
|
13
13
|
InspectorBar.Buttons.editText()
|
|
14
|
+
InspectorBar.Buttons.textPresets()
|
|
14
15
|
InspectorBar.Buttons.formatText()
|
|
15
16
|
InspectorBar.Buttons.fillStroke()
|
|
16
17
|
InspectorBar.Buttons.textBackground()
|
|
18
|
+
InspectorBar.Buttons.textOnPath()
|
|
17
19
|
InspectorBar.Buttons.crop()
|
|
18
20
|
|
|
19
21
|
InspectorBar.Buttons.adjustments()
|
|
@@ -81,37 +81,30 @@ public extension DesignEditorConfiguration {
|
|
|
81
81
|
/// Registers all default and demo asset sources, plus text and photo roll sources.
|
|
82
82
|
static let defaultLoadAssetSources: OnCreate.Callback = { engine in
|
|
83
83
|
// highlight-starter-kit-on-load-asset-sources
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Engine.DefaultAssetSource.blur.rawValue: Engine.assetBaseURL,
|
|
92
|
-
Engine.DefaultAssetSource.typeface.rawValue: Engine.assetBaseURL,
|
|
93
|
-
Engine.DefaultAssetSource.cropPresets.rawValue: Engine.assetBaseURL,
|
|
94
|
-
Engine.DefaultAssetSource.pagePresets.rawValue: Engine.assetBaseURL,
|
|
95
|
-
|
|
96
|
-
Engine.DemoAssetSource.image.rawValue: Engine.assetBaseURL,
|
|
97
|
-
Engine.DemoAssetSource.textComponents.rawValue: Engine.assetBaseURL,
|
|
84
|
+
let basePath = try engine.editor.getSettingString("basePath")
|
|
85
|
+
guard let baseURL = URL(string: basePath) else { return }
|
|
86
|
+
let sourceIDs = [
|
|
87
|
+
"ly.img.sticker", "ly.img.vector.shape", "ly.img.filter", "ly.img.color.palette",
|
|
88
|
+
"ly.img.effect", "ly.img.blur", "ly.img.typeface", "ly.img.crop.presets",
|
|
89
|
+
"ly.img.page.presets", "ly.img.text", "ly.img.text.styles", "ly.img.text.curves", "ly.img.text.components",
|
|
90
|
+
"ly.img.image",
|
|
98
91
|
]
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
for assetSource in assetSources {
|
|
92
|
+
try await withThrowingTaskGroup(of: String.self) { group in
|
|
93
|
+
for id in sourceIDs {
|
|
102
94
|
group.addTask {
|
|
103
|
-
try await engine.
|
|
95
|
+
try await engine.asset.addLocalAssetSourceFromJSON(
|
|
96
|
+
baseURL.appendingPathComponent(id).appendingPathComponent("content.json"),
|
|
97
|
+
)
|
|
104
98
|
}
|
|
105
99
|
}
|
|
106
|
-
try await group
|
|
100
|
+
for try await _ in group {}
|
|
107
101
|
}
|
|
108
102
|
|
|
109
103
|
try engine.asset.addLocalSource(
|
|
110
|
-
sourceID:
|
|
111
|
-
supportedMimeTypes:
|
|
104
|
+
sourceID: "ly.img.image.upload",
|
|
105
|
+
supportedMimeTypes: ["image/jpeg", "image/png", "image/svg+xml", "image/gif", "image/apng", "image/bmp"],
|
|
112
106
|
)
|
|
113
107
|
|
|
114
|
-
try await engine.asset.addSource(TextAssetSource(engine: engine))
|
|
115
108
|
try engine.asset.addSource(PhotoRollAssetSource(engine: engine))
|
|
116
109
|
// highlight-starter-kit-on-load-asset-sources
|
|
117
110
|
}
|
|
@@ -10,7 +10,7 @@ extension DesignEditorConfiguration {
|
|
|
10
10
|
builder.items { _ in
|
|
11
11
|
Dock.Buttons.elementsLibrary()
|
|
12
12
|
Dock.Buttons.photoRoll()
|
|
13
|
-
Dock.Buttons.
|
|
13
|
+
Dock.Buttons.imglyCamera()
|
|
14
14
|
Dock.Buttons.imagesLibrary()
|
|
15
15
|
Dock.Buttons.textLibrary()
|
|
16
16
|
Dock.Buttons.shapesLibrary()
|
|
@@ -11,9 +11,11 @@ extension DesignEditorConfiguration {
|
|
|
11
11
|
InspectorBar.Buttons.replace()
|
|
12
12
|
|
|
13
13
|
InspectorBar.Buttons.editText()
|
|
14
|
+
InspectorBar.Buttons.textPresets()
|
|
14
15
|
InspectorBar.Buttons.formatText()
|
|
15
16
|
InspectorBar.Buttons.fillStroke()
|
|
16
17
|
InspectorBar.Buttons.textBackground()
|
|
18
|
+
InspectorBar.Buttons.textOnPath()
|
|
17
19
|
InspectorBar.Buttons.crop()
|
|
18
20
|
|
|
19
21
|
InspectorBar.Buttons.adjustments()
|
|
@@ -78,31 +78,24 @@ public extension PhotoEditorConfiguration {
|
|
|
78
78
|
/// Registers all default and demo asset sources, plus text and photo roll sources.
|
|
79
79
|
static let defaultLoadAssetSources: OnCreate.Callback = { engine in
|
|
80
80
|
// highlight-starter-kit-on-load-asset-sources
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Engine.DefaultAssetSource.effect.rawValue: Engine.assetBaseURL,
|
|
88
|
-
Engine.DefaultAssetSource.blur.rawValue: Engine.assetBaseURL,
|
|
89
|
-
Engine.DefaultAssetSource.typeface.rawValue: Engine.assetBaseURL,
|
|
90
|
-
Engine.DefaultAssetSource.cropPresets.rawValue: Engine.assetBaseURL,
|
|
91
|
-
Engine.DefaultAssetSource.pagePresets.rawValue: Engine.assetBaseURL,
|
|
92
|
-
|
|
93
|
-
Engine.DemoAssetSource.textComponents.rawValue: Engine.assetBaseURL,
|
|
81
|
+
let basePath = try engine.editor.getSettingString("basePath")
|
|
82
|
+
guard let baseURL = URL(string: basePath) else { return }
|
|
83
|
+
let defaultSourceIDs = [
|
|
84
|
+
"ly.img.sticker", "ly.img.vector.shape", "ly.img.filter", "ly.img.color.palette",
|
|
85
|
+
"ly.img.effect", "ly.img.blur", "ly.img.typeface", "ly.img.crop.presets",
|
|
86
|
+
"ly.img.page.presets", "ly.img.text", "ly.img.text.styles", "ly.img.text.curves", "ly.img.text.components",
|
|
94
87
|
]
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
for assetSource in assetSources {
|
|
88
|
+
try await withThrowingTaskGroup(of: String.self) { group in
|
|
89
|
+
for id in defaultSourceIDs {
|
|
98
90
|
group.addTask {
|
|
99
|
-
try await engine.
|
|
91
|
+
try await engine.asset.addLocalAssetSourceFromJSON(
|
|
92
|
+
baseURL.appendingPathComponent(id).appendingPathComponent("content.json"),
|
|
93
|
+
)
|
|
100
94
|
}
|
|
101
95
|
}
|
|
102
|
-
try await group
|
|
96
|
+
for try await _ in group {}
|
|
103
97
|
}
|
|
104
98
|
|
|
105
|
-
try await engine.asset.addSource(TextAssetSource(engine: engine))
|
|
106
99
|
try engine.asset.addSource(PhotoRollAssetSource(engine: engine))
|
|
107
100
|
// highlight-starter-kit-on-load-asset-sources
|
|
108
101
|
}
|
|
@@ -12,9 +12,11 @@ extension PhotoEditorConfiguration {
|
|
|
12
12
|
InspectorBar.Buttons.replace()
|
|
13
13
|
|
|
14
14
|
InspectorBar.Buttons.editText()
|
|
15
|
+
InspectorBar.Buttons.textPresets()
|
|
15
16
|
InspectorBar.Buttons.formatText()
|
|
16
17
|
InspectorBar.Buttons.fillStroke()
|
|
17
18
|
InspectorBar.Buttons.textBackground()
|
|
19
|
+
InspectorBar.Buttons.textOnPath()
|
|
18
20
|
InspectorBar.Buttons.crop()
|
|
19
21
|
|
|
20
22
|
InspectorBar.Buttons.adjustments()
|
|
@@ -81,37 +81,30 @@ public extension PostcardEditorConfiguration {
|
|
|
81
81
|
/// Registers all default and demo asset sources, plus text and photo roll sources.
|
|
82
82
|
static let defaultLoadAssetSources: OnCreate.Callback = { engine in
|
|
83
83
|
// highlight-starter-kit-on-load-asset-sources
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Engine.DefaultAssetSource.blur.rawValue: Engine.assetBaseURL,
|
|
92
|
-
Engine.DefaultAssetSource.typeface.rawValue: Engine.assetBaseURL,
|
|
93
|
-
Engine.DefaultAssetSource.cropPresets.rawValue: Engine.assetBaseURL,
|
|
94
|
-
Engine.DefaultAssetSource.pagePresets.rawValue: Engine.assetBaseURL,
|
|
95
|
-
|
|
96
|
-
Engine.DemoAssetSource.image.rawValue: Engine.assetBaseURL,
|
|
97
|
-
Engine.DemoAssetSource.textComponents.rawValue: Engine.assetBaseURL,
|
|
84
|
+
let basePath = try engine.editor.getSettingString("basePath")
|
|
85
|
+
guard let baseURL = URL(string: basePath) else { return }
|
|
86
|
+
let sourceIDs = [
|
|
87
|
+
"ly.img.sticker", "ly.img.vector.shape", "ly.img.filter", "ly.img.color.palette",
|
|
88
|
+
"ly.img.effect", "ly.img.blur", "ly.img.typeface", "ly.img.crop.presets",
|
|
89
|
+
"ly.img.page.presets", "ly.img.text", "ly.img.text.styles", "ly.img.text.curves", "ly.img.text.components",
|
|
90
|
+
"ly.img.image",
|
|
98
91
|
]
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
for assetSource in assetSources {
|
|
92
|
+
try await withThrowingTaskGroup(of: String.self) { group in
|
|
93
|
+
for id in sourceIDs {
|
|
102
94
|
group.addTask {
|
|
103
|
-
try await engine.
|
|
95
|
+
try await engine.asset.addLocalAssetSourceFromJSON(
|
|
96
|
+
baseURL.appendingPathComponent(id).appendingPathComponent("content.json"),
|
|
97
|
+
)
|
|
104
98
|
}
|
|
105
99
|
}
|
|
106
|
-
try await group
|
|
100
|
+
for try await _ in group {}
|
|
107
101
|
}
|
|
108
102
|
|
|
109
103
|
try engine.asset.addLocalSource(
|
|
110
|
-
sourceID:
|
|
111
|
-
supportedMimeTypes:
|
|
104
|
+
sourceID: "ly.img.image.upload",
|
|
105
|
+
supportedMimeTypes: ["image/jpeg", "image/png", "image/svg+xml", "image/gif", "image/apng", "image/bmp"],
|
|
112
106
|
)
|
|
113
107
|
|
|
114
|
-
try await engine.asset.addSource(TextAssetSource(engine: engine))
|
|
115
108
|
try engine.asset.addSource(PhotoRollAssetSource(engine: engine))
|
|
116
109
|
// highlight-starter-kit-on-load-asset-sources
|
|
117
110
|
}
|
|
@@ -11,9 +11,11 @@ extension PostcardEditorConfiguration {
|
|
|
11
11
|
InspectorBar.Buttons.replace()
|
|
12
12
|
|
|
13
13
|
InspectorBar.Buttons.editText()
|
|
14
|
+
InspectorBar.Buttons.textPresets()
|
|
14
15
|
InspectorBar.Buttons.formatText()
|
|
15
16
|
InspectorBar.Buttons.fillStroke()
|
|
16
17
|
InspectorBar.Buttons.textBackground()
|
|
18
|
+
InspectorBar.Buttons.textOnPath()
|
|
17
19
|
InspectorBar.Buttons.crop()
|
|
18
20
|
|
|
19
21
|
InspectorBar.Buttons.adjustments()
|
|
@@ -87,47 +87,34 @@ public extension VideoEditorConfiguration {
|
|
|
87
87
|
/// Registers all default and demo asset sources, plus text and photo roll sources.
|
|
88
88
|
static let defaultLoadAssetSources: OnCreate.Callback = { engine in
|
|
89
89
|
// highlight-starter-kit-on-load-asset-sources
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Engine.DefaultAssetSource.blur.rawValue: Engine.assetBaseURL,
|
|
98
|
-
Engine.DefaultAssetSource.typeface.rawValue: Engine.assetBaseURL,
|
|
99
|
-
Engine.DefaultAssetSource.cropPresets.rawValue: Engine.assetBaseURL,
|
|
100
|
-
Engine.DefaultAssetSource.pagePresets.rawValue: Engine.assetBaseURL,
|
|
101
|
-
|
|
102
|
-
Engine.DemoAssetSource.image.rawValue: Engine.assetBaseURL,
|
|
103
|
-
Engine.DemoAssetSource.video.rawValue: Engine.assetBaseURL,
|
|
104
|
-
Engine.DemoAssetSource.audio.rawValue: Engine.assetBaseURL,
|
|
105
|
-
Engine.DemoAssetSource.textComponents.rawValue: Engine.assetBaseURL,
|
|
90
|
+
let basePath = try engine.editor.getSettingString("basePath")
|
|
91
|
+
guard let baseURL = URL(string: basePath) else { return }
|
|
92
|
+
let sourceIDs = [
|
|
93
|
+
"ly.img.sticker", "ly.img.vector.shape", "ly.img.filter", "ly.img.color.palette",
|
|
94
|
+
"ly.img.effect", "ly.img.blur", "ly.img.typeface", "ly.img.crop.presets",
|
|
95
|
+
"ly.img.page.presets", "ly.img.text", "ly.img.text.styles", "ly.img.text.curves", "ly.img.text.components",
|
|
96
|
+
"ly.img.image", "ly.img.video", "ly.img.audio",
|
|
106
97
|
]
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
for assetSource in assetSources {
|
|
98
|
+
try await withThrowingTaskGroup(of: String.self) { group in
|
|
99
|
+
for id in sourceIDs {
|
|
110
100
|
group.addTask {
|
|
111
|
-
try await engine.
|
|
101
|
+
try await engine.asset.addLocalAssetSourceFromJSON(
|
|
102
|
+
baseURL.appendingPathComponent(id).appendingPathComponent("content.json"),
|
|
103
|
+
)
|
|
112
104
|
}
|
|
113
105
|
}
|
|
114
|
-
try await group
|
|
106
|
+
for try await _ in group {}
|
|
115
107
|
}
|
|
116
108
|
|
|
117
|
-
let
|
|
118
|
-
.
|
|
119
|
-
.
|
|
120
|
-
.
|
|
109
|
+
let uploadSources: [(id: String, mimeTypes: [String])] = [
|
|
110
|
+
("ly.img.image.upload", ["image/jpeg", "image/png", "image/svg+xml", "image/gif", "image/apng", "image/bmp"]),
|
|
111
|
+
("ly.img.audio.upload", ["audio/mpeg", "audio/mp4", "audio/wav", "audio/x-wav", "audio/ogg", "audio/aac"]),
|
|
112
|
+
("ly.img.video.upload", ["video/mp4", "video/quicktime"]),
|
|
121
113
|
]
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
try engine.asset.addLocalSource(
|
|
125
|
-
sourceID: localAssetSource.rawValue,
|
|
126
|
-
supportedMimeTypes: localAssetSource.mimeTypes,
|
|
127
|
-
)
|
|
114
|
+
for source in uploadSources {
|
|
115
|
+
try engine.asset.addLocalSource(sourceID: source.id, supportedMimeTypes: source.mimeTypes)
|
|
128
116
|
}
|
|
129
117
|
|
|
130
|
-
try await engine.asset.addSource(TextAssetSource(engine: engine))
|
|
131
118
|
try engine.asset.addSource(PhotoRollAssetSource(engine: engine))
|
|
132
119
|
// highlight-starter-kit-on-load-asset-sources
|
|
133
120
|
}
|
|
@@ -11,9 +11,11 @@ extension VideoEditorConfiguration {
|
|
|
11
11
|
InspectorBar.Buttons.replace()
|
|
12
12
|
|
|
13
13
|
InspectorBar.Buttons.editText()
|
|
14
|
+
InspectorBar.Buttons.textPresets()
|
|
14
15
|
InspectorBar.Buttons.formatText()
|
|
15
16
|
InspectorBar.Buttons.fillStroke()
|
|
16
17
|
InspectorBar.Buttons.textBackground()
|
|
18
|
+
InspectorBar.Buttons.textOnPath()
|
|
17
19
|
InspectorBar.Buttons.addVoiceoverRecording()
|
|
18
20
|
InspectorBar.Buttons.volume()
|
|
19
21
|
InspectorBar.Buttons.clipSpeed()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/editor-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.77.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.77.0/assets';
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Unique ID tied to your application's user.
|