@bendyline/squisq-cli 2.8.17 → 2.8.19

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.14 ((MPL-2.0 OR Apache-2.0)); files: LICENSE, LICENSE-MPL
65
+ - dompurify@3.4.16 ((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.14 - LICENSE
1405
+ dompurify@3.4.16 - LICENSE
1406
1406
  ==============================================================================
1407
1407
 
1408
1408
  Apache License
@@ -1608,7 +1608,7 @@ dompurify@3.4.14 - LICENSE
1608
1608
  limitations under the License.
1609
1609
 
1610
1610
  ==============================================================================
1611
- dompurify@3.4.14 - LICENSE-MPL
1611
+ dompurify@3.4.16 - LICENSE-MPL
1612
1612
  ==============================================================================
1613
1613
  Mozilla Public License Version 2.0
1614
1614
  ==================================
@@ -18,7 +18,7 @@ import {
18
18
  renderDocToMp4,
19
19
  resolveDashboardDimensions,
20
20
  validateDashboardImageDimensions
21
- } from "./chunk-6MZC4YQV.js";
21
+ } from "./chunk-KWE5OXEY.js";
22
22
  import {
23
23
  GIF_EXPORT_DEFAULTS,
24
24
  framesToGifNative,
package/dist/api.js CHANGED
@@ -15,6 +15,7 @@ import { tmpdir as tmpdir2 } from "os";
15
15
  import { dirname as dirname2, join as join4, resolve as resolvePath } from "path";
16
16
  import { resolveMediaSchedule as resolveMediaSchedule2 } from "@bendyline/squisq/schemas";
17
17
  import { flattenBlocks as flattenBlocks2 } from "@bendyline/squisq/doc";
18
+ import { usesDynamicPresentation } from "@bendyline/squisq/transform";
18
19
  import { ffmpegGifOutputArgs, frameTimeSeconds, generateRenderHtml } from "@bendyline/squisq-video";
19
20
  import { resolveDashboardDimensions, resolveDimensions } from "@bendyline/squisq-video";
20
21
  import {
@@ -822,7 +823,7 @@ async function buildBareMarkdownContainer(filePath, content, doc, signal) {
822
823
  }
823
824
  refs.add("timing.json");
824
825
  for (const ref of [...refs]) {
825
- if (NARRATION_EXTENSIONS.has(extname(stripUrlSuffix(ref)).toLowerCase())) {
826
+ if (NARRATION_EXTENSIONS.has(extname(stripUrlSuffix(ref)).toLowerCase()) || /\.(?:webm|mp4)$/i.test(stripUrlSuffix(ref))) {
826
827
  refs.add(`${stripUrlSuffix(ref)}.timing.json`);
827
828
  }
828
829
  }
@@ -1623,6 +1624,12 @@ async function renderDocToDashboardPng(doc, container, options = {}) {
1623
1624
  }
1624
1625
  async function renderDocToMp4(doc, container, options) {
1625
1626
  options.signal?.throwIfAborted();
1627
+ if ((Object.prototype.hasOwnProperty.call(doc.frontmatter ?? {}, "squisq-presentation") || usesDynamicPresentation(doc)) && !doc.presentationApplied) {
1628
+ const { resolveAudioMapping: resolveAudioMapping2, buildPreviewDoc } = await import("@bendyline/squisq/doc");
1629
+ doc = buildPreviewDoc(await resolveAudioMapping2(doc, container));
1630
+ }
1631
+ const presentationError = doc.diagnostics?.find((item) => item.code === "presentation-invalid");
1632
+ if (presentationError) throw new Error(presentationError.message);
1626
1633
  const fps = options.fps ?? 30;
1627
1634
  const quality = options.quality ?? "normal";
1628
1635
  const orientation = options.orientation ?? "landscape";
@@ -12,6 +12,7 @@ import { tmpdir as tmpdir2 } from "os";
12
12
  import { dirname as dirname2, join as join4, resolve as resolvePath } from "path";
13
13
  import { resolveMediaSchedule as resolveMediaSchedule2 } from "@bendyline/squisq/schemas";
14
14
  import { flattenBlocks as flattenBlocks2 } from "@bendyline/squisq/doc";
15
+ import { usesDynamicPresentation } from "@bendyline/squisq/transform";
15
16
  import { ffmpegGifOutputArgs, frameTimeSeconds, generateRenderHtml } from "@bendyline/squisq-video";
16
17
  import { resolveDashboardDimensions, resolveDimensions } from "@bendyline/squisq-video";
17
18
  import {
@@ -542,7 +543,7 @@ function mp4Format() {
542
543
  const animationsEnabled = typeof mp4Opts.animationsEnabled === "boolean" ? mp4Opts.animationsEnabled : MP4_DEFAULTS.animationsEnabled;
543
544
  const outputPath = join2(tmpdir(), `squisq-mp4-${randomBytes(8).toString("hex")}.mp4`);
544
545
  try {
545
- const { renderDocToMp4: renderDocToMp42 } = await import("./api-P7LOLIZT.js");
546
+ const { renderDocToMp4: renderDocToMp42 } = await import("./api-6NVYOTM6.js");
546
547
  await renderDocToMp42(input.doc, input.container, {
547
548
  outputPath,
548
549
  fps,
@@ -583,7 +584,7 @@ function gifFormat() {
583
584
  const defaultHeight = portrait ? GIF_DEFAULTS.width : GIF_DEFAULTS.height;
584
585
  const outputPath = join2(tmpdir(), `squisq-gif-${randomBytes(8).toString("hex")}.gif`);
585
586
  try {
586
- const { renderDocToGif: renderDocToGif2 } = await import("./api-P7LOLIZT.js");
587
+ const { renderDocToGif: renderDocToGif2 } = await import("./api-6NVYOTM6.js");
587
588
  const result = await renderDocToGif2(input.doc, input.container, {
588
589
  outputPath,
589
590
  fps: typeof gifOpts.fps === "number" ? gifOpts.fps : GIF_DEFAULTS.fps,
@@ -626,7 +627,7 @@ function pngFormat() {
626
627
  async exportDoc(input, options) {
627
628
  options.signal?.throwIfAborted();
628
629
  const pngOpts = options.formatOptions?.png ?? {};
629
- const { renderDocToDashboardPng: renderDocToDashboardPng2 } = await import("./api-P7LOLIZT.js");
630
+ const { renderDocToDashboardPng: renderDocToDashboardPng2 } = await import("./api-6NVYOTM6.js");
630
631
  const result = await renderDocToDashboardPng2(input.doc, input.container, {
631
632
  resolution: pngOpts.resolution,
632
633
  width: pngOpts.width,
@@ -819,7 +820,7 @@ async function buildBareMarkdownContainer(filePath, content, doc, signal) {
819
820
  }
820
821
  refs.add("timing.json");
821
822
  for (const ref of [...refs]) {
822
- if (NARRATION_EXTENSIONS.has(extname(stripUrlSuffix(ref)).toLowerCase())) {
823
+ if (NARRATION_EXTENSIONS.has(extname(stripUrlSuffix(ref)).toLowerCase()) || /\.(?:webm|mp4)$/i.test(stripUrlSuffix(ref))) {
823
824
  refs.add(`${stripUrlSuffix(ref)}.timing.json`);
824
825
  }
825
826
  }
@@ -1620,6 +1621,12 @@ async function renderDocToDashboardPng(doc, container, options = {}) {
1620
1621
  }
1621
1622
  async function renderDocToMp4(doc, container, options) {
1622
1623
  options.signal?.throwIfAborted();
1624
+ if ((Object.prototype.hasOwnProperty.call(doc.frontmatter ?? {}, "squisq-presentation") || usesDynamicPresentation(doc)) && !doc.presentationApplied) {
1625
+ const { resolveAudioMapping: resolveAudioMapping2, buildPreviewDoc } = await import("@bendyline/squisq/doc");
1626
+ doc = buildPreviewDoc(await resolveAudioMapping2(doc, container));
1627
+ }
1628
+ const presentationError = doc.diagnostics?.find((item) => item.code === "presentation-invalid");
1629
+ if (presentationError) throw new Error(presentationError.message);
1623
1630
  const fps = options.fps ?? 30;
1624
1631
  const quality = options.quality ?? "normal";
1625
1632
  const orientation = options.orientation ?? "landscape";
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  renderDocToDashboardPng,
10
10
  renderDocToGif,
11
11
  renderDocToMp4
12
- } from "./chunk-6MZC4YQV.js";
12
+ } from "./chunk-KWE5OXEY.js";
13
13
  import "./chunk-Y5XKUWJ5.js";
14
14
 
15
15
  // src/index.ts