diff --git a/plugins/woocommerce-admin/client/products/tour/block-editor/block-editor-guide.tsx b/plugins/woocommerce-admin/client/products/tour/block-editor/block-editor-guide.tsx index 05b0f5f3d7e..1f32347a68f 100644 --- a/plugins/woocommerce-admin/client/products/tour/block-editor/block-editor-guide.tsx +++ b/plugins/woocommerce-admin/client/products/tour/block-editor/block-editor-guide.tsx @@ -10,11 +10,95 @@ import { __ } from '@wordpress/i18n'; import Guide from '../components/guide'; import './style.scss'; -interface Props { +const PageContent = ( { + page, +}: { + page: { + heading: string; + text: string; + }; +} ) => ( + <> +

+ { page.heading } +

+

{ page.text }

+ +); + +const PageImage = ( { + page, +}: { + page: { + index: number; + }; +} ) => ( +
+); + +interface BlockEditorGuideProps { + isNewUser: boolean; onCloseGuide: ( currentPage: number, origin: 'close' | 'finish' ) => void; } -const BlockEditorGuide = ( { onCloseGuide }: Props ) => { +const BlockEditorGuide = ( { + isNewUser, + onCloseGuide, +}: BlockEditorGuideProps ) => { + const pagesConfig = [ + { + heading: isNewUser + ? __( 'Fresh and modern interface', 'woocommerce' ) + : __( 'Refreshed, streamlined interface', 'woocommerce' ), + text: isNewUser + ? __( + 'Using the product form means less clicking around. Product details are neatly grouped by tabs, so you always know where to go.', + 'woocommerce' + ) + : __( + 'Experience a simpler, more focused interface with a modern design that enhances usability.', + 'woocommerce' + ), + }, + { + heading: __( 'Content-rich product descriptions', 'woocommerce' ), + text: __( + 'Create compelling product pages with blocks, media, images, videos, and any content you desire to engage customers.', + 'woocommerce' + ), + }, + { + heading: isNewUser + ? __( 'Speed & performance', 'woocommerce' ) + : __( 'Improved speed & performance', 'woocommerce' ), + text: isNewUser + ? __( + 'Create a product from start to finish without page reloads. Our modern technology ensures reliability and lightning-fast performance.', + 'woocommerce' + ) + : __( + 'Enjoy a seamless experience without page reloads. Our modern technology ensures reliability and lightning-fast performance.', + 'woocommerce' + ), + }, + { + heading: __( 'More features are on the way', 'woocommerce' ), + text: __( + 'While we currently support physical products, exciting updates are coming to accommodate more types, like digital products, variations, and more. Stay tuned!', + 'woocommerce' + ), + }, + ]; + + const pages = pagesConfig.map( ( page, index ) => ( { + content: , + image: , + } ) ); + return ( { finishButtonText={ __( 'Tell me more', 'woocommerce' ) } finishButtonLink="https://woocommerce.com/product-form-beta" onFinish={ onCloseGuide } - pages={ [ - { - content: ( - <> -

- { __( - 'Refreshed, streamlined interface', - 'woocommerce' - ) } -

-

- { __( - 'Experience a simpler, more focused interface with a modern design that enhances usability.', - 'woocommerce' - ) } -

- - ), - image: ( -
- ), - }, - { - content: ( - <> -

- { __( - 'Content-rich product descriptions', - 'woocommerce' - ) } -

-

- { __( - 'Create compelling product pages with blocks, media, images, videos, and any content you desire to engage customers.', - 'woocommerce' - ) } -

- - ), - image: ( -
- ), - }, - { - content: ( - <> -

- { __( - 'Improved speed & performance', - 'woocommerce' - ) } -

-

- { __( - 'Enjoy a seamless experience without page reloads. Our modern technology ensures reliability and lightning-fast performance.', - 'woocommerce' - ) } -

- - ), - image: ( -
- ), - }, - { - content: ( - <> -

- { __( - 'More features are on the way', - 'woocommerce' - ) } -

-

- { __( - 'While we currently support physical products, exciting updates are coming to accommodate more types, like digital products, variations, and more. Stay tuned!', - 'woocommerce' - ) } -

- - ), - image: ( -
- ), - }, - ] } + pages={ pages } /> ); }; diff --git a/plugins/woocommerce-admin/client/products/tour/block-editor/block-editor-tour.tsx b/plugins/woocommerce-admin/client/products/tour/block-editor/block-editor-tour.tsx index 59b369f722b..748a4fb490c 100644 --- a/plugins/woocommerce-admin/client/products/tour/block-editor/block-editor-tour.tsx +++ b/plugins/woocommerce-admin/client/products/tour/block-editor/block-editor-tour.tsx @@ -1,11 +1,13 @@ /** * External dependencies */ -import { Pill, TourKit } from '@woocommerce/components'; -import { __ } from '@wordpress/i18n'; -import { recordEvent } from '@woocommerce/tracks'; +import { useSelect } from '@wordpress/data'; import { useEffect, useState } from '@wordpress/element'; +import { __ } from '@wordpress/i18n'; +import { Pill, TourKit } from '@woocommerce/components'; +import { PRODUCTS_STORE_NAME } from '@woocommerce/data'; import { __experimentalUseFeedbackBar as useFeedbackBar } from '@woocommerce/product-editor'; +import { recordEvent } from '@woocommerce/tracks'; /** * Internal dependencies @@ -19,7 +21,30 @@ interface Props { dismissModal: () => void; } +const PUBLISHED_PRODUCTS_QUERY_PARAMS = { + status: 'publish', + _fields: [ 'id' ], +}; + const BlockEditorTour = ( { shouldTourBeShown, dismissModal }: Props ) => { + const { publishedProductsCount, loadingPublishedProductsCount } = useSelect( + ( select ) => { + const { getProductsTotalCount, hasFinishedResolution } = + select( PRODUCTS_STORE_NAME ); + + return { + publishedProductsCount: getProductsTotalCount( + PUBLISHED_PRODUCTS_QUERY_PARAMS, + 0 + ), + loadingPublishedProductsCount: ! hasFinishedResolution( + 'getProductsTotalCount', + [ PUBLISHED_PRODUCTS_QUERY_PARAMS, 0 ] + ), + }; + } + ); + useEffect( () => { if ( shouldTourBeShown ) { recordEvent( 'block_product_editor_spotlight_view' ); @@ -30,13 +55,38 @@ const BlockEditorTour = ( { shouldTourBeShown, dismissModal }: Props ) => { const { maybeShowFeedbackBar } = useFeedbackBar(); + // we consider a user new if they have no published products + const isNewUser = publishedProductsCount < 1; + const openGuide = () => { setIsGuideOpen( true ); }; + const getTourText = () => { + return { + heading: isNewUser + ? __( 'Meet the product editing form', 'woocommerce' ) + : __( 'A new way to edit your products', 'woocommerce' ), + description: isNewUser + ? __( + "Discover the form's unique features designed to help you make this product stand out.", + 'woocommerce' + ) + : __( + 'Introducing the upgraded experience designed to help you create and edit products easier.', + 'woocommerce' + ), + }; + }; + + if ( loadingPublishedProductsCount ) { + return null; + } + if ( isGuideOpen ) { return ( { dismissModal(); if ( source === 'finish' ) { @@ -58,6 +108,8 @@ const BlockEditorTour = ( { shouldTourBeShown, dismissModal }: Props ) => { /> ); } else if ( shouldTourBeShown ) { + const { heading, description } = getTourText(); + return ( { ), }, descriptions: { - desktop: __( - "We designed a brand new product editing experience to let you focus on what's important.", - 'woocommerce' - ), + desktop: description, }, heading: ( <> - - { __( - 'Meet a streamlined product form', - 'woocommerce' - ) } - { ' ' } - + { heading } + { __( 'Beta', 'woocommerce' ) } diff --git a/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-1.svg b/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-1.svg new file mode 100644 index 00000000000..0954135a334 --- /dev/null +++ b/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-1.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-2.png b/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-2.png new file mode 100644 index 00000000000..2f68ecb3263 Binary files /dev/null and b/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-2.png differ diff --git a/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-3.png b/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-3.png new file mode 100644 index 00000000000..c4f9b471c98 Binary files /dev/null and b/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-3.png differ diff --git a/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-4.png b/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-4.png new file mode 100644 index 00000000000..3afbdf8672b Binary files /dev/null and b/plugins/woocommerce-admin/client/products/tour/block-editor/images/guide-4.png differ diff --git a/plugins/woocommerce-admin/client/products/tour/block-editor/images/tour-header.svg b/plugins/woocommerce-admin/client/products/tour/block-editor/images/tour-header.svg new file mode 100644 index 00000000000..ac84b6014e4 --- /dev/null +++ b/plugins/woocommerce-admin/client/products/tour/block-editor/images/tour-header.svg @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/woocommerce-admin/client/products/tour/block-editor/style.scss b/plugins/woocommerce-admin/client/products/tour/block-editor/style.scss index 9ba4967cae3..266820f31ec 100644 --- a/plugins/woocommerce-admin/client/products/tour/block-editor/style.scss +++ b/plugins/woocommerce-admin/client/products/tour/block-editor/style.scss @@ -1,30 +1,29 @@ -$background-height: 220px; -$yellow: #f5e6ab; -$light-purple: #f2edff; - .woocommerce-block-editor-guide { - &__background1 { - height: $background-height; - background-color: $light-purple; - } - &__background2 { - height: $background-height; - background-color: #dfd1fb; - } - &__background3 { - height: $background-height; - background-color: #cfb9f6; - } - &__background4 { - height: $background-height; - background-color: #bea0f2; - } - &__pill { - border: 1px solid $yellow; - background-color: $yellow; + &__header { + width: 312px; + height: 222px; + background-color: #f6f7f7; /* WP Gray 0; no var available */ + background-size: cover; + + &-1 { + background-image: url(./images/guide-1.svg); + } + + &-2 { + background-image: url(./images/guide-2.png); + } + + &-3 { + background-image: url(./images/guide-3.png); + } + + &-4 { + background-image: url(./images/guide-4.png); + } } + &.components-modal__frame { - max-width: 320px; + max-width: 312px; } &__heading, &__text { @@ -59,10 +58,26 @@ $light-purple: #f2edff; } .woocommerce-block-editor-tourkit { - .components-card__header { - align-items: flex-start; - height: 200px; - background-color: $light-purple; - margin-bottom: $gap; + .woocommerce-tour-kit-step { + width: 381px; + + .components-card__header { + align-items: flex-start; + height: 194px; + background-color: #d4aaf6; /* no var available */ + background-image: url(./images/tour-header.svg); + border-bottom: 1px solid $gray-200; + margin-bottom: $gap; + } + + &__heading { + .woocommerce-pill { + margin-left: $gap-small; + background-color: $studio-yellow-5; + border: 0; + } + } } + + } diff --git a/plugins/woocommerce/changelog/update-product-editor-tour-design b/plugins/woocommerce/changelog/update-product-editor-tour-design new file mode 100644 index 00000000000..14fd1f18ff3 --- /dev/null +++ b/plugins/woocommerce/changelog/update-product-editor-tour-design @@ -0,0 +1,4 @@ +Significance: patch +Type: enhancement + +Update product editor tour/guide copy and style.