css
5 years ago
attributes.js
4 years ago
block.js
4 years ago
deprecated.js
5 years ago
edit.js
4 years ago
editor.scss
5 years ago
element-icons.js
4 years ago
markformat.js
4 years ago
save.js
5 years ago
transforms.js
5 years ago
transforms.js
52 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | import { |
| 5 | createBlock, |
| 6 | } from '@wordpress/blocks'; |
| 7 | |
| 8 | const transforms = { |
| 9 | from: [ |
| 10 | { |
| 11 | type: 'block', |
| 12 | blocks: [ 'core/paragraph' ], |
| 13 | transform: ( { content } ) => { |
| 14 | return createBlock( 'generateblocks/headline', { |
| 15 | content, |
| 16 | } ); |
| 17 | }, |
| 18 | }, |
| 19 | { |
| 20 | type: 'block', |
| 21 | blocks: [ 'core/heading' ], |
| 22 | transform: ( { content } ) => { |
| 23 | return createBlock( 'generateblocks/headline', { |
| 24 | content, |
| 25 | } ); |
| 26 | }, |
| 27 | }, |
| 28 | ], |
| 29 | to: [ |
| 30 | { |
| 31 | type: 'block', |
| 32 | blocks: [ 'core/paragraph' ], |
| 33 | transform: ( { content } ) => { |
| 34 | return createBlock( 'core/paragraph', { |
| 35 | content, |
| 36 | } ); |
| 37 | }, |
| 38 | }, |
| 39 | { |
| 40 | type: 'block', |
| 41 | blocks: [ 'core/heading' ], |
| 42 | transform: ( { content } ) => { |
| 43 | return createBlock( 'core/heading', { |
| 44 | content, |
| 45 | } ); |
| 46 | }, |
| 47 | }, |
| 48 | ], |
| 49 | }; |
| 50 | |
| 51 | export default transforms; |
| 52 |