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

smooth-scroll-into-view-if-needed

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smooth-scroll-into-view-if-needed - npm Package Compare versions

Comparing version 1.1.8 to 1.1.9

8

package.json

@@ -11,3 +11,3 @@ {

},
"version": "1.1.8",
"version": "1.1.9",
"main": "index.js",

@@ -50,6 +50,6 @@ "module": "es/index.js",

"eslint-plugin-import": "2.13.0",
"eslint-plugin-react": "7.9.1",
"eslint-plugin-react": "7.10.0",
"husky": "0.14.3",
"lint-staged": "7.2.0",
"prettier": "1.13.5",
"prettier": "1.13.6",
"prettier-package-json": "1.6.0",

@@ -63,3 +63,3 @@ "rimraf": "2.6.2",

"rollup-plugin-terser": "1.0.1",
"scroll-into-view-if-needed": "2.2.7",
"scroll-into-view-if-needed": "2.2.8",
"semantic-release": "15.6.0",

@@ -66,0 +66,0 @@ "typescript": "2.9.2"

@@ -9,4 +9,6 @@ (function (global, factory) {

var getViewport = (function () {
var doc = document;
if (!viewport) {
viewport = document.compatMode === 'CSS1Compat' ? document.documentElement : document.scrollingElement || document.documentElement;
viewport = doc.compatMode !== 'CSS1Compat' && doc.scrollingElement || doc.documentElement;
}

@@ -17,13 +19,9 @@

var isElement = function isElement(el) {
function isElement(el) {
return el != null && typeof el === 'object' && (el.nodeType === 1 || el.nodeType === 11);
};
}
var hasScrollableSpace = function hasScrollableSpace(el, axis) {
return axis === 'X' ? el.clientWidth < el.scrollWidth : el.clientHeight < el.scrollHeight;
};
function canOverflow(el, axis, skipOverflowHiddenElements) {
var overflowValue = getComputedStyle(el, null)[axis];
var canOverflow = function canOverflow(el, axis, skipOverflowHiddenElements) {
var overflowValue = getComputedStyle(el, null)['overflow' + axis];
if (skipOverflowHiddenElements && overflowValue === 'hidden') {

@@ -34,9 +32,9 @@ return false;

return overflowValue !== 'visible' && overflowValue !== 'clip';
};
}
var isScrollable = function isScrollable(el, skipOverflowHiddenElements) {
return el === getViewport() || hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y', skipOverflowHiddenElements) || hasScrollableSpace(el, 'X') && canOverflow(el, 'X', skipOverflowHiddenElements);
};
function isScrollable(el, skipOverflowHiddenElements) {
return el === getViewport() || el.clientHeight < el.scrollHeight && canOverflow(el, 'overflowY', skipOverflowHiddenElements) || el.clientWidth < el.scrollWidth && canOverflow(el, 'overflowX', skipOverflowHiddenElements);
}
var alignNearest = function alignNearest(scrollingEdgeStart, scrollingEdgeEnd, scrollingSize, scrollingBorderStart, scrollingBorderEnd, elementEdgeStart, elementEdgeEnd, elementSize) {
function alignNearest(scrollingEdgeStart, scrollingEdgeEnd, scrollingSize, scrollingBorderStart, scrollingBorderEnd, elementEdgeStart, elementEdgeEnd, elementSize) {
if (elementEdgeStart < scrollingEdgeStart && elementEdgeEnd > scrollingEdgeEnd || elementEdgeStart > scrollingEdgeStart && elementEdgeEnd < scrollingEdgeEnd) {

@@ -55,19 +53,10 @@ return 0;

return 0;
};
}
var compute = (function (target, options) {
if (options === void 0) {
options = {};
}
var _options = options,
_options$scrollMode = _options.scrollMode,
scrollMode = _options$scrollMode === void 0 ? 'always' : _options$scrollMode,
_options$block = _options.block,
block = _options$block === void 0 ? 'center' : _options$block,
_options$inline = _options.inline,
inline = _options$inline === void 0 ? 'nearest' : _options$inline,
boundary = _options.boundary,
_options$skipOverflow = _options.skipOverflowHiddenElements,
skipOverflowHiddenElements = _options$skipOverflow === void 0 ? false : _options$skipOverflow;
var scrollMode = options.scrollMode,
block = options.block,
inline = options.inline,
boundary = options.boundary,
skipOverflowHiddenElements = options.skipOverflowHiddenElements;
var checkBoundary = typeof boundary === 'function' ? boundary : function (node) {

@@ -129,4 +118,4 @@ return node !== boundary;

var targetBlock;
var targetInline;
var targetBlock = block === 'start' ? targetRect.top : block === 'end' ? targetRect.bottom : block === 'nearest' ? targetRect.top : targetRect.top + targetRect.height / 2;
var targetInline = inline === 'start' ? targetRect.left : inline === 'center' ? targetRect.left + targetRect.width / 2 : inline === 'end' ? targetRect.right : targetRect.left;
var computations = frames.map(function (frame) {

@@ -145,116 +134,21 @@ var frameRect = frame.getBoundingClientRect();

if (block === 'start') {
if (!targetBlock) {
targetBlock = targetRect.top;
}
if (viewport === frame) {
blockScroll = viewportY + targetBlock;
} else {
var offset = Math.min(targetBlock - frameRect.top, frame.scrollHeight - frame.clientHeight - frame.scrollTop);
blockScroll = frame.scrollTop + offset - borderTop;
}
blockScroll = viewport === frame ? viewportY + targetBlock : targetBlock - frameRect.top - borderTop;
} else if (block === 'end') {
blockScroll = viewport === frame ? viewportY + (targetBlock - viewportHeight) : frame.scrollTop - (frameRect.bottom - targetBlock) + borderBottom + scrollbarHeight;
} else if (block === 'nearest') {
blockScroll = viewport === frame ? viewportY + alignNearest(viewportY, viewportY + viewportHeight, viewportHeight, borderTop, borderBottom, viewportY + targetBlock, viewportY + targetBlock + targetRect.height, targetRect.height) : frame.scrollTop + alignNearest(frameRect.top, frameRect.bottom, frameRect.height, borderTop, borderBottom + scrollbarHeight, targetBlock, targetBlock + targetRect.height, targetRect.height);
} else {
blockScroll = viewport === frame ? viewportY + targetBlock - viewportHeight / 2 : frame.scrollTop - (frameRect.top + frameRect.height / 2 - targetBlock);
}
if (block === 'center') {
if (!targetBlock) {
targetBlock = targetRect.top + targetRect.height / 2;
}
if (viewport === frame) {
blockScroll = viewportY + targetBlock - viewportHeight / 2;
} else {
var _offset = 0 - Math.min(frameRect.top + frameRect.height / 2 - targetBlock, frame.scrollTop);
blockScroll = frame.scrollTop + _offset;
}
}
if (block === 'end') {
if (!targetBlock) {
targetBlock = targetRect.bottom;
}
if (viewport === frame) {
blockScroll = viewportY + targetBlock - viewportHeight;
} else {
var _offset2 = 0 - Math.min(frameRect.bottom - targetBlock, frame.scrollTop);
blockScroll = frame.scrollTop + _offset2 + borderBottom + scrollbarHeight;
}
}
if (block === 'nearest') {
if (!targetBlock) {
targetBlock = targetRect.top;
}
if (viewport === frame) {
var _offset3 = alignNearest(viewportY, viewportY + viewportHeight, viewportHeight, borderTop, borderBottom, viewportY + targetBlock, viewportY + targetBlock + targetRect.height, targetRect.height);
blockScroll = viewportY + _offset3;
} else {
var _offset4 = alignNearest(frameRect.top, frameRect.bottom, frameRect.height, borderTop, borderBottom + scrollbarHeight, targetBlock, targetBlock + targetRect.height, targetRect.height);
blockScroll = frame.scrollTop + _offset4;
}
}
if (inline === 'start') {
if (!targetInline) {
targetInline = targetRect.left;
}
if (viewport === frame) {
inlineScroll = viewportX + targetInline;
} else {
var _offset5 = Math.min(targetInline - frameRect.left, frame.scrollHeight - frame.clientLeft - frame.scrollLeft);
inlineScroll = frame.scrollLeft + _offset5 - borderLeft;
}
inlineScroll = viewport === frame ? viewportX + targetInline : frame.scrollLeft + (targetInline - frameRect.left) - borderLeft;
} else if (inline === 'center') {
inlineScroll = viewport === frame ? viewportX + targetInline - viewportWidth / 2 : frame.scrollLeft - (frameRect.left + frameRect.width / 2 - targetInline);
} else if (inline === 'end') {
inlineScroll = viewport === frame ? viewportX + (targetInline - viewportWidth) : frame.scrollLeft - (frameRect.right - targetInline) + borderRight + scrollbarWidth;
} else {
inlineScroll = viewport === frame ? viewportX + alignNearest(viewportX, viewportX + viewportWidth, viewportWidth, borderLeft, borderRight, viewportX + targetInline, viewportX + targetInline + targetRect.width, targetRect.width) : frame.scrollLeft + alignNearest(frameRect.left, frameRect.right, frameRect.width, borderLeft, borderRight + scrollbarWidth, targetInline, targetInline + targetRect.width, targetRect.width);
}
if (inline === 'center') {
if (!targetInline) {
targetInline = targetRect.left + targetRect.width / 2;
}
if (viewport === frame) {
inlineScroll = viewportX + targetInline - viewportWidth / 2;
} else {
var _offset6 = 0 - Math.min(frameRect.left + frameRect.width / 2 - targetInline, frame.scrollLeft);
inlineScroll = frame.scrollLeft + _offset6;
}
}
if (inline === 'end') {
if (!targetInline) {
targetInline = targetRect.right;
}
if (viewport === frame) {
inlineScroll = viewportX + targetInline - viewportWidth;
} else {
var _offset7 = 0 - Math.min(frameRect.right - targetInline, frame.scrollLeft);
inlineScroll = frame.scrollLeft + _offset7 + borderRight + scrollbarWidth;
}
}
if (inline === 'nearest') {
if (!targetInline) {
targetInline = targetRect.left;
}
if (viewport === frame) {
var _offset8 = alignNearest(viewportX, viewportX + viewportWidth, viewportWidth, borderLeft, borderRight, viewportX + targetInline, viewportX + targetInline + targetRect.width, targetRect.width);
inlineScroll = viewportX + _offset8;
} else {
var _offset9 = alignNearest(frameRect.left, frameRect.right, frameRect.width, borderLeft, borderRight + scrollbarWidth, targetInline, targetInline + targetRect.width, targetRect.width);
inlineScroll = frame.scrollLeft + _offset9;
}
}
targetBlock += frame.scrollTop - blockScroll;

@@ -271,11 +165,7 @@ targetInline += frame.scrollLeft - inlineScroll;

var isFunction = function isFunction(arg) {
return typeof arg === 'function';
};
var isOptionsObject = function isOptionsObject(options) {
function isOptionsObject(options) {
return options === Object(options) && Object.keys(options).length !== 0;
};
}
var defaultBehavior = function defaultBehavior(actions, behavior) {
function defaultBehavior(actions, behavior) {
if (behavior === void 0) {

@@ -286,3 +176,2 @@ behavior = 'auto';

var viewport = getViewport();
var supportsScrollBehavior = 'scrollBehavior' in viewport.style;
actions.forEach(function (_ref) {

@@ -293,3 +182,3 @@ var el = _ref.el,

if (el.scroll && supportsScrollBehavior) {
if (el.scroll && 'scrollBehavior' in viewport.style) {
el.scroll({

@@ -302,3 +191,3 @@ top: top,

if (el === viewport) {
window.scrollTo(left, top);
scrollTo(left, top);
} else {

@@ -310,20 +199,13 @@ el.scrollTop = top;

});
};
}
var getOptions = function getOptions(options) {
if (options === void 0) {
options = true;
}
if (options === true || options === null) {
function getOptions(options) {
if (options === false) {
return {
block: 'start',
inline: 'nearest'
};
} else if (options === false) {
return {
block: 'end',
inline: 'nearest'
};
} else if (isOptionsObject(options)) {
}
if (isOptionsObject(options)) {
return options;

@@ -336,10 +218,6 @@ }

};
};
}
function scrollIntoView(target, options) {
if (options === void 0) {
options = true;
}
if (isOptionsObject(options) && isFunction(options.behavior)) {
if (isOptionsObject(options) && typeof options.behavior === 'function') {
return options.behavior(compute(target, options));

@@ -346,0 +224,0 @@ }

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.scrollIntoView=e()}(this,function(){"use strict";var t,e,o=function(){return t||(t="CSS1Compat"===document.compatMode?document.documentElement:document.scrollingElement||document.documentElement),t},n=function(t){return null!=t&&"object"==typeof t&&(1===t.nodeType||11===t.nodeType)},i=function(t,e){return"X"===e?t.clientWidth<t.scrollWidth:t.clientHeight<t.scrollHeight},r=function(t,e,o){var n=getComputedStyle(t,null)["overflow"+e];return(!o||"hidden"!==n)&&("visible"!==n&&"clip"!==n)},l=function(t,e){return t===o()||i(t,"Y")&&r(t,"Y",e)||i(t,"X")&&r(t,"X",e)},f=function(t,e,o,n,i,r,l,f){return r<t&&l>e||r>t&&l<e?0:r<t&&f<o||l>e&&f>o?r-t-n:l>e&&f<o||r<t&&f>o?l-e+i:0},c=function(t,e){void 0===e&&(e={});var i=e,r=i.scrollMode,c=void 0===r?"always":r,s=i.block,a=void 0===s?"center":s,u=i.inline,d=void 0===u?"nearest":u,h=i.boundary,p=i.skipOverflowHiddenElements,w=void 0!==p&&p,v="function"==typeof h?h:function(t){return t!==h};if(!n(t))throw new Error("Element is required in scrollIntoView");for(var m,g=t.getBoundingClientRect(),b=[];n(m=t.parentNode||t.host)&&v(t);)l(m,w)&&b.push(m),t=m;var y,T,L=o(),M=window.visualViewport?window.visualViewport.width:Math.min(L.clientWidth,window.innerWidth),H=window.visualViewport?window.visualViewport.height:Math.min(L.clientHeight,window.innerHeight),W=window.scrollX||window.pageXOffset,X=window.scrollY||window.pageYOffset;if("if-needed"===c&&b.every(function(t){var e=t.getBoundingClientRect();if(g.top<e.top)return!1;if(g.bottom>e.bottom)return!1;if(t===L){if(g.bottom>H||g.top<0)return!1;if(g.left>M||g.right<0)return!1}return!0}))return[];return b.map(function(t){var e=t.getBoundingClientRect(),o=getComputedStyle(t),n=parseInt(o.borderLeftWidth,10),i=parseInt(o.borderTopWidth,10),r=parseInt(o.borderRightWidth,10),l=parseInt(o.borderBottomWidth,10),c="offsetWidth"in t?t.offsetWidth-t.clientWidth-n-r:0,s="offsetHeight"in t?t.offsetHeight-t.clientHeight-i-l:0,u=0,h=0;if("start"===a)if(y||(y=g.top),L===t)u=X+y;else{var p=Math.min(y-e.top,t.scrollHeight-t.clientHeight-t.scrollTop);u=t.scrollTop+p-i}if("center"===a)if(y||(y=g.top+g.height/2),L===t)u=X+y-H/2;else{var w=0-Math.min(e.top+e.height/2-y,t.scrollTop);u=t.scrollTop+w}if("end"===a)if(y||(y=g.bottom),L===t)u=X+y-H;else{var v=0-Math.min(e.bottom-y,t.scrollTop);u=t.scrollTop+v+l+s}if("nearest"===a)if(y||(y=g.top),L===t){var m=f(X,X+H,H,i,l,X+y,X+y+g.height,g.height);u=X+m}else{var b=f(e.top,e.bottom,e.height,i,l+s,y,y+g.height,g.height);u=t.scrollTop+b}if("start"===d)if(T||(T=g.left),L===t)h=W+T;else{var Y=Math.min(T-e.left,t.scrollHeight-t.clientLeft-t.scrollLeft);h=t.scrollLeft+Y-n}if("center"===d)if(T||(T=g.left+g.width/2),L===t)h=W+T-M/2;else{var k=0-Math.min(e.left+e.width/2-T,t.scrollLeft);h=t.scrollLeft+k}if("end"===d)if(T||(T=g.right),L===t)h=W+T-M;else{var E=0-Math.min(e.right-T,t.scrollLeft);h=t.scrollLeft+E+r+c}if("nearest"===d)if(T||(T=g.left),L===t){var C=f(W,W+M,M,n,r,W+T,W+T+g.width,g.width);h=W+C}else{var O=f(e.left,e.right,e.width,n,r+c,T,T+g.width,g.width);h=t.scrollLeft+O}return y+=t.scrollTop-u,T+=t.scrollLeft-h,{el:t,top:u,left:h}})},s=function(t){return"function"==typeof t},a=function(t){return t===Object(t)&&0!==Object.keys(t).length},u=function(t,e){void 0===e&&(e="auto");var n=o(),i="scrollBehavior"in n.style;t.forEach(function(t){var o=t.el,r=t.top,l=t.left;o.scroll&&i?o.scroll({top:r,left:l,behavior:e}):o===n?window.scrollTo(l,r):(o.scrollTop=r,o.scrollLeft=l)})},d=function(t){return void 0===t&&(t=!0),!0===t||null===t?{block:"start",inline:"nearest"}:!1===t?{block:"end",inline:"nearest"}:a(t)?t:{block:"start",inline:"nearest"}};function h(t,e){if(void 0===e&&(e=!0),a(e)&&s(e.behavior))return e.behavior(c(t,e));var o=d(e);return u(c(t,o),o.behavior)}var p=function(){return e||(e="performance"in window?performance.now.bind(performance):Date.now),e()};function w(t,e,o,n,i,r){var l,f,c,s;void 0===n&&(n=450),void 0===i&&(i=function(t){return 1+--t*t*t*t*t}),t===document.documentElement?(l=window,f=window.scrollX||window.pageXOffset,c=window.scrollY||window.pageYOffset,s=function(t,e){return window.scroll(t,e)}):(l=t,f=t.scrollLeft,c=t.scrollTop,s=function(e,o){t.scrollLeft=e,t.scrollTop=o}),function t(e){var o=p(),n=Math.min((o-e.startTime)/e.duration,1),i=e.ease(n),r=e.startX+(e.x-e.startX)*i,l=e.startY+(e.y-e.startY)*i;e.method(r,l),r===e.x&&l===e.y||requestAnimationFrame(function(){return t(e)})}({scrollable:l,method:s,startTime:p(),startX:f,startY:c,x:e,y:o,duration:n,ease:i,cb:r})}var v=function(t){return t&&!t.behavior||"smooth"===t.behavior};return function(t,e){if(v(e)){var o=e||{};return h(t,{block:o.block,inline:o.inline,scrollMode:o.scrollMode,boundary:o.boundary,behavior:function(t){return Promise.all(t.map(function(t){var e=t.el,n=t.left,i=t.top;return new Promise(function(t){return w(e,n,i,o.duration,o.ease,function(){return t()})})}))}})}return h(t,e)}});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.scrollIntoView=e()}(this,function(){"use strict";var t,e=function(){var e=document;return t||(t="CSS1Compat"!==e.compatMode&&e.scrollingElement||e.documentElement),t};function o(t){return null!=t&&"object"==typeof t&&(1===t.nodeType||11===t.nodeType)}function n(t,e,o){var n=getComputedStyle(t,null)[e];return(!o||"hidden"!==n)&&("visible"!==n&&"clip"!==n)}function r(t,o){return t===e()||t.clientHeight<t.scrollHeight&&n(t,"overflowY",o)||t.clientWidth<t.scrollWidth&&n(t,"overflowX",o)}function i(t,e,o,n,r,i,l,c){return i<t&&l>e||i>t&&l<e?0:i<t&&c<o||l>e&&c>o?i-t-n:l>e&&c<o||i<t&&c>o?l-e+r:0}var l,c=function(t,n){var l=n.scrollMode,c=n.block,f=n.inline,u=n.boundary,d=n.skipOverflowHiddenElements,s="function"==typeof u?u:function(t){return t!==u};if(!o(t))throw new Error("Element is required in scrollIntoView");for(var a,h=t.getBoundingClientRect(),p=[];o(a=t.parentNode||t.host)&&s(t);)r(a,d)&&p.push(a),t=a;var w=e(),m=window.visualViewport?window.visualViewport.width:Math.min(w.clientWidth,window.innerWidth),v=window.visualViewport?window.visualViewport.height:Math.min(w.clientHeight,window.innerHeight),g=window.scrollX||window.pageXOffset,b=window.scrollY||window.pageYOffset;if("if-needed"===l&&p.every(function(t){var e=t.getBoundingClientRect();if(h.top<e.top)return!1;if(h.bottom>e.bottom)return!1;if(t===w){if(h.bottom>v||h.top<0)return!1;if(h.left>m||h.right<0)return!1}return!0}))return[];var y="start"===c?h.top:"end"===c?h.bottom:"nearest"===c?h.top:h.top+h.height/2,T="start"===f?h.left:"center"===f?h.left+h.width/2:"end"===f?h.right:h.left;return p.map(function(t){var e=t.getBoundingClientRect(),o=getComputedStyle(t),n=parseInt(o.borderLeftWidth,10),r=parseInt(o.borderTopWidth,10),l=parseInt(o.borderRightWidth,10),u=parseInt(o.borderBottomWidth,10),d="offsetWidth"in t?t.offsetWidth-t.clientWidth-n-l:0,s="offsetHeight"in t?t.offsetHeight-t.clientHeight-r-u:0,a=0,p=0;return a="start"===c?w===t?b+y:y-e.top-r:"end"===c?w===t?b+(y-v):t.scrollTop-(e.bottom-y)+u+s:"nearest"===c?w===t?b+i(b,b+v,v,r,u,b+y,b+y+h.height,h.height):t.scrollTop+i(e.top,e.bottom,e.height,r,u+s,y,y+h.height,h.height):w===t?b+y-v/2:t.scrollTop-(e.top+e.height/2-y),p="start"===f?w===t?g+T:t.scrollLeft+(T-e.left)-n:"center"===f?w===t?g+T-m/2:t.scrollLeft-(e.left+e.width/2-T):"end"===f?w===t?g+(T-m):t.scrollLeft-(e.right-T)+l+d:w===t?g+i(g,g+m,m,n,l,g+T,g+T+h.width,h.width):t.scrollLeft+i(e.left,e.right,e.width,n,l+d,T,T+h.width,h.width),y+=t.scrollTop-a,T+=t.scrollLeft-p,{el:t,top:a,left:p}})};function f(t){return t===Object(t)&&0!==Object.keys(t).length}function u(t,o){if(f(o)&&"function"==typeof o.behavior)return o.behavior(c(t,o));var n=function(t){return!1===t?{block:"end",inline:"nearest"}:f(t)?t:{block:"start",inline:"nearest"}}(o);return function(t,o){void 0===o&&(o="auto");var n=e();t.forEach(function(t){var e=t.el,r=t.top,i=t.left;e.scroll&&"scrollBehavior"in n.style?e.scroll({top:r,left:i,behavior:o}):e===n?scrollTo(i,r):(e.scrollTop=r,e.scrollLeft=i)})}(c(t,n),n.behavior)}var d=function(){return l||(l="performance"in window?performance.now.bind(performance):Date.now),l()};function s(t,e,o,n,r,i){var l,c,f,u;void 0===n&&(n=450),void 0===r&&(r=function(t){return 1+--t*t*t*t*t}),t===document.documentElement?(l=window,c=window.scrollX||window.pageXOffset,f=window.scrollY||window.pageYOffset,u=function(t,e){return window.scroll(t,e)}):(l=t,c=t.scrollLeft,f=t.scrollTop,u=function(e,o){t.scrollLeft=e,t.scrollTop=o}),function t(e){var o=d(),n=Math.min((o-e.startTime)/e.duration,1),r=e.ease(n),i=e.startX+(e.x-e.startX)*r,l=e.startY+(e.y-e.startY)*r;e.method(i,l),i===e.x&&l===e.y||requestAnimationFrame(function(){return t(e)})}({scrollable:l,method:u,startTime:d(),startX:c,startY:f,x:e,y:o,duration:n,ease:r,cb:i})}var a=function(t){return t&&!t.behavior||"smooth"===t.behavior};return function(t,e){if(a(e)){var o=e||{};return u(t,{block:o.block,inline:o.inline,scrollMode:o.scrollMode,boundary:o.boundary,behavior:function(t){return Promise.all(t.map(function(t){var e=t.el,n=t.left,r=t.top;return new Promise(function(t){return s(e,n,r,o.duration,o.ease,function(){return t()})})}))}})}return u(t,e)}});
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