@bendyline/squisq 2.13.11 → 2.13.13
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/{Doc-DqYt_b2b.d.ts → Doc-BhvotZx_.d.ts} +48 -2
- package/dist/{ImageEditDoc-CXXiXVJ-.d.ts → ImageEditDoc-D8hYio6b.d.ts} +1 -1
- package/dist/{chunk-S76W65BB.js → chunk-5DFFVW75.js} +1 -1
- package/dist/{chunk-DOOUVVOM.js → chunk-7MS26OXD.js} +4 -0
- package/dist/{chunk-XDOSE5M3.js → chunk-C4SB3NN4.js} +1 -1
- package/dist/{chunk-SKGMNBQX.js → chunk-CTT4XAGO.js} +2033 -375
- package/dist/{chunk-SG3HXPMF.js → chunk-DBVCSVNV.js} +2 -1
- package/dist/chunk-FCB6JLWB.js +125 -0
- package/dist/{chunk-WNEH3BZP.js → chunk-JNUNNQ74.js} +3 -3
- package/dist/chunk-L4AFSOT3.js +26 -0
- package/dist/{chunk-65WL5ILB.js → chunk-OIQ2GO2O.js} +1 -1
- package/dist/{chunk-3WUI2N6C.js → chunk-SGNWO7OF.js} +20 -1
- package/dist/{chunk-ESGKI6CD.js → chunk-TCGGJUKC.js} +25 -6
- package/dist/{chunk-GLWQTZ4C.js → chunk-XEQALK5B.js} +1 -1
- package/dist/{chunk-N7I6JP6Q.js → chunk-YQQWE4HG.js} +413 -216
- package/dist/doc/index.d.ts +225 -9
- package/dist/doc/index.js +32 -7
- package/dist/fence/index.d.ts +1 -1
- package/dist/generate/index.d.ts +1 -1
- package/dist/imageEdit/index.d.ts +3 -3
- package/dist/index.d.ts +7 -7
- package/dist/index.js +79 -11
- package/dist/jsonForm/index.d.ts +1 -1
- package/dist/jsonForm/index.js +3 -3
- package/dist/markdown/index.js +3 -3
- package/dist/{materializePageSection-S2hxZ_lO.d.ts → materializePageSection-CWxou4mX.d.ts} +62 -2
- package/dist/mediaEdit/index.d.ts +2 -2
- package/dist/narration/index.d.ts +1 -1
- package/dist/narration/index.js +5 -5
- package/dist/recommend/index.js +1 -1
- package/dist/schemas/index.d.ts +4 -4
- package/dist/schemas/index.js +2 -2
- package/dist/{themeLibrary-CFJbeItn.d.ts → themeLibrary-BIYE6aLw.d.ts} +1 -1
- package/dist/timing/index.d.ts +58 -2
- package/dist/timing/index.js +9 -1
- package/dist/transform/index.d.ts +173 -72
- package/dist/transform/index.js +43 -6
- package/package.json +1 -1
package/dist/narration/index.js
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
traceWordPosAt,
|
|
32
32
|
transcriptWordKeys,
|
|
33
33
|
vadStep
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-OIQ2GO2O.js";
|
|
35
35
|
import "../chunk-NEWNNLWN.js";
|
|
36
36
|
import {
|
|
37
37
|
buildNarrationTimingJson,
|
|
@@ -45,12 +45,12 @@ import {
|
|
|
45
45
|
wordIndexAtChar,
|
|
46
46
|
wordIndexAtTime,
|
|
47
47
|
wordPosAtExpectedSyllables
|
|
48
|
-
} from "../chunk-
|
|
49
|
-
import "../chunk-
|
|
48
|
+
} from "../chunk-CTT4XAGO.js";
|
|
49
|
+
import "../chunk-SGNWO7OF.js";
|
|
50
50
|
import "../chunk-FUBMT6SJ.js";
|
|
51
|
-
import "../chunk-
|
|
51
|
+
import "../chunk-JNUNNQ74.js";
|
|
52
52
|
import "../chunk-L7QZORLB.js";
|
|
53
|
-
import "../chunk-
|
|
53
|
+
import "../chunk-7MS26OXD.js";
|
|
54
54
|
import "../chunk-L3KSFLTP.js";
|
|
55
55
|
import "../chunk-P53Z4RYC.js";
|
|
56
56
|
import "../chunk-GHOPHGOK.js";
|
package/dist/recommend/index.js
CHANGED
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { B as BUILD_EFFECTS, a as BUILD_MODES, b as BUILD_PARAM_KEYS, c as BUILD_PREVIOUS, d as BuildAdvance, e as BuildCursor, f as BuildSpec, g as BuildStep, h as BuildTiming, i as DEFAULT_TRANSITION_DURATION_SECONDS, aa as TRANSITION_DIRECTIONS, ab as TRANSITION_TYPES, ac as Transition, ad as TransitionDirection, ae as TransitionType, ah as buildSpecParams, ai as isTransitionType, aj as normalizeTransitionDirection, ak as normalizeTransitionType, al as parseBuildSpec, am as recordBuildAdvance, an as resolveBlockTransition, ap as resolveTransitionDuration } from '../types-Zk8qYuaT.js';
|
|
2
2
|
export { B as BoundingBox, C as Coordinates } from '../Types-sh2VRxfo.js';
|
|
3
|
-
import {
|
|
4
|
-
export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AreaChartInput, f as AudioBookmark, g as AudioSegment, h as AudioTimingData, i as AudioTrack, B as BarChartInput, j as BigTextInput, k as Block, l as BlockConnection, m as BorderStyle, n as BottomFeatureInput, C as CaptionPhrase, o as CaptionTrack, p as CaptionWord, q as
|
|
5
|
-
export { D as DEFAULT_THEME, a as DEFAULT_THEME_ID, T as THEMES, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-
|
|
3
|
+
import { T as Doc, bH as Theme, bK as ThemePageStyle, bJ as ThemeColorScheme, N as DeepPartial, bN as ThemeSeedColors, bI as ThemeColorPalette, a1 as FontFamilyKind, a0 as FontFamily } from '../Doc-BhvotZx_.js';
|
|
4
|
+
export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AreaChartInput, f as AudioBookmark, g as AudioSegment, h as AudioTimingData, i as AudioTrack, B as BarChartInput, j as BigTextInput, k as Block, l as BlockConnection, m as BorderStyle, n as BottomFeatureInput, C as CaptionPhrase, o as CaptionTrack, p as CaptionWord, q as CardsBlockInput, r as ChartBaseFields, s as ChartTemplateInput, t as ColorScheme, u as ColumnChartInput, v as ComparisonBarInput, w as ContentBlockInput, x as CornerBrandingConfig, y as CountUpSpec, z as CreateTemplateContextOptions, D as CustomTemplateDefinition, E as CustomTemplateLayer, F as CustomTemplateValidationError, G as CustomTemplateValidationResult, H as CycleBlockInput, I as DARK_SURFACE, J as DEFAULT_DOC_FONT, K as DEFAULT_TITLE_FONT, L as DataTableInput, M as DateEventInput, O as DefinitionCardInput, P as DiagramBlockInput, Q as DiagramEdgeAnchor, R as DiagramTemplateEdge, S as DiagramTemplateNode, U as DocBlock, V as DocDiagnostic, W as DonutChartInput, X as DrawingBlockInput, Y as FRONTMATTER_CUSTOM_TEMPLATES_KEY, Z as FRONTMATTER_CUSTOM_THEMES_KEY, _ as FRONTMATTER_MOTION_KEY, $ as FactCardInput, a2 as FullBleedQuoteInput, a3 as GradientBackgroundConfig, a4 as ImageBackgroundConfig, a5 as ImageLayer, a6 as ImageTreatment, a7 as ImageWithCaptionInput, a8 as LIGHT_SURFACE, a9 as Layer, aa as LayerRepeat, ab as LayersBlockInput, ac as LayoutHints, ad as LeftFeatureInput, ae as LineChartInput, af as LinearGradient, ag as ListBlockInput, ah as MOTION_PROFILES, ai as MapBlockInput, aj as MapLayer, ak as MapMarker, al as MapTileStyle, am as MarkerStyle, an as MediaClip, ao as MediaCrop, ap as MediaCut, aq as MediaEdits, ar as MediaOnlyInput, as as MediaScheduleOptions, at as MermaidLayer, au as MotionEntrance, av as MotionOrigin, aw as MotionProfile, ax as MotionProfileName, ay as MotionSpec, az as MotionState, aA as PAGE_ACCENT_STRATEGIES, aB as PAGE_BACKGROUNDS, aC as PAGE_BACKGROUND_RHYTHMS, aD as PAGE_DESIGN_FAMILIES, aE as PAGE_DIVIDERS, aF as PAGE_EMPHASES, aG as PAGE_EYEBROWS, aH as PAGE_HEADING_CASES, aI as PAGE_HEADING_SCALES, aJ as PAGE_HEADING_UNDERLINES, aK as PAGE_HERO_STYLES, aL as PAGE_IMAGE_FRAMINGS, aM as PAGE_NUMERAL_STYLES, aN as PAGE_PATTERNS, aO as PAGE_QUOTE_MARKS, aP as PAGE_SECTION_KINDS, aQ as PAGE_SECTION_SPACINGS, aR as PAGE_SHADOWS, aS as PAGE_VARIANTS, aT as PageAccentRotation, aU as PageBackground, aV as PageDesignFamily, aW as PageEmphasis, aX as PageHeadingTreatment, aY as PageSectionKind, aZ as PageSectionOverride, a_ as PageTokens, a$ as PageVariant, b0 as PathLayer, b1 as PatternBackgroundConfig, b2 as PersistentLayer, b3 as PersistentLayerConfig, b4 as PersistentLayerTemplate, b5 as PersistentLayerTemplateConfig, b6 as PersistentLayerTemplateType, b7 as PhotoGridInput, b8 as PieChartInput, b9 as PipStyle, ba as Position, bb as PresentationSlideMark, bc as ProcessBlockInput, bd as ProgressIndicatorConfig, be as PromotedBodyAnnotation, bf as PullQuoteInput, bg as QuoteBlockInput, bh as RawLayersInput, bi as RenderStyle, bj as RightFeatureInput, bk as ScatterChartInput, bl as ScheduledClip, bm as SectionHeaderInput, bn as ShapeFilter, bo as ShapeLayer, bp as ShapePattern, bq as SolidBackgroundConfig, br as StartBlockConfig, bs as StatHighlightInput, bt as SurfaceScheme, bu as SvgLayer, bv as THEME_SCHEMA_VERSION, bw as TableLayer, bx as TableLayerStyle, by as TemplateBlock, bz as TemplateContext, bA as TemplateFunction, bB as TemplateRegistry, bC as TextFlow, bD as TextLayer, bE as TextParagraph, bF as TextParagraphList, bG as TextStyle, bL as ThemeRegistry, bM as ThemeSchemaVersion, bO as ThemeStyle, bP as ThemeTypography, bQ as TimelineBlockInput, bR as TimelineTemplateEvent, bS as TimelineTemplateLink, bT as TimelineTemplateTrack, bU as TitleBlockInput, bV as TitleCaptionConfig, bW as TopFeatureInput, bX as TranscriptBlockInput, bY as TreeBlockInput, bZ as TreeLayer, b_ as TreeLayerItem, b$ as TreeLayerStyle, c0 as TreeTemplateItem, c1 as TwoColumnInput, c2 as VIEWPORT_PRESETS, c3 as VideoEmbedLayer, c4 as VideoLayer, c5 as VideoPipPosition, c6 as VideoPipShape, c7 as VideoPipSize, c8 as VideoPlacement, c9 as VideoPresentation, ca as VideoPullQuoteInput, cb as VideoWithCaptionInput, cc as ViewportConfig, cd as ViewportOrientation, ce as ViewportPreset, cf as VignetteConfig, cg as applySurface, ch as calculateDuration, ci as calculateFontScale, cj as createTemplateContext, ck as createTheme, cl as createThemeRegistry, cm as getAspectRatioString, cn as getBlockAtTime, co as getCaptionAtTime, cp as getDocPlaybackDuration, cq as getLayoutHints, cr as getSafeTextBounds, cs as getSegmentAtTime, ct as getTwoColumnPositions, cu as getViewport, cv as getViewportOrientation, cw as isCustomTemplateDefinition, cx as isMotionProfileName, cy as isPersistentLayerTemplate, cz as isTemplateBlock, cA as layoutScaledFontSize, cB as readFrontmatterMotion, cC as resolveMediaSchedule, cD as resolveMotionForDoc, cE as resolveMotionProfile, cF as scaledFontSize, cG as scheduleMediaClip, cH as validateCustomTemplateDefinition } from '../Doc-BhvotZx_.js';
|
|
5
|
+
export { D as DEFAULT_THEME, a as DEFAULT_THEME_ID, T as THEMES, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-BIYE6aLw.js';
|
|
6
6
|
export { M as MediaEntry, a as MediaProvider } from '../MediaProvider-wpSe21B3.js';
|
|
7
|
-
export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-
|
|
7
|
+
export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-D8hYio6b.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Runtime validation for the canonical {@link Doc} JSON shape.
|
package/dist/schemas/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
pipStyleVars,
|
|
14
14
|
serializeTheme,
|
|
15
15
|
validateDocSchema
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-DBVCSVNV.js";
|
|
17
17
|
import {
|
|
18
18
|
defaultPageStyle,
|
|
19
19
|
getDocPlaybackDuration,
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
validateCustomTemplateDefinition,
|
|
98
98
|
validateTheme,
|
|
99
99
|
withAlpha
|
|
100
|
-
} from "../chunk-
|
|
100
|
+
} from "../chunk-JNUNNQ74.js";
|
|
101
101
|
import "../chunk-JSGIWW35.js";
|
|
102
102
|
import "../chunk-L7QZORLB.js";
|
|
103
103
|
import {
|
package/dist/timing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as AudioSegment, h as AudioTimingData, o as CaptionTrack } from '../Doc-
|
|
1
|
+
import { g as AudioSegment, h as AudioTimingData, o as CaptionTrack } from '../Doc-BhvotZx_.js';
|
|
2
2
|
import '../types-Zk8qYuaT.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -139,4 +139,60 @@ interface BuildCaptionTrackOptions {
|
|
|
139
139
|
}
|
|
140
140
|
declare function buildCaptionTrack(sources: CaptionSegmentSource[], options?: BuildCaptionTrackOptions): CaptionTrack;
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
/**
|
|
143
|
+
* Word timings: when narration speaks a given place in its script.
|
|
144
|
+
*
|
|
145
|
+
* Narration that comes with word timings — TTS bookmarks, an aligned
|
|
146
|
+
* recording (`NarrationTimingJsonV3`), any `{ sourceText, bookmarks }` pair —
|
|
147
|
+
* lets a slide appear as its words are spoken instead of at an estimated
|
|
148
|
+
* moment. These helpers answer the two questions every caller asks: what time
|
|
149
|
+
* is it at this character of the script, and when does this phrase start?
|
|
150
|
+
*
|
|
151
|
+
* Two snapping rules, because callers place things differently:
|
|
152
|
+
* - `containing` (default) — the word being spoken at that character: the last
|
|
153
|
+
* bookmark at or before it. A phrase that starts mid-word starts with that
|
|
154
|
+
* word.
|
|
155
|
+
* - `next` — the first bookmark at or after it: the next word to be spoken.
|
|
156
|
+
* A span with no word of its own collapses onto what follows.
|
|
157
|
+
* The two agree whenever a bookmark sits on the character, as word bookmarks
|
|
158
|
+
* do at the start of each word.
|
|
159
|
+
*
|
|
160
|
+
* Related: `narration/sidecar.ts` (the v3 timing file), `doc/builds.ts`
|
|
161
|
+
* (build steps timed to narration), `transform/conceptReveal.ts`.
|
|
162
|
+
*/
|
|
163
|
+
/** One timed place in a script: the word starting at `charOffset` is spoken at `time` seconds. */
|
|
164
|
+
interface WordMark {
|
|
165
|
+
charOffset: number;
|
|
166
|
+
time: number;
|
|
167
|
+
}
|
|
168
|
+
/** A script and the times its words are spoken, bookmarks in script order. */
|
|
169
|
+
interface WordTimeline {
|
|
170
|
+
sourceText: string;
|
|
171
|
+
bookmarks: readonly WordMark[];
|
|
172
|
+
}
|
|
173
|
+
type WordSnap = 'containing' | 'next';
|
|
174
|
+
/**
|
|
175
|
+
* Seconds at which the narration reaches `offset`, or `undefined` when no
|
|
176
|
+
* bookmark answers (an empty timeline; with `next`, an offset past the last
|
|
177
|
+
* word). With `containing`, an offset before the first bookmark takes the
|
|
178
|
+
* first bookmark's time.
|
|
179
|
+
*/
|
|
180
|
+
declare function wordTimeAt(bookmarks: readonly WordMark[], offset: number, snap?: WordSnap): number | undefined;
|
|
181
|
+
interface PhraseTimeOptions {
|
|
182
|
+
/** Script offset to search from (default 0, the first occurrence). */
|
|
183
|
+
from?: number;
|
|
184
|
+
/** Seconds to start ahead of the word, so a visual lands with it (default 0). */
|
|
185
|
+
lead?: number;
|
|
186
|
+
/** How a phrase that starts between bookmarks is placed (default `containing`). */
|
|
187
|
+
snap?: WordSnap;
|
|
188
|
+
}
|
|
189
|
+
/** Offset of `phrase` in the timeline's script at or after `from`, or -1. */
|
|
190
|
+
declare function phraseOffset(timeline: WordTimeline, phrase: string, from?: number): number;
|
|
191
|
+
/**
|
|
192
|
+
* Seconds at which `phrase` starts being spoken, `lead` seconds early and
|
|
193
|
+
* never before 0; `null` when the phrase is not in the script or no bookmark
|
|
194
|
+
* times it.
|
|
195
|
+
*/
|
|
196
|
+
declare function phraseStartTime(timeline: WordTimeline, phrase: string, options?: PhraseTimeOptions): number | null;
|
|
197
|
+
|
|
198
|
+
export { type BuildCaptionTrackOptions, type CaptionSegmentSource, DEFAULT_WORDS_PER_SECOND, type NarrationTimeEstimate, type NarrationTimeOptions, type PhraseTimeOptions, type ReadingTimeEstimate, type ReadingTimeOptions, type WordMark, type WordSnap, type WordTimeline, buildCaptionTrack, calculatePrefixDuration, countSpokenWords, estimateNarrationDuration, estimateNarrationTime, estimateReadingTime, estimateSpokenWordCount, estimateTimeFromText, phraseOffset, phraseStartTime, wordTimeAt };
|
package/dist/timing/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildCaptionTrack
|
|
3
3
|
} from "../chunk-5HWYSUXS.js";
|
|
4
|
+
import {
|
|
5
|
+
phraseOffset,
|
|
6
|
+
phraseStartTime,
|
|
7
|
+
wordTimeAt
|
|
8
|
+
} from "../chunk-L4AFSOT3.js";
|
|
4
9
|
import {
|
|
5
10
|
DEFAULT_WORDS_PER_SECOND,
|
|
6
11
|
calculatePrefixDuration,
|
|
@@ -20,5 +25,8 @@ export {
|
|
|
20
25
|
estimateNarrationTime,
|
|
21
26
|
estimateReadingTime,
|
|
22
27
|
estimateSpokenWordCount,
|
|
23
|
-
estimateTimeFromText
|
|
28
|
+
estimateTimeFromText,
|
|
29
|
+
phraseOffset,
|
|
30
|
+
phraseStartTime,
|
|
31
|
+
wordTimeAt
|
|
24
32
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { T as Doc, t as ColorScheme, k as Block, by as TemplateBlock } from '../Doc-BhvotZx_.js';
|
|
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"];
|
|
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 or a
|
|
351
|
-
* 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
|
|
@@ -439,22 +380,182 @@ declare function createPresentationPlan(doc: Doc, hints?: PresentationHints): Pr
|
|
|
439
380
|
declare function compilePresentationPlan(doc: Doc, plan: PresentationPlan): Doc;
|
|
440
381
|
declare function applySavedPresentation(doc: Doc): Doc;
|
|
441
382
|
|
|
442
|
-
/** The
|
|
443
|
-
*
|
|
444
|
-
*
|
|
383
|
+
/** The features a narrated section embeds (videos, diagrams, tables and
|
|
384
|
+
* pictures), which dynamic slides show beside its summaries: the visuals
|
|
385
|
+
* rich-media layout places next to slide text (`appendRichContentLayers`).
|
|
386
|
+
* A picture usually has its own full-bleed slide; it rides beside the text
|
|
387
|
+
* only when no slide shows it that way.
|
|
445
388
|
*/
|
|
446
389
|
|
|
447
390
|
interface PresentationMediaItem {
|
|
448
|
-
/** `<section block id>#<index
|
|
391
|
+
/** `<section block id>#<index>` for videos and diagrams, `#table-<index>` and
|
|
392
|
+
* `#image-<index>` for tables and pictures; stable while the section's
|
|
393
|
+
* visuals are unchanged. */
|
|
449
394
|
ref: string;
|
|
450
|
-
kind: 'video' | 'diagram';
|
|
451
|
-
/** The body node exactly as authored
|
|
395
|
+
kind: 'video' | 'diagram' | 'table' | 'image';
|
|
396
|
+
/** The body node exactly as authored (a picture gets a paragraph of its
|
|
397
|
+
* own); slides render it through rich-media layout. */
|
|
452
398
|
node: MarkdownBlockNode;
|
|
453
|
-
/** A diagram, or an HTML video that can resume mid-clip on a
|
|
399
|
+
/** A diagram, table, picture, or an HTML video that can resume mid-clip on a
|
|
400
|
+
* following slide. */
|
|
454
401
|
continuous: boolean;
|
|
402
|
+
/** A picture's source, matched against the slides that show it full-bleed. */
|
|
403
|
+
src?: string;
|
|
455
404
|
}
|
|
456
|
-
/** Each section's visuals in source order
|
|
457
|
-
* block's visuals belong to the
|
|
405
|
+
/** Each section's visuals in source order (a block's pictures after its other
|
|
406
|
+
* visuals), claimed like images: a nested block's visuals belong to the
|
|
407
|
+
* nearest narrated section at or before it. */
|
|
458
408
|
declare function collectPresentationMedia(doc: Doc, sectionIds: string[]): Map<string, PresentationMediaItem[]>;
|
|
459
409
|
|
|
460
|
-
|
|
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,22 +48,24 @@ import {
|
|
|
29
48
|
serializePresentationPlan,
|
|
30
49
|
transformNarratedSegment,
|
|
31
50
|
usesDynamicPresentation
|
|
32
|
-
} from "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
51
|
+
} from "../chunk-YQQWE4HG.js";
|
|
52
|
+
import "../chunk-CTT4XAGO.js";
|
|
53
|
+
import "../chunk-SGNWO7OF.js";
|
|
35
54
|
import "../chunk-SVN7T6BK.js";
|
|
36
55
|
import "../chunk-FUBMT6SJ.js";
|
|
37
|
-
import "../chunk-
|
|
56
|
+
import "../chunk-JNUNNQ74.js";
|
|
38
57
|
import "../chunk-L7QZORLB.js";
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
58
|
+
import "../chunk-C4SB3NN4.js";
|
|
59
|
+
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
|
};
|