),
},
- category: 'woocommerce',
- keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
- description: __(
- 'Allow customers to filter the grid by products stock status. Works in combination with the All Products block.',
- 'woo-gutenberg-products-block'
- ),
- supports: {
- html: false,
- multiple: false,
- },
- example: {
- attributes: {
- isPreview: true,
- },
- },
attributes: {
+ ...metadata.attributes,
heading: {
type: 'string',
default: __(
@@ -44,25 +36,6 @@ registerBlockType( 'woocommerce/stock-filter', {
'woo-gutenberg-products-block'
),
},
- headingLevel: {
- type: 'number',
- default: 3,
- },
- showCounts: {
- type: 'boolean',
- default: true,
- },
- showFilterButton: {
- type: 'boolean',
- default: false,
- },
- /**
- * Are we previewing?
- */
- isPreview: {
- type: 'boolean',
- default: false,
- },
},
edit,
// Save the props to post content.
@@ -84,7 +57,9 @@ registerBlockType( 'woocommerce/stock-filter', {
}
return (
{
new CopyWebpackPlugin( {
patterns: [
{
- from: './assets/js/blocks/checkout/block.json',
- to: './checkout/block.json',
- },
- {
- from:
- './assets/js/blocks/featured-items/featured-category/block.json',
- to: './featured-category/block.json',
- },
- {
- from:
- './assets/js/blocks/featured-items/featured-product/block.json',
- to: './featured-product/block.json',
- },
- {
- from:
- './assets/js/blocks/handpicked-products/block.json',
- to: './handpicked-products/block.json',
- },
- {
- from: './assets/js/blocks/product-tag/block.json',
- to: './product-tag/block.json',
- },
- {
- from:
- './assets/js/blocks/products-by-attribute/block.json',
- to: './products-by-attribute/block.json',
+ from: './assets/js/blocks/**/block.json',
+ to( { absoluteFilename } ) {
+ const blockName = absoluteFilename
+ .split( '/' )
+ .at( -2 );
+ return `./${ blockName }/block.json`;
+ },
+ globOptions: {
+ ignore: [ '**/inner-blocks/**' ],
+ },
},
],
} ),