seamless-scroll-polyfill
Advanced tools
Comparing version 2.1.5 to 2.1.6
@@ -0,1 +1,8 @@ | ||
## [2.1.6](https://github.com/magic-akari/seamless-scroll-polyfill/compare/v2.1.5...v2.1.6) (2021-12-05) | ||
### Bug Fixes | ||
* allow tree-shake if necessary ([aae469f](https://github.com/magic-akari/seamless-scroll-polyfill/commit/aae469f61abd921e40ebe87133011774e4be0d37)) | ||
## [2.1.5](https://github.com/magic-akari/seamless-scroll-polyfill/compare/v2.1.4...v2.1.5) (2021-10-25) | ||
@@ -2,0 +9,0 @@ |
@@ -59,6 +59,6 @@ (function (global, factory) { | ||
if (reason === void 0) { reason = "cannot convert to dictionary."; } | ||
return "Failed to execute '" + method + "' on '" + object + "': " + reason; | ||
return "Failed to execute '".concat(method, "' on '").concat(object, "': ").concat(reason); | ||
}; | ||
var failedExecuteInvalidEnumValue = function (method, object, value) { | ||
return failedExecute(method, object, "The provided value '" + value + "' is not a valid enum value of type ScrollBehavior."); | ||
return failedExecute(method, object, "The provided value '".concat(value, "' is not a valid enum value of type ScrollBehavior.")); | ||
}; | ||
@@ -68,3 +68,3 @@ /* eslint-disable */ | ||
var _a; | ||
var backup = "__SEAMLESS.BACKUP$" + method; | ||
var backup = "__SEAMLESS.BACKUP$".concat(method); | ||
if (!proto[backup] && proto[method] && !((_a = proto[method]) === null || _a === void 0 ? void 0 : _a.__isPolyfill)) { | ||
@@ -193,5 +193,5 @@ proto[backup] = proto[method]; | ||
}; | ||
var scroll = createScroll("scroll"); | ||
var scrollTo = createScroll("scrollTo"); | ||
var scrollBy = createScroll("scrollBy"); | ||
var scroll = /* #__PURE__ */ createScroll("scroll"); | ||
var scrollTo = /* #__PURE__ */ createScroll("scrollTo"); | ||
var scrollBy = /* #__PURE__ */ createScroll("scrollBy"); | ||
var elementScroll = scroll; | ||
@@ -496,3 +496,3 @@ var elementScrollTo = scrollTo; | ||
var scrollMarginValue = function (edge) { | ||
var value = computedStyle.getPropertyValue(scrollProperty + "-" + edge); | ||
var value = computedStyle.getPropertyValue("".concat(scrollProperty, "-").concat(edge)); | ||
return parseInt(value, 10) || 0; | ||
@@ -621,5 +621,5 @@ }; | ||
}; | ||
var elementScrollPolyfill = createPolyfill("scroll", modifyPrototypes); | ||
var elementScrollToPolyfill = createPolyfill("scrollTo", modifyPrototypes); | ||
var elementScrollByPolyfill = createPolyfill("scrollBy", modifyPrototypes); | ||
var elementScrollPolyfill = /* #__PURE__ */ createPolyfill("scroll", modifyPrototypes); | ||
var elementScrollToPolyfill = /* #__PURE__ */ createPolyfill("scrollTo", modifyPrototypes); | ||
var elementScrollByPolyfill = /* #__PURE__ */ createPolyfill("scrollBy", modifyPrototypes); | ||
var modifyWindow = function (prop, func) { | ||
@@ -630,5 +630,5 @@ markPolyfill(func); | ||
}; | ||
var windowScrollPolyfill = createPolyfill("scroll", modifyWindow); | ||
var windowScrollToPolyfill = createPolyfill("scrollTo", modifyWindow); | ||
var windowScrollByPolyfill = createPolyfill("scrollBy", modifyWindow); | ||
var windowScrollPolyfill = /* #__PURE__ */ createPolyfill("scroll", modifyWindow); | ||
var windowScrollToPolyfill = /* #__PURE__ */ createPolyfill("scrollTo", modifyWindow); | ||
var windowScrollByPolyfill = /* #__PURE__ */ createPolyfill("scrollBy", modifyWindow); | ||
@@ -635,0 +635,0 @@ function elementScrollIntoViewBoolean(alignToTop) { |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).seamless={})}(this,(function(e){"use strict"; | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).seamless={})}(this,(function(t){"use strict"; | ||
/*! ***************************************************************************** | ||
@@ -15,3 +15,3 @@ Copyright (c) Microsoft Corporation. | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var t=function(){return t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},t.apply(this,arguments)};function n(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,l=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=l.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return i}var o=function(e){return void 0===e||"auto"===e||"instant"===e||"smooth"===e};function r(e,t){this.scrollLeft=e,this.scrollTop=t}var l=function(e,t,n){return void 0===n&&(n="cannot convert to dictionary."),"Failed to execute '"+e+"' on '"+t+"': "+n},i=function(e,t,n){return l(e,t,"The provided value '"+n+"' is not a valid enum value of type ScrollBehavior.")},c=function(e,t,n){var o,r="__SEAMLESS.BACKUP$"+t;return e[r]||!e[t]||(null===(o=e[t])||void 0===o?void 0:o.__isPolyfill)||(e[r]=e[t]),e[r]||n},u=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)},a=function(){return"scrollBehavior"in window.document.documentElement.style},f=function(e){Object.defineProperty(e,"__isPolyfill",{value:!0})},s=function(e,t){f(t),[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach((function(n){c(n,e),n[e]=t}))},d=function(e){return e.ownerDocument.scrollingElement||e.ownerDocument.documentElement},v=function(e){return.5*(1-Math.cos(Math.PI*e))},w=function(){var e,t,n;return null!==(n=null===(t=null===(e=window.performance)||void 0===e?void 0:e.now)||void 0===t?void 0:t.call(e))&&void 0!==n?n:window.Date.now()},m=function(e){var t=(w()-e.timeStamp)/(e.duration||500);if(t>1)return e.method(e.targetX,e.targetY),void e.callback();var n=(e.timingFunc||v)(t),o=e.startX+(e.targetX-e.startX)*n,r=e.startY+(e.targetY-e.startY)*n;e.method(o,r),e.rafId=window.requestAnimationFrame((function(){m(e)}))},h=function(e){return isFinite(e)?Number(e):0},p=function(e){return function(a,f,s){var v,p=n((v=a).window===v?[d(a.document.documentElement),"Window"]:[a,"Element"],2),y=p[0],g=p[1],b=null!=f?f:{};if(!u(b))throw new TypeError(l(e,g));if(!o(b.behavior))throw new TypeError(i(e,g,b.behavior));"scrollBy"===e&&(b.left=h(b.left)+y.scrollLeft,b.top=h(b.top)+y.scrollTop),function(e,n,o){var l,i;if(function(e){var t;return null!==(t=e.isConnected)&&void 0!==t?t:!(e.ownerDocument&&1&e.ownerDocument.compareDocumentPosition(e))}(e)){var u=e.scrollLeft,a=e.scrollTop,f=h(null!==(l=n.left)&&void 0!==l?l:u),s=h(null!==(i=n.top)&&void 0!==i?i:a);if(f!==u||s!==a){var d=c(HTMLElement.prototype,"scroll",r),v=c(Object.getPrototypeOf(e),"scroll",d).bind(e);if("smooth"===n.behavior){var p=function(){window.removeEventListener("wheel",g),window.removeEventListener("touchmove",g)},y=t(t({},o),{timeStamp:w(),startX:u,startY:a,targetX:f,targetY:s,rafId:0,method:v,callback:p}),g=function(){window.cancelAnimationFrame(y.rafId),p()};window.addEventListener("wheel",g,{passive:!0,once:!0}),window.addEventListener("touchmove",g,{passive:!0,once:!0}),m(y)}else v(f,s)}}}(y,b,s)}},y=p("scroll"),g=p("scrollTo"),b=p("scrollBy"),T=y,E=g,S=b,P=y,L=g,B=b,V=function(e){switch(e){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":return 0;case"vertical-rl":case"tb":case"tb-rl":return 1;case"vertical-lr":case"tb-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4}return 0},M=function(e,t,o,r){var l,i=0;switch(t||(i^=2),e){case 0:i=i>>1|(1&i)<<1,o=(l=n([r,o],2))[0],r=l[1];break;case 1:case 3:i^=1;break;case 4:i^=2}return[i,o,r]},D=function(e){return 1==(1&M(V(e.writingMode),"rtl"!==e.direction,void 0,void 0)[0])},I=function(e,t,n,o,r,l,i){return 0!==e?e:r<t&&l>n||r>t&&l<n?null:r<=t&&i<=o||l>=n&&i>=o?2:l>n&&i<o||r<t&&i>o?3:null},W=function(e){return"visible"!==e&&"clip"!==e},H=function(e,t){return(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth)&&(W(t.overflowY)||W(t.overflowX)||e===d(e))},k=function(e){var t=e.parentNode,n=e.parentElement;if(null===n&&null!==t){if(11===t.nodeType)return t.host;if(9===t.nodeType)return function(e){var t;try{return(null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.frameElement)||null}catch(e){return null}}(e)}return n},x=function(e,t,n){return e<t?t:e>n?n:e},_=function(e,t,n){switch(e){case 1:return(t+n)/2;case 3:return n;case 2:case 0:return t}},j=function(e,t){var o,r,l,i=null===(o=e.ownerDocument.defaultView)||void 0===o?void 0:o.visualViewport,c=n(e===d(e)?[0,0,null!==(r=null==i?void 0:i.width)&&void 0!==r?r:e.clientWidth,null!==(l=null==i?void 0:i.height)&&void 0!==l?l:e.clientHeight]:[t.left,t.top,e.clientWidth,e.clientHeight],4),u=c[0],a=c[1],f=c[2],s=c[3],v=u+e.clientLeft,w=a+e.clientTop;return[w,v+f,w+s,v]},C=function(e,t){var o=[],r=e.ownerDocument,l=r.defaultView;if(!l)return o;for(var i=window.getComputedStyle(e),c="rtl"!==i.direction,u=n(function(e,t,o){var r=n(M(t,o,e.block||"start",e.inline||"nearest"),3),l=r[0];return[r[1],r[2]].map((function(e,t){switch(e){case"center":return 1;case"nearest":return 0;default:return"start"===e==!(l>>t&1)?2:3}}))}(t,V(i.writingMode||i.getPropertyValue("-webkit-writing-mode")||i.getPropertyValue("-ms-writing-mode")),c),2),a=u[0],f=u[1],s=n(function(e,t,n){var o,r=t.top,l=t.right,i=t.bottom,c=t.left,u=(o=e.ownerDocument,["scroll-margin","scroll-snap-margin"].filter((function(e){return e in o.documentElement.style}))[0]);if(!u)return[r,l,i,c];var a=function(e){var t=n.getPropertyValue(u+"-"+e);return parseInt(t,10)||0};return[r-a("top"),l+a("right"),i+a("bottom"),c-a("left")]}(e,e.getBoundingClientRect(),i),4),d=s[0],v=s[1],w=s[2],m=s[3],h=k(e);null!==h;h=k(h)){if(r!==h.ownerDocument){if(!(l=(r=h.ownerDocument).defaultView))break;var p=h.getBoundingClientRect(),y=p.left,g=p.top;d+=g,v+=y,w+=g,m+=y}var b=l.getComputedStyle(h);if("fixed"===b.position)break;if(H(h,b)){var T=h.getBoundingClientRect(),E=n(j(h,T),4),S=E[0],P=E[1],L=E[2],B=E[3],W=I(a,B,P,h.clientWidth,m,v,v-m),C=I(f,S,L,h.clientHeight,d,w,w-d),O=null===W?0:_(W,m,v)-_(W,B,P),X=null===C?0:_(C,d,w)-_(C,S,L),Y=D(b)?x(O,-h.scrollWidth+h.clientWidth-h.scrollLeft,-h.scrollLeft):x(O,-h.scrollLeft,h.scrollWidth-h.clientWidth-h.scrollLeft),F=x(X,-h.scrollTop,h.scrollHeight-h.clientHeight-h.scrollTop);o.push([h,{left:h.scrollLeft+Y,top:h.scrollTop+F,behavior:t.behavior}]),d=Math.max(d-F,S),v=Math.min(v-Y,P),w=Math.min(w-F,L),m=Math.max(m-Y,B)}}return o},O=function(e,t,r){var l=t||{};if(!o(l.behavior))throw new TypeError(i("scrollIntoView","Element",l.behavior));C(e,l).forEach((function(e){var t=n(e,2),o=t[0],l=t[1];T(o,l,r)}))},X=O,Y=function(e,t){return function(n){if(!a()){var o={scroll:y,scrollTo:g,scrollBy:b}[e];t(e,(function(){var e=arguments;if(1!==arguments.length){var t=e[0],r=e[1];o(this,{left:t,top:r})}else o(this,e[0],n)}))}}},F=Y("scroll",s),A=Y("scrollTo",s),R=Y("scrollBy",s),N=function(e,t){f(t),c(window,e),window[e]=t},q=Y("scroll",N),z=Y("scrollTo",N),G=Y("scrollBy",N);function K(e){X(this,{block:null==e||e?"start":"end",inline:"nearest"})}var U=function(e){if(!a()){var t=c(window.HTMLElement.prototype,"scrollIntoView",K);s("scrollIntoView",(function(){var n=arguments,o=n[0];1===n.length&&u(o)?X(this,o,e):t.apply(this,n)}))}};e.elementScroll=T,e.elementScrollBy=S,e.elementScrollByPolyfill=R,e.elementScrollIntoView=X,e.elementScrollIntoViewPolyfill=U,e.elementScrollPolyfill=F,e.elementScrollTo=E,e.elementScrollToPolyfill=A,e.modifyWindow=N,e.polyfill=function(e){a()||(F(e),A(e),R(e),U(e),q(e),z(e),G(e))},e.scroll=y,e.scrollBy=b,e.scrollIntoView=O,e.scrollTo=g,e.windowScroll=P,e.windowScrollBy=B,e.windowScrollByPolyfill=G,e.windowScrollPolyfill=q,e.windowScrollTo=L,e.windowScrollToPolyfill=z,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
***************************************************************************** */var e=function(){return e=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},e.apply(this,arguments)};function n(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,l=n.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(o=l.next()).done;)i.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return i}var o=function(t){return void 0===t||"auto"===t||"instant"===t||"smooth"===t};function r(t,e){this.scrollLeft=t,this.scrollTop=e}var l=function(t,e,n){return void 0===n&&(n="cannot convert to dictionary."),"Failed to execute '".concat(t,"' on '").concat(e,"': ").concat(n)},i=function(t,e,n){return l(t,e,"The provided value '".concat(n,"' is not a valid enum value of type ScrollBehavior."))},c=function(t,e,n){var o,r="__SEAMLESS.BACKUP$".concat(e);return t[r]||!t[e]||(null===(o=t[e])||void 0===o?void 0:o.__isPolyfill)||(t[r]=t[e]),t[r]||n},u=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)},a=function(){return"scrollBehavior"in window.document.documentElement.style},f=function(t){Object.defineProperty(t,"__isPolyfill",{value:!0})},s=function(t,e){f(e),[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach((function(n){c(n,t),n[t]=e}))},d=function(t){return t.ownerDocument.scrollingElement||t.ownerDocument.documentElement},v=function(t){return.5*(1-Math.cos(Math.PI*t))},w=function(){var t,e,n;return null!==(n=null===(e=null===(t=window.performance)||void 0===t?void 0:t.now)||void 0===e?void 0:e.call(t))&&void 0!==n?n:window.Date.now()},m=function(t){var e=(w()-t.timeStamp)/(t.duration||500);if(e>1)return t.method(t.targetX,t.targetY),void t.callback();var n=(t.timingFunc||v)(e),o=t.startX+(t.targetX-t.startX)*n,r=t.startY+(t.targetY-t.startY)*n;t.method(o,r),t.rafId=window.requestAnimationFrame((function(){m(t)}))},h=function(t){return isFinite(t)?Number(t):0},p=function(t){return function(a,f,s){var v,p=n((v=a).window===v?[d(a.document.documentElement),"Window"]:[a,"Element"],2),y=p[0],g=p[1],b=null!=f?f:{};if(!u(b))throw new TypeError(l(t,g));if(!o(b.behavior))throw new TypeError(i(t,g,b.behavior));"scrollBy"===t&&(b.left=h(b.left)+y.scrollLeft,b.top=h(b.top)+y.scrollTop),function(t,n,o){var l,i;if(function(t){var e;return null!==(e=t.isConnected)&&void 0!==e?e:!(t.ownerDocument&&1&t.ownerDocument.compareDocumentPosition(t))}(t)){var u=t.scrollLeft,a=t.scrollTop,f=h(null!==(l=n.left)&&void 0!==l?l:u),s=h(null!==(i=n.top)&&void 0!==i?i:a);if(f!==u||s!==a){var d=c(HTMLElement.prototype,"scroll",r),v=c(Object.getPrototypeOf(t),"scroll",d).bind(t);if("smooth"===n.behavior){var p=function(){window.removeEventListener("wheel",g),window.removeEventListener("touchmove",g)},y=e(e({},o),{timeStamp:w(),startX:u,startY:a,targetX:f,targetY:s,rafId:0,method:v,callback:p}),g=function(){window.cancelAnimationFrame(y.rafId),p()};window.addEventListener("wheel",g,{passive:!0,once:!0}),window.addEventListener("touchmove",g,{passive:!0,once:!0}),m(y)}else v(f,s)}}}(y,b,s)}},y=p("scroll"),g=p("scrollTo"),b=p("scrollBy"),T=y,E=g,S=b,P=y,L=g,B=b,V=function(t){switch(t){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":return 0;case"vertical-rl":case"tb":case"tb-rl":return 1;case"vertical-lr":case"tb-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4}return 0},M=function(t,e,o,r){var l,i=0;switch(e||(i^=2),t){case 0:i=i>>1|(1&i)<<1,o=(l=n([r,o],2))[0],r=l[1];break;case 1:case 3:i^=1;break;case 4:i^=2}return[i,o,r]},D=function(t){return 1==(1&M(V(t.writingMode),"rtl"!==t.direction,void 0,void 0)[0])},I=function(t,e,n,o,r,l,i){return 0!==t?t:r<e&&l>n||r>e&&l<n?null:r<=e&&i<=o||l>=n&&i>=o?2:l>n&&i<o||r<e&&i>o?3:null},W=function(t){return"visible"!==t&&"clip"!==t},H=function(t,e){return(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth)&&(W(e.overflowY)||W(e.overflowX)||t===d(t))},k=function(t){var e=t.parentNode,n=t.parentElement;if(null===n&&null!==e){if(11===e.nodeType)return e.host;if(9===e.nodeType)return function(t){var e;try{return(null===(e=t.ownerDocument.defaultView)||void 0===e?void 0:e.frameElement)||null}catch(t){return null}}(t)}return n},x=function(t,e,n){return t<e?e:t>n?n:t},_=function(t,e,n){switch(t){case 1:return(e+n)/2;case 3:return n;case 2:case 0:return e}},j=function(t,e){var o,r,l,i=null===(o=t.ownerDocument.defaultView)||void 0===o?void 0:o.visualViewport,c=n(t===d(t)?[0,0,null!==(r=null==i?void 0:i.width)&&void 0!==r?r:t.clientWidth,null!==(l=null==i?void 0:i.height)&&void 0!==l?l:t.clientHeight]:[e.left,e.top,t.clientWidth,t.clientHeight],4),u=c[0],a=c[1],f=c[2],s=c[3],v=u+t.clientLeft,w=a+t.clientTop;return[w,v+f,w+s,v]},C=function(t,e){var o=[],r=t.ownerDocument,l=r.defaultView;if(!l)return o;for(var i=window.getComputedStyle(t),c="rtl"!==i.direction,u=n(function(t,e,o){var r=n(M(e,o,t.block||"start",t.inline||"nearest"),3),l=r[0];return[r[1],r[2]].map((function(t,e){switch(t){case"center":return 1;case"nearest":return 0;default:return"start"===t==!(l>>e&1)?2:3}}))}(e,V(i.writingMode||i.getPropertyValue("-webkit-writing-mode")||i.getPropertyValue("-ms-writing-mode")),c),2),a=u[0],f=u[1],s=n(function(t,e,n){var o,r=e.top,l=e.right,i=e.bottom,c=e.left,u=(o=t.ownerDocument,["scroll-margin","scroll-snap-margin"].filter((function(t){return t in o.documentElement.style}))[0]);if(!u)return[r,l,i,c];var a=function(t){var e=n.getPropertyValue("".concat(u,"-").concat(t));return parseInt(e,10)||0};return[r-a("top"),l+a("right"),i+a("bottom"),c-a("left")]}(t,t.getBoundingClientRect(),i),4),d=s[0],v=s[1],w=s[2],m=s[3],h=k(t);null!==h;h=k(h)){if(r!==h.ownerDocument){if(!(l=(r=h.ownerDocument).defaultView))break;var p=h.getBoundingClientRect(),y=p.left,g=p.top;d+=g,v+=y,w+=g,m+=y}var b=l.getComputedStyle(h);if("fixed"===b.position)break;if(H(h,b)){var T=h.getBoundingClientRect(),E=n(j(h,T),4),S=E[0],P=E[1],L=E[2],B=E[3],W=I(a,B,P,h.clientWidth,m,v,v-m),C=I(f,S,L,h.clientHeight,d,w,w-d),O=null===W?0:_(W,m,v)-_(W,B,P),X=null===C?0:_(C,d,w)-_(C,S,L),Y=D(b)?x(O,-h.scrollWidth+h.clientWidth-h.scrollLeft,-h.scrollLeft):x(O,-h.scrollLeft,h.scrollWidth-h.clientWidth-h.scrollLeft),F=x(X,-h.scrollTop,h.scrollHeight-h.clientHeight-h.scrollTop);o.push([h,{left:h.scrollLeft+Y,top:h.scrollTop+F,behavior:e.behavior}]),d=Math.max(d-F,S),v=Math.min(v-Y,P),w=Math.min(w-F,L),m=Math.max(m-Y,B)}}return o},O=function(t,e,r){var l=e||{};if(!o(l.behavior))throw new TypeError(i("scrollIntoView","Element",l.behavior));C(t,l).forEach((function(t){var e=n(t,2),o=e[0],l=e[1];T(o,l,r)}))},X=O,Y=function(t,e){return function(n){if(!a()){var o={scroll:y,scrollTo:g,scrollBy:b}[t];e(t,(function(){var t=arguments;if(1!==arguments.length){var e=t[0],r=t[1];o(this,{left:e,top:r})}else o(this,t[0],n)}))}}},F=Y("scroll",s),A=Y("scrollTo",s),R=Y("scrollBy",s),N=function(t,e){f(e),c(window,t),window[t]=e},q=Y("scroll",N),z=Y("scrollTo",N),G=Y("scrollBy",N);function K(t){X(this,{block:null==t||t?"start":"end",inline:"nearest"})}var U=function(t){if(!a()){var e=c(window.HTMLElement.prototype,"scrollIntoView",K);s("scrollIntoView",(function(){var n=arguments,o=n[0];1===n.length&&u(o)?X(this,o,t):e.apply(this,n)}))}};t.elementScroll=T,t.elementScrollBy=S,t.elementScrollByPolyfill=R,t.elementScrollIntoView=X,t.elementScrollIntoViewPolyfill=U,t.elementScrollPolyfill=F,t.elementScrollTo=E,t.elementScrollToPolyfill=A,t.modifyWindow=N,t.polyfill=function(t){a()||(F(t),A(t),R(t),U(t),q(t),z(t),G(t))},t.scroll=y,t.scrollBy=b,t.scrollIntoView=O,t.scrollTo=g,t.windowScroll=P,t.windowScrollBy=B,t.windowScrollByPolyfill=G,t.windowScrollPolyfill=q,t.windowScrollTo=L,t.windowScrollToPolyfill=z,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=bundle.min.js.map |
@@ -80,5 +80,5 @@ import { backupMethod, checkBehavior, elementScrollXY, failedExecute, failedExecuteInvalidEnumValue, isObject, scrollingElement, } from "./common.js"; | ||
}; | ||
export const scroll = createScroll("scroll"); | ||
export const scrollTo = createScroll("scrollTo"); | ||
export const scrollBy = createScroll("scrollBy"); | ||
export const scroll = /* #__PURE__ */ createScroll("scroll"); | ||
export const scrollTo = /* #__PURE__ */ createScroll("scrollTo"); | ||
export const scrollBy = /* #__PURE__ */ createScroll("scrollBy"); | ||
export const elementScroll = scroll; | ||
@@ -85,0 +85,0 @@ export const elementScrollTo = scrollTo; |
@@ -23,5 +23,5 @@ import { backupMethod, isScrollBehaviorSupported, markPolyfill, modifyPrototypes } from "./common.js"; | ||
}; | ||
export const elementScrollPolyfill = createPolyfill("scroll", modifyPrototypes); | ||
export const elementScrollToPolyfill = createPolyfill("scrollTo", modifyPrototypes); | ||
export const elementScrollByPolyfill = createPolyfill("scrollBy", modifyPrototypes); | ||
export const elementScrollPolyfill = /* #__PURE__ */ createPolyfill("scroll", modifyPrototypes); | ||
export const elementScrollToPolyfill = /* #__PURE__ */ createPolyfill("scrollTo", modifyPrototypes); | ||
export const elementScrollByPolyfill = /* #__PURE__ */ createPolyfill("scrollBy", modifyPrototypes); | ||
export const modifyWindow = (prop, func) => { | ||
@@ -32,5 +32,5 @@ markPolyfill(func); | ||
}; | ||
export const windowScrollPolyfill = createPolyfill("scroll", modifyWindow); | ||
export const windowScrollToPolyfill = createPolyfill("scrollTo", modifyWindow); | ||
export const windowScrollByPolyfill = createPolyfill("scrollBy", modifyWindow); | ||
export const windowScrollPolyfill = /* #__PURE__ */ createPolyfill("scroll", modifyWindow); | ||
export const windowScrollToPolyfill = /* #__PURE__ */ createPolyfill("scrollTo", modifyWindow); | ||
export const windowScrollByPolyfill = /* #__PURE__ */ createPolyfill("scrollBy", modifyWindow); | ||
//# sourceMappingURL=scroll.polyfill.js.map |
@@ -5,3 +5,3 @@ { | ||
"description": "Smooth Scroll behavior polyfill", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"author": { | ||
@@ -20,20 +20,21 @@ "name": "Dustan Kasten", | ||
"devDependencies": { | ||
"@commitlint/cli": "^13.2.1", | ||
"@commitlint/config-conventional": "^13.2.0", | ||
"@semantic-release/changelog": "^6.0.0", | ||
"@semantic-release/git": "^10.0.0", | ||
"@commitlint/cli": "^15.0.0", | ||
"@commitlint/config-conventional": "^15.0.0", | ||
"@semantic-release/changelog": "^6.0.1", | ||
"@semantic-release/git": "^10.0.1", | ||
"commitizen": "^4.2.4", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"eslint": "^8.1.0", | ||
"eslint": "^8.4.0", | ||
"eslint-config-akari": "^0.0.4", | ||
"husky": "^7.0.4", | ||
"lint-staged": "^11.2.4", | ||
"prettier": "^2.4.1", | ||
"rollup": "^2.58.1", | ||
"lint-staged": "^12.1.2", | ||
"prettier": "^2.5.1", | ||
"rollup": "^2.60.2", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-typescript2": "^0.30.0", | ||
"semantic-release": "^18.0.0", | ||
"rollup-plugin-typescript2": "^0.31.1", | ||
"semantic-release": "^18.0.1", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.4.4" | ||
"typescript": "^4.5.2" | ||
}, | ||
"packageManager": "pnpm@6.23.6", | ||
"type": "module", | ||
@@ -40,0 +41,0 @@ "main": "./lib/bundle.js", |
@@ -35,5 +35,5 @@ import { backupMethod, isScrollBehaviorSupported, markPolyfill, modifyPrototypes } from "./common.js"; | ||
export const elementScrollPolyfill = createPolyfill("scroll", modifyPrototypes); | ||
export const elementScrollToPolyfill = createPolyfill("scrollTo", modifyPrototypes); | ||
export const elementScrollByPolyfill = createPolyfill("scrollBy", modifyPrototypes); | ||
export const elementScrollPolyfill = /* #__PURE__ */ createPolyfill("scroll", modifyPrototypes); | ||
export const elementScrollToPolyfill = /* #__PURE__ */ createPolyfill("scrollTo", modifyPrototypes); | ||
export const elementScrollByPolyfill = /* #__PURE__ */ createPolyfill("scrollBy", modifyPrototypes); | ||
@@ -46,4 +46,4 @@ export const modifyWindow = <T extends "scroll" | "scrollTo" | "scrollBy">(prop: T, func: typeof window[T]): void => { | ||
export const windowScrollPolyfill = createPolyfill("scroll", modifyWindow); | ||
export const windowScrollToPolyfill = createPolyfill("scrollTo", modifyWindow); | ||
export const windowScrollByPolyfill = createPolyfill("scrollBy", modifyWindow); | ||
export const windowScrollPolyfill = /* #__PURE__ */ createPolyfill("scroll", modifyWindow); | ||
export const windowScrollToPolyfill = /* #__PURE__ */ createPolyfill("scrollTo", modifyWindow); | ||
export const windowScrollByPolyfill = /* #__PURE__ */ createPolyfill("scrollBy", modifyWindow); |
@@ -118,5 +118,5 @@ import { | ||
export const scroll = createScroll("scroll"); | ||
export const scrollTo = createScroll("scrollTo"); | ||
export const scrollBy = createScroll("scrollBy"); | ||
export const scroll = /* #__PURE__ */ createScroll("scroll"); | ||
export const scrollTo = /* #__PURE__ */ createScroll("scrollTo"); | ||
export const scrollBy = /* #__PURE__ */ createScroll("scrollBy"); | ||
@@ -123,0 +123,0 @@ export const elementScroll = scroll as ScrollMethod<Element>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
430777
2247