UNPKG

@wordpress/block-library

Version:
29 lines (28 loc) • 715 B
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); // 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 } } }; } exports.default = migrate_text_align_default; //# sourceMappingURL=migrate-text-align.cjs.map