prop-for-that 0.7.7 → 0.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +85 -0
- package/README.md +26 -3
- package/dist/auto.cjs +1 -1
- package/dist/auto.js +1 -1
- package/dist/{chunk-HKCTBVQT.js → chunk-2NMXY7T4.js} +1 -1
- package/dist/{chunk-MDKLN42L.js → chunk-2SIGTGQE.js} +1 -1
- package/dist/chunk-3QHCKCTX.cjs +1 -0
- package/dist/{chunk-37L73RJL.cjs → chunk-4C255WE6.cjs} +1 -1
- package/dist/chunk-4R63TNNO.cjs +1 -0
- package/dist/chunk-5PU4B3GP.cjs +1 -0
- package/dist/chunk-5VXDAWUI.js +1 -0
- package/dist/chunk-6234NJTF.js +1 -0
- package/dist/{chunk-3W7CXUWN.cjs → chunk-675RBWFU.cjs} +1 -1
- package/dist/{chunk-KAK6WZS7.js → chunk-6M2UIJI5.js} +1 -1
- package/dist/chunk-7KEBMJ3O.js +1 -0
- package/dist/{chunk-HTKGZP36.cjs → chunk-7LN34C3P.cjs} +1 -1
- package/dist/chunk-BF7D5A5Z.cjs +1 -0
- package/dist/chunk-DFWBYWE3.cjs +1 -0
- package/dist/chunk-DRXR56P5.cjs +1 -0
- package/dist/chunk-EXPE3C6O.js +2 -0
- package/dist/chunk-HFE2X32G.js +1 -0
- package/dist/{chunk-SKEEFKDT.js → chunk-HTO57OQP.js} +1 -1
- package/dist/chunk-IFIWYBMP.js +1 -0
- package/dist/chunk-JI7NXES2.cjs +1 -0
- package/dist/{chunk-BS2XX4G3.js → chunk-KDIZYBPJ.js} +1 -1
- package/dist/{chunk-G2BOTBBH.cjs → chunk-KHBJUHJ6.cjs} +1 -1
- package/dist/chunk-KSKAQMWJ.cjs +2 -0
- package/dist/chunk-N3F2LRDI.js +1 -0
- package/dist/{chunk-TRMZLMNW.js → chunk-N745RQIX.js} +1 -1
- package/dist/{chunk-SV76E7NI.js → chunk-PS7KTHW4.js} +1 -1
- package/dist/{chunk-LP3QQ33O.cjs → chunk-RVZWUZQ2.cjs} +1 -1
- package/dist/chunk-SRKAOAXW.cjs +1 -0
- package/dist/{chunk-2E2JQAHI.js → chunk-TL5BJFFL.js} +1 -1
- package/dist/{chunk-SYKMPPTY.cjs → chunk-XMJ6YRQB.cjs} +1 -1
- package/dist/head.cjs +1 -1
- package/dist/head.global.js +2 -1
- package/dist/head.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +28 -4
- package/dist/index.d.ts +28 -4
- package/dist/index.global.js +1 -1
- package/dist/index.js +1 -1
- package/dist/motion-6SENJS5V.cjs +1 -0
- package/dist/motion-QDEZZYDF.js +1 -0
- package/dist/online-HHJAVPBU.cjs +1 -0
- package/dist/online-OWTXHDGG.js +1 -0
- package/dist/orientation-LBAL4AXW.js +1 -0
- package/dist/orientation-PE3B4RPH.cjs +1 -0
- package/dist/page-focused-UK3VPLIG.js +1 -0
- package/dist/page-focused-Y74VK25Y.cjs +1 -0
- package/dist/page-visible-3YREALOP.cjs +1 -0
- package/dist/page-visible-GSBWF44E.js +1 -0
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.cts +64 -2
- package/dist/plugins.d.ts +64 -2
- package/dist/plugins.js +1 -1
- package/dist/pointer-P2B4YDKM.cjs +1 -0
- package/dist/pointer-RJIXVFBH.js +1 -0
- package/dist/pointer-local-L4EQM2UF.js +1 -0
- package/dist/pointer-local-QZJODLIH.cjs +1 -0
- package/dist/random-LUAMZ2M7.cjs +1 -0
- package/dist/random-O4GDPYJ3.js +1 -0
- package/dist/scroll-velocity-X3F22E47.cjs +1 -0
- package/dist/scroll-velocity-Y43V5NH2.js +1 -0
- package/dist/truncated-23UAUK2L.cjs +1 -0
- package/dist/truncated-R3OIXDTH.js +1 -0
- package/dist/{types-CudiAlDE.d.cts → types-CyGIcLOq.d.cts} +8 -0
- package/dist/{types-CudiAlDE.d.ts → types-CyGIcLOq.d.ts} +8 -0
- package/dist/ua-3MLUBLSV.cjs +1 -0
- package/dist/ua-3RC4SBYB.js +1 -0
- package/llms.txt +34 -5
- package/package.json +1 -1
- package/dist/chunk-3MK6Q7DX.cjs +0 -1
- package/dist/chunk-D24E2DBW.js +0 -1
- package/dist/chunk-EEMKKLRF.js +0 -1
- package/dist/chunk-OVCZMPYV.cjs +0 -1
- package/dist/chunk-OVF4XN2H.cjs +0 -1
- package/dist/chunk-PQVNJZUW.cjs +0 -1
- package/dist/chunk-QHHF5SEL.cjs +0 -1
- package/dist/chunk-SFO6H2DN.js +0 -1
- package/dist/chunk-V4OTPLOQ.js +0 -1
- package/dist/chunk-WIPJMLJJ.cjs +0 -1
- package/dist/motion-GHDWROM2.js +0 -1
- package/dist/motion-GMUGWJN3.cjs +0 -1
- package/dist/online-KTMCBCXT.cjs +0 -1
- package/dist/online-MGYZDLCQ.js +0 -1
- package/dist/orientation-27ULVQVJ.js +0 -1
- package/dist/orientation-JD23MYZR.cjs +0 -1
- package/dist/page-focused-3WLSZDV4.cjs +0 -1
- package/dist/page-focused-LBKD6QXG.js +0 -1
- package/dist/page-visible-27YKTHKU.js +0 -1
- package/dist/page-visible-6PMX575B.cjs +0 -1
- package/dist/pointer-3O7MGTQD.js +0 -1
- package/dist/pointer-DJSMZGSV.cjs +0 -1
- package/dist/pointer-local-6JKSOJZV.cjs +0 -1
- package/dist/pointer-local-X5TVNEEJ.js +0 -1
- package/dist/scroll-velocity-DGZNNO73.cjs +0 -1
- package/dist/scroll-velocity-ZRXPNZG7.js +0 -1
- package/dist/truncated-MDPFWGSI.js +0 -1
- package/dist/truncated-RUY3JNAX.cjs +0 -1
package/dist/index.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var PropForThat=(function(exports){'use strict';var
|
|
1
|
+
var PropForThat=(function(exports){'use strict';var p={livePrefix:"--live-",constPrefix:"--const-",root:typeof document<"u"?document.documentElement:void 0,typed:false};var v=new Set,W=null,a=0,C=false,m=false,O=0,k=false,H=()=>typeof requestAnimationFrame=="function";function F(e){if(a=0,m)return;let t=p.liveHz;if(H()&&t&&t>0&&e-O<1e3/t){(v.size||k)&&(a=requestAnimationFrame(F));return}if(O=e,C=true,v.size)for(let n of v)n(e);k=false,W?.(),C=false,v.size&&H()&&z();}function z(){a||C||m||(H()?a=requestAnimationFrame(F):F(0));}function A(){k=true,z();}function K(e){W=e;}function q(){m||(m=true,a&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(a),a=0);}function $(){m&&(m=false,z());}typeof document<"u"&&typeof document.addEventListener=="function"&&document.addEventListener("visibilitychange",()=>{document.hidden?q():$();});var d;function te(){if(d!==void 0||(d=null,typeof document>"u"||typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in document)))return d;try{let e=new CSSStyleSheet;e.replaceSync(":root{}"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],d=e.cssRules[0].style;}catch{d=null;}return d}function w(e){if(typeof document<"u"&&e===document.documentElement){let t=te();if(t)return t}return e.style}var D=class{pending=new Map;last=new WeakMap;set(t,n,r){let o=this.pending.get(t);if(o?.has(n)){o.set(n,r);return}this.last.get(t)?.get(n)!==r&&(o?o.set(n,r):this.pending.set(t,new Map([[n,r]])),A());}forget(t,n){this.last.get(t)?.delete(n);let r=this.pending.get(t);r&&(r.delete(n),r.size===0&&this.pending.delete(t));}flush=()=>{if(this.pending.size!==0){for(let[t,n]of this.pending){let r=this.last.get(t);r||this.last.set(t,r=new Map);let o=w(t);for(let[s,i]of n)r.get(s)!==i&&(o.setProperty(s,i),r.set(s,i));}this.pending.clear();}}},E=new D;K(E.flush);var b,S=new WeakMap,B=new WeakMap;function _(e,t){b||(b=new ResizeObserver(o=>{for(let s of o){B.set(s.target,s);let i=S.get(s.target);if(i)for(let f of i)f(s);}}));let n=S.get(e);n||(S.set(e,n=new Set),b.observe(e)),n.add(t);let r=B.get(e);return r&&t(r),()=>{let o=S.get(e);o&&(o.delete(t),o.size===0&&(S.delete(e),b.unobserve(e)));}}var M,h=new WeakMap,V=new WeakMap,ne=[0,.98,.99,.995,.999,1];function L(e,t){M||(M=new IntersectionObserver(o=>{for(let s of o){V.set(s.target,s);let i=h.get(s.target);if(i)for(let f of i)f(s);}},{threshold:ne}));let n=h.get(e);n||(h.set(e,n=new Set),M.observe(e)),n.add(t);let r=V.get(e);return r&&t(r),()=>{let o=h.get(e);o&&(o.delete(t),o.size===0&&(h.delete(e),M.unobserve(e)));}}var j=new Set;function G(e,t,n){if(j.has(e)||typeof CSS>"u"||typeof CSS.registerProperty!="function")return;j.add(e);let r=t?n?.[t]:void 0,o=t?p.defaults?.[t]:void 0;try{CSS.registerProperty({name:e,syntax:r?.syntax??"<number>",inherits:r?.inherits??!0,initialValue:o!=null?String(o):r?.initial??"0"});}catch{}}var R=new Map;function N(e,t){let n=R.get(e);if(!n){let r=new Set,o=s=>{for(let i of r)i(s);};n={handlers:r,dispatch:o},R.set(e,n),window.addEventListener(e,o,{passive:true});}return n.handlers.add(t),()=>{n.handlers.delete(t),n.handlers.size===0&&(window.removeEventListener(e,n.dispatch),R.delete(e));}}var U={key:"viewport",scope:"global",start(e){let t=()=>{e.write("vw",window.innerWidth),e.write("vh",window.innerHeight);};return t(),N("resize",t)}};function g(e){return Math.round(e*1e4)/1e4}var Y={key:"size",scope:"element",start(e){return _(e.target,t=>{let n=t.borderBoxSize?.[0],r=n?n.inlineSize:t.contentRect.width,o=n?n.blockSize:t.contentRect.height;e.write("w",g(r)),e.write("h",g(o)),e.write("aspect",o>0?g(r/o):0);})}};var T=1;function re(e){let t=e.rootBounds;if(!t)return e.intersectionRatio>=1;let n=e.boundingClientRect;return n.top>=t.top-T&&n.right<=t.right+T&&n.bottom<=t.bottom+T&&n.left>=t.left-T}var J={key:"visibility",scope:"element",gate:false,start(e){let t=false;return e.write("visible",0),e.write("has-entered",0,"const"),L(e.target,n=>{let r=re(n);e.write("visible",r?1:0),r&&!t&&(t=true,e.write("has-entered",1,"const"));})}};function Q(e,t){return e.matches(t)?e:e.querySelector(t)}var X={key:"range",scope:"element",gate:false,start(e){let t=Q(e.target,'input[type="range"], input[type="number"]');if(!t)return ()=>{};let n=()=>{let r=t.min===""?0:Number(t.min),o=t.max===""?100:Number(t.max),s=Number(t.value);e.write("value",s),e.write("value-pct",o>r?g((s-r)/(o-r)):0);};return n(),t.addEventListener("input",n,{passive:true}),()=>t.removeEventListener("input",n)}};var Z={viewport:U,size:Y,visibility:J,range:X};var oe=()=>{},l=new Map,I=new WeakMap,x={...Z};function Ne(e){x[e.key]=e;}function Ue(e){delete x[e];}function Ye(e){return e in x}function Je(e){Object.assign(p,e);}function ie(e,t,n,r){let o={live:new Map,const:new Map};return {target:e,config:p,write(s,i,f="live"){let c=o[f],u=c.get(s);if(u){if(u.raw===i)return;u.raw=i;}else {let y=(f==="const"?p.constPrefix:p.livePrefix)+s;c.set(s,u={raw:i,prop:y}),n.add(y);}p.typed&&G(u.prop,s,r),E.set(t,u.prop,String(i));}}}function se(e,t,n){if(!(e.scope==="element"&&e.gate!==false&&n!==p.root&&typeof IntersectionObserver<"u"))return e.start(t);let o=null,s=()=>{if(!o)try{o=e.start(t);}catch(c){console.error(`[prop-for-that] source "${e.key}" failed to start`,c);}},i=()=>{o?.(),o=null;},f=L(n,c=>{c.isIntersecting?s():i();});return ()=>{f(),i();}}function P(e,t,n){let r=n.get(t);if(!r)return;r.dispose();let{writeTarget:o}=r,s=w(o);for(let i of r.written)s.removeProperty(i),E.forget(o,i);o!==e&&I.get(o)?.delete(t),n.delete(t);}function fe(e,t){if(typeof t!="string")return t;let n=e.closest(t);return n||(console.warn(`[prop-for-that] no ancestor matches "${t}" \u2014 writing on the element itself`),e)}function ce(e,t){let n=I.get(e);n||I.set(e,n=new Set),n.has(t)&&console.warn(`[prop-for-that] "${t}" is already hoisted onto this element \u2014 the bindings will overwrite each other`,e),n.add(t);}function pe(e,t,n){let r=l.get(e);r||l.set(e,r=new Map);let o=n?fe(e,n):e,s=[];for(let i of t){if(r.has(i))continue;let f=x[i];if(!f){console.warn(`[prop-for-that] unknown source "${i}"`);continue}let c=o;c!==e&&f.scope==="global"&&(console.warn(`[prop-for-that] "to" ignored for global source "${i}"`),c=e);let u=new Set,y;try{y=se(f,ie(e,c,u,f.props),e);}catch(ee){console.error(`[prop-for-that] source "${i}" failed to start`,ee);continue}c!==e&&ce(c,i),r.set(i,{dispose:y,written:u,writeTarget:c}),s.push(i);}return ()=>{let i=l.get(e);if(i){for(let f of s)P(e,f,i);i.size===0&&l.delete(e);}}}function ue(e){return e instanceof Element?[e]:typeof NodeList<"u"&&e instanceof NodeList||typeof HTMLCollection<"u"&&e instanceof HTMLCollection||Array.isArray(e)?Array.from(e).filter(t=>t instanceof Element):[]}function le(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="string")}function Qe(e,t,n){let r,o;if(t===void 0&&le(e)?(r=p.root?[p.root]:[],o=e):(r=ue(e),o=t??[]),!r.length||!o.length)return oe;let s=r.map(i=>pe(i,o,n?.to));return ()=>{for(let i of s)i();}}function Xe(e,t){let n=l.get(e);if(n){for(let r of t??[...n.keys()])P(e,r,n);n.size===0&&l.delete(e);}}function Ze(){for(let[e,t]of l)for(let n of [...t.keys()])P(e,n,t);l.clear();}exports.configure=Je;exports.isRegistered=Ye;exports.pause=q;exports.propsFor=Qe;exports.register=Ne;exports.reset=Ze;exports.resume=$;exports.unbind=Xe;exports.unregister=Ue;return exports;})({});
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{d as configure,c as isRegistered,e as propsFor,a as register,g as reset,f as unbind,b as unregister}from'./chunk-
|
|
1
|
+
export{d as configure,c as isRegistered,e as propsFor,a as register,g as reset,f as unbind,b as unregister}from'./chunk-N3F2LRDI.js';import'./chunk-6234NJTF.js';import'./chunk-LTJ2VKVY.js';export{d as pause,e as resume}from'./chunk-KG3EF456.js';import'./chunk-T4N6AEOZ.js';import'./chunk-LWKH66VY.js';import'./chunk-7KEBMJ3O.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkKHBJUHJ6_cjs=require('./chunk-KHBJUHJ6.cjs');require('./chunk-65MXZJBD.cjs'),require('./chunk-DRXR56P5.cjs');Object.defineProperty(exports,"motion",{enumerable:true,get:function(){return chunkKHBJUHJ6_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as motion}from'./chunk-HTO57OQP.js';import'./chunk-T4N6AEOZ.js';import'./chunk-7KEBMJ3O.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk4R63TNNO_cjs=require('./chunk-4R63TNNO.cjs');require('./chunk-DRXR56P5.cjs');Object.defineProperty(exports,"online",{enumerable:true,get:function(){return chunk4R63TNNO_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as online}from'./chunk-2SIGTGQE.js';import'./chunk-7KEBMJ3O.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as orientation}from'./chunk-N745RQIX.js';import'./chunk-T4N6AEOZ.js';import'./chunk-7KEBMJ3O.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk7LN34C3P_cjs=require('./chunk-7LN34C3P.cjs');require('./chunk-65MXZJBD.cjs'),require('./chunk-DRXR56P5.cjs');Object.defineProperty(exports,"orientation",{enumerable:true,get:function(){return chunk7LN34C3P_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as pageFocused}from'./chunk-2NMXY7T4.js';import'./chunk-7KEBMJ3O.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkBF7D5A5Z_cjs=require('./chunk-BF7D5A5Z.cjs');require('./chunk-DRXR56P5.cjs');Object.defineProperty(exports,"pageFocused",{enumerable:true,get:function(){return chunkBF7D5A5Z_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkJI7NXES2_cjs=require('./chunk-JI7NXES2.cjs');Object.defineProperty(exports,"pageVisible",{enumerable:true,get:function(){return chunkJI7NXES2_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as pageVisible}from'./chunk-IFIWYBMP.js';
|
package/dist/plugins.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk3QHCKCTX_cjs=require('./chunk-3QHCKCTX.cjs'),chunkSRKAOAXW_cjs=require('./chunk-SRKAOAXW.cjs'),chunk7LN34C3P_cjs=require('./chunk-7LN34C3P.cjs'),chunkKHBJUHJ6_cjs=require('./chunk-KHBJUHJ6.cjs'),chunkUALPUR2L_cjs=require('./chunk-UALPUR2L.cjs'),chunk2H5YFW6O_cjs=require('./chunk-2H5YFW6O.cjs'),chunk2YHGSLQQ_cjs=require('./chunk-2YHGSLQQ.cjs'),chunkFKBHTKZH_cjs=require('./chunk-FKBHTKZH.cjs'),chunkHYVT6V4Z_cjs=require('./chunk-HYVT6V4Z.cjs'),chunk4C255WE6_cjs=require('./chunk-4C255WE6.cjs'),chunk675RBWFU_cjs=require('./chunk-675RBWFU.cjs'),chunkXMJ6YRQB_cjs=require('./chunk-XMJ6YRQB.cjs'),chunk63C3RCO2_cjs=require('./chunk-63C3RCO2.cjs'),chunkFZYB3P7L_cjs=require('./chunk-FZYB3P7L.cjs'),chunkIIQP3BYA_cjs=require('./chunk-IIQP3BYA.cjs'),chunkQFJ6SZ2H_cjs=require('./chunk-QFJ6SZ2H.cjs');require('./chunk-L4SCOKPV.cjs');var chunkODPCQAKC_cjs=require('./chunk-ODPCQAKC.cjs'),chunk3REDV2FZ_cjs=require('./chunk-3REDV2FZ.cjs');require('./chunk-A6JDSQWH.cjs');var chunkMGZTR3X6_cjs=require('./chunk-MGZTR3X6.cjs'),chunkK2YWGXLP_cjs=require('./chunk-K2YWGXLP.cjs'),chunkRT47EE2L_cjs=require('./chunk-RT47EE2L.cjs'),chunk7CDVAP3H_cjs=require('./chunk-7CDVAP3H.cjs'),chunk6LTQ7ISE_cjs=require('./chunk-6LTQ7ISE.cjs'),chunk2OYRAOTM_cjs=require('./chunk-2OYRAOTM.cjs'),chunkXQOUJEVE_cjs=require('./chunk-XQOUJEVE.cjs'),chunkIPYBSM34_cjs=require('./chunk-IPYBSM34.cjs'),chunk5PU4B3GP_cjs=require('./chunk-5PU4B3GP.cjs');require('./chunk-DFWBYWE3.cjs'),require('./chunk-HHINWX7L.cjs'),require('./chunk-KSKAQMWJ.cjs');var chunkRVZWUZQ2_cjs=require('./chunk-RVZWUZQ2.cjs');require('./chunk-EYDIF3NM.cjs'),require('./chunk-65MXZJBD.cjs'),require('./chunk-7L35N3N3.cjs');var chunk4R63TNNO_cjs=require('./chunk-4R63TNNO.cjs'),chunkBF7D5A5Z_cjs=require('./chunk-BF7D5A5Z.cjs');require('./chunk-DRXR56P5.cjs');var chunkJI7NXES2_cjs=require('./chunk-JI7NXES2.cjs');var z=[chunkRVZWUZQ2_cjs.a,chunk4R63TNNO_cjs.a,chunkBF7D5A5Z_cjs.a,chunkJI7NXES2_cjs.a,chunkMGZTR3X6_cjs.a,chunkK2YWGXLP_cjs.a,chunkRT47EE2L_cjs.b,chunk7CDVAP3H_cjs.a,chunk6LTQ7ISE_cjs.a,chunk2OYRAOTM_cjs.a,chunkXQOUJEVE_cjs.a,chunkIPYBSM34_cjs.a,chunk675RBWFU_cjs.a,chunkXMJ6YRQB_cjs.a,chunk63C3RCO2_cjs.a,chunkFZYB3P7L_cjs.a,chunkIIQP3BYA_cjs.a,chunkQFJ6SZ2H_cjs.a,chunkODPCQAKC_cjs.a,chunk3REDV2FZ_cjs.a,chunk7LN34C3P_cjs.a,chunkKHBJUHJ6_cjs.a,chunkUALPUR2L_cjs.a,chunk2H5YFW6O_cjs.a,chunk2YHGSLQQ_cjs.a,chunkFKBHTKZH_cjs.a,chunkHYVT6V4Z_cjs.a,chunk4C255WE6_cjs.a,chunk3QHCKCTX_cjs.a,chunkSRKAOAXW_cjs.a];function ao(...o){for(let q of o.length?o:z)chunk5PU4B3GP_cjs.a(q);}Object.defineProperty(exports,"ua",{enumerable:true,get:function(){return chunk3QHCKCTX_cjs.a}});Object.defineProperty(exports,"random",{enumerable:true,get:function(){return chunkSRKAOAXW_cjs.a}});Object.defineProperty(exports,"orientation",{enumerable:true,get:function(){return chunk7LN34C3P_cjs.a}});Object.defineProperty(exports,"motion",{enumerable:true,get:function(){return chunkKHBJUHJ6_cjs.a}});Object.defineProperty(exports,"geo",{enumerable:true,get:function(){return chunkUALPUR2L_cjs.a}});Object.defineProperty(exports,"cpuPressure",{enumerable:true,get:function(){return chunk2H5YFW6O_cjs.a}});Object.defineProperty(exports,"img",{enumerable:true,get:function(){return chunk2YHGSLQQ_cjs.a}});Object.defineProperty(exports,"imgColor",{enumerable:true,get:function(){return chunkFKBHTKZH_cjs.a}});Object.defineProperty(exports,"videoColor",{enumerable:true,get:function(){return chunkHYVT6V4Z_cjs.a}});Object.defineProperty(exports,"truncated",{enumerable:true,get:function(){return chunk4C255WE6_cjs.a}});Object.defineProperty(exports,"pointer",{enumerable:true,get:function(){return chunk675RBWFU_cjs.a}});Object.defineProperty(exports,"pointerLocal",{enumerable:true,get:function(){return chunkXMJ6YRQB_cjs.a}});Object.defineProperty(exports,"media",{enumerable:true,get:function(){return chunk63C3RCO2_cjs.a}});Object.defineProperty(exports,"field",{enumerable:true,get:function(){return chunkFZYB3P7L_cjs.a}});Object.defineProperty(exports,"fieldState",{enumerable:true,get:function(){return chunkIIQP3BYA_cjs.a}});Object.defineProperty(exports,"formState",{enumerable:true,get:function(){return chunkQFJ6SZ2H_cjs.a}});Object.defineProperty(exports,"select",{enumerable:true,get:function(){return chunkODPCQAKC_cjs.a}});Object.defineProperty(exports,"colorInput",{enumerable:true,get:function(){return chunk3REDV2FZ_cjs.a}});Object.defineProperty(exports,"navType",{enumerable:true,get:function(){return chunkMGZTR3X6_cjs.a}});Object.defineProperty(exports,"meta",{enumerable:true,get:function(){return chunkK2YWGXLP_cjs.a}});Object.defineProperty(exports,"network",{enumerable:true,get:function(){return chunkRT47EE2L_cjs.b}});Object.defineProperty(exports,"battery",{enumerable:true,get:function(){return chunk7CDVAP3H_cjs.a}});Object.defineProperty(exports,"clock",{enumerable:true,get:function(){return chunk6LTQ7ISE_cjs.a}});Object.defineProperty(exports,"fps",{enumerable:true,get:function(){return chunk2OYRAOTM_cjs.a}});Object.defineProperty(exports,"visualViewport",{enumerable:true,get:function(){return chunkXQOUJEVE_cjs.a}});Object.defineProperty(exports,"keyboard",{enumerable:true,get:function(){return chunkIPYBSM34_cjs.a}});Object.defineProperty(exports,"scrollVelocity",{enumerable:true,get:function(){return chunkRVZWUZQ2_cjs.a}});Object.defineProperty(exports,"online",{enumerable:true,get:function(){return chunk4R63TNNO_cjs.a}});Object.defineProperty(exports,"pageFocused",{enumerable:true,get:function(){return chunkBF7D5A5Z_cjs.a}});Object.defineProperty(exports,"pageVisible",{enumerable:true,get:function(){return chunkJI7NXES2_cjs.a}});exports.allPlugins=z;exports.registerPlugins=ao;
|
package/dist/plugins.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as Source } from './types-
|
|
1
|
+
import { S as Source } from './types-CyGIcLOq.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* `--live-scroll-velocity` (signed px/frame, decays toward 0 when idle),
|
|
@@ -367,6 +367,68 @@ declare const videoColor: Source;
|
|
|
367
367
|
*/
|
|
368
368
|
declare const truncated: Source;
|
|
369
369
|
|
|
370
|
+
/**
|
|
371
|
+
* `--const-ua-*` — low-entropy device & browser identity JS can read but CSS
|
|
372
|
+
* can't, written **once** as strings/numbers on the `const` cadence:
|
|
373
|
+
*
|
|
374
|
+
* - `--const-ua-platform` — `macos` / `windows` / `linux` / `android` / `ios` /
|
|
375
|
+
* `chromeos` / `unknown`
|
|
376
|
+
* - `--const-ua-browser` — `chrome` / `edge` / `firefox` / `safari` / `opera` /
|
|
377
|
+
* `samsung` / `unknown`
|
|
378
|
+
* - `--const-ua-engine` — `blink` / `gecko` / `webkit` / `unknown`
|
|
379
|
+
* - `--const-ua-version` — the browser's major version (number, `0` if unknown)
|
|
380
|
+
* - `--const-ua-mobile` — `1` on a phone-class device, else `0`
|
|
381
|
+
*
|
|
382
|
+
* so CSS can branch on the client without JS or a media query —
|
|
383
|
+
* `@container style(--const-ua-engine: webkit) { … }`,
|
|
384
|
+
* `@container style(--const-ua-platform: ios) { … }` — or gate on the version
|
|
385
|
+
* with `calc(var(--const-ua-version))`.
|
|
386
|
+
*
|
|
387
|
+
* Prefers structured UA Client Hints (`navigator.userAgentData`, Chromium) and
|
|
388
|
+
* falls back to a minimal (best-effort) `userAgent`-string sniff on Firefox /
|
|
389
|
+
* Safari. **Low-entropy only** — no high-entropy hints, device model, or full
|
|
390
|
+
* version, so it adds no fingerprinting surface beyond the request headers.
|
|
391
|
+
*
|
|
392
|
+
* Typed (`configure({ typed: true })`) registers the strings as `<custom-ident>`
|
|
393
|
+
* and the numbers as `<integer>` so they survive `@property`. Rides the writer,
|
|
394
|
+
* so it lands the frame *after* bind; the same constants are available before
|
|
395
|
+
* first paint via the `head` entry (`import 'prop-for-that/head'`). Global source
|
|
396
|
+
* — bind once.
|
|
397
|
+
*/
|
|
398
|
+
declare const ua: Source;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Per-element randomness — the one value CSS genuinely can't produce for itself
|
|
402
|
+
* (until `random()` ships everywhere). Bind it to N elements and each gets its
|
|
403
|
+
* own rolls, written **once** on the `const` cadence:
|
|
404
|
+
*
|
|
405
|
+
* - `--const-random` — a float in `[0, 1)`
|
|
406
|
+
* - `--const-random-2`, `--const-random-3` — two more, independent of the first
|
|
407
|
+
*
|
|
408
|
+
* Three, because organic variation usually needs more than one axis (delay *and*
|
|
409
|
+
* rotation *and* scale) and CSS can't derive a second independent random from the
|
|
410
|
+
* first. Everything else *is* derivable, so it isn't shipped: an angle is
|
|
411
|
+
* `calc(var(--const-random) * 360deg)`, a coin flip
|
|
412
|
+
* `calc(sign(var(--const-random) - 0.5))`, a range
|
|
413
|
+
* `calc(A + (B - A) * var(--const-random))`, a bucket
|
|
414
|
+
* `round(down, calc(var(--const-random) * 5), 1)`.
|
|
415
|
+
*
|
|
416
|
+
* Stagger a grid without `:nth-child()` rules, jitter a scatter layout, vary a
|
|
417
|
+
* shimmer's duration per card — one binding, no per-element JS.
|
|
418
|
+
*
|
|
419
|
+
* **Never re-rolled.** It writes on the `const` cadence and sets `gate: false`,
|
|
420
|
+
* so — unlike a gated element source, whose `start` re-runs on every viewport
|
|
421
|
+
* re-entry — scrolling out of view and back can't hand an element a new value
|
|
422
|
+
* mid-animation.
|
|
423
|
+
*
|
|
424
|
+
* **Seeded (deterministic) mode:** `configure({ randomSeed: 42 })` derives every
|
|
425
|
+
* roll from the seed plus the element's position in the DOM, so the same markup
|
|
426
|
+
* renders the same "random" layout on every load, and a rebind hands an element
|
|
427
|
+
* the values it had before. Reordering the tree reshuffles it. Unseeded (the
|
|
428
|
+
* default) rolls come from `Math.random()`.
|
|
429
|
+
*/
|
|
430
|
+
declare const random: Source;
|
|
431
|
+
|
|
370
432
|
/** Every plugin source, for `registerPlugins()` / bulk registration. */
|
|
371
433
|
declare const allPlugins: Source[];
|
|
372
434
|
/**
|
|
@@ -379,4 +441,4 @@ declare const allPlugins: Source[];
|
|
|
379
441
|
*/
|
|
380
442
|
declare function registerPlugins(...sources: Source[]): void;
|
|
381
443
|
|
|
382
|
-
export { allPlugins, battery, clock, colorInput, cpuPressure, field, fieldState, formState, fps, geo, img, imgColor, keyboard, media, meta, motion, navType, network, online, orientation, pageFocused, pageVisible, pointer, pointerLocal, registerPlugins, scrollVelocity, select, truncated, videoColor, visualViewport };
|
|
444
|
+
export { allPlugins, battery, clock, colorInput, cpuPressure, field, fieldState, formState, fps, geo, img, imgColor, keyboard, media, meta, motion, navType, network, online, orientation, pageFocused, pageVisible, pointer, pointerLocal, random, registerPlugins, scrollVelocity, select, truncated, ua, videoColor, visualViewport };
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as Source } from './types-
|
|
1
|
+
import { S as Source } from './types-CyGIcLOq.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* `--live-scroll-velocity` (signed px/frame, decays toward 0 when idle),
|
|
@@ -367,6 +367,68 @@ declare const videoColor: Source;
|
|
|
367
367
|
*/
|
|
368
368
|
declare const truncated: Source;
|
|
369
369
|
|
|
370
|
+
/**
|
|
371
|
+
* `--const-ua-*` — low-entropy device & browser identity JS can read but CSS
|
|
372
|
+
* can't, written **once** as strings/numbers on the `const` cadence:
|
|
373
|
+
*
|
|
374
|
+
* - `--const-ua-platform` — `macos` / `windows` / `linux` / `android` / `ios` /
|
|
375
|
+
* `chromeos` / `unknown`
|
|
376
|
+
* - `--const-ua-browser` — `chrome` / `edge` / `firefox` / `safari` / `opera` /
|
|
377
|
+
* `samsung` / `unknown`
|
|
378
|
+
* - `--const-ua-engine` — `blink` / `gecko` / `webkit` / `unknown`
|
|
379
|
+
* - `--const-ua-version` — the browser's major version (number, `0` if unknown)
|
|
380
|
+
* - `--const-ua-mobile` — `1` on a phone-class device, else `0`
|
|
381
|
+
*
|
|
382
|
+
* so CSS can branch on the client without JS or a media query —
|
|
383
|
+
* `@container style(--const-ua-engine: webkit) { … }`,
|
|
384
|
+
* `@container style(--const-ua-platform: ios) { … }` — or gate on the version
|
|
385
|
+
* with `calc(var(--const-ua-version))`.
|
|
386
|
+
*
|
|
387
|
+
* Prefers structured UA Client Hints (`navigator.userAgentData`, Chromium) and
|
|
388
|
+
* falls back to a minimal (best-effort) `userAgent`-string sniff on Firefox /
|
|
389
|
+
* Safari. **Low-entropy only** — no high-entropy hints, device model, or full
|
|
390
|
+
* version, so it adds no fingerprinting surface beyond the request headers.
|
|
391
|
+
*
|
|
392
|
+
* Typed (`configure({ typed: true })`) registers the strings as `<custom-ident>`
|
|
393
|
+
* and the numbers as `<integer>` so they survive `@property`. Rides the writer,
|
|
394
|
+
* so it lands the frame *after* bind; the same constants are available before
|
|
395
|
+
* first paint via the `head` entry (`import 'prop-for-that/head'`). Global source
|
|
396
|
+
* — bind once.
|
|
397
|
+
*/
|
|
398
|
+
declare const ua: Source;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Per-element randomness — the one value CSS genuinely can't produce for itself
|
|
402
|
+
* (until `random()` ships everywhere). Bind it to N elements and each gets its
|
|
403
|
+
* own rolls, written **once** on the `const` cadence:
|
|
404
|
+
*
|
|
405
|
+
* - `--const-random` — a float in `[0, 1)`
|
|
406
|
+
* - `--const-random-2`, `--const-random-3` — two more, independent of the first
|
|
407
|
+
*
|
|
408
|
+
* Three, because organic variation usually needs more than one axis (delay *and*
|
|
409
|
+
* rotation *and* scale) and CSS can't derive a second independent random from the
|
|
410
|
+
* first. Everything else *is* derivable, so it isn't shipped: an angle is
|
|
411
|
+
* `calc(var(--const-random) * 360deg)`, a coin flip
|
|
412
|
+
* `calc(sign(var(--const-random) - 0.5))`, a range
|
|
413
|
+
* `calc(A + (B - A) * var(--const-random))`, a bucket
|
|
414
|
+
* `round(down, calc(var(--const-random) * 5), 1)`.
|
|
415
|
+
*
|
|
416
|
+
* Stagger a grid without `:nth-child()` rules, jitter a scatter layout, vary a
|
|
417
|
+
* shimmer's duration per card — one binding, no per-element JS.
|
|
418
|
+
*
|
|
419
|
+
* **Never re-rolled.** It writes on the `const` cadence and sets `gate: false`,
|
|
420
|
+
* so — unlike a gated element source, whose `start` re-runs on every viewport
|
|
421
|
+
* re-entry — scrolling out of view and back can't hand an element a new value
|
|
422
|
+
* mid-animation.
|
|
423
|
+
*
|
|
424
|
+
* **Seeded (deterministic) mode:** `configure({ randomSeed: 42 })` derives every
|
|
425
|
+
* roll from the seed plus the element's position in the DOM, so the same markup
|
|
426
|
+
* renders the same "random" layout on every load, and a rebind hands an element
|
|
427
|
+
* the values it had before. Reordering the tree reshuffles it. Unseeded (the
|
|
428
|
+
* default) rolls come from `Math.random()`.
|
|
429
|
+
*/
|
|
430
|
+
declare const random: Source;
|
|
431
|
+
|
|
370
432
|
/** Every plugin source, for `registerPlugins()` / bulk registration. */
|
|
371
433
|
declare const allPlugins: Source[];
|
|
372
434
|
/**
|
|
@@ -379,4 +441,4 @@ declare const allPlugins: Source[];
|
|
|
379
441
|
*/
|
|
380
442
|
declare function registerPlugins(...sources: Source[]): void;
|
|
381
443
|
|
|
382
|
-
export { allPlugins, battery, clock, colorInput, cpuPressure, field, fieldState, formState, fps, geo, img, imgColor, keyboard, media, meta, motion, navType, network, online, orientation, pageFocused, pageVisible, pointer, pointerLocal, registerPlugins, scrollVelocity, select, truncated, videoColor, visualViewport };
|
|
444
|
+
export { allPlugins, battery, clock, colorInput, cpuPressure, field, fieldState, formState, fps, geo, img, imgColor, keyboard, media, meta, motion, navType, network, online, orientation, pageFocused, pageVisible, pointer, pointerLocal, random, registerPlugins, scrollVelocity, select, truncated, ua, videoColor, visualViewport };
|
package/dist/plugins.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$j}from'./chunk-
|
|
1
|
+
import {a as a$r}from'./chunk-5VXDAWUI.js';export{a as ua}from'./chunk-5VXDAWUI.js';import {a as a$s}from'./chunk-HFE2X32G.js';export{a as random}from'./chunk-HFE2X32G.js';import {a as a$j}from'./chunk-N745RQIX.js';export{a as orientation}from'./chunk-N745RQIX.js';import {a as a$k}from'./chunk-HTO57OQP.js';export{a as motion}from'./chunk-HTO57OQP.js';import {a as a$l}from'./chunk-FOHEZJHF.js';export{a as geo}from'./chunk-FOHEZJHF.js';import {a as a$m}from'./chunk-5JZBLUQK.js';export{a as cpuPressure}from'./chunk-5JZBLUQK.js';import {a as a$n}from'./chunk-YARRV66T.js';export{a as img}from'./chunk-YARRV66T.js';import {a as a$o}from'./chunk-A7GWTDM7.js';export{a as imgColor}from'./chunk-A7GWTDM7.js';import {a as a$p}from'./chunk-ZQTU5EW7.js';export{a as videoColor}from'./chunk-ZQTU5EW7.js';import {a as a$q}from'./chunk-KDIZYBPJ.js';export{a as truncated}from'./chunk-KDIZYBPJ.js';import {a as a$b}from'./chunk-6M2UIJI5.js';export{a as pointer}from'./chunk-6M2UIJI5.js';import {a as a$c}from'./chunk-TL5BJFFL.js';export{a as pointerLocal}from'./chunk-TL5BJFFL.js';import {a as a$d}from'./chunk-UHGW7AXC.js';export{a as media}from'./chunk-UHGW7AXC.js';import {a as a$e}from'./chunk-COGNT6R5.js';export{a as field}from'./chunk-COGNT6R5.js';import {a as a$f}from'./chunk-BTKSOVH3.js';export{a as fieldState}from'./chunk-BTKSOVH3.js';import {a as a$g}from'./chunk-LBK3257B.js';export{a as formState}from'./chunk-LBK3257B.js';import'./chunk-QIUPJ6MF.js';import {a as a$h}from'./chunk-M65LNJXV.js';export{a as select}from'./chunk-M65LNJXV.js';import {a as a$i}from'./chunk-QTM2FDUV.js';export{a as colorInput}from'./chunk-QTM2FDUV.js';import'./chunk-A2ETARW3.js';import {a as a$4}from'./chunk-H7X35UB4.js';export{a as navType}from'./chunk-H7X35UB4.js';import {a as a$5}from'./chunk-TEPMM5DH.js';export{a as meta}from'./chunk-TEPMM5DH.js';import {b}from'./chunk-JB72QLD6.js';export{b as network}from'./chunk-JB72QLD6.js';import {a as a$6}from'./chunk-DQJQEWPS.js';export{a as battery}from'./chunk-DQJQEWPS.js';import {a as a$7}from'./chunk-7U544OAJ.js';export{a as clock}from'./chunk-7U544OAJ.js';import {a as a$8}from'./chunk-M7FMWTDF.js';export{a as fps}from'./chunk-M7FMWTDF.js';import {a as a$9}from'./chunk-F5H2O3AR.js';export{a as visualViewport}from'./chunk-F5H2O3AR.js';import {a as a$a}from'./chunk-IVUTABRM.js';export{a as keyboard}from'./chunk-IVUTABRM.js';import {a as a$t}from'./chunk-N3F2LRDI.js';import'./chunk-6234NJTF.js';import'./chunk-LTJ2VKVY.js';import'./chunk-EXPE3C6O.js';import {a}from'./chunk-PS7KTHW4.js';export{a as scrollVelocity}from'./chunk-PS7KTHW4.js';import'./chunk-KG3EF456.js';import'./chunk-T4N6AEOZ.js';import'./chunk-LWKH66VY.js';import {a as a$1}from'./chunk-2SIGTGQE.js';export{a as online}from'./chunk-2SIGTGQE.js';import {a as a$2}from'./chunk-2NMXY7T4.js';export{a as pageFocused}from'./chunk-2NMXY7T4.js';import'./chunk-7KEBMJ3O.js';import {a as a$3}from'./chunk-IFIWYBMP.js';export{a as pageVisible}from'./chunk-IFIWYBMP.js';var z=[a,a$1,a$2,a$3,a$4,a$5,b,a$6,a$7,a$8,a$9,a$a,a$b,a$c,a$d,a$e,a$f,a$g,a$h,a$i,a$j,a$k,a$l,a$m,a$n,a$o,a$p,a$q,a$r,a$s];function ao(...o){for(let q of o.length?o:z)a$t(q);}export{z as allPlugins,ao as registerPlugins};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk675RBWFU_cjs=require('./chunk-675RBWFU.cjs');require('./chunk-65MXZJBD.cjs'),require('./chunk-DRXR56P5.cjs');Object.defineProperty(exports,"pointer",{enumerable:true,get:function(){return chunk675RBWFU_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as pointer}from'./chunk-6M2UIJI5.js';import'./chunk-T4N6AEOZ.js';import'./chunk-7KEBMJ3O.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as pointerLocal}from'./chunk-TL5BJFFL.js';import'./chunk-T4N6AEOZ.js';import'./chunk-7KEBMJ3O.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkXMJ6YRQB_cjs=require('./chunk-XMJ6YRQB.cjs');require('./chunk-65MXZJBD.cjs'),require('./chunk-DRXR56P5.cjs');Object.defineProperty(exports,"pointerLocal",{enumerable:true,get:function(){return chunkXMJ6YRQB_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkSRKAOAXW_cjs=require('./chunk-SRKAOAXW.cjs');require('./chunk-65MXZJBD.cjs');Object.defineProperty(exports,"random",{enumerable:true,get:function(){return chunkSRKAOAXW_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as random}from'./chunk-HFE2X32G.js';import'./chunk-T4N6AEOZ.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkRVZWUZQ2_cjs=require('./chunk-RVZWUZQ2.cjs');require('./chunk-EYDIF3NM.cjs'),require('./chunk-65MXZJBD.cjs'),require('./chunk-7L35N3N3.cjs'),require('./chunk-DRXR56P5.cjs');Object.defineProperty(exports,"scrollVelocity",{enumerable:true,get:function(){return chunkRVZWUZQ2_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as scrollVelocity}from'./chunk-PS7KTHW4.js';import'./chunk-KG3EF456.js';import'./chunk-T4N6AEOZ.js';import'./chunk-LWKH66VY.js';import'./chunk-7KEBMJ3O.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk4C255WE6_cjs=require('./chunk-4C255WE6.cjs');require('./chunk-DFWBYWE3.cjs');Object.defineProperty(exports,"truncated",{enumerable:true,get:function(){return chunk4C255WE6_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as truncated}from'./chunk-KDIZYBPJ.js';import'./chunk-6234NJTF.js';
|
|
@@ -31,6 +31,14 @@ interface Config {
|
|
|
31
31
|
* `fps`/`scroll-velocity` measure at this rate too.
|
|
32
32
|
*/
|
|
33
33
|
liveHz?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Seed for the `random` plugin. When set, each element's rolls are derived from
|
|
36
|
+
* this seed plus the element's position in the DOM instead of `Math.random()`,
|
|
37
|
+
* so the same markup renders the same "random" layout on every load — and a
|
|
38
|
+
* rebind hands an element the values it had before. Unset (the default) means
|
|
39
|
+
* genuinely random per load. Any integer works; `0` is a valid seed.
|
|
40
|
+
*/
|
|
41
|
+
randomSeed?: number;
|
|
34
42
|
}
|
|
35
43
|
/** Optional `@property` typing for a source's local name, used when `typed` is on. */
|
|
36
44
|
interface PropSpec {
|
|
@@ -31,6 +31,14 @@ interface Config {
|
|
|
31
31
|
* `fps`/`scroll-velocity` measure at this rate too.
|
|
32
32
|
*/
|
|
33
33
|
liveHz?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Seed for the `random` plugin. When set, each element's rolls are derived from
|
|
36
|
+
* this seed plus the element's position in the DOM instead of `Math.random()`,
|
|
37
|
+
* so the same markup renders the same "random" layout on every load — and a
|
|
38
|
+
* rebind hands an element the values it had before. Unset (the default) means
|
|
39
|
+
* genuinely random per load. Any integer works; `0` is a valid seed.
|
|
40
|
+
*/
|
|
41
|
+
randomSeed?: number;
|
|
34
42
|
}
|
|
35
43
|
/** Optional `@property` typing for a source's local name, used when `typed` is on. */
|
|
36
44
|
interface PropSpec {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk3QHCKCTX_cjs=require('./chunk-3QHCKCTX.cjs');require('./chunk-KSKAQMWJ.cjs');Object.defineProperty(exports,"ua",{enumerable:true,get:function(){return chunk3QHCKCTX_cjs.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as ua}from'./chunk-5VXDAWUI.js';import'./chunk-EXPE3C6O.js';
|
package/llms.txt
CHANGED
|
@@ -13,7 +13,7 @@ when a value actually changed. Zero runtime dependencies, tree-shakeable, TypeSc
|
|
|
13
13
|
## Entry points
|
|
14
14
|
|
|
15
15
|
- `prop-for-that`: the core API (`configure`, `register`, `unregister`, `propsFor`, `unbind`, `reset`).
|
|
16
|
-
- `prop-for-that/auto`: side-effecting and fully declarative. Attaches **nothing** by default — it scans the DOM for `[data-props-for="key1 key2"]` and binds exactly those sources (globals included, declared on `<html data-props-for="viewport pointer">` → writes to `:root`), watching the DOM with a `MutationObserver`. Plugin sources are **loaded on demand**: the first time a key needs one, its chunk is dynamically imported and registered, then the binding attaches (no `registerPlugins()`, no separate plugins import). Because it lazy-loads via dynamic `import()`, use it as a module — `<script type="module" src=".../auto.js">` (a classic CDN drop-in `auto.global.js` no longer exists). If the root `<html>` has the boolean attribute `data-props-typed`, it calls `configure({ typed: true })` first (markup equivalent; read once on load; global, no per-key subset). Two limits: it only sees the **light DOM** (a `MutationObserver` doesn't cross shadow roots, so `data-props-for` inside a web component's shadow root is never auto-bound — bind those imperatively with `propsFor(el, [...])`); and on-demand plugin chunks resolve only on CDNs that serve the `dist` tree verbatim (unpkg / jsDelivr file paths), not rewriting/bundling CDNs (esm.sh, `?module`, jsDelivr `+esm`).
|
|
16
|
+
- `prop-for-that/auto`: side-effecting and fully declarative. Attaches **nothing** by default — it scans the DOM for `[data-props-for="key1 key2"]` and binds exactly those sources (globals included, declared on `<html data-props-for="viewport pointer">` → writes to `:root`), watching the DOM with a `MutationObserver`. An element can add `data-props-to="<selector>"` to write its properties on the nearest matching **ancestor** instead (the element is still what's observed) — editing that attribute rebinds every key on the element against the new target. Plugin sources are **loaded on demand**: the first time a key needs one, its chunk is dynamically imported and registered, then the binding attaches (no `registerPlugins()`, no separate plugins import). Because it lazy-loads via dynamic `import()`, use it as a module — `<script type="module" src=".../auto.js">` (a classic CDN drop-in `auto.global.js` no longer exists). If the root `<html>` has the boolean attribute `data-props-typed`, it calls `configure({ typed: true })` first (markup equivalent; read once on load; global, no per-key subset). Likewise `<html data-props-seed="42">` calls `configure({ randomSeed: 42 })` first (markup equivalent, seeds the `random` plugin; read once on load; a non-numeric value is ignored with a warning). Two limits: it only sees the **light DOM** (a `MutationObserver` doesn't cross shadow roots, so `data-props-for` inside a web component's shadow root is never auto-bound — bind those imperatively with `propsFor(el, [...])`); and on-demand plugin chunks resolve only on CDNs that serve the `dist` tree verbatim (unpkg / jsDelivr file paths), not rewriting/bundling CDNs (esm.sh, `?module`, jsDelivr `+esm`).
|
|
17
17
|
- `prop-for-that/head`: side-effecting. Synchronously writes FOUC-safe constants before first paint. Inline it in `<head>`.
|
|
18
18
|
- `prop-for-that/plugins`: opt-in plugin sources, plus `registerPlugins` and `allPlugins`.
|
|
19
19
|
|
|
@@ -43,7 +43,7 @@ register(source: Source): void // add a custom/plugin source by key
|
|
|
43
43
|
unregister(key: SourceKey): void // remove a source from the registry
|
|
44
44
|
isRegistered(key: SourceKey): boolean // whether a source key is currently registered
|
|
45
45
|
propsFor(keys: string[]): Disposer // global: attach sources to config.root (:root)
|
|
46
|
-
propsFor(target: Element | NodeList | Element[], keys: string[]): Disposer // per element(s)
|
|
46
|
+
propsFor(target: Element | NodeList | Element[], keys: string[], opts?: PropsForOptions): Disposer // per element(s)
|
|
47
47
|
unbind(target: HTMLElement, keys?: string[]): void // detach some/all
|
|
48
48
|
reset(): void // tear down every binding + shared observers/listeners
|
|
49
49
|
pause(): void // freeze the loop (no sampling/flushing); idempotent
|
|
@@ -52,10 +52,19 @@ resume(): void // unfreeze; flushes anything queued wh
|
|
|
52
52
|
// propsFor is global unless the first arg is a Node, NodeList, or array of elements.
|
|
53
53
|
// Its disposer tears down only what that call started and removes the properties it wrote.
|
|
54
54
|
|
|
55
|
-
interface
|
|
55
|
+
interface PropsForOptions { to?: Element | string }
|
|
56
|
+
// `to` hoists the WRITES to an ancestor (selector → el.closest(), or an explicit element)
|
|
57
|
+
// while still OBSERVING the bound element — the fix for "custom properties inherit
|
|
58
|
+
// downward only, and @container style() matches an ancestor". Markup form: data-props-to.
|
|
59
|
+
// No closest() match → warns, falls back to the element itself. `to` + a global source →
|
|
60
|
+
// warns, ignored. One binding per key per hoist target (duplicates warn and fight).
|
|
61
|
+
|
|
62
|
+
interface Config { livePrefix: string; constPrefix: string; root: HTMLElement; typed: boolean; defaults?: Record<string, string|number>; liveHz?: number; randomSeed?: number }
|
|
56
63
|
// defaults: livePrefix '--live-', constPrefix '--const-', root document.documentElement, typed false, liveHz unset (every frame)
|
|
57
64
|
// config.defaults are typed @property initial values, keyed by a source's local name
|
|
58
65
|
// liveHz caps loop sampling+flushing rate (e.g. 30); fewer writes = less style recalc + calmer DevTools
|
|
66
|
+
// randomSeed makes the `random` plugin deterministic (rolls derive from seed + the element's DOM position); read when a source starts
|
|
67
|
+
// randomSeed markup equivalent under auto: <html data-props-seed="42">
|
|
59
68
|
|
|
60
69
|
interface Source {
|
|
61
70
|
key: SourceKey
|
|
@@ -106,6 +115,11 @@ prefix; constants use `--const-`. Values are unitless numbers unless noted.
|
|
|
106
115
|
| `--const-dpr` | `devicePixelRatio` |
|
|
107
116
|
| `--const-cores` | `navigator.hardwareConcurrency` |
|
|
108
117
|
| `--const-mem` | `navigator.deviceMemory` in GiB (Chromium-only, coarse; `0` elsewhere) |
|
|
118
|
+
| `--const-ua-platform` | low-entropy OS: `macos` / `windows` / `linux` / `android` / `ios` / `chromeos` / `unknown` |
|
|
119
|
+
| `--const-ua-browser` | `chrome` / `edge` / `firefox` / `safari` / `opera` / `samsung` / `unknown` |
|
|
120
|
+
| `--const-ua-engine` | `blink` / `gecko` / `webkit` / `unknown` |
|
|
121
|
+
| `--const-ua-version` | browser major version (number, `0` if unknown) |
|
|
122
|
+
| `--const-ua-mobile` | `1` on a phone-class device, else `0` |
|
|
109
123
|
|
|
110
124
|
### Plugins (`prop-for-that/plugins`)
|
|
111
125
|
|
|
@@ -120,6 +134,7 @@ Import name is camelCase; the key for `propsFor`/`data-props-for` is the dashed
|
|
|
120
134
|
| `pageVisible` | `page-visible` | global | `--live-page-visible` (1/0 — tab foreground vs hidden/backgrounded; `document.visibilityState`. A visible tab can still be unfocused) |
|
|
121
135
|
| `navType` | `nav-type` | global | `--const-nav-type` (write-once string — how the user arrived: `navigate` / `reload` / `back_forward` / `prerender`, from `performance.getEntriesByType('navigation')[0].type`. Pairs with `@container style(--const-nav-type: reload)`) |
|
|
122
136
|
| `meta` | `meta` | global | every `<meta name\|property + content>` as a write-once `--const-meta-<slug>` (slug = lowercased name, non-alphanumerics → `-`): e.g. `--const-meta-theme-color`, `--const-meta-og-image`, `--const-meta-color-scheme`. First match wins; a `media`-conditional meta is skipped when it doesn't match, so the active `theme-color` variant lands. Read once at bind (const) |
|
|
137
|
+
| `ua` | `ua` | global | low-entropy device/browser identity, write-once: `--const-ua-platform` (macos/windows/linux/android/ios/chromeos/unknown), `--const-ua-browser` (chrome/edge/firefox/safari/opera/samsung/unknown), `--const-ua-engine` (blink/gecko/webkit/unknown), `--const-ua-version` (browser major, 0 if unknown), `--const-ua-mobile` (1/0). Prefers UA Client Hints (`navigator.userAgentData`, Chromium), falls back to a best-effort userAgent sniff (Firefox/Safari). Low-entropy only — no fingerprinting surface beyond request headers. Also written pre-paint by the `head` entry |
|
|
123
138
|
| `network` | `network` | global | `--live-net-downlink`, `--live-net-rtt`, `--live-net-save-data` (1/0), `--live-net-type` (slow-2g=1…4g=4, else 0) |
|
|
124
139
|
| `battery` | `battery` | global | `--live-battery-level` (0–1), `--live-battery-charging` (1/0) |
|
|
125
140
|
| `clock` | `clock` | global | `--live-now` (epoch seconds), `--live-hours`, `--live-minutes`, `--live-seconds` |
|
|
@@ -141,6 +156,7 @@ Import name is camelCase; the key for `propsFor`/`data-props-for` is the dashed
|
|
|
141
156
|
| `imgColor` | `img-color` | element | a palette from an `<img>`, all from one 16×16 bucketing pass (createImageBitmap+OffscreenCanvas). Each swatch is a single sRGB hex colour (no channel props — use relative colour syntax / color-mix to extract): `--live-img` (dominant), `--live-img-accent` (most vibrant), `--live-img-dark` (darkest non-black), `--live-img-light` (lightest non-white), `--live-img-avg` (mean). Plus `--live-img-temp` (−1 cool…+1 warm). Accent reuses the dominant for grayscale. Cross-origin needs `crossorigin` + CORS, else no-ops. Bind the `<img>` or a container. |
|
|
142
157
|
| `videoColor` | `video-color` | element | live colours of a playing `<video>`, each a single sRGB hex colour: `--live-video` (dominant) + `--live-video-accent` (most vibrant; reuses the dominant for a grayscale frame). Both from one 16×16 read on `requestVideoFrameCallback` (stops when paused/offscreen/backgrounded), throttled to ~4 Hz; seeds a paused/poster frame; falls back to `timeupdate`. Cross-origin needs `crossorigin` + CORS, else no-ops. Bind the `<video>` or a container. |
|
|
143
158
|
| `truncated` | `truncated` | element | whether the element's own text is clipped right now — the "is the ellipsis showing?" CSS can ask a scroll container but not overflowing text (all 1/0): `--live-truncated` (either axis), `--live-truncated-x` (inline clip, `scrollWidth > clientWidth` — the `text-overflow: ellipsis` case), `--live-truncated-y` (block clip, `scrollHeight > clientHeight` — `-webkit-line-clamp` / fixed-height box). Drives `@container style(--live-truncated: 1)` to reveal a "more"/tooltip/expand affordance only while text is cut off. Recomputed on resize (shared `ResizeObserver`), flips both ways as layout reflows. Bind the element whose overflow you care about. |
|
|
159
|
+
| `random` | `random` | element | three independent random rolls per bound element, each a float in [0,1), written once: `--const-random`, `--const-random-2`, `--const-random-3`. One CSS rule varies every element (size / tint / animation-delay phase) with no `:nth-child()` ladder. Angles, ranges, buckets, coin flips are derivable in calc() so they aren't shipped. Never re-rolled: `const` cadence + `gate: false` (gating would re-roll on every viewport re-entry). `configure({ randomSeed: 42 })` → deterministic, derived from the seed + the element's DOM position, so the same markup renders the same scatter every load (SSR/screenshot diffing); rebinding returns the same values; reordering the tree reshuffles. Native CSS `random()` is the eventual replacement. |
|
|
144
160
|
|
|
145
161
|
## Recipes
|
|
146
162
|
|
|
@@ -177,6 +193,19 @@ Container-bound range (so siblings can read the value):
|
|
|
177
193
|
propsFor(document.querySelector('.meter'), ['range'])
|
|
178
194
|
```
|
|
179
195
|
|
|
196
|
+
Hoisting to an ancestor (the general form — works for every element source):
|
|
197
|
+
|
|
198
|
+
```html
|
|
199
|
+
<figure>
|
|
200
|
+
<img data-props-for="img size" data-props-to="figure" src="art.jpg">
|
|
201
|
+
<figcaption>…</figcaption> <!-- reads --live-loaded, and can style-query it -->
|
|
202
|
+
</figure>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
```js
|
|
206
|
+
propsFor(img, ['img', 'size'], { to: 'figure' }) // or { to: someElement }
|
|
207
|
+
```
|
|
208
|
+
|
|
180
209
|
Continuous reaction with `var()`:
|
|
181
210
|
|
|
182
211
|
```css
|
|
@@ -192,7 +221,7 @@ Discrete reaction with a style query:
|
|
|
192
221
|
|
|
193
222
|
## Gotchas (read before writing CSS)
|
|
194
223
|
|
|
195
|
-
- **Custom properties inherit downward only.** An `element`-scoped source writes its vars on the bound element
|
|
224
|
+
- **Custom properties inherit downward only.** An `element`-scoped source writes its vars on the bound element, so only its *descendants* see them — and since `@container style()` matches an ancestor, the element can't style-query its own values either. Fix it by **hoisting**: `propsFor(el, keys, { to: 'figure' })` or `data-props-to="figure"` observes `el` but writes on the ancestor, so siblings (and `el` itself) can read and style-query it. The complementary trick: `range`, `field`, `select`, `media`, `img`, `img-color`, `video-color`, `color-input` also accept being bound to a *container* — they find the inner element and write on the container. Keep hoists to one binding per key per target (two elements hoisting the same key to one ancestor overwrite each other; it warns).
|
|
196
225
|
- **Pick the right consumer.** Continuous numbers go through `var()` + `calc()`. Discrete/boolean/integer values use `@container style()`, which matches on **equality only** (range comparisons like `style(--x < 5)` are not stable yet). Emit booleans/tiers when you need thresholds.
|
|
197
226
|
- **`visibility` is binary + latched, not a ratio.** It writes `--live-visible` and `--const-has-entered`. There is no continuous visible-ratio and no scroll-position source: use native `animation-timeline: scroll()` / `view()` for continuous scroll-driven effects.
|
|
198
227
|
- **Values are unitless.** Multiply by `1px`, `1deg`, `100%`, etc. in CSS.
|
|
@@ -200,7 +229,7 @@ Discrete reaction with a style query:
|
|
|
200
229
|
- **Typed properties are opt-in.** `configure({ typed: true })` (before attaching) registers each written `--live-*` with `@property` so it interpolates (consumers add `transition`/`@keyframes`) and resolves to `0` before a value arrives. With the `auto` entry, `<html data-props-typed>` is the markup equivalent (boolean, read once on load; typing is global per `@property` name, so no per-key subset). It is a one-way door (no unregister), uses `inherits: true`, is feature-detected, and skips names already registered. Sources can declare per-property `props: { name: { syntax, initial, inherits } }` (default `<number>` / `0` / inherited); consumers can set initials with `configure({ typed: true, defaults: { 'pointer-x-ratio': 0.5 } })` (keyed by local name).
|
|
201
230
|
- **Permission-gated plugins** (`orientation`, `motion`, `geo`) and unsupported APIs feature-detect and no-op; registering them is always safe. On iOS some need a user-gesture permission grant before values arrive. `cpuPressure` is Chromium-only and needs a secure context + the `compute-pressure` Permissions Policy; it seeds `--live-cpu-pressure: 0` where supported, writes nothing where not.
|
|
202
231
|
- **Global writes land in an adopted stylesheet, not `<html>` inline style.** Root `--live-*` go into one constructable, adopted `:root {}` rule (element-scoped writes stay inline; the `head` entry still writes `--const-*` inline for first paint). Keeps the DevTools Styles panel usable under per-frame churn; `var()`/`calc()` consumption is identical (still inherits). Reading `documentElement.style` directly won't show them — read computed style. Falls back to inline where constructable stylesheets are unsupported.
|
|
203
|
-
- **Continuously-sampling element sources pause off screen.** Under both the imperative API and `auto`, a *gated* `element`-scoped source runs only while its element intersects the viewport (via the shared `IntersectionObserver`); off screen its work (listeners/observers/timers) is torn down and its last-written values freeze in place, resuming + re-seeding on re-entry. This covers the sources that do continuous/heavy work: `size`, `truncated`, `pointer-local`, `media`, `img-color`, `video-color`. `global` sources and `:root` bindings are never gated. Opt out with `gate: false`: `visibility` does (it must keep observing to *report* visibility), and so do the **event-driven** sources `range`, `field`, `field-state`, `form-state`, `select`, `color-input`, `img` — they only write on user interaction or `load` (impossible off screen), so they seed once at bind and run ungated rather than paying for an `IntersectionObserver` subscription that saves nothing.
|
|
232
|
+
- **Continuously-sampling element sources pause off screen.** Under both the imperative API and `auto`, a *gated* `element`-scoped source runs only while its element intersects the viewport (via the shared `IntersectionObserver`); off screen its work (listeners/observers/timers) is torn down and its last-written values freeze in place, resuming + re-seeding on re-entry. This covers the sources that do continuous/heavy work: `size`, `truncated`, `pointer-local`, `media`, `img-color`, `video-color`. `global` sources and `:root` bindings are never gated. Opt out with `gate: false`: `visibility` does (it must keep observing to *report* visibility), and so do the **event-driven** sources `range`, `field`, `field-state`, `form-state`, `select`, `color-input`, `img` — they only write on user interaction or `load` (impossible off screen), so they seed once at bind and run ungated rather than paying for an `IntersectionObserver` subscription that saves nothing. `random` is ungated for a stronger reason: re-entry re-runs `start`, which would re-roll its write-once values.
|
|
204
233
|
- **Freeze or throttle the loop.** The whole loop also freezes automatically while the tab is hidden (`document.hidden`). `pause()` / `resume()` stop and restart sampling+flushing (values hold steady; bindings stay attached). `configure({ liveHz: 30 })` caps the rate to reduce mutations/recalc, throttling samplers (`fps`, `scroll-velocity`) too.
|
|
205
234
|
|
|
206
235
|
## Links
|
package/package.json
CHANGED
package/dist/chunk-3MK6Q7DX.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var s=new Map;function o(e,n){let t=s.get(e);if(!t){let r=new Set,i=a=>{for(let d of [...r])d(a);};t={handlers:r,dispatch:i},s.set(e,t),document.addEventListener(e,i,{passive:true});}return t.handlers.add(n),()=>{t.handlers.delete(n),t.handlers.size===0&&(document.removeEventListener(e,t.dispatch),s.delete(e));}}var l={key:"page-visible",scope:"global",start(e){let n=()=>e.write("page-visible",document.visibilityState==="visible"?1:0);return n(),o("visibilitychange",n)}};exports.a=l;
|
package/dist/chunk-D24E2DBW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b as b$1,a as a$3}from'./chunk-V4OTPLOQ.js';import {a as a$2}from'./chunk-LTJ2VKVY.js';import {b,a}from'./chunk-KG3EF456.js';import {a as a$4}from'./chunk-T4N6AEOZ.js';import {a as a$1}from'./chunk-LWKH66VY.js';import {a as a$5}from'./chunk-EEMKKLRF.js';var f;function P(){if(f!==void 0||(f=null,typeof document>"u"||typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in document)))return f;try{let e=new CSSStyleSheet;e.replaceSync(":root{}"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],f=e.cssRules[0].style;}catch{f=null;}return f}function m(e){if(typeof document<"u"&&e===document.documentElement){let t=P();if(t)return t}return e.style}var h=class{pending=new Map;last=new WeakMap;set(t,r,o){let n=this.pending.get(t);if(n?.has(r)){n.set(r,o);return}this.last.get(t)?.get(r)!==o&&(n?n.set(r,o):this.pending.set(t,new Map([[r,o]])),a());}forget(t,r){this.last.get(t)?.delete(r);let o=this.pending.get(t);o&&(o.delete(r),o.size===0&&this.pending.delete(t));}flush=()=>{if(this.pending.size!==0){for(let[t,r]of this.pending){let o=this.last.get(t);o||this.last.set(t,o=new Map);let n=m(t);for(let[i,s]of r)o.get(i)!==s&&(n.setProperty(i,s),o.set(i,s));}this.pending.clear();}}},y=new h;b(y.flush);var k=new Set;function C(e,t,r){if(k.has(e)||typeof CSS>"u"||typeof CSS.registerProperty!="function")return;k.add(e);let o=t?r?.[t]:void 0,n=t?a$1.defaults?.[t]:void 0;try{CSS.registerProperty({name:e,syntax:o?.syntax??"<number>",inherits:o?.inherits??!0,initialValue:n!=null?String(n):o?.initial??"0"});}catch{}}var T={key:"viewport",scope:"global",start(e){let t=()=>{e.write("vw",window.innerWidth),e.write("vh",window.innerHeight);};return t(),a$5("resize",t)}};var x={key:"size",scope:"element",start(e){return a$3(e.target,t=>{let r=t.borderBoxSize?.[0],o=r?r.inlineSize:t.contentRect.width,n=r?r.blockSize:t.contentRect.height;e.write("w",a$4(o)),e.write("h",a$4(n)),e.write("aspect",n>0?a$4(o/n):0);})}};var g=1;function R(e){let t=e.rootBounds;if(!t)return e.intersectionRatio>=1;let r=e.boundingClientRect;return r.top>=t.top-g&&r.right<=t.right+g&&r.bottom<=t.bottom+g&&r.left>=t.left-g}var H={key:"visibility",scope:"element",gate:false,start(e){let t=false;return e.write("visible",0),e.write("has-entered",0,"const"),b$1(e.target,r=>{let o=R(r);e.write("visible",o?1:0),o&&!t&&(t=true,e.write("has-entered",1,"const"));})}};var D={key:"range",scope:"element",gate:false,start(e){let t=a$2(e.target,'input[type="range"], input[type="number"]');if(!t)return ()=>{};let r=()=>{let o=t.min===""?0:Number(t.min),n=t.max===""?100:Number(t.max),i=Number(t.value);e.write("value",i),e.write("value-pct",n>o?a$4((i-o)/(n-o)):0);};return r(),t.addEventListener("input",r,{passive:true}),()=>t.removeEventListener("input",r)}};var z={viewport:T,size:x,visibility:H,range:D};var I=()=>{},p=new Map,S={...z};function ge(e){S[e.key]=e;}function Se(e){delete S[e];}function he(e){return e in S}function we(e){Object.assign(a$1,e);}function F(e,t,r){return {target:e,config:a$1,write(o,n,i="live"){let s=(i==="const"?a$1.constPrefix:a$1.livePrefix)+o;t.add(s),a$1.typed&&C(s,o,r),y.set(e,s,String(n));}}}function K(e,t,r){if(!(e.scope==="element"&&e.gate!==false&&r!==a$1.root&&typeof IntersectionObserver<"u"))return e.start(t);let n=null,i=()=>{if(!n)try{n=e.start(t);}catch(l){console.error(`[prop-for-that] source "${e.key}" failed to start`,l);}},s=()=>{n?.(),n=null;},d=b$1(r,l=>{l.isIntersecting?i():s();});return ()=>{d(),s();}}function w(e,t,r){let o=r.get(t);if(!o)return;o.dispose();let n=m(e);for(let i of o.written)n.removeProperty(i),y.forget(e,i);r.delete(t);}function A(e,t){let r=p.get(e);r||p.set(e,r=new Map);let o=[];for(let n of t){if(r.has(n))continue;let i=S[n];if(!i){console.warn(`[prop-for-that] unknown source "${n}"`);continue}let s=new Set,d;try{d=K(i,F(e,s,i.props),e);}catch(l){console.error(`[prop-for-that] source "${n}" failed to start`,l);continue}r.set(n,{dispose:d,written:s}),o.push(n);}return ()=>{let n=p.get(e);if(n){for(let i of o)w(e,i,n);n.size===0&&p.delete(e);}}}function O(e){return e instanceof Element?[e]:typeof NodeList<"u"&&e instanceof NodeList||typeof HTMLCollection<"u"&&e instanceof HTMLCollection||Array.isArray(e)?Array.from(e).filter(t=>t instanceof Element):[]}function W(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="string")}function ve(e,t){let r,o;if(t===void 0&&W(e)?(r=a$1.root?[a$1.root]:[],o=e):(r=O(e),o=t??[]),!r.length||!o.length)return I;let n=r.map(i=>A(i,o));return ()=>{for(let i of n)i();}}function Ee(e,t){let r=p.get(e);if(r){for(let o of t??[...r.keys()])w(e,o,r);r.size===0&&p.delete(e);}}function be(){for(let[e,t]of p)for(let r of [...t.keys()])w(e,r,t);p.clear();}export{ge as a,Se as b,he as c,we as d,ve as e,Ee as f,be as g};
|
package/dist/chunk-EEMKKLRF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=new Map;function a(n,s){let e=t.get(n);if(!e){let r=new Set,d=i=>{for(let o of [...r])o(i);};e={handlers:r,dispatch:d},t.set(n,e),window.addEventListener(n,d,{passive:true});}return e.handlers.add(s),()=>{e.handlers.delete(s),e.handlers.size===0&&(window.removeEventListener(n,e.dispatch),t.delete(n));}}export{a};
|
package/dist/chunk-OVCZMPYV.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkPQVNJZUW_cjs=require('./chunk-PQVNJZUW.cjs'),chunkHHINWX7L_cjs=require('./chunk-HHINWX7L.cjs'),chunkEYDIF3NM_cjs=require('./chunk-EYDIF3NM.cjs'),chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunk7L35N3N3_cjs=require('./chunk-7L35N3N3.cjs'),chunkQHHF5SEL_cjs=require('./chunk-QHHF5SEL.cjs');var f;function P(){if(f!==void 0||(f=null,typeof document>"u"||typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in document)))return f;try{let e=new CSSStyleSheet;e.replaceSync(":root{}"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],f=e.cssRules[0].style;}catch{f=null;}return f}function m(e){if(typeof document<"u"&&e===document.documentElement){let t=P();if(t)return t}return e.style}var h=class{pending=new Map;last=new WeakMap;set(t,r,o){let n=this.pending.get(t);if(n?.has(r)){n.set(r,o);return}this.last.get(t)?.get(r)!==o&&(n?n.set(r,o):this.pending.set(t,new Map([[r,o]])),chunkEYDIF3NM_cjs.a());}forget(t,r){this.last.get(t)?.delete(r);let o=this.pending.get(t);o&&(o.delete(r),o.size===0&&this.pending.delete(t));}flush=()=>{if(this.pending.size!==0){for(let[t,r]of this.pending){let o=this.last.get(t);o||this.last.set(t,o=new Map);let n=m(t);for(let[i,s]of r)o.get(i)!==s&&(n.setProperty(i,s),o.set(i,s));}this.pending.clear();}}},y=new h;chunkEYDIF3NM_cjs.b(y.flush);var k=new Set;function C(e,t,r){if(k.has(e)||typeof CSS>"u"||typeof CSS.registerProperty!="function")return;k.add(e);let o=t?r?.[t]:void 0,n=t?chunk7L35N3N3_cjs.a.defaults?.[t]:void 0;try{CSS.registerProperty({name:e,syntax:o?.syntax??"<number>",inherits:o?.inherits??!0,initialValue:n!=null?String(n):o?.initial??"0"});}catch{}}var T={key:"viewport",scope:"global",start(e){let t=()=>{e.write("vw",window.innerWidth),e.write("vh",window.innerHeight);};return t(),chunkQHHF5SEL_cjs.a("resize",t)}};var x={key:"size",scope:"element",start(e){return chunkPQVNJZUW_cjs.a(e.target,t=>{let r=t.borderBoxSize?.[0],o=r?r.inlineSize:t.contentRect.width,n=r?r.blockSize:t.contentRect.height;e.write("w",chunk65MXZJBD_cjs.a(o)),e.write("h",chunk65MXZJBD_cjs.a(n)),e.write("aspect",n>0?chunk65MXZJBD_cjs.a(o/n):0);})}};var g=1;function R(e){let t=e.rootBounds;if(!t)return e.intersectionRatio>=1;let r=e.boundingClientRect;return r.top>=t.top-g&&r.right<=t.right+g&&r.bottom<=t.bottom+g&&r.left>=t.left-g}var H={key:"visibility",scope:"element",gate:false,start(e){let t=false;return e.write("visible",0),e.write("has-entered",0,"const"),chunkPQVNJZUW_cjs.b(e.target,r=>{let o=R(r);e.write("visible",o?1:0),o&&!t&&(t=true,e.write("has-entered",1,"const"));})}};var D={key:"range",scope:"element",gate:false,start(e){let t=chunkHHINWX7L_cjs.a(e.target,'input[type="range"], input[type="number"]');if(!t)return ()=>{};let r=()=>{let o=t.min===""?0:Number(t.min),n=t.max===""?100:Number(t.max),i=Number(t.value);e.write("value",i),e.write("value-pct",n>o?chunk65MXZJBD_cjs.a((i-o)/(n-o)):0);};return r(),t.addEventListener("input",r,{passive:true}),()=>t.removeEventListener("input",r)}};var z={viewport:T,size:x,visibility:H,range:D};var I=()=>{},p=new Map,S={...z};function ge(e){S[e.key]=e;}function Se(e){delete S[e];}function he(e){return e in S}function we(e){Object.assign(chunk7L35N3N3_cjs.a,e);}function F(e,t,r){return {target:e,config:chunk7L35N3N3_cjs.a,write(o,n,i="live"){let s=(i==="const"?chunk7L35N3N3_cjs.a.constPrefix:chunk7L35N3N3_cjs.a.livePrefix)+o;t.add(s),chunk7L35N3N3_cjs.a.typed&&C(s,o,r),y.set(e,s,String(n));}}}function K(e,t,r){if(!(e.scope==="element"&&e.gate!==false&&r!==chunk7L35N3N3_cjs.a.root&&typeof IntersectionObserver<"u"))return e.start(t);let n=null,i=()=>{if(!n)try{n=e.start(t);}catch(l){console.error(`[prop-for-that] source "${e.key}" failed to start`,l);}},s=()=>{n?.(),n=null;},d=chunkPQVNJZUW_cjs.b(r,l=>{l.isIntersecting?i():s();});return ()=>{d(),s();}}function w(e,t,r){let o=r.get(t);if(!o)return;o.dispose();let n=m(e);for(let i of o.written)n.removeProperty(i),y.forget(e,i);r.delete(t);}function A(e,t){let r=p.get(e);r||p.set(e,r=new Map);let o=[];for(let n of t){if(r.has(n))continue;let i=S[n];if(!i){console.warn(`[prop-for-that] unknown source "${n}"`);continue}let s=new Set,d;try{d=K(i,F(e,s,i.props),e);}catch(l){console.error(`[prop-for-that] source "${n}" failed to start`,l);continue}r.set(n,{dispose:d,written:s}),o.push(n);}return ()=>{let n=p.get(e);if(n){for(let i of o)w(e,i,n);n.size===0&&p.delete(e);}}}function O(e){return e instanceof Element?[e]:typeof NodeList<"u"&&e instanceof NodeList||typeof HTMLCollection<"u"&&e instanceof HTMLCollection||Array.isArray(e)?Array.from(e).filter(t=>t instanceof Element):[]}function W(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="string")}function ve(e,t){let r,o;if(t===void 0&&W(e)?(r=chunk7L35N3N3_cjs.a.root?[chunk7L35N3N3_cjs.a.root]:[],o=e):(r=O(e),o=t??[]),!r.length||!o.length)return I;let n=r.map(i=>A(i,o));return ()=>{for(let i of n)i();}}function Ee(e,t){let r=p.get(e);if(r){for(let o of t??[...r.keys()])w(e,o,r);r.size===0&&p.delete(e);}}function be(){for(let[e,t]of p)for(let r of [...t.keys()])w(e,r,t);p.clear();}exports.a=ge;exports.b=Se;exports.c=he;exports.d=we;exports.e=ve;exports.f=Ee;exports.g=be;
|
package/dist/chunk-OVF4XN2H.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkQHHF5SEL_cjs=require('./chunk-QHHF5SEL.cjs');var f={key:"online",scope:"global",start(e){let o=()=>e.write("online",navigator.onLine?1:0);o();let t=chunkQHHF5SEL_cjs.a("online",o),i=chunkQHHF5SEL_cjs.a("offline",o);return ()=>{t(),i();}}};exports.a=f;
|
package/dist/chunk-PQVNJZUW.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var a,f=new WeakMap,v=new WeakMap;function y(e,n){a||(a=new ResizeObserver(t=>{for(let s of t){v.set(s.target,s);let i=f.get(s.target);if(i)for(let d of [...i])d(s);}}));let r=f.get(e);r||(f.set(e,r=new Set),a.observe(e)),r.add(n);let o=v.get(e);return o&&n(o),()=>{let t=f.get(e);t&&(t.delete(n),t.size===0&&(f.delete(e),a.unobserve(e)));}}var b,c=new WeakMap,p=new WeakMap,g=[0,.98,.99,.995,.999,1];function l(e,n){b||(b=new IntersectionObserver(t=>{for(let s of t){p.set(s.target,s);let i=c.get(s.target);if(i)for(let d of [...i])d(s);}},{threshold:g}));let r=c.get(e);r||(c.set(e,r=new Set),b.observe(e)),r.add(n);let o=p.get(e);return o&&n(o),()=>{let t=c.get(e);t&&(t.delete(n),t.size===0&&(c.delete(e),b.unobserve(e)));}}exports.a=y;exports.b=l;
|
package/dist/chunk-QHHF5SEL.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var t=new Map;function a(n,s){let e=t.get(n);if(!e){let r=new Set,d=i=>{for(let o of [...r])o(i);};e={handlers:r,dispatch:d},t.set(n,e),window.addEventListener(n,d,{passive:true});}return e.handlers.add(s),()=>{e.handlers.delete(s),e.handlers.size===0&&(window.removeEventListener(n,e.dispatch),t.delete(n));}}exports.a=a;
|
package/dist/chunk-SFO6H2DN.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s=new Map;function o(e,n){let t=s.get(e);if(!t){let r=new Set,i=a=>{for(let d of [...r])d(a);};t={handlers:r,dispatch:i},s.set(e,t),document.addEventListener(e,i,{passive:true});}return t.handlers.add(n),()=>{t.handlers.delete(n),t.handlers.size===0&&(document.removeEventListener(e,t.dispatch),s.delete(e));}}var l={key:"page-visible",scope:"global",start(e){let n=()=>e.write("page-visible",document.visibilityState==="visible"?1:0);return n(),o("visibilitychange",n)}};export{l as a};
|
package/dist/chunk-V4OTPLOQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a,f=new WeakMap,v=new WeakMap;function y(e,n){a||(a=new ResizeObserver(t=>{for(let s of t){v.set(s.target,s);let i=f.get(s.target);if(i)for(let d of [...i])d(s);}}));let r=f.get(e);r||(f.set(e,r=new Set),a.observe(e)),r.add(n);let o=v.get(e);return o&&n(o),()=>{let t=f.get(e);t&&(t.delete(n),t.size===0&&(f.delete(e),a.unobserve(e)));}}var b,c=new WeakMap,p=new WeakMap,g=[0,.98,.99,.995,.999,1];function l(e,n){b||(b=new IntersectionObserver(t=>{for(let s of t){p.set(s.target,s);let i=c.get(s.target);if(i)for(let d of [...i])d(s);}},{threshold:g}));let r=c.get(e);r||(c.set(e,r=new Set),b.observe(e)),r.add(n);let o=p.get(e);return o&&n(o),()=>{let t=c.get(e);t&&(t.delete(n),t.size===0&&(c.delete(e),b.unobserve(e)));}}export{y as a,l as b};
|
package/dist/chunk-WIPJMLJJ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkQHHF5SEL_cjs=require('./chunk-QHHF5SEL.cjs');var u={key:"page-focused",scope:"global",start(c){let o=()=>c.write("page-focused",document.hasFocus()?1:0);o();let t=chunkQHHF5SEL_cjs.a("focus",o),r=chunkQHHF5SEL_cjs.a("blur",o);return ()=>{t(),r();}}};exports.a=u;
|
package/dist/motion-GHDWROM2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as motion}from'./chunk-SKEEFKDT.js';import'./chunk-T4N6AEOZ.js';import'./chunk-EEMKKLRF.js';
|
package/dist/motion-GMUGWJN3.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkG2BOTBBH_cjs=require('./chunk-G2BOTBBH.cjs');require('./chunk-65MXZJBD.cjs'),require('./chunk-QHHF5SEL.cjs');Object.defineProperty(exports,"motion",{enumerable:true,get:function(){return chunkG2BOTBBH_cjs.a}});
|
package/dist/online-KTMCBCXT.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkOVF4XN2H_cjs=require('./chunk-OVF4XN2H.cjs');require('./chunk-QHHF5SEL.cjs');Object.defineProperty(exports,"online",{enumerable:true,get:function(){return chunkOVF4XN2H_cjs.a}});
|