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

@bolt/components-sticky

Package Overview
Dependencies
Maintainers
4
Versions
350
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bolt/components-sticky - npm Package Compare versions

Comparing version 0.9.0-rc.3 to 0.9.0-rc.4

2

dist/bolt-sticky.min.js

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

!function(e){var t=window.webpackHotUpdate;window.webpackHotUpdate=function(e,n){!function(e,t){if(!w[e]||!k[e])return;k[e]=!1;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(h[n]=t[n]);0==--v&&0===m&&x()}(e,n),t&&t(e,n)};var n,r=!0,o="ba4ecacefca14a8de020",i=1e4,s={},c=[],a=[];function l(e){var t=j[e];if(!t)return C;var r=function(r){return t.hot.active?(j[r]?j[r].parents.indexOf(e)<0&&j[r].parents.push(e):(c=[e],n=r),t.children.indexOf(r)<0&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),c=[]),C(r)},o=function(e){return{configurable:!0,enumerable:!0,get:function(){return C[e]},set:function(t){C[e]=t}}};for(var i in C)Object.prototype.hasOwnProperty.call(C,i)&&"e"!==i&&Object.defineProperty(r,i,o(i));return r.e=function(e){return"ready"===p&&u("prepare"),m++,C.e(e).then(t,function(e){throw t(),e});function t(){m--,"prepare"===p&&(g[e]||E(e),0===m&&0===v&&x())}},r}var d=[],p="idle";function u(e){p=e;for(var t=0;t<d.length;t++)d[t].call(null,e)}var f,h,y,v=0,m=0,g={},k={},w={};function b(e){return+e+""===e?+e:e}function O(e){if("idle"!==p)throw new Error("check() is only allowed in idle status");return r=e,u("check"),(t=i,t=t||1e4,new Promise(function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,i=C.p+""+o+".hot-update.json";r.open("GET",i,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+i+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+i+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}})).then(function(e){if(!e)return u("idle"),null;k={},g={},w=e.c,y=e.h,u("prepare");var t=new Promise(function(e,t){f={resolve:e,reject:t}});h={};return E(0),"prepare"===p&&0===m&&0===v&&x(),t});var t}function E(e){w[e]?(k[e]=!0,v++,function(e){var t=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.src=C.p+""+e+"."+o+".hot-update.js",t.appendChild(n)}(e)):g[e]=!0}function x(){u("ready");var e=f;if(f=null,e)if(r)Promise.resolve().then(function(){return _(r)}).then(function(t){e.resolve(t)},function(t){e.reject(t)});else{var t=[];for(var n in h)Object.prototype.hasOwnProperty.call(h,n)&&t.push(b(n));e.resolve(t)}}function _(t){if("ready"!==p)throw new Error("apply() is only allowed in ready status");t=t||{};var n,r,i,a,l;function d(e){for(var t=[e],n={},r=t.slice().map(function(e){return{chain:[e],id:e}});r.length>0;){var o=r.pop(),i=o.id,s=o.chain;if((a=j[i])&&!a.hot._selfAccepted){if(a.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:i};if(a.hot._main)return{type:"unaccepted",chain:s,moduleId:i};for(var c=0;c<a.parents.length;c++){var l=a.parents[c],d=j[l];if(d){if(d.hot._declinedDependencies[i])return{type:"declined",chain:s.concat([l]),moduleId:i,parentId:l};t.indexOf(l)>=0||(d.hot._acceptedDependencies[i]?(n[l]||(n[l]=[]),f(n[l],[i])):(delete n[l],t.push(l),r.push({chain:s.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.indexOf(r)<0&&e.push(r)}}var v={},m=[],g={},k=function(){console.warn("[HMR] unexpected require("+E.moduleId+") to disposed module")};for(var O in h)if(Object.prototype.hasOwnProperty.call(h,O)){l=b(O);var E,x=!1,_=!1,P=!1,S="";switch((E=h[O]?d(l):{type:"disposed",moduleId:O}).chain&&(S="\nUpdate propagation: "+E.chain.join(" -> ")),E.type){case"self-declined":t.onDeclined&&t.onDeclined(E),t.ignoreDeclined||(x=new Error("Aborted because of self decline: "+E.moduleId+S));break;case"declined":t.onDeclined&&t.onDeclined(E),t.ignoreDeclined||(x=new Error("Aborted because of declined dependency: "+E.moduleId+" in "+E.parentId+S));break;case"unaccepted":t.onUnaccepted&&t.onUnaccepted(E),t.ignoreUnaccepted||(x=new Error("Aborted because "+l+" is not accepted"+S));break;case"accepted":t.onAccepted&&t.onAccepted(E),_=!0;break;case"disposed":t.onDisposed&&t.onDisposed(E),P=!0;break;default:throw new Error("Unexception type "+E.type)}if(x)return u("abort"),Promise.reject(x);if(_){g[l]=h[l],f(m,E.outdatedModules);for(l in E.outdatedDependencies)Object.prototype.hasOwnProperty.call(E.outdatedDependencies,l)&&(v[l]||(v[l]=[]),f(v[l],E.outdatedDependencies[l]))}P&&(f(m,[E.moduleId]),g[l]=k)}var D=[];for(r=0;r<m.length;r++)l=m[r],j[l]&&j[l].hot._selfAccepted&&D.push({module:l,errorHandler:j[l].hot._selfAccepted});u("dispose"),Object.keys(w).forEach(function(e){!1===w[e]&&delete installedChunks[e]});for(var H,I=m.slice();I.length>0;)if(l=I.pop(),a=j[l]){var A={},M=a.hot._disposeHandlers;for(i=0;i<M.length;i++)(n=M[i])(A);for(s[l]=A,a.hot.active=!1,delete j[l],delete v[l],i=0;i<a.children.length;i++){var q=j[a.children[i]];q&&((H=q.parents.indexOf(l))>=0&&q.parents.splice(H,1))}}var B,N;for(l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&(a=j[l]))for(N=v[l],i=0;i<N.length;i++)B=N[i],(H=a.children.indexOf(B))>=0&&a.children.splice(H,1);u("apply"),o=y;for(l in g)Object.prototype.hasOwnProperty.call(g,l)&&(e[l]=g[l]);var R=null;for(l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&(a=j[l])){N=v[l];var U=[];for(r=0;r<N.length;r++)if(B=N[r],n=a.hot._acceptedDependencies[B]){if(U.indexOf(n)>=0)continue;U.push(n)}for(r=0;r<U.length;r++){n=U[r];try{n(N)}catch(e){t.onErrored&&t.onErrored({type:"accept-errored",moduleId:l,dependencyId:N[r],error:e}),t.ignoreErrored||R||(R=e)}}}for(r=0;r<D.length;r++){var W=D[r];l=W.module,c=[l];try{C(l)}catch(e){if("function"==typeof W.errorHandler)try{W.errorHandler(e)}catch(n){t.onErrored&&t.onErrored({type:"self-accept-error-handler-errored",moduleId:l,error:n,orginalError:e,originalError:e}),t.ignoreErrored||R||(R=n),R||(R=e)}else t.onErrored&&t.onErrored({type:"self-accept-errored",moduleId:l,error:e}),t.ignoreErrored||R||(R=e)}}return R?(u("fail"),Promise.reject(R)):(u("idle"),new Promise(function(e){e(m)}))}var j={};function C(t){if(j[t])return j[t].exports;var r=j[t]={i:t,l:!1,exports:{},hot:function(e){var t={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_disposeHandlers:[],_main:n!==e,active:!0,accept:function(e,n){if(void 0===e)t._selfAccepted=!0;else if("function"==typeof e)t._selfAccepted=e;else if("object"==typeof e)for(var r=0;r<e.length;r++)t._acceptedDependencies[e[r]]=n||function(){};else t._acceptedDependencies[e]=n||function(){}},decline:function(e){if(void 0===e)t._selfDeclined=!0;else if("object"==typeof e)for(var n=0;n<e.length;n++)t._declinedDependencies[e[n]]=!0;else t._declinedDependencies[e]=!0},dispose:function(e){t._disposeHandlers.push(e)},addDisposeHandler:function(e){t._disposeHandlers.push(e)},removeDisposeHandler:function(e){var n=t._disposeHandlers.indexOf(e);n>=0&&t._disposeHandlers.splice(n,1)},check:O,apply:_,status:function(e){if(!e)return p;d.push(e)},addStatusHandler:function(e){d.push(e)},removeStatusHandler:function(e){var t=d.indexOf(e);t>=0&&d.splice(t,1)},data:s[e]};return n=void 0,t}(t),parents:(a=c,c=[],a),children:[]};return e[t].call(r.exports,r,r.exports,l(t)),r.l=!0,r.exports}C.m=e,C.c=j,C.d=function(e,t,n){C.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},C.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return C.d(t,"a",t),t},C.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},C.p="/scripts/",C.h=function(){return o},l(0)(C.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){var n=void 0!==t?t:{};this.version="2.0.13",this.userAgent=window.navigator.userAgent||"no `userAgent` provided by the browser",this.props={noStyles:n.noStyles||!1,stickyBitStickyOffset:n.stickyBitStickyOffset||0,parentClass:n.parentClass||"js-stickybit-parent",scrollEl:n.scrollEl||window,stickyClass:n.stickyClass||"js-is-sticky",stuckClass:n.stuckClass||"js-is-stuck",useStickyClasses:n.useStickyClasses||!1,verticalPosition:n.verticalPosition||"top"};var r=this.props;r.positionVal=this.definePosition()||"fixed";var o=r.verticalPosition,i=r.noStyles,s=r.positionVal;this.els="string"==typeof e?document.querySelectorAll(e):e,"length"in this.els||(this.els=[this.els]),this.instances=[];for(var c=0;c<this.els.length;c+=1){var a=this.els[c],l=a.style;if("top"!==o||i||(l[o]=r.stickyBitStickyOffset+"px"),"fixed"!==s&&!1===r.useStickyClasses)l.position=s;else{"fixed"!==s&&(l.position=s);var d=this.addInstance(a,r);this.instances.push(d)}}return this}r.prototype.definePosition=function(){for(var e=["","-o-","-webkit-","-moz-","-ms-"],t=document.head.style,n=0;n<e.length;n+=1)t.position=e[n]+"sticky";var r="fixed";return void 0!==t.position&&(r=t.position),t.position="",r},r.prototype.addInstance=function(e,t){var n=this,r={el:e,parent:e.parentNode,props:t},o=r.props;r.parent.className+=" "+t.parentClass;var i=o.scrollEl;return r.isWin=i===window,r.isWin||(i=this.getClosestParent(r.el,i)),this.computeScrollOffsets(r),r.state="default",r.stateContainer=function(){n.manageState(r)},i.addEventListener("scroll",r.stateContainer),r},r.prototype.getClosestParent=function(e,t){var n=document.querySelector(t),r=e;if(r.parentElement===n)return n;for(;r.parentElement!==n;)r=r.parentElement;return n},r.prototype.computeScrollOffsets=function(e){var t=e,n=t.props,r=t.parent,o=t.isWin,i=0,s=r.getBoundingClientRect().top;return o||"fixed"!==n.positionVal||(i=n.scrollEl.getBoundingClientRect().top,s=r.getBoundingClientRect().top-i),t.offset=i+n.stickyBitStickyOffset,t.stickyStart=s-t.offset,t.stickyStop=s+r.offsetHeight-(t.el.offsetHeight+t.offset),t},r.prototype.toggleClasses=function(e,t,n){var r=e,o=r.className.split(" ");n&&-1===o.indexOf(n)&&o.push(n);var i=o.indexOf(t);-1!==i&&o.splice(i,1),r.className=o.join(" ")},r.prototype.manageState=function(e){var t=e,n=t.el,r=t.props,o=t.state,i=t.stickyStart,s=t.stickyStop,c=n.style,a=r.noStyles,l=r.positionVal,d=r.scrollEl,p=r.stickyClass,u=r.stuckClass,f=r.verticalPosition,h=d.requestAnimationFrame;t.isWin&&void 0!==h||(h=function(e){e()});var y=this.toggleClasses,v=t.isWin?d.scrollY||d.pageYOffset:d.scrollTop,m=v<=i&&"sticky"===o,g=v>=s&&"sticky"===o;return v>i&&v<s&&("default"===o||"stuck"===o)?(t.state="sticky",h(function(){y(n,u,p),c.position=l,a||(c.bottom="",c[f]=r.stickyBitStickyOffset+"px")})):m?(t.state="default",h(function(){y(n,p),"fixed"===l&&(c.position="")})):g&&(t.state="stuck",h(function(){y(n,p,u),"fixed"!==l||a||(c.top="",c.bottom="0",c.position="absolute")})),t},r.prototype.removeInstance=function(e){var t=e.el,n=e.props,r=this.toggleClasses;t.style.position="",t.style[n.verticalPosition]="",r(t,n.stickyClass),r(t,n.stuckClass),r(t.parentNode,n.parentClass)},r.prototype.cleanup=function(){for(var e=0;e<this.instances.length;e+=1){var t=this.instances[e];t.props.scrollEl.removeEventListener("scroll",t.stateContainer),this.removeInstance(t)}this.manageState=!1,this.instances=[]};(function(e,t){new r(e,t)})(".js-bolt-sticky")}]);
!function(e){var t=window.webpackHotUpdate;window.webpackHotUpdate=function(e,n){!function(e,t){if(!w[e]||!k[e])return;k[e]=!1;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(h[n]=t[n]);0==--v&&0===m&&x()}(e,n),t&&t(e,n)};var n,r=!0,o="ba4ecacefca14a8de020",i=1e4,s={},c=[],a=[];function l(e){var t=j[e];if(!t)return C;var r=function(r){return t.hot.active?(j[r]?j[r].parents.indexOf(e)<0&&j[r].parents.push(e):(c=[e],n=r),t.children.indexOf(r)<0&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),c=[]),C(r)},o=function(e){return{configurable:!0,enumerable:!0,get:function(){return C[e]},set:function(t){C[e]=t}}};for(var i in C)Object.prototype.hasOwnProperty.call(C,i)&&"e"!==i&&Object.defineProperty(r,i,o(i));return r.e=function(e){return"ready"===p&&u("prepare"),m++,C.e(e).then(t,function(e){throw t(),e});function t(){m--,"prepare"===p&&(g[e]||E(e),0===m&&0===v&&x())}},r}var d=[],p="idle";function u(e){p=e;for(var t=0;t<d.length;t++)d[t].call(null,e)}var f,h,y,v=0,m=0,g={},k={},w={};function b(e){return+e+""===e?+e:e}function O(e){if("idle"!==p)throw new Error("check() is only allowed in idle status");return r=e,u("check"),(t=i,t=t||1e4,new Promise(function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,i=C.p+""+o+".hot-update.json";r.open("GET",i,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+i+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+i+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}})).then(function(e){if(!e)return u("idle"),null;k={},g={},w=e.c,y=e.h,u("prepare");var t=new Promise(function(e,t){f={resolve:e,reject:t}});h={};return E(0),"prepare"===p&&0===m&&0===v&&x(),t});var t}function E(e){var t,n,r;w[e]?(k[e]=!0,v++,t=e,n=document.getElementsByTagName("head")[0],(r=document.createElement("script")).type="text/javascript",r.charset="utf-8",r.src=C.p+""+t+"."+o+".hot-update.js",n.appendChild(r)):g[e]=!0}function x(){u("ready");var e=f;if(f=null,e)if(r)Promise.resolve().then(function(){return _(r)}).then(function(t){e.resolve(t)},function(t){e.reject(t)});else{var t=[];for(var n in h)Object.prototype.hasOwnProperty.call(h,n)&&t.push(b(n));e.resolve(t)}}function _(t){if("ready"!==p)throw new Error("apply() is only allowed in ready status");var n,r,i,a,l;function d(e){for(var t=[e],n={},r=t.slice().map(function(e){return{chain:[e],id:e}});r.length>0;){var o=r.pop(),i=o.id,s=o.chain;if((a=j[i])&&!a.hot._selfAccepted){if(a.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:i};if(a.hot._main)return{type:"unaccepted",chain:s,moduleId:i};for(var c=0;c<a.parents.length;c++){var l=a.parents[c],d=j[l];if(d){if(d.hot._declinedDependencies[i])return{type:"declined",chain:s.concat([l]),moduleId:i,parentId:l};t.indexOf(l)>=0||(d.hot._acceptedDependencies[i]?(n[l]||(n[l]=[]),f(n[l],[i])):(delete n[l],t.push(l),r.push({chain:s.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.indexOf(r)<0&&e.push(r)}}t=t||{};var v={},m=[],g={},k=function(){console.warn("[HMR] unexpected require("+E.moduleId+") to disposed module")};for(var O in h)if(Object.prototype.hasOwnProperty.call(h,O)){var E;l=b(O);var x=!1,_=!1,P=!1,S="";switch((E=h[O]?d(l):{type:"disposed",moduleId:O}).chain&&(S="\nUpdate propagation: "+E.chain.join(" -> ")),E.type){case"self-declined":t.onDeclined&&t.onDeclined(E),t.ignoreDeclined||(x=new Error("Aborted because of self decline: "+E.moduleId+S));break;case"declined":t.onDeclined&&t.onDeclined(E),t.ignoreDeclined||(x=new Error("Aborted because of declined dependency: "+E.moduleId+" in "+E.parentId+S));break;case"unaccepted":t.onUnaccepted&&t.onUnaccepted(E),t.ignoreUnaccepted||(x=new Error("Aborted because "+l+" is not accepted"+S));break;case"accepted":t.onAccepted&&t.onAccepted(E),_=!0;break;case"disposed":t.onDisposed&&t.onDisposed(E),P=!0;break;default:throw new Error("Unexception type "+E.type)}if(x)return u("abort"),Promise.reject(x);if(_){g[l]=h[l],f(m,E.outdatedModules);for(l in E.outdatedDependencies)Object.prototype.hasOwnProperty.call(E.outdatedDependencies,l)&&(v[l]||(v[l]=[]),f(v[l],E.outdatedDependencies[l]))}P&&(f(m,[E.moduleId]),g[l]=k)}var D,H=[];for(r=0;r<m.length;r++)l=m[r],j[l]&&j[l].hot._selfAccepted&&H.push({module:l,errorHandler:j[l].hot._selfAccepted});u("dispose"),Object.keys(w).forEach(function(e){!1===w[e]&&delete installedChunks[e]});for(var I,A,M=m.slice();M.length>0;)if(l=M.pop(),a=j[l]){var q={},B=a.hot._disposeHandlers;for(i=0;i<B.length;i++)(n=B[i])(q);for(s[l]=q,a.hot.active=!1,delete j[l],delete v[l],i=0;i<a.children.length;i++){var N=j[a.children[i]];N&&((D=N.parents.indexOf(l))>=0&&N.parents.splice(D,1))}}for(l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&(a=j[l]))for(A=v[l],i=0;i<A.length;i++)I=A[i],(D=a.children.indexOf(I))>=0&&a.children.splice(D,1);u("apply"),o=y;for(l in g)Object.prototype.hasOwnProperty.call(g,l)&&(e[l]=g[l]);var R=null;for(l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&(a=j[l])){A=v[l];var U=[];for(r=0;r<A.length;r++)if(I=A[r],n=a.hot._acceptedDependencies[I]){if(U.indexOf(n)>=0)continue;U.push(n)}for(r=0;r<U.length;r++){n=U[r];try{n(A)}catch(e){t.onErrored&&t.onErrored({type:"accept-errored",moduleId:l,dependencyId:A[r],error:e}),t.ignoreErrored||R||(R=e)}}}for(r=0;r<H.length;r++){var W=H[r];l=W.module,c=[l];try{C(l)}catch(e){if("function"==typeof W.errorHandler)try{W.errorHandler(e)}catch(n){t.onErrored&&t.onErrored({type:"self-accept-error-handler-errored",moduleId:l,error:n,orginalError:e,originalError:e}),t.ignoreErrored||R||(R=n),R||(R=e)}else t.onErrored&&t.onErrored({type:"self-accept-errored",moduleId:l,error:e}),t.ignoreErrored||R||(R=e)}}return R?(u("fail"),Promise.reject(R)):(u("idle"),new Promise(function(e){e(m)}))}var j={};function C(t){if(j[t])return j[t].exports;var r,o,i=j[t]={i:t,l:!1,exports:{},hot:(r=t,o={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_disposeHandlers:[],_main:n!==r,active:!0,accept:function(e,t){if(void 0===e)o._selfAccepted=!0;else if("function"==typeof e)o._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)o._acceptedDependencies[e[n]]=t||function(){};else o._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)o._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)o._declinedDependencies[e[t]]=!0;else o._declinedDependencies[e]=!0},dispose:function(e){o._disposeHandlers.push(e)},addDisposeHandler:function(e){o._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=o._disposeHandlers.indexOf(e);t>=0&&o._disposeHandlers.splice(t,1)},check:O,apply:_,status:function(e){if(!e)return p;d.push(e)},addStatusHandler:function(e){d.push(e)},removeStatusHandler:function(e){var t=d.indexOf(e);t>=0&&d.splice(t,1)},data:s[r]},n=void 0,o),parents:(a=c,c=[],a),children:[]};return e[t].call(i.exports,i,i.exports,l(t)),i.l=!0,i.exports}C.m=e,C.c=j,C.d=function(e,t,n){C.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},C.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return C.d(t,"a",t),t},C.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},C.p="/scripts/",C.h=function(){return o},l(0)(C.s=0)}([function(e,t,n){"use strict";function r(e,t){var n=void 0!==t?t:{};this.version="2.0.13",this.userAgent=window.navigator.userAgent||"no `userAgent` provided by the browser",this.props={noStyles:n.noStyles||!1,stickyBitStickyOffset:n.stickyBitStickyOffset||0,parentClass:n.parentClass||"js-stickybit-parent",scrollEl:n.scrollEl||window,stickyClass:n.stickyClass||"js-is-sticky",stuckClass:n.stuckClass||"js-is-stuck",useStickyClasses:n.useStickyClasses||!1,verticalPosition:n.verticalPosition||"top"};var r=this.props;r.positionVal=this.definePosition()||"fixed";var o=r.verticalPosition,i=r.noStyles,s=r.positionVal;this.els="string"==typeof e?document.querySelectorAll(e):e,"length"in this.els||(this.els=[this.els]),this.instances=[];for(var c=0;c<this.els.length;c+=1){var a=this.els[c],l=a.style;if("top"!==o||i||(l[o]=r.stickyBitStickyOffset+"px"),"fixed"!==s&&!1===r.useStickyClasses)l.position=s;else{"fixed"!==s&&(l.position=s);var d=this.addInstance(a,r);this.instances.push(d)}}return this}Object.defineProperty(t,"__esModule",{value:!0}),r.prototype.definePosition=function(){for(var e=["","-o-","-webkit-","-moz-","-ms-"],t=document.head.style,n=0;n<e.length;n+=1)t.position=e[n]+"sticky";var r="fixed";return void 0!==t.position&&(r=t.position),t.position="",r},r.prototype.addInstance=function(e,t){var n=this,r={el:e,parent:e.parentNode,props:t},o=r.props;r.parent.className+=" "+t.parentClass;var i=o.scrollEl;return r.isWin=i===window,r.isWin||(i=this.getClosestParent(r.el,i)),this.computeScrollOffsets(r),r.state="default",r.stateContainer=function(){n.manageState(r)},i.addEventListener("scroll",r.stateContainer),r},r.prototype.getClosestParent=function(e,t){var n=document.querySelector(t),r=e;if(r.parentElement===n)return n;for(;r.parentElement!==n;)r=r.parentElement;return n},r.prototype.computeScrollOffsets=function(e){var t=e,n=t.props,r=t.parent,o=t.isWin,i=0,s=r.getBoundingClientRect().top;return o||"fixed"!==n.positionVal||(i=n.scrollEl.getBoundingClientRect().top,s=r.getBoundingClientRect().top-i),t.offset=i+n.stickyBitStickyOffset,t.stickyStart=s-t.offset,t.stickyStop=s+r.offsetHeight-(t.el.offsetHeight+t.offset),t},r.prototype.toggleClasses=function(e,t,n){var r=e,o=r.className.split(" ");n&&-1===o.indexOf(n)&&o.push(n);var i=o.indexOf(t);-1!==i&&o.splice(i,1),r.className=o.join(" ")},r.prototype.manageState=function(e){var t=e,n=t.el,r=t.props,o=t.state,i=t.stickyStart,s=t.stickyStop,c=n.style,a=r.noStyles,l=r.positionVal,d=r.scrollEl,p=r.stickyClass,u=r.stuckClass,f=r.verticalPosition,h=d.requestAnimationFrame;t.isWin&&void 0!==h||(h=function(e){e()});var y=this.toggleClasses,v=t.isWin?d.scrollY||d.pageYOffset:d.scrollTop,m=v<=i&&"sticky"===o,g=v>=s&&"sticky"===o;return v>i&&v<s&&("default"===o||"stuck"===o)?(t.state="sticky",h(function(){y(n,u,p),c.position=l,a||(c.bottom="",c[f]=r.stickyBitStickyOffset+"px")})):m?(t.state="default",h(function(){y(n,p),"fixed"===l&&(c.position="")})):g&&(t.state="stuck",h(function(){y(n,p,u),"fixed"!==l||a||(c.top="",c.bottom="0",c.position="absolute")})),t},r.prototype.removeInstance=function(e){var t=e.el,n=e.props,r=this.toggleClasses;t.style.position="",t.style[n.verticalPosition]="",r(t,n.stickyClass),r(t,n.stuckClass),r(t.parentNode,n.parentClass)},r.prototype.cleanup=function(){for(var e=0;e<this.instances.length;e+=1){var t=this.instances[e];t.props.scrollEl.removeEventListener("scroll",t.stateContainer),this.removeInstance(t)}this.manageState=!1,this.instances=[]},o=".js-bolt-sticky",new r(o,i);var o,i}]);

@@ -13,3 +13,3 @@ {

],
"version": "0.9.0-rc.3",
"version": "0.9.0-rc.4",
"maintainers": [

@@ -47,3 +47,3 @@ {

"devDependencies": {
"@bolt/build-webpack": "^0.9.0-rc.3"
"@bolt/build-webpack": "^0.9.0-rc.4"
},

@@ -50,0 +50,0 @@ "scripts": {

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