This repository was archived by the owner on Feb 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +18
-16
lines changed Expand file tree Collapse file tree 4 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import PropTypes from 'prop-types'
7
7
* @author WebDevStudios
8
8
* @param {object } block The block data.
9
9
* @param {number } index A unique key required by React.
10
- * @return {Element } A block-based component.
10
+ * @return {Element } A block-based component.
11
11
*/
12
12
export default function displayBlock ( block , index ) {
13
13
const { attributes, name} = block
@@ -43,7 +43,7 @@ export default function displayBlock(block, index) {
43
43
case 'core/spacer' :
44
44
return < Blocks . BlockSpacer { ...attributes } key = { index } />
45
45
default :
46
- return < pre key = { index } > { JSON . stringify ( attributes , null , 2 ) } </ pre >
46
+ return < pre key = { index } > { JSON . stringify ( block , null , 2 ) } </ pre >
47
47
}
48
48
}
49
49
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ import getFormById from '@/api/wordpress/gravityForms/getFormById'
4
4
* Format and retrieve expanded block data.
5
5
*
6
6
* @author WebDevStudios
7
- * @param {Array } blocks Basic block data.
8
- * @return {Array } Formatted block data.
7
+ * @param {Array } blocks Basic block data.
8
+ * @return {Array } Formatted block data.
9
9
*/
10
10
export default async function formatBlockData ( blocks ) {
11
11
if ( ! blocks || ! blocks . length ) {
@@ -14,7 +14,7 @@ export default async function formatBlockData(blocks) {
14
14
15
15
return await Promise . all (
16
16
blocks . map ( async ( block ) => {
17
- const { name, attributes} = block
17
+ const { name, attributes, innerBlocks } = block
18
18
19
19
switch ( name ) {
20
20
case 'gravityforms/form' :
@@ -23,7 +23,9 @@ export default async function formatBlockData(blocks) {
23
23
break
24
24
}
25
25
26
- return { name, attributes}
26
+ const innerBlocksFormatted = await formatBlockData ( innerBlocks )
27
+
28
+ return { name, attributes, innerBlocks : innerBlocksFormatted }
27
29
} )
28
30
)
29
31
}
Original file line number Diff line number Diff line change 64
64
"eslint-plugin-prettier" : " ^3.3.1" ,
65
65
"eslint-plugin-react" : " ^7.22.0" ,
66
66
"eslint-plugin-react-hooks" : " ^4.2.0" ,
67
- "graphql" : " ^15.4 .0" ,
67
+ "graphql" : " ^15.5 .0" ,
68
68
"husky" : " ^4.3.8" ,
69
69
"lint-staged" : " ^10.5.3" ,
70
70
"next-seo" : " ^4.17.0" ,
71
- "next-sitemap" : " ^1.4.5 " ,
71
+ "next-sitemap" : " ^1.4.13 " ,
72
72
"postcss-flexbugs-fixes" : " ^4.2.1" ,
73
73
"postcss-preset-env" : " ^6.7.0" ,
74
74
"prettier" : " ^2.2.1" ,
Original file line number Diff line number Diff line change @@ -7047,10 +7047,10 @@ graphql-tag@^2.11.0:
7047
7047
resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.11.0.tgz#1deb53a01c46a7eb401d6cb59dec86fa1cccbffd"
7048
7048
integrity sha512-VmsD5pJqWJnQZMUeRwrDhfgoyqcfwEkvtpANqcoUG8/tOLkwNgU9mzub/Mc78OJMhHjx7gfAMTxzdG43VGg3bA==
7049
7049
7050
- graphql@^15.4 .0:
7051
- version "15.4 .0"
7052
- resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.4 .0.tgz#e459dea1150da5a106486ba7276518b5295a4347 "
7053
- integrity sha512-EB3zgGchcabbsU9cFe1j+yxdzKQKAbGUWRb13DsrsMN1yyfmmIq+2+L5MqVWcDCE4V89R5AyUOi7sMOGxdsYtA ==
7050
+ graphql@^15.5 .0:
7051
+ version "15.5 .0"
7052
+ resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5 .0.tgz#39d19494dbe69d1ea719915b578bf920344a69d5 "
7053
+ integrity sha512-OmaM7y0kaK31NKG31q4YbD2beNYa6jBBKtMFT6gLYJljHLJr42IqJ8KX08u3Li/0ifzTU5HjmoOOrwa5BRLeDA ==
7054
7054
7055
7055
gud@^1.0.0:
7056
7056
version "1.0.0"
@@ -9263,10 +9263,10 @@ next-seo@^4.17.0:
9263
9263
resolved "https://registry.yarnpkg.com/next-seo/-/next-seo-4.17.0.tgz#fb3dbe0ed7414aa9d83872ef5d8510980a6dae7e"
9264
9264
integrity sha512-/hnb3oq7bhi8s7bup7+Lm6VzzgRucj+JrWtp+dJiYs/04H0N/NhmE9MpepixQ16fFj6G/39JLYxhzsO/QZG/Kw==
9265
9265
9266
- next-sitemap@^1.4.5 :
9267
- version "1.4.5 "
9268
- resolved "https://registry.yarnpkg.com/next-sitemap/-/next-sitemap-1.4.5 .tgz#009f99f279cab63ca64803830e467fae2aae2e27 "
9269
- integrity sha512-gi7xeBiJrzcSJekT0xRh26KEEU8c+v4yenzy3BDehvm2rXzl2tOFbUoSESuQkv8iHm2Gz5WC8Og297t/VRGmkw ==
9266
+ next-sitemap@^1.4.13 :
9267
+ version "1.4.13 "
9268
+ resolved "https://registry.yarnpkg.com/next-sitemap/-/next-sitemap-1.4.13 .tgz#2c7638f1a48a43db8aa138e53cf9c857e540052f "
9269
+ integrity sha512-jaf6VsYHU5zIJUYiciN6xSrGqrMoT3xwrmLvCk+//B9jxg+aXqTdl3jKH9QYcHSf5aHo/skAmqMbiXZqaEfwjg ==
9270
9270
dependencies:
9271
9271
"@corex/deepmerge" "^2.5.3"
9272
9272
matcher "^3.0.0"
You can’t perform that action at this time.
0 commit comments