react-responsive
Advanced tools
Comparing version 9.0.0-beta.4 to 9.0.0-beta.5
@@ -135,6 +135,6 @@ !function(root, factory) { | ||
var hyphenate_style_name_1 = __importDefault(__webpack_require__(2)), mediaQuery_1 = __importDefault(__webpack_require__(11)), negate = function(cond) { | ||
return "not " + cond; | ||
return "not ".concat(cond); | ||
}, keyVal = function(k, v) { | ||
var realKey = (0, hyphenate_style_name_1.default)(k); | ||
return "number" == typeof v && (v += "px"), !0 === v ? realKey : !1 === v ? negate(realKey) : "(" + realKey + ": " + v + ")"; | ||
return "number" == typeof v && (v = "".concat(v, "px")), !0 === v ? realKey : !1 === v ? negate(realKey) : "(".concat(realKey, ": ").concat(v, ")"); | ||
}, join = function(conds) { | ||
@@ -141,0 +141,0 @@ return conds.join(" and "); |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.MediaQuery=t(require("react")):e.MediaQuery=t(e.React)}("undefined"!=typeof self?self:this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var u=r[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(r(1)),o=n(r(6)),a=n(r(2)),i=r(8),c=n(r(3)),s=n(r(4)),f=function(e){return e.query||(0,c.default)(e)},l=function(e){if(!e)return null;var t=Object.keys(e);return 0===t.length?null:t.reduce(function(t,r){return t[(0,a.default)(r)]=e[r],t},{})},d=function(){var e=u.default.useRef(!1);return u.default.useEffect(function(){e.current=!0},[]),e.current},p=function(e){var t=u.default.useContext(s.default),r=function(){return l(e)||l(t)||{}},n=u.default.useState(r),o=n[0],a=n[1];return u.default.useEffect(function(){var e=r();(0,i.shallowEqualObjects)(o,e)||a(e)},[e,t]),o},m=function(e){var t=function(){return f(e)},r=u.default.useState(t),n=r[0],o=r[1];return u.default.useEffect(function(){var e=t();n!==e&&o(e)},[e]),n},h=function(e,t){var r=function(){return(0,o.default)(e,t)},n=u.default.useState(r),a=n[0],i=n[1],c=d();return u.default.useEffect(function(){if(c){var e=r();return i(e),function(){e&&e.dispose()}}},[e,t]),a},v=function(e){var t=u.default.useState(e.matches),r=t[0],n=t[1];return u.default.useEffect(function(){var t=function(){n(e.matches)};return e.addListener(t),t(),function(){e.removeListener(t)}},[e]),r},y=function(e,t,r){var n=p(t),o=m(e);if(!o)throw new Error("Invalid or missing MediaQuery!");var a=h(o,n),i=v(a),c=d();return u.default.useEffect(function(){c&&r&&r(i)},[i]),u.default.useEffect(function(){return function(){a&&a.dispose()}},[]),i};t.default=y},function(t,r){t.exports=e},function(e,t,r){"use strict";function n(e){return"-"+e.toLowerCase()}function u(e){if(i.hasOwnProperty(e))return i[e];var t=e.replace(o,n);return i[e]=a.test(t)?"-"+t:t}Object.defineProperty(t,"__esModule",{value:!0});var o=/[A-Z]/g,a=/^ms-/,i={};t.default=u},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(r(2)),o=n(r(9)),a=function(e){return"not "+e},i=function(e,t){var r=(0,u.default)(e);return"number"==typeof t&&(t+="px"),!0===t?r:!1===t?a(r):"("+r+": "+t+")"},c=function(e){return e.join(" and ")},s=function(e){var t=[];return Object.keys(o.default.all).forEach(function(r){var n=e[r];null!=n&&t.push(i(r,n))}),c(t)};t.default=s},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(r(1)),o=u.default.createContext({});t.default=o},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.toQuery=t.useMediaQuery=t.default=void 0;var u=n(r(0));t.useMediaQuery=u.default;var o=n(r(13));t.default=o.default;var a=n(r(3));t.toQuery=a.default;var i=n(r(4));t.Context=i.default},function(e,t,r){"use strict";function n(e,t,r){function n(e){f&&f.addListener(e)}function u(e){f&&f.removeListener(e)}function i(e){s.matches=e.matches,s.media=e.media}function c(){f&&f.removeListener(i)}var s=this;if(a&&!r){var f=a.call(window,e);this.matches=f.matches,this.media=f.media,f.addListener(i)}else this.matches=o(e,t),this.media=e;this.addListener=n,this.removeListener=u,this.dispose=c}function u(e,t,r){return new n(e,t,r)}var o=r(7).match,a="undefined"!=typeof window?window.matchMedia:null;e.exports=u},function(e,t,r){"use strict";function n(e,t){return u(e).some(function(e){var r=e.inverse,n="all"===e.type||t.type===e.type;if(n&&r||!n&&!r)return!1;var u=e.expressions.every(function(e){var r=e.feature,n=e.modifier,u=e.value,c=t[r];if(!c)return!1;switch(r){case"orientation":case"scan":return c.toLowerCase()===u.toLowerCase();case"width":case"height":case"device-width":case"device-height":u=i(u),c=i(c);break;case"resolution":u=a(u),c=a(c);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":u=o(u),c=o(c);break;case"grid":case"color":case"color-index":case"monochrome":u=parseInt(u,10)||1,c=parseInt(c,10)||0}switch(n){case"min":return c>=u;case"max":return c<=u;default:return c===u}});return u&&!r||!u&&r})}function u(e){return e.split(",").map(function(e){e=e.trim();var t=e.match(c),r=t[1],n=t[2],u=t[3]||"",o={};return o.inverse=!!r&&"not"===r.toLowerCase(),o.type=n?n.toLowerCase():"all",u=u.match(/\([^\)]+\)/g)||[],o.expressions=u.map(function(e){var t=e.match(s),r=t[1].toLowerCase().match(f);return{modifier:r[1],feature:r[2],value:t[2]}}),o})}function o(e){var t,r=Number(e);return r||(t=e.match(/^(\d+)\s*\/\s*(\d+)$/),r=t[1]/t[2]),r}function a(e){var t=parseFloat(e);switch(String(e).match(d)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function i(e){var t=parseFloat(e);switch(String(e).match(l)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}t.match=n,t.parse=u;var c=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,s=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,f=/^(?:(min|max)-)?(.+)/,l=/(em|rem|px|cm|mm|in|pt|pc)?$/,d=/(dpi|dpcm|dppx)?$/},function(e,t,r){"use strict";function n(e,t){if(e===t)return!0;if(!e||!t)return!1;var r=Object.keys(e),n=Object.keys(t),u=r.length;if(n.length!==u)return!1;for(var o=0;o<u;o++){var a=r[o];if(e[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0}function u(e,t){if(e===t)return!0;if(!e||!t)return!1;var r=e.length;if(t.length!==r)return!1;for(var n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}Object.defineProperty(t,"__esModule",{value:!0}),r.d(t,"shallowEqualArrays",function(){return u}),r.d(t,"shallowEqualObjects",function(){return n})},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u])}return e},n.apply(this,arguments)},u=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var u=0,n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]]);return r},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=o(r(10)),i=a.default.oneOfType([a.default.string,a.default.number]),c={all:a.default.bool,grid:a.default.bool,aural:a.default.bool,braille:a.default.bool,handheld:a.default.bool,print:a.default.bool,projection:a.default.bool,screen:a.default.bool,tty:a.default.bool,tv:a.default.bool,embossed:a.default.bool},s={orientation:a.default.oneOf(["portrait","landscape"]),scan:a.default.oneOf(["progressive","interlace"]),aspectRatio:a.default.string,deviceAspectRatio:a.default.string,height:i,deviceHeight:i,width:i,deviceWidth:i,color:a.default.bool,colorIndex:a.default.bool,monochrome:a.default.bool,resolution:i,type:Object.keys(c)},f=u(s,["type"]),l=n({minAspectRatio:a.default.string,maxAspectRatio:a.default.string,minDeviceAspectRatio:a.default.string,maxDeviceAspectRatio:a.default.string,minHeight:i,maxHeight:i,minDeviceHeight:i,maxDeviceHeight:i,minWidth:i,maxWidth:i,minDeviceWidth:i,maxDeviceWidth:i,minColor:a.default.number,maxColor:a.default.number,minColorIndex:a.default.number,maxColorIndex:a.default.number,minMonochrome:a.default.number,maxMonochrome:a.default.number,minResolution:i,maxResolution:i},f),d=n(n({},c),l);t.default={all:d,types:c,matchers:s,features:l}},function(e,t,r){e.exports=r(11)()},function(e,t,r){"use strict";function n(){}function u(){}var o=r(12);u.resetWarningCache=n,e.exports=function(){function e(e,t,r,n,u,a){if(a!==o){var i=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 i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={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:u,resetWarningCache:n};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var u=0,n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]]);return r},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=u(r(0)),a=function(e){var t=e.children,r=e.device,u=e.onChange,a=n(e,["children","device","onChange"]),i=(0,o.default)(a,r,u);return"function"==typeof t?t(i):i?t:null};t.default=a}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.MediaQuery=t(require("react")):e.MediaQuery=t(e.React)}("undefined"!=typeof self?self:this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var u=r[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(r(1)),o=n(r(6)),a=n(r(2)),i=r(8),c=n(r(3)),s=n(r(4)),f=function(e){return e.query||(0,c.default)(e)},l=function(e){if(!e)return null;var t=Object.keys(e);return 0===t.length?null:t.reduce(function(t,r){return t[(0,a.default)(r)]=e[r],t},{})},d=function(){var e=u.default.useRef(!1);return u.default.useEffect(function(){e.current=!0},[]),e.current},p=function(e){var t=u.default.useContext(s.default),r=function(){return l(e)||l(t)||{}},n=u.default.useState(r),o=n[0],a=n[1];return u.default.useEffect(function(){var e=r();(0,i.shallowEqualObjects)(o,e)||a(e)},[e,t]),o},m=function(e){var t=function(){return f(e)},r=u.default.useState(t),n=r[0],o=r[1];return u.default.useEffect(function(){var e=t();n!==e&&o(e)},[e]),n},h=function(e,t){var r=function(){return(0,o.default)(e,t)},n=u.default.useState(r),a=n[0],i=n[1],c=d();return u.default.useEffect(function(){if(c){var e=r();return i(e),function(){e&&e.dispose()}}},[e,t]),a},v=function(e){var t=u.default.useState(e.matches),r=t[0],n=t[1];return u.default.useEffect(function(){var t=function(){n(e.matches)};return e.addListener(t),t(),function(){e.removeListener(t)}},[e]),r},y=function(e,t,r){var n=p(t),o=m(e);if(!o)throw new Error("Invalid or missing MediaQuery!");var a=h(o,n),i=v(a),c=d();return u.default.useEffect(function(){c&&r&&r(i)},[i]),u.default.useEffect(function(){return function(){a&&a.dispose()}},[]),i};t.default=y},function(t,r){t.exports=e},function(e,t,r){"use strict";function n(e){return"-"+e.toLowerCase()}function u(e){if(i.hasOwnProperty(e))return i[e];var t=e.replace(o,n);return i[e]=a.test(t)?"-"+t:t}Object.defineProperty(t,"__esModule",{value:!0});var o=/[A-Z]/g,a=/^ms-/,i={};t.default=u},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(r(2)),o=n(r(9)),a=function(e){return"not ".concat(e)},i=function(e,t){var r=(0,u.default)(e);return"number"==typeof t&&(t="".concat(t,"px")),!0===t?r:!1===t?a(r):"(".concat(r,": ").concat(t,")")},c=function(e){return e.join(" and ")},s=function(e){var t=[];return Object.keys(o.default.all).forEach(function(r){var n=e[r];null!=n&&t.push(i(r,n))}),c(t)};t.default=s},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(r(1)),o=u.default.createContext({});t.default=o},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.toQuery=t.useMediaQuery=t.default=void 0;var u=n(r(0));t.useMediaQuery=u.default;var o=n(r(13));t.default=o.default;var a=n(r(3));t.toQuery=a.default;var i=n(r(4));t.Context=i.default},function(e,t,r){"use strict";function n(e,t,r){function n(e){f&&f.addListener(e)}function u(e){f&&f.removeListener(e)}function i(e){s.matches=e.matches,s.media=e.media}function c(){f&&f.removeListener(i)}var s=this;if(a&&!r){var f=a.call(window,e);this.matches=f.matches,this.media=f.media,f.addListener(i)}else this.matches=o(e,t),this.media=e;this.addListener=n,this.removeListener=u,this.dispose=c}function u(e,t,r){return new n(e,t,r)}var o=r(7).match,a="undefined"!=typeof window?window.matchMedia:null;e.exports=u},function(e,t,r){"use strict";function n(e,t){return u(e).some(function(e){var r=e.inverse,n="all"===e.type||t.type===e.type;if(n&&r||!n&&!r)return!1;var u=e.expressions.every(function(e){var r=e.feature,n=e.modifier,u=e.value,c=t[r];if(!c)return!1;switch(r){case"orientation":case"scan":return c.toLowerCase()===u.toLowerCase();case"width":case"height":case"device-width":case"device-height":u=i(u),c=i(c);break;case"resolution":u=a(u),c=a(c);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":u=o(u),c=o(c);break;case"grid":case"color":case"color-index":case"monochrome":u=parseInt(u,10)||1,c=parseInt(c,10)||0}switch(n){case"min":return c>=u;case"max":return c<=u;default:return c===u}});return u&&!r||!u&&r})}function u(e){return e.split(",").map(function(e){e=e.trim();var t=e.match(c),r=t[1],n=t[2],u=t[3]||"",o={};return o.inverse=!!r&&"not"===r.toLowerCase(),o.type=n?n.toLowerCase():"all",u=u.match(/\([^\)]+\)/g)||[],o.expressions=u.map(function(e){var t=e.match(s),r=t[1].toLowerCase().match(f);return{modifier:r[1],feature:r[2],value:t[2]}}),o})}function o(e){var t,r=Number(e);return r||(t=e.match(/^(\d+)\s*\/\s*(\d+)$/),r=t[1]/t[2]),r}function a(e){var t=parseFloat(e);switch(String(e).match(d)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function i(e){var t=parseFloat(e);switch(String(e).match(l)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}t.match=n,t.parse=u;var c=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,s=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,f=/^(?:(min|max)-)?(.+)/,l=/(em|rem|px|cm|mm|in|pt|pc)?$/,d=/(dpi|dpcm|dppx)?$/},function(e,t,r){"use strict";function n(e,t){if(e===t)return!0;if(!e||!t)return!1;var r=Object.keys(e),n=Object.keys(t),u=r.length;if(n.length!==u)return!1;for(var o=0;o<u;o++){var a=r[o];if(e[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0}function u(e,t){if(e===t)return!0;if(!e||!t)return!1;var r=e.length;if(t.length!==r)return!1;for(var n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}Object.defineProperty(t,"__esModule",{value:!0}),r.d(t,"shallowEqualArrays",function(){return u}),r.d(t,"shallowEqualObjects",function(){return n})},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u])}return e},n.apply(this,arguments)},u=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var u=0,n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]]);return r},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=o(r(10)),i=a.default.oneOfType([a.default.string,a.default.number]),c={all:a.default.bool,grid:a.default.bool,aural:a.default.bool,braille:a.default.bool,handheld:a.default.bool,print:a.default.bool,projection:a.default.bool,screen:a.default.bool,tty:a.default.bool,tv:a.default.bool,embossed:a.default.bool},s={orientation:a.default.oneOf(["portrait","landscape"]),scan:a.default.oneOf(["progressive","interlace"]),aspectRatio:a.default.string,deviceAspectRatio:a.default.string,height:i,deviceHeight:i,width:i,deviceWidth:i,color:a.default.bool,colorIndex:a.default.bool,monochrome:a.default.bool,resolution:i,type:Object.keys(c)},f=u(s,["type"]),l=n({minAspectRatio:a.default.string,maxAspectRatio:a.default.string,minDeviceAspectRatio:a.default.string,maxDeviceAspectRatio:a.default.string,minHeight:i,maxHeight:i,minDeviceHeight:i,maxDeviceHeight:i,minWidth:i,maxWidth:i,minDeviceWidth:i,maxDeviceWidth:i,minColor:a.default.number,maxColor:a.default.number,minColorIndex:a.default.number,maxColorIndex:a.default.number,minMonochrome:a.default.number,maxMonochrome:a.default.number,minResolution:i,maxResolution:i},f),d=n(n({},c),l);t.default={all:d,types:c,matchers:s,features:l}},function(e,t,r){e.exports=r(11)()},function(e,t,r){"use strict";function n(){}function u(){}var o=r(12);u.resetWarningCache=n,e.exports=function(){function e(e,t,r,n,u,a){if(a!==o){var i=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 i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={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:u,resetWarningCache:n};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var u=0,n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]]);return r},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=u(r(0)),a=function(e){var t=e.children,r=e.device,u=e.onChange,a=n(e,["children","device","onChange"]),i=(0,o.default)(a,r,u);return"function"==typeof t?t(i):i?t:null};t.default=a}])}); | ||
//# sourceMappingURL=react-responsive.min.js.map |
{ | ||
"name": "react-responsive", | ||
"description": "Media queries in react for responsive design", | ||
"version": "9.0.0-beta.4", | ||
"version": "9.0.0-beta.5", | ||
"homepage": "http://github.com/contra/react-responsive", | ||
@@ -52,4 +52,4 @@ "repository": { | ||
"@types/sinon": "^10.0.0", | ||
"@typescript-eslint/eslint-plugin": "^4.15.2", | ||
"@typescript-eslint/parser": "^4.15.2", | ||
"@typescript-eslint/eslint-plugin": "^5.0.0", | ||
"@typescript-eslint/parser": "^5.0.0", | ||
"chai": "^4.1.2", | ||
@@ -59,3 +59,3 @@ "cross-env": "^7.0.0", | ||
"gh-pages": "^3.1.0", | ||
"jsdom": "^17.0.0", | ||
"jsdom": "^18.0.0", | ||
"match-media-mock": "^0.1.1", | ||
@@ -66,3 +66,3 @@ "mocha": "^9.0.0", | ||
"should": "^13.2.1", | ||
"sinon": "^11.0.0", | ||
"sinon": "^12.0.0", | ||
"ts-loader": "^3.0.0", | ||
@@ -69,0 +69,0 @@ "ts-node": "^10.0.0", |
@@ -12,1 +12,8 @@ import useMediaQuery from './useMediaQuery' | ||
} | ||
export type { | ||
MediaQueryTypes, | ||
MediaQueryType, | ||
MediaQueryFeatures, | ||
MediaQueryAllQueryable | ||
} from './types' |
@@ -72,8 +72,8 @@ import React from 'react' | ||
// skip on mounting, it has already been set | ||
const newMq = getMatchMedia(); | ||
setMq(newMq); | ||
const newMq = getMatchMedia() | ||
setMq(newMq) | ||
return () => { | ||
if (newMq) { | ||
newMq.dispose(); | ||
newMq.dispose() | ||
} | ||
@@ -119,9 +119,7 @@ } | ||
React.useEffect(() => { | ||
return () => { | ||
if (mq) { | ||
mq.dispose(); | ||
} | ||
React.useEffect(() => () => { | ||
if (mq) { | ||
mq.dispose() | ||
} | ||
}, []); | ||
}, []) | ||
@@ -128,0 +126,0 @@ return matches |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
310854
1419
1