@hyperframes/producer 0.8.204 → 0.8.206
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/distributed.js +762 -442
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +66 -64
- package/dist/index.d.ts +2 -0
- package/dist/index.js +835 -511
- package/dist/public-server.js +557 -235
- package/dist/services/animatedGifPrep.d.ts +6 -0
- package/dist/services/assetMediaType.d.ts +1 -0
- package/dist/services/heifImagePrep.d.ts +69 -0
- package/dist/services/heifRotation.d.ts +2 -0
- package/dist/services/htmlCompiler.d.ts +1 -4
- package/package.json +7 -7
|
@@ -30,6 +30,12 @@ export interface PrepareAnimatedGifInputsResult {
|
|
|
30
30
|
preparedAssets: Map<string, string>;
|
|
31
31
|
preparedGifs: PreparedAnimatedGif[];
|
|
32
32
|
}
|
|
33
|
+
export declare function splitUrlSuffix(src: string): {
|
|
34
|
+
basePath: string;
|
|
35
|
+
suffix: string;
|
|
36
|
+
};
|
|
37
|
+
export declare function normalizeRelPath(path: string): string;
|
|
38
|
+
export declare function resolveLocalImageSourcePath(src: string, options: Pick<PrepareAnimatedGifInputsOptions, "projectDir" | "downloadDir" | "sourceAssets">): string | null;
|
|
33
39
|
export declare function buildAnimatedGifTranscodeArgs(input: {
|
|
34
40
|
inputPath: string;
|
|
35
41
|
outputPath: string;
|
|
@@ -15,6 +15,7 @@ export declare class AssetMediaTypeMismatchError extends Error {
|
|
|
15
15
|
readonly mismatches: readonly AssetMediaTypeMismatch[];
|
|
16
16
|
constructor(mismatches: readonly AssetMediaTypeMismatch[]);
|
|
17
17
|
}
|
|
18
|
+
export declare function mediaProfileMatchesElementType(expected: AssetElementMediaType, profile: MediaProbeProfile): boolean;
|
|
18
19
|
export declare function assertAssetMediaTypeProfile(expected: AssetElementMediaType, profile: MediaProbeProfile, elementIdentity: string): void;
|
|
19
20
|
interface CompositionMediaAssets {
|
|
20
21
|
videos: readonly VideoElement[];
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const HEIF_IMAGE_CONVERSION_FAILED: "HEIF_IMAGE_CONVERSION_FAILED";
|
|
2
|
+
export declare class HeifImageConversionError extends Error {
|
|
3
|
+
readonly code: "HEIF_IMAGE_CONVERSION_FAILED";
|
|
4
|
+
readonly owner: "user";
|
|
5
|
+
readonly retryable: false;
|
|
6
|
+
constructor(label: string, reason: string);
|
|
7
|
+
}
|
|
8
|
+
/** The host's ffmpeg or ffprobe cannot do the job; a different photo would not help. */
|
|
9
|
+
export declare class HeifToolUnavailableError extends Error {
|
|
10
|
+
readonly code: "HEIF_TOOL_UNAVAILABLE";
|
|
11
|
+
readonly owner: "system";
|
|
12
|
+
readonly retryable: false;
|
|
13
|
+
constructor(label: string, reason: string);
|
|
14
|
+
}
|
|
15
|
+
export interface HeifTranscodeRequest {
|
|
16
|
+
inputPath: string;
|
|
17
|
+
outputPath: string;
|
|
18
|
+
timeoutMs?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface PrepareHeifImageInputsOptions {
|
|
21
|
+
projectDir: string;
|
|
22
|
+
downloadDir: string;
|
|
23
|
+
outputDir?: string;
|
|
24
|
+
outputSrcPrefix?: string;
|
|
25
|
+
cacheDir?: string;
|
|
26
|
+
sourceAssets?: Map<string, string>;
|
|
27
|
+
timeoutMs?: number;
|
|
28
|
+
transcode?: (input: HeifTranscodeRequest) => Promise<void>;
|
|
29
|
+
/** Leaves an image whose conversion failed as authored and reports it, instead of throwing. */
|
|
30
|
+
onFailure?: (error: HeifImageConversionError | HeifToolUnavailableError) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface PreparedHeifImage {
|
|
33
|
+
sourceSrc: string;
|
|
34
|
+
outputSrc: string;
|
|
35
|
+
outputPath: string;
|
|
36
|
+
}
|
|
37
|
+
export interface PrepareHeifImageInputsResult {
|
|
38
|
+
html: string;
|
|
39
|
+
preparedAssets: Map<string, string>;
|
|
40
|
+
preparedImages: PreparedHeifImage[];
|
|
41
|
+
}
|
|
42
|
+
/** True when the leading bytes are a HEIF file by its `ftyp` brands, and not an AVIF one. */
|
|
43
|
+
export declare function isHeifBytes(head: Uint8Array): boolean;
|
|
44
|
+
export interface ProbedStream {
|
|
45
|
+
width?: number;
|
|
46
|
+
height?: number;
|
|
47
|
+
coded_width?: number;
|
|
48
|
+
coded_height?: number;
|
|
49
|
+
horizontal_offset?: number;
|
|
50
|
+
vertical_offset?: number;
|
|
51
|
+
subcomponents?: {
|
|
52
|
+
stream_index: number;
|
|
53
|
+
tile_horizontal_offset: number;
|
|
54
|
+
tile_vertical_offset: number;
|
|
55
|
+
}[];
|
|
56
|
+
}
|
|
57
|
+
export interface ProbeJson {
|
|
58
|
+
streams?: ProbedStream[];
|
|
59
|
+
stream_groups?: {
|
|
60
|
+
components?: ProbedStream[];
|
|
61
|
+
disposition?: {
|
|
62
|
+
default?: number;
|
|
63
|
+
};
|
|
64
|
+
}[];
|
|
65
|
+
}
|
|
66
|
+
/** The primary item's grid: the group ffmpeg marks default, so an auxiliary grid listed first is skipped. */
|
|
67
|
+
export declare function primaryGrid(probed: ProbeJson): ProbedStream | undefined;
|
|
68
|
+
export declare function convertHeifToJpeg(request: HeifTranscodeRequest): Promise<void>;
|
|
69
|
+
export declare function prepareHeifImageInputs(html: string, options: PrepareHeifImageInputsOptions): Promise<PrepareHeifImageInputsResult>;
|
|
@@ -175,10 +175,7 @@ export interface CompileForRenderOptions {
|
|
|
175
175
|
allowSystemFontCapture?: boolean;
|
|
176
176
|
/** Caller cancellation propagated through compile-time font fetches. */
|
|
177
177
|
abortSignal?: AbortSignal;
|
|
178
|
-
/**
|
|
179
|
-
* Optional persistent cache directory for prep-time animated GIF → WebM
|
|
180
|
-
* transcodes. When omitted, the render's downloadDir is used.
|
|
181
|
-
*/
|
|
178
|
+
/** Persistent cache directory for the animated GIF and HEIC prep transcodes; defaults to downloadDir. */
|
|
182
179
|
animatedGifCacheDir?: string;
|
|
183
180
|
/** FFmpeg timeout for animated GIF transcodes. */
|
|
184
181
|
ffmpegProcessTimeout?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/producer",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.206",
|
|
4
4
|
"description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"postcss": "^8.4.0",
|
|
36
36
|
"puppeteer": "^25.2.1",
|
|
37
37
|
"puppeteer-core": "^25.2.1",
|
|
38
|
-
"@hyperframes/
|
|
39
|
-
"@hyperframes/
|
|
40
|
-
"@hyperframes/
|
|
41
|
-
"@hyperframes/
|
|
42
|
-
"@hyperframes/
|
|
38
|
+
"@hyperframes/core": "0.8.206",
|
|
39
|
+
"@hyperframes/parsers": "0.8.206",
|
|
40
|
+
"@hyperframes/lint": "0.8.206",
|
|
41
|
+
"@hyperframes/studio-server": "0.8.206",
|
|
42
|
+
"@hyperframes/engine": "0.8.206"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^25.0.10",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"tsx": "^4.21.0",
|
|
49
49
|
"typescript": "^5.7.2",
|
|
50
50
|
"vitest": "^4.1.11",
|
|
51
|
-
"@hyperframes/aws-lambda": "0.8.
|
|
51
|
+
"@hyperframes/aws-lambda": "0.8.206"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22"
|