33 */
44import { createBlock , createBlocksFromInnerBlocksTemplate } from '@wordpress/blocks'
55
6+ /**
7+ * External dependencies
8+ */
9+ import { settings } from 'stackable'
10+
611/**
712 * Internal dependencies
813 */
914import { TEMPLATE as ICON_LABEL_TEMPLATE } from '../icon-label/edit'
15+ import { getHeadingDefaultAttributes } from './util'
1016
1117const transforms = {
1218 from : [
@@ -15,15 +21,21 @@ const transforms = {
1521 isMultiBlock : true ,
1622 blocks : [ 'stackable/text' ] ,
1723 transform : attributes => {
18- return attributes . map ( ( { ...attrs } ) => createBlock ( 'stackable/heading' , { ...attrs } ) )
24+ return attributes . map ( ( { ...attrs } ) => createBlock ( 'stackable/heading' , {
25+ ...getHeadingDefaultAttributes ( settings ) ,
26+ ...attrs ,
27+ } ) )
1928 } ,
2029 } ,
2130 {
2231 type : 'block' ,
2332 isMultiBlock : true ,
2433 blocks : [ 'stackable/subtitle' ] ,
2534 transform : attributes => {
26- return attributes . map ( ( { ...attrs } ) => createBlock ( 'stackable/heading' , { ...attrs } ) )
35+ return attributes . map ( ( { ...attrs } ) => createBlock ( 'stackable/heading' , {
36+ ...getHeadingDefaultAttributes ( settings ) ,
37+ ...attrs ,
38+ } ) )
2739 } ,
2840 } ,
2941 {
@@ -32,6 +44,7 @@ const transforms = {
3244 blocks : [ 'core/paragraph' ] ,
3345 transform : attributes => {
3446 return attributes . map ( ( { content } ) => createBlock ( 'stackable/heading' , {
47+ ...getHeadingDefaultAttributes ( settings ) ,
3548 text : content ,
3649 } ) )
3750 } ,
@@ -42,6 +55,7 @@ const transforms = {
4255 blocks : [ 'core/heading' ] ,
4356 transform : attributes => {
4457 return attributes . map ( ( { content } ) => createBlock ( 'stackable/heading' , {
58+ ...getHeadingDefaultAttributes ( settings ) ,
4559 text : content ,
4660 } ) )
4761 } ,
0 commit comments