css-box-model
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -1,1 +0,1 @@ | ||
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((t=t||self).cssBoxModel={})}(this,function(t){"use strict";var u=function(t){var o=t.top,r=t.right,e=t.bottom,i=t.left;return{top:o,right:r,bottom:e,left:i,width:r-i,height:e-o,x:i,y:o,center:{x:(r+i)/2,y:(e+o)/2}}},b=function(t,o){return{top:t.top-o.top,left:t.left-o.left,bottom:t.bottom+o.bottom,right:t.right+o.right}},m=function(t,o){return{top:t.top+o.top,left:t.left+o.left,bottom:t.bottom-o.bottom,right:t.right-o.right}},h={top:0,right:0,bottom:0,left:0},a=function(t){var o=t.borderBox,r=t.margin,e=void 0===r?h:r,i=t.border,n=void 0===i?h:i,d=t.padding,f=void 0===d?h:d,g=u(b(o,e)),a=u(m(o,n)),p=u(m(a,f));return{marginBox:g,borderBox:u(o),paddingBox:a,contentBox:p,margin:e,border:n,padding:f}},n=function(t){var o=t.slice(0,-2);if("px"!==t.slice(-2))return 0;var r=Number(o);return isNaN(r)&&function(t,o){if(!t)throw new Error("Invariant failed")}(!1),r},r=function(t,o){var r,e,i=t.borderBox,n=t.border,d=t.margin,f=t.padding,g=(e=o,{top:(r=i).top+e.y,left:r.left+e.x,bottom:r.bottom+e.y,right:r.right+e.x});return a({borderBox:g,border:n,margin:d,padding:f})},e=function(t,o){var r={top:n(o.marginTop),right:n(o.marginRight),bottom:n(o.marginBottom),left:n(o.marginLeft)},e={top:n(o.paddingTop),right:n(o.paddingRight),bottom:n(o.paddingBottom),left:n(o.paddingLeft)},i={top:n(o.borderTopWidth),right:n(o.borderRightWidth),bottom:n(o.borderBottomWidth),left:n(o.borderLeftWidth)};return a({borderBox:t,margin:r,padding:e,border:i})};t.calculateBox=e,t.createBox=a,t.expand=b,t.getBox=function(t){var o=t.getBoundingClientRect(),r=window.getComputedStyle(t);return e(o,r)},t.getRect=u,t.offset=r,t.shrink=m,t.withScroll=function(t,o){return void 0===o&&(o={x:window.pageXOffset,y:window.pageYOffset}),r(t,o)},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((t=t||self).cssBoxModel={})}(this,function(t){"use strict";var o="Invariant failed";var r=function(t){var o=t.top,r=t.right,e=t.bottom,i=t.left;return{top:o,right:r,bottom:e,left:i,width:r-i,height:e-o,x:i,y:o,center:{x:(r+i)/2,y:(e+o)/2}}},e=function(t,o){return{top:t.top-o.top,left:t.left-o.left,bottom:t.bottom+o.bottom,right:t.right+o.right}},i=function(t,o){return{top:t.top+o.top,left:t.left+o.left,bottom:t.bottom-o.bottom,right:t.right-o.right}},n={top:0,right:0,bottom:0,left:0},d=function(t){var o=t.borderBox,d=t.margin,f=void 0===d?n:d,g=t.border,a=void 0===g?n:g,p=t.padding,u=void 0===p?n:p,b=r(e(o,f)),m=r(i(o,a)),h=r(i(m,u));return{marginBox:b,borderBox:r(o),paddingBox:m,contentBox:h,margin:f,border:a,padding:u}},f=function(t){var r=t.slice(0,-2);if("px"!==t.slice(-2))return 0;var e=Number(r);return isNaN(e)&&function(t,r){if(!t)throw new Error(o)}(!1),e},g=function(t,o){var r,e,i=t.borderBox,n=t.border,f=t.margin,g=t.padding,a=(e=o,{top:(r=i).top+e.y,left:r.left+e.x,bottom:r.bottom+e.y,right:r.right+e.x});return d({borderBox:a,border:n,margin:f,padding:g})},a=function(t,o){var r={top:f(o.marginTop),right:f(o.marginRight),bottom:f(o.marginBottom),left:f(o.marginLeft)},e={top:f(o.paddingTop),right:f(o.paddingRight),bottom:f(o.paddingBottom),left:f(o.paddingLeft)},i={top:f(o.borderTopWidth),right:f(o.borderRightWidth),bottom:f(o.borderBottomWidth),left:f(o.borderLeftWidth)};return d({borderBox:t,margin:r,padding:e,border:i})};t.calculateBox=a,t.createBox=d,t.expand=e,t.getBox=function(t){var o=t.getBoundingClientRect(),r=window.getComputedStyle(t);return a(o,r)},t.getRect=r,t.offset=g,t.shrink=i,t.withScroll=function(t,o){return void 0===o&&(o={x:window.pageXOffset,y:window.pageYOffset}),g(t,o)},Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "css-box-model", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Get accurate and well named css box model information about an Element 📦", | ||
@@ -36,4 +36,3 @@ "author": "Alex Reardon <alexreardon@gmail.com>", | ||
"lint": "yarn prettier --debug-check src/** test/**", | ||
"typecheck": "yarn flow", | ||
"validate": "yarn lint && yarn flow", | ||
"validate": "yarn lint && flow check", | ||
"build:clean": "rimraf dist", | ||
@@ -49,4 +48,2 @@ "build:flow": "echo \"// @flow\n\nexport * from '../src';\" > dist/css-box-model.cjs.js.flow", | ||
"@babel/preset-flow": "^7.0.0", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-jest": "^24.9.0", | ||
"babel-plugin-dev-expression": "^0.2.2", | ||
@@ -59,6 +56,5 @@ "flow-bin": "0.106.1", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-commonjs": "^10.0.2", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-replace": "^2.2.0", | ||
"rollup-plugin-uglify": "^6.0.2" | ||
"rollup-plugin-terser": "^5.1.1" | ||
}, | ||
@@ -65,0 +61,0 @@ "dependencies": { |
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
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
31610
13
10