prop-for-that 0.7.7 → 0.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +85 -0
- package/README.md +26 -3
- package/dist/auto.cjs +1 -1
- package/dist/auto.js +1 -1
- package/dist/{chunk-HKCTBVQT.js → chunk-2NMXY7T4.js} +1 -1
- package/dist/{chunk-MDKLN42L.js → chunk-2SIGTGQE.js} +1 -1
- package/dist/chunk-3QHCKCTX.cjs +1 -0
- package/dist/{chunk-37L73RJL.cjs → chunk-4C255WE6.cjs} +1 -1
- package/dist/chunk-4R63TNNO.cjs +1 -0
- package/dist/chunk-5PU4B3GP.cjs +1 -0
- package/dist/chunk-5VXDAWUI.js +1 -0
- package/dist/chunk-6234NJTF.js +1 -0
- package/dist/{chunk-3W7CXUWN.cjs → chunk-675RBWFU.cjs} +1 -1
- package/dist/{chunk-KAK6WZS7.js → chunk-6M2UIJI5.js} +1 -1
- package/dist/chunk-7KEBMJ3O.js +1 -0
- package/dist/{chunk-HTKGZP36.cjs → chunk-7LN34C3P.cjs} +1 -1
- package/dist/chunk-BF7D5A5Z.cjs +1 -0
- package/dist/chunk-DFWBYWE3.cjs +1 -0
- package/dist/chunk-DRXR56P5.cjs +1 -0
- package/dist/chunk-EXPE3C6O.js +2 -0
- package/dist/chunk-HFE2X32G.js +1 -0
- package/dist/{chunk-SKEEFKDT.js → chunk-HTO57OQP.js} +1 -1
- package/dist/chunk-IFIWYBMP.js +1 -0
- package/dist/chunk-JI7NXES2.cjs +1 -0
- package/dist/{chunk-BS2XX4G3.js → chunk-KDIZYBPJ.js} +1 -1
- package/dist/{chunk-G2BOTBBH.cjs → chunk-KHBJUHJ6.cjs} +1 -1
- package/dist/chunk-KSKAQMWJ.cjs +2 -0
- package/dist/chunk-N3F2LRDI.js +1 -0
- package/dist/{chunk-TRMZLMNW.js → chunk-N745RQIX.js} +1 -1
- package/dist/{chunk-SV76E7NI.js → chunk-PS7KTHW4.js} +1 -1
- package/dist/{chunk-LP3QQ33O.cjs → chunk-RVZWUZQ2.cjs} +1 -1
- package/dist/chunk-SRKAOAXW.cjs +1 -0
- package/dist/{chunk-2E2JQAHI.js → chunk-TL5BJFFL.js} +1 -1
- package/dist/{chunk-SYKMPPTY.cjs → chunk-XMJ6YRQB.cjs} +1 -1
- package/dist/head.cjs +1 -1
- package/dist/head.global.js +2 -1
- package/dist/head.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +28 -4
- package/dist/index.d.ts +28 -4
- package/dist/index.global.js +1 -1
- package/dist/index.js +1 -1
- package/dist/motion-6SENJS5V.cjs +1 -0
- package/dist/motion-QDEZZYDF.js +1 -0
- package/dist/online-HHJAVPBU.cjs +1 -0
- package/dist/online-OWTXHDGG.js +1 -0
- package/dist/orientation-LBAL4AXW.js +1 -0
- package/dist/orientation-PE3B4RPH.cjs +1 -0
- package/dist/page-focused-UK3VPLIG.js +1 -0
- package/dist/page-focused-Y74VK25Y.cjs +1 -0
- package/dist/page-visible-3YREALOP.cjs +1 -0
- package/dist/page-visible-GSBWF44E.js +1 -0
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.cts +64 -2
- package/dist/plugins.d.ts +64 -2
- package/dist/plugins.js +1 -1
- package/dist/pointer-P2B4YDKM.cjs +1 -0
- package/dist/pointer-RJIXVFBH.js +1 -0
- package/dist/pointer-local-L4EQM2UF.js +1 -0
- package/dist/pointer-local-QZJODLIH.cjs +1 -0
- package/dist/random-LUAMZ2M7.cjs +1 -0
- package/dist/random-O4GDPYJ3.js +1 -0
- package/dist/scroll-velocity-X3F22E47.cjs +1 -0
- package/dist/scroll-velocity-Y43V5NH2.js +1 -0
- package/dist/truncated-23UAUK2L.cjs +1 -0
- package/dist/truncated-R3OIXDTH.js +1 -0
- package/dist/{types-CudiAlDE.d.cts → types-CyGIcLOq.d.cts} +8 -0
- package/dist/{types-CudiAlDE.d.ts → types-CyGIcLOq.d.ts} +8 -0
- package/dist/ua-3MLUBLSV.cjs +1 -0
- package/dist/ua-3RC4SBYB.js +1 -0
- package/llms.txt +34 -5
- package/package.json +1 -1
- package/dist/chunk-3MK6Q7DX.cjs +0 -1
- package/dist/chunk-D24E2DBW.js +0 -1
- package/dist/chunk-EEMKKLRF.js +0 -1
- package/dist/chunk-OVCZMPYV.cjs +0 -1
- package/dist/chunk-OVF4XN2H.cjs +0 -1
- package/dist/chunk-PQVNJZUW.cjs +0 -1
- package/dist/chunk-QHHF5SEL.cjs +0 -1
- package/dist/chunk-SFO6H2DN.js +0 -1
- package/dist/chunk-V4OTPLOQ.js +0 -1
- package/dist/chunk-WIPJMLJJ.cjs +0 -1
- package/dist/motion-GHDWROM2.js +0 -1
- package/dist/motion-GMUGWJN3.cjs +0 -1
- package/dist/online-KTMCBCXT.cjs +0 -1
- package/dist/online-MGYZDLCQ.js +0 -1
- package/dist/orientation-27ULVQVJ.js +0 -1
- package/dist/orientation-JD23MYZR.cjs +0 -1
- package/dist/page-focused-3WLSZDV4.cjs +0 -1
- package/dist/page-focused-LBKD6QXG.js +0 -1
- package/dist/page-visible-27YKTHKU.js +0 -1
- package/dist/page-visible-6PMX575B.cjs +0 -1
- package/dist/pointer-3O7MGTQD.js +0 -1
- package/dist/pointer-DJSMZGSV.cjs +0 -1
- package/dist/pointer-local-6JKSOJZV.cjs +0 -1
- package/dist/pointer-local-X5TVNEEJ.js +0 -1
- package/dist/scroll-velocity-DGZNNO73.cjs +0 -1
- package/dist/scroll-velocity-ZRXPNZG7.js +0 -1
- package/dist/truncated-MDPFWGSI.js +0 -1
- package/dist/truncated-RUY3JNAX.cjs +0 -1
package/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,
|
|
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="…"
|
|
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
|
|
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
|
|
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-
|
|
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-
|
|
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
|
|
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'),
|
|
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-
|
|
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'),
|
|
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-
|
|
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-
|
|
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'),
|
|
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-
|
|
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-
|
|
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'),
|
|
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-
|
|
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'),
|
|
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
|
|
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();
|
package/dist/head.global.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
(function(){'use strict';var
|
|
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
|
|
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
|
|
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-
|
|
2
|
-
export { C as Cadence, P as PropSpec, b as SourceContext } from './types-
|
|
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-
|
|
2
|
-
export { C as Cadence, P as PropSpec, b as SourceContext } from './types-
|
|
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 };
|