compute-scroll-into-view
Advanced tools
Comparing version 1.0.14 to 1.0.15
101
package.json
@@ -11,22 +11,17 @@ { | ||
}, | ||
"version": "1.0.14", | ||
"main": "index.js", | ||
"module": "es/index.js", | ||
"version": "1.0.15", | ||
"main": "dist/index.js", | ||
"module": "dist/index.module.js", | ||
"files": [ | ||
"es", | ||
"typings", | ||
"umd" | ||
"dist", | ||
"umd/compute-scroll-into-view.min.js", | ||
"umd/compute-scroll-into-view.min.js.map" | ||
], | ||
"scripts": { | ||
"prebuild": "yarn clean", | ||
"build": "yarn build:d.ts && yarn build:cjs && yarn build:es && yarn build:umd && yarn build:umd.min", | ||
"build:cjs": "BABEL_ENV=cjs babel src -d . --extensions '.ts'", | ||
"build:d.ts": "tsc --emitDeclarationOnly", | ||
"build:es": "BABEL_ENV=es babel src -d es --extensions '.ts'", | ||
"build:umd": "BABEL_ENV=umd NODE_ENV=development rollup -c -f umd -o umd/compute-scroll-into-view.js", | ||
"build:umd.min": "BABEL_ENV=umd NODE_ENV=production rollup -c -f umd -o umd/compute-scroll-into-view.min.js", | ||
"clean": "rimraf 'umd' 'es' 'typings'", | ||
"precommit": "lint-staged", | ||
"dev": "concurrently 'tsc --noEmit --watch' 'yarn build:cjs --watch' 'yarn build:es --watch' 'yarn build:umd --watch' 'yarn build:umd.min --watch'", | ||
"prepublishOnly": "unset npm_config_cafile && yarn build", | ||
"prebuild": "rimraf 'dist' 'umd'", | ||
"build": "npm run build:dist && npm run build:umd", | ||
"build:dist": "microbundle -f cjs,es", | ||
"build:umd": "microbundle -f umd -o umd", | ||
"dev": "concurrently 'npm run typecheck -- --watch' 'npm run build:dist -- --watch' 'npm run build:umd -- --watch'", | ||
"prepublishOnly": "unset npm_config_cafile && npm run build", | ||
"test": "jest -c integration/jest.config.js", | ||
@@ -36,32 +31,17 @@ "typecheck": "tsc --noEmit" | ||
"sideEffects": false, | ||
"typings": "typings/index.d.ts", | ||
"typings": "dist/index.d.ts", | ||
"devDependencies": { | ||
"@babel/cli": "7.8.4", | ||
"@babel/core": "7.9.6", | ||
"@babel/plugin-external-helpers": "7.8.3", | ||
"@babel/preset-env": "7.9.6", | ||
"@babel/preset-typescript": "7.9.0", | ||
"babel-plugin-add-module-exports": "1.0.2", | ||
"babel-plugin-dev-expression": "0.2.2", | ||
"concurrently": "5.2.0", | ||
"husky": "3.1.0", | ||
"jest": "23.6.0", | ||
"concurrently": "5.3.0", | ||
"husky": "4.2.5", | ||
"jest": "26.4.2", | ||
"jest-junit": "10.0.0", | ||
"jest-puppeteer": "4.4.0", | ||
"lint-staged": "10.1.5", | ||
"prettier": "1.19.1", | ||
"lint-staged": "10.2.13", | ||
"microbundle": "^0.12.3", | ||
"prettier": "2.1.1", | ||
"prettier-package-json": "2.1.3", | ||
"puppeteer": "2.1.1", | ||
"puppeteer": "3.3.0", | ||
"rimraf": "3.0.2", | ||
"rollup": "1.29.0", | ||
"rollup-plugin-babel": "4.4.0", | ||
"rollup-plugin-commonjs": "10.1.0", | ||
"rollup-plugin-node-resolve": "5.2.0", | ||
"rollup-plugin-replace": "2.2.0", | ||
"rollup-plugin-terser": "5.3.0", | ||
"semantic-release": "15.14.0", | ||
"serve": "11.3.1", | ||
"tslint": "5.20.1", | ||
"tslint-config-prettier": "1.18.0", | ||
"typescript": "3.9.3" | ||
"serve": "11.3.2", | ||
"typescript": "3.9.7" | ||
}, | ||
@@ -86,31 +66,14 @@ "keywords": [ | ||
"path": "./umd/compute-scroll-into-view.min.js", | ||
"maxSize": "2.6 kB", | ||
"maxSize": "3 kB", | ||
"compression": "none" | ||
} | ||
], | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"prettier --write", | ||
"git add" | ||
], | ||
"*.{ts,tsx}": [ | ||
"prettier --write", | ||
"git add" | ||
], | ||
"*.json": [ | ||
"prettier --write", | ||
"git add" | ||
], | ||
"*.md": [ | ||
"prettier --write", | ||
"git add" | ||
], | ||
"**/package.json": [ | ||
"prettier-package-json --write", | ||
"git add" | ||
], | ||
"**/.babelrc": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
"*.{js,ts,tsx,json,md}": "prettier --write", | ||
"**/package.json": "prettier-package-json --write" | ||
}, | ||
@@ -126,3 +89,5 @@ "prettier": { | ||
] | ||
} | ||
}, | ||
"source": "src/index.ts", | ||
"umd:main": "umd/compute-scroll-into-view.min.js" | ||
} |
@@ -1,1 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).computeScrollIntoView=t()}(this,(function(){"use strict";function e(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function t(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function n(e,n){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return t(r.overflowY,n)||t(r.overflowX,n)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function r(e,t,n,r,i,o,l,d){return o<e&&l>t||o>e&&l<t?0:o<=e&&d<=n||l>=t&&d>=n?o-e-r:l>t&&d<n||o<e&&d>n?l-t+i:0}return function(t,i){var o=i.scrollMode,l=i.block,d=i.inline,u=i.boundary,f=i.skipOverflowHiddenElements,c="function"==typeof u?u:function(e){return e!==u};if(!e(t))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,s=[],a=t;e(a)&&c(a);){if((a=a.parentNode)===h){s.push(a);break}a===document.body&&n(a)&&!n(document.documentElement)||n(a,f)&&s.push(a)}for(var p=window.visualViewport?visualViewport.width:innerWidth,m=window.visualViewport?visualViewport.height:innerHeight,g=window.scrollX||pageXOffset,w=window.scrollY||pageYOffset,v=t.getBoundingClientRect(),b=v.height,W=v.width,y=v.top,H=v.right,M=v.bottom,V=v.left,x="start"===l||"nearest"===l?y:"end"===l?M:y+b/2,E="center"===d?V+W/2:"end"===d?H:V,I=[],C=0;C<s.length;C++){var T=s[C],k=T.getBoundingClientRect(),B=k.height,D=k.width,O=k.top,R=k.right,S=k.bottom,X=k.left;if("if-needed"===o&&y>=0&&V>=0&&M<=m&&H<=p&&y>=O&&M<=S&&V>=X&&H<=R)return I;var Y=getComputedStyle(T),j=parseInt(Y.borderLeftWidth,10),L=parseInt(Y.borderTopWidth,10),N=parseInt(Y.borderRightWidth,10),q=parseInt(Y.borderBottomWidth,10),z=0,A=0,F="offsetWidth"in T?T.offsetWidth-T.clientWidth-j-N:0,G="offsetHeight"in T?T.offsetHeight-T.clientHeight-L-q:0;if(h===T)z="start"===l?x:"end"===l?x-m:"nearest"===l?r(w,w+m,m,L,q,w+x,w+x+b,b):x-m/2,A="start"===d?E:"center"===d?E-p/2:"end"===d?E-p:r(g,g+p,p,j,N,g+E,g+E+W,W),z=Math.max(0,z+w),A=Math.max(0,A+g);else{z="start"===l?x-O-L:"end"===l?x-S+q+G:"nearest"===l?r(O,S,B,L,q+G,x,x+b,b):x-(O+B/2)+G/2,A="start"===d?E-X-j:"center"===d?E-(X+D/2)+F/2:"end"===d?E-R+N+F:r(X,R,D,j,N+F,E,E+W,W);var J=T.scrollLeft,K=T.scrollTop;x+=K-(z=Math.max(0,Math.min(K+z,T.scrollHeight-B+G))),E+=J-(A=Math.max(0,Math.min(J+A,T.scrollWidth-D+F)))}I.push({el:T,top:z,left:A})}return I}})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).computeScrollIntoView=t()}(this,function(){function e(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function t(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function n(e,n){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return t(r.overflowY,n)||t(r.overflowX,n)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function r(e,t,n,r,i,o,l,d){return o<e&&l>t||o>e&&l<t?0:o<=e&&d<=n||l>=t&&d>=n?o-e-r:l>t&&d<n||o<e&&d>n?l-t+i:0}return function(t,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,f=i.boundary,c=i.skipOverflowHiddenElements,h="function"==typeof f?f:function(e){return e!==f};if(!e(t))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,s=[],p=t;e(p)&&h(p);){if((p=p.parentNode)===a){s.push(p);break}p===document.body&&n(p)&&!n(document.documentElement)||n(p,c)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,b=t.getBoundingClientRect(),W=b.height,y=b.width,H=b.top,M=b.right,V=b.bottom,x=b.left,E="start"===d||"nearest"===d?H:"end"===d?V:H+W/2,I="center"===u?x+y/2:"end"===u?M:x,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,S=B.right,X=B.bottom,Y=B.left;if("if-needed"===l&&H>=0&&x>=0&&V<=g&&M<=m&&H>=R&&V<=X&&x>=Y&&M<=S)return C;var j=getComputedStyle(k),L=parseInt(j.borderLeftWidth,10),N=parseInt(j.borderTopWidth,10),q=parseInt(j.borderRightWidth,10),z=parseInt(j.borderBottomWidth,10),A=0,F=0,G="offsetWidth"in k?k.offsetWidth-k.clientWidth-L-q:0,J="offsetHeight"in k?k.offsetHeight-k.clientHeight-N-z:0;if(a===k)A="start"===d?E:"end"===d?E-g:"nearest"===d?r(v,v+g,g,N,z,v+E,v+E+W,W):E-g/2,F="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:r(w,w+m,m,L,q,w+I,w+I+y,y),A=Math.max(0,A+v),F=Math.max(0,F+w);else{A="start"===d?E-R-N:"end"===d?E-X+z+J:"nearest"===d?r(R,X,D,N,z+J,E,E+W,W):E-(R+D/2)+J/2,F="start"===u?I-Y-L:"center"===u?I-(Y+O/2)+G/2:"end"===u?I-S+q+G:r(Y,S,O,L,q+G,I,I+y,y);var K=k.scrollLeft,P=k.scrollTop;E+=P-(A=Math.max(0,Math.min(P+A,k.scrollHeight-D+J))),I+=K-(F=Math.max(0,Math.min(K+F,k.scrollWidth-O+G)))}C.push({el:k,top:A,left:F})}return C}}); | ||
//# sourceMappingURL=compute-scroll-into-view.min.js.map |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
87674
13
9
34
1