├── .nvmrc ├── .github ├── CODEOWNERS ├── workflows │ ├── i18n-crowdin-upload.yml │ ├── i18n-crowdin-download.yml │ ├── auto-translate.yml │ ├── newfold-prep-release.yml │ ├── satis-update.yml │ ├── brand-plugin-test.yml │ ├── lint-check-php.yml │ └── lint-check-spa.yml └── dependabot.yml ├── src ├── Brands │ ├── crazy-domains │ │ ├── icon-empty.svg │ │ ├── wp-admin.png │ │ ├── full-service.png │ │ ├── icon.svg │ │ └── step-loader-logo.svg │ ├── bluehost │ │ ├── bluesky.png │ │ ├── wp-admin.png │ │ ├── step-interstitial.png │ │ ├── dark.svg │ │ ├── icon.svg │ │ └── logo.svg │ ├── wordpress │ │ ├── wp-admin.png │ │ ├── full-service.png │ │ ├── icon.svg │ │ ├── dark.svg │ │ ├── step-loader-logo.svg │ │ └── dark-other.svg │ ├── newfold │ │ └── icon.svg │ ├── webcom │ │ ├── icon.svg │ │ └── dark.svg │ └── hostgator │ │ ├── dark.svg │ │ └── icon.svg ├── app │ ├── components │ │ ├── Orb │ │ │ ├── index.js │ │ │ └── Orb.js │ │ ├── Step │ │ │ ├── index.js │ │ │ └── Step.js │ │ ├── AppBody │ │ │ ├── index.js │ │ │ └── AppBody.js │ │ ├── Header │ │ │ ├── index.js │ │ │ └── Header.js │ │ ├── Iframe │ │ │ ├── index.js │ │ │ └── Iframe.js │ │ ├── Motion │ │ │ ├── index.js │ │ │ └── Motion.js │ │ ├── Navigate │ │ │ ├── index.js │ │ │ └── Navigate.js │ │ ├── ActionCard │ │ │ ├── index.js │ │ │ └── ActionCard.js │ │ ├── BackButton │ │ │ ├── index.js │ │ │ └── BackButton.js │ │ ├── BrandLoader │ │ │ ├── index.js │ │ │ ├── BrandLoader.scss │ │ │ └── BrandLoader.js │ │ ├── AnimateRoutes │ │ │ ├── index.js │ │ │ └── AnimateRoutes.js │ │ ├── SiteGenPreviewCard │ │ │ └── index.js │ │ ├── ErrorBoundaryFallback │ │ │ ├── index.js │ │ │ ├── nfd-err-boundary.png │ │ │ └── ErrorBoundaryFallback.js │ │ ├── InteractionBlockingOverlay │ │ │ ├── index.js │ │ │ └── InteractionBlockingOverlay.js │ │ └── index.js │ ├── steps │ │ ├── Fork │ │ │ ├── index.js │ │ │ ├── MigrationCard.js │ │ │ └── SiteCreatorCard.js │ │ ├── Migration │ │ │ └── index.js │ │ ├── Blueprints │ │ │ └── index.js │ │ ├── Previews │ │ │ └── index.js │ │ ├── Logo │ │ │ ├── index.js │ │ │ └── LogoStep.js │ │ ├── Generating │ │ │ └── index.js │ │ ├── BlueprintCanvas │ │ │ ├── index.js │ │ │ ├── BlueprintCanvasStep.js │ │ │ └── Preview.js │ │ ├── Canvas │ │ │ ├── index.js │ │ │ └── CanvasStep.js │ │ ├── Intake │ │ │ ├── index.js │ │ │ ├── SiteTitleInput.js │ │ │ ├── calculatePromptStrength.js │ │ │ ├── PromptInput.js │ │ │ └── SiteTypeSelector.js │ │ └── index.js │ ├── utils │ │ ├── blueprints │ │ │ ├── index.js │ │ │ └── fetchBlueprints.js │ │ ├── api │ │ │ ├── index.js │ │ │ ├── migration.js │ │ │ └── wp.js │ │ ├── helpers │ │ │ ├── index.js │ │ │ ├── isCypress.js │ │ │ └── resolve.js │ │ ├── sitegen │ │ │ ├── index.js │ │ │ ├── generateSiteNavigationMenu.js │ │ │ ├── generateSite.js │ │ │ ├── generateSitePages.js │ │ │ └── generateHomePages.js │ │ ├── hooks │ │ │ ├── index.js │ │ │ ├── useAnimateRouteDirection.js │ │ │ └── useGlobalStyles.js │ │ └── analytics │ │ │ └── hiive │ │ │ ├── OnboardingEvent.js │ │ │ └── index.js │ ├── assets │ │ ├── nfd-migration.png │ │ ├── nfd-missing-resource.png │ │ └── ai-sitegen-icon.svg │ ├── data │ │ └── store │ │ │ ├── reducer.js │ │ │ ├── actions.js │ │ │ ├── selectors.js │ │ │ └── index.js │ ├── styles │ │ ├── app.scss │ │ ├── _wordpress.scss │ │ ├── _utilities.scss │ │ ├── _interface.scss │ │ └── tailwind.css │ └── index.js ├── DesignStudio │ ├── utils │ │ ├── constants.js │ │ ├── text.js │ │ ├── editor-utils.js │ │ ├── url-utils.js │ │ ├── simple-cache.js │ │ ├── design-api.js │ │ └── styles-utils.js │ ├── onboarding-design-studio.js │ ├── hooks │ │ ├── useEditorControls.js │ │ ├── useColorPaletteSelection.js │ │ ├── useColorPalettePagination.js │ │ ├── useColorSettings.js │ │ ├── useTypographyUpdate.js │ │ └── useLogoManagement.js │ └── components │ │ ├── ScreenHeader │ │ ├── NavigationButton.jsx │ │ └── index.jsx │ │ ├── Typography │ │ ├── FontPairings.jsx │ │ └── PreviewItem.jsx │ │ ├── Colors │ │ ├── ColorPalettePagination.jsx │ │ ├── ColorPaletteItem.jsx │ │ └── ColorPalette.jsx │ │ ├── Logo │ │ ├── LogoUploader.jsx │ │ └── LogoPreview.jsx │ │ └── Screens │ │ ├── ScreenRoot.jsx │ │ ├── ScreenTypography.jsx │ │ ├── ScreenColors.jsx │ │ └── ScreenLogo.jsx ├── Scripts │ ├── sitegen-theme-marker │ │ ├── sitegen-theme-marker.css │ │ └── sitegen-theme-marker.js │ └── onboarding-restart-button │ │ └── onboarding-restart-button.css └── webpack-public-path.js ├── languages ├── wp-module-onboarding-de_DE.mo ├── wp-module-onboarding-en_AU.mo ├── wp-module-onboarding-en_GB.mo ├── wp-module-onboarding-es_ES.mo ├── wp-module-onboarding-es_MX.mo ├── wp-module-onboarding-fr_FR.mo ├── wp-module-onboarding-it_IT.mo ├── wp-module-onboarding-nl_NL.mo └── wp-module-onboarding-pt_BR.mo ├── .gitignore ├── postcss.config.js ├── .gitattributes ├── jsconfig.json ├── includes ├── WP_CLI.php ├── Mustache │ ├── Templates │ │ └── themeStylesheet.mustache │ └── Mustache.php ├── Services │ ├── LanguageService.php │ ├── I18nService.php │ ├── SettingsService.php │ ├── ReduxStateService.php │ └── ThemeService.php ├── RestApi │ ├── BaseHiiveController.php │ ├── SiteClassificationController.php │ ├── LanguagesController.php │ ├── Themes │ │ ├── ThemeInstallerController.php │ │ ├── ThemeColorsController.php │ │ └── ThemeFontsController.php │ ├── GlobalStylesController.php │ ├── PreviewsController.php │ ├── RestApi.php │ └── SiteImagesController.php ├── Permissions.php ├── WP_Config.php ├── Types │ └── SiteClassification.php ├── Compatibility │ ├── Status.php │ └── Scan.php ├── Tasks │ └── ImageSideloadTask.php ├── Models │ └── Theme.php ├── Application.php └── ExternalRedirectInterceptor.php ├── .editorconfig ├── phpcs.xml ├── .prettierrc.js ├── cypress.json ├── crowdin.yml ├── phpunit.xml ├── webpack.config.js ├── tailwind.config.js └── .eslintrc.js /.nvmrc: -------------------------------------------------------------------------------- 1 | v16 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/Brands/crazy-domains/icon-empty.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/components/Orb/index.js: -------------------------------------------------------------------------------- 1 | export { default as Orb } from './Orb'; 2 | -------------------------------------------------------------------------------- /src/app/components/Step/index.js: -------------------------------------------------------------------------------- 1 | export { default as Step } from './Step'; 2 | -------------------------------------------------------------------------------- /src/app/steps/Fork/index.js: -------------------------------------------------------------------------------- 1 | export { default as ForkStep } from './ForkStep'; 2 | -------------------------------------------------------------------------------- /src/app/components/AppBody/index.js: -------------------------------------------------------------------------------- 1 | export { default as AppBody } from './AppBody'; 2 | -------------------------------------------------------------------------------- /src/app/components/Header/index.js: -------------------------------------------------------------------------------- 1 | export { default as Header } from './Header'; 2 | -------------------------------------------------------------------------------- /src/app/components/Iframe/index.js: -------------------------------------------------------------------------------- 1 | export { default as Iframe } from './Iframe'; 2 | -------------------------------------------------------------------------------- /src/app/components/Motion/index.js: -------------------------------------------------------------------------------- 1 | export { default as Motion } from './Motion'; 2 | -------------------------------------------------------------------------------- /src/app/components/Navigate/index.js: -------------------------------------------------------------------------------- 1 | export { default as Navigate } from './Navigate'; 2 | -------------------------------------------------------------------------------- /src/app/components/ActionCard/index.js: -------------------------------------------------------------------------------- 1 | export { default as ActionCard } from './ActionCard'; 2 | -------------------------------------------------------------------------------- /src/app/steps/Migration/index.js: -------------------------------------------------------------------------------- 1 | export { default as MigrationStep } from './MigrationStep'; 2 | -------------------------------------------------------------------------------- /src/app/components/BackButton/index.js: -------------------------------------------------------------------------------- 1 | export { default as BackButton } from './BackButton'; 2 | 3 | -------------------------------------------------------------------------------- /src/app/components/BrandLoader/index.js: -------------------------------------------------------------------------------- 1 | export { default as BrandLoader } from './BrandLoader'; 2 | -------------------------------------------------------------------------------- /src/app/steps/Blueprints/index.js: -------------------------------------------------------------------------------- 1 | export { default as BlueprintsStep } from './BlueprintsStep'; 2 | -------------------------------------------------------------------------------- /src/app/utils/blueprints/index.js: -------------------------------------------------------------------------------- 1 | export { default as fetchBlueprints } from './fetchBlueprints'; 2 | -------------------------------------------------------------------------------- /src/app/components/AnimateRoutes/index.js: -------------------------------------------------------------------------------- 1 | export { default as AnimateRoutes } from './AnimateRoutes'; 2 | -------------------------------------------------------------------------------- /src/app/components/SiteGenPreviewCard/index.js: -------------------------------------------------------------------------------- 1 | export { default as SiteGenPreviewCard } from './SiteGenPreviewCard'; 2 | -------------------------------------------------------------------------------- /src/app/utils/api/index.js: -------------------------------------------------------------------------------- 1 | export * from './migration'; 2 | export * from './onboarding'; 3 | export * from './wp'; 4 | -------------------------------------------------------------------------------- /src/Brands/bluehost/bluesky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/src/Brands/bluehost/bluesky.png -------------------------------------------------------------------------------- /src/Brands/bluehost/wp-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/src/Brands/bluehost/wp-admin.png -------------------------------------------------------------------------------- /src/app/assets/nfd-migration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/src/app/assets/nfd-migration.png -------------------------------------------------------------------------------- /src/app/components/ErrorBoundaryFallback/index.js: -------------------------------------------------------------------------------- 1 | export { default as ErrorBoundaryFallback } from './ErrorBoundaryFallback'; 2 | -------------------------------------------------------------------------------- /src/Brands/wordpress/wp-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/src/Brands/wordpress/wp-admin.png -------------------------------------------------------------------------------- /src/app/utils/helpers/index.js: -------------------------------------------------------------------------------- 1 | export { default as isCypress } from './isCypress'; 2 | export { default as resolve } from './resolve'; 3 | -------------------------------------------------------------------------------- /src/Brands/crazy-domains/wp-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/src/Brands/crazy-domains/wp-admin.png -------------------------------------------------------------------------------- /src/Brands/wordpress/full-service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/src/Brands/wordpress/full-service.png -------------------------------------------------------------------------------- /languages/wp-module-onboarding-de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/languages/wp-module-onboarding-de_DE.mo -------------------------------------------------------------------------------- /languages/wp-module-onboarding-en_AU.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/languages/wp-module-onboarding-en_AU.mo -------------------------------------------------------------------------------- /languages/wp-module-onboarding-en_GB.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/languages/wp-module-onboarding-en_GB.mo -------------------------------------------------------------------------------- /languages/wp-module-onboarding-es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/languages/wp-module-onboarding-es_ES.mo -------------------------------------------------------------------------------- /languages/wp-module-onboarding-es_MX.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/languages/wp-module-onboarding-es_MX.mo -------------------------------------------------------------------------------- /languages/wp-module-onboarding-fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/languages/wp-module-onboarding-fr_FR.mo -------------------------------------------------------------------------------- /languages/wp-module-onboarding-it_IT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/languages/wp-module-onboarding-it_IT.mo -------------------------------------------------------------------------------- /languages/wp-module-onboarding-nl_NL.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/languages/wp-module-onboarding-nl_NL.mo -------------------------------------------------------------------------------- /languages/wp-module-onboarding-pt_BR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/languages/wp-module-onboarding-pt_BR.mo -------------------------------------------------------------------------------- /src/app/assets/nfd-missing-resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/src/app/assets/nfd-missing-resource.png -------------------------------------------------------------------------------- /src/app/components/InteractionBlockingOverlay/index.js: -------------------------------------------------------------------------------- 1 | export { default as InteractionBlockingOverlay } from './InteractionBlockingOverlay'; 2 | -------------------------------------------------------------------------------- /src/app/steps/Previews/index.js: -------------------------------------------------------------------------------- 1 | export { default as Preview } from './Preview'; 2 | export { default as PreviewsStep } from './PreviewsStep'; 3 | -------------------------------------------------------------------------------- /src/Brands/bluehost/step-interstitial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/src/Brands/bluehost/step-interstitial.png -------------------------------------------------------------------------------- /src/Brands/crazy-domains/full-service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/src/Brands/crazy-domains/full-service.png -------------------------------------------------------------------------------- /src/app/steps/Logo/index.js: -------------------------------------------------------------------------------- 1 | export { default as LogoStep } from './LogoStep'; 2 | export { default as LogoUploadInput } from './LogoUploadInput'; 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode 3 | .env 4 | /node_modules 5 | /tests/_output 6 | /tests/_support/_generated 7 | /wordpress 8 | /wp-content 9 | node_modules 10 | vendor -------------------------------------------------------------------------------- /src/app/steps/Generating/index.js: -------------------------------------------------------------------------------- 1 | export { default as GeneratingStep } from './GeneratingStep'; 2 | export { default as ExperienceOptions } from './ExperienceOptions'; 3 | 4 | -------------------------------------------------------------------------------- /src/app/components/ErrorBoundaryFallback/nfd-err-boundary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/newfold-labs/wp-module-onboarding/HEAD/src/app/components/ErrorBoundaryFallback/nfd-err-boundary.png -------------------------------------------------------------------------------- /src/app/components/BrandLoader/BrandLoader.scss: -------------------------------------------------------------------------------- 1 | .brand-loader { 2 | display: inline-block; 3 | background-size: contain; 4 | background-repeat: no-repeat; 5 | background-position: center; 6 | } 7 | -------------------------------------------------------------------------------- /src/app/utils/helpers/isCypress.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checks if the code is running in a Cypress test environment. 3 | */ 4 | function isCypress() { 5 | return !! window.Cypress; 6 | } 7 | 8 | export default isCypress; 9 | -------------------------------------------------------------------------------- /src/app/steps/BlueprintCanvas/index.js: -------------------------------------------------------------------------------- 1 | export { default as BlueprintCanvasStep } from './BlueprintCanvasStep'; 2 | export { default as HeaderActions } from './HeaderActions'; 3 | export { default as Preview } from './Preview'; 4 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require( 'postcss-import' ), 4 | require( 'tailwindcss/nesting' ), 5 | require( 'tailwindcss' ), 6 | ...require( '@wordpress/postcss-plugins-preset' ), 7 | ], 8 | }; 9 | -------------------------------------------------------------------------------- /src/app/steps/Canvas/index.js: -------------------------------------------------------------------------------- 1 | export { default as CanvasStep } from './CanvasStep'; 2 | export { default as HeaderActions } from './HeaderActions'; 3 | export { default as Preview } from './Preview'; 4 | export { default as Sidebar } from './Sidebar'; 5 | 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /.env.testing export-ignore 2 | /.wp-env.json export-ignore 3 | /codeception.dist.yml export-ignore 4 | /package-lock.json export-ignore 5 | /package.json export-ignore 6 | /tests export-ignore 7 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "./", 4 | "moduleResolution": "node", 5 | "module": "commonjs", 6 | "target": "es6", 7 | "paths": { 8 | "@/*": ["src/app/*"], 9 | } 10 | }, 11 | "include": ["src/**/*"], 12 | "exclude": ["node_modules", "dist", "build"] 13 | } -------------------------------------------------------------------------------- /includes/WP_CLI.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/DesignStudio/utils/constants.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Constants for query parameters 3 | */ 4 | export const QUERY_PARAMS = { 5 | REFERRER: 'referrer', 6 | CANVAS_MODE: 'canvas', 7 | }; 8 | 9 | /** 10 | * Valid referrer sources for onboarding integration 11 | */ 12 | export const VALID_REFERRERS = [ 'nfd-onboarding', 'nfd-plugin' ]; 13 | -------------------------------------------------------------------------------- /src/app/steps/Intake/index.js: -------------------------------------------------------------------------------- 1 | export { default as IntakeStep } from './IntakeStep'; 2 | export { default as SiteTitleInput } from './SiteTitleInput'; 3 | export { default as PromptInput } from './PromptInput'; 4 | export { default as calculatePromptStrength } from './calculatePromptStrength'; 5 | export { default as SiteTypeSelector } from './SiteTypeSelector'; 6 | -------------------------------------------------------------------------------- /includes/Mustache/Templates/themeStylesheet.mustache: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: {{ site_title }} 3 | Author: {{ site_title }} & {{ brand_name }} 4 | Author URI: {{ site_url }} 5 | Description: A Custom WordPress Theme built for {{ site_title }} by {{ brand_name }} 6 | Version: 1.0.0 7 | Template: {{ parent_theme_slug }} 8 | Text Domain: {{ child_theme_slug }} 9 | */ 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | # WordPress Coding Standards 5 | # https://make.wordpress.org/core/handbook/coding-standards/ 6 | 7 | root = true 8 | 9 | [*] 10 | charset = utf-8 11 | end_of_line = lf 12 | insert_final_newline = true 13 | trim_trailing_whitespace = true 14 | indent_style = tab -------------------------------------------------------------------------------- /src/app/utils/sitegen/index.js: -------------------------------------------------------------------------------- 1 | export { default as generateSite } from './generateSite'; 2 | export { default as generateSiteMeta } from './generateSiteMeta'; 3 | export { default as generateHomePages } from './generateHomePages'; 4 | export { default as generateSitePages } from './generateSitePages'; 5 | export { default as generateSiteNavigationMenu } from './generateSiteNavigationMenu'; 6 | -------------------------------------------------------------------------------- /src/app/data/store/reducer.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from '@wordpress/data'; 2 | import { runtime } from './slices/runtime'; 3 | import { input } from './slices/input'; 4 | import { sitegen } from './slices/sitegen'; 5 | import { blueprints } from './slices/blueprints'; 6 | 7 | export default combineReducers( { 8 | runtime, 9 | input, 10 | sitegen, 11 | blueprints, 12 | } ); 13 | -------------------------------------------------------------------------------- /src/app/utils/hooks/index.js: -------------------------------------------------------------------------------- 1 | export { default as useAnimateRouteDirection } from './useAnimateRouteDirection'; 2 | export { default as useGlobalStyles } from './useGlobalStyles'; 3 | export { default as useTemplateParts } from './useTemplateParts'; 4 | export { default as usePublishSite } from './usePublishSite'; 5 | export { default as usePublishBlueprintSite } from './usePublishBlueprintSite'; 6 | -------------------------------------------------------------------------------- /src/app/styles/app.scss: -------------------------------------------------------------------------------- 1 | @import "wordpress"; 2 | @import "interface"; 3 | /* @import "icons"; */ 4 | /* @import "branding"; */ 5 | @import "utilities"; 6 | 7 | .nfd-onboarding-container { 8 | display: flex; 9 | background-color: var(--nfd-onboarding-canvas); 10 | position: fixed; 11 | bottom: 0; 12 | left: 0; 13 | right: 0; 14 | top: 0; 15 | overflow-y: auto; 16 | overflow-x: hidden; 17 | } 18 | -------------------------------------------------------------------------------- /.github/workflows/i18n-crowdin-upload.yml: -------------------------------------------------------------------------------- 1 | name: Crowdin Upload Action 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | call-crowdin-upload-workflow: 8 | uses: newfold-labs/workflows/.github/workflows/i18n-crowdin-upload.yml@main 9 | with: 10 | CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }} 11 | secrets: 12 | CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} 13 | -------------------------------------------------------------------------------- /phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Brands/bluehost/dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Brands/bluehost/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | const wordpressPrettierConfig = require( '@wordpress/prettier-config' ); 2 | 3 | module.exports = { 4 | ...wordpressPrettierConfig, 5 | printWidth: 100, // Default print width for all files. Override if needed. 6 | singleQuote: true, 7 | tabWidth: 2, 8 | trailingComma: 'es5', 9 | overrides: [ 10 | { 11 | files: '*.css', 12 | options: { 13 | printWidth: 160, 14 | }, 15 | }, 16 | ], 17 | }; 18 | -------------------------------------------------------------------------------- /src/app/assets/ai-sitegen-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/DesignStudio/utils/text.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Capitalizes the first letter of each word in a string 3 | * 4 | * @param {string} str String to capitalize 5 | * @return {string} Capitalized string 6 | */ 7 | export const ucwords = ( str ) => { 8 | if ( ! str ) { 9 | return ''; 10 | } 11 | 12 | return str 13 | .split( ' ' ) 14 | .map( ( word ) => word.charAt( 0 ).toUpperCase() + word.slice( 1 ).toLowerCase() ) 15 | .join( ' ' ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/DesignStudio/onboarding-design-studio.js: -------------------------------------------------------------------------------- 1 | import domReady from '@wordpress/dom-ready'; 2 | import { registerPlugin } from '@wordpress/plugins'; 3 | import DesignStudio from './components/DesignStudio'; 4 | 5 | // Register the plugin when DOM is ready 6 | domReady( () => { 7 | registerPlugin( 'nfd-design-studio', { 8 | render: DesignStudio, 9 | } ); 10 | } ); 11 | 12 | // Export components for potential reuse 13 | export { DesignStudio }; 14 | -------------------------------------------------------------------------------- /src/app/data/store/actions.js: -------------------------------------------------------------------------------- 1 | import { actions as runtimeActions } from './slices/runtime'; 2 | import { actions as inputActions } from './slices/input'; 3 | import { actions as sitegenActions } from './slices/sitegen'; 4 | import { actions as blueprintsActions } from './slices/blueprints'; 5 | 6 | export const actions = { 7 | ...runtimeActions, 8 | ...inputActions, 9 | ...sitegenActions, 10 | ...blueprintsActions, 11 | }; 12 | 13 | export default actions; 14 | -------------------------------------------------------------------------------- /src/app/utils/helpers/resolve.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Resolves a promise and returns the body and error. 3 | * 4 | * @param {Promise} promise 5 | * @return {Object} resolved 6 | */ 7 | async function resolve( promise ) { 8 | const resolved = { 9 | body: null, 10 | error: null, 11 | }; 12 | 13 | try { 14 | resolved.body = await promise; 15 | } catch ( error ) { 16 | resolved.error = error; 17 | } 18 | 19 | return resolved; 20 | } 21 | 22 | export default resolve; 23 | -------------------------------------------------------------------------------- /src/app/data/store/selectors.js: -------------------------------------------------------------------------------- 1 | import { selectors as runtimeSelectors } from './slices/runtime'; 2 | import { selectors as inputSelectors } from './slices/input'; 3 | import { selectors as sitegenSelectors } from './slices/sitegen'; 4 | import { selectors as blueprintsSelectors } from './slices/blueprints'; 5 | 6 | const selectors = { 7 | ...runtimeSelectors, 8 | ...inputSelectors, 9 | ...sitegenSelectors, 10 | ...blueprintsSelectors, 11 | }; 12 | 13 | export default selectors; 14 | -------------------------------------------------------------------------------- /src/app/utils/sitegen/generateSiteNavigationMenu.js: -------------------------------------------------------------------------------- 1 | import { setupSiteNavigationMenu } from '@/utils/api'; 2 | 3 | /** 4 | * Generate the site navigation menu. 5 | * 6 | * @return {boolean} True if successful, false otherwise. 7 | */ 8 | const generateSiteNavigationMenu = async () => { 9 | const response = await setupSiteNavigationMenu(); 10 | if ( response.error ) { 11 | return false; 12 | } 13 | 14 | return true; 15 | }; 16 | 17 | export default generateSiteNavigationMenu; 18 | -------------------------------------------------------------------------------- /src/app/styles/_wordpress.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Initialize all WordPress Sass 3 | * ----------------------------- 4 | * @import @wordpress/base-styles 5 | * @import @wordpress/interface 6 | */ 7 | 8 | @import '@wordpress/base-styles/breakpoints'; 9 | @import '@wordpress/base-styles/colors'; 10 | @import '@wordpress/base-styles/mixins'; 11 | @import '@wordpress/base-styles/variables'; 12 | @import '@wordpress/base-styles/z-index'; 13 | 14 | @import '@wordpress/interface/src/style.scss'; 15 | -------------------------------------------------------------------------------- /src/Scripts/sitegen-theme-marker/sitegen-theme-marker.css: -------------------------------------------------------------------------------- 1 | .theme-name { 2 | display: flex; 3 | flex-direction: row; 4 | align-items: center; 5 | 6 | svg { 7 | margin-left: 8px; 8 | } 9 | } 10 | 11 | .nfd-onboarding-sitegen-theme-marker-filled { 12 | fill: #1d2327; 13 | } 14 | 15 | .theme.active { 16 | 17 | .nfd-onboarding-sitegen-theme-marker-filled { 18 | fill: none; 19 | } 20 | } 21 | 22 | .nfd-onboarding-sitegen-theme-marker-title { 23 | margin-left: 8px; 24 | width: 120px; 25 | text-overflow: ellipsis; 26 | overflow: hidden; 27 | } 28 | -------------------------------------------------------------------------------- /src/app/steps/Intake/SiteTitleInput.js: -------------------------------------------------------------------------------- 1 | import { TextField } from '@newfold/ui-component-library'; 2 | 3 | const SiteTitleInput = ( { value, onChange } ) => { 4 | return ( 5 |
6 | onChange( e.target.value ) } 11 | value={ value } 12 | /> 13 |
14 | ); 15 | }; 16 | 17 | export default SiteTitleInput; 18 | -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "http://localhost:8880", 3 | "env": { 4 | "wpUsername": "admin", 5 | "wpPassword": "password" 6 | }, 7 | "fixturesFolder": "tests/cypress/fixtures", 8 | "integrationFolder": "tests/cypress/integration", 9 | "pluginsFile": "tests/cypress/plugins/index.js", 10 | "screenshotsFolder": "tests/cypress/screenshots", 11 | "supportFile": "tests/cypress/support/index.js", 12 | "video": false, 13 | "videosFolder": "tests/cypress/videos", 14 | "videoUploadOnPasses": false, 15 | "chromeWebSecurity": false 16 | } 17 | -------------------------------------------------------------------------------- /src/app/styles/_utilities.scss: -------------------------------------------------------------------------------- 1 | .is-centered { 2 | display: flex; 3 | place-content: center; 4 | place-items: center; 5 | } 6 | 7 | .is-vertically-centered { 8 | display: flex; 9 | align-items: center; 10 | justify-content: space-evenly; 11 | flex-direction: column; 12 | } 13 | 14 | .is-bg-primary { 15 | background-color: var(--nfd-onboarding-primary); 16 | color: var(--nfd-onboarding-base); 17 | } 18 | 19 | .center { 20 | text-align: center; 21 | } 22 | 23 | input::placeholder { 24 | font-size: 0.75rem; 25 | color: var(--nfd-onboarding-light-gray-4); 26 | } 27 | -------------------------------------------------------------------------------- /src/webpack-public-path.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Set webpack's public path (default is root directory of URI resource) to Plugin's build directory. 3 | * This helps lazy-loading work correctly. This value is set in `/includes/Data.php` in Data::runtime(). 4 | */ 5 | import { runtimeDataObjectIsMounted } from './onboarding'; 6 | 7 | const webpackPublicPath = () => { 8 | if ( runtimeDataObjectIsMounted() ) { 9 | // eslint-disable-next-line camelcase, no-undef 10 | __webpack_public_path__ = window.nfdOnboarding.runtime.buildUrl; 11 | } 12 | }; 13 | 14 | export default webpackPublicPath; 15 | -------------------------------------------------------------------------------- /src/app/utils/api/migration.js: -------------------------------------------------------------------------------- 1 | import apiFetch from '@wordpress/api-fetch'; 2 | import { wpRestURL } from '@/data/constants'; 3 | import { resolve } from '@/utils/helpers'; 4 | 5 | export const migrationRestRoute = 'newfold-migration/v1'; 6 | export const migrateRestBase = `${ wpRestURL }/${ migrationRestRoute }`; 7 | 8 | export const migrateRestURL = ( api ) => { 9 | return `${ migrateRestBase }/${ api }`; 10 | }; 11 | 12 | export async function getSiteMigrateUrl() { 13 | return await resolve( 14 | apiFetch( { 15 | url: migrateRestURL( 'migrate/connect' ), 16 | } ).then() 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /crowdin.yml: -------------------------------------------------------------------------------- 1 | "project_id_env": "CROWDIN_PROJECT_ID" 2 | "api_token_env": "CROWDIN_PERSONAL_TOKEN" 3 | "base_path": "." 4 | 5 | "preserve_hierarchy": true 6 | 7 | "files": [ 8 | { 9 | "source": "/languages/wp-module-onboarding.pot", 10 | "translation": "/languages/wp-module-onboarding-%locale%.po", 11 | "languages_mapping": { 12 | "locale": { 13 | "de": "de_DE", 14 | "en-AU": "en_AU", 15 | "en-GB": "en_GB", 16 | "es-ES": "es_ES", 17 | "fr": "fr_FR", 18 | "it": "it_IT", 19 | "nl": "nl_NL" 20 | } 21 | } 22 | } 23 | ] -------------------------------------------------------------------------------- /src/app/utils/analytics/hiive/OnboardingEvent.js: -------------------------------------------------------------------------------- 1 | import { HiiveEvent } from '@newfold/js-utility-ui-analytics'; 2 | import { getLabelKeyFromAction } from '.'; 3 | import { CATEGORY } from './constants'; 4 | 5 | export class OnboardingEvent extends HiiveEvent { 6 | constructor( action, value, additionalData, page, category = CATEGORY ) { 7 | const labelKey = getLabelKeyFromAction( action ); 8 | super( 9 | category, 10 | action, 11 | { 12 | label_key: labelKey, 13 | [ labelKey ]: value, 14 | ...additionalData, 15 | page: page ? page : window.location.href, 16 | }, 17 | category 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/app/components/AnimateRoutes/AnimateRoutes.js: -------------------------------------------------------------------------------- 1 | import { AnimatePresence } from 'motion/react'; 2 | import { useAnimateRouteDirection } from '@/utils/hooks'; 3 | 4 | /** 5 | * Wraps children components with animation context and handles route transition animations. 6 | * @param {ReactNode} children 7 | * @return {JSX.Element} Animated route wrapper component 8 | */ 9 | const AnimateRoutes = ( { children } ) => { 10 | return ( 11 | 16 | { children } 17 | 18 | ); 19 | }; 20 | 21 | export default AnimateRoutes; 22 | -------------------------------------------------------------------------------- /.github/workflows/i18n-crowdin-download.yml: -------------------------------------------------------------------------------- 1 | name: Crowdin Download Action 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | base_branch: 7 | description: 'Base branch for the pull request' 8 | required: false 9 | default: 'main' 10 | 11 | permissions: 12 | contents: write 13 | pull-requests: write 14 | 15 | jobs: 16 | call-crowdin-workflow: 17 | uses: newfold-labs/workflows/.github/workflows/i18n-crowdin-download.yml@main 18 | with: 19 | base_branch: ${{ inputs.base_branch }} 20 | CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }} 21 | secrets: 22 | CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} 23 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | tests/phpunit 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /includes/Services/LanguageService.php: -------------------------------------------------------------------------------- 1 | { 4 | // Generate site meta 5 | const siteMeta = await generateSiteMeta(); 6 | if ( ! siteMeta ) { 7 | return false; 8 | } 9 | 10 | // Generate home pages 11 | const homePages = await generateHomePages(); 12 | if ( ! homePages ) { 13 | return false; 14 | } 15 | 16 | // Generate the rest of the site pages. 17 | await generateSitePages(); 18 | 19 | // Generate the site navigation menu. 20 | await generateSiteNavigationMenu(); 21 | 22 | return true; 23 | }; 24 | 25 | export default generateSite; 26 | -------------------------------------------------------------------------------- /src/app/components/Motion/Motion.js: -------------------------------------------------------------------------------- 1 | import { forwardRef } from 'react'; 2 | import { motion } from 'motion/react'; 3 | 4 | /** 5 | * A wrapper component for the Framer Motion library. 6 | * @param {Object} props Component props. 7 | * @param {string} props.tag HTML tag name. 8 | * @param {React.ReactNode} props.children Component children. 9 | * @param {React.Ref} ref Component ref. 10 | * @return {React.ReactNode} Motion component. 11 | */ 12 | const Motion = forwardRef( ( { 13 | tag = 'div', 14 | children, 15 | ...props 16 | }, ref ) => { 17 | const Component = motion[ tag ]; 18 | 19 | return ( 20 | 24 | { children } 25 | 26 | ); 27 | } ); 28 | 29 | export default Motion; 30 | 31 | -------------------------------------------------------------------------------- /src/app/utils/api/wp.js: -------------------------------------------------------------------------------- 1 | import apiFetch from '@wordpress/api-fetch'; 2 | import { wpRestURL as wpRestApiURL, wpSiteUrl } from '@/data/constants'; 3 | import { resolve } from '@/utils/helpers'; 4 | 5 | export const wpRestRoute = 'wp/v2'; 6 | export const wpRestBase = `${ wpRestApiURL }/${ wpRestRoute }`; 7 | 8 | export const wpRestURL = ( api ) => { 9 | return `${ wpRestBase }/${ api }`; 10 | }; 11 | 12 | export async function getWpSettings() { 13 | return await resolve( 14 | apiFetch( { 15 | url: wpRestURL( 'settings' ), 16 | } ).then() 17 | ); 18 | } 19 | 20 | export const fireWpCron = () => { 21 | apiFetch( { 22 | url: `${ wpSiteUrl }/wp-cron.php`, 23 | method: 'GET', 24 | parse: false, 25 | } ).catch( ( error ) => { 26 | // eslint-disable-next-line no-console 27 | console.error( error ); 28 | } ); 29 | }; 30 | -------------------------------------------------------------------------------- /.github/workflows/auto-translate.yml: -------------------------------------------------------------------------------- 1 | name: Check for Updates to Translations 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'trunk' 7 | workflow_dispatch: 8 | 9 | # Cancels all previous workflow runs for the branch that have not completed. 10 | concurrency: 11 | # The concurrency group contains the workflow name and the branch name. 12 | group: ${{ github.workflow }}-${{ github.ref_name }} 13 | cancel-in-progress: true 14 | 15 | permissions: {} 16 | 17 | jobs: 18 | translate: 19 | name: 'Check and update translations' 20 | permissions: 21 | contents: write 22 | pull-requests: write 23 | uses: newfold-labs/workflows/.github/workflows/reusable-translations.yml@main 24 | with: 25 | text_domain: 'wp-module-onboarding' 26 | secrets: 27 | TRANSLATOR_API_KEY: ${{ secrets.TRANSLATOR_API_KEY }} 28 | -------------------------------------------------------------------------------- /src/Brands/webcom/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Brands/webcom/dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /includes/Mustache/Mustache.php: -------------------------------------------------------------------------------- 1 | mustache_engine = new \Mustache_Engine( 21 | array( 22 | 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__ . '/Templates' ), 23 | ) 24 | ); 25 | } 26 | 27 | /** 28 | * Render respective template data. 29 | * 30 | * @param string $template_name Template Name 31 | * @param array $data Data 32 | * @return string 33 | */ 34 | public function render_template( $template_name, $data ) { 35 | return $this->mustache_engine->loadTemplate( $template_name )->render( $data ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/DesignStudio/hooks/useEditorControls.js: -------------------------------------------------------------------------------- 1 | /** 2 | * WordPress dependencies 3 | */ 4 | import { useDispatch, useSelect } from '@wordpress/data'; 5 | import { store as editorStore } from '@wordpress/editor'; 6 | 7 | /** 8 | * Custom hook to manage editor rendering mode 9 | * @return {Object} Editor control functions and state 10 | */ 11 | export const useEditorControls = () => { 12 | const { setRenderingMode } = useDispatch( editorStore ); 13 | 14 | const renderingMode = useSelect( ( select ) => { 15 | const editor = select( editorStore ); 16 | return editor?.getRenderingMode ? editor.getRenderingMode() : null; 17 | }, [] ); 18 | 19 | return { 20 | setShowTemplate: () => { 21 | if ( setRenderingMode && renderingMode !== 'template-locked' ) { 22 | setRenderingMode( 'template-locked' ); 23 | return true; 24 | } 25 | return false; 26 | }, 27 | }; 28 | }; 29 | -------------------------------------------------------------------------------- /src/app/components/index.js: -------------------------------------------------------------------------------- 1 | export { ActionCard as ActionCard } from './ActionCard'; 2 | export { AnimateRoutes as AnimateRoutes } from './AnimateRoutes'; 3 | export { AppBody as AppBody } from './AppBody'; 4 | export { BackButton as BackButton } from './BackButton'; 5 | export { BrandLoader as BrandLoader } from './BrandLoader'; 6 | export { ErrorBoundaryFallback as ErrorBoundaryFallback } from './ErrorBoundaryFallback'; 7 | export { Header as Header } from './Header'; 8 | export { Iframe as Iframe } from './Iframe'; 9 | export { InteractionBlockingOverlay as InteractionBlockingOverlay } from './InteractionBlockingOverlay'; 10 | export { Motion as Motion } from './Motion'; 11 | export { Navigate as Navigate } from './Navigate'; 12 | export { Orb as Orb } from './Orb'; 13 | export { SiteGenPreviewCard as SiteGenPreviewCard } from './SiteGenPreviewCard'; 14 | export { Step as Step } from './Step'; 15 | -------------------------------------------------------------------------------- /src/Brands/wordpress/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Brands/wordpress/dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/DesignStudio/utils/editor-utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Click the zoom out button 3 | */ 4 | export const enableZoomOut = () => { 5 | // Find and click the zoom out button 6 | const zoomButtonSelectors = [ 7 | 'button[aria-label="Zoom out"]', 8 | 'button[aria-label="Zoom Out"]', 9 | '.block-editor-zoom-out-button', 10 | '.edit-site-visual-editor__zoom-dropdown button', 11 | ]; 12 | 13 | let zoomButton = null; 14 | for ( const selector of zoomButtonSelectors ) { 15 | zoomButton = document.querySelector( selector ); 16 | if ( zoomButton ) { 17 | break; 18 | } 19 | } 20 | 21 | if ( zoomButton ) { 22 | zoomButton.click(); 23 | return true; 24 | } 25 | 26 | // Retry after a delay 27 | setTimeout( () => { 28 | const retryZoomButton = document.querySelector( zoomButtonSelectors.join( ', ' ) ); 29 | if ( retryZoomButton ) { 30 | retryZoomButton.click(); 31 | } 32 | }, 1500 ); 33 | 34 | return false; 35 | }; 36 | -------------------------------------------------------------------------------- /src/app/components/InteractionBlockingOverlay/InteractionBlockingOverlay.js: -------------------------------------------------------------------------------- 1 | import { BrandLoader } from '@/components'; 2 | 3 | const InteractionBlockingOverlay = ( { 4 | hasLoadingSpinner = false, 5 | hasBackground = true, 6 | children, 7 | } ) => { 8 | return ( 9 |
10 | { hasLoadingSpinner && ( 11 |
12 | 13 |
14 | ) } 15 | { hasBackground && ( 16 |
17 | ) } 18 | { children } 19 |
20 | ); 21 | }; 22 | 23 | export default InteractionBlockingOverlay; 24 | -------------------------------------------------------------------------------- /src/app/utils/analytics/hiive/index.js: -------------------------------------------------------------------------------- 1 | import { HiiveAnalytics } from '@newfold/js-utility-ui-analytics'; 2 | import { default as wpData } from '@wordpress/data'; 3 | import { default as wpApiFetch } from '@wordpress/api-fetch'; 4 | import { ACTION_TO_LABEL_KEY_MAP } from './constants'; 5 | 6 | export const trackOnboardingEvent = ( onboardingEvent ) => { 7 | return HiiveAnalytics.track( onboardingEvent ); 8 | }; 9 | 10 | export const sendOnboardingEvent = ( onboardingEvent ) => { 11 | return HiiveAnalytics.send( onboardingEvent ); 12 | }; 13 | 14 | export const getLabelKeyFromAction = ( action ) => { 15 | if ( action in ACTION_TO_LABEL_KEY_MAP ) { 16 | return ACTION_TO_LABEL_KEY_MAP[ action ]; 17 | } 18 | return undefined; 19 | }; 20 | 21 | // passing dependencies to HiiveAnalytics solely for build purposes 22 | HiiveAnalytics.dependencies = { 23 | wpData, 24 | wpApiFetch, 25 | }; 26 | 27 | export * from './OnboardingEvent'; 28 | -------------------------------------------------------------------------------- /src/app/data/store/index.js: -------------------------------------------------------------------------------- 1 | import { createReduxStore, register } from '@wordpress/data'; 2 | import actions from './actions'; 3 | import selectors from './selectors'; 4 | import reducer from './reducer'; 5 | import { dbSyncService as inputSliceDbSyncService } from './slices/input'; 6 | import { dbSyncService as sitegenSliceDbSyncService } from './slices/sitegen'; 7 | import { dbSyncService as blueprintsSliceDbSyncService } from './slices/blueprints'; 8 | 9 | const STORE_NAME = 'newfold/onboarding'; 10 | const STORE_CONFIG = { 11 | reducer, 12 | actions, 13 | selectors, 14 | }; 15 | 16 | export const nfdOnboardingStore = createReduxStore( STORE_NAME, STORE_CONFIG ); 17 | register( nfdOnboardingStore ); 18 | 19 | /** 20 | * Initialize the store-db sync services. 21 | */ 22 | export function initializeStoreDbSyncServices() { 23 | inputSliceDbSyncService(); 24 | sitegenSliceDbSyncService(); 25 | blueprintsSliceDbSyncService(); 26 | } 27 | -------------------------------------------------------------------------------- /src/DesignStudio/utils/url-utils.js: -------------------------------------------------------------------------------- 1 | import { QUERY_PARAMS, VALID_REFERRERS } from './constants'; 2 | 3 | /** 4 | * Check if we should apply our customizations 5 | * @return {boolean} Whether to apply customizations 6 | */ 7 | export const shouldApplyCustomizations = () => { 8 | const urlParams = new URLSearchParams( window.location.search ); 9 | const referrer = urlParams.get( QUERY_PARAMS.REFERRER ); 10 | return VALID_REFERRERS.includes( referrer ); 11 | }; 12 | 13 | /** 14 | * Set canvas mode to edit via URL parameter 15 | */ 16 | export const setDefaultCanvasMode = () => { 17 | const urlParams = new URLSearchParams( window.location.search ); 18 | if ( ! urlParams.has( QUERY_PARAMS.CANVAS_MODE ) ) { 19 | urlParams.set( QUERY_PARAMS.CANVAS_MODE, 'edit' ); 20 | const newUrl = `${ window.location.pathname }?${ urlParams.toString() }${ 21 | window.location.hash 22 | }`; 23 | window.history.replaceState( {}, '', newUrl ); 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /src/DesignStudio/components/ScreenHeader/NavigationButton.jsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable @wordpress/no-unsafe-wp-apis */ 2 | /** 3 | * WordPress dependencies 4 | */ 5 | import { 6 | FlexItem, 7 | __experimentalHStack as HStack, 8 | Icon, 9 | __experimentalItem as Item, 10 | Navigator, 11 | } from '@wordpress/components'; 12 | 13 | function GenericNavigationButton( { icon, children, ...props } ) { 14 | return ( 15 | 16 | { icon && ( 17 | 18 | 19 | { children } 20 | 21 | ) } 22 | { ! icon && children } 23 | 24 | ); 25 | } 26 | 27 | function NavigationButton( props ) { 28 | return ; 29 | } 30 | 31 | function NavigationBackButton( props ) { 32 | return ; 33 | } 34 | 35 | export { NavigationBackButton, NavigationButton }; 36 | -------------------------------------------------------------------------------- /src/Brands/crazy-domains/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/components/Iframe/Iframe.js: -------------------------------------------------------------------------------- 1 | import classNames from 'classnames'; 2 | import { forwardRef } from '@wordpress/element'; 3 | 4 | const Iframe = forwardRef( ( { 5 | title, 6 | src, 7 | width = 400, // eslint-disable-line no-unused-vars 8 | height = 400, 9 | viewportScale = 1, 10 | viewportWidth = 1440, 11 | viewportHeight = 1000, 12 | className, 13 | ...props 14 | }, ref ) => { 15 | return ( 16 |
26 |