Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@faceless-ui/window-info

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@faceless-ui/window-info - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

2

dist/build.bundle.js

@@ -1,2 +0,2 @@

module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t){e.exports=require("react")},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=r(n(2));t.default=function(){return o.useContext(i.default)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowInfoContext=void 0;var r=n(0);t.WindowInfoContext=r.createContext({}),t.default=t.WindowInfoContext},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.withWindowInfo=t.WindowInfoProvider=t.WindowInfoContext=t.WindowInfo=t.useWindowInfo=void 0;var o=n(1);Object.defineProperty(t,"useWindowInfo",{enumerable:!0,get:function(){return r(o).default}});var i=n(4);Object.defineProperty(t,"WindowInfo",{enumerable:!0,get:function(){return r(i).default}});var u=n(2);Object.defineProperty(t,"WindowInfoContext",{enumerable:!0,get:function(){return r(u).default}});var a=n(8);Object.defineProperty(t,"WindowInfoProvider",{enumerable:!0,get:function(){return r(a).default}});var f=n(9);Object.defineProperty(t,"withWindowInfo",{enumerable:!0,get:function(){return r(f).default}})},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(5)),i=r(n(1)),u=function(e){var t=e.children,n=i.default();return t?"function"==typeof t?t(n):t:null};u.defaultProps={children:void 0},u.propTypes={children:o.default.func},t.default=u},function(e,t,n){e.exports=n(6)()},function(e,t,n){"use strict";var r=n(7);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,u){if(u!==r){var a=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 a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={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:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},u=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&u(t,e,n);return a(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=f(n(0)),d=c(n(2)),l=function(e){function t(t){var n=e.call(this,t)||this;return n.updateWindowInfoWithTimeout=function(){setTimeout((function(){n.requestAnimation()}),500)},n.requestAnimation=function(){n.state.animationScheduled||n.setState({animationScheduled:!0},(function(){return requestAnimationFrame(n.updateWindowInfo)}))},n.updateWindowInfo=function(){var e=n.props.breakpoints,t=e.xs,r=e.s,o=e.m,i=e.l,u=e.xl,a=n.state.eventsFired,f=document.documentElement,c=f.style,s=f.clientWidth,d=f.clientHeight,l=window.innerWidth,p=window.innerHeight,h=s/100+"px",v=d/100+"px";n.setState({width:l,height:p,"--vw":h,"--vh":v,breakpoints:{xs:l<=t,s:l<=r,m:l<=o,l:l<=i,xl:l<=u},eventsFired:a+1,animationScheduled:!1}),c.setProperty("--vw",h),c.setProperty("--vh",v)},n.state={width:0,height:0,"--vw":"0px","--vh":"0px",breakpoints:{xs:!1,s:!1,m:!1,l:!1,xl:!1},eventsFired:0,animationScheduled:!1},n}return o(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.requestAnimation),window.addEventListener("orientationchange",this.updateWindowInfoWithTimeout),this.updateWindowInfo()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.requestAnimation),window.removeEventListener("orientationchange",this.updateWindowInfoWithTimeout)},t.prototype.render=function(){var e=this.props.children,t=i({},this.state);return delete t.animationScheduled,s.default.createElement(d.default.Provider,{value:i({},t)},e&&e)},t}(s.Component);t.default=l},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(0)),u=o(n(1));t.default=function(e){return function(t){var n=u.default();return i.default.createElement(e,r({},r(r({},t),{windowInfo:n})))}}}]);
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t){e.exports=require("react")},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=r(n(2));t.default=function(){return o.useContext(i.default)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0).createContext({});t.default=r},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.withWindowInfo=t.WindowInfoProvider=t.WindowInfoContext=t.WindowInfo=t.useWindowInfo=void 0;var o=n(1);Object.defineProperty(t,"useWindowInfo",{enumerable:!0,get:function(){return r(o).default}});var i=n(4);Object.defineProperty(t,"WindowInfo",{enumerable:!0,get:function(){return r(i).default}});var u=n(2);Object.defineProperty(t,"WindowInfoContext",{enumerable:!0,get:function(){return r(u).default}});var a=n(5);Object.defineProperty(t,"WindowInfoProvider",{enumerable:!0,get:function(){return r(a).default}});var f=n(6);Object.defineProperty(t,"withWindowInfo",{enumerable:!0,get:function(){return r(f).default}})},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(1));t.default=function(e){var t=e.children,n=o.default();return t?"function"==typeof t?t(n):t:null}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},u=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&u(t,e,n);return a(t,e),t},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=f(n(0)),l=d(n(2)),s=function(e){function t(t){var n=e.call(this,t)||this;return n.updateWindowInfoWithTimeout=function(){setTimeout((function(){n.requestAnimation()}),500)},n.requestAnimation=function(){n.state.animationScheduled||n.setState({animationScheduled:!0},(function(){return requestAnimationFrame(n.updateWindowInfo)}))},n.updateWindowInfo=function(){var e=n.props.breakpoints,t=e.xs,r=e.s,o=e.m,i=e.l,u=e.xl,a=n.state.eventsFired,f=document.documentElement,d=f.style,c=f.clientWidth,l=f.clientHeight,s=window.innerWidth,p=window.innerHeight,h=c/100+"px",v=l/100+"px";n.setState({width:s,height:p,"--vw":h,"--vh":v,breakpoints:{xs:s<=t,s:s<=r,m:s<=o,l:s<=i,xl:s<=u},eventsFired:a+1,animationScheduled:!1}),d.setProperty("--vw",h),d.setProperty("--vh",v)},n.state={width:0,height:0,"--vw":"0px","--vh":"0px",breakpoints:{xs:!1,s:!1,m:!1,l:!1,xl:!1},eventsFired:0,animationScheduled:!1},n}return o(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.requestAnimation),window.addEventListener("orientationchange",this.updateWindowInfoWithTimeout),this.updateWindowInfo()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.requestAnimation),window.removeEventListener("orientationchange",this.updateWindowInfoWithTimeout)},t.prototype.render=function(){var e=this.props.children,t=i({},this.state);return delete t.animationScheduled,c.default.createElement(l.default.Provider,{value:i({},t)},e&&e)},t}(c.Component);t.default=s},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(0)),u=o(n(1));t.default=function(e){return function(t){var n=u.default();return i.default.createElement(e,r({},r(r({},t),{windowInfo:n})))}}}]);
//# sourceMappingURL=build.bundle.js.map
{
"name": "@faceless-ui/window-info",
"version": "1.2.3",
"version": "1.2.4",
"main": "dist/build.bundle.js",

@@ -27,8 +27,5 @@ "repository": "git@github.com:faceless-ui/window-info.git",

"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
"dependencies": {
"prop-types": "^15.7.2"
},
"devDependencies": {

@@ -35,0 +32,0 @@ "@trbl/eslint-config": "^2.0.3",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc