import { Launch } from '@auto-launch/components/Launch'; import { Logo } from '@auto-launch/components/Logo'; import { MovingGradient } from '@auto-launch/components/MovingGradients'; import { NeedsTheme } from '@auto-launch/components/NeedsTheme'; import { RestartLaunchModal } from '@auto-launch/components/RestartLaunchModal'; import { ViewportPulse } from '@auto-launch/components/ViewportPulse'; import { updateOption } from '@auto-launch/functions/wp'; import { useLaunchDataStore } from '@auto-launch/state/launch-data'; import { registerCoreBlocks } from '@wordpress/block-library'; import { getBlockTypes } from '@wordpress/blocks'; import { useSelect } from '@wordpress/data'; import { useEffect, useRef } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { chevronLeft, Icon } from '@wordpress/icons'; import { AnimatePresence, motion } from 'framer-motion'; import { checkIn } from './functions/insights'; export const LaunchPage = () => { const theme = useSelect((select) => select('core').getCurrentTheme()); // Checking `theme` here makes sure the data is populated const needsTheme = theme && theme?.textdomain !== 'extendable'; const oldPages = window.extLaunchData.resetSiteInformation.pagesIds ?? []; const needsToReset = oldPages.length > 0; const { title, descriptionRaw, go, urlParams, designBuild } = useLaunchDataStore(); const skipDescription = Boolean(urlParams?.['build-id']) || designBuild || ((title || descriptionRaw) && go); const containerRef = useRef(null); useEffect(() => { // translators: Launch is a noun. document.title = __('Launch - AI-Powered Web Creation', 'extendify-local'); updateOption('extendify_launch_loaded', new Date().toISOString()); // We load core blocks so we can parse them if (getBlockTypes().length === 0) registerCoreBlocks(); checkIn({ stage: 'launch_page' }); }, []); if (needsTheme) { return (
); } if (needsToReset) { return (
); } return (
{skipDescription || window.extLaunchData?.hideAutoLaunchExitLink ? null : (
checkIn({ stage: 'exit_to_wp_admin' })} > {__('WP Admin Dashboard', 'extendify-local')}
)}
); }; const Wrapper = ({ children }) => { const { pulse } = useLaunchDataStore(); return (
{children}
{pulse ? : null}
); }; const TheTitle = ({ skipDescription }) => { if (skipDescription) return null; return ( {__('Describe the website you want to build', 'extendify-local')} ); };