@imgly/editor-react-native 1.73.0 → 1.74.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/assets/scene/apparel.scene +1 -0
- package/android/src/main/assets/scene/design.scene +1 -0
- package/android/src/main/assets/scene/postcard.scene +1 -0
- package/android/src/main/assets/scene/video.scene +1 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/ApparelConfigurationBuilder.kt +113 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/EditorActivity.kt +37 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/callback/OnCreate.kt +190 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/callback/OnExport.kt +82 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/callback/OnLoaded.kt +88 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/component/CanvasMenu.kt +45 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/component/Dock.kt +37 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/component/InspectorBar.kt +52 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/component/NavigationBar.kt +45 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/apparel/component/Overlay.kt +15 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/DesignConfigurationBuilder.kt +106 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/EditorActivity.kt +37 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/callback/OnCreate.kt +162 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/callback/OnExport.kt +82 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/callback/OnLoaded.kt +10 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/component/CanvasMenu.kt +45 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/component/Dock.kt +35 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/component/InspectorBar.kt +52 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/component/NavigationBar.kt +45 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/design/component/Overlay.kt +15 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/EditorActivity.kt +37 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/PhotoConfigurationBuilder.kt +106 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/callback/OnCreate.kt +143 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/callback/OnExport.kt +82 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/callback/OnLoaded.kt +49 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/component/CanvasMenu.kt +45 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/component/Dock.kt +43 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/component/InspectorBar.kt +52 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/component/NavigationBar.kt +45 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/photo/component/Overlay.kt +15 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/EditorActivity.kt +37 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/PostcardConfigurationBuilder.kt +106 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/callback/OnCreate.kt +149 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/callback/OnExport.kt +82 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/callback/OnLoaded.kt +58 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/component/CanvasMenu.kt +45 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/component/Dock.kt +243 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/component/InspectorBar.kt +52 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/component/NavigationBar.kt +76 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/component/Overlay.kt +15 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/postcard/ext/Engine.kt +107 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/EditorActivity.kt +37 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/VideoConfigurationBuilder.kt +135 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/callback/OnCreate.kt +191 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/callback/OnExport.kt +98 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/callback/OnLoaded.kt +20 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/component/BottomPanel.kt +13 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/component/CanvasMenu.kt +45 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/component/Dock.kt +71 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/component/InspectorBar.kt +68 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/component/NavigationBar.kt +57 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/component/Overlay.kt +421 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/iconPack/CheckCircleOutline.kt +79 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/iconPack/ErrorOutline.kt +92 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/iconPack/IconPack.kt +14 -0
- package/android/src/main/kotlin/ly/img/editor/configuration/video/model/ExportStatus.kt +39 -0
- package/ios/IMGLYEditorModule.swift +9 -1
- package/ios/StarterKits/Apparel/ApparelEditorConfiguration.swift +46 -0
- package/ios/StarterKits/Apparel/ApparelEditorStarterKit.swift +30 -0
- package/ios/StarterKits/Apparel/callbacks/OnChanged+Apparel.swift +116 -0
- package/ios/StarterKits/Apparel/callbacks/OnCreate+Apparel.swift +197 -0
- package/ios/StarterKits/Apparel/callbacks/OnExport+Apparel.swift +29 -0
- package/ios/StarterKits/Apparel/components/CanvasMenu+Apparel.swift +22 -0
- package/ios/StarterKits/Apparel/components/Dock+Apparel.swift +19 -0
- package/ios/StarterKits/Apparel/components/InspectorBar+Apparel.swift +35 -0
- package/ios/StarterKits/Apparel/components/NavigationBar+Apparel.swift +26 -0
- package/ios/StarterKits/Design/DesignEditorConfiguration.swift +43 -0
- package/ios/StarterKits/Design/DesignEditorStarterKit.swift +30 -0
- package/ios/StarterKits/Design/callbacks/OnCreate+Design.swift +131 -0
- package/ios/StarterKits/Design/callbacks/OnExport+Design.swift +30 -0
- package/ios/StarterKits/Design/components/CanvasMenu+Design.swift +22 -0
- package/ios/StarterKits/Design/components/Dock+Design.swift +23 -0
- package/ios/StarterKits/Design/components/InspectorBar+Design.swift +35 -0
- package/ios/StarterKits/Design/components/NavigationBar+Design.swift +24 -0
- package/ios/StarterKits/Photo/PhotoEditorConfiguration.swift +48 -0
- package/ios/StarterKits/Photo/PhotoEditorStarterKit.swift +30 -0
- package/ios/StarterKits/Photo/callbacks/OnChanged+Photo.swift +25 -0
- package/ios/StarterKits/Photo/callbacks/OnCreate+Photo.swift +138 -0
- package/ios/StarterKits/Photo/callbacks/OnExport+Photo.swift +29 -0
- package/ios/StarterKits/Photo/callbacks/OnLoaded+Photo.swift +18 -0
- package/ios/StarterKits/Photo/components/CanvasMenu+Photo.swift +22 -0
- package/ios/StarterKits/Photo/components/Dock+Photo.swift +23 -0
- package/ios/StarterKits/Photo/components/InspectorBar+Photo.swift +39 -0
- package/ios/StarterKits/Photo/components/NavigationBar+Photo.swift +24 -0
- package/ios/StarterKits/Photo/examples/ExampleForceCrop.swift +30 -0
- package/ios/StarterKits/Postcard/PostcardEditorConfiguration.swift +45 -0
- package/ios/StarterKits/Postcard/PostcardEditorStarterKit.swift +30 -0
- package/ios/StarterKits/Postcard/callbacks/OnChanged+Postcard.swift +92 -0
- package/ios/StarterKits/Postcard/callbacks/OnCreate+Postcard.swift +127 -0
- package/ios/StarterKits/Postcard/callbacks/OnExport+Postcard.swift +29 -0
- package/ios/StarterKits/Postcard/components/CanvasMenu+Postcard.swift +22 -0
- package/ios/StarterKits/Postcard/components/Dock+Postcard.swift +34 -0
- package/ios/StarterKits/Postcard/components/DockButtons+Postcard.swift +129 -0
- package/ios/StarterKits/Postcard/components/InspectorBar+Postcard.swift +35 -0
- package/ios/StarterKits/Postcard/components/NavigationBar+Postcard.swift +38 -0
- package/ios/StarterKits/Video/VideoEditorConfiguration.swift +54 -0
- package/ios/StarterKits/Video/VideoEditorStarterKit.swift +30 -0
- package/ios/StarterKits/Video/callbacks/OnCreate+Video.swift +137 -0
- package/ios/StarterKits/Video/callbacks/OnExport+Video.swift +46 -0
- package/ios/StarterKits/Video/components/BottomPanel+Video.swift +16 -0
- package/ios/StarterKits/Video/components/CanvasMenu+Video.swift +22 -0
- package/ios/StarterKits/Video/components/Dock+Video.swift +30 -0
- package/ios/StarterKits/Video/components/InspectorBar+Video.swift +43 -0
- package/ios/StarterKits/Video/components/NavigationBar+Video.swift +32 -0
- package/ios/StarterKits/Video/examples/ExampleVideoDurationConstraints.swift +23 -0
- package/ios/StarterKits/apparel-ui-b-empty.scene +1 -0
- package/ios/StarterKits/design-ui-empty.scene +1 -0
- package/ios/StarterKits/photo-ui-empty.png +0 -0
- package/ios/StarterKits/postcard-empty.scene +1 -0
- package/ios/StarterKits/video-empty.scene +1 -0
- package/package.json +1 -1
- package/src/NativeIMGLYEditor.ts +1 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
@file:OptIn(UnstableEditorApi::class)
|
|
2
|
+
|
|
3
|
+
package ly.img.editor.configuration.apparel.callback
|
|
4
|
+
|
|
5
|
+
import androidx.core.net.toUri
|
|
6
|
+
import kotlinx.coroutines.coroutineScope
|
|
7
|
+
import kotlinx.coroutines.launch
|
|
8
|
+
import ly.img.editor.configuration.apparel.ApparelConfigurationBuilder
|
|
9
|
+
import ly.img.editor.core.UnstableEditorApi
|
|
10
|
+
import ly.img.editor.core.library.data.AssetSourceType
|
|
11
|
+
import ly.img.editor.core.library.data.SystemGalleryAssetSource
|
|
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
|
+
import ly.img.engine.BlendMode
|
|
16
|
+
import ly.img.engine.Color
|
|
17
|
+
import ly.img.engine.DefaultAssetSource
|
|
18
|
+
import ly.img.engine.DemoAssetSource
|
|
19
|
+
import ly.img.engine.DesignBlockType
|
|
20
|
+
import ly.img.engine.ShapeType
|
|
21
|
+
import ly.img.engine.StrokeStyle
|
|
22
|
+
import ly.img.engine.populateAssetSource
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The callback that is invoked when the editor is created.
|
|
26
|
+
*/
|
|
27
|
+
suspend fun ApparelConfigurationBuilder.onCreate(
|
|
28
|
+
preCreateScene: suspend ApparelConfigurationBuilder.() -> Unit = {
|
|
29
|
+
onPreCreateScene()
|
|
30
|
+
},
|
|
31
|
+
createScene: suspend ApparelConfigurationBuilder.() -> Unit = {
|
|
32
|
+
onCreateScene()
|
|
33
|
+
},
|
|
34
|
+
loadAssetSources: suspend ApparelConfigurationBuilder.() -> Unit = {
|
|
35
|
+
onLoadAssetSources()
|
|
36
|
+
},
|
|
37
|
+
postCreateScene: suspend ApparelConfigurationBuilder.() -> Unit = {
|
|
38
|
+
onPostCreateScene()
|
|
39
|
+
},
|
|
40
|
+
finally: suspend ApparelConfigurationBuilder.() -> Unit = {
|
|
41
|
+
onCreateFinally()
|
|
42
|
+
},
|
|
43
|
+
) {
|
|
44
|
+
try {
|
|
45
|
+
preCreateScene()
|
|
46
|
+
createScene()
|
|
47
|
+
loadAssetSources()
|
|
48
|
+
postCreateScene()
|
|
49
|
+
} finally {
|
|
50
|
+
finally()
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The callback that is invoked before the scene is created.
|
|
56
|
+
*/
|
|
57
|
+
fun ApparelConfigurationBuilder.onPreCreateScene() {
|
|
58
|
+
showLoading = true
|
|
59
|
+
editorContext.engine.editor.setSettingBoolean(
|
|
60
|
+
keypath = "ubq://page/dimOutOfPageAreas",
|
|
61
|
+
value = false,
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The callback that is responsible for creating the scene.
|
|
67
|
+
*/
|
|
68
|
+
// highlight-starter-kit-on-create-scene
|
|
69
|
+
suspend fun ApparelConfigurationBuilder.onCreateScene() {
|
|
70
|
+
getOrLoadScene(sceneUri = "file:///android_asset/scene/apparel.scene".toUri())
|
|
71
|
+
}
|
|
72
|
+
// highlight-starter-kit-on-create-scene
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The callback that loads all the required assets sources.
|
|
76
|
+
*/
|
|
77
|
+
// highlight-starter-kit-on-load-asset-sources
|
|
78
|
+
suspend fun ApparelConfigurationBuilder.onLoadAssetSources() {
|
|
79
|
+
// Load asset sources in parallel from content.json files
|
|
80
|
+
coroutineScope {
|
|
81
|
+
listOf(
|
|
82
|
+
DefaultAssetSource.STICKER.key,
|
|
83
|
+
DefaultAssetSource.VECTOR_PATH.key,
|
|
84
|
+
DefaultAssetSource.FILTER_LUT.key,
|
|
85
|
+
DefaultAssetSource.FILTER_DUO_TONE.key,
|
|
86
|
+
DefaultAssetSource.CROP_PRESETS.key,
|
|
87
|
+
DefaultAssetSource.EFFECT.key,
|
|
88
|
+
DefaultAssetSource.BLUR.key,
|
|
89
|
+
DefaultAssetSource.TYPEFACE.key,
|
|
90
|
+
DemoAssetSource.IMAGE.key,
|
|
91
|
+
DemoAssetSource.TEXT_COMPONENTS.key,
|
|
92
|
+
).forEach { assetSource ->
|
|
93
|
+
launch {
|
|
94
|
+
val baseUri = editorContext.baseUri
|
|
95
|
+
editorContext.engine.populateAssetSource(
|
|
96
|
+
id = assetSource,
|
|
97
|
+
jsonUri = "$baseUri/$assetSource/content.json".toUri(),
|
|
98
|
+
replaceBaseUri = baseUri,
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Load local asset sources
|
|
105
|
+
editorContext.engine.asset.addLocalSource(
|
|
106
|
+
sourceId = DemoAssetSource.IMAGE_UPLOAD.key,
|
|
107
|
+
supportedMimeTypes = listOf(
|
|
108
|
+
"image/jpeg",
|
|
109
|
+
"image/png",
|
|
110
|
+
"image/heic",
|
|
111
|
+
"image/heif",
|
|
112
|
+
"image/svg+xml",
|
|
113
|
+
"image/gif",
|
|
114
|
+
"image/bmp",
|
|
115
|
+
),
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
// Register gallery asset sources
|
|
119
|
+
listOf(
|
|
120
|
+
AssetSourceType.GalleryAllVisuals,
|
|
121
|
+
AssetSourceType.GalleryImage,
|
|
122
|
+
AssetSourceType.GalleryVideo,
|
|
123
|
+
).forEach { type ->
|
|
124
|
+
editorContext.engine.asset.addSource(
|
|
125
|
+
source = SystemGalleryAssetSource(
|
|
126
|
+
context = editorContext.engine.applicationContext,
|
|
127
|
+
type = type,
|
|
128
|
+
),
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
SystemGalleryPermission.setMode(systemGalleryConfiguration)
|
|
132
|
+
|
|
133
|
+
// Register text asset source
|
|
134
|
+
TypefaceProvider().provideTypeface(
|
|
135
|
+
engine = editorContext.engine,
|
|
136
|
+
name = "Roboto",
|
|
137
|
+
)?.let {
|
|
138
|
+
val textAssetSource = TextAssetSource(engine = editorContext.engine, typeface = it)
|
|
139
|
+
editorContext.engine.asset.addSource(textAssetSource)
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// highlight-starter-kit-on-load-asset-sources
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The callback that is invoked right after [onCreateScene], after the scene is created.
|
|
146
|
+
*/
|
|
147
|
+
fun ApparelConfigurationBuilder.onPostCreateScene() {
|
|
148
|
+
val engine = editorContext.engine
|
|
149
|
+
val page = requireNotNull(engine.scene.getCurrentPage())
|
|
150
|
+
engine.block.setClipped(block = page, clipped = true)
|
|
151
|
+
engine.block.setBoolean(block = page, property = "fill/enabled", value = false)
|
|
152
|
+
|
|
153
|
+
// Add dotted outline design block.
|
|
154
|
+
engine.block.findByName(ApparelConfigurationBuilder.Companion.OUTLINE_BLOCK_NAME).firstOrNull() ?: run {
|
|
155
|
+
val outline = engine.block.create(blockType = DesignBlockType.Graphic)
|
|
156
|
+
engine.block.setName(block = outline, name = ApparelConfigurationBuilder.Companion.OUTLINE_BLOCK_NAME)
|
|
157
|
+
engine.block.setShape(
|
|
158
|
+
block = outline,
|
|
159
|
+
shape = engine.block.createShape(ShapeType.Rect),
|
|
160
|
+
)
|
|
161
|
+
engine.block.appendChild(parent = page, child = outline)
|
|
162
|
+
engine.block.setFillEnabled(block = outline, enabled = false)
|
|
163
|
+
engine.block.setStrokeEnabled(block = outline, enabled = true)
|
|
164
|
+
engine.block.setStrokeColor(
|
|
165
|
+
block = outline,
|
|
166
|
+
color = Color.fromRGBA(r = 1F, g = 1F, b = 1F),
|
|
167
|
+
)
|
|
168
|
+
engine.block.setStrokeStyle(block = outline, style = StrokeStyle.DOTTED)
|
|
169
|
+
engine.block.setStrokeWidth(block = outline, width = 1.0F)
|
|
170
|
+
engine.block.setBlendMode(block = outline, blendMode = BlendMode.DIFFERENCE)
|
|
171
|
+
engine.block.setScopeEnabled(
|
|
172
|
+
block = outline,
|
|
173
|
+
key = "editor/select",
|
|
174
|
+
enabled = false,
|
|
175
|
+
)
|
|
176
|
+
engine.block.setScopeEnabled(
|
|
177
|
+
block = outline,
|
|
178
|
+
key = "lifecycle/destroy",
|
|
179
|
+
enabled = false,
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The callback that is invoked as the last step of [onCreate].
|
|
186
|
+
* It always runs, no matter success or failure on previous steps.
|
|
187
|
+
*/
|
|
188
|
+
fun ApparelConfigurationBuilder.onCreateFinally() {
|
|
189
|
+
showLoading = false
|
|
190
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
package ly.img.editor.configuration.apparel.callback
|
|
2
|
+
|
|
3
|
+
import kotlinx.coroutines.CancellationException
|
|
4
|
+
import ly.img.editor.configuration.apparel.ApparelConfigurationBuilder
|
|
5
|
+
import ly.img.engine.MimeType
|
|
6
|
+
import java.nio.ByteBuffer
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The callback that is invoked when the export button is clicked.
|
|
10
|
+
*/
|
|
11
|
+
suspend fun ApparelConfigurationBuilder.onExport(
|
|
12
|
+
preExport: suspend ApparelConfigurationBuilder.() -> Unit = {
|
|
13
|
+
onPreExport()
|
|
14
|
+
},
|
|
15
|
+
exportByteBuffer: suspend ApparelConfigurationBuilder.() -> ByteBuffer = {
|
|
16
|
+
onExportByteBuffer()
|
|
17
|
+
},
|
|
18
|
+
postExport: suspend ApparelConfigurationBuilder.(ByteBuffer) -> Unit = {
|
|
19
|
+
onPostExport(it)
|
|
20
|
+
},
|
|
21
|
+
error: suspend ApparelConfigurationBuilder.(Exception) -> Unit = {
|
|
22
|
+
onExportError(it)
|
|
23
|
+
},
|
|
24
|
+
finally: suspend ApparelConfigurationBuilder.() -> Unit = {
|
|
25
|
+
onExportFinally()
|
|
26
|
+
},
|
|
27
|
+
) {
|
|
28
|
+
try {
|
|
29
|
+
preExport()
|
|
30
|
+
val result = exportByteBuffer()
|
|
31
|
+
postExport(result)
|
|
32
|
+
} catch (exception: Exception) {
|
|
33
|
+
error(exception)
|
|
34
|
+
} finally {
|
|
35
|
+
finally()
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The callback that is invoked before the export is started.
|
|
41
|
+
*/
|
|
42
|
+
fun ApparelConfigurationBuilder.onPreExport() {
|
|
43
|
+
showLoading = true
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The callback that exports the content of the editor into [ByteBuffer].
|
|
48
|
+
*/
|
|
49
|
+
// highlight-starter-kit-on-export-byte-buffer
|
|
50
|
+
suspend fun ApparelConfigurationBuilder.onExportByteBuffer(): ByteBuffer = export(
|
|
51
|
+
block = requireNotNull(editorContext.engine.scene.get()),
|
|
52
|
+
mimeType = MimeType.PDF,
|
|
53
|
+
)
|
|
54
|
+
// highlight-starter-kit-on-export-byte-buffer
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The callback that is invoked after [onExportByteBuffer] and handles its output.
|
|
58
|
+
*/
|
|
59
|
+
// highlight-starter-kit-on-post-export
|
|
60
|
+
suspend fun ApparelConfigurationBuilder.onPostExport(byteBuffer: ByteBuffer) {
|
|
61
|
+
val file = writeToFile(byteBuffer = byteBuffer, mimeType = MimeType.PDF)
|
|
62
|
+
shareFile(file = file, mimeType = MimeType.PDF)
|
|
63
|
+
}
|
|
64
|
+
// highlight-starter-kit-on-post-export
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The callback that is invoked in case any of the export functions throw an exception.
|
|
68
|
+
*/
|
|
69
|
+
fun ApparelConfigurationBuilder.onExportError(error: Exception) {
|
|
70
|
+
if (error is CancellationException) {
|
|
71
|
+
throw error
|
|
72
|
+
}
|
|
73
|
+
this.error = error
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The callback that is invoked as the last step of [onExportByteBuffer].
|
|
78
|
+
* It always runs, no matter success or failure on previous steps.
|
|
79
|
+
*/
|
|
80
|
+
fun ApparelConfigurationBuilder.onExportFinally() {
|
|
81
|
+
showLoading = false
|
|
82
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
package ly.img.editor.configuration.apparel.callback
|
|
2
|
+
|
|
3
|
+
import kotlinx.coroutines.coroutineScope
|
|
4
|
+
import kotlinx.coroutines.flow.distinctUntilChanged
|
|
5
|
+
import kotlinx.coroutines.flow.distinctUntilChangedBy
|
|
6
|
+
import kotlinx.coroutines.flow.filter
|
|
7
|
+
import kotlinx.coroutines.flow.map
|
|
8
|
+
import kotlinx.coroutines.launch
|
|
9
|
+
import ly.img.editor.configuration.apparel.ApparelConfigurationBuilder
|
|
10
|
+
import ly.img.editor.core.state.EditorViewMode
|
|
11
|
+
import ly.img.engine.SizeMode
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The callback that is invoked when the editor is loaded and ready to be used.
|
|
15
|
+
*/
|
|
16
|
+
suspend fun ApparelConfigurationBuilder.onLoaded() {
|
|
17
|
+
coroutineScope {
|
|
18
|
+
launch { observeEditorViewMode() }
|
|
19
|
+
launch { observeEditorEditMode() }
|
|
20
|
+
launch { observePageSizeChanges() }
|
|
21
|
+
launch { observeIsTouchActive() }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Function that zooms to the backdrop image (t-shirt) when the [EditorViewMode] is preview.
|
|
27
|
+
*/
|
|
28
|
+
suspend fun ApparelConfigurationBuilder.observeEditorViewMode() {
|
|
29
|
+
editorContext.state
|
|
30
|
+
.distinctUntilChangedBy { it.viewMode to it.insets }
|
|
31
|
+
.filter { it.viewMode is EditorViewMode.Preview }
|
|
32
|
+
.collect { state ->
|
|
33
|
+
val engine = editorContext.engine
|
|
34
|
+
val scene = requireNotNull(engine.scene.get())
|
|
35
|
+
val backdropImage =
|
|
36
|
+
engine.block.getChildren(scene).first { engine.block.getKind(it) == "image" }
|
|
37
|
+
engine.scene.immediateZoomToBlock(
|
|
38
|
+
block = backdropImage,
|
|
39
|
+
paddingLeft = state.insets.left.value,
|
|
40
|
+
paddingTop = state.insets.top.value,
|
|
41
|
+
paddingRight = state.insets.right.value,
|
|
42
|
+
paddingBottom = 0F,
|
|
43
|
+
forceUpdate = true,
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Function that observes the size changes of the page and updates the dimensions of the dotted outline block
|
|
50
|
+
* accordingly.
|
|
51
|
+
*/
|
|
52
|
+
suspend fun ApparelConfigurationBuilder.observePageSizeChanges() {
|
|
53
|
+
val engine = editorContext.engine
|
|
54
|
+
val page = requireNotNull(engine.scene.getCurrentPage())
|
|
55
|
+
val outline = engine.block.findByName(ApparelConfigurationBuilder.OUTLINE_BLOCK_NAME).first()
|
|
56
|
+
engine.event.subscribe(listOf(page))
|
|
57
|
+
.map { engine.block.getWidth(block = page) to engine.block.getHeight(block = page) }
|
|
58
|
+
.distinctUntilChanged()
|
|
59
|
+
.collect { (width, height) ->
|
|
60
|
+
engine.block.setHeightMode(block = outline, mode = SizeMode.ABSOLUTE)
|
|
61
|
+
engine.block.setHeight(block = outline, value = height)
|
|
62
|
+
engine.block.setWidthMode(block = outline, mode = SizeMode.ABSOLUTE)
|
|
63
|
+
engine.block.setWidth(block = outline, value = width)
|
|
64
|
+
engine.block.setPositionX(
|
|
65
|
+
block = outline,
|
|
66
|
+
value = engine.block.getPositionX(block = page),
|
|
67
|
+
)
|
|
68
|
+
engine.block.setPositionY(
|
|
69
|
+
block = outline,
|
|
70
|
+
value = engine.block.getPositionY(block = page),
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Function that observes the [ly.img.editor.core.state.EditorState.isTouchActive] value and updates
|
|
77
|
+
* the visibility of the dotted outline block accordingly.
|
|
78
|
+
*/
|
|
79
|
+
suspend fun ApparelConfigurationBuilder.observeIsTouchActive() {
|
|
80
|
+
val engine = editorContext.engine
|
|
81
|
+
val outline = engine.block.findByName(ApparelConfigurationBuilder.OUTLINE_BLOCK_NAME).first()
|
|
82
|
+
editorContext.state
|
|
83
|
+
.distinctUntilChangedBy { it.isTouchActive }
|
|
84
|
+
.collect {
|
|
85
|
+
engine.block.setVisible(block = outline, visible = it.isTouchActive)
|
|
86
|
+
engine.block.setOpacity(block = outline, value = if (it.isTouchActive) 1F else 0F)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@file:Suppress("UnusedReceiverParameter")
|
|
2
|
+
|
|
3
|
+
package ly.img.editor.configuration.apparel.component
|
|
4
|
+
|
|
5
|
+
import androidx.compose.runtime.Composable
|
|
6
|
+
import ly.img.editor.configuration.apparel.ApparelConfigurationBuilder
|
|
7
|
+
import ly.img.editor.core.component.CanvasMenu
|
|
8
|
+
import ly.img.editor.core.component.EditorComponentId
|
|
9
|
+
import ly.img.editor.core.component.remember
|
|
10
|
+
import ly.img.editor.core.component.rememberBringForward
|
|
11
|
+
import ly.img.editor.core.component.rememberDelete
|
|
12
|
+
import ly.img.editor.core.component.rememberDuplicate
|
|
13
|
+
import ly.img.editor.core.component.rememberSelectGroup
|
|
14
|
+
import ly.img.editor.core.component.rememberSendBackward
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The configuration of the component that is displayed as horizontal list of items next to
|
|
18
|
+
* the selected design block.
|
|
19
|
+
*/
|
|
20
|
+
@Composable
|
|
21
|
+
fun ApparelConfigurationBuilder.rememberCanvasMenu() = CanvasMenu.remember {
|
|
22
|
+
listBuilder = {
|
|
23
|
+
CanvasMenu.ListBuilder.remember {
|
|
24
|
+
add { CanvasMenu.Button.rememberSelectGroup() }
|
|
25
|
+
if (editorContext.isSelectionInGroup) {
|
|
26
|
+
add {
|
|
27
|
+
CanvasMenu.Divider.remember {
|
|
28
|
+
id = { EditorComponentId("ly.img.component.canvasMenu.divider1") }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
add { CanvasMenu.Button.rememberBringForward() }
|
|
33
|
+
add { CanvasMenu.Button.rememberSendBackward() }
|
|
34
|
+
if (editorContext.canSelectionMove) {
|
|
35
|
+
add {
|
|
36
|
+
CanvasMenu.Divider.remember {
|
|
37
|
+
id = { EditorComponentId("ly.img.component.canvasMenu.divider2") }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
add { CanvasMenu.Button.rememberDuplicate() }
|
|
42
|
+
add { CanvasMenu.Button.rememberDelete() }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@file:Suppress("UnusedReceiverParameter")
|
|
2
|
+
|
|
3
|
+
package ly.img.editor.configuration.apparel.component
|
|
4
|
+
|
|
5
|
+
import androidx.compose.runtime.Composable
|
|
6
|
+
import androidx.compose.runtime.collectAsState
|
|
7
|
+
import androidx.compose.runtime.getValue
|
|
8
|
+
import androidx.compose.ui.graphics.Color
|
|
9
|
+
import ly.img.editor.configuration.apparel.ApparelConfigurationBuilder
|
|
10
|
+
import ly.img.editor.core.component.DefaultDecoration
|
|
11
|
+
import ly.img.editor.core.component.Dock
|
|
12
|
+
import ly.img.editor.core.component.remember
|
|
13
|
+
import ly.img.editor.core.component.rememberAssetLibrary
|
|
14
|
+
import ly.img.editor.core.state.EditorViewMode
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The configuration of the component that is displayed as horizontal list of items at the bottom of the editor.
|
|
18
|
+
*/
|
|
19
|
+
@Composable
|
|
20
|
+
fun ApparelConfigurationBuilder.rememberDock() = Dock.remember {
|
|
21
|
+
visible = {
|
|
22
|
+
val state by editorContext.state.collectAsState()
|
|
23
|
+
// Hide Dock in preview mode
|
|
24
|
+
state.viewMode !is EditorViewMode.Preview
|
|
25
|
+
}
|
|
26
|
+
decoration = {
|
|
27
|
+
// Show transparent background
|
|
28
|
+
Dock.DefaultDecoration(
|
|
29
|
+
background = Color.Transparent,
|
|
30
|
+
) { it() }
|
|
31
|
+
}
|
|
32
|
+
listBuilder = {
|
|
33
|
+
Dock.ListBuilder.remember {
|
|
34
|
+
add { Dock.Button.rememberAssetLibrary() }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@file:Suppress("UnusedReceiverParameter")
|
|
2
|
+
|
|
3
|
+
package ly.img.editor.configuration.apparel.component
|
|
4
|
+
|
|
5
|
+
import androidx.compose.runtime.Composable
|
|
6
|
+
import ly.img.editor.configuration.apparel.ApparelConfigurationBuilder
|
|
7
|
+
import ly.img.editor.core.component.InspectorBar
|
|
8
|
+
import ly.img.editor.core.component.remember
|
|
9
|
+
import ly.img.editor.core.component.rememberAdjustments
|
|
10
|
+
import ly.img.editor.core.component.rememberBlur
|
|
11
|
+
import ly.img.editor.core.component.rememberCrop
|
|
12
|
+
import ly.img.editor.core.component.rememberDelete
|
|
13
|
+
import ly.img.editor.core.component.rememberDuplicate
|
|
14
|
+
import ly.img.editor.core.component.rememberEditText
|
|
15
|
+
import ly.img.editor.core.component.rememberEffect
|
|
16
|
+
import ly.img.editor.core.component.rememberEnterGroup
|
|
17
|
+
import ly.img.editor.core.component.rememberFillStroke
|
|
18
|
+
import ly.img.editor.core.component.rememberFilter
|
|
19
|
+
import ly.img.editor.core.component.rememberFormatText
|
|
20
|
+
import ly.img.editor.core.component.rememberLayer
|
|
21
|
+
import ly.img.editor.core.component.rememberReplace
|
|
22
|
+
import ly.img.editor.core.component.rememberSelectGroup
|
|
23
|
+
import ly.img.editor.core.component.rememberShape
|
|
24
|
+
import ly.img.editor.core.component.rememberTextBackground
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The configuration of the component that is displayed as horizontal list of items at the
|
|
28
|
+
* bottom of the editor when a design block is selected.
|
|
29
|
+
*/
|
|
30
|
+
@Composable
|
|
31
|
+
fun ApparelConfigurationBuilder.rememberInspectorBar() = InspectorBar.remember {
|
|
32
|
+
listBuilder = {
|
|
33
|
+
InspectorBar.ListBuilder.remember {
|
|
34
|
+
add { InspectorBar.Button.rememberReplace() } // Image, Sticker, Audio
|
|
35
|
+
add { InspectorBar.Button.rememberEditText() } // Text
|
|
36
|
+
add { InspectorBar.Button.rememberFormatText() } // Text
|
|
37
|
+
add { InspectorBar.Button.rememberFillStroke() } // Page, Image, Shape, Text
|
|
38
|
+
add { InspectorBar.Button.rememberTextBackground() } // Text
|
|
39
|
+
add { InspectorBar.Button.rememberCrop() } // Image
|
|
40
|
+
add { InspectorBar.Button.rememberAdjustments() } // Image
|
|
41
|
+
add { InspectorBar.Button.rememberFilter() } // Image
|
|
42
|
+
add { InspectorBar.Button.rememberEffect() } // Image
|
|
43
|
+
add { InspectorBar.Button.rememberBlur() } // Image
|
|
44
|
+
add { InspectorBar.Button.rememberShape() } // Image, Shape
|
|
45
|
+
add { InspectorBar.Button.rememberSelectGroup() } // Image, Sticker, Shape, Text
|
|
46
|
+
add { InspectorBar.Button.rememberEnterGroup() } // Group
|
|
47
|
+
add { InspectorBar.Button.rememberLayer() } // Image, Sticker, Shape, Text
|
|
48
|
+
add { InspectorBar.Button.rememberDuplicate() } // Image, Sticker, Shape, Text
|
|
49
|
+
add { InspectorBar.Button.rememberDelete() } // Image, Sticker, Shape, Text
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
package/android/src/main/kotlin/ly/img/editor/configuration/apparel/component/NavigationBar.kt
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@file:Suppress("UnusedReceiverParameter")
|
|
2
|
+
|
|
3
|
+
package ly.img.editor.configuration.apparel.component
|
|
4
|
+
|
|
5
|
+
import androidx.compose.runtime.Composable
|
|
6
|
+
import androidx.compose.runtime.remember
|
|
7
|
+
import androidx.compose.ui.Alignment
|
|
8
|
+
import ly.img.editor.configuration.apparel.ApparelConfigurationBuilder
|
|
9
|
+
import ly.img.editor.core.component.EditorTrigger
|
|
10
|
+
import ly.img.editor.core.component.NavigationBar
|
|
11
|
+
import ly.img.editor.core.component.remember
|
|
12
|
+
import ly.img.editor.core.component.rememberCloseEditor
|
|
13
|
+
import ly.img.editor.core.component.rememberExport
|
|
14
|
+
import ly.img.editor.core.component.rememberRedo
|
|
15
|
+
import ly.img.editor.core.component.rememberTogglePreviewMode
|
|
16
|
+
import ly.img.editor.core.component.rememberUndo
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The configuration of the component that is displayed as horizontal list of items at the top of the editor.
|
|
20
|
+
*/
|
|
21
|
+
@Composable
|
|
22
|
+
fun ApparelConfigurationBuilder.rememberNavigationBar() = NavigationBar.remember {
|
|
23
|
+
scope = {
|
|
24
|
+
val historyTrigger by EditorTrigger.remember {
|
|
25
|
+
editorContext.engine.editor.onHistoryUpdated()
|
|
26
|
+
}
|
|
27
|
+
// Update NavigationBar whenever the editor history changes
|
|
28
|
+
remember(this, historyTrigger) {
|
|
29
|
+
NavigationBar.Scope(parentScope = this)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
listBuilder = {
|
|
33
|
+
NavigationBar.ListBuilder.remember {
|
|
34
|
+
aligned(alignment = Alignment.Start) {
|
|
35
|
+
add { NavigationBar.Button.rememberCloseEditor() }
|
|
36
|
+
}
|
|
37
|
+
aligned(alignment = Alignment.End) {
|
|
38
|
+
add { NavigationBar.Button.rememberUndo() }
|
|
39
|
+
add { NavigationBar.Button.rememberRedo() }
|
|
40
|
+
add { NavigationBar.Button.rememberTogglePreviewMode() }
|
|
41
|
+
add { NavigationBar.Button.rememberExport() }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package ly.img.editor.configuration.apparel.component
|
|
2
|
+
|
|
3
|
+
import androidx.compose.runtime.Composable
|
|
4
|
+
import ly.img.editor.configuration.apparel.ApparelConfigurationBuilder
|
|
5
|
+
import ly.img.editor.core.component.EditorComponent
|
|
6
|
+
import ly.img.editor.core.component.remember
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The configuration of the component that is displayed over the editor. It is useful if you want to display a popup dialog or anything in the
|
|
10
|
+
* overlay.
|
|
11
|
+
*/
|
|
12
|
+
@Composable
|
|
13
|
+
fun ApparelConfigurationBuilder.rememberOverlay() = EditorComponent.remember {
|
|
14
|
+
decoration = { Overlay() }
|
|
15
|
+
}
|
package/android/src/main/kotlin/ly/img/editor/configuration/design/DesignConfigurationBuilder.kt
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
package ly.img.editor.configuration.design
|
|
2
|
+
|
|
3
|
+
import androidx.compose.runtime.Stable
|
|
4
|
+
import ly.img.editor.BasicConfigurationBuilder
|
|
5
|
+
import ly.img.editor.configuration.design.callback.onCreate
|
|
6
|
+
import ly.img.editor.configuration.design.callback.onExport
|
|
7
|
+
import ly.img.editor.configuration.design.callback.onLoaded
|
|
8
|
+
import ly.img.editor.configuration.design.component.rememberCanvasMenu
|
|
9
|
+
import ly.img.editor.configuration.design.component.rememberDock
|
|
10
|
+
import ly.img.editor.configuration.design.component.rememberInspectorBar
|
|
11
|
+
import ly.img.editor.configuration.design.component.rememberNavigationBar
|
|
12
|
+
import ly.img.editor.configuration.design.component.rememberOverlay
|
|
13
|
+
import ly.img.editor.core.EditorScope
|
|
14
|
+
import ly.img.editor.core.ScopedProperty
|
|
15
|
+
import ly.img.editor.core.component.EditorComponent
|
|
16
|
+
import ly.img.editor.core.event.EditorEvent
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Configuration builder class for design editor starter kit.
|
|
20
|
+
*/
|
|
21
|
+
@Stable
|
|
22
|
+
class DesignConfigurationBuilder : BasicConfigurationBuilder() {
|
|
23
|
+
/**
|
|
24
|
+
* The callback that is invoked when the editor is created.
|
|
25
|
+
* Check parent class declaration for more details.
|
|
26
|
+
*/
|
|
27
|
+
override var onCreate: (suspend EditorScope.() -> Unit)? = {
|
|
28
|
+
onCreate()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The callback that is invoked when the editor is loaded and ready to be used.
|
|
33
|
+
* Check parent class declaration for more details.
|
|
34
|
+
*/
|
|
35
|
+
override var onLoaded: (suspend EditorScope.() -> Unit)? = {
|
|
36
|
+
onLoaded()
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The callback that is invoked when the export button is clicked.
|
|
41
|
+
* Check parent class declaration for more details.
|
|
42
|
+
*/
|
|
43
|
+
override var onExport: (suspend EditorScope.() -> Unit)? = {
|
|
44
|
+
onExport()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The callback that is invoked after [EditorEvent.OnClose] event is triggered or when the system back button is clicked
|
|
49
|
+
* and editor cannot handle the event internally.
|
|
50
|
+
* Check parent class declaration for more details.
|
|
51
|
+
*/
|
|
52
|
+
override var onClose: (suspend EditorScope.() -> Unit)? = {
|
|
53
|
+
showConfirmationOrCloseEditor()
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The callback that is invoked after the editor captures an error.
|
|
58
|
+
* Check parent class declaration for more details.
|
|
59
|
+
*/
|
|
60
|
+
override var onError: (suspend EditorScope.(Throwable) -> Unit)? = {
|
|
61
|
+
error = it
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The configuration of the component that is displayed as horizontal list of items at the bottom of the editor.
|
|
66
|
+
* Check parent class declaration for more details.
|
|
67
|
+
*/
|
|
68
|
+
override var dock: ScopedProperty<EditorScope, EditorComponent<*>>? = {
|
|
69
|
+
rememberDock()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The configuration of the component that is displayed as horizontal list of items at the top of the editor.
|
|
74
|
+
* Check parent class declaration for more details.
|
|
75
|
+
*/
|
|
76
|
+
override var navigationBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
|
|
77
|
+
rememberNavigationBar()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The configuration of the component that is displayed as horizontal list of items at the
|
|
82
|
+
* bottom of the editor when a design block is selected.
|
|
83
|
+
* Check parent class declaration for more details.
|
|
84
|
+
*/
|
|
85
|
+
override var inspectorBar: ScopedProperty<EditorScope, EditorComponent<*>>? = {
|
|
86
|
+
rememberInspectorBar()
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The configuration of the component that is displayed as horizontal list of items next to
|
|
91
|
+
* the selected design block.
|
|
92
|
+
* Check parent class declaration for more details.
|
|
93
|
+
*/
|
|
94
|
+
override var canvasMenu: ScopedProperty<EditorScope, EditorComponent<*>>? = {
|
|
95
|
+
rememberCanvasMenu()
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The configuration of the component that is displayed over the editor. It is useful if you want to display a popup dialog or anything in the
|
|
100
|
+
* overlay.
|
|
101
|
+
* Check parent class declaration for more details.
|
|
102
|
+
*/
|
|
103
|
+
override var overlay: ScopedProperty<EditorScope, EditorComponent<*>>? = {
|
|
104
|
+
rememberOverlay()
|
|
105
|
+
}
|
|
106
|
+
}
|