2020-05-27 14:45:18 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2020-06-05 12:18:16 +00:00
|
|
|
import { getValidBlockAttributes } from '@woocommerce/base-utils';
|
2020-07-22 12:20:54 +00:00
|
|
|
import {
|
2021-06-11 08:54:18 +00:00
|
|
|
getBlockMap,
|
2020-07-22 12:20:54 +00:00
|
|
|
renderParentBlock,
|
|
|
|
renderStandaloneBlocks,
|
|
|
|
} from '@woocommerce/atomic-utils';
|
2020-05-27 14:45:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import Block from './block';
|
|
|
|
import blockAttributes from './attributes';
|
2020-06-05 12:18:16 +00:00
|
|
|
import { BLOCK_NAME } from './constants';
|
2020-05-27 14:45:18 +00:00
|
|
|
|
|
|
|
const getProps = ( el ) => {
|
|
|
|
return {
|
2020-06-05 12:18:16 +00:00
|
|
|
attributes: getValidBlockAttributes( blockAttributes, el.dataset ),
|
2020-05-27 14:45:18 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-06-05 12:18:16 +00:00
|
|
|
renderParentBlock( {
|
2020-07-30 10:57:22 +00:00
|
|
|
Block,
|
2020-06-05 12:18:16 +00:00
|
|
|
blockName: BLOCK_NAME,
|
|
|
|
selector: '.wp-block-woocommerce-single-product',
|
2020-05-27 14:45:18 +00:00
|
|
|
getProps,
|
2021-06-11 08:54:18 +00:00
|
|
|
blockMap: getBlockMap( BLOCK_NAME ),
|
2020-05-27 14:45:18 +00:00
|
|
|
} );
|
2020-07-22 12:20:54 +00:00
|
|
|
|
|
|
|
renderStandaloneBlocks();
|