File tree Expand file tree Collapse file tree 1 file changed +23
-13
lines changed
packages/edit-site/src/components/style-book Expand file tree Collapse file tree 1 file changed +23
-13
lines changed Original file line number Diff line number Diff line change @@ -224,19 +224,29 @@ function applyBlockVariationsToExamples( examples, variation ) {
224224if ( ! variation ) {
225225return examples ;
226226}
227-
228- return examples . map ( ( example ) => ( {
229- ...example ,
230- variation,
231- blocks : {
232- ...example . blocks ,
233- attributes : {
234- ...example . blocks . attributes ,
235- style : undefined ,
236- className : getVariationClassName ( variation ) ,
237- } ,
238- } ,
239- } ) ) ;
227+ return examples . map ( ( example ) => {
228+ return {
229+ ...example ,
230+ variation,
231+ blocks : Array . isArray ( example . blocks )
232+ ? example . blocks . map ( ( block ) => ( {
233+ ...block ,
234+ attributes : {
235+ ...block . attributes ,
236+ style : undefined ,
237+ className : getVariationClassName ( variation ) ,
238+ } ,
239+ } ) )
240+ : {
241+ ...example . blocks ,
242+ attributes : {
243+ ...example . blocks . attributes ,
244+ style : undefined ,
245+ className : getVariationClassName ( variation ) ,
246+ } ,
247+ } ,
248+ } ;
249+ } ) ;
240250}
241251
242252function StyleBook ( {
You can’t perform that action at this time.
0 commit comments