@bendyline/squisq-cli 2.7.1 → 2.8.0

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.
@@ -62,7 +62,7 @@ COMPONENTS
62
62
  - decode-named-character-reference@1.3.0 (MIT); files: license
63
63
  - delaunator@5.1.0 (ISC); files: LICENSE
64
64
  - devlop@1.1.0 (MIT); files: license
65
- - dompurify@3.4.12 ((MPL-2.0 OR Apache-2.0)); files: LICENSE, LICENSE-MPL
65
+ - dompurify@3.4.14 ((MPL-2.0 OR Apache-2.0)); files: LICENSE, LICENSE-MPL
66
66
  - entities@6.0.1 (BSD-2-Clause); files: LICENSE
67
67
  - es-toolkit@1.49.0 (MIT); files: LICENSE
68
68
  - escape-string-regexp@5.0.0 (MIT); files: license
@@ -1402,7 +1402,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1402
1402
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1403
1403
 
1404
1404
  ==============================================================================
1405
- dompurify@3.4.12 - LICENSE
1405
+ dompurify@3.4.14 - LICENSE
1406
1406
  ==============================================================================
1407
1407
 
1408
1408
  Apache License
@@ -1608,7 +1608,7 @@ dompurify@3.4.12 - LICENSE
1608
1608
  limitations under the License.
1609
1609
 
1610
1610
  ==============================================================================
1611
- dompurify@3.4.12 - LICENSE-MPL
1611
+ dompurify@3.4.14 - LICENSE-MPL
1612
1612
  ==============================================================================
1613
1613
  Mozilla Public License Version 2.0
1614
1614
  ==================================
@@ -16,7 +16,7 @@ import {
16
16
  renderDocToMp4,
17
17
  resolveDashboardDimensions,
18
18
  validateDashboardImageDimensions
19
- } from "./chunk-3VRG7RDV.js";
19
+ } from "./chunk-W7GAUNLT.js";
20
20
  import {
21
21
  GIF_EXPORT_DEFAULTS,
22
22
  framesToGifNative,
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 doc = await resolveAudioMapping(result.doc, result.container);
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-7LSZM24X.js");
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-7LSZM24X.js");
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-7LSZM24X.js");
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 doc = await resolveAudioMapping(result.doc, result.container);
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-3VRG7RDV.js";
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
- doc = await resolveAudioMapping(
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
- doc = await resolveAudioMapping(
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");