@bendyline/squisq 2.11.17 → 2.11.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.
- package/NOTICE.md +2 -2
- package/THIRD_PARTY_LICENSES.txt +2 -2
- package/dist/{Doc-CXx1WL8G.d.ts → Doc-B6TYHYGc.d.ts} +14 -0
- package/dist/{ImageEditDoc-BVLXI-Zd.d.ts → ImageEditDoc-CN_3Ysj5.d.ts} +1 -1
- package/dist/chunk-3XEABCT3.js +114 -0
- package/dist/{chunk-54RU7TBZ.js → chunk-BA5MMBI6.js} +19 -4
- package/dist/chunk-CZ7AUSLI.js +80 -0
- package/dist/{chunk-MY46W5O5.js → chunk-JVY3NH6H.js} +2 -4
- package/dist/{chunk-LJZHC6GN.js → chunk-K2Z7K65P.js} +1 -1
- package/dist/{chunk-KNC4ZBQC.js → chunk-QKNFR55R.js} +826 -295
- package/dist/{chunk-L7IIFWWW.js → chunk-QLN6ILHM.js} +275 -43
- package/dist/{chunk-PGWYC3S2.js → chunk-Y4OZ5DSG.js} +1 -1
- package/dist/doc/index.d.ts +5 -22
- package/dist/doc/index.js +7 -5
- package/dist/fence/index.d.ts +1 -1
- package/dist/generate/index.d.ts +1 -1
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/inlineIconMarker.d.ts +1 -1
- package/dist/imageEdit/index.d.ts +3 -3
- package/dist/index.d.ts +6 -6
- package/dist/index.js +61 -31
- package/dist/{inlineIconMarker-CiE8Hlvz.d.ts → inlineIconMarker-BGjv-W4j.d.ts} +2 -2
- package/dist/jsonForm/index.d.ts +1 -1
- package/dist/markdown/index.js +3 -3
- package/dist/{materializePageSection-BX1uOAlN.d.ts → materializePageSection-IYXU3tDN.d.ts} +1 -1
- package/dist/mediaEdit/index.d.ts +2 -2
- package/dist/narration/index.d.ts +1 -1
- package/dist/narration/index.js +7 -6
- package/dist/schemas/index.d.ts +4 -4
- package/dist/{themeLibrary-Bnq_x-db.d.ts → themeLibrary-_46saKYO.d.ts} +1 -1
- package/dist/timing/index.d.ts +1 -1
- package/dist/transform/index.d.ts +84 -4
- package/dist/transform/index.js +37 -7
- package/package.json +2 -2
- package/dist/chunk-7N4G32LG.js +0 -80
- package/dist/chunk-PNXBDMNS.js +0 -337
package/NOTICE.md
CHANGED
|
@@ -11,7 +11,7 @@ Third-party components remain under their respective license terms.
|
|
|
11
11
|
| genson-js | 0.0.8 | Apache-2.0 | https://github.com/aspecto-io/genson-js |
|
|
12
12
|
| hast-util-from-html | 2.0.3 | MIT | https://github.com/syntax-tree/hast-util-from-html |
|
|
13
13
|
| localforage | 1.10.0 | Apache-2.0 | https://github.com/localForage/localForage |
|
|
14
|
-
| ngeohash | 0.6.
|
|
14
|
+
| ngeohash | 0.6.4 | MIT | https://github.com/sunng87/node-geohash |
|
|
15
15
|
| remark-directive | 3.0.1 | MIT | https://github.com/remarkjs/remark-directive |
|
|
16
16
|
| remark-frontmatter | 5.0.0 | MIT | https://github.com/remarkjs/remark-frontmatter |
|
|
17
17
|
| remark-gfm | 4.0.1 | MIT | https://github.com/remarkjs/remark-gfm |
|
|
@@ -19,7 +19,7 @@ Third-party components remain under their respective license terms.
|
|
|
19
19
|
| remark-parse | 11.0.0 | MIT | https://github.com/remarkjs/remark/tree/main/packages/remark-parse |
|
|
20
20
|
| remark-stringify | 11.0.0 | MIT | https://github.com/remarkjs/remark/tree/main/packages/remark-stringify |
|
|
21
21
|
| unified | 11.0.5 | MIT | https://unifiedjs.com |
|
|
22
|
-
| @fortawesome/fontawesome-free _(bundled)_ | 7.
|
|
22
|
+
| @fortawesome/fontawesome-free _(bundled)_ | 7.3.1 | CC-BY-4.0 AND OFL-1.1 AND MIT | https://github.com/FortAwesome/Font-Awesome |
|
|
23
23
|
|
|
24
24
|
The generated icon catalog incorporates Font Awesome Free metadata. Exact
|
|
25
25
|
third-party license texts for bundled code and data are shipped in
|
package/THIRD_PARTY_LICENSES.txt
CHANGED
|
@@ -5,10 +5,10 @@ and notice files are reproduced verbatim. When an npm tarball omits its
|
|
|
5
5
|
repository license, the pinned upstream copy is vendored and identified below.
|
|
6
6
|
|
|
7
7
|
COMPONENTS
|
|
8
|
-
- @fortawesome/fontawesome-free@7.
|
|
8
|
+
- @fortawesome/fontawesome-free@7.3.1 ((CC-BY-4.0 AND OFL-1.1 AND MIT)); files: LICENSE.txt
|
|
9
9
|
|
|
10
10
|
==============================================================================
|
|
11
|
-
@fortawesome/fontawesome-free@7.
|
|
11
|
+
@fortawesome/fontawesome-free@7.3.1 - LICENSE.txt
|
|
12
12
|
==============================================================================
|
|
13
13
|
Fonticons, Inc. (https://fontawesome.com)
|
|
14
14
|
|
|
@@ -703,6 +703,8 @@ interface AccentImage {
|
|
|
703
703
|
* Base properties shared by all template blocks.
|
|
704
704
|
*/
|
|
705
705
|
interface BaseTemplateBlock {
|
|
706
|
+
/** Compiled presentation timing is authoritative; pacing must not merge or split it. */
|
|
707
|
+
timelineLocked?: boolean;
|
|
706
708
|
/** Unique block ID */
|
|
707
709
|
id: string;
|
|
708
710
|
/** Block duration in seconds */
|
|
@@ -1310,6 +1312,8 @@ interface DiagramTemplateEdge {
|
|
|
1310
1312
|
*/
|
|
1311
1313
|
interface DiagramBlockInput extends BaseTemplateBlock {
|
|
1312
1314
|
template: 'diagram';
|
|
1315
|
+
/** Paint an opaque themed surface for standalone slides; omitted stays transparent. */
|
|
1316
|
+
background?: 'surface';
|
|
1313
1317
|
/** Optional diagram title displayed above the canvas. */
|
|
1314
1318
|
title?: string;
|
|
1315
1319
|
/** Color scheme for nodes and edges. */
|
|
@@ -2330,6 +2334,16 @@ interface DocDiagnostic {
|
|
|
2330
2334
|
* A complete visual doc for an article.
|
|
2331
2335
|
*/
|
|
2332
2336
|
interface Doc {
|
|
2337
|
+
/** Projection-only source/timing metadata from the document narration take. */
|
|
2338
|
+
presentationNarration?: {
|
|
2339
|
+
sourceText: string;
|
|
2340
|
+
src: string;
|
|
2341
|
+
startTime: number;
|
|
2342
|
+
duration: number;
|
|
2343
|
+
bookmarks: AudioBookmark[];
|
|
2344
|
+
};
|
|
2345
|
+
/** Projection-only guard: never compile an accepted plan twice. */
|
|
2346
|
+
presentationApplied?: boolean;
|
|
2333
2347
|
/** Article ID this doc belongs to */
|
|
2334
2348
|
articleId: string;
|
|
2335
2349
|
/** Total duration in seconds (sum of all audio segments) */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a2 as ImageLayer, bu as TextLayer, bh as ShapeLayer, aX as PathLayer } from './Doc-
|
|
1
|
+
import { a2 as ImageLayer, bu as TextLayer, bh as ShapeLayer, aX as PathLayer } from './Doc-B6TYHYGc.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ImageEditDoc — JSON document describing a layered, editable image.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// src/narration/sidecar.ts
|
|
2
|
+
function resolveNarrationTimingGenerator(options) {
|
|
3
|
+
const baseWpm = options?.generator?.baseWpm ?? options?.baseWpm;
|
|
4
|
+
return {
|
|
5
|
+
name: options?.generator?.name ?? "squisq-teleprompter",
|
|
6
|
+
method: options?.generator?.method ?? "dsp-align",
|
|
7
|
+
...baseWpm !== void 0 ? { baseWpm } : {}
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function buildNarrationTimingJson(script, alignment, durationSec, options) {
|
|
11
|
+
const bookmarks = alignment.words.map((word) => {
|
|
12
|
+
const token = script.tokens[word.tokenIndex];
|
|
13
|
+
return {
|
|
14
|
+
id: `word-${word.tokenIndex}`,
|
|
15
|
+
time: word.tSec,
|
|
16
|
+
charOffset: token?.charOffset ?? 0,
|
|
17
|
+
textFragment: token?.text ?? ""
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
const blocks = alignment.blocks.map((range) => ({
|
|
21
|
+
...range.blockId ? { blockId: range.blockId } : {},
|
|
22
|
+
...range.heading !== void 0 ? { heading: range.heading } : {},
|
|
23
|
+
blockIndex: range.blockIndex,
|
|
24
|
+
charStart: range.charStart,
|
|
25
|
+
charEnd: range.charEnd,
|
|
26
|
+
startSec: range.startSec,
|
|
27
|
+
endSec: range.endSec
|
|
28
|
+
}));
|
|
29
|
+
return {
|
|
30
|
+
version: 3,
|
|
31
|
+
sourceText: script.sourceText,
|
|
32
|
+
duration: Number.isFinite(durationSec) && durationSec >= 0 ? durationSec : 0,
|
|
33
|
+
bookmarks,
|
|
34
|
+
blocks,
|
|
35
|
+
// Write only what `parseNarrationTimingJson` will read back, so the codec
|
|
36
|
+
// is a round-trip pair. A non-finite value would serialize to `null`
|
|
37
|
+
// (JSON has no NaN) and be dropped on parse anyway — omitting it here
|
|
38
|
+
// keeps the emitted sidecar honest rather than carrying a dead field.
|
|
39
|
+
...finiteNumber(options?.cameraOffsetSec) ? { cameraOffsetSec: options.cameraOffsetSec } : {},
|
|
40
|
+
generator: resolveNarrationTimingGenerator(options)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function finiteNonNegative(value) {
|
|
44
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
45
|
+
}
|
|
46
|
+
function finiteNumber(value) {
|
|
47
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
48
|
+
}
|
|
49
|
+
function parseNarrationTimingJson(data) {
|
|
50
|
+
try {
|
|
51
|
+
const text = typeof data === "string" ? data : new TextDecoder().decode(data instanceof Uint8Array ? data : new Uint8Array(data));
|
|
52
|
+
const parsed = JSON.parse(text);
|
|
53
|
+
if (typeof parsed !== "object" || parsed === null) return null;
|
|
54
|
+
const raw = parsed;
|
|
55
|
+
if (typeof raw.sourceText !== "string" || !finiteNonNegative(raw.duration)) return null;
|
|
56
|
+
const bookmarks = Array.isArray(raw.bookmarks) ? raw.bookmarks.flatMap((b) => {
|
|
57
|
+
if (typeof b !== "object" || b === null) return [];
|
|
58
|
+
const bookmark = b;
|
|
59
|
+
if (!finiteNonNegative(bookmark.time) || !finiteNonNegative(bookmark.charOffset)) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
return [
|
|
63
|
+
{
|
|
64
|
+
id: typeof bookmark.id === "string" ? bookmark.id : `bookmark-${bookmark.charOffset}`,
|
|
65
|
+
time: bookmark.time,
|
|
66
|
+
charOffset: bookmark.charOffset,
|
|
67
|
+
...typeof bookmark.textFragment === "string" ? { textFragment: bookmark.textFragment } : {}
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
}) : [];
|
|
71
|
+
let blocks = Array.isArray(raw.blocks) ? raw.blocks.flatMap((b) => {
|
|
72
|
+
if (typeof b !== "object" || b === null) return [];
|
|
73
|
+
const block = b;
|
|
74
|
+
if (!finiteNonNegative(block.startSec) || !finiteNonNegative(block.endSec) || !finiteNonNegative(block.charStart) || !finiteNonNegative(block.charEnd)) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
return [
|
|
78
|
+
{
|
|
79
|
+
...typeof block.blockId === "string" ? { blockId: block.blockId } : {},
|
|
80
|
+
...typeof block.heading === "string" ? { heading: block.heading } : {},
|
|
81
|
+
blockIndex: finiteNonNegative(block.blockIndex) ? block.blockIndex : 0,
|
|
82
|
+
charStart: block.charStart,
|
|
83
|
+
charEnd: block.charEnd,
|
|
84
|
+
startSec: block.startSec,
|
|
85
|
+
endSec: Math.max(block.startSec, block.endSec)
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
}) : [];
|
|
89
|
+
blocks = blocks.sort((a, b) => a.startSec - b.startSec);
|
|
90
|
+
let cursor = 0;
|
|
91
|
+
for (const block of blocks) {
|
|
92
|
+
if (block.startSec < cursor) block.startSec = cursor;
|
|
93
|
+
if (block.endSec < block.startSec) block.endSec = block.startSec;
|
|
94
|
+
cursor = block.startSec;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
version: 3,
|
|
98
|
+
sourceText: raw.sourceText,
|
|
99
|
+
duration: raw.duration,
|
|
100
|
+
bookmarks,
|
|
101
|
+
blocks,
|
|
102
|
+
...finiteNumber(raw.cameraOffsetSec) ? { cameraOffsetSec: raw.cameraOffsetSec } : {},
|
|
103
|
+
...typeof raw.generator === "object" && raw.generator !== null ? { generator: raw.generator } : {}
|
|
104
|
+
};
|
|
105
|
+
} catch {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export {
|
|
111
|
+
resolveNarrationTimingGenerator,
|
|
112
|
+
buildNarrationTimingJson,
|
|
113
|
+
parseNarrationTimingJson
|
|
114
|
+
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
buildNarrationScript,
|
|
3
2
|
parseNarrationTimingJson
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3XEABCT3.js";
|
|
4
|
+
import {
|
|
5
|
+
applySavedPresentation
|
|
6
|
+
} from "./chunk-QKNFR55R.js";
|
|
5
7
|
import {
|
|
6
8
|
SHAPE_NAMES,
|
|
7
9
|
buildChartData,
|
|
10
|
+
buildNarrationScript,
|
|
8
11
|
buildRegistry,
|
|
9
12
|
coerceTemplateParams,
|
|
10
13
|
deriveTemplateInputs,
|
|
@@ -32,7 +35,7 @@ import {
|
|
|
32
35
|
templateRegistry,
|
|
33
36
|
writeCustomTemplatesToFrontmatter,
|
|
34
37
|
writeCustomThemesToFrontmatter
|
|
35
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-QLN6ILHM.js";
|
|
36
39
|
import {
|
|
37
40
|
ASCII_TREE_VOCAB,
|
|
38
41
|
ASCII_VOCAB,
|
|
@@ -82,7 +85,7 @@ import {
|
|
|
82
85
|
} from "./chunk-L7QZORLB.js";
|
|
83
86
|
import {
|
|
84
87
|
parseMarkdown
|
|
85
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-Y4OZ5DSG.js";
|
|
86
89
|
import {
|
|
87
90
|
KNOWN_BLOCK_META_KEYS,
|
|
88
91
|
TABLE_FED_TEMPLATES,
|
|
@@ -1033,6 +1036,8 @@ function resolveDocumentTitle(doc, provided) {
|
|
|
1033
1036
|
return provided?.trim() ?? "";
|
|
1034
1037
|
}
|
|
1035
1038
|
function buildPreviewDoc(doc, options) {
|
|
1039
|
+
doc = applySavedPresentation(doc);
|
|
1040
|
+
if (doc.presentationApplied) options = { ...options, interleaveImages: false };
|
|
1036
1041
|
const flat = flattenRenderableBlocks(doc.blocks);
|
|
1037
1042
|
const allImages = collectAllDocImages(doc.blocks);
|
|
1038
1043
|
const usedImageSrcs = /* @__PURE__ */ new Set();
|
|
@@ -4418,6 +4423,16 @@ async function applyNarrationTiming(doc, container) {
|
|
|
4418
4423
|
...doc,
|
|
4419
4424
|
blocks,
|
|
4420
4425
|
duration,
|
|
4426
|
+
presentationNarration: {
|
|
4427
|
+
sourceText: timing.sourceText,
|
|
4428
|
+
src: clip.src,
|
|
4429
|
+
startTime: clip.startAt,
|
|
4430
|
+
duration: playedDuration,
|
|
4431
|
+
bookmarks: timing.bookmarks.flatMap((bookmark) => {
|
|
4432
|
+
const time = timeMap ? timeMap.sourceToPlayed(bookmark.time) : bookmark.time;
|
|
4433
|
+
return time !== null && time >= 0 && time <= playedDuration ? [{ ...bookmark, time: clip.startAt + time }] : [];
|
|
4434
|
+
})
|
|
4435
|
+
},
|
|
4421
4436
|
...captions ? { captions } : {},
|
|
4422
4437
|
...ctx.diagnostics.length > 0 ? { diagnostics: [...doc.diagnostics ?? [], ...ctx.diagnostics] } : {}
|
|
4423
4438
|
};
|