Load headings data

[MAILPOET-2613]
This commit is contained in:
Pavel Dohnal
2020-03-10 16:51:38 +01:00
committed by Veljko V
parent f465564d41
commit 40ee30259d
3 changed files with 52 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
/* eslint-disable camelcase */
import { has } from 'lodash';
import formatCustomFieldBlockName from '../blocks/format_custom_field_block_name.jsx';
@@ -142,6 +143,19 @@ export const formBodyToBlocksFactory = (colorDefinitions, customFields = []) =>
mapped.attributes.label = item.params.label ? item.params.label : '';
}
switch (item.id) {
case 'heading':
return {
...mapped,
attributes: {
content: item.params?.content || '',
level: item.params?.level || 2,
align: item.params?.align,
textColor: item.params?.text_color,
anchor: item.params?.anchor,
className: item.params?.class_name,
},
name: 'core/heading',
};
case 'email':
return {
...mapped,