prop-for-that 0.7.6 → 0.7.7
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 +15 -0
- package/README.md +1 -1
- package/dist/auto.cjs +1 -1
- package/dist/auto.js +1 -1
- package/dist/chunk-37L73RJL.cjs +1 -0
- package/dist/chunk-BS2XX4G3.js +1 -0
- package/dist/chunk-D24E2DBW.js +1 -0
- package/dist/chunk-OVCZMPYV.cjs +1 -0
- package/dist/chunk-PQVNJZUW.cjs +1 -0
- package/dist/chunk-V4OTPLOQ.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.cts +21 -1
- package/dist/plugins.d.ts +21 -1
- package/dist/plugins.js +1 -1
- package/dist/truncated-MDPFWGSI.js +1 -0
- package/dist/truncated-RUY3JNAX.cjs +1 -0
- package/llms.txt +2 -1
- package/package.json +1 -1
- package/dist/chunk-BVU5BAWU.js +0 -1
- package/dist/chunk-WZXNO2W7.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,21 @@ backwards-compatible change (semver's `1.0.0`+ rules kick in at v1).
|
|
|
8
8
|
Only the published library (`dist/`) is versioned here; the demo and docs site
|
|
9
9
|
are repo-only and not part of the npm package.
|
|
10
10
|
|
|
11
|
+
## [0.7.7]
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **`truncated` plugin** (element) — whether an element's own text is being
|
|
15
|
+
clipped right now, the "is the ellipsis showing?" question CSS can ask a scroll
|
|
16
|
+
container (`scroll-state()`) but never overflowing text. All `1`/`0`:
|
|
17
|
+
`--live-truncated` (clipped on either axis), `--live-truncated-x` (inline clip —
|
|
18
|
+
the classic `text-overflow: ellipsis` line, `scrollWidth > clientWidth`),
|
|
19
|
+
`--live-truncated-y` (block clip — a `-webkit-line-clamp` / fixed-height
|
|
20
|
+
`overflow: hidden` box, `scrollHeight > clientHeight`). Reveal a "more"
|
|
21
|
+
affordance, tooltip trigger, or expand control only while text is actually cut
|
|
22
|
+
off — `@container style(--live-truncated: 1) { … }` — and have it vanish the
|
|
23
|
+
moment a wider box fits. Recomputed whenever the box resizes (the shared
|
|
24
|
+
`ResizeObserver`); gated, so it pauses off screen like `size`. (#11)
|
|
25
|
+
|
|
11
26
|
## [0.7.6]
|
|
12
27
|
|
|
13
28
|
### Fixed
|
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ Bind any element with `data-props-for="key …"` and read its `--live-*` propert
|
|
|
52
52
|
|
|
53
53
|
**Core** (built in): viewport, element size, visibility, and `<input type="range">` values.
|
|
54
54
|
|
|
55
|
-
**Plugins** (opt-in): pointer position, battery, network, online status, page focus & visibility, navigation type, page meta tags, FPS, clock, scroll velocity, device orientation / motion, geolocation, CPU pressure, soft-keyboard geometry, media playback, form & field state, select & color-picker values, and dominant + accent colors extracted from images and video — 20+ in all.
|
|
55
|
+
**Plugins** (opt-in): pointer position, battery, network, online status, page focus & visibility, navigation type, page meta tags, FPS, clock, scroll velocity, device orientation / motion, geolocation, CPU pressure, soft-keyboard geometry, media playback, form & field state, select & color-picker values, text-truncation (ellipsis) detection, and dominant + accent colors extracted from images and video — 20+ in all.
|
|
56
56
|
|
|
57
57
|
→ Every source, every property, and live demos are in the **[docs](https://prop-for-that.netlify.app/docsite/reference/plugins/)**.
|
|
58
58
|
|
package/dist/auto.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkOVCZMPYV_cjs=require('./chunk-OVCZMPYV.cjs');require('./chunk-PQVNJZUW.cjs'),require('./chunk-HHINWX7L.cjs'),require('./chunk-EYDIF3NM.cjs'),require('./chunk-65MXZJBD.cjs'),require('./chunk-7L35N3N3.cjs'),require('./chunk-QHHF5SEL.cjs');var u={"scroll-velocity":()=>import('./scroll-velocity-DGZNNO73.cjs').then(t=>t.scrollVelocity),online:()=>import('./online-KTMCBCXT.cjs').then(t=>t.online),"page-focused":()=>import('./page-focused-3WLSZDV4.cjs').then(t=>t.pageFocused),"page-visible":()=>import('./page-visible-6PMX575B.cjs').then(t=>t.pageVisible),"nav-type":()=>import('./nav-type-MFJJDDPZ.cjs').then(t=>t.navType),meta:()=>import('./meta-U2EHV4AM.cjs').then(t=>t.meta),network:()=>import('./network-DPAAEK2S.cjs').then(t=>t.network),battery:()=>import('./battery-DQQ2NOGC.cjs').then(t=>t.battery),clock:()=>import('./clock-EVSBOOMJ.cjs').then(t=>t.clock),fps:()=>import('./fps-Q3ITXSJO.cjs').then(t=>t.fps),"visual-viewport":()=>import('./visual-viewport-MKUHWUQT.cjs').then(t=>t.visualViewport),keyboard:()=>import('./keyboard-6ZGB2LAD.cjs').then(t=>t.keyboard),pointer:()=>import('./pointer-DJSMZGSV.cjs').then(t=>t.pointer),"pointer-local":()=>import('./pointer-local-6JKSOJZV.cjs').then(t=>t.pointerLocal),media:()=>import('./media-XS6ADFFY.cjs').then(t=>t.media),field:()=>import('./field-4MBM2R7N.cjs').then(t=>t.field),"field-state":()=>import('./field-state-NXSK6ZZW.cjs').then(t=>t.fieldState),"form-state":()=>import('./form-state-FJZINKN7.cjs').then(t=>t.formState),select:()=>import('./select-LMRGCCLB.cjs').then(t=>t.select),"color-input":()=>import('./color-input-SYYBVLZM.cjs').then(t=>t.colorInput),orientation:()=>import('./orientation-JD23MYZR.cjs').then(t=>t.orientation),motion:()=>import('./motion-GMUGWJN3.cjs').then(t=>t.motion),geo:()=>import('./geo-CMG7QJ6S.cjs').then(t=>t.geo),"cpu-pressure":()=>import('./cpu-pressure-FXZDL5IE.cjs').then(t=>t.cpuPressure),img:()=>import('./img-6F5QAPW3.cjs').then(t=>t.img),"img-color":()=>import('./img-color-MBEU42DF.cjs').then(t=>t.imgColor),"video-color":()=>import('./video-color-B37Z5OBY.cjs').then(t=>t.videoColor),truncated:()=>import('./truncated-RUY3JNAX.cjs').then(t=>t.truncated)};var n=new WeakMap,l=new Map;function v(t){return (t.dataset.propsFor??"").split(/\s+/).filter(Boolean)}function E(t){if(chunkOVCZMPYV_cjs.c(t))return null;let e=u[t];if(!e)return null;let o=l.get(t);return o||(o=e().then(r=>{chunkOVCZMPYV_cjs.a(r);}).catch(r=>{l.delete(t),console.error(`[prop-for-that] failed to load plugin "${t}"`,r);}),l.set(t,o)),o}function b(t,e){let o=E(e);if(!o){chunkOVCZMPYV_cjs.e(t,[e]);return}o.then(()=>{chunkOVCZMPYV_cjs.c(e)&&(n.get(t)??[]).includes(e)&&chunkOVCZMPYV_cjs.e(t,[e]);});}function s(t){let e=v(t),o=n.get(t)??[],r=o.filter(i=>!e.includes(i)),g=e.filter(i=>!o.includes(i));r.length&&chunkOVCZMPYV_cjs.f(t,r),e.length?n.set(t,e):n.delete(t);for(let i of g)b(t,i);}function f(t){let e=n.get(t);e&&(chunkOVCZMPYV_cjs.f(t,e),n.delete(t));}function y(t){t instanceof HTMLElement&&(t.hasAttribute("data-props-for")&&s(t),t.querySelectorAll("[data-props-for]").forEach(s));}function L(t){t instanceof HTMLElement&&(f(t),t.querySelectorAll("[data-props-for]").forEach(f));}function h(){document.documentElement.hasAttribute("data-props-typed")&&chunkOVCZMPYV_cjs.d({typed:true}),document.querySelectorAll("[data-props-for]").forEach(s),new MutationObserver(t=>{for(let e of t){if(e.type==="attributes"&&e.target instanceof HTMLElement){s(e.target);continue}e.removedNodes.forEach(L),e.addedNodes.forEach(y);}}).observe(document.documentElement,{subtree:true,childList:true,attributes:true,attributeFilter:["data-props-for"]});}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h,{once:true}):h());
|
package/dist/auto.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d,f as f$1,e,c,a
|
|
1
|
+
import {d,f as f$1,e,c,a}from'./chunk-D24E2DBW.js';import'./chunk-V4OTPLOQ.js';import'./chunk-LTJ2VKVY.js';import'./chunk-KG3EF456.js';import'./chunk-T4N6AEOZ.js';import'./chunk-LWKH66VY.js';import'./chunk-EEMKKLRF.js';var u={"scroll-velocity":()=>import('./scroll-velocity-ZRXPNZG7.js').then(t=>t.scrollVelocity),online:()=>import('./online-MGYZDLCQ.js').then(t=>t.online),"page-focused":()=>import('./page-focused-LBKD6QXG.js').then(t=>t.pageFocused),"page-visible":()=>import('./page-visible-27YKTHKU.js').then(t=>t.pageVisible),"nav-type":()=>import('./nav-type-S4MHMDHS.js').then(t=>t.navType),meta:()=>import('./meta-VSAZR4JL.js').then(t=>t.meta),network:()=>import('./network-BHUTXTX7.js').then(t=>t.network),battery:()=>import('./battery-CDMJLP4C.js').then(t=>t.battery),clock:()=>import('./clock-LYF2IHGE.js').then(t=>t.clock),fps:()=>import('./fps-IGSZPFLV.js').then(t=>t.fps),"visual-viewport":()=>import('./visual-viewport-GNJTAHPT.js').then(t=>t.visualViewport),keyboard:()=>import('./keyboard-YJ7S6XPJ.js').then(t=>t.keyboard),pointer:()=>import('./pointer-3O7MGTQD.js').then(t=>t.pointer),"pointer-local":()=>import('./pointer-local-X5TVNEEJ.js').then(t=>t.pointerLocal),media:()=>import('./media-RDQ3WR22.js').then(t=>t.media),field:()=>import('./field-6USMKGKM.js').then(t=>t.field),"field-state":()=>import('./field-state-YLUDK3XS.js').then(t=>t.fieldState),"form-state":()=>import('./form-state-Q4SCA6TH.js').then(t=>t.formState),select:()=>import('./select-H3CFIVK3.js').then(t=>t.select),"color-input":()=>import('./color-input-STV57DGE.js').then(t=>t.colorInput),orientation:()=>import('./orientation-27ULVQVJ.js').then(t=>t.orientation),motion:()=>import('./motion-GHDWROM2.js').then(t=>t.motion),geo:()=>import('./geo-MXO5OMVO.js').then(t=>t.geo),"cpu-pressure":()=>import('./cpu-pressure-WCDHVDRP.js').then(t=>t.cpuPressure),img:()=>import('./img-PYBNG6OU.js').then(t=>t.img),"img-color":()=>import('./img-color-VW3XMATY.js').then(t=>t.imgColor),"video-color":()=>import('./video-color-ZMRKDZFO.js').then(t=>t.videoColor),truncated:()=>import('./truncated-MDPFWGSI.js').then(t=>t.truncated)};var n=new WeakMap,l=new Map;function v(t){return (t.dataset.propsFor??"").split(/\s+/).filter(Boolean)}function E(t){if(c(t))return null;let e=u[t];if(!e)return null;let o=l.get(t);return o||(o=e().then(r=>{a(r);}).catch(r=>{l.delete(t),console.error(`[prop-for-that] failed to load plugin "${t}"`,r);}),l.set(t,o)),o}function b(t,e$1){let o=E(e$1);if(!o){e(t,[e$1]);return}o.then(()=>{c(e$1)&&(n.get(t)??[]).includes(e$1)&&e(t,[e$1]);});}function s(t){let e=v(t),o=n.get(t)??[],r=o.filter(i=>!e.includes(i)),g=e.filter(i=>!o.includes(i));r.length&&f$1(t,r),e.length?n.set(t,e):n.delete(t);for(let i of g)b(t,i);}function f(t){let e=n.get(t);e&&(f$1(t,e),n.delete(t));}function y(t){t instanceof HTMLElement&&(t.hasAttribute("data-props-for")&&s(t),t.querySelectorAll("[data-props-for]").forEach(s));}function L(t){t instanceof HTMLElement&&(f(t),t.querySelectorAll("[data-props-for]").forEach(f));}function h(){document.documentElement.hasAttribute("data-props-typed")&&d({typed:true}),document.querySelectorAll("[data-props-for]").forEach(s),new MutationObserver(t=>{for(let e of t){if(e.type==="attributes"&&e.target instanceof HTMLElement){s(e.target);continue}e.removedNodes.forEach(L),e.addedNodes.forEach(y);}}).observe(document.documentElement,{subtree:true,childList:true,attributes:true,attributeFilter:["data-props-for"]});}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h,{once:true}):h());
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkPQVNJZUW_cjs=require('./chunk-PQVNJZUW.cjs');var i={key:"truncated",scope:"element",start(t){let e=t.target,r=()=>{let o=e.scrollWidth>e.clientWidth?1:0,c=e.scrollHeight>e.clientHeight?1:0;t.write("truncated",o||c?1:0),t.write("truncated-x",o),t.write("truncated-y",c);};return r(),chunkPQVNJZUW_cjs.a(e,r)}};exports.a=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-V4OTPLOQ.js';var i={key:"truncated",scope:"element",start(t){let e=t.target,r=()=>{let o=e.scrollWidth>e.clientWidth?1:0,c=e.scrollHeight>e.clientHeight?1:0;t.write("truncated",o||c?1:0),t.write("truncated-x",o),t.write("truncated-y",c);};return r(),a(e,r)}};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
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/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkOVCZMPYV_cjs=require('./chunk-OVCZMPYV.cjs');require('./chunk-PQVNJZUW.cjs'),require('./chunk-HHINWX7L.cjs');var chunkEYDIF3NM_cjs=require('./chunk-EYDIF3NM.cjs');require('./chunk-65MXZJBD.cjs'),require('./chunk-7L35N3N3.cjs'),require('./chunk-QHHF5SEL.cjs');Object.defineProperty(exports,"configure",{enumerable:true,get:function(){return chunkOVCZMPYV_cjs.d}});Object.defineProperty(exports,"isRegistered",{enumerable:true,get:function(){return chunkOVCZMPYV_cjs.c}});Object.defineProperty(exports,"propsFor",{enumerable:true,get:function(){return chunkOVCZMPYV_cjs.e}});Object.defineProperty(exports,"register",{enumerable:true,get:function(){return chunkOVCZMPYV_cjs.a}});Object.defineProperty(exports,"reset",{enumerable:true,get:function(){return chunkOVCZMPYV_cjs.g}});Object.defineProperty(exports,"unbind",{enumerable:true,get:function(){return chunkOVCZMPYV_cjs.f}});Object.defineProperty(exports,"unregister",{enumerable:true,get:function(){return chunkOVCZMPYV_cjs.b}});Object.defineProperty(exports,"pause",{enumerable:true,get:function(){return chunkEYDIF3NM_cjs.d}});Object.defineProperty(exports,"resume",{enumerable:true,get:function(){return chunkEYDIF3NM_cjs.e}});
|
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-D24E2DBW.js';import'./chunk-V4OTPLOQ.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-EEMKKLRF.js';
|
package/dist/plugins.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkHTKGZP36_cjs=require('./chunk-HTKGZP36.cjs'),chunkG2BOTBBH_cjs=require('./chunk-G2BOTBBH.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'),chunk3W7CXUWN_cjs=require('./chunk-3W7CXUWN.cjs'),chunkSYKMPPTY_cjs=require('./chunk-SYKMPPTY.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'),
|
|
1
|
+
'use strict';var chunkHTKGZP36_cjs=require('./chunk-HTKGZP36.cjs'),chunkG2BOTBBH_cjs=require('./chunk-G2BOTBBH.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'),chunk37L73RJL_cjs=require('./chunk-37L73RJL.cjs'),chunk3W7CXUWN_cjs=require('./chunk-3W7CXUWN.cjs'),chunkSYKMPPTY_cjs=require('./chunk-SYKMPPTY.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'),chunkOVCZMPYV_cjs=require('./chunk-OVCZMPYV.cjs');require('./chunk-PQVNJZUW.cjs'),require('./chunk-HHINWX7L.cjs');var chunkLP3QQ33O_cjs=require('./chunk-LP3QQ33O.cjs');require('./chunk-EYDIF3NM.cjs'),require('./chunk-65MXZJBD.cjs'),require('./chunk-7L35N3N3.cjs');var chunkOVF4XN2H_cjs=require('./chunk-OVF4XN2H.cjs'),chunkWIPJMLJJ_cjs=require('./chunk-WIPJMLJJ.cjs');require('./chunk-QHHF5SEL.cjs');var chunk3MK6Q7DX_cjs=require('./chunk-3MK6Q7DX.cjs');var j=[chunkLP3QQ33O_cjs.a,chunkOVF4XN2H_cjs.a,chunkWIPJMLJJ_cjs.a,chunk3MK6Q7DX_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,chunk3W7CXUWN_cjs.a,chunkSYKMPPTY_cjs.a,chunk63C3RCO2_cjs.a,chunkFZYB3P7L_cjs.a,chunkIIQP3BYA_cjs.a,chunkQFJ6SZ2H_cjs.a,chunkODPCQAKC_cjs.a,chunk3REDV2FZ_cjs.a,chunkHTKGZP36_cjs.a,chunkG2BOTBBH_cjs.a,chunkUALPUR2L_cjs.a,chunk2H5YFW6O_cjs.a,chunk2YHGSLQQ_cjs.a,chunkFKBHTKZH_cjs.a,chunkHYVT6V4Z_cjs.a,chunk37L73RJL_cjs.a];function fo(...o){for(let T of o.length?o:j)chunkOVCZMPYV_cjs.a(T);}Object.defineProperty(exports,"orientation",{enumerable:true,get:function(){return chunkHTKGZP36_cjs.a}});Object.defineProperty(exports,"motion",{enumerable:true,get:function(){return chunkG2BOTBBH_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 chunk37L73RJL_cjs.a}});Object.defineProperty(exports,"pointer",{enumerable:true,get:function(){return chunk3W7CXUWN_cjs.a}});Object.defineProperty(exports,"pointerLocal",{enumerable:true,get:function(){return chunkSYKMPPTY_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 chunkLP3QQ33O_cjs.a}});Object.defineProperty(exports,"online",{enumerable:true,get:function(){return chunkOVF4XN2H_cjs.a}});Object.defineProperty(exports,"pageFocused",{enumerable:true,get:function(){return chunkWIPJMLJJ_cjs.a}});Object.defineProperty(exports,"pageVisible",{enumerable:true,get:function(){return chunk3MK6Q7DX_cjs.a}});exports.allPlugins=j;exports.registerPlugins=fo;
|
package/dist/plugins.d.cts
CHANGED
|
@@ -347,6 +347,26 @@ declare const imgColor: Source;
|
|
|
347
347
|
*/
|
|
348
348
|
declare const videoColor: Source;
|
|
349
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Whether an element's own text is being clipped right now — the "is the
|
|
352
|
+
* ellipsis showing?" question CSS can ask of a scroll container (`scroll-state()`)
|
|
353
|
+
* but never of overflowing text. Bind it to the element whose overflow you care
|
|
354
|
+
* about; all `1`/`0`:
|
|
355
|
+
*
|
|
356
|
+
* - `--live-truncated` — clipped on *either* axis.
|
|
357
|
+
* - `--live-truncated-x` — inline clip: the classic `text-overflow: ellipsis` on
|
|
358
|
+
* a `white-space: nowrap; overflow: hidden` line (`scrollWidth > clientWidth`).
|
|
359
|
+
* - `--live-truncated-y` — block clip: a `-webkit-line-clamp` / fixed-height
|
|
360
|
+
* `overflow: hidden` box whose lines run past it (`scrollHeight > clientHeight`).
|
|
361
|
+
*
|
|
362
|
+
* Reveal a "more" affordance, a tooltip trigger, or an expand control only while
|
|
363
|
+
* text is actually cut off — `@container style(--live-truncated: 1) { … }` — and
|
|
364
|
+
* have it disappear the moment a wider box fits the text. Recomputed whenever the
|
|
365
|
+
* box resizes (the shared `ResizeObserver`), so responsive truncation flips both
|
|
366
|
+
* ways as the layout reflows.
|
|
367
|
+
*/
|
|
368
|
+
declare const truncated: Source;
|
|
369
|
+
|
|
350
370
|
/** Every plugin source, for `registerPlugins()` / bulk registration. */
|
|
351
371
|
declare const allPlugins: Source[];
|
|
352
372
|
/**
|
|
@@ -359,4 +379,4 @@ declare const allPlugins: Source[];
|
|
|
359
379
|
*/
|
|
360
380
|
declare function registerPlugins(...sources: Source[]): void;
|
|
361
381
|
|
|
362
|
-
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, videoColor, visualViewport };
|
|
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 };
|
package/dist/plugins.d.ts
CHANGED
|
@@ -347,6 +347,26 @@ declare const imgColor: Source;
|
|
|
347
347
|
*/
|
|
348
348
|
declare const videoColor: Source;
|
|
349
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Whether an element's own text is being clipped right now — the "is the
|
|
352
|
+
* ellipsis showing?" question CSS can ask of a scroll container (`scroll-state()`)
|
|
353
|
+
* but never of overflowing text. Bind it to the element whose overflow you care
|
|
354
|
+
* about; all `1`/`0`:
|
|
355
|
+
*
|
|
356
|
+
* - `--live-truncated` — clipped on *either* axis.
|
|
357
|
+
* - `--live-truncated-x` — inline clip: the classic `text-overflow: ellipsis` on
|
|
358
|
+
* a `white-space: nowrap; overflow: hidden` line (`scrollWidth > clientWidth`).
|
|
359
|
+
* - `--live-truncated-y` — block clip: a `-webkit-line-clamp` / fixed-height
|
|
360
|
+
* `overflow: hidden` box whose lines run past it (`scrollHeight > clientHeight`).
|
|
361
|
+
*
|
|
362
|
+
* Reveal a "more" affordance, a tooltip trigger, or an expand control only while
|
|
363
|
+
* text is actually cut off — `@container style(--live-truncated: 1) { … }` — and
|
|
364
|
+
* have it disappear the moment a wider box fits the text. Recomputed whenever the
|
|
365
|
+
* box resizes (the shared `ResizeObserver`), so responsive truncation flips both
|
|
366
|
+
* ways as the layout reflows.
|
|
367
|
+
*/
|
|
368
|
+
declare const truncated: Source;
|
|
369
|
+
|
|
350
370
|
/** Every plugin source, for `registerPlugins()` / bulk registration. */
|
|
351
371
|
declare const allPlugins: Source[];
|
|
352
372
|
/**
|
|
@@ -359,4 +379,4 @@ declare const allPlugins: Source[];
|
|
|
359
379
|
*/
|
|
360
380
|
declare function registerPlugins(...sources: Source[]): void;
|
|
361
381
|
|
|
362
|
-
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, videoColor, visualViewport };
|
|
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 };
|
package/dist/plugins.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$j}from'./chunk-TRMZLMNW.js';export{a as orientation}from'./chunk-TRMZLMNW.js';import {a as a$k}from'./chunk-SKEEFKDT.js';export{a as motion}from'./chunk-SKEEFKDT.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$b}from'./chunk-KAK6WZS7.js';export{a as pointer}from'./chunk-KAK6WZS7.js';import {a as a$c}from'./chunk-2E2JQAHI.js';export{a as pointerLocal}from'./chunk-2E2JQAHI.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$
|
|
1
|
+
import {a as a$j}from'./chunk-TRMZLMNW.js';export{a as orientation}from'./chunk-TRMZLMNW.js';import {a as a$k}from'./chunk-SKEEFKDT.js';export{a as motion}from'./chunk-SKEEFKDT.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-BS2XX4G3.js';export{a as truncated}from'./chunk-BS2XX4G3.js';import {a as a$b}from'./chunk-KAK6WZS7.js';export{a as pointer}from'./chunk-KAK6WZS7.js';import {a as a$c}from'./chunk-2E2JQAHI.js';export{a as pointerLocal}from'./chunk-2E2JQAHI.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$r}from'./chunk-D24E2DBW.js';import'./chunk-V4OTPLOQ.js';import'./chunk-LTJ2VKVY.js';import {a}from'./chunk-SV76E7NI.js';export{a as scrollVelocity}from'./chunk-SV76E7NI.js';import'./chunk-KG3EF456.js';import'./chunk-T4N6AEOZ.js';import'./chunk-LWKH66VY.js';import {a as a$1}from'./chunk-MDKLN42L.js';export{a as online}from'./chunk-MDKLN42L.js';import {a as a$2}from'./chunk-HKCTBVQT.js';export{a as pageFocused}from'./chunk-HKCTBVQT.js';import'./chunk-EEMKKLRF.js';import {a as a$3}from'./chunk-SFO6H2DN.js';export{a as pageVisible}from'./chunk-SFO6H2DN.js';var j=[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];function fo(...o){for(let T of o.length?o:j)a$r(T);}export{j as allPlugins,fo as registerPlugins};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as truncated}from'./chunk-BS2XX4G3.js';import'./chunk-V4OTPLOQ.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk37L73RJL_cjs=require('./chunk-37L73RJL.cjs');require('./chunk-PQVNJZUW.cjs');Object.defineProperty(exports,"truncated",{enumerable:true,get:function(){return chunk37L73RJL_cjs.a}});
|
package/llms.txt
CHANGED
|
@@ -140,6 +140,7 @@ Import name is camelCase; the key for `propsFor`/`data-props-for` is the dashed
|
|
|
140
140
|
| `img` | `img` | element | `--live-natural-w`, `--live-natural-h` (intrinsic px), `--live-loaded` (1/0), `--live-broken` (1/0). Bind the `<img>` or a container holding one. |
|
|
141
141
|
| `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
142
|
| `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
|
+
| `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. |
|
|
143
144
|
|
|
144
145
|
## Recipes
|
|
145
146
|
|
|
@@ -199,7 +200,7 @@ Discrete reaction with a style query:
|
|
|
199
200
|
- **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).
|
|
200
201
|
- **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.
|
|
201
202
|
- **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.
|
|
202
|
-
- **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`, `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.
|
|
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.
|
|
203
204
|
- **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.
|
|
204
205
|
|
|
205
206
|
## Links
|
package/package.json
CHANGED
package/dist/chunk-BVU5BAWU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a as a$3}from'./chunk-LTJ2VKVY.js';import {b as b$1,a as a$1}from'./chunk-KG3EF456.js';import {a as a$5}from'./chunk-T4N6AEOZ.js';import {a as a$2}from'./chunk-LWKH66VY.js';import {a as a$4}from'./chunk-EEMKKLRF.js';var u;function K(){if(u!==void 0||(u=null,typeof document>"u"||typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in document)))return u;try{let e=new CSSStyleSheet;e.replaceSync(":root{}"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],u=e.cssRules[0].style;}catch{u=null;}return u}function y(e){if(typeof document<"u"&&e===document.documentElement){let t=K();if(t)return t}return e.style}var E=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$1());}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=y(t);for(let[s,i]of r)o.get(s)!==i&&(n.setProperty(s,i),o.set(s,i));}this.pending.clear();}}},g=new E;b$1(g.flush);var S,a=new WeakMap,T=new WeakMap;function H(e,t){S||(S=new ResizeObserver(n=>{for(let s of n){T.set(s.target,s);let i=a.get(s.target);if(i)for(let p of [...i])p(s);}}));let r=a.get(e);r||(a.set(e,r=new Set),S.observe(e)),r.add(t);let o=T.get(e);return o&&t(o),()=>{let n=a.get(e);n&&(n.delete(t),n.size===0&&(a.delete(e),S.unobserve(e)));}}var v,m=new WeakMap,z=new WeakMap,A=[0,.98,.99,.995,.999,1];function w(e,t){v||(v=new IntersectionObserver(n=>{for(let s of n){z.set(s.target,s);let i=m.get(s.target);if(i)for(let p of [...i])p(s);}},{threshold:A}));let r=m.get(e);r||(m.set(e,r=new Set),v.observe(e)),r.add(t);let o=z.get(e);return o&&t(o),()=>{let n=m.get(e);n&&(n.delete(t),n.size===0&&(m.delete(e),v.unobserve(e)));}}var R=new Set;function I(e,t,r){if(R.has(e)||typeof CSS>"u"||typeof CSS.registerProperty!="function")return;R.add(e);let o=t?r?.[t]:void 0,n=t?a$2.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 D={key:"viewport",scope:"global",start(e){let t=()=>{e.write("vw",window.innerWidth),e.write("vh",window.innerHeight);};return t(),a$4("resize",t)}};var O={key:"size",scope:"element",start(e){return H(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$5(o)),e.write("h",a$5(n)),e.write("aspect",n>0?a$5(o/n):0);})}};var h=1;function B(e){let t=e.rootBounds;if(!t)return e.intersectionRatio>=1;let r=e.boundingClientRect;return r.top>=t.top-h&&r.right<=t.right+h&&r.bottom<=t.bottom+h&&r.left>=t.left-h}var P={key:"visibility",scope:"element",gate:false,start(e){let t=false;return e.write("visible",0),e.write("has-entered",0,"const"),w(e.target,r=>{let o=B(r);e.write("visible",o?1:0),o&&!t&&(t=true,e.write("has-entered",1,"const"));})}};var F={key:"range",scope:"element",gate:false,start(e){let t=a$3(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),s=Number(t.value);e.write("value",s),e.write("value-pct",n>o?a$5((s-o)/(n-o)):0);};return r(),t.addEventListener("input",r,{passive:true}),()=>t.removeEventListener("input",r)}};var W={viewport:D,size:O,visibility:P,range:F};var N=()=>{},f=new Map,b={...W};function Me(e){b[e.key]=e;}function ke(e){delete b[e];}function Le(e){return e in b}function xe(e){Object.assign(a$2,e);}function V(e,t,r){return {target:e,config:a$2,write(o,n,s="live"){let i=(s==="const"?a$2.constPrefix:a$2.livePrefix)+o;t.add(i),a$2.typed&&I(i,o,r),g.set(e,i,String(n));}}}function $(e,t,r){if(!(e.scope==="element"&&e.gate!==false&&r!==a$2.root&&typeof IntersectionObserver<"u"))return e.start(t);let n=null,s=()=>{if(!n)try{n=e.start(t);}catch(d){console.error(`[prop-for-that] source "${e.key}" failed to start`,d);}},i=()=>{n?.(),n=null;},p=w(r,d=>{d.isIntersecting?s():i();});return ()=>{p(),i();}}function C(e,t,r){let o=r.get(t);if(!o)return;o.dispose();let n=y(e);for(let s of o.written)n.removeProperty(s),g.forget(e,s);r.delete(t);}function _(e,t){let r=f.get(e);r||f.set(e,r=new Map);let o=[];for(let n of t){if(r.has(n))continue;let s=b[n];if(!s){console.warn(`[prop-for-that] unknown source "${n}"`);continue}let i=new Set,p;try{p=$(s,V(e,i,s.props),e);}catch(d){console.error(`[prop-for-that] source "${n}" failed to start`,d);continue}r.set(n,{dispose:p,written:i}),o.push(n);}return ()=>{let n=f.get(e);if(n){for(let s of o)C(e,s,n);n.size===0&&f.delete(e);}}}function j(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 q(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="string")}function Te(e,t){let r,o;if(t===void 0&&q(e)?(r=a$2.root?[a$2.root]:[],o=e):(r=j(e),o=t??[]),!r.length||!o.length)return N;let n=r.map(s=>_(s,o));return ()=>{for(let s of n)s();}}function ze(e,t){let r=f.get(e);if(r){for(let o of t??[...r.keys()])C(e,o,r);r.size===0&&f.delete(e);}}function He(){for(let[e,t]of f)for(let r of [...t.keys()])C(e,r,t);f.clear();}export{Me as a,ke as b,Le as c,xe as d,Te as e,ze as f,He as g};
|
package/dist/chunk-WZXNO2W7.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var 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 u;function K(){if(u!==void 0||(u=null,typeof document>"u"||typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in document)))return u;try{let e=new CSSStyleSheet;e.replaceSync(":root{}"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],u=e.cssRules[0].style;}catch{u=null;}return u}function y(e){if(typeof document<"u"&&e===document.documentElement){let t=K();if(t)return t}return e.style}var E=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=y(t);for(let[s,i]of r)o.get(s)!==i&&(n.setProperty(s,i),o.set(s,i));}this.pending.clear();}}},g=new E;chunkEYDIF3NM_cjs.b(g.flush);var S,a=new WeakMap,T=new WeakMap;function H(e,t){S||(S=new ResizeObserver(n=>{for(let s of n){T.set(s.target,s);let i=a.get(s.target);if(i)for(let p of [...i])p(s);}}));let r=a.get(e);r||(a.set(e,r=new Set),S.observe(e)),r.add(t);let o=T.get(e);return o&&t(o),()=>{let n=a.get(e);n&&(n.delete(t),n.size===0&&(a.delete(e),S.unobserve(e)));}}var v,m=new WeakMap,z=new WeakMap,A=[0,.98,.99,.995,.999,1];function w(e,t){v||(v=new IntersectionObserver(n=>{for(let s of n){z.set(s.target,s);let i=m.get(s.target);if(i)for(let p of [...i])p(s);}},{threshold:A}));let r=m.get(e);r||(m.set(e,r=new Set),v.observe(e)),r.add(t);let o=z.get(e);return o&&t(o),()=>{let n=m.get(e);n&&(n.delete(t),n.size===0&&(m.delete(e),v.unobserve(e)));}}var R=new Set;function I(e,t,r){if(R.has(e)||typeof CSS>"u"||typeof CSS.registerProperty!="function")return;R.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 D={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 O={key:"size",scope:"element",start(e){return H(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 h=1;function B(e){let t=e.rootBounds;if(!t)return e.intersectionRatio>=1;let r=e.boundingClientRect;return r.top>=t.top-h&&r.right<=t.right+h&&r.bottom<=t.bottom+h&&r.left>=t.left-h}var P={key:"visibility",scope:"element",gate:false,start(e){let t=false;return e.write("visible",0),e.write("has-entered",0,"const"),w(e.target,r=>{let o=B(r);e.write("visible",o?1:0),o&&!t&&(t=true,e.write("has-entered",1,"const"));})}};var F={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),s=Number(t.value);e.write("value",s),e.write("value-pct",n>o?chunk65MXZJBD_cjs.a((s-o)/(n-o)):0);};return r(),t.addEventListener("input",r,{passive:true}),()=>t.removeEventListener("input",r)}};var W={viewport:D,size:O,visibility:P,range:F};var N=()=>{},f=new Map,b={...W};function Me(e){b[e.key]=e;}function ke(e){delete b[e];}function Le(e){return e in b}function xe(e){Object.assign(chunk7L35N3N3_cjs.a,e);}function V(e,t,r){return {target:e,config:chunk7L35N3N3_cjs.a,write(o,n,s="live"){let i=(s==="const"?chunk7L35N3N3_cjs.a.constPrefix:chunk7L35N3N3_cjs.a.livePrefix)+o;t.add(i),chunk7L35N3N3_cjs.a.typed&&I(i,o,r),g.set(e,i,String(n));}}}function $(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,s=()=>{if(!n)try{n=e.start(t);}catch(d){console.error(`[prop-for-that] source "${e.key}" failed to start`,d);}},i=()=>{n?.(),n=null;},p=w(r,d=>{d.isIntersecting?s():i();});return ()=>{p(),i();}}function C(e,t,r){let o=r.get(t);if(!o)return;o.dispose();let n=y(e);for(let s of o.written)n.removeProperty(s),g.forget(e,s);r.delete(t);}function _(e,t){let r=f.get(e);r||f.set(e,r=new Map);let o=[];for(let n of t){if(r.has(n))continue;let s=b[n];if(!s){console.warn(`[prop-for-that] unknown source "${n}"`);continue}let i=new Set,p;try{p=$(s,V(e,i,s.props),e);}catch(d){console.error(`[prop-for-that] source "${n}" failed to start`,d);continue}r.set(n,{dispose:p,written:i}),o.push(n);}return ()=>{let n=f.get(e);if(n){for(let s of o)C(e,s,n);n.size===0&&f.delete(e);}}}function j(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 q(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="string")}function Te(e,t){let r,o;if(t===void 0&&q(e)?(r=chunk7L35N3N3_cjs.a.root?[chunk7L35N3N3_cjs.a.root]:[],o=e):(r=j(e),o=t??[]),!r.length||!o.length)return N;let n=r.map(s=>_(s,o));return ()=>{for(let s of n)s();}}function ze(e,t){let r=f.get(e);if(r){for(let o of t??[...r.keys()])C(e,o,r);r.size===0&&f.delete(e);}}function He(){for(let[e,t]of f)for(let r of [...t.keys()])C(e,r,t);f.clear();}exports.a=Me;exports.b=ke;exports.c=Le;exports.d=xe;exports.e=Te;exports.f=ze;exports.g=He;
|