Skip to content

Commit

Permalink
Columns: Add transform to unwrap the contents (#45666)
Browse files Browse the repository at this point in the history
Add a transform to move the column contents out into standalone blocks.
  • Loading branch information
dsas authored Nov 9, 2022
1 parent f8c3f1f commit 07c948d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/block-library/src/columns/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ const transforms = {
},
},
],
to: [
{
type: 'block',
blocks: [ '*' ],
transform: ( attributes, innerBlocks ) =>
innerBlocks
.map( ( innerBlock ) => innerBlock.innerBlocks )
.flat(),
},
],
};

export default transforms;

0 comments on commit 07c948d

Please sign in to comment.