WordPress/wp-includes/js/dist/compose.min.js
atimmer 8efbcce93b Build tools: Upgrade @wordpress packages.
Generated using `npm update @wordpress/api-fetch @wordpress/blob @wordpress/block-library @wordpress/blocks @wordpress/components @wordpress/compose @wordpress/core-data @wordpress/data @wordpress/date @wordpress/dom @wordpress/edit-post @wordpress/editor @wordpress/element @wordpress/escape-html @wordpress/list-reusable-blocks @wordpress/nux @wordpress/plugins @wordpress/redux-routine @wordpress/rich-text @wordpress/url @wordpress/viewport`.

See #45145.

Built from https://develop.svn.wordpress.org/branches/5.0@43789


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:06:59 +00:00

1 line
8.7 KiB
JavaScript

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=296)}({0:function(t,e){!function(){t.exports=this.wp.element}()},10: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})},12:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(29),o=n(3);function i(t,e){return!e||"object"!==Object(r.a)(e)&&"function"!=typeof e?Object(o.a)(t):e}},13: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})},14: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}()},29: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})},296: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(10),a=n(9),s=n(12),f=n(13),l=n(14),p=n(41),h=n.n(p),b=o(function(t){return t.prototype instanceof i.Component?function(t){function e(){return Object(c.a)(this,e),Object(s.a)(this,Object(f.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(s.a)(this,Object(f.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"),d=n(18),O=function(t){return o(function(e){return function(n){function r(e){var n;return Object(c.a)(this,r),(n=Object(s.a)(this,Object(f.a)(r).apply(this,arguments))).state={propChangeId:0,propValue:e[t]},n}return Object(l.a)(r,n),Object(a.a)(r,[{key:"render",value:function(){return Object(i.createElement)(e,Object(d.a)({key:this.state.propChangeId},this.props))}}],[{key:"getDerivedStateFromProps",value:function(e,n){return e[t]===n.propValue?null:{propChangeId:n.propChangeId+1,propValue:e[t]}}}]),r}(i.Component)},"remountOnPropChange")},j=n(3),y=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 m=function(t){return o(function(e){var n=function(n){function o(){var t;return Object(c.a)(this,o),(t=Object(s.a)(this,Object(f.a)(o).apply(this,arguments))).handleEvent=t.handleEvent.bind(Object(j.a)(Object(j.a)(t))),t.handleRef=t.handleRef.bind(Object(j.a)(Object(j.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){y.add(n,e)})}},{key:"componentWillUnmount",value:function(){var e=this;Object(r.forEach)(t,function(t,n){y.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(d.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")},v=o(function(t){var e=0;return function(n){function r(){var t;return Object(c.a)(this,r),(t=Object(s.a)(this,Object(f.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(d.a)({},this.props,{instanceId:this.instanceId}))}}]),r}(i.Component)},"withInstanceId"),w=o(function(t){return function(e){function n(){var t;return Object(c.a)(this,n),(t=Object(s.a)(this,Object(f.a)(n).apply(this,arguments))).timeouts=[],t.setTimeout=t.setTimeout.bind(Object(j.a)(Object(j.a)(t))),t.clearTimeout=t.clearTimeout.bind(Object(j.a)(Object(j.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(d.a)({},this.props,{setTimeout:this.setTimeout,clearTimeout:this.clearTimeout}))}}]),n}(i.Component)},"withSafeTimeout");function S(){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(s.a)(this,Object(f.a)(r).apply(this,arguments))).setState=e.setState.bind(Object(j.a)(Object(j.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(d.a)({},this.props,this.state,{setState:this.setState}))}}]),r}(i.Component)},"withState")}n.d(e,"createHigherOrderComponent",function(){return o}),n.d(e,"ifCondition",function(){return u}),n.d(e,"pure",function(){return b}),n.d(e,"remountOnPropChange",function(){return O}),n.d(e,"withGlobalEvents",function(){return m}),n.d(e,"withInstanceId",function(){return v}),n.d(e,"withSafeTimeout",function(){return w}),n.d(e,"withState",function(){return S}),n.d(e,"compose",function(){return r.flowRight})},3: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})},41:function(t,e){!function(){t.exports=this.wp.isShallowEqual}()},9: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})}});