Skip to content

Support for block variation JS generation #7

@bacoords

Description

@bacoords

This tool generates the JS object for creating blocks with inner blocks where it expects arrays/separate parameters (where you have name, attributes, innerBlocks separately).

But for Block Variations, it's basically an object with 'name' and 'innerBlocks' as keys in the object. If PRs are being reviewed still, let me know.

InnerBlocks

[
	'core/group',
	{
		"layout":{
			"type":"constrained"
		}
	},
	[
		[
			'core/paragraph',
			{},
			[]
		],
		
	]
],

would be more like

Block Variation

{
	name: 'core/group',
	attributes: {
		"layout":{
			"type":"constrained"
		}
	},
	innerBlocks: [
		{
			name: 'core/paragraph',
			attributes: {},
			innerBlocks: []
		},
		
	]
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions