| 1 |
/** |
| 2 |
* WordPress dependencies |
| 3 |
*/ |
| 4 |
import {BlockConfiguration, getBlockType, registerBlockType} from '@wordpress/blocks'; |
| 5 |
|
| 6 |
/** |
| 7 |
* Internal dependencies |
| 8 |
*/ |
| 9 |
import campaignGrid from './CampaignGrid'; |
| 10 |
import campaignBlock from './Campaign'; |
| 11 |
import campaignForm from './CampaignForm/resources'; |
| 12 |
|
| 13 |
export const getAllBlocks = () => { |
| 14 |
return [ |
| 15 |
campaignGrid, |
| 16 |
campaignBlock, |
| 17 |
campaignForm |
| 18 |
]; |
| 19 |
}; |
| 20 |
|
| 21 |
getAllBlocks().forEach((block) => { |
| 22 |
if (!getBlockType(block.schema.name)) { |
| 23 |
registerBlockType(block.schema as BlockConfiguration, block.settings); |
| 24 |
} |
| 25 |
}); |
| 26 |
|
| 27 |
|