@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/index.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  traceWordPosAt,
32
32
  transcriptWordKeys,
33
33
  vadStep
34
- } from "./chunk-CQSCYJQU.js";
34
+ } from "./chunk-OIQ2GO2O.js";
35
35
  import {
36
36
  fenceRendererLangs
37
37
  } from "./chunk-PGI7HSWE.js";
@@ -58,6 +58,20 @@ import {
58
58
  selectSafeZoneClips,
59
59
  selectTranscriptClips
60
60
  } from "./chunk-ZP5F7LUH.js";
61
+ import {
62
+ distinctiveStems,
63
+ groundingSentences,
64
+ isGroundedParaphrase,
65
+ isVerbatimQuote,
66
+ normalizeGroundingText,
67
+ numbersIn,
68
+ rangeEndOnly,
69
+ restatesHeadline,
70
+ sourceNumbers,
71
+ spelledNumbers,
72
+ statedRanges,
73
+ ungroundedNumber
74
+ } from "./chunk-FCB6JLWB.js";
61
75
  import {
62
76
  DATA_BACKUP_PREFIX,
63
77
  DocumentVersionManager,
@@ -182,6 +196,7 @@ import {
182
196
  buildPreviewDoc,
183
197
  chooseDashboardLayout,
184
198
  composeDashboardLayers,
199
+ coverRepeatsLeadingBlock,
185
200
  cssFilterForTreatment,
186
201
  dashboardCanvasFill,
187
202
  dashboardCellAccent,
@@ -235,7 +250,7 @@ import {
235
250
  validateMarkdownSource,
236
251
  wordRevealDelay,
237
252
  writeDashboardLayoutsToFrontmatter
238
- } from "./chunk-IFZZI4XY.js";
253
+ } from "./chunk-J2G6EOEJ.js";
239
254
  import {
240
255
  buildNarrationTimingJson,
241
256
  parseNarrationTimingJson,
@@ -243,6 +258,7 @@ import {
243
258
  } from "./chunk-HKHOFTGM.js";
244
259
  import {
245
260
  AUTHORED_PRESENTATION_LAYOUT,
261
+ CONCEPT_TEMPLATES,
246
262
  DEFAULT_TRANSFORM_STYLE_ID,
247
263
  DYNAMIC_PRESENTATION_STYLE,
248
264
  PRESENTATION_HINTS_KEY,
@@ -255,12 +271,16 @@ import {
255
271
  applyTransform,
256
272
  collectPresentationMedia,
257
273
  compilePresentationPlan,
274
+ conceptBuildSpec,
275
+ conceptRevealTiming,
276
+ conceptTemplate,
258
277
  createPresentationPlan,
259
278
  createTransformStyleRegistry,
260
279
  defaultPresentationHints,
261
280
  extractDocImages,
262
281
  getTransformStyleIds,
263
282
  getTransformStyleSummaries,
283
+ matchPointsToSentences,
264
284
  parsePresentationHints,
265
285
  parsePresentationPlan,
266
286
  presentationLayoutFits,
@@ -272,8 +292,9 @@ import {
272
292
  serializePresentationPlan,
273
293
  transformNarratedSegment,
274
294
  usesDynamicPresentation
275
- } from "./chunk-OUSEEUEC.js";
295
+ } from "./chunk-YQQWE4HG.js";
276
296
  import {
297
+ AUTHORING_TRICKS,
277
298
  BASE_INPUT_DESCRIPTORS,
278
299
  BLOCK_MEDIA_LAYOUT_POLICIES,
279
300
  DEFAULT_LAYOUT,
@@ -282,13 +303,16 @@ import {
282
303
  DIAGRAM_LABEL_MIN_FONT_SIZE,
283
304
  DIAGRAM_LABEL_VERTICAL_PADDING,
284
305
  GEOMETRY_BOUND_TEMPLATES,
306
+ PRESENTATION_LAYOUT_GUIDE,
285
307
  SHAPE_NAMES,
286
308
  TEMPLATE_AUTHORING_METADATA,
309
+ TEMPLATE_GUIDES,
287
310
  TEMPLATE_INPUT_DESCRIPTORS,
288
311
  TEMPLATE_METADATA,
289
312
  accentForViewport,
290
313
  adjustY,
291
314
  applyRenderStyleToLayers,
315
+ authoringTricks,
292
316
  bigText,
293
317
  blockBuildSteps,
294
318
  bottomFeature,
@@ -345,6 +369,7 @@ import {
345
369
  getPinnedBlockMeta,
346
370
  getTemplateHint,
347
371
  getThemeFont,
372
+ guideText,
348
373
  hasBlockBuilds,
349
374
  hasTemplate,
350
375
  imageWithCaption,
@@ -385,6 +410,7 @@ import {
385
410
  shouldUseShadow,
386
411
  splitConceptItem,
387
412
  statHighlight,
413
+ templateCatalog,
388
414
  templateRegistry,
389
415
  themeWantsAmbientMotion,
390
416
  themedEntrance,
@@ -405,7 +431,7 @@ import {
405
431
  wrapWithPersistentLayers,
406
432
  writeCustomTemplatesToFrontmatter,
407
433
  writeCustomThemesToFrontmatter
408
- } from "./chunk-QJQQO3K4.js";
434
+ } from "./chunk-CTT4XAGO.js";
409
435
  import {
410
436
  ASCII_CHAR_H,
411
437
  ASCII_CHAR_W,
@@ -704,6 +730,11 @@ import {
704
730
  import {
705
731
  buildCaptionTrack
706
732
  } from "./chunk-5HWYSUXS.js";
733
+ import {
734
+ phraseOffset,
735
+ phraseStartTime,
736
+ wordTimeAt
737
+ } from "./chunk-L4AFSOT3.js";
707
738
  import {
708
739
  DEFAULT_WORDS_PER_SECOND,
709
740
  calculatePrefixDuration,
@@ -724,6 +755,7 @@ export {
724
755
  ASCII_DIAGRAM_FENCE_LANGS,
725
756
  ASCII_TIMELINE_FENCE_LANGS,
726
757
  AUTHORED_PRESENTATION_LAYOUT,
758
+ AUTHORING_TRICKS,
727
759
  AVAILABLE_FONT_STACKS,
728
760
  BASE_INPUT_DESCRIPTORS,
729
761
  BLOCK_MEDIA_LAYOUT_POLICIES,
@@ -733,6 +765,7 @@ export {
733
765
  BUILD_PARAM_KEYS,
734
766
  BUILD_PREVIOUS,
735
767
  BUILTIN_DASHBOARD_LAYOUTS,
768
+ CONCEPT_TEMPLATES,
736
769
  CONTAINER_TEMPLATES,
737
770
  COVER_SLIDE_FRONTMATTER_KEYS,
738
771
  COVER_SLIDE_TEMPLATE_OPTIONS,
@@ -823,6 +856,7 @@ export {
823
856
  PRESENTATION_HINTS_KEY,
824
857
  PRESENTATION_KEY,
825
858
  PRESENTATION_LAYOUTS,
859
+ PRESENTATION_LAYOUT_GUIDE,
826
860
  PRESENTATION_LIMITS,
827
861
  PROOF_DIALECTS,
828
862
  PROOF_FRONTMATTER_KEYS,
@@ -835,6 +869,7 @@ export {
835
869
  SeededRandom,
836
870
  TABLE_FED_TEMPLATES,
837
871
  TEMPLATE_AUTHORING_METADATA,
872
+ TEMPLATE_GUIDES,
838
873
  TEMPLATE_INPUT_DESCRIPTORS,
839
874
  TEMPLATE_METADATA,
840
875
  THEMES,
@@ -875,6 +910,7 @@ export {
875
910
  assertMarkdownDocumentWithinLimits,
876
911
  assertMarkdownSourceWithinLimits,
877
912
  assertTheme,
913
+ authoringTricks,
878
914
  autoTemplatePreservesContent,
879
915
  bandpassRun,
880
916
  bigText,
@@ -928,7 +964,10 @@ export {
928
964
  computeDiagramLayout,
929
965
  computeDrawingLayout,
930
966
  computeLayoutLayers,
967
+ conceptBuildSpec,
931
968
  conceptBuildStepTexts,
969
+ conceptRevealTiming,
970
+ conceptTemplate,
932
971
  condenseMarkdownSource,
933
972
  connectorPath,
934
973
  contentBlock,
@@ -938,6 +977,7 @@ export {
938
977
  countSpokenWords,
939
978
  countUpSpecFor,
940
979
  coverBlock,
980
+ coverRepeatsLeadingBlock,
941
981
  createAccentLayers,
942
982
  createBandpass,
943
983
  createDocument,
@@ -976,6 +1016,7 @@ export {
976
1016
  detectSyllableOnsets,
977
1017
  detectTree,
978
1018
  diagramBlock,
1019
+ distinctiveStems,
979
1020
  docToMarkdown,
980
1021
  documentTitleFromFileName,
981
1022
  downsampleTrace,
@@ -1077,7 +1118,9 @@ export {
1077
1118
  getTwoColumnPositions,
1078
1119
  getViewport,
1079
1120
  getViewportOrientation,
1121
+ groundingSentences,
1080
1122
  guessFontFallback,
1123
+ guideText,
1081
1124
  hasBlockBuilds,
1082
1125
  hasIconMarker,
1083
1126
  hasTemplate,
@@ -1105,6 +1148,7 @@ export {
1105
1148
  isExplicitTimelineLang,
1106
1149
  isExplicitTreeLang,
1107
1150
  isGeometryBoundTemplate,
1151
+ isGroundedParaphrase,
1108
1152
  isHex,
1109
1153
  isHtmlLineBreak,
1110
1154
  isMaterializedMediaNode,
@@ -1124,6 +1168,7 @@ export {
1124
1168
  isTemplatedPageBlock,
1125
1169
  isTransitionType,
1126
1170
  isTreeFence,
1171
+ isVerbatimQuote,
1127
1172
  isVideoEmbedUrl,
1128
1173
  isWrappedFlowTimelineSource,
1129
1174
  layersBlock,
@@ -1146,6 +1191,7 @@ export {
1146
1191
  markerPath,
1147
1192
  matchByKeywordAffinity,
1148
1193
  matchFontFamily,
1194
+ matchPointsToSentences,
1149
1195
  matchTrailingPandocAttr,
1150
1196
  matchTrailingTemplateAnnotation,
1151
1197
  materializeBlockLayers,
@@ -1165,10 +1211,12 @@ export {
1165
1211
  normalizeChartTable,
1166
1212
  normalizeDashboardZoom,
1167
1213
  normalizeDocfxMarkdown,
1214
+ normalizeGroundingText,
1168
1215
  normalizeShapeKind,
1169
1216
  normalizeTransitionDirection,
1170
1217
  normalizeTransitionType,
1171
1218
  nucleiStep,
1219
+ numbersIn,
1172
1220
  oklchDarken,
1173
1221
  oklchLighten,
1174
1222
  oklchSetChroma,
@@ -1203,6 +1251,8 @@ export {
1203
1251
  parseWrappedFlowTimeline,
1204
1252
  parseYamlSubset,
1205
1253
  photoGrid,
1254
+ phraseOffset,
1255
+ phraseStartTime,
1206
1256
  pickContrastingText,
1207
1257
  pipStyleVars,
1208
1258
  plainTextFromInlineHtml,
@@ -1221,6 +1271,7 @@ export {
1221
1271
  pullQuote,
1222
1272
  quoteAttrValue,
1223
1273
  quoteBlock,
1274
+ rangeEndOnly,
1224
1275
  readCustomTemplatesFromFrontmatter,
1225
1276
  readCustomThemesFromFrontmatter,
1226
1277
  readDashboardLayoutsFromFrontmatter,
@@ -1279,6 +1330,7 @@ export {
1279
1330
  resolveTransformStyle,
1280
1331
  resolveTransitionDuration,
1281
1332
  resolveWikiLinks,
1333
+ restatesHeadline,
1282
1334
  revertToImageEditVersion,
1283
1335
  revertToVersion,
1284
1336
  rewriteMarkdownReferences,
@@ -1308,11 +1360,14 @@ export {
1308
1360
  shouldUseShadow,
1309
1361
  snapEndpoints,
1310
1362
  snapPoints,
1363
+ sourceNumbers,
1364
+ spelledNumbers,
1311
1365
  splitConceptItem,
1312
1366
  splitFrontmatterBlock,
1313
1367
  splitIconMarkers,
1314
1368
  splitKeyValueToken,
1315
1369
  statHighlight,
1370
+ statedRanges,
1316
1371
  stringifyHtmlNodes,
1317
1372
  stringifyMarkdown,
1318
1373
  stripBlockBackdropLayer,
@@ -1324,6 +1379,7 @@ export {
1324
1379
  svgIslandMarkup,
1325
1380
  svgSourceFromBytes,
1326
1381
  svgSourceFromDataUrl,
1382
+ templateCatalog,
1327
1383
  templateRegistry,
1328
1384
  themeWantsAmbientMotion,
1329
1385
  themedEntrance,
@@ -1348,6 +1404,7 @@ export {
1348
1404
  treeFromTemplateData,
1349
1405
  treeToTemplateData,
1350
1406
  twoColumn,
1407
+ ungroundedNumber,
1351
1408
  unquoteAttrValue,
1352
1409
  unwrapMarkdownSource,
1353
1410
  updateLayer,
@@ -1370,6 +1427,7 @@ export {
1370
1427
  wordIndexAtTime,
1371
1428
  wordPosAtExpectedSyllables,
1372
1429
  wordRevealDelay,
1430
+ wordTimeAt,
1373
1431
  wrapMarkdownSource,
1374
1432
  wrapWithPersistentLayers,
1375
1433
  writeCustomTemplatesToFrontmatter,
@@ -1,6 +1,66 @@
1
1
  import { k as Block, aY as PageSectionKind, aW as PageEmphasis, bJ as ThemeColorScheme, aU as PageBackground, bH as Theme, cc as ViewportConfig, D as CustomTemplateDefinition, a$ as PageVariant, br as StartBlockConfig, T as Doc, bK as ThemePageStyle } from './Doc-BhvotZx_.js';
2
2
  import { M as MarkdownBlockNode } from './types-Zk8qYuaT.js';
3
3
 
4
+ /** A prominent number found inside a short stat-like string. */
5
+ interface NumberHighlightMatch {
6
+ value: string;
7
+ index: number;
8
+ end: number;
9
+ }
10
+
11
+ /** A bounded presentation is a visual overlay on the canonical spoken script.
12
+ * It lives in frontmatter so undo, copy, DBK, and ordinary Markdown saves carry
13
+ * it atomically. Layout choices never replace the source prose or store seconds.
14
+ */
15
+
16
+ declare const PRESENTATION_KEY = "squisq-presentation";
17
+ /** The layouts a summary (a headline and up to four points) can fill. */
18
+ declare const PRESENTATION_LAYOUTS: readonly ["title", "divider", "statement", "emphasis", "quote", "stat", "definition", "list", "comparison", "steps", "image", "cards", "process", "cycle", "layers"];
19
+ type PresentationLayout = (typeof PRESENTATION_LAYOUTS)[number];
20
+ /** Shows a section's own block, with the template its author chose, instead of
21
+ * a summary. A section shown this way is one slide for its whole narration. */
22
+ declare const AUTHORED_PRESENTATION_LAYOUT = "authored";
23
+ type PresentationBeatLayout = PresentationLayout | typeof AUTHORED_PRESENTATION_LAYOUT;
24
+ /** The prominent number a key-number slide shows, and the line that states it. */
25
+ declare function presentationStat(headline: string, points: readonly string[]): {
26
+ match: NumberHighlightMatch;
27
+ line: string;
28
+ index: number;
29
+ } | null;
30
+ /** Whether a summary can fill a layout: enough points for a list, steps,
31
+ * cards, a process, a cycle (three) or a comparison; a prominent number for a key number; a short headline for a big
32
+ * statement; and, for a quote, a headline found word for word in
33
+ * `passage`, the source text the slide summarizes. An image slide also needs a
34
+ * picture, which callers check. */
35
+ declare function presentationLayoutFits(layout: PresentationLayout, headline: string, points: readonly string[], passage: string): boolean;
36
+ interface PresentationBeat {
37
+ id: string;
38
+ sourceStart: number;
39
+ sourceEnd: number;
40
+ layout: PresentationBeatLayout;
41
+ headline: string;
42
+ points: string[];
43
+ imageSrc?: string;
44
+ /** The section's videos and diagrams shown beside this slide's text (`presentationMedia`). */
45
+ media?: string[];
46
+ /** Left out of the deck; the slide shown before it stays on screen instead. */
47
+ hidden?: true;
48
+ }
49
+ interface PresentationPlan {
50
+ version: 1;
51
+ sourceText: string;
52
+ origin: 'automatic' | 'ai';
53
+ beats: PresentationBeat[];
54
+ }
55
+ declare const PRESENTATION_LIMITS: {
56
+ readonly sourceCharacters: 40000;
57
+ readonly beats: 80;
58
+ readonly serializedCharacters: 160000;
59
+ readonly mediaPerBeat: 4;
60
+ };
61
+ declare function parsePresentationPlan(input: unknown): PresentationPlan | null;
62
+ declare function serializePresentationPlan(plan: PresentationPlan): string;
63
+
4
64
  /**
5
65
  * PageSection — the framework-agnostic block model for Page (linear) mode.
6
66
  *
@@ -240,4 +300,4 @@ declare function materializePageSection(block: Block, options?: MaterializePageS
240
300
  */
241
301
  declare function materializePageSections(doc: Doc, options?: MaterializePageSectionsOptions): PageSectionMaterialization[];
242
302
 
243
- export { type MaterializePageSectionOptions as M, type PageMedia as P, type MaterializePageSectionsOptions as a, type PageRichText as b, type PageSection as c, type PageSectionDiagnostic as d, type PageSectionItem as e, type PageSectionMaterialization as f, type PageSectionSource as g, type PageSpatialKind as h, type PageTransformHints as i, materializePageSections as j, materializePageSection as m, resolvePageStyle as r };
303
+ export { AUTHORED_PRESENTATION_LAYOUT as A, type MaterializePageSectionOptions as M, PRESENTATION_KEY as P, type MaterializePageSectionsOptions as a, PRESENTATION_LAYOUTS as b, PRESENTATION_LIMITS as c, type PageMedia as d, type PageRichText as e, type PageSection as f, type PageSectionDiagnostic as g, type PageSectionItem as h, type PageSectionMaterialization as i, type PageSectionSource as j, type PageSpatialKind as k, type PageTransformHints as l, type PresentationBeat as m, type PresentationBeatLayout as n, type PresentationLayout as o, type PresentationPlan as p, materializePageSection as q, materializePageSections as r, parsePresentationPlan as s, presentationLayoutFits as t, presentationStat as u, resolvePageStyle as v, serializePresentationPlan as w };
@@ -31,7 +31,7 @@ import {
31
31
  traceWordPosAt,
32
32
  transcriptWordKeys,
33
33
  vadStep
34
- } from "../chunk-CQSCYJQU.js";
34
+ } from "../chunk-OIQ2GO2O.js";
35
35
  import "../chunk-NEWNNLWN.js";
36
36
  import {
37
37
  buildNarrationTimingJson,
@@ -45,7 +45,7 @@ import {
45
45
  wordIndexAtChar,
46
46
  wordIndexAtTime,
47
47
  wordPosAtExpectedSyllables
48
- } from "../chunk-QJQQO3K4.js";
48
+ } from "../chunk-CTT4XAGO.js";
49
49
  import "../chunk-SGNWO7OF.js";
50
50
  import "../chunk-FUBMT6SJ.js";
51
51
  import "../chunk-JNUNNQ74.js";
@@ -139,4 +139,60 @@ interface BuildCaptionTrackOptions {
139
139
  }
140
140
  declare function buildCaptionTrack(sources: CaptionSegmentSource[], options?: BuildCaptionTrackOptions): CaptionTrack;
141
141
 
142
- export { type BuildCaptionTrackOptions, type CaptionSegmentSource, DEFAULT_WORDS_PER_SECOND, type NarrationTimeEstimate, type NarrationTimeOptions, type ReadingTimeEstimate, type ReadingTimeOptions, buildCaptionTrack, calculatePrefixDuration, countSpokenWords, estimateNarrationDuration, estimateNarrationTime, estimateReadingTime, estimateSpokenWordCount, estimateTimeFromText };
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 };
@@ -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
  };