Skip to content

Commit b282f50

Browse files
added more substitutions
1 parent 0391659 commit b282f50

File tree

10 files changed

+84
-0
lines changed

10 files changed

+84
-0
lines changed

src/block/feature-grid/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import schema from './schema'
1717
import metadata from './block.json'
1818
import example from './example'
1919
import deprecated from './deprecated'
20+
import substitute from './substitute'
2021

2122
/**
2223
* WordPress dependencies
@@ -41,4 +42,5 @@ export const settings = {
4142
variations,
4243
edit,
4344
save,
45+
substitute,
4446
}
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/feature-grid',
3+
variants: [],
4+
to: [ 'stackable/columns' ],
5+
transform: ( oldAttributes, innerBlocks ) => {
6+
return [
7+
'stackable/columns',
8+
{},
9+
innerBlocks,
10+
]
11+
},
12+
}
13+
14+
export default substitute

src/block/feature/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import schema from './schema'
1717
import metadata from './block.json'
1818
import example from './example'
1919
import deprecated from './deprecated'
20+
import substitute from './substitute'
2021

2122
/**
2223
* WordPress dependencies
@@ -42,4 +43,5 @@ export const settings = {
4243
variations,
4344
edit,
4445
save,
46+
substitute,
4547
}

src/block/feature/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/feature',
3+
variants: [],
4+
to: [ 'stackable/columns' ],
5+
transform: ( oldAttributes, innerBlocks ) => {
6+
return [
7+
'stackable/columns',
8+
{},
9+
innerBlocks,
10+
]
11+
},
12+
}
13+
14+
export default substitute

src/block/hero/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
}

src/block/hero/substitute.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export const substitute = {
2+
from: 'stackable/hero',
3+
variants: [ 'stackable/hero' ],
4+
to: [ 'stackable/columns' ],
5+
transform: ( oldAttributes, innerBlocks ) => {
6+
return [
7+
'stackable/columns',
8+
{
9+
// TODO: See if passing the entire oldAttributes works.
10+
...oldAttributes,
11+
// hasBackground: oldAttributes.hasBackground,
12+
// blockBackgroundMediaUrl: oldAttributes.blockBackgroundMediaUrl,
13+
// align: oldAttributes.align,
14+
// contentAlign: oldAttributes.contentAlign,
15+
// innerBlockContentAlign: oldAttributes.innerBlockContentAlign,
16+
// blockHeight: oldAttributes.blockHeight,
17+
// blockVerticalAlign: oldAttributes.blockVerticalAlign,
18+
// hasContainer: oldAttributes.hasContainer,
19+
},
20+
[ 'stackable/column', {}, innerBlocks ],
21+
]
22+
},
23+
}
24+
25+
export default substitute

src/block/horizontal-scroller/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import schema from './schema'
77
import example from './example'
88
import metadata from './block.json'
99
import deprecated from './deprecated'
10+
import substitute from './substitute'
1011

1112
import { HorizontalScrollerIcon } from '~stackable/icons'
1213

@@ -28,4 +29,5 @@ export const settings = {
2829
deprecated,
2930
edit,
3031
save,
32+
substitute,
3133
}
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/horizontal-scroller',
3+
variants: [],
4+
to: [ 'stackable/columns' ],
5+
transform: ( oldAttributes, innerBlocks ) => {
6+
return [
7+
'stackable/columns',
8+
{},
9+
innerBlocks,
10+
]
11+
},
12+
}
13+
14+
export default substitute

src/block/icon/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import schema from './schema'
1717
import example from './example'
1818
import transforms from './transforms'
1919
import deprecated from './deprecated'
20+
import substitute from './substitute'
2021

2122
/**
2223
* WordPress dependencies
@@ -36,4 +37,5 @@ export const settings = {
3637
deprecated,
3738
edit,
3839
save,
40+
substitute,
3941
}

src/block/icon/substitute.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// TODO: this results in an error. test with Blooom Service 1 design
2+
export const substitute = {
3+
from: 'stackable/icon',
4+
to: [ 'core/paragraph' ],
5+
}
6+
7+
export default substitute

0 commit comments

Comments
 (0)