* Empty commit for release pull request

* Added readme.txt changelog entry

* Update HPOS compatibility snippet (https://github.com/woocommerce/woocommerce-blocks/pull/7395)

* 8.7.2 Testing notes

* Update testing notes

* Update testing notes

* Bumped version

* Refactor force billing: remove forcedBillingAddress from conditions for showBillingFields (https://github.com/woocommerce/woocommerce-blocks/pull/7393)

Co-authored-by: Niels Lange <info@nielslange.de>

* Updated testing instructions and changelog to include woocommerce/woocommerce-blocks#7393

* Updated testing zip

* Bumping version strings to new version.

* Empty commit for release pull request

* Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434)

* Construct args for canMakePayment with correct keys

* When the CheckoutEventsContext mounts, initialize payment store

* Destructure useSelect correctly

* Dispatch __internalInitializePaymentStore in selector tests

* Update selector name to __internalUpdateAvailablePaymentMethods

* Remove check for editor when registering checkout store

* Add check for when express payment methods have updated too

* Ensure billingAddress key exists in canMakePayment arg

* Use editor context to know if we're in editor

* Updated readme.txt

* Reverted stable tag change on readme.txt

* Testing instructions

* Cleaned out testing instructions

* Bumping version strings to new version.

* Empty commit for release pull request

* Testing instructions

* package-lock.json version bump

* Revert "Fix `useForcedLayout` to re-select inner blocks after we manually insert one (https://github.com/woocommerce/woocommerce-blocks/pull/6676)" (https://github.com/woocommerce/woocommerce-blocks/pull/7447)

This reverts commit 25e24708b5.

* Testing zip

* Bumping version strings to new version.

* add testing instructions

* upload a new zip file

* Update styles of the Filter by Attribute dropdown so it looks good in TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7506)

* Use theme's body background color as the mini cart contents default background color (https://github.com/woocommerce/woocommerce-blocks/pull/7510)

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Price Slider: use `currentColor` for the slider (https://github.com/woocommerce/woocommerce-blocks/pull/7527)

* Fixed Price Slider Issue

Located where the price slider was hard coded and replaced it.

* fix CSS lint

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* use currentColor instead of hard-coded color for the slider of the Filter By Price block woocommerce/woocommerce-blocks#7130

use currentColor instead of hard-coded color for the slider of the Filte By Price block

* remove background-color

Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>

* Make price slider 'inactive' range half transparent so it looks better in dark themes (https://github.com/woocommerce/woocommerce-blocks/pull/7525)

* Fix inconsistent button styling with TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7516)

* fix inconsistent button styling with TT3

* use wc_wp_theme_get_element_class_name

* add check to be sure that wc_wp_theme_get_element_class_name function exists

* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379 (https://github.com/woocommerce/woocommerce-blocks/pull/7515)

* Fix Mini Cart Block global styles woocommerce/woocommerce-blocks#7379

Fix Mini Cart Block global styles

* add font_size

* upload a new build

* Bumping version strings to new version.

* update changelog

* Empty commit for release pull request

* add testing instructions

* update zip file link

* Prevent Mini Cart loading the same script twice (https://github.com/woocommerce/woocommerce-blocks/pull/7794)

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: EmptySet-Exe <46509186+EmptySet-Exe@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2022-12-01 19:10:33 +01:00 committed by GitHub
parent 5d3bd76eb3
commit f06c43ab4c
9 changed files with 50 additions and 13 deletions

View File

@ -26,8 +26,16 @@ interface AppendScriptAttributesParam {
* This function checks whether an element matching that selector exists.
* Useful to know if a script has already been appended to the page.
*/
const isScriptTagInDOM = ( scriptId: string ): boolean => {
const scriptElements = document.querySelectorAll( `script#${ scriptId }` );
const isScriptTagInDOM = ( scriptId: string, src = '' ): boolean => {
const srcParts = src.split( '?' );
if ( srcParts?.length > 1 ) {
src = srcParts[ 0 ];
}
const selector = src
? `script#${ scriptId }, script[src*="${ src }"]`
: `script#${ scriptId }`;
const scriptElements = document.querySelectorAll( selector );
return scriptElements.length > 0;
};
@ -37,7 +45,10 @@ const isScriptTagInDOM = ( scriptId: string ): boolean => {
*/
const appendScript = ( attributes: AppendScriptAttributesParam ): void => {
// Abort if id is not valid or a script with the same id exists.
if ( ! isString( attributes.id ) || isScriptTagInDOM( attributes.id ) ) {
if (
! isString( attributes.id ) ||
isScriptTagInDOM( attributes.id, attributes?.src )
) {
return;
}
const scriptElement = document.createElement( 'script' );
@ -92,7 +103,7 @@ const lazyLoadScript = ( {
translations,
}: LazyLoadScriptParams ): Promise< void > => {
return new Promise( ( resolve, reject ) => {
if ( isScriptTagInDOM( `${ handle }-js` ) ) {
if ( isScriptTagInDOM( `${ handle }-js`, src ) ) {
resolve();
}

View File

@ -13,9 +13,12 @@ const preloadScript = ( {
src,
version,
}: PreloadScriptParams ): void => {
const handleScriptElements = document.querySelectorAll(
`#${ handle }-js, #${ handle }-js-prefetch`
);
const srcParts = src.split( '?' );
if ( srcParts?.length > 1 ) {
src = srcParts[ 0 ];
}
const selector = `#${ handle }-js, #${ handle }-js-prefetch, script[src*="${ src }"]`;
const handleScriptElements = document.querySelectorAll( selector );
if ( handleScriptElements.length === 0 ) {
const prefetchLink = document.createElement( 'link' );

View File

@ -0,0 +1,15 @@
# Testing notes and ZIP for release 8.7.6
Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10134947/woocommerce-gutenberg-products-block.zip)
## Feature plugin and package inclusion in WooCommerce
### Mini Cart block: fix compatibility with Page Optimize and Product Bundles plugins [#7794](https://github.com/woocommerce/woocommerce-blocks/pull/7794) [#7813](https://github.com/woocommerce/woocommerce-blocks/pull/7813)
1. Install [Page Optimize](https://wordpress.org/plugins/page-optimize/) and [Product Bundles](https://woocommerce.com/products/product-bundles/).
2. Enable a block theme.
3. Customize the block theme and add the Mini Cart block in the header via Site Editor.
4. Save the changes.
5. In the frontend, lick on the Mini Cart. The drawer should open and show the "empty cart" message.
6. Go to the shop page and add a product to your cart.
7. Click on the Mini Cart. The drawer should open and show the product you just added.

View File

@ -97,6 +97,7 @@ Every release includes specific testing instructions for new features and bug fi
- [8.7.3](./873.md)
- [8.7.4](./874.md)
- [8.7.5](./875.md)
- [8.7.6](./876.md)
<!-- FEEDBACK -->

View File

@ -2,7 +2,7 @@
"name": "@woocommerce/block-library",
"title": "WooCommerce Blocks",
"author": "Automattic",
"version": "8.7.5",
"version": "8.7.6",
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
"keywords": [

View File

@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
Requires at least: 6.0
Tested up to: 6.0
Requires PHP: 7.0
Stable tag: 8.7.5
Stable tag: 8.7.6
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@ -80,6 +80,13 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/
== Changelog ==
= 8.7.6 - 2022-12-01
#### Bug Fixes
- Mini Cart block: fix compatibility with Page Optimize and Product Bundles plugins [#7794](https://github.com/woocommerce/woocommerce-blocks/pull/7794)
- Mini Cart block: Load wc-blocks-registry package at the page's load instead of lazy load it [#7813](https://github.com/woocommerce/woocommerce-blocks/pull/7813)
= 8.7.5 - 2022-10-31 =
#### Enhancements

View File

@ -103,7 +103,7 @@ class MiniCart extends AbstractBlock {
$script = [
'handle' => 'wc-' . $this->block_name . '-block-frontend',
'path' => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
'dependencies' => [],
'dependencies' => [ 'wc-blocks-registry' ],
];
return $key ? $script[ $key ] : $script;
}
@ -273,7 +273,7 @@ class MiniCart extends AbstractBlock {
}
}
}
if ( ! $script->src ) {
if ( ! $script->src || 'wc-blocks-registry' === $script->handle ) {
return;
}

View File

@ -109,7 +109,7 @@ class Package {
NewPackage::class,
function ( $container ) {
// leave for automated version bumping.
$version = '8.7.5';
$version = '8.7.6';
return new NewPackage(
$version,
dirname( __DIR__ ),

View File

@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Blocks
* Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
* Description: WooCommerce blocks for the Gutenberg editor.
* Version: 8.7.5
* Version: 8.7.6
* Author: Automattic
* Author URI: https://woocommerce.com
* Text Domain: woo-gutenberg-products-block