WordPress/wp-includes/js/dist/compose.min.js
gziolo 355c05ea71 Build Tools: Integrate DependencyExtractionWebpackPlugin in the JS build.
This patch integrates DependencyExtractionWebpackPlugin which was battle-tested in Gutenberg. 

This will greatly simplify the process of upgrading npm packages which change after every Gutenberg release. It might even useful during the WordPress release cycle as we might need to publish more often as we discover critical bugs and regressions.

Props jonsurrell, adamsilverstein, youknowriad, ocean90, netweb.

Fixes #48154. 


Built from https://develop.svn.wordpress.org/trunk@47035


git-svn-id: http://core.svn.wordpress.org/trunk@46835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-03 13:17:24 +00:00

2 lines
11 KiB
JavaScript

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.compose=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=355)}({0:function(t,e){!function(){t.exports=this.wp.element}()},109:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(23),o=n(0);function i(t){var e=Object(o.useState)(!1),n=Object(r.a)(e,2),i=n[0],u=n[1];return Object(o.useEffect)((function(){var e=function(){return u(window.matchMedia(t).matches)};e();var n=window.matchMedia(t);return n.addListener(e),function(){n.removeListener(e)}}),[t]),i}},11:function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return o}))},12:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},13:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(31),o=n(5);function i(t,e){return!e||"object"!==Object(r.a)(e)&&"function"!=typeof e?Object(o.a)(t):e}},14:function(t,e,n){"use strict";function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"a",(function(){return r}))},15:function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}n.d(e,"a",(function(){return o}))},18:function(t,e,n){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}n.d(e,"a",(function(){return r}))},2:function(t,e){!function(){t.exports=this.lodash}()},209:function(t,e,n){"use strict";(function(t){var r=n(109),o="undefined"!=typeof window&&window.navigator.userAgent.indexOf("Trident")>=0,i=t.env.FORCE_REDUCED_MOTION||o?function(){return!0}:function(){return Object(r.a)("(prefers-reduced-motion: reduce)")};e.a=i}).call(this,n(316))},23:function(t,e,n){"use strict";var r=n(38);var o=n(39);function i(t,e){return Object(r.a)(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||Object(o.a)()}n.d(e,"a",(function(){return i}))},31:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return(o="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(t)}n.d(e,"a",(function(){return o}))},316:function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var a,f=[],s=!1,l=-1;function p(){s&&a&&(s=!1,a.length?f=a.concat(f):l=-1,f.length&&h())}function h(){if(!s){var t=c(p);s=!0;for(var e=f.length;e;){for(a=f,f=[];++l<e;)a&&a[l].run();l=-1,e=f.length}a=null,s=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function b(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new d(t,e)),1!==f.length||s||c(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=b,o.addListener=b,o.once=b,o.off=b,o.removeListener=b,o.removeAllListeners=b,o.emit=b,o.prependListener=b,o.prependOnceListener=b,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},355:function(t,e,n){"use strict";n.r(e);var r=n(2);var o=function(t,e){return function(n){var o=t(n),i=n.displayName,u=void 0===i?n.name||"Component":i;return o.displayName="".concat(Object(r.upperFirst)(Object(r.camelCase)(e)),"(").concat(u,")"),o}},i=n(0),u=function(t){return o((function(e){return function(n){return t(n)?Object(i.createElement)(e,n):null}}),"ifCondition")},c=n(12),a=n(11),f=n(13),s=n(14),l=n(15),p=n(41),h=n.n(p),d=o((function(t){return t.prototype instanceof i.Component?function(t){function e(){return Object(c.a)(this,e),Object(f.a)(this,Object(s.a)(e).apply(this,arguments))}return Object(l.a)(e,t),Object(a.a)(e,[{key:"shouldComponentUpdate",value:function(t,e){return!h()(t,this.props)||!h()(e,this.state)}}]),e}(t):function(e){function n(){return Object(c.a)(this,n),Object(f.a)(this,Object(s.a)(n).apply(this,arguments))}return Object(l.a)(n,e),Object(a.a)(n,[{key:"shouldComponentUpdate",value:function(t){return!h()(t,this.props)}},{key:"render",value:function(){return Object(i.createElement)(t,this.props)}}]),n}(i.Component)}),"pure"),b=n(18),y=n(5),m=new(function(){function t(){Object(c.a)(this,t),this.listeners={},this.handleEvent=this.handleEvent.bind(this)}return Object(a.a)(t,[{key:"add",value:function(t,e){this.listeners[t]||(window.addEventListener(t,this.handleEvent),this.listeners[t]=[]),this.listeners[t].push(e)}},{key:"remove",value:function(t,e){this.listeners[t]=Object(r.without)(this.listeners[t],e),this.listeners[t].length||(window.removeEventListener(t,this.handleEvent),delete this.listeners[t])}},{key:"handleEvent",value:function(t){Object(r.forEach)(this.listeners[t.type],(function(e){e.handleEvent(t)}))}}]),t}());var v=function(t){return o((function(e){var n=function(n){function o(){var t;return Object(c.a)(this,o),(t=Object(f.a)(this,Object(s.a)(o).apply(this,arguments))).handleEvent=t.handleEvent.bind(Object(y.a)(t)),t.handleRef=t.handleRef.bind(Object(y.a)(t)),t}return Object(l.a)(o,n),Object(a.a)(o,[{key:"componentDidMount",value:function(){var e=this;Object(r.forEach)(t,(function(t,n){m.add(n,e)}))}},{key:"componentWillUnmount",value:function(){var e=this;Object(r.forEach)(t,(function(t,n){m.remove(n,e)}))}},{key:"handleEvent",value:function(e){var n=t[e.type];"function"==typeof this.wrappedRef[n]&&this.wrappedRef[n](e)}},{key:"handleRef",value:function(t){this.wrappedRef=t,this.props.forwardedRef&&this.props.forwardedRef(t)}},{key:"render",value:function(){return Object(i.createElement)(e,Object(b.a)({},this.props.ownProps,{ref:this.handleRef}))}}]),o}(i.Component);return Object(i.forwardRef)((function(t,e){return Object(i.createElement)(n,{ownProps:t,forwardedRef:e})}))}),"withGlobalEvents")},O=o((function(t){var e=0;return(function(n){function r(){var t;return Object(c.a)(this,r),(t=Object(f.a)(this,Object(s.a)(r).apply(this,arguments))).instanceId=e++,t}return Object(l.a)(r,n),Object(a.a)(r,[{key:"render",value:function(){return Object(i.createElement)(t,Object(b.a)({},this.props,{instanceId:this.instanceId}))}}]),r}(i.Component))}),"withInstanceId"),j=o((function(t){return function(e){function n(){var t;return Object(c.a)(this,n),(t=Object(f.a)(this,Object(s.a)(n).apply(this,arguments))).timeouts=[],t.setTimeout=t.setTimeout.bind(Object(y.a)(t)),t.clearTimeout=t.clearTimeout.bind(Object(y.a)(t)),t}return Object(l.a)(n,e),Object(a.a)(n,[{key:"componentWillUnmount",value:function(){this.timeouts.forEach(clearTimeout)}},{key:"setTimeout",value:function(t){function e(e,n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){var n=this,r=setTimeout((function(){t(),n.clearTimeout(r)}),e);return this.timeouts.push(r),r}))},{key:"clearTimeout",value:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){clearTimeout(t),this.timeouts=Object(r.without)(this.timeouts,t)}))},{key:"render",value:function(){return Object(i.createElement)(t,Object(b.a)({},this.props,{setTimeout:this.setTimeout,clearTimeout:this.clearTimeout}))}}]),n}(i.Component)}),"withSafeTimeout");function w(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o((function(e){return function(n){function r(){var e;return Object(c.a)(this,r),(e=Object(f.a)(this,Object(s.a)(r).apply(this,arguments))).setState=e.setState.bind(Object(y.a)(e)),e.state=t,e}return Object(l.a)(r,n),Object(a.a)(r,[{key:"render",value:function(){return Object(i.createElement)(e,Object(b.a)({},this.props,this.state,{setState:this.setState}))}}]),r}(i.Component)}),"withState")}var T=n(109),E=n(209);n.d(e,"createHigherOrderComponent",(function(){return o})),n.d(e,"compose",(function(){return r.flowRight})),n.d(e,"ifCondition",(function(){return u})),n.d(e,"pure",(function(){return d})),n.d(e,"withGlobalEvents",(function(){return v})),n.d(e,"withInstanceId",(function(){return O})),n.d(e,"withSafeTimeout",(function(){return j})),n.d(e,"withState",(function(){return w})),n.d(e,"useMediaQuery",(function(){return T.a})),n.d(e,"useReducedMotion",(function(){return E.a}))},38:function(t,e,n){"use strict";function r(t){if(Array.isArray(t))return t}n.d(e,"a",(function(){return r}))},39:function(t,e,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}n.d(e,"a",(function(){return r}))},41:function(t,e){!function(){t.exports=this.wp.isShallowEqual}()},5:function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))}});