@wordpress/block-library
Version:
Block library for the WordPress editor.
24 lines (23 loc) • 593 B
JavaScript
// packages/block-library/src/utils/migrate-text-align.js
/**
* Migrates the current textAlign attribute,
*
* @param {Object} attributes The current attributes
* @return {Object} The updated attributes.
*/
function migrate_text_align_default(attributes) {
const { textAlign, ...restAttributes } = attributes;
if (!textAlign) return attributes;
return {
...restAttributes,
style: {
...attributes.style,
typography: {
...attributes.style?.typography,
textAlign
}
}
};
}
export { migrate_text_align_default as default };
//# sourceMappingURL=migrate-text-align.mjs.map