UNPKG

@getontime/cli

Version:
3 lines (2 loc) 969 B
import{h as c}from"./vendor-q6fv0YT2.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="f54ae56d-eca4-4696-9400-b8617aeef534",n._sentryDebugIdIdentifier="sentry-dbid-f54ae56d-eca4-4696-9400-b8617aeef534")}catch{}})();function b(n,e,r){if(!n.current||!e.current)return;const u=n.current.getBoundingClientRect(),t=e.current.getBoundingClientRect(),i=u.top-t.top+e.current.scrollTop-r;e.current.scrollTo({top:i,behavior:"smooth"})}function y({followRef:n,scrollRef:e,doFollow:r,topOffset:u=100,setScrollFlag:t,followTrigger:i}){return c.useEffect(()=>{!r||!i||n.current&&e.current&&(t==null||t(!0),window.requestAnimationFrame(()=>{b(n,e,u),t==null||t(!1)}))},[i,r,n,e,t,u]),c.useCallback((d=n,o=e,s=u)=>{d&&o&&b(d,o,s)},[n,e,u])}export{y as u}; //# sourceMappingURL=useFollowComponent-B7vvPzG2.js.map