@bendyline/squisq 2.4.2 → 2.4.4

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.
@@ -2,7 +2,7 @@ import {
2
2
  assertMarkdownDocumentWithinLimits,
3
3
  parseMarkdown,
4
4
  toMdast
5
- } from "./chunk-7TJJA2RI.js";
5
+ } from "./chunk-YQW6AQBV.js";
6
6
  import {
7
7
  formatFrontmatterYaml,
8
8
  getChildren,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  expectedSyllablesAt,
3
3
  wordPosAtExpectedSyllables
4
- } from "./chunk-2HY2ZA7U.js";
4
+ } from "./chunk-OIIIHI3Y.js";
5
5
 
6
6
  // src/narration/types.ts
7
7
  var DEFAULT_FEATURE_CONFIG = Object.freeze({
@@ -23,7 +23,7 @@ import {
23
23
  templateRegistry,
24
24
  writeCustomTemplatesToFrontmatter,
25
25
  writeCustomThemesToFrontmatter
26
- } from "./chunk-2HY2ZA7U.js";
26
+ } from "./chunk-OIIIHI3Y.js";
27
27
  import {
28
28
  ASCII_TREE_VOCAB,
29
29
  ASCII_VOCAB,
@@ -58,7 +58,7 @@ import {
58
58
  } from "./chunk-BAOV476U.js";
59
59
  import {
60
60
  parseMarkdown
61
- } from "./chunk-7TJJA2RI.js";
61
+ } from "./chunk-YQW6AQBV.js";
62
62
  import {
63
63
  KNOWN_BLOCK_META_KEYS,
64
64
  TEMPLATE_ALIASES,
@@ -66,7 +66,7 @@ import {
66
66
  isContainerTemplate,
67
67
  resolveTemplateName,
68
68
  serializeAnnotation
69
- } from "./chunk-D6YTLQCL.js";
69
+ } from "./chunk-O3LLD7HG.js";
70
70
  import {
71
71
  extractPlainText,
72
72
  getChildren,
@@ -56,7 +56,7 @@ import {
56
56
  sanitizeUrl,
57
57
  splitKeyValueToken,
58
58
  tokenizeAttrTokens
59
- } from "./chunk-D6YTLQCL.js";
59
+ } from "./chunk-O3LLD7HG.js";
60
60
  import {
61
61
  extractPlainText,
62
62
  readFrontmatterThemeId,
@@ -2414,7 +2414,7 @@ function renderInlineHtml(nodes) {
2414
2414
  case "mention":
2415
2415
  return escapeInlineHtml(`@${node.displayName}`);
2416
2416
  case "inlineIcon":
2417
- return escapeInlineHtml(`{[${node.token}]}`);
2417
+ return `<i class="fa-${node.family} fa-${node.name}" aria-hidden="true"></i>`;
2418
2418
  case "htmlInline":
2419
2419
  return escapeInlineHtml(node.rawHtml);
2420
2420
  }
@@ -2525,10 +2525,16 @@ function extractEmbeddedVideos(contents, limit = Infinity) {
2525
2525
  const attrs = n.attributes;
2526
2526
  const src = attrs?.src || nestedSource(n.children);
2527
2527
  if (src) {
2528
+ const startAt = attrs?.["data-squisq-video-start-at"] ? parseTimeSeconds(attrs["data-squisq-video-start-at"]) : null;
2529
+ const clipStart = attrs?.["data-squisq-video-clip-start"] ? parseTimeSeconds(attrs["data-squisq-video-clip-start"]) : null;
2530
+ const clipEnd = attrs?.["data-squisq-video-clip-end"] ? parseTimeSeconds(attrs["data-squisq-video-clip-end"]) : null;
2528
2531
  add({
2529
2532
  src,
2530
2533
  ...attrs?.poster ? { posterSrc: attrs.poster } : {},
2531
- alt: attrs?.["aria-label"] || attrs?.title || attrs?.alt || ""
2534
+ alt: attrs?.["aria-label"] || attrs?.title || attrs?.alt || "",
2535
+ ...startAt != null ? { startAt } : {},
2536
+ ...clipStart != null ? { clipStart } : {},
2537
+ ...clipEnd != null ? { clipEnd } : {}
2532
2538
  });
2533
2539
  }
2534
2540
  } else if ((n.type === "link" || n.type === "image") && typeof n.url === "string" && VIDEO_FILE_RE.test(n.url)) {
@@ -8125,7 +8131,10 @@ function collectRichMediaItems(layers, block) {
8125
8131
  src: video.src,
8126
8132
  ...video.posterSrc ? { posterSrc: video.posterSrc } : {},
8127
8133
  alt: video.alt,
8128
- aspectRatio: 16 / 9
8134
+ aspectRatio: 16 / 9,
8135
+ ...video.startAt != null ? { startAt: video.startAt } : {},
8136
+ ...video.clipStart != null ? { clipStart: video.clipStart } : {},
8137
+ ...video.clipEnd != null ? { clipEnd: video.clipEnd } : {}
8129
8138
  })
8130
8139
  ),
8131
8140
  ...sources.map((source) => ({ kind: "mermaid", source, aspectRatio: 16 / 9 })),
@@ -8181,6 +8190,7 @@ function richMediaLayers(item, position, block, theme, kindIndex) {
8181
8190
  ];
8182
8191
  }
8183
8192
  if (item.kind === "video") {
8193
+ const clipStart = Math.max(0, item.clipStart ?? 0);
8184
8194
  return [
8185
8195
  {
8186
8196
  id: `${block.id}-embedded-video-${kindIndex}`,
@@ -8191,8 +8201,9 @@ function richMediaLayers(item, position, block, theme, kindIndex) {
8191
8201
  ...item.posterSrc ? { posterSrc: item.posterSrc } : {},
8192
8202
  alt: item.alt || block.title || "Embedded video",
8193
8203
  fit: "contain",
8194
- clipStart: 0,
8195
- clipEnd: Math.max(0, block.duration)
8204
+ clipStart,
8205
+ clipEnd: Math.max(clipStart, item.clipEnd ?? clipStart + Math.max(0, block.duration)),
8206
+ ...item.startAt != null ? { startAt: Math.max(0, item.startAt) } : {}
8196
8207
  }
8197
8208
  }
8198
8209
  ];
@@ -8233,11 +8244,36 @@ function richMediaLayers(item, position, block, theme, kindIndex) {
8233
8244
  `${block.id}-embedded-${item.template}-${kindIndex}`
8234
8245
  );
8235
8246
  }
8247
+ function applyEmbeddedVideoTiming(layers, block) {
8248
+ const timedBySrc = new Map(
8249
+ extractEmbeddedVideos(block.contents).filter((video) => video.startAt != null || video.clipStart != null || video.clipEnd != null).map((video) => [video.src, video])
8250
+ );
8251
+ if (timedBySrc.size === 0) return layers;
8252
+ return layers.map((layer) => {
8253
+ if (layer.type !== "video") return layer;
8254
+ const video = timedBySrc.get(layer.content.src);
8255
+ if (!video) return layer;
8256
+ const clipStart = Math.max(0, video.clipStart ?? layer.content.clipStart);
8257
+ return {
8258
+ ...layer,
8259
+ content: {
8260
+ ...layer.content,
8261
+ clipStart,
8262
+ clipEnd: Math.max(
8263
+ clipStart,
8264
+ video.clipEnd ?? (video.clipStart != null ? clipStart + Math.max(0, block.duration) : layer.content.clipEnd)
8265
+ ),
8266
+ ...video.startAt != null ? { startAt: Math.max(0, video.startAt) } : {}
8267
+ }
8268
+ };
8269
+ });
8270
+ }
8236
8271
  function appendRichContentLayers(layers, block, theme, viewport) {
8237
- const items = collectRichMediaItems(layers, block);
8238
- if (items.length === 0) return layers;
8272
+ const timedLayers = applyEmbeddedVideoTiming(layers, block);
8273
+ const items = collectRichMediaItems(timedLayers, block);
8274
+ if (items.length === 0) return timedLayers;
8239
8275
  const layout = resolveSupplementalMediaLayout(
8240
- layers,
8276
+ timedLayers,
8241
8277
  block.template ? resolveTemplateName(block.template) : void 0,
8242
8278
  viewport,
8243
8279
  items.length,
@@ -6,7 +6,7 @@ import {
6
6
  quoteAttrValue,
7
7
  splitKeyValueToken,
8
8
  tokenizeAttrTokens
9
- } from "./chunk-D6YTLQCL.js";
9
+ } from "./chunk-O3LLD7HG.js";
10
10
  import {
11
11
  resolveIcon
12
12
  } from "./chunk-7N4G32LG.js";
@@ -979,8 +979,9 @@ declare function pullQuote(input: PullQuoteInput, context: TemplateContext): Lay
979
979
  * Video With Caption Template
980
980
  *
981
981
  * Full-screen background video clip with text overlay. Mirrors the structure of
982
- * imageWithCaption but uses a VideoLayer instead of an ImageLayer. The video
983
- * plays muted narration audio is the only sound track.
982
+ * imageWithCaption but uses a VideoLayer instead of an ImageLayer. Interactive
983
+ * players may play the video's own audio; muted and render-mode players keep it
984
+ * silent.
984
985
  *
985
986
  * Adapts caption positioning and font sizes for different viewports.
986
987
  *
@@ -1762,6 +1763,11 @@ interface EmbeddedVideo {
1762
1763
  src: string;
1763
1764
  posterSrc?: string;
1764
1765
  alt: string;
1766
+ /** Delay within the owning block before playback begins. */
1767
+ startAt?: number;
1768
+ /** Source-media in/out points carried by inline video data attributes. */
1769
+ clipStart?: number;
1770
+ clipEnd?: number;
1765
1771
  }
1766
1772
  /** Plain text of a block's body contents (excluding the heading). */
1767
1773
  declare function extractBodyPlainText(contents?: MarkdownBlockNode[]): string;
package/dist/doc/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  sectionExtractors,
27
27
  validateMarkdownDoc,
28
28
  validateMarkdownSource
29
- } from "../chunk-AQF5ZYDI.js";
29
+ } from "../chunk-GXUFHFYD.js";
30
30
  import {
31
31
  ASCII_CHAR_H,
32
32
  ASCII_CHAR_W,
@@ -144,7 +144,7 @@ import {
144
144
  wrapWithPersistentLayers,
145
145
  writeCustomTemplatesToFrontmatter,
146
146
  writeCustomThemesToFrontmatter
147
- } from "../chunk-2HY2ZA7U.js";
147
+ } from "../chunk-OIIIHI3Y.js";
148
148
  import {
149
149
  PATH_SHAPE_KINDS,
150
150
  anchorPoint,
@@ -200,13 +200,13 @@ import {
200
200
  isTemplateBlock,
201
201
  scaledFontSize2 as scaledFontSize
202
202
  } from "../chunk-BAOV476U.js";
203
- import "../chunk-7TJJA2RI.js";
203
+ import "../chunk-YQW6AQBV.js";
204
204
  import {
205
205
  CONTAINER_TEMPLATES,
206
206
  TABLE_FED_TEMPLATES,
207
207
  isContainerTemplate,
208
208
  resolveTemplateName
209
- } from "../chunk-D6YTLQCL.js";
209
+ } from "../chunk-O3LLD7HG.js";
210
210
  import "../chunk-7N4G32LG.js";
211
211
  import "../chunk-O7JILDEF.js";
212
212
  import "../chunk-4VOD55SX.js";
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { B as BoundingBox, C as Coordinates } from './Types-sh2VRxfo.js';
2
2
  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 Block, k as BlockConnection, l as BorderStyle, C as CaptionPhrase, m as CaptionTrack, n as CaptionWord, o as ChartBaseFields, p as ChartTemplateInput, q as ColorScheme, r as ColumnChartInput, s as ComparisonBarInput, t as ContentBlockInput, u as CornerBrandingConfig, v as CustomTemplateDefinition, w as CustomTemplateLayer, x as CustomTemplateValidationError, y as CustomTemplateValidationResult, D as DARK_SURFACE, z as DEFAULT_DOC_FONT, E as DEFAULT_TITLE_FONT, F as DataTableInput, G as DateEventInput, H as DeepPartial, I as DefinitionCardInput, J as DiagramBlockInput, K as DiagramEdgeAnchor, L as DiagramTemplateEdge, M as DiagramTemplateNode, N as Doc, O as DocBlock, P as DocDiagnostic, Q as DonutChartInput, R as DrawingBlockInput, S as FRONTMATTER_CUSTOM_TEMPLATES_KEY, T as FRONTMATTER_CUSTOM_THEMES_KEY, U as FactCardInput, V as FontFamily, W as FontFamilyKind, X as FullBleedQuoteInput, Y as GradientBackgroundConfig, Z as ImageBackgroundConfig, _ as ImageLayer, $ as ImageTreatment, a0 as ImageWithCaptionInput, a1 as LIGHT_SURFACE, a2 as Layer, a3 as LayerRepeat, a4 as LayoutHints, a5 as LeftFeatureInput, a6 as LineChartInput, a7 as LinearGradient, a8 as ListBlockInput, a9 as MapBlockInput, aa as MapLayer, ab as MapMarker, ac as MapTileStyle, ad as MarkerStyle, ae as MediaClip, af as MediaScheduleOptions, ag as MermaidLayer, ah as PAGE_ACCENT_STRATEGIES, ai as PAGE_BACKGROUNDS, aj as PAGE_BACKGROUND_RHYTHMS, ak as PAGE_DESIGN_FAMILIES, al as PAGE_DIVIDERS, am as PAGE_EMPHASES, an as PAGE_EYEBROWS, ao as PAGE_HEADING_CASES, ap as PAGE_HEADING_SCALES, aq as PAGE_HEADING_UNDERLINES, ar as PAGE_HERO_STYLES, as as PAGE_IMAGE_FRAMINGS, at as PAGE_NUMERAL_STYLES, au as PAGE_PATTERNS, av as PAGE_QUOTE_MARKS, aw as PAGE_SECTION_KINDS, ax as PAGE_SECTION_SPACINGS, ay as PAGE_SHADOWS, az as PageAccentRotation, aA as PageBackground, aB as PageDesignFamily, aC as PageEmphasis, aD as PageHeadingTreatment, aE as PageSectionKind, aF as PageSectionOverride, aG as PageTokens, aH as PathLayer, aI as PatternBackgroundConfig, aJ as PersistentLayer, aK as PersistentLayerConfig, aL as PersistentLayerTemplate, aM as PersistentLayerTemplateConfig, aN as PersistentLayerTemplateType, aO as PhotoGridInput, aP as PieChartInput, aQ as PipStyle, aR as Position, aS as ProgressIndicatorConfig, aT as PromotedBodyAnnotation, aU as PullQuoteInput, aV as QuoteBlockInput, aW as RawLayersInput, aX as RenderStyle, aY as RightFeatureInput, aZ as ScatterChartInput, a_ as ScheduledClip, a$ as SectionHeaderInput, b0 as ShapeFilter, b1 as ShapeLayer, b2 as ShapePattern, b3 as SolidBackgroundConfig, b4 as StartBlockConfig, b5 as StatHighlightInput, b6 as SurfaceScheme, b7 as THEME_SCHEMA_VERSION, b8 as TableLayer, b9 as TableLayerStyle, ba as TemplateBlock, bb as TemplateContext, bc as TemplateFunction, bd as TemplateRegistry, be as TextLayer, bf as TextStyle, bg as Theme, bh as ThemeColorPalette, bi as ThemeColorScheme, bj as ThemePageStyle, bk as ThemeRegistry, bl as ThemeSchemaVersion, bm as ThemeSeedColors, bn as ThemeStyle, bo as ThemeTypography, bp as TimelineBlockInput, bq as TimelineTemplateEvent, br as TimelineTemplateLink, bs as TimelineTemplateTrack, bt as TitleBlockInput, bu as TitleCaptionConfig, bv as TreeBlockInput, bw as TreeLayer, bx as TreeLayerItem, by as TreeLayerStyle, bz as TreeTemplateItem, bA as TwoColumnInput, bB as VIEWPORT_PRESETS, bC as VideoLayer, bD as VideoPipPosition, bE as VideoPipShape, bF as VideoPipSize, bG as VideoPlacement, bH as VideoPresentation, bI as VideoPullQuoteInput, bJ as VideoWithCaptionInput, bK as ViewportConfig, bL as ViewportOrientation, bM as ViewportPreset, bN as VignetteConfig, bO as applySurface, bP as calculateDuration, bQ as calculateFontScale, bR as createTemplateContext, bS as createTheme, bT as createThemeRegistry, bU as getAspectRatioString, bV as getBlockAtTime, bW as getCaptionAtTime, bX as getDocPlaybackDuration, bY as getLayoutHints, bZ as getSafeTextBounds, b_ as getSegmentAtTime, b$ as getTwoColumnPositions, c0 as getViewport, c1 as getViewportOrientation, c2 as isCustomTemplateDefinition, c3 as isPersistentLayerTemplate, c4 as isTemplateBlock, c5 as layoutScaledFontSize, c6 as resolveMediaSchedule, c7 as scaledFontSize, c8 as validateCustomTemplateDefinition } from './Doc-BKKcPjfe.js';
3
+ export { AVAILABLE_FONT_STACKS, CompileOptions, ContrastPreset, DocSchemaIssue, FONT_FALLBACKS, FontStack, MermaidThemeVariables, PipStyleVars, STARTER_THEME, ValidationError, ValidationResult, accentToColorScheme, assertDocSchema, assertTheme, buildGoogleFontsUrl, buildMermaidThemeVariables, compileTheme, contrastRatio, defaultPageStyle, deriveColorPalette, deriveScale, fontStack, getFontStack, guessFontFallback, hexHueDegrees, isHex, matchFontFamily, oklchDarken, oklchLighten, oklchSetChroma, parseTheme, pickContrastingText, pipStyleVars, relativeLuminance, resolveFontFamily, serializeTheme, validateDocSchema, validateTheme, withAlpha } from './schemas/index.js';
3
4
  export { D as DEFAULT_MARKDOWN_SAFETY_LIMITS, a as DEFAULT_TRANSITION_DURATION_SECONDS, H as HeadingAttributes, b as HeadingTemplateAnnotation, c as HtmlComment, d as HtmlElement, e as HtmlNode, f as HtmlText, M as MarkdownBlockNode, g as MarkdownBlockquote, h as MarkdownBreak, i as MarkdownCodeBlock, j as MarkdownContainerDirective, k as MarkdownDefinitionDescription, l as MarkdownDefinitionList, m as MarkdownDefinitionTerm, n as MarkdownDocument, o as MarkdownEmphasis, p as MarkdownFootnoteDefinition, q as MarkdownFootnoteReference, r as MarkdownHeading, s as MarkdownHtmlBlock, t as MarkdownImage, u as MarkdownImageReference, v as MarkdownInlineCode, w as MarkdownInlineHtml, x as MarkdownInlineIcon, y as MarkdownInlineMath, z as MarkdownInlineNode, A as MarkdownLeafDirective, B as MarkdownLimitError, C as MarkdownLink, E as MarkdownLinkDefinition, F as MarkdownLinkReference, G as MarkdownList, I as MarkdownListItem, J as MarkdownMathBlock, K as MarkdownMention, L as MarkdownNode, N as MarkdownParagraph, O as MarkdownPoint, P as MarkdownSafetyLimits, Q as MarkdownSourcePosition, R as MarkdownStrikethrough, S as MarkdownStrong, T as MarkdownTable, U as MarkdownTableCell, V as MarkdownTableRow, W as MarkdownText, X as MarkdownTextDirective, Y as MarkdownThematicBreak, Z as ParseOptions, _ as StringifyOptions, $ as TRANSITION_DIRECTIONS, a0 as TRANSITION_TYPES, a1 as Transition, a2 as TransitionDirection, a3 as TransitionType, a4 as assertMarkdownDocumentWithinLimits, a5 as assertMarkdownSourceWithinLimits, a6 as isTransitionType, a7 as normalizeTransitionDirection, a8 as normalizeTransitionType, a9 as resolveBlockTransition, aa as resolveMarkdownSafetyLimits, ab as resolveTransitionDuration } from './types-CcrDFdWH.js';
4
- export { AVAILABLE_FONT_STACKS, CompileOptions, ContrastPreset, FONT_FALLBACKS, FontStack, MermaidThemeVariables, PipStyleVars, STARTER_THEME, ValidationError, ValidationResult, accentToColorScheme, assertTheme, buildGoogleFontsUrl, buildMermaidThemeVariables, compileTheme, contrastRatio, defaultPageStyle, deriveColorPalette, deriveScale, fontStack, getFontStack, guessFontFallback, hexHueDegrees, isHex, matchFontFamily, oklchDarken, oklchLighten, oklchSetChroma, parseTheme, pickContrastingText, pipStyleVars, relativeLuminance, resolveFontFamily, serializeTheme, validateTheme, withAlpha } from './schemas/index.js';
5
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-BMXXLZBU.js';
6
6
  export { M as MediaEntry, a as MediaProvider } from './MediaProvider-wpSe21B3.js';
7
7
  export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from './ImageEditDoc-CU1cXxRd.js';
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  reanchorSession,
24
24
  traceWordPosAt,
25
25
  vadStep
26
- } from "./chunk-EMXYZLRH.js";
26
+ } from "./chunk-GGTDYLW4.js";
27
27
  import {
28
28
  DEFAULT_TRANSFORM_STYLE_ID,
29
29
  analyzeBlocks,
@@ -112,6 +112,7 @@ import {
112
112
  import {
113
113
  STARTER_THEME,
114
114
  accentToColorScheme,
115
+ assertDocSchema,
115
116
  buildMermaidThemeVariables,
116
117
  calculateDuration,
117
118
  compileTheme,
@@ -121,8 +122,9 @@ import {
121
122
  getSegmentAtTime,
122
123
  parseTheme,
123
124
  pipStyleVars,
124
- serializeTheme
125
- } from "./chunk-GODLNXO4.js";
125
+ serializeTheme,
126
+ validateDocSchema
127
+ } from "./chunk-24SENDJY.js";
126
128
  import {
127
129
  calculateBearing,
128
130
  decodeGeohash,
@@ -163,7 +165,7 @@ import {
163
165
  sectionExtractors,
164
166
  validateMarkdownDoc,
165
167
  validateMarkdownSource
166
- } from "./chunk-AQF5ZYDI.js";
168
+ } from "./chunk-GXUFHFYD.js";
167
169
  import {
168
170
  ASCII_CHAR_H,
169
171
  ASCII_CHAR_W,
@@ -289,7 +291,7 @@ import {
289
291
  wrapWithPersistentLayers,
290
292
  writeCustomTemplatesToFrontmatter,
291
293
  writeCustomThemesToFrontmatter
292
- } from "./chunk-2HY2ZA7U.js";
294
+ } from "./chunk-OIIIHI3Y.js";
293
295
  import {
294
296
  PATH_SHAPE_KINDS,
295
297
  anchorPoint,
@@ -432,7 +434,7 @@ import {
432
434
  stringifyMarkdown,
433
435
  unwrapMarkdownSource,
434
436
  wrapMarkdownSource
435
- } from "./chunk-JUAC2QWP.js";
437
+ } from "./chunk-CYRIVZTR.js";
436
438
  import {
437
439
  DEFAULT_MARKDOWN_SAFETY_LIMITS,
438
440
  MarkdownLimitError,
@@ -444,7 +446,7 @@ import {
444
446
  resolveMarkdownSafetyLimits,
445
447
  serializePandocAttributes,
446
448
  toMdast
447
- } from "./chunk-7TJJA2RI.js";
449
+ } from "./chunk-YQW6AQBV.js";
448
450
  import {
449
451
  BLOCK_META_KEY_DESCRIPTORS,
450
452
  CONTAINER_TEMPLATES,
@@ -462,7 +464,7 @@ import {
462
464
  splitKeyValueToken,
463
465
  tokenizeAttrTokens,
464
466
  unquoteAttrValue
465
- } from "./chunk-D6YTLQCL.js";
467
+ } from "./chunk-O3LLD7HG.js";
466
468
  import {
467
469
  ICONS,
468
470
  canonicalIconToken,
@@ -623,6 +625,7 @@ export {
623
625
  asciiDiagramFromTemplateData,
624
626
  asciiDiagramToTemplateData,
625
627
  asciiTimelineToTemplateData,
628
+ assertDocSchema,
626
629
  assertMarkdownDocumentWithinLimits,
627
630
  assertMarkdownSourceWithinLimits,
628
631
  assertTheme,
@@ -966,6 +969,7 @@ export {
966
969
  updateLayer,
967
970
  vadStep,
968
971
  validateCustomTemplateDefinition,
972
+ validateDocSchema,
969
973
  validateMarkdownDoc,
970
974
  validateMarkdownSource,
971
975
  validateTheme,
@@ -16,7 +16,7 @@ import {
16
16
  setByPointer,
17
17
  toPointer
18
18
  } from "../chunk-DAMIRKTO.js";
19
- import "../chunk-GODLNXO4.js";
19
+ import "../chunk-24SENDJY.js";
20
20
  import "../chunk-GAZKTT4R.js";
21
21
  import "../chunk-SBAX4ZPO.js";
22
22
  import "../chunk-BAOV476U.js";
@@ -14,7 +14,7 @@ import {
14
14
  stringifyMarkdown,
15
15
  unwrapMarkdownSource,
16
16
  wrapMarkdownSource
17
- } from "../chunk-JUAC2QWP.js";
17
+ } from "../chunk-CYRIVZTR.js";
18
18
  import {
19
19
  DEFAULT_MARKDOWN_SAFETY_LIMITS,
20
20
  MarkdownLimitError,
@@ -26,7 +26,7 @@ import {
26
26
  resolveMarkdownSafetyLimits,
27
27
  serializePandocAttributes,
28
28
  toMdast
29
- } from "../chunk-7TJJA2RI.js";
29
+ } from "../chunk-YQW6AQBV.js";
30
30
  import {
31
31
  BLOCK_META_KEY_DESCRIPTORS,
32
32
  KNOWN_BLOCK_META_KEYS,
@@ -40,7 +40,7 @@ import {
40
40
  splitKeyValueToken,
41
41
  tokenizeAttrTokens,
42
42
  unquoteAttrValue
43
- } from "../chunk-D6YTLQCL.js";
43
+ } from "../chunk-O3LLD7HG.js";
44
44
  import "../chunk-7N4G32LG.js";
45
45
  import {
46
46
  countNodes,
@@ -23,7 +23,7 @@ import {
23
23
  reanchorSession,
24
24
  traceWordPosAt,
25
25
  vadStep
26
- } from "../chunk-EMXYZLRH.js";
26
+ } from "../chunk-GGTDYLW4.js";
27
27
  import {
28
28
  buildNarrationScript,
29
29
  buildNarrationTimingJson,
@@ -33,12 +33,12 @@ import {
33
33
  wordIndexAtChar,
34
34
  wordIndexAtTime,
35
35
  wordPosAtExpectedSyllables
36
- } from "../chunk-2HY2ZA7U.js";
36
+ } from "../chunk-OIIIHI3Y.js";
37
37
  import "../chunk-PUS54YU6.js";
38
38
  import "../chunk-CUYHFOFL.js";
39
39
  import "../chunk-SBAX4ZPO.js";
40
40
  import "../chunk-BAOV476U.js";
41
- import "../chunk-D6YTLQCL.js";
41
+ import "../chunk-O3LLD7HG.js";
42
42
  import "../chunk-O7JILDEF.js";
43
43
  import "../chunk-4VOD55SX.js";
44
44
  import "../chunk-XOFT65EX.js";
@@ -1,11 +1,30 @@
1
1
  export { B as BoundingBox, C as Coordinates } from '../Types-sh2VRxfo.js';
2
- import { bg as Theme, bj as ThemePageStyle, bi as ThemeColorScheme, H as DeepPartial, bm as ThemeSeedColors, bh as ThemeColorPalette, W as FontFamilyKind, V as FontFamily } from '../Doc-BKKcPjfe.js';
3
- 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 Block, k as BlockConnection, l as BorderStyle, C as CaptionPhrase, m as CaptionTrack, n as CaptionWord, o as ChartBaseFields, p as ChartTemplateInput, q as ColorScheme, r as ColumnChartInput, s as ComparisonBarInput, t as ContentBlockInput, u as CornerBrandingConfig, v as CustomTemplateDefinition, w as CustomTemplateLayer, x as CustomTemplateValidationError, y as CustomTemplateValidationResult, D as DARK_SURFACE, z as DEFAULT_DOC_FONT, E as DEFAULT_TITLE_FONT, F as DataTableInput, G as DateEventInput, I as DefinitionCardInput, J as DiagramBlockInput, K as DiagramEdgeAnchor, L as DiagramTemplateEdge, M as DiagramTemplateNode, N as Doc, O as DocBlock, P as DocDiagnostic, Q as DonutChartInput, R as DrawingBlockInput, S as FRONTMATTER_CUSTOM_TEMPLATES_KEY, T as FRONTMATTER_CUSTOM_THEMES_KEY, U as FactCardInput, X as FullBleedQuoteInput, Y as GradientBackgroundConfig, Z as ImageBackgroundConfig, _ as ImageLayer, $ as ImageTreatment, a0 as ImageWithCaptionInput, a1 as LIGHT_SURFACE, a2 as Layer, a3 as LayerRepeat, a4 as LayoutHints, a5 as LeftFeatureInput, a6 as LineChartInput, a7 as LinearGradient, a8 as ListBlockInput, a9 as MapBlockInput, aa as MapLayer, ab as MapMarker, ac as MapTileStyle, ad as MarkerStyle, ae as MediaClip, af as MediaScheduleOptions, ag as MermaidLayer, ah as PAGE_ACCENT_STRATEGIES, ai as PAGE_BACKGROUNDS, aj as PAGE_BACKGROUND_RHYTHMS, ak as PAGE_DESIGN_FAMILIES, al as PAGE_DIVIDERS, am as PAGE_EMPHASES, an as PAGE_EYEBROWS, ao as PAGE_HEADING_CASES, ap as PAGE_HEADING_SCALES, aq as PAGE_HEADING_UNDERLINES, ar as PAGE_HERO_STYLES, as as PAGE_IMAGE_FRAMINGS, at as PAGE_NUMERAL_STYLES, au as PAGE_PATTERNS, av as PAGE_QUOTE_MARKS, aw as PAGE_SECTION_KINDS, ax as PAGE_SECTION_SPACINGS, ay as PAGE_SHADOWS, az as PageAccentRotation, aA as PageBackground, aB as PageDesignFamily, aC as PageEmphasis, aD as PageHeadingTreatment, aE as PageSectionKind, aF as PageSectionOverride, aG as PageTokens, aH as PathLayer, aI as PatternBackgroundConfig, aJ as PersistentLayer, aK as PersistentLayerConfig, aL as PersistentLayerTemplate, aM as PersistentLayerTemplateConfig, aN as PersistentLayerTemplateType, aO as PhotoGridInput, aP as PieChartInput, aQ as PipStyle, aR as Position, aS as ProgressIndicatorConfig, aT as PromotedBodyAnnotation, aU as PullQuoteInput, aV as QuoteBlockInput, aW as RawLayersInput, aX as RenderStyle, aY as RightFeatureInput, aZ as ScatterChartInput, a_ as ScheduledClip, a$ as SectionHeaderInput, b0 as ShapeFilter, b1 as ShapeLayer, b2 as ShapePattern, b3 as SolidBackgroundConfig, b4 as StartBlockConfig, b5 as StatHighlightInput, b6 as SurfaceScheme, b7 as THEME_SCHEMA_VERSION, b8 as TableLayer, b9 as TableLayerStyle, ba as TemplateBlock, bb as TemplateContext, bc as TemplateFunction, bd as TemplateRegistry, be as TextLayer, bf as TextStyle, bk as ThemeRegistry, bl as ThemeSchemaVersion, bn as ThemeStyle, bo as ThemeTypography, bp as TimelineBlockInput, bq as TimelineTemplateEvent, br as TimelineTemplateLink, bs as TimelineTemplateTrack, bt as TitleBlockInput, bu as TitleCaptionConfig, bv as TreeBlockInput, bw as TreeLayer, bx as TreeLayerItem, by as TreeLayerStyle, bz as TreeTemplateItem, bA as TwoColumnInput, bB as VIEWPORT_PRESETS, bC as VideoLayer, bD as VideoPipPosition, bE as VideoPipShape, bF as VideoPipSize, bG as VideoPlacement, bH as VideoPresentation, bI as VideoPullQuoteInput, bJ as VideoWithCaptionInput, bK as ViewportConfig, bL as ViewportOrientation, bM as ViewportPreset, bN as VignetteConfig, bO as applySurface, bP as calculateDuration, bQ as calculateFontScale, bR as createTemplateContext, bS as createTheme, bT as createThemeRegistry, bU as getAspectRatioString, bV as getBlockAtTime, bW as getCaptionAtTime, bX as getDocPlaybackDuration, bY as getLayoutHints, bZ as getSafeTextBounds, b_ as getSegmentAtTime, b$ as getTwoColumnPositions, c0 as getViewport, c1 as getViewportOrientation, c2 as isCustomTemplateDefinition, c3 as isPersistentLayerTemplate, c4 as isTemplateBlock, c5 as layoutScaledFontSize, c6 as resolveMediaSchedule, c7 as scaledFontSize, c8 as validateCustomTemplateDefinition } from '../Doc-BKKcPjfe.js';
2
+ import { N as Doc, bg as Theme, bj as ThemePageStyle, bi as ThemeColorScheme, H as DeepPartial, bm as ThemeSeedColors, bh as ThemeColorPalette, W as FontFamilyKind, V as FontFamily } from '../Doc-BKKcPjfe.js';
3
+ 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 Block, k as BlockConnection, l as BorderStyle, C as CaptionPhrase, m as CaptionTrack, n as CaptionWord, o as ChartBaseFields, p as ChartTemplateInput, q as ColorScheme, r as ColumnChartInput, s as ComparisonBarInput, t as ContentBlockInput, u as CornerBrandingConfig, v as CustomTemplateDefinition, w as CustomTemplateLayer, x as CustomTemplateValidationError, y as CustomTemplateValidationResult, D as DARK_SURFACE, z as DEFAULT_DOC_FONT, E as DEFAULT_TITLE_FONT, F as DataTableInput, G as DateEventInput, I as DefinitionCardInput, J as DiagramBlockInput, K as DiagramEdgeAnchor, L as DiagramTemplateEdge, M as DiagramTemplateNode, O as DocBlock, P as DocDiagnostic, Q as DonutChartInput, R as DrawingBlockInput, S as FRONTMATTER_CUSTOM_TEMPLATES_KEY, T as FRONTMATTER_CUSTOM_THEMES_KEY, U as FactCardInput, X as FullBleedQuoteInput, Y as GradientBackgroundConfig, Z as ImageBackgroundConfig, _ as ImageLayer, $ as ImageTreatment, a0 as ImageWithCaptionInput, a1 as LIGHT_SURFACE, a2 as Layer, a3 as LayerRepeat, a4 as LayoutHints, a5 as LeftFeatureInput, a6 as LineChartInput, a7 as LinearGradient, a8 as ListBlockInput, a9 as MapBlockInput, aa as MapLayer, ab as MapMarker, ac as MapTileStyle, ad as MarkerStyle, ae as MediaClip, af as MediaScheduleOptions, ag as MermaidLayer, ah as PAGE_ACCENT_STRATEGIES, ai as PAGE_BACKGROUNDS, aj as PAGE_BACKGROUND_RHYTHMS, ak as PAGE_DESIGN_FAMILIES, al as PAGE_DIVIDERS, am as PAGE_EMPHASES, an as PAGE_EYEBROWS, ao as PAGE_HEADING_CASES, ap as PAGE_HEADING_SCALES, aq as PAGE_HEADING_UNDERLINES, ar as PAGE_HERO_STYLES, as as PAGE_IMAGE_FRAMINGS, at as PAGE_NUMERAL_STYLES, au as PAGE_PATTERNS, av as PAGE_QUOTE_MARKS, aw as PAGE_SECTION_KINDS, ax as PAGE_SECTION_SPACINGS, ay as PAGE_SHADOWS, az as PageAccentRotation, aA as PageBackground, aB as PageDesignFamily, aC as PageEmphasis, aD as PageHeadingTreatment, aE as PageSectionKind, aF as PageSectionOverride, aG as PageTokens, aH as PathLayer, aI as PatternBackgroundConfig, aJ as PersistentLayer, aK as PersistentLayerConfig, aL as PersistentLayerTemplate, aM as PersistentLayerTemplateConfig, aN as PersistentLayerTemplateType, aO as PhotoGridInput, aP as PieChartInput, aQ as PipStyle, aR as Position, aS as ProgressIndicatorConfig, aT as PromotedBodyAnnotation, aU as PullQuoteInput, aV as QuoteBlockInput, aW as RawLayersInput, aX as RenderStyle, aY as RightFeatureInput, aZ as ScatterChartInput, a_ as ScheduledClip, a$ as SectionHeaderInput, b0 as ShapeFilter, b1 as ShapeLayer, b2 as ShapePattern, b3 as SolidBackgroundConfig, b4 as StartBlockConfig, b5 as StatHighlightInput, b6 as SurfaceScheme, b7 as THEME_SCHEMA_VERSION, b8 as TableLayer, b9 as TableLayerStyle, ba as TemplateBlock, bb as TemplateContext, bc as TemplateFunction, bd as TemplateRegistry, be as TextLayer, bf as TextStyle, bk as ThemeRegistry, bl as ThemeSchemaVersion, bn as ThemeStyle, bo as ThemeTypography, bp as TimelineBlockInput, bq as TimelineTemplateEvent, br as TimelineTemplateLink, bs as TimelineTemplateTrack, bt as TitleBlockInput, bu as TitleCaptionConfig, bv as TreeBlockInput, bw as TreeLayer, bx as TreeLayerItem, by as TreeLayerStyle, bz as TreeTemplateItem, bA as TwoColumnInput, bB as VIEWPORT_PRESETS, bC as VideoLayer, bD as VideoPipPosition, bE as VideoPipShape, bF as VideoPipSize, bG as VideoPlacement, bH as VideoPresentation, bI as VideoPullQuoteInput, bJ as VideoWithCaptionInput, bK as ViewportConfig, bL as ViewportOrientation, bM as ViewportPreset, bN as VignetteConfig, bO as applySurface, bP as calculateDuration, bQ as calculateFontScale, bR as createTemplateContext, bS as createTheme, bT as createThemeRegistry, bU as getAspectRatioString, bV as getBlockAtTime, bW as getCaptionAtTime, bX as getDocPlaybackDuration, bY as getLayoutHints, bZ as getSafeTextBounds, b_ as getSegmentAtTime, b$ as getTwoColumnPositions, c0 as getViewport, c1 as getViewportOrientation, c2 as isCustomTemplateDefinition, c3 as isPersistentLayerTemplate, c4 as isTemplateBlock, c5 as layoutScaledFontSize, c6 as resolveMediaSchedule, c7 as scaledFontSize, c8 as validateCustomTemplateDefinition } from '../Doc-BKKcPjfe.js';
4
4
  export { a as DEFAULT_TRANSITION_DURATION_SECONDS, $ as TRANSITION_DIRECTIONS, a0 as TRANSITION_TYPES, a1 as Transition, a2 as TransitionDirection, a3 as TransitionType, a6 as isTransitionType, a7 as normalizeTransitionDirection, a8 as normalizeTransitionType, a9 as resolveBlockTransition, ab as resolveTransitionDuration } from '../types-CcrDFdWH.js';
5
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-BMXXLZBU.js';
6
6
  export { M as MediaEntry, a as MediaProvider } from '../MediaProvider-wpSe21B3.js';
7
7
  export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-CU1cXxRd.js';
8
8
 
9
+ /**
10
+ * Runtime validation for the canonical {@link Doc} JSON shape.
11
+ *
12
+ * TypeScript types disappear at a JSON boundary. This validator deliberately
13
+ * lives next to the schema so every importer can apply the same structural
14
+ * contract instead of maintaining a partial, consumer-specific guard.
15
+ */
16
+
17
+ interface DocSchemaIssue {
18
+ /** JavaScript-style path to the invalid value. */
19
+ path: string;
20
+ /** Human-readable statement of the violated schema rule. */
21
+ message: string;
22
+ }
23
+ /** Return every structural problem found in a prospective Doc value. */
24
+ declare function validateDocSchema(value: unknown): DocSchemaIssue[];
25
+ /** Assert that a value implements the canonical Doc JSON schema. */
26
+ declare function assertDocSchema(value: unknown): asserts value is Doc;
27
+
9
28
  /**
10
29
  * Theme-driven picture-in-picture framing.
11
30
  *
@@ -291,4 +310,4 @@ type MermaidThemeVariables = Record<string, string | number | boolean>;
291
310
  /** Build complete, contrast-aware Mermaid theme variables from a Squisq theme. */
292
311
  declare function buildMermaidThemeVariables(theme: Theme): MermaidThemeVariables;
293
312
 
294
- export { AVAILABLE_FONT_STACKS, type CompileOptions, type ContrastPreset, DeepPartial, FONT_FALLBACKS, FontFamily, FontFamilyKind, type FontStack, type MermaidThemeVariables, type PipStyleVars, STARTER_THEME, Theme, ThemeColorPalette, ThemeColorScheme, ThemePageStyle, ThemeSeedColors, type ValidationError, type ValidationResult, accentToColorScheme, assertTheme, buildGoogleFontsUrl, buildMermaidThemeVariables, compileTheme, contrastRatio, defaultPageStyle, deriveColorPalette, deriveScale, fontStack, getFontStack, guessFontFallback, hexHueDegrees, isHex, matchFontFamily, oklchDarken, oklchLighten, oklchSetChroma, parseTheme, pickContrastingText, pipStyleVars, relativeLuminance, resolveFontFamily, serializeTheme, validateTheme, withAlpha };
313
+ export { AVAILABLE_FONT_STACKS, type CompileOptions, type ContrastPreset, DeepPartial, Doc, type DocSchemaIssue, FONT_FALLBACKS, FontFamily, FontFamilyKind, type FontStack, type MermaidThemeVariables, type PipStyleVars, STARTER_THEME, Theme, ThemeColorPalette, ThemeColorScheme, ThemePageStyle, ThemeSeedColors, type ValidationError, type ValidationResult, accentToColorScheme, assertDocSchema, assertTheme, buildGoogleFontsUrl, buildMermaidThemeVariables, compileTheme, contrastRatio, defaultPageStyle, deriveColorPalette, deriveScale, fontStack, getFontStack, guessFontFallback, hexHueDegrees, isHex, matchFontFamily, oklchDarken, oklchLighten, oklchSetChroma, parseTheme, pickContrastingText, pipStyleVars, relativeLuminance, resolveFontFamily, serializeTheme, validateDocSchema, validateTheme, withAlpha };
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  STARTER_THEME,
3
3
  accentToColorScheme,
4
+ assertDocSchema,
4
5
  buildMermaidThemeVariables,
5
6
  calculateDuration,
6
7
  compileTheme,
@@ -10,8 +11,9 @@ import {
10
11
  getSegmentAtTime,
11
12
  parseTheme,
12
13
  pipStyleVars,
13
- serializeTheme
14
- } from "../chunk-GODLNXO4.js";
14
+ serializeTheme,
15
+ validateDocSchema
16
+ } from "../chunk-24SENDJY.js";
15
17
  import {
16
18
  defaultPageStyle,
17
19
  getDocPlaybackDuration,
@@ -138,6 +140,7 @@ export {
138
140
  VIEWPORT_PRESETS,
139
141
  accentToColorScheme,
140
142
  applySurface,
143
+ assertDocSchema,
141
144
  assertTheme,
142
145
  buildGoogleFontsUrl,
143
146
  buildMermaidThemeVariables,
@@ -191,6 +194,7 @@ export {
191
194
  scaledFontSize2 as scaledFontSize,
192
195
  serializeTheme,
193
196
  validateCustomTemplateDefinition,
197
+ validateDocSchema,
194
198
  validateTheme,
195
199
  withAlpha
196
200
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq",
3
- "version": "2.4.2",
3
+ "version": "2.4.4",
4
4
  "description": "Headless utilities for doc/block rendering, spatial math, Markdown, and storage",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",