
/**
 * Register block styles.
 */

wp.domReady( function() {

    /**
    * A Button block variation for Ghost.
    */
    wp.blocks.registerBlockVariation( 'core/button', {     
        name: 'button-ghost',
        title: 'Button Ghost',
        description: 'A Ghost button',
        isDefault: true,
        attributes: { 
            className: 'is-style-button-ghost',
            style: {
                border: {
                    width: "1px"
                },
                spacing: {
                    padding: {
                        top: "var:preset|spacing|20",
                        right: "var:preset|spacing|20",
                        bottom:"var:preset|spacing|20", 
                        left: "var:preset|spacing|20"
                    }
                }
            },
                
        },
    } );

    /**
     * Customize the default Media & Text block.
     */
    wp.blocks.registerBlockVariation(
        'core/media-text', 
        {
            name: 'custom-media-text',
            title: 'Media & Text',
            isDefault: true,
            attributes: { 
                mediaPosition: 'right', 
            },
            innerBlocks: [
                [
                    'core/heading',
                    {
                        level: 3,
                        placeholder: 'Heading'
                    } 
                ],
                [
                    'core/paragraph',
                    {
                        placeholder: 'Content...'
                    } 
                ]
            ]
        },
    );
});
