Skip to content

Commit 00adbdf

Browse files
added more substitutions
1 parent 2d63b48 commit 00adbdf

File tree

7 files changed

+51
-0
lines changed

7 files changed

+51
-0
lines changed

src/block/blockquote/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import save from './save'
1111
import schema from './schema'
1212
import example from './example'
1313
import deprecated from './deprecated'
14+
import substitute from './substitute'
1415

1516
/**
1617
* External dependencies
@@ -40,4 +41,5 @@ export const settings = {
4041
variations,
4142
edit,
4243
save,
44+
substitute,
4345
}

src/block/blockquote/substitute.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export const substitute = {
2+
from: 'stackable/blockquote',
3+
to: 'core/pullquote',
4+
transform: ( oldAttributes, innerBlocks ) => {
5+
return {
6+
value: innerBlocks[ 1 ][ 1 ].text,
7+
align: oldAttributes.contentAlign,
8+
}
9+
},
10+
}
11+
12+
export default substitute

src/block/count-up/substitute.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const substitute = {
66
fontSize: 'x-large',
77
content: oldAttributes.text,
88
align: oldAttributes.contentAlign,
9+
style: { spacing: { margin: { top: '0', bottom: '0' } } },
910
}
1011
},
1112
}

src/block/number-box/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import schema from './schema'
1515
import metadata from './block.json'
1616
import example from './example'
1717
import deprecated from './deprecated'
18+
import substitute from './substitute'
1819

1920
export const settings = {
2021
...metadata,
@@ -29,4 +30,5 @@ export const settings = {
2930
deprecated,
3031
edit,
3132
save,
33+
substitute,
3234
}

src/block/number-box/substitute.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const substitute = {
2+
from: 'stackable/number-box',
3+
to: 'core/paragraph',
4+
transform: oldAttributes => {
5+
return {
6+
fontSize: 'xx-large',
7+
content: oldAttributes.text,
8+
align: oldAttributes.contentAlign,
9+
style: { spacing: { margin: { top: '0', bottom: '0' } } },
10+
}
11+
},
12+
}
13+
14+
export default substitute

src/block/team-member/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import save from './save'
1111
import schema from './schema'
1212
import example from './example'
1313
import deprecated from './deprecated'
14+
import substitute from './substitute'
1415

1516
/**
1617
* External dependencies
@@ -40,4 +41,5 @@ export const settings = {
4041
deprecated,
4142
edit,
4243
save,
44+
substitute,
4345
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export const substitute = {
2+
from: 'stackable/team-member',
3+
variants: [],
4+
to: 'stackable/columns',
5+
transform: ( oldAttributes, innerBlocks ) => {
6+
return [ 'stackable/columns',
7+
{},
8+
[
9+
[ 'stackable/column',
10+
{},
11+
innerBlocks,
12+
],
13+
],
14+
]
15+
},
16+
}
17+
18+
export default substitute

0 commit comments

Comments
 (0)