Download node_modules/@headlessui/react/dist/utils/element-movement.js from sitcod3/modul-s: direct link, hf CLI and curl.
- Browser
- Download file 585 Bytes
-
https://huggingface.co/spaces/sitcod3/modul-s/resolve/c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/%40headlessui/react/dist/utils/element-movement.js
- Command line
-
hf download hf://spaces/sitcod3/modul-s@c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/@headlessui/react/dist/utils/element-movement.js
-
curl -L -o element-movement.js https://huggingface.co/spaces/sitcod3/modul-s/resolve/c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/%40headlessui/react/dist/utils/element-movement.js
585 Bytes
| import{disposables as r}from'./disposables.js';const c={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function a(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function p(e,t,i){let n=r();if(t.kind==="Tracked"){let o=function(){d!==a(e)&&(n.dispose(),i())};var f=o;let{position:d}=t,s=new ResizeObserver(o);s.observe(e),n.add(()=>s.disconnect()),n.addEventListener(window,"scroll",o,{passive:!0}),n.addEventListener(window,"resize",o)}return()=>n.dispose()}export{c as ElementPositionState,a as computeVisualPosition,p as detectMovement}; | |