From eec8d29c9b456623ee4e17b086cee2ad73fe665d Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Tue, 30 Jan 2024 17:21:33 +0530 Subject: [PATCH 1/3] Separate out header, content and footer for homepages --- composer.json | 2 +- composer.lock | 14 +++++++------- package-lock.json | 12 ++++++------ .../components/SitegenEditorPatterns/Sidebar.js | 16 ++++++++++++++-- src/OnboardingSPA/steps/SiteGen/Editor/index.js | 9 ++++++++- src/OnboardingSPA/steps/SiteGen/Preview/index.js | 8 +++++++- 6 files changed, 43 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index be07ecd2f..1bb90cc70 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "newfold-labs/wp-module-onboarding-data": "^0.1.0", "newfold-labs/wp-module-patterns": "^0.1.12", "newfold-labs/wp-module-install-checker": "^1.0", - "newfold-labs/wp-module-facebook": "1.0.0" + "newfold-labs/wp-module-facebook": "^1.0.2" }, "require-dev": { "wp-phpunit/wp-phpunit": "^6.2", diff --git a/composer.lock b/composer.lock index 216d4ccad..821c6877f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e9414ea34a5260c76cff581c26a6856d", + "content-hash": "ecc1023e4ef1e6b2bd33c3597d78c06e", "packages": [ { "name": "mustache/mustache", @@ -195,16 +195,16 @@ }, { "name": "newfold-labs/wp-module-facebook", - "version": "v1.0.0", + "version": "v1.0.2", "source": { "type": "git", "url": "git@github.com:newfold-labs/wp-module-facebook.git", - "reference": "9b0caa8311bd13b72cb8c03075e7832302109cf4" + "reference": "21ad4a3db764633307b680b3bb693d6ed8390a3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-facebook/zipball/9b0caa8311bd13b72cb8c03075e7832302109cf4", - "reference": "9b0caa8311bd13b72cb8c03075e7832302109cf4", + "url": "https://api.github.com/repos/newfold-labs/wp-module-facebook/zipball/21ad4a3db764633307b680b3bb693d6ed8390a3b", + "reference": "21ad4a3db764633307b680b3bb693d6ed8390a3b", "shasum": "" }, "require": { @@ -230,10 +230,10 @@ } ], "support": { - "source": "https://github.com/newfold-labs/wp-module-facebook/tree/v1.0.0", + "source": "https://github.com/newfold-labs/wp-module-facebook/tree/v1.0.2", "issues": "https://github.com/newfold-labs/wp-module-facebook/issues" }, - "time": "2024-01-24T10:00:53+00:00" + "time": "2024-01-29T09:15:30+00:00" }, { "name": "newfold-labs/wp-module-install-checker", diff --git a/package-lock.json b/package-lock.json index fa543b786..76b7f14fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4816,6 +4816,12 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "prettier": { + "version": "npm:wp-prettier@3.0.3", + "resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-3.0.3.tgz", + "integrity": "sha512-X4UlrxDTH8oom9qXlcjnydsjAOD2BmB6yFmvS4Z2zdTzqqpRWb+fbqrH412+l+OUXmbzJlSXjlMFYPgYG12IAA==", + "dev": true + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -14654,12 +14660,6 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, - "prettier": { - "version": "npm:wp-prettier@3.0.3", - "resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-3.0.3.tgz", - "integrity": "sha512-X4UlrxDTH8oom9qXlcjnydsjAOD2BmB6yFmvS4Z2zdTzqqpRWb+fbqrH412+l+OUXmbzJlSXjlMFYPgYG12IAA==", - "dev": true - }, "prettier-linter-helpers": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", diff --git a/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js b/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js index 9ac83796c..9070e3dfc 100644 --- a/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js +++ b/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js @@ -110,6 +110,12 @@ const SitegenEditorPatternsSidebar = () => { const newPreviewSettings = cloneDeep( globalStyles[ 0 ] ); newPreviewSettings.settings.color.palette = data.color.palette; + let blockGrammar = ''; + [ 'header', 'content', 'footer' ].forEach( ( part ) => { + if ( part in data ) { + blockGrammar += data[ part ]; + } + } ); return (
{ ? 'custom' : 'custom__highlighted' } - blockGrammer={ data.content } + blockGrammer={ blockGrammar } viewportWidth={ 1300 } previewSettings={ newPreviewSettings } skeletonLoadingTime={ 0 } @@ -206,6 +212,12 @@ const SitegenEditorPatternsSidebar = () => { ); newPreviewSettings.settings.color.palette = data.color.palette; + let blockGrammar = ''; + [ 'header', 'content', 'footer' ].forEach( ( part ) => { + if ( part in data ) { + blockGrammar += data[ part ]; + } + } ); return (
{ : 'custom__highlighted' } blockGrammer={ - data.content + blockGrammar } viewportWidth={ 1300 diff --git a/src/OnboardingSPA/steps/SiteGen/Editor/index.js b/src/OnboardingSPA/steps/SiteGen/Editor/index.js index 02d588571..e1dc70210 100644 --- a/src/OnboardingSPA/steps/SiteGen/Editor/index.js +++ b/src/OnboardingSPA/steps/SiteGen/Editor/index.js @@ -81,9 +81,16 @@ const StepSiteGenEditor = () => { populateFontsInPreviewSettings( newPreviewSettings ); } + let blockGrammar = ''; + [ 'header', 'content', 'footer' ].forEach( ( part ) => { + if ( part in homepage ) { + blockGrammar += homepage[ part ]; + } + } ); + return ( { const data = homepages[ slug ]; const newPreviewSettings = cloneDeep( globalStyles[ 0 ] ); newPreviewSettings.settings.color.palette = data.color.palette; + let blockGrammar = ''; + [ 'header', 'content', 'footer' ].forEach( ( part ) => { + if ( part in data ) { + blockGrammar += data[ part ]; + } + } ); return ( Date: Tue, 30 Jan 2024 17:41:03 +0530 Subject: [PATCH 2/3] Lint fixes --- .../Sidebar/components/SitegenEditorPatterns/Sidebar.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js b/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js index 9070e3dfc..309514205 100644 --- a/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js +++ b/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js @@ -213,9 +213,14 @@ const SitegenEditorPatternsSidebar = () => { newPreviewSettings.settings.color.palette = data.color.palette; let blockGrammar = ''; - [ 'header', 'content', 'footer' ].forEach( ( part ) => { + [ + 'header', + 'content', + 'footer', + ].forEach( ( part ) => { if ( part in data ) { - blockGrammar += data[ part ]; + blockGrammar += + data[ part ]; } } ); return ( From 09b29138a1f953702b645222727238f18e836d74 Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Wed, 31 Jan 2024 18:00:04 +0530 Subject: [PATCH 3/3] Fix favorites sidebar --- .../components/SitegenEditorPatterns/Sidebar.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js b/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js index 309514205..9c96c9c08 100644 --- a/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js +++ b/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js @@ -323,6 +323,17 @@ const SitegenEditorPatternsSidebar = () => { ); newPreviewSettings.settings.color.palette = data.color.palette; + let blockGrammar = ''; + [ + 'header', + 'content', + 'footer', + ].forEach( ( part ) => { + if ( part in data ) { + blockGrammar += + data[ part ]; + } + } ); return (
{ : 'custom__highlighted' } blockGrammer={ - data.content + blockGrammar } viewportWidth={ 1300