@bendyline/squisq 2.3.1 → 2.3.3

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.
@@ -5,6 +5,7 @@ import {
5
5
  coerceTemplateParams,
6
6
  deriveTemplateInputs,
7
7
  extractBodyPlainText,
8
+ extractRichListItems,
8
9
  flattenBlocks,
9
10
  flattenRenderableBlocks,
10
11
  getBlockBodyText,
@@ -24,7 +25,7 @@ import {
24
25
  templateRegistry,
25
26
  writeCustomTemplatesToFrontmatter,
26
27
  writeCustomThemesToFrontmatter
27
- } from "./chunk-E3RXZUNP.js";
28
+ } from "./chunk-GQNH7PLN.js";
28
29
  import {
29
30
  ASCII_TREE_VOCAB,
30
31
  ASCII_VOCAB,
@@ -59,12 +60,12 @@ import {
59
60
  } from "./chunk-BAOV476U.js";
60
61
  import {
61
62
  parseMarkdown
62
- } from "./chunk-ACZOVWX3.js";
63
+ } from "./chunk-G3JOS25T.js";
63
64
  import {
64
65
  KNOWN_BLOCK_META_KEYS,
65
66
  coerceAnnotationValues,
66
67
  serializeAnnotation
67
- } from "./chunk-ZQKZSJAX.js";
68
+ } from "./chunk-2VCNTDNZ.js";
68
69
  import {
69
70
  extractPlainText,
70
71
  getChildren,
@@ -633,6 +634,13 @@ var sectionHeader = (input) => {
633
634
  mediaBackground: !!s.imageSrc
634
635
  };
635
636
  };
637
+ var content = (input) => {
638
+ const c = input;
639
+ return {
640
+ kind: "prose",
641
+ slots: { title: c.title, body: bodyRichText(input) }
642
+ };
643
+ };
636
644
  var statHighlight = (input) => {
637
645
  const s = input;
638
646
  return {
@@ -756,11 +764,16 @@ var fullBleedQuote = (input) => {
756
764
  };
757
765
  var list = (input) => {
758
766
  const l = input;
767
+ const contents = input.contents;
768
+ const richItems = extractRichListItems(contents);
759
769
  return {
760
770
  kind: "item-list",
761
771
  slots: {
762
772
  title: l.title,
763
- items: (l.items ?? []).map((item) => ({ body: item })),
773
+ items: (l.items ?? []).map((item, index) => ({
774
+ body: item,
775
+ ...richItems[index]?.text === item ? { markdown: richItems[index].markdown } : {}
776
+ })),
764
777
  media: accentImageMedia(l.accentImage)
765
778
  },
766
779
  colorScheme: l.colorScheme
@@ -899,6 +912,7 @@ var layout = (input, ctx) => canvasDraft("layout", ctx, input);
899
912
  var sectionExtractors = {
900
913
  title,
901
914
  sectionHeader,
915
+ content,
902
916
  statHighlight,
903
917
  quote,
904
918
  factCard,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  assertMarkdownDocumentWithinLimits,
3
3
  toMdast
4
- } from "./chunk-ACZOVWX3.js";
4
+ } from "./chunk-G3JOS25T.js";
5
5
  import {
6
6
  formatFrontmatterYaml
7
7
  } from "./chunk-BCCXTMN5.js";
@@ -200,249 +200,6 @@ ${cleaned}`;
200
200
  return cleaned;
201
201
  }
202
202
 
203
- // src/markdown/sanitize.ts
204
- var SAFE_LINK_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel"]);
205
- var SAFE_MEDIA_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "blob"]);
206
- var NEVER_ALLOWED_SCHEMES = /* @__PURE__ */ new Set(["javascript", "vbscript", "data"]);
207
- var SAFE_DATA_MEDIA_RE = /^data:(?:image\/(?!svg\+xml)[a-z0-9.+-]+|audio\/[a-z0-9.+-]+|video\/[a-z0-9.+-]+);/i;
208
- var SAFE_TAGS = /* @__PURE__ */ new Set([
209
- "a",
210
- "abbr",
211
- "b",
212
- "blockquote",
213
- "br",
214
- "caption",
215
- "cite",
216
- "code",
217
- "col",
218
- "colgroup",
219
- "data",
220
- "dd",
221
- "del",
222
- "details",
223
- "dfn",
224
- "div",
225
- "dl",
226
- "dt",
227
- "em",
228
- "figcaption",
229
- "figure",
230
- "h1",
231
- "h2",
232
- "h3",
233
- "h4",
234
- "h5",
235
- "h6",
236
- "hr",
237
- "i",
238
- "img",
239
- "kbd",
240
- "li",
241
- "mark",
242
- "ol",
243
- "p",
244
- "pre",
245
- "q",
246
- "s",
247
- "samp",
248
- "small",
249
- "source",
250
- "span",
251
- "strong",
252
- "sub",
253
- "summary",
254
- "sup",
255
- "table",
256
- "tbody",
257
- "td",
258
- "tfoot",
259
- "th",
260
- "thead",
261
- "time",
262
- "tr",
263
- "track",
264
- "u",
265
- "ul",
266
- "var",
267
- "video",
268
- "audio"
269
- ]);
270
- var DROP_WITH_CONTENT_TAGS = /* @__PURE__ */ new Set([
271
- "base",
272
- "button",
273
- "embed",
274
- "form",
275
- "iframe",
276
- "input",
277
- "link",
278
- "meta",
279
- "object",
280
- "option",
281
- "script",
282
- "select",
283
- "style",
284
- "svg",
285
- "template",
286
- "textarea"
287
- ]);
288
- var GLOBAL_ATTRS = /* @__PURE__ */ new Set(["class", "id", "title", "role"]);
289
- var TAG_ATTRS = {
290
- a: /* @__PURE__ */ new Set(["href", "target", "rel"]),
291
- audio: /* @__PURE__ */ new Set(["src", "controls", "preload", "muted", "loop"]),
292
- col: /* @__PURE__ */ new Set(["span", "width"]),
293
- colgroup: /* @__PURE__ */ new Set(["span"]),
294
- data: /* @__PURE__ */ new Set(["value"]),
295
- img: /* @__PURE__ */ new Set(["src", "alt", "width", "height", "loading", "decoding"]),
296
- li: /* @__PURE__ */ new Set(["value"]),
297
- ol: /* @__PURE__ */ new Set(["start", "type"]),
298
- q: /* @__PURE__ */ new Set(["cite"]),
299
- source: /* @__PURE__ */ new Set(["src", "type", "media"]),
300
- td: /* @__PURE__ */ new Set(["colspan", "rowspan", "align"]),
301
- th: /* @__PURE__ */ new Set(["colspan", "rowspan", "align", "scope"]),
302
- time: /* @__PURE__ */ new Set(["datetime"]),
303
- track: /* @__PURE__ */ new Set(["src", "kind", "label", "srclang", "default"]),
304
- video: /* @__PURE__ */ new Set([
305
- "src",
306
- "poster",
307
- "width",
308
- "height",
309
- "controls",
310
- "preload",
311
- "muted",
312
- "loop",
313
- "playsinline"
314
- ])
315
- };
316
- var SAFE_ATTR_NAME_RE = /^[a-z][a-z0-9:_.-]*$/;
317
- var SAFE_OL_TYPES = /* @__PURE__ */ new Set(["1", "a", "A", "i", "I"]);
318
- var SAFE_PRELOAD_VALUES = /* @__PURE__ */ new Set(["none", "metadata", "auto"]);
319
- var SAFE_TRACK_KINDS = /* @__PURE__ */ new Set(["subtitles", "captions", "descriptions", "chapters", "metadata"]);
320
- function sanitizeUrl(url, kind = "link", options) {
321
- if (typeof url !== "string") return null;
322
- const trimmed = url.trim();
323
- if (!trimmed) return null;
324
- const compact = stripUrlSchemeNoise(trimmed);
325
- const colon = compact.indexOf(":");
326
- const firstPathChar = firstIndexOfAny(compact, ["/", "?", "#"]);
327
- const hasScheme = colon >= 0 && (firstPathChar < 0 || colon < firstPathChar);
328
- if (!hasScheme) return trimmed;
329
- const scheme = compact.slice(0, colon).toLowerCase();
330
- if (kind === "media") {
331
- if (scheme === "data") return SAFE_DATA_MEDIA_RE.test(compact) ? trimmed : null;
332
- return SAFE_MEDIA_SCHEMES.has(scheme) ? trimmed : null;
333
- }
334
- if (SAFE_LINK_SCHEMES.has(scheme)) return trimmed;
335
- if (options?.extraLinkSchemes?.includes(scheme) && !NEVER_ALLOWED_SCHEMES.has(scheme)) {
336
- return trimmed;
337
- }
338
- return null;
339
- }
340
- function sanitizeHtmlNodes(nodes) {
341
- const out = [];
342
- for (const node of nodes) {
343
- out.push(...sanitizeHtmlNode(node));
344
- }
345
- return out;
346
- }
347
- function sanitizeHtmlNode(node) {
348
- switch (node.type) {
349
- case "htmlText":
350
- return [node];
351
- case "htmlComment":
352
- return [];
353
- case "htmlElement":
354
- return sanitizeHtmlElement(node);
355
- }
356
- }
357
- function sanitizeHtmlElement(node) {
358
- const tag = node.tagName.toLowerCase();
359
- if (DROP_WITH_CONTENT_TAGS.has(tag)) return [];
360
- const children = sanitizeHtmlNodes(node.children);
361
- if (!SAFE_TAGS.has(tag)) return children;
362
- return [
363
- {
364
- type: "htmlElement",
365
- tagName: tag,
366
- attributes: sanitizeAttrs(tag, node.attributes),
367
- children,
368
- selfClosing: node.selfClosing
369
- }
370
- ];
371
- }
372
- function sanitizeAttrs(tag, attrs) {
373
- const out = {};
374
- for (const [rawName, rawValue] of Object.entries(attrs)) {
375
- const name = rawName.toLowerCase();
376
- if (!isAllowedAttr(tag, name)) continue;
377
- const value = String(rawValue);
378
- const safeValue = sanitizeAttrValue(tag, name, value);
379
- if (safeValue === null) continue;
380
- out[name] = safeValue;
381
- }
382
- if (tag === "a" && out.target === "_blank") {
383
- out.rel = ensureRelTokens(out.rel, ["noopener", "noreferrer"]);
384
- }
385
- return out;
386
- }
387
- function isAllowedAttr(tag, name) {
388
- if (!SAFE_ATTR_NAME_RE.test(name)) return false;
389
- if (name.startsWith("on")) return false;
390
- if (name.startsWith("aria-") || name.startsWith("data-")) return true;
391
- if (GLOBAL_ATTRS.has(name)) return true;
392
- return TAG_ATTRS[tag]?.has(name) ?? false;
393
- }
394
- function sanitizeAttrValue(tag, name, value) {
395
- if (name === "href") return sanitizeUrl(value, "link");
396
- if (name === "src" || name === "poster") return sanitizeUrl(value, "media");
397
- if ((name === "width" || name === "height" || name === "span" || name === "colspan" || name === "rowspan" || name === "value") && !isNonNegativeInteger(value)) {
398
- return null;
399
- }
400
- if (name === "start" && !isInteger(value)) return null;
401
- if (name === "type" && tag === "ol" && !SAFE_OL_TYPES.has(value)) return null;
402
- if (name === "preload" && !SAFE_PRELOAD_VALUES.has(value)) return null;
403
- if (name === "kind" && tag === "track" && !SAFE_TRACK_KINDS.has(value)) return null;
404
- if (name === "align" && value !== "left" && value !== "right" && value !== "center") return null;
405
- if (name === "target")
406
- return value === "_blank" || value === "_self" || value === "_parent" || value === "_top" ? value : null;
407
- if (name === "rel") return sanitizeRel(value);
408
- return value;
409
- }
410
- function sanitizeRel(value) {
411
- return relTokens(value).join(" ");
412
- }
413
- function ensureRelTokens(value, required) {
414
- const tokens = new Set(value ? relTokens(value) : []);
415
- for (const token of required) tokens.add(token);
416
- return Array.from(tokens).join(" ");
417
- }
418
- function relTokens(value) {
419
- const tokens = value.split(/\s+/).map((token) => token.trim().toLowerCase()).filter(Boolean).filter((token) => /^[a-z0-9_-]+$/.test(token));
420
- return Array.from(new Set(tokens));
421
- }
422
- function isInteger(value) {
423
- return /^-?\d+$/.test(value.trim());
424
- }
425
- function isNonNegativeInteger(value) {
426
- return /^\d+$/.test(value.trim());
427
- }
428
- function firstIndexOfAny(value, needles) {
429
- let result = -1;
430
- for (const needle of needles) {
431
- const index = value.indexOf(needle);
432
- if (index >= 0 && (result < 0 || index < result)) result = index;
433
- }
434
- return result;
435
- }
436
- function stripUrlSchemeNoise(value) {
437
- let out = "";
438
- for (const char of value) {
439
- const code = char.charCodeAt(0);
440
- if (code <= 32 || code === 127 || char.trim() === "") continue;
441
- out += char;
442
- }
443
- return out;
444
- }
445
-
446
203
  // src/markdown/resourcePolicy.ts
447
204
  var DEFAULT_RESOURCE_MAX_BYTES = 64 * 1024 * 1024;
448
205
  var DEFAULT_RESOURCE_TIMEOUT_MS = 15e3;
@@ -633,8 +390,6 @@ function tooLarge(maxBytes) {
633
390
 
634
391
  export {
635
392
  stringifyMarkdown,
636
- sanitizeUrl,
637
- sanitizeHtmlNodes,
638
393
  DEFAULT_RESOURCE_MAX_BYTES,
639
394
  DEFAULT_RESOURCE_TIMEOUT_MS,
640
395
  DEFAULT_INTERACTIVE_RESOURCE_POLICY,
@@ -1,11 +1,11 @@
1
- import { aX as TemplateBlock, aY as TemplateContext, V as Layer, p as CustomTemplateDefinition, a_ as TemplateRegistry, b1 as Theme, bq as ViewportConfig, az as PersistentLayerConfig, G as DocBlock, br as ViewportOrientation, ay as PersistentLayer, be as TitleBlockInput, aM as SectionHeaderInput, aS as StatHighlightInput, aH as QuoteBlockInput, L as FactCardInput, bl as TwoColumnInput, u as DateEventInput, T as ImageWithCaptionInput, Y as LeftFeatureInput, aK as RightFeatureInput, $ as MapBlockInput, aR as StartBlockConfig, O as FullBleedQuoteInput, _ as ListBlockInput, aD as PhotoGridInput, w as DefinitionCardInput, n as ComparisonBarInput, aG as PullQuoteInput, bp as VideoWithCaptionInput, bo as VideoPullQuoteInput, t as DataTableInput, x as DiagramBlockInput, bg as TreeBlockInput, ba as TimelineBlockInput, B as Block, I as DrawingBlockInput, a3 as MarkerStyle, A as AccentImage, S as ImageTreatment, a as AccentPosition, c as Animation, d as AnimationType, b3 as ThemeColorScheme, F as Doc, b5 as ThemeRegistry, ar as PageEmphasis, b4 as ThemePageStyle, H as DocDiagnostic, E as DiagramTemplateNode, z as DiagramTemplateEdge, bd as TimelineTemplateTrack, bc as TimelineTemplateLink } from '../Doc-COe-rPQB.js';
2
- export { J as FRONTMATTER_CUSTOM_TEMPLATES_KEY, K as FRONTMATTER_CUSTOM_THEMES_KEY, X as LayoutHints, aJ as RenderStyle, b2 as ThemeColorPalette, b8 as ThemeStyle, b9 as ThemeTypography, bm as VIEWPORT_PRESETS, bs as ViewportPreset, bx as createTemplateContext, bE as getLayoutHints, bH as getTwoColumnPositions, bI as getViewport, bJ as getViewportOrientation, bL as isTemplateBlock, bO as scaledFontSize } from '../Doc-COe-rPQB.js';
1
+ import { aY as TemplateBlock, aZ as TemplateContext, W as Layer, q as CustomTemplateDefinition, a$ as TemplateRegistry, b2 as Theme, br as ViewportConfig, aA as PersistentLayerConfig, H as DocBlock, bs as ViewportOrientation, az as PersistentLayer, bf as TitleBlockInput, aN as SectionHeaderInput, o as ContentBlockInput, aT as StatHighlightInput, aI as QuoteBlockInput, M as FactCardInput, bm as TwoColumnInput, v as DateEventInput, U as ImageWithCaptionInput, Z as LeftFeatureInput, aL as RightFeatureInput, a0 as MapBlockInput, aS as StartBlockConfig, P as FullBleedQuoteInput, $ as ListBlockInput, aE as PhotoGridInput, x as DefinitionCardInput, n as ComparisonBarInput, aH as PullQuoteInput, bq as VideoWithCaptionInput, bp as VideoPullQuoteInput, u as DataTableInput, y as DiagramBlockInput, bh as TreeBlockInput, bb as TimelineBlockInput, B as Block, J as DrawingBlockInput, a4 as MarkerStyle, A as AccentImage, T as ImageTreatment, a as AccentPosition, c as Animation, d as AnimationType, b4 as ThemeColorScheme, G as Doc, b6 as ThemeRegistry, as as PageEmphasis, b5 as ThemePageStyle, I as DocDiagnostic, F as DiagramTemplateNode, E as DiagramTemplateEdge, be as TimelineTemplateTrack, bd as TimelineTemplateLink } from '../Doc-BrgZC7SE.js';
2
+ export { K as FRONTMATTER_CUSTOM_TEMPLATES_KEY, L as FRONTMATTER_CUSTOM_THEMES_KEY, Y as LayoutHints, aK as RenderStyle, b3 as ThemeColorPalette, b9 as ThemeStyle, ba as ThemeTypography, bn as VIEWPORT_PRESETS, bt as ViewportPreset, by as createTemplateContext, bF as getLayoutHints, bI as getTwoColumnPositions, bJ as getViewport, bK as getViewportOrientation, bM as isTemplateBlock, bP as scaledFontSize } from '../Doc-BrgZC7SE.js';
3
3
  import { K as MarkdownNode, a2 as TransitionType, a1 as TransitionDirection, M as MarkdownBlockNode, r as MarkdownHeading, n as MarkdownDocument, S as MarkdownTable, i as MarkdownCodeBlock, F as MarkdownList } from '../types-CUNc9biN.js';
4
4
  import { C as CoercedBlockMeta } from '../annotationCoercion-PtRQhk5V.js';
5
- import { c as PageSection } from '../materializePageSection-BSMOocve.js';
6
- export { M as MaterializePageSectionOptions, a as MaterializePageSectionsOptions, P as PageMedia, b as PageRichText, d as PageSectionDiagnostic, e as PageSectionItem, f as PageSectionMaterialization, g as PageSectionSource, h as PageSpatialKind, i as PageTransformHints, m as materializePageSection, j as materializePageSections, r as resolvePageStyle } from '../materializePageSection-BSMOocve.js';
5
+ import { c as PageSection } from '../materializePageSection-CrZWYnXM.js';
6
+ export { M as MaterializePageSectionOptions, a as MaterializePageSectionsOptions, P as PageMedia, b as PageRichText, d as PageSectionDiagnostic, e as PageSectionItem, f as PageSectionMaterialization, g as PageSectionSource, h as PageSpatialKind, i as PageTransformHints, m as materializePageSection, j as materializePageSections, r as resolvePageStyle } from '../materializePageSection-CrZWYnXM.js';
7
7
  import { C as ContentContainer } from '../ContentContainer-B2w9sUoL.js';
8
- export { D as DEFAULT_THEME, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-BUTWjufL.js';
8
+ export { D as DEFAULT_THEME, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-DJt89gyP.js';
9
9
 
10
10
  /** Runtime registry composition for built-in and document-scoped templates. */
11
11
 
@@ -107,6 +107,182 @@ interface TemplateMetadata {
107
107
  }
108
108
  declare const TEMPLATE_METADATA: Record<string, TemplateMetadata>;
109
109
 
110
+ /** Agent-oriented behavior metadata for every built-in template. */
111
+ type TemplateAuthoringRole = 'opener' | 'divider' | 'content' | 'highlight' | 'quote' | 'comparison' | 'event' | 'media' | 'data' | 'spatial';
112
+ type TemplateBodyPolicy = 'complete' | 'derived' | 'ignored' | 'structured';
113
+ interface TemplateAuthoringMetadata {
114
+ /** Broad semantic job, independent of visual theme. */
115
+ role: TemplateAuthoringRole;
116
+ /** How source body prose participates in the rendered result. */
117
+ bodyPolicy: TemplateBodyPolicy;
118
+ /** Whether this template is a loss-averse default before visual optimization. */
119
+ safeForContentFirst: boolean;
120
+ /** Preferred annotation placement. Standalone annotations remain supported for deliberate extra blocks. */
121
+ placement: 'heading';
122
+ }
123
+ /**
124
+ * Kept exhaustive over TemplateBlock so adding a template requires an explicit
125
+ * statement about content retention before it can ship.
126
+ */
127
+ declare const TEMPLATE_AUTHORING_METADATA: {
128
+ readonly title: {
129
+ readonly role: "opener";
130
+ readonly bodyPolicy: "ignored";
131
+ readonly safeForContentFirst: false;
132
+ readonly placement: "heading";
133
+ };
134
+ readonly sectionHeader: {
135
+ readonly role: "divider";
136
+ readonly bodyPolicy: "ignored";
137
+ readonly safeForContentFirst: false;
138
+ readonly placement: "heading";
139
+ };
140
+ readonly content: {
141
+ readonly role: "content";
142
+ readonly bodyPolicy: "complete";
143
+ readonly safeForContentFirst: true;
144
+ readonly placement: "heading";
145
+ };
146
+ readonly statHighlight: {
147
+ readonly role: "highlight";
148
+ readonly bodyPolicy: "derived";
149
+ readonly safeForContentFirst: false;
150
+ readonly placement: "heading";
151
+ };
152
+ readonly quote: {
153
+ readonly role: "quote";
154
+ readonly bodyPolicy: "derived";
155
+ readonly safeForContentFirst: false;
156
+ readonly placement: "heading";
157
+ };
158
+ readonly factCard: {
159
+ readonly role: "highlight";
160
+ readonly bodyPolicy: "derived";
161
+ readonly safeForContentFirst: false;
162
+ readonly placement: "heading";
163
+ };
164
+ readonly twoColumn: {
165
+ readonly role: "comparison";
166
+ readonly bodyPolicy: "structured";
167
+ readonly safeForContentFirst: false;
168
+ readonly placement: "heading";
169
+ };
170
+ readonly dateEvent: {
171
+ readonly role: "event";
172
+ readonly bodyPolicy: "derived";
173
+ readonly safeForContentFirst: false;
174
+ readonly placement: "heading";
175
+ };
176
+ readonly imageWithCaption: {
177
+ readonly role: "media";
178
+ readonly bodyPolicy: "derived";
179
+ readonly safeForContentFirst: false;
180
+ readonly placement: "heading";
181
+ };
182
+ readonly leftFeature: {
183
+ readonly role: "media";
184
+ readonly bodyPolicy: "derived";
185
+ readonly safeForContentFirst: false;
186
+ readonly placement: "heading";
187
+ };
188
+ readonly rightFeature: {
189
+ readonly role: "media";
190
+ readonly bodyPolicy: "derived";
191
+ readonly safeForContentFirst: false;
192
+ readonly placement: "heading";
193
+ };
194
+ readonly map: {
195
+ readonly role: "spatial";
196
+ readonly bodyPolicy: "structured";
197
+ readonly safeForContentFirst: false;
198
+ readonly placement: "heading";
199
+ };
200
+ readonly fullBleedQuote: {
201
+ readonly role: "quote";
202
+ readonly bodyPolicy: "derived";
203
+ readonly safeForContentFirst: false;
204
+ readonly placement: "heading";
205
+ };
206
+ readonly list: {
207
+ readonly role: "content";
208
+ readonly bodyPolicy: "derived";
209
+ readonly safeForContentFirst: false;
210
+ readonly placement: "heading";
211
+ };
212
+ readonly photoGrid: {
213
+ readonly role: "media";
214
+ readonly bodyPolicy: "structured";
215
+ readonly safeForContentFirst: false;
216
+ readonly placement: "heading";
217
+ };
218
+ readonly definitionCard: {
219
+ readonly role: "content";
220
+ readonly bodyPolicy: "derived";
221
+ readonly safeForContentFirst: false;
222
+ readonly placement: "heading";
223
+ };
224
+ readonly comparisonBar: {
225
+ readonly role: "comparison";
226
+ readonly bodyPolicy: "structured";
227
+ readonly safeForContentFirst: false;
228
+ readonly placement: "heading";
229
+ };
230
+ readonly pullQuote: {
231
+ readonly role: "quote";
232
+ readonly bodyPolicy: "derived";
233
+ readonly safeForContentFirst: false;
234
+ readonly placement: "heading";
235
+ };
236
+ readonly videoWithCaption: {
237
+ readonly role: "media";
238
+ readonly bodyPolicy: "derived";
239
+ readonly safeForContentFirst: false;
240
+ readonly placement: "heading";
241
+ };
242
+ readonly videoPullQuote: {
243
+ readonly role: "media";
244
+ readonly bodyPolicy: "derived";
245
+ readonly safeForContentFirst: false;
246
+ readonly placement: "heading";
247
+ };
248
+ readonly dataTable: {
249
+ readonly role: "data";
250
+ readonly bodyPolicy: "structured";
251
+ readonly safeForContentFirst: false;
252
+ readonly placement: "heading";
253
+ };
254
+ readonly diagram: {
255
+ readonly role: "spatial";
256
+ readonly bodyPolicy: "structured";
257
+ readonly safeForContentFirst: false;
258
+ readonly placement: "heading";
259
+ };
260
+ readonly tree: {
261
+ readonly role: "spatial";
262
+ readonly bodyPolicy: "structured";
263
+ readonly safeForContentFirst: false;
264
+ readonly placement: "heading";
265
+ };
266
+ readonly timeline: {
267
+ readonly role: "spatial";
268
+ readonly bodyPolicy: "structured";
269
+ readonly safeForContentFirst: false;
270
+ readonly placement: "heading";
271
+ };
272
+ readonly drawing: {
273
+ readonly role: "spatial";
274
+ readonly bodyPolicy: "structured";
275
+ readonly safeForContentFirst: false;
276
+ readonly placement: "heading";
277
+ };
278
+ readonly layout: {
279
+ readonly role: "spatial";
280
+ readonly bodyPolicy: "structured";
281
+ readonly safeForContentFirst: false;
282
+ readonly placement: "heading";
283
+ };
284
+ };
285
+
110
286
  /**
111
287
  * Exhaustive media-layout policy for every built-in block template.
112
288
  *
@@ -150,7 +326,7 @@ interface BlockMediaLayoutPolicy {
150
326
  variants?: SupplementalMediaVariantMatrix;
151
327
  }
152
328
  /**
153
- * Canonical media contract for all 25 built-in templates. Entries are kept
329
+ * Canonical media contract for all built-in templates. Entries are kept
154
330
  * in registry/gallery order to make policy reviews easy to scan.
155
331
  */
156
332
  declare const BLOCK_MEDIA_LAYOUT_POLICIES: {
@@ -170,6 +346,13 @@ declare const BLOCK_MEDIA_LAYOUT_POLICIES: {
170
346
  readonly unconsumedMedia: "reserve-when-no-native-media";
171
347
  readonly variants: SupplementalMediaVariantMatrix;
172
348
  };
349
+ readonly content: {
350
+ readonly summary: "Preserves the complete heading and body; supplemental media receives a companion field.";
351
+ readonly noMedia: "template-default";
352
+ readonly ownership: "supplemental";
353
+ readonly unconsumedMedia: "reserved-slot";
354
+ readonly variants: SupplementalMediaVariantMatrix;
355
+ };
173
356
  readonly statHighlight: {
174
357
  readonly summary: "Uses its optional accent image natively; otherwise supplemental media occupies a companion field.";
175
358
  readonly noMedia: "template-without-optional-media";
@@ -439,6 +622,17 @@ declare function titleBlock(input: TitleBlockInput, context: TemplateContext): L
439
622
 
440
623
  declare function sectionHeader(input: SectionHeaderInput, context: TemplateContext): Layer[];
441
624
 
625
+ /**
626
+ * Content-first template.
627
+ *
628
+ * Unlike visual-summary templates, this template deliberately preserves the
629
+ * complete plain-text projection of a Markdown block. It is intended as the
630
+ * loss-averse first pass for generated decks; authors can replace it with a
631
+ * more visual template after validation and preview.
632
+ */
633
+
634
+ declare function contentBlock(input: ContentBlockInput, context: TemplateContext): Layer[];
635
+
442
636
  /**
443
637
  * Stat Highlight Template
444
638
  *
@@ -1466,6 +1660,14 @@ interface EmbeddedVideo {
1466
1660
  declare function extractBodyPlainText(contents?: MarkdownBlockNode[]): string;
1467
1661
  /** Extract list items as plain text. */
1468
1662
  declare function extractListItems(contents?: MarkdownBlockNode[]): string[];
1663
+ /** One authored Markdown list item with both plain and rich projections. */
1664
+ interface RichListItem {
1665
+ text: string;
1666
+ markdown: MarkdownBlockNode[];
1667
+ html?: string;
1668
+ }
1669
+ /** Extract list items without discarding their inline Markdown formatting. */
1670
+ declare function extractRichListItems(contents?: MarkdownBlockNode[]): RichListItem[];
1469
1671
  /**
1470
1672
  * Find images referenced anywhere in block contents — both markdown
1471
1673
  * shorthand `![alt](url)` (type `image`) and raw HTML `<img>` tags
@@ -2768,4 +2970,4 @@ declare function treeFromMarkdownList(list: MarkdownList): Tree;
2768
2970
  /** Find the first top-level markdown list in a block's body, if any. */
2769
2971
  declare function findFirstList(contents: MarkdownBlockNode[] | undefined): MarkdownList | undefined;
2770
2972
 
2771
- export { ASCII_CHAR_H, ASCII_CHAR_W, ASCII_DIAGRAM_FENCE_LANGS, ASCII_TIMELINE_FENCE_LANGS, type AccentLayout, type AsciiDiagram, type AsciiDiagramDetection, type AsciiDiagramEdge, type AsciiDiagramNode, type AsciiTimeline, type AsciiTimelineDetection, type AsciiTimelineEvent, type AsciiTimelineLink, type AsciiTimelineMarker, type AsciiTimelineSide, type AsciiTimelineStats, type AsciiTimelineStyle, type AsciiTimelineTrack, type AudioSegmentTiming, BASE_INPUT_DESCRIPTORS, BLOCK_MEDIA_LAYOUT_POLICIES, type BlockLayerMaterialization, type BlockMediaLayoutPolicy, type BuiltInTemplateName, CONTAINER_TEMPLATES, type ClipBox, type ConnectorAnchor, type ConnectorPort, type ConnectorRouting, type ConnectorSnapPoint, type CoverBlockInput, DEFAULT_LAYOUT, DIAGRAM_LABEL_HORIZONTAL_PADDING, DIAGRAM_LABEL_LINE_HEIGHT, DIAGRAM_LABEL_MIN_FONT_SIZE, DIAGRAM_LABEL_VERTICAL_PADDING, type DataFenceParseResult, type DeriveTemplateInputsOptions, type DetectAsciiTimelineOptions, type DiagramEdge, type DiagramLabelFit, type DiagramLayout, type DiagramLayoutOptions, type DiagramNodePosition, DocBlock, type DrawingConnector, type DrawingLayout, type DrawingLayoutOptions, type DrawingShape, type DrawingShapeKind, type EmbeddedVideo, type ExpandDocBlocksOptions, type ExtractedTableData, type FirstImage, type InputCoercion, type LayerMaterializationDiagnostic, type LayerMaterializationFailureMode, type LayerMaterializationSource, type LayoutLayerDefaults, type LayoutLayersResult, type MarkdownToDocOptions, type MarkdownValidationResult, type MaterializeBlockLayersOptions, type NarrationResolution, type NativeMediaLayout, type NoMediaLayout, PAGE_BASE_CSS, PATH_SHAPE_KINDS, PageSection, type PageSectionContext, type PageSectionDraft, PersistentLayerConfig, type RenderAsciiDiagramOptions, type RenderAsciiTimelineOptions, type RenderTreeOptions, type RepairResult, type ResolvedPageBlock, type RuntimeTemplateRegistry, SHAPE_NAMES, type SectionExtractor, type SupplementalMediaLayoutVariant, type SupplementalMediaShape, type SupplementalMediaVariantMatrix, TEMPLATE_INPUT_DESCRIPTORS, TEMPLATE_METADATA, TREE_FENCE_LANGS, TemplateBlock, TemplateContext, type TemplateInputDescriptor, type TemplateMediaOwnership, type TemplateMetadata, type TemplateParamFinding, Theme, ThemeColorScheme, type Tree, type TreeDetection, type TreeItem, type TreeNode, type UnconsumedMediaBehavior, type ValidateOptions, ViewportConfig, ViewportOrientation, adjustY, anchorPoint, applyNarrationTiming, applyRenderStyleToLayers, asciiCellToCanvas, asciiDiagramFromBlocks, asciiDiagramFromTemplateData, asciiDiagramToTemplateData, asciiTimelineToTemplateData, autoTemplatePreservesContent, buildPageCss, buildPageCssVars, buildRegistry, canvasToAsciiCell, clipEndpoints, clipPoint, coerceTemplateParams, comparisonBar, computeDiagramLayout, computeDrawingLayout, computeLayoutLayers, connectorPath, countBlocks, coverBlock, createAccentLayers, cssFilterForTreatment, dataTable, dateEvent, definitionCard, deriveTemplateInputs, detectAsciiDiagram, detectAsciiTimeline, detectTree, diagramBlock, docToMarkdown, drawingBlock, expandCoverBlock, expandDocBlocks, expandPersistentLayers, extractBlockquoteText, extractBodyPlainText, extractEmbeddedVideos, extractFirstEmbeddedVideo, extractFirstImage, extractImages, extractListItems, extractTableData, extractTableFromContents, factCard, fallbackBlockLayers, findFirstList, findFirstTable, fitDiagramLabel, flattenBlocks, flattenRenderableBlocks, fullBleedQuote, getAccentLayout, getAnimationProgress, getAnimationStyle, getAvailableTemplates, getBlockBodyText, getBlockDepth, getBlockMediaLayoutPolicy, getDefaultAnimation, getDefaultAnimationDuration, getOverlayOpacity, getPersistentLayersFromTheme, getPinnedBlockMeta, getTemplateHint, getThemeFont, getTransitionClass, hasTemplate, imageWithCaption, isAsciiDiagramFence, isAsciiTimelineFence, isContainerTemplate, isDataFence, isEligibleAsciiFenceLang, isEligibleAsciiTimelineFenceLang, isEligibleTreeFenceLang, isExplicitDiagramLang, isExplicitTimelineLang, isExplicitTreeLang, isRepairableDiagram, isShapeName, isTemplatedPageBlock, isTreeFence, isWrappedFlowTimelineSource, layoutBlock, leftFeature, lineStyleDasharray, lintTemplateParams, listBlock, mapBlock, markdownToDoc, markerPath, materializeBlockLayers, nearestSnapPoint, normalizeShapeKind, pageStyleDataAttributes, parseAsciiDiagram, parseAsciiTimeline, parseAsciiTimelineWithStats, parseDataFence, parseTree, parseWrappedFlowTimeline, parseYamlSubset, photoGrid, pullQuote, quoteBlock, readCustomTemplatesFromFrontmatter, readCustomThemesFromFrontmatter, renderAsciiDiagram, renderAsciiTimeline, renderTree, repairAsciiDiagram, replaceDataFence, resolveAudioMapping, resolveColorScheme, resolvePageBlock, resolvePersistentLayers, resolveTemplateName, resolveThemeForDoc, rightFeature, scaleAnimationDuration, scoreTextSimilarity, sectionExtractors, sectionHeader, shapePath, shouldUseShadow, snapEndpoints, snapPoints, statHighlight, templateRegistry, themeWantsAmbientMotion, themedEntrance, themedFontSize, themedImageTreatment, themedScrim, themedSurfaceGradient, timelineBlock, titleBlock, treeBlock, treeFromMarkdownList, treeFromTemplateData, treeToTemplateData, twoColumn, validateMarkdownDoc, validateMarkdownSource, videoPullQuote, videoWithCaption, wrapWithPersistentLayers, writeCustomTemplatesToFrontmatter, writeCustomThemesToFrontmatter };
2973
+ export { ASCII_CHAR_H, ASCII_CHAR_W, ASCII_DIAGRAM_FENCE_LANGS, ASCII_TIMELINE_FENCE_LANGS, type AccentLayout, type AsciiDiagram, type AsciiDiagramDetection, type AsciiDiagramEdge, type AsciiDiagramNode, type AsciiTimeline, type AsciiTimelineDetection, type AsciiTimelineEvent, type AsciiTimelineLink, type AsciiTimelineMarker, type AsciiTimelineSide, type AsciiTimelineStats, type AsciiTimelineStyle, type AsciiTimelineTrack, type AudioSegmentTiming, BASE_INPUT_DESCRIPTORS, BLOCK_MEDIA_LAYOUT_POLICIES, type BlockLayerMaterialization, type BlockMediaLayoutPolicy, type BuiltInTemplateName, CONTAINER_TEMPLATES, type ClipBox, type ConnectorAnchor, type ConnectorPort, type ConnectorRouting, type ConnectorSnapPoint, type CoverBlockInput, DEFAULT_LAYOUT, DIAGRAM_LABEL_HORIZONTAL_PADDING, DIAGRAM_LABEL_LINE_HEIGHT, DIAGRAM_LABEL_MIN_FONT_SIZE, DIAGRAM_LABEL_VERTICAL_PADDING, type DataFenceParseResult, type DeriveTemplateInputsOptions, type DetectAsciiTimelineOptions, type DiagramEdge, type DiagramLabelFit, type DiagramLayout, type DiagramLayoutOptions, type DiagramNodePosition, DocBlock, type DrawingConnector, type DrawingLayout, type DrawingLayoutOptions, type DrawingShape, type DrawingShapeKind, type EmbeddedVideo, type ExpandDocBlocksOptions, type ExtractedTableData, type FirstImage, type InputCoercion, type LayerMaterializationDiagnostic, type LayerMaterializationFailureMode, type LayerMaterializationSource, type LayoutLayerDefaults, type LayoutLayersResult, type MarkdownToDocOptions, type MarkdownValidationResult, type MaterializeBlockLayersOptions, type NarrationResolution, type NativeMediaLayout, type NoMediaLayout, PAGE_BASE_CSS, PATH_SHAPE_KINDS, PageSection, type PageSectionContext, type PageSectionDraft, PersistentLayerConfig, type RenderAsciiDiagramOptions, type RenderAsciiTimelineOptions, type RenderTreeOptions, type RepairResult, type ResolvedPageBlock, type RichListItem, type RuntimeTemplateRegistry, SHAPE_NAMES, type SectionExtractor, type SupplementalMediaLayoutVariant, type SupplementalMediaShape, type SupplementalMediaVariantMatrix, TEMPLATE_AUTHORING_METADATA, TEMPLATE_INPUT_DESCRIPTORS, TEMPLATE_METADATA, TREE_FENCE_LANGS, type TemplateAuthoringMetadata, type TemplateAuthoringRole, TemplateBlock, type TemplateBodyPolicy, TemplateContext, type TemplateInputDescriptor, type TemplateMediaOwnership, type TemplateMetadata, type TemplateParamFinding, Theme, ThemeColorScheme, type Tree, type TreeDetection, type TreeItem, type TreeNode, type UnconsumedMediaBehavior, type ValidateOptions, ViewportConfig, ViewportOrientation, adjustY, anchorPoint, applyNarrationTiming, applyRenderStyleToLayers, asciiCellToCanvas, asciiDiagramFromBlocks, asciiDiagramFromTemplateData, asciiDiagramToTemplateData, asciiTimelineToTemplateData, autoTemplatePreservesContent, buildPageCss, buildPageCssVars, buildRegistry, canvasToAsciiCell, clipEndpoints, clipPoint, coerceTemplateParams, comparisonBar, computeDiagramLayout, computeDrawingLayout, computeLayoutLayers, connectorPath, contentBlock, countBlocks, coverBlock, createAccentLayers, cssFilterForTreatment, dataTable, dateEvent, definitionCard, deriveTemplateInputs, detectAsciiDiagram, detectAsciiTimeline, detectTree, diagramBlock, docToMarkdown, drawingBlock, expandCoverBlock, expandDocBlocks, expandPersistentLayers, extractBlockquoteText, extractBodyPlainText, extractEmbeddedVideos, extractFirstEmbeddedVideo, extractFirstImage, extractImages, extractListItems, extractRichListItems, extractTableData, extractTableFromContents, factCard, fallbackBlockLayers, findFirstList, findFirstTable, fitDiagramLabel, flattenBlocks, flattenRenderableBlocks, fullBleedQuote, getAccentLayout, getAnimationProgress, getAnimationStyle, getAvailableTemplates, getBlockBodyText, getBlockDepth, getBlockMediaLayoutPolicy, getDefaultAnimation, getDefaultAnimationDuration, getOverlayOpacity, getPersistentLayersFromTheme, getPinnedBlockMeta, getTemplateHint, getThemeFont, getTransitionClass, hasTemplate, imageWithCaption, isAsciiDiagramFence, isAsciiTimelineFence, isContainerTemplate, isDataFence, isEligibleAsciiFenceLang, isEligibleAsciiTimelineFenceLang, isEligibleTreeFenceLang, isExplicitDiagramLang, isExplicitTimelineLang, isExplicitTreeLang, isRepairableDiagram, isShapeName, isTemplatedPageBlock, isTreeFence, isWrappedFlowTimelineSource, layoutBlock, leftFeature, lineStyleDasharray, lintTemplateParams, listBlock, mapBlock, markdownToDoc, markerPath, materializeBlockLayers, nearestSnapPoint, normalizeShapeKind, pageStyleDataAttributes, parseAsciiDiagram, parseAsciiTimeline, parseAsciiTimelineWithStats, parseDataFence, parseTree, parseWrappedFlowTimeline, parseYamlSubset, photoGrid, pullQuote, quoteBlock, readCustomTemplatesFromFrontmatter, readCustomThemesFromFrontmatter, renderAsciiDiagram, renderAsciiTimeline, renderTree, repairAsciiDiagram, replaceDataFence, resolveAudioMapping, resolveColorScheme, resolvePageBlock, resolvePersistentLayers, resolveTemplateName, resolveThemeForDoc, rightFeature, scaleAnimationDuration, scoreTextSimilarity, sectionExtractors, sectionHeader, shapePath, shouldUseShadow, snapEndpoints, snapPoints, statHighlight, templateRegistry, themeWantsAmbientMotion, themedEntrance, themedFontSize, themedImageTreatment, themedScrim, themedSurfaceGradient, timelineBlock, titleBlock, treeBlock, treeFromMarkdownList, treeFromTemplateData, treeToTemplateData, twoColumn, validateMarkdownDoc, validateMarkdownSource, videoPullQuote, videoWithCaption, wrapWithPersistentLayers, writeCustomTemplatesToFrontmatter, writeCustomThemesToFrontmatter };