From 3c4995e5eab636d253738096127c358dc9a7516f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Jan 2022 12:23:10 +0100 Subject: [PATCH 01/12] Release: 6.7.0 (#5478) * Empty commit for release pull request * Update readme.txt with 6.7.0 changelog * Add testing notes for the 6.7.0 release * Fix typo in testing notes * Update Testing Notes * Remove item from testing notes for 6.7.0 * Bumping version strings to new version. Co-authored-by: github-actions Co-authored-by: Raluca Stan --- docs/testing/releases/670.md | 87 ++++++++++++++++++++++++ docs/testing/releases/README.md | 1 + package.json | 2 +- readme.txt | 18 ++++- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 6 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 docs/testing/releases/670.md diff --git a/docs/testing/releases/670.md b/docs/testing/releases/670.md new file mode 100644 index 00000000000..679de923a42 --- /dev/null +++ b/docs/testing/releases/670.md @@ -0,0 +1,87 @@ +## Testing notes and ZIP for release 6.7.0 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-gutenberg-products-block/files/7802539/woocommerce-gutenberg-products-block.zip) + +## Feature Plugin + +### Fixed an issue where the checkout address fields would be blank for logged in customers. ([5473](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5473)) + +1. While logged in, with a customer than has checked out before, visit the Checkout block page +2. Confirm shipping address fields are populated +3. Toggle the `Different billing address` box. Confirm that the billing fields are populated. +4. Finish your purchase successfully + +### Prevent a 0 value shipping price being shown in the Checkout if no shipping methods are available. ([5444](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5444)) + +| Before | After | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| ![image](https://user-images.githubusercontent.com/5656702/147132243-bd42c69c-415b-45d6-9e7f-ebd02e1c0ab9.png) | ![image](https://user-images.githubusercontent.com/5656702/147132055-1efbd023-f99c-4651-bccc-5608ddc7ba7a.png) | + +1. Go to WooCommerce > Settings > Shipping and remove all shipping methods, including shipping methods for `Locations not covered by your other zones`. +2. Add a shipping zone for a specific country, for example USA. +3. Add some methods to this zone, free shipping and flat rate are fine. +4. Add some items to the cart. +5. Go to the Cart. +6. Check you can still use the shipping calculator. +7. Check that the shipping rates show when using a USA address. +8. Check the error shows when using an address from another country, e.g. UK. +9. Go to the Checkout block. +10. Notice the shipping subtotal does not contain a price if your address is in an invalid country. +11. Change country on the Checkout form. +12. Notice that a shipping price is only shown when the address is in a valid country. +13. Try changing country back and forth and selecting different shipping rates. + +### Ensure that the translation of the "Proceed to Checkout" button is working. ([5453](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5453)) + +| Before | After | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| ![image](https://user-images.githubusercontent.com/3323310/147332014-9d76312d-a0a4-4682-94fa-5fbed6957380.png) | ![image](https://user-images.githubusercontent.com/3323310/147332020-48140705-4b7f-44e4-b967-0459424a33cd.png) | + +1. Create a test page and add the Cart block. +2. Go to `/wp-admin/options-general.php` and change the site language to `Norsk bokmål`. +3. Go to `/wp-admin/update-core.php` and update the translations. +4. Go to the front-end page, add a product to cart and visit the Cart block. +5. See that the "Proceed to Checkout" button is now translated. + +### Added global styles (text color) to the Active Product Filters block. ([5465](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5465)) + +![image](https://user-images.githubusercontent.com/4463174/147587196-86b1ee61-8ec9-41c3-a9dd-0a709b68e513.png) + +1. Install and enable the `Gutenberg` plugin. +2. Install and enable the `TT1 Blocks` theme. +3. Add the Active Product Filters block block to a post. (you need to add a block like `Filters Product By Attribute`) +4. Go to Color section & verify you can change the text color. +5. Save your changes. +6. Go on the page and check if there are changes. +7. Reset to default using the `Clear` button from Styles > Text color window. +8. Go to Dashboard and select Appearance > Editor (beta). +9. On the Editor page click on the `Styles` icon on the right-top corner. +10. Verify that the Active Product Filters block is shown Under the `Blocks` section . +11. Save your changes. +12. Go on the page created earlier and check if all styles are applied correctly. +13. Edit your previous post/page again. +14. Change again the text color. +15. Save your changes. +16. Check if these styles have priority over the styles from the Site Editor. + +## Feature plugin and package inclusion in WooCommerce + +### Account for products without variations in the On Sale Products block. ([5470](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5470)) + +On an store with no products add the Query Monitor extension, then: + +1. Add 2 simple products on sale and publish them. +2. Go to a test page and add the On Sale Products block. +3. Visit the front-end page. +4. Notice that no MySQL error is present in Query Monitor extension. + +### Remove text decorations from product filtering blocks items. ([5384](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5384)) + +| Before | After | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| ![image](https://user-images.githubusercontent.com/3323310/146129258-794efe6d-b73d-4d33-a7f6-421e0ecaad3f.png) | ![image](https://user-images.githubusercontent.com/3323310/146129264-df7a0531-286c-4316-ab22-5605735d6e26.png) | + +1. Create a test page. +2. Add the Filter Products by Attribute, Filter Products by Stock and All Products blocks to it. +3. Visit the front-end test page. +4. Verify that the options within the Filter Products by Attribute and Filter Products by Stock blocks are not underlined. diff --git a/docs/testing/releases/README.md b/docs/testing/releases/README.md index b980aa58bab..85aa3c63e70 100644 --- a/docs/testing/releases/README.md +++ b/docs/testing/releases/README.md @@ -54,3 +54,4 @@ Every release includes specific testing instructions for new features and bug fi - [6.4.0](./640.md) - [6.5.0](./650.md) - [6.6.0](./660.md) +- [6.7.0](./670.md) diff --git a/package.json b/package.json index 6d4571802da..8ca10584af9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "6.7.0-dev", + "version": "6.7.0", "description": "WooCommerce blocks for the Gutenberg editor.", "homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/", "keywords": [ diff --git a/readme.txt b/readme.txt index efb2a6db9d7..f0d6a942ef4 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 5.8 Tested up to: 5.8 Requires PHP: 7.0 -Stable tag: 6.7.0-dev +Stable tag: 6.7.0 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -85,6 +85,22 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 6.7.0 - 2022-01-03 = + +#### Enhancements + +- Added global styles (text color) to the Active Filters block. ([5465](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5465)) +- Prevent a 0 value shipping price being shown in the Checkout if no shipping methods are available. ([5444](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5444)) + +#### Bug Fixes + +- Fixed an issue where the checkout address fields would be blank for logged in customers. ([5473](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5473)) +- Account for products without variations in the On Sale Products block. ([5470](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5470)) +- Update the template retrieving logic to allow for older Gutenberg convention and newer one (`block-templates`/`block-template-parts` vs. `templates`/`parts`). ([5455](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5455)) +- Ensure that the translation of the "Proceed to Checkout" button is working. ([5453](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5453)) +- Fix custom templates with fallback to archive being incorrectly attributed to the user in the editor instead of the parent theme. ([5447](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5447)) +- Remove text decorations from product filtering blocks items. ([5384](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5384)) + = 6.6.0 - 2021-12-20 = #### Bug Fixes diff --git a/src/Package.php b/src/Package.php index 652922448f0..386fbe2da41 100644 --- a/src/Package.php +++ b/src/Package.php @@ -106,7 +106,7 @@ public static function container( $reset = false ) { NewPackage::class, function ( $container ) { // leave for automated version bumping. - $version = '6.7.0-dev'; + $version = '6.7.0'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index 4eacc006253..cbb61d56fcc 100644 --- a/woocommerce-gutenberg-products-block.php +++ b/woocommerce-gutenberg-products-block.php @@ -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: 6.7.0-dev + * Version: 6.7.0 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block From 06a02ab5eb4aa8b11215596bf75c2c36d9fba77b Mon Sep 17 00:00:00 2001 From: Raluca Stan Date: Tue, 4 Jan 2022 12:33:01 +0100 Subject: [PATCH 02/12] Update 6.8.0-dev tag --- package-lock.json | 2 +- package.json | 2 +- readme.txt | 2 +- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc54d6d3251..46b84be691b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@woocommerce/block-library", - "version": "6.7.0-dev", + "version": "6.8.0-dev", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 8ca10584af9..aed342bcb62 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "6.7.0", + "version": "6.8.0-dev", "description": "WooCommerce blocks for the Gutenberg editor.", "homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/", "keywords": [ diff --git a/readme.txt b/readme.txt index f0d6a942ef4..7b06844158d 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 5.8 Tested up to: 5.8 Requires PHP: 7.0 -Stable tag: 6.7.0 +Stable tag: 6.8.0-dev License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/src/Package.php b/src/Package.php index 386fbe2da41..c6968c344f6 100644 --- a/src/Package.php +++ b/src/Package.php @@ -106,7 +106,7 @@ public static function container( $reset = false ) { NewPackage::class, function ( $container ) { // leave for automated version bumping. - $version = '6.7.0'; + $version = '6.8.0-dev'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index cbb61d56fcc..5cf3ec2123b 100644 --- a/woocommerce-gutenberg-products-block.php +++ b/woocommerce-gutenberg-products-block.php @@ -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: 6.7.0 + * Version: 6.8.0-dev * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block From 0c43f37583f8caea1f4f94b3bfa9cb12918830b3 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 4 Jan 2022 14:12:08 +0000 Subject: [PATCH 03/12] Prevent duplicate hooks in hook docs (#5472) * Update wp-hooks-generator * Update inline hook documentation into consistent format 1. Hook docs for the same hook should be identical 2. Prefix with `Hook: ` so the case of the hook is not changed. 3. Use `@see` instead of `@hooked`. Hooked is not a standard PHP Doc tag. cc @Aljullu * Update hook doc script to support duplicate hooks across files * Remove unused variables in function Co-authored-by: Thomas Roberts --- bin/hook-docs/actions/index.js | 6 +- bin/hook-docs/data/actions.json | 194 ++++++++++++++--------- bin/hook-docs/data/filters.json | 93 +++++++---- bin/hook-docs/filters/index.js | 6 +- bin/hook-docs/format-hook-doc/files.js | 11 ++ bin/hook-docs/format-hook-doc/index.js | 3 +- bin/hook-docs/format-hook-doc/related.js | 4 +- bin/hook-docs/index.js | 28 +++- composer.json | 2 +- composer.lock | 22 ++- docs/extensibility/actions.md | 135 ++++++++-------- docs/extensibility/filters.md | 63 ++++---- src/BlockTypes/LegacyTemplate.php | 54 ++++--- 13 files changed, 378 insertions(+), 243 deletions(-) create mode 100644 bin/hook-docs/format-hook-doc/files.js diff --git a/bin/hook-docs/actions/index.js b/bin/hook-docs/actions/index.js index a2fe2feb31b..ddcd9a9eb5a 100644 --- a/bin/hook-docs/actions/index.js +++ b/bin/hook-docs/actions/index.js @@ -15,6 +15,7 @@ const { returns, example, related, + files, } = require( '../format-hook-doc' ); const { createDocs, @@ -52,9 +53,8 @@ const generate = ( hooks ) => { ...sectionWithHeading( exceptions( hookDocs ), 'Exceptions' ), ...sectionWithHeading( returns( hookDocs ), 'Returns' ), ...sectionWithHeading( example( hookDocs ), 'Example' ), - ...sectionWithHeading( related( hookDocs ), 'Related' ), - { h3: `Source` }, - { p: `File: [${ hook.file }](../src/${ hook.file })` }, + ...sectionWithHeading( related( hookDocs ), 'See' ), + ...sectionWithHeading( files( hook.file ), 'Source' ), { hr: '' }, ].filter( Boolean ); } ), diff --git a/bin/hook-docs/data/actions.json b/bin/hook-docs/data/actions.json index b5b8ac0faab..2b5553e8697 100644 --- a/bin/hook-docs/data/actions.json +++ b/bin/hook-docs/data/actions.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/johnbillion/wp-hooks-generator/0.6.1/schema.json", + "$schema": "https://raw.githubusercontent.com/johnbillion/wp-hooks-generator/0.7.0/schema.json", "hooks": [ { "name": "woocommerce_add_to_cart", @@ -59,39 +59,44 @@ } ], "long_description_html": "

This hook fires when an item is added to the cart. This is triggered from the Store API in this context, but WooCommerce core add to cart events trigger the same hook.

" - } + }, + "args": 6 }, { "name": "woocommerce_after_main_content", "file": "BlockTypes/LegacyTemplate.php", "type": "action", "doc": { - "description": "Hook: woocommerce_after_main_content.", - "long_description": "", + "description": "Hook: woocommerce_after_main_content", + "long_description": "Called after rendering the main content for a product.", "tags": [ { - "name": "hooked", - "content": "woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)" + "name": "see", + "content": "Outputs closing DIV for the content (priority 10)", + "refers": "woocommerce_output_content_wrapper_end()" } ], - "long_description_html": "" - } + "long_description_html": "

Called after rendering the main content for a product.

" + }, + "args": 0 }, { "name": "woocommerce_after_main_content", "file": "BlockTypes/LegacyTemplate.php", "type": "action", "doc": { - "description": "Woocommerce_after_main_content hook.", - "long_description": "", + "description": "Hook: woocommerce_after_main_content", + "long_description": "Called after rendering the main content for a product.", "tags": [ { - "name": "hooked", - "content": "woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)" + "name": "see", + "content": "Outputs closing DIV for the content (priority 10)", + "refers": "woocommerce_output_content_wrapper_end()" } ], - "long_description_html": "" - } + "long_description_html": "

Called after rendering the main content for a product.

" + }, + "args": 0 }, { "name": "woocommerce_after_shop_loop", @@ -102,12 +107,14 @@ "long_description": "", "tags": [ { - "name": "hooked", - "content": "woocommerce_pagination - 10" + "name": "see", + "content": "Renders pagination (priority 10)", + "refers": "woocommerce_pagination()" } ], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_applied_coupon", @@ -127,7 +134,8 @@ } ], "long_description_html": "" - } + }, + "args": 1 }, { "name": "woocommerce_archive_description", @@ -138,60 +146,75 @@ "long_description": "", "tags": [ { - "name": "hooked", - "content": "woocommerce_taxonomy_archive_description - 10" + "name": "see", + "content": "Renders the taxonomy archive description (priority 10)", + "refers": "woocommerce_taxonomy_archive_description()" }, { - "name": "hooked", - "content": "woocommerce_product_archive_description - 10" + "name": "see", + "content": "Renders the product archive description (priority 10)", + "refers": "woocommerce_product_archive_description()" } ], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_before_main_content", "file": "BlockTypes/LegacyTemplate.php", "type": "action", "doc": { - "description": "Woocommerce_before_main_content hook.", - "long_description": "", + "description": "Hook: woocommerce_before_main_content", + "long_description": "Called before rendering the main content for a product.", "tags": [ { - "name": "hooked", - "content": "woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)" + "name": "see", + "content": "Outputs opening DIV for the content (priority 10)", + "refers": "woocommerce_output_content_wrapper()" }, { - "name": "hooked", - "content": "woocommerce_breadcrumb - 20" + "name": "see", + "content": "Outputs breadcrumb trail to the current product (priority 20)", + "refers": "woocommerce_breadcrumb()" + }, + { + "name": "see", + "content": "Outputs schema markup (priority 30)", + "refers": "WC_Structured_Data::generate_website_data()" } ], - "long_description_html": "" - } + "long_description_html": "

Called before rendering the main content for a product.

" + }, + "args": 0 }, { "name": "woocommerce_before_main_content", "file": "BlockTypes/LegacyTemplate.php", "type": "action", "doc": { - "description": "Hook: woocommerce_before_main_content.", - "long_description": "", + "description": "Hook: woocommerce_before_main_content", + "long_description": "Called before rendering the main content for a product.", "tags": [ { - "name": "hooked", - "content": "woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)" + "name": "see", + "content": "Outputs opening DIV for the content (priority 10)", + "refers": "woocommerce_output_content_wrapper()" }, { - "name": "hooked", - "content": "woocommerce_breadcrumb - 20" + "name": "see", + "content": "Outputs breadcrumb trail to the current product (priority 20)", + "refers": "woocommerce_breadcrumb()" }, { - "name": "hooked", - "content": "WC_Structured_Data::generate_website_data() - 30" + "name": "see", + "content": "Outputs schema markup (priority 30)", + "refers": "WC_Structured_Data::generate_website_data()" } ], - "long_description_html": "" - } + "long_description_html": "

Called before rendering the main content for a product.

" + }, + "args": 0 }, { "name": "woocommerce_before_shop_loop", @@ -202,20 +225,24 @@ "long_description": "", "tags": [ { - "name": "hooked", - "content": "woocommerce_output_all_notices - 10" + "name": "see", + "content": "Render error notices (priority 10)", + "refers": "woocommerce_output_all_notices()" }, { - "name": "hooked", - "content": "woocommerce_result_count - 20" + "name": "see", + "content": "Show number of results found (priority 20)", + "refers": "woocommerce_result_count()" }, { - "name": "hooked", - "content": "woocommerce_catalog_ordering - 30" + "name": "see", + "content": "Show form to control sort order (priority 30)", + "refers": "woocommerce_catalog_ordering()" } ], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_blocks_cart_enqueue_data", @@ -226,7 +253,8 @@ "long_description": "", "tags": [], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_blocks_cart_enqueue_data", @@ -237,7 +265,8 @@ "long_description": "", "tags": [], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_blocks_cart_update_customer_from_request", @@ -265,7 +294,8 @@ } ], "long_description_html": "" - } + }, + "args": 2 }, { "name": "woocommerce_blocks_cart_update_order_from_request", @@ -301,7 +331,8 @@ } ], "long_description_html": "" - } + }, + "args": 2 }, { "name": "woocommerce_blocks_checkout_enqueue_data", @@ -312,7 +343,8 @@ "long_description": "", "tags": [], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_blocks_checkout_order_processed", @@ -341,7 +373,8 @@ } ], "long_description_html": "

This hook informs extensions that $order has completed processing and is ready for payment.

This is similar to existing core hook woocommerce_checkout_order_processed. We're using a new action:

  • To keep the interface focused (only pass $order, not passing request data).
  • This also explicitly indicates these orders are from checkout block/StoreAPI.
" - } + }, + "args": 1 }, { "name": "woocommerce_blocks_checkout_update_order_from_request", @@ -369,7 +402,8 @@ } ], "long_description_html": "

This hook gives extensions the chance to update orders based on the data in the request. This can be used in conjunction with the ExtendRestAPI class to post custom data and then process it.

" - } + }, + "args": 2 }, { "name": "woocommerce_blocks_checkout_update_order_meta", @@ -394,7 +428,8 @@ } ], "long_description_html": "

This hook gives extensions the chance to add or update meta data on the $order.

This is similar to existing core hook woocommerce_checkout_update_order_meta. We're using a new action:

  • To keep the interface focused (only pass $order, not passing request data).
  • This also explicitly indicates these orders are from checkout block/StoreAPI.
" - } + }, + "args": 1 }, { "name": "woocommerce_blocks_enqueue_cart_block_scripts_after", @@ -405,7 +440,8 @@ "long_description": "", "tags": [], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_blocks_enqueue_cart_block_scripts_before", @@ -416,7 +452,8 @@ "long_description": "", "tags": [], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_blocks_enqueue_checkout_block_scripts_after", @@ -427,7 +464,8 @@ "long_description": "", "tags": [], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_blocks_enqueue_checkout_block_scripts_before", @@ -438,7 +476,8 @@ "long_description": "", "tags": [], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_blocks_loaded", @@ -449,7 +488,8 @@ "long_description": "This hook is intended to be used as a safe event hook for when the plugin has been loaded, and all dependency requirements have been met.", "tags": [], "long_description_html": "

This hook is intended to be used as a safe event hook for when the plugin has been loaded, and all dependency requirements have been met.

" - } + }, + "args": 0 }, { "name": "woocommerce_blocks_{$this->registry_identifier}_registration", @@ -469,7 +509,8 @@ } ], "long_description_html": "

Runs before integrations are initialized allowing new integration to be registered for use. This should be used as the primary hook for integrations to include their scripts, styles, and other code extending the blocks.

" - } + }, + "args": 1 }, { "name": "woocommerce_check_cart_items", @@ -480,7 +521,8 @@ "long_description": "Allow 3rd parties to validate cart items. This is a legacy hook from Woo core. This filter will be deprecated because it encourages usage of wc_add_notice. For the API we need to capture notices and convert to exceptions instead.", "tags": [], "long_description_html": "

Allow 3rd parties to validate cart items. This is a legacy hook from Woo core. This filter will be deprecated because it encourages usage of wc_add_notice. For the API we need to capture notices and convert to exceptions instead.

" - } + }, + "args": 0 }, { "name": "woocommerce_created_customer", @@ -516,7 +558,8 @@ } ], "long_description_html": "

This hook fires after customer accounts are created and passes the customer data.

" - } + }, + "args": 3 }, { "name": "woocommerce_no_products_found", @@ -527,12 +570,14 @@ "long_description": "", "tags": [ { - "name": "hooked", - "content": "wc_no_products_found - 10" + "name": "see", + "content": "Default no products found content (priority 10)", + "refers": "wc_no_products_found()" } ], "long_description_html": "" - } + }, + "args": 0 }, { "name": "woocommerce_register_post", @@ -568,7 +613,8 @@ } ], "long_description_html": "

This hook fires before customer accounts are created and passes the form data (username, email) and an array of errors.

This could be used to add extra validation logic and append errors to the array.

" - } + }, + "args": 3 }, { "name": "woocommerce_rest_checkout_process_payment_with_context", @@ -607,7 +653,8 @@ } ], "long_description_html": "" - } + }, + "args": 1 }, { "name": "woocommerce_shop_loop", @@ -618,7 +665,8 @@ "long_description": "", "tags": [], "long_description_html": "" - } + }, + "args": 0 }, { "name": "wooocommerce_store_api_validate_add_to_cart", @@ -646,7 +694,8 @@ } ], "long_description_html": "

Fire action to validate add to cart. Functions hooking into this should throw an \\Exception to prevent add to cart from happening.

" - } + }, + "args": 2 }, { "name": "wooocommerce_store_api_validate_cart_item", @@ -674,7 +723,8 @@ } ], "long_description_html": "" - } + }, + "args": 2 } ] } \ No newline at end of file diff --git a/bin/hook-docs/data/filters.json b/bin/hook-docs/data/filters.json index efc36b4e156..7ed46163cbb 100644 --- a/bin/hook-docs/data/filters.json +++ b/bin/hook-docs/data/filters.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/johnbillion/wp-hooks-generator/0.6.1/schema.json", + "$schema": "https://raw.githubusercontent.com/johnbillion/wp-hooks-generator/0.7.0/schema.json", "hooks": [ { "name": "__experimental_woocommerce_blocks_add_data_attributes_to_block", @@ -19,7 +19,8 @@ } ], "long_description_html": "

This hook defines which block names should have block name and attribute data- attributes appended on render.

" - } + }, + "args": 1 }, { "name": "__experimental_woocommerce_blocks_add_data_attributes_to_namespace", @@ -39,7 +40,8 @@ } ], "long_description_html": "

This hook defines which block namespaces should have block name and attribute data- attributes appended on render.

" - } + }, + "args": 1 }, { "name": "__experimental_woocommerce_blocks_payment_gateway_features_list", @@ -78,7 +80,8 @@ } ], "long_description_html": "" - } + }, + "args": 2 }, { "name": "wc_stripe_allow_prepaid_card", @@ -105,7 +108,8 @@ } ], "long_description_html": "" - } + }, + "args": 1 }, { "name": "wc_stripe_display_save_payment_method_checkbox", @@ -142,7 +146,8 @@ } ], "long_description_html": "

This assumes that Stripe supports tokenization - currently this is true, based on https://github.com/woocommerce/woocommerce-gateway-stripe/blob/master/includes/class-wc-gateway-stripe.php#L95

" - } + }, + "args": 1 }, { "name": "wc_stripe_payment_request_button_locale", @@ -169,7 +174,8 @@ } ], "long_description_html": "" - } + }, + "args": 1 }, { "name": "woocommerce_add_cart_item", @@ -204,7 +210,8 @@ } ], "long_description_html": "" - } + }, + "args": 2 }, { "name": "woocommerce_add_cart_item_data", @@ -255,7 +262,8 @@ } ], "long_description_html": "" - } + }, + "args": 4 }, { "name": "woocommerce_add_to_cart_sold_individually_quantity", @@ -314,7 +322,8 @@ } ], "long_description_html": "" - } + }, + "args": 5 }, { "name": "woocommerce_add_to_cart_validation", @@ -377,7 +386,8 @@ } ], "long_description_html": "

Allow 3rd parties to validate if an item can be added to the cart. This is a legacy hook from Woo core. This filter will be deprecated because it encourages usage of wc_add_notice. For the API we need to capture notices and convert to exceptions instead.

" - } + }, + "args": 5 }, { "name": "woocommerce_adjust_non_base_location_prices", @@ -404,7 +414,8 @@ } ], "long_description_html": "

The woocommerce_adjust_non_base_location_prices filter can stop base taxes being taken off when dealing with out of base locations. e.g. If a product costs 10 including tax, all users will pay 10 regardless of location and taxes.

" - } + }, + "args": 1 }, { "name": "woocommerce_apply_individual_use_coupon", @@ -447,7 +458,8 @@ } ], "long_description_html": "" - } + }, + "args": 3 }, { "name": "woocommerce_apply_with_individual_use_coupon", @@ -498,7 +510,8 @@ } ], "long_description_html": "" - } + }, + "args": 4 }, { "name": "woocommerce_blocks_product_grid_is_cacheable", @@ -533,7 +546,8 @@ } ], "long_description_html": "" - } + }, + "args": 2 }, { "name": "woocommerce_blocks_product_grid_item_html", @@ -576,7 +590,8 @@ } ], "long_description_html": "" - } + }, + "args": 3 }, { "name": "woocommerce_blocks_register_script_dependencies", @@ -611,7 +626,8 @@ } ], "long_description_html": "" - } + }, + "args": 2 }, { "name": "woocommerce_cart_contents_changed", @@ -638,7 +654,8 @@ } ], "long_description_html": "" - } + }, + "args": 1 }, { "name": "woocommerce_ga_disable_tracking", @@ -658,7 +675,8 @@ } ], "long_description_html": "" - } + }, + "args": 1 }, { "name": "woocommerce_get_item_data", @@ -693,7 +711,8 @@ } ], "long_description_html": "

Filters the variation option name for custom option slugs.

" - } + }, + "args": 2 }, { "name": "woocommerce_new_customer_data", @@ -720,7 +739,8 @@ } ], "long_description_html": "

This hook filters customer data. It allows user data to be changed, for example, username, password, email, first name, last name, and role.

" - } + }, + "args": 1 }, { "name": "woocommerce_registration_errors", @@ -763,7 +783,8 @@ } ], "long_description_html": "

This hook filters registration errors. This can be used to manipulate the array of errors before they are displayed.

" - } + }, + "args": 3 }, { "name": "woocommerce_shared_settings", @@ -794,7 +815,8 @@ } ], "long_description_html": "

Low level hook for registration of new data late in the cycle. This is deprecated. Instead, use the data api:

Automattic\\WooCommerce\\Blocks\\Package::container()->get( Automattic\\WooCommerce\\Blocks\\Assets\\AssetDataRegistry::class )->add( $key, $value )
" - } + }, + "args": 1 }, { "name": "woocommerce_shipping_package_name", @@ -837,18 +859,26 @@ } ], "long_description_html": "" - } + }, + "args": 3 }, { "name": "woocommerce_show_page_title", "file": "BlockTypes/LegacyTemplate.php", "type": "filter", "doc": { - "description": "", + "description": "We need to load the scripts here because when using block templates wp_head() gets run after the block template. As a result we are trying to enqueue required scripts before we have even registered them.", "long_description": "", - "tags": [], + "tags": [ + { + "name": "see", + "content": "", + "refers": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5328#issuecomment-989013447" + } + ], "long_description_html": "" - } + }, + "args": 1 }, { "name": "woocommerce_store_api_disable_nonce_check", @@ -875,7 +905,8 @@ } ], "long_description_html": "

This can be used to disable the nonce check when testing API endpoints via a REST API client.

" - } + }, + "args": 1 }, { "name": "woocommerce_store_api_product_quantity_limit", @@ -910,7 +941,8 @@ } ], "long_description_html": "

Filters the variation option name for custom option slugs.

" - } + }, + "args": 2 }, { "name": "woocommerce_variation_option_name", @@ -961,7 +993,8 @@ } ], "long_description_html": "

Filters the variation option name for custom option slugs.

" - } + }, + "args": 4 } ] } \ No newline at end of file diff --git a/bin/hook-docs/filters/index.js b/bin/hook-docs/filters/index.js index 532e369cb17..191e020726d 100644 --- a/bin/hook-docs/filters/index.js +++ b/bin/hook-docs/filters/index.js @@ -15,6 +15,7 @@ const { returns, example, related, + files, } = require( '../format-hook-doc' ); const { createDocs, @@ -52,9 +53,8 @@ const generate = ( hooks ) => { ...sectionWithHeading( exceptions( hookDocs ), 'Exceptions' ), ...sectionWithHeading( returns( hookDocs ), 'Returns' ), ...sectionWithHeading( example( hookDocs ), 'Example' ), - ...sectionWithHeading( related( hookDocs ), 'Related' ), - { h3: `Source` }, - { p: `File: [${ hook.file }](../src/${ hook.file })` }, + ...sectionWithHeading( related( hookDocs ), 'See' ), + ...sectionWithHeading( files( hook.file ), 'Source' ), { hr: '' }, ].filter( Boolean ); } ), diff --git a/bin/hook-docs/format-hook-doc/files.js b/bin/hook-docs/format-hook-doc/files.js new file mode 100644 index 00000000000..73d43263c8b --- /dev/null +++ b/bin/hook-docs/format-hook-doc/files.js @@ -0,0 +1,11 @@ +const files = ( sources ) => { + return sources && sources.length + ? { + ul: sources.map( ( file ) => { + return `[${ file }](../src/${ file })`; + } ), + } + : null; +}; + +module.exports = { files }; diff --git a/bin/hook-docs/format-hook-doc/index.js b/bin/hook-docs/format-hook-doc/index.js index 9dd4febdb27..01e06643953 100644 --- a/bin/hook-docs/format-hook-doc/index.js +++ b/bin/hook-docs/format-hook-doc/index.js @@ -3,5 +3,6 @@ const { returns } = require( './returns' ); const { example } = require( './example' ); const { related } = require( './related' ); const { exceptions } = require( './exceptions' ); +const { files } = require( './files' ); -module.exports = { params, returns, example, related, exceptions }; +module.exports = { params, returns, example, related, exceptions, files }; diff --git a/bin/hook-docs/format-hook-doc/related.js b/bin/hook-docs/format-hook-doc/related.js index 4bc1e3d3484..42924db1391 100644 --- a/bin/hook-docs/format-hook-doc/related.js +++ b/bin/hook-docs/format-hook-doc/related.js @@ -5,7 +5,9 @@ const related = ( hookDoc ) => { return seeDocs && seeDocs.length ? { - ul: seeDocs.map( ( { refers } ) => refers ), + ul: seeDocs.map( ( { refers, content = '' } ) => { + return content ? refers + ' - ' + content : refers; + } ), } : null; }; diff --git a/bin/hook-docs/index.js b/bin/hook-docs/index.js index 04ab66b135d..77ef46e31f7 100644 --- a/bin/hook-docs/index.js +++ b/bin/hook-docs/index.js @@ -3,17 +3,37 @@ /* eslint no-console: 0 */ const chalk = require( 'chalk' ); +const groupByHook = ( hooks, hook ) => { + if ( hooks[ hook.name ] !== undefined ) { + if ( hooks[ hook.name ].file !== hook.file ) { + hooks[ hook.name ].file.push( hook.file ); + } + return hooks; // skip or return updated record. + } + + hooks[ hook.name ] = { + ...hook, + file: [ hook.file ], // Use array of files to support hooks used across the codebase. + }; + + return hooks; +}; + try { const { generate: generateActionDocs } = require( './actions' ); const { generate: generateFilterDocs } = require( './filters' ); console.log( chalk.blue( "Let's create some docs!" ) ); - const actions = require( './data/actions.json' ).hooks; - const filters = require( './data/filters.json' ).hooks; + const rawActions = require( './data/actions.json' ).hooks; + const rawFilters = require( './data/filters.json' ).hooks; + + // Skip duplicates. + const actions = rawActions.reduce( groupByHook, {} ); + const filters = rawFilters.reduce( groupByHook, {} ); - generateActionDocs( actions ); - generateFilterDocs( filters ); + generateActionDocs( Object.values( actions ) ); + generateFilterDocs( Object.values( filters ) ); } catch ( error ) { console.log( chalk.red( error.message ) ); } diff --git a/composer.json b/composer.json index 84d76532b86..0871e2800aa 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "wp-phpunit/wp-phpunit": "^5.4", "woocommerce/woocommerce-sniffs": "0.1.0", "yoast/phpunit-polyfills": "^1.0", - "johnbillion/wp-hooks-generator": "0.6.1", + "johnbillion/wp-hooks-generator": "^0.7.0", "mockery/mockery": "^1.4" }, "autoload": { diff --git a/composer.lock b/composer.lock index 6c01bb72aa9..4ec1cd46a2f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "35125888589aa8a4adfdb2cdbc266442", + "content-hash": "94edc00af416eb4f7b05b5f56548373a", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -452,16 +452,16 @@ }, { "name": "johnbillion/wp-hooks-generator", - "version": "0.6.1", + "version": "0.7.0", "source": { "type": "git", "url": "https://github.com/johnbillion/wp-hooks-generator.git", - "reference": "56f316b9716d441c4cfa35b8820dab21899dbee8" + "reference": "26027e46d5396afbeb5ed18b0cd6a75deb2f2996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/johnbillion/wp-hooks-generator/zipball/56f316b9716d441c4cfa35b8820dab21899dbee8", - "reference": "56f316b9716d441c4cfa35b8820dab21899dbee8", + "url": "https://api.github.com/repos/johnbillion/wp-hooks-generator/zipball/26027e46d5396afbeb5ed18b0cd6a75deb2f2996", + "reference": "26027e46d5396afbeb5ed18b0cd6a75deb2f2996", "shasum": "" }, "require": { @@ -469,7 +469,7 @@ "php": ">=7" }, "require-dev": { - "oomphinc/composer-installers-extender": "^1.1", + "oomphinc/composer-installers-extender": "^2", "opis/json-schema": "^1" }, "bin": [ @@ -489,9 +489,15 @@ "description": "Generates a JSON representation of the WordPress actions and filters in your code", "support": { "issues": "https://github.com/johnbillion/wp-hooks-generator/issues", - "source": "https://github.com/johnbillion/wp-hooks-generator/tree/0.6.1" + "source": "https://github.com/johnbillion/wp-hooks-generator/tree/0.7.0" }, - "time": "2020-10-31T17:46:42+00:00" + "funding": [ + { + "url": "https://github.com/johnbillion", + "type": "github" + } + ], + "time": "2021-11-10T17:22:21+00:00" }, { "name": "johnbillion/wp-parser-lib", diff --git a/docs/extensibility/actions.md b/docs/extensibility/actions.md index 9262a2fe5c5..670f959602a 100644 --- a/docs/extensibility/actions.md +++ b/docs/extensibility/actions.md @@ -9,15 +9,12 @@ - [woocommerce_add_to_cart](#woocommerce_add_to_cart) - [woocommerce_after_main_content](#woocommerce_after_main_content) - - [woocommerce_after_main_content](#woocommerce_after_main_content-1) - [woocommerce_after_shop_loop](#woocommerce_after_shop_loop) - [woocommerce_applied_coupon](#woocommerce_applied_coupon) - [woocommerce_archive_description](#woocommerce_archive_description) - [woocommerce_before_main_content](#woocommerce_before_main_content) - - [woocommerce_before_main_content](#woocommerce_before_main_content-1) - [woocommerce_before_shop_loop](#woocommerce_before_shop_loop) - [woocommerce_blocks_cart_enqueue_data](#woocommerce_blocks_cart_enqueue_data) - - [woocommerce_blocks_cart_enqueue_data](#woocommerce_blocks_cart_enqueue_data-1) - [woocommerce_blocks_cart_update_customer_from_request](#woocommerce_blocks_cart_update_customer_from_request) - [woocommerce_blocks_cart_update_order_from_request](#woocommerce_blocks_cart_update_order_from_request) - [woocommerce_blocks_checkout_enqueue_data](#woocommerce_blocks_checkout_enqueue_data) @@ -68,39 +65,33 @@ do_action( 'woocommerce_add_to_cart', string $cart_id, integer $product_id, inte ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_after_main_content -Hook: woocommerce_after_main_content. +Hook: woocommerce_after_main_content ```php do_action( 'woocommerce_after_main_content' ) ``` -### Source - - -File: [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) +### Description ---- +

Called after rendering the main content for a product.

-## woocommerce_after_main_content +### See -Woocommerce_after_main_content hook. - -```php -do_action( 'woocommerce_after_main_content' ) -``` + - woocommerce_output_content_wrapper_end() - Outputs closing DIV for the content (priority 10) ### Source -File: [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) + - [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) + - [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) --- @@ -113,10 +104,15 @@ Hook: woocommerce_after_shop_loop. do_action( 'woocommerce_after_shop_loop' ) ``` +### See + + + - woocommerce_pagination() - Renders pagination (priority 10) + ### Source -File: [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) + - [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) --- @@ -138,7 +134,7 @@ do_action( 'woocommerce_applied_coupon', string $coupon_code ) ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- @@ -151,42 +147,44 @@ Hook: woocommerce_archive_description. do_action( 'woocommerce_archive_description' ) ``` +### See + + + - woocommerce_taxonomy_archive_description() - Renders the taxonomy archive description (priority 10) + - woocommerce_product_archive_description() - Renders the product archive description (priority 10) + ### Source -File: [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) + - [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) --- ## woocommerce_before_main_content -Woocommerce_before_main_content hook. +Hook: woocommerce_before_main_content ```php do_action( 'woocommerce_before_main_content' ) ``` -### Source - - -File: [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) - ---- +### Description -## woocommerce_before_main_content +

Called before rendering the main content for a product.

+### See -Hook: woocommerce_before_main_content. -```php -do_action( 'woocommerce_before_main_content' ) -``` + - woocommerce_output_content_wrapper() - Outputs opening DIV for the content (priority 10) + - woocommerce_breadcrumb() - Outputs breadcrumb trail to the current product (priority 20) + - WC_Structured_Data::generate_website_data() - Outputs schema markup (priority 30) ### Source -File: [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) + - [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) + - [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) --- @@ -199,26 +197,17 @@ Hook: woocommerce_before_shop_loop. do_action( 'woocommerce_before_shop_loop' ) ``` -### Source - - -File: [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) - ---- - -## woocommerce_blocks_cart_enqueue_data +### See -Fires after cart block data is registered. - -```php -do_action( 'woocommerce_blocks_cart_enqueue_data' ) -``` + - woocommerce_output_all_notices() - Render error notices (priority 10) + - woocommerce_result_count() - Show number of results found (priority 20) + - woocommerce_catalog_ordering() - Show form to control sort order (priority 30) ### Source -File: [BlockTypes/MiniCart.php](../src/BlockTypes/MiniCart.php) + - [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) --- @@ -234,7 +223,8 @@ do_action( 'woocommerce_blocks_cart_enqueue_data' ) ### Source -File: [BlockTypes/Cart.php](../src/BlockTypes/Cart.php) + - [BlockTypes/MiniCart.php](../src/BlockTypes/MiniCart.php) + - [BlockTypes/Cart.php](../src/BlockTypes/Cart.php) --- @@ -257,7 +247,7 @@ do_action( 'woocommerce_blocks_cart_update_customer_from_request', \WC_Customer ### Source -File: [StoreApi/Routes/CartUpdateCustomer.php](../src/StoreApi/Routes/CartUpdateCustomer.php) + - [StoreApi/Routes/CartUpdateCustomer.php](../src/StoreApi/Routes/CartUpdateCustomer.php) --- @@ -281,7 +271,7 @@ do_action( 'woocommerce_blocks_cart_update_order_from_request', \WC_Order $draft ### Source -File: [StoreApi/Routes/AbstractCartRoute.php](../src/StoreApi/Routes/AbstractCartRoute.php) + - [StoreApi/Routes/AbstractCartRoute.php](../src/StoreApi/Routes/AbstractCartRoute.php) --- @@ -297,7 +287,7 @@ do_action( 'woocommerce_blocks_checkout_enqueue_data' ) ### Source -File: [BlockTypes/Checkout.php](../src/BlockTypes/Checkout.php) + - [BlockTypes/Checkout.php](../src/BlockTypes/Checkout.php) --- @@ -333,7 +323,7 @@ add_action( 'woocommerce_blocks_checkout_order_processed', 'my_function_callback ``` -### Related +### See - https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3238 @@ -341,7 +331,7 @@ add_action( 'woocommerce_blocks_checkout_order_processed', 'my_function_callback ### Source -File: [StoreApi/Routes/Checkout.php](../src/StoreApi/Routes/Checkout.php) + - [StoreApi/Routes/Checkout.php](../src/StoreApi/Routes/Checkout.php) --- @@ -368,7 +358,7 @@ do_action( 'woocommerce_blocks_checkout_update_order_from_request', \WC_Order $o ### Source -File: [StoreApi/Routes/Checkout.php](../src/StoreApi/Routes/Checkout.php) + - [StoreApi/Routes/Checkout.php](../src/StoreApi/Routes/Checkout.php) --- @@ -391,7 +381,7 @@ do_action( 'woocommerce_blocks_checkout_update_order_meta', \WC_Order $order ) | -------- | ---- | ----------- | | $order | \WC_Order | Order object. | -### Related +### See - https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686 @@ -399,7 +389,7 @@ do_action( 'woocommerce_blocks_checkout_update_order_meta', \WC_Order $order ) ### Source -File: [StoreApi/Routes/Checkout.php](../src/StoreApi/Routes/Checkout.php) + - [StoreApi/Routes/Checkout.php](../src/StoreApi/Routes/Checkout.php) --- @@ -415,7 +405,7 @@ do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_after' ) ### Source -File: [BlockTypes/Cart.php](../src/BlockTypes/Cart.php) + - [BlockTypes/Cart.php](../src/BlockTypes/Cart.php) --- @@ -431,7 +421,7 @@ do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_before' ) ### Source -File: [BlockTypes/Cart.php](../src/BlockTypes/Cart.php) + - [BlockTypes/Cart.php](../src/BlockTypes/Cart.php) --- @@ -447,7 +437,7 @@ do_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_after' ) ### Source -File: [BlockTypes/Checkout.php](../src/BlockTypes/Checkout.php) + - [BlockTypes/Checkout.php](../src/BlockTypes/Checkout.php) --- @@ -463,7 +453,7 @@ do_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_before' ) ### Source -File: [BlockTypes/Checkout.php](../src/BlockTypes/Checkout.php) + - [BlockTypes/Checkout.php](../src/BlockTypes/Checkout.php) --- @@ -483,7 +473,7 @@ do_action( 'woocommerce_blocks_loaded' ) ### Source -File: [Domain/Bootstrap.php](../src/Domain/Bootstrap.php) + - [Domain/Bootstrap.php](../src/Domain/Bootstrap.php) --- @@ -509,7 +499,7 @@ do_action( 'woocommerce_blocks_{$this->registry_identifier}_registration', \Auto ### Source -File: [Integrations/IntegrationRegistry.php](../src/Integrations/IntegrationRegistry.php) + - [Integrations/IntegrationRegistry.php](../src/Integrations/IntegrationRegistry.php) --- @@ -529,7 +519,7 @@ do_action( 'woocommerce_check_cart_items' ) ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- @@ -557,7 +547,7 @@ do_action( 'woocommerce_created_customer', integer $customer_id, array $new_cust ### Source -File: [Domain/Services/CreateAccount.php](../src/Domain/Services/CreateAccount.php) + - [Domain/Services/CreateAccount.php](../src/Domain/Services/CreateAccount.php) --- @@ -570,10 +560,15 @@ Hook: woocommerce_no_products_found. do_action( 'woocommerce_no_products_found' ) ``` +### See + + + - wc_no_products_found() - Default no products found content (priority 10) + ### Source -File: [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) + - [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) --- @@ -601,7 +596,7 @@ do_action( 'woocommerce_register_post', string $username, string $user_email, \W ### Source -File: [Domain/Services/CreateAccount.php](../src/Domain/Services/CreateAccount.php) + - [Domain/Services/CreateAccount.php](../src/Domain/Services/CreateAccount.php) --- @@ -629,7 +624,7 @@ do_action_ref_array( 'woocommerce_rest_checkout_process_payment_with_context', [ ### Source -File: [StoreApi/Routes/Checkout.php](../src/StoreApi/Routes/Checkout.php) + - [StoreApi/Routes/Checkout.php](../src/StoreApi/Routes/Checkout.php) --- @@ -645,7 +640,7 @@ do_action( 'woocommerce_shop_loop' ) ### Source -File: [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) + - [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) --- @@ -672,7 +667,7 @@ do_action( 'wooocommerce_store_api_validate_add_to_cart', \WC_Product $product, ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- @@ -695,6 +690,6 @@ do_action( 'wooocommerce_store_api_validate_cart_item', \WC_Product $product, ar ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- diff --git a/docs/extensibility/filters.md b/docs/extensibility/filters.md index 1b1ba88a2d1..e269bc8a0d0 100644 --- a/docs/extensibility/filters.md +++ b/docs/extensibility/filters.md @@ -59,7 +59,7 @@ apply_filters( '__experimental_woocommerce_blocks_add_data_attributes_to_block', ### Source -File: [BlockTypesController.php](../src/BlockTypesController.php) + - [BlockTypesController.php](../src/BlockTypesController.php) --- @@ -85,7 +85,7 @@ apply_filters( '__experimental_woocommerce_blocks_add_data_attributes_to_namespa ### Source -File: [BlockTypesController.php](../src/BlockTypesController.php) + - [BlockTypesController.php](../src/BlockTypesController.php) --- @@ -129,7 +129,7 @@ add_filter( '__experimental_woocommerce_blocks_payment_gateway_features_list', ' ### Source -File: [Payments/Integrations/PayPal.php](../src/Payments/Integrations/PayPal.php) + - [Payments/Integrations/PayPal.php](../src/Payments/Integrations/PayPal.php) --- @@ -156,7 +156,7 @@ apply_filters( 'wc_stripe_allow_prepaid_card', boolean $allow_prepaid_card ) ### Source -File: [Payments/Integrations/Stripe.php](../src/Payments/Integrations/Stripe.php) + - [Payments/Integrations/Stripe.php](../src/Payments/Integrations/Stripe.php) --- @@ -184,7 +184,7 @@ apply_filters( 'wc_stripe_display_save_payment_method_checkbox', boolean $saved_ `boolean` -### Related +### See - https://github.com/woocommerce/woocommerce-gateway-stripe/blob/ad19168b63df86176cbe35c3e95203a245687640/includes/class-wc-gateway-stripe.php#L271 @@ -193,7 +193,7 @@ apply_filters( 'wc_stripe_display_save_payment_method_checkbox', boolean $saved_ ### Source -File: [Payments/Integrations/Stripe.php](../src/Payments/Integrations/Stripe.php) + - [Payments/Integrations/Stripe.php](../src/Payments/Integrations/Stripe.php) --- @@ -220,7 +220,7 @@ apply_filters( 'wc_stripe_payment_request_button_locale', string $locale ) ### Source -File: [Payments/Integrations/Stripe.php](../src/Payments/Integrations/Stripe.php) + - [Payments/Integrations/Stripe.php](../src/Payments/Integrations/Stripe.php) --- @@ -248,7 +248,7 @@ apply_filters( 'woocommerce_add_cart_item', array $cart_item_data, string $cart_ ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- @@ -278,7 +278,7 @@ apply_filters( 'woocommerce_add_cart_item_data', array $cart_item_data, integer ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- @@ -309,7 +309,7 @@ apply_filters( 'woocommerce_add_to_cart_sold_individually_quantity', integer $so ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- @@ -347,7 +347,7 @@ apply_filters( 'woocommerce_add_to_cart_validation', boolean $passed_validation, ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- @@ -378,7 +378,7 @@ apply_filters( 'woocommerce_adjust_non_base_location_prices', boolean $adjust_no ### Source -File: [StoreApi/Utilities/ProductQuery.php](../src/StoreApi/Utilities/ProductQuery.php) + - [StoreApi/Utilities/ProductQuery.php](../src/StoreApi/Utilities/ProductQuery.php) --- @@ -407,7 +407,7 @@ apply_filters( 'woocommerce_apply_individual_use_coupon', array $coupons, \WC_Co ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- @@ -437,7 +437,7 @@ apply_filters( 'woocommerce_apply_with_individual_use_coupon', boolean $apply_wi ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- @@ -465,7 +465,7 @@ apply_filters( 'woocommerce_blocks_product_grid_is_cacheable', boolean $is_cache ### Source -File: [BlockTypes/AbstractProductGrid.php](../src/BlockTypes/AbstractProductGrid.php) + - [BlockTypes/AbstractProductGrid.php](../src/BlockTypes/AbstractProductGrid.php) --- @@ -494,7 +494,7 @@ apply_filters( 'woocommerce_blocks_product_grid_item_html', string $html, array ### Source -File: [BlockTypes/AbstractProductGrid.php](../src/BlockTypes/AbstractProductGrid.php) + - [BlockTypes/AbstractProductGrid.php](../src/BlockTypes/AbstractProductGrid.php) --- @@ -522,7 +522,7 @@ apply_filters( 'woocommerce_blocks_register_script_dependencies', array $depende ### Source -File: [Assets/Api.php](../src/Assets/Api.php) + - [Assets/Api.php](../src/Assets/Api.php) --- @@ -549,7 +549,7 @@ apply_filters( 'woocommerce_cart_contents_changed', array $cart_contents ) ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- @@ -571,7 +571,7 @@ apply_filters( 'woocommerce_ga_disable_tracking', boolean $disable_tracking ) ### Source -File: [Domain/Services/GoogleAnalytics.php](../src/Domain/Services/GoogleAnalytics.php) + - [Domain/Services/GoogleAnalytics.php](../src/Domain/Services/GoogleAnalytics.php) --- @@ -603,7 +603,7 @@ apply_filters( 'woocommerce_get_item_data', array $item_data, array $cart_item ) ### Source -File: [StoreApi/Schemas/CartItemSchema.php](../src/StoreApi/Schemas/CartItemSchema.php) + - [StoreApi/Schemas/CartItemSchema.php](../src/StoreApi/Schemas/CartItemSchema.php) --- @@ -634,7 +634,7 @@ apply_filters( 'woocommerce_new_customer_data', array $customer_data ) ### Source -File: [Domain/Services/CreateAccount.php](../src/Domain/Services/CreateAccount.php) + - [Domain/Services/CreateAccount.php](../src/Domain/Services/CreateAccount.php) --- @@ -667,7 +667,7 @@ apply_filters( 'woocommerce_registration_errors', \WP_Error $errors, string $use ### Source -File: [Domain/Services/CreateAccount.php](../src/Domain/Services/CreateAccount.php) + - [Domain/Services/CreateAccount.php](../src/Domain/Services/CreateAccount.php) --- @@ -701,7 +701,7 @@ apply_filters( 'woocommerce_shared_settings', array $data ) ### Source -File: [Assets/AssetDataRegistry.php](../src/Assets/AssetDataRegistry.php) + - [Assets/AssetDataRegistry.php](../src/Assets/AssetDataRegistry.php) --- @@ -730,23 +730,28 @@ apply_filters( 'woocommerce_shipping_package_name', string $shipping_package_nam ### Source -File: [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_show_page_title - +We need to load the scripts here because when using block templates wp_head() gets run after the block template. As a result we are trying to enqueue required scripts before we have even registered them. ```php apply_filters( 'woocommerce_show_page_title' ) ``` +### See + + + - https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5328#issuecomment-989013447 + ### Source -File: [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) + - [BlockTypes/LegacyTemplate.php](../src/BlockTypes/LegacyTemplate.php) --- @@ -777,7 +782,7 @@ apply_filters( 'woocommerce_store_api_disable_nonce_check', boolean $disable_non ### Source -File: [StoreApi/Routes/AbstractCartRoute.php](../src/StoreApi/Routes/AbstractCartRoute.php) + - [StoreApi/Routes/AbstractCartRoute.php](../src/StoreApi/Routes/AbstractCartRoute.php) --- @@ -809,7 +814,7 @@ apply_filters( 'woocommerce_store_api_product_quantity_limit', integer $quantity ### Source -File: [StoreApi/Schemas/ProductSchema.php](../src/StoreApi/Schemas/ProductSchema.php) + - [StoreApi/Schemas/ProductSchema.php](../src/StoreApi/Schemas/ProductSchema.php) --- @@ -843,6 +848,6 @@ apply_filters( 'woocommerce_variation_option_name', string $value, null $unused, ### Source -File: [StoreApi/Schemas/CartItemSchema.php](../src/StoreApi/Schemas/CartItemSchema.php) + - [StoreApi/Schemas/CartItemSchema.php](../src/StoreApi/Schemas/CartItemSchema.php) --- diff --git a/src/BlockTypes/LegacyTemplate.php b/src/BlockTypes/LegacyTemplate.php index 4742ad8219a..38980836fdb 100644 --- a/src/BlockTypes/LegacyTemplate.php +++ b/src/BlockTypes/LegacyTemplate.php @@ -34,9 +34,12 @@ protected function render( $attributes, $content ) { return; } - // We need to load the scripts here because when using block templates wp_head() gets run after the block template. - // As a result we are trying to enqueue required scripts before we have even registered them. - // See here for more information: https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5328#issuecomment-989013447. + /** + * We need to load the scripts here because when using block templates wp_head() gets run after the block + * template. As a result we are trying to enqueue required scripts before we have even registered them. + * + * @see https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5328#issuecomment-989013447 + */ if ( class_exists( 'WC_Frontend_Scripts' ) ) { $frontend_scripts = new \WC_Frontend_Scripts(); $frontend_scripts::load_scripts(); @@ -67,10 +70,13 @@ protected function render_single_product() { ob_start(); /** - * Woocommerce_before_main_content hook. + * Hook: woocommerce_before_main_content + * + * Called before rendering the main content for a product. * - * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content) - * @hooked woocommerce_breadcrumb - 20 + * @see woocommerce_output_content_wrapper() Outputs opening DIV for the content (priority 10) + * @see woocommerce_breadcrumb() Outputs breadcrumb trail to the current product (priority 20) + * @see WC_Structured_Data::generate_website_data() Outputs schema markup (priority 30) */ do_action( 'woocommerce_before_main_content' ); @@ -82,9 +88,11 @@ protected function render_single_product() { endwhile; /** - * Woocommerce_after_main_content hook. + * Hook: woocommerce_after_main_content * - * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content) + * Called after rendering the main content for a product. + * + * @see woocommerce_output_content_wrapper_end() Outputs closing DIV for the content (priority 10) */ do_action( 'woocommerce_after_main_content' ); @@ -102,11 +110,13 @@ protected function render_archive_product() { ob_start(); /** - * Hook: woocommerce_before_main_content. + * Hook: woocommerce_before_main_content + * + * Called before rendering the main content for a product. * - * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content) - * @hooked woocommerce_breadcrumb - 20 - * @hooked WC_Structured_Data::generate_website_data() - 30 + * @see woocommerce_output_content_wrapper() Outputs opening DIV for the content (priority 10) + * @see woocommerce_breadcrumb() Outputs breadcrumb trail to the current product (priority 20) + * @see WC_Structured_Data::generate_website_data() Outputs schema markup (priority 30) */ do_action( 'woocommerce_before_main_content' ); @@ -120,8 +130,8 @@ protected function render_archive_product() { /** * Hook: woocommerce_archive_description. * - * @hooked woocommerce_taxonomy_archive_description - 10 - * @hooked woocommerce_product_archive_description - 10 + * @see woocommerce_taxonomy_archive_description() Renders the taxonomy archive description (priority 10) + * @see woocommerce_product_archive_description() Renders the product archive description (priority 10) */ do_action( 'woocommerce_archive_description' ); ?> @@ -132,9 +142,9 @@ protected function render_archive_product() { /** * Hook: woocommerce_before_shop_loop. * - * @hooked woocommerce_output_all_notices - 10 - * @hooked woocommerce_result_count - 20 - * @hooked woocommerce_catalog_ordering - 30 + * @see woocommerce_output_all_notices() Render error notices (priority 10) + * @see woocommerce_result_count() Show number of results found (priority 20) + * @see woocommerce_catalog_ordering() Show form to control sort order (priority 30) */ do_action( 'woocommerce_before_shop_loop' ); @@ -158,22 +168,24 @@ protected function render_archive_product() { /** * Hook: woocommerce_after_shop_loop. * - * @hooked woocommerce_pagination - 10 + * @see woocommerce_pagination() Renders pagination (priority 10) */ do_action( 'woocommerce_after_shop_loop' ); } else { /** * Hook: woocommerce_no_products_found. * - * @hooked wc_no_products_found - 10 + * @see wc_no_products_found() Default no products found content (priority 10) */ do_action( 'woocommerce_no_products_found' ); } /** - * Hook: woocommerce_after_main_content. + * Hook: woocommerce_after_main_content + * + * Called after rendering the main content for a product. * - * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content) + * @see woocommerce_output_content_wrapper_end() Outputs closing DIV for the content (priority 10) */ do_action( 'woocommerce_after_main_content' ); From a1e2af78f6b7438295a53a215dd3990862520cc6 Mon Sep 17 00:00:00 2001 From: Malith Senaweera <6216000+malithsen@users.noreply.github.com> Date: Tue, 4 Jan 2022 11:37:46 -0600 Subject: [PATCH 04/12] Fix duplicated error notices (#5476) * Fix duplicated error notices StoreNoticeProvider is already being used within Block component. This removal prevents duplicated error notices within the Payment Options section * Move StoreNoticeProvider from payment block Remove StoreNoticeProvider from payment block and move it to the parent frontend block to avoid unnecessarily loading the notice provider --- .../inner-blocks/checkout-payment-block/block.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/block.tsx b/assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/block.tsx index 5a654934704..191a060bca2 100644 --- a/assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/block.tsx +++ b/assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/block.tsx @@ -1,8 +1,6 @@ /** * External dependencies */ -import { StoreNoticesProvider } from '@woocommerce/base-context'; -import { useEmitResponse } from '@woocommerce/base-context/hooks'; /** * Internal dependencies @@ -10,13 +8,7 @@ import { useEmitResponse } from '@woocommerce/base-context/hooks'; import { PaymentMethods } from '../../../payment-methods'; const Block = (): JSX.Element | null => { - const { noticeContexts } = useEmitResponse(); - - return ( - - - - ); + return ; }; export default Block; From b8de0ab7317e62bf32b59b6eea9430e89bea5c12 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 4 Jan 2022 18:04:08 +0000 Subject: [PATCH 05/12] Validate available payment methods before attempting payment or updating order statuses (#5440) * Make payment method required * removed unused imports * Remove PUT method * Validate available method when updating order * Enable bacs for tests --- src/StoreApi/Routes/Checkout.php | 71 +++------- src/StoreApi/Schemas/CheckoutSchema.php | 1 + src/StoreApi/docs/checkout.md | 173 ++++++++++-------------- tests/php/Helpers/FixtureData.php | 77 +++++++---- tests/php/StoreApi/Routes/Checkout.php | 2 +- 5 files changed, 146 insertions(+), 178 deletions(-) diff --git a/src/StoreApi/Routes/Checkout.php b/src/StoreApi/Routes/Checkout.php index 8f0d08b6dbd..9d0998098a4 100644 --- a/src/StoreApi/Routes/Checkout.php +++ b/src/StoreApi/Routes/Checkout.php @@ -5,12 +5,8 @@ use Automattic\WooCommerce\Blocks\Package; use Automattic\WooCommerce\Blocks\Payments\PaymentContext; use Automattic\WooCommerce\Blocks\Payments\PaymentResult; -use Automattic\WooCommerce\Blocks\StoreApi\Schemas\AbstractSchema; -use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartSchema; -use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController; use Automattic\WooCommerce\Blocks\StoreApi\Utilities\DraftOrderTrait; use Automattic\WooCommerce\Blocks\StoreApi\Utilities\InvalidStockLevelsInCartException; -use Automattic\WooCommerce\Blocks\StoreApi\Utilities\OrderController; use Automattic\WooCommerce\Checkout\Helpers\ReserveStock; use Automattic\WooCommerce\Checkout\Helpers\ReserveStockException; /** @@ -87,12 +83,6 @@ public function get_args() { $this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE ) ), ], - [ - 'methods' => \WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'get_response' ), - 'permission_callback' => '__return_true', - 'args' => $this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::EDITABLE ), - ], 'schema' => [ $this->schema, 'get_public_item_schema' ], 'allow_batch' => [ 'v1' => true ], ]; @@ -141,30 +131,7 @@ protected function get_route_response( \WP_REST_Request $request ) { } /** - * Update the current order. - * - * @internal Customer data is updated first so OrderController::update_addresses_from_cart uses up to date data. - * - * @throws RouteException On error. - * @param \WP_REST_Request $request Request object. - * @return \WP_REST_Response - */ - protected function get_route_update_response( \WP_REST_Request $request ) { - $this->update_customer_from_request( $request ); - $this->create_or_update_draft_order(); - $this->update_order_from_request( $request ); - - return $this->prepare_item_for_response( - (object) [ - 'order' => $this->order, - 'payment_result' => new PaymentResult(), - ], - $request - ); - } - - /** - * Update and process an order. + * Process an order. * * 1. Obtain Draft Order * 2. Process Request @@ -448,7 +415,7 @@ private function update_customer_from_request( \WP_REST_Request $request ) { */ private function update_order_from_request( \WP_REST_Request $request ) { $this->order->set_customer_note( $request['customer_note'] ?? '' ); - $this->order->set_payment_method( $request['payment_method'] ?? '' ); + $this->order->set_payment_method( $this->get_request_payment_method_id( $request ) ); /** * Fires when the Checkout Block/Store API updates an order's from the API request data. @@ -551,17 +518,7 @@ private function process_payment( \WP_REST_Request $request, PaymentResult $paym * @return string */ private function get_request_payment_method_id( \WP_REST_Request $request ) { - $payment_method_id = wc_clean( wp_unslash( $request['payment_method'] ?? '' ) ); - - if ( empty( $payment_method_id ) ) { - throw new RouteException( - 'woocommerce_rest_checkout_missing_payment_method', - __( 'No payment method provided.', 'woo-gutenberg-products-block' ), - 400 - ); - } - - return $payment_method_id; + return $this->get_request_payment_method( $request )->id; } /** @@ -572,18 +529,30 @@ private function get_request_payment_method_id( \WP_REST_Request $request ) { * @return \WC_Payment_Gateway */ private function get_request_payment_method( \WP_REST_Request $request ) { - $payment_method_id = $this->get_request_payment_method_id( $request ); - $available_gateways = WC()->payment_gateways->get_available_payment_gateways(); + $available_gateways = WC()->payment_gateways->get_available_payment_gateways(); + $request_payment_method = wc_clean( wp_unslash( $request['payment_method'] ?? '' ) ); - if ( ! isset( $available_gateways[ $payment_method_id ] ) ) { + if ( empty( $request_payment_method ) ) { + throw new RouteException( + 'woocommerce_rest_checkout_missing_payment_method', + __( 'No payment method provided.', 'woo-gutenberg-products-block' ), + 400 + ); + } + + if ( ! isset( $available_gateways[ $request_payment_method ] ) ) { throw new RouteException( 'woocommerce_rest_checkout_payment_method_disabled', - __( 'This payment gateway is not available.', 'woo-gutenberg-products-block' ), + sprintf( + // Translators: %s Payment method ID. + __( 'The %s payment gateway is not available.', 'woo-gutenberg-products-block' ), + esc_html( $request_payment_method ) + ), 400 ); } - return $available_gateways[ $payment_method_id ]; + return $available_gateways[ $request_payment_method ]; } /** diff --git a/src/StoreApi/Schemas/CheckoutSchema.php b/src/StoreApi/Schemas/CheckoutSchema.php index 989cf677842..5c3ce4a2ca4 100644 --- a/src/StoreApi/Schemas/CheckoutSchema.php +++ b/src/StoreApi/Schemas/CheckoutSchema.php @@ -115,6 +115,7 @@ public function get_properties() { 'type' => 'string', 'context' => [ 'view', 'edit' ], 'enum' => wc()->payment_gateways->get_payment_gateway_ids(), + 'required' => true, ], 'create_account' => [ 'description' => __( 'Whether to create a new user account as part of order processing.', 'woo-gutenberg-products-block' ), diff --git a/src/StoreApi/docs/checkout.md b/src/StoreApi/docs/checkout.md index 865aea83ee4..527817e85cd 100644 --- a/src/StoreApi/docs/checkout.md +++ b/src/StoreApi/docs/checkout.md @@ -5,7 +5,6 @@ The checkout API facilitates the creation of orders (from the current cart) and All checkout endpoints require [Nonce Tokens](nonce-tokens.md). - [Get Checkout Data](#get-checkout-data) -- [Update Checkout Data](#update-checkout-data) - [Process Order and Payment](#process-order-and-payment) ## Get Checkout Data @@ -28,70 +27,48 @@ curl --header "X-WC-Store-API-Nonce: 12345" --request GET https://example-store. ```json { - "order_id": 146, - "status": "checkout-draft", - "order_key": "wc_order_VPffqyvgWVqWL", - "customer_note": "", - "customer_id": 1, - "billing_address": { - "first_name": "Peter", - "last_name": "Venkman", - "company": "", - "address_1": "550 Central Park West", - "address_2": "Corner Penthouse Spook Central", - "city": "New York", - "state": "NY", - "postcode": "10023", - "country": "US", - "email": "admin@example.com", - "phone": "555-2368" - }, - "shipping_address": { - "first_name": "Peter", - "last_name": "Venkman", - "company": "", - "address_1": "550 Central Park West", - "address_2": "Corner Penthouse Spook Central", - "city": "New York", - "state": "NY", - "postcode": "10023", - "country": "US" - }, - "payment_method": "", - "payment_result": { - "payment_status": "", - "payment_details": [], - "redirect_url": "" - } + "order_id": 146, + "status": "checkout-draft", + "order_key": "wc_order_VPffqyvgWVqWL", + "customer_note": "", + "customer_id": 1, + "billing_address": { + "first_name": "Peter", + "last_name": "Venkman", + "company": "", + "address_1": "550 Central Park West", + "address_2": "Corner Penthouse Spook Central", + "city": "New York", + "state": "NY", + "postcode": "10023", + "country": "US", + "email": "admin@example.com", + "phone": "555-2368" + }, + "shipping_address": { + "first_name": "Peter", + "last_name": "Venkman", + "company": "", + "address_1": "550 Central Park West", + "address_2": "Corner Penthouse Spook Central", + "city": "New York", + "state": "NY", + "postcode": "10023", + "country": "US" + }, + "payment_method": "", + "payment_result": { + "payment_status": "", + "payment_details": [], + "redirect_url": "" + } } ``` -## Update Checkout Data - -Allows the client to update checkout data, and returns an updated response. - -This endpoint will return an error unless a valid [Nonce Token](nonce-tokens.md) is provided. - -```http -PUT /wc/store/checkout -``` - -| Attribute | Type | Required | Description | -| :----------------- | :------ | :------: | :-------------------------------------------------------------- | -| `billing_address` | array | No | Array of updated billing address data for the customer. | -| `shipping_address` | integer | No | Array of updated shipping address data for the customer. | -| `customer_note` | string | No | Note added to the order by the customer during checkout. | -| `payment_method` | string | No | The ID of the payment method being used to process the payment. | - -```http -curl --header "X-WC-Store-API-Nonce: 12345" --request PUT https://example-store.com/wp-json/wc/store/checkout?payment_method=paypal -``` - -Returns either updated checkout data (See [Get Checkout Data](#get-checkout-data)), or an error response. - ## Process Order and Payment -Posts final checkout data, including data from payment methods, and attempts payment. +Accepts the final customer addresses and chosen payment method, and any additional payment data, then attempts payment and +returns the result. This endpoint will return an error unless a valid [Nonce Token](nonce-tokens.md) is provided. @@ -101,10 +78,10 @@ POST /wc/store/checkout | Attribute | Type | Required | Description | | :----------------- | :------ | :------: | :------------------------------------------------------------------ | -| `billing_address` | array | No | Array of updated billing address data for the customer. | -| `shipping_address` | integer | No | Array of updated shipping address data for the customer. | +| `billing_address` | array | Yes | Array of updated billing address data for the customer. | +| `shipping_address` | integer | Yes | Array of updated shipping address data for the customer. | | `customer_note` | string | No | Note added to the order by the customer during checkout. | -| `payment_method` | string | No | The ID of the payment method being used to process the payment. | +| `payment_method` | string | Yes | The ID of the payment method being used to process the payment. | | `payment_data` | array | No | Data to pass through to the payment method when processing payment. | ```http @@ -115,40 +92,40 @@ curl --header "X-WC-Store-API-Nonce: 12345" --request POST https://example-store ```json { - "order_id": 146, - "status": "on-hold", - "order_key": "wc_order_VPffqyvgWVqWL", - "customer_note": "", - "customer_id": 1, - "billing_address": { - "first_name": "Peter", - "last_name": "Venkman", - "company": "", - "address_1": "550 Central Park West", - "address_2": "Corner Penthouse Spook Central", - "city": "New York", - "state": "NY", - "postcode": "10023", - "country": "US", - "email": "admin@example.com", - "phone": "555-2368" - }, - "shipping_address": { - "first_name": "Peter", - "last_name": "Venkman", - "company": "", - "address_1": "550 Central Park West", - "address_2": "Corner Penthouse Spook Central", - "city": "New York", - "state": "NY", - "postcode": "10023", - "country": "US" - }, - "payment_method": "cheque", - "payment_result": { - "payment_status": "success", - "payment_details": [], - "redirect_url": "https:\/\/local.wordpress.test\/block-checkout\/order-received\/146\/?key=wc_order_VPffqyvgWVqWL" - } + "order_id": 146, + "status": "on-hold", + "order_key": "wc_order_VPffqyvgWVqWL", + "customer_note": "", + "customer_id": 1, + "billing_address": { + "first_name": "Peter", + "last_name": "Venkman", + "company": "", + "address_1": "550 Central Park West", + "address_2": "Corner Penthouse Spook Central", + "city": "New York", + "state": "NY", + "postcode": "10023", + "country": "US", + "email": "admin@example.com", + "phone": "555-2368" + }, + "shipping_address": { + "first_name": "Peter", + "last_name": "Venkman", + "company": "", + "address_1": "550 Central Park West", + "address_2": "Corner Penthouse Spook Central", + "city": "New York", + "state": "NY", + "postcode": "10023", + "country": "US" + }, + "payment_method": "cheque", + "payment_result": { + "payment_status": "success", + "payment_details": [], + "redirect_url": "https://local.wordpress.test/block-checkout/order-received/146/?key=wc_order_VPffqyvgWVqWL" + } } ``` diff --git a/tests/php/Helpers/FixtureData.php b/tests/php/Helpers/FixtureData.php index 08f433ad74c..9976e04fc2e 100644 --- a/tests/php/Helpers/FixtureData.php +++ b/tests/php/Helpers/FixtureData.php @@ -20,9 +20,9 @@ public function get_simple_product( $props ) { $product->set_props( wp_parse_args( $props, - [ + array( 'name' => 'Simple Product', - ] + ) ) ); $product->save(); @@ -37,20 +37,20 @@ public function get_simple_product( $props ) { * @param array $attributes Product attributes from which to create variations. * @return \WC_Product */ - public function get_variable_product( $props, $attributes = [] ) { + public function get_variable_product( $props, $attributes = array() ) { $product = new \WC_Product_Variable(); $product->set_props( wp_parse_args( $props, - [ + array( 'name' => 'Variable Product', - ] + ) ) ); $product->save(); if ( $attributes ) { - $product_attributes = []; + $product_attributes = array(); foreach ( $attributes as $attribute ) { $product_attribute = new \WC_Product_Attribute(); @@ -74,23 +74,23 @@ public function get_variable_product( $props, $attributes = [] ) { * Create and return a variation of a product. * * @param integer $parent_id Parent product ID. - * @param array $attributes Variation attributes. - * @param array $props Product props. + * @param array $attributes Variation attributes. + * @param array $props Product props. * @return \WC_Product_Variation */ - public function get_variation_product( $parent_id, $attributes = [], $props = [] ) { + public function get_variation_product( $parent_id, $attributes = array(), $props = array() ) { $variation = new \WC_Product_Variation(); $variation->set_props( array_merge( wp_parse_args( $props, - [ - 'name' => 'Variation of ' . $parent_id, + array( + 'name' => 'Variation of ' . $parent_id, 'regular_price' => '10', - ] + ) ), array( - 'parent_id' => $parent_id, + 'parent_id' => $parent_id, ) ) ); @@ -103,7 +103,7 @@ public function get_variation_product( $parent_id, $attributes = [], $props = [] * Create a product attribute. * * @param string $raw_name Name of attribute to create. - * @param array $terms Terms to create for the attribute. + * @param array $terms Terms to create for the attribute. * @return array Attribute data and created terms. */ public static function get_product_attribute( $raw_name = 'size', $terms = array( 'small' ) ) { @@ -180,10 +180,10 @@ public static function get_product_attribute( $raw_name = 'size', $terms = array $result = wp_insert_term( $term, $attribute->slug, - [ - 'slug' => $term . '-slug', + array( + 'slug' => $term . '-slug', 'description' => 'Description of ' . $term, - ] + ) ); $return['term_ids'][] = $result['term_id']; } else { @@ -225,30 +225,30 @@ public function sideload_image( $product_id = 0 ) { * * @param integer $product_id Product ID. * @param integer $rating Review rating. - * @param string $content Review content. - * @param array $props Review props. + * @param string $content Review content. + * @param array $props Review props. * @return void */ - public function add_product_review( $product_id, $rating = 5, $content = 'Product review.', $props = [] ) { + public function add_product_review( $product_id, $rating = 5, $content = 'Product review.', $props = array() ) { wp_insert_comment( array_merge( wp_parse_args( $props, - [ + array( 'comment_author' => 'admin', 'comment_author_email' => 'woo@woo.local', 'comment_author_url' => '', 'comment_approved' => 1, 'comment_type' => 'review', - ] + ) ), - [ - 'comment_post_ID' => $product_id, - 'comment_content' => $content, - 'comment_meta' => [ + array( + 'comment_post_ID' => $product_id, + 'comment_content' => $content, + 'comment_meta' => array( 'rating' => $rating, - ], - ] + ), + ) ) ); \WC_Comments::clear_transients( $product_id ); @@ -273,4 +273,25 @@ public function shipping_add_flat_rate( $cost = 10 ) { \WC_Cache_Helper::get_transient_version( 'shipping', true ); WC()->shipping()->load_shipping_methods(); } + + /** + * Enable bacs payment method. + */ + public function payments_enable_bacs() { + $bacs_settings = array( + 'enabled' => 'yes', + 'title' => 'Direct bank transfer', + 'description' => 'Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order will not be shipped until the funds have cleared in our account.', + 'instructions' => '', + 'account_details' => '', + 'account_name' => '', + 'account_number' => '', + 'sort_code' => '', + 'bank_name' => '', + 'iban' => '', + 'bic' => '', + ); + update_option( 'woocommerce_bacs_settings', $bacs_settings ); + WC()->payment_gateways()->init(); + } } diff --git a/tests/php/StoreApi/Routes/Checkout.php b/tests/php/StoreApi/Routes/Checkout.php index d57de75e08d..6a114911ae7 100644 --- a/tests/php/StoreApi/Routes/Checkout.php +++ b/tests/php/StoreApi/Routes/Checkout.php @@ -13,7 +13,6 @@ use Automattic\WooCommerce\Blocks\StoreApi\Formatters\CurrencyFormatter; use Automattic\WooCommerce\Blocks\Domain\Services\FeatureGating; use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CheckoutSchema; -use Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes\ControllerTestCase; use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData; use Automattic\WooCommerce\Blocks\StoreApi\Routes\Checkout as CheckoutRoute; use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController; @@ -62,6 +61,7 @@ protected function setUp(): void { $fixtures = new FixtureData(); $fixtures->shipping_add_flat_rate(); + $fixtures->payments_enable_bacs(); $this->products = array( $fixtures->get_simple_product( array( From 7129c0c5eefb53f0183a52ebcb5e4a4d0bdf218d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Jan 2022 04:06:56 +0000 Subject: [PATCH 06/12] Update babel monorepo to v7.16.7 (#5517) Co-authored-by: Renovate Bot --- package-lock.json | 688 +++++++++++++++++++++++----------------------- package.json | 10 +- 2 files changed, 349 insertions(+), 349 deletions(-) diff --git a/package-lock.json b/package-lock.json index 46b84be691b..6f1e0da82ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@woocommerce/block-library", - "version": "6.7.0-dev", + "version": "6.8.0-dev", "hasInstallScript": true, "license": "GPL-3.0+", "dependencies": { @@ -36,12 +36,12 @@ }, "devDependencies": { "@automattic/color-studio": "2.5.0", - "@babel/cli": "7.16.0", - "@babel/core": "7.16.5", - "@babel/plugin-proposal-class-properties": "7.16.5", - "@babel/plugin-syntax-jsx": "7.16.5", + "@babel/cli": "7.16.7", + "@babel/core": "7.16.7", + "@babel/plugin-proposal-class-properties": "7.16.7", + "@babel/plugin-syntax-jsx": "7.16.7", "@babel/polyfill": "7.12.1", - "@babel/preset-typescript": "7.16.5", + "@babel/preset-typescript": "7.16.7", "@octokit/graphql": "4.8.0", "@storybook/addon-a11y": "6.4.9", "@storybook/addon-essentials": "6.4.9", @@ -432,9 +432,9 @@ "dev": true }, "node_modules/@babel/cli": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.16.0.tgz", - "integrity": "sha512-WLrM42vKX/4atIoQB+eb0ovUof53UUvecb4qGjU2PDDWRiZr50ZpiV8NpcLo7iSxeGYrRG0Mqembsa+UrTAV6Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.16.7.tgz", + "integrity": "sha512-0iBF+G2Qml0y3mY5dirolyToLSR88a/KB6F2Gm8J/lOnyL8wbEOHak0DHF8gjc9XZGgTDGv/jYXNiapvsYyHTA==", "dev": true, "dependencies": { "commander": "^4.0.1", @@ -470,11 +470,11 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", - "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dependencies": { - "@babel/highlight": "^7.16.0" + "@babel/highlight": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -489,19 +489,19 @@ } }, "node_modules/@babel/core": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.5.tgz", - "integrity": "sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ==", - "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.5", - "@babel/helper-compilation-targets": "^7.16.3", - "@babel/helper-module-transforms": "^7.16.5", - "@babel/helpers": "^7.16.5", - "@babel/parser": "^7.16.5", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.7.tgz", + "integrity": "sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA==", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -566,11 +566,11 @@ } }, "node_modules/@babel/generator": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.5.tgz", - "integrity": "sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz", + "integrity": "sha512-/ST3Sg8MLGY5HVYmrjOgL60ENux/HfO/CsUh7y4MalThufhE/Ff/6EibFDHi4jiDCaWfJKoqbE6oTh21c5hrRg==", "dependencies": { - "@babel/types": "^7.16.0", + "@babel/types": "^7.16.7", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -579,12 +579,12 @@ } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz", - "integrity": "sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", + "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -604,12 +604,12 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.16.3", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz", - "integrity": "sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "dependencies": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-validator-option": "^7.14.5", + "@babel/compat-data": "^7.16.4", + "@babel/helper-validator-option": "^7.16.7", "browserslist": "^4.17.5", "semver": "^6.3.0" }, @@ -629,18 +629,18 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.5.tgz", - "integrity": "sha512-NEohnYA7mkB8L5JhU7BLwcBdU3j83IziR9aseMueWGeAjblbul3zzb8UvJ3a1zuBiqCMObzCJHFqKIQE6hTVmg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.7.tgz", + "integrity": "sha512-kIFozAvVfK05DM4EVQYKK+zteWvY85BFdGBRQBytRyY3y+6PX0DkDOn/CZ3lEuczCfrCxEzwt0YtP/87YPTWSw==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-member-expression-to-functions": "^7.16.5", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/helper-replace-supers": "^7.16.5", - "@babel/helper-split-export-declaration": "^7.16.0" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -694,11 +694,11 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz", - "integrity": "sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -717,97 +717,97 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz", - "integrity": "sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", "dependencies": { - "@babel/helper-get-function-arity": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-get-function-arity": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz", - "integrity": "sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz", - "integrity": "sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.5.tgz", - "integrity": "sha512-7fecSXq7ZrLE+TWshbGT+HyCLkxloWNhTbU2QM1NTI/tDqyf0oZiMcEfYtDuUDCo528EOlt39G1rftea4bRZIw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.7.tgz", + "integrity": "sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz", - "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz", - "integrity": "sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", "dependencies": { - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-simple-access": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/helper-validator-identifier": "^7.15.7", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz", - "integrity": "sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz", + "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz", - "integrity": "sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", "engines": { "node": ">=6.9.0" } @@ -827,27 +827,27 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.5.tgz", - "integrity": "sha512-ao3seGVa/FZCMCCNDuBcqnBFSbdr8N2EW35mzojx3TwfIbdPmNK+JV6+2d5bR0Z71W5ocLnQp9en/cTF7pBJiQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz", + "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-member-expression-to-functions": "^7.16.5", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz", - "integrity": "sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -866,28 +866,28 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz", - "integrity": "sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", - "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "engines": { "node": ">=6.9.0" } @@ -908,24 +908,24 @@ } }, "node_modules/@babel/helpers": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.5.tgz", - "integrity": "sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", "dependencies": { - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0" + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", - "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", + "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", "dependencies": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -955,9 +955,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.16.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz", - "integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.7.tgz", + "integrity": "sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA==", "bin": { "parser": "bin/babel-parser.js" }, @@ -1015,13 +1015,13 @@ } }, "node_modules/@babel/plugin-proposal-class-properties": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.5.tgz", - "integrity": "sha512-pJD3HjgRv83s5dv1sTnDbZOaTjghKEz8KUn1Kbh2eAIRhGuyQ1XSeI4xVXU3UlIEVA3DAyIdxqT1eRn7Wcn55A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz", + "integrity": "sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.16.5", - "@babel/helper-plugin-utils": "^7.16.5" + "@babel/helper-create-class-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1423,11 +1423,11 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.5.tgz", - "integrity": "sha512-42OGssv9NPk4QHKVgIHlzeLgPOW5rGgfV5jzG90AhcXXIv6hu/eqj63w4VgvRxdvZY3AlYeDgPiSJ3BqAd1Y6Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.7.tgz", + "integrity": "sha512-Esxmk7YjA8QysKeT3VhTXvF6y77f/a91SIs4pWb4H2eWGQkCKFgQaG6hdoEVZtGsrAcb2K5BW66XsOErD4WU3Q==", "dependencies": { - "@babel/helper-plugin-utils": "^7.16.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1539,12 +1539,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.0.tgz", - "integrity": "sha512-Xv6mEXqVdaqCBfJFyeab0fH2DnUoMsDmhamxsSi4j8nLd4Vtw213WMJr55xxqipC/YVWyPY3K0blJncPYji+dQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz", + "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -2165,14 +2165,14 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.1.tgz", - "integrity": "sha512-NO4XoryBng06jjw/qWEU2LhcLJr1tWkhpMam/H4eas/CDKMX/b2/Ylb6EI256Y7+FVPCawwSM1rrJNOpDiz+Lg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.7.tgz", + "integrity": "sha512-Hzx1lvBtOCWuCEwMmYOfpQpO7joFeXLgoPuzZZBtTxXqSqUGUubvFGZv2ygo1tB5Bp9q6PXV3H0E/kf7KM0RLA==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-typescript": "^7.16.0" + "@babel/helper-create-class-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-typescript": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -2395,14 +2395,14 @@ } }, "node_modules/@babel/preset-typescript": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.16.5.tgz", - "integrity": "sha512-lmAWRoJ9iOSvs3DqOndQpj8XqXkzaiQs50VG/zESiI9D3eoZhGriU675xNCr0UwvsuXrhMAGvyk1w+EVWF3u8Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.16.7.tgz", + "integrity": "sha512-WbVEmgXdIyvzB77AQjGBEyYPZx+8tTsO50XtfozQrkW8QB2rLJpH2lgx0TRw5EJrBxOZQ+wCcyPVQvS8tjEHpQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.5", - "@babel/helper-validator-option": "^7.14.5", - "@babel/plugin-transform-typescript": "^7.16.1" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-validator-option": "^7.16.7", + "@babel/plugin-transform-typescript": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -2455,31 +2455,31 @@ } }, "node_modules/@babel/template": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz", - "integrity": "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.5.tgz", - "integrity": "sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==", - "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.5", - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/parser": "^7.16.5", - "@babel/types": "^7.16.0", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.7.tgz", + "integrity": "sha512-8KWJPIb8c2VvY8AJrydh6+fVRo2ODx1wYBU2398xJVq0JomuLBZmVQzLPBblJgHIGYG4znCpUZUZ0Pt2vdmVYQ==", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -2488,11 +2488,11 @@ } }, "node_modules/@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.7.tgz", + "integrity": "sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg==", "dependencies": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -41788,9 +41788,9 @@ "dev": true }, "@babel/cli": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.16.0.tgz", - "integrity": "sha512-WLrM42vKX/4atIoQB+eb0ovUof53UUvecb4qGjU2PDDWRiZr50ZpiV8NpcLo7iSxeGYrRG0Mqembsa+UrTAV6Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.16.7.tgz", + "integrity": "sha512-0iBF+G2Qml0y3mY5dirolyToLSR88a/KB6F2Gm8J/lOnyL8wbEOHak0DHF8gjc9XZGgTDGv/jYXNiapvsYyHTA==", "dev": true, "requires": { "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", @@ -41813,11 +41813,11 @@ } }, "@babel/code-frame": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", - "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "requires": { - "@babel/highlight": "^7.16.0" + "@babel/highlight": "^7.16.7" } }, "@babel/compat-data": { @@ -41826,19 +41826,19 @@ "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==" }, "@babel/core": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.5.tgz", - "integrity": "sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ==", - "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.5", - "@babel/helper-compilation-targets": "^7.16.3", - "@babel/helper-module-transforms": "^7.16.5", - "@babel/helpers": "^7.16.5", - "@babel/parser": "^7.16.5", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.7.tgz", + "integrity": "sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA==", + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -41884,22 +41884,22 @@ } }, "@babel/generator": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.5.tgz", - "integrity": "sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz", + "integrity": "sha512-/ST3Sg8MLGY5HVYmrjOgL60ENux/HfO/CsUh7y4MalThufhE/Ff/6EibFDHi4jiDCaWfJKoqbE6oTh21c5hrRg==", "requires": { - "@babel/types": "^7.16.0", + "@babel/types": "^7.16.7", "jsesc": "^2.5.1", "source-map": "^0.5.0" } }, "@babel/helper-annotate-as-pure": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz", - "integrity": "sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", + "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-builder-binary-assignment-operator-visitor": { @@ -41913,12 +41913,12 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.16.3", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz", - "integrity": "sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "requires": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-validator-option": "^7.14.5", + "@babel/compat-data": "^7.16.4", + "@babel/helper-validator-option": "^7.16.7", "browserslist": "^4.17.5", "semver": "^6.3.0" }, @@ -41931,18 +41931,18 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.5.tgz", - "integrity": "sha512-NEohnYA7mkB8L5JhU7BLwcBdU3j83IziR9aseMueWGeAjblbul3zzb8UvJ3a1zuBiqCMObzCJHFqKIQE6hTVmg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.7.tgz", + "integrity": "sha512-kIFozAvVfK05DM4EVQYKK+zteWvY85BFdGBRQBytRyY3y+6PX0DkDOn/CZ3lEuczCfrCxEzwt0YtP/87YPTWSw==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-member-expression-to-functions": "^7.16.5", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/helper-replace-supers": "^7.16.5", - "@babel/helper-split-export-declaration": "^7.16.0" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7" } }, "@babel/helper-create-regexp-features-plugin": { @@ -41980,11 +41980,11 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz", - "integrity": "sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-explode-assignable-expression": { @@ -41997,76 +41997,76 @@ } }, "@babel/helper-function-name": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz", - "integrity": "sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", "requires": { - "@babel/helper-get-function-arity": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/helper-get-function-arity": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz", - "integrity": "sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-hoist-variables": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz", - "integrity": "sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.5.tgz", - "integrity": "sha512-7fecSXq7ZrLE+TWshbGT+HyCLkxloWNhTbU2QM1NTI/tDqyf0oZiMcEfYtDuUDCo528EOlt39G1rftea4bRZIw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.7.tgz", + "integrity": "sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-imports": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz", - "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-transforms": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz", - "integrity": "sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", "requires": { - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-simple-access": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/helper-validator-identifier": "^7.15.7", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/helper-optimise-call-expression": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz", - "integrity": "sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz", + "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-plugin-utils": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz", - "integrity": "sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ==" + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==" }, "@babel/helper-remap-async-to-generator": { "version": "7.16.4", @@ -42080,24 +42080,24 @@ } }, "@babel/helper-replace-supers": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.5.tgz", - "integrity": "sha512-ao3seGVa/FZCMCCNDuBcqnBFSbdr8N2EW35mzojx3TwfIbdPmNK+JV6+2d5bR0Z71W5ocLnQp9en/cTF7pBJiQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz", + "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==", "dev": true, "requires": { - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-member-expression-to-functions": "^7.16.5", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/helper-simple-access": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz", - "integrity": "sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-skip-transparent-expression-wrappers": { @@ -42110,22 +42110,22 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz", - "integrity": "sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==" + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==" }, "@babel/helper-validator-option": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", - "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==" + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==" }, "@babel/helper-wrap-function": { "version": "7.16.0", @@ -42140,21 +42140,21 @@ } }, "@babel/helpers": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.5.tgz", - "integrity": "sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", "requires": { - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0" + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/highlight": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", - "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", + "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", "requires": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -42177,9 +42177,9 @@ } }, "@babel/parser": { - "version": "7.16.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz", - "integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==" + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.7.tgz", + "integrity": "sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA==" }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { "version": "7.16.2", @@ -42213,13 +42213,13 @@ } }, "@babel/plugin-proposal-class-properties": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.5.tgz", - "integrity": "sha512-pJD3HjgRv83s5dv1sTnDbZOaTjghKEz8KUn1Kbh2eAIRhGuyQ1XSeI4xVXU3UlIEVA3DAyIdxqT1eRn7Wcn55A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz", + "integrity": "sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.16.5", - "@babel/helper-plugin-utils": "^7.16.5" + "@babel/helper-create-class-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-proposal-class-static-block": { @@ -42480,11 +42480,11 @@ } }, "@babel/plugin-syntax-jsx": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.5.tgz", - "integrity": "sha512-42OGssv9NPk4QHKVgIHlzeLgPOW5rGgfV5jzG90AhcXXIv6hu/eqj63w4VgvRxdvZY3AlYeDgPiSJ3BqAd1Y6Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.7.tgz", + "integrity": "sha512-Esxmk7YjA8QysKeT3VhTXvF6y77f/a91SIs4pWb4H2eWGQkCKFgQaG6hdoEVZtGsrAcb2K5BW66XsOErD4WU3Q==", "requires": { - "@babel/helper-plugin-utils": "^7.16.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-syntax-logical-assignment-operators": { @@ -42560,12 +42560,12 @@ } }, "@babel/plugin-syntax-typescript": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.0.tgz", - "integrity": "sha512-Xv6mEXqVdaqCBfJFyeab0fH2DnUoMsDmhamxsSi4j8nLd4Vtw213WMJr55xxqipC/YVWyPY3K0blJncPYji+dQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz", + "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-arrow-functions": { @@ -42954,14 +42954,14 @@ } }, "@babel/plugin-transform-typescript": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.1.tgz", - "integrity": "sha512-NO4XoryBng06jjw/qWEU2LhcLJr1tWkhpMam/H4eas/CDKMX/b2/Ylb6EI256Y7+FVPCawwSM1rrJNOpDiz+Lg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.7.tgz", + "integrity": "sha512-Hzx1lvBtOCWuCEwMmYOfpQpO7joFeXLgoPuzZZBtTxXqSqUGUubvFGZv2ygo1tB5Bp9q6PXV3H0E/kf7KM0RLA==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-typescript": "^7.16.0" + "@babel/helper-create-class-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-typescript": "^7.16.7" } }, "@babel/plugin-transform-unicode-escapes": { @@ -43140,14 +43140,14 @@ } }, "@babel/preset-typescript": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.16.5.tgz", - "integrity": "sha512-lmAWRoJ9iOSvs3DqOndQpj8XqXkzaiQs50VG/zESiI9D3eoZhGriU675xNCr0UwvsuXrhMAGvyk1w+EVWF3u8Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.16.7.tgz", + "integrity": "sha512-WbVEmgXdIyvzB77AQjGBEyYPZx+8tTsO50XtfozQrkW8QB2rLJpH2lgx0TRw5EJrBxOZQ+wCcyPVQvS8tjEHpQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.5", - "@babel/helper-validator-option": "^7.14.5", - "@babel/plugin-transform-typescript": "^7.16.1" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-validator-option": "^7.16.7", + "@babel/plugin-transform-typescript": "^7.16.7" } }, "@babel/register": { @@ -43182,38 +43182,38 @@ } }, "@babel/template": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz", - "integrity": "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/traverse": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.5.tgz", - "integrity": "sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==", - "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.5", - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/parser": "^7.16.5", - "@babel/types": "^7.16.0", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.7.tgz", + "integrity": "sha512-8KWJPIb8c2VvY8AJrydh6+fVRo2ODx1wYBU2398xJVq0JomuLBZmVQzLPBblJgHIGYG4znCpUZUZ0Pt2vdmVYQ==", + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.7.tgz", + "integrity": "sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg==", "requires": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" } }, diff --git a/package.json b/package.json index aed342bcb62..6f08327634b 100644 --- a/package.json +++ b/package.json @@ -76,12 +76,12 @@ }, "devDependencies": { "@automattic/color-studio": "2.5.0", - "@babel/cli": "7.16.0", - "@babel/core": "7.16.5", - "@babel/plugin-proposal-class-properties": "7.16.5", - "@babel/plugin-syntax-jsx": "7.16.5", + "@babel/cli": "7.16.7", + "@babel/core": "7.16.7", + "@babel/plugin-proposal-class-properties": "7.16.7", + "@babel/plugin-syntax-jsx": "7.16.7", "@babel/polyfill": "7.12.1", - "@babel/preset-typescript": "7.16.5", + "@babel/preset-typescript": "7.16.7", "@octokit/graphql": "4.8.0", "@storybook/addon-a11y": "6.4.9", "@storybook/addon-essentials": "6.4.9", From 4f2c12b06daeb16be924c81176a963349cfcb7b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Jan 2022 04:08:56 +0000 Subject: [PATCH 07/12] Update dependency eslint-plugin-import to v2.25.4 (#5518) Co-authored-by: Renovate Bot --- package-lock.json | 61 +++++++++++++++-------------------------------- package.json | 2 +- 2 files changed, 20 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f1e0da82ec..77428903972 100644 --- a/package-lock.json +++ b/package-lock.json @@ -107,7 +107,7 @@ "deep-freeze": "0.0.1", "eslint-import-resolver-typescript": "2.5.0", "eslint-import-resolver-webpack": "0.13.2", - "eslint-plugin-import": "2.25.3", + "eslint-plugin-import": "2.25.4", "eslint-plugin-woocommerce": "file:bin/eslint-plugin-woocommerce", "eslint-plugin-you-dont-need-lodash-underscore": "6.10.0", "expect-puppeteer": "6.0.2", @@ -18011,14 +18011,13 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz", - "integrity": "sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ==", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz", + "integrity": "sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg==", "dev": true, "dependencies": { "debug": "^3.2.7", - "find-up": "^2.1.0", - "pkg-dir": "^2.0.0" + "find-up": "^2.1.0" }, "engines": { "node": ">=4" @@ -18091,22 +18090,10 @@ "node": ">=4" } }, - "node_modules/eslint-module-utils/node_modules/pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "dependencies": { - "find-up": "^2.1.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-plugin-import": { - "version": "2.25.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz", - "integrity": "sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg==", + "version": "2.25.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", + "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", "dev": true, "dependencies": { "array-includes": "^3.1.4", @@ -18114,14 +18101,14 @@ "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.1", + "eslint-module-utils": "^2.7.2", "has": "^1.0.3", "is-core-module": "^2.8.0", "is-glob": "^4.0.3", "minimatch": "^3.0.4", "object.values": "^1.1.5", "resolve": "^1.20.0", - "tsconfig-paths": "^3.11.0" + "tsconfig-paths": "^3.12.0" }, "engines": { "node": ">=4" @@ -55430,14 +55417,13 @@ } }, "eslint-module-utils": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz", - "integrity": "sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ==", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz", + "integrity": "sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg==", "dev": true, "requires": { "debug": "^3.2.7", - "find-up": "^2.1.0", - "pkg-dir": "^2.0.0" + "find-up": "^2.1.0" }, "dependencies": { "debug": { @@ -55491,22 +55477,13 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } } } }, "eslint-plugin-import": { - "version": "2.25.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz", - "integrity": "sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg==", + "version": "2.25.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", + "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", "dev": true, "requires": { "array-includes": "^3.1.4", @@ -55514,14 +55491,14 @@ "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.1", + "eslint-module-utils": "^2.7.2", "has": "^1.0.3", "is-core-module": "^2.8.0", "is-glob": "^4.0.3", "minimatch": "^3.0.4", "object.values": "^1.1.5", "resolve": "^1.20.0", - "tsconfig-paths": "^3.11.0" + "tsconfig-paths": "^3.12.0" }, "dependencies": { "debug": { diff --git a/package.json b/package.json index 6f08327634b..cee251a61fb 100644 --- a/package.json +++ b/package.json @@ -147,7 +147,7 @@ "deep-freeze": "0.0.1", "eslint-import-resolver-typescript": "2.5.0", "eslint-import-resolver-webpack": "0.13.2", - "eslint-plugin-import": "2.25.3", + "eslint-plugin-import": "2.25.4", "eslint-plugin-woocommerce": "file:bin/eslint-plugin-woocommerce", "eslint-plugin-you-dont-need-lodash-underscore": "6.10.0", "expect-puppeteer": "6.0.2", From bccdfc1bbb456da3175ada770d1401f2d8c87221 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Wed, 5 Jan 2022 13:53:12 +0100 Subject: [PATCH 08/12] Mini Cart Contents: Fix missing custom background (#5448) * fix missing custom background mini cart contents * fix naming --- src/BlockTypes/MiniCart.php | 10 +++++----- src/Utils/BlockTemplateUtils.php | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/BlockTypes/MiniCart.php b/src/BlockTypes/MiniCart.php index f0decd8685d..9a1b2d78a03 100644 --- a/src/BlockTypes/MiniCart.php +++ b/src/BlockTypes/MiniCart.php @@ -378,12 +378,12 @@ protected function get_markup( $attributes ) { } $template_part_contents = ''; - if ( function_exists( 'gutenberg_get_block_template' ) ) { - $template_part = gutenberg_get_block_template( get_stylesheet() . '//mini-cart', 'wp_template_part' ); - if ( $template_part && ! empty( $template_part->content ) ) { - $template_part_contents = do_blocks( $template_part->content ); - } + $template_part = BlockTemplateUtils::get_block_template( get_stylesheet() . '//mini-cart', 'wp_template_part' ); + + if ( $template_part && ! empty( $template_part->content ) ) { + $template_part_contents = do_blocks( $template_part->content ); } + if ( '' === $template_part_contents ) { $template_part_contents = do_blocks( // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents diff --git a/src/Utils/BlockTemplateUtils.php b/src/Utils/BlockTemplateUtils.php index 8b6d793a63b..c856ce17e4c 100644 --- a/src/Utils/BlockTemplateUtils.php +++ b/src/Utils/BlockTemplateUtils.php @@ -352,6 +352,28 @@ public static function supports_block_templates() { return true; } + /** + * Retrieves a single unified template object using its id. + * + * @param string $id Template unique identifier (example: theme_slug//template_slug). + * @param string $template_type Optional. Template type: `'wp_template'` or '`wp_template_part'`. + * Default `'wp_template'`. + * + * @return WP_Block_Template|null Template. + */ + public static function get_block_template( $id, $template_type ) { + if ( function_exists( 'get_block_template' ) ) { + return get_block_template( $id, $template_type ); + } + + if ( function_exists( 'gutenberg_get_block_template' ) ) { + return gutenberg_get_block_template( $id, $template_type ); + } + + return null; + + } + /** * Checks if we can fallback to the `archive-product` template for a given slug * From 95c9ead282ac1d5ff4e20b33acbaeecfa124cf41 Mon Sep 17 00:00:00 2001 From: Lucio Giannotta Date: Wed, 5 Jan 2022 19:18:23 +0100 Subject: [PATCH 09/12] Legacy Template: Add warning about block removal (#5208) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Legacy blocks were previous locked for removal to avoid unintended consequences. However, this would lock the ability to move the block within other e.g. layout blocks and unnecessarily limit merchant customization ability. Now that we have reverted this decision, merchants could delete this block, which is likely **not** what they want to do. While we investigate other, more long-term, solutions, we are adding a warning notice. Refs #5180. Fixes #5207. * Rename legacy blocks to avoid confusion with the term “Template” --- assets/js/blocks/legacy-template/constants.ts | 8 +++--- assets/js/blocks/legacy-template/editor.scss | 5 ++++ assets/js/blocks/legacy-template/index.tsx | 28 ++++++++++++++----- .../feedback-prompt/index.js | 10 +++++++ 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/assets/js/blocks/legacy-template/constants.ts b/assets/js/blocks/legacy-template/constants.ts index 85f1ec5f319..42b8cfb14c8 100644 --- a/assets/js/blocks/legacy-template/constants.ts +++ b/assets/js/blocks/legacy-template/constants.ts @@ -6,28 +6,28 @@ import { __ } from '@wordpress/i18n'; export const TEMPLATES: Record< string, Record< string, string > > = { 'single-product': { title: __( - 'WooCommerce Single Product Template', + 'WooCommerce Single Product Block', 'woo-gutenberg-products-block' ), placeholder: 'single-product', }, 'archive-product': { title: __( - 'WooCommerce Product Archive Template', + 'WooCommerce Product Grid Block', 'woo-gutenberg-products-block' ), placeholder: 'archive-product', }, 'taxonomy-product_cat': { title: __( - 'WooCommerce Product Taxonomy Template', + 'WooCommerce Product Taxonomy Block', 'woo-gutenberg-products-block' ), placeholder: 'archive-product', }, 'taxonomy-product_tag': { title: __( - 'WooCommerce Product Tag Template', + 'WooCommerce Product Tag Block', 'woo-gutenberg-products-block' ), placeholder: 'archive-product', diff --git a/assets/js/blocks/legacy-template/editor.scss b/assets/js/blocks/legacy-template/editor.scss index 7ddf81acc5a..f7a34eb1534 100644 --- a/assets/js/blocks/legacy-template/editor.scss +++ b/assets/js/blocks/legacy-template/editor.scss @@ -3,6 +3,11 @@ margin-bottom: 30px; } +.wp-block-woocommerce-legacy-template__placeholder-warning { + border-left: 5px solid #2181d2; + padding-left: em(40px); +} + .wp-block-woocommerce-legacy-template__placeholder-wireframe { width: 100%; height: 250px; diff --git a/assets/js/blocks/legacy-template/index.tsx b/assets/js/blocks/legacy-template/index.tsx index b54fef312c3..fe973e65f10 100644 --- a/assets/js/blocks/legacy-template/index.tsx +++ b/assets/js/blocks/legacy-template/index.tsx @@ -34,14 +34,28 @@ const Edit = ( { attributes }: Props ) => { className="wp-block-woocommerce-legacy-template__placeholder" >
- { sprintf( - /* translators: %s is the template title */ - __( - 'This is an editor placeholder for the %s. On your store this will be replaced by the template and display with your product image(s), title, price, etc. You can move this placeholder around and add further blocks around it to extend the template.', +

+ + { __( + 'Attention: Do not remove this block!', + 'woo-gutenberg-products-block' + ) } + { ' ' } + { __( + 'Removal will cause unintended effects on your store.', 'woo-gutenberg-products-block' - ), - templateTitle - ) } + ) } +

+

+ { sprintf( + /* translators: %s is the template title */ + __( + 'This is an editor placeholder for the %s. On your store this will be replaced by the template and display with your product image(s), title, price, etc. You can move this placeholder around and add further blocks around it to extend the template.', + 'woo-gutenberg-products-block' + ), + templateTitle + ) } +

( url="https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?template=--cart-checkout-feedback.md" /> ); + +export const LegacyFeedbackPrompt = () => ( + +); From 512cc04ff33c728c20dfa61213c066fd73ce4011 Mon Sep 17 00:00:00 2001 From: Lucio Giannotta Date: Wed, 5 Jan 2022 19:28:51 +0100 Subject: [PATCH 10/12] Move Woo Blocks template directories to latest Gutenberg convention (#5464) * Align Woo Block template locations with the newest convention While we now support both the old and new conventions for the templates paths, our own repo should be aligned with the latest convention. See: #5455 Fixes: #5343 * Simplify `generate_template_slug_from_path` function * Change `BlockTemplatesController` constructor to get correct dir names * Update Mini Cart template path --- src/BlockTemplatesController.php | 27 ++++++------------- src/BlockTypes/MiniCart.php | 2 +- src/Utils/BlockTemplateUtils.php | 13 ++++----- .../mini-cart.html | 0 .../archive-product.html | 0 .../single-product.html | 0 .../taxonomy-product_cat.html | 0 .../taxonomy-product_tag.html | 0 8 files changed, 14 insertions(+), 28 deletions(-) rename templates/{block-template-parts => parts}/mini-cart.html (100%) rename templates/{block-templates => templates}/archive-product.html (100%) rename templates/{block-templates => templates}/single-product.html (100%) rename templates/{block-templates => templates}/taxonomy-product_cat.html (100%) rename templates/{block-templates => templates}/taxonomy-product_tag.html (100%) diff --git a/src/BlockTemplatesController.php b/src/BlockTemplatesController.php index be1fa2ea7da..7ea5ca9ce1a 100644 --- a/src/BlockTemplatesController.php +++ b/src/BlockTemplatesController.php @@ -25,18 +25,11 @@ class BlockTemplatesController { private $template_parts_directory; /** - * Directory name of the block template directory. + * Directory which contains all templates * * @var string */ - const TEMPLATES_DIR_NAME = 'block-templates'; - - /** - * Directory name of the block template parts directory. - * - * @var string - */ - const TEMPLATE_PARTS_DIR_NAME = 'block-template-parts'; + const TEMPLATES_ROOT_DIR = 'templates'; /** * Constructor. @@ -44,8 +37,10 @@ class BlockTemplatesController { public function __construct() { // This feature is gated for WooCommerce versions 6.0.0 and above. if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '6.0.0', '>=' ) ) { - $this->templates_directory = plugin_dir_path( __DIR__ ) . 'templates/' . self::TEMPLATES_DIR_NAME; - $this->template_parts_directory = plugin_dir_path( __DIR__ ) . 'templates/' . self::TEMPLATE_PARTS_DIR_NAME; + $root_path = plugin_dir_path( __DIR__ ) . self::TEMPLATES_ROOT_DIR . DIRECTORY_SEPARATOR; + + $this->templates_directory = $root_path . BlockTemplateUtils::DIRECTORY_NAMES['TEMPLATES']; + $this->template_parts_directory = $root_path . BlockTemplateUtils::DIRECTORY_NAMES['TEMPLATE_PARTS']; $this->init(); } } @@ -61,7 +56,7 @@ protected function init() { /** * This function checks if there's a blocks template (ultimately it resolves either a saved blocks template from the - * database or a template file in `woo-gutenberg-products-block/templates/block-templates/`) + * database or a template file in `woo-gutenberg-products-block/templates/templates/`) * to return to pre_get_posts short-circuiting the query in Gutenberg. * * @param \WP_Block_Template|null $template Return a block template object to short-circuit the default query, @@ -311,14 +306,8 @@ public function get_block_templates_from_woocommerce( $slugs, $already_found_tem $template_files = BlockTemplateUtils::gutenberg_get_template_paths( $directory ); $templates = array(); - if ( 'wp_template_part' === $template_type ) { - $dir_name = self::TEMPLATE_PARTS_DIR_NAME; - } else { - $dir_name = self::TEMPLATES_DIR_NAME; - } - foreach ( $template_files as $template_file ) { - $template_slug = BlockTemplateUtils::generate_template_slug_from_path( $template_file, $dir_name ); + $template_slug = BlockTemplateUtils::generate_template_slug_from_path( $template_file ); // This template does not have a slug we're looking for. Skip it. if ( is_array( $slugs ) && count( $slugs ) > 0 && ! in_array( $template_slug, $slugs, true ) ) { diff --git a/src/BlockTypes/MiniCart.php b/src/BlockTypes/MiniCart.php index 9a1b2d78a03..2ee0aff9e25 100644 --- a/src/BlockTypes/MiniCart.php +++ b/src/BlockTypes/MiniCart.php @@ -387,7 +387,7 @@ protected function get_markup( $attributes ) { if ( '' === $template_part_contents ) { $template_part_contents = do_blocks( // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents - file_get_contents( Package::get_path() . 'templates/block-template-parts/mini-cart.html' ) + file_get_contents( Package::get_path() . 'templates/' . BlockTemplateUtils::DIRECTORY_NAMES['TEMPLATE_PARTS'] . '/mini-cart.html' ) ); } diff --git a/src/Utils/BlockTemplateUtils.php b/src/Utils/BlockTemplateUtils.php index c856ce17e4c..fc50cd059b9 100644 --- a/src/Utils/BlockTemplateUtils.php +++ b/src/Utils/BlockTemplateUtils.php @@ -254,15 +254,12 @@ public static function convert_slug_to_title( $template_slug ) { * Converts template paths into a slug * * @param string $path The template's path. - * @param string $directory_name The template's directory name. * @return string slug */ - public static function generate_template_slug_from_path( $path, $directory_name = 'block-templates' ) { - return substr( - $path, - strpos( $path, $directory_name . DIRECTORY_SEPARATOR ) + 1 + strlen( $directory_name ), - -5 - ); + public static function generate_template_slug_from_path( $path ) { + $template_extension = '.html'; + + return basename( $path, $template_extension ); } /** @@ -298,8 +295,8 @@ public static function get_theme_template_path( $template_slug, $template_type = function( $carry, $item ) use ( $template_filename ) { $filepath = DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . $template_filename; - $carry[] = get_template_directory() . $filepath; $carry[] = get_stylesheet_directory() . $filepath; + $carry[] = get_template_directory() . $filepath; return $carry; }, diff --git a/templates/block-template-parts/mini-cart.html b/templates/parts/mini-cart.html similarity index 100% rename from templates/block-template-parts/mini-cart.html rename to templates/parts/mini-cart.html diff --git a/templates/block-templates/archive-product.html b/templates/templates/archive-product.html similarity index 100% rename from templates/block-templates/archive-product.html rename to templates/templates/archive-product.html diff --git a/templates/block-templates/single-product.html b/templates/templates/single-product.html similarity index 100% rename from templates/block-templates/single-product.html rename to templates/templates/single-product.html diff --git a/templates/block-templates/taxonomy-product_cat.html b/templates/templates/taxonomy-product_cat.html similarity index 100% rename from templates/block-templates/taxonomy-product_cat.html rename to templates/templates/taxonomy-product_cat.html diff --git a/templates/block-templates/taxonomy-product_tag.html b/templates/templates/taxonomy-product_tag.html similarity index 100% rename from templates/block-templates/taxonomy-product_tag.html rename to templates/templates/taxonomy-product_tag.html From c90d6d22a994ea49f6145a0eed2b70133b3c9776 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Thu, 6 Jan 2022 09:47:34 +0100 Subject: [PATCH 11/12] Mini Cart Block: The color of the badge reflects the global style (#5477) * Mini Cart Block: the color of the badge reflects the global style #4965 Mini Cart Block: the color of the badge reflects the global style #4965 * disable background --- assets/js/blocks/cart-checkout/mini-cart/index.tsx | 1 + .../js/blocks/cart-checkout/mini-cart/quantity-badge/style.scss | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/js/blocks/cart-checkout/mini-cart/index.tsx b/assets/js/blocks/cart-checkout/mini-cart/index.tsx index 0dd00870469..3936622f6cd 100644 --- a/assets/js/blocks/cart-checkout/mini-cart/index.tsx +++ b/assets/js/blocks/cart-checkout/mini-cart/index.tsx @@ -36,6 +36,7 @@ const settings = { * to add color classes and style to the wrapper. */ __experimentalSkipSerialization: true, + background: false, }, /** * We need this experimental flag because we don't want to style the diff --git a/assets/js/blocks/cart-checkout/mini-cart/quantity-badge/style.scss b/assets/js/blocks/cart-checkout/mini-cart/quantity-badge/style.scss index eea3915ad0e..701316cd27a 100644 --- a/assets/js/blocks/cart-checkout/mini-cart/quantity-badge/style.scss +++ b/assets/js/blocks/cart-checkout/mini-cart/quantity-badge/style.scss @@ -9,7 +9,7 @@ border: 0.15em solid; border-radius: 1em; box-sizing: border-box; - color: #000; + color: inherit; display: flex; font-size: 0.875em; font-weight: 600; From f2a2a3e51e69304acbbce33827c2f19a9d1df1a7 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Thu, 6 Jan 2022 15:30:34 +0100 Subject: [PATCH 12/12] Filter Products By Price block: don't allow to insert negative values on inputs (#5123) * Don't allow to insert negative values on input for Filter Products By Price block #2695 Don't allow to insert negative values on input for Filter Products By Price block * renaming util functions and add comments --- .../formatted-monetary-amount/index.tsx | 2 + .../js/base/components/price-slider/index.tsx | 29 +++++++++++++ .../js/base/components/price-slider/utils.ts | 41 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 assets/js/base/components/price-slider/utils.ts diff --git a/assets/js/base/components/formatted-monetary-amount/index.tsx b/assets/js/base/components/formatted-monetary-amount/index.tsx index 4eb92f962b5..4b7bef06de9 100644 --- a/assets/js/base/components/formatted-monetary-amount/index.tsx +++ b/assets/js/base/components/formatted-monetary-amount/index.tsx @@ -18,6 +18,8 @@ interface FormattedMonetaryAmountProps extends Omit< NumberFormatProps, 'onValueChange' > { className?: string; displayType?: NumberFormatProps[ 'displayType' ]; + allowNegative?: boolean; + isAllowed?: ( formattedValue: NumberFormatValues ) => boolean; value: number | string; // Value of money amount. currency: Currency | Record< string, never >; // Currency configuration object. onValueChange?: ( unit: number ) => void; // Function to call when value changes. diff --git a/assets/js/base/components/price-slider/index.tsx b/assets/js/base/components/price-slider/index.tsx index e18aa9f4102..aa1ef665945 100644 --- a/assets/js/base/components/price-slider/index.tsx +++ b/assets/js/base/components/price-slider/index.tsx @@ -19,6 +19,7 @@ import { Currency, isObject } from '@woocommerce/types'; import './style.scss'; import { constrainRangeSliderValues } from './constrain-range-slider-values'; import FilterSubmitButton from '../filter-submit-button'; +import { isValidMaxValue, isValidMinValue } from './utils'; export interface PriceSliderProps { /** @@ -240,9 +241,27 @@ const PriceSlider = ( { ) { return; } + const isMin = event.target.classList.contains( 'wc-block-price-filter__amount--min' ); + + // When the user inserts in the max price input a value less or equal than the current minimum price, + // we set to 0 the minimum price. + if ( minPriceInput >= maxPriceInput ) { + const values = constrainRangeSliderValues( + [ 0, maxPriceInput ], + null, + null, + stepValue, + isMin + ); + return onChange( [ + parseInt( values[ 0 ], 10 ), + parseInt( values[ 1 ], 10 ), + ] ); + } + const values = constrainRangeSliderValues( [ minPriceInput, maxPriceInput ], null, @@ -351,6 +370,12 @@ const PriceSlider = ( { 'Filter products by minimum price', 'woo-gutenberg-products-block' ) } + allowNegative={ false } + isAllowed={ isValidMinValue( { + minConstraint, + minorUnit: currency.minorUnit, + currentMaxValue: maxPriceInput, + } ) } onValueChange={ ( value ) => { if ( value === minPriceInput ) { return; @@ -369,6 +394,10 @@ const PriceSlider = ( { 'Filter products by maximum price', 'woo-gutenberg-products-block' ) } + isAllowed={ isValidMaxValue( { + maxConstraint, + minorUnit: currency.minorUnit, + } ) } onValueChange={ ( value ) => { if ( value === maxPriceInput ) { return; diff --git a/assets/js/base/components/price-slider/utils.ts b/assets/js/base/components/price-slider/utils.ts new file mode 100644 index 00000000000..1fbab6fe2f9 --- /dev/null +++ b/assets/js/base/components/price-slider/utils.ts @@ -0,0 +1,41 @@ +/** + * External dependencies + */ +import { NumberFormatValues } from 'react-number-format'; + +/** + Check if that the value is minor than the max price and greater than 0. + */ +export const isValidMaxValue = ( { + maxConstraint, + minorUnit, +}: { + maxConstraint: number; + minorUnit: number; +} ) => ( { floatValue }: NumberFormatValues ): boolean => { + const maxPrice = maxConstraint / 10 ** minorUnit; + + return floatValue !== undefined && floatValue <= maxPrice && floatValue > 0; +}; + +/** + Check if that the value is minor than the max price and greater than 0. + */ +export const isValidMinValue = ( { + minConstraint, + currentMaxValue, + minorUnit, +}: { + minConstraint: number; + currentMaxValue: number; + minorUnit: number; +} ) => ( { floatValue }: NumberFormatValues ): boolean => { + const minPrice = minConstraint / 10 ** minorUnit; + const currentMaxPrice = currentMaxValue / 10 ** minorUnit; + + return ( + floatValue !== undefined && + floatValue >= minPrice && + floatValue < currentMaxPrice + ); +};