@bendyline/squisq-cli 2.8.18 → 2.8.20

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/NOTICE.md CHANGED
@@ -9,7 +9,7 @@ Third-party components remain under their respective license terms.
9
9
  | Package | Version | License | Repository |
10
10
  | --------------- | ------- | ---------- | --------------------------------------- |
11
11
  | commander | 12.1.0 | MIT | https://github.com/tj/commander.js |
12
- | playwright-core | 1.61.1 | Apache-2.0 | https://github.com/microsoft/playwright |
12
+ | playwright-core | 1.63.0 | Apache-2.0 | https://github.com/microsoft/playwright |
13
13
 
14
14
  Copyright and complete license texts for these dependencies are included in
15
15
  their respective npm distributions and source repositories.
@@ -9,7 +9,7 @@ repository license, the pinned upstream copy is vendored and identified below.
9
9
  COMPONENTS
10
10
  - @braintree/sanitize-url@7.1.2 (MIT); files: LICENSE
11
11
  - @iconify/utils@3.1.4 (MIT); files: license.txt
12
- - @mermaid-js/parser@1.2.0 (MIT); files: LICENSE
12
+ - @mermaid-js/parser@1.2.1 (MIT); files: LICENSE
13
13
  - @upsetjs/venn.js@2.0.0 (MIT); files: LICENSE
14
14
  - bail@2.0.2 (MIT); files: license
15
15
  - ccount@2.0.1 (MIT); files: license
@@ -67,6 +67,7 @@ COMPONENTS
67
67
  - es-toolkit@1.49.0 (MIT); files: LICENSE
68
68
  - escape-string-regexp@5.0.0 (MIT); files: license
69
69
  - extend@3.0.2 (MIT); files: LICENSE
70
+ - fastdom@1.0.12 (MIT); files: VENDORED-fastdom-1.0.12.txt
70
71
  - fault@2.0.1 (MIT); files: license
71
72
  - format@0.2.2 (MIT); files: VENDORED-format-0.2.2.txt
72
73
  - hast-util-from-html@2.0.3 (MIT); files: license
@@ -102,7 +103,7 @@ COMPONENTS
102
103
  - mdast-util-phrasing@4.1.0 (MIT); files: license
103
104
  - mdast-util-to-markdown@2.1.2 (MIT); files: license
104
105
  - mdast-util-to-string@4.0.0 (MIT); files: license
105
- - mermaid@11.16.1 (MIT); files: LICENSE
106
+ - mermaid@11.17.2 (MIT); files: LICENSE
106
107
  - micromark-core-commonmark@2.0.3 (MIT); files: license
107
108
  - micromark-extension-directive@3.0.2 (MIT); files: license
108
109
  - micromark-extension-frontmatter@2.0.0 (MIT); files: license
@@ -134,7 +135,7 @@ COMPONENTS
134
135
  - micromark@4.0.2 (MIT); files: license
135
136
  - parse-entities@4.0.2 (MIT); files: license
136
137
  - parse5@7.3.0 (MIT); files: LICENSE
137
- - preact@10.29.0 (MIT); files: LICENSE
138
+ - preact@10.29.8 (MIT); files: LICENSE
138
139
  - property-information@7.1.0 (MIT); files: license
139
140
  - remark-directive@3.0.1 (MIT); files: license
140
141
  - remark-frontmatter@5.0.0 (MIT); files: license
@@ -212,7 +213,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
212
213
  SOFTWARE.
213
214
 
214
215
  ==============================================================================
215
- @mermaid-js/parser@1.2.0 - LICENSE
216
+ @mermaid-js/parser@1.2.1 - LICENSE
216
217
  ==============================================================================
217
218
  The MIT License (MIT)
218
219
 
@@ -2064,6 +2065,19 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2064
2065
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2065
2066
 
2066
2067
 
2068
+ ==============================================================================
2069
+ fastdom@1.0.12 - VENDORED-fastdom-1.0.12.txt
2070
+ ==============================================================================
2071
+ (The MIT License)
2072
+
2073
+ Copyright (c) 2016 Wilson Page <wilsonpage@me.com>
2074
+
2075
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2076
+
2077
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2078
+
2079
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2080
+
2067
2081
  ==============================================================================
2068
2082
  fault@2.0.1 - license
2069
2083
  ==============================================================================
@@ -2987,7 +3001,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2987
3001
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2988
3002
 
2989
3003
  ==============================================================================
2990
- mermaid@11.16.1 - LICENSE
3004
+ mermaid@11.17.2 - LICENSE
2991
3005
  ==============================================================================
2992
3006
  The MIT License (MIT)
2993
3007
 
@@ -3815,7 +3829,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3815
3829
  THE SOFTWARE.
3816
3830
 
3817
3831
  ==============================================================================
3818
- preact@10.29.0 - LICENSE
3832
+ preact@10.29.8 - LICENSE
3819
3833
  ==============================================================================
3820
3834
  The MIT License (MIT)
3821
3835
 
@@ -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