2020-05-29 11:28:04 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2020-06-17 13:10:46 +00:00
|
|
|
import { getRegisteredBlockComponents } from '@woocommerce/blocks-registry';
|
2022-02-07 09:34:30 +00:00
|
|
|
import type { RegisteredBlockComponent } from '@woocommerce/types';
|
2020-05-29 11:28:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2020-06-17 13:10:46 +00:00
|
|
|
import '../blocks/component-init';
|
2020-05-29 11:28:04 +00:00
|
|
|
|
|
|
|
/**
|
2020-06-17 13:10:46 +00:00
|
|
|
* Map named Blocks to defined React Components to render on the frontend.
|
2020-05-29 11:28:04 +00:00
|
|
|
*
|
2020-06-17 13:10:46 +00:00
|
|
|
* @param {string} blockName Name of the parent block.
|
2020-05-29 11:28:04 +00:00
|
|
|
*/
|
2022-02-07 09:34:30 +00:00
|
|
|
export const getBlockMap = (
|
|
|
|
blockName: string
|
|
|
|
): Record< string, RegisteredBlockComponent > =>
|
2020-06-17 13:10:46 +00:00
|
|
|
getRegisteredBlockComponents( blockName );
|