@bendyline/squisq 2.11.14 → 2.11.15
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/{chunk-GDF2FWL6.js → chunk-4IQ2DHCI.js} +78 -9
- package/dist/{chunk-HHGVTXHR.js → chunk-GQWIUBJU.js} +1 -1
- package/dist/{chunk-6H2HBBFC.js → chunk-Z35TG4WR.js} +10 -5
- package/dist/doc/index.d.ts +6 -0
- package/dist/doc/index.js +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -4
- package/dist/narration/index.d.ts +27 -7
- package/dist/narration/index.js +4 -2
- package/dist/timing/index.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-44BJ42GT.js → chunk-4OQFLZ6G.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildNarrationScript,
|
|
3
3
|
parseNarrationTimingJson
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Z35TG4WR.js";
|
|
5
5
|
import {
|
|
6
6
|
SHAPE_NAMES,
|
|
7
7
|
buildChartData,
|
|
@@ -98,6 +98,9 @@ import {
|
|
|
98
98
|
parseHtmlToNodes,
|
|
99
99
|
readFrontmatterThemeId
|
|
100
100
|
} from "./chunk-X7BNDUNI.js";
|
|
101
|
+
import {
|
|
102
|
+
buildCaptionTrack
|
|
103
|
+
} from "./chunk-4OQFLZ6G.js";
|
|
101
104
|
import {
|
|
102
105
|
estimateTimeFromText
|
|
103
106
|
} from "./chunk-GHOPHGOK.js";
|
|
@@ -954,9 +957,11 @@ function blockToSlide(block, index, knownTemplates, documentTitle) {
|
|
|
954
957
|
// authored rich elements (Mermaid fences today; other media can follow)
|
|
955
958
|
// independently of the selected visual template.
|
|
956
959
|
...block.contents ? { contents: block.contents } : {},
|
|
957
|
-
// Custom templates consume child blocks through tokens
|
|
958
|
-
//
|
|
959
|
-
|
|
960
|
+
// Custom templates consume child blocks through tokens, and container
|
|
961
|
+
// templates (diagram, drawing, layout) draw their children as the canvas:
|
|
962
|
+
// without them a drawing renders as an empty frame in the slideshow,
|
|
963
|
+
// video export, and PPTX. They are never flattened into their own slides.
|
|
964
|
+
...block.children && (isCustomTemplate || isContainerTemplate(template)) ? { children: block.children } : {},
|
|
960
965
|
...block.summaryMode && block.layers ? { layers: block.layers } : {},
|
|
961
966
|
...defaults,
|
|
962
967
|
...extraFields,
|
|
@@ -4297,6 +4302,34 @@ function mapRangesToPlayed(ranges, map2) {
|
|
|
4297
4302
|
}
|
|
4298
4303
|
return mapped;
|
|
4299
4304
|
}
|
|
4305
|
+
function narrationCaptions(doc, clip, timing, timeMap, playedDuration) {
|
|
4306
|
+
if (timing.bookmarks.length === 0 || !(playedDuration > 0)) return null;
|
|
4307
|
+
const bookmarks = [];
|
|
4308
|
+
for (const bookmark of timing.bookmarks) {
|
|
4309
|
+
if (!timeMap) {
|
|
4310
|
+
if (bookmark.time <= playedDuration) bookmarks.push(bookmark);
|
|
4311
|
+
} else if (timeMap.sourceToPlayed(bookmark.time) !== null) {
|
|
4312
|
+
bookmarks.push({ ...bookmark, time: timeMap.snapSourceToPlayed(bookmark.time) });
|
|
4313
|
+
}
|
|
4314
|
+
}
|
|
4315
|
+
if (bookmarks.length === 0) return null;
|
|
4316
|
+
bookmarks.sort((a, b) => a.time - b.time);
|
|
4317
|
+
const track = buildCaptionTrack(
|
|
4318
|
+
[
|
|
4319
|
+
{
|
|
4320
|
+
segment: {
|
|
4321
|
+
src: clip.src,
|
|
4322
|
+
name: "narration",
|
|
4323
|
+
startTime: clip.startAt,
|
|
4324
|
+
duration: playedDuration
|
|
4325
|
+
},
|
|
4326
|
+
timing: { sourceText: timing.sourceText, bookmarks, duration: playedDuration }
|
|
4327
|
+
}
|
|
4328
|
+
],
|
|
4329
|
+
doc.captions?.generatedAt ? { generatedAt: doc.captions.generatedAt } : {}
|
|
4330
|
+
);
|
|
4331
|
+
return track.phrases.length > 0 ? track : null;
|
|
4332
|
+
}
|
|
4300
4333
|
function retimeBlocks(blocks, ctx) {
|
|
4301
4334
|
return blocks.map((block) => {
|
|
4302
4335
|
const range = ctx.ranges.get(block.id);
|
|
@@ -4353,10 +4386,12 @@ async function applyNarrationTiming(doc, container) {
|
|
|
4353
4386
|
};
|
|
4354
4387
|
const blocks = retimeBlocks(doc.blocks, ctx);
|
|
4355
4388
|
const duration = Math.max(clip.startAt + playedDuration, ctx.cursor);
|
|
4389
|
+
const captions = narrationCaptions(doc, clip, timing, timeMap, playedDuration);
|
|
4356
4390
|
const retimed = {
|
|
4357
4391
|
...doc,
|
|
4358
4392
|
blocks,
|
|
4359
4393
|
duration,
|
|
4394
|
+
...captions ? { captions } : {},
|
|
4360
4395
|
...ctx.diagnostics.length > 0 ? { diagnostics: [...doc.diagnostics ?? [], ...ctx.diagnostics] } : {}
|
|
4361
4396
|
};
|
|
4362
4397
|
return { doc: retimed, applied: true, clipSrc: clip.src };
|
|
@@ -4813,6 +4848,10 @@ function collectKnownTemplates(doc, options) {
|
|
|
4813
4848
|
function isDrawingBlock(block) {
|
|
4814
4849
|
return resolveTemplateName(block.template ?? "") === "drawing";
|
|
4815
4850
|
}
|
|
4851
|
+
function isLayoutBlock(block) {
|
|
4852
|
+
return resolveTemplateName(block.template ?? "") === "layout";
|
|
4853
|
+
}
|
|
4854
|
+
var LAYOUT_IMAGE_LAYERS = /* @__PURE__ */ new Set(["image", "img"]);
|
|
4816
4855
|
function checkTemplate(block, parent, known, diagnostics) {
|
|
4817
4856
|
const requested = block.sourceHeading?.templateAnnotation?.template ?? block.sourceAnnotation?.template;
|
|
4818
4857
|
if (!requested) return;
|
|
@@ -4830,11 +4869,37 @@ function checkTemplate(block, parent, known, diagnostics) {
|
|
|
4830
4869
|
});
|
|
4831
4870
|
return;
|
|
4832
4871
|
}
|
|
4872
|
+
if (parent && isLayoutBlock(parent)) {
|
|
4873
|
+
if (LAYOUT_IMAGE_LAYERS.has(requested.toLowerCase())) {
|
|
4874
|
+
if (!block.templateOverrides?.src) {
|
|
4875
|
+
diagnostics.push({
|
|
4876
|
+
severity: "warning",
|
|
4877
|
+
code: "layout-image-missing-src",
|
|
4878
|
+
message: `Layout image "${block.id}" has no src= \u2014 the layer will be skipped`,
|
|
4879
|
+
blockId: block.id,
|
|
4880
|
+
...lineOf(block)
|
|
4881
|
+
});
|
|
4882
|
+
}
|
|
4883
|
+
return;
|
|
4884
|
+
}
|
|
4885
|
+
if (normalizeShapeKind(block.template ?? requested) || normalizeShapeKind(requested)) return;
|
|
4886
|
+
const suggestion2 = nearestName(requested, /* @__PURE__ */ new Set([...SHAPE_NAMES, "image"]), {
|
|
4887
|
+
map: resolveTemplateName
|
|
4888
|
+
});
|
|
4889
|
+
diagnostics.push({
|
|
4890
|
+
severity: "warning",
|
|
4891
|
+
code: "unknown-layer",
|
|
4892
|
+
message: `"${requested}" is not a layout layer \u2014 the child will be skipped. Layers are text, image, or a drawing shape` + (suggestion2 ? `. Did you mean "${suggestion2}"?` : ""),
|
|
4893
|
+
blockId: block.id,
|
|
4894
|
+
...lineOf(block)
|
|
4895
|
+
});
|
|
4896
|
+
return;
|
|
4897
|
+
}
|
|
4833
4898
|
if (isShapeName(requested)) {
|
|
4834
4899
|
diagnostics.push({
|
|
4835
4900
|
severity: "warning",
|
|
4836
4901
|
code: "shape-outside-drawing",
|
|
4837
|
-
message: `Shape "${requested}" is only recognized on a child heading of a {[drawing]} block`,
|
|
4902
|
+
message: `Shape "${requested}" is only recognized on a child heading of a {[drawing]} or {[layout]} block`,
|
|
4838
4903
|
blockId: block.id,
|
|
4839
4904
|
...lineOf(block)
|
|
4840
4905
|
});
|
|
@@ -4853,7 +4918,7 @@ function checkTemplate(block, parent, known, diagnostics) {
|
|
|
4853
4918
|
function checkTemplateInputs(block, parent, customNames, diagnostics) {
|
|
4854
4919
|
const requested = block.sourceHeading?.templateAnnotation?.template;
|
|
4855
4920
|
if (!requested) return;
|
|
4856
|
-
if (parent && isDrawingBlock(parent)) return;
|
|
4921
|
+
if (parent && (isDrawingBlock(parent) || isLayoutBlock(parent))) return;
|
|
4857
4922
|
if (isShapeName(requested)) return;
|
|
4858
4923
|
const canonical = resolveTemplateName(requested);
|
|
4859
4924
|
if (customNames.has(requested) || customNames.has(canonical)) return;
|
|
@@ -4878,6 +4943,7 @@ function isInputSatisfiable(canonical, block, key) {
|
|
|
4878
4943
|
return derived != null && key in derived;
|
|
4879
4944
|
}
|
|
4880
4945
|
var NUMERIC_SHAPE_KEYS = ["x", "y", "width", "height", "w", "h", "strokeWidth", "borderRadius"];
|
|
4946
|
+
var NUMERIC_LAYER_KEYS = [...NUMERIC_SHAPE_KEYS, "fontSize", "lineHeight", "padding"];
|
|
4881
4947
|
function checkAttributeCoercion(block, parent, diagnostics) {
|
|
4882
4948
|
const params = block.sourceHeading?.attributes?.params;
|
|
4883
4949
|
if (params) {
|
|
@@ -4892,9 +4958,12 @@ function checkAttributeCoercion(block, parent, diagnostics) {
|
|
|
4892
4958
|
});
|
|
4893
4959
|
}
|
|
4894
4960
|
}
|
|
4895
|
-
|
|
4961
|
+
const inDrawing = parent !== void 0 && isDrawingBlock(parent) && isShapeName(block.template);
|
|
4962
|
+
const inLayout = parent !== void 0 && isLayoutBlock(parent);
|
|
4963
|
+
if (inDrawing || inLayout) {
|
|
4896
4964
|
const overrides = block.templateOverrides ?? {};
|
|
4897
|
-
|
|
4965
|
+
const label = inLayout ? "Layout layer" : "Drawing shape";
|
|
4966
|
+
for (const key of inLayout ? NUMERIC_LAYER_KEYS : NUMERIC_SHAPE_KEYS) {
|
|
4898
4967
|
const raw = overrides[key];
|
|
4899
4968
|
if (raw == null) continue;
|
|
4900
4969
|
const value = raw.replace(/,\s*$/, "").trim();
|
|
@@ -4902,7 +4971,7 @@ function checkAttributeCoercion(block, parent, diagnostics) {
|
|
|
4902
4971
|
diagnostics.push({
|
|
4903
4972
|
severity: "warning",
|
|
4904
4973
|
code: "invalid-attribute",
|
|
4905
|
-
message:
|
|
4974
|
+
message: `${label} "${block.id}": "${key}" is not a number (${JSON.stringify(raw)})`,
|
|
4906
4975
|
blockId: block.id,
|
|
4907
4976
|
...lineOf(block)
|
|
4908
4977
|
});
|
|
@@ -216,6 +216,14 @@ function wordIndexAtTime(words, tSec) {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
// src/narration/sidecar.ts
|
|
219
|
+
function resolveNarrationTimingGenerator(options) {
|
|
220
|
+
const baseWpm = options?.generator?.baseWpm ?? options?.baseWpm;
|
|
221
|
+
return {
|
|
222
|
+
name: options?.generator?.name ?? "squisq-teleprompter",
|
|
223
|
+
method: options?.generator?.method ?? "dsp-align",
|
|
224
|
+
...baseWpm !== void 0 ? { baseWpm } : {}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
219
227
|
function buildNarrationTimingJson(script, alignment, durationSec, options) {
|
|
220
228
|
const bookmarks = alignment.words.map((word) => {
|
|
221
229
|
const token = script.tokens[word.tokenIndex];
|
|
@@ -246,11 +254,7 @@ function buildNarrationTimingJson(script, alignment, durationSec, options) {
|
|
|
246
254
|
// (JSON has no NaN) and be dropped on parse anyway — omitting it here
|
|
247
255
|
// keeps the emitted sidecar honest rather than carrying a dead field.
|
|
248
256
|
...finiteNumber(options?.cameraOffsetSec) ? { cameraOffsetSec: options.cameraOffsetSec } : {},
|
|
249
|
-
generator:
|
|
250
|
-
name: "squisq-teleprompter",
|
|
251
|
-
method: "dsp-align",
|
|
252
|
-
...options?.baseWpm !== void 0 ? { baseWpm: options.baseWpm } : {}
|
|
253
|
-
}
|
|
257
|
+
generator: resolveNarrationTimingGenerator(options)
|
|
254
258
|
};
|
|
255
259
|
}
|
|
256
260
|
function finiteNonNegative(value) {
|
|
@@ -327,6 +331,7 @@ export {
|
|
|
327
331
|
wordPosAtExpectedSyllables,
|
|
328
332
|
wordIndexAtChar,
|
|
329
333
|
wordIndexAtTime,
|
|
334
|
+
resolveNarrationTimingGenerator,
|
|
330
335
|
buildNarrationTimingJson,
|
|
331
336
|
parseNarrationTimingJson
|
|
332
337
|
};
|
package/dist/doc/index.d.ts
CHANGED
|
@@ -3370,6 +3370,11 @@ declare function resolveAudioMapping(doc: Doc, container: ContentContainer): Pro
|
|
|
3370
3370
|
* (a conflicting pin gets an `info` diagnostic); narration ranges win
|
|
3371
3371
|
* over per-block audio-segment mapping and reading-time estimates.
|
|
3372
3372
|
*
|
|
3373
|
+
* Captions: when the sidecar carries word timings (v3 bookmarks), the doc's
|
|
3374
|
+
* reading-time caption estimates are replaced by captions built from those
|
|
3375
|
+
* words, mapped through the clip's trim/cuts — so captions follow the voice
|
|
3376
|
+
* instead of drifting after re-timing. Without word timings they are kept.
|
|
3377
|
+
*
|
|
3373
3378
|
* Contiguity: the block strip never opens a gap (or an overlap) around a
|
|
3374
3379
|
* pin. When a pin moves a block's end away from the take's range
|
|
3375
3380
|
* boundary, every later narration anchor ripples by the same delta —
|
|
@@ -3587,6 +3592,7 @@ declare function extractTableData(table: MarkdownTable): ExtractedTableData;
|
|
|
3587
3592
|
*
|
|
3588
3593
|
* - unknown template names (with a did-you-mean suggestion)
|
|
3589
3594
|
* - unknown drawing shapes, and shape annotations used outside a `{[drawing]}`
|
|
3595
|
+
* or `{[layout]}`; unknown layout layers and layout images without `src=`
|
|
3590
3596
|
* - `{[…]}` text that was not recognized as an annotation (bad quoting,
|
|
3591
3597
|
* non-heading placement, unknown inline icon)
|
|
3592
3598
|
* - malformed heading-attribute values (`x=abc`, bad `startTime`) and
|
package/dist/doc/index.js
CHANGED
|
@@ -74,8 +74,8 @@ import {
|
|
|
74
74
|
validateMarkdownSource,
|
|
75
75
|
wordRevealDelay,
|
|
76
76
|
writeDashboardLayoutsToFrontmatter
|
|
77
|
-
} from "../chunk-
|
|
78
|
-
import "../chunk-
|
|
77
|
+
} from "../chunk-4IQ2DHCI.js";
|
|
78
|
+
import "../chunk-Z35TG4WR.js";
|
|
79
79
|
import {
|
|
80
80
|
ASCII_CHAR_H,
|
|
81
81
|
ASCII_CHAR_W,
|
|
@@ -273,6 +273,7 @@ import {
|
|
|
273
273
|
import "../chunk-X7BNDUNI.js";
|
|
274
274
|
import "../chunk-7N4G32LG.js";
|
|
275
275
|
import "../chunk-4VOD55SX.js";
|
|
276
|
+
import "../chunk-4OQFLZ6G.js";
|
|
276
277
|
import "../chunk-GHOPHGOK.js";
|
|
277
278
|
import "../chunk-XRW6P7IF.js";
|
|
278
279
|
export {
|
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { AnimatedImageFormat, AnimatedImageInfo, IMAGE_EDIT_ASSETS_PREFIX, IMAGE
|
|
|
24
24
|
export { I as ICONS, a as IconEntry, b as IconFamily, c as IconTextRun, h as hasIconMarker, i as iconClass, d as iconMarker, s as splitIconMarkers, e as stripIconMarkers } from './inlineIconMarker-CiE8Hlvz.js';
|
|
25
25
|
export { IconSuggestion, canonicalIconToken, iconGlyph, looksLikeIconToken, resolveIcon, suggestIcons } from './icons/index.js';
|
|
26
26
|
export { BlockContentProfile, RecommendationResult, profileBlockContents, recommendTemplatesForBlock } from './recommend/index.js';
|
|
27
|
-
export { AdvanceCoverage, AlignConfig, AlignInput, BandpassState, BuildAdvanceTimingOptions, BuildNarrationTimingOptions, BuildScriptOptions, DEFAULT_ALIGN_CONFIG, DEFAULT_FEATURE_CONFIG, DEFAULT_NUCLEI_CONFIG, DEFAULT_PACING_CONFIG, DEFAULT_VAD_CONFIG, EMPTY_ADVANCE_LOG, FeatureConfig, FeatureState, FrameFeatures, NarrationAlignment, NarrationBlockRange, NarrationScript, NarrationSessionConfig, NarrationSessionState, NarrationTimingBlock, NarrationTimingJsonV3, NarrationTimingMethod, NarrationTrace, NucleiConfig, NucleiState, PacingConfig, PacingState, PacingTick, ScriptBlockRange, ScriptToken, SlideAdvance, SlideAdvanceLog, TraceSample, VadConfig, VadState, WordTiming, advanceCoverage, alignNarration, bandpassRun, buildAdvanceTimingJson, buildNarrationScript, buildNarrationTimingJson, createBandpass, createFeatureState, createNarrationSession, createNucleiState, createPacingState, createVadState, detectSyllableOnsets, downsampleTrace, estimateSyllables, expectedSyllablesAt, extractFrameFeatures, featureStep, narrationSessionStep, nucleiStep, pacingStep, parseNarrationTimingJson, reanchorPacing, reanchorSession, recordSlideShown, traceWordPosAt, vadStep, wordIndexAtChar, wordIndexAtTime, wordPosAtExpectedSyllables } from './narration/index.js';
|
|
27
|
+
export { AdvanceCoverage, AlignConfig, AlignInput, BandpassState, BuildAdvanceTimingOptions, BuildNarrationTimingOptions, BuildScriptOptions, DEFAULT_ALIGN_CONFIG, DEFAULT_FEATURE_CONFIG, DEFAULT_NUCLEI_CONFIG, DEFAULT_PACING_CONFIG, DEFAULT_VAD_CONFIG, EMPTY_ADVANCE_LOG, FeatureConfig, FeatureState, FrameFeatures, NarrationAlignment, NarrationBlockRange, NarrationScript, NarrationSessionConfig, NarrationSessionState, NarrationTimingBlock, NarrationTimingGenerator, NarrationTimingJsonV3, NarrationTimingMethod, NarrationTrace, NucleiConfig, NucleiState, PacingConfig, PacingState, PacingTick, ScriptBlockRange, ScriptToken, SlideAdvance, SlideAdvanceLog, TraceSample, VadConfig, VadState, WordTiming, advanceCoverage, alignNarration, bandpassRun, buildAdvanceTimingJson, buildNarrationScript, buildNarrationTimingJson, createBandpass, createFeatureState, createNarrationSession, createNucleiState, createPacingState, createVadState, detectSyllableOnsets, downsampleTrace, estimateSyllables, expectedSyllablesAt, extractFrameFeatures, featureStep, narrationSessionStep, nucleiStep, pacingStep, parseNarrationTimingJson, reanchorPacing, reanchorSession, recordSlideShown, resolveNarrationTimingGenerator, traceWordPosAt, vadStep, wordIndexAtChar, wordIndexAtTime, wordPosAtExpectedSyllables } from './narration/index.js';
|
|
28
28
|
export { FenceRenderContext, FenceRenderer, FenceRendererMap, fenceRendererLangs } from './fence/index.js';
|
|
29
29
|
export { P as PROOF_DIALECTS, a as ProofCategory, b as ProofDialect, c as ProofFinding, d as ProofRange, e as ProofSuggestion, f as ProofSuggestionKind } from './types-BQWu0gzi.js';
|
|
30
30
|
export { BlankProtectedSpansOptions, BlankedText, DEFAULT_PROOF_SETTINGS, JoinedSegments, LINT_KIND_CATEGORIES, PROOF_FRONTMATTER_KEYS, PROOF_JOIN_SEPARATOR, ProofingSettings, SegmentSpan, blankProtectedSpans, buildJoinedText, categorizeLintKind, dropMaskedFindings, formatProofDictionary, mapJoinedSpanToSegment, parseProofDictionary, readProofingSettings, resolveProofDialect } from './proof/index.js';
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
recordSlideShown,
|
|
28
28
|
traceWordPosAt,
|
|
29
29
|
vadStep
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GQWIUBJU.js";
|
|
31
31
|
import {
|
|
32
32
|
fenceRendererLangs
|
|
33
33
|
} from "./chunk-PGI7HSWE.js";
|
|
@@ -246,17 +246,18 @@ import {
|
|
|
246
246
|
validateMarkdownSource,
|
|
247
247
|
wordRevealDelay,
|
|
248
248
|
writeDashboardLayoutsToFrontmatter
|
|
249
|
-
} from "./chunk-
|
|
249
|
+
} from "./chunk-4IQ2DHCI.js";
|
|
250
250
|
import {
|
|
251
251
|
buildNarrationScript,
|
|
252
252
|
buildNarrationTimingJson,
|
|
253
253
|
estimateSyllables,
|
|
254
254
|
expectedSyllablesAt,
|
|
255
255
|
parseNarrationTimingJson,
|
|
256
|
+
resolveNarrationTimingGenerator,
|
|
256
257
|
wordIndexAtChar,
|
|
257
258
|
wordIndexAtTime,
|
|
258
259
|
wordPosAtExpectedSyllables
|
|
259
|
-
} from "./chunk-
|
|
260
|
+
} from "./chunk-Z35TG4WR.js";
|
|
260
261
|
import {
|
|
261
262
|
ASCII_CHAR_H,
|
|
262
263
|
ASCII_CHAR_W,
|
|
@@ -618,7 +619,7 @@ import {
|
|
|
618
619
|
} from "./chunk-4VOD55SX.js";
|
|
619
620
|
import {
|
|
620
621
|
buildCaptionTrack
|
|
621
|
-
} from "./chunk-
|
|
622
|
+
} from "./chunk-4OQFLZ6G.js";
|
|
622
623
|
import {
|
|
623
624
|
DEFAULT_WORDS_PER_SECOND,
|
|
624
625
|
calculatePrefixDuration,
|
|
@@ -1112,6 +1113,7 @@ export {
|
|
|
1112
1113
|
resolveMediaSchedule,
|
|
1113
1114
|
resolveMotionForDoc,
|
|
1114
1115
|
resolveMotionProfile,
|
|
1116
|
+
resolveNarrationTimingGenerator,
|
|
1115
1117
|
resolvePageBlock,
|
|
1116
1118
|
resolvePageStyle,
|
|
1117
1119
|
resolvePersistentLayers,
|
|
@@ -616,11 +616,7 @@ interface NarrationTimingJsonV3 {
|
|
|
616
616
|
*/
|
|
617
617
|
cameraOffsetSec?: number;
|
|
618
618
|
/** Provenance of the timing data. */
|
|
619
|
-
generator?:
|
|
620
|
-
name: string;
|
|
621
|
-
method: NarrationTimingMethod;
|
|
622
|
-
baseWpm?: number;
|
|
623
|
-
};
|
|
619
|
+
generator?: NarrationTimingGenerator;
|
|
624
620
|
}
|
|
625
621
|
/**
|
|
626
622
|
* How a sidecar's block ranges were produced.
|
|
@@ -629,12 +625,36 @@ interface NarrationTimingJsonV3 {
|
|
|
629
625
|
* them from the take's audio against the expected script.
|
|
630
626
|
* - `'presenter-advance'` — the presenter drove them directly, by advancing
|
|
631
627
|
* slides in the recorder while the take rolled. Observed, not inferred.
|
|
628
|
+
* - `'tts'` — a host synthesized the narration (text-to-speech). Block and
|
|
629
|
+
* sentence boundaries are exact because each was synthesized separately;
|
|
630
|
+
* word times are interpolated.
|
|
632
631
|
*/
|
|
633
|
-
type NarrationTimingMethod = 'dsp-align' | 'presenter-advance';
|
|
632
|
+
type NarrationTimingMethod = 'dsp-align' | 'presenter-advance' | 'tts';
|
|
633
|
+
/** Provenance recorded in a sidecar's `generator` field. */
|
|
634
|
+
interface NarrationTimingGenerator {
|
|
635
|
+
/** Producer id, e.g. `'squisq-teleprompter'` or a host's TTS engine name. */
|
|
636
|
+
name: string;
|
|
637
|
+
method: NarrationTimingMethod;
|
|
638
|
+
/** Speaking rate the take was paced at, when the producer has one. */
|
|
639
|
+
baseWpm?: number;
|
|
640
|
+
}
|
|
634
641
|
interface BuildNarrationTimingOptions {
|
|
635
642
|
cameraOffsetSec?: number;
|
|
643
|
+
/**
|
|
644
|
+
* Recorded as `generator.baseWpm`. A `generator` override's own `baseWpm`
|
|
645
|
+
* wins over this one.
|
|
646
|
+
*/
|
|
636
647
|
baseWpm?: number;
|
|
648
|
+
/**
|
|
649
|
+
* Who produced the timings. Defaults to the teleprompter's aligner
|
|
650
|
+
* (`{ name: 'squisq-teleprompter', method: 'dsp-align' }`); hosts that
|
|
651
|
+
* produce their own timings (TTS, say) name themselves here instead of
|
|
652
|
+
* post-editing the payload.
|
|
653
|
+
*/
|
|
654
|
+
generator?: NarrationTimingGenerator;
|
|
637
655
|
}
|
|
656
|
+
/** The `generator` block a sidecar records for these build options. */
|
|
657
|
+
declare function resolveNarrationTimingGenerator(options?: BuildNarrationTimingOptions): NarrationTimingGenerator;
|
|
638
658
|
/** Build the v3 sidecar payload from a script + its alignment. Pure. */
|
|
639
659
|
declare function buildNarrationTimingJson(script: NarrationScript, alignment: NarrationAlignment, durationSec: number, options?: BuildNarrationTimingOptions): NarrationTimingJsonV3;
|
|
640
660
|
/**
|
|
@@ -741,4 +761,4 @@ interface AdvanceCoverage {
|
|
|
741
761
|
/** Summarize an advance log against a doc. Pure; drives the review-panel warning. */
|
|
742
762
|
declare function advanceCoverage(doc: Doc, advances: SlideAdvanceLog): AdvanceCoverage;
|
|
743
763
|
|
|
744
|
-
export { type AdvanceCoverage, type AlignConfig, type AlignInput, type BandpassState, type BuildAdvanceTimingOptions, type BuildNarrationTimingOptions, type BuildScriptOptions, DEFAULT_ALIGN_CONFIG, DEFAULT_FEATURE_CONFIG, DEFAULT_NUCLEI_CONFIG, DEFAULT_PACING_CONFIG, DEFAULT_VAD_CONFIG, EMPTY_ADVANCE_LOG, type FeatureConfig, type FeatureState, type FrameFeatures, type NarrationAlignment, type NarrationBlockRange, type NarrationScript, type NarrationSessionConfig, type NarrationSessionState, type NarrationTimingBlock, type NarrationTimingJsonV3, type NarrationTimingMethod, type NarrationTrace, type NucleiConfig, type NucleiState, type PacingConfig, type PacingState, type PacingTick, type ScriptBlockRange, type ScriptToken, type SlideAdvance, type SlideAdvanceLog, type TraceSample, type VadConfig, type VadState, type WordTiming, advanceCoverage, alignNarration, bandpassRun, buildAdvanceTimingJson, buildNarrationScript, buildNarrationTimingJson, createBandpass, createFeatureState, createNarrationSession, createNucleiState, createPacingState, createVadState, detectSyllableOnsets, downsampleTrace, estimateSyllables, expectedSyllablesAt, extractFrameFeatures, featureStep, narrationSessionStep, nucleiStep, pacingStep, parseNarrationTimingJson, reanchorPacing, reanchorSession, recordSlideShown, traceWordPosAt, vadStep, wordIndexAtChar, wordIndexAtTime, wordPosAtExpectedSyllables };
|
|
764
|
+
export { type AdvanceCoverage, type AlignConfig, type AlignInput, type BandpassState, type BuildAdvanceTimingOptions, type BuildNarrationTimingOptions, type BuildScriptOptions, DEFAULT_ALIGN_CONFIG, DEFAULT_FEATURE_CONFIG, DEFAULT_NUCLEI_CONFIG, DEFAULT_PACING_CONFIG, DEFAULT_VAD_CONFIG, EMPTY_ADVANCE_LOG, type FeatureConfig, type FeatureState, type FrameFeatures, type NarrationAlignment, type NarrationBlockRange, type NarrationScript, type NarrationSessionConfig, type NarrationSessionState, type NarrationTimingBlock, type NarrationTimingGenerator, type NarrationTimingJsonV3, type NarrationTimingMethod, type NarrationTrace, type NucleiConfig, type NucleiState, type PacingConfig, type PacingState, type PacingTick, type ScriptBlockRange, type ScriptToken, type SlideAdvance, type SlideAdvanceLog, type TraceSample, type VadConfig, type VadState, type WordTiming, advanceCoverage, alignNarration, bandpassRun, buildAdvanceTimingJson, buildNarrationScript, buildNarrationTimingJson, createBandpass, createFeatureState, createNarrationSession, createNucleiState, createPacingState, createVadState, detectSyllableOnsets, downsampleTrace, estimateSyllables, expectedSyllablesAt, extractFrameFeatures, featureStep, narrationSessionStep, nucleiStep, pacingStep, parseNarrationTimingJson, reanchorPacing, reanchorSession, recordSlideShown, resolveNarrationTimingGenerator, traceWordPosAt, vadStep, wordIndexAtChar, wordIndexAtTime, wordPosAtExpectedSyllables };
|
package/dist/narration/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
recordSlideShown,
|
|
28
28
|
traceWordPosAt,
|
|
29
29
|
vadStep
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-GQWIUBJU.js";
|
|
31
31
|
import "../chunk-NEWNNLWN.js";
|
|
32
32
|
import {
|
|
33
33
|
buildNarrationScript,
|
|
@@ -35,10 +35,11 @@ import {
|
|
|
35
35
|
estimateSyllables,
|
|
36
36
|
expectedSyllablesAt,
|
|
37
37
|
parseNarrationTimingJson,
|
|
38
|
+
resolveNarrationTimingGenerator,
|
|
38
39
|
wordIndexAtChar,
|
|
39
40
|
wordIndexAtTime,
|
|
40
41
|
wordPosAtExpectedSyllables
|
|
41
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-Z35TG4WR.js";
|
|
42
43
|
import "../chunk-YPI2VJSB.js";
|
|
43
44
|
import "../chunk-C3NAY5YP.js";
|
|
44
45
|
import "../chunk-PUS54YU6.js";
|
|
@@ -81,6 +82,7 @@ export {
|
|
|
81
82
|
reanchorPacing,
|
|
82
83
|
reanchorSession,
|
|
83
84
|
recordSlideShown,
|
|
85
|
+
resolveNarrationTimingGenerator,
|
|
84
86
|
traceWordPosAt,
|
|
85
87
|
vadStep,
|
|
86
88
|
wordIndexAtChar,
|
package/dist/timing/index.js
CHANGED
package/package.json
CHANGED
|
File without changes
|