blockkit

0.0.4 • Public • Published

blockkit

This is an exploratory repository to explore the options for creating a wrapper of the wordpress registerBlockType function to add defaults

Idea

The Idea behind this exploration is to create a wrapper around the registerBlockType function. Under the namespace blockkit you can add options to the supports object. Tho start with I will explore to add settings for colors that will then automatically add the attributes and Inspector / Toolbar settings.

import { registerBlock } from 'blockkit';
 
registerBlock( 'blockkit/block', {
    ...,
    supports: {
        blockkit: {
            colors: [
                'background'
                'text'
            ]
        }
    },
    ...
} );

Example

An example of how to use this can be found in the example directory.

/blockkit/

    Package Sidebar

    Install

    npm i blockkit

    Weekly Downloads

    2

    Version

    0.0.4

    License

    GPL-3.0-or-later

    Unpacked Size

    4.38 kB

    Total Files

    7

    Last publish

    Collaborators

    • fabiankaegy