2021-08-25 15:42:55 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
import { Icon, cart } from '@woocommerce/icons';
|
2021-09-16 18:50:33 +00:00
|
|
|
import { registerExperimentalBlockType } from '@woocommerce/block-settings';
|
2021-08-25 15:42:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import edit from './edit';
|
|
|
|
|
|
|
|
const settings = {
|
|
|
|
apiVersion: 2,
|
|
|
|
title: __( 'Mini Cart', 'woo-gutenberg-products-block' ),
|
|
|
|
icon: {
|
|
|
|
src: <Icon srcElement={ cart } />,
|
|
|
|
foreground: '#96588a',
|
|
|
|
},
|
|
|
|
category: 'woocommerce',
|
|
|
|
keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
|
|
|
|
description: __(
|
|
|
|
'Display a mini cart widget.',
|
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
),
|
|
|
|
supports: {
|
|
|
|
html: false,
|
|
|
|
multiple: false,
|
|
|
|
},
|
|
|
|
example: {
|
|
|
|
attributes: {
|
|
|
|
isPreview: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
attributes: {
|
|
|
|
isPreview: {
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
save: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
edit,
|
|
|
|
|
|
|
|
save() {
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2021-09-16 18:50:33 +00:00
|
|
|
registerExperimentalBlockType( 'woocommerce/mini-cart', settings );
|