2020-05-29 11:28:04 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { getRegisteredInnerBlocks } from '@woocommerce/blocks-registry';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2020-06-05 12:18:16 +00:00
|
|
|
import ProductButton from '../blocks/product/button/block';
|
|
|
|
import ProductImage from '../blocks/product/image/frontend';
|
|
|
|
import ProductPrice from '../blocks/product/price/block';
|
|
|
|
import ProductRating from '../blocks/product/rating/block';
|
|
|
|
import ProductSaleBadge from '../blocks/product/sale-badge/block';
|
|
|
|
import ProductSummary from '../blocks/product/summary/block';
|
|
|
|
import ProductTitle from '../blocks/product/title/frontend';
|
2020-06-05 14:36:07 +00:00
|
|
|
import ProductSku from '../blocks/product/sku/block';
|
2020-06-10 15:56:13 +00:00
|
|
|
import ProductCategoryList from '../blocks/product/category-list/block';
|
|
|
|
import ProductTagList from '../blocks/product/tag-list/block';
|
2020-06-11 09:02:00 +00:00
|
|
|
import ProductStockIndicator from '../blocks/product/stock-indicator/block';
|
2020-05-29 11:28:04 +00:00
|
|
|
|
|
|
|
/**
|
2020-06-05 12:18:16 +00:00
|
|
|
* Map blocks to components suitable for use on the frontend.
|
2020-05-29 11:28:04 +00:00
|
|
|
*
|
|
|
|
* @param {string} blockName Name of the parent block. Used to get extension children.
|
|
|
|
*/
|
|
|
|
export const getBlockMap = ( blockName ) => ( {
|
|
|
|
'woocommerce/product-price': ProductPrice,
|
|
|
|
'woocommerce/product-image': ProductImage,
|
|
|
|
'woocommerce/product-title': ProductTitle,
|
|
|
|
'woocommerce/product-rating': ProductRating,
|
|
|
|
'woocommerce/product-button': ProductButton,
|
|
|
|
'woocommerce/product-summary': ProductSummary,
|
|
|
|
'woocommerce/product-sale-badge': ProductSaleBadge,
|
2020-06-05 14:36:07 +00:00
|
|
|
'woocommerce/product-sku': ProductSku,
|
2020-06-10 15:56:13 +00:00
|
|
|
'woocommerce/product-category-list': ProductCategoryList,
|
|
|
|
'woocommerce/product-tag-list': ProductTagList,
|
2020-06-11 09:02:00 +00:00
|
|
|
'woocommerce/product-stock-indicator': ProductStockIndicator,
|
2020-05-29 11:28:04 +00:00
|
|
|
...getRegisteredInnerBlocks( blockName ),
|
|
|
|
} );
|