@joewinke/jatui 0.11.0 → 0.13.0

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.
@@ -1,26 +1,31 @@
1
1
  /**
2
- * Night module — CONTRACT ONLY (mos-5lzns.28). Implemented by mos-5lzns.33
3
- * ("night dimming, bias light, predictive dimming, strobe guard").
2
+ * Night module (mos-5lzns.33) — night dimming, bias light, predictive
3
+ * dimming (the luma track), strobe guard. Ported from extension-library
4
+ * FEATURES.md §Night dimming, §Bias light, §The light track.
4
5
  *
5
- * What lands here (extension-library FEATURES.md §Night dimming, §Bias light,
6
- * §The light track), as ADVISORS + paint helpers:
6
+ * Layout (every file pure and node-testable — `npm run test:unit`):
7
7
  *
8
- * · night dimming — every ~900ms while playing, sample the frame's actual
9
- * brightness (downscaled canvas read), drive filter: brightness() toward
10
- * `1 − 0.5·depth·excess`. Attack fast, release slow, so a dark cut inside a
11
- * bright video doesn't flash. `N` cycles auto/on/off — add its row to
12
- * keys.ts PLAYER_KEYS when the reader lands, not before.
13
- * · bias light — the frame's own colours, blurred, behind the player
14
- * (radial-gradient cells at z-index −1).
15
- * · predictive dimming — the pre-scanned luma track read ~1s ahead so
16
- * dimming starts BEFORE a bright cut; the light ribbon rides the same
17
- * track on whichever axis owns scrubbing (mos-5lzns.30's one-axis).
18
- * · strobe guard — hold the level down across detected flash intervals.
8
+ * · night/meter.ts — 32×18 frame bytes → Rec.709 luma (+ blown-out share),
9
+ * asymmetric smoothing (attack 0.5, release 0.12), and the 3×3 bias-light
10
+ * cells read from the SAME bytes.
11
+ * · night/levels.ts — luma → brightness / saturation / warmth / vignette off
12
+ * NIGHT_FLOOR 0.34; the blind fixed level; the surround level that re-tunes
13
+ * night for LIGHT themes.
14
+ * · night/clock.ts — what arms it: local clock (prefers-color-scheme dark only
15
+ * widens the window) + the manual auto/on/off cycle (`N`). No hyprsunset.
16
+ * · night/track.ts — prediction (can only ADD dimming), flash intervals, and
17
+ * `composeNight`, the one-tick decision: darker lands at once, brighter is
18
+ * released per tick, so nothing ever brightens in a jump.
19
19
  *
20
- * The measuring code is an advisor: it reads no settings, touches no
21
- * <video>, and returns safe neutral values on garbage input (CORS-tainted
22
- * canvas ⇒ escalate to the caller, never silently guess brightness). The
23
- * component decides and applies. Respect prefers-reduced-motion where it
24
- * applies: the correction is the feature, the ramp is only how it arrives.
20
+ * The advisor rule (README): nothing here reads a setting, touches the
21
+ * <video>, or draws. The component samples the frame (crossorigin="anonymous"
22
+ * is the host's call), escalates a tainted canvas via `onNightBlind`, and
23
+ * applies the numbers as CSS variables that exist only while night acts — off
24
+ * leaves no trace. prefers-reduced-motion drops the ramps, never the
25
+ * correction: the dimming is the feature, the ramp is only how it arrives.
25
26
  */
26
27
  export const NIGHT_NEUTRAL = 1;
28
+ export * from './night/meter';
29
+ export * from './night/levels';
30
+ export * from './night/clock';
31
+ export * from './night/track';
@@ -32,9 +32,25 @@
32
32
  export const VIDEO_SETTINGS = [
33
33
  // Read by VideoPlayer's `oneAxis` prop → video/band/axis.ts resolveAxis().
34
34
  { id: 'player.oneAxis', type: 'bool', default: true, owner: 'mos-5lzns.30', wired: true },
35
- // { id: 'audio.level', type: 'bool', default: true, owner: 'mos-5lzns.31' },
35
+ // Read by VideoPlayer's `loudness` / `loudnessTarget` / `quietListening` /
36
+ // `limiter` props → video/audio/* (graph.createAudioSession, rider.*). As with
37
+ // night, the DEFAULT is the host's opt-in: an absent prop means nothing is
38
+ // ever routed through WebAudio on that player.
39
+ { id: 'audio.level', type: 'bool', default: true, owner: 'mos-5lzns.31', wired: true },
40
+ { id: 'audio.target', type: 'range', default: -20, min: -30, max: -12, step: 2, owner: 'mos-5lzns.31', wired: true },
41
+ { id: 'audio.quiet', type: 'bool', default: true, owner: 'mos-5lzns.31', wired: true },
42
+ { id: 'audio.limiter', type: 'bool', default: true, owner: 'mos-5lzns.31', wired: true },
36
43
  // { id: 'player.speakerRate', type: 'bool', default: false, owner: 'mos-5lzns.32' },
37
- // { id: 'night.mode', type: 'enum', default: 'auto', options: ['auto','on','off'], owner: 'mos-5lzns.33' },
44
+ // Read by VideoPlayer's `night` / `nightDepth` / `biasLight` / `predictive` /
45
+ // `strobeGuard` props → video/night/* (clock.nightArmed, levels.nightLevels,
46
+ // meter.biasCells, track.lumaAhead / inFlash / composeNight). Unlike the
47
+ // extension, night.mode's DEFAULT here is the host's opt-in: an absent `night`
48
+ // prop means the feature does not exist on that player.
49
+ { id: 'night.mode', type: 'enum', default: 'auto', options: ['auto', 'on', 'off'], owner: 'mos-5lzns.33', wired: true },
50
+ { id: 'night.depth', type: 'range', default: 0.7, min: 0.2, max: 1, step: 0.1, owner: 'mos-5lzns.33', wired: true },
51
+ { id: 'night.bias', type: 'bool', default: true, owner: 'mos-5lzns.33', wired: true },
52
+ { id: 'player.predictive', type: 'bool', default: true, owner: 'mos-5lzns.33', wired: true },
53
+ { id: 'player.strobeGuard', type: 'bool', default: true, owner: 'mos-5lzns.33', wired: true },
38
54
  // { id: 'sleep.enabled', type: 'bool', default: true, owner: 'mos-5lzns.34' },
39
55
  ];
40
56
  /** Coerce a raw stored value against a spec — never throws, never returns junk. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joewinke/jatui",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "private": false,
5
5
  "description": "Shared Svelte 5 component library for JAT projects",
6
6
  "type": "module",