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.
Files changed (100) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/README.md +26 -3
  3. package/dist/auto.cjs +1 -1
  4. package/dist/auto.js +1 -1
  5. package/dist/{chunk-HKCTBVQT.js → chunk-2NMXY7T4.js} +1 -1
  6. package/dist/{chunk-MDKLN42L.js → chunk-2SIGTGQE.js} +1 -1
  7. package/dist/chunk-3QHCKCTX.cjs +1 -0
  8. package/dist/{chunk-37L73RJL.cjs → chunk-4C255WE6.cjs} +1 -1
  9. package/dist/chunk-4R63TNNO.cjs +1 -0
  10. package/dist/chunk-5PU4B3GP.cjs +1 -0
  11. package/dist/chunk-5VXDAWUI.js +1 -0
  12. package/dist/chunk-6234NJTF.js +1 -0
  13. package/dist/{chunk-3W7CXUWN.cjs → chunk-675RBWFU.cjs} +1 -1
  14. package/dist/{chunk-KAK6WZS7.js → chunk-6M2UIJI5.js} +1 -1
  15. package/dist/chunk-7KEBMJ3O.js +1 -0
  16. package/dist/{chunk-HTKGZP36.cjs → chunk-7LN34C3P.cjs} +1 -1
  17. package/dist/chunk-BF7D5A5Z.cjs +1 -0
  18. package/dist/chunk-DFWBYWE3.cjs +1 -0
  19. package/dist/chunk-DRXR56P5.cjs +1 -0
  20. package/dist/chunk-EXPE3C6O.js +2 -0
  21. package/dist/chunk-HFE2X32G.js +1 -0
  22. package/dist/{chunk-SKEEFKDT.js → chunk-HTO57OQP.js} +1 -1
  23. package/dist/chunk-IFIWYBMP.js +1 -0
  24. package/dist/chunk-JI7NXES2.cjs +1 -0
  25. package/dist/{chunk-BS2XX4G3.js → chunk-KDIZYBPJ.js} +1 -1
  26. package/dist/{chunk-G2BOTBBH.cjs → chunk-KHBJUHJ6.cjs} +1 -1
  27. package/dist/chunk-KSKAQMWJ.cjs +2 -0
  28. package/dist/chunk-N3F2LRDI.js +1 -0
  29. package/dist/{chunk-TRMZLMNW.js → chunk-N745RQIX.js} +1 -1
  30. package/dist/{chunk-SV76E7NI.js → chunk-PS7KTHW4.js} +1 -1
  31. package/dist/{chunk-LP3QQ33O.cjs → chunk-RVZWUZQ2.cjs} +1 -1
  32. package/dist/chunk-SRKAOAXW.cjs +1 -0
  33. package/dist/{chunk-2E2JQAHI.js → chunk-TL5BJFFL.js} +1 -1
  34. package/dist/{chunk-SYKMPPTY.cjs → chunk-XMJ6YRQB.cjs} +1 -1
  35. package/dist/head.cjs +1 -1
  36. package/dist/head.global.js +2 -1
  37. package/dist/head.js +1 -1
  38. package/dist/index.cjs +1 -1
  39. package/dist/index.d.cts +28 -4
  40. package/dist/index.d.ts +28 -4
  41. package/dist/index.global.js +1 -1
  42. package/dist/index.js +1 -1
  43. package/dist/motion-6SENJS5V.cjs +1 -0
  44. package/dist/motion-QDEZZYDF.js +1 -0
  45. package/dist/online-HHJAVPBU.cjs +1 -0
  46. package/dist/online-OWTXHDGG.js +1 -0
  47. package/dist/orientation-LBAL4AXW.js +1 -0
  48. package/dist/orientation-PE3B4RPH.cjs +1 -0
  49. package/dist/page-focused-UK3VPLIG.js +1 -0
  50. package/dist/page-focused-Y74VK25Y.cjs +1 -0
  51. package/dist/page-visible-3YREALOP.cjs +1 -0
  52. package/dist/page-visible-GSBWF44E.js +1 -0
  53. package/dist/plugins.cjs +1 -1
  54. package/dist/plugins.d.cts +64 -2
  55. package/dist/plugins.d.ts +64 -2
  56. package/dist/plugins.js +1 -1
  57. package/dist/pointer-P2B4YDKM.cjs +1 -0
  58. package/dist/pointer-RJIXVFBH.js +1 -0
  59. package/dist/pointer-local-L4EQM2UF.js +1 -0
  60. package/dist/pointer-local-QZJODLIH.cjs +1 -0
  61. package/dist/random-LUAMZ2M7.cjs +1 -0
  62. package/dist/random-O4GDPYJ3.js +1 -0
  63. package/dist/scroll-velocity-X3F22E47.cjs +1 -0
  64. package/dist/scroll-velocity-Y43V5NH2.js +1 -0
  65. package/dist/truncated-23UAUK2L.cjs +1 -0
  66. package/dist/truncated-R3OIXDTH.js +1 -0
  67. package/dist/{types-CudiAlDE.d.cts → types-CyGIcLOq.d.cts} +8 -0
  68. package/dist/{types-CudiAlDE.d.ts → types-CyGIcLOq.d.ts} +8 -0
  69. package/dist/ua-3MLUBLSV.cjs +1 -0
  70. package/dist/ua-3RC4SBYB.js +1 -0
  71. package/llms.txt +34 -5
  72. package/package.json +1 -1
  73. package/dist/chunk-3MK6Q7DX.cjs +0 -1
  74. package/dist/chunk-D24E2DBW.js +0 -1
  75. package/dist/chunk-EEMKKLRF.js +0 -1
  76. package/dist/chunk-OVCZMPYV.cjs +0 -1
  77. package/dist/chunk-OVF4XN2H.cjs +0 -1
  78. package/dist/chunk-PQVNJZUW.cjs +0 -1
  79. package/dist/chunk-QHHF5SEL.cjs +0 -1
  80. package/dist/chunk-SFO6H2DN.js +0 -1
  81. package/dist/chunk-V4OTPLOQ.js +0 -1
  82. package/dist/chunk-WIPJMLJJ.cjs +0 -1
  83. package/dist/motion-GHDWROM2.js +0 -1
  84. package/dist/motion-GMUGWJN3.cjs +0 -1
  85. package/dist/online-KTMCBCXT.cjs +0 -1
  86. package/dist/online-MGYZDLCQ.js +0 -1
  87. package/dist/orientation-27ULVQVJ.js +0 -1
  88. package/dist/orientation-JD23MYZR.cjs +0 -1
  89. package/dist/page-focused-3WLSZDV4.cjs +0 -1
  90. package/dist/page-focused-LBKD6QXG.js +0 -1
  91. package/dist/page-visible-27YKTHKU.js +0 -1
  92. package/dist/page-visible-6PMX575B.cjs +0 -1
  93. package/dist/pointer-3O7MGTQD.js +0 -1
  94. package/dist/pointer-DJSMZGSV.cjs +0 -1
  95. package/dist/pointer-local-6JKSOJZV.cjs +0 -1
  96. package/dist/pointer-local-X5TVNEEJ.js +0 -1
  97. package/dist/scroll-velocity-DGZNNO73.cjs +0 -1
  98. package/dist/scroll-velocity-ZRXPNZG7.js +0 -1
  99. package/dist/truncated-MDPFWGSI.js +0 -1
  100. package/dist/truncated-RUY3JNAX.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,91 @@ 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.11]
12
+
13
+ ### Added
14
+ - **Hoist an element's properties to an ancestor** — `propsFor(el, keys, { to })`
15
+ and the markup twin `data-props-to="<selector>"`. The binding still *observes*
16
+ the bound element; only its writes move. This is the general answer to the
17
+ library's oldest constraint: custom properties inherit **downward only** and
18
+ `@container style()` matches an **ancestor**, so an element could never share
19
+ its own values with a sibling, nor style-query them itself. An `<img>` can now
20
+ hoist `--live-loaded` onto its `<figure>`, where a skeleton overlay, the
21
+ `<figcaption>`, and the image itself can all react to it.
22
+
23
+ It's a binding-layer feature — sources need no changes, they just call
24
+ `ctx.write` — so it works for **every** element source, including the ones the
25
+ existing container-binding trick (`range`, `field`, `img`, `img-color`…) can't
26
+ help: `size`, `visibility`, `pointer-local`, `truncated`. `to` takes a selector
27
+ (resolved once at bind time via `el.closest()`) or an element. No match warns
28
+ and falls back to writing on the element itself; `to` on a `global` source
29
+ warns and is ignored. Two elements hoisting the same key onto one ancestor
30
+ overwrite each other, so that warns too — keep it to one binding per key per
31
+ target. Under `auto`, changing `data-props-to` rebinds every key on that
32
+ element against the new target.
33
+
34
+ ## [0.7.10]
35
+
36
+ ### Added
37
+ - **`random` plugin** (element, opt-in) — the per-element variation CSS can't
38
+ compute for itself yet: three independent rolls, `--const-random`,
39
+ `--const-random-2` and `--const-random-3`, each a float in `[0, 1)`, written
40
+ **once** on the `const` cadence. One rule then varies every element it's bound to
41
+ (size from the first, tint from the second, `animation-delay` phase from the
42
+ third) with no `:nth-child()` ladder; angles, ranges, buckets and coin flips are
43
+ all derivable from these in `calc()`, so they aren't shipped. It sets
44
+ `gate: false`: a gated element source's `start` re-runs on every viewport
45
+ re-entry, which for a generator would hand an element a fresh value each time it
46
+ scrolled back into view, mid-animation.
47
+ - **`configure({ randomSeed })`** — deterministic mode for `random`. Each element's
48
+ rolls derive from the seed plus the element's position in the DOM rather than from
49
+ a shared sequence, so the same markup renders the same "random" layout on every
50
+ load (SSR, screenshot diffing, print), a rebind hands an element the values it had
51
+ before, and bind order is irrelevant — reordering the tree is what reshuffles.
52
+ Unset (the default) keeps rolling from `Math.random()`. The seed is read when a
53
+ source starts, so it can differ between two `propsFor()` calls.
54
+ - **`data-props-seed` on the root `<html>`** — the markup mirror of
55
+ `configure({ randomSeed })` for the `auto` entry, read once on load before any
56
+ source attaches (`<html data-props-seed="42">`). `0` is a valid seed; a
57
+ non-numeric value is ignored with a warning rather than seeding `NaN`.
58
+
59
+ ## [0.7.9]
60
+
61
+ ### Performance
62
+ - **Redundant writes short-circuit at the source boundary.** `ctx.write` now
63
+ memoizes the last raw value (and the prefixed property name) per binding, so
64
+ a write whose value hasn't changed — the steady state for most sources, e.g.
65
+ `pointer-y` during horizontal movement or `scroll-direction` mid-scroll —
66
+ exits after one Map lookup instead of paying the prefix concat,
67
+ `String()` coercion, and Writer queue lookups every time (~5.6× faster on
68
+ that path). Property names are now built once per binding, which also means
69
+ prefix changes via `configure()` no longer affect already-attached bindings —
70
+ consistent with `configure`'s documented "call before attaching" contract.
71
+ - **Allocation-free event/observer dispatch.** The shared `window`/`document`
72
+ listeners and the page-wide Resize/IntersectionObserver callbacks no longer
73
+ copy their handler set on every dispatch (previously one array allocation
74
+ per event — including every `pointermove` — and per observer entry). Set
75
+ iteration already tolerates handlers unsubscribing mid-dispatch.
76
+
77
+ ## [0.7.8]
78
+
79
+ ### Added
80
+ - **`ua` plugin** (global) + **`head` constants** — low-entropy device & browser
81
+ identity JS can read but CSS can't, written **once** as `--const-ua-*`:
82
+ `--const-ua-platform` (`macos` / `windows` / `linux` / `android` / `ios` /
83
+ `chromeos` / `unknown`), `--const-ua-browser` (`chrome` / `edge` / `firefox` /
84
+ `safari` / `opera` / `samsung` / `unknown`), `--const-ua-engine` (`blink` /
85
+ `gecko` / `webkit` / `unknown`), `--const-ua-version` (browser major, `0` if
86
+ unknown), `--const-ua-mobile` (`1` / `0`). Branch on the client with no JS or
87
+ media query — `@container style(--const-ua-engine: webkit) { … }`. Prefers
88
+ structured UA Client Hints (`navigator.userAgentData`, Chromium) and falls back
89
+ to a best-effort `userAgent`-string sniff on Firefox / Safari. **Low-entropy
90
+ only** — no `getHighEntropyValues`, device model, full version, or architecture,
91
+ so it adds no fingerprinting surface beyond what request headers already expose.
92
+ The same five constants are also written **synchronously** by the `head` entry
93
+ (`import 'prop-for-that/head'`) for FOUC-safe, pre-paint branching. Typed mode
94
+ registers the strings as `<custom-ident>` and the numbers as `<integer>`.
95
+
11
96
  ## [0.7.7]
12
97
 
13
98
  ### Added
package/README.md CHANGED
@@ -40,6 +40,29 @@ input {
40
40
 
41
41
  Bind any element with `data-props-for="key …"` and read its `--live-*` properties in CSS. That's the whole idea.
42
42
 
43
+ ### Hoisting & style queries
44
+
45
+ Custom properties inherit **downward only**, and `@container style()` matches against an **ancestor** — so an element can't style-query the values written on itself, and its siblings never see them. Add `data-props-to="<selector>"` (or `{ to }` imperatively) to observe the element but write its properties on the nearest matching ancestor:
46
+
47
+ ```html
48
+ <figure>
49
+ <img data-props-for="img" data-props-to="figure" src="art.jpg" />
50
+ <figcaption>…</figcaption>
51
+ </figure>
52
+ ```
53
+
54
+ ```css
55
+ /* the skeleton is a sibling of the <img> — it can only react because the
56
+ property lives on the <figure> */
57
+ @container style(--live-loaded: 0) {
58
+ .skeleton { opacity: 1; }
59
+ }
60
+ ```
61
+
62
+ ```js
63
+ propsFor(img, ['img', 'size'], { to: 'figure' }) // selector, or an element
64
+ ```
65
+
43
66
  ## Why
44
67
 
45
68
  - **CSS does the work.** No per-element event handlers or render loops — bind once, compose in stylesheets.
@@ -52,7 +75,7 @@ Bind any element with `data-props-for="key …"` and read its `--live-*` propert
52
75
 
53
76
  **Core** (built in): viewport, element size, visibility, and `<input type="range">` values.
54
77
 
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.
78
+ **Plugins** (opt-in): pointer position, battery, network, online status, page focus & visibility, navigation type, page meta tags, low-entropy user-agent (OS / browser / engine / version / mobile), 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, dominant + accent colors extracted from images and video, and per-element random rolls (optionally seeded) — 20+ in all.
56
79
 
57
80
  → Every source, every property, and live demos are in the **[docs](https://prop-for-that.netlify.app/docsite/reference/plugins/)**.
58
81
 
@@ -60,9 +83,9 @@ Bind any element with `data-props-for="key …"` and read its `--live-*` propert
60
83
 
61
84
  | Import | What it does |
62
85
  | --- | --- |
63
- | `prop-for-that/auto` | Zero-config & declarative: binds every `data-props-for` element — globals included, via `<html data-props-for="…">` — loading plugin sources on demand, kept in sync with the DOM. Use as `<script type="module">`. |
86
+ | `prop-for-that/auto` | Zero-config & declarative: binds every `data-props-for` element — globals included, via `<html data-props-for="…">`, hoisting with `data-props-to` — loading plugin sources on demand, kept in sync with the DOM. Use as `<script type="module">`. |
64
87
  | `prop-for-that` | Imperative API — `propsFor()`, `register()`, `configure()` — for explicit control and teardown. |
65
- | `prop-for-that/head` | Synchronous, FOUC-safe constants (scrollbar width & overlay preference, DPR, core count, device memory) before first paint. |
88
+ | `prop-for-that/head` | Synchronous, FOUC-safe constants (scrollbar width & overlay preference, DPR, core count, device memory, low-entropy user-agent) before first paint. |
66
89
  | `prop-for-that/plugins` | The opt-in plugin catalog. |
67
90
 
68
91
  > `auto` sees the **light DOM only** (not shadow roots — bind those with `propsFor(el, …)`), and lazy-loads plugin chunks, so from a CDN use one that serves the `dist` files verbatim (unpkg / jsDelivr), not a rewriting CDN.
package/dist/auto.cjs CHANGED
@@ -1 +1 @@
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());
1
+ 'use strict';var chunk5PU4B3GP_cjs=require('./chunk-5PU4B3GP.cjs');require('./chunk-DFWBYWE3.cjs'),require('./chunk-HHINWX7L.cjs'),require('./chunk-EYDIF3NM.cjs'),require('./chunk-65MXZJBD.cjs'),require('./chunk-7L35N3N3.cjs'),require('./chunk-DRXR56P5.cjs');var g={"scroll-velocity":()=>import('./scroll-velocity-X3F22E47.cjs').then(e=>e.scrollVelocity),online:()=>import('./online-HHJAVPBU.cjs').then(e=>e.online),"page-focused":()=>import('./page-focused-Y74VK25Y.cjs').then(e=>e.pageFocused),"page-visible":()=>import('./page-visible-3YREALOP.cjs').then(e=>e.pageVisible),"nav-type":()=>import('./nav-type-MFJJDDPZ.cjs').then(e=>e.navType),meta:()=>import('./meta-U2EHV4AM.cjs').then(e=>e.meta),network:()=>import('./network-DPAAEK2S.cjs').then(e=>e.network),battery:()=>import('./battery-DQQ2NOGC.cjs').then(e=>e.battery),clock:()=>import('./clock-EVSBOOMJ.cjs').then(e=>e.clock),fps:()=>import('./fps-Q3ITXSJO.cjs').then(e=>e.fps),"visual-viewport":()=>import('./visual-viewport-MKUHWUQT.cjs').then(e=>e.visualViewport),keyboard:()=>import('./keyboard-6ZGB2LAD.cjs').then(e=>e.keyboard),pointer:()=>import('./pointer-P2B4YDKM.cjs').then(e=>e.pointer),"pointer-local":()=>import('./pointer-local-QZJODLIH.cjs').then(e=>e.pointerLocal),media:()=>import('./media-XS6ADFFY.cjs').then(e=>e.media),field:()=>import('./field-4MBM2R7N.cjs').then(e=>e.field),"field-state":()=>import('./field-state-NXSK6ZZW.cjs').then(e=>e.fieldState),"form-state":()=>import('./form-state-FJZINKN7.cjs').then(e=>e.formState),select:()=>import('./select-LMRGCCLB.cjs').then(e=>e.select),"color-input":()=>import('./color-input-SYYBVLZM.cjs').then(e=>e.colorInput),orientation:()=>import('./orientation-PE3B4RPH.cjs').then(e=>e.orientation),motion:()=>import('./motion-6SENJS5V.cjs').then(e=>e.motion),geo:()=>import('./geo-CMG7QJ6S.cjs').then(e=>e.geo),"cpu-pressure":()=>import('./cpu-pressure-FXZDL5IE.cjs').then(e=>e.cpuPressure),img:()=>import('./img-6F5QAPW3.cjs').then(e=>e.img),"img-color":()=>import('./img-color-MBEU42DF.cjs').then(e=>e.imgColor),"video-color":()=>import('./video-color-B37Z5OBY.cjs').then(e=>e.videoColor),truncated:()=>import('./truncated-23UAUK2L.cjs').then(e=>e.truncated),ua:()=>import('./ua-3MLUBLSV.cjs').then(e=>e.ua),random:()=>import('./random-LUAMZ2M7.cjs').then(e=>e.random)};var i=new WeakMap,l=new Map;function b(e){return (e.dataset.propsFor??"").split(/\s+/).filter(Boolean)}function L(e){if(chunk5PU4B3GP_cjs.c(e))return null;let t=g[e];if(!t)return null;let o=l.get(e);return o||(o=t().then(r=>{chunk5PU4B3GP_cjs.a(r);}).catch(r=>{l.delete(e),console.error(`[prop-for-that] failed to load plugin "${e}"`,r);}),l.set(e,o)),o}function M(e,t,o){let r=L(t);if(!r){chunk5PU4B3GP_cjs.e(e,[t],{to:o});return}r.then(()=>{let n=i.get(e);chunk5PU4B3GP_cjs.c(t)&&n&&n.to===o&&n.keys.includes(t)&&chunk5PU4B3GP_cjs.e(e,[t],{to:o});});}function p(e){let t=b(e),o=e.dataset.propsTo||void 0,r=i.get(e),n=r?.keys??[],u=r!==void 0&&r.to!==o,f=u?n:n.filter(s=>!t.includes(s)),E=u?t:t.filter(s=>!n.includes(s));f.length&&chunk5PU4B3GP_cjs.f(e,f),t.length?i.set(e,{keys:t,to:o}):i.delete(e);for(let s of E)M(e,s,o);}function v(e){let t=i.get(e);t&&(chunk5PU4B3GP_cjs.f(e,t.keys),i.delete(e));}function T(e){e instanceof HTMLElement&&(e.hasAttribute("data-props-for")&&p(e),e.querySelectorAll("[data-props-for]").forEach(p));}function H(e){e instanceof HTMLElement&&(v(e),e.querySelectorAll("[data-props-for]").forEach(v));}function y(){document.documentElement.hasAttribute("data-props-typed")&&chunk5PU4B3GP_cjs.d({typed:true});let e=document.documentElement.dataset.propsSeed;if(e){let t=Number(e);Number.isFinite(t)?chunk5PU4B3GP_cjs.d({randomSeed:t}):console.warn(`[prop-for-that] ignoring non-numeric data-props-seed="${e}"`);}document.querySelectorAll("[data-props-for]").forEach(p),new MutationObserver(t=>{for(let o of t){if(o.type==="attributes"&&o.target instanceof HTMLElement){p(o.target);continue}o.removedNodes.forEach(H),o.addedNodes.forEach(T);}}).observe(document.documentElement,{subtree:true,childList:true,attributes:true,attributeFilter:["data-props-for","data-props-to"]});}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y,{once:true}):y());
package/dist/auto.js CHANGED
@@ -1 +1 @@
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());
1
+ import {d,f,e,c,a}from'./chunk-N3F2LRDI.js';import'./chunk-6234NJTF.js';import'./chunk-LTJ2VKVY.js';import'./chunk-KG3EF456.js';import'./chunk-T4N6AEOZ.js';import'./chunk-LWKH66VY.js';import'./chunk-7KEBMJ3O.js';var g={"scroll-velocity":()=>import('./scroll-velocity-Y43V5NH2.js').then(e=>e.scrollVelocity),online:()=>import('./online-OWTXHDGG.js').then(e=>e.online),"page-focused":()=>import('./page-focused-UK3VPLIG.js').then(e=>e.pageFocused),"page-visible":()=>import('./page-visible-GSBWF44E.js').then(e=>e.pageVisible),"nav-type":()=>import('./nav-type-S4MHMDHS.js').then(e=>e.navType),meta:()=>import('./meta-VSAZR4JL.js').then(e=>e.meta),network:()=>import('./network-BHUTXTX7.js').then(e=>e.network),battery:()=>import('./battery-CDMJLP4C.js').then(e=>e.battery),clock:()=>import('./clock-LYF2IHGE.js').then(e=>e.clock),fps:()=>import('./fps-IGSZPFLV.js').then(e=>e.fps),"visual-viewport":()=>import('./visual-viewport-GNJTAHPT.js').then(e=>e.visualViewport),keyboard:()=>import('./keyboard-YJ7S6XPJ.js').then(e=>e.keyboard),pointer:()=>import('./pointer-RJIXVFBH.js').then(e=>e.pointer),"pointer-local":()=>import('./pointer-local-L4EQM2UF.js').then(e=>e.pointerLocal),media:()=>import('./media-RDQ3WR22.js').then(e=>e.media),field:()=>import('./field-6USMKGKM.js').then(e=>e.field),"field-state":()=>import('./field-state-YLUDK3XS.js').then(e=>e.fieldState),"form-state":()=>import('./form-state-Q4SCA6TH.js').then(e=>e.formState),select:()=>import('./select-H3CFIVK3.js').then(e=>e.select),"color-input":()=>import('./color-input-STV57DGE.js').then(e=>e.colorInput),orientation:()=>import('./orientation-LBAL4AXW.js').then(e=>e.orientation),motion:()=>import('./motion-QDEZZYDF.js').then(e=>e.motion),geo:()=>import('./geo-MXO5OMVO.js').then(e=>e.geo),"cpu-pressure":()=>import('./cpu-pressure-WCDHVDRP.js').then(e=>e.cpuPressure),img:()=>import('./img-PYBNG6OU.js').then(e=>e.img),"img-color":()=>import('./img-color-VW3XMATY.js').then(e=>e.imgColor),"video-color":()=>import('./video-color-ZMRKDZFO.js').then(e=>e.videoColor),truncated:()=>import('./truncated-R3OIXDTH.js').then(e=>e.truncated),ua:()=>import('./ua-3RC4SBYB.js').then(e=>e.ua),random:()=>import('./random-O4GDPYJ3.js').then(e=>e.random)};var i=new WeakMap,l=new Map;function b(e){return (e.dataset.propsFor??"").split(/\s+/).filter(Boolean)}function L(e){if(c(e))return null;let t=g[e];if(!t)return null;let o=l.get(e);return o||(o=t().then(r=>{a(r);}).catch(r=>{l.delete(e),console.error(`[prop-for-that] failed to load plugin "${e}"`,r);}),l.set(e,o)),o}function M(e$1,t,o){let r=L(t);if(!r){e(e$1,[t],{to:o});return}r.then(()=>{let n=i.get(e$1);c(t)&&n&&n.to===o&&n.keys.includes(t)&&e(e$1,[t],{to:o});});}function p(e){let t=b(e),o=e.dataset.propsTo||void 0,r=i.get(e),n=r?.keys??[],u=r!==void 0&&r.to!==o,f$1=u?n:n.filter(s=>!t.includes(s)),E=u?t:t.filter(s=>!n.includes(s));f$1.length&&f(e,f$1),t.length?i.set(e,{keys:t,to:o}):i.delete(e);for(let s of E)M(e,s,o);}function v(e){let t=i.get(e);t&&(f(e,t.keys),i.delete(e));}function T(e){e instanceof HTMLElement&&(e.hasAttribute("data-props-for")&&p(e),e.querySelectorAll("[data-props-for]").forEach(p));}function H(e){e instanceof HTMLElement&&(v(e),e.querySelectorAll("[data-props-for]").forEach(v));}function y(){document.documentElement.hasAttribute("data-props-typed")&&d({typed:true});let e=document.documentElement.dataset.propsSeed;if(e){let t=Number(e);Number.isFinite(t)?d({randomSeed:t}):console.warn(`[prop-for-that] ignoring non-numeric data-props-seed="${e}"`);}document.querySelectorAll("[data-props-for]").forEach(p),new MutationObserver(t=>{for(let o of t){if(o.type==="attributes"&&o.target instanceof HTMLElement){p(o.target);continue}o.removedNodes.forEach(H),o.addedNodes.forEach(T);}}).observe(document.documentElement,{subtree:true,childList:true,attributes:true,attributeFilter:["data-props-for","data-props-to"]});}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y,{once:true}):y());
@@ -1 +1 @@
1
- import {a}from'./chunk-EEMKKLRF.js';var u={key:"page-focused",scope:"global",start(c){let o=()=>c.write("page-focused",document.hasFocus()?1:0);o();let t=a("focus",o),r=a("blur",o);return ()=>{t(),r();}}};export{u as a};
1
+ import {a}from'./chunk-7KEBMJ3O.js';var u={key:"page-focused",scope:"global",start(c){let o=()=>c.write("page-focused",document.hasFocus()?1:0);o();let t=a("focus",o),r=a("blur",o);return ()=>{t(),r();}}};export{u as a};
@@ -1 +1 @@
1
- import {a}from'./chunk-EEMKKLRF.js';var f={key:"online",scope:"global",start(e){let o=()=>e.write("online",navigator.onLine?1:0);o();let t=a("online",o),i=a("offline",o);return ()=>{t(),i();}}};export{f as a};
1
+ import {a}from'./chunk-7KEBMJ3O.js';var f={key:"online",scope:"global",start(e){let o=()=>e.write("online",navigator.onLine?1:0);o();let t=a("online",o),i=a("offline",o);return ()=>{t(),i();}}};export{f as a};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkKSKAQMWJ_cjs=require('./chunk-KSKAQMWJ.cjs');var u={key:"ua",scope:"global",props:{"ua-platform":{syntax:"<custom-ident>",initial:"unknown"},"ua-browser":{syntax:"<custom-ident>",initial:"unknown"},"ua-engine":{syntax:"<custom-ident>",initial:"unknown"},"ua-version":{syntax:"<integer>",initial:"0"},"ua-mobile":{syntax:"<integer>",initial:"0"}},start(n){let{platform:t,browser:i,engine:o,version:r,mobile:a}=chunkKSKAQMWJ_cjs.a();return n.write("ua-platform",t,"const"),n.write("ua-browser",i,"const"),n.write("ua-engine",o,"const"),n.write("ua-version",r,"const"),n.write("ua-mobile",a,"const"),()=>{}}};exports.a=u;
@@ -1 +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;
1
+ 'use strict';var chunkDFWBYWE3_cjs=require('./chunk-DFWBYWE3.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(),chunkDFWBYWE3_cjs.a(e,r)}};exports.a=i;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkDRXR56P5_cjs=require('./chunk-DRXR56P5.cjs');var f={key:"online",scope:"global",start(e){let o=()=>e.write("online",navigator.onLine?1:0);o();let t=chunkDRXR56P5_cjs.a("online",o),i=chunkDRXR56P5_cjs.a("offline",o);return ()=>{t(),i();}}};exports.a=f;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkDFWBYWE3_cjs=require('./chunk-DFWBYWE3.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'),chunkDRXR56P5_cjs=require('./chunk-DRXR56P5.cjs');var a;function O(){if(a!==void 0||(a=null,typeof document>"u"||typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in document)))return a;try{let e=new CSSStyleSheet;e.replaceSync(":root{}"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],a=e.cssRules[0].style;}catch{a=null;}return a}function y(e){if(typeof document<"u"&&e===document.documentElement){let t=O();if(t)return t}return e.style}var v=class{pending=new Map;last=new WeakMap;set(t,r,n){let o=this.pending.get(t);if(o?.has(r)){o.set(r,n);return}this.last.get(t)?.get(r)!==n&&(o?o.set(r,n):this.pending.set(t,new Map([[r,n]])),chunkEYDIF3NM_cjs.a());}forget(t,r){this.last.get(t)?.delete(r);let n=this.pending.get(t);n&&(n.delete(r),n.size===0&&this.pending.delete(t));}flush=()=>{if(this.pending.size!==0){for(let[t,r]of this.pending){let n=this.last.get(t);n||this.last.set(t,n=new Map);let o=y(t);for(let[s,i]of r)n.get(s)!==i&&(o.setProperty(s,i),n.set(s,i));}this.pending.clear();}}},S=new v;chunkEYDIF3NM_cjs.b(S.flush);var C=new Set;function x(e,t,r){if(C.has(e)||typeof CSS>"u"||typeof CSS.registerProperty!="function")return;C.add(e);let n=t?r?.[t]:void 0,o=t?chunk7L35N3N3_cjs.a.defaults?.[t]:void 0;try{CSS.registerProperty({name:e,syntax:n?.syntax??"<number>",inherits:n?.inherits??!0,initialValue:o!=null?String(o):n?.initial??"0"});}catch{}}var P={key:"viewport",scope:"global",start(e){let t=()=>{e.write("vw",window.innerWidth),e.write("vh",window.innerHeight);};return t(),chunkDRXR56P5_cjs.a("resize",t)}};var D={key:"size",scope:"element",start(e){return chunkDFWBYWE3_cjs.a(e.target,t=>{let r=t.borderBoxSize?.[0],n=r?r.inlineSize:t.contentRect.width,o=r?r.blockSize:t.contentRect.height;e.write("w",chunk65MXZJBD_cjs.a(n)),e.write("h",chunk65MXZJBD_cjs.a(o)),e.write("aspect",o>0?chunk65MXZJBD_cjs.a(n/o):0);})}};var w=1;function K(e){let t=e.rootBounds;if(!t)return e.intersectionRatio>=1;let r=e.boundingClientRect;return r.top>=t.top-w&&r.right<=t.right+w&&r.bottom<=t.bottom+w&&r.left>=t.left-w}var z={key:"visibility",scope:"element",gate:false,start(e){let t=false;return e.write("visible",0),e.write("has-entered",0,"const"),chunkDFWBYWE3_cjs.b(e.target,r=>{let n=K(r);e.write("visible",n?1:0),n&&!t&&(t=true,e.write("has-entered",1,"const"));})}};var R={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 n=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>n?chunk65MXZJBD_cjs.a((s-n)/(o-n)):0);};return r(),t.addEventListener("input",r,{passive:true}),()=>t.removeEventListener("input",r)}};var F={viewport:P,size:D,visibility:z,range:R};var W=()=>{},u=new Map,E=new WeakMap,h={...F};function Me(e){h[e.key]=e;}function Le(e){delete h[e];}function Te(e){return e in h}function be(e){Object.assign(chunk7L35N3N3_cjs.a,e);}function $(e,t,r,n){let o={live:new Map,const:new Map};return {target:e,config:chunk7L35N3N3_cjs.a,write(s,i,c="live"){let p=o[c],l=p.get(s);if(l){if(l.raw===i)return;l.raw=i;}else {let m=(c==="const"?chunk7L35N3N3_cjs.a.constPrefix:chunk7L35N3N3_cjs.a.livePrefix)+s;p.set(s,l={raw:i,prop:m}),r.add(m);}chunk7L35N3N3_cjs.a.typed&&x(l.prop,s,n),S.set(t,l.prop,String(i));}}}function A(e,t,r){if(!(e.scope==="element"&&e.gate!==false&&r!==chunk7L35N3N3_cjs.a.root&&typeof IntersectionObserver<"u"))return e.start(t);let o=null,s=()=>{if(!o)try{o=e.start(t);}catch(p){console.error(`[prop-for-that] source "${e.key}" failed to start`,p);}},i=()=>{o?.(),o=null;},c=chunkDFWBYWE3_cjs.b(r,p=>{p.isIntersecting?s():i();});return ()=>{c(),i();}}function M(e,t,r){let n=r.get(t);if(!n)return;n.dispose();let{writeTarget:o}=n,s=y(o);for(let i of n.written)s.removeProperty(i),S.forget(o,i);o!==e&&E.get(o)?.delete(t),r.delete(t);}function B(e,t){if(typeof t!="string")return t;let r=e.closest(t);return r||(console.warn(`[prop-for-that] no ancestor matches "${t}" \u2014 writing on the element itself`),e)}function V(e,t){let r=E.get(e);r||E.set(e,r=new Set),r.has(t)&&console.warn(`[prop-for-that] "${t}" is already hoisted onto this element \u2014 the bindings will overwrite each other`,e),r.add(t);}function _(e,t,r){let n=u.get(e);n||u.set(e,n=new Map);let o=r?B(e,r):e,s=[];for(let i of t){if(n.has(i))continue;let c=h[i];if(!c){console.warn(`[prop-for-that] unknown source "${i}"`);continue}let p=o;p!==e&&c.scope==="global"&&(console.warn(`[prop-for-that] "to" ignored for global source "${i}"`),p=e);let l=new Set,m;try{m=A(c,$(e,p,l,c.props),e);}catch(I){console.error(`[prop-for-that] source "${i}" failed to start`,I);continue}p!==e&&V(p,i),n.set(i,{dispose:m,written:l,writeTarget:p}),s.push(i);}return ()=>{let i=u.get(e);if(i){for(let c of s)M(e,c,i);i.size===0&&u.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 He(e,t,r){let n,o;if(t===void 0&&q(e)?(n=chunk7L35N3N3_cjs.a.root?[chunk7L35N3N3_cjs.a.root]:[],o=e):(n=j(e),o=t??[]),!n.length||!o.length)return W;let s=n.map(i=>_(i,o,r?.to));return ()=>{for(let i of s)i();}}function ke(e,t){let r=u.get(e);if(r){for(let n of t??[...r.keys()])M(e,n,r);r.size===0&&u.delete(e);}}function Ce(){for(let[e,t]of u)for(let r of [...t.keys()])M(e,r,t);u.clear();}exports.a=Me;exports.b=Le;exports.c=Te;exports.d=be;exports.e=He;exports.f=ke;exports.g=Ce;
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-EXPE3C6O.js';var u={key:"ua",scope:"global",props:{"ua-platform":{syntax:"<custom-ident>",initial:"unknown"},"ua-browser":{syntax:"<custom-ident>",initial:"unknown"},"ua-engine":{syntax:"<custom-ident>",initial:"unknown"},"ua-version":{syntax:"<integer>",initial:"0"},"ua-mobile":{syntax:"<integer>",initial:"0"}},start(n){let{platform:t,browser:i,engine:o,version:r,mobile:a$1}=a();return n.write("ua-platform",t,"const"),n.write("ua-browser",i,"const"),n.write("ua-engine",o,"const"),n.write("ua-version",r,"const"),n.write("ua-mobile",a$1,"const"),()=>{}}};export{u as a};
@@ -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};
@@ -1 +1 @@
1
- 'use strict';var chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunkQHHF5SEL_cjs=require('./chunk-QHHF5SEL.cjs');var c={key:"pointer",scope:"global",start(o){return chunkQHHF5SEL_cjs.a("pointermove",n=>{let e=n;o.write("pointer-x",e.clientX),o.write("pointer-y",e.clientY),o.write("pointer-x-ratio",chunk65MXZJBD_cjs.a(e.clientX/window.innerWidth)),o.write("pointer-y-ratio",chunk65MXZJBD_cjs.a(e.clientY/window.innerHeight));})}};exports.a=c;
1
+ 'use strict';var chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunkDRXR56P5_cjs=require('./chunk-DRXR56P5.cjs');var c={key:"pointer",scope:"global",start(o){return chunkDRXR56P5_cjs.a("pointermove",n=>{let e=n;o.write("pointer-x",e.clientX),o.write("pointer-y",e.clientY),o.write("pointer-x-ratio",chunk65MXZJBD_cjs.a(e.clientX/window.innerWidth)),o.write("pointer-y-ratio",chunk65MXZJBD_cjs.a(e.clientY/window.innerHeight));})}};exports.a=c;
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-T4N6AEOZ.js';import {a}from'./chunk-EEMKKLRF.js';var c={key:"pointer",scope:"global",start(o){return a("pointermove",n=>{let e=n;o.write("pointer-x",e.clientX),o.write("pointer-y",e.clientY),o.write("pointer-x-ratio",a$1(e.clientX/window.innerWidth)),o.write("pointer-y-ratio",a$1(e.clientY/window.innerHeight));})}};export{c as a};
1
+ import {a as a$1}from'./chunk-T4N6AEOZ.js';import {a}from'./chunk-7KEBMJ3O.js';var c={key:"pointer",scope:"global",start(o){return a("pointermove",n=>{let e=n;o.write("pointer-x",e.clientX),o.write("pointer-y",e.clientY),o.write("pointer-x-ratio",a$1(e.clientX/window.innerWidth)),o.write("pointer-y-ratio",a$1(e.clientY/window.innerHeight));})}};export{c as a};
@@ -0,0 +1 @@
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};
@@ -1 +1 @@
1
- 'use strict';var chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunkQHHF5SEL_cjs=require('./chunk-QHHF5SEL.cjs');var p={key:"orientation",scope:"global",start(t){return typeof DeviceOrientationEvent>"u"?()=>{}:chunkQHHF5SEL_cjs.a("deviceorientation",r=>{let o=r;t.write("orient-alpha",chunk65MXZJBD_cjs.a(o.alpha??0)),t.write("orient-beta",chunk65MXZJBD_cjs.a(o.beta??0)),t.write("orient-gamma",chunk65MXZJBD_cjs.a(o.gamma??0));})}};exports.a=p;
1
+ 'use strict';var chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunkDRXR56P5_cjs=require('./chunk-DRXR56P5.cjs');var p={key:"orientation",scope:"global",start(t){return typeof DeviceOrientationEvent>"u"?()=>{}:chunkDRXR56P5_cjs.a("deviceorientation",r=>{let o=r;t.write("orient-alpha",chunk65MXZJBD_cjs.a(o.alpha??0)),t.write("orient-beta",chunk65MXZJBD_cjs.a(o.beta??0)),t.write("orient-gamma",chunk65MXZJBD_cjs.a(o.gamma??0));})}};exports.a=p;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkDRXR56P5_cjs=require('./chunk-DRXR56P5.cjs');var u={key:"page-focused",scope:"global",start(c){let o=()=>c.write("page-focused",document.hasFocus()?1:0);o();let t=chunkDRXR56P5_cjs.a("focus",o),r=chunkDRXR56P5_cjs.a("blur",o);return ()=>{t(),r();}}};exports.a=u;
@@ -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
+ '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;
@@ -0,0 +1,2 @@
1
+ var d={platform:"unknown",browser:"unknown",engine:"unknown",version:0,mobile:0},c={android:"android","chrome-os":"chromeos","chromium-os":"chromeos",ios:"ios",linux:"linux",macos:"macos",windows:"windows"},u=n=>n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");function f(n){let r=n.toLowerCase();return r.includes("edge")||r.includes("edg")?"edge":r.includes("opera")||r.includes("opr")?"opera":r.includes("samsung")?"samsung":r.includes("firefox")?"firefox":r.includes("chrome")||r.includes("chromium")?"chrome":r.includes("safari")?"safari":"unknown"}function g(n){let r=n.brands;if(!r||!r.length)return null;let i=r.filter(o=>!/not.?a.?brand/i.test(o.brand)),e=i.find(o=>!/chromium/i.test(o.brand))??i[0];return e?{platform:c[u(n.platform??"")]??"unknown",browser:f(e.brand),engine:"blink",version:parseInt(e.version,10)||0,mobile:n.mobile?1:0}:null}var l=[{id:"edge",test:/Edg(?:iOS|A)?\//,ver:/Edg(?:iOS|A)?\/(\d+)/},{id:"opera",test:/OPR\/|OPiOS\/|Opera\//,ver:/(?:OPR|OPiOS|Opera)\/(\d+)/},{id:"samsung",test:/SamsungBrowser\//,ver:/SamsungBrowser\/(\d+)/},{id:"firefox",test:/Firefox\/|FxiOS\//,ver:/(?:Firefox|FxiOS)\/(\d+)/},{id:"chrome",test:/Chrome\/|CriOS\//,ver:/(?:Chrome|CriOS)\/(\d+)/},{id:"safari",test:/Safari\//,ver:/Version\/(\d+)/}];function m(n){let r=/Android/.test(n)?"android":/iPhone|iPad|iPod/.test(n)?"ios":/Macintosh|Mac OS X/.test(n)?"macos":/Windows/.test(n)?"windows":/CrOS/.test(n)?"chromeos":/Linux/.test(n)?"linux":"unknown",i=l.find(a=>a.test.test(n)),e=i?.id??"unknown",o=i&&parseInt(n.match(i.ver)?.[1]??"",10)||0,t=r==="ios"?"webkit":e==="firefox"?"gecko":e==="safari"?"webkit":e==="unknown"?"unknown":"blink",s=/Mobi|Android|iPhone|iPod/.test(n)?1:0;return {platform:r,browser:e,engine:t,version:o,mobile:s}}function b(){if(typeof navigator>"u")return d;let n=navigator.userAgentData;return (n?g(n):null)??m(navigator.userAgent||"")}
2
+ export{b as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-T4N6AEOZ.js';var s={key:"random",scope:"element",gate:false,props:{random:{syntax:"<number>",initial:"0"},"random-2":{syntax:"<number>",initial:"0"},"random-3":{syntax:"<number>",initial:"0"}},start(n){let{randomSeed:t}=n.config,e=t===void 0?()=>Math.random():l(u(n.target,t));return n.write("random",a(e()),"const"),n.write("random-2",a(e()),"const"),n.write("random-3",a(e()),"const"),()=>{}}};function l(n){let t=n|0;return ()=>{t=t+1831565813|0;let e=t^t>>>15;return e=Math.imul(e,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function u(n,t){let e=t>>>0^2166136261;for(let o=n;o;o=o.parentElement){let a=o.tagName;for(let r=0;r<a.length;r++)e=Math.imul(e^a.charCodeAt(r),16777619);let i=0;for(let r=o.previousElementSibling;r;r=r.previousElementSibling)i++;e=Math.imul(e^i,16777619);}return e>>>0}export{s as a};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-T4N6AEOZ.js';import {a}from'./chunk-EEMKKLRF.js';var m={key:"motion",scope:"global",start(e){return typeof DeviceMotionEvent>"u"?()=>{}:a("devicemotion",i=>{let t=i.accelerationIncludingGravity;e.write("accel-x",a$1(t?.x??0)),e.write("accel-y",a$1(t?.y??0)),e.write("accel-z",a$1(t?.z??0));})}};export{m as a};
1
+ import {a as a$1}from'./chunk-T4N6AEOZ.js';import {a}from'./chunk-7KEBMJ3O.js';var m={key:"motion",scope:"global",start(e){return typeof DeviceMotionEvent>"u"?()=>{}:a("devicemotion",i=>{let t=i.accelerationIncludingGravity;e.write("accel-x",a$1(t?.x??0)),e.write("accel-y",a$1(t?.y??0)),e.write("accel-z",a$1(t?.z??0));})}};export{m as a};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
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;
@@ -1 +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};
1
+ import {a}from'./chunk-6234NJTF.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};
@@ -1 +1 @@
1
- 'use strict';var chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunkQHHF5SEL_cjs=require('./chunk-QHHF5SEL.cjs');var m={key:"motion",scope:"global",start(e){return typeof DeviceMotionEvent>"u"?()=>{}:chunkQHHF5SEL_cjs.a("devicemotion",i=>{let t=i.accelerationIncludingGravity;e.write("accel-x",chunk65MXZJBD_cjs.a(t?.x??0)),e.write("accel-y",chunk65MXZJBD_cjs.a(t?.y??0)),e.write("accel-z",chunk65MXZJBD_cjs.a(t?.z??0));})}};exports.a=m;
1
+ 'use strict';var chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunkDRXR56P5_cjs=require('./chunk-DRXR56P5.cjs');var m={key:"motion",scope:"global",start(e){return typeof DeviceMotionEvent>"u"?()=>{}:chunkDRXR56P5_cjs.a("devicemotion",i=>{let t=i.accelerationIncludingGravity;e.write("accel-x",chunk65MXZJBD_cjs.a(t?.x??0)),e.write("accel-y",chunk65MXZJBD_cjs.a(t?.y??0)),e.write("accel-z",chunk65MXZJBD_cjs.a(t?.z??0));})}};exports.a=m;
@@ -0,0 +1,2 @@
1
+ 'use strict';var d={platform:"unknown",browser:"unknown",engine:"unknown",version:0,mobile:0},c={android:"android","chrome-os":"chromeos","chromium-os":"chromeos",ios:"ios",linux:"linux",macos:"macos",windows:"windows"},u=n=>n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");function f(n){let r=n.toLowerCase();return r.includes("edge")||r.includes("edg")?"edge":r.includes("opera")||r.includes("opr")?"opera":r.includes("samsung")?"samsung":r.includes("firefox")?"firefox":r.includes("chrome")||r.includes("chromium")?"chrome":r.includes("safari")?"safari":"unknown"}function g(n){let r=n.brands;if(!r||!r.length)return null;let i=r.filter(o=>!/not.?a.?brand/i.test(o.brand)),e=i.find(o=>!/chromium/i.test(o.brand))??i[0];return e?{platform:c[u(n.platform??"")]??"unknown",browser:f(e.brand),engine:"blink",version:parseInt(e.version,10)||0,mobile:n.mobile?1:0}:null}var l=[{id:"edge",test:/Edg(?:iOS|A)?\//,ver:/Edg(?:iOS|A)?\/(\d+)/},{id:"opera",test:/OPR\/|OPiOS\/|Opera\//,ver:/(?:OPR|OPiOS|Opera)\/(\d+)/},{id:"samsung",test:/SamsungBrowser\//,ver:/SamsungBrowser\/(\d+)/},{id:"firefox",test:/Firefox\/|FxiOS\//,ver:/(?:Firefox|FxiOS)\/(\d+)/},{id:"chrome",test:/Chrome\/|CriOS\//,ver:/(?:Chrome|CriOS)\/(\d+)/},{id:"safari",test:/Safari\//,ver:/Version\/(\d+)/}];function m(n){let r=/Android/.test(n)?"android":/iPhone|iPad|iPod/.test(n)?"ios":/Macintosh|Mac OS X/.test(n)?"macos":/Windows/.test(n)?"windows":/CrOS/.test(n)?"chromeos":/Linux/.test(n)?"linux":"unknown",i=l.find(a=>a.test.test(n)),e=i?.id??"unknown",o=i&&parseInt(n.match(i.ver)?.[1]??"",10)||0,t=r==="ios"?"webkit":e==="firefox"?"gecko":e==="safari"?"webkit":e==="unknown"?"unknown":"blink",s=/Mobi|Android|iPhone|iPod/.test(n)?1:0;return {platform:r,browser:e,engine:t,version:o,mobile:s}}function b(){if(typeof navigator>"u")return d;let n=navigator.userAgentData;return (n?g(n):null)??m(navigator.userAgent||"")}
2
+ exports.a=b;
@@ -0,0 +1 @@
1
+ import {b as b$1,a as a$4}from'./chunk-6234NJTF.js';import {a as a$3}from'./chunk-LTJ2VKVY.js';import {b,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$6}from'./chunk-7KEBMJ3O.js';var a;function O(){if(a!==void 0||(a=null,typeof document>"u"||typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in document)))return a;try{let e=new CSSStyleSheet;e.replaceSync(":root{}"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],a=e.cssRules[0].style;}catch{a=null;}return a}function y(e){if(typeof document<"u"&&e===document.documentElement){let t=O();if(t)return t}return e.style}var v=class{pending=new Map;last=new WeakMap;set(t,r,n){let o=this.pending.get(t);if(o?.has(r)){o.set(r,n);return}this.last.get(t)?.get(r)!==n&&(o?o.set(r,n):this.pending.set(t,new Map([[r,n]])),a$1());}forget(t,r){this.last.get(t)?.delete(r);let n=this.pending.get(t);n&&(n.delete(r),n.size===0&&this.pending.delete(t));}flush=()=>{if(this.pending.size!==0){for(let[t,r]of this.pending){let n=this.last.get(t);n||this.last.set(t,n=new Map);let o=y(t);for(let[s,i]of r)n.get(s)!==i&&(o.setProperty(s,i),n.set(s,i));}this.pending.clear();}}},S=new v;b(S.flush);var C=new Set;function x(e,t,r){if(C.has(e)||typeof CSS>"u"||typeof CSS.registerProperty!="function")return;C.add(e);let n=t?r?.[t]:void 0,o=t?a$2.defaults?.[t]:void 0;try{CSS.registerProperty({name:e,syntax:n?.syntax??"<number>",inherits:n?.inherits??!0,initialValue:o!=null?String(o):n?.initial??"0"});}catch{}}var P={key:"viewport",scope:"global",start(e){let t=()=>{e.write("vw",window.innerWidth),e.write("vh",window.innerHeight);};return t(),a$6("resize",t)}};var D={key:"size",scope:"element",start(e){return a$4(e.target,t=>{let r=t.borderBoxSize?.[0],n=r?r.inlineSize:t.contentRect.width,o=r?r.blockSize:t.contentRect.height;e.write("w",a$5(n)),e.write("h",a$5(o)),e.write("aspect",o>0?a$5(n/o):0);})}};var w=1;function K(e){let t=e.rootBounds;if(!t)return e.intersectionRatio>=1;let r=e.boundingClientRect;return r.top>=t.top-w&&r.right<=t.right+w&&r.bottom<=t.bottom+w&&r.left>=t.left-w}var z={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 n=K(r);e.write("visible",n?1:0),n&&!t&&(t=true,e.write("has-entered",1,"const"));})}};var R={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 n=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>n?a$5((s-n)/(o-n)):0);};return r(),t.addEventListener("input",r,{passive:true}),()=>t.removeEventListener("input",r)}};var F={viewport:P,size:D,visibility:z,range:R};var W=()=>{},u=new Map,E=new WeakMap,h={...F};function Me(e){h[e.key]=e;}function Le(e){delete h[e];}function Te(e){return e in h}function be(e){Object.assign(a$2,e);}function $(e,t,r,n){let o={live:new Map,const:new Map};return {target:e,config:a$2,write(s,i,c="live"){let p=o[c],l=p.get(s);if(l){if(l.raw===i)return;l.raw=i;}else {let m=(c==="const"?a$2.constPrefix:a$2.livePrefix)+s;p.set(s,l={raw:i,prop:m}),r.add(m);}a$2.typed&&x(l.prop,s,n),S.set(t,l.prop,String(i));}}}function A(e,t,r){if(!(e.scope==="element"&&e.gate!==false&&r!==a$2.root&&typeof IntersectionObserver<"u"))return e.start(t);let o=null,s=()=>{if(!o)try{o=e.start(t);}catch(p){console.error(`[prop-for-that] source "${e.key}" failed to start`,p);}},i=()=>{o?.(),o=null;},c=b$1(r,p=>{p.isIntersecting?s():i();});return ()=>{c(),i();}}function M(e,t,r){let n=r.get(t);if(!n)return;n.dispose();let{writeTarget:o}=n,s=y(o);for(let i of n.written)s.removeProperty(i),S.forget(o,i);o!==e&&E.get(o)?.delete(t),r.delete(t);}function B(e,t){if(typeof t!="string")return t;let r=e.closest(t);return r||(console.warn(`[prop-for-that] no ancestor matches "${t}" \u2014 writing on the element itself`),e)}function V(e,t){let r=E.get(e);r||E.set(e,r=new Set),r.has(t)&&console.warn(`[prop-for-that] "${t}" is already hoisted onto this element \u2014 the bindings will overwrite each other`,e),r.add(t);}function _(e,t,r){let n=u.get(e);n||u.set(e,n=new Map);let o=r?B(e,r):e,s=[];for(let i of t){if(n.has(i))continue;let c=h[i];if(!c){console.warn(`[prop-for-that] unknown source "${i}"`);continue}let p=o;p!==e&&c.scope==="global"&&(console.warn(`[prop-for-that] "to" ignored for global source "${i}"`),p=e);let l=new Set,m;try{m=A(c,$(e,p,l,c.props),e);}catch(I){console.error(`[prop-for-that] source "${i}" failed to start`,I);continue}p!==e&&V(p,i),n.set(i,{dispose:m,written:l,writeTarget:p}),s.push(i);}return ()=>{let i=u.get(e);if(i){for(let c of s)M(e,c,i);i.size===0&&u.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 He(e,t,r){let n,o;if(t===void 0&&q(e)?(n=a$2.root?[a$2.root]:[],o=e):(n=j(e),o=t??[]),!n.length||!o.length)return W;let s=n.map(i=>_(i,o,r?.to));return ()=>{for(let i of s)i();}}function ke(e,t){let r=u.get(e);if(r){for(let n of t??[...r.keys()])M(e,n,r);r.size===0&&u.delete(e);}}function Ce(){for(let[e,t]of u)for(let r of [...t.keys()])M(e,r,t);u.clear();}export{Me as a,Le as b,Te as c,be as d,He as e,ke as f,Ce as g};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-T4N6AEOZ.js';import {a}from'./chunk-EEMKKLRF.js';var p={key:"orientation",scope:"global",start(t){return typeof DeviceOrientationEvent>"u"?()=>{}:a("deviceorientation",r=>{let o=r;t.write("orient-alpha",a$1(o.alpha??0)),t.write("orient-beta",a$1(o.beta??0)),t.write("orient-gamma",a$1(o.gamma??0));})}};export{p as a};
1
+ import {a as a$1}from'./chunk-T4N6AEOZ.js';import {a}from'./chunk-7KEBMJ3O.js';var p={key:"orientation",scope:"global",start(t){return typeof DeviceOrientationEvent>"u"?()=>{}:a("deviceorientation",r=>{let o=r;t.write("orient-alpha",a$1(o.alpha??0)),t.write("orient-beta",a$1(o.beta??0)),t.write("orient-gamma",a$1(o.gamma??0));})}};export{p as a};
@@ -1 +1 @@
1
- import {c}from'./chunk-KG3EF456.js';import {a as a$1}from'./chunk-T4N6AEOZ.js';import {a}from'./chunk-EEMKKLRF.js';var u={key:"scroll-velocity",scope:"global",start(r){let e=window.scrollY,l=0,o=null,a$2=()=>{let c=window.scrollY,w=c-e;e=c,l=w||l*.8,Math.abs(l)<.01&&(l=0);let t=a$1(l);r.write("scroll-velocity",t),r.write("scroll-direction",Math.sign(t)),t===0&&o&&(o(),o=null);},m=()=>{o||(o=c(a$2));};r.write("scroll-velocity",0),r.write("scroll-direction",0);let p=a("scroll",m);return ()=>{p(),o?.();}}};export{u as a};
1
+ import {c}from'./chunk-KG3EF456.js';import {a as a$1}from'./chunk-T4N6AEOZ.js';import {a}from'./chunk-7KEBMJ3O.js';var u={key:"scroll-velocity",scope:"global",start(r){let e=window.scrollY,l=0,o=null,a$2=()=>{let c=window.scrollY,w=c-e;e=c,l=w||l*.8,Math.abs(l)<.01&&(l=0);let t=a$1(l);r.write("scroll-velocity",t),r.write("scroll-direction",Math.sign(t)),t===0&&o&&(o(),o=null);},m=()=>{o||(o=c(a$2));};r.write("scroll-velocity",0),r.write("scroll-direction",0);let p=a("scroll",m);return ()=>{p(),o?.();}}};export{u as a};
@@ -1 +1 @@
1
- 'use strict';var chunkEYDIF3NM_cjs=require('./chunk-EYDIF3NM.cjs'),chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunkQHHF5SEL_cjs=require('./chunk-QHHF5SEL.cjs');var u={key:"scroll-velocity",scope:"global",start(r){let e=window.scrollY,l=0,o=null,a=()=>{let c=window.scrollY,w=c-e;e=c,l=w||l*.8,Math.abs(l)<.01&&(l=0);let t=chunk65MXZJBD_cjs.a(l);r.write("scroll-velocity",t),r.write("scroll-direction",Math.sign(t)),t===0&&o&&(o(),o=null);},m=()=>{o||(o=chunkEYDIF3NM_cjs.c(a));};r.write("scroll-velocity",0),r.write("scroll-direction",0);let p=chunkQHHF5SEL_cjs.a("scroll",m);return ()=>{p(),o?.();}}};exports.a=u;
1
+ 'use strict';var chunkEYDIF3NM_cjs=require('./chunk-EYDIF3NM.cjs'),chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunkDRXR56P5_cjs=require('./chunk-DRXR56P5.cjs');var u={key:"scroll-velocity",scope:"global",start(r){let e=window.scrollY,l=0,o=null,a=()=>{let c=window.scrollY,w=c-e;e=c,l=w||l*.8,Math.abs(l)<.01&&(l=0);let t=chunk65MXZJBD_cjs.a(l);r.write("scroll-velocity",t),r.write("scroll-direction",Math.sign(t)),t===0&&o&&(o(),o=null);},m=()=>{o||(o=chunkEYDIF3NM_cjs.c(a));};r.write("scroll-velocity",0),r.write("scroll-direction",0);let p=chunkDRXR56P5_cjs.a("scroll",m);return ()=>{p(),o?.();}}};exports.a=u;
@@ -0,0 +1 @@
1
+ 'use strict';var chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs');var s={key:"random",scope:"element",gate:false,props:{random:{syntax:"<number>",initial:"0"},"random-2":{syntax:"<number>",initial:"0"},"random-3":{syntax:"<number>",initial:"0"}},start(n){let{randomSeed:t}=n.config,e=t===void 0?()=>Math.random():l(u(n.target,t));return n.write("random",chunk65MXZJBD_cjs.a(e()),"const"),n.write("random-2",chunk65MXZJBD_cjs.a(e()),"const"),n.write("random-3",chunk65MXZJBD_cjs.a(e()),"const"),()=>{}}};function l(n){let t=n|0;return ()=>{t=t+1831565813|0;let e=t^t>>>15;return e=Math.imul(e,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function u(n,t){let e=t>>>0^2166136261;for(let o=n;o;o=o.parentElement){let a=o.tagName;for(let r=0;r<a.length;r++)e=Math.imul(e^a.charCodeAt(r),16777619);let i=0;for(let r=o.previousElementSibling;r;r=r.previousElementSibling)i++;e=Math.imul(e^i,16777619);}return e>>>0}exports.a=s;
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-T4N6AEOZ.js';import {a}from'./chunk-EEMKKLRF.js';var h={key:"pointer-local",scope:"element",start(t){let p=t.target;return a("pointermove",l=>{let r=l,o=p.getBoundingClientRect(),e=o.width>0?(r.clientX-o.left)/o.width:0,n=o.height>0?(r.clientY-o.top)/o.height:0,s=e>=0&&e<=1&&n>=0&&n<=1;t.write("local-pointer-x-ratio",a$1(e)),t.write("local-pointer-y-ratio",a$1(n)),t.write("local-pointer-inside",s?1:0);})}};export{h as a};
1
+ import {a as a$1}from'./chunk-T4N6AEOZ.js';import {a}from'./chunk-7KEBMJ3O.js';var h={key:"pointer-local",scope:"element",start(t){let p=t.target;return a("pointermove",l=>{let r=l,o=p.getBoundingClientRect(),e=o.width>0?(r.clientX-o.left)/o.width:0,n=o.height>0?(r.clientY-o.top)/o.height:0,s=e>=0&&e<=1&&n>=0&&n<=1;t.write("local-pointer-x-ratio",a$1(e)),t.write("local-pointer-y-ratio",a$1(n)),t.write("local-pointer-inside",s?1:0);})}};export{h as a};
@@ -1 +1 @@
1
- 'use strict';var chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunkQHHF5SEL_cjs=require('./chunk-QHHF5SEL.cjs');var h={key:"pointer-local",scope:"element",start(t){let p=t.target;return chunkQHHF5SEL_cjs.a("pointermove",l=>{let r=l,o=p.getBoundingClientRect(),e=o.width>0?(r.clientX-o.left)/o.width:0,n=o.height>0?(r.clientY-o.top)/o.height:0,s=e>=0&&e<=1&&n>=0&&n<=1;t.write("local-pointer-x-ratio",chunk65MXZJBD_cjs.a(e)),t.write("local-pointer-y-ratio",chunk65MXZJBD_cjs.a(n)),t.write("local-pointer-inside",s?1:0);})}};exports.a=h;
1
+ 'use strict';var chunk65MXZJBD_cjs=require('./chunk-65MXZJBD.cjs'),chunkDRXR56P5_cjs=require('./chunk-DRXR56P5.cjs');var h={key:"pointer-local",scope:"element",start(t){let p=t.target;return chunkDRXR56P5_cjs.a("pointermove",l=>{let r=l,o=p.getBoundingClientRect(),e=o.width>0?(r.clientX-o.left)/o.width:0,n=o.height>0?(r.clientY-o.top)/o.height:0,s=e>=0&&e<=1&&n>=0&&n<=1;t.write("local-pointer-x-ratio",chunk65MXZJBD_cjs.a(e)),t.write("local-pointer-y-ratio",chunk65MXZJBD_cjs.a(n)),t.write("local-pointer-inside",s?1:0);})}};exports.a=h;
package/dist/head.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunk7L35N3N3_cjs=require('./chunk-7L35N3N3.cjs');function c(){let r=chunk7L35N3N3_cjs.a.root,o=(n,s)=>r.style.setProperty(chunk7L35N3N3_cjs.a.constPrefix+n,String(s)),t=document.createElement("div");t.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden;scrollbar-width:auto",(document.body??r).appendChild(t);let i=t.offsetWidth-t.clientWidth;o("scrollbar-w",i),o("scrollbar-overlay",i===0?1:0),t.style.scrollbarWidth="thin",o("scrollbar-thin-w",t.offsetWidth-t.clientWidth),t.remove(),o("dpr",window.devicePixelRatio||1),o("cores",navigator.hardwareConcurrency||0),o("mem",navigator.deviceMemory||0);}typeof document<"u"&&c();
1
+ 'use strict';var chunkKSKAQMWJ_cjs=require('./chunk-KSKAQMWJ.cjs'),chunk7L35N3N3_cjs=require('./chunk-7L35N3N3.cjs');function c(){let i=chunk7L35N3N3_cjs.a.root,o=(a,l)=>i.style.setProperty(chunk7L35N3N3_cjs.a.constPrefix+a,String(l)),e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden;scrollbar-width:auto",(document.body??i).appendChild(e);let n=e.offsetWidth-e.clientWidth;o("scrollbar-w",n),o("scrollbar-overlay",n===0?1:0),e.style.scrollbarWidth="thin",o("scrollbar-thin-w",e.offsetWidth-e.clientWidth),e.remove(),o("dpr",window.devicePixelRatio||1),o("cores",navigator.hardwareConcurrency||0),o("mem",navigator.deviceMemory||0);let t=chunkKSKAQMWJ_cjs.a();o("ua-platform",t.platform),o("ua-browser",t.browser),o("ua-engine",t.engine),o("ua-version",t.version),o("ua-mobile",t.mobile);}typeof document<"u"&&c();
@@ -1 +1,2 @@
1
- (function(){'use strict';var o={constPrefix:"--const-",root:typeof document<"u"?document.documentElement:void 0};function c(){let i=o.root,e=(r,s)=>i.style.setProperty(o.constPrefix+r,String(s)),t=document.createElement("div");t.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden;scrollbar-width:auto",(document.body??i).appendChild(t);let n=t.offsetWidth-t.clientWidth;e("scrollbar-w",n),e("scrollbar-overlay",n===0?1:0),t.style.scrollbarWidth="thin",e("scrollbar-thin-w",t.offsetWidth-t.clientWidth),t.remove(),e("dpr",window.devicePixelRatio||1),e("cores",navigator.hardwareConcurrency||0),e("mem",navigator.deviceMemory||0);}typeof document<"u"&&c();})();
1
+ (function(){'use strict';var d={constPrefix:"--const-",root:typeof document<"u"?document.documentElement:void 0};var l={platform:"unknown",browser:"unknown",engine:"unknown",version:0,mobile:0},f={android:"android","chrome-os":"chromeos","chromium-os":"chromeos",ios:"ios",linux:"linux",macos:"macos",windows:"windows"},u=n=>n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");function m(n){let e=n.toLowerCase();return e.includes("edge")||e.includes("edg")?"edge":e.includes("opera")||e.includes("opr")?"opera":e.includes("samsung")?"samsung":e.includes("firefox")?"firefox":e.includes("chrome")||e.includes("chromium")?"chrome":e.includes("safari")?"safari":"unknown"}function g(n){let e=n.brands;if(!e||!e.length)return null;let r=e.filter(t=>!/not.?a.?brand/i.test(t.brand)),o=r.find(t=>!/chromium/i.test(t.brand))??r[0];return o?{platform:f[u(n.platform??"")]??"unknown",browser:m(o.brand),engine:"blink",version:parseInt(o.version,10)||0,mobile:n.mobile?1:0}:null}var b=[{id:"edge",test:/Edg(?:iOS|A)?\//,ver:/Edg(?:iOS|A)?\/(\d+)/},{id:"opera",test:/OPR\/|OPiOS\/|Opera\//,ver:/(?:OPR|OPiOS|Opera)\/(\d+)/},{id:"samsung",test:/SamsungBrowser\//,ver:/SamsungBrowser\/(\d+)/},{id:"firefox",test:/Firefox\/|FxiOS\//,ver:/(?:Firefox|FxiOS)\/(\d+)/},{id:"chrome",test:/Chrome\/|CriOS\//,ver:/(?:Chrome|CriOS)\/(\d+)/},{id:"safari",test:/Safari\//,ver:/Version\/(\d+)/}];function p(n){let e=/Android/.test(n)?"android":/iPhone|iPad|iPod/.test(n)?"ios":/Macintosh|Mac OS X/.test(n)?"macos":/Windows/.test(n)?"windows":/CrOS/.test(n)?"chromeos":/Linux/.test(n)?"linux":"unknown",r=b.find(a=>a.test.test(n)),o=r?.id??"unknown",t=r&&parseInt(n.match(r.ver)?.[1]??"",10)||0,i=e==="ios"?"webkit":o==="firefox"?"gecko":o==="safari"?"webkit":o==="unknown"?"unknown":"blink",s=/Mobi|Android|iPhone|iPod/.test(n)?1:0;return {platform:e,browser:o,engine:i,version:t,mobile:s}}function c(){if(typeof navigator>"u")return l;let n=navigator.userAgentData;return (n?g(n):null)??p(navigator.userAgent||"")}function w(){let n=d.root,e=(s,a)=>n.style.setProperty(d.constPrefix+s,String(a)),r=document.createElement("div");r.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden;scrollbar-width:auto",(document.body??n).appendChild(r);let t=r.offsetWidth-r.clientWidth;e("scrollbar-w",t),e("scrollbar-overlay",t===0?1:0),r.style.scrollbarWidth="thin",e("scrollbar-thin-w",r.offsetWidth-r.clientWidth),r.remove(),e("dpr",window.devicePixelRatio||1),e("cores",navigator.hardwareConcurrency||0),e("mem",navigator.deviceMemory||0);let i=c();e("ua-platform",i.platform),e("ua-browser",i.browser),e("ua-engine",i.engine),e("ua-version",i.version),e("ua-mobile",i.mobile);}typeof document<"u"&&w();
2
+ })();
package/dist/head.js CHANGED
@@ -1 +1 @@
1
- import {a}from'./chunk-LWKH66VY.js';function c(){let r=a.root,o=(n,s)=>r.style.setProperty(a.constPrefix+n,String(s)),t=document.createElement("div");t.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden;scrollbar-width:auto",(document.body??r).appendChild(t);let i=t.offsetWidth-t.clientWidth;o("scrollbar-w",i),o("scrollbar-overlay",i===0?1:0),t.style.scrollbarWidth="thin",o("scrollbar-thin-w",t.offsetWidth-t.clientWidth),t.remove(),o("dpr",window.devicePixelRatio||1),o("cores",navigator.hardwareConcurrency||0),o("mem",navigator.deviceMemory||0);}typeof document<"u"&&c();
1
+ import {a as a$1}from'./chunk-EXPE3C6O.js';import {a}from'./chunk-LWKH66VY.js';function c(){let i=a.root,o=(a$1,l)=>i.style.setProperty(a.constPrefix+a$1,String(l)),e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden;scrollbar-width:auto",(document.body??i).appendChild(e);let n=e.offsetWidth-e.clientWidth;o("scrollbar-w",n),o("scrollbar-overlay",n===0?1:0),e.style.scrollbarWidth="thin",o("scrollbar-thin-w",e.offsetWidth-e.clientWidth),e.remove(),o("dpr",window.devicePixelRatio||1),o("cores",navigator.hardwareConcurrency||0),o("mem",navigator.deviceMemory||0);let t=a$1();o("ua-platform",t.platform),o("ua-browser",t.browser),o("ua-engine",t.engine),o("ua-version",t.version),o("ua-mobile",t.mobile);}typeof document<"u"&&c();
package/dist/index.cjs CHANGED
@@ -1 +1 @@
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}});
1
+ 'use strict';var chunk5PU4B3GP_cjs=require('./chunk-5PU4B3GP.cjs');require('./chunk-DFWBYWE3.cjs'),require('./chunk-HHINWX7L.cjs');var chunkEYDIF3NM_cjs=require('./chunk-EYDIF3NM.cjs');require('./chunk-65MXZJBD.cjs'),require('./chunk-7L35N3N3.cjs'),require('./chunk-DRXR56P5.cjs');Object.defineProperty(exports,"configure",{enumerable:true,get:function(){return chunk5PU4B3GP_cjs.d}});Object.defineProperty(exports,"isRegistered",{enumerable:true,get:function(){return chunk5PU4B3GP_cjs.c}});Object.defineProperty(exports,"propsFor",{enumerable:true,get:function(){return chunk5PU4B3GP_cjs.e}});Object.defineProperty(exports,"register",{enumerable:true,get:function(){return chunk5PU4B3GP_cjs.a}});Object.defineProperty(exports,"reset",{enumerable:true,get:function(){return chunk5PU4B3GP_cjs.g}});Object.defineProperty(exports,"unbind",{enumerable:true,get:function(){return chunk5PU4B3GP_cjs.f}});Object.defineProperty(exports,"unregister",{enumerable:true,get:function(){return chunk5PU4B3GP_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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as Config, D as Disposer, S as Source } from './types-CudiAlDE.cjs';
2
- export { C as Cadence, P as PropSpec, b as SourceContext } from './types-CudiAlDE.cjs';
1
+ import { a as Config, D as Disposer, S as Source } from './types-CyGIcLOq.cjs';
2
+ export { C as Cadence, P as PropSpec, b as SourceContext } from './types-CyGIcLOq.cjs';
3
3
 
4
4
  /** Freeze the loop: no sampling, no flushing, until `resume()`. Idempotent. */
5
5
  declare function pause(): void;
@@ -9,6 +9,25 @@ declare function resume(): void;
9
9
  type CoreKey = 'viewport' | 'size' | 'visibility' | 'range';
10
10
  /** Built-in keys autocomplete; any registered/plugin key (a string) is allowed. */
11
11
  type SourceKey = CoreKey | (string & {});
12
+ /** Options for the element-targeted `propsFor`. */
13
+ interface PropsForOptions {
14
+ /**
15
+ * Write this binding's properties on an **ancestor** instead of the bound
16
+ * element — a selector resolved with `el.closest()`, or an explicit element.
17
+ * The bound element is still the one observed.
18
+ *
19
+ * Custom properties inherit downward only, and `@container style()` matches
20
+ * against an *ancestor*, so an element can neither style-query nor share the
21
+ * values written on itself. Hoisting to a wrapper is what lets the element's
22
+ * siblings — and the element itself — react to them.
23
+ *
24
+ * No `closest()` match warns and falls back to the element itself; `to` on a
25
+ * `global` source warns and is ignored. Keep it to **one binding per key per
26
+ * target**: two elements hoisting the same key to one ancestor overwrite each
27
+ * other (dev-time warning).
28
+ */
29
+ to?: Element | string;
30
+ }
12
31
  /** Register a custom or plugin source so it can be used by key. */
13
32
  declare function register(source: Source): void;
14
33
  /** Remove a previously registered source key. */
@@ -25,15 +44,20 @@ declare function configure(opts: Partial<Config>): void;
25
44
  * propsFor(el, ['size']) // → el
26
45
  * propsFor(els, ['visibility']) // → each element in a NodeList / array
27
46
  *
47
+ * `opts.to` hoists the writes to an ancestor (selector or element) while still
48
+ * observing the bound element, so siblings can read the values:
49
+ *
50
+ * propsFor(img, ['img'], { to: 'figure' })
51
+ *
28
52
  * Returns a disposer that tears down exactly what this call started and removes
29
53
  * the custom properties it wrote.
30
54
  */
31
55
  declare function propsFor(keys: SourceKey[]): Disposer;
32
- declare function propsFor(target: Element | NodeList | HTMLCollection | Element[], keys: SourceKey[]): Disposer;
56
+ declare function propsFor(target: Element | NodeList | HTMLCollection | Element[], keys: SourceKey[], opts?: PropsForOptions): Disposer;
33
57
  /** Detach specific keys from an element, or all of them. Removes written props. */
34
58
  declare function unbind(target: HTMLElement, keys?: string[]): void;
35
59
  /** Tear down every active binding (and, via ref-counting, the shared observers
36
60
  * and listeners they used). Useful for SPA route changes, HMR, and tests. */
37
61
  declare function reset(): void;
38
62
 
39
- export { Config, Disposer, Source, type SourceKey, configure, isRegistered, pause, propsFor, register, reset, resume, unbind, unregister };
63
+ export { Config, Disposer, type PropsForOptions, Source, type SourceKey, configure, isRegistered, pause, propsFor, register, reset, resume, unbind, unregister };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as Config, D as Disposer, S as Source } from './types-CudiAlDE.js';
2
- export { C as Cadence, P as PropSpec, b as SourceContext } from './types-CudiAlDE.js';
1
+ import { a as Config, D as Disposer, S as Source } from './types-CyGIcLOq.js';
2
+ export { C as Cadence, P as PropSpec, b as SourceContext } from './types-CyGIcLOq.js';
3
3
 
4
4
  /** Freeze the loop: no sampling, no flushing, until `resume()`. Idempotent. */
5
5
  declare function pause(): void;
@@ -9,6 +9,25 @@ declare function resume(): void;
9
9
  type CoreKey = 'viewport' | 'size' | 'visibility' | 'range';
10
10
  /** Built-in keys autocomplete; any registered/plugin key (a string) is allowed. */
11
11
  type SourceKey = CoreKey | (string & {});
12
+ /** Options for the element-targeted `propsFor`. */
13
+ interface PropsForOptions {
14
+ /**
15
+ * Write this binding's properties on an **ancestor** instead of the bound
16
+ * element — a selector resolved with `el.closest()`, or an explicit element.
17
+ * The bound element is still the one observed.
18
+ *
19
+ * Custom properties inherit downward only, and `@container style()` matches
20
+ * against an *ancestor*, so an element can neither style-query nor share the
21
+ * values written on itself. Hoisting to a wrapper is what lets the element's
22
+ * siblings — and the element itself — react to them.
23
+ *
24
+ * No `closest()` match warns and falls back to the element itself; `to` on a
25
+ * `global` source warns and is ignored. Keep it to **one binding per key per
26
+ * target**: two elements hoisting the same key to one ancestor overwrite each
27
+ * other (dev-time warning).
28
+ */
29
+ to?: Element | string;
30
+ }
12
31
  /** Register a custom or plugin source so it can be used by key. */
13
32
  declare function register(source: Source): void;
14
33
  /** Remove a previously registered source key. */
@@ -25,15 +44,20 @@ declare function configure(opts: Partial<Config>): void;
25
44
  * propsFor(el, ['size']) // → el
26
45
  * propsFor(els, ['visibility']) // → each element in a NodeList / array
27
46
  *
47
+ * `opts.to` hoists the writes to an ancestor (selector or element) while still
48
+ * observing the bound element, so siblings can read the values:
49
+ *
50
+ * propsFor(img, ['img'], { to: 'figure' })
51
+ *
28
52
  * Returns a disposer that tears down exactly what this call started and removes
29
53
  * the custom properties it wrote.
30
54
  */
31
55
  declare function propsFor(keys: SourceKey[]): Disposer;
32
- declare function propsFor(target: Element | NodeList | HTMLCollection | Element[], keys: SourceKey[]): Disposer;
56
+ declare function propsFor(target: Element | NodeList | HTMLCollection | Element[], keys: SourceKey[], opts?: PropsForOptions): Disposer;
33
57
  /** Detach specific keys from an element, or all of them. Removes written props. */
34
58
  declare function unbind(target: HTMLElement, keys?: string[]): void;
35
59
  /** Tear down every active binding (and, via ref-counting, the shared observers
36
60
  * and listeners they used). Useful for SPA route changes, HMR, and tests. */
37
61
  declare function reset(): void;
38
62
 
39
- export { Config, Disposer, Source, type SourceKey, configure, isRegistered, pause, propsFor, register, reset, resume, unbind, unregister };
63
+ export { Config, Disposer, type PropsForOptions, Source, type SourceKey, configure, isRegistered, pause, propsFor, register, reset, resume, unbind, unregister };