@hyperframes/core 0.8.50 → 0.8.52
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/audioAutomation.d.ts +5 -0
- package/dist/audioAutomation.d.ts.map +1 -1
- package/dist/audioAutomation.js +21 -1
- package/dist/audioAutomation.js.map +1 -1
- package/dist/clipFacts.d.ts +32 -0
- package/dist/clipFacts.d.ts.map +1 -0
- package/dist/clipFacts.js +22 -0
- package/dist/clipFacts.js.map +1 -0
- package/dist/compiler/htmlBundler.d.ts +10 -0
- package/dist/compiler/htmlBundler.d.ts.map +1 -1
- package/dist/compiler/htmlBundler.js +17 -12
- package/dist/compiler/htmlBundler.js.map +1 -1
- package/dist/compiler/timingCompiler.d.ts +3 -2
- package/dist/compiler/timingCompiler.d.ts.map +1 -1
- package/dist/compiler/timingCompiler.js +23 -7
- package/dist/compiler/timingCompiler.js.map +1 -1
- package/dist/generated/audio-fx-runtime-inline.js +1 -1
- package/dist/generated/audio-fx-runtime-inline.js.map +1 -1
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/generated/runtime-inline.js.map +1 -1
- package/dist/hyperframe.runtime.iife.js +30 -30
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/mediaTiming.d.ts +10 -0
- package/dist/mediaTiming.d.ts.map +1 -1
- package/dist/mediaTiming.js +13 -0
- package/dist/mediaTiming.js.map +1 -1
- package/dist/playbackRateBounds.d.ts +2 -0
- package/dist/playbackRateBounds.d.ts.map +1 -0
- package/dist/playbackRateBounds.js +2 -0
- package/dist/playbackRateBounds.js.map +1 -0
- package/dist/runtime/audioAutomationVolume.d.ts +20 -0
- package/dist/runtime/audioAutomationVolume.d.ts.map +1 -0
- package/dist/runtime/audioAutomationVolume.js +51 -0
- package/dist/runtime/audioAutomationVolume.js.map +1 -0
- package/dist/runtime/clipTree.d.ts.map +1 -1
- package/dist/runtime/clipTree.js +7 -4
- package/dist/runtime/clipTree.js.map +1 -1
- package/dist/runtime/clipWindow.d.ts +8 -0
- package/dist/runtime/clipWindow.d.ts.map +1 -0
- package/dist/runtime/clipWindow.js +12 -0
- package/dist/runtime/clipWindow.js.map +1 -0
- package/dist/runtime/playbackRate.d.ts +16 -8
- package/dist/runtime/playbackRate.d.ts.map +1 -1
- package/dist/runtime/playbackRate.js +50 -34
- package/dist/runtime/playbackRate.js.map +1 -1
- package/dist/runtime/startResolver.d.ts.map +1 -1
- package/dist/runtime/startResolver.js +9 -15
- package/dist/runtime/startResolver.js.map +1 -1
- package/dist/speedRamp.d.ts +48 -0
- package/dist/speedRamp.d.ts.map +1 -0
- package/dist/speedRamp.js +196 -0
- package/dist/speedRamp.js.map +1 -0
- package/dist/storyboard/types.d.ts +2 -2
- package/dist/storyboard/types.js +1 -1
- package/docs/core.md +1 -1
- package/package.json +12 -4
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** A ramp is a `rate` lane in `data-automation`; `sourceTimeAt` is the one rate-to-time mapping consumers share. */
|
|
2
|
+
import { type HfAutomationLane } from "./audioAutomation.js";
|
|
3
|
+
/** A constant multiplier, or a lane whose `v` is the multiplier over clip-local time. */
|
|
4
|
+
export type RateSpec = number | HfAutomationLane;
|
|
5
|
+
/**
|
|
6
|
+
* The lane as seen from `dt` seconds into the clip: what a renderer sees after it trims the clip's start.
|
|
7
|
+
* A shaped segment (`curve`, `viaX`) cut in the middle is resampled, since its shape belongs to its left point.
|
|
8
|
+
*/
|
|
9
|
+
export declare function shiftRateLane(spec: RateSpec, dt: number): RateSpec;
|
|
10
|
+
/** Speed multiplier at clip-local time `t`. */
|
|
11
|
+
export declare function rateAt(spec: RateSpec, t: number): number;
|
|
12
|
+
/** Source seconds consumed by clip-local time `t` (the integral of the rate). */
|
|
13
|
+
export declare function sourceTimeAt(spec: RateSpec, t: number): number;
|
|
14
|
+
/** Inverse of `sourceTimeAt`: the clip-local time at which `source` seconds have been consumed. */
|
|
15
|
+
export declare function timeAtSourceTime(spec: RateSpec, source: number): number;
|
|
16
|
+
/** The `rate` lane inside a `data-automation` attribute value, or null when absent or unreadable. */
|
|
17
|
+
export declare function parseRateLane(raw: string | null | undefined): HfAutomationLane | null;
|
|
18
|
+
/** A clip's rate: its `rate` lane when it has one, otherwise the constant. */
|
|
19
|
+
export declare function resolveRateSpec(automationAttr: string | null | undefined, constant: number): RateSpec;
|
|
20
|
+
/** The CapCut-style presets; `speedPresetLane` stretches one over a clip's duration. */
|
|
21
|
+
export declare const SPEED_PRESETS: readonly [{
|
|
22
|
+
readonly id: "montage";
|
|
23
|
+
readonly label: "Montage";
|
|
24
|
+
readonly points: readonly [readonly [0, 0.9], readonly [0.15, 0.3], readonly [0.5, 2.5], readonly [0.85, 0.3], readonly [1, 0.9]];
|
|
25
|
+
}, {
|
|
26
|
+
readonly id: "hero";
|
|
27
|
+
readonly label: "Hero";
|
|
28
|
+
readonly points: readonly [readonly [0, 1], readonly [0.25, 1.6], readonly [0.5, 0.25], readonly [0.75, 1.6], readonly [1, 1]];
|
|
29
|
+
}, {
|
|
30
|
+
readonly id: "bullet";
|
|
31
|
+
readonly label: "Bullet";
|
|
32
|
+
readonly points: readonly [readonly [0, 3], readonly [0.4, 3], readonly [0.5, 0.15], readonly [0.6, 3], readonly [1, 3]];
|
|
33
|
+
}, {
|
|
34
|
+
readonly id: "jump-cut";
|
|
35
|
+
readonly label: "Jump cut";
|
|
36
|
+
readonly points: readonly [readonly [0, 0.5], readonly [0.24, 0.5], readonly [0.26, 3], readonly [0.5, 3], readonly [0.52, 0.5], readonly [0.74, 0.5], readonly [0.76, 3], readonly [1, 3]];
|
|
37
|
+
}, {
|
|
38
|
+
readonly id: "flash-in";
|
|
39
|
+
readonly label: "Flash in";
|
|
40
|
+
readonly points: readonly [readonly [0, 0.3], readonly [0.6, 0.6], readonly [1, 5]];
|
|
41
|
+
}, {
|
|
42
|
+
readonly id: "flash-out";
|
|
43
|
+
readonly label: "Flash out";
|
|
44
|
+
readonly points: readonly [readonly [0, 5], readonly [0.4, 0.6], readonly [1, 0.3]];
|
|
45
|
+
}];
|
|
46
|
+
export type SpeedPresetId = (typeof SPEED_PRESETS)[number]["id"];
|
|
47
|
+
export declare function speedPresetLane(id: SpeedPresetId, clipDuration: number): HfAutomationLane;
|
|
48
|
+
//# sourceMappingURL=speedRamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"speedRamp.d.ts","sourceRoot":"","sources":["../src/speedRamp.ts"],"names":[],"mappings":"AAAA,oHAAoH;AAEpH,OAAO,EAAqC,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIhG,yFAAyF;AACzF,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,gBAAgB,CAAC;AAIjD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ,CAYlE;AAsDD,+CAA+C;AAC/C,wBAAgB,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGxD;AAcD,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ9D;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQvE;AAED,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,gBAAgB,GAAG,IAAI,CAErF;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAC7B,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACzC,QAAQ,EAAE,MAAM,GACf,QAAQ,CAEV;AASD,wFAAwF;AACxF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EAkEgB,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAEjE,wBAAgB,eAAe,CAAC,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,gBAAgB,CASzF"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/** A ramp is a `rate` lane in `data-automation`; `sourceTimeAt` is the one rate-to-time mapping consumers share. */
|
|
2
|
+
import { RATE_TARGET, sampleAutomationLane } from "./audioAutomation.js";
|
|
3
|
+
import { laneFromAttr } from "./runtime/audioAutomationVolume.js";
|
|
4
|
+
import { MAX_PLAYBACK_RATE, MIN_PLAYBACK_RATE } from "./playbackRateBounds.js";
|
|
5
|
+
const SHIFT_RESAMPLES = 16;
|
|
6
|
+
/**
|
|
7
|
+
* The lane as seen from `dt` seconds into the clip: what a renderer sees after it trims the clip's start.
|
|
8
|
+
* A shaped segment (`curve`, `viaX`) cut in the middle is resampled, since its shape belongs to its left point.
|
|
9
|
+
*/
|
|
10
|
+
export function shiftRateLane(spec, dt) {
|
|
11
|
+
if (typeof spec === "number" || dt === 0)
|
|
12
|
+
return spec;
|
|
13
|
+
const next = spec.points.findIndex((p) => p.t > dt);
|
|
14
|
+
const later = next < 0 ? [] : spec.points.slice(next).map((p) => ({ ...p, t: p.t - dt }));
|
|
15
|
+
const left = next > 0 ? spec.points[next - 1] : undefined;
|
|
16
|
+
const shaped = left !== undefined && (left.curve || left.viaX !== undefined);
|
|
17
|
+
const cut = shaped && next > 0 ? spec.points[next].t - dt : 0;
|
|
18
|
+
const samples = Array.from({ length: shaped ? SHIFT_RESAMPLES - 1 : 0 }, (_, k) => {
|
|
19
|
+
const t = ((k + 1) * cut) / SHIFT_RESAMPLES;
|
|
20
|
+
return { t, v: rateAt(spec, dt + t) };
|
|
21
|
+
});
|
|
22
|
+
return { ...spec, points: [{ t: 0, v: rateAt(spec, dt) }, ...samples, ...later] };
|
|
23
|
+
}
|
|
24
|
+
const CELLS_PER_SEGMENT = 48;
|
|
25
|
+
const tables = new WeakMap();
|
|
26
|
+
function buildTable(lane) {
|
|
27
|
+
const pts = lane.points;
|
|
28
|
+
const firstRate = pts[0].v;
|
|
29
|
+
const lastRate = pts[pts.length - 1].v;
|
|
30
|
+
const ts = [0];
|
|
31
|
+
const ss = [0];
|
|
32
|
+
const push = (t) => {
|
|
33
|
+
const prevT = ts[ts.length - 1];
|
|
34
|
+
if (t <= prevT)
|
|
35
|
+
return;
|
|
36
|
+
const prevRate = sampleAutomationLane(lane, prevT, "log");
|
|
37
|
+
ts.push(t);
|
|
38
|
+
ss.push(ss[ss.length - 1] + ((prevRate + sampleAutomationLane(lane, t, "log")) / 2) * (t - prevT));
|
|
39
|
+
};
|
|
40
|
+
const first = Math.max(0, pts[0].t);
|
|
41
|
+
push(first);
|
|
42
|
+
for (let i = 1; i < pts.length; i += 1) {
|
|
43
|
+
const a = pts[i - 1].t;
|
|
44
|
+
const b = pts[i].t;
|
|
45
|
+
if (b <= 0)
|
|
46
|
+
continue;
|
|
47
|
+
for (let k = 1; k <= CELLS_PER_SEGMENT; k += 1)
|
|
48
|
+
push(Math.max(a, 0) + ((b - a) * k) / CELLS_PER_SEGMENT);
|
|
49
|
+
}
|
|
50
|
+
return { ts: Float64Array.from(ts), ss: Float64Array.from(ss), firstRate, lastRate };
|
|
51
|
+
}
|
|
52
|
+
function tableFor(lane) {
|
|
53
|
+
let table = tables.get(lane);
|
|
54
|
+
if (!table) {
|
|
55
|
+
table = buildTable(lane);
|
|
56
|
+
tables.set(lane, table);
|
|
57
|
+
}
|
|
58
|
+
return table;
|
|
59
|
+
}
|
|
60
|
+
function usable(spec) {
|
|
61
|
+
return typeof spec !== "number" && spec.points.length > 0;
|
|
62
|
+
}
|
|
63
|
+
/** Speed multiplier at clip-local time `t`. */
|
|
64
|
+
export function rateAt(spec, t) {
|
|
65
|
+
if (typeof spec === "number")
|
|
66
|
+
return spec;
|
|
67
|
+
return usable(spec) ? sampleAutomationLane(spec, t, "log") : 1;
|
|
68
|
+
}
|
|
69
|
+
/** Piecewise-linear lookup of `x` in the ascending `xs`, read off `ys`; caller keeps `x` inside `xs`. */
|
|
70
|
+
function interpolate(xs, ys, x) {
|
|
71
|
+
let lo = 0;
|
|
72
|
+
let hi = xs.length - 1;
|
|
73
|
+
while (hi - lo > 1) {
|
|
74
|
+
const mid = (lo + hi) >> 1;
|
|
75
|
+
if (xs[mid] <= x)
|
|
76
|
+
lo = mid;
|
|
77
|
+
else
|
|
78
|
+
hi = mid;
|
|
79
|
+
}
|
|
80
|
+
return ys[lo] + ((ys[hi] - ys[lo]) * (x - xs[lo])) / (xs[hi] - xs[lo]);
|
|
81
|
+
}
|
|
82
|
+
/** Source seconds consumed by clip-local time `t` (the integral of the rate). */
|
|
83
|
+
export function sourceTimeAt(spec, t) {
|
|
84
|
+
if (typeof spec === "number")
|
|
85
|
+
return t * spec;
|
|
86
|
+
if (!usable(spec))
|
|
87
|
+
return t;
|
|
88
|
+
const { ts, ss, firstRate, lastRate } = tableFor(spec);
|
|
89
|
+
const last = ts.length - 1;
|
|
90
|
+
if (t <= 0)
|
|
91
|
+
return t * firstRate;
|
|
92
|
+
if (t >= ts[last])
|
|
93
|
+
return ss[last] + (t - ts[last]) * lastRate;
|
|
94
|
+
return interpolate(ts, ss, t);
|
|
95
|
+
}
|
|
96
|
+
/** Inverse of `sourceTimeAt`: the clip-local time at which `source` seconds have been consumed. */
|
|
97
|
+
export function timeAtSourceTime(spec, source) {
|
|
98
|
+
if (typeof spec === "number")
|
|
99
|
+
return source / spec;
|
|
100
|
+
if (!usable(spec))
|
|
101
|
+
return source;
|
|
102
|
+
const { ts, ss, firstRate, lastRate } = tableFor(spec);
|
|
103
|
+
const last = ts.length - 1;
|
|
104
|
+
if (source <= 0)
|
|
105
|
+
return source / firstRate;
|
|
106
|
+
if (source >= ss[last])
|
|
107
|
+
return ts[last] + (source - ss[last]) / lastRate;
|
|
108
|
+
return interpolate(ss, ts, source);
|
|
109
|
+
}
|
|
110
|
+
/** The `rate` lane inside a `data-automation` attribute value, or null when absent or unreadable. */
|
|
111
|
+
export function parseRateLane(raw) {
|
|
112
|
+
return raw ? laneFromAttr(raw, RATE_TARGET) : null;
|
|
113
|
+
}
|
|
114
|
+
/** A clip's rate: its `rate` lane when it has one, otherwise the constant. */
|
|
115
|
+
export function resolveRateSpec(automationAttr, constant) {
|
|
116
|
+
return parseRateLane(automationAttr) ?? constant;
|
|
117
|
+
}
|
|
118
|
+
/** The CapCut-style presets; `speedPresetLane` stretches one over a clip's duration. */
|
|
119
|
+
export const SPEED_PRESETS = [
|
|
120
|
+
{
|
|
121
|
+
id: "montage",
|
|
122
|
+
label: "Montage",
|
|
123
|
+
points: [
|
|
124
|
+
[0, 0.9],
|
|
125
|
+
[0.15, 0.3],
|
|
126
|
+
[0.5, 2.5],
|
|
127
|
+
[0.85, 0.3],
|
|
128
|
+
[1, 0.9],
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "hero",
|
|
133
|
+
label: "Hero",
|
|
134
|
+
points: [
|
|
135
|
+
[0, 1],
|
|
136
|
+
[0.25, 1.6],
|
|
137
|
+
[0.5, 0.25],
|
|
138
|
+
[0.75, 1.6],
|
|
139
|
+
[1, 1],
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "bullet",
|
|
144
|
+
label: "Bullet",
|
|
145
|
+
points: [
|
|
146
|
+
[0, 3],
|
|
147
|
+
[0.4, 3],
|
|
148
|
+
[0.5, 0.15],
|
|
149
|
+
[0.6, 3],
|
|
150
|
+
[1, 3],
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "jump-cut",
|
|
155
|
+
label: "Jump cut",
|
|
156
|
+
points: [
|
|
157
|
+
[0, 0.5],
|
|
158
|
+
[0.24, 0.5],
|
|
159
|
+
[0.26, 3],
|
|
160
|
+
[0.5, 3],
|
|
161
|
+
[0.52, 0.5],
|
|
162
|
+
[0.74, 0.5],
|
|
163
|
+
[0.76, 3],
|
|
164
|
+
[1, 3],
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: "flash-in",
|
|
169
|
+
label: "Flash in",
|
|
170
|
+
points: [
|
|
171
|
+
[0, 0.3],
|
|
172
|
+
[0.6, 0.6],
|
|
173
|
+
[1, 5],
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: "flash-out",
|
|
178
|
+
label: "Flash out",
|
|
179
|
+
points: [
|
|
180
|
+
[0, 5],
|
|
181
|
+
[0.4, 0.6],
|
|
182
|
+
[1, 0.3],
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
];
|
|
186
|
+
export function speedPresetLane(id, clipDuration) {
|
|
187
|
+
const preset = SPEED_PRESETS.find((p) => p.id === id);
|
|
188
|
+
return {
|
|
189
|
+
target: RATE_TARGET,
|
|
190
|
+
points: preset.points.map(([x, v]) => ({
|
|
191
|
+
t: x * clipDuration,
|
|
192
|
+
v: Math.min(MAX_PLAYBACK_RATE, Math.max(MIN_PLAYBACK_RATE, v)),
|
|
193
|
+
})),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=speedRamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"speedRamp.js","sourceRoot":"","sources":["../src/speedRamp.ts"],"names":[],"mappings":"AAAA,oHAAoH;AAEpH,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAyB,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAK/E,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAc,EAAE,EAAU;IACtD,IA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;YACR,CAAC,IAAI,EAAE,GAAG,CAAC;YACX,CAAC,IAAI,EAAE,GAAG,CAAC;YACX,CAAC,IAAI,EAAE,CAAC,CAAC;YACT,CAAC,CAAC,EAAE,CAAC,CAAC;SACP;KACF;IACD;QACE,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,UAAU;QACjB,MAAM,EAAE;YACN,CAAC,CAAC,EAAE,GAAG,CAAC;YACR,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,CAAC,EAAE,CAAC,CAAC;SACP;KACF;IACD;QACE,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE;YACN,CAAC,CAAC,EAAE,CAAC,CAAC;YACN,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,CAAC,EAAE,GAAG,CAAC;SACT;KACF;CACuC,CAAC;AAI3C,MAAM,UAAU,eAAe,CAAC,EAAiB,EAAE,YAAoB;IACrE,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAE,CAAC;IACvD,OAAO;QACL,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACrC,CAAC,EAAE,CAAC,GAAG,YAAY;YACnB,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;SAC/D,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* A storyboard is the plan for a video before any animation work happens: an
|
|
5
5
|
* ordered set of frames (key moments) plus their narrative/script. It is
|
|
6
6
|
* authored as a single canonical markdown file (`STORYBOARD.md`) and parsed
|
|
7
|
-
* into this normalized shape for
|
|
7
|
+
* into this normalized shape for agents.
|
|
8
8
|
*
|
|
9
9
|
* See PRD: "Storyboarding in HyperFrames". The markdown stays canonical; this
|
|
10
10
|
* is the derived structure the parser produces.
|
|
@@ -19,7 +19,7 @@ export declare const STORYBOARD_FILENAME = "STORYBOARD.md";
|
|
|
19
19
|
export declare const SCRIPT_FILENAME = "SCRIPT.md";
|
|
20
20
|
/**
|
|
21
21
|
* Lifecycle of a single frame. The agent advances each frame
|
|
22
|
-
* `outline → built → animated`; the
|
|
22
|
+
* `outline → built → animated`; scripts and the agent read progress from this.
|
|
23
23
|
*/
|
|
24
24
|
export type FrameStatus = "outline" | "built" | "animated";
|
|
25
25
|
/** The set of recognized {@link FrameStatus} values. */
|
package/dist/storyboard/types.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* A storyboard is the plan for a video before any animation work happens: an
|
|
5
5
|
* ordered set of frames (key moments) plus their narrative/script. It is
|
|
6
6
|
* authored as a single canonical markdown file (`STORYBOARD.md`) and parsed
|
|
7
|
-
* into this normalized shape for
|
|
7
|
+
* into this normalized shape for agents.
|
|
8
8
|
*
|
|
9
9
|
* See PRD: "Storyboarding in HyperFrames". The markdown stays canonical; this
|
|
10
10
|
* is the derived structure the parser produces.
|
package/docs/core.md
CHANGED
|
@@ -183,7 +183,7 @@ A clip is any discrete block on the timeline. We represent clips as HTML element
|
|
|
183
183
|
|
|
184
184
|
- `id` — Unique identifier (e.g., "el-1")
|
|
185
185
|
- `data-start` — Start time in seconds, or a clip `id` reference. See [Relative Timing](#relative-timing).
|
|
186
|
-
- `data-duration` — Duration in seconds.
|
|
186
|
+
- `data-duration` — Duration in seconds. Optional for `<img>` (defaults to 3 seconds), `<video>` and `<audio>` (default to the source media's length, less any playback offset, over the playback rate; an authored value trims). Not used on compositions.
|
|
187
187
|
- `data-track-index` — Timeline track number. Tracks serve two purposes: they determine visual layering (higher tracks render in front) and they group clips into rows on the timeline. Clips on the same track **cannot overlap in time**.
|
|
188
188
|
|
|
189
189
|
### Media Clips (video, audio)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.52",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -134,6 +134,10 @@
|
|
|
134
134
|
"import": "./dist/audioAutomation.js",
|
|
135
135
|
"types": "./dist/audioAutomation.d.ts"
|
|
136
136
|
},
|
|
137
|
+
"./clip-facts": {
|
|
138
|
+
"import": "./dist/clipFacts.js",
|
|
139
|
+
"types": "./dist/clipFacts.d.ts"
|
|
140
|
+
},
|
|
137
141
|
"./audio-gain": {
|
|
138
142
|
"import": "./dist/audioGain.js",
|
|
139
143
|
"types": "./dist/audioGain.d.ts"
|
|
@@ -175,6 +179,10 @@
|
|
|
175
179
|
"import": "./dist/runtime/protocol.js",
|
|
176
180
|
"types": "./dist/runtime/protocol.d.ts"
|
|
177
181
|
},
|
|
182
|
+
"./runtime/clip-window": {
|
|
183
|
+
"import": "./dist/runtime/clipWindow.js",
|
|
184
|
+
"types": "./dist/runtime/clipWindow.d.ts"
|
|
185
|
+
},
|
|
178
186
|
"./runtime/stacking-context": {
|
|
179
187
|
"import": "./dist/runtime/stackingContext.js",
|
|
180
188
|
"types": "./dist/runtime/stackingContext.d.ts"
|
|
@@ -286,9 +294,9 @@
|
|
|
286
294
|
"bpm-detective": "^2.0.5",
|
|
287
295
|
"linkedom": "^0.18.12",
|
|
288
296
|
"postcss": "^8.5.8",
|
|
289
|
-
"@hyperframes/lint": "0.8.
|
|
290
|
-
"@hyperframes/
|
|
291
|
-
"@hyperframes/
|
|
297
|
+
"@hyperframes/lint": "0.8.52",
|
|
298
|
+
"@hyperframes/parsers": "0.8.52",
|
|
299
|
+
"@hyperframes/studio-server": "0.8.52"
|
|
292
300
|
},
|
|
293
301
|
"devDependencies": {
|
|
294
302
|
"@types/jsdom": "^28.0.0",
|