@hyperframes/core 0.9.14 → 0.9.16
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/cacheDir.d.ts +1 -0
- package/dist/cacheDir.js +3 -0
- package/dist/generated/position-edits-render-inline.js +1 -1
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/hyperframe.runtime.iife.js +68 -68
- package/dist/motionBlurSettings.d.ts +6 -0
- package/dist/motionBlurSettings.js +6 -1
- package/dist/runtime/diagnostics.d.ts +6 -0
- package/dist/runtime/diagnostics.js +19 -0
- package/package.json +4 -4
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export declare const MOTION_BLUR_ATTR: {
|
|
3
3
|
readonly enable: "data-motion-blur";
|
|
4
4
|
readonly shutter: "data-motion-blur-shutter";
|
|
5
|
+
readonly phase: "data-motion-blur-phase";
|
|
5
6
|
readonly samples: "data-motion-blur-samples";
|
|
6
7
|
readonly events: "data-motion-blur-events";
|
|
7
8
|
readonly tier: "data-motion-blur-tier";
|
|
@@ -12,6 +13,10 @@ export declare const MOTION_BLUR_LIMITS: {
|
|
|
12
13
|
readonly max: 720;
|
|
13
14
|
readonly default: 240;
|
|
14
15
|
};
|
|
16
|
+
readonly phaseDeg: {
|
|
17
|
+
readonly min: -360;
|
|
18
|
+
readonly max: 360;
|
|
19
|
+
};
|
|
15
20
|
readonly samples: {
|
|
16
21
|
readonly min: 2;
|
|
17
22
|
readonly max: 64;
|
|
@@ -21,6 +26,7 @@ export type MotionBlurTier = "auto" | "capture" | "filter";
|
|
|
21
26
|
export interface MotionBlurSettings {
|
|
22
27
|
enabled: boolean;
|
|
23
28
|
shutterDeg: number;
|
|
29
|
+
phaseDeg: number | null;
|
|
24
30
|
/** A fixed count per frame; null sizes it to each smear, never under 32. */
|
|
25
31
|
samples: number | null;
|
|
26
32
|
events: boolean;
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
export const MOTION_BLUR_ATTR = {
|
|
3
3
|
enable: "data-motion-blur",
|
|
4
4
|
shutter: "data-motion-blur-shutter",
|
|
5
|
+
phase: "data-motion-blur-phase",
|
|
5
6
|
samples: "data-motion-blur-samples",
|
|
6
7
|
events: "data-motion-blur-events",
|
|
7
8
|
tier: "data-motion-blur-tier",
|
|
8
9
|
};
|
|
9
10
|
export const MOTION_BLUR_LIMITS = {
|
|
10
11
|
shutterDeg: { min: 0, max: 720, default: 240 },
|
|
12
|
+
phaseDeg: { min: -360, max: 360 },
|
|
11
13
|
samples: { min: 2, max: 64 },
|
|
12
14
|
};
|
|
13
15
|
const clamp = (x, lo, hi) => Math.min(hi, Math.max(lo, x));
|
|
@@ -19,12 +21,14 @@ function number(value) {
|
|
|
19
21
|
}
|
|
20
22
|
export function readMotionBlurSettings(attr) {
|
|
21
23
|
const shutter = number(attr(MOTION_BLUR_ATTR.shutter));
|
|
24
|
+
const phase = number(attr(MOTION_BLUR_ATTR.phase));
|
|
22
25
|
const samples = number(attr(MOTION_BLUR_ATTR.samples));
|
|
23
26
|
const tier = attr(MOTION_BLUR_ATTR.tier);
|
|
24
|
-
const { shutterDeg, samples: bounds } = MOTION_BLUR_LIMITS;
|
|
27
|
+
const { shutterDeg, phaseDeg, samples: bounds } = MOTION_BLUR_LIMITS;
|
|
25
28
|
return {
|
|
26
29
|
enabled: attr(MOTION_BLUR_ATTR.enable) === "on",
|
|
27
30
|
shutterDeg: clamp(shutter ?? shutterDeg.default, shutterDeg.min, shutterDeg.max),
|
|
31
|
+
phaseDeg: phase === null ? null : clamp(phase, phaseDeg.min, phaseDeg.max),
|
|
28
32
|
samples: samples === null ? null : Math.round(clamp(samples, bounds.min, bounds.max)),
|
|
29
33
|
events: attr(MOTION_BLUR_ATTR.events) === "on",
|
|
30
34
|
tier: tier === "capture" || tier === "filter" ? tier : "auto",
|
|
@@ -39,6 +43,7 @@ export function motionBlurAttributeEdits(settings) {
|
|
|
39
43
|
return {
|
|
40
44
|
[MOTION_BLUR_ATTR.enable]: settings.enabled ? "on" : null,
|
|
41
45
|
[MOTION_BLUR_ATTR.shutter]: settings.shutterDeg === shutterDeg.default ? null : String(settings.shutterDeg),
|
|
46
|
+
[MOTION_BLUR_ATTR.phase]: settings.phaseDeg === null ? null : String(settings.phaseDeg),
|
|
42
47
|
[MOTION_BLUR_ATTR.samples]: settings.samples === null ? null : String(settings.samples),
|
|
43
48
|
[MOTION_BLUR_ATTR.events]: settings.events ? "on" : null,
|
|
44
49
|
[MOTION_BLUR_ATTR.tier]: settings.tier === "auto" ? null : settings.tier,
|
|
@@ -2,4 +2,10 @@
|
|
|
2
2
|
export declare function recordStartupError(error: unknown): void;
|
|
3
3
|
/** Starts the warning for a scene callback that threw; the render log shows it once per render. */
|
|
4
4
|
export declare const SCENE_CALLBACK_ERROR_PREFIX = "[hyperframes] scene timeline callback threw:";
|
|
5
|
+
/**
|
|
6
|
+
* A rejected `window.__hf.buildReady[key]` is the composition saying its own setup failed, so
|
|
7
|
+
* readiness waits (render, snapshot, check) fail with the key and reason instead of capturing an
|
|
8
|
+
* unbuilt scene. Returns the recorded message so a teardown can clear exactly this error.
|
|
9
|
+
*/
|
|
10
|
+
export declare function recordBuildReadyRejection(key: string, error: unknown): string;
|
|
5
11
|
export declare function swallow(label: string, error?: unknown): void;
|
|
@@ -50,6 +50,25 @@ export function recordStartupError(error) {
|
|
|
50
50
|
}
|
|
51
51
|
/** Starts the warning for a scene callback that threw; the render log shows it once per render. */
|
|
52
52
|
export const SCENE_CALLBACK_ERROR_PREFIX = "[hyperframes] scene timeline callback threw:";
|
|
53
|
+
/**
|
|
54
|
+
* A rejected `window.__hf.buildReady[key]` is the composition saying its own setup failed, so
|
|
55
|
+
* readiness waits (render, snapshot, check) fail with the key and reason instead of capturing an
|
|
56
|
+
* unbuilt scene. Returns the recorded message so a teardown can clear exactly this error.
|
|
57
|
+
*/
|
|
58
|
+
export function recordBuildReadyRejection(key, error) {
|
|
59
|
+
let detail = "unknown error";
|
|
60
|
+
try {
|
|
61
|
+
detail = error instanceof Error ? `${error.name}: ${error.message}` : String(error);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
swallow("runtime.buildReadyRejection", err);
|
|
65
|
+
}
|
|
66
|
+
const message = `window.__hf.buildReady[${JSON.stringify(key)}] rejected: ${detail}. ` +
|
|
67
|
+
`The composition reported that its own setup failed, so it cannot be rendered. Fix that ` +
|
|
68
|
+
`setup, or resolve the promise only once the scene is drawable.`;
|
|
69
|
+
window.__hfStartupError = message;
|
|
70
|
+
return message;
|
|
71
|
+
}
|
|
53
72
|
export function swallow(label, error) {
|
|
54
73
|
if (typeof window === "undefined")
|
|
55
74
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -437,9 +437,9 @@
|
|
|
437
437
|
"linkedom": "^0.18.12",
|
|
438
438
|
"postcss": "^8.5.8",
|
|
439
439
|
"wawoff2": "^2.0.1",
|
|
440
|
-
"@hyperframes/lint": "0.9.
|
|
441
|
-
"@hyperframes/parsers": "0.9.
|
|
442
|
-
"@hyperframes/studio-server": "0.9.
|
|
440
|
+
"@hyperframes/lint": "0.9.16",
|
|
441
|
+
"@hyperframes/parsers": "0.9.16",
|
|
442
|
+
"@hyperframes/studio-server": "0.9.16"
|
|
443
443
|
},
|
|
444
444
|
"devDependencies": {
|
|
445
445
|
"@fontsource/archivo-black": "^5.2.8",
|