WordPress/wp-includes/js/dist/viewport.min.js
gziolo b8871304cf Editor: Update WordPress packages from Gutenberg 10.5
Applies changes between the Gutenberg plugin v10.4 and v10.5. It contains the latest version of WordPress packages and PHP changes applied to non-experimental features.

Props youknowriad.
See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 11:48:27 +00:00

2 lines
4.5 KiB
JavaScript

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.viewport=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=469)}({0:function(t,e){t.exports=window.wp.element},11:function(t,e){t.exports=window.wp.compose},12:function(t,e,r){"use strict";r.d(e,"a",(function(){return c}));var n=r(38);var o=r(28),i=r(39);function c(t,e){return Object(n.a)(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=r){var n,o,i=[],c=!0,u=!1;try{for(r=r.call(t);!(c=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{c||null==r.return||r.return()}finally{if(u)throw o}}return i}}(t,e)||Object(o.a)(t,e)||Object(i.a)()}},2:function(t,e){t.exports=window.lodash},24:function(t,e,r){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}r.d(e,"a",(function(){return n}))},28:function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(24);function o(t,e){if(t){if("string"==typeof t)return Object(n.a)(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(t,e):void 0}}},38:function(t,e,r){"use strict";function n(t){if(Array.isArray(t))return t}r.d(e,"a",(function(){return n}))},39:function(t,e,r){"use strict";function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.d(e,"a",(function(){return n}))},4:function(t,e){t.exports=window.wp.data},469:function(t,e,r){"use strict";r.r(e),r.d(e,"store",(function(){return s})),r.d(e,"ifViewportMatches",(function(){return w})),r.d(e,"withViewportMatch",(function(){return v}));var n={};r.r(n),r.d(n,"setIsMatching",(function(){return a}));var o={};r.r(o),r.d(o,"isViewportMatch",(function(){return f}));var i=r(2),c=r(4);var u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_IS_MATCHING":return e.values}return t};function a(t){return{type:"SET_IS_MATCHING",values:t}}function f(t,e){return-1===e.indexOf(" ")&&(e=">= "+e),!!t[e]}var s=Object(c.createReduxStore)("core/viewport",{reducer:u,actions:n,selectors:o});Object(c.register)(s);var l=function(t,e){var r=Object(i.debounce)((function(){var t=Object(i.mapValues)(n,(function(t){return t.matches}));Object(c.dispatch)(s).setIsMatching(t)}),{leading:!0}),n=Object(i.reduce)(t,(function(t,n,o){return Object(i.forEach)(e,(function(e,i){var c=window.matchMedia("(".concat(e,": ").concat(n,"px)"));c.addListener(r);var u=[i,o].join(" ");t[u]=c})),t}),{});window.addEventListener("orientationchange",r),r(),r.flush()},d=r(11),p=r(8),b=r(12),h=r(0),v=function(t){return Object(d.createHigherOrderComponent)((function(e){return Object(d.pure)((function(r){var n=Object(i.mapValues)(t,(function(t){var e=t.split(" "),r=Object(b.a)(e,2),n=r[0],o=r[1];return void 0===o&&(o=n,n=">="),Object(d.useViewportMatch)(o,n)}));return Object(h.createElement)(e,Object(p.a)({},r,n))}))}),"withViewportMatch")},w=function(t){return Object(d.createHigherOrderComponent)(Object(d.compose)([v({isViewportMatch:t}),Object(d.ifCondition)((function(t){return t.isViewportMatch}))]),"ifViewportMatches")};l({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},{"<":"max-width",">=":"min-width"})},8:function(t,e,r){"use strict";function n(){return(n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}r.d(e,"a",(function(){return n}))}});