@bendyline/squisq 2.13.15 → 2.13.16

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.
Files changed (38) hide show
  1. package/dist/{Doc-C_Sh49ot.d.ts → Doc-DLfTam0R.d.ts} +24 -1
  2. package/dist/{ImageEditDoc-Sqw3Tw-R.d.ts → ImageEditDoc-DdSHb6sj.d.ts} +1 -1
  3. package/dist/{chunk-OJCAKUHW.js → chunk-33CAD575.js} +12 -6
  4. package/dist/{chunk-L7QZORLB.js → chunk-37RLFDIT.js} +11 -4
  5. package/dist/chunk-4R3YZTPX.js +42 -0
  6. package/dist/{chunk-DBVCSVNV.js → chunk-A4ZFYGU6.js} +13 -38
  7. package/dist/{chunk-4HQ7QZKB.js → chunk-BG2OYBGC.js} +181 -43
  8. package/dist/{chunk-2SRF5III.js → chunk-BVL3F64S.js} +1 -1
  9. package/dist/{chunk-OFE5RZWW.js → chunk-MA7XUCSQ.js} +27 -6
  10. package/dist/{chunk-JSGIWW35.js → chunk-MTIR5PWF.js} +1 -1
  11. package/dist/{chunk-DDJHIZED.js → chunk-NBDF6SQ5.js} +21 -1
  12. package/dist/{chunk-N3FQSUVT.js → chunk-TOPEP5B7.js} +2 -2
  13. package/dist/{chunk-2CB37BOU.js → chunk-TXN23SG2.js} +1 -1
  14. package/dist/{chunk-FYP7GNER.js → chunk-XY5Z23C4.js} +7 -7
  15. package/dist/{chunk-Y34KYMAS.js → chunk-Z73DG6IL.js} +1 -1
  16. package/dist/doc/index.d.ts +98 -10
  17. package/dist/doc/index.js +17 -8
  18. package/dist/fence/index.d.ts +1 -1
  19. package/dist/generate/index.d.ts +1 -1
  20. package/dist/imageEdit/index.d.ts +3 -3
  21. package/dist/index.d.ts +6 -6
  22. package/dist/index.js +30 -16
  23. package/dist/jsonForm/index.d.ts +1 -1
  24. package/dist/jsonForm/index.js +5 -4
  25. package/dist/markdown/index.js +2 -2
  26. package/dist/{materializePageSection-Dmf-rf1b.d.ts → materializePageSection-HIoRYiZu.d.ts} +1 -1
  27. package/dist/mediaEdit/index.d.ts +154 -3
  28. package/dist/mediaEdit/index.js +241 -2
  29. package/dist/narration/index.d.ts +1 -1
  30. package/dist/narration/index.js +6 -4
  31. package/dist/recommend/index.js +3 -2
  32. package/dist/schemas/index.d.ts +26 -7
  33. package/dist/schemas/index.js +14 -8
  34. package/dist/{themeLibrary-B4VLovhW.d.ts → themeLibrary-B2K-aAOy.d.ts} +1 -1
  35. package/dist/timing/index.d.ts +1 -1
  36. package/dist/transform/index.d.ts +3 -3
  37. package/dist/transform/index.js +8 -6
  38. package/package.json +1 -1
@@ -152,6 +152,10 @@ declare function mediaEditValuesFromAttributes(kind: 'audio' | 'video', attribut
152
152
  * re-render (the render manifest records them instead). 12 hex digits.
153
153
  */
154
154
  declare function mediaRenderKey(src: string, fx: MediaFxChain): string;
155
+ /** The known ops of a chain, in chain order with explicit values — what a render applies. */
156
+ declare function canonicalMediaFx(fx: MediaFxChain): string;
157
+ /** 12 hex digits naming a derived file after the text that decides its content. */
158
+ declare function mediaRecipeHash(text: string): string;
155
159
 
156
160
  /**
157
161
  * Media-clip timing model.
@@ -2904,7 +2908,14 @@ interface TextParagraphList {
2904
2908
  level: number;
2905
2909
  /** The item's number, for an ordered item. */
2906
2910
  number?: number;
2911
+ /**
2912
+ * A task-list item (`- [ ]` / `- [x]`): drawn with an empty or ticked box
2913
+ * as its marker instead of a bullet. Absent for an ordinary item.
2914
+ */
2915
+ checked?: boolean;
2907
2916
  }
2917
+ /** The marker character of a task-list item: a ballot box, ticked when done. */
2918
+ declare function taskMarker(checked: boolean): string;
2908
2919
  /**
2909
2920
  * Ties together text layers that render one flow of text. A consumer that
2910
2921
  * lays text out natively (PPTX) draws the flow as ONE text box over the
@@ -3105,6 +3116,18 @@ interface VideoLayer extends BaseLayer {
3105
3116
  clipEnd: number;
3106
3117
  /** Total source video duration (for validation) */
3107
3118
  sourceDuration?: number;
3119
+ /**
3120
+ * Source ranges skipped as the clip plays (the clip's `cuts` recipe),
3121
+ * inside `clipStart`…`clipEnd`. With cuts, `clipEnd` is far enough into
3122
+ * the source to fill the block once they are skipped.
3123
+ */
3124
+ cuts?: MediaCut[];
3125
+ /**
3126
+ * The rest of the clip's edit recipe — `fx`, `gain`, `fadeIn`,
3127
+ * `fadeOut`, `crop` — for the renderer to apply. A video laid out in a
3128
+ * slide is not a scheduled clip, so the layer carries its own recipe.
3129
+ */
3130
+ edits?: MediaEdits;
3108
3131
  /**
3109
3132
  * Seconds into the owning block before this video begins playing
3110
3133
  * (the block-relative `startAt`). Default 0 — plays from block start.
@@ -3585,4 +3608,4 @@ declare function getBlockAtTime(blocks: Block[], time: number): Block | null;
3585
3608
  */
3586
3609
  declare function getCaptionAtTime(captions: CaptionTrack | undefined, time: number): CaptionPhrase | null;
3587
3610
 
3588
- export { FRONTMATTER_MOTION_KEY as $, type AccentImage as A, type BarChartInput as B, type CaptionPhrase as C, type CustomTemplateDefinition as D, type CustomTemplateLayer as E, type CustomTemplateValidationError as F, type CustomTemplateValidationResult as G, type CycleBlockInput as H, DARK_SURFACE as I, DEFAULT_DOC_FONT as J, DEFAULT_TITLE_FONT as K, type DataTableInput as L, type DateEventInput as M, type DeepPartial as N, type DefinitionCardInput as O, type DiagramBlockInput as P, type DiagramEdgeAnchor as Q, type DiagramTemplateEdge as R, type DiagramTemplateNode as S, type DiagramTemplateNodeInput as T, type Doc as U, type DocBlock as V, type DocDiagnostic as W, type DonutChartInput as X, type DrawingBlockInput as Y, FRONTMATTER_CUSTOM_TEMPLATES_KEY as Z, FRONTMATTER_CUSTOM_THEMES_KEY as _, type AccentPosition as a, type PageHeadingTreatment as a$, type FactCardInput as a0, type FontFamily as a1, type FontFamilyKind as a2, type FullBleedQuoteInput as a3, type FunnelBlockInput as a4, type GradientBackgroundConfig as a5, type HubBlockInput as a6, type ImageBackgroundConfig as a7, type ImageLayer as a8, type ImageTreatment as a9, type MotionProfile as aA, type MotionProfileName as aB, type MotionSpec as aC, type MotionState as aD, PAGE_ACCENT_STRATEGIES as aE, PAGE_BACKGROUNDS as aF, PAGE_BACKGROUND_RHYTHMS as aG, PAGE_DESIGN_FAMILIES as aH, PAGE_DIVIDERS as aI, PAGE_EMPHASES as aJ, PAGE_EYEBROWS as aK, PAGE_HEADING_CASES as aL, PAGE_HEADING_SCALES as aM, PAGE_HEADING_UNDERLINES as aN, PAGE_HERO_STYLES as aO, PAGE_IMAGE_FRAMINGS as aP, PAGE_NUMERAL_STYLES as aQ, PAGE_PATTERNS as aR, PAGE_QUOTE_MARKS as aS, PAGE_SECTION_KINDS as aT, PAGE_SECTION_SPACINGS as aU, PAGE_SHADOWS as aV, PAGE_VARIANTS as aW, type PageAccentRotation as aX, type PageBackground as aY, type PageDesignFamily as aZ, type PageEmphasis as a_, type ImageWithCaptionInput as aa, LIGHT_SURFACE as ab, type Layer as ac, type LayerRepeat as ad, type LayersBlockInput as ae, type LayoutHints as af, type LeftFeatureInput as ag, type LineChartInput as ah, type LinearGradient as ai, type ListBlockInput as aj, MOTION_PROFILES as ak, type MapBlockInput as al, type MapLayer as am, type MapMarker as an, type MapTileStyle as ao, type MarkerStyle as ap, type MatrixBlockInput as aq, type MediaClip as ar, type MediaCrop as as, type MediaCut as at, type MediaEdits as au, type MediaOnlyInput as av, type MediaScheduleOptions as aw, type MermaidLayer as ax, type MotionEntrance as ay, type MotionOrigin as az, type AmbientGradientConfig as b, type TitleCaptionConfig as b$, type PageSectionKind as b0, type PageSectionOverride as b1, type PageTokens as b2, type PageVariant as b3, type PathLayer as b4, type PatternBackgroundConfig as b5, type PersistentLayer as b6, type PersistentLayerConfig as b7, type PersistentLayerTemplate as b8, type PersistentLayerTemplateConfig as b9, type SvgLayer as bA, THEME_SCHEMA_VERSION as bB, type TableLayer as bC, type TableLayerStyle as bD, type TemplateBlock as bE, type TemplateContext as bF, type TemplateFunction as bG, type TemplateRegistry as bH, type TextFlow as bI, type TextLayer as bJ, type TextParagraph as bK, type TextParagraphList as bL, type TextStyle as bM, type Theme as bN, type ThemeColorPalette as bO, type ThemeColorScheme as bP, type ThemePageStyle as bQ, type ThemeRegistry as bR, type ThemeSchemaVersion as bS, type ThemeSeedColors as bT, type ThemeStyle as bU, type ThemeTypography as bV, type TimelineBlockInput as bW, type TimelineTemplateEvent as bX, type TimelineTemplateLink as bY, type TimelineTemplateTrack as bZ, type TitleBlockInput as b_, type PersistentLayerTemplateType as ba, type PhotoGridInput as bb, type PieChartInput as bc, type PipStyle as bd, type Position as be, type PresentationSlideMark as bf, type ProcessBlockInput as bg, type ProgressIndicatorConfig as bh, type PromotedBodyAnnotation as bi, type PullQuoteInput as bj, type PyramidBlockInput as bk, type QuoteBlockInput as bl, type RawLayersInput as bm, type RenderStyle as bn, type RightFeatureInput as bo, type ScatterChartInput as bp, type ScheduledClip as bq, type SectionHeaderInput as br, type ShapeFilter as bs, type ShapeLayer as bt, type ShapePattern as bu, type SolidBackgroundConfig as bv, type StartBlockConfig as bw, type StatHighlightInput as bx, type StatsBlockInput as by, type SurfaceScheme as bz, type Animation as c, mediaEditValuesFromParams as c$, type TopFeatureInput as c0, type TranscriptBlockInput as c1, type TreeBlockInput as c2, type TreeLayer as c3, type TreeLayerItem as c4, type TreeLayerStyle as c5, type TreeTemplateItem as c6, type TwoColumnInput as c7, VIEWPORT_PRESETS as c8, type VennBlockInput as c9, getTwoColumnPositions as cA, getViewport as cB, getViewportOrientation as cC, isCustomTemplateDefinition as cD, isMotionProfileName as cE, isPersistentLayerTemplate as cF, isTemplateBlock as cG, scaledFontSize$1 as cH, readFrontmatterMotion as cI, resolveMediaSchedule as cJ, resolveMotionForDoc as cK, resolveMotionProfile as cL, scaledFontSize as cM, scheduleMediaClip as cN, validateCustomTemplateDefinition as cO, type MediaFxOpId as cP, type MediaFxChain as cQ, MEDIA_EDIT_PARAMS as cR, MEDIA_FX_ORDER as cS, MEDIA_FX_SPECS as cT, type MediaEditParamKey as cU, type MediaEditParamValues as cV, type MediaFxOp as cW, formatMediaNumber as cX, hasRenderableFx as cY, mediaEditHtmlAttribute as cZ, mediaEditValuesFromAttributes as c_, type VideoEmbedLayer as ca, type VideoLayer as cb, type VideoPipPosition as cc, type VideoPipShape as cd, type VideoPipSize as ce, type VideoPlacement as cf, type VideoPresentation as cg, type VideoPullQuoteInput as ch, type VideoWithCaptionInput as ci, type ViewportConfig as cj, type ViewportOrientation as ck, type ViewportPreset as cl, type VignetteConfig as cm, applySurface as cn, calculateDuration as co, calculateFontScale as cp, createTemplateContext as cq, createTheme as cr, createThemeRegistry as cs, getAspectRatioString as ct, getBlockAtTime as cu, getCaptionAtTime as cv, getDocPlaybackDuration as cw, getLayoutHints as cx, getSafeTextBounds as cy, getSegmentAtTime as cz, type AnimationType as d, mediaRenderKey as d0, normalizeMediaCrop as d1, normalizeMediaCuts as d2, parseMediaCrop as d3, parseMediaCuts as d4, parseMediaEdits as d5, parseMediaFx as d6, serializeMediaCrop as d7, serializeMediaCuts as d8, serializeMediaEdits as d9, serializeMediaFx as da, 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 CardsBlockInput as q, type ChartBaseFields as r, type ChartTemplateInput as s, type ColorScheme as t, type ColumnChartInput as u, type ComparisonBarInput as v, type ContentBlockInput as w, type CornerBrandingConfig as x, type CountUpSpec as y, type CreateTemplateContextOptions as z };
3611
+ export { FRONTMATTER_MOTION_KEY as $, type AccentImage as A, type BarChartInput as B, type CaptionPhrase as C, type CustomTemplateDefinition as D, type CustomTemplateLayer as E, type CustomTemplateValidationError as F, type CustomTemplateValidationResult as G, type CycleBlockInput as H, DARK_SURFACE as I, DEFAULT_DOC_FONT as J, DEFAULT_TITLE_FONT as K, type DataTableInput as L, type DateEventInput as M, type DeepPartial as N, type DefinitionCardInput as O, type DiagramBlockInput as P, type DiagramEdgeAnchor as Q, type DiagramTemplateEdge as R, type DiagramTemplateNode as S, type DiagramTemplateNodeInput as T, type Doc as U, type DocBlock as V, type DocDiagnostic as W, type DonutChartInput as X, type DrawingBlockInput as Y, FRONTMATTER_CUSTOM_TEMPLATES_KEY as Z, FRONTMATTER_CUSTOM_THEMES_KEY as _, type AccentPosition as a, type PageHeadingTreatment as a$, type FactCardInput as a0, type FontFamily as a1, type FontFamilyKind as a2, type FullBleedQuoteInput as a3, type FunnelBlockInput as a4, type GradientBackgroundConfig as a5, type HubBlockInput as a6, type ImageBackgroundConfig as a7, type ImageLayer as a8, type ImageTreatment as a9, type MotionProfile as aA, type MotionProfileName as aB, type MotionSpec as aC, type MotionState as aD, PAGE_ACCENT_STRATEGIES as aE, PAGE_BACKGROUNDS as aF, PAGE_BACKGROUND_RHYTHMS as aG, PAGE_DESIGN_FAMILIES as aH, PAGE_DIVIDERS as aI, PAGE_EMPHASES as aJ, PAGE_EYEBROWS as aK, PAGE_HEADING_CASES as aL, PAGE_HEADING_SCALES as aM, PAGE_HEADING_UNDERLINES as aN, PAGE_HERO_STYLES as aO, PAGE_IMAGE_FRAMINGS as aP, PAGE_NUMERAL_STYLES as aQ, PAGE_PATTERNS as aR, PAGE_QUOTE_MARKS as aS, PAGE_SECTION_KINDS as aT, PAGE_SECTION_SPACINGS as aU, PAGE_SHADOWS as aV, PAGE_VARIANTS as aW, type PageAccentRotation as aX, type PageBackground as aY, type PageDesignFamily as aZ, type PageEmphasis as a_, type ImageWithCaptionInput as aa, LIGHT_SURFACE as ab, type Layer as ac, type LayerRepeat as ad, type LayersBlockInput as ae, type LayoutHints as af, type LeftFeatureInput as ag, type LineChartInput as ah, type LinearGradient as ai, type ListBlockInput as aj, MOTION_PROFILES as ak, type MapBlockInput as al, type MapLayer as am, type MapMarker as an, type MapTileStyle as ao, type MarkerStyle as ap, type MatrixBlockInput as aq, type MediaClip as ar, type MediaCrop as as, type MediaCut as at, type MediaEdits as au, type MediaOnlyInput as av, type MediaScheduleOptions as aw, type MermaidLayer as ax, type MotionEntrance as ay, type MotionOrigin as az, type AmbientGradientConfig as b, type TitleCaptionConfig as b$, type PageSectionKind as b0, type PageSectionOverride as b1, type PageTokens as b2, type PageVariant as b3, type PathLayer as b4, type PatternBackgroundConfig as b5, type PersistentLayer as b6, type PersistentLayerConfig as b7, type PersistentLayerTemplate as b8, type PersistentLayerTemplateConfig as b9, type SvgLayer as bA, THEME_SCHEMA_VERSION as bB, type TableLayer as bC, type TableLayerStyle as bD, type TemplateBlock as bE, type TemplateContext as bF, type TemplateFunction as bG, type TemplateRegistry as bH, type TextFlow as bI, type TextLayer as bJ, type TextParagraph as bK, type TextParagraphList as bL, type TextStyle as bM, type Theme as bN, type ThemeColorPalette as bO, type ThemeColorScheme as bP, type ThemePageStyle as bQ, type ThemeRegistry as bR, type ThemeSchemaVersion as bS, type ThemeSeedColors as bT, type ThemeStyle as bU, type ThemeTypography as bV, type TimelineBlockInput as bW, type TimelineTemplateEvent as bX, type TimelineTemplateLink as bY, type TimelineTemplateTrack as bZ, type TitleBlockInput as b_, type PersistentLayerTemplateType as ba, type PhotoGridInput as bb, type PieChartInput as bc, type PipStyle as bd, type Position as be, type PresentationSlideMark as bf, type ProcessBlockInput as bg, type ProgressIndicatorConfig as bh, type PromotedBodyAnnotation as bi, type PullQuoteInput as bj, type PyramidBlockInput as bk, type QuoteBlockInput as bl, type RawLayersInput as bm, type RenderStyle as bn, type RightFeatureInput as bo, type ScatterChartInput as bp, type ScheduledClip as bq, type SectionHeaderInput as br, type ShapeFilter as bs, type ShapeLayer as bt, type ShapePattern as bu, type SolidBackgroundConfig as bv, type StartBlockConfig as bw, type StatHighlightInput as bx, type StatsBlockInput as by, type SurfaceScheme as bz, type Animation as c, mediaEditHtmlAttribute as c$, type TopFeatureInput as c0, type TranscriptBlockInput as c1, type TreeBlockInput as c2, type TreeLayer as c3, type TreeLayerItem as c4, type TreeLayerStyle as c5, type TreeTemplateItem as c6, type TwoColumnInput as c7, VIEWPORT_PRESETS as c8, type VennBlockInput as c9, getTwoColumnPositions as cA, getViewport as cB, getViewportOrientation as cC, isCustomTemplateDefinition as cD, isMotionProfileName as cE, isPersistentLayerTemplate as cF, isTemplateBlock as cG, scaledFontSize$1 as cH, readFrontmatterMotion as cI, resolveMediaSchedule as cJ, resolveMotionForDoc as cK, resolveMotionProfile as cL, scaledFontSize as cM, scheduleMediaClip as cN, taskMarker as cO, validateCustomTemplateDefinition as cP, type MediaFxOpId as cQ, type MediaFxChain as cR, MEDIA_EDIT_PARAMS as cS, MEDIA_FX_ORDER as cT, MEDIA_FX_SPECS as cU, type MediaEditParamKey as cV, type MediaEditParamValues as cW, type MediaFxOp as cX, canonicalMediaFx as cY, formatMediaNumber as cZ, hasRenderableFx as c_, type VideoEmbedLayer as ca, type VideoLayer as cb, type VideoPipPosition as cc, type VideoPipShape as cd, type VideoPipSize as ce, type VideoPlacement as cf, type VideoPresentation as cg, type VideoPullQuoteInput as ch, type VideoWithCaptionInput as ci, type ViewportConfig as cj, type ViewportOrientation as ck, type ViewportPreset as cl, type VignetteConfig as cm, applySurface as cn, calculateDuration as co, calculateFontScale as cp, createTemplateContext as cq, createTheme as cr, createThemeRegistry as cs, getAspectRatioString as ct, getBlockAtTime as cu, getCaptionAtTime as cv, getDocPlaybackDuration as cw, getLayoutHints as cx, getSafeTextBounds as cy, getSegmentAtTime as cz, type AnimationType as d, mediaEditValuesFromAttributes as d0, mediaEditValuesFromParams as d1, mediaRecipeHash as d2, mediaRenderKey as d3, normalizeMediaCrop as d4, normalizeMediaCuts as d5, parseMediaCrop as d6, parseMediaCuts as d7, parseMediaEdits as d8, parseMediaFx as d9, serializeMediaCrop as da, serializeMediaCuts as db, serializeMediaEdits as dc, serializeMediaFx as dd, 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 CardsBlockInput as q, type ChartBaseFields as r, type ChartTemplateInput as s, type ColorScheme as t, type ColumnChartInput as u, type ComparisonBarInput as v, type ContentBlockInput as w, type CornerBrandingConfig as x, type CountUpSpec as y, type CreateTemplateContextOptions as z };
@@ -1,4 +1,4 @@
1
- import { a8 as ImageLayer, bJ as TextLayer, bt as ShapeLayer, b4 as PathLayer } from './Doc-C_Sh49ot.js';
1
+ import { a8 as ImageLayer, bJ as TextLayer, bt as ShapeLayer, b4 as PathLayer } from './Doc-DLfTam0R.js';
2
2
 
3
3
  /**
4
4
  * ImageEditDoc — JSON document describing a layered, editable image.
@@ -15,7 +15,7 @@ import {
15
15
  presentationBeatExtras,
16
16
  presentationLayoutFits,
17
17
  presentationStat
18
- } from "./chunk-4HQ7QZKB.js";
18
+ } from "./chunk-BG2OYBGC.js";
19
19
  import {
20
20
  deriveTemplateInputs,
21
21
  extractConceptItems,
@@ -32,7 +32,7 @@ import {
32
32
  isTreeFence,
33
33
  matchNumberHighlight,
34
34
  shapeIsStated
35
- } from "./chunk-OFE5RZWW.js";
35
+ } from "./chunk-MA7XUCSQ.js";
36
36
  import {
37
37
  extractContent,
38
38
  mapElementToBlock,
@@ -45,9 +45,10 @@ import {
45
45
  } from "./chunk-JNUNNQ74.js";
46
46
  import {
47
47
  parseMarkdown
48
- } from "./chunk-DDJHIZED.js";
48
+ } from "./chunk-NBDF6SQ5.js";
49
49
  import {
50
- isContainerTemplate
50
+ isContainerTemplate,
51
+ resolveTemplateName
51
52
  } from "./chunk-UDPPWYYM.js";
52
53
  import {
53
54
  extractPlainText,
@@ -1769,6 +1770,7 @@ var pointText = (text2) => clip(text2, Infinity, 180);
1769
1770
  var captionText = (text2) => clip(text2, 18, 110);
1770
1771
  var FEATURE_POINTS = 2;
1771
1772
  var FEATURE_POINT_CHARACTERS = 100;
1773
+ var HAND_DRAWN_TEMPLATES = /* @__PURE__ */ new Set(["drawing", "layout"]);
1772
1774
  function featurePointText(text2) {
1773
1775
  const clean = text2.replace(/\s+/gu, " ").trim();
1774
1776
  if (clean.length <= FEATURE_POINT_CHARACTERS) return clean;
@@ -1878,7 +1880,7 @@ function createPresentationPlan(doc, hints = defaultPresentationHints()) {
1878
1880
  );
1879
1881
  const drawnLists = new Set(
1880
1882
  flattenRenderableBlocks(doc.blocks).filter(
1881
- (block) => !!conceptTemplate(block.template ?? "") && block.contents?.length === 1 && block.contents[0].type === "list"
1883
+ (block) => !!conceptTemplate(block.template ?? "") && block.contents?.length === 1 && block.contents[0].type === "list" || !block.autoTemplate && HAND_DRAWN_TEMPLATES.has(resolveTemplateName(block.template ?? "")) && !!block.children?.length
1882
1884
  ).map((block) => block.id)
1883
1885
  );
1884
1886
  const beats = [];
@@ -2131,9 +2133,13 @@ function createPresentationPlan(doc, hints = defaultPresentationHints()) {
2131
2133
  if (refs.length) beat.media = refs;
2132
2134
  });
2133
2135
  }
2136
+ const mediaKinds = new Map(
2137
+ [...sectionMedia.values()].flatMap((items) => items.map((item) => [item.ref, item.kind]))
2138
+ );
2134
2139
  for (const beat of beats) {
2135
2140
  if (!beat.media) continue;
2136
- if (!worded.has(beat.id)) {
2141
+ const drawn = !!conceptTemplate(beat.layout) && !beat.media.some((ref) => mediaKinds.get(ref) === "table");
2142
+ if (!worded.has(beat.id) && !drawn) {
2137
2143
  const points = beat.points.slice(0, FEATURE_POINTS);
2138
2144
  beat.points = suggested.has(beat.id) ? points : points.map(featurePointText);
2139
2145
  }
@@ -202,9 +202,14 @@ function fnv1a64Hex(text) {
202
202
  return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0");
203
203
  }
204
204
  function mediaRenderKey(src, fx) {
205
- const canonical = fx.ops.map((op) => `${op.id}:${formatMediaNumber(op.value)}`).join(" ");
206
- return fnv1a64Hex(`${src}
207
- ${canonical}`).slice(0, 12);
205
+ return mediaRecipeHash(`${src}
206
+ ${canonicalMediaFx(fx)}`);
207
+ }
208
+ function canonicalMediaFx(fx) {
209
+ return fx.ops.map((op) => `${op.id}:${formatMediaNumber(op.value)}`).join(" ");
210
+ }
211
+ function mediaRecipeHash(text) {
212
+ return fnv1a64Hex(text).slice(0, 12);
208
213
  }
209
214
 
210
215
  export {
@@ -226,5 +231,7 @@ export {
226
231
  serializeMediaEdits,
227
232
  mediaEditValuesFromParams,
228
233
  mediaEditValuesFromAttributes,
229
- mediaRenderKey
234
+ mediaRenderKey,
235
+ canonicalMediaFx,
236
+ mediaRecipeHash
230
237
  };
@@ -0,0 +1,42 @@
1
+ // src/schemas/Doc.ts
2
+ function taskMarker(checked) {
3
+ return checked ? "\u2611" : "\u2610";
4
+ }
5
+ function calculateDuration(audio) {
6
+ return audio.segments.reduce((sum, seg) => sum + seg.duration, 0);
7
+ }
8
+ function getSegmentAtTime(audio, time) {
9
+ let elapsed = 0;
10
+ for (let i = 0; i < audio.segments.length; i++) {
11
+ elapsed += audio.segments[i].duration;
12
+ if (time < elapsed) return i;
13
+ }
14
+ return audio.segments.length - 1;
15
+ }
16
+ var BLOCK_START_TOLERANCE = 1e-3;
17
+ function getBlockAtTime(blocks, time) {
18
+ for (let i = blocks.length - 1; i >= 0; i--) {
19
+ const block = blocks[i];
20
+ if (time + BLOCK_START_TOLERANCE >= block.startTime && time < block.startTime + block.duration) {
21
+ return block;
22
+ }
23
+ }
24
+ return blocks[0] || null;
25
+ }
26
+ function getCaptionAtTime(captions, time) {
27
+ if (!captions || !captions.phrases.length) return null;
28
+ for (const phrase of captions.phrases) {
29
+ if (time >= phrase.startTime && time < phrase.endTime) {
30
+ return phrase;
31
+ }
32
+ }
33
+ return null;
34
+ }
35
+
36
+ export {
37
+ taskMarker,
38
+ calculateDuration,
39
+ getSegmentAtTime,
40
+ getBlockAtTime,
41
+ getCaptionAtTime
42
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defaultPageStyle
3
- } from "./chunk-2SRF5III.js";
3
+ } from "./chunk-BVL3F64S.js";
4
4
  import {
5
5
  FONT_FALLBACKS,
6
6
  THEME_SCHEMA_VERSION,
@@ -21,38 +21,6 @@ import {
21
21
  parseBuildSpec
22
22
  } from "./chunk-P53Z4RYC.js";
23
23
 
24
- // src/schemas/Doc.ts
25
- function calculateDuration(audio) {
26
- return audio.segments.reduce((sum, seg) => sum + seg.duration, 0);
27
- }
28
- function getSegmentAtTime(audio, time) {
29
- let elapsed = 0;
30
- for (let i = 0; i < audio.segments.length; i++) {
31
- elapsed += audio.segments[i].duration;
32
- if (time < elapsed) return i;
33
- }
34
- return audio.segments.length - 1;
35
- }
36
- var BLOCK_START_TOLERANCE = 1e-3;
37
- function getBlockAtTime(blocks, time) {
38
- for (let i = blocks.length - 1; i >= 0; i--) {
39
- const block = blocks[i];
40
- if (time + BLOCK_START_TOLERANCE >= block.startTime && time < block.startTime + block.duration) {
41
- return block;
42
- }
43
- }
44
- return blocks[0] || null;
45
- }
46
- function getCaptionAtTime(captions, time) {
47
- if (!captions || !captions.phrases.length) return null;
48
- for (const phrase of captions.phrases) {
49
- if (time >= phrase.startTime && time < phrase.endTime) {
50
- return phrase;
51
- }
52
- }
53
- return null;
54
- }
55
-
56
24
  // src/schemas/validateDoc.ts
57
25
  var LAYER_TYPES = /* @__PURE__ */ new Set([
58
26
  "image",
@@ -765,12 +733,18 @@ function buildMermaidThemeVariables(theme) {
765
733
  });
766
734
  return variables;
767
735
  }
736
+ var PAGE_LABELS = [".edgeLabel", ".icon-shape .label", ".image-shape .label"];
737
+ var PLAIN_CSS_COLOR = /^[\w\s#%(),./-]+$/;
738
+ function buildMermaidThemeCss(theme) {
739
+ const color = theme.colors.text.trim();
740
+ if (!PLAIN_CSS_COLOR.test(color)) return "";
741
+ const html = PAGE_LABELS.map((label) => `${label} span`).join(", ");
742
+ const svg = PAGE_LABELS.map((label) => `${label} text`).join(", ");
743
+ return `${html} { color: ${color}; }
744
+ ${svg} { fill: ${color}; }`;
745
+ }
768
746
 
769
747
  export {
770
- calculateDuration,
771
- getSegmentAtTime,
772
- getBlockAtTime,
773
- getCaptionAtTime,
774
748
  validateDocSchema,
775
749
  assertDocSchema,
776
750
  pipStyleVars,
@@ -780,5 +754,6 @@ export {
780
754
  compileTheme,
781
755
  parseTheme,
782
756
  serializeTheme,
783
- buildMermaidThemeVariables
757
+ buildMermaidThemeVariables,
758
+ buildMermaidThemeCss
784
759
  };
@@ -38,7 +38,7 @@ import {
38
38
  timelineItems,
39
39
  treeToTemplateData,
40
40
  vennOverlapIndex
41
- } from "./chunk-OFE5RZWW.js";
41
+ } from "./chunk-MA7XUCSQ.js";
42
42
  import {
43
43
  anchorPoint,
44
44
  base64ToUtf8,
@@ -71,6 +71,15 @@ import {
71
71
  validateTheme,
72
72
  withAlpha
73
73
  } from "./chunk-JNUNNQ74.js";
74
+ import {
75
+ taskMarker
76
+ } from "./chunk-4R3YZTPX.js";
77
+ import {
78
+ createMediaTimeMap
79
+ } from "./chunk-MTIR5PWF.js";
80
+ import {
81
+ normalizeMediaCuts
82
+ } from "./chunk-37RLFDIT.js";
74
83
  import {
75
84
  TABLE_FED_TEMPLATES,
76
85
  isContainerTemplate,
@@ -10419,8 +10428,9 @@ function drawingBlock(input, context) {
10419
10428
  const defaultStroke = input.stroke ?? colors.text ?? theme.colors.text;
10420
10429
  const defaultFill = input.fill ?? "none";
10421
10430
  const layout = computeDrawingLayout(children);
10431
+ const background = createBackgroundLayer("bg", theme.colors.background);
10422
10432
  if (layout.shapes.length === 0 && layout.connectors.length === 0) {
10423
- return [emptyHint(input, context)];
10433
+ return [background, emptyHint(input, context)];
10424
10434
  }
10425
10435
  const minX = Math.min(...layout.shapes.map((s) => s.x));
10426
10436
  const maxX = Math.max(...layout.shapes.map((s) => s.x + s.width));
@@ -10434,7 +10444,7 @@ function drawingBlock(input, context) {
10434
10444
  const tx = (x) => offsetX + (x - minX) * scale;
10435
10445
  const ty = (y) => offsetY + (y - minY) * scale;
10436
10446
  const fontAdj = Math.min(Math.max(scale, 1), 1.5);
10437
- const layers = [];
10447
+ const layers = [background];
10438
10448
  if (input.title) {
10439
10449
  const titleLayer = canvasTitleLayer("drawing-title", input.title, frame2, placement, context);
10440
10450
  if (titleLayer) layers.push(titleLayer);
@@ -10801,7 +10811,8 @@ function round3(n) {
10801
10811
  function layoutBlock(input, context) {
10802
10812
  const { theme, viewport, children = [] } = context;
10803
10813
  const { layers } = computeLayoutLayers(children, viewport, { ink: theme.colors.text });
10804
- return layers.length > 0 ? layers : [emptyHint2(input, context)];
10814
+ const background = createBackgroundLayer("bg", theme.colors.background);
10815
+ return [background, ...layers.length > 0 ? layers : [emptyHint2(input, context)]];
10805
10816
  }
10806
10817
  function emptyHint2(input, context) {
10807
10818
  return {
@@ -12500,7 +12511,42 @@ function applyEmbeddedVideoTiming(layers, block) {
12500
12511
  };
12501
12512
  });
12502
12513
  }
12514
+ function applyEmbeddedVideoEdits(layers, block) {
12515
+ const editedBySrc = new Map(
12516
+ extractEmbeddedVideos(block.contents).filter((video) => video.edits).map((video) => [video.src, video])
12517
+ );
12518
+ if (editedBySrc.size === 0) return layers;
12519
+ return layers.map((layer) => {
12520
+ if (layer.type !== "video") return layer;
12521
+ const video = editedBySrc.get(layer.content.src);
12522
+ if (!video?.edits) return layer;
12523
+ const { fx, gain, fadeIn, fadeOut, crop } = video.edits;
12524
+ const edits = {
12525
+ ...fx ? { fx } : {},
12526
+ ...gain ? { gain } : {},
12527
+ ...fadeIn ? { fadeIn } : {},
12528
+ ...fadeOut ? { fadeOut } : {},
12529
+ ...crop ? { crop } : {}
12530
+ };
12531
+ const hasEdits = Object.keys(edits).length > 0;
12532
+ const withEdits = (content) => hasEdits ? { ...layer, content: { ...content, edits } } : content === layer.content ? layer : { ...layer, content };
12533
+ if (!video.cuts?.length) return withEdits(layer.content);
12534
+ const { clipStart } = layer.content;
12535
+ const clipEnd = video.clipEnd != null ? layer.content.clipEnd : createMediaTimeMap({ clipStart, cuts: video.cuts }).playedToSource(
12536
+ Math.max(0, layer.content.clipEnd - clipStart)
12537
+ );
12538
+ const cuts = normalizeMediaCuts(video.cuts, clipStart, clipEnd);
12539
+ if (cuts.length === 0) return withEdits(layer.content);
12540
+ return withEdits({ ...layer.content, clipEnd, cuts });
12541
+ });
12542
+ }
12503
12543
  function appendRichContentLayers(layers, block, theme, viewport, mediaAspectRatios) {
12544
+ return applyEmbeddedVideoEdits(
12545
+ placeRichContentLayers(layers, block, theme, viewport, mediaAspectRatios),
12546
+ block
12547
+ );
12548
+ }
12549
+ function placeRichContentLayers(layers, block, theme, viewport, mediaAspectRatios) {
12504
12550
  const timedLayers = applyEmbeddedVideoTiming(layers, block);
12505
12551
  const items = collectRichMediaItems(timedLayers, block);
12506
12552
  if (items.length === 0) return timedLayers;
@@ -14714,6 +14760,64 @@ function detectPromotableBodyAnnotation(contents) {
14714
14760
  return { data, strippedContents };
14715
14761
  }
14716
14762
 
14763
+ // src/doc/videoTiming.ts
14764
+ function clipEndsWithBlock(clip) {
14765
+ return clip.kind === "video" && clip.anchor === "block" && clip.spillover !== true && clip.lockToBlock !== false;
14766
+ }
14767
+ function blockVideos(block) {
14768
+ const body = extractEmbeddedVideos(block.contents).map((video) => ({
14769
+ src: video.src,
14770
+ startAt: video.startAt,
14771
+ clipStart: video.clipStart,
14772
+ clipEnd: video.clipEnd,
14773
+ cuts: video.cuts
14774
+ }));
14775
+ const clips = (block.media ?? []).filter(clipEndsWithBlock).map((clip) => ({
14776
+ src: clip.src,
14777
+ startAt: clip.startAt,
14778
+ clipStart: clip.clipStart,
14779
+ clipEnd: clip.clipEnd,
14780
+ cuts: clip.edits?.cuts
14781
+ }));
14782
+ return [...body, ...clips];
14783
+ }
14784
+ function knownLength(seconds) {
14785
+ return seconds != null && Number.isFinite(seconds) && seconds > 0 ? seconds : void 0;
14786
+ }
14787
+ function videoEnd(video, lookup) {
14788
+ const sourceDuration = knownLength(lookup?.(video.src));
14789
+ if (video.clipEnd == null && sourceDuration == null) return null;
14790
+ const played = createMediaTimeMap({
14791
+ clipStart: video.clipStart,
14792
+ clipEnd: video.clipEnd,
14793
+ cuts: video.cuts,
14794
+ sourceDuration
14795
+ }).playedDuration;
14796
+ if (!Number.isFinite(played) || played <= 0) return null;
14797
+ return Math.max(0, video.startAt ?? 0) + played;
14798
+ }
14799
+ function blockVideoLength(block, lookup) {
14800
+ let longest = null;
14801
+ for (const video of blockVideos(block)) {
14802
+ const end = videoEnd(video, lookup);
14803
+ if (end != null && (longest == null || end > longest)) longest = end;
14804
+ }
14805
+ return longest;
14806
+ }
14807
+ function collectVideoDurationSources(doc) {
14808
+ const sources = /* @__PURE__ */ new Set();
14809
+ const visit = (blocks) => {
14810
+ for (const block of blocks) {
14811
+ for (const video of blockVideos(block)) {
14812
+ if (video.clipEnd == null && video.src) sources.add(video.src);
14813
+ }
14814
+ if (block.children?.length) visit(block.children);
14815
+ }
14816
+ };
14817
+ visit(doc.blocks);
14818
+ return [...sources];
14819
+ }
14820
+
14717
14821
  // src/doc/markdownToDoc.ts
14718
14822
  var SLUG_NON_WORD_RE = /[^\w\s-]/g;
14719
14823
  var SLUG_SPACES_RE = /[\s_]+/g;
@@ -14979,46 +15083,13 @@ function markdownToDoc(markdownDoc, options) {
14979
15083
  }
14980
15084
  }
14981
15085
  const minDuration = 3;
14982
- const phrases = [];
14983
15086
  for (const block of allBlocks) {
14984
15087
  if (pinnedMeta(block).duration != null) continue;
14985
15088
  const bodyText3 = getBlockBodyText2(block);
14986
- if (bodyText3.length > 0) {
14987
- const estimate = estimateReadingTime(bodyText3);
14988
- block.duration = Math.max(minDuration, estimate.seconds);
14989
- } else {
14990
- block.duration = defaultDuration;
14991
- }
14992
- }
14993
- let currentTime = 0;
14994
- for (const block of allBlocks) {
14995
- const explicitStart = pinnedMeta(block).startTime;
14996
- if (explicitStart == null) {
14997
- block.startTime = currentTime;
14998
- }
14999
- const bodyText3 = getBlockBodyText2(block);
15000
- if (bodyText3.length > 0) {
15001
- const sentences = splitIntoSentences(bodyText3);
15002
- if (sentences.length > 0) {
15003
- const timePerSentence = block.duration / sentences.length;
15004
- for (let i = 0; i < sentences.length; i++) {
15005
- phrases.push({
15006
- text: sentences[i],
15007
- startTime: currentTime + i * timePerSentence,
15008
- endTime: currentTime + (i + 1) * timePerSentence,
15009
- audioSegment: 0
15010
- });
15011
- }
15012
- }
15013
- }
15014
- currentTime += block.duration;
15015
- }
15016
- const blockById = new Map(allBlocks.map((block) => [block.id, block]));
15017
- for (const clip of documentMedia) {
15018
- if (clip.lockToBlock === false && clip.origin?.format === "html" && !/\bdata-squisq-video-start-at\s*=/i.test(clip.origin.raw ?? "")) {
15019
- clip.startAt = blockById.get(clip.origin.blockId)?.startTime ?? 0;
15020
- }
15089
+ const estimate = bodyText3.length > 0 ? Math.max(minDuration, estimateReadingTime(bodyText3).seconds) : defaultDuration;
15090
+ block.duration = Math.max(estimate, blockVideoLength(block) ?? 0);
15021
15091
  }
15092
+ const { phrases, duration: totalDuration } = sequenceBlockTimeline(allBlocks, documentMedia);
15022
15093
  const captions = phrases.length > 0 ? {
15023
15094
  phrases,
15024
15095
  ...options?.captionsGeneratedAt ? { generatedAt: options.captionsGeneratedAt } : {},
@@ -15030,7 +15101,7 @@ function markdownToDoc(markdownDoc, options) {
15030
15101
  const motion = readFrontmatterMotion(markdownDoc.frontmatter);
15031
15102
  const doc = {
15032
15103
  articleId,
15033
- duration: currentTime,
15104
+ duration: totalDuration,
15034
15105
  blocks: rootBlocks,
15035
15106
  audio: {
15036
15107
  segments: []
@@ -15052,6 +15123,64 @@ function markdownToDoc(markdownDoc, options) {
15052
15123
  }
15053
15124
  return doc;
15054
15125
  }
15126
+ function sequenceBlockTimeline(blocks, documentMedia) {
15127
+ const phrases = [];
15128
+ let currentTime = 0;
15129
+ for (const block of blocks) {
15130
+ const explicitStart = pinnedMeta(block).startTime;
15131
+ if (explicitStart == null) {
15132
+ block.startTime = currentTime;
15133
+ }
15134
+ const bodyText3 = getBlockBodyText2(block);
15135
+ if (bodyText3.length > 0) {
15136
+ const sentences = splitIntoSentences(bodyText3);
15137
+ if (sentences.length > 0) {
15138
+ const timePerSentence = block.duration / sentences.length;
15139
+ for (let i = 0; i < sentences.length; i++) {
15140
+ phrases.push({
15141
+ text: sentences[i],
15142
+ startTime: currentTime + i * timePerSentence,
15143
+ endTime: currentTime + (i + 1) * timePerSentence,
15144
+ audioSegment: 0
15145
+ });
15146
+ }
15147
+ }
15148
+ }
15149
+ currentTime += block.duration;
15150
+ }
15151
+ const blockById = new Map(blocks.map((block) => [block.id, block]));
15152
+ for (const clip of documentMedia) {
15153
+ if (clip.lockToBlock === false && clip.origin?.format === "html" && !/\bdata-squisq-video-start-at\s*=/i.test(clip.origin.raw ?? "")) {
15154
+ clip.startAt = blockById.get(clip.origin.blockId)?.startTime ?? 0;
15155
+ }
15156
+ }
15157
+ return { phrases, duration: currentTime };
15158
+ }
15159
+ var VIDEO_FLOOR_EPSILON = 1e-3;
15160
+ function applyVideoDurations(doc, lookup) {
15161
+ const grownBy = /* @__PURE__ */ new Map();
15162
+ for (const block of flattenBlocks(doc.blocks)) {
15163
+ if (pinnedMeta(block).duration != null) continue;
15164
+ const floor = blockVideoLength(block, lookup);
15165
+ if (floor != null && floor > block.duration + VIDEO_FLOOR_EPSILON) grownBy.set(block, floor);
15166
+ }
15167
+ if (grownBy.size === 0) return doc;
15168
+ const copy = (blocks2) => blocks2.map((block) => ({
15169
+ ...block,
15170
+ ...grownBy.has(block) ? { duration: grownBy.get(block) } : {},
15171
+ ...block.children ? { children: copy(block.children) } : {}
15172
+ }));
15173
+ const blocks = copy(doc.blocks);
15174
+ const documentMedia = doc.documentMedia?.map((clip) => ({ ...clip }));
15175
+ const { phrases, duration } = sequenceBlockTimeline(flattenBlocks(blocks), documentMedia ?? []);
15176
+ return {
15177
+ ...doc,
15178
+ blocks,
15179
+ duration,
15180
+ ...doc.captions ? { captions: { ...doc.captions, phrases } } : {},
15181
+ ...documentMedia ? { documentMedia } : {}
15182
+ };
15183
+ }
15055
15184
  function flattenBlocks(blocks) {
15056
15185
  const result = [];
15057
15186
  for (const block of blocks) {
@@ -15739,10 +15868,16 @@ function listParagraphs(list, level = 0) {
15739
15868
  const ordered = Boolean(list.ordered);
15740
15869
  return list.children.flatMap((item, index) => {
15741
15870
  const ownText = item.children.filter((node) => node.type !== "list").map((node) => extractPlainText(node).trim()).filter(Boolean).join(" ");
15871
+ const checked = typeof item.checked === "boolean" ? { checked: item.checked } : {};
15742
15872
  const paragraphs = ownText ? [
15743
15873
  {
15744
15874
  text: ownText,
15745
- list: { ordered, level, ...ordered ? { number: (list.start ?? 1) + index } : {} }
15875
+ list: {
15876
+ ordered,
15877
+ level,
15878
+ ...ordered ? { number: (list.start ?? 1) + index } : {},
15879
+ ...checked
15880
+ }
15746
15881
  }
15747
15882
  ] : [];
15748
15883
  for (const child of item.children) {
@@ -15753,7 +15888,7 @@ function listParagraphs(list, level = 0) {
15753
15888
  }
15754
15889
  function plainParagraphText({ text: text2, list }) {
15755
15890
  if (!list) return text2;
15756
- const marker = list.ordered ? `${list.number ?? 1}.` : "\u2022";
15891
+ const marker = list.checked !== void 0 ? taskMarker(list.checked) : list.ordered ? `${list.number ?? 1}.` : "\u2022";
15757
15892
  return `${" ".repeat(list.level)}${marker} ${text2}`;
15758
15893
  }
15759
15894
  function completeBodyParagraphs(nodes) {
@@ -15985,8 +16120,11 @@ export {
15985
16120
  getAvailableTemplates,
15986
16121
  hasTemplate,
15987
16122
  detectPromotableBodyAnnotation,
16123
+ blockVideoLength,
16124
+ collectVideoDurationSources,
15988
16125
  getPinnedBlockMeta,
15989
16126
  markdownToDoc,
16127
+ applyVideoDurations,
15990
16128
  flattenBlocks,
15991
16129
  flattenRenderableBlocks,
15992
16130
  countBlocks,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createMediaTimeMap
3
- } from "./chunk-JSGIWW35.js";
3
+ } from "./chunk-MTIR5PWF.js";
4
4
 
5
5
  // src/schemas/Media.ts
6
6
  function flatten(blocks, out = []) {