UNPKG

@wordpress/block-library

Version:
33 lines (30 loc) 602 B
/** * Internal dependencies */ import metadata from './block.json'; const { attributes, supports } = metadata; export default [ { attributes: { ...attributes, singleCommentLabel: { type: 'string', }, multipleCommentsLabel: { type: 'string', }, }, supports, migrate: ( oldAttributes ) => { const { singleCommentLabel, multipleCommentsLabel, ...newAttributes } = oldAttributes; return newAttributes; }, isEligible: ( { multipleCommentsLabel, singleCommentLabel } ) => multipleCommentsLabel || singleCommentLabel, save: () => null, }, ];