wasm-html-to-image 1.0.3 → 1.0.5
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/cli-options.js +2 -2
- package/dist/cli.js +4 -2
- package/dist/core.d.ts +2 -2
- package/dist/encode-args.js +2 -0
- package/dist/html-to-image-wasm.js +3 -3
- package/dist/html-to-image.wasm +0 -0
- package/dist/input.d.ts +1 -1
- package/dist/input.js +11 -1
- package/dist/tailwind.d.ts +38 -1
- package/dist/tailwind.js +187 -3
- package/dist/web-workers.js +6 -2
- package/package.json +1 -1
package/dist/cli-options.js
CHANGED
|
@@ -20,9 +20,9 @@ export function resolveAnimation(flags) {
|
|
|
20
20
|
}
|
|
21
21
|
return {};
|
|
22
22
|
}
|
|
23
|
-
if (flags.format !== "webp") {
|
|
23
|
+
if (flags.format !== "webp" && flags.format !== "apng" && flags.format !== "gif") {
|
|
24
24
|
return {
|
|
25
|
-
warning: `--animation is only supported for webp output; ignoring (format=${flags.format}).`,
|
|
25
|
+
warning: `--animation is only supported for webp, apng and gif output; ignoring (format=${flags.format}).`,
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
// `loop` stays absent unless requested: the render() default (0) is the
|
package/dist/cli.js
CHANGED
|
@@ -10,6 +10,8 @@ const OUTPUT_FORMATS = [
|
|
|
10
10
|
"pdf",
|
|
11
11
|
"jpeg",
|
|
12
12
|
"webp",
|
|
13
|
+
"apng",
|
|
14
|
+
"gif",
|
|
13
15
|
"avif",
|
|
14
16
|
"jxl",
|
|
15
17
|
"raw",
|
|
@@ -30,9 +32,9 @@ program
|
|
|
30
32
|
.option("-f, --format <format>", `output format (${OUTPUT_FORMATS.join(", ")})`, "png")
|
|
31
33
|
.option("-q, --quality <number>", "encode quality 0-100 (encode stage only)", (v) => parseFloat(v), 85)
|
|
32
34
|
.option("--base-url <url>", "base URL for relative resources (URL input: defaults to the post-redirect document URL; file input: defaults to the file's directory)")
|
|
33
|
-
.option("--animation <duration-ms>", "sample the document's @keyframes opacity / transform / color animation into an animated WebP; one loop duration in ms (webp output only; the CSS animation-duration wins and this value is an upper bound)", (v) => parseInt(v, 10))
|
|
35
|
+
.option("--animation <duration-ms>", "sample the document's @keyframes opacity / transform / color animation into an animated WebP / APNG / GIF; one loop duration in ms (webp, apng and gif output only; the CSS animation-duration wins and this value is an upper bound)", (v) => parseInt(v, 10))
|
|
34
36
|
.option("--animation-fps <n>", "animation frame rate (default 15, capped at ~75 frames total; requires --animation)", (v) => parseInt(v, 10))
|
|
35
|
-
.option("--animation-loop <n>", "how many times the animated WebP repeats (0 = infinite, the default; 1 = play once; requires --animation)", (v) => parseInt(v, 10))
|
|
37
|
+
.option("--animation-loop <n>", "how many times the animated WebP / APNG / GIF repeats (0 = infinite, the default; 1 = play once; requires --animation)", (v) => parseInt(v, 10))
|
|
36
38
|
.action(async (input, options) => {
|
|
37
39
|
try {
|
|
38
40
|
const format = String(options.format).toLowerCase();
|
package/dist/core.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type { WasmBindingName } from "./core-orchestrate.js";
|
|
|
16
16
|
* (`converter_load_image` -> optional crop/resize -> `converter_encode`,
|
|
17
17
|
* or `converter_encode_svg` / `converter_encode_pdf`).
|
|
18
18
|
*/
|
|
19
|
-
export type OutputFormat = "svg" | "png" | "pdf" | "jpeg" | "webp" | "avif" | "jxl" | "raw" | "thumbhash" | "none";
|
|
19
|
+
export type OutputFormat = "svg" | "png" | "pdf" | "jpeg" | "webp" | "apng" | "gif" | "avif" | "jxl" | "raw" | "thumbhash" | "none";
|
|
20
20
|
/** Result of rendering an HTML document or converting an image. */
|
|
21
21
|
export interface RenderResult<T = Uint8Array | string> {
|
|
22
22
|
/** Output binary or text (string for svg, Uint8Array for all others). */
|
|
@@ -75,7 +75,7 @@ export interface HtmlToImageOptions extends RenderOptions {
|
|
|
75
75
|
* is the length of one iteration; `animation-delay` /
|
|
76
76
|
* `animation-iteration-count` define the sampled timeline, capped by
|
|
77
77
|
* `duration`; `fps` is the upper frame rate. `loop` is how many times the
|
|
78
|
-
* animated WebP repeats: `0` (the default) means infinite, `1` means play
|
|
78
|
+
* animated WebP / APNG / GIF repeats: `0` (the default) means infinite, `1` means play
|
|
79
79
|
* once. `opacity`, `transform` (`translate` / `rotate` / `scale` only) and
|
|
80
80
|
* `color` / `background-color` keyframes are animated; their values may
|
|
81
81
|
* use `var()` (resolved against the element's custom properties).
|