From 59ff006eb726908bbc25fac1eae7249c3b424fc2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 31 Jul 2023 17:14:57 +0200 Subject: [PATCH] Release: 10.6.2 (#10407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: WooCommerce Blocks causing malfunction of the navigation block on WordPress 6.3 (#10388) * Make sure the revert button is registered and enqueued for usage exclusively in the site editor. * Register and enqueue the styles for the revert button. * Rename the files. * Revert "Rename the file renames." This reverts commit c0330ce70fec20bea1f957eddcf458881e16242c. * Add plugin-proposal-optional-chaining to the WebPack plugins config. * Rename the files. * Remove unnecessary dependencies as those are already provided via : more specifically, get_script_data. * Address CR. * Cart and Checkout Page Migration: Inherit Page template and fix rendering (#10375) * Change shortcode block render callback * Inherit template from original "page" template * Check if WordPress version is higher than 6.2.2 to make Products block compatible with Gutenberg 16+ (#10360) * Check if WordPress version is higher than 6.2.2 to make Products block compatible with Gutenberg 16+ * Extract the logic of checking the post template support for grid view toi separate function * Change the versions comparison and improve description of custom version compare function * Render Checkout/Cart containing pages without template overriding (#10359) * Render Checkout/Cart containing pages without template overriding * Fix checkout typo --------- Co-authored-by: Mike Jolley * Add to cart form: Fix fatal error when missing `product` param in add_to_cart_redirect_filter (#10316) * Transform product param optional in add_to_cart_redirect_filter method * Remove unnecessary argument from add_to_cart_redirect_filter * Remove mocked filter call * Remove unnecessary argument from function docs * Remove opinionated styles from Product Hero pattern (#10255) * Mini Cart: Remove deprecated print_inline_script() (#10165) * Mini Cart: Replace the deprecated print_inline_script() with supported get_inline_script_data(). Fixes #10004 * Mini Cart: Add version check for the new get_inline_script_data() function * Update the variable names and fix a typo * Mini Cart: Add regex to check for the WP version * Abstract the WP version comparison regex to a separate Utils class * Call wc_setup_product_data if the global product variable is not an instance of WC_Product. (#10128) * Empty commit for release pull request * add testing instructions * Per block stylesheets (#9831) * Clean up blank lines * Update Webpack config * Update PHP logic to load block styles * Style fixes * Style fixes (II) * Style fixes (III) * Style fixes (IV) * Fix missing stylesheets in the Site Editor * Fix wrong return values in some PHP method docs * Fix missing ProductPrice stylesheet causing 404 in tests * Fix missing ProductGallery stylesheet causing 404 in tests * update testing instructions * add zip link * update version * update zip link * remove screenshot * remove testing instructions * Register Legacy block for all taxonomy-product_ template (#10382) * WIP * improve logic * improve unit test * $post validation on Cart and Checkout template (#10410) Co-authored-by: Luigi Teschio * Update zip --------- Co-authored-by: Patricia Hillebrandt Co-authored-by: Mike Jolley Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com> Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> Co-authored-by: Alexandre Lara Co-authored-by: Albert Juhé Lluveras Co-authored-by: Daniel Dudzic Co-authored-by: github-actions Co-authored-by: Luigi --- assets/css/style.scss | 1 - .../blocks/product-elements/price/block.tsx | 1 - .../blocks/product-elements/price/style.scss | 11 -- .../product-details/block.tsx | 4 - .../product-details/index.tsx | 1 + .../product-reviews/block.tsx | 4 - .../product-reviews/index.tsx | 1 + .../blocks/product-elements/rating/block.tsx | 5 - .../base/components/country-input/style.scss | 4 + .../components/form-token-field/vendor.scss | 1 + .../base/components/product-price/style.scss | 12 ++ .../base/components/product-rating/index.tsx | 1 + .../components/product-rating}/style.scss | 0 assets/js/blocks/breadcrumbs/index.tsx | 1 + .../payment-methods/payment-methods.js | 1 + .../cart-cross-sells-products/index.tsx | 1 + .../inner-blocks/cart-totals-block/edit.tsx | 1 - .../inner-blocks/cart-totals-block/index.tsx | 1 + .../inner-blocks/empty-cart-block/edit.tsx | 1 - .../inner-blocks/empty-cart-block/index.tsx | 1 + .../proceed-to-checkout-block/block.tsx | 1 - .../proceed-to-checkout-block/index.tsx | 1 + .../proceed-to-checkout-block/style.scss | 1 - assets/js/blocks/catalog-sorting/index.tsx | 1 + .../checkout-actions-block/block.tsx | 2 +- .../checkout-actions-block/index.tsx | 1 + .../checkout-fields-block/frontend.tsx | 5 - .../checkout-fields-block/index.tsx | 1 + .../checkout-order-note-block/index.tsx | 1 + .../checkout-order-note-block}/style.scss | 2 +- .../checkout-payment-block/block.tsx | 4 - .../checkout-pickup-options-block/block.tsx | 1 - .../checkout-pickup-options-block/index.tsx | 1 + .../checkout-shipping-method-block/block.tsx | 1 - .../checkout-shipping-method-block/index.tsx | 1 + .../checkout-shipping-methods-block/block.tsx | 5 - .../checkout-shipping-methods-block/index.tsx | 1 + .../checkout-terms-block/frontend.tsx | 1 - .../checkout-terms-block/index.tsx | 2 + .../checkout-totals-block/frontend.tsx | 5 - .../checkout-totals-block/index.tsx | 1 + .../js/blocks/checkout/order-notes/index.tsx | 5 - .../js/blocks/classic-template/constants.ts | 9 + .../js/blocks/classic-template/test/utils.ts | 38 ++-- assets/js/blocks/customer-account/index.tsx | 1 + .../js/blocks/product-results-count/index.tsx | 1 + assets/js/blocks/product-tag/index.tsx | 2 +- assets/js/blocks/product-template/index.tsx | 1 + .../search-list-control.tsx | 1 + assets/js/index.js | 1 - bin/webpack-configs.js | 165 +++++++++++++----- bin/webpack-entries.js | 42 ++--- composer.json | 2 +- .../testing/releases/1062.md | 60 +++++++ .../testing/releases/README.md | 1 + package-lock.json | 4 +- package.json | 5 +- .../components/checkbox-control/style.scss | 2 +- patterns/product-hero.php | 22 +-- readme.txt | 18 +- src/Assets/Api.php | 17 +- src/AssetsController.php | 25 ++- src/BlockTemplatesController.php | 89 ++++++++-- src/BlockTypes/AbstractBlock.php | 7 +- src/BlockTypes/AbstractInnerBlock.php | 8 + src/BlockTypes/AbstractProductGrid.php | 10 ++ src/BlockTypes/AddToCartForm.php | 14 +- src/BlockTypes/AttributeFilter.php | 9 + src/BlockTypes/Cart.php | 9 + src/BlockTypes/Checkout.php | 9 + src/BlockTypes/ClassicTemplate.php | 8 + src/BlockTypes/FilterWrapper.php | 9 + src/BlockTypes/MiniCart.php | 22 ++- src/BlockTypes/MiniCartContents.php | 9 + src/BlockTypes/ProceedToCheckoutBlock.php | 1 - src/BlockTypes/ProductCollection.php | 9 + src/BlockTypes/ProductGallery.php | 9 + src/BlockTypes/ProductPrice.php | 9 + src/BlockTypes/ProductQuery.php | 38 ++-- src/BlockTypes/ProductRating.php | 9 + src/BlockTypes/RatingFilter.php | 9 + src/BlockTypes/RelatedProducts.php | 11 +- src/BlockTypes/StockFilter.php | 9 + src/BlockTypes/StoreNotices.php | 9 + src/Package.php | 2 +- src/Templates/CartTemplate.php | 3 +- src/Templates/CheckoutTemplate.php | 3 +- src/Utils/Utils.php | 27 +++ webpack.config.js | 10 ++ woocommerce-gutenberg-products-block.php | 3 +- 90 files changed, 664 insertions(+), 214 deletions(-) delete mode 100644 assets/js/atomic/blocks/product-elements/price/style.scss rename assets/js/{atomic/blocks/product-elements/rating => base/components/product-rating}/style.scss (100%) rename assets/js/blocks/checkout/{order-notes => inner-blocks/checkout-order-note-block}/style.scss (79%) create mode 100644 docs/internal-developers/testing/releases/1062.md create mode 100644 src/Utils/Utils.php diff --git a/assets/css/style.scss b/assets/css/style.scss index 68c0cd14e91..756c24984ec 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -337,7 +337,6 @@ @include visually-hidden-focus-reveal(); } - .wp-block-group.woocommerce.product .up-sells.upsells.products { max-width: var(--wp--style--global--wide-size); } diff --git a/assets/js/atomic/blocks/product-elements/price/block.tsx b/assets/js/atomic/blocks/product-elements/price/block.tsx index 8561b00c3d6..3f66056631b 100644 --- a/assets/js/atomic/blocks/product-elements/price/block.tsx +++ b/assets/js/atomic/blocks/product-elements/price/block.tsx @@ -17,7 +17,6 @@ import type { HTMLAttributes } from 'react'; * Internal dependencies */ import type { BlockAttributes } from './types'; -import './style.scss'; type Props = BlockAttributes & HTMLAttributes< HTMLDivElement >; diff --git a/assets/js/atomic/blocks/product-elements/price/style.scss b/assets/js/atomic/blocks/product-elements/price/style.scss deleted file mode 100644 index 5ff42437d25..00000000000 --- a/assets/js/atomic/blocks/product-elements/price/style.scss +++ /dev/null @@ -1,11 +0,0 @@ -.wc-block-components-product-price { - display: block; - - .wc-block-all-products & { - margin-bottom: $gap-small; - } - - ins { - text-decoration: none; - } -} diff --git a/assets/js/atomic/blocks/product-elements/product-details/block.tsx b/assets/js/atomic/blocks/product-elements/product-details/block.tsx index 74c46267b3a..2d2f95bfd03 100644 --- a/assets/js/atomic/blocks/product-elements/product-details/block.tsx +++ b/assets/js/atomic/blocks/product-elements/product-details/block.tsx @@ -5,10 +5,6 @@ import classnames from 'classnames'; import { __ } from '@wordpress/i18n'; import { useBlockProps } from '@wordpress/block-editor'; -/** - * Internal dependencies - */ - interface SingleProductTab { id: string; title: string; diff --git a/assets/js/atomic/blocks/product-elements/product-details/index.tsx b/assets/js/atomic/blocks/product-elements/product-details/index.tsx index 0c3e05a1747..4a71b9963ae 100644 --- a/assets/js/atomic/blocks/product-elements/product-details/index.tsx +++ b/assets/js/atomic/blocks/product-elements/product-details/index.tsx @@ -10,6 +10,7 @@ import { productDetails } from '@woocommerce/icons'; */ import metadata from './block.json'; import edit from './edit'; +import './style.scss'; registerBlockSingleProductTemplate( { blockName: metadata.name, diff --git a/assets/js/atomic/blocks/product-elements/product-reviews/block.tsx b/assets/js/atomic/blocks/product-elements/product-reviews/block.tsx index 965cd18f8a0..da8d08aee9a 100644 --- a/assets/js/atomic/blocks/product-elements/product-reviews/block.tsx +++ b/assets/js/atomic/blocks/product-elements/product-reviews/block.tsx @@ -9,10 +9,6 @@ import { __ } from '@wordpress/i18n'; import { useBlockProps } from '@wordpress/block-editor'; import { Notice } from '@wordpress/components'; -/** - * Internal dependencies - */ - export const ProductReviews = () => { const blockProps = useBlockProps(); diff --git a/assets/js/atomic/blocks/product-elements/product-reviews/index.tsx b/assets/js/atomic/blocks/product-elements/product-reviews/index.tsx index 20cbbe7ecd1..3dd9446baee 100644 --- a/assets/js/atomic/blocks/product-elements/product-reviews/index.tsx +++ b/assets/js/atomic/blocks/product-elements/product-reviews/index.tsx @@ -8,6 +8,7 @@ import { registerBlockSingleProductTemplate } from '@woocommerce/atomic-utils'; */ import metadata from './block.json'; import edit from './edit'; +import './style.scss'; registerBlockSingleProductTemplate( { blockName: metadata.name, diff --git a/assets/js/atomic/blocks/product-elements/rating/block.tsx b/assets/js/atomic/blocks/product-elements/rating/block.tsx index cd1dded900b..a113e573f79 100644 --- a/assets/js/atomic/blocks/product-elements/rating/block.tsx +++ b/assets/js/atomic/blocks/product-elements/rating/block.tsx @@ -11,11 +11,6 @@ import { useStyleProps } from '@woocommerce/base-hooks'; import { withProductDataContext } from '@woocommerce/shared-hocs'; import { isNumber, ProductResponseItem } from '@woocommerce/types'; -/** - * Internal dependencies - */ -import './style.scss'; - type RatingProps = { reviews: number; rating: number; diff --git a/assets/js/base/components/country-input/style.scss b/assets/js/base/components/country-input/style.scss index 576951e4ba6..003c302203e 100644 --- a/assets/js/base/components/country-input/style.scss +++ b/assets/js/base/components/country-input/style.scss @@ -1,3 +1,7 @@ +@import "node_modules/@wordpress/base-styles/breakpoints"; +@import "node_modules/@wordpress/base-styles/mixins"; +@import "node_modules/wordpress-components/src/combobox-control/style"; + .wc-block-components-country-input { margin-top: em($gap-large); } diff --git a/assets/js/base/components/form-token-field/vendor.scss b/assets/js/base/components/form-token-field/vendor.scss index 1da6718e9c3..273d47af58c 100644 --- a/assets/js/base/components/form-token-field/vendor.scss +++ b/assets/js/base/components/form-token-field/vendor.scss @@ -8,5 +8,6 @@ @import "node_modules/@wordpress/base-styles/mixins"; @import "node_modules/wordpress-components/src/popover/style"; @import "node_modules/wordpress-components/src/tooltip/style"; + @import "node_modules/wordpress-components/src/form-token-field/style"; /* stylelint-enable no-invalid-position-at-import-rule */ } diff --git a/assets/js/base/components/product-price/style.scss b/assets/js/base/components/product-price/style.scss index e3b7db30178..8e72d6413e8 100644 --- a/assets/js/base/components/product-price/style.scss +++ b/assets/js/base/components/product-price/style.scss @@ -13,6 +13,18 @@ } /*rtl:end:ignore*/ +.wc-block-components-product-price { + display: block; + + .wc-block-all-products .wc-block-components-product-price { + margin-bottom: $gap-small; + } + + ins { + text-decoration: none; + } +} + .wc-block-components-product-price__value { &.is-discounted { margin-left: 0.5em; diff --git a/assets/js/base/components/product-rating/index.tsx b/assets/js/base/components/product-rating/index.tsx index bc391b3fe70..5b9bd6a91e1 100644 --- a/assets/js/base/components/product-rating/index.tsx +++ b/assets/js/base/components/product-rating/index.tsx @@ -7,6 +7,7 @@ import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies */ +import './style.scss'; const Rating = ( { className, diff --git a/assets/js/atomic/blocks/product-elements/rating/style.scss b/assets/js/base/components/product-rating/style.scss similarity index 100% rename from assets/js/atomic/blocks/product-elements/rating/style.scss rename to assets/js/base/components/product-rating/style.scss diff --git a/assets/js/blocks/breadcrumbs/index.tsx b/assets/js/blocks/breadcrumbs/index.tsx index 194aa54e9ad..ee6d49066b5 100644 --- a/assets/js/blocks/breadcrumbs/index.tsx +++ b/assets/js/blocks/breadcrumbs/index.tsx @@ -10,6 +10,7 @@ import { Icon, queryPagination } from '@wordpress/icons'; */ import metadata from './block.json'; import edit from './edit'; +import './style.scss'; const featurePluginSupport = { ...metadata.supports, diff --git a/assets/js/blocks/cart-checkout-shared/payment-methods/payment-methods.js b/assets/js/blocks/cart-checkout-shared/payment-methods/payment-methods.js index a35312dc3f6..b4b207cfc8b 100644 --- a/assets/js/blocks/cart-checkout-shared/payment-methods/payment-methods.js +++ b/assets/js/blocks/cart-checkout-shared/payment-methods/payment-methods.js @@ -12,6 +12,7 @@ import { PAYMENT_STORE_KEY } from '@woocommerce/block-data'; import NoPaymentMethods from './no-payment-methods'; import PaymentMethodOptions from './payment-method-options'; import SavedPaymentMethodOptions from './saved-payment-method-options'; +import './style.scss'; /** * PaymentMethods component. diff --git a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx index 552ad127e34..1b303359d4a 100644 --- a/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx +++ b/assets/js/blocks/cart/inner-blocks/cart-cross-sells-products/index.tsx @@ -8,6 +8,7 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; +import './style.scss'; registerBlockType( 'woocommerce/cart-cross-sells-products-block', { icon: { diff --git a/assets/js/blocks/cart/inner-blocks/cart-totals-block/edit.tsx b/assets/js/blocks/cart/inner-blocks/cart-totals-block/edit.tsx index 6707e86914f..f78a07ee392 100644 --- a/assets/js/blocks/cart/inner-blocks/cart-totals-block/edit.tsx +++ b/assets/js/blocks/cart/inner-blocks/cart-totals-block/edit.tsx @@ -9,7 +9,6 @@ import type { TemplateArray } from '@wordpress/blocks'; /** * Internal dependencies */ -import './style.scss'; import { useForcedLayout, getAllowedBlocks, diff --git a/assets/js/blocks/cart/inner-blocks/cart-totals-block/index.tsx b/assets/js/blocks/cart/inner-blocks/cart-totals-block/index.tsx index 0cb78ff525f..d5f041722d3 100644 --- a/assets/js/blocks/cart/inner-blocks/cart-totals-block/index.tsx +++ b/assets/js/blocks/cart/inner-blocks/cart-totals-block/index.tsx @@ -8,6 +8,7 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; +import './style.scss'; registerBlockType( 'woocommerce/cart-totals-block', { icon: { diff --git a/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx b/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx index d55c95784ea..2eecb03f2c1 100644 --- a/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx +++ b/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx @@ -15,7 +15,6 @@ import { useForcedLayout, getAllowedBlocks, } from '../../../cart-checkout-shared'; -import './style.scss'; const browseStoreTemplate = SHOP_URL ? [ diff --git a/assets/js/blocks/cart/inner-blocks/empty-cart-block/index.tsx b/assets/js/blocks/cart/inner-blocks/empty-cart-block/index.tsx index 2902049d61e..dc1c28cdb9d 100644 --- a/assets/js/blocks/cart/inner-blocks/empty-cart-block/index.tsx +++ b/assets/js/blocks/cart/inner-blocks/empty-cart-block/index.tsx @@ -9,6 +9,7 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; +import './style.scss'; registerBlockType( 'woocommerce/empty-cart-block', { icon: { diff --git a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx index 6dc2e34644a..760138f9c10 100644 --- a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx +++ b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx @@ -16,7 +16,6 @@ import { useCartEventsContext } from '@woocommerce/base-context/providers'; /** * Internal dependencies */ -import './style.scss'; import { defaultButtonLabel } from './constants'; /** diff --git a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/index.tsx b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/index.tsx index ba3058f0776..8ccfdcb9c75 100644 --- a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/index.tsx +++ b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/index.tsx @@ -9,6 +9,7 @@ import { registerBlockType } from '@wordpress/blocks'; */ import attributes from './attributes'; import { Edit, Save } from './edit'; +import './style.scss'; registerBlockType( 'woocommerce/proceed-to-checkout-block', { icon: { diff --git a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss index 06ef7f37a35..ec97ee8c1d8 100644 --- a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss +++ b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss @@ -44,4 +44,3 @@ } } } - diff --git a/assets/js/blocks/catalog-sorting/index.tsx b/assets/js/blocks/catalog-sorting/index.tsx index b83b17bf6af..0fd0be1eb50 100644 --- a/assets/js/blocks/catalog-sorting/index.tsx +++ b/assets/js/blocks/catalog-sorting/index.tsx @@ -10,6 +10,7 @@ import { totals } from '@woocommerce/icons'; */ import metadata from './block.json'; import edit from './edit'; +import './style.scss'; registerBlockType( metadata, { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/block.tsx index 6e1302e6816..5896878c053 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/block.tsx @@ -17,8 +17,8 @@ import { /** * Internal dependencies */ -import './style.scss'; import { defaultPlaceOrderButtonLabel } from './constants'; +import './style.scss'; const Block = ( { cartPageId, diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/index.tsx index 8fe72c17446..8f5712b1b04 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-actions-block/index.tsx @@ -10,6 +10,7 @@ import type { BlockConfiguration } from '@wordpress/blocks'; */ import attributes from './attributes'; import { Edit, Save } from './edit'; +import './style.scss'; const blockConfig: BlockConfiguration = { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/frontend.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/frontend.tsx index 27cbaa28746..ad682af396e 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/frontend.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/frontend.tsx @@ -4,11 +4,6 @@ import classnames from 'classnames'; import { Main } from '@woocommerce/base-components/sidebar-layout'; -/** - * Internal dependencies - */ -import './style.scss'; - const FrontendBlock = ( { children, className, diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/index.tsx index d78238e3729..b31c89ffad3 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-fields-block/index.tsx @@ -8,6 +8,7 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; +import './style.scss'; registerBlockType( 'woocommerce/checkout-fields-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/index.tsx index 71a1ebfdd70..2696f82b730 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/index.tsx @@ -8,6 +8,7 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; +import './style.scss'; registerBlockType( 'woocommerce/checkout-order-note-block', { icon: { diff --git a/assets/js/blocks/checkout/order-notes/style.scss b/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/style.scss similarity index 79% rename from assets/js/blocks/checkout/order-notes/style.scss rename to assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/style.scss index 02b0c71dc48..5920676ae91 100644 --- a/assets/js/blocks/checkout/order-notes/style.scss +++ b/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/style.scss @@ -17,6 +17,6 @@ margin-top: $gap; } -.wc-block-checkout__order-notes.wc-block-components-checkout-step { +.wc-block-components-form .wc-block-checkout__order-notes.wc-block-components-checkout-step { padding-left: 0; } diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/block.tsx index de7f2979e4f..c204a044262 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/block.tsx @@ -1,7 +1,3 @@ -/** - * External dependencies - */ - /** * Internal dependencies */ diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx index c5fe3756deb..91771f5109e 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx @@ -26,7 +26,6 @@ import { LocalPickupSelect } from '@woocommerce/base-components/cart-checkout/lo /** * Internal dependencies */ -import './style.scss'; import ShippingRatesControlPackage from '../../../../base/components/cart-checkout/shipping-rates-control-package'; const getPickupLocation = ( diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/index.tsx index 89a01ceffc5..f173f14e506 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/index.tsx @@ -9,6 +9,7 @@ import { registerBlockType } from '@wordpress/blocks'; */ import { Edit, Save } from './edit'; import attributes from './attributes'; +import './style.scss'; registerBlockType( 'woocommerce/checkout-pickup-options-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx index b090729fb6f..190cb4fa3f2 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx @@ -17,7 +17,6 @@ import { isPackageRateCollectable } from '@woocommerce/base-utils'; /** * Internal dependencies */ -import './style.scss'; import { RatePrice, getLocalPickupPrices, getShippingPrices } from './shared'; import type { minMaxPrices } from './shared'; import { defaultLocalPickupText, defaultShippingText } from './constants'; diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/index.tsx index 1a0e1859673..6df154b730c 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/index.tsx @@ -9,6 +9,7 @@ import { registerBlockType } from '@wordpress/blocks'; */ import { Edit, Save } from './edit'; import attributes from './attributes'; +import './style.scss'; registerBlockType( 'woocommerce/checkout-shipping-method-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx index 68be42ddde5..e0ad9bc0c72 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx @@ -25,11 +25,6 @@ import type { import NoticeBanner from '@woocommerce/base-components/notice-banner'; import type { ReactElement } from 'react'; -/** - * Internal dependencies - */ -import './style.scss'; - /** * Renders a shipping rate control option. * diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx index 972723db9e8..cb898b4663a 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx @@ -9,6 +9,7 @@ import { registerBlockType } from '@wordpress/blocks'; */ import { Edit, Save } from './edit'; import attributes from './attributes'; +import './style.scss'; registerBlockType( 'woocommerce/checkout-shipping-methods-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx index b3de54291b9..46ffce5c4cc 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx @@ -14,7 +14,6 @@ import { VALIDATION_STORE_KEY } from '@woocommerce/block-data'; * Internal dependencies */ import { termsConsentDefaultText, termsCheckboxDefaultText } from './constants'; -import './style.scss'; const FrontendBlock = ( { text, diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/index.tsx index 60ff1e045de..11d01e0a451 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/index.tsx @@ -3,10 +3,12 @@ */ import { Icon, customPostType } from '@wordpress/icons'; import { registerBlockType } from '@wordpress/blocks'; + /** * Internal dependencies */ import { Edit, Save } from './edit'; +import './style.scss'; registerBlockType( 'woocommerce/checkout-terms-block', { icon: { diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/frontend.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/frontend.tsx index 504483205a5..43f65fab2ac 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/frontend.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/frontend.tsx @@ -5,11 +5,6 @@ import classnames from 'classnames'; import { Sidebar } from '@woocommerce/base-components/sidebar-layout'; import { StoreNoticesContainer } from '@woocommerce/blocks-checkout'; -/** - * Internal dependencies - */ -import './style.scss'; - const FrontendBlock = ( { children, className, diff --git a/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/index.tsx b/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/index.tsx index aa3581bbf9d..95f48f855fc 100644 --- a/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/index.tsx +++ b/assets/js/blocks/checkout/inner-blocks/checkout-totals-block/index.tsx @@ -8,6 +8,7 @@ import { registerBlockType } from '@wordpress/blocks'; * Internal dependencies */ import { Edit, Save } from './edit'; +import './style.scss'; registerBlockType( 'woocommerce/checkout-totals-block', { icon: { diff --git a/assets/js/blocks/checkout/order-notes/index.tsx b/assets/js/blocks/checkout/order-notes/index.tsx index e68d616c953..e4345e3c340 100644 --- a/assets/js/blocks/checkout/order-notes/index.tsx +++ b/assets/js/blocks/checkout/order-notes/index.tsx @@ -6,11 +6,6 @@ import { useState } from '@wordpress/element'; import { CheckboxControl } from '@woocommerce/blocks-checkout'; import { Textarea } from '@woocommerce/base-components/textarea'; -/** - * Internal dependencies - */ -import './style.scss'; - interface CheckoutOrderNotesProps { disabled: boolean; onChange: ( orderNotes: string ) => void; diff --git a/assets/js/blocks/classic-template/constants.ts b/assets/js/blocks/classic-template/constants.ts index 92601253e4e..75a49d55da2 100644 --- a/assets/js/blocks/classic-template/constants.ts +++ b/assets/js/blocks/classic-template/constants.ts @@ -67,6 +67,15 @@ export const TEMPLATES: TemplateDetails = { ), placeholder: PLACEHOLDERS.archiveProduct, }, + // Since that it is a fallback value, it has to be the last one. + 'taxonomy-product': { + type: TYPES.productTaxonomy, + title: __( + "WooCommerce Product's Custom Taxonomy Block", + 'woo-gutenberg-products-block' + ), + placeholder: PLACEHOLDERS.archiveProduct, + }, 'product-search-results': { type: TYPES.productSearchResults, title: __( diff --git a/assets/js/blocks/classic-template/test/utils.ts b/assets/js/blocks/classic-template/test/utils.ts index da50d63dd09..6e1da20ffab 100644 --- a/assets/js/blocks/classic-template/test/utils.ts +++ b/assets/js/blocks/classic-template/test/utils.ts @@ -1,27 +1,9 @@ /** * Internal dependencies */ +import { TEMPLATES } from '../constants'; import { getTemplateDetailsBySlug } from '../utils'; -const TEMPLATES = { - 'single-product': { - title: 'Single Product Title', - placeholder: 'Single Product Placeholder', - }, - 'archive-product': { - title: 'Product Archive Title', - placeholder: 'Product Archive Placeholder', - }, - 'taxonomy-product_cat': { - title: 'Product Taxonomy Title', - placeholder: 'Product Taxonomy Placeholder', - }, - 'taxonomy-product_attribute': { - title: 'Product Attribute Title', - placeholder: 'Product Attribute Placeholder', - }, -}; - describe( 'getTemplateDetailsBySlug', function () { it( 'should return single-product object when given an exact match', () => { expect( @@ -41,6 +23,24 @@ describe( 'getTemplateDetailsBySlug', function () { ).toStrictEqual( TEMPLATES[ 'single-product' ] ); } ); + it( 'should return taxonomy-product object when given a partial match', () => { + expect( + getTemplateDetailsBySlug( 'taxonomy-product_tag', TEMPLATES ) + ).toBeTruthy(); + expect( + getTemplateDetailsBySlug( 'taxonomy-product_tag', TEMPLATES ) + ).toStrictEqual( TEMPLATES[ 'taxonomy-product_tag' ] ); + } ); + + it( 'should return taxonomy-product object when given an exact match', () => { + expect( + getTemplateDetailsBySlug( 'taxonomy-product_brands', TEMPLATES ) + ).toBeTruthy(); + expect( + getTemplateDetailsBySlug( 'taxonomy-product_brands', TEMPLATES ) + ).toStrictEqual( TEMPLATES[ 'taxonomy-product' ] ); + } ); + it( 'should return null object when given an incorrect match', () => { expect( getTemplateDetailsBySlug( 'void', TEMPLATES ) ).toBeNull(); } ); diff --git a/assets/js/blocks/customer-account/index.tsx b/assets/js/blocks/customer-account/index.tsx index b1fc7e85f72..3f849b2c0f9 100644 --- a/assets/js/blocks/customer-account/index.tsx +++ b/assets/js/blocks/customer-account/index.tsx @@ -11,6 +11,7 @@ import { __ } from '@wordpress/i18n'; */ import metadata from './block.json'; import edit from './edit'; +import './style.scss'; registerBlockType( metadata, { icon: { diff --git a/assets/js/blocks/product-results-count/index.tsx b/assets/js/blocks/product-results-count/index.tsx index b83b17bf6af..0fd0be1eb50 100644 --- a/assets/js/blocks/product-results-count/index.tsx +++ b/assets/js/blocks/product-results-count/index.tsx @@ -10,6 +10,7 @@ import { totals } from '@woocommerce/icons'; */ import metadata from './block.json'; import edit from './edit'; +import './style.scss'; registerBlockType( metadata, { icon: { diff --git a/assets/js/blocks/product-tag/index.tsx b/assets/js/blocks/product-tag/index.tsx index fae42bf2c6c..3e0f742b704 100644 --- a/assets/js/blocks/product-tag/index.tsx +++ b/assets/js/blocks/product-tag/index.tsx @@ -8,9 +8,9 @@ import { Icon, tag } from '@wordpress/icons'; /** * Internal dependencies */ -import './editor.scss'; import metadata from './block.json'; import { Edit } from './edit'; +import './editor.scss'; /** * Register and run the "Products by Tag" block. diff --git a/assets/js/blocks/product-template/index.tsx b/assets/js/blocks/product-template/index.tsx index 1686814d123..6fc7771cc96 100644 --- a/assets/js/blocks/product-template/index.tsx +++ b/assets/js/blocks/product-template/index.tsx @@ -11,6 +11,7 @@ import metadata from './block.json'; import edit from './edit'; import save from './save'; import icon from './icon'; +import './style.scss'; const blockConfig: BlockConfiguration = { ...metadata, diff --git a/assets/js/editor-components/search-list-control/search-list-control.tsx b/assets/js/editor-components/search-list-control/search-list-control.tsx index 225e7e6d204..27b057742c1 100644 --- a/assets/js/editor-components/search-list-control/search-list-control.tsx +++ b/assets/js/editor-components/search-list-control/search-list-control.tsx @@ -34,6 +34,7 @@ import type { ListItemsProps, SearchListItemsContainerProps, } from './types'; +import './style.scss'; const defaultRenderListItem = ( args: renderItemArgs ): JSX.Element => { return ; diff --git a/assets/js/index.js b/assets/js/index.js index 3324889f387..cdb1e57a0be 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -5,7 +5,6 @@ import { getCategories, setCategories } from '@wordpress/blocks'; import { __ } from '@wordpress/i18n'; import { woo } from '@woocommerce/icons'; import { Icon } from '@wordpress/icons'; -import '@woocommerce/templates/revert-button'; /** * Internal dependencies diff --git a/bin/webpack-configs.js b/bin/webpack-configs.js index b5fb6f3f82d..5448a8f26bc 100644 --- a/bin/webpack-configs.js +++ b/bin/webpack-configs.js @@ -612,6 +612,109 @@ const getExtensionsConfig = ( options = {} ) => { }; }; +/** + * Build config for scripts to be used exclusively within the Site Editor context. + * + * @param {Object} options Build options. + */ +const getSiteEditorConfig = ( options = {} ) => { + const { alias, resolvePlugins = [] } = options; + const resolve = alias + ? { + alias, + plugins: resolvePlugins, + } + : { + plugins: resolvePlugins, + }; + return { + entry: getEntryConfig( 'editor', options.exclude || [] ), + output: { + devtoolNamespace: 'wc', + path: path.resolve( __dirname, '../build/' ), + filename: `[name].js`, + jsonpFunction: 'webpackWcBlocksExtensionsMethodExtensionJsonp', + }, + module: { + rules: [ + { + test: /\.(j|t)sx?$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader?cacheDirectory', + options: { + presets: [ + [ + '@wordpress/babel-preset-default', + { + modules: false, + targets: { + browsers: [ + 'extends @wordpress/browserslist-config', + ], + }, + }, + ], + ], + plugins: [ + isProduction + ? require.resolve( + 'babel-plugin-transform-react-remove-prop-types' + ) + : false, + '@babel/plugin-proposal-optional-chaining', + ].filter( Boolean ), + }, + }, + }, + { + test: /\.s[c|a]ss$/, + use: { + loader: 'ignore-loader', + }, + }, + ], + }, + optimization: { + concatenateModules: + isProduction && ! process.env.WP_BUNDLE_ANALYZER, + splitChunks: { + automaticNameDelimiter: '--', + }, + minimizer: [ + new TerserPlugin( { + cache: true, + parallel: true, + terserOptions: { + output: { + comments: /translators:/i, + }, + compress: { + passes: 2, + }, + mangle: { + reserved: [ '__', '_n', '_nx', '_x' ], + }, + }, + extractComments: false, + } ), + ], + }, + plugins: [ + ...getSharedPlugins( { + bundleAnalyzerReportTitle: 'Site Editor', + } ), + new ProgressBarPlugin( + getProgressBarPluginConfig( 'Site Editor' ) + ), + ], + resolve: { + ...resolve, + extensions: [ '.js', '.ts', '.tsx' ], + }, + }; +}; + /** * Build config for CSS Styles. * @@ -660,62 +763,32 @@ const getStylingConfig = ( options = {} ) => { chunks: 'all', priority: 10, }, - vendorsStyle: { - test: /[\/\\]node_modules[\/\\].*?style\.s?css$/, - name: 'wc-blocks-vendors-style', - chunks: 'all', - priority: 7, - }, - blocksStyle: { - // Capture all stylesheets with name `style` or name that starts with underscore (abstracts). - test: /(style|_.*)\.scss$/, - name: 'wc-blocks-style', - chunks: 'all', - priority: 5, - }, }, }, }, module: { rules: [ { - test: /[\/\\]node_modules[\/\\].*?style\.s?css$/, - use: [ - MiniCssExtractPlugin.loader, - { loader: 'css-loader', options: { importLoaders: 1 } }, - 'postcss-loader', - { - loader: 'sass-loader', - options: { - sassOptions: { - includePaths: [ 'node_modules' ], - }, - additionalData: ( content ) => { - const styleImports = [ - 'colors', - 'breakpoints', - 'variables', - 'mixins', - 'animations', - 'z-index', - ] - .map( - ( imported ) => - `@import "~@wordpress/base-styles/${ imported }";` - ) - .join( ' ' ); - return styleImports + content; - }, - }, + test: /\.(j|t)sx?$/, + use: { + loader: 'babel-loader?cacheDirectory', + options: { + presets: [ '@wordpress/babel-preset-default' ], + plugins: [ + isProduction + ? require.resolve( + 'babel-plugin-transform-react-remove-prop-types' + ) + : false, + ].filter( Boolean ), }, - ], + }, }, { test: /\.s?css$/, - exclude: /node_modules/, use: [ MiniCssExtractPlugin.loader, - { loader: 'css-loader', options: { importLoaders: 1 } }, + 'css-loader', 'postcss-loader', { loader: 'sass-loader', @@ -761,6 +834,7 @@ const getStylingConfig = ( options = {} ) => { ], }, plugins: [ + ...getSharedPlugins( { bundleAnalyzerReportTitle: 'Styles' } ), new ProgressBarPlugin( getProgressBarPluginConfig( 'Styles' ) ), new WebpackRTLPlugin( { filename: `[name]${ fileSuffix }-rtl.css`, @@ -776,7 +850,7 @@ const getStylingConfig = ( options = {} ) => { ], resolve: { ...resolve, - extensions: [ '.js', '.ts', '.tsx' ], + extensions: [ '.js', '.jsx', '.ts', '.tsx' ], }, }; }; @@ -851,6 +925,7 @@ module.exports = { getMainConfig, getPaymentsConfig, getExtensionsConfig, + getSiteEditorConfig, getStylingConfig, getInteractivityAPIConfig, }; diff --git a/bin/webpack-entries.js b/bin/webpack-entries.js index 0d61c431eb4..9e089bec793 100644 --- a/bin/webpack-entries.js +++ b/bin/webpack-entries.js @@ -110,27 +110,23 @@ const getBlockEntries = ( relativePath ) => { const entries = { styling: { - // @wordpress/components styles - 'custom-select-control-style': - './node_modules/wordpress-components/src/custom-select-control/style.scss', - 'snackbar-notice-style': - './node_modules/wordpress-components/src/snackbar/style.scss', - 'combobox-control-style': - './node_modules/wordpress-components/src/combobox-control/style.scss', - 'form-token-field-style': - './node_modules/wordpress-components/src/form-token-field/style.scss', - - 'general-style': glob.sync( './assets/**/*.scss', { - ignore: [ - // Block styles are added below. - './assets/js/blocks/*/*.scss', - ], - } ), - - 'packages-style': glob.sync( './packages/**/*.scss' ), - - 'reviews-style': './assets/js/blocks/reviews/editor.scss', - ...getBlockEntries( '**/*.scss' ), + // Packages styles + 'packages-style': glob.sync( './packages/**/index.js' ), + // Shared blocks code + 'wc-blocks': './assets/js/index.js', + // Blocks + 'product-image-gallery': + './assets/js/atomic/blocks/product-elements/product-image-gallery/index.ts', + 'product-reviews': + './assets/js/atomic/blocks/product-elements/product-reviews/index.tsx', + 'product-details': + './assets/js/atomic/blocks/product-elements/product-details/index.tsx', + 'add-to-cart-form': + './assets/js/atomic/blocks/product-elements/add-to-cart-form/index.tsx', + ...getBlockEntries( '{index,block,frontend}.{t,j}s{,x}' ), + // Templates + 'wc-blocks-classic-template-revert-button-style': + './assets/js/templates/revert-button/index.tsx', }, core: { wcBlocksRegistry: './assets/js/blocks-registry/index.js', @@ -171,6 +167,10 @@ const entries = { 'wc-shipping-method-pickup-location': './assets/js/extensions/shipping-methods/pickup-location/index.js', }, + editor: { + 'wc-blocks-classic-template-revert-button': + './assets/js/templates/revert-button/index.tsx', + }, }; const getEntryConfig = ( type = 'main', exclude = [] ) => { diff --git a/composer.json b/composer.json index 350ae0eb539..bbe346276cd 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "WooCommerce blocks for the Gutenberg editor.", "homepage": "https://woocommerce.com/", "type": "wordpress-plugin", - "version": "10.6.1", + "version": "10.6.2", "keywords": [ "gutenberg", "woocommerce", diff --git a/docs/internal-developers/testing/releases/1062.md b/docs/internal-developers/testing/releases/1062.md new file mode 100644 index 00000000000..4fad5c319a5 --- /dev/null +++ b/docs/internal-developers/testing/releases/1062.md @@ -0,0 +1,60 @@ +# Testing notes and ZIP for release 10.6.2 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/12214223/woocommerce-gutenberg-products-block.zip) + +## WooCommerce Core + +### Fix: WooCommerce Blocks causing malfunction of the navigation block on WordPress 6.3. [#10388](https://github.com/woocommerce/woocommerce-blocks/pull/10388) + +1. Ensure you have a local install up and running with the release candidate version of WordPress 6.3. You can do so by downloading it via WP-CLI: `wp core update --version=6.3-RC1 --force` followed by `wp core update-db`. Alternatively, you can also download the zip for the release [over here](https://wordpress.org/wordpress-6.3-RC1.zip). +2. Ensure you have a block theme enabled such as Twenty-Twenty Three +3. Create a new post +4. Insert the navigation block +5. Make sure you can correctly preview it without any problems, as demonstrated in the screenshot in the description of this PR. +6. Now head over to Appearence > Editor > Templates > Product Catalog and edit it. +7. If you are seeing the "WooCommerce Product Grid Block", click on "Transform into blocks": + +Screenshot 2023-07-27 at 18 56 37 + +8. Now, on the sidebar, click on Template and ensure the "Revert to classic template" button is visible (as demonstrated on the screenshot in the description of this PR). +9. Click on "Revert to classic template" button and make sure everything works as expected: the product blocks should be replaced with the "WooCommerce Product Grid Block". + +### Check if WordPress version is higher than 6.2.2 to make Products block compatible with Gutenberg 16+. [#10360](https://github.com/woocommerce/woocommerce-blocks/pull/10360) + +| Before - no layout option is chosen, which defaults to list | After - grid option is chosen by default| +| ------ | ----- | +| image | image | + +Check below steps in following configurations: + +- WordPress 6.2: + - [ ] Gutenberg 16 enabled + - [ ] Gutenberg 16 disabled +- WordPress 6.3: + - [ ] Gutenberg 16 enabled + - [ ] Gutenberg 16 disabled + +1. Create new post +2. Add Products (Beta) block +3. **Expected**: It has grid layout applied by default + +### Render Checkout/Cart containing pages without template overriding. [#10359](https://github.com/woocommerce/woocommerce-blocks/pull/10359) + +1. Create a page/post with cart or checkout shortcodes, and save it with a different slug from the ones in WooCommerce > Advanced screen. +2. Add extra test content. +3. On the store, accessing the page/post will render it properly. Accessing the cart/checkout endpoints presented on WooCommerce > Advanced screen + +### Remove opinionated styles from Product Hero pattern. [#10255](https://github.com/woocommerce/woocommerce-blocks/pull/10255) + +1. In the post editor or the site editor, add the Product Hero pattern. +2. Verify it looks like the _After_ patterns in screenshot below (styles adapt to the theme) and it matches the design (see ). + +Desktop | Mobile +--- | --- +![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/8c320dea-bd0c-4a6c-af10-12121b3784f4) | ![imatge](https://github.com/woocommerce/woocommerce-blocks/assets/3616980/ee00385b-4752-4f5f-b44c-5549f8b2b604) + +### Per block stylesheets. [#9831](https://github.com/woocommerce/woocommerce-blocks/pull/9831) + +1. Create a post or page and add the All Products block. Verify styles are loaded correctly. +2. Visit the page in the frontend and verify styles are loaded correctly in the frontend as well. +3. Repeat steps 1 and 2 with all blocks listed on [this page](https://wordpress.org/plugins/woo-gutenberg-products-block/). Make sure to test each block individually. So, when possible, try with only one block on the page (in some cases, that's not possible, ie: filter blocks, in that case, try with as few blocks as possible on the page). The reason is that we want to make sure each block includes the style dependencies that it needs, so they need to be tested in isolation, otherwise styles from other blocks might leak into other blocks and "help fix issues". diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index be8dae9f598..9be54002a78 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -159,6 +159,7 @@ Every release includes specific testing instructions for new features and bug fi - [10.5.0](./1050.md) - [10.6.0](./1060.md) - [10.6.1](./1061.md) + - [10.6.2](./1062.md) diff --git a/package-lock.json b/package-lock.json index 793b2c0a47f..0d2b59aef55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@woocommerce/block-library", - "version": "10.6.1", + "version": "10.6.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@woocommerce/block-library", - "version": "10.6.1", + "version": "10.6.2", "hasInstallScript": true, "license": "GPL-3.0+", "dependencies": { diff --git a/package.json b/package.json index 53c85444c42..a77f3130afc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "10.6.1", + "version": "10.6.2", "description": "WooCommerce blocks for the Gutenberg editor.", "homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/", "keywords": [ @@ -27,8 +27,7 @@ "./assets/js/blocks/filter-wrapper/register-components.ts", "./assets/js/blocks/product-query/variations/**.tsx", "./assets/js/blocks/product-query/index.tsx", - "./assets/js/blocks/product-query/inspector-controls.tsx", - "./assets/js/templates/revert-button/index.tsx" + "./assets/js/blocks/product-query/inspector-controls.tsx" ], "repository": { "type": "git", diff --git a/packages/checkout/components/checkbox-control/style.scss b/packages/checkout/components/checkbox-control/style.scss index 71173748314..47843f0c52c 100644 --- a/packages/checkout/components/checkbox-control/style.scss +++ b/packages/checkout/components/checkbox-control/style.scss @@ -1,7 +1,7 @@ .wc-block-components-checkbox { @include reset-color(); @include reset-typography(); - margin-top: em($gap-large); + margin-top: em($gap); label { align-items: flex-start; diff --git a/patterns/product-hero.php b/patterns/product-hero.php index 9fc61b06dd6..648b75ab61d 100644 --- a/patterns/product-hero.php +++ b/patterns/product-hero.php @@ -19,25 +19,25 @@
- -