WordPress/wp-includes/js/dist/viewport.min.js
desrosj 3c8457e747 Build/Test Tools: Update build related dependencies to their latest versions.
This updates the following npm dependencies:
- `autoprefixer` to version `10.4.16`.
- `grunt-contrib-qunit` to version `8.0.1`.
- `postcss` to version `8.4.30`.
- `react-refresh` to version `0.14.0`.
- `sass` to version `1.68.0`.
- `sinon` to version `16.0.0`.
- `uuid` to version `9.0.1`.
- `tslib` to version `2.6.2`.

This change accompanies a similar one in the Gutenberg repository: https://github.com/WordPress/gutenberg/pull/54657.

Props gziolo, desrosj.
Fixes #58863.
Built from https://develop.svn.wordpress.org/trunk@56647


git-svn-id: http://core.svn.wordpress.org/trunk@56159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-21 13:26:32 +00:00

2 lines
1.9 KiB
JavaScript

/*! This file is auto-generated */
!function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ifViewportMatches:function(){return f},store:function(){return s},withViewportMatch:function(){return w}});var r={};e.r(r),e.d(r,{setIsMatching:function(){return a}});var n={};e.r(n),e.d(n,{isViewportMatch:function(){return u}});var o=window.wp.compose,i=window.wp.data;var c=function(e={},t){return"SET_IS_MATCHING"===t.type?t.values:e};function a(e){return{type:"SET_IS_MATCHING",values:e}}function u(e,t){return-1===t.indexOf(" ")&&(t=">= "+t),!!e[t]}const s=(0,i.createReduxStore)("core/viewport",{reducer:c,actions:r,selectors:n});(0,i.register)(s);var d=(e,t)=>{const r=(0,o.debounce)((()=>{const e=Object.fromEntries(c.map((([e,t])=>[e,t.matches])));(0,i.dispatch)(s).setIsMatching(e)}),0,{leading:!0}),n=Object.entries(t),c=Object.entries(e).flatMap((([e,t])=>n.map((([n,o])=>{const i=window.matchMedia(`(${o}: ${t}px)`);return i.addEventListener("change",r),[`${n} ${e}`,i]}))));window.addEventListener("orientationchange",r),r(),r.flush()},p=window.wp.element;var w=e=>{const t=Object.entries(e);return(0,o.createHigherOrderComponent)((e=>(0,o.pure)((r=>{const n=Object.fromEntries(t.map((([e,t])=>{let[r,n]=t.split(" ");return void 0===n&&(n=r,r=">="),[e,(0,o.useViewportMatch)(n,r)]})));return(0,p.createElement)(e,{...r,...n})}))),"withViewportMatch")};var f=e=>(0,o.createHigherOrderComponent)((0,o.compose)([w({isViewportMatch:e}),(0,o.ifCondition)((e=>e.isViewportMatch))]),"ifViewportMatches");d({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},{"<":"max-width",">=":"min-width"}),(window.wp=window.wp||{}).viewport=t}();