@wordpress/block-library
Version:
Block library for the WordPress editor.
59 lines (56 loc) • 1.11 kB
JavaScript
/**
* WordPress dependencies
*/
import { listItem as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
const metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/list-item",
title: "List item",
category: "text",
parent: ["core/list"],
description: "Create a list item.",
textdomain: "default",
attributes: {
placeholder: {
type: "string"
},
content: {
type: "string",
source: "html",
selector: "li",
"default": "",
__experimentalRole: "content"
}
},
supports: {
className: false,
__experimentalSelector: "li"
}
};
import edit from './edit';
import save from './save';
const {
name
} = metadata;
export { metadata, name };
export const settings = {
icon,
edit,
save,
merge(attributes, attributesToMerge) {
return { ...attributes,
content: attributes.content + attributesToMerge.content
};
}
};
export const init = () => initBlock({
name,
metadata,
settings
});
//# sourceMappingURL=index.js.map