@@ -55,8 +55,10 @@ public string ToArtifact(object value, PropertyType propertyType, ICollection<Ar
55
55
if ( blockEditorValue == null )
56
56
return null ;
57
57
58
+ var allBlocks = blockEditorValue . Content . Concat ( blockEditorValue . Settings ) ;
59
+
58
60
// get all the content types used in block editor items
59
- var allContentTypes = blockEditorValue . Content . Select ( x => x . ContentTypeKey )
61
+ var allContentTypes = allBlocks . Select ( x => x . ContentTypeKey )
60
62
. Distinct ( )
61
63
. ToDictionary ( a => a , a =>
62
64
{
@@ -77,7 +79,7 @@ public string ToArtifact(object value, PropertyType propertyType, ICollection<Ar
77
79
dependencies . Add ( new ArtifactDependency ( contentType . GetUdi ( ) , false , ArtifactDependencyMode . Match ) ) ;
78
80
}
79
81
80
- foreach ( var block in blockEditorValue . Content )
82
+ foreach ( var block in allBlocks )
81
83
{
82
84
var contentType = allContentTypes [ block . ContentTypeKey ] ;
83
85
@@ -126,7 +128,9 @@ public object FromArtifact(string value, PropertyType propertyType, object curre
126
128
if ( blockEditorValue == null )
127
129
return value ;
128
130
129
- var allContentTypes = blockEditorValue . Content . Select ( x => x . ContentTypeKey )
131
+ var allBlocks = blockEditorValue . Content . Concat ( blockEditorValue . Settings ) ;
132
+
133
+ var allContentTypes = allBlocks . Select ( x => x . ContentTypeKey )
130
134
. Distinct ( )
131
135
. ToDictionary ( a => a , a =>
132
136
{
@@ -141,7 +145,7 @@ public object FromArtifact(string value, PropertyType propertyType, object curre
141
145
throw new InvalidOperationException ( $ "Could not resolve these content types for the Block Editor property: { string . Join ( "," , allContentTypes . Where ( x => x . Value == null ) . Select ( x => x . Key ) ) } ") ;
142
146
}
143
147
144
- foreach ( var block in blockEditorValue . Content )
148
+ foreach ( var block in allBlocks )
145
149
{
146
150
var contentType = allContentTypes [ block . ContentTypeKey ] ;
147
151
@@ -206,6 +210,20 @@ public object FromArtifact(string value, PropertyType propertyType, object curre
206
210
/// "text": "hero text",
207
211
/// "contentpicker": "umb://document/87478d1efa66413698063f8d00fda1d1"
208
212
/// }
213
+ /// ],
214
+ /// "settingsData": [
215
+ /// {
216
+ /// "contentTypeKey": "2e6094ea-7bca-4b7c-a223-375254a194f4",
217
+ /// "udi": "umb://element/499cf69f00c84227a59ca10fb4ae4c9a",
218
+ /// "textColor": "",
219
+ /// "containerWidth": "standard",
220
+ /// "textWidth": [],
221
+ /// "height": [],
222
+ /// "overlayStrength": [],
223
+ /// "textAlignment": "left",
224
+ /// "verticalTextAlignment": "top",
225
+ /// "animate": "0"
226
+ /// }
209
227
/// ]
210
228
/// }
211
229
/// ]]>
@@ -224,6 +242,12 @@ public class BlockEditorValue
224
242
/// </summary>
225
243
[ JsonProperty ( "contentData" ) ]
226
244
public IEnumerable < Block > Content { get ; set ; }
245
+
246
+ /// <summary>
247
+ /// This contains the settings associated with the block editor.
248
+ /// </summary>
249
+ [ JsonProperty ( "settingsData" ) ]
250
+ public IEnumerable < Block > Settings { get ; set ; }
227
251
}
228
252
229
253
public class Block
0 commit comments