File tree Expand file tree Collapse file tree
packages/edit-site/src/components/style-book Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -227,19 +227,29 @@ function applyBlockVariationsToExamples( examples, variation ) {
227227 if ( ! variation ) {
228228 return examples ;
229229 }
230-
231- return examples . map ( ( example ) => ( {
232- ...example ,
233- variation,
234- blocks : {
235- ...example . blocks ,
236- attributes : {
237- ...example . blocks . attributes ,
238- style : undefined ,
239- className : getVariationClassName ( variation ) ,
240- } ,
241- } ,
242- } ) ) ;
230+ return examples . map ( ( example ) => {
231+ return {
232+ ...example ,
233+ variation,
234+ blocks : Array . isArray ( example . blocks )
235+ ? example . blocks . map ( ( block ) => ( {
236+ ...block ,
237+ attributes : {
238+ ...block . attributes ,
239+ style : undefined ,
240+ className : getVariationClassName ( variation ) ,
241+ } ,
242+ } ) )
243+ : {
244+ ...example . blocks ,
245+ attributes : {
246+ ...example . blocks . attributes ,
247+ style : undefined ,
248+ className : getVariationClassName ( variation ) ,
249+ } ,
250+ } ,
251+ } ;
252+ } ) ;
243253}
244254
245255function StyleBook ( {
You can’t perform that action at this time.
0 commit comments