From 9f6ab77759f10f45a4c99636765fc16bfb1251d5 Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Thu, 7 Dec 2023 01:13:16 +0530 Subject: [PATCH] Favorites, regeneration and maintaining state --- src/OnboardingSPA/components/Header/index.js | 18 +- .../LivePreview/SiteGenCard/index.js | 4 +- .../LivePreview/SiteGenCard/stylesheet.scss | 8 +- .../NewfoldInterfaceSkeleton/SiteGen/index.js | 4 +- .../SitegenEditorPatterns/Sidebar.js | 59 ++++ .../SitegenEditorPatterns/stylesheet.scss | 0 src/OnboardingSPA/data/homepages/1.json | 5 - .../data/homepages/getHomepages.js | 8 - src/OnboardingSPA/data/sidebars/index.js | 17 +- .../data/sitegen/homepages/1.json | 5 + .../data/{ => sitegen}/homepages/2.json | 0 .../data/{ => sitegen}/homepages/3.json | 0 .../data/{ => sitegen}/homepages/4.json | 0 .../data/sitegen/homepages/homepages.js | 25 ++ .../data/sitegen/sitemeta/siteMeta.js | 39 +++ .../data/sitegen/sitemeta/siteMeta.json | 305 ++++++++++++++++++ .../static/icons/sitegen/favorite-filled.svg | 3 + .../static/icons/sitegen/settings.svg | 8 + .../steps/SiteGen/Editor/Header/index.js | 170 +++++++--- .../SiteGen/Editor/Header/stylesheet.scss | 65 +++- .../SiteGen/Editor/Sidebar/Patterns/index.js | 17 + .../steps/SiteGen/Editor/index.js | 54 +++- .../steps/SiteGen/Preview/index.js | 108 +++++-- .../steps/SiteGen/Preview/stylesheet.scss | 5 +- .../steps/SiteGen/SiteLogo/index.js | 38 ++- src/OnboardingSPA/styles/_branding.scss | 1 + src/OnboardingSPA/styles/_icons.scss | 2 + src/constants.js | 1 + 28 files changed, 831 insertions(+), 138 deletions(-) create mode 100644 src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js create mode 100644 src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/stylesheet.scss delete mode 100644 src/OnboardingSPA/data/homepages/1.json delete mode 100644 src/OnboardingSPA/data/homepages/getHomepages.js create mode 100644 src/OnboardingSPA/data/sitegen/homepages/1.json rename src/OnboardingSPA/data/{ => sitegen}/homepages/2.json (100%) rename src/OnboardingSPA/data/{ => sitegen}/homepages/3.json (100%) rename src/OnboardingSPA/data/{ => sitegen}/homepages/4.json (100%) create mode 100644 src/OnboardingSPA/data/sitegen/homepages/homepages.js create mode 100644 src/OnboardingSPA/data/sitegen/sitemeta/siteMeta.js create mode 100644 src/OnboardingSPA/data/sitegen/sitemeta/siteMeta.json create mode 100644 src/OnboardingSPA/static/icons/sitegen/favorite-filled.svg create mode 100644 src/OnboardingSPA/static/icons/sitegen/settings.svg create mode 100644 src/OnboardingSPA/steps/SiteGen/Editor/Sidebar/Patterns/index.js diff --git a/src/OnboardingSPA/components/Header/index.js b/src/OnboardingSPA/components/Header/index.js index 5950c1f4b..6506cf1c2 100644 --- a/src/OnboardingSPA/components/Header/index.js +++ b/src/OnboardingSPA/components/Header/index.js @@ -9,18 +9,22 @@ import { HEADER_START, HEADER_TOP, } from '../../../constants'; +import classNames from 'classnames'; +import { stepSiteGenEditor } from '../../steps/SiteGen/Editor/step'; const Header = () => { - const { headers, headerActiveView, isHeaderEnabled } = useSelect( - ( select ) => { + const { headers, headerActiveView, isHeaderEnabled, currentStep } = + useSelect( ( select ) => { return { headers: select( nfdOnboardingStore ).getHeaders(), headerActiveView: select( nfdOnboardingStore ).getHeaderActiveView(), isHeaderEnabled: select( nfdOnboardingStore ).isHeaderEnabled(), + currentStep: select( nfdOnboardingStore ).getCurrentStep(), }; - } - ); + } ); + + const isEditorStep = currentStep === stepSiteGenEditor; return ( <> @@ -35,7 +39,11 @@ const Header = () => { { isHeaderEnabled && ( -
+
- { - const { newfoldBrand } = useSelect( ( select ) => { + const { newfoldBrand, currentStep } = useSelect( ( select ) => { return { newfoldBrand: select( nfdOnboardingStore ).getNewfoldBrand(), + currentStep: select( nfdOnboardingStore ).getCurrentStep(), }; }, [] ); diff --git a/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js b/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js new file mode 100644 index 000000000..9535bcce0 --- /dev/null +++ b/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js @@ -0,0 +1,59 @@ +import { Fill, PanelBody, PanelHeader, Button } from '@wordpress/components'; +import { Fragment, memo, Suspense } from '@wordpress/element'; +import { closeSmall } from '@wordpress/icons'; +import { useDispatch, useSelect } from '@wordpress/data'; +import { __ } from '@wordpress/i18n'; + +import { store as nfdOnboardingStore } from '../../../../store'; +import { + SIDEBAR_SITEGEN_EDITOR_PATTERNS, + SIDEBAR_SLOTFILL_PREFIX, +} from '../../../../../constants'; + +const SitegenEditorPatternsSidebar = () => { + const { currentStep } = useSelect( ( select ) => { + return { + currentStep: select( nfdOnboardingStore ).getCurrentStep(), + }; + } ); + + const { setIsSidebarOpened } = useDispatch( nfdOnboardingStore ); + + const closeSideBar = () => { + setIsSidebarOpened( false ); + }; + return ( + + + }> + +
+ +
+
+ { currentStep?.sidebars?.LearnMore && + currentStep?.sidebars?.LearnMore.SidebarComponents.map( + ( SidebarComponent, index ) => { + return ( + + + + ); + } + ) } +
+
+
+ ); +}; + +export default memo( SitegenEditorPatternsSidebar ); diff --git a/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/stylesheet.scss b/src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/stylesheet.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/OnboardingSPA/data/homepages/1.json b/src/OnboardingSPA/data/homepages/1.json deleted file mode 100644 index 652efc18e..000000000 --- a/src/OnboardingSPA/data/homepages/1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "slug": "version-1", - "title": "Version 1", - "content": "\n
\n \n\t
\n\t\t\n\t\t

Memorable Experiences

\n\t\t\n\t\t\n\t\t

Elevate your function
to the industry’s finest

\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n\t\n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n
\n \n\n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\"\"/
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\"\"/
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\"\"/
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\"\"/
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n
\n \n\n\n
\n \n
\n \n

Area of Practice

\n \n
\n \n \n\t\n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

01

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Portfolio Management

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

02

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Performance Reviews

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

03

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Financial Planning

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

04

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Portfolio Management

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

05

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Performance Reviews

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

06

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Financial Planning

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n
\n \n\n\n
\n\n\n\n
\n\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\"\"
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\"\"
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

Discover Our Amazing Workouts

\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Experience amazing daily workouts at our newly opened gym. Choose among classic and modern fitness programs, performed with the guidance of expert trainers.

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

Come and Experience Our Unforgettable Cuisine

\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Experience exquisite fine dining at our newly opened restaurant. Enjoy a delicious menu of classic and modern dishes, prepared with the freshest ingredients.

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n\t\n\n
\n\n \n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

25k

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Drinks served

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

50k

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Attendee Registrations

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

12

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Promotions held

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

15

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Professional associations

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n
\n \n\n\n
\n \n\t

★ ★ ★ ★ ★

\n\t\n\t\n\t
\n\t\t\n\t\t

My experience at the restaurant was great. The food was delicious, the service was excellent, and the atmosphere was cozy and inviting. Highly recommend this restaurant.

\n\t\t\n\t
\n\t\n\t\n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t

\n\t\t\t\tAlex Martinez\n\t\t\t

\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t

/

\n\t\t\n\t\t\n\t\t

Customer

\n\t\t\n\t
\n\t\n
\n \n\n\n
\n \n\t
\n\t\t\"\"\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We handle everything
detail-oriented individuals worry about

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Effortless experience

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Exceptional events

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t
\n\t\n
\n \n\n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

Frequently Asked Questions

\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Is there a free trial available?

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Yes, we offer a free trial period of 14 days. During this period, you will have full access to all of our features and services.

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

How do I change my personal information?

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

You can update name, email address and other personal information from the \"Settings\" section.

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Can I change my plan later?

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Yes, you can upgrade or downgrade your plan at any time.

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

How does billing work?

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

We have a simple billing system which allows you to pay for services on a monthly basis.

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Can I get an invoice for my purchase?

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Yes, you can. Please contact our customer support and provide your purchase number.

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n
\n \n\n\n
\n\n \n\t
\n\n\t\t\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Discover the authorities

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\n\t\t\n\t\t

Our Crew

\n\t\t\n\t
\n\t\n\n \n\t
\n\t\t\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\n\n
\n" -} \ No newline at end of file diff --git a/src/OnboardingSPA/data/homepages/getHomepages.js b/src/OnboardingSPA/data/homepages/getHomepages.js deleted file mode 100644 index 675071ac2..000000000 --- a/src/OnboardingSPA/data/homepages/getHomepages.js +++ /dev/null @@ -1,8 +0,0 @@ -import one from './1.json'; -import two from './2.json'; -import three from './3.json'; -const getHomepages = () => { - return [one, two, three]; -} - -export default getHomepages; \ No newline at end of file diff --git a/src/OnboardingSPA/data/sidebars/index.js b/src/OnboardingSPA/data/sidebars/index.js index a448adcd4..f45973fc9 100644 --- a/src/OnboardingSPA/data/sidebars/index.js +++ b/src/OnboardingSPA/data/sidebars/index.js @@ -1,6 +1,9 @@ import { lazy } from '@wordpress/element'; -import { SIDEBAR_LEARN_MORE } from '../../../constants'; +import { + SIDEBAR_LEARN_MORE, + SIDEBAR_SITEGEN_EDITOR_PATTERNS, +} from '../../../constants'; const LearnMoreMenu = lazy( () => import( '../../components/Sidebar/components/LearnMore/Menu' ) @@ -9,6 +12,12 @@ const LearnMoreSidebar = lazy( () => import( '../../components/Sidebar/components/LearnMore/Sidebar' ) ); +const SitegenEditorPatternsSidebar = lazy( () => + import( + '../../components/Sidebar/components/SitegenEditorPatterns/Sidebar' + ) +); + export const sidebars = [ { id: SIDEBAR_LEARN_MORE, @@ -16,4 +25,10 @@ export const sidebars = [ sidebar: LearnMoreSidebar, enabled: true, }, + { + id: SIDEBAR_SITEGEN_EDITOR_PATTERNS, + menu: SitegenEditorPatternsSidebar, + sidebar: SitegenEditorPatternsSidebar, + enabled: true, + }, ]; diff --git a/src/OnboardingSPA/data/sitegen/homepages/1.json b/src/OnboardingSPA/data/sitegen/homepages/1.json new file mode 100644 index 000000000..a56a2a307 --- /dev/null +++ b/src/OnboardingSPA/data/sitegen/homepages/1.json @@ -0,0 +1,5 @@ +{ + "slug": "version-1", + "title": "Version 1", + "content": "\n
\n\t
\n\t\n\t\n\t
\n\t\n\t\n\t\n\t
\n\t
\n\t
\n\t\n
\n \n\t
\n\t\t\n\t\t

Memorable Experiences

\n\t\t\n\t\t\n\t\t

Elevate your function
to the industry’s finest

\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n\t\n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n
\n \n\n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\"\"/
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\"\"/
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\"\"/
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\"\"/
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n
\n \n\n\n
\n \n
\n \n

Area of Practice

\n \n
\n \n \n\t\n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

01

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Portfolio Management

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

02

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Performance Reviews

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

03

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Financial Planning

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

04

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Portfolio Management

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

05

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Performance Reviews

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

06

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Financial Planning

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We will work with you to create a personalised plan to help you achieve your financial goals.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n
\n \n\n\n
\n\n\n\n
\n\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\"\"
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\"\"
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

Discover Our Amazing Workouts

\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Experience amazing daily workouts at our newly opened gym. Choose among classic and modern fitness programs, performed with the guidance of expert trainers.

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

Come and Experience Our Unforgettable Cuisine

\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Experience exquisite fine dining at our newly opened restaurant. Enjoy a delicious menu of classic and modern dishes, prepared with the freshest ingredients.

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n\t\n\n
\n\n \n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

25k

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Drinks served

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

50k

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Attendee Registrations

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

12

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Promotions held

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

15

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Professional associations

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n
\n \n\n\n
\n \n\t

★ ★ ★ ★ ★

\n\t\n\t\n\t
\n\t\t\n\t\t

My experience at the restaurant was great. The food was delicious, the service was excellent, and the atmosphere was cozy and inviting. Highly recommend this restaurant.

\n\t\t\n\t
\n\t\n\t\n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t

\n\t\t\t\tAlex Martinez\n\t\t\t

\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t

/

\n\t\t\n\t\t\n\t\t

Customer

\n\t\t\n\t
\n\t\n
\n \n\n\n
\n \n\t
\n\t\t\"\"\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We handle everything
detail-oriented individuals worry about

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Effortless experience

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Exceptional events

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t
\n\t\n
\n \n\n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

Frequently Asked Questions

\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Is there a free trial available?

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Yes, we offer a free trial period of 14 days. During this period, you will have full access to all of our features and services.

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

How do I change my personal information?

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

You can update name, email address and other personal information from the \"Settings\" section.

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Can I change my plan later?

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Yes, you can upgrade or downgrade your plan at any time.

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

How does billing work?

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

We have a simple billing system which allows you to pay for services on a monthly basis.

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Can I get an invoice for my purchase?

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

Yes, you can. Please contact our customer support and provide your purchase number.

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n
\n \n\n\n
\n\n \n\t
\n\n\t\t\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Discover the authorities

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\n\t\t\n\t\t

Our Crew

\n\t\t\n\t
\n\t\n\n \n\t
\n\t\t\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\n\n
\n" +} \ No newline at end of file diff --git a/src/OnboardingSPA/data/homepages/2.json b/src/OnboardingSPA/data/sitegen/homepages/2.json similarity index 100% rename from src/OnboardingSPA/data/homepages/2.json rename to src/OnboardingSPA/data/sitegen/homepages/2.json diff --git a/src/OnboardingSPA/data/homepages/3.json b/src/OnboardingSPA/data/sitegen/homepages/3.json similarity index 100% rename from src/OnboardingSPA/data/homepages/3.json rename to src/OnboardingSPA/data/sitegen/homepages/3.json diff --git a/src/OnboardingSPA/data/homepages/4.json b/src/OnboardingSPA/data/sitegen/homepages/4.json similarity index 100% rename from src/OnboardingSPA/data/homepages/4.json rename to src/OnboardingSPA/data/sitegen/homepages/4.json diff --git a/src/OnboardingSPA/data/sitegen/homepages/homepages.js b/src/OnboardingSPA/data/sitegen/homepages/homepages.js new file mode 100644 index 000000000..34f9ab1e9 --- /dev/null +++ b/src/OnboardingSPA/data/sitegen/homepages/homepages.js @@ -0,0 +1,25 @@ +import {getRandomColorPalette} from '../sitemeta/siteMeta'; +import one from './1.json'; +import two from './2.json'; +import three from './3.json'; +import four from './4.json'; +const getHomepages = () => { + return [one, two, three]; +} + +const getRandom = ( homepage ) => { + console.log('homepage', homepage); + if ( homepage?.favorite ) { + homepage.slug = homepage.slug + '-copy' + homepage.title = homepage.title + ' Copy' + homepage.favorite = false; + homepage.color = getRandomColorPalette( homepage?.color?.slug ); + return homepage; + } + four.color = getRandomColorPalette( homepage?.color?.slug ); + return four; + + +} + +export { getHomepages, getRandom }; \ No newline at end of file diff --git a/src/OnboardingSPA/data/sitegen/sitemeta/siteMeta.js b/src/OnboardingSPA/data/sitegen/sitemeta/siteMeta.js new file mode 100644 index 000000000..83156a301 --- /dev/null +++ b/src/OnboardingSPA/data/sitegen/sitemeta/siteMeta.js @@ -0,0 +1,39 @@ +import siteMeta from './siteMeta.json'; +const getSiteMeta = () => { + return siteMeta; +} + +const getColorPalettes = () => { + let colorPalettes = {}; + Object.keys( siteMeta.colorpalette ).forEach((colorPalette) => { + colorPalettes[colorPalette] = Object.keys(siteMeta.colorpalette[colorPalette]).map(( slug ) => { + return { + slug, + title: slug[0].toUpperCase() + slug.slice(1), + color: siteMeta.colorpalette[colorPalette][slug] + } + }) + }) + + return colorPalettes; +} + +const getRandomColorPalette = ( activeColorPaletteSlug ) => { + const colorPalettes = getColorPalettes(); + console.log(colorPalettes) + let keys = Object.keys( colorPalettes ); + if ( activeColorPaletteSlug ) { + keys = keys.filter(( key ) => { + return key != activeColorPaletteSlug + }) + } + + const rand = Math.floor( Math.random() * keys.length ); + console.log(rand) + return { + slug: keys[2], + palette: colorPalettes[ keys[ 2 ] ] + } +} + +export {getSiteMeta, getColorPalettes, getRandomColorPalette}; \ No newline at end of file diff --git a/src/OnboardingSPA/data/sitegen/sitemeta/siteMeta.json b/src/OnboardingSPA/data/sitegen/sitemeta/siteMeta.json new file mode 100644 index 000000000..4f677166c --- /dev/null +++ b/src/OnboardingSPA/data/sitegen/sitemeta/siteMeta.json @@ -0,0 +1,305 @@ +{ + "siteclassification": { + "primaryType": "health-wellness", + "slug": "gym", + "emoji": "💪", + "wooType": "health-beauty", + "keywords": [ + "fitness", + "group", + "weight loss", + "muscle", + "cardio", + "strength", + "yoga", + "pilates", + "crossfit", + "bodybuilding", + "weight", + "treadmill", + "elliptical", + "interval" + ], + "label": "Gym" + }, + "targetaudience": { + "age": { + "min": "18", + "max": "45" + }, + "gender": "both", + "income": { + "min": "0", + "max": "1000000", + "currency": "INR" + }, + "education": "any", + "location": "Gym Beach, India", + "interests": [ + "Fitness", + "Health", + "Exercise", + "Wellness" + ] + }, + "contenttones": { + "tone": "Professional", + "undertone": "Positive", + "verbosity": 5, + "reading_level": 60 + }, + "contentstructure": { + "homepage1": [ + "header", + "hero", + "headings", + "features", + "gallery", + "call-to-action", + "pricing-table", + "footer" + ], + "homepage2": [ + "header", + "hero", + "team", + "features", + "gallery", + "call-to-action", + "testimonials", + "footer" + ], + "homepage3": [ + "header", + "hero", + "headings", + "features", + "gallery", + "call-to-action", + "faq", + "footer" + ], + "homepage4": [ + "header", + "hero", + "headings", + "features", + "gallery", + "call-to-action", + "blog", + "footer" + ], + "homepage5": [ + "header", + "hero", + "headings", + "features", + "gallery", + "call-to-action", + "about", + "footer" + ] + }, + "colorpalette": { + "palette1": { + "base": "#FF5733", + "contrast": "#FFFFFF", + "primary": "#2ECC71", + "tertiary": "#F1C40F", + "header_background": "#2E86C1", + "header_foreground": "#FFFFFF", + "header_tiles": "#FFC300", + "secondary_background": "#F39C12", + "secondary_foreground": "#FFFFFF" + }, + "palette2": { + "base": "#FF5733", + "contrast": "#FFFFFF", + "primary": "#3498DB", + "tertiary": "#F1C40F", + "header_background": "#2E86C1", + "header_foreground": "#FFFFFF", + "header_tiles": "#FFC300", + "secondary_background": "#F39C12", + "secondary_foreground": "#FFFFFF" + }, + "palette3": { + "base": "#FF5733", + "contrast": "#FFFFFF", + "primary": "#9B59B6", + "tertiary": "#F1C40F", + "header_background": "#2E86C1", + "header_foreground": "#FFFFFF", + "header_tiles": "#FFC300", + "secondary_background": "#F39C12", + "secondary_foreground": "#FFFFFF" + }, + "palette4": { + "base": "#FF5733", + "contrast": "#FFFFFF", + "primary": "#E74C3C", + "tertiary": "#F1C40F", + "header_background": "#2E86C1", + "header_foreground": "#FFFFFF", + "header_tiles": "#FFC300", + "secondary_background": "#F39C12", + "secondary_foreground": "#FFFFFF" + }, + "palette5": { + "base": "#FF5733", + "contrast": "#FFFFFF", + "primary": "#1ABC9C", + "tertiary": "#F1C40F", + "header_background": "#2E86C1", + "header_foreground": "#FFFFFF", + "header_tiles": "#FFC300", + "secondary_background": "#F39C12", + "secondary_foreground": "#FFFFFF" + } + }, + "sitemap": [ + { + "slug": "home", + "path": "/", + "title": "Gymmer - Home", + "keywords": [ + "Gymmer", + "Gym Beach", + "India", + "fitness", + "workout" + ] + }, + { + "slug": "about", + "path": "/about", + "title": "Gymmer - About", + "keywords": [ + "Gymmer", + "Gym Beach", + "India", + "studio", + "history" + ] + }, + { + "slug": "services", + "path": "/services", + "title": "Gymmer - Services", + "keywords": [ + "Gymmer", + "Gym Beach", + "India", + "classes", + "training" + ] + }, + { + "slug": "gallery", + "path": "/gallery", + "title": "Gymmer - Gallery", + "keywords": [ + "Gymmer", + "Gym Beach", + "India", + "photos", + "videos" + ] + }, + { + "slug": "contact", + "path": "/contact", + "title": "Gymmer - Contact", + "keywords": [ + "Gymmer", + "Gym Beach", + "India", + "location", + "contact" + ] + } + ], + "pluginrecommendation": { + "requiredPlugins": [ + { + "title": "Yoast SEO", + "description": "Yoast SEO is a comprehensive search engine optimization plugin for WordPress, which offers various features to optimize your site for maximum visibility in search engines.", + "slug": "wordpress-seo/wordpress-seo.php", + "download_url": "https://downloads.wordpress.org/plugin/wordpress-seo.zip", + "premium": false, + "requires": [] + }, + { + "title": "WooCommerce", + "description": "WooCommerce is a customizable, open-source eCommerce platform built on WordPress, allowing users to set up online stores with ease.", + "slug": "woocommerce/woocommerce.php", + "download_url": "https://downloads.wordpress.org/plugin/woocommerce.zip", + "premium": false, + "requires": [] + } + ], + "recommendedPlugins": [ + { + "title": "Jetpack", + "description": "Jetpack offers a suite of design, security, and marketing tools for WordPress sites, including real-time backups and easy-to-use performance enhancements.", + "slug": "jetpack/jetpack.php", + "download_url": "https://downloads.wordpress.org/plugin/jetpack.zip", + "premium": false, + "requires": [] + }, + { + "title": "WPForms Lite", + "description": "WPForms Lite is a drag-and-drop form builder for WordPress, allowing users to create contact forms, surveys, and more without any coding.", + "slug": "wpforms-lite/wpforms.php", + "download_url": "https://downloads.wordpress.org/plugin/wpforms-lite.zip", + "premium": false, + "requires": [] + } + ] + }, + "fontpair": [ + { + "aesthetics": "modern", + "font_heading": "Montserrat", + "font_content": "Roboto", + "spacing": 10, + "radius": 5 + }, + { + "aesthetics": "energetic", + "font_heading": "Bebas Neue", + "font_content": "Open Sans", + "spacing": 8, + "radius": 3 + }, + { + "aesthetics": "bold", + "font_heading": "Oswald", + "font_content": "Lato", + "spacing": 12, + "radius": 7 + }, + { + "aesthetics": "sleek", + "font_heading": "Raleway", + "font_content": "Nunito", + "spacing": 6, + "radius": 2 + }, + { + "aesthetics": "dynamic", + "font_heading": "Exo", + "font_content": "Poppins", + "spacing": 9, + "radius": 4 + } + ], + "keywords": { + "keywords": [ + "Gym studio", + "Gymmer", + "Gym Beach", + "India" + ] + } +} \ No newline at end of file diff --git a/src/OnboardingSPA/static/icons/sitegen/favorite-filled.svg b/src/OnboardingSPA/static/icons/sitegen/favorite-filled.svg new file mode 100644 index 000000000..bfa02dd88 --- /dev/null +++ b/src/OnboardingSPA/static/icons/sitegen/favorite-filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/OnboardingSPA/static/icons/sitegen/settings.svg b/src/OnboardingSPA/static/icons/sitegen/settings.svg new file mode 100644 index 000000000..af76ae43e --- /dev/null +++ b/src/OnboardingSPA/static/icons/sitegen/settings.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/OnboardingSPA/steps/SiteGen/Editor/Header/index.js b/src/OnboardingSPA/steps/SiteGen/Editor/Header/index.js index e8af98d14..6f55d84fe 100644 --- a/src/OnboardingSPA/steps/SiteGen/Editor/Header/index.js +++ b/src/OnboardingSPA/steps/SiteGen/Editor/Header/index.js @@ -1,64 +1,138 @@ import { Fill, Dropdown } from '@wordpress/components'; -import { HEADER_CENTER, HEADER_END, HEADER_SITEGEN, HEADER_START } from '../../../../../constants'; -import { Icon, chevronDown, home } from '@wordpress/icons'; +import { + HEADER_CENTER, + HEADER_END, + HEADER_SITEGEN, + HEADER_START, +} from '../../../../../constants'; +import { Icon, chevronDown, chevronRight, home } from '@wordpress/icons'; import { store as nfdOnboardingStore } from '../../../../store'; import { useSelect, useDispatch } from '@wordpress/data'; import { useEffect, useState } from '@wordpress/element'; +import { getRandom } from '../../../../data/sitegen/homepages/homepages'; const StepSiteGenEditorHeader = () => { - const [homepage, setHomepage] = useState(); + const [ homepage, setHomepage ] = useState(); - const { setCurrentOnboardingData } = useDispatch(nfdOnboardingStore); - const { currentData } = useSelect((select) => { - return { - currentData: select(nfdOnboardingStore).getCurrentOnboardingData(), - } - }) + const { setCurrentOnboardingData } = useDispatch( nfdOnboardingStore ); + const { currentData } = useSelect( ( select ) => { + return { + currentData: + select( nfdOnboardingStore ).getCurrentOnboardingData(), + }; + } ); - const handleFavorite = () => { + const handleFavorite = () => { homepage.favorite = ! homepage.favorite; - currentData.sitegen.homepages.data[homepage.slug] = homepage; + currentData.sitegen.homepages.data[ homepage.slug ] = homepage; setCurrentOnboardingData( currentData ); - } + }; - useEffect(() => { - if ( currentData.sitegen.homepages.active ) { + const handleRegenerate = () => { + const newPage = getRandom( { ...homepage } ); + setHomepage( newPage ); + currentData.sitegen.homepages.data[ newPage.slug ] = newPage; + currentData.sitegen.homepages.active = newPage; + setCurrentOnboardingData( currentData ); + }; - setHomepage(currentData.sitegen.homepages.active) - } - }, []) - return <> - -
- -
-
- -
-
- { - return <> -

-
-

{homepage.title}

- -
- + const generateChildThemes = () => {}; - }} - renderContent={() =>
Hello World
} - /> -
-
- - - -} + useEffect( () => { + if ( currentData?.sitegen?.homepages?.active ) { + setHomepage( currentData.sitegen.homepages.active ); + } + }, [ currentData ] ); + return ( + <> + +
+
handleRegenerate() } + > +
+
+ Regenerate +
+
+
+
+ + { homepage && ( +
+
+ { + return ( + <> +

+
+

+ { homepage.title } +

+ +
+ + ); + } } + renderContent={ () => ( +
+

+ Rename +

+

+ View All +

+
+ ) } + /> +
+ ) } +
+ +
+
+
+
+ Customize +
+
+
+
+ Save & Continue +
+ +
+
+
+ + ); +}; -export default StepSiteGenEditorHeader; \ No newline at end of file +export default StepSiteGenEditorHeader; diff --git a/src/OnboardingSPA/steps/SiteGen/Editor/Header/stylesheet.scss b/src/OnboardingSPA/steps/SiteGen/Editor/Header/stylesheet.scss index f80e46c55..c068666e5 100644 --- a/src/OnboardingSPA/steps/SiteGen/Editor/Header/stylesheet.scss +++ b/src/OnboardingSPA/steps/SiteGen/Editor/Header/stylesheet.scss @@ -1,4 +1,7 @@ .nfd-onboarding-header { + &--dark { + background-color: var(--nfd-onboarding-editor-header-background); + } &--sitegen{ &__editor { &__start { @@ -6,11 +9,9 @@ margin-left: 20px; height: 36px; color: var(--nfd-onboarding-primary); - background-color: var(--nfd-onboarding-preview-favorite-background); - border: none; - :hover { - cursor: pointer; - } + background-color: var(--nfd-onboarding-button-background); + border-radius: 8px; + cursor: pointer; &__icon { background-image: var(--sitegen-regenerate); width: 16px; @@ -35,13 +36,13 @@ &__favorite-icon { background-image: var(--sitegen-favorite); - height: 20px; + height: 21px; width: 20px; margin-right: 15px; cursor: pointer; &__fill { - background-color: var(--nfd-onboarding-favorite-fill); + background-image: var(--sitegen-favorite-filled); } } @@ -61,6 +62,56 @@ height: 20px; } } + + &__content { + &__rename, &__view-all { + height: 40px; + padding: 0px 9px 0px 9px; + width: 240px; + color: var(--nfd-onboarding-secondary); + } + + &__view-all { + border-top: 1px solid var(--nfd-onboarding-secondary); + } + } + } + } + &__end { + display: flex; + flex-direction: row; + &__customize-button { + display: flex; + flex-direction: row; + justify-content: space-evenly; + align-items: center; + cursor: pointer; + background-color: var(--nfd-onboarding-button-background); + color: var(--nfd-onboarding-primary); + padding: 0px 12px 0px 12px; + margin-right: 16px; + height: 36px; + border-radius: 8px; + + &__icon { + background-image: var(--sitegen-settings); + height: 16px; + width: 16px; + margin-right: 8px; + } + } + + &__save-button { + display: flex; + flex-direction: row; + justify-content: space-evenly; + align-items: center; + cursor: pointer; + background-color: var(--nfd-onboarding-primary); + color: var(--nfd-onboarding-secondary); + padding: 0px 12px 0px 12px; + height: 36px; + border-radius: 8px; } } } diff --git a/src/OnboardingSPA/steps/SiteGen/Editor/Sidebar/Patterns/index.js b/src/OnboardingSPA/steps/SiteGen/Editor/Sidebar/Patterns/index.js new file mode 100644 index 000000000..821ce88b4 --- /dev/null +++ b/src/OnboardingSPA/steps/SiteGen/Editor/Sidebar/Patterns/index.js @@ -0,0 +1,17 @@ +import { useDispatch } from '@wordpress/data'; + +import { useEffect } from '@wordpress/element'; + +import { store as nfdOnboardingStore } from '../../../../../store'; +import { SIDEBAR_SITEGEN_EDITOR_PATTERNS } from '../../../../../../constants'; + +const Patterns = () => { + const { setSidebarActiveView } = useDispatch( nfdOnboardingStore ) + + useEffect(() => { + setSidebarActiveView( SIDEBAR_SITEGEN_EDITOR_PATTERNS ); + }, []) + return
Hello World
+} + +export default Patterns; \ No newline at end of file diff --git a/src/OnboardingSPA/steps/SiteGen/Editor/index.js b/src/OnboardingSPA/steps/SiteGen/Editor/index.js index f4139ddcd..04d91cb2d 100644 --- a/src/OnboardingSPA/steps/SiteGen/Editor/index.js +++ b/src/OnboardingSPA/steps/SiteGen/Editor/index.js @@ -7,9 +7,15 @@ import { store as nfdOnboardingStore } from '../../../store'; import { HEADER_SITEGEN } from '../../../../constants'; import { LivePreview } from '../../../components/LivePreview'; +import { getGlobalStyles } from '../../../utils/api/themes'; + +import { cloneDeep } from 'lodash'; const StepSiteGenEditor = () => { - const [ pattern, setPattern ] = useState(); + const [ activeHomepage, setActiveHomepage ] = useState(); + const [ colorPalette, setColorPalette ] = useState(); + const [ globalStyles, setGlobalStyles ] = useState( [] ); + const [ reRender, setReRender ] = useState( false ); const { setIsHeaderEnabled, setSidebarActiveView, @@ -24,28 +30,54 @@ const StepSiteGenEditor = () => { }; } ); - useEffect( () => { + const loadData = async () => { setIsHeaderEnabled( true ); setSidebarActiveView( false ); setHeaderActiveView( HEADER_SITEGEN ); setDrawerActiveView( false ); const homepage = currentData.sitegen.homepages.active; - setPattern( homepage.content ); + setActiveHomepage( homepage ); + const globalStyles = await getGlobalStyles(); + setGlobalStyles( globalStyles.body ); + setColorPalette( homepage.color.palette ); + }; + + useEffect( () => { + loadData(); }, [] ); + + useEffect( () => { + if ( currentData?.sitegen?.homepages?.active ) { + setActiveHomepage( currentData.sitegen.homepages.active ); + setReRender( true ); + } + }, [ currentData ] ); + + const buildPreview = () => { + const newPreviewSettings = cloneDeep( globalStyles[ 0 ] ); + newPreviewSettings.settings.color.palette = + activeHomepage.color.palette; + return ( + + ); + }; return (
- { pattern && ( - - ) } + { activeHomepage && + colorPalette && + globalStyles && + reRender && + buildPreview() }
); diff --git a/src/OnboardingSPA/steps/SiteGen/Preview/index.js b/src/OnboardingSPA/steps/SiteGen/Preview/index.js index f0d6e51c4..0fdea5b0b 100644 --- a/src/OnboardingSPA/steps/SiteGen/Preview/index.js +++ b/src/OnboardingSPA/steps/SiteGen/Preview/index.js @@ -11,11 +11,20 @@ import { HEADER_SITEGEN } from '../../../../constants'; import LivePreviewSiteGenCard from '../../../components/LivePreview/SiteGenCard'; import getContents from './contents'; -import getHomepages from '../../../data/homepages/getHomepages'; +import { + getHomepages, + getRandom, +} from '../../../data/sitegen/homepages/homepages'; +import { getColorPalettes } from '../../../data/sitegen/sitemeta/siteMeta'; +import { getGlobalStyles } from '../../../utils/api/themes'; + +import { isEmpty, cloneDeep } from 'lodash'; +import Grid from '../../../components/Grid'; const SiteGenPreview = () => { const navigate = useNavigate(); const [ homepages, setHomepages ] = useState(); + const [ globalStyles, setGlobalStyles ] = useState( [] ); const { setIsHeaderEnabled, setSidebarActiveView, @@ -32,22 +41,42 @@ const SiteGenPreview = () => { }; } ); - useEffect( () => { + const loadData = async () => { setIsHeaderEnabled( true ); setSidebarActiveView( false ); setHeaderActiveView( HEADER_SITEGEN ); setDrawerActiveView( false ); + let homepagesObject = {}; + if ( isEmpty( currentData.sitegen.homepages.data ) ) { + const homepagesResponse = getHomepages(); + const colorsResponse = getColorPalettes(); + homepagesResponse.forEach( ( homepage, index ) => { + if ( ! homepage?.color ) { + const paletteKeys = Object.keys( colorsResponse ); + const paletteIndex = + paletteKeys[ index % paletteKeys.length ]; + homepage.color = { + slug: paletteIndex, + palette: colorsResponse[ paletteIndex ], + }; + } + } ); + currentData.sitegen.homepages.data = homepagesResponse; + setCurrentOnboardingData( currentData ); + homepagesResponse.forEach( ( homepage ) => { + homepagesObject[ homepage.slug ] = homepage; + } ); + } else { + homepagesObject = currentData.sitegen.homepages.data; + } + const globalStyles = await getGlobalStyles(); + setGlobalStyles( globalStyles.body ); - const homepagesResponse = getHomepages(); - currentData.sitegen.homepages.data = homepagesResponse; - setCurrentOnboardingData( currentData ); - - const homePagesObject = {}; + setHomepages( homepagesObject ); + }; - homepagesResponse.forEach( ( homepage ) => { - homePagesObject[ homepage.slug ] = homepage; - } ); - setHomepages( homePagesObject ); + useEffect( () => { + loadData(); }, [] ); const handleFavorite = ( slug ) => { @@ -69,8 +98,44 @@ const SiteGenPreview = () => { navigate( nextStep.path ); }; + const handleRegenerate = ( slug ) => { + if ( ! ( slug in homepages ) ) { + return false; + } + const page = { ...homepages }; + const newPage = getRandom( { ...page[ slug ] } ); + page[ newPage.slug ] = newPage; + setHomepages( page ); + currentData.sitegen.homepages.data = page; + setCurrentOnboardingData( currentData ); + }; + const content = getContents(); + const buildPreviews = () => { + return Object.keys( homepages ).map( ( homepage ) => { + const data = homepages[ homepage ]; + const newPreviewSettings = cloneDeep( globalStyles[ 0 ] ); + newPreviewSettings.settings.color.palette = data.color.palette; + return ( + + ); + } ); + }; + return ( {
- { homepages && - Object.keys( homepages ).map( ( homepage ) => { - const data = homepages[ homepage ]; - return ( - - ); - } ) } + { homepages && globalStyles && ( + { buildPreviews() } + ) }
diff --git a/src/OnboardingSPA/steps/SiteGen/Preview/stylesheet.scss b/src/OnboardingSPA/steps/SiteGen/Preview/stylesheet.scss index 2ea50d916..c93d9cc08 100644 --- a/src/OnboardingSPA/steps/SiteGen/Preview/stylesheet.scss +++ b/src/OnboardingSPA/steps/SiteGen/Preview/stylesheet.scss @@ -3,7 +3,8 @@ &__preview { display: flex; flex-direction: column; - justify-content: space-around; + justify-content: space-evenly; + align-items: center; &__context { text-align: center; @@ -29,7 +30,7 @@ align-items: center; justify-content: center; width: 100%; - height: 300px; + margin-top: 30px; } &__favorite-info { diff --git a/src/OnboardingSPA/steps/SiteGen/SiteLogo/index.js b/src/OnboardingSPA/steps/SiteGen/SiteLogo/index.js index 573de8f2d..e7a25d89f 100644 --- a/src/OnboardingSPA/steps/SiteGen/SiteLogo/index.js +++ b/src/OnboardingSPA/steps/SiteGen/SiteLogo/index.js @@ -1,6 +1,7 @@ import { useViewportMatch } from '@wordpress/compose'; import { useEffect, useState } from '@wordpress/element'; import { useSelect, useDispatch } from '@wordpress/data'; +import { store as coreStore } from '@wordpress/core-data'; import getContents from './contents'; import { HEADER_SITEGEN } from '../../../../constants'; @@ -22,6 +23,12 @@ const SiteGenSiteLogo = () => { }; } ); + const { editEntityRecord } = useDispatch( coreStore ); + + const { getEditedEntityRecord } = useSelect( ( select ) => { + return select( coreStore ); + }, [] ); + const { setFooterNavEnabled, setIsHeaderEnabled, @@ -49,23 +56,26 @@ const SiteGenSiteLogo = () => { setSidebarActiveView( false ); setHeaderActiveView( HEADER_SITEGEN ); setDrawerActiveView( false ); - if ( currentData.sitegen.siteLogo?.id !== 0 ) { - return setSiteLogo( currentData.sitegen.siteLogo ); + if ( currentData.data.siteLogo?.id !== 0 ) { + return setSiteLogo( currentData.data.siteLogo ); } setFooterNavEnabled( false ); + getEditedEntityRecord( 'root', 'site' ); }, [] ); - useEffect( () => { - if ( undefined !== siteLogo ) { - const currentDataCopy = { ...currentData }; - currentDataCopy.sitegen.siteLogo.id = siteLogo.id; - currentDataCopy.sitegen.siteLogo.url = siteLogo.url; - currentDataCopy.sitegen.siteLogo.fileName = siteLogo.fileName; - currentDataCopy.sitegen.siteLogo.fileSize = siteLogo.fileSize; - setCurrentOnboardingData( currentDataCopy ); - setFooterNavEnabled( siteLogo.id !== 0 ); - } - }, [ siteLogo ] ); + const handleSiteLogo = ( siteLogo ) => { + const currentDataCopy = { ...currentData }; + currentDataCopy.data.siteLogo.id = siteLogo.id; + currentDataCopy.data.siteLogo.url = siteLogo.url; + currentDataCopy.data.siteLogo.fileName = siteLogo.fileName; + currentDataCopy.data.siteLogo.fileSize = siteLogo.fileSize; + setCurrentOnboardingData( currentDataCopy ); + setFooterNavEnabled( siteLogo.id !== 0 ); + editEntityRecord( 'root', 'site', undefined, { + site_logo: siteLogo.id, + } ); + setSiteLogo( siteLogo ); + }; const content = getContents(); return ( @@ -77,7 +87,7 @@ const SiteGenSiteLogo = () => {