@bendyline/squisq-cli 2.3.1 → 2.3.3

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' omit for no captions
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, an infinite
198
- loop, and disabled slide animations/transitions. Embedded video still advances,
199
- but all audio is omitted and reported through `result.warnings`.
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
 
@@ -11,7 +11,7 @@ import {
11
11
  readInput,
12
12
  renderDocToGif,
13
13
  renderDocToMp4
14
- } from "./chunk-TPODSM5L.js";
14
+ } from "./chunk-WR2BZJ77.js";
15
15
  import {
16
16
  GIF_EXPORT_DEFAULTS,
17
17
  framesToGifNative,
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 style to bake into the video (default: none). */
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 style to bake into the GIF (default: none). */
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
@@ -298,6 +298,7 @@ var GIF_DEFAULTS = {
298
298
  function mp4Format() {
299
299
  return {
300
300
  id: "mp4",
301
+ templateAnnotationHandling: "rendered",
301
302
  label: "MP4 Video",
302
303
  mimeType: "video/mp4",
303
304
  extensions: [".mp4"],
@@ -339,6 +340,7 @@ function mp4Format() {
339
340
  function gifFormat() {
340
341
  return {
341
342
  id: "gif",
343
+ templateAnnotationHandling: "rendered",
342
344
  label: "Animated GIF",
343
345
  mimeType: "image/gif",
344
346
  extensions: [".gif"],
@@ -885,7 +887,7 @@ async function renderDocToMp4(doc, container, options) {
885
887
  fps,
886
888
  width: dimensions.width,
887
889
  height: dimensions.height,
888
- captionStyle: options.captionStyle,
890
+ captionStyle: options.captionStyle === "off" ? void 0 : options.captionStyle,
889
891
  coverPreRoll: options.coverPreRoll ?? 0,
890
892
  animationsEnabled: options.animationsEnabled ?? true,
891
893
  onProgress: options.onProgress,
@@ -948,7 +950,7 @@ async function renderDocToGif(doc, container, options) {
948
950
  fps,
949
951
  width,
950
952
  height,
951
- captionStyle: options.captionStyle,
953
+ captionStyle: options.captionStyle === "off" ? void 0 : options.captionStyle ?? "standard",
952
954
  coverPreRoll: options.coverPreRoll ?? 0,
953
955
  animationsEnabled: options.animationsEnabled ?? false,
954
956
  onProgress: options.onProgress,
@@ -295,6 +295,7 @@ var GIF_DEFAULTS = {
295
295
  function mp4Format() {
296
296
  return {
297
297
  id: "mp4",
298
+ templateAnnotationHandling: "rendered",
298
299
  label: "MP4 Video",
299
300
  mimeType: "video/mp4",
300
301
  extensions: [".mp4"],
@@ -308,7 +309,7 @@ function mp4Format() {
308
309
  const animationsEnabled = typeof mp4Opts.animationsEnabled === "boolean" ? mp4Opts.animationsEnabled : MP4_DEFAULTS.animationsEnabled;
309
310
  const outputPath = join(tmpdir(), `squisq-mp4-${randomBytes(8).toString("hex")}.mp4`);
310
311
  try {
311
- const { renderDocToMp4: renderDocToMp42 } = await import("./api-L5AORQHA.js");
312
+ const { renderDocToMp4: renderDocToMp42 } = await import("./api-HBPJQ7MA.js");
312
313
  await renderDocToMp42(input.doc, input.container, {
313
314
  outputPath,
314
315
  fps,
@@ -336,6 +337,7 @@ function mp4Format() {
336
337
  function gifFormat() {
337
338
  return {
338
339
  id: "gif",
340
+ templateAnnotationHandling: "rendered",
339
341
  label: "Animated GIF",
340
342
  mimeType: "image/gif",
341
343
  extensions: [".gif"],
@@ -348,7 +350,7 @@ function gifFormat() {
348
350
  const defaultHeight = portrait ? GIF_DEFAULTS.width : GIF_DEFAULTS.height;
349
351
  const outputPath = join(tmpdir(), `squisq-gif-${randomBytes(8).toString("hex")}.gif`);
350
352
  try {
351
- const { renderDocToGif: renderDocToGif2 } = await import("./api-L5AORQHA.js");
353
+ const { renderDocToGif: renderDocToGif2 } = await import("./api-HBPJQ7MA.js");
352
354
  const result = await renderDocToGif2(input.doc, input.container, {
353
355
  outputPath,
354
356
  fps: typeof gifOpts.fps === "number" ? gifOpts.fps : GIF_DEFAULTS.fps,
@@ -882,7 +884,7 @@ async function renderDocToMp4(doc, container, options) {
882
884
  fps,
883
885
  width: dimensions.width,
884
886
  height: dimensions.height,
885
- captionStyle: options.captionStyle,
887
+ captionStyle: options.captionStyle === "off" ? void 0 : options.captionStyle,
886
888
  coverPreRoll: options.coverPreRoll ?? 0,
887
889
  animationsEnabled: options.animationsEnabled ?? true,
888
890
  onProgress: options.onProgress,
@@ -945,7 +947,7 @@ async function renderDocToGif(doc, container, options) {
945
947
  fps,
946
948
  width,
947
949
  height,
948
- captionStyle: options.captionStyle,
950
+ captionStyle: options.captionStyle === "off" ? void 0 : options.captionStyle ?? "standard",
949
951
  coverPreRoll: options.coverPreRoll ?? 0,
950
952
  animationsEnabled: options.animationsEnabled ?? false,
951
953
  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-TPODSM5L.js";
10
+ } from "./chunk-WR2BZJ77.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)