compute-scroll-into-view 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +5 -1
- package/index.js +5 -1
- package/package.json +13 -13
- package/umd/compute-scroll-into-view.js +5 -1
- package/umd/compute-scroll-into-view.min.js +1 -1
package/es/index.js
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/stipsan/compute-scroll-into-view.git"
|
|
10
10
|
},
|
|
11
|
-
"version": "1.0.
|
|
11
|
+
"version": "1.0.14",
|
|
12
12
|
"main": "index.js",
|
|
13
13
|
"module": "es/index.js",
|
|
14
14
|
"files": [
|
|
@@ -34,34 +34,34 @@
|
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"typings": "typings/index.d.ts",
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@babel/cli": "7.8.
|
|
38
|
-
"@babel/core": "7.
|
|
37
|
+
"@babel/cli": "7.8.4",
|
|
38
|
+
"@babel/core": "7.9.6",
|
|
39
39
|
"@babel/plugin-external-helpers": "7.8.3",
|
|
40
|
-
"@babel/preset-env": "7.
|
|
41
|
-
"@babel/preset-typescript": "7.
|
|
40
|
+
"@babel/preset-env": "7.9.6",
|
|
41
|
+
"@babel/preset-typescript": "7.9.0",
|
|
42
42
|
"babel-plugin-add-module-exports": "1.0.2",
|
|
43
43
|
"babel-plugin-dev-expression": "0.2.2",
|
|
44
|
-
"concurrently": "5.0
|
|
44
|
+
"concurrently": "5.2.0",
|
|
45
45
|
"husky": "3.1.0",
|
|
46
46
|
"jest": "23.6.0",
|
|
47
47
|
"jest-junit": "10.0.0",
|
|
48
48
|
"jest-puppeteer": "4.4.0",
|
|
49
|
-
"lint-staged": "10.
|
|
49
|
+
"lint-staged": "10.1.5",
|
|
50
50
|
"prettier": "1.19.1",
|
|
51
51
|
"prettier-package-json": "2.1.3",
|
|
52
|
-
"puppeteer": "2.
|
|
53
|
-
"rimraf": "3.0.
|
|
52
|
+
"puppeteer": "2.1.1",
|
|
53
|
+
"rimraf": "3.0.2",
|
|
54
54
|
"rollup": "1.29.0",
|
|
55
|
-
"rollup-plugin-babel": "4.
|
|
55
|
+
"rollup-plugin-babel": "4.4.0",
|
|
56
56
|
"rollup-plugin-commonjs": "10.1.0",
|
|
57
57
|
"rollup-plugin-node-resolve": "5.2.0",
|
|
58
58
|
"rollup-plugin-replace": "2.2.0",
|
|
59
|
-
"rollup-plugin-terser": "5.
|
|
59
|
+
"rollup-plugin-terser": "5.3.0",
|
|
60
60
|
"semantic-release": "15.14.0",
|
|
61
|
-
"serve": "11.3.
|
|
61
|
+
"serve": "11.3.1",
|
|
62
62
|
"tslint": "5.20.1",
|
|
63
63
|
"tslint-config-prettier": "1.18.0",
|
|
64
|
-
"typescript": "3.
|
|
64
|
+
"typescript": "3.9.3"
|
|
65
65
|
},
|
|
66
66
|
"keywords": [
|
|
67
67
|
"if-needed",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!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
|
|
1
|
+
!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}}));
|