@bendyline/squisq 2.13.9 → 2.13.10
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-BCrrYAuK.d.ts → Doc-DqYt_b2b.d.ts} +14 -1
- package/dist/{ImageEditDoc-CSuevovH.d.ts → ImageEditDoc-CXXiXVJ-.d.ts} +1 -1
- package/dist/{chunk-R2J7CQJZ.js → chunk-DIY3NBIS.js} +24 -11
- package/dist/{chunk-3BIKSQTM.js → chunk-FXQ7C2FF.js} +17 -1
- package/dist/{chunk-FTN6SGW5.js → chunk-HKHOFTGM.js} +10 -0
- package/dist/{chunk-VMKRN7TB.js → chunk-KRMAEYNM.js} +232 -59
- package/dist/{chunk-L3VQQ3WT.js → chunk-LWNT6M4N.js} +19 -14
- package/dist/{chunk-QVNMPBS3.js → chunk-WK6LEZ3U.js} +25 -9
- package/dist/doc/index.d.ts +14 -15
- package/dist/doc/index.js +7 -5
- package/dist/fence/index.d.ts +1 -1
- package/dist/generate/index.d.ts +1 -1
- package/dist/imageEdit/index.d.ts +3 -3
- package/dist/index.d.ts +7 -7
- package/dist/index.js +20 -6
- package/dist/jsonForm/index.d.ts +1 -1
- package/dist/{materializePageSection-FT1B5NOo.d.ts → materializePageSection-S2hxZ_lO.d.ts} +1 -1
- package/dist/mediaEdit/index.d.ts +2 -2
- package/dist/narration/index.d.ts +28 -2
- package/dist/narration/index.js +8 -4
- package/dist/recommend/index.js +1 -1
- package/dist/schemas/index.d.ts +4 -4
- package/dist/{themeLibrary-BWvtBQ42.d.ts → themeLibrary-CFJbeItn.d.ts} +1 -1
- package/dist/timing/index.d.ts +1 -1
- package/dist/transform/index.d.ts +43 -7
- package/dist/transform/index.js +11 -3
- package/package.json +1 -1
|
@@ -2396,6 +2396,8 @@ interface Doc {
|
|
|
2396
2396
|
duration: number;
|
|
2397
2397
|
bookmarks: AudioBookmark[];
|
|
2398
2398
|
builds?: BuildAdvance[];
|
|
2399
|
+
/** When the presenter first showed each presentation slide during the take. */
|
|
2400
|
+
slides?: PresentationSlideMark[];
|
|
2399
2401
|
};
|
|
2400
2402
|
/** Projection-only guard: never compile an accepted plan twice. */
|
|
2401
2403
|
presentationApplied?: boolean;
|
|
@@ -3443,6 +3445,17 @@ interface AudioBookmark {
|
|
|
3443
3445
|
/** The word text at this position */
|
|
3444
3446
|
textFragment?: string;
|
|
3445
3447
|
}
|
|
3448
|
+
/**
|
|
3449
|
+
* A presentation slide the presenter put on screen while recording, keyed by
|
|
3450
|
+
* where its passage begins in the narration script. Unlike a bookmark it marks
|
|
3451
|
+
* a click, not a spoken word.
|
|
3452
|
+
*/
|
|
3453
|
+
interface PresentationSlideMark {
|
|
3454
|
+
/** Character offset in the narration script where the slide's passage begins. */
|
|
3455
|
+
charOffset: number;
|
|
3456
|
+
/** Seconds: take-relative in a timing sidecar, document time once applied. */
|
|
3457
|
+
time: number;
|
|
3458
|
+
}
|
|
3446
3459
|
/**
|
|
3447
3460
|
* Timing data for an audio segment, typically from a `.timing.json` file
|
|
3448
3461
|
* generated alongside TTS audio. Contains the source text and per-word
|
|
@@ -3473,4 +3486,4 @@ declare function getBlockAtTime(blocks: Block[], time: number): Block | null;
|
|
|
3473
3486
|
*/
|
|
3474
3487
|
declare function getCaptionAtTime(captions: CaptionTrack | undefined, time: number): CaptionPhrase | null;
|
|
3475
3488
|
|
|
3476
|
-
export { type FontFamilyKind as $, type AccentImage as A, type BarChartInput as B, type CaptionPhrase as C, type CustomTemplateLayer as D, type CustomTemplateValidationError as E, type CustomTemplateValidationResult as F, DARK_SURFACE as G, DEFAULT_DOC_FONT as H, DEFAULT_TITLE_FONT as I, type DataTableInput as J, type DateEventInput as K, type DeepPartial as L, type DefinitionCardInput as M, type DiagramBlockInput as N, type DiagramEdgeAnchor as O, type DiagramTemplateEdge as P, type DiagramTemplateNode as Q, type Doc as R, type DocBlock as S, type DocDiagnostic as T, type DonutChartInput as U, type DrawingBlockInput as V, FRONTMATTER_CUSTOM_TEMPLATES_KEY as W, FRONTMATTER_CUSTOM_THEMES_KEY as X, FRONTMATTER_MOTION_KEY as Y, type FactCardInput as Z, type FontFamily as _, type AccentPosition as a, type PersistentLayer as a$, type FullBleedQuoteInput as a0, type GradientBackgroundConfig as a1, type ImageBackgroundConfig as a2, type ImageLayer as a3, type ImageTreatment as a4, type ImageWithCaptionInput as a5, LIGHT_SURFACE as a6, type Layer as a7, type LayerRepeat as a8, type LayoutHints as a9, PAGE_DESIGN_FAMILIES as aA, PAGE_DIVIDERS as aB, PAGE_EMPHASES as aC, PAGE_EYEBROWS as aD, PAGE_HEADING_CASES as aE, PAGE_HEADING_SCALES as aF, PAGE_HEADING_UNDERLINES as aG, PAGE_HERO_STYLES as aH, PAGE_IMAGE_FRAMINGS as aI, PAGE_NUMERAL_STYLES as aJ, PAGE_PATTERNS as aK, PAGE_QUOTE_MARKS as aL, PAGE_SECTION_KINDS as aM, PAGE_SECTION_SPACINGS as aN, PAGE_SHADOWS as aO, PAGE_VARIANTS as aP, type PageAccentRotation as aQ, type PageBackground as aR, type PageDesignFamily as aS, type PageEmphasis as aT, type PageHeadingTreatment as aU, type PageSectionKind as aV, type PageSectionOverride as aW, type PageTokens as aX, type PageVariant as aY, type PathLayer as aZ, type PatternBackgroundConfig as a_, type LeftFeatureInput as aa, type LineChartInput as ab, type LinearGradient as ac, type ListBlockInput as ad, MOTION_PROFILES as ae, type MapBlockInput as af, type MapLayer as ag, type MapMarker as ah, type MapTileStyle as ai, type MarkerStyle as aj, type MediaClip as ak, type MediaCrop as al, type MediaCut as am, type MediaEdits as an, type MediaOnlyInput as ao, type MediaScheduleOptions as ap, type MermaidLayer as aq, type MotionEntrance as ar, type MotionOrigin as as, type MotionProfile as at, type MotionProfileName as au, type MotionSpec as av, type MotionState as aw, PAGE_ACCENT_STRATEGIES as ax, PAGE_BACKGROUNDS as ay, PAGE_BACKGROUND_RHYTHMS as az, type AmbientGradientConfig as b, type
|
|
3489
|
+
export { type FontFamilyKind as $, type AccentImage as A, type BarChartInput as B, type CaptionPhrase as C, type CustomTemplateLayer as D, type CustomTemplateValidationError as E, type CustomTemplateValidationResult as F, DARK_SURFACE as G, DEFAULT_DOC_FONT as H, DEFAULT_TITLE_FONT as I, type DataTableInput as J, type DateEventInput as K, type DeepPartial as L, type DefinitionCardInput as M, type DiagramBlockInput as N, type DiagramEdgeAnchor as O, type DiagramTemplateEdge as P, type DiagramTemplateNode as Q, type Doc as R, type DocBlock as S, type DocDiagnostic as T, type DonutChartInput as U, type DrawingBlockInput as V, FRONTMATTER_CUSTOM_TEMPLATES_KEY as W, FRONTMATTER_CUSTOM_THEMES_KEY as X, FRONTMATTER_MOTION_KEY as Y, type FactCardInput as Z, type FontFamily as _, type AccentPosition as a, type PersistentLayer as a$, type FullBleedQuoteInput as a0, type GradientBackgroundConfig as a1, type ImageBackgroundConfig as a2, type ImageLayer as a3, type ImageTreatment as a4, type ImageWithCaptionInput as a5, LIGHT_SURFACE as a6, type Layer as a7, type LayerRepeat as a8, type LayoutHints as a9, PAGE_DESIGN_FAMILIES as aA, PAGE_DIVIDERS as aB, PAGE_EMPHASES as aC, PAGE_EYEBROWS as aD, PAGE_HEADING_CASES as aE, PAGE_HEADING_SCALES as aF, PAGE_HEADING_UNDERLINES as aG, PAGE_HERO_STYLES as aH, PAGE_IMAGE_FRAMINGS as aI, PAGE_NUMERAL_STYLES as aJ, PAGE_PATTERNS as aK, PAGE_QUOTE_MARKS as aL, PAGE_SECTION_KINDS as aM, PAGE_SECTION_SPACINGS as aN, PAGE_SHADOWS as aO, PAGE_VARIANTS as aP, type PageAccentRotation as aQ, type PageBackground as aR, type PageDesignFamily as aS, type PageEmphasis as aT, type PageHeadingTreatment as aU, type PageSectionKind as aV, type PageSectionOverride as aW, type PageTokens as aX, type PageVariant as aY, type PathLayer as aZ, type PatternBackgroundConfig as a_, type LeftFeatureInput as aa, type LineChartInput as ab, type LinearGradient as ac, type ListBlockInput as ad, MOTION_PROFILES as ae, type MapBlockInput as af, type MapLayer as ag, type MapMarker as ah, type MapTileStyle as ai, type MarkerStyle as aj, type MediaClip as ak, type MediaCrop as al, type MediaCut as am, type MediaEdits as an, type MediaOnlyInput as ao, type MediaScheduleOptions as ap, type MermaidLayer as aq, type MotionEntrance as ar, type MotionOrigin as as, type MotionProfile as at, type MotionProfileName as au, type MotionSpec as av, type MotionState as aw, PAGE_ACCENT_STRATEGIES as ax, PAGE_BACKGROUNDS as ay, PAGE_BACKGROUND_RHYTHMS as az, type AmbientGradientConfig as b, type VideoEmbedLayer as b$, type PersistentLayerConfig as b0, type PersistentLayerTemplate as b1, type PersistentLayerTemplateConfig as b2, type PersistentLayerTemplateType as b3, type PhotoGridInput as b4, type PieChartInput as b5, type PipStyle as b6, type Position as b7, type PresentationSlideMark as b8, type ProgressIndicatorConfig as b9, type TextParagraph as bA, type TextParagraphList as bB, type TextStyle as bC, type Theme as bD, type ThemeColorPalette as bE, type ThemeColorScheme as bF, type ThemePageStyle as bG, type ThemeRegistry as bH, type ThemeSchemaVersion as bI, type ThemeSeedColors as bJ, type ThemeStyle as bK, type ThemeTypography as bL, type TimelineBlockInput as bM, type TimelineTemplateEvent as bN, type TimelineTemplateLink as bO, type TimelineTemplateTrack as bP, type TitleBlockInput as bQ, type TitleCaptionConfig as bR, type TopFeatureInput as bS, type TranscriptBlockInput as bT, type TreeBlockInput as bU, type TreeLayer as bV, type TreeLayerItem as bW, type TreeLayerStyle as bX, type TreeTemplateItem as bY, type TwoColumnInput as bZ, VIEWPORT_PRESETS as b_, type PromotedBodyAnnotation as ba, type PullQuoteInput as bb, type QuoteBlockInput as bc, type RawLayersInput as bd, type RenderStyle as be, type RightFeatureInput as bf, type ScatterChartInput as bg, type ScheduledClip as bh, type SectionHeaderInput as bi, type ShapeFilter as bj, type ShapeLayer as bk, type ShapePattern as bl, type SolidBackgroundConfig as bm, type StartBlockConfig as bn, type StatHighlightInput as bo, type SurfaceScheme as bp, type SvgLayer as bq, THEME_SCHEMA_VERSION as br, type TableLayer as bs, type TableLayerStyle as bt, type TemplateBlock as bu, type TemplateContext as bv, type TemplateFunction as bw, type TemplateRegistry as bx, type TextFlow as by, type TextLayer as bz, type Animation as c, serializeMediaFx as c$, type VideoLayer as c0, type VideoPipPosition as c1, type VideoPipShape as c2, type VideoPipSize as c3, type VideoPlacement as c4, type VideoPresentation as c5, type VideoPullQuoteInput as c6, type VideoWithCaptionInput as c7, type ViewportConfig as c8, type ViewportOrientation as c9, resolveMotionProfile as cA, scaledFontSize as cB, scheduleMediaClip as cC, validateCustomTemplateDefinition as cD, type MediaFxOpId as cE, type MediaFxChain as cF, MEDIA_EDIT_PARAMS as cG, MEDIA_FX_ORDER as cH, MEDIA_FX_SPECS as cI, type MediaEditParamKey as cJ, type MediaEditParamValues as cK, type MediaFxOp as cL, formatMediaNumber as cM, hasRenderableFx as cN, mediaEditHtmlAttribute as cO, mediaEditValuesFromAttributes as cP, mediaEditValuesFromParams as cQ, mediaRenderKey as cR, normalizeMediaCrop as cS, normalizeMediaCuts as cT, parseMediaCrop as cU, parseMediaCuts as cV, parseMediaEdits as cW, parseMediaFx as cX, serializeMediaCrop as cY, serializeMediaCuts as cZ, serializeMediaEdits as c_, type ViewportPreset as ca, type VignetteConfig as cb, applySurface as cc, calculateDuration as cd, calculateFontScale as ce, createTemplateContext as cf, createTheme as cg, createThemeRegistry as ch, getAspectRatioString as ci, getBlockAtTime as cj, getCaptionAtTime as ck, getDocPlaybackDuration as cl, getLayoutHints as cm, getSafeTextBounds as cn, getSegmentAtTime as co, getTwoColumnPositions as cp, getViewport as cq, getViewportOrientation as cr, isCustomTemplateDefinition as cs, isMotionProfileName as ct, isPersistentLayerTemplate as cu, isTemplateBlock as cv, scaledFontSize$1 as cw, readFrontmatterMotion as cx, resolveMediaSchedule as cy, resolveMotionForDoc as cz, type AnimationType as d, type AreaChartInput as e, type AudioBookmark as f, type AudioSegment as g, type AudioTimingData as h, type AudioTrack as i, type BigTextInput as j, type Block as k, type BlockConnection as l, type BorderStyle as m, type BottomFeatureInput as n, type CaptionTrack as o, type CaptionWord as p, type ChartBaseFields as q, type ChartTemplateInput as r, type ColorScheme as s, type ColumnChartInput as t, type ComparisonBarInput as u, type ContentBlockInput as v, type CornerBrandingConfig as w, type CountUpSpec as x, type CreateTemplateContextOptions as y, type CustomTemplateDefinition as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a3 as ImageLayer,
|
|
1
|
+
import { a3 as ImageLayer, bz as TextLayer, bk as ShapeLayer, aZ as PathLayer } from './Doc-DqYt_b2b.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ImageEditDoc — JSON document describing a layered, editable image.
|
|
@@ -744,6 +744,7 @@ function findRailLabels(grid, boxes) {
|
|
|
744
744
|
for (let c = Math.max(0, box.c0); c <= Math.min(W - 1, box.c1); c++) inBox[r * W + c] = 1;
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
|
+
const boxCell = maskedCell(inBox, W, H);
|
|
747
748
|
const at = (r, c) => r >= 0 && r < H && c >= 0 && c < W ? grid[r][c] : " ";
|
|
748
749
|
const joins = (ch) => isLineChar(ch) || isJunction(ch) || isPlus(ch) || isAnyCorner(ch);
|
|
749
750
|
const vertJoins = (ch) => {
|
|
@@ -771,7 +772,7 @@ function findRailLabels(grid, boxes) {
|
|
|
771
772
|
if (ch === " ") return false;
|
|
772
773
|
if (arrowDirection(ch) !== null) return true;
|
|
773
774
|
const ascii = asciiArrowDirection(ch);
|
|
774
|
-
if (ascii !== null && asciiArrowGate(grid, r, c, ascii)) return true;
|
|
775
|
+
if (ascii !== null && asciiArrowGate(grid, r, c, ascii, boxCell)) return true;
|
|
775
776
|
if (!isLineChar(ch)) return false;
|
|
776
777
|
if (routingRow[r]) return true;
|
|
777
778
|
const vert = vertJoins(at(r - 1, c)) || vertJoins(at(r + 1, c));
|
|
@@ -883,6 +884,7 @@ function extractEdges(grid, mask, perimeterOwners, boxes, warnings) {
|
|
|
883
884
|
var _a;
|
|
884
885
|
const H = grid.length;
|
|
885
886
|
const W = H > 0 ? grid[0].length : 0;
|
|
887
|
+
const boxCell = maskedCell(mask, W, H);
|
|
886
888
|
const cells = /* @__PURE__ */ new Map();
|
|
887
889
|
for (let r = 0; r < H; r++) {
|
|
888
890
|
for (let c = 0; c < W; c++) {
|
|
@@ -895,7 +897,7 @@ function extractEdges(grid, mask, perimeterOwners, boxes, warnings) {
|
|
|
895
897
|
continue;
|
|
896
898
|
}
|
|
897
899
|
const asc = asciiArrowDirection(ch);
|
|
898
|
-
if (asc && asciiArrowGate(grid, r, c, asc)) {
|
|
900
|
+
if (asc && asciiArrowGate(grid, r, c, asc, boxCell)) {
|
|
899
901
|
cells.set(idx, { arrow: asc });
|
|
900
902
|
continue;
|
|
901
903
|
}
|
|
@@ -925,12 +927,12 @@ function extractEdges(grid, mask, perimeterOwners, boxes, warnings) {
|
|
|
925
927
|
break;
|
|
926
928
|
}
|
|
927
929
|
if (isHoriz(gch)) {
|
|
928
|
-
if (horizRunReachesStructure(grid, mask, r, g, W)) break;
|
|
930
|
+
if (horizRunReachesStructure(grid, mask, r, g, W, boxCell)) break;
|
|
929
931
|
while (g < W && isHoriz(grid[r][g])) g++;
|
|
930
932
|
sawText = true;
|
|
931
933
|
continue;
|
|
932
934
|
}
|
|
933
|
-
if (isStructuralInGap(grid, r, g)) {
|
|
935
|
+
if (isStructuralInGap(grid, r, g, boxCell)) {
|
|
934
936
|
failed = true;
|
|
935
937
|
break;
|
|
936
938
|
}
|
|
@@ -1259,28 +1261,38 @@ function extractEdges(grid, mask, perimeterOwners, boxes, warnings) {
|
|
|
1259
1261
|
for (const idx of sideLabelCells) edgeCells.add(idx);
|
|
1260
1262
|
return { edges, edgeCells };
|
|
1261
1263
|
}
|
|
1262
|
-
function horizRunReachesStructure(grid, mask, r, c, W) {
|
|
1264
|
+
function horizRunReachesStructure(grid, mask, r, c, W, isBoxCell) {
|
|
1263
1265
|
let end = c;
|
|
1264
1266
|
while (end < W && isHoriz(grid[r][end]) && !mask[r * W + end]) end++;
|
|
1265
1267
|
if (end >= W || mask[r * W + end]) return true;
|
|
1266
1268
|
const ch = grid[r][end];
|
|
1267
1269
|
if (isLineChar(ch) || arrowDirection(ch) !== null) return true;
|
|
1268
1270
|
const asc = asciiArrowDirection(ch);
|
|
1269
|
-
return asc !== null && asciiArrowGate(grid, r, end, asc);
|
|
1271
|
+
return asc !== null && asciiArrowGate(grid, r, end, asc, isBoxCell);
|
|
1270
1272
|
}
|
|
1271
|
-
function isStructuralInGap(grid, r, c) {
|
|
1273
|
+
function isStructuralInGap(grid, r, c, isBoxCell) {
|
|
1272
1274
|
const ch = grid[r][c];
|
|
1273
1275
|
if (arrowDirection(ch) !== null) return true;
|
|
1274
1276
|
const asc = asciiArrowDirection(ch);
|
|
1275
|
-
if (asc !== null && asciiArrowGate(grid, r, c, asc)) return true;
|
|
1277
|
+
if (asc !== null && asciiArrowGate(grid, r, c, asc, isBoxCell)) return true;
|
|
1276
1278
|
if (!isLineChar(ch)) return false;
|
|
1277
1279
|
const isDrawing = (x) => x !== void 0 && (isLineChar(x) || arrowDirection(x) !== null);
|
|
1278
1280
|
return isDrawing(grid[r - 1]?.[c]) || isDrawing(grid[r + 1]?.[c]);
|
|
1279
1281
|
}
|
|
1280
|
-
function asciiArrowGate(grid, r, c, dir) {
|
|
1281
|
-
const
|
|
1282
|
+
function asciiArrowGate(grid, r, c, dir, isBoxCell) {
|
|
1283
|
+
const [br, bc] = dir === "down" ? [r - 1, c] : dir === "up" ? [r + 1, c] : dir === "right" ? [r, c - 1] : [r, c + 1];
|
|
1284
|
+
const behind = grid[br]?.[bc];
|
|
1282
1285
|
if (behind === void 0) return false;
|
|
1283
|
-
|
|
1286
|
+
if (dir === "down" || dir === "up" ? isVert(behind) : isHoriz(behind)) return true;
|
|
1287
|
+
if (!isBoxCell || !isPlus(behind) || isBoxCell(br, bc)) return false;
|
|
1288
|
+
const line = (lr, lc, test) => {
|
|
1289
|
+
const ch = grid[lr]?.[lc];
|
|
1290
|
+
return ch !== void 0 && test(ch) && !isBoxCell(lr, lc);
|
|
1291
|
+
};
|
|
1292
|
+
return line(br, bc - 1, isHoriz) || line(br, bc + 1, isHoriz) || line(br - 1, bc, isVert) || line(br + 1, bc, isVert);
|
|
1293
|
+
}
|
|
1294
|
+
function maskedCell(mask, W, H) {
|
|
1295
|
+
return (r, c) => r >= 0 && r < H && c >= 0 && c < W && mask[r * W + c] === 1;
|
|
1284
1296
|
}
|
|
1285
1297
|
function snapEndpoint(r, c, arrow, perimeterOwners, boxes, W, H) {
|
|
1286
1298
|
const ownersAt = (rr, cc) => {
|
|
@@ -4021,6 +4033,7 @@ function recommendTemplatesForBlock(profile, allNames) {
|
|
|
4021
4033
|
}
|
|
4022
4034
|
|
|
4023
4035
|
export {
|
|
4036
|
+
matchNumberHighlight,
|
|
4024
4037
|
parseAnnotationInner,
|
|
4025
4038
|
parseStandaloneAnnotation,
|
|
4026
4039
|
isMediaAnnotationName,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
expectedSyllablesAt,
|
|
10
10
|
flattenRenderableBlocks,
|
|
11
11
|
wordPosAtExpectedSyllables
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LWNT6M4N.js";
|
|
13
13
|
|
|
14
14
|
// src/narration/types.ts
|
|
15
15
|
var DEFAULT_FEATURE_CONFIG = Object.freeze({
|
|
@@ -1177,6 +1177,13 @@ function recordSlideShown(log, blockId, atMs) {
|
|
|
1177
1177
|
const floor = log.length > 0 ? log[log.length - 1].atMs : 0;
|
|
1178
1178
|
return [...log, { blockId, atMs: Math.max(atMs, floor, 0) }];
|
|
1179
1179
|
}
|
|
1180
|
+
var EMPTY_SLIDE_MARK_LOG = Object.freeze([]);
|
|
1181
|
+
function recordSlideMark(log, charOffset, atMs) {
|
|
1182
|
+
if (!Number.isInteger(charOffset) || charOffset < 0 || !Number.isFinite(atMs)) return log;
|
|
1183
|
+
if (log.some((entry) => entry.charOffset === charOffset)) return log;
|
|
1184
|
+
const floor = log.length > 0 ? log[log.length - 1].atMs : 0;
|
|
1185
|
+
return [...log, { charOffset, atMs: Math.max(atMs, floor, 0) }];
|
|
1186
|
+
}
|
|
1180
1187
|
function clampDuration(durationSec) {
|
|
1181
1188
|
return Number.isFinite(durationSec) && durationSec >= 0 ? durationSec : 0;
|
|
1182
1189
|
}
|
|
@@ -1231,6 +1238,12 @@ function buildAdvanceTimingJson(doc, advances, durationSec, options) {
|
|
|
1231
1238
|
endSec: Math.max(startSec, Math.min(rawEnd, duration))
|
|
1232
1239
|
});
|
|
1233
1240
|
}
|
|
1241
|
+
let slideCursor = 0;
|
|
1242
|
+
const slides = (options?.slides ?? []).filter((mark) => mark.charOffset < script.sourceText.length).map((mark, index) => {
|
|
1243
|
+
const time = index === 0 ? 0 : Math.min(duration, Math.max(slideCursor, mark.atMs / 1e3));
|
|
1244
|
+
slideCursor = time;
|
|
1245
|
+
return { charOffset: mark.charOffset, time };
|
|
1246
|
+
});
|
|
1234
1247
|
return {
|
|
1235
1248
|
version: 3,
|
|
1236
1249
|
sourceText: script.sourceText,
|
|
@@ -1240,6 +1253,7 @@ function buildAdvanceTimingJson(doc, advances, durationSec, options) {
|
|
|
1240
1253
|
// them with block starts would misreport what was measured.
|
|
1241
1254
|
bookmarks: [],
|
|
1242
1255
|
blocks,
|
|
1256
|
+
...slides.length ? { slides } : {},
|
|
1243
1257
|
// `cameraOffsetSec` is deliberately omitted: a dual take already encodes
|
|
1244
1258
|
// its skew in the camera clip's `startAt`/`clipStart` attributes, and a
|
|
1245
1259
|
// second copy here invites a double correction.
|
|
@@ -1295,6 +1309,8 @@ export {
|
|
|
1295
1309
|
alignTranscript,
|
|
1296
1310
|
EMPTY_ADVANCE_LOG,
|
|
1297
1311
|
recordSlideShown,
|
|
1312
|
+
EMPTY_SLIDE_MARK_LOG,
|
|
1313
|
+
recordSlideMark,
|
|
1298
1314
|
buildAdvanceTimingJson,
|
|
1299
1315
|
advanceCoverage
|
|
1300
1316
|
};
|
|
@@ -111,8 +111,18 @@ function parseNarrationTimingJson(data) {
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
+
const slides = [];
|
|
115
|
+
if (Array.isArray(raw.slides))
|
|
116
|
+
for (const item of raw.slides) {
|
|
117
|
+
if (!item || typeof item !== "object") continue;
|
|
118
|
+
const mark = item;
|
|
119
|
+
if (Number.isInteger(mark.charOffset) && finiteNonNegative(mark.charOffset) && mark.charOffset < raw.sourceText.length && finiteNonNegative(mark.time) && mark.time <= raw.duration && !slides.some((slide) => slide.charOffset === mark.charOffset))
|
|
120
|
+
slides.push({ charOffset: mark.charOffset, time: mark.time });
|
|
121
|
+
}
|
|
122
|
+
slides.sort((a, b) => a.time - b.time);
|
|
114
123
|
return {
|
|
115
124
|
...builds.length ? { builds } : {},
|
|
125
|
+
...slides.length ? { slides } : {},
|
|
116
126
|
version: 3,
|
|
117
127
|
sourceText: raw.sourceText,
|
|
118
128
|
duration: raw.duration,
|