@wordpress/block-library
Version:
Block library for the WordPress editor.
1 lines • 830 B
Source Map (JSON)
{"version":3,"file":"migrate-text-align.mjs","names":[],"sources":["../../src/utils/migrate-text-align.js"],"sourcesContent":["/**\n * Migrates the current textAlign attribute,\n *\n * @param {Object} attributes The current attributes\n * @return {Object} The updated attributes.\n */\nexport default function ( attributes ) {\n\tconst { textAlign, ...restAttributes } = attributes;\n\tif ( ! textAlign ) {\n\t\treturn attributes;\n\t}\n\treturn {\n\t\t...restAttributes,\n\t\tstyle: {\n\t\t\t...attributes.style,\n\t\t\ttypography: {\n\t\t\t\t...attributes.style?.typography,\n\t\t\t\ttextAlign,\n\t\t\t},\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;AAMA,SAAA,2BAA0B,YAAa;CACtC,MAAM,EAAE,WAAW,GAAG,mBAAmB;CACzC,IAAK,CAAE,WACN,OAAO;CAER,OAAO;EACN,GAAG;EACH,OAAO;GACN,GAAG,WAAW;GACd,YAAY;IACX,GAAG,WAAW,OAAO;IACrB;GACD;EACD;CACD;AACD"}