WooCommerce Gutenberg Products Block - Version 8.7.1

Version Description

  • 2022-10-12 =

  • Fixed an issue where JavaScript errors would occur when more than one extension tried to filter specific payment methods in the Cart and Checkout blocks. (7377)

Download this release

Release Info

Developer automattic
Plugin Icon 128x128 WooCommerce Gutenberg Products Block
Version 8.7.1
Comparing to
See all releases

Code changes from version 8.7.0 to 8.7.1

assets/js/blocks-registry/payment-methods/payment-method-config-helper.ts CHANGED
@@ -50,6 +50,12 @@ export const canMakePaymentWithExtensions =
50
 
51
  Object.entries( extensionsCallbacks ).forEach(
52
  ( [ namespace, callbacks ] ) => {
 
 
 
 
 
 
53
  namespacedCallbacks[ namespace ] =
54
  callbacks[ paymentMethodName ];
55
  }
50
 
51
  Object.entries( extensionsCallbacks ).forEach(
52
  ( [ namespace, callbacks ] ) => {
53
+ if (
54
+ ! ( paymentMethodName in callbacks ) ||
55
+ typeof callbacks[ paymentMethodName ] !== 'function'
56
+ ) {
57
+ return;
58
+ }
59
  namespacedCallbacks[ namespace ] =
60
  callbacks[ paymentMethodName ];
61
  }
assets/js/blocks-registry/payment-methods/test/payment-method-config-helper.ts CHANGED
@@ -88,6 +88,9 @@ describe( 'payment-method-config-helper', () => {
88
  woopay: trueCallback,
89
  // testpay: one callback errors, one returns true
90
  testpay: throwsCallback,
 
 
 
91
  }
92
  );
93
  registerPaymentMethodExtensionCallbacks(
@@ -202,5 +205,14 @@ describe( 'payment-method-config-helper', () => {
202
  expect( throwsCallback ).toHaveBeenCalledTimes( 1 );
203
  expect( trueCallback ).toHaveBeenCalledTimes( 1 );
204
  } );
 
 
 
 
 
 
 
 
 
205
  } );
206
  } );
88
  woopay: trueCallback,
89
  // testpay: one callback errors, one returns true
90
  testpay: throwsCallback,
91
+ // Used to check that only valid callbacks run in each namespace. It is not present in
92
+ // 'other-woocommerce-marketplace-extension'.
93
+ blocks_pay: trueCallback,
94
  }
95
  );
96
  registerPaymentMethodExtensionCallbacks(
205
  expect( throwsCallback ).toHaveBeenCalledTimes( 1 );
206
  expect( trueCallback ).toHaveBeenCalledTimes( 1 );
207
  } );
208
+
209
+ it( 'Does not error when a callback for a payment method is in one namespace but not another', () => {
210
+ helpers.canMakePaymentWithExtensions(
211
+ () => true,
212
+ canMakePaymentExtensionsCallbacks,
213
+ 'blocks_pay'
214
+ )( canMakePaymentArgument );
215
+ expect( console ).not.toHaveErrored();
216
+ } );
217
  } );
218
  } );
build/wc-blocks-registry.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-data', 'wp-deprecated', 'wp-element', 'wp-polyfill'), 'version' => 'bc672d7e1037a348ada3ccc3773eed07');
1
+ <?php return array('dependencies' => array('wp-data', 'wp-deprecated', 'wp-element', 'wp-polyfill'), 'version' => '7df57de74cc20f3474c65c1949bf99ef');
build/wc-blocks-registry.js CHANGED
@@ -1 +1 @@
1
- this.wc=this.wc||{},this.wc.wcBlocksRegistry=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=143)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.data},143:function(e,t,n){"use strict";n.r(t),n.d(t,"registerPaymentMethod",(function(){return w})),n.d(t,"registerExpressPaymentMethod",(function(){return k})),n.d(t,"registerPaymentMethodExtensionCallbacks",(function(){return P})),n.d(t,"__experimentalDeRegisterPaymentMethod",(function(){return M})),n.d(t,"__experimentalDeRegisterExpressPaymentMethod",(function(){return E})),n.d(t,"getPaymentMethods",(function(){return T})),n.d(t,"getExpressPaymentMethods",(function(){return C})),n.d(t,"getRegisteredBlockComponents",(function(){return x})),n.d(t,"getRegisteredInnerBlocks",(function(){return I})),n.d(t,"registerBlockComponent",(function(){return S})),n.d(t,"registerInnerBlock",(function(){return _}));var o=n(8),r=n.n(o),a=n(1),i=n(20),s=n.n(i),c=n(0);const l={},u=l,p=(e,t,n)=>{const o=((e,t)=>n=>((null==n?void 0:n.paymentRequirements)||[]).every(e=>t.includes(e))&&e(n))(e,t);return Object.values(u).some(e=>n in e)?((e,t,n)=>o=>{let r=e(o);if(r){const e={};Object.entries(t).forEach(t=>{let[o,r]=t;e[o]=r[n]}),r=Object.keys(e).every(t=>{try{return e[t](o)}catch(e){return console.error(`Error when executing callback for ${n} in ${t}`,e),!0}})}return r})(o,u,n):o},d=(e,t)=>{if(null!==e&&!Object(c.isValidElement)(e))throw new TypeError(`The ${t} property for the payment method must be a React element or null.`)},m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=t.reduce((t,n)=>(e.hasOwnProperty(n)||t.push(n),t),[]);if(n.length>0)throw new TypeError("The payment method configuration object is missing the following properties:"+n.join(", "))},h=()=>null;class f{constructor(e){var t,n,o,r;f.assertValidConfig(e),this.name=e.name,this.label=e.label,this.placeOrderButtonLabel=e.placeOrderButtonLabel,this.ariaLabel=e.ariaLabel,this.content=e.content,this.savedTokenComponent=e.savedTokenComponent,this.icons=e.icons||null,this.edit=e.edit,this.paymentMethodId=e.paymentMethodId||this.name,this.supports={showSavedCards:(null==e||null===(t=e.supports)||void 0===t?void 0:t.showSavedCards)||(null==e||null===(n=e.supports)||void 0===n?void 0:n.savePaymentInfo)||!1,showSaveOption:(null==e||null===(o=e.supports)||void 0===o?void 0:o.showSaveOption)||!1,features:(null==e||null===(r=e.supports)||void 0===r?void 0:r.features)||["products"]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return p(this.canMakePaymentFromConfig,this.supports.features,this.name)}}s()(f,"assertValidConfig",e=>{var t,n,o,a,i,s,l;if(e.savedTokenComponent=e.savedTokenComponent||Object(c.createElement)(h,null),m(e,["name","label","ariaLabel","content","edit","canMakePayment"]),"string"!=typeof e.name)throw new Error("The name property for the payment method must be a string");if(void 0!==e.icons&&!Array.isArray(e.icons)&&null!==e.icons)throw new Error("The icons property for the payment method must be an array or null.");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if("string"!=typeof e.placeOrderButtonLabel&&void 0!==e.placeOrderButtonLabel)throw new TypeError("The placeOrderButtonLabel property for the payment method must be a string");if(((e,t)=>{if(null!==e&&!Object(c.isValidElement)(e)&&"string"!=typeof e)throw new TypeError("The label property for the payment method must be a React element, a string, or null.")})(e.label),d(e.content,"content"),d(e.edit,"edit"),d(e.savedTokenComponent,"savedTokenComponent"),"string"!=typeof e.ariaLabel)throw new TypeError("The ariaLabel property for the payment method must be a string");if("function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the payment method must be a function.");if(void 0!==(null===(t=e.supports)||void 0===t?void 0:t.showSavedCards)&&"boolean"!=typeof(null===(n=e.supports)||void 0===n?void 0:n.showSavedCards))throw new TypeError("If the payment method includes the `supports.showSavedCards` property, it must be a boolean");if(void 0!==(null===(o=e.supports)||void 0===o?void 0:o.savePaymentInfo)&&r()("Passing savePaymentInfo when registering a payment method.",{alternative:"Pass showSavedCards and showSaveOption",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686"}),void 0!==(null===(a=e.supports)||void 0===a?void 0:a.features)&&!Array.isArray(null===(i=e.supports)||void 0===i?void 0:i.features))throw new Error("The features property for the payment method must be an array or undefined.");if(void 0!==(null===(s=e.supports)||void 0===s?void 0:s.showSaveOption)&&"boolean"!=typeof(null===(l=e.supports)||void 0===l?void 0:l.showSaveOption))throw new TypeError("If the payment method includes the `supports.showSaveOption` property, it must be a boolean")});class y{constructor(e){var t;y.assertValidConfig(e),this.name=e.name,this.content=e.content,this.edit=e.edit,this.paymentMethodId=e.paymentMethodId||this.name,this.supports={features:(null==e||null===(t=e.supports)||void 0===t?void 0:t.features)||["products"]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return p(this.canMakePaymentFromConfig,this.supports.features,this.name)}}s()(y,"assertValidConfig",e=>{var t,n;if(m(e,["name","content","edit"]),"string"!=typeof e.name)throw new TypeError("The name property for the express payment method must be a string");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if(void 0!==(null===(t=e.supports)||void 0===t?void 0:t.features)&&!Array.isArray(null===(n=e.supports)||void 0===n?void 0:n.features))throw new Error("The features property for the payment method must be an array or undefined.");if(d(e.content,"content"),d(e.edit,"edit"),"function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the express payment method must be a function.")});var b=n(7);const g={},v={},w=e=>{let t;"function"==typeof e?(t=e(f),r()("Passing a callback to registerPaymentMethod()",{alternative:"a config options object",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404"})):t=new f(e),t instanceof f&&(g[t.name]=t)},k=e=>{let t;"function"==typeof e?(t=e(y),r()("Passing a callback to registerExpressPaymentMethod()",{alternative:"a config options object",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404"})):t=new y(e),t instanceof y&&(v[t.name]=t)},P=(e,t)=>{l[e]?console.error(`The namespace provided to registerPaymentMethodExtensionCallbacks must be unique. Callbacks have already been registered for the ${e} namespace.`):(l[e]={},Object.entries(t).forEach(t=>{let[n,o]=t;"function"==typeof o?l[e][n]=o:console.error(`All callbacks provided to registerPaymentMethodExtensionCallbacks must be functions. The callback for the ${n} payment method in the ${e} namespace was not a function.`)}))},M=e=>{delete g[e];const{__internalRemoveAvailablePaymentMethod:t}=Object(a.dispatch)(b.b);t(e)},E=e=>{delete v[e];const{__internalRemoveAvailableExpressPaymentMethod:t}=Object(a.dispatch)(b.b);t(e)},T=()=>g,C=()=>v,O={};function x(e){return{..."object"==typeof O[e]&&Object.keys(O[e]).length>0?O[e]:{},...O.any}}function I(e){return r()("getRegisteredInnerBlocks",{version:"2.8.0",alternative:"getRegisteredBlockComponents",plugin:"WooCommerce Blocks"}),x(e)}function S(e){e.context||(e.context="any"),R(e,"context","string"),R(e,"blockName","string"),j(e,"component");const{context:t,blockName:n,component:o}=e;O[t]||(O[t]={}),O[t][n]=o}const j=(e,t)=>{if(e[t]){if("function"==typeof e[t])return;if(e[t].$$typeof&&e[t].$$typeof===Symbol.for("react.lazy"))return}throw new Error(`Incorrect value for the ${t} argument when registering a block component. Component must be a valid React Element or Lazy callback.`)},R=(e,t,n)=>{const o=typeof e[t];if(o!==n)throw new Error(`Incorrect value for the ${t} argument when registering a block component. It was a ${o}, but must be a ${n}.`)};function _(e){r()("registerInnerBlock",{version:"2.8.0",alternative:"registerBlockComponent",plugin:"WooCommerce Blocks",hint:'"main" has been replaced with "context" and is now optional.'}),R(e,"main","string"),S({...e,context:e.main})}},20:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},7:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r}));const o="wc/store/payment";let r;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(r||(r={}))},8:function(e,t){e.exports=window.wp.deprecated}});
1
+ this.wc=this.wc||{},this.wc.wcBlocksRegistry=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=143)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.data},143:function(e,t,n){"use strict";n.r(t),n.d(t,"registerPaymentMethod",(function(){return w})),n.d(t,"registerExpressPaymentMethod",(function(){return k})),n.d(t,"registerPaymentMethodExtensionCallbacks",(function(){return P})),n.d(t,"__experimentalDeRegisterPaymentMethod",(function(){return M})),n.d(t,"__experimentalDeRegisterExpressPaymentMethod",(function(){return E})),n.d(t,"getPaymentMethods",(function(){return T})),n.d(t,"getExpressPaymentMethods",(function(){return C})),n.d(t,"getRegisteredBlockComponents",(function(){return x})),n.d(t,"getRegisteredInnerBlocks",(function(){return I})),n.d(t,"registerBlockComponent",(function(){return S})),n.d(t,"registerInnerBlock",(function(){return _}));var o=n(8),r=n.n(o),a=n(1),i=n(20),s=n.n(i),c=n(0);const l={},u=l,p=(e,t,n)=>{const o=((e,t)=>n=>((null==n?void 0:n.paymentRequirements)||[]).every(e=>t.includes(e))&&e(n))(e,t);return Object.values(u).some(e=>n in e)?((e,t,n)=>o=>{let r=e(o);if(r){const e={};Object.entries(t).forEach(t=>{let[o,r]=t;n in r&&"function"==typeof r[n]&&(e[o]=r[n])}),r=Object.keys(e).every(t=>{try{return e[t](o)}catch(e){return console.error(`Error when executing callback for ${n} in ${t}`,e),!0}})}return r})(o,u,n):o},d=(e,t)=>{if(null!==e&&!Object(c.isValidElement)(e))throw new TypeError(`The ${t} property for the payment method must be a React element or null.`)},m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=t.reduce((t,n)=>(e.hasOwnProperty(n)||t.push(n),t),[]);if(n.length>0)throw new TypeError("The payment method configuration object is missing the following properties:"+n.join(", "))},h=()=>null;class f{constructor(e){var t,n,o,r;f.assertValidConfig(e),this.name=e.name,this.label=e.label,this.placeOrderButtonLabel=e.placeOrderButtonLabel,this.ariaLabel=e.ariaLabel,this.content=e.content,this.savedTokenComponent=e.savedTokenComponent,this.icons=e.icons||null,this.edit=e.edit,this.paymentMethodId=e.paymentMethodId||this.name,this.supports={showSavedCards:(null==e||null===(t=e.supports)||void 0===t?void 0:t.showSavedCards)||(null==e||null===(n=e.supports)||void 0===n?void 0:n.savePaymentInfo)||!1,showSaveOption:(null==e||null===(o=e.supports)||void 0===o?void 0:o.showSaveOption)||!1,features:(null==e||null===(r=e.supports)||void 0===r?void 0:r.features)||["products"]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return p(this.canMakePaymentFromConfig,this.supports.features,this.name)}}s()(f,"assertValidConfig",e=>{var t,n,o,a,i,s,l;if(e.savedTokenComponent=e.savedTokenComponent||Object(c.createElement)(h,null),m(e,["name","label","ariaLabel","content","edit","canMakePayment"]),"string"!=typeof e.name)throw new Error("The name property for the payment method must be a string");if(void 0!==e.icons&&!Array.isArray(e.icons)&&null!==e.icons)throw new Error("The icons property for the payment method must be an array or null.");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if("string"!=typeof e.placeOrderButtonLabel&&void 0!==e.placeOrderButtonLabel)throw new TypeError("The placeOrderButtonLabel property for the payment method must be a string");if(((e,t)=>{if(null!==e&&!Object(c.isValidElement)(e)&&"string"!=typeof e)throw new TypeError("The label property for the payment method must be a React element, a string, or null.")})(e.label),d(e.content,"content"),d(e.edit,"edit"),d(e.savedTokenComponent,"savedTokenComponent"),"string"!=typeof e.ariaLabel)throw new TypeError("The ariaLabel property for the payment method must be a string");if("function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the payment method must be a function.");if(void 0!==(null===(t=e.supports)||void 0===t?void 0:t.showSavedCards)&&"boolean"!=typeof(null===(n=e.supports)||void 0===n?void 0:n.showSavedCards))throw new TypeError("If the payment method includes the `supports.showSavedCards` property, it must be a boolean");if(void 0!==(null===(o=e.supports)||void 0===o?void 0:o.savePaymentInfo)&&r()("Passing savePaymentInfo when registering a payment method.",{alternative:"Pass showSavedCards and showSaveOption",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686"}),void 0!==(null===(a=e.supports)||void 0===a?void 0:a.features)&&!Array.isArray(null===(i=e.supports)||void 0===i?void 0:i.features))throw new Error("The features property for the payment method must be an array or undefined.");if(void 0!==(null===(s=e.supports)||void 0===s?void 0:s.showSaveOption)&&"boolean"!=typeof(null===(l=e.supports)||void 0===l?void 0:l.showSaveOption))throw new TypeError("If the payment method includes the `supports.showSaveOption` property, it must be a boolean")});class y{constructor(e){var t;y.assertValidConfig(e),this.name=e.name,this.content=e.content,this.edit=e.edit,this.paymentMethodId=e.paymentMethodId||this.name,this.supports={features:(null==e||null===(t=e.supports)||void 0===t?void 0:t.features)||["products"]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return p(this.canMakePaymentFromConfig,this.supports.features,this.name)}}s()(y,"assertValidConfig",e=>{var t,n;if(m(e,["name","content","edit"]),"string"!=typeof e.name)throw new TypeError("The name property for the express payment method must be a string");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if(void 0!==(null===(t=e.supports)||void 0===t?void 0:t.features)&&!Array.isArray(null===(n=e.supports)||void 0===n?void 0:n.features))throw new Error("The features property for the payment method must be an array or undefined.");if(d(e.content,"content"),d(e.edit,"edit"),"function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the express payment method must be a function.")});var b=n(7);const g={},v={},w=e=>{let t;"function"==typeof e?(t=e(f),r()("Passing a callback to registerPaymentMethod()",{alternative:"a config options object",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404"})):t=new f(e),t instanceof f&&(g[t.name]=t)},k=e=>{let t;"function"==typeof e?(t=e(y),r()("Passing a callback to registerExpressPaymentMethod()",{alternative:"a config options object",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404"})):t=new y(e),t instanceof y&&(v[t.name]=t)},P=(e,t)=>{l[e]?console.error(`The namespace provided to registerPaymentMethodExtensionCallbacks must be unique. Callbacks have already been registered for the ${e} namespace.`):(l[e]={},Object.entries(t).forEach(t=>{let[n,o]=t;"function"==typeof o?l[e][n]=o:console.error(`All callbacks provided to registerPaymentMethodExtensionCallbacks must be functions. The callback for the ${n} payment method in the ${e} namespace was not a function.`)}))},M=e=>{delete g[e];const{__internalRemoveAvailablePaymentMethod:t}=Object(a.dispatch)(b.b);t(e)},E=e=>{delete v[e];const{__internalRemoveAvailableExpressPaymentMethod:t}=Object(a.dispatch)(b.b);t(e)},T=()=>g,C=()=>v,O={};function x(e){return{..."object"==typeof O[e]&&Object.keys(O[e]).length>0?O[e]:{},...O.any}}function I(e){return r()("getRegisteredInnerBlocks",{version:"2.8.0",alternative:"getRegisteredBlockComponents",plugin:"WooCommerce Blocks"}),x(e)}function S(e){e.context||(e.context="any"),R(e,"context","string"),R(e,"blockName","string"),j(e,"component");const{context:t,blockName:n,component:o}=e;O[t]||(O[t]={}),O[t][n]=o}const j=(e,t)=>{if(e[t]){if("function"==typeof e[t])return;if(e[t].$$typeof&&e[t].$$typeof===Symbol.for("react.lazy"))return}throw new Error(`Incorrect value for the ${t} argument when registering a block component. Component must be a valid React Element or Lazy callback.`)},R=(e,t,n)=>{const o=typeof e[t];if(o!==n)throw new Error(`Incorrect value for the ${t} argument when registering a block component. It was a ${o}, but must be a ${n}.`)};function _(e){r()("registerInnerBlock",{version:"2.8.0",alternative:"registerBlockComponent",plugin:"WooCommerce Blocks",hint:'"main" has been replaced with "context" and is now optional.'}),R(e,"main","string"),S({...e,context:e.main})}},20:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},7:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r}));const o="wc/store/payment";let r;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(r||(r={}))},8:function(e,t){e.exports=window.wp.deprecated}});
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
4
  Requires at least: 6.0
5
  Tested up to: 6.0
6
  Requires PHP: 7.0
7
- Stable tag: 8.7.0
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -80,6 +80,10 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/
80
 
81
  == Changelog ==
82
 
 
 
 
 
83
  = 8.7.0 - 2022-10-10 =
84
 
85
  #### Enhancements
4
  Requires at least: 6.0
5
  Tested up to: 6.0
6
  Requires PHP: 7.0
7
+ Stable tag: 8.7.1
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
80
 
81
  == Changelog ==
82
 
83
+ = 8.7.1 - 2022-10-12 =
84
+
85
+ - Fixed an issue where JavaScript errors would occur when more than one extension tried to filter specific payment methods in the Cart and Checkout blocks. ([7377](https://github.com/woocommerce/woocommerce-blocks/pull/7377))
86
+
87
  = 8.7.0 - 2022-10-10 =
88
 
89
  #### Enhancements
src/Package.php CHANGED
@@ -109,7 +109,7 @@ class Package {
109
  NewPackage::class,
110
  function ( $container ) {
111
  // leave for automated version bumping.
112
- $version = '8.7.0';
113
  return new NewPackage(
114
  $version,
115
  dirname( __DIR__ ),
109
  NewPackage::class,
110
  function ( $container ) {
111
  // leave for automated version bumping.
112
+ $version = '8.7.1';
113
  return new NewPackage(
114
  $version,
115
  dirname( __DIR__ ),
vendor/autoload.php CHANGED
@@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
9
 
10
  require_once __DIR__ . '/composer/autoload_real.php';
11
 
12
- return ComposerAutoloaderInit6b550e184b17485656842ffcbc086fa0::getLoader();
9
 
10
  require_once __DIR__ . '/composer/autoload_real.php';
11
 
12
+ return ComposerAutoloaderInitfd87cadf5eb45d1ca7a37f396ccd5880::getLoader();
vendor/autoload_packages.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit6b550e184b17485656842ffcbc086fa0
6
  {
7
  private static $loader;
8
 
@@ -22,18 +22,18 @@ class ComposerAutoloaderInit6b550e184b17485656842ffcbc086fa0
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit6b550e184b17485656842ffcbc086fa0', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
27
- spl_autoload_unregister(array('ComposerAutoloaderInit6b550e184b17485656842ffcbc086fa0', 'loadClassLoader'));
28
 
29
  require __DIR__ . '/autoload_static.php';
30
- call_user_func(\Composer\Autoload\ComposerStaticInit6b550e184b17485656842ffcbc086fa0::getInitializer($loader));
31
 
32
  $loader->register(true);
33
 
34
- $includeFiles = \Composer\Autoload\ComposerStaticInit6b550e184b17485656842ffcbc086fa0::$files;
35
  foreach ($includeFiles as $fileIdentifier => $file) {
36
- composerRequire6b550e184b17485656842ffcbc086fa0($fileIdentifier, $file);
37
  }
38
 
39
  return $loader;
@@ -45,7 +45,7 @@ class ComposerAutoloaderInit6b550e184b17485656842ffcbc086fa0
45
  * @param string $file
46
  * @return void
47
  */
48
- function composerRequire6b550e184b17485656842ffcbc086fa0($fileIdentifier, $file)
49
  {
50
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
51
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitfd87cadf5eb45d1ca7a37f396ccd5880
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInitfd87cadf5eb45d1ca7a37f396ccd5880', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInitfd87cadf5eb45d1ca7a37f396ccd5880', 'loadClassLoader'));
28
 
29
  require __DIR__ . '/autoload_static.php';
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitfd87cadf5eb45d1ca7a37f396ccd5880::getInitializer($loader));
31
 
32
  $loader->register(true);
33
 
34
+ $includeFiles = \Composer\Autoload\ComposerStaticInitfd87cadf5eb45d1ca7a37f396ccd5880::$files;
35
  foreach ($includeFiles as $fileIdentifier => $file) {
36
+ composerRequirefd87cadf5eb45d1ca7a37f396ccd5880($fileIdentifier, $file);
37
  }
38
 
39
  return $loader;
45
  * @param string $file
46
  * @return void
47
  */
48
+ function composerRequirefd87cadf5eb45d1ca7a37f396ccd5880($fileIdentifier, $file)
49
  {
50
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
51
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit6b550e184b17485656842ffcbc086fa0
8
  {
9
  public static $files = array (
10
  'fcd5d7d87e03ff4f5b5a66c2b8968671' => __DIR__ . '/../..' . '/src/StoreApi/deprecated.php',
@@ -51,9 +51,9 @@ class ComposerStaticInit6b550e184b17485656842ffcbc086fa0
51
  public static function getInitializer(ClassLoader $loader)
52
  {
53
  return \Closure::bind(function () use ($loader) {
54
- $loader->prefixLengthsPsr4 = ComposerStaticInit6b550e184b17485656842ffcbc086fa0::$prefixLengthsPsr4;
55
- $loader->prefixDirsPsr4 = ComposerStaticInit6b550e184b17485656842ffcbc086fa0::$prefixDirsPsr4;
56
- $loader->classMap = ComposerStaticInit6b550e184b17485656842ffcbc086fa0::$classMap;
57
 
58
  }, null, ClassLoader::class);
59
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitfd87cadf5eb45d1ca7a37f396ccd5880
8
  {
9
  public static $files = array (
10
  'fcd5d7d87e03ff4f5b5a66c2b8968671' => __DIR__ . '/../..' . '/src/StoreApi/deprecated.php',
51
  public static function getInitializer(ClassLoader $loader)
52
  {
53
  return \Closure::bind(function () use ($loader) {
54
+ $loader->prefixLengthsPsr4 = ComposerStaticInitfd87cadf5eb45d1ca7a37f396ccd5880::$prefixLengthsPsr4;
55
+ $loader->prefixDirsPsr4 = ComposerStaticInitfd87cadf5eb45d1ca7a37f396ccd5880::$prefixDirsPsr4;
56
+ $loader->classMap = ComposerStaticInitfd87cadf5eb45d1ca7a37f396ccd5880::$classMap;
57
 
58
  }, null, ClassLoader::class);
59
  }
vendor/composer/installed.php CHANGED
@@ -3,7 +3,7 @@
3
  'name' => 'woocommerce/woocommerce-blocks',
4
  'pretty_version' => 'dev-trunk',
5
  'version' => 'dev-trunk',
6
- 'reference' => 'c90c6f18390218af0d91b4436d478b450a6e0fb0',
7
  'type' => 'wordpress-plugin',
8
  'install_path' => __DIR__ . '/../../',
9
  'aliases' => array(),
@@ -43,7 +43,7 @@
43
  'woocommerce/woocommerce-blocks' => array(
44
  'pretty_version' => 'dev-trunk',
45
  'version' => 'dev-trunk',
46
- 'reference' => 'c90c6f18390218af0d91b4436d478b450a6e0fb0',
47
  'type' => 'wordpress-plugin',
48
  'install_path' => __DIR__ . '/../../',
49
  'aliases' => array(),
3
  'name' => 'woocommerce/woocommerce-blocks',
4
  'pretty_version' => 'dev-trunk',
5
  'version' => 'dev-trunk',
6
+ 'reference' => '585b6a2e8f5eb8e42faeb4c18fd90fbf2195e44b',
7
  'type' => 'wordpress-plugin',
8
  'install_path' => __DIR__ . '/../../',
9
  'aliases' => array(),
43
  'woocommerce/woocommerce-blocks' => array(
44
  'pretty_version' => 'dev-trunk',
45
  'version' => 'dev-trunk',
46
+ 'reference' => '585b6a2e8f5eb8e42faeb4c18fd90fbf2195e44b',
47
  'type' => 'wordpress-plugin',
48
  'install_path' => __DIR__ . '/../../',
49
  'aliases' => array(),
vendor/composer/jetpack_autoload_filemap.php CHANGED
@@ -7,11 +7,11 @@ $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
  'fcd5d7d87e03ff4f5b5a66c2b8968671' => array(
10
- 'version' => '8.7.0.0',
11
  'path' => $baseDir . '/src/StoreApi/deprecated.php'
12
  ),
13
  'd0f16a186498c2ba04f1d0064fecf9cf' => array(
14
- 'version' => '8.7.0.0',
15
  'path' => $baseDir . '/src/StoreApi/functions.php'
16
  ),
17
  );
7
 
8
  return array(
9
  'fcd5d7d87e03ff4f5b5a66c2b8968671' => array(
10
+ 'version' => '8.7.1.0',
11
  'path' => $baseDir . '/src/StoreApi/deprecated.php'
12
  ),
13
  'd0f16a186498c2ba04f1d0064fecf9cf' => array(
14
+ 'version' => '8.7.1.0',
15
  'path' => $baseDir . '/src/StoreApi/functions.php'
16
  ),
17
  );
vendor/composer/jetpack_autoload_psr4.php CHANGED
@@ -11,15 +11,15 @@ return array(
11
  'path' => array( $vendorDir . '/composer/installers/src/Composer/Installers' )
12
  ),
13
  'Automattic\\WooCommerce\\StoreApi\\' => array(
14
- 'version' => '8.7.0.0',
15
  'path' => array( $baseDir . '/src/StoreApi' )
16
  ),
17
  'Automattic\\WooCommerce\\Blocks\\Tests\\' => array(
18
- 'version' => '8.7.0.0',
19
  'path' => array( $baseDir . '/tests/php' )
20
  ),
21
  'Automattic\\WooCommerce\\Blocks\\' => array(
22
- 'version' => '8.7.0.0',
23
  'path' => array( $baseDir . '/src' )
24
  ),
25
  'Automattic\\Jetpack\\Autoloader\\' => array(
11
  'path' => array( $vendorDir . '/composer/installers/src/Composer/Installers' )
12
  ),
13
  'Automattic\\WooCommerce\\StoreApi\\' => array(
14
+ 'version' => '8.7.1.0',
15
  'path' => array( $baseDir . '/src/StoreApi' )
16
  ),
17
  'Automattic\\WooCommerce\\Blocks\\Tests\\' => array(
18
+ 'version' => '8.7.1.0',
19
  'path' => array( $baseDir . '/tests/php' )
20
  ),
21
  'Automattic\\WooCommerce\\Blocks\\' => array(
22
+ 'version' => '8.7.1.0',
23
  'path' => array( $baseDir . '/src' )
24
  ),
25
  'Automattic\\Jetpack\\Autoloader\\' => array(
vendor/jetpack-autoloader/class-autoloader-handler.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-autoloader-locator.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-autoloader.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-container.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-hook-manager.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-latest-autoloader-guard.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-manifest-reader.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-path-processor.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-php-autoloader.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-plugin-locator.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-plugins-handler.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-shutdown-handler.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-version-loader.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
vendor/jetpack-autoloader/class-version-selector.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp6b550e184b17485656842ffcbc086fa0;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jpfd87cadf5eb45d1ca7a37f396ccd5880;
9
 
10
  // phpcs:ignore
11
 
woocommerce-gutenberg-products-block.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce Blocks
4
  * Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
5
  * Description: WooCommerce blocks for the Gutenberg editor.
6
- * Version: 8.7.0
7
  * Author: Automattic
8
  * Author URI: https://woocommerce.com
9
  * Text Domain: woo-gutenberg-products-block
3
  * Plugin Name: WooCommerce Blocks
4
  * Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
5
  * Description: WooCommerce blocks for the Gutenberg editor.
6
+ * Version: 8.7.1
7
  * Author: Automattic
8
  * Author URI: https://woocommerce.com
9
  * Text Domain: woo-gutenberg-products-block