| 1 |
( function( blocks, editor, element ) { |
| 2 |
|
| 3 |
var el = element.createElement; |
| 4 |
|
| 5 |
const { __ } = wp.i18n; |
| 6 |
const iconEl = el('svg', { preserveAspectRatio: 'xMinYMin meet', viewBox: '0 0 28 28' }, |
| 7 |
el('path', { fill: '#333', d: "M12.7.8c-2.6.3-5 1.3-7 2.9S2.2 7.5 1.5 10c-.8 2.4-.8 5.1-.2 7.5.7 2.5 2.1 4.7 4 6.4.1.1.2.1.3.2h.3c.1 0 .2 0 .3-.1.1-.1.2-.1.2-.2.1-.1.1-.2.1-.3v-.3c0-.1 0-.2-.1-.3-.1-.1-.1-.2-.2-.2-1.5-1.3-2.6-2.9-3.2-4.8s-.7-3.9-.4-5.8c.3-1.9 1.1-3.7 2.3-5.3s2.8-2.7 4.6-3.5c1.8-.8 3.8-1.1 5.7-.9 1.9.2 3.8.9 5.4 2 1.6 1.1 2.9 2.6 3.8 4.4.9 1.8 1.3 3.7 1.2 5.6-.1 2.3-.9 4.5-2.3 6.3-1.3 1.8-3.2 3.3-5.3 4.1-2.1.8-4.3 1-6.5.5l8-15.1c.1-.2.2-.5.2-.8 0-.1 0-.2-.1-.3 0-.1-.1-.2-.2-.3-.1-.1-.2-.1-.3-.2-.1 0-.2-.1-.4 0h-10c-.2 0-.5.1-.7.2 0 .2 0 .3-.1.4 0 .1-.1.2 0 .3 0 .1 0 .2.1.3 0 .2 0 .3.1.4.2.2.4.2.7.2h8.5L9.6 24.7c-.7 1.1-.3 1.7 1.1 2.1 1.9.5 3.8.5 5.7.2 1.9-.4 3.7-1.1 5.3-2.3 1.6-1.1 2.9-2.6 3.8-4.3s1.5-3.6 1.6-5.5c.1-1.9-.1-3.9-.8-5.7-.7-1.8-1.8-3.4-3.1-4.8s-3-2.4-4.9-3C16.5.9 14.6.6 12.7.8z" } ) |
| 8 |
); |
| 9 |
|
| 10 |
blocks.registerBlockType( 'c7wp/default', { |
| 11 |
title: __( 'Default Content' ), // The title of block in editor. |
| 12 |
description: __( 'Placeholder for dynamic content. Required on product, club, collection, reservation, cart, and checkout pages.' ), |
| 13 |
icon: iconEl, |
| 14 |
category: 'commerce7', // The category of block in editor. |
| 15 |
keywords: [ 'commerce7', 'default' ], |
| 16 |
example: {}, |
| 17 |
attributes: {}, |
| 18 |
edit: function( props ) { |
| 19 |
|
| 20 |
return ( |
| 21 |
el( 'div', { |
| 22 |
className: 'components-placeholder ' + props.className |
| 23 |
}, |
| 24 |
el( 'div', { |
| 25 |
id: 'c7-content' |
| 26 |
}, |
| 27 |
el( |
| 28 |
'strong', |
| 29 |
null, |
| 30 |
'Default Content' |
| 31 |
), |
| 32 |
) |
| 33 |
) |
| 34 |
); |
| 35 |
}, |
| 36 |
save: function( props ) { |
| 37 |
return ( |
| 38 |
el( 'div', { |
| 39 |
className: props.className |
| 40 |
}, |
| 41 |
el( 'div', { |
| 42 |
id: 'c7-content' |
| 43 |
} |
| 44 |
) |
| 45 |
) |
| 46 |
); |
| 47 |
}, |
| 48 |
} ); |
| 49 |
} )( window.wp.blocks, window.wp.editor, window.wp.element ); |