Skip to content

Commit

Permalink
Use schema structure for attribute sourcing
Browse files Browse the repository at this point in the history
  • Loading branch information
goldentroll committed Sep 1, 2017
1 parent 706abfa commit 4d17144
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion 03-editable-esnext/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ registerBlockType( 'gutenberg-examples/03-editable-esnext', {
icon: 'universal-access-alt',
category: 'layout',
attributes: {
content: children( 'p' ),
content: {
type: 'array',
source: children( 'p' ),
},
},
edit: props => {
const { attributes: { content }, focus, className, setFocus } = props;
Expand Down
5 changes: 4 additions & 1 deletion 03-editable/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
category: 'layout',

attributes: {
content: children( 'p' ),
content: {
type: 'array',
source: children( 'p' ),
},
},

edit: function( props ) {
Expand Down
5 changes: 4 additions & 1 deletion 04-controls-esnext/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ registerBlockType( 'gutenberg-examples/04-controls-esnext', {
icon: 'universal-access-alt',
category: 'layout',
attributes: {
content: children( 'p' ),
content: {
type: 'array',
source: children( 'p' ),
},
},
edit: props => {
const {
Expand Down
5 changes: 4 additions & 1 deletion 04-controls/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
category: 'layout',

attributes: {
content: children( 'p' ),
content: {
type: 'array',
source: children( 'p' ),
},
},

edit: function( props ) {
Expand Down

0 comments on commit 4d17144

Please sign in to comment.