@bendyline/squisq 2.6.0 → 2.7.0

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.
@@ -1149,6 +1149,13 @@ var PANEL_KINDS = /* @__PURE__ */ new Set([
1149
1149
  function isMermaidFence(node) {
1150
1150
  return node.type === "code" && node.lang?.trim().toLowerCase() === "mermaid";
1151
1151
  }
1152
+ function isWidgetFence(node, widgetFenceLangs) {
1153
+ if (isMermaidFence(node)) return true;
1154
+ if (!widgetFenceLangs || widgetFenceLangs.length === 0) return false;
1155
+ if (node.type !== "code") return false;
1156
+ const lang = node.lang?.trim().toLowerCase();
1157
+ return !!lang && widgetFenceLangs.includes(lang);
1158
+ }
1152
1159
  function htmlTreeContainsMedia(nodes) {
1153
1160
  for (const value of nodes) {
1154
1161
  if (!value || typeof value !== "object") continue;
@@ -1169,11 +1176,11 @@ function markdownNodeContainsMedia(value) {
1169
1176
  }
1170
1177
  return Array.isArray(node.children) && node.children.some(markdownNodeContainsMedia);
1171
1178
  }
1172
- function unconsumedRichContent(block, draft) {
1179
+ function unconsumedRichContent(block, draft, widgetFenceLangs) {
1173
1180
  if (!block.contents || block.contents.length === 0) return void 0;
1174
1181
  const templateHasMedia = Boolean(draft.slots.media) || Boolean(draft.slots.items?.some((item) => item.media !== void 0));
1175
1182
  const markdown = block.contents.filter(
1176
- (node) => isMermaidFence(node) || !templateHasMedia && markdownNodeContainsMedia(node)
1183
+ (node) => isWidgetFence(node, widgetFenceLangs) || !templateHasMedia && markdownNodeContainsMedia(node)
1177
1184
  );
1178
1185
  if (markdown.length === 0) return void 0;
1179
1186
  return {
@@ -1181,18 +1188,22 @@ function unconsumedRichContent(block, draft) {
1181
1188
  markdown
1182
1189
  };
1183
1190
  }
1184
- function preserveRichContent(block, draft) {
1185
- const richContent = unconsumedRichContent(block, draft);
1191
+ function preserveRichContent(block, draft, widgetFenceLangs) {
1192
+ const richContent = unconsumedRichContent(block, draft, widgetFenceLangs);
1186
1193
  return richContent ? { ...draft, slots: { ...draft.slots, richContent } } : draft;
1187
1194
  }
1188
- function draftForBlock(block, viewport, customTemplates) {
1195
+ function draftForBlock(block, viewport, customTemplates, widgetFenceLangs) {
1189
1196
  if (isTemplatedPageBlock(block)) {
1190
1197
  const resolved = resolvePageBlock(block);
1191
1198
  const templateName = resolved.templateName;
1192
1199
  const extractor = sectionExtractors[templateName];
1193
1200
  if (extractor) {
1194
1201
  return {
1195
- draft: preserveRichContent(block, extractor(resolved.templateBlock, { block, viewport })),
1202
+ draft: preserveRichContent(
1203
+ block,
1204
+ extractor(resolved.templateBlock, { block, viewport }),
1205
+ widgetFenceLangs
1206
+ ),
1196
1207
  source: "template",
1197
1208
  templateName
1198
1209
  };
@@ -1215,7 +1226,7 @@ function draftForBlock(block, viewport, customTemplates) {
1215
1226
  }
1216
1227
  };
1217
1228
  return {
1218
- draft: preserveRichContent(block, draft2),
1229
+ draft: preserveRichContent(block, draft2, widgetFenceLangs),
1219
1230
  source: "custom-template",
1220
1231
  templateName
1221
1232
  };
@@ -1237,7 +1248,7 @@ function draftForBlock(block, viewport, customTemplates) {
1237
1248
  emphasis: "quiet"
1238
1249
  };
1239
1250
  return {
1240
- draft: preserveRichContent(block, draft),
1251
+ draft: preserveRichContent(block, draft, widgetFenceLangs),
1241
1252
  source: "fallback",
1242
1253
  templateName,
1243
1254
  diagnostic
@@ -1257,7 +1268,7 @@ function draftForBlock(block, viewport, customTemplates) {
1257
1268
  }
1258
1269
  };
1259
1270
  return {
1260
- draft: preserveRichContent(block, draft),
1271
+ draft: preserveRichContent(block, draft, widgetFenceLangs),
1261
1272
  source: "authored"
1262
1273
  };
1263
1274
  }
@@ -1319,7 +1330,7 @@ function materializePageSection(block, options = {}) {
1319
1330
  const theme = options.theme ?? DEFAULT_THEME;
1320
1331
  const viewport = options.viewport ?? VIEWPORT_PRESETS.landscape;
1321
1332
  const pageStyle = resolvePageStyle(theme);
1322
- const result = draftForBlock(block, viewport, options.customTemplates);
1333
+ const result = draftForBlock(block, viewport, options.customTemplates, options.widgetFenceLangs);
1323
1334
  const override = overrideFor(pageStyle, result.draft.kind, result.templateName);
1324
1335
  const background = override?.background ?? (result.draft.mediaBackground ? "media" : "base");
1325
1336
  const emphasis = override?.emphasis ?? result.draft.emphasis ?? "standard";
@@ -1375,7 +1386,7 @@ function materializePageSections(doc, options = {}) {
1375
1386
  }
1376
1387
  const walk = (blocks, depth) => {
1377
1388
  for (const block of blocks) {
1378
- const result = draftForBlock(block, viewport, customTemplates);
1389
+ const result = draftForBlock(block, viewport, customTemplates, options.widgetFenceLangs);
1379
1390
  seeds.push({ ...result, block, depth });
1380
1391
  const consumed = result.draft.kind === "canvas-embed" && isContainerTemplate(result.templateName);
1381
1392
  if (!consumed && block.children && block.children.length > 0) {
@@ -0,0 +1,8 @@
1
+ // src/fence/index.ts
2
+ function fenceRendererLangs(renderers) {
3
+ return renderers ? Object.keys(renderers).map((lang) => lang.trim().toLowerCase()) : [];
4
+ }
5
+
6
+ export {
7
+ fenceRendererLangs
8
+ };
@@ -2,8 +2,8 @@ import { bb as TemplateBlock, bc as TemplateContext, a3 as Layer, w as CustomTem
2
2
  export { T as FRONTMATTER_CUSTOM_TEMPLATES_KEY, U as FRONTMATTER_CUSTOM_THEMES_KEY, a5 as LayoutHints, aY as RenderStyle, bi as ThemeColorPalette, bo as ThemeStyle, bp as ThemeTypography, bC as VIEWPORT_PRESETS, bN as ViewportPreset, bS as createTemplateContext, bZ as getLayoutHints, c0 as getTwoColumnPositions, c1 as getViewport, c2 as getViewportOrientation, c5 as isTemplateBlock, c8 as scaledFontSize } from '../Doc-DBadkoP4.js';
3
3
  import { L as MarkdownNode, a3 as TransitionType, a2 as TransitionDirection, M as MarkdownBlockNode, r as MarkdownHeading, n as MarkdownDocument, T as MarkdownTable, i as MarkdownCodeBlock, G as MarkdownList } from '../types-CcrDFdWH.js';
4
4
  import { C as CoercedBlockMeta } from '../annotationCoercion-CPHEggo3.js';
5
- import { c as PageSection } from '../materializePageSection-DgOFYge7.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-DgOFYge7.js';
5
+ import { c as PageSection } from '../materializePageSection-Rss5thAj.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-Rss5thAj.js';
7
7
  import { C as ContentContainer } from '../ContentContainer-B2w9sUoL.js';
8
8
  export { D as DEFAULT_THEME, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-8BQMY2HV.js';
9
9
 
package/dist/doc/index.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  sectionExtractors,
32
32
  validateMarkdownDoc,
33
33
  validateMarkdownSource
34
- } from "../chunk-KY6SDMQZ.js";
34
+ } from "../chunk-KOU5WRVN.js";
35
35
  import {
36
36
  ASCII_CHAR_H,
37
37
  ASCII_CHAR_W,
@@ -0,0 +1,74 @@
1
+ import { bh as Theme } from '../Doc-DBadkoP4.js';
2
+ import '../types-CcrDFdWH.js';
3
+
4
+ /**
5
+ * Host-pluggable fence renderers — the contract shared by the read path
6
+ * (`@bendyline/squisq-react`'s `MarkdownRenderer` / `LinearDocView`) and
7
+ * the edit path (`@bendyline/squisq-editor-react`'s `HostFenceExtension`).
8
+ *
9
+ * A host registers a renderer per fence *language* (the token after the
10
+ * opening backticks). Wherever squisq renders markdown, a fenced code
11
+ * block whose language is claimed renders through the host's component
12
+ * instead of the default code block; unclaimed fences are untouched.
13
+ *
14
+ * Design constraints the contract encodes:
15
+ *
16
+ * - **All payload lives in the fence body.** The info string's *meta*
17
+ * segment does not survive the WYSIWYG round-trip (ProseMirror keeps
18
+ * only the `language-*` class token), so `meta` is populated on the
19
+ * read path only and renderers must not depend on it.
20
+ * - **Core stays React-free.** `FenceRenderer` returns `unknown`; the
21
+ * react packages narrow it to `ReactNode` at their boundaries.
22
+ * - Failures fall back: the react integrations wrap renderers in an
23
+ * error boundary that degrades to the plain code block, so a broken
24
+ * host widget never takes a document down with it.
25
+ */
26
+
27
+ /** Everything a fence renderer receives for one claimed fence. */
28
+ interface FenceRenderContext {
29
+ /** Normalized (trimmed, lowercased) fence language token. */
30
+ lang: string;
31
+ /**
32
+ * The info-string remainder after the language. READ PATH ONLY — absent
33
+ * in edit mode (it does not survive the ProseMirror round-trip). Do not
34
+ * store payload here; use the body.
35
+ */
36
+ meta?: string;
37
+ /** Fence body, verbatim. */
38
+ value: string;
39
+ /**
40
+ * Parsed body when it was valid JSON or the documented YAML subset
41
+ * (see `parseDataFence` in `@bendyline/squisq/doc`); undefined when
42
+ * parsing failed or was not attempted. Renderers needing guaranteed
43
+ * structure should parse `value` themselves.
44
+ */
45
+ data?: unknown;
46
+ /** Surface-applied theme — read colors/typography directly from it. */
47
+ theme?: Theme;
48
+ /** Which pipeline is rendering: static read view or the live editor. */
49
+ mode: 'read' | 'edit';
50
+ /**
51
+ * Edit mode only: replace the fence body with `next` in one undoable
52
+ * editor transaction. Absent on the read path.
53
+ */
54
+ replaceValue?: (next: string) => void;
55
+ }
56
+ /**
57
+ * A host renderer for one fence language. Returns the host UI for the
58
+ * fence — `ReactNode` in the react integrations; typed `unknown` here so
59
+ * core carries no React dependency.
60
+ */
61
+ type FenceRenderer = (ctx: FenceRenderContext) => unknown;
62
+ /**
63
+ * Registry: normalized fence language → renderer. Keys are matched
64
+ * against `lang.trim().toLowerCase()`; register lowercase keys.
65
+ */
66
+ type FenceRendererMap = Record<string, FenceRenderer>;
67
+ /**
68
+ * The registry's claimed languages, for plumbing that needs the *set*
69
+ * without the functions (e.g. the page materializer's
70
+ * `widgetFenceLangs`, or `CodeSnippetExtension.reservedLanguages`).
71
+ */
72
+ declare function fenceRendererLangs(renderers: FenceRendererMap | undefined): readonly string[];
73
+
74
+ export { type FenceRenderContext, type FenceRenderer, type FenceRendererMap, fenceRendererLangs };
@@ -0,0 +1,6 @@
1
+ import {
2
+ fenceRendererLangs
3
+ } from "../chunk-PGI7HSWE.js";
4
+ export {
5
+ fenceRendererLangs
6
+ };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { D as DEFAULT_THEME, a as DEFAULT_THEME_ID, T as THEMES, g as getAvailab
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-Cq2a3c30.js';
8
8
  export { ASCII_CHAR_H, ASCII_CHAR_W, ASCII_DIAGRAM_FENCE_LANGS, ASCII_TIMELINE_FENCE_LANGS, AccentLayout, AsciiDiagram, AsciiDiagramDetection, AsciiDiagramEdge, AsciiDiagramNode, AsciiTimeline, AsciiTimelineDetection, AsciiTimelineEvent, AsciiTimelineLink, AsciiTimelineMarker, AsciiTimelineSide, AsciiTimelineStats, AsciiTimelineStyle, AsciiTimelineTrack, AudioSegmentTiming, BASE_INPUT_DESCRIPTORS, BLOCK_MEDIA_LAYOUT_POLICIES, BlockLayerMaterialization, BlockMediaLayoutPolicy, BuiltInTemplateName, CONTAINER_TEMPLATES, COVER_SLIDE_FRONTMATTER_KEYS, COVER_SLIDE_TEMPLATE_OPTIONS, ClipBox, ConnectorAnchor, ConnectorPort, ConnectorRouting, ConnectorSnapPoint, CoverBlockInput, CoverSlidePlayback, CoverSlideSettings, CoverSlideTemplate, CoverSlideTemplateOption, DEFAULT_COVER_SLIDE_SETTINGS, DEFAULT_LAYOUT, DIAGRAM_LABEL_HORIZONTAL_PADDING, DIAGRAM_LABEL_LINE_HEIGHT, DIAGRAM_LABEL_MIN_FONT_SIZE, DIAGRAM_LABEL_VERTICAL_PADDING, DataFenceParseResult, DeriveTemplateInputsOptions, DetectAsciiTimelineOptions, DiagramEdge, DiagramLabelFit, DiagramLayout, DiagramLayoutOptions, DiagramNodePosition, DrawingConnector, DrawingLayout, DrawingLayoutOptions, DrawingShape, DrawingShapeKind, EmbeddedVideo, ExpandDocBlocksOptions, ExtractedTableData, FirstImage, InputCoercion, LayerMaterializationDiagnostic, LayerMaterializationFailureMode, LayerMaterializationSource, LayoutLayerDefaults, LayoutLayersResult, MAX_COVER_SLIDE_DURATION_SECONDS, MarkdownToDocOptions, MarkdownValidationResult, MaterializeBlockLayersOptions, NarrationResolution, NativeMediaLayout, NoMediaLayout, PAGE_BASE_CSS, PATH_SHAPE_KINDS, PageSectionContext, PageSectionDraft, RenderAsciiDiagramOptions, RenderAsciiTimelineOptions, RenderTreeOptions, RepairResult, ResolvedPageBlock, RichListItem, RuntimeTemplateRegistry, SHAPE_NAMES, SectionExtractor, SupplementalMediaLayoutVariant, SupplementalMediaShape, SupplementalMediaVariantMatrix, TABLE_FED_TEMPLATES, TEMPLATE_AUTHORING_METADATA, TEMPLATE_INPUT_DESCRIPTORS, TEMPLATE_METADATA, TREE_FENCE_LANGS, TemplateAuthoringMetadata, TemplateAuthoringRole, TemplateBodyPolicy, TemplateInputDescriptor, TemplateMediaOwnership, TemplateMetadata, TemplateParamFinding, Tree, TreeDetection, TreeItem, TreeNode, UnconsumedMediaBehavior, ValidateOptions, adjustY, anchorPoint, applyNarrationTiming, applyRenderStyleToLayers, asciiCellToCanvas, asciiDiagramFromBlocks, asciiDiagramFromTemplateData, asciiDiagramToTemplateData, asciiTimelineToTemplateData, autoTemplatePreservesContent, bigText, 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, fitBigTextSize, 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, resolveCoverSlideSettings, 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 } from './doc/index.js';
9
- export { M as MaterializePageSectionOptions, a as MaterializePageSectionsOptions, P as PageMedia, b as PageRichText, c as PageSection, 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-DgOFYge7.js';
9
+ export { M as MaterializePageSectionOptions, a as MaterializePageSectionsOptions, P as PageMedia, b as PageRichText, c as PageSection, 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-Rss5thAj.js';
10
10
  export { calculateBearing, decodeGeohash, encodeGeohash, geohashOverlapsBounds, geohashToHierarchicalPath, getGeohash4Neighbors, getGeohashPath, getGeohashPrefix, getNeighbors, haversineDistance } from './spatial/index.js';
11
11
  export { LocalForageAdapter, LocalForageAdapterOptions, LocalStorageAdapter, MemoryStorageAdapter, ScopedContentContainer, StorageAdapter, createMediaProviderFromContainer, scopeContainer } from './storage/index.js';
12
12
  export { C as ContentContainer, a as ContentEntry, M as MemoryContentContainer, f as findDocumentPath } from './ContentContainer-B2w9sUoL.js';
@@ -25,3 +25,4 @@ export { I as ICONS, a as IconEntry, b as IconFamily, c as IconTextRun, h as has
25
25
  export { IconSuggestion, canonicalIconToken, iconGlyph, looksLikeIconToken, resolveIcon, suggestIcons } from './icons/index.js';
26
26
  export { BlockContentProfile, RecommendationResult, profileBlockContents, recommendTemplatesForBlock } from './recommend/index.js';
27
27
  export { AlignConfig, AlignInput, BandpassState, BuildNarrationTimingOptions, BuildScriptOptions, DEFAULT_ALIGN_CONFIG, DEFAULT_FEATURE_CONFIG, DEFAULT_NUCLEI_CONFIG, DEFAULT_PACING_CONFIG, DEFAULT_VAD_CONFIG, FeatureConfig, FeatureState, FrameFeatures, NarrationAlignment, NarrationBlockRange, NarrationScript, NarrationSessionConfig, NarrationSessionState, NarrationTimingBlock, NarrationTimingJsonV3, NarrationTrace, NucleiConfig, NucleiState, PacingConfig, PacingState, PacingTick, ScriptBlockRange, ScriptToken, TraceSample, VadConfig, VadState, WordTiming, alignNarration, bandpassRun, buildNarrationScript, buildNarrationTimingJson, createBandpass, createFeatureState, createNarrationSession, createNucleiState, createPacingState, createVadState, detectSyllableOnsets, downsampleTrace, estimateSyllables, expectedSyllablesAt, extractFrameFeatures, featureStep, narrationSessionStep, nucleiStep, pacingStep, parseNarrationTimingJson, reanchorPacing, reanchorSession, traceWordPosAt, vadStep, wordIndexAtChar, wordIndexAtTime, wordPosAtExpectedSyllables } from './narration/index.js';
28
+ export { FenceRenderContext, FenceRenderer, FenceRendererMap, fenceRendererLangs } from './fence/index.js';
package/dist/index.js CHANGED
@@ -24,6 +24,9 @@ import {
24
24
  traceWordPosAt,
25
25
  vadStep
26
26
  } from "./chunk-7Z5T3CUI.js";
27
+ import {
28
+ fenceRendererLangs
29
+ } from "./chunk-PGI7HSWE.js";
27
30
  import {
28
31
  DEFAULT_TRANSFORM_STYLE_ID,
29
32
  analyzeBlocks,
@@ -170,7 +173,7 @@ import {
170
173
  sectionExtractors,
171
174
  validateMarkdownDoc,
172
175
  validateMarkdownSource
173
- } from "./chunk-KY6SDMQZ.js";
176
+ } from "./chunk-KOU5WRVN.js";
174
177
  import {
175
178
  ASCII_CHAR_H,
176
179
  ASCII_CHAR_W,
@@ -742,6 +745,7 @@ export {
742
745
  factCard,
743
746
  fallbackBlockLayers,
744
747
  featureStep,
748
+ fenceRendererLangs,
745
749
  fetchResourceBytes,
746
750
  findDocumentPath,
747
751
  findFirstList,
@@ -191,6 +191,16 @@ interface MaterializePageSectionOptions {
191
191
  totalBlocks?: number;
192
192
  /** Document-scoped custom templates (render as canvas embeds). */
193
193
  customTemplates?: readonly CustomTemplateDefinition[];
194
+ /**
195
+ * Fence languages a host renderer claims as widgets (see
196
+ * `@bendyline/squisq/fence`). Typed-template sections keep only the rich
197
+ * content they haven't already consumed — historically just mermaid
198
+ * fences and media. A claimed fence must survive that filter too, or a
199
+ * host widget inside a callout/card block is dropped before it ever
200
+ * reaches the renderer. Lowercased language tokens; mermaid is always
201
+ * kept regardless.
202
+ */
203
+ widgetFenceLangs?: readonly string[];
194
204
  }
195
205
  /** Doc-level options. */
196
206
  interface MaterializePageSectionsOptions extends MaterializePageSectionOptions {
@@ -1,5 +1,5 @@
1
1
  import { r as ColorScheme, O as Doc, k as Block } from '../Doc-DBadkoP4.js';
2
- import { i as PageTransformHints } from '../materializePageSection-DgOFYge7.js';
2
+ import { i as PageTransformHints } from '../materializePageSection-Rss5thAj.js';
3
3
  import { d as ExtractionType, E as ExtractedElement, b as ExtractionOptions } from '../contentExtractor-BNfVJV2U.js';
4
4
  import '../types-CcrDFdWH.js';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Headless utilities for doc/block rendering, spatial math, Markdown, and storage",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -121,6 +121,11 @@
121
121
  "types": "./dist/narration/index.d.ts",
122
122
  "import": "./dist/narration/index.js",
123
123
  "default": "./dist/narration/index.js"
124
+ },
125
+ "./fence": {
126
+ "types": "./dist/fence/index.d.ts",
127
+ "import": "./dist/fence/index.js",
128
+ "default": "./dist/fence/index.js"
124
129
  }
125
130
  },
126
131
  "scripts": {