Version Description
- 2021-09-23 =
Bug fixes
- Fix infinite recursion when removing an attribute filter from the Active filters block. (4816)
Download this release
Release Info
Developer | automattic |
Plugin | WooCommerce Gutenberg Products Block |
Version | 5.9.1 |
Comparing to | |
See all releases |
Code changes from version 5.9.0 to 5.9.1
- assets/js/blocks/attribute-filter/block.js +20 -9
- build/attribute-filter-frontend.asset.php +1 -1
- build/attribute-filter-frontend.js +2 -2
- build/attribute-filter.asset.php +1 -1
- build/attribute-filter.js +5 -5
- readme.txt +8 -2
- src/Package.php +1 -1
- vendor/autoload.php +1 -1
- vendor/autoload_packages.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +4 -4
- vendor/composer/installed.php +2 -2
- vendor/composer/jetpack_autoload_psr4.php +2 -2
- vendor/jetpack-autoloader/class-autoloader-handler.php +1 -1
- vendor/jetpack-autoloader/class-autoloader-locator.php +1 -1
- vendor/jetpack-autoloader/class-autoloader.php +1 -1
- vendor/jetpack-autoloader/class-container.php +1 -1
- vendor/jetpack-autoloader/class-hook-manager.php +1 -1
- vendor/jetpack-autoloader/class-latest-autoloader-guard.php +1 -1
- vendor/jetpack-autoloader/class-manifest-reader.php +1 -1
- vendor/jetpack-autoloader/class-path-processor.php +1 -1
- vendor/jetpack-autoloader/class-php-autoloader.php +1 -1
- vendor/jetpack-autoloader/class-plugin-locator.php +1 -1
- vendor/jetpack-autoloader/class-plugins-handler.php +1 -1
- vendor/jetpack-autoloader/class-shutdown-handler.php +1 -1
- vendor/jetpack-autoloader/class-version-loader.php +1 -1
- vendor/jetpack-autoloader/class-version-selector.php +1 -1
- woocommerce-gutenberg-products-block.php +1 -1
assets/js/blocks/attribute-filter/block.js
CHANGED
@@ -178,8 +178,17 @@ const AttributeFilterBlock = ( {
|
|
178 |
! isShallowEqual( checked, currentCheckedQuery ) // checked query doesn't match the UI
|
179 |
) {
|
180 |
setChecked( currentCheckedQuery );
|
|
|
|
|
|
|
181 |
}
|
182 |
-
}, [
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
|
184 |
/**
|
185 |
* Returns an array of term objects that have been chosen via the checkboxes.
|
@@ -220,13 +229,6 @@ const AttributeFilterBlock = ( {
|
|
220 |
]
|
221 |
);
|
222 |
|
223 |
-
// Track checked STATE changes - if state changes, update the query.
|
224 |
-
useEffect( () => {
|
225 |
-
if ( ! blockAttributes.showFilterButton ) {
|
226 |
-
onSubmit( checked );
|
227 |
-
}
|
228 |
-
}, [ blockAttributes.showFilterButton, checked, onSubmit ] );
|
229 |
-
|
230 |
const multiple =
|
231 |
blockAttributes.displayStyle !== 'dropdown' ||
|
232 |
blockAttributes.queryType === 'or';
|
@@ -312,8 +314,17 @@ const AttributeFilterBlock = ( {
|
|
312 |
}
|
313 |
|
314 |
setChecked( newChecked );
|
|
|
|
|
|
|
315 |
},
|
316 |
-
[
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
);
|
318 |
|
319 |
if ( displayedOptions.length === 0 && ! attributeTermsLoading ) {
|
178 |
! isShallowEqual( checked, currentCheckedQuery ) // checked query doesn't match the UI
|
179 |
) {
|
180 |
setChecked( currentCheckedQuery );
|
181 |
+
if ( ! blockAttributes.showFilterButton ) {
|
182 |
+
onSubmit( currentCheckedQuery );
|
183 |
+
}
|
184 |
}
|
185 |
+
}, [
|
186 |
+
checked,
|
187 |
+
currentCheckedQuery,
|
188 |
+
previousCheckedQuery,
|
189 |
+
onSubmit,
|
190 |
+
blockAttributes.showFilterButton,
|
191 |
+
] );
|
192 |
|
193 |
/**
|
194 |
* Returns an array of term objects that have been chosen via the checkboxes.
|
229 |
]
|
230 |
);
|
231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
const multiple =
|
233 |
blockAttributes.displayStyle !== 'dropdown' ||
|
234 |
blockAttributes.queryType === 'or';
|
314 |
}
|
315 |
|
316 |
setChecked( newChecked );
|
317 |
+
if ( ! blockAttributes.showFilterButton ) {
|
318 |
+
onSubmit( newChecked );
|
319 |
+
}
|
320 |
},
|
321 |
+
[
|
322 |
+
checked,
|
323 |
+
displayedOptions,
|
324 |
+
multiple,
|
325 |
+
onSubmit,
|
326 |
+
blockAttributes.showFilterButton,
|
327 |
+
]
|
328 |
);
|
329 |
|
330 |
if ( displayedOptions.length === 0 && ! attributeTermsLoading ) {
|
build/attribute-filter-frontend.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '57f97e49771c1ed4ac6c24cc77d7d99f');
|
build/attribute-filter-frontend.js
CHANGED
@@ -18,10 +18,10 @@ Object(s.__)("Replace current %s filter","woo-gutenberg-products-block"),r.name)
|
|
18 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
19 |
Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),r.name)},React.createElement(pe.a,{srcElement:de.a,size:16})))};function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(270);var ge=function(e){var t=e.attributeLabel,n=void 0===t?"":t,r=e.className,o=e.checked,i=void 0===o?[]:o,a=e.inputLabel,u=void 0===a?"":a,c=e.isDisabled,l=void 0!==c&&c,p=e.isLoading,d=void 0!==p&&p,f=e.multiple,m=void 0!==f&&f,b=e.onChange,h=void 0===b?function(){}:b,v=e.options,y=void 0===v?[]:v,O=Object(g.useRef)(null),x=w()(r,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":l,"is-loading":d}),_=Object(g.useCallback)((function(e,t){switch(t.type){case oe.stateChangeTypes.keyDownEnter:case oe.stateChangeTypes.clickItem:return be(be({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:m,inputValue:""});case oe.stateChangeTypes.blurInput:case oe.stateChangeTypes.mouseUp:return be(be({},t),{},{inputValue:e.inputValue});default:return t}}),[m]);return React.createElement(oe,{onChange:h,selectedItem:null,stateReducer:_},(function(e){var t=e.getInputProps,r=e.getItemProps,o=e.getLabelProps,a=e.getMenuProps,c=e.highlightedIndex,p=e.inputValue,d=e.isOpen,f=e.openMenu;return React.createElement("div",{className:w()(x,{"is-multiple":m,"is-single":!m,"has-checked":i.length>0,"is-open":d})},React.createElement("label",o({className:"screen-reader-text"}),u),React.createElement(ue,{isOpen:d,onClick:function(){return O.current.focus()}},i.map((function(e){var t=y.find((function(t){return t.value===e})),n=function(e){h(e),O.current.focus()};return m?React.createElement(le,{key:e,onRemoveItem:n,option:t}):React.createElement(fe,{key:e,onClick:function(){return O.current.focus()},onRemoveItem:n,option:t})})),React.createElement(ae,{checked:i,getInputProps:t,inputRef:O,isDisabled:l,onFocus:f,onRemoveItem:function(e){h(e),O.current.focus()},placeholder:i.length>0&&m?null:Object(s.sprintf)(
|
20 |
/* translators: %s attribute name. */
|
21 |
-
Object(s.__)("Any %s","woo-gutenberg-products-block"),n),tabIndex:!m&&i.length>0?"-1":"0",value:p})),d&&!l&&React.createElement(ce,{checked:i,getItemProps:r,getMenuProps:a,highlightedIndex:c,options:y.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},he=n(118),ve=n(144),ye=n(27),Oe=n.n(ye),we=n(24),xe=n(179),_e=n(180),Ee=[{value:"preview-1",name:"Blue",label:React.createElement(he.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:React.createElement(he.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:React.createElement(he.a,{name:"Red",count:2})}],je={id:0,name:"preview",taxonomy:"preview",label:"Preview"};function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(269);Object(o.a)({selector:".wp-block-woocommerce-attribute-filter",Block:Object(r.a)((function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,o=t.isPreview&&!t.attributeId?je:Object(xe.a)(t.attributeId),i=Object(g.useState)([]),a=c()(i,2),u=a[0],v=a[1],y=Object(g.useState)(t.isPreview&&!t.attributeId?Ee:[]),O=c()(y,2),w=O[0],x=O[1],_=Object(f.a)(),E=c()(_,1)[0],j=Object(f.b)("attributes",[]),I=c()(j,2),S=I[0],k=I[1],R=Object(m.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[o.id],shouldSelect:t.attributeId>0}),P=R.results,C=R.isLoading,M="dropdown"!==t.displayStyle&&"and"===t.queryType,T=Object(b.a)({queryAttribute:{taxonomy:o.taxonomy,queryType:t.queryType},queryState:Se(Se({},E),{},{attributes:M?E.attributes:null})}),D=T.results,A=T.isLoading,H=Object(g.useCallback)((function(e){return D.attribute_counts?D.attribute_counts.find((function(t){return t.term===e})):null}),[D]);Object(g.useEffect)((function(){if(!C&&!A){var e=P.map((function(e){var n,r=H(e.id);if(!(r||u.includes(e.slug)||(n=e.slug,null!=E&&E.attributes&&E.attributes.some((function(e){var t=e.attribute,r=e.slug,i=void 0===r?[]:r;return t===o.taxonomy&&i.includes(n)})))))return null;var i=r?r.count:0;return{value:e.slug,name:Object(we.decodeEntities)(e.name),label:React.createElement(he.a,{name:Object(we.decodeEntities)(e.name),count:t.showCounts?i:null})}})).filter(Boolean);x(e)}}),[o.taxonomy,P,C,t.showCounts,A,H,u,E.attributes]);var N=Object(g.useMemo)((function(){return S.filter((function(e){return e.attribute===o.taxonomy})).flatMap((function(e){return e.slug}))}),[S,o.taxonomy]),L=Object(p.a)(N),B=Object(d.a)(L);Object(g.useEffect)((function(){Oe()(B,L)||Oe()(u,L)||v(L)}),[u,L,B]);var V=Object(g.useCallback)((function(e){return P.reduce((function(t,n){return e.includes(n.slug)&&t.push(n),t}),[])}),[P]),K=Object(g.useCallback)((function(e){r||Object(_e.b)(S,k,o,V(e),"or"===t.queryType?"in":"and")}),[r,S,k,o,V,t.queryType])
|
22 |
/* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
|
23 |
Object(s.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),o,i)):o?Object(l.speak)(Object(s.sprintf)(
|
24 |
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
|
25 |
Object(s.__)("%s filter added.","woo-gutenberg-products-block"),o)):i&&Object(l.speak)(Object(s.sprintf)(
|
26 |
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
|
27 |
-
Object(s.__)("%s filter removed.","woo-gutenberg-products-block"),i))},o=u.includes(e);F?(t=u.filter((function(t){return t!==e})),o?r({filterRemoved:e}):(t.push(e),t.sort(),r({filterAdded:e}))):(t=o?[]:[e],r({filterAdded:o?null:e,filterRemoved:1===u.length?u[0]:null})),v(t)}),[u,w,F]);if(0===w.length&&!C)return null;var U="h".concat(t.headingLevel),$=!t.isPreview&&C,W=!t.isPreview&&A;return React.createElement(React.Fragment,null,!r&&t.heading&&React.createElement(U,null,t.heading),React.createElement("div",{className:"wc-block-attribute-filter"},"dropdown"===t.displayStyle?React.createElement(ge,{attributeLabel:o.label,checked:u,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:$,multiple:F,onChange:q,options:w}):React.createElement(h.a,{className:"wc-block-attribute-filter-list",options:w,checked:u,onChange:q,isLoading:$,isDisabled:W}),t.showFilterButton&&React.createElement(ve.a,{className:"wc-block-attribute-filter__button",disabled:$||W,onClick:function(){return K(u)}})))})),getProps:function(e){return{attributes:{attributeId:parseInt(e.dataset.attributeId||0,10),showCounts:"true"===e.dataset.showCounts,queryType:e.dataset.queryType,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3,displayStyle:e.dataset.displayStyle,showFilterButton:"true"===e.dataset.showFilterButton}}}})},32:function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},34:function(e,t){e.exports=window.wp.primitives},36:function(e,t){e.exports=window.wp.a11y},37:function(e,t,n){"use strict";var r=n(5),o=n.n(r),i=n(0),a=n(3),u=n.n(a);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,c=void 0===a?{}:a,l=null!=n,p=null!=r;return!l&&p?(t=o||"span",c=s(s({},c),{},{className:u()(c.className,"screen-reader-text")}),React.createElement(t,c,r)):(t=o||i.Fragment,l&&p&&n!==r?React.createElement(t,c,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,c,n))}},4:function(e,t){e.exports=window.React},44:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},45:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},46:function(e,t,n){var r=n(75);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},47:function(e,t,n){var r=n(22).default,o=n(30);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},5: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.default=e.exports,e.exports.__esModule=!0},53:function(e,t){e.exports=window.wp.blocks},54:function(e,t,n){"use strict";var r=n(44),o=n.n(r),i=n(45),a=n.n(i),u=n(30),c=n.n(u),s=n(46),l=n.n(s),p=n(47),d=n.n(p),f=n(32),m=n.n(f),b=n(5),g=n.n(b),h=(n(9),n(4)),v=n(1),y=n(15),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.n,"/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!","woo-gutenberg-products-block"):r,i=e.text,a=void 0===i?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):i,u=e.errorMessage,c=e.errorMessagePrefix,s=void 0===c?Object(v.__)("Error:","woo-gutenberg-products-block"):c,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),u&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",u),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};n(82);var w=function(e){l()(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var o=m()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return d()(this,e)});function i(){var e;o()(this,i);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),g()(c()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(i,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,i=e.errorMessagePrefix,a=e.renderError,u=e.button,c=this.state,s=c.errorMessage;return c.hasError?"function"==typeof a?a({errorMessage:s}):React.createElement(O,{errorMessage:r?s:null,header:t,imageUrl:n,text:o,errorMessagePrefix:i,button:u}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),i}(h.Component);w.defaultProps={showErrorMessage:!0},t.a=w},58:function(e,t,n){var r=n(101),o=n(102),i=n(71),a=n(103);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},6:function(e,t,n){var r=n(89),o=n(90),i=n(71),a=n(91);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},60:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n(27),i=n.n(o);function a(e){var t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},69:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(o)};o.Provider},7:function(e,t){e.exports=window.lodash},71:function(e,t,n){var r=n(72);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},72:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},75:function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,n){"use strict";var r=n(81);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},81:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},82:function(e,t){},88:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4);function o(e,t,n){void 0===n&&(n={});var o=n.maxWait,i=Object(r.useRef)(null),a=Object(r.useRef)([]),u=n.leading,c=void 0===n.trailing||n.trailing,s=Object(r.useRef)(!1),l=Object(r.useRef)(null),p=Object(r.useRef)(!1),d=Object(r.useRef)(e);d.current=e;var f=Object(r.useCallback)((function(){clearTimeout(l.current),clearTimeout(i.current),i.current=null,a.current=[],l.current=null,s.current=!1}),[]);Object(r.useEffect)((function(){return p.current=!1,function(){p.current=!0}}),[]);var m=Object(r.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.current=e,clearTimeout(l.current),s.current&&(s.current=!1),l.current||!u||s.current||(d.current.apply(d,e),s.current=!0),l.current=setTimeout((function(){var t=!0;u&&s.current&&(t=!1),f(),!p.current&&c&&t&&d.current.apply(d,e)}),t),o&&!i.current&&c&&(i.current=setTimeout((function(){var e=a.current;f(),p.current||d.current.apply(null,e)}),o))}),[o,t,f,u,c]),b=Object(r.useCallback)((function(){l.current&&(d.current.apply(null,a.current),f())}),[f]);return[m,f,b]}},89:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},9:function(e,t,n){e.exports=n(80)()},90:function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},91:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},96:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return b}));var r=n(6),o=n.n(r),i=n(8),a=n(11),u=n(0),c=n(27),s=n.n(c),l=n(60),p=n(116),d=n(69),f=function(e){var t=Object(d.a)();e=e||t;var n=Object(a.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(a.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(u.useCallback)((function(t){r(e,t)}),[e,r])]},m=function(e,t,n){var r=Object(d.a)();n=n||r;var o=Object(a.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),c=Object(a.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(u.useCallback)((function(t){c(n,e,t)}),[n,e,c])]},b=function(e,t){var n=Object(d.a)(),r=f(t=t||n),i=o()(r,2),a=i[0],c=i[1],m=Object(l.a)(a),b=Object(l.a)(e),g=Object(p.a)(b),h=Object(u.useRef)(!1);return Object(u.useEffect)((function(){s()(g,b)||(c(Object.assign({},m,b)),h.current=!0)}),[m,b,g,c]),h.current?[a,c]:[e,c]}}});
|
18 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
19 |
Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),r.name)},React.createElement(pe.a,{srcElement:de.a,size:16})))};function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(270);var ge=function(e){var t=e.attributeLabel,n=void 0===t?"":t,r=e.className,o=e.checked,i=void 0===o?[]:o,a=e.inputLabel,u=void 0===a?"":a,c=e.isDisabled,l=void 0!==c&&c,p=e.isLoading,d=void 0!==p&&p,f=e.multiple,m=void 0!==f&&f,b=e.onChange,h=void 0===b?function(){}:b,v=e.options,y=void 0===v?[]:v,O=Object(g.useRef)(null),x=w()(r,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":l,"is-loading":d}),_=Object(g.useCallback)((function(e,t){switch(t.type){case oe.stateChangeTypes.keyDownEnter:case oe.stateChangeTypes.clickItem:return be(be({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:m,inputValue:""});case oe.stateChangeTypes.blurInput:case oe.stateChangeTypes.mouseUp:return be(be({},t),{},{inputValue:e.inputValue});default:return t}}),[m]);return React.createElement(oe,{onChange:h,selectedItem:null,stateReducer:_},(function(e){var t=e.getInputProps,r=e.getItemProps,o=e.getLabelProps,a=e.getMenuProps,c=e.highlightedIndex,p=e.inputValue,d=e.isOpen,f=e.openMenu;return React.createElement("div",{className:w()(x,{"is-multiple":m,"is-single":!m,"has-checked":i.length>0,"is-open":d})},React.createElement("label",o({className:"screen-reader-text"}),u),React.createElement(ue,{isOpen:d,onClick:function(){return O.current.focus()}},i.map((function(e){var t=y.find((function(t){return t.value===e})),n=function(e){h(e),O.current.focus()};return m?React.createElement(le,{key:e,onRemoveItem:n,option:t}):React.createElement(fe,{key:e,onClick:function(){return O.current.focus()},onRemoveItem:n,option:t})})),React.createElement(ae,{checked:i,getInputProps:t,inputRef:O,isDisabled:l,onFocus:f,onRemoveItem:function(e){h(e),O.current.focus()},placeholder:i.length>0&&m?null:Object(s.sprintf)(
|
20 |
/* translators: %s attribute name. */
|
21 |
+
Object(s.__)("Any %s","woo-gutenberg-products-block"),n),tabIndex:!m&&i.length>0?"-1":"0",value:p})),d&&!l&&React.createElement(ce,{checked:i,getItemProps:r,getMenuProps:a,highlightedIndex:c,options:y.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},he=n(118),ve=n(144),ye=n(27),Oe=n.n(ye),we=n(24),xe=n(179),_e=n(180),Ee=[{value:"preview-1",name:"Blue",label:React.createElement(he.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:React.createElement(he.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:React.createElement(he.a,{name:"Red",count:2})}],je={id:0,name:"preview",taxonomy:"preview",label:"Preview"};function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(269);Object(o.a)({selector:".wp-block-woocommerce-attribute-filter",Block:Object(r.a)((function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,o=t.isPreview&&!t.attributeId?je:Object(xe.a)(t.attributeId),i=Object(g.useState)([]),a=c()(i,2),u=a[0],v=a[1],y=Object(g.useState)(t.isPreview&&!t.attributeId?Ee:[]),O=c()(y,2),w=O[0],x=O[1],_=Object(f.a)(),E=c()(_,1)[0],j=Object(f.b)("attributes",[]),I=c()(j,2),S=I[0],k=I[1],R=Object(m.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[o.id],shouldSelect:t.attributeId>0}),P=R.results,C=R.isLoading,M="dropdown"!==t.displayStyle&&"and"===t.queryType,T=Object(b.a)({queryAttribute:{taxonomy:o.taxonomy,queryType:t.queryType},queryState:Se(Se({},E),{},{attributes:M?E.attributes:null})}),D=T.results,A=T.isLoading,H=Object(g.useCallback)((function(e){return D.attribute_counts?D.attribute_counts.find((function(t){return t.term===e})):null}),[D]);Object(g.useEffect)((function(){if(!C&&!A){var e=P.map((function(e){var n,r=H(e.id);if(!(r||u.includes(e.slug)||(n=e.slug,null!=E&&E.attributes&&E.attributes.some((function(e){var t=e.attribute,r=e.slug,i=void 0===r?[]:r;return t===o.taxonomy&&i.includes(n)})))))return null;var i=r?r.count:0;return{value:e.slug,name:Object(we.decodeEntities)(e.name),label:React.createElement(he.a,{name:Object(we.decodeEntities)(e.name),count:t.showCounts?i:null})}})).filter(Boolean);x(e)}}),[o.taxonomy,P,C,t.showCounts,A,H,u,E.attributes]);var N=Object(g.useMemo)((function(){return S.filter((function(e){return e.attribute===o.taxonomy})).flatMap((function(e){return e.slug}))}),[S,o.taxonomy]),L=Object(p.a)(N),B=Object(d.a)(L);Object(g.useEffect)((function(){Oe()(B,L)||Oe()(u,L)||(v(L),t.showFilterButton||K(L))}),[u,L,B,K,t.showFilterButton]);var V=Object(g.useCallback)((function(e){return P.reduce((function(t,n){return e.includes(n.slug)&&t.push(n),t}),[])}),[P]),K=Object(g.useCallback)((function(e){r||Object(_e.b)(S,k,o,V(e),"or"===t.queryType?"in":"and")}),[r,S,k,o,V,t.queryType]),F="dropdown"!==t.displayStyle||"or"===t.queryType,q=Object(g.useCallback)((function(e){var n,r=function(e){return w.find((function(t){return t.value===e})).name},o=function(e){var t=e.filterAdded,n=e.filterRemoved,o=t?r(t):null,i=n?r(n):null;o&&i?Object(l.speak)(Object(s.sprintf)(
|
22 |
/* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
|
23 |
Object(s.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),o,i)):o?Object(l.speak)(Object(s.sprintf)(
|
24 |
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
|
25 |
Object(s.__)("%s filter added.","woo-gutenberg-products-block"),o)):i&&Object(l.speak)(Object(s.sprintf)(
|
26 |
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
|
27 |
+
Object(s.__)("%s filter removed.","woo-gutenberg-products-block"),i))},i=u.includes(e);F?(n=u.filter((function(t){return t!==e})),i?o({filterRemoved:e}):(n.push(e),n.sort(),o({filterAdded:e}))):(n=i?[]:[e],o({filterAdded:i?null:e,filterRemoved:1===u.length?u[0]:null})),v(n),t.showFilterButton||K(n)}),[u,w,F,K,t.showFilterButton]);if(0===w.length&&!C)return null;var U="h".concat(t.headingLevel),$=!t.isPreview&&C,W=!t.isPreview&&A;return React.createElement(React.Fragment,null,!r&&t.heading&&React.createElement(U,null,t.heading),React.createElement("div",{className:"wc-block-attribute-filter"},"dropdown"===t.displayStyle?React.createElement(ge,{attributeLabel:o.label,checked:u,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:$,multiple:F,onChange:q,options:w}):React.createElement(h.a,{className:"wc-block-attribute-filter-list",options:w,checked:u,onChange:q,isLoading:$,isDisabled:W}),t.showFilterButton&&React.createElement(ve.a,{className:"wc-block-attribute-filter__button",disabled:$||W,onClick:function(){return K(u)}})))})),getProps:function(e){return{attributes:{attributeId:parseInt(e.dataset.attributeId||0,10),showCounts:"true"===e.dataset.showCounts,queryType:e.dataset.queryType,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3,displayStyle:e.dataset.displayStyle,showFilterButton:"true"===e.dataset.showFilterButton}}}})},32:function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},34:function(e,t){e.exports=window.wp.primitives},36:function(e,t){e.exports=window.wp.a11y},37:function(e,t,n){"use strict";var r=n(5),o=n.n(r),i=n(0),a=n(3),u=n.n(a);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,c=void 0===a?{}:a,l=null!=n,p=null!=r;return!l&&p?(t=o||"span",c=s(s({},c),{},{className:u()(c.className,"screen-reader-text")}),React.createElement(t,c,r)):(t=o||i.Fragment,l&&p&&n!==r?React.createElement(t,c,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,c,n))}},4:function(e,t){e.exports=window.React},44:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},45:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},46:function(e,t,n){var r=n(75);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},47:function(e,t,n){var r=n(22).default,o=n(30);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},5: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.default=e.exports,e.exports.__esModule=!0},53:function(e,t){e.exports=window.wp.blocks},54:function(e,t,n){"use strict";var r=n(44),o=n.n(r),i=n(45),a=n.n(i),u=n(30),c=n.n(u),s=n(46),l=n.n(s),p=n(47),d=n.n(p),f=n(32),m=n.n(f),b=n(5),g=n.n(b),h=(n(9),n(4)),v=n(1),y=n(15),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.n,"/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!","woo-gutenberg-products-block"):r,i=e.text,a=void 0===i?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):i,u=e.errorMessage,c=e.errorMessagePrefix,s=void 0===c?Object(v.__)("Error:","woo-gutenberg-products-block"):c,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),u&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",u),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};n(82);var w=function(e){l()(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var o=m()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return d()(this,e)});function i(){var e;o()(this,i);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),g()(c()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(i,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,i=e.errorMessagePrefix,a=e.renderError,u=e.button,c=this.state,s=c.errorMessage;return c.hasError?"function"==typeof a?a({errorMessage:s}):React.createElement(O,{errorMessage:r?s:null,header:t,imageUrl:n,text:o,errorMessagePrefix:i,button:u}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),i}(h.Component);w.defaultProps={showErrorMessage:!0},t.a=w},58:function(e,t,n){var r=n(101),o=n(102),i=n(71),a=n(103);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},6:function(e,t,n){var r=n(89),o=n(90),i=n(71),a=n(91);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},60:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n(27),i=n.n(o);function a(e){var t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},69:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(o)};o.Provider},7:function(e,t){e.exports=window.lodash},71:function(e,t,n){var r=n(72);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},72:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},75:function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,n){"use strict";var r=n(81);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},81:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},82:function(e,t){},88:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4);function o(e,t,n){void 0===n&&(n={});var o=n.maxWait,i=Object(r.useRef)(null),a=Object(r.useRef)([]),u=n.leading,c=void 0===n.trailing||n.trailing,s=Object(r.useRef)(!1),l=Object(r.useRef)(null),p=Object(r.useRef)(!1),d=Object(r.useRef)(e);d.current=e;var f=Object(r.useCallback)((function(){clearTimeout(l.current),clearTimeout(i.current),i.current=null,a.current=[],l.current=null,s.current=!1}),[]);Object(r.useEffect)((function(){return p.current=!1,function(){p.current=!0}}),[]);var m=Object(r.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.current=e,clearTimeout(l.current),s.current&&(s.current=!1),l.current||!u||s.current||(d.current.apply(d,e),s.current=!0),l.current=setTimeout((function(){var t=!0;u&&s.current&&(t=!1),f(),!p.current&&c&&t&&d.current.apply(d,e)}),t),o&&!i.current&&c&&(i.current=setTimeout((function(){var e=a.current;f(),p.current||d.current.apply(null,e)}),o))}),[o,t,f,u,c]),b=Object(r.useCallback)((function(){l.current&&(d.current.apply(null,a.current),f())}),[f]);return[m,f,b]}},89:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},9:function(e,t,n){e.exports=n(80)()},90:function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},91:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},96:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return b}));var r=n(6),o=n.n(r),i=n(8),a=n(11),u=n(0),c=n(27),s=n.n(c),l=n(60),p=n(116),d=n(69),f=function(e){var t=Object(d.a)();e=e||t;var n=Object(a.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(a.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(u.useCallback)((function(t){r(e,t)}),[e,r])]},m=function(e,t,n){var r=Object(d.a)();n=n||r;var o=Object(a.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),c=Object(a.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(u.useCallback)((function(t){c(n,e,t)}),[n,e,c])]},b=function(e,t){var n=Object(d.a)(),r=f(t=t||n),i=o()(r,2),a=i[0],c=i[1],m=Object(l.a)(a),b=Object(l.a)(e),g=Object(p.a)(b),h=Object(u.useRef)(!1);return Object(u.useEffect)((function(){s()(g,b)||(c(Object.assign({},m,b)),h.current=!0)}),[m,b,g,c]),h.current?[a,c]:[e,c]}}});
|
build/attribute-filter.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => 'c62b18fa0d516b2a2e7fa4cceecaeb4d');
|
build/attribute-filter.js
CHANGED
@@ -10,23 +10,23 @@ Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var x={"aria-label
|
|
10 |
/* translators: %s is referring the remaining count of options */
|
11 |
Object(i._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(i.sprintf)(
|
12 |
/* translators: %s number of options to reveal. */
|
13 |
-
Object(i._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))}),[u,w,h]),E=Object(l.useMemo)((function(){return h&&Object(l.createElement)("li",{key:"show-less",className:"show-less"},Object(l.createElement)("button",{onClick:function(){y(!1)},"aria-expanded":!0,"aria-label":Object(i.__)("Show less options","woo-gutenberg-products-block")},Object(i.__)("Show less","woo-gutenberg-products-block")))}),[h]),x=Object(l.useMemo)((function(){var e=u.length>w+5;return Object(l.createElement)(l.Fragment,null,u.map((function(t,n){return Object(l.createElement)(l.Fragment,{key:t.value},Object(l.createElement)("li",e&&!h&&n>=w&&{hidden:!0},Object(l.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){r(e.target.value)},checked:d.includes(t.value),disabled:O}),Object(l.createElement)("label",{htmlFor:t.value},t.label)),e&&n===w-1&&k)})),e&&E)}),[u,r,d,h,w,E,k,O]),P=s()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":f},t);return Object(l.createElement)("ul",{className:P},f?_:x)}},3:function(e,t){e.exports=window.wc.wcSettings},30:function(e,t){e.exports=window.wp.primitives},307:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(14),a=n.n(o),l=n(0),i=n(30),u=["className","size"],s=Object(l.createElement)((function(e){var t=e.className,n=e.size,r=a()(e,u);return Object(l.createElement)(i.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(l.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=s},32:function(e,t){e.exports=window.moment},33:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},360:function(e,t){},361:function(e,t){},4:function(e,t){e.exports=window.wp.components},40:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),l=n.n(a);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,i=void 0===a?{}:a,s=null!=n,b=null!=r;return!s&&b?(t=c||"span",i=u(u({},i),{},{className:l()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,r)):(t=c||o.Fragment,s&&b&&n!==r?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,i,n))}},49:function(e,t){e.exports=window.wp.keycodes},497:function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(5),c=n.n(r),o=n(35),a=n.n(o),l=n(37),i=n.n(l),u=n(8),s=n.n(u),b=n(0),d=n(374),p=n(7),f=n(62),m=n(108),O=n(167),v=n(75);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryStock,c=e.queryState,o=Object(v.a)();o="".concat(o,"-collection-data");var l=Object(m.a)(o),u=s()(l,1)[0],w=Object(m.b)("calculate_attribute_counts",[],o),j=s()(w,2),h=j[0],y=j[1],_=Object(m.b)("calculate_price_range",null,o),k=s()(_,2),E=k[0],x=k[1],P=Object(m.b)("calculate_stock_status_counts",null,o),C=s()(P,2),S=C[0],R=C[1],N=Object(f.a)(t||{}),L=Object(f.a)(n),T=Object(f.a)(r);Object(b.useEffect)((function(){"object"===i()(N)&&Object.keys(N).length&&(h.find((function(e){return e.taxonomy===N.taxonomy}))||y([].concat(a()(h),[N])))}),[N,h,y]),Object(b.useEffect)((function(){E!==L&&void 0!==L&&x(L)}),[L,x,E]),Object(b.useEffect)((function(){S!==T&&void 0!==T&&R(T)}),[T,R,S]);var B=Object(b.useState)(!1),D=s()(B,2),I=D[0],V=D[1],
|
14 |
/* translators: %s is referring to the filter option being removed. */
|
15 |
Object(a.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)})))},I=n(219),V=function(e){var t=e.onRemoveItem,n=e.option;return Object(o.createElement)(I.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(a.sprintf)(
|
16 |
/* translators: %s is referring to the filter option being removed. */
|
17 |
-
Object(a.__)("Remove %s filter","woo-gutenberg-products-block"),n.name),text:n.label,radius:"large"})},
|
18 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
19 |
Object(a.__)("Replace current %s filter","woo-gutenberg-products-block"),r.name)},r.label),Object(o.createElement)("button",{className:"wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove",onClick:function(){n(r.value)},onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||n(r.value)},"aria-label":Object(a.sprintf)(
|
20 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
21 |
-
Object(a.__)("Remove %s filter","woo-gutenberg-products-block"),r.name)},Object(o.createElement)(i.a,{srcElement:
|
22 |
/* translators: %s attribute name. */
|
23 |
-
Object(a.__)("Any %s","woo-gutenberg-products-block"),n),tabIndex:!O&&l.length>0?"-1":"0",value:p})),f&&!d&&Object(o.createElement)(D,{checked:l,getItemProps:r,getMenuProps:i,highlightedIndex:s,options:j.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},q=n(145),G=n(193),Y=n(33),K=n.n(Y),Q=n(26),U=n(279),W=n(280),J=[{value:"preview-1",name:"Blue",label:Object(o.createElement)(q.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:Object(o.createElement)(q.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:Object(o.createElement)(q.a,{name:"Red",count:2})}],$={id:0,name:"preview",taxonomy:"preview",label:"Preview"};function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(784);var ee=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=t.isPreview&&!t.attributeId?$:Object(U.a)(t.attributeId),l=Object(o.useState)([]),i=p()(l,2),u=i[0],s=i[1],b=Object(o.useState)(t.isPreview&&!t.attributeId?J:[]),d=p()(b,2),f=d[0],m=d[1],O=Object(C.a)(),v=p()(O,1)[0],w=Object(C.b)("attributes",[]),g=p()(w,2),j=g[0],h=g[1],y=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[c.id],shouldSelect:t.attributeId>0}),_=y.results,k=y.isLoading,L="dropdown"!==t.displayStyle&&"and"===t.queryType,T=Object(R.a)({queryAttribute:{taxonomy:c.taxonomy,queryType:t.queryType},queryState:Z(Z({},v),{},{attributes:L?v.attributes:null})}),B=T.results,D=T.isLoading,I=Object(o.useCallback)((function(e){return B.attribute_counts?B.attribute_counts.find((function(t){return t.term===e})):null}),[B]);Object(o.useEffect)((function(){if(!k&&!D){var e=_.map((function(e){var n,r=I(e.id);if(!(r||u.includes(e.slug)||(n=e.slug,null!=v&&v.attributes&&v.attributes.some((function(e){var t=e.attribute,r=e.slug,o=void 0===r?[]:r;return t===c.taxonomy&&o.includes(n)})))))return null;var a=r?r.count:0;return{value:e.slug,name:Object(Q.decodeEntities)(e.name),label:Object(o.createElement)(q.a,{name:Object(Q.decodeEntities)(e.name),count:t.showCounts?a:null})}})).filter(Boolean);m(e)}}),[c.taxonomy,_,k,t.showCounts,D,I,u,v.attributes]);var V=Object(o.useMemo)((function(){return j.filter((function(e){return e.attribute===c.taxonomy})).flatMap((function(e){return e.slug}))}),[j,c.taxonomy]),
|
24 |
/* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
|
25 |
Object(a.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),c,o)):c?Object(E.speak)(Object(a.sprintf)(
|
26 |
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
|
27 |
Object(a.__)("%s filter added.","woo-gutenberg-products-block"),c)):o&&Object(E.speak)(Object(a.sprintf)(
|
28 |
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
|
29 |
-
Object(a.__)("%s filter removed.","woo-gutenberg-products-block"),o))},
|
30 |
/* translators: %s attribute name. */
|
31 |
Object(a.__)("Filter by %s","woo-gutenberg-products-block"),o)})}}},L=function(e){var t=e.isCompact,n={clear:Object(a.__)("Clear selected attribute","woo-gutenberg-products-block"),list:Object(a.__)("Product Attributes","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any product attributes.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product attribute:","woo-gutenberg-products-block"),selected:function(e){return Object(a.sprintf)(
|
32 |
/* translators: %d is the number of attributes selected. */
|
10 |
/* translators: %s is referring the remaining count of options */
|
11 |
Object(i._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(i.sprintf)(
|
12 |
/* translators: %s number of options to reveal. */
|
13 |
+
Object(i._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))}),[u,w,h]),E=Object(l.useMemo)((function(){return h&&Object(l.createElement)("li",{key:"show-less",className:"show-less"},Object(l.createElement)("button",{onClick:function(){y(!1)},"aria-expanded":!0,"aria-label":Object(i.__)("Show less options","woo-gutenberg-products-block")},Object(i.__)("Show less","woo-gutenberg-products-block")))}),[h]),x=Object(l.useMemo)((function(){var e=u.length>w+5;return Object(l.createElement)(l.Fragment,null,u.map((function(t,n){return Object(l.createElement)(l.Fragment,{key:t.value},Object(l.createElement)("li",e&&!h&&n>=w&&{hidden:!0},Object(l.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){r(e.target.value)},checked:d.includes(t.value),disabled:O}),Object(l.createElement)("label",{htmlFor:t.value},t.label)),e&&n===w-1&&k)})),e&&E)}),[u,r,d,h,w,E,k,O]),P=s()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":f},t);return Object(l.createElement)("ul",{className:P},f?_:x)}},3:function(e,t){e.exports=window.wc.wcSettings},30:function(e,t){e.exports=window.wp.primitives},307:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(14),a=n.n(o),l=n(0),i=n(30),u=["className","size"],s=Object(l.createElement)((function(e){var t=e.className,n=e.size,r=a()(e,u);return Object(l.createElement)(i.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(l.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=s},32:function(e,t){e.exports=window.moment},33:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},360:function(e,t){},361:function(e,t){},4:function(e,t){e.exports=window.wp.components},40:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),l=n.n(a);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,i=void 0===a?{}:a,s=null!=n,b=null!=r;return!s&&b?(t=c||"span",i=u(u({},i),{},{className:l()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,r)):(t=c||o.Fragment,s&&b&&n!==r?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,i,n))}},49:function(e,t){e.exports=window.wp.keycodes},497:function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(5),c=n.n(r),o=n(35),a=n.n(o),l=n(37),i=n.n(l),u=n(8),s=n.n(u),b=n(0),d=n(374),p=n(7),f=n(62),m=n(108),O=n(167),v=n(75);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryStock,c=e.queryState,o=Object(v.a)();o="".concat(o,"-collection-data");var l=Object(m.a)(o),u=s()(l,1)[0],w=Object(m.b)("calculate_attribute_counts",[],o),j=s()(w,2),h=j[0],y=j[1],_=Object(m.b)("calculate_price_range",null,o),k=s()(_,2),E=k[0],x=k[1],P=Object(m.b)("calculate_stock_status_counts",null,o),C=s()(P,2),S=C[0],R=C[1],N=Object(f.a)(t||{}),L=Object(f.a)(n),T=Object(f.a)(r);Object(b.useEffect)((function(){"object"===i()(N)&&Object.keys(N).length&&(h.find((function(e){return e.taxonomy===N.taxonomy}))||y([].concat(a()(h),[N])))}),[N,h,y]),Object(b.useEffect)((function(){E!==L&&void 0!==L&&x(L)}),[L,x,E]),Object(b.useEffect)((function(){S!==T&&void 0!==T&&R(T)}),[T,R,S]);var B=Object(b.useState)(!1),D=s()(B,2),I=D[0],V=D[1],F=Object(d.a)(I,200),M=s()(F,1)[0];I||V(!0);var A=Object(b.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(p.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(u)}),[u]);return Object(O.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:g(g({},c),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},A),shouldSelect:M})}},54:function(e,t){e.exports=window.wp.deprecated},55:function(e,t){e.exports=window.wp.hooks},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),c=n(33),o=n.n(c);function a(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},63:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(14),a=n.n(o),l=n(0),i=["srcElement","size"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=a()(e,i);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},69:function(e,t){e.exports=window.wp.a11y},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},75:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=function(){return Object(r.useContext)(c)};c.Provider},781:function(e,t,n){e.exports=n(830)},782:function(e,t,n){"use strict";var r=n(0),c=n(30),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M19 15v4H5v-4h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM19 5v4H5V5h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5z"}));t.a=o},783:function(e,t){},784:function(e,t){},785:function(e,t){},830:function(e,t,n){"use strict";n.r(t);var r=n(9),c=n.n(r),o=n(0),a=n(1),l=n(25),i=n(63),u=n(782),s=n(6),b=n.n(s),d=n(8),p=n.n(d),f=n(21),m=n(4),O=n(163),v=n(47),w=n(7),g=n(3),j=n(136),h=n(162),y=n(86),_=n(5),k=n.n(_),E=n(69),x=n(62),P=n(150),C=n(108),S=n(167),R=n(497),N=n(281),L=(n(2),n(243)),T=function(e){var t=e.checked,n=e.getInputProps,r=e.inputRef,c=e.isDisabled,a=e.onFocus,l=e.onRemoveItem,i=e.placeholder,u=e.tabIndex,s=e.value;return Object(o.createElement)("input",n({ref:r,className:"wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input",disabled:c,onFocus:a,onKeyDown:function(e){"Backspace"===e.key&&!s&&t.length>0&&l(t[t.length-1])},placeholder:i,tabIndex:u}))},B=function(e){var t=e.children,n=e.onClick;return Object(o.createElement)("div",{className:"wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper",onClick:n},t)},D=function(e){var t=e.checked,n=e.getItemProps,r=e.getMenuProps,c=e.highlightedIndex,l=e.options;return Object(o.createElement)("ul",r({className:"wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list"}),l.map((function(e,r){var l=t.includes(e.value);return Object(o.createElement)("li",n({key:e.value,className:b()("wc-block-dropdown-selector__list-item","wc-block-components-dropdown-selector__list-item",{"is-selected":l,"is-highlighted":c===r}),index:r,item:e.value,"aria-label":l?Object(a.sprintf)(
|
14 |
/* translators: %s is referring to the filter option being removed. */
|
15 |
Object(a.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)})))},I=n(219),V=function(e){var t=e.onRemoveItem,n=e.option;return Object(o.createElement)(I.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(a.sprintf)(
|
16 |
/* translators: %s is referring to the filter option being removed. */
|
17 |
+
Object(a.__)("Remove %s filter","woo-gutenberg-products-block"),n.name),text:n.label,radius:"large"})},F=n(307),M=function(e){var t=e.onClick,n=e.onRemoveItem,r=e.option,c=Object(o.useRef)(null);return Object(o.useEffect)((function(){c.current.focus()}),[c]),Object(o.createElement)("div",{className:"wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value"},Object(o.createElement)("button",{ref:c,className:"wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label",onClick:function(e){e.stopPropagation(),t(r.value)},"aria-label":Object(a.sprintf)(
|
18 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
19 |
Object(a.__)("Replace current %s filter","woo-gutenberg-products-block"),r.name)},r.label),Object(o.createElement)("button",{className:"wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove",onClick:function(){n(r.value)},onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||n(r.value)},"aria-label":Object(a.sprintf)(
|
20 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
21 |
+
Object(a.__)("Remove %s filter","woo-gutenberg-products-block"),r.name)},Object(o.createElement)(i.a,{srcElement:F.a,size:16})))};function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(785);var z=function(e){var t=e.attributeLabel,n=void 0===t?"":t,r=e.className,c=e.checked,l=void 0===c?[]:c,i=e.inputLabel,u=void 0===i?"":i,s=e.isDisabled,d=void 0!==s&&s,p=e.isLoading,f=void 0!==p&&p,m=e.multiple,O=void 0!==m&&m,v=e.onChange,w=void 0===v?function(){}:v,g=e.options,j=void 0===g?[]:g,h=Object(o.useRef)(null),y=b()(r,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":d,"is-loading":f}),_=Object(o.useCallback)((function(e,t){switch(t.type){case L.a.stateChangeTypes.keyDownEnter:case L.a.stateChangeTypes.clickItem:return H(H({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:O,inputValue:""});case L.a.stateChangeTypes.blurInput:case L.a.stateChangeTypes.mouseUp:return H(H({},t),{},{inputValue:e.inputValue});default:return t}}),[O]);return Object(o.createElement)(L.a,{onChange:w,selectedItem:null,stateReducer:_},(function(e){var t=e.getInputProps,r=e.getItemProps,c=e.getLabelProps,i=e.getMenuProps,s=e.highlightedIndex,p=e.inputValue,f=e.isOpen,m=e.openMenu;return Object(o.createElement)("div",{className:b()(y,{"is-multiple":O,"is-single":!O,"has-checked":l.length>0,"is-open":f})},Object(o.createElement)("label",c({className:"screen-reader-text"}),u),Object(o.createElement)(B,{isOpen:f,onClick:function(){return h.current.focus()}},l.map((function(e){var t=j.find((function(t){return t.value===e})),n=function(e){w(e),h.current.focus()};return O?Object(o.createElement)(V,{key:e,onRemoveItem:n,option:t}):Object(o.createElement)(M,{key:e,onClick:function(){return h.current.focus()},onRemoveItem:n,option:t})})),Object(o.createElement)(T,{checked:l,getInputProps:t,inputRef:h,isDisabled:d,onFocus:m,onRemoveItem:function(e){w(e),h.current.focus()},placeholder:l.length>0&&O?null:Object(a.sprintf)(
|
22 |
/* translators: %s attribute name. */
|
23 |
+
Object(a.__)("Any %s","woo-gutenberg-products-block"),n),tabIndex:!O&&l.length>0?"-1":"0",value:p})),f&&!d&&Object(o.createElement)(D,{checked:l,getItemProps:r,getMenuProps:i,highlightedIndex:s,options:j.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},q=n(145),G=n(193),Y=n(33),K=n.n(Y),Q=n(26),U=n(279),W=n(280),J=[{value:"preview-1",name:"Blue",label:Object(o.createElement)(q.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:Object(o.createElement)(q.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:Object(o.createElement)(q.a,{name:"Red",count:2})}],$={id:0,name:"preview",taxonomy:"preview",label:"Preview"};function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(784);var ee=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=t.isPreview&&!t.attributeId?$:Object(U.a)(t.attributeId),l=Object(o.useState)([]),i=p()(l,2),u=i[0],s=i[1],b=Object(o.useState)(t.isPreview&&!t.attributeId?J:[]),d=p()(b,2),f=d[0],m=d[1],O=Object(C.a)(),v=p()(O,1)[0],w=Object(C.b)("attributes",[]),g=p()(w,2),j=g[0],h=g[1],y=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[c.id],shouldSelect:t.attributeId>0}),_=y.results,k=y.isLoading,L="dropdown"!==t.displayStyle&&"and"===t.queryType,T=Object(R.a)({queryAttribute:{taxonomy:c.taxonomy,queryType:t.queryType},queryState:Z(Z({},v),{},{attributes:L?v.attributes:null})}),B=T.results,D=T.isLoading,I=Object(o.useCallback)((function(e){return B.attribute_counts?B.attribute_counts.find((function(t){return t.term===e})):null}),[B]);Object(o.useEffect)((function(){if(!k&&!D){var e=_.map((function(e){var n,r=I(e.id);if(!(r||u.includes(e.slug)||(n=e.slug,null!=v&&v.attributes&&v.attributes.some((function(e){var t=e.attribute,r=e.slug,o=void 0===r?[]:r;return t===c.taxonomy&&o.includes(n)})))))return null;var a=r?r.count:0;return{value:e.slug,name:Object(Q.decodeEntities)(e.name),label:Object(o.createElement)(q.a,{name:Object(Q.decodeEntities)(e.name),count:t.showCounts?a:null})}})).filter(Boolean);m(e)}}),[c.taxonomy,_,k,t.showCounts,D,I,u,v.attributes]);var V=Object(o.useMemo)((function(){return j.filter((function(e){return e.attribute===c.taxonomy})).flatMap((function(e){return e.slug}))}),[j,c.taxonomy]),F=Object(x.a)(V),M=Object(P.a)(F);Object(o.useEffect)((function(){K()(M,F)||K()(u,F)||(s(F),t.showFilterButton||H(F))}),[u,F,M,H,t.showFilterButton]);var A=Object(o.useCallback)((function(e){return _.reduce((function(t,n){return e.includes(n.slug)&&t.push(n),t}),[])}),[_]),H=Object(o.useCallback)((function(e){r||Object(W.b)(j,h,c,A(e),"or"===t.queryType?"in":"and")}),[r,j,h,c,A,t.queryType]),Y="dropdown"!==t.displayStyle||"or"===t.queryType,X=Object(o.useCallback)((function(e){var n,r=function(e){return f.find((function(t){return t.value===e})).name},c=function(e){var t=e.filterAdded,n=e.filterRemoved,c=t?r(t):null,o=n?r(n):null;c&&o?Object(E.speak)(Object(a.sprintf)(
|
24 |
/* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
|
25 |
Object(a.__)("%1$s filter replaced with %2$s.","woo-gutenberg-products-block"),c,o)):c?Object(E.speak)(Object(a.sprintf)(
|
26 |
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
|
27 |
Object(a.__)("%s filter added.","woo-gutenberg-products-block"),c)):o&&Object(E.speak)(Object(a.sprintf)(
|
28 |
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
|
29 |
+
Object(a.__)("%s filter removed.","woo-gutenberg-products-block"),o))},o=u.includes(e);Y?(n=u.filter((function(t){return t!==e})),o?c({filterRemoved:e}):(n.push(e),n.sort(),c({filterAdded:e}))):(n=o?[]:[e],c({filterAdded:o?null:e,filterRemoved:1===u.length?u[0]:null})),s(n),t.showFilterButton||H(n)}),[u,f,Y,H,t.showFilterButton]);if(0===f.length&&!k)return null;var ee="h".concat(t.headingLevel),te=!t.isPreview&&k,ne=!t.isPreview&&D;return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(ee,null,t.heading),Object(o.createElement)("div",{className:"wc-block-attribute-filter"},"dropdown"===t.displayStyle?Object(o.createElement)(z,{attributeLabel:c.label,checked:u,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:te,multiple:Y,onChange:X,options:f}):Object(o.createElement)(N.a,{className:"wc-block-attribute-filter-list",options:f,checked:u,onChange:X,isLoading:te,isDisabled:ne}),t.showFilterButton&&Object(o.createElement)(G.a,{className:"wc-block-attribute-filter__button",disabled:te||ne,onClick:function(){return H(u)}})))},te=(n(783),Object(g.getSetting)("attributes",[])),ne=Object(m.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=e.debouncedSpeak,c=t.attributeId,l=t.className,s=t.displayStyle,b=t.heading,d=t.headingLevel,_=t.isPreview,k=t.queryType,E=t.showCounts,x=t.showFilterButton,P=Object(o.useState)(!c&&!_),C=p()(P,2),S=C[0],R=C[1],N=function(e){if(e&&e.length){var t=e[0].id,r=te.find((function(e){return e.attribute_id===t.toString()}));if(r&&c!==t){var o=r.attribute_label;n({attributeId:t,heading:Object(a.sprintf)(
|
30 |
/* translators: %s attribute name. */
|
31 |
Object(a.__)("Filter by %s","woo-gutenberg-products-block"),o)})}}},L=function(e){var t=e.isCompact,n={clear:Object(a.__)("Clear selected attribute","woo-gutenberg-products-block"),list:Object(a.__)("Product Attributes","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any product attributes.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product attribute:","woo-gutenberg-products-block"),selected:function(e){return Object(a.sprintf)(
|
32 |
/* translators: %d is the number of attributes selected. */
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
|
|
4 |
Requires at least: 5.8
|
5 |
Tested up to: 5.8
|
6 |
Requires PHP: 7.0
|
7 |
-
Stable tag: 5.9.
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -85,7 +85,13 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/
|
|
85 |
|
86 |
== Changelog ==
|
87 |
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
#### Enhancements
|
91 |
|
4 |
Requires at least: 5.8
|
5 |
Tested up to: 5.8
|
6 |
Requires PHP: 7.0
|
7 |
+
Stable tag: 5.9.1
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
85 |
|
86 |
== Changelog ==
|
87 |
|
88 |
+
= 5.9.1 - 2021-09-23 =
|
89 |
+
|
90 |
+
#### Bug fixes
|
91 |
+
|
92 |
+
- Fix infinite recursion when removing an attribute filter from the Active filters block. ([4816](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4816))
|
93 |
+
|
94 |
+
= 5.9.0 - 2021-09-14 =
|
95 |
|
96 |
#### Enhancements
|
97 |
|
src/Package.php
CHANGED
@@ -106,7 +106,7 @@ class Package {
|
|
106 |
NewPackage::class,
|
107 |
function ( $container ) {
|
108 |
// leave for automated version bumping.
|
109 |
-
$version = '5.9.
|
110 |
return new NewPackage(
|
111 |
$version,
|
112 |
dirname( __DIR__ ),
|
106 |
NewPackage::class,
|
107 |
function ( $container ) {
|
108 |
// leave for automated version bumping.
|
109 |
+
$version = '5.9.1';
|
110 |
return new NewPackage(
|
111 |
$version,
|
112 |
dirname( __DIR__ ),
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit05c8e4d171d261276c23837710508e77::getLoader();
|
vendor/autoload_packages.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitd724f467927de5f01ec7ea61e2afc88d
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit05c8e4d171d261276c23837710508e77
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit05c8e4d171d261276c23837710508e77', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit05c8e4d171d261276c23837710508e77', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit05c8e4d171d261276c23837710508e77::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'C' =>
|
@@ -41,9 +41,9 @@ class ComposerStaticInitd724f467927de5f01ec7ea61e2afc88d
|
|
41 |
public static function getInitializer(ClassLoader $loader)
|
42 |
{
|
43 |
return \Closure::bind(function () use ($loader) {
|
44 |
-
$loader->prefixLengthsPsr4 =
|
45 |
-
$loader->prefixDirsPsr4 =
|
46 |
-
$loader->classMap =
|
47 |
|
48 |
}, null, ClassLoader::class);
|
49 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit05c8e4d171d261276c23837710508e77
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'C' =>
|
41 |
public static function getInitializer(ClassLoader $loader)
|
42 |
{
|
43 |
return \Closure::bind(function () use ($loader) {
|
44 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit05c8e4d171d261276c23837710508e77::$prefixLengthsPsr4;
|
45 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit05c8e4d171d261276c23837710508e77::$prefixDirsPsr4;
|
46 |
+
$loader->classMap = ComposerStaticInit05c8e4d171d261276c23837710508e77::$classMap;
|
47 |
|
48 |
}, null, ClassLoader::class);
|
49 |
}
|
vendor/composer/installed.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
'type' => 'wordpress-plugin',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
-
'reference' => '
|
9 |
'name' => 'woocommerce/woocommerce-blocks',
|
10 |
'dev' => false,
|
11 |
),
|
@@ -46,7 +46,7 @@
|
|
46 |
'type' => 'wordpress-plugin',
|
47 |
'install_path' => __DIR__ . '/../../',
|
48 |
'aliases' => array(),
|
49 |
-
'reference' => '
|
50 |
'dev_requirement' => false,
|
51 |
),
|
52 |
),
|
5 |
'type' => 'wordpress-plugin',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
+
'reference' => 'd723889335311e4d7794185c4e07304a24ef7f37',
|
9 |
'name' => 'woocommerce/woocommerce-blocks',
|
10 |
'dev' => false,
|
11 |
),
|
46 |
'type' => 'wordpress-plugin',
|
47 |
'install_path' => __DIR__ . '/../../',
|
48 |
'aliases' => array(),
|
49 |
+
'reference' => 'd723889335311e4d7794185c4e07304a24ef7f37',
|
50 |
'dev_requirement' => false,
|
51 |
),
|
52 |
),
|
vendor/composer/jetpack_autoload_psr4.php
CHANGED
@@ -11,11 +11,11 @@ return array(
|
|
11 |
'path' => array( $vendorDir . '/composer/installers/src/Composer/Installers' )
|
12 |
),
|
13 |
'Automattic\\WooCommerce\\Blocks\\Tests\\' => array(
|
14 |
-
'version' => '5.9.
|
15 |
'path' => array( $baseDir . '/tests/php' )
|
16 |
),
|
17 |
'Automattic\\WooCommerce\\Blocks\\' => array(
|
18 |
-
'version' => '5.9.
|
19 |
'path' => array( $baseDir . '/src' )
|
20 |
),
|
21 |
'Automattic\\Jetpack\\Autoloader\\' => array(
|
11 |
'path' => array( $vendorDir . '/composer/installers/src/Composer/Installers' )
|
12 |
),
|
13 |
'Automattic\\WooCommerce\\Blocks\\Tests\\' => array(
|
14 |
+
'version' => '5.9.1.0',
|
15 |
'path' => array( $baseDir . '/tests/php' )
|
16 |
),
|
17 |
'Automattic\\WooCommerce\\Blocks\\' => array(
|
18 |
+
'version' => '5.9.1.0',
|
19 |
'path' => array( $baseDir . '/src' )
|
20 |
),
|
21 |
'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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp05c8e4d171d261276c23837710508e77;
|
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: 5.9.
|
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: 5.9.1
|
7 |
* Author: Automattic
|
8 |
* Author URI: https://woocommerce.com
|
9 |
* Text Domain: woo-gutenberg-products-block
|