File tree Expand file tree Collapse file tree 4 files changed +31
-0
lines changed
Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import schema from './schema'
1515import metadata from './block.json'
1616import example from './example'
1717import deprecated from './deprecated'
18+ import substitute from './substitute'
1819
1920export const settings = {
2021 ...metadata ,
@@ -30,4 +31,5 @@ export const settings = {
3031 deprecated,
3132 edit,
3233 save,
34+ substitute,
3335}
Original file line number Diff line number Diff line change 1+ export const substitute = {
2+ from : 'stackable/icon-label' ,
3+ to : 'stackable/text' ,
4+ transform : ( oldAttributes , innerBlocks ) => {
5+ return {
6+ text : innerBlocks [ 1 ] [ 1 ] . text ,
7+ }
8+ } ,
9+ }
10+
11+ export default substitute
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import schema from './schema'
1515import metadata from './block.json'
1616import example from './example'
1717import deprecated from './deprecated'
18+ import substitute from './substitute'
1819
1920export const settings = {
2021 ...metadata ,
@@ -28,4 +29,5 @@ export const settings = {
2829 deprecated,
2930 edit,
3031 save,
32+ substitute,
3133}
Original file line number Diff line number Diff line change 1+ export const substitute = {
2+ from : 'stackable/price' ,
3+ to : 'core/paragraph' ,
4+ transform : ( oldAttributes , innerBlocks ) => {
5+ let content = ''
6+ for ( const block of innerBlocks ) {
7+ content += block [ 1 ] . text
8+ }
9+ return [ 'core/paragraph' , {
10+ fontSize : 'x-large' ,
11+ content,
12+ } ]
13+ } ,
14+ }
15+
16+ export default substitute
You can’t perform that action at this time.
0 commit comments