@joewinke/jatui 0.14.0 → 0.16.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.
- package/dist/components/VideoPlayer.svelte +843 -19
- package/dist/components/VideoPlayer.svelte.d.ts +103 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +10 -0
- package/dist/video/README.md +2 -2
- package/dist/video/keys.d.ts +5 -5
- package/dist/video/keys.js +5 -4
- package/dist/video/presence/flip.d.ts +145 -0
- package/dist/video/presence/flip.js +253 -0
- package/dist/video/presence/idle.d.ts +82 -0
- package/dist/video/presence/idle.js +145 -0
- package/dist/video/presence/resume.d.ts +76 -0
- package/dist/video/presence/resume.js +139 -0
- package/dist/video/presence/winddown.d.ts +106 -0
- package/dist/video/presence/winddown.js +104 -0
- package/dist/video/presence.d.ts +25 -21
- package/dist/video/presence.js +25 -21
- package/dist/video/settings/SettingsPanel.svelte +414 -0
- package/dist/video/settings/SettingsPanel.svelte.d.ts +16 -0
- package/dist/video/settings/panel.d.ts +24 -0
- package/dist/video/settings/panel.js +58 -0
- package/dist/video/settings/registry.d.ts +82 -0
- package/dist/video/settings/registry.js +331 -0
- package/dist/video/settings/store.d.ts +55 -0
- package/dist/video/settings/store.js +116 -0
- package/dist/video/settings.d.ts +15 -46
- package/dist/video/settings.js +15 -82
- package/package.json +1 -1
package/dist/video/settings.js
CHANGED
|
@@ -1,86 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Settings
|
|
3
|
-
*
|
|
2
|
+
* Settings for VideoPlayer — the barrel (mos-5lzns.28 skeleton, filled in by
|
|
3
|
+
* mos-5lzns.35). The pieces live in `settings/`:
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* · `registry.ts` — `VIDEO_SETTINGS`: every standing choice the player's
|
|
6
|
+
* automatic behaviours read, with its label, hint, group, the prop it
|
|
7
|
+
* drives and the availability gate. `coerce` never throws.
|
|
8
|
+
* · `store.ts` — the host-supplied `VideoSettingsStore` (get/set) and the
|
|
9
|
+
* session that reads/writes through it. jatui never persists on its own.
|
|
10
|
+
* · `panel.ts` — which rows a given player can offer, and how values read.
|
|
11
|
+
* · `SettingsPanel.svelte` — the panel, generated wholly from the registry.
|
|
9
12
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* unrecognised returns undefined and the caller falls back to the
|
|
14
|
-
* declared default. A corrupted blob degrades to defaults, not to a
|
|
15
|
-
* broken player.
|
|
16
|
-
* · One registry (`VIDEO_SETTINGS`) lists every knob the player's automatic
|
|
17
|
-
* behaviours read, with the sub-task that owns each. A knob that is here
|
|
18
|
-
* but unread by any module is a switch that visibly does nothing — the
|
|
19
|
-
* extension calls that "declared but not yet wired" and refuses to fix it
|
|
20
|
-
* quietly. Keep the same discipline: land the knob WITH its reader.
|
|
21
|
-
*
|
|
22
|
-
* Nothing under src/lib/video/ reads a setting directly except through the
|
|
23
|
-
* value its owning feature passes in as an `opts` argument — the advisor
|
|
24
|
-
* rule (see README). That keeps every module node-testable and keeps the
|
|
25
|
-
* arbitration in the component.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* The registry. Populated as the behaviours land — .30 oneAxis, .31 audio,
|
|
29
|
-
* .32 rate/speaker/silence, .33 night, .34 presence. An empty registry is
|
|
30
|
-
* the honest state while every behaviour is prop-driven.
|
|
13
|
+
* Nothing under src/lib/video/ reads a setting directly: the component maps
|
|
14
|
+
* each value onto the prop it names and the feature reads that — the
|
|
15
|
+
* advisor rule (see README).
|
|
31
16
|
*/
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
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 },
|
|
43
|
-
// Read by VideoPlayer's `smartSpeed` / `speakerPace` (+ `speakerRates`) /
|
|
44
|
-
// `skipAds` (+ `adSpans`) props → video/rate/* (silenceMapFor + silenceFactor,
|
|
45
|
-
// speakerRateMap + speakerFactor, normalizeAdSpans + adSkipTarget), composed
|
|
46
|
-
// by rate/compose.ts composeRate. All default off: an automatic rate change
|
|
47
|
-
// is the host's opt-in.
|
|
48
|
-
{ id: 'player.smartSpeed', type: 'bool', default: false, owner: 'mos-5lzns.32', wired: true },
|
|
49
|
-
{ id: 'player.speakerRate', type: 'bool', default: false, owner: 'mos-5lzns.32', wired: true },
|
|
50
|
-
{ id: 'player.skipAds', type: 'bool', default: false, owner: 'mos-5lzns.32', wired: true },
|
|
51
|
-
// Read by VideoPlayer's `night` / `nightDepth` / `biasLight` / `predictive` /
|
|
52
|
-
// `strobeGuard` props → video/night/* (clock.nightArmed, levels.nightLevels,
|
|
53
|
-
// meter.biasCells, track.lumaAhead / inFlash / composeNight). Unlike the
|
|
54
|
-
// extension, night.mode's DEFAULT here is the host's opt-in: an absent `night`
|
|
55
|
-
// prop means the feature does not exist on that player.
|
|
56
|
-
{ id: 'night.mode', type: 'enum', default: 'auto', options: ['auto', 'on', 'off'], owner: 'mos-5lzns.33', wired: true },
|
|
57
|
-
{ id: 'night.depth', type: 'range', default: 0.7, min: 0.2, max: 1, step: 0.1, owner: 'mos-5lzns.33', wired: true },
|
|
58
|
-
{ id: 'night.bias', type: 'bool', default: true, owner: 'mos-5lzns.33', wired: true },
|
|
59
|
-
{ id: 'player.predictive', type: 'bool', default: true, owner: 'mos-5lzns.33', wired: true },
|
|
60
|
-
{ id: 'player.strobeGuard', type: 'bool', default: true, owner: 'mos-5lzns.33', wired: true },
|
|
61
|
-
// { id: 'sleep.enabled', type: 'bool', default: true, owner: 'mos-5lzns.34' },
|
|
62
|
-
];
|
|
63
|
-
/** Coerce a raw stored value against a spec — never throws, never returns junk. */
|
|
64
|
-
export function coerce(spec, raw) {
|
|
65
|
-
if (spec.type === 'bool') {
|
|
66
|
-
if (raw === true || raw === '1' || raw === 'true')
|
|
67
|
-
return true;
|
|
68
|
-
if (raw === false || raw === '0' || raw === 'false')
|
|
69
|
-
return false;
|
|
70
|
-
return undefined;
|
|
71
|
-
}
|
|
72
|
-
if (spec.type === 'range') {
|
|
73
|
-
const n = typeof raw === 'number' ? raw : Number(raw);
|
|
74
|
-
if (!Number.isFinite(n))
|
|
75
|
-
return undefined;
|
|
76
|
-
const min = spec.min ?? -Infinity;
|
|
77
|
-
const max = spec.max ?? Infinity;
|
|
78
|
-
return Math.min(max, Math.max(min, n));
|
|
79
|
-
}
|
|
80
|
-
// enum: must match a declared option or the value is discarded
|
|
81
|
-
if (typeof raw !== 'string')
|
|
82
|
-
return undefined;
|
|
83
|
-
if (!spec.options?.includes(raw))
|
|
84
|
-
return undefined;
|
|
85
|
-
return raw;
|
|
86
|
-
}
|
|
17
|
+
export * from './settings/registry';
|
|
18
|
+
export * from './settings/store';
|
|
19
|
+
export * from './settings/panel';
|