Skip to content

Commit

Permalink
Switch type/source to string/children
Browse files Browse the repository at this point in the history
In the attributes, The source of `children` is no longer supported and should be
changed to `html` along with the type changing to `string`.

See PR comment here:
WordPress/gutenberg#10439 (comment)
  • Loading branch information
mkaz committed Oct 21, 2021
1 parent 8a7ec11 commit 57ae550
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions 03-editable-esnext/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"category": "layout",
"attributes": {
"content": {
"type": "array",
"source": "children",
"type": "string",
"source": "html",
"selector": "p"
}
},
Expand Down
4 changes: 2 additions & 2 deletions 03-editable/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"category": "layout",
"attributes": {
"content": {
"type": "array",
"source": "children",
"type": "string",
"source": "html",
"selector": "p"
}
},
Expand Down
4 changes: 2 additions & 2 deletions 04-controls-esnext/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"category": "layout",
"attributes": {
"content": {
"type": "array",
"source": "children",
"type": "string",
"source": "html",
"selector": "p"
},
"alignment": {
Expand Down
4 changes: 2 additions & 2 deletions 04-controls/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"category": "layout",
"attributes": {
"content": {
"type": "array",
"source": "children",
"type": "string",
"source": "html",
"selector": "p"
},
"alignment": {
Expand Down
22 changes: 11 additions & 11 deletions 05-recipe-card-esnext/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"category": "layout",
"attributes": {
"title": {
"type": "array",
"source": "children",
"type": "string",
"source": "html",
"selector": "h2"
},
"mediaID": {
Expand All @@ -21,13 +21,13 @@
"attribute": "src"
},
"ingredients": {
"type": "array",
"source": "children",
"type": "string",
"source": "html",
"selector": ".ingredients"
},
"instructions": {
"type": "array",
"source": "children",
"type": "string",
"source": "html",
"selector": ".steps"
}
},
Expand All @@ -37,15 +37,15 @@
"mediaID": 1,
"mediaURL": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f1/2ChocolateChipCookies.jpg/320px-2ChocolateChipCookies.jpg",
"ingredients": [
{ "type": "li", "props": { "children": [ "flour" ] } },
{ "type": "li", "props": { "children": [ "sugar" ] } },
{ "type": "li", "props": { "children": [ "chocolate" ] } },
{ "type": "li", "props": { "children": [ "💖" ] } }
{ "type": "li", "props": { "children": ["flour"] } },
{ "type": "li", "props": { "children": ["sugar"] } },
{ "type": "li", "props": { "children": ["chocolate"] } },
{ "type": "li", "props": { "children": ["💖"] } }
],
"instructions": [
{
"type": "p",
"props": { "children": [ "Mix, Bake, Enjoy!" ] }
"props": { "children": ["Mix, Bake, Enjoy!"] }
}
]
}
Expand Down
16 changes: 8 additions & 8 deletions 05-recipe-card/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"category": "layout",
"attributes": {
"title": {
"type": "array",
"source": "children",
"type": "string",
"source": "html",
"selector": "h2"
},
"mediaID": {
Expand All @@ -21,22 +21,22 @@
"attribute": "src"
},
"ingredients": {
"type": "array",
"source": "children",
"type": "string",
"source": "html",
"selector": ".ingredients"
},
"instructions": {
"type": "array",
"source": "children",
"type": "string",
"source": "html",
"selector": ".steps"
}
},
"example": {
"attributes": {
"title": "Chocolate Chip Cookies",
"mediaURL": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f1/2ChocolateChipCookies.jpg/320px-2ChocolateChipCookies.jpg",
"ingredients": [ "flour", "sugar", "chocolate", "💖" ],
"instructions": [ "Mix", "Bake", "Enjoy" ]
"ingredients": ["flour", "sugar", "chocolate", "💖"],
"instructions": ["Mix", "Bake", "Enjoy"]
}
},
"editorScript": "file:./block.js",
Expand Down

0 comments on commit 57ae550

Please sign in to comment.