@bendyline/squisq 2.13.12 → 2.13.14
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-QJQQO3K4.js → chunk-CTT4XAGO.js} +193 -6
- package/dist/chunk-FCB6JLWB.js +125 -0
- package/dist/{chunk-IFZZI4XY.js → chunk-J2G6EOEJ.js} +23 -4
- package/dist/chunk-L4AFSOT3.js +26 -0
- package/dist/{chunk-CQSCYJQU.js → chunk-OIQ2GO2O.js} +1 -1
- package/dist/{chunk-OUSEEUEC.js → chunk-YQQWE4HG.js} +65 -40
- package/dist/doc/index.d.ts +121 -3
- package/dist/doc/index.js +18 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +62 -4
- package/dist/{materializePageSection-bLfqIy6j.d.ts → materializePageSection-CWxou4mX.d.ts} +61 -1
- package/dist/narration/index.js +2 -2
- package/dist/timing/index.d.ts +57 -1
- package/dist/timing/index.js +9 -1
- package/dist/transform/index.d.ts +154 -62
- package/dist/transform/index.js +39 -2
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { T as Doc, t as ColorScheme, k as Block, by as TemplateBlock } from '../Doc-BhvotZx_.js';
|
|
2
|
-
import {
|
|
2
|
+
import { l as PageTransformHints, n as PresentationBeatLayout, o as PresentationLayout, p as PresentationPlan } from '../materializePageSection-CWxou4mX.js';
|
|
3
|
+
export { A as AUTHORED_PRESENTATION_LAYOUT, P as PRESENTATION_KEY, b as PRESENTATION_LAYOUTS, c as PRESENTATION_LIMITS, m as PresentationBeat, s as parsePresentationPlan, t as presentationLayoutFits, u as presentationStat, w as serializePresentationPlan } from '../materializePageSection-CWxou4mX.js';
|
|
3
4
|
import { d as ExtractionType, E as ExtractedElement, b as ExtractionOptions } from '../contentExtractor-BNfVJV2U.js';
|
|
4
5
|
import { f as BuildSpec, M as MarkdownBlockNode } from '../types-Zk8qYuaT.js';
|
|
5
6
|
|
|
@@ -321,66 +322,6 @@ declare function extractDocImages(blocks: Block[]): TransformImage[];
|
|
|
321
322
|
*/
|
|
322
323
|
declare function analyzeBlocks(blocks: Block[], options?: ExtractionOptions): AnalyzedBlock[];
|
|
323
324
|
|
|
324
|
-
/** A prominent number found inside a short stat-like string. */
|
|
325
|
-
interface NumberHighlightMatch {
|
|
326
|
-
value: string;
|
|
327
|
-
index: number;
|
|
328
|
-
end: number;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/** A bounded presentation is a visual overlay on the canonical spoken script.
|
|
332
|
-
* It lives in frontmatter so undo, copy, DBK, and ordinary Markdown saves carry
|
|
333
|
-
* it atomically. Layout choices never replace the source prose or store seconds.
|
|
334
|
-
*/
|
|
335
|
-
|
|
336
|
-
declare const PRESENTATION_KEY = "squisq-presentation";
|
|
337
|
-
/** The layouts a summary (a headline and up to four points) can fill. */
|
|
338
|
-
declare const PRESENTATION_LAYOUTS: readonly ["title", "divider", "statement", "emphasis", "quote", "stat", "definition", "list", "comparison", "steps", "image", "cards", "process", "cycle", "layers"];
|
|
339
|
-
type PresentationLayout = (typeof PRESENTATION_LAYOUTS)[number];
|
|
340
|
-
/** Shows a section's own block, with the template its author chose, instead of
|
|
341
|
-
* a summary. A section shown this way is one slide for its whole narration. */
|
|
342
|
-
declare const AUTHORED_PRESENTATION_LAYOUT = "authored";
|
|
343
|
-
type PresentationBeatLayout = PresentationLayout | typeof AUTHORED_PRESENTATION_LAYOUT;
|
|
344
|
-
/** The prominent number a key-number slide shows, and the line that states it. */
|
|
345
|
-
declare function presentationStat(headline: string, points: readonly string[]): {
|
|
346
|
-
match: NumberHighlightMatch;
|
|
347
|
-
line: string;
|
|
348
|
-
index: number;
|
|
349
|
-
} | null;
|
|
350
|
-
/** Whether a summary can fill a layout: enough points for a list, steps,
|
|
351
|
-
* cards, a process, a cycle (three) or a comparison; a prominent number for a key number; a short headline for a big
|
|
352
|
-
* statement; and, for a quote, a headline found word for word in
|
|
353
|
-
* `passage`, the source text the slide summarizes. An image slide also needs a
|
|
354
|
-
* picture, which callers check. */
|
|
355
|
-
declare function presentationLayoutFits(layout: PresentationLayout, headline: string, points: readonly string[], passage: string): boolean;
|
|
356
|
-
interface PresentationBeat {
|
|
357
|
-
id: string;
|
|
358
|
-
sourceStart: number;
|
|
359
|
-
sourceEnd: number;
|
|
360
|
-
layout: PresentationBeatLayout;
|
|
361
|
-
headline: string;
|
|
362
|
-
points: string[];
|
|
363
|
-
imageSrc?: string;
|
|
364
|
-
/** The section's videos and diagrams shown beside this slide's text (`presentationMedia`). */
|
|
365
|
-
media?: string[];
|
|
366
|
-
/** Left out of the deck; the slide shown before it stays on screen instead. */
|
|
367
|
-
hidden?: true;
|
|
368
|
-
}
|
|
369
|
-
interface PresentationPlan {
|
|
370
|
-
version: 1;
|
|
371
|
-
sourceText: string;
|
|
372
|
-
origin: 'automatic' | 'ai';
|
|
373
|
-
beats: PresentationBeat[];
|
|
374
|
-
}
|
|
375
|
-
declare const PRESENTATION_LIMITS: {
|
|
376
|
-
readonly sourceCharacters: 40000;
|
|
377
|
-
readonly beats: 80;
|
|
378
|
-
readonly serializedCharacters: 160000;
|
|
379
|
-
readonly mediaPerBeat: 4;
|
|
380
|
-
};
|
|
381
|
-
declare function parsePresentationPlan(input: unknown): PresentationPlan | null;
|
|
382
|
-
declare function serializePresentationPlan(plan: PresentationPlan): string;
|
|
383
|
-
|
|
384
325
|
declare const PRESENTATION_HINTS_KEY = "squisq-presentation-hints";
|
|
385
326
|
declare const DYNAMIC_PRESENTATION_STYLE = "dynamic-slides";
|
|
386
327
|
/** A short, stable name for one slide's exact source passage. Saving it rather
|
|
@@ -466,4 +407,155 @@ interface PresentationMediaItem {
|
|
|
466
407
|
* nearest narrated section at or before it. */
|
|
467
408
|
declare function collectPresentationMedia(doc: Doc, sectionIds: string[]): Map<string, PresentationMediaItem[]>;
|
|
468
409
|
|
|
469
|
-
|
|
410
|
+
/**
|
|
411
|
+
* Grounding checks: does what an author put on a slide come from the source
|
|
412
|
+
* it illustrates?
|
|
413
|
+
*
|
|
414
|
+
* An AI author (a deck refiner, a video director) rewords and arranges; it must
|
|
415
|
+
* never add a fact. These pure checks are the gate its output passes before a
|
|
416
|
+
* slide ships, shared so every product holds generated slides to the same
|
|
417
|
+
* standard:
|
|
418
|
+
*
|
|
419
|
+
* - {@link ungroundedNumber}: every number shown is one the source states,
|
|
420
|
+
* in digits or words (commas ignored, so "1400" matches "1,400" and "10"
|
|
421
|
+
* matches "ten").
|
|
422
|
+
* - {@link isVerbatimQuote}: a quotation is the source's own words.
|
|
423
|
+
* - {@link isGroundedParaphrase}: a short label or point may trim and reorder,
|
|
424
|
+
* but its numbers and most of its distinctive words come from the source.
|
|
425
|
+
* - {@link restatesHeadline}: a point that only repeats its headline.
|
|
426
|
+
* - {@link rangeEndOnly}: a number the source gives only as one end of a range
|
|
427
|
+
* ("3 to 7 miles deep"). Shown as a single value — a count-up, one bar — it
|
|
428
|
+
* misstates the source, though the number itself appears there.
|
|
429
|
+
*
|
|
430
|
+
* Checks report; callers decide what to drop. None of them can tell whether
|
|
431
|
+
* a slide is good, only whether it is faithful.
|
|
432
|
+
*
|
|
433
|
+
* Related: `doc/templates/authoringGuide.ts` (what authors are told),
|
|
434
|
+
* `transform/conceptReveal.ts` (matching points to the sentences that say them).
|
|
435
|
+
*/
|
|
436
|
+
/**
|
|
437
|
+
* Lowercased text with typographic quotes and dashes folded and other
|
|
438
|
+
* punctuation spaced out; apostrophes, percent signs and hyphens survive.
|
|
439
|
+
*/
|
|
440
|
+
declare function normalizeGroundingText(text: string): string;
|
|
441
|
+
/** The numbers a value shows, commas dropped: "1,500 to 2,500 feet" → ["1500", "2500"]. */
|
|
442
|
+
declare function numbersIn(value: string | number): string[];
|
|
443
|
+
/**
|
|
444
|
+
* Numbers a source spells out, two to ninety-nine ("ten peaks", "twenty-five
|
|
445
|
+
* years"), with where each starts. "One" is left out: it is more often a
|
|
446
|
+
* pronoun than a count.
|
|
447
|
+
*/
|
|
448
|
+
declare function spelledNumbers(source: string): Array<{
|
|
449
|
+
value: string;
|
|
450
|
+
index: number;
|
|
451
|
+
}>;
|
|
452
|
+
/** Every number a source states, in digits or spelled out, for repeated lookups. */
|
|
453
|
+
declare function sourceNumbers(source: string): Set<string>;
|
|
454
|
+
/**
|
|
455
|
+
* The first number among `values` that the source does not state, or
|
|
456
|
+
* `undefined` when every one is grounded.
|
|
457
|
+
*/
|
|
458
|
+
declare function ungroundedNumber(values: string | number | ReadonlyArray<string | number>, source: string | ReadonlySet<string>): string | undefined;
|
|
459
|
+
/** Sentences of a text, split after ., ! or ? and at line breaks. */
|
|
460
|
+
declare function groundingSentences(text: string): string[];
|
|
461
|
+
interface VerbatimQuoteOptions {
|
|
462
|
+
/** The source's sentences, when the caller splits them its own way. */
|
|
463
|
+
sentences?: readonly string[];
|
|
464
|
+
/** Share of the quote's words one sentence must hold (default 0.9). */
|
|
465
|
+
minShare?: number;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Whether `quote` is the source's own words: a span of the source once both
|
|
469
|
+
* are normalized, or a sentence of it holding nearly all of the quote's words
|
|
470
|
+
* (a dropped comma or a trimmed clause still passes; a paraphrase does not).
|
|
471
|
+
*/
|
|
472
|
+
declare function isVerbatimQuote(quote: string, source: string, options?: VerbatimQuoteOptions): boolean;
|
|
473
|
+
/**
|
|
474
|
+
* Distinctive words of a text — four letters or longer and not a common
|
|
475
|
+
* word — by their first four letters, so "writing" matches "write" and a
|
|
476
|
+
* possessive matches its noun.
|
|
477
|
+
*/
|
|
478
|
+
declare function distinctiveStems(text: string): string[];
|
|
479
|
+
interface ParaphraseOptions {
|
|
480
|
+
/** Share of the text's distinctive words the source must use (default ⅔). */
|
|
481
|
+
minShare?: number;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Whether a short paraphrase (a label, a point, a list item) is grounded:
|
|
485
|
+
* every number it shows is stated in the source, and at least `minShare` of
|
|
486
|
+
* its distinctive words come from the source. A text with no distinctive
|
|
487
|
+
* words ("Then", "By 1900") passes on its numbers alone.
|
|
488
|
+
*/
|
|
489
|
+
declare function isGroundedParaphrase(text: string, source: string, options?: ParaphraseOptions): boolean;
|
|
490
|
+
/**
|
|
491
|
+
* Whether a point mostly repeats its headline (most of its words are the
|
|
492
|
+
* headline's) or merely continues it (it holds every word of a headline of
|
|
493
|
+
* three or more), so it adds nothing to the slide.
|
|
494
|
+
*/
|
|
495
|
+
declare function restatesHeadline(point: string, headline: string): boolean;
|
|
496
|
+
/** A range a source states, such as "3 to 7", "1,500–2,500" or "between 10 and 12". */
|
|
497
|
+
interface StatedRange {
|
|
498
|
+
/** The lower end as written, commas dropped. */
|
|
499
|
+
low: string;
|
|
500
|
+
/** The upper end as written, commas dropped. */
|
|
501
|
+
high: string;
|
|
502
|
+
/** The range as it appears in the source. */
|
|
503
|
+
text: string;
|
|
504
|
+
/** Where it starts in the source. */
|
|
505
|
+
index: number;
|
|
506
|
+
}
|
|
507
|
+
/** Every range the source states, in order. */
|
|
508
|
+
declare function statedRanges(source: string): StatedRange[];
|
|
509
|
+
/**
|
|
510
|
+
* When every place the source states `value` is one end of a range, the
|
|
511
|
+
* first such range; otherwise `undefined`. Use it on numbers a slide shows
|
|
512
|
+
* as one value — a count-up, a single bar, a comparison — where "3 to 7 miles
|
|
513
|
+
* deep" drawn as 7 says something the source does not. Dates are ranges of
|
|
514
|
+
* a different kind ("1939–1945" names two years); don't check them here.
|
|
515
|
+
*/
|
|
516
|
+
declare function rangeEndOnly(value: string | number, source: string): StatedRange | undefined;
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Concept reveals: a concept slide (`cards`, `process`, `cycle`, `layers`)
|
|
520
|
+
* that shows its ideas one at a time, each as the narration reaches it.
|
|
521
|
+
*
|
|
522
|
+
* Two steps, so any host with narration can use them: find where in the
|
|
523
|
+
* script each idea is spoken ({@link matchPointsToSentences}), then turn
|
|
524
|
+
* those moments into the slide's build ({@link conceptRevealTiming}). The
|
|
525
|
+
* presentation compiler does both from a plan; a host with its own script
|
|
526
|
+
* format (a video director's beats) can time ideas by phrase instead and use
|
|
527
|
+
* only the second step.
|
|
528
|
+
*
|
|
529
|
+
* The build's `sourceText` guard is named from the same step texts the
|
|
530
|
+
* template draws (`conceptBuildStepTexts`), so the renderer accepts the
|
|
531
|
+
* timing without drawing the block first; ideas the narration cannot place
|
|
532
|
+
* reveal evenly over the slide instead.
|
|
533
|
+
*
|
|
534
|
+
* Related: `doc/templates/conceptBlocks.ts`, `doc/builds.ts`
|
|
535
|
+
* (`resolveBuildTimeline`), `transform/presentationCompiler.ts`.
|
|
536
|
+
*/
|
|
537
|
+
|
|
538
|
+
declare const CONCEPT_TEMPLATES: readonly ["cards", "process", "cycle", "layers"];
|
|
539
|
+
type ConceptTemplate = (typeof CONCEPT_TEMPLATES)[number];
|
|
540
|
+
/** The concept template a name denotes, or `undefined`. */
|
|
541
|
+
declare function conceptTemplate(template: string): ConceptTemplate | undefined;
|
|
542
|
+
/**
|
|
543
|
+
* Where in `sourceText[start, end)` each point is spoken: the offset of the
|
|
544
|
+
* sentence it shares the most words with (at least two). Points must land
|
|
545
|
+
* in order (two may share a sentence); `undefined` when one cannot be placed
|
|
546
|
+
* or would land before the point ahead of it.
|
|
547
|
+
*/
|
|
548
|
+
declare function matchPointsToSentences(points: readonly string[], sourceText: string, start: number, end: number): number[] | undefined;
|
|
549
|
+
/** How a concept slide reveals its ideas unless its author says otherwise. */
|
|
550
|
+
declare function conceptBuildSpec(): BuildSpec;
|
|
551
|
+
/**
|
|
552
|
+
* A concept slide's build: its ideas appear at `itemTimes` (seconds on the
|
|
553
|
+
* same clock as `start` and `end`, the slide's span). Each reveal waits for a
|
|
554
|
+
* short lead into the slide and lands before its end; the first idea lands
|
|
555
|
+
* as the headline settles even when its words come later, so the slide never
|
|
556
|
+
* sits on its headline alone. Without one time per idea, the build reveals
|
|
557
|
+
* the ideas evenly.
|
|
558
|
+
*/
|
|
559
|
+
declare function conceptRevealTiming(template: ConceptTemplate, items: readonly string[], itemTimes: readonly number[] | undefined, start: number, end: number): Pick<Block, 'build' | 'buildTiming'>;
|
|
560
|
+
|
|
561
|
+
export { type AnalyzedBlock, type BlockImage, CONCEPT_TEMPLATES, type ConceptTemplate, DEFAULT_TRANSFORM_STYLE_ID, DYNAMIC_PRESENTATION_STYLE, type NarratedSegmentInput, type NarratedSegmentResult, type NarratedSegmentTransformOptions, type NarratedSegmentVideo, PRESENTATION_HINTS_KEY, type ParaphraseOptions, PresentationBeatLayout, type PresentationBlockHint, type PresentationHints, PresentationLayout, type PresentationMediaItem, PresentationPlan, type StatedRange, type TransformImage, type TransformOptions, type TransformResult, type TransformStyleConfig, type TransformStyleId, type TransformStyleInput, type TransformStyleRegistry, type TransformStyleSummary, type VerbatimQuoteOptions, allocateTiming, analyzeBlocks, applySavedPresentation, applyTransform, collectPresentationMedia, compilePresentationPlan, conceptBuildSpec, conceptRevealTiming, conceptTemplate, createPresentationPlan, createTransformStyleRegistry, defaultPresentationHints, distinctiveStems, extractDocImages, getTransformStyleIds, getTransformStyleSummaries, groundingSentences, isGroundedParaphrase, isVerbatimQuote, matchPointsToSentences, normalizeGroundingText, numbersIn, parsePresentationHints, presentationPassageKey, presentationSections, rangeEndOnly, resolveTransformStyle, restatesHeadline, serializePresentationHints, sourceNumbers, spelledNumbers, statedRanges, transformNarratedSegment, ungroundedNumber, usesDynamicPresentation };
|
package/dist/transform/index.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
distinctiveStems,
|
|
3
|
+
groundingSentences,
|
|
4
|
+
isGroundedParaphrase,
|
|
5
|
+
isVerbatimQuote,
|
|
6
|
+
normalizeGroundingText,
|
|
7
|
+
numbersIn,
|
|
8
|
+
rangeEndOnly,
|
|
9
|
+
restatesHeadline,
|
|
10
|
+
sourceNumbers,
|
|
11
|
+
spelledNumbers,
|
|
12
|
+
statedRanges,
|
|
13
|
+
ungroundedNumber
|
|
14
|
+
} from "../chunk-FCB6JLWB.js";
|
|
1
15
|
import {
|
|
2
16
|
AUTHORED_PRESENTATION_LAYOUT,
|
|
17
|
+
CONCEPT_TEMPLATES,
|
|
3
18
|
DEFAULT_TRANSFORM_STYLE_ID,
|
|
4
19
|
DYNAMIC_PRESENTATION_STYLE,
|
|
5
20
|
PRESENTATION_HINTS_KEY,
|
|
@@ -12,12 +27,16 @@ import {
|
|
|
12
27
|
applyTransform,
|
|
13
28
|
collectPresentationMedia,
|
|
14
29
|
compilePresentationPlan,
|
|
30
|
+
conceptBuildSpec,
|
|
31
|
+
conceptRevealTiming,
|
|
32
|
+
conceptTemplate,
|
|
15
33
|
createPresentationPlan,
|
|
16
34
|
createTransformStyleRegistry,
|
|
17
35
|
defaultPresentationHints,
|
|
18
36
|
extractDocImages,
|
|
19
37
|
getTransformStyleIds,
|
|
20
38
|
getTransformStyleSummaries,
|
|
39
|
+
matchPointsToSentences,
|
|
21
40
|
parsePresentationHints,
|
|
22
41
|
parsePresentationPlan,
|
|
23
42
|
presentationLayoutFits,
|
|
@@ -29,8 +48,8 @@ import {
|
|
|
29
48
|
serializePresentationPlan,
|
|
30
49
|
transformNarratedSegment,
|
|
31
50
|
usesDynamicPresentation
|
|
32
|
-
} from "../chunk-
|
|
33
|
-
import "../chunk-
|
|
51
|
+
} from "../chunk-YQQWE4HG.js";
|
|
52
|
+
import "../chunk-CTT4XAGO.js";
|
|
34
53
|
import "../chunk-SGNWO7OF.js";
|
|
35
54
|
import "../chunk-SVN7T6BK.js";
|
|
36
55
|
import "../chunk-FUBMT6SJ.js";
|
|
@@ -41,10 +60,12 @@ import "../chunk-7MS26OXD.js";
|
|
|
41
60
|
import "../chunk-L3KSFLTP.js";
|
|
42
61
|
import "../chunk-CZ7AUSLI.js";
|
|
43
62
|
import "../chunk-P53Z4RYC.js";
|
|
63
|
+
import "../chunk-L4AFSOT3.js";
|
|
44
64
|
import "../chunk-GHOPHGOK.js";
|
|
45
65
|
import "../chunk-XRW6P7IF.js";
|
|
46
66
|
export {
|
|
47
67
|
AUTHORED_PRESENTATION_LAYOUT,
|
|
68
|
+
CONCEPT_TEMPLATES,
|
|
48
69
|
DEFAULT_TRANSFORM_STYLE_ID,
|
|
49
70
|
DYNAMIC_PRESENTATION_STYLE,
|
|
50
71
|
PRESENTATION_HINTS_KEY,
|
|
@@ -57,21 +78,37 @@ export {
|
|
|
57
78
|
applyTransform,
|
|
58
79
|
collectPresentationMedia,
|
|
59
80
|
compilePresentationPlan,
|
|
81
|
+
conceptBuildSpec,
|
|
82
|
+
conceptRevealTiming,
|
|
83
|
+
conceptTemplate,
|
|
60
84
|
createPresentationPlan,
|
|
61
85
|
createTransformStyleRegistry,
|
|
62
86
|
defaultPresentationHints,
|
|
87
|
+
distinctiveStems,
|
|
63
88
|
extractDocImages,
|
|
64
89
|
getTransformStyleIds,
|
|
65
90
|
getTransformStyleSummaries,
|
|
91
|
+
groundingSentences,
|
|
92
|
+
isGroundedParaphrase,
|
|
93
|
+
isVerbatimQuote,
|
|
94
|
+
matchPointsToSentences,
|
|
95
|
+
normalizeGroundingText,
|
|
96
|
+
numbersIn,
|
|
66
97
|
parsePresentationHints,
|
|
67
98
|
parsePresentationPlan,
|
|
68
99
|
presentationLayoutFits,
|
|
69
100
|
presentationPassageKey,
|
|
70
101
|
presentationSections,
|
|
71
102
|
presentationStat,
|
|
103
|
+
rangeEndOnly,
|
|
72
104
|
resolveTransformStyle,
|
|
105
|
+
restatesHeadline,
|
|
73
106
|
serializePresentationHints,
|
|
74
107
|
serializePresentationPlan,
|
|
108
|
+
sourceNumbers,
|
|
109
|
+
spelledNumbers,
|
|
110
|
+
statedRanges,
|
|
75
111
|
transformNarratedSegment,
|
|
112
|
+
ungroundedNumber,
|
|
76
113
|
usesDynamicPresentation
|
|
77
114
|
};
|