@bendyline/squisq-cli 2.7.2 → 2.8.1
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/api.js
CHANGED
|
@@ -461,7 +461,7 @@ import {
|
|
|
461
461
|
win32
|
|
462
462
|
} from "path";
|
|
463
463
|
import { parseMarkdown, stringifyMarkdown } from "@bendyline/squisq/markdown";
|
|
464
|
-
import { markdownToDoc, resolveAudioMapping } from "@bendyline/squisq/doc";
|
|
464
|
+
import { markdownToDoc, resolveAudioMapping, resolveDataReferences } from "@bendyline/squisq/doc";
|
|
465
465
|
import { resolveMediaSchedule, validateDocSchema } from "@bendyline/squisq/schemas";
|
|
466
466
|
import { MemoryContentContainer } from "@bendyline/squisq/storage";
|
|
467
467
|
import { zipToContainer } from "@bendyline/squisq-formats/container";
|
|
@@ -531,7 +531,12 @@ async function readInput(inputPath, options) {
|
|
|
531
531
|
const result = await readInputRaw(inputPath, options);
|
|
532
532
|
throwIfAborted(options?.signal);
|
|
533
533
|
assertValidDoc(result.doc, inputPath);
|
|
534
|
-
const
|
|
534
|
+
const audioDoc = await resolveAudioMapping(result.doc, result.container);
|
|
535
|
+
throwIfAborted(options?.signal);
|
|
536
|
+
const { defaultDataReaders } = await import("@bendyline/squisq-formats/data");
|
|
537
|
+
const { doc } = await resolveDataReferences(audioDoc, result.container, {
|
|
538
|
+
readers: defaultDataReaders()
|
|
539
|
+
});
|
|
535
540
|
throwIfAborted(options?.signal);
|
|
536
541
|
assertValidDoc(doc, inputPath);
|
|
537
542
|
return doc === result.doc ? result : { ...result, doc };
|
|
@@ -331,7 +331,7 @@ function mp4Format() {
|
|
|
331
331
|
const animationsEnabled = typeof mp4Opts.animationsEnabled === "boolean" ? mp4Opts.animationsEnabled : MP4_DEFAULTS.animationsEnabled;
|
|
332
332
|
const outputPath = join(tmpdir(), `squisq-mp4-${randomBytes(8).toString("hex")}.mp4`);
|
|
333
333
|
try {
|
|
334
|
-
const { renderDocToMp4: renderDocToMp42 } = await import("./api-
|
|
334
|
+
const { renderDocToMp4: renderDocToMp42 } = await import("./api-OK3YGUA4.js");
|
|
335
335
|
await renderDocToMp42(input.doc, input.container, {
|
|
336
336
|
outputPath,
|
|
337
337
|
fps,
|
|
@@ -372,7 +372,7 @@ function gifFormat() {
|
|
|
372
372
|
const defaultHeight = portrait ? GIF_DEFAULTS.width : GIF_DEFAULTS.height;
|
|
373
373
|
const outputPath = join(tmpdir(), `squisq-gif-${randomBytes(8).toString("hex")}.gif`);
|
|
374
374
|
try {
|
|
375
|
-
const { renderDocToGif: renderDocToGif2 } = await import("./api-
|
|
375
|
+
const { renderDocToGif: renderDocToGif2 } = await import("./api-OK3YGUA4.js");
|
|
376
376
|
const result = await renderDocToGif2(input.doc, input.container, {
|
|
377
377
|
outputPath,
|
|
378
378
|
fps: typeof gifOpts.fps === "number" ? gifOpts.fps : GIF_DEFAULTS.fps,
|
|
@@ -415,7 +415,7 @@ function pngFormat() {
|
|
|
415
415
|
async exportDoc(input, options) {
|
|
416
416
|
options.signal?.throwIfAborted();
|
|
417
417
|
const pngOpts = options.formatOptions?.png ?? {};
|
|
418
|
-
const { renderDocToDashboardPng: renderDocToDashboardPng2 } = await import("./api-
|
|
418
|
+
const { renderDocToDashboardPng: renderDocToDashboardPng2 } = await import("./api-OK3YGUA4.js");
|
|
419
419
|
const result = await renderDocToDashboardPng2(input.doc, input.container, {
|
|
420
420
|
resolution: pngOpts.resolution,
|
|
421
421
|
width: pngOpts.width,
|
|
@@ -458,7 +458,7 @@ import {
|
|
|
458
458
|
win32
|
|
459
459
|
} from "path";
|
|
460
460
|
import { parseMarkdown, stringifyMarkdown } from "@bendyline/squisq/markdown";
|
|
461
|
-
import { markdownToDoc, resolveAudioMapping } from "@bendyline/squisq/doc";
|
|
461
|
+
import { markdownToDoc, resolveAudioMapping, resolveDataReferences } from "@bendyline/squisq/doc";
|
|
462
462
|
import { resolveMediaSchedule, validateDocSchema } from "@bendyline/squisq/schemas";
|
|
463
463
|
import { MemoryContentContainer } from "@bendyline/squisq/storage";
|
|
464
464
|
import { zipToContainer } from "@bendyline/squisq-formats/container";
|
|
@@ -528,7 +528,12 @@ async function readInput(inputPath, options) {
|
|
|
528
528
|
const result = await readInputRaw(inputPath, options);
|
|
529
529
|
throwIfAborted(options?.signal);
|
|
530
530
|
assertValidDoc(result.doc, inputPath);
|
|
531
|
-
const
|
|
531
|
+
const audioDoc = await resolveAudioMapping(result.doc, result.container);
|
|
532
|
+
throwIfAborted(options?.signal);
|
|
533
|
+
const { defaultDataReaders } = await import("@bendyline/squisq-formats/data");
|
|
534
|
+
const { doc } = await resolveDataReferences(audioDoc, result.container, {
|
|
535
|
+
readers: defaultDataReaders()
|
|
536
|
+
});
|
|
532
537
|
throwIfAborted(options?.signal);
|
|
533
538
|
assertValidDoc(doc, inputPath);
|
|
534
539
|
return doc === result.doc ? result : { ...result, doc };
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
renderDocToDashboardPng,
|
|
10
10
|
renderDocToGif,
|
|
11
11
|
renderDocToMp4
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-W7GAUNLT.js";
|
|
13
13
|
import "./chunk-GGVASRPG.js";
|
|
14
14
|
|
|
15
15
|
// src/index.ts
|
|
@@ -443,11 +443,13 @@ async function runVideo(inputPath, opts) {
|
|
|
443
443
|
let doc = result.doc;
|
|
444
444
|
if (result.markdownDoc) {
|
|
445
445
|
if (opts.autoTemplates === false) {
|
|
446
|
-
const { markdownToDoc, resolveAudioMapping } = await import("@bendyline/squisq/doc");
|
|
447
|
-
|
|
446
|
+
const { markdownToDoc, resolveAudioMapping, resolveDataReferences } = await import("@bendyline/squisq/doc");
|
|
447
|
+
const { defaultDataReaders } = await import("@bendyline/squisq-formats/data");
|
|
448
|
+
const audioDoc = await resolveAudioMapping(
|
|
448
449
|
markdownToDoc(result.markdownDoc, { autoTemplates: false }),
|
|
449
450
|
container
|
|
450
451
|
);
|
|
452
|
+
doc = (await resolveDataReferences(audioDoc, container, { readers: defaultDataReaders() })).doc;
|
|
451
453
|
}
|
|
452
454
|
} else {
|
|
453
455
|
console.error("Using pre-built Doc JSON");
|
|
@@ -599,11 +601,13 @@ async function runImage(inputPath, opts) {
|
|
|
599
601
|
let doc = result.doc;
|
|
600
602
|
if (result.markdownDoc) {
|
|
601
603
|
if (opts.autoTemplates === false) {
|
|
602
|
-
const { markdownToDoc, resolveAudioMapping } = await import("@bendyline/squisq/doc");
|
|
603
|
-
|
|
604
|
+
const { markdownToDoc, resolveAudioMapping, resolveDataReferences } = await import("@bendyline/squisq/doc");
|
|
605
|
+
const { defaultDataReaders } = await import("@bendyline/squisq-formats/data");
|
|
606
|
+
const audioDoc = await resolveAudioMapping(
|
|
604
607
|
markdownToDoc(result.markdownDoc, { autoTemplates: false }),
|
|
605
608
|
container
|
|
606
609
|
);
|
|
610
|
+
doc = (await resolveDataReferences(audioDoc, container, { readers: defaultDataReaders() })).doc;
|
|
607
611
|
}
|
|
608
612
|
} else {
|
|
609
613
|
console.error("Using pre-built Doc JSON");
|