@bendyline/squisq-cli 2.3.1 → 2.3.2
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/README.md
CHANGED
|
@@ -77,7 +77,7 @@ squisq video doc.json -o out.mp4
|
|
|
77
77
|
| `--fps` | Frames per second (MP4 1–120; GIF 1–100) | MP4 30; GIF 10 |
|
|
78
78
|
| `--quality` | MP4-only quality: `draft`, `normal`, or `high` | normal |
|
|
79
79
|
| `--orientation` | `landscape` or `portrait` | landscape |
|
|
80
|
-
| `--captions` | `off`, `standard`, or `social` | off
|
|
80
|
+
| `--captions` | `off`, `standard`, or `social` | MP4 off; GIF standard |
|
|
81
81
|
| `--animations` / `--no-animations` | Enable/disable layer animations and block transitions | MP4 enabled; GIF disabled |
|
|
82
82
|
| `--loop` | GIF repeat count (`0` forever, `-1` no loop) | 0 |
|
|
83
83
|
| `--max-colors` | GIF palette size, 2–256 | 256 |
|
|
@@ -169,7 +169,7 @@ const result = await renderDocToMp4(doc, input.container, {
|
|
|
169
169
|
fps: 30, // default 30
|
|
170
170
|
quality: 'high', // 'draft' | 'normal' | 'high' (default 'normal')
|
|
171
171
|
orientation: 'landscape', // 'landscape' | 'portrait' (default 'landscape')
|
|
172
|
-
captionStyle: 'social', // 'standard' | 'social'
|
|
172
|
+
captionStyle: 'social', // 'off' | 'standard' | 'social' (default 'off')
|
|
173
173
|
animationsEnabled: false, // static slide changes; media/timing remain active
|
|
174
174
|
coverPreRoll: 2, // seconds of cover-slide pre-roll (default 0)
|
|
175
175
|
onProgress: (phase, pct) => console.log(`${phase}: ${pct}%`),
|
|
@@ -188,15 +188,17 @@ import { renderDocToGif } from '@bendyline/squisq-cli/api';
|
|
|
188
188
|
const result = await renderDocToGif(doc, input.container, {
|
|
189
189
|
outputPath: './output.gif',
|
|
190
190
|
fps: 10,
|
|
191
|
+
captionStyle: 'off', // override the default 'standard' captions
|
|
191
192
|
animationsEnabled: false,
|
|
192
193
|
maxColors: 256,
|
|
193
194
|
loop: 0,
|
|
194
195
|
});
|
|
195
196
|
```
|
|
196
197
|
|
|
197
|
-
GIF defaults to 960×540 landscape (540×960 portrait), 10 fps,
|
|
198
|
-
loop, and disabled slide animations/transitions.
|
|
199
|
-
|
|
198
|
+
GIF defaults to 960×540 landscape (540×960 portrait), 10 fps, standard
|
|
199
|
+
captions, an infinite loop, and disabled slide animations/transitions. Set
|
|
200
|
+
`captionStyle: 'off'` to omit captions. Embedded video still advances, but all
|
|
201
|
+
audio is omitted and reported through `result.warnings`.
|
|
200
202
|
|
|
201
203
|
### Native frame encoding
|
|
202
204
|
|
package/dist/api.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ interface Mp4FormatOptions {
|
|
|
23
23
|
orientation?: VideoOrientation;
|
|
24
24
|
width?: number;
|
|
25
25
|
height?: number;
|
|
26
|
-
captionStyle?: 'standard' | 'social';
|
|
26
|
+
captionStyle?: 'off' | 'standard' | 'social';
|
|
27
27
|
coverPreRoll?: number;
|
|
28
28
|
animationsEnabled?: boolean;
|
|
29
29
|
}
|
|
@@ -34,7 +34,7 @@ interface GifFormatOptions {
|
|
|
34
34
|
orientation?: VideoOrientation;
|
|
35
35
|
width?: number;
|
|
36
36
|
height?: number;
|
|
37
|
-
captionStyle?: 'standard' | 'social';
|
|
37
|
+
captionStyle?: 'off' | 'standard' | 'social';
|
|
38
38
|
coverPreRoll?: number;
|
|
39
39
|
animationsEnabled?: boolean;
|
|
40
40
|
loop?: number;
|
|
@@ -258,8 +258,8 @@ interface RenderDocToMp4Options {
|
|
|
258
258
|
width?: number;
|
|
259
259
|
/** Override video height in pixels. */
|
|
260
260
|
height?: number;
|
|
261
|
-
/** Caption
|
|
262
|
-
captionStyle?: 'standard' | 'social';
|
|
261
|
+
/** Caption mode to bake into the video (default: off). */
|
|
262
|
+
captionStyle?: 'off' | 'standard' | 'social';
|
|
263
263
|
/** Render layer animations and block transitions (default: true). */
|
|
264
264
|
animationsEnabled?: boolean;
|
|
265
265
|
/**
|
|
@@ -289,8 +289,8 @@ interface RenderDocToGifOptions {
|
|
|
289
289
|
width?: number;
|
|
290
290
|
/** Override output height (default: 540 landscape / 960 portrait). */
|
|
291
291
|
height?: number;
|
|
292
|
-
/** Caption
|
|
293
|
-
captionStyle?: 'standard' | 'social';
|
|
292
|
+
/** Caption mode to bake into the GIF (default: standard). */
|
|
293
|
+
captionStyle?: 'off' | 'standard' | 'social';
|
|
294
294
|
/** Seconds of cover-slide pre-roll (default: 0). */
|
|
295
295
|
coverPreRoll?: number;
|
|
296
296
|
/** Render layer animations and block transitions (default: false). */
|
package/dist/api.js
CHANGED
|
@@ -885,7 +885,7 @@ async function renderDocToMp4(doc, container, options) {
|
|
|
885
885
|
fps,
|
|
886
886
|
width: dimensions.width,
|
|
887
887
|
height: dimensions.height,
|
|
888
|
-
captionStyle: options.captionStyle,
|
|
888
|
+
captionStyle: options.captionStyle === "off" ? void 0 : options.captionStyle,
|
|
889
889
|
coverPreRoll: options.coverPreRoll ?? 0,
|
|
890
890
|
animationsEnabled: options.animationsEnabled ?? true,
|
|
891
891
|
onProgress: options.onProgress,
|
|
@@ -948,7 +948,7 @@ async function renderDocToGif(doc, container, options) {
|
|
|
948
948
|
fps,
|
|
949
949
|
width,
|
|
950
950
|
height,
|
|
951
|
-
captionStyle: options.captionStyle,
|
|
951
|
+
captionStyle: options.captionStyle === "off" ? void 0 : options.captionStyle ?? "standard",
|
|
952
952
|
coverPreRoll: options.coverPreRoll ?? 0,
|
|
953
953
|
animationsEnabled: options.animationsEnabled ?? false,
|
|
954
954
|
onProgress: options.onProgress,
|
|
@@ -308,7 +308,7 @@ function mp4Format() {
|
|
|
308
308
|
const animationsEnabled = typeof mp4Opts.animationsEnabled === "boolean" ? mp4Opts.animationsEnabled : MP4_DEFAULTS.animationsEnabled;
|
|
309
309
|
const outputPath = join(tmpdir(), `squisq-mp4-${randomBytes(8).toString("hex")}.mp4`);
|
|
310
310
|
try {
|
|
311
|
-
const { renderDocToMp4: renderDocToMp42 } = await import("./api-
|
|
311
|
+
const { renderDocToMp4: renderDocToMp42 } = await import("./api-A7FKMZY6.js");
|
|
312
312
|
await renderDocToMp42(input.doc, input.container, {
|
|
313
313
|
outputPath,
|
|
314
314
|
fps,
|
|
@@ -348,7 +348,7 @@ function gifFormat() {
|
|
|
348
348
|
const defaultHeight = portrait ? GIF_DEFAULTS.width : GIF_DEFAULTS.height;
|
|
349
349
|
const outputPath = join(tmpdir(), `squisq-gif-${randomBytes(8).toString("hex")}.gif`);
|
|
350
350
|
try {
|
|
351
|
-
const { renderDocToGif: renderDocToGif2 } = await import("./api-
|
|
351
|
+
const { renderDocToGif: renderDocToGif2 } = await import("./api-A7FKMZY6.js");
|
|
352
352
|
const result = await renderDocToGif2(input.doc, input.container, {
|
|
353
353
|
outputPath,
|
|
354
354
|
fps: typeof gifOpts.fps === "number" ? gifOpts.fps : GIF_DEFAULTS.fps,
|
|
@@ -882,7 +882,7 @@ async function renderDocToMp4(doc, container, options) {
|
|
|
882
882
|
fps,
|
|
883
883
|
width: dimensions.width,
|
|
884
884
|
height: dimensions.height,
|
|
885
|
-
captionStyle: options.captionStyle,
|
|
885
|
+
captionStyle: options.captionStyle === "off" ? void 0 : options.captionStyle,
|
|
886
886
|
coverPreRoll: options.coverPreRoll ?? 0,
|
|
887
887
|
animationsEnabled: options.animationsEnabled ?? true,
|
|
888
888
|
onProgress: options.onProgress,
|
|
@@ -945,7 +945,7 @@ async function renderDocToGif(doc, container, options) {
|
|
|
945
945
|
fps,
|
|
946
946
|
width,
|
|
947
947
|
height,
|
|
948
|
-
captionStyle: options.captionStyle,
|
|
948
|
+
captionStyle: options.captionStyle === "off" ? void 0 : options.captionStyle ?? "standard",
|
|
949
949
|
coverPreRoll: options.coverPreRoll ?? 0,
|
|
950
950
|
animationsEnabled: options.animationsEnabled ?? false,
|
|
951
951
|
onProgress: options.onProgress,
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
readInput,
|
|
8
8
|
renderDocToGif,
|
|
9
9
|
renderDocToMp4
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZEN42AFN.js";
|
|
11
11
|
import "./chunk-GGVASRPG.js";
|
|
12
12
|
|
|
13
13
|
// src/index.ts
|
|
@@ -321,8 +321,7 @@ function registerVideoCommand(program2) {
|
|
|
321
321
|
"landscape"
|
|
322
322
|
).option(
|
|
323
323
|
"--captions <style>",
|
|
324
|
-
`Caption style: ${VALID_CAPTIONS.join(", ")} (default: off)
|
|
325
|
-
"off"
|
|
324
|
+
`Caption style: ${VALID_CAPTIONS.join(", ")} (default: off for MP4, standard for GIF)`
|
|
326
325
|
).option(
|
|
327
326
|
"--no-auto-templates",
|
|
328
327
|
"Disable content-aware template auto-picking for unannotated headings"
|
|
@@ -388,11 +387,10 @@ async function runVideo(inputPath, opts) {
|
|
|
388
387
|
const width = opts.width === void 0 ? void 0 : Number(opts.width);
|
|
389
388
|
const height = opts.height === void 0 ? void 0 : Number(opts.height);
|
|
390
389
|
validateVideoExportOptions({ width, height, orientation });
|
|
391
|
-
const captions = opts.captions ?? "off";
|
|
390
|
+
const captions = opts.captions ?? (outputFormat === "gif" ? "standard" : "off");
|
|
392
391
|
if (!VALID_CAPTIONS.includes(captions)) {
|
|
393
392
|
throw new Error(`Invalid captions "${captions}". Valid: ${VALID_CAPTIONS.join(", ")}`);
|
|
394
393
|
}
|
|
395
|
-
const captionStyle = captions === "off" ? void 0 : captions;
|
|
396
394
|
const coverPreRoll = Number(opts.coverPreroll ?? "2");
|
|
397
395
|
if (!Number.isFinite(coverPreRoll) || coverPreRoll < 0) {
|
|
398
396
|
throw new Error("Cover pre-roll must be a number of seconds >= 0");
|
|
@@ -462,7 +460,7 @@ async function runVideo(inputPath, opts) {
|
|
|
462
460
|
orientation,
|
|
463
461
|
width,
|
|
464
462
|
height,
|
|
465
|
-
captionStyle,
|
|
463
|
+
captionStyle: captions,
|
|
466
464
|
coverPreRoll,
|
|
467
465
|
animationsEnabled,
|
|
468
466
|
onProgress: (phase, percent) => writeProgress(phase, percent, 100)
|