@bendyline/squisq 2.13.7 → 2.13.8

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.
@@ -32,7 +32,7 @@ import {
32
32
  profileBlockContents,
33
33
  renderMarkdownBlocksHtml,
34
34
  treeToTemplateData
35
- } from "./chunk-NGQ5TJVX.js";
35
+ } from "./chunk-HGXZMB7K.js";
36
36
  import {
37
37
  anchorPoint,
38
38
  base64ToUtf8,
@@ -12615,6 +12615,7 @@ export {
12615
12615
  videoWithCaption,
12616
12616
  videoPullQuote,
12617
12617
  dataTable,
12618
+ normalizeChartTable,
12618
12619
  buildChartData,
12619
12620
  BLOCK_MEDIA_LAYOUT_POLICIES,
12620
12621
  getBlockMediaLayoutPolicy,
@@ -12661,6 +12662,7 @@ export {
12661
12662
  parseYamlSubset,
12662
12663
  findFirstTable,
12663
12664
  extractTableData,
12665
+ detectPromotableBodyAnnotation,
12664
12666
  getPinnedBlockMeta,
12665
12667
  markdownToDoc,
12666
12668
  flattenBlocks,
@@ -4,7 +4,7 @@ import {
4
4
  flattenRenderableBlocks,
5
5
  getPinnedBlockMeta,
6
6
  markdownToDoc
7
- } from "./chunk-TTJZXUQA.js";
7
+ } from "./chunk-5C6ZO5FV.js";
8
8
  import {
9
9
  deriveTemplateInputs,
10
10
  extractEmbeddedVideos,
@@ -18,7 +18,7 @@ import {
18
18
  isPictureParagraph,
19
19
  isStandaloneHtmlVideo,
20
20
  isTreeFence
21
- } from "./chunk-NGQ5TJVX.js";
21
+ } from "./chunk-HGXZMB7K.js";
22
22
  import {
23
23
  extractContent,
24
24
  mapElementToBlock,
@@ -9,7 +9,7 @@ import {
9
9
  expectedSyllablesAt,
10
10
  flattenRenderableBlocks,
11
11
  wordPosAtExpectedSyllables
12
- } from "./chunk-TTJZXUQA.js";
12
+ } from "./chunk-5C6ZO5FV.js";
13
13
 
14
14
  // src/narration/types.ts
15
15
  var DEFAULT_FEATURE_CONFIG = Object.freeze({
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-FTN6SGW5.js";
4
4
  import {
5
5
  applySavedPresentation
6
- } from "./chunk-CJYN3MTX.js";
6
+ } from "./chunk-CS3MAZZX.js";
7
7
  import {
8
8
  SHAPE_NAMES,
9
9
  buildChartData,
@@ -31,7 +31,7 @@ import {
31
31
  templateRegistry,
32
32
  writeCustomTemplatesToFrontmatter,
33
33
  writeCustomThemesToFrontmatter
34
- } from "./chunk-TTJZXUQA.js";
34
+ } from "./chunk-5C6ZO5FV.js";
35
35
  import {
36
36
  ASCII_TREE_VOCAB,
37
37
  ASCII_VOCAB,
@@ -54,7 +54,7 @@ import {
54
54
  toCells,
55
55
  toGrid,
56
56
  traceBoxes
57
- } from "./chunk-NGQ5TJVX.js";
57
+ } from "./chunk-HGXZMB7K.js";
58
58
  import {
59
59
  iconMarker
60
60
  } from "./chunk-7ZAAICW4.js";
@@ -1,4 +1,4 @@
1
- import { a7 as Layer, k as Block, R as Doc, bt as TemplateBlock, bu as TemplateContext, z as CustomTemplateDefinition, bw as TemplateRegistry, bC as Theme, c7 as ViewportConfig, b0 as PersistentLayerConfig, av as MotionSpec, S as DocBlock, c8 as ViewportOrientation, a$ as PersistentLayer, bP as TitleBlockInput, bh as SectionHeaderInput, j as BigTextInput, v as ContentBlockInput, bn as StatHighlightInput, bb as QuoteBlockInput, Z as FactCardInput, bY as TwoColumnInput, K as DateEventInput, a5 as ImageWithCaptionInput, aa as LeftFeatureInput, be as RightFeatureInput, n as BottomFeatureInput, ao as MediaOnlyInput, bR as TopFeatureInput, af as MapBlockInput, bm as StartBlockConfig, a0 as FullBleedQuoteInput, ad as ListBlockInput, b4 as PhotoGridInput, M as DefinitionCardInput, u as ComparisonBarInput, ba as PullQuoteInput, c6 as VideoWithCaptionInput, c5 as VideoPullQuoteInput, J as DataTableInput, N as DiagramBlockInput, bT as TreeBlockInput, bL as TimelineBlockInput, V as DrawingBlockInput, aj as MarkerStyle, A as AccentImage, a4 as ImageTreatment, a as AccentPosition, c as Animation, d as AnimationType, aw as MotionState, at as MotionProfile, bE as ThemeColorScheme, x as CountUpSpec, bG as ThemeRegistry, aT as PageEmphasis, bF as ThemePageStyle, T as DocDiagnostic, Q as DiagramTemplateNode, P as DiagramTemplateEdge, bO as TimelineTemplateTrack, bN as TimelineTemplateLink } from '../Doc-BCrrYAuK.js';
1
+ import { a7 as Layer, k as Block, R as Doc, bt as TemplateBlock, bu as TemplateContext, z as CustomTemplateDefinition, bw as TemplateRegistry, bC as Theme, c7 as ViewportConfig, b0 as PersistentLayerConfig, av as MotionSpec, S as DocBlock, c8 as ViewportOrientation, a$ as PersistentLayer, bP as TitleBlockInput, bh as SectionHeaderInput, j as BigTextInput, v as ContentBlockInput, bn as StatHighlightInput, bb as QuoteBlockInput, Z as FactCardInput, bY as TwoColumnInput, K as DateEventInput, a5 as ImageWithCaptionInput, aa as LeftFeatureInput, be as RightFeatureInput, n as BottomFeatureInput, ao as MediaOnlyInput, bR as TopFeatureInput, af as MapBlockInput, bm as StartBlockConfig, a0 as FullBleedQuoteInput, ad as ListBlockInput, b4 as PhotoGridInput, M as DefinitionCardInput, u as ComparisonBarInput, ba as PullQuoteInput, c6 as VideoWithCaptionInput, c5 as VideoPullQuoteInput, J as DataTableInput, N as DiagramBlockInput, bT as TreeBlockInput, bL as TimelineBlockInput, V as DrawingBlockInput, aj as MarkerStyle, A as AccentImage, a4 as ImageTreatment, a as AccentPosition, c as Animation, d as AnimationType, aw as MotionState, at as MotionProfile, bE as ThemeColorScheme, x as CountUpSpec, bG as ThemeRegistry, aT as PageEmphasis, bF as ThemePageStyle, T as DocDiagnostic, b9 as PromotedBodyAnnotation, Q as DiagramTemplateNode, P as DiagramTemplateEdge, bO as TimelineTemplateTrack, bN as TimelineTemplateLink } from '../Doc-BCrrYAuK.js';
2
2
  export { W as FRONTMATTER_CUSTOM_TEMPLATES_KEY, X as FRONTMATTER_CUSTOM_THEMES_KEY, a9 as LayoutHints, bd as RenderStyle, bD as ThemeColorPalette, bJ as ThemeStyle, bK as ThemeTypography, bZ as VIEWPORT_PRESETS, c9 as ViewportPreset, ce as createTemplateContext, cl as getLayoutHints, co as getTwoColumnPositions, cp as getViewport, cq as getViewportOrientation, cu as isTemplateBlock, cA as scaledFontSize } from '../Doc-BCrrYAuK.js';
3
3
  import { g as BuildStep, M as MarkdownBlockNode, S as MarkdownListItem, f as BuildSpec, e as BuildCursor, h as BuildTiming, V as MarkdownNode, ae as TransitionType, ad as TransitionDirection, z as MarkdownHeading, v as MarkdownDocument, a2 as MarkdownTable, q as MarkdownCodeBlock, R as MarkdownList } from '../types-Zk8qYuaT.js';
4
4
  import { C as CoercedBlockMeta } from '../annotationCoercion-hTvELpIN.js';
@@ -3782,6 +3782,155 @@ declare function findFirstTable(contents: MarkdownBlockNode[] | undefined): Mark
3782
3782
  */
3783
3783
  declare function extractTableData(table: MarkdownTable): ExtractedTableData;
3784
3784
 
3785
+ /**
3786
+ * Standalone-paragraph annotation parser.
3787
+ *
3788
+ * A paragraph whose entire trimmed text is exactly a `{[…]}` annotation
3789
+ * (nothing before or after) is a *standalone annotation*. Two features share
3790
+ * this shape:
3791
+ *
3792
+ * - **Media annotations** (`{[audio …]}` / `{[video …]}`) — lifted into typed
3793
+ * {@link import('../schemas/Media.js').MediaClip}s by `mediaAnnotations.ts`.
3794
+ * - **Standalone template blocks** (`{[quote]}`, `{[statHighlight …]}`, …) —
3795
+ * turned into heading-less {@link import('../schemas/Doc.js').Block}s by
3796
+ * `annotationBlocks.ts`.
3797
+ *
3798
+ * Both call the single parser here so the annotation grammar (quoting,
3799
+ * escaping, first-token-is-template) stays identical to the heading form.
3800
+ */
3801
+
3802
+ /** The template name + params parsed out of a standalone `{[…]}` paragraph. */
3803
+ interface ParsedAnnotation {
3804
+ /** First bare token, when the annotation leads with one (e.g. `quote`). */
3805
+ template?: string;
3806
+ /** Remaining `key=value` tokens, unquoted/unescaped. */
3807
+ params: Record<string, string>;
3808
+ }
3809
+ /**
3810
+ * Parse a paragraph node that is *exactly* a `{[…]}` annotation (nothing
3811
+ * before or after). Returns the template + params, or null when the node
3812
+ * isn't a standalone annotation (not a paragraph, more than one child, a
3813
+ * non-text child such as a resolved inline icon, or trailing text).
3814
+ */
3815
+ declare function parseStandaloneAnnotation(node: MarkdownBlockNode): ParsedAnnotation | null;
3816
+
3817
+ /**
3818
+ * Media-annotation extraction.
3819
+ *
3820
+ * Lifts standalone body-level media annotations — `{[audio …]}` / `{[video …]}`
3821
+ * — out of a block's markdown contents into typed {@link MediaClip}s. A block
3822
+ * can hold several clips (unlike the single heading annotation). An annotation
3823
+ * flagged `anchor=document` (or `span=document`) becomes a document-spanning
3824
+ * clip instead. The annotation grammar is the shared one used for heading
3825
+ * annotations, so quoting/escaping behave identically.
3826
+ */
3827
+
3828
+ /**
3829
+ * Whether a standalone-annotation template name is a media name
3830
+ * (`audio`/`video`/`media`). The standalone template-block extractor uses
3831
+ * this to leave media annotations to {@link extractMediaFromContents}.
3832
+ */
3833
+ declare function isMediaAnnotationName(name: string | undefined): boolean;
3834
+
3835
+ /**
3836
+ * Body-annotation promotion detector.
3837
+ *
3838
+ * LLM-authored markdown often puts a block-type tag (`{[title …]}`, `{[list]}`,
3839
+ * `{[statHighlight …]}`) INSIDE a block's body — on its own line, or glued to
3840
+ * the end of a body paragraph — instead of appending it to the heading where
3841
+ * Squisq expects it (`# Heading {[title …]}`). This module recognizes that
3842
+ * misplaced tag so the block can be treated as that template.
3843
+ *
3844
+ * Promotion is deliberately conservative — "single trailing tag" only:
3845
+ *
3846
+ * - the tag must be the block's TRAILING content (whole-paragraph as the last
3847
+ * node, or a trailing token on the last paragraph), and
3848
+ * - it must be the ONLY body annotation (an earlier standalone `{[…]}` paragraph
3849
+ * means the section uses the multi-block heading-less feature — left alone).
3850
+ *
3851
+ * The detector is pure: it returns the parsed annotation, provenance for a
3852
+ * byte-faithful round-trip (`docToMarkdown` re-emits the tag in the body until
3853
+ * the block is edited — mirroring the media-annotation round-trip), and the body
3854
+ * `contents` with the tag stripped for rendering. It does NOT decide media vs.
3855
+ * template names or template validity — the caller (`markdownToDoc`) does.
3856
+ */
3857
+
3858
+ /** A successful detection: the annotation + the body with the tag removed. */
3859
+ interface PromotableDetection {
3860
+ data: PromotedBodyAnnotation;
3861
+ strippedContents: MarkdownBlockNode[];
3862
+ }
3863
+ /**
3864
+ * Detect a promotable single trailing body annotation. Returns null unless the
3865
+ * block's LAST content node is a `{[template …]}` tag (whole-paragraph or
3866
+ * trailing token) AND no earlier node is itself an annotation.
3867
+ */
3868
+ declare function detectPromotableBodyAnnotation(contents: MarkdownBlockNode[] | undefined): PromotableDetection | null;
3869
+
3870
+ /** One value column projected to numbers (null = unparseable cell → gap). */
3871
+ interface ChartSeries {
3872
+ name: string;
3873
+ values: (number | null)[];
3874
+ }
3875
+ /** Numeric projection of a string table, ready to plot. */
3876
+ interface ChartData {
3877
+ /** Category labels, one per table row (label column cells verbatim). */
3878
+ labels: string[];
3879
+ /** One entry per resolved value column. */
3880
+ series: ChartSeries[];
3881
+ /** Header text of the label column. */
3882
+ labelHeader: string;
3883
+ /**
3884
+ * Numeric projection of the label column (scatter x-axis). Null per
3885
+ * non-numeric cell; scatter falls back to row index when too sparse.
3886
+ */
3887
+ labelNumbers: (number | null)[];
3888
+ /** Non-fatal issues encountered while mapping columns (for tests/tools). */
3889
+ warnings: string[];
3890
+ }
3891
+ /** The string table the engine plots (extracted markdown table shape). */
3892
+ interface ChartTableData {
3893
+ headers: string[];
3894
+ rows: string[][];
3895
+ }
3896
+
3897
+ /**
3898
+ * Numeric parsing + column-role resolution for the chart engine.
3899
+ *
3900
+ * Table cells arrive as plain strings (the markdown table projection).
3901
+ * The parser is tolerant of the formatting people actually put in tables
3902
+ * — currency symbols, thousands separators, percent signs, accounting
3903
+ * negatives — but never invents data: a cell that doesn't parse is
3904
+ * `null` (a gap), not zero.
3905
+ *
3906
+ * Blocks authored as JSON (typed `headers`/`rows` rather than a markdown
3907
+ * table) naturally carry numbers — `["Birds", 216]`. `normalizeChartTable`
3908
+ * stringifies every cell where the table enters the engine, so those plot
3909
+ * like their markdown equivalents instead of throwing.
3910
+ */
3911
+
3912
+ /**
3913
+ * Coerce a typed table to the all-string shape the engine parses: numeric
3914
+ * and boolean cells become their text, missing/null/object cells become
3915
+ * empty, and non-array rows are dropped.
3916
+ */
3917
+ declare function normalizeChartTable(table: {
3918
+ headers?: unknown;
3919
+ rows?: unknown;
3920
+ }): ChartTableData;
3921
+ /**
3922
+ * Map a string table + column-role options to plottable data.
3923
+ *
3924
+ * Label column defaults to the first column; value columns default to
3925
+ * every numeric column that isn't the label column. Returns null when no
3926
+ * value column resolves — the "table exists but isn't chartable" case,
3927
+ * which callers treat the same as having no table at all.
3928
+ */
3929
+ declare function buildChartData(table: ChartTableData, options?: {
3930
+ labelColumn?: string;
3931
+ valueColumns?: string[];
3932
+ }): ChartData | null;
3933
+
3785
3934
  /**
3786
3935
  * Markdown document validation.
3787
3936
  *
@@ -4471,4 +4620,4 @@ declare function treeFromMarkdownList(list: MarkdownList): Tree;
4471
4620
  /** Find the first top-level markdown list in a block's body, if any. */
4472
4621
  declare function findFirstList(contents: MarkdownBlockNode[] | undefined): MarkdownList | undefined;
4473
4622
 
4474
- export { ASCII_CHAR_H, ASCII_CHAR_W, ASCII_DIAGRAM_FENCE_LANGS, ASCII_TIMELINE_FENCE_LANGS, type AccentLayout, type ArrangeAsciiDiagramOptions, 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, BUILTIN_DASHBOARD_LAYOUTS, type BlockLayerMaterialization, type BlockMediaLayoutPolicy, type BuildPreviewDocOptions, type BuildTimeline, type BuiltInTemplateName, CONTAINER_TEMPLATES, COVER_SLIDE_FRONTMATTER_KEYS, COVER_SLIDE_TEMPLATE_OPTIONS, type ClipBox, type ConnectorAnchor, type ConnectorPort, type ConnectorRouting, type ConnectorSnapPoint, type ContentBuildPlan, type CoverBlockInput, type CoverSlidePlayback, type CoverSlideSettings, type CoverSlideTemplate, type CoverSlideTemplateOption, DASHBOARD_AUTO_LAYOUT_ID, DASHBOARD_FRONTMATTER_KEYS, DASHBOARD_STYLES, DASHBOARD_STYLE_IDS, DASHBOARD_ZOOM_LEVELS, DATA_FILE_EXTENSIONS, DEFAULT_COVER_SLIDE_SETTINGS, DEFAULT_DASHBOARD_SETTINGS, DEFAULT_DASHBOARD_STYLE, DEFAULT_LAYOUT, DEFAULT_WORD_STAGGER, DIAGRAM_LABEL_HORIZONTAL_PADDING, DIAGRAM_LABEL_LINE_HEIGHT, DIAGRAM_LABEL_MIN_FONT_SIZE, DIAGRAM_LABEL_VERTICAL_PADDING, type DashboardCell, type DashboardCellChrome, type DashboardCellDefinition, type DashboardCellFrame, type DashboardDiagnostic, type DashboardLayoutDefinition, type DashboardLayoutSummary, type DashboardLayoutValidationError, type DashboardLayoutValidationResult, type DashboardMaterialization, type DashboardRectPct, type DashboardSettings, type DashboardSettingsOverrides, type DashboardStyleId, type DashboardStyleSummary, type DashboardTitle, type DashboardTitleSlotDefinition, type DashboardZoomCandidate, type DashboardZoomLevel, type DashboardZoomMode, type DataFenceParseResult, type DataSourceReadOptions, type DataSourceReader, type DataSourceStats, type DataSourceTable, 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, FRONTMATTER_DASHBOARD_LAYOUTS_KEY, type FirstImage, type Flashcard, type FlashcardChoice, type FlashcardDeck, type FlashcardDiagnostic, type FlashcardDiagnosticCode, type FlashcardFace, type FlashcardKind, type FlashcardSourceMode, type FrostedBigTextLayout, GEOMETRY_BOUND_TEMPLATES, type HostedVideo, type InputCoercion, type LayerMaterializationDiagnostic, type LayerMaterializationFailureMode, type LayerMaterializationSource, type LayoutLayerDefaults, type LayoutLayersResult, MAX_COVER_SLIDE_DURATION_SECONDS, type MarkdownToDocOptions, type MarkdownValidationResult, type MaterializeBlockLayersOptions, type MaterializeDashboardOptions, type MaterializeFlashcardsOptions, type NarrationResolution, type NativeMediaLayout, type NoMediaLayout, PAGE_BASE_CSS, PATH_SHAPE_KINDS, PageSection, type PageSectionContext, type PageSectionDraft, type ParsedStat, PersistentLayerConfig, type RenderAsciiDiagramOptions, type RenderAsciiTimelineOptions, type RenderTreeOptions, type RepairResult, type ResolveDataReferencesOptions, type ResolvedDashboardCell, type ResolvedDataReferences, type ResolvedPageBlock, type RichListItem, type RuntimeTemplateRegistry, SHAPE_NAMES, type SectionExtractor, type SupplementalMediaLayoutVariant, type SupplementalMediaShape, type SupplementalMediaVariantMatrix, TABLE_FED_TEMPLATES, 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, accentForViewport, adjustY, anchorPoint, applyNarrationTiming, applyRenderStyleToLayers, arrangeAsciiDiagram, asciiCellToCanvas, asciiDiagramFromBlocks, asciiDiagramFromTemplateData, asciiDiagramToTemplateData, asciiTimelineToTemplateData, autoTemplatePreservesContent, bigText, blockBuildSteps, bottomFeature, buildCursorAtTime, buildDashboardCellChrome, buildPageCss, buildPageCssVars, buildPreviewDoc, buildRegistry, buildSourceText, buildTargetState, canvasToAsciiCell, chooseDashboardLayout, clipEndpoints, clipPoint, coerceTemplateParams, comparisonBar, composeDashboardLayers, computeDiagramLayout, computeDrawingLayout, computeLayoutLayers, connectorPath, contentBlock, countBlocks, countUpSpecFor, coverBlock, createAccentLayers, cssFilterForTreatment, dashboardCanvasFill, dashboardCellAccent, dataSidecarPrefix, dataTable, dateEvent, definitionCard, deriveTemplateInputs, desiredCellZoom, detectAsciiDiagram, detectAsciiTimeline, detectTree, diagramBlock, docToMarkdown, documentTitleFromFileName, drawingBlock, expandCoverBlock, expandDocBlocks, expandPersistentLayers, extractBlockquoteText, extractBodyPlainText, extractEmbeddedVideos, extractFirstEmbeddedVideo, extractFirstImage, extractHostedVideos, extractImages, extractListItems, extractRichListItems, extractTableData, extractTableFromContents, factCard, fallbackBlockLayers, findFirstList, findFirstTable, fitBigTextSize, fitDiagramLabel, flattenBlocks, flattenRenderableBlocks, formatCountUp, formatCountValue, frostedBigTextLayout, fullBleedQuote, getAccentLayout, getAnimationProgress, getAnimationStyle, getAvailableTemplates, getBlockBodyText, getBlockDepth, getBlockMediaLayoutPolicy, getDashboardLayoutSummaries, getDefaultAnimation, getDefaultAnimationDuration, getMotionProfile, getOverlayOpacity, getPersistentLayersFromTheme, getPinnedBlockMeta, getTemplateHint, getThemeFont, getTransitionClass, hasBlockBuilds, hasTemplate, imageWithCaption, isAsciiDiagramFence, isAsciiTimelineFence, isContainerTemplate, isDataFence, isDataFilePath, isEligibleAsciiFenceLang, isEligibleAsciiTimelineFenceLang, isEligibleTreeFenceLang, isExplicitDiagramLang, isExplicitTimelineLang, isExplicitTreeLang, isGeometryBoundTemplate, isMaterializedMediaNode, isPictureFence, isPictureParagraph, isRepairableDiagram, isShapeName, isTemplatedPageBlock, isTreeFence, isWrappedFlowTimelineSource, layoutBlock, layoutCapacity, leftFeature, lineStyleDasharray, lintTemplateParams, listBlock, listDashboardLayouts, mapBlock, markdownBlockSeparatorLines, markdownToDoc, markerPath, materializeBlockLayers, materializeDashboard, materializeFlashcards, mediaOnly, motionDelay, motionEntrance, motionStateTransform, nearestSnapPoint, normalizeDashboardZoom, normalizeShapeKind, pageStyleDataAttributes, parseAsciiDiagram, parseAsciiTimeline, parseAsciiTimelineWithStats, parseDataFence, parseStatNumber, parseTree, parseWrappedFlowTimeline, parseYamlSubset, photoGrid, planContentBuilds, pullQuote, quoteBlock, readCustomTemplatesFromFrontmatter, readCustomThemesFromFrontmatter, readDashboardLayoutsFromFrontmatter, renderAsciiDiagram, renderAsciiTimeline, renderMarkdownBlocksHtml, renderTree, repairAsciiDiagram, replaceDataFence, resolveAudioMapping, resolveBuildTimeline, resolveColorScheme, resolveCoverSlideSettings, resolveDashboardLayoutDefinition, resolveDashboardSettings, resolveDashboardStyleId, resolveDashboardZooms, resolveDataReferences, resolveDocBuildTiming, resolveFlashcardMarker, resolveLayoutCells, resolvePageBlock, resolvePersistentLayers, resolveTemplateName, resolveThemeForDoc, rightFeature, scaleAnimationDuration, scoreTextSimilarity, sectionExtractors, sectionHeader, shapePath, shouldUseShadow, snapEndpoints, snapPoints, statHighlight, stripBlockBackdropLayer, stripsBlockBackdrop, templateRegistry, themeWantsAmbientMotion, themedEntrance, themedFontSize, themedImageTreatment, themedScrim, themedSurfaceGradient, timelineBlock, titleBlock, topFeature, transformOriginFor, transposeCells, treeBlock, treeFromMarkdownList, treeFromTemplateData, treeToTemplateData, twoColumn, validateDashboardLayoutDefinition, validateMarkdownDoc, validateMarkdownSource, videoPullQuote, videoWithCaption, wordRevealDelay, wrapWithPersistentLayers, writeCustomTemplatesToFrontmatter, writeCustomThemesToFrontmatter, writeDashboardLayoutsToFrontmatter };
4623
+ export { ASCII_CHAR_H, ASCII_CHAR_W, ASCII_DIAGRAM_FENCE_LANGS, ASCII_TIMELINE_FENCE_LANGS, type AccentLayout, type ArrangeAsciiDiagramOptions, 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, BUILTIN_DASHBOARD_LAYOUTS, type BlockLayerMaterialization, type BlockMediaLayoutPolicy, type BuildPreviewDocOptions, type BuildTimeline, type BuiltInTemplateName, CONTAINER_TEMPLATES, COVER_SLIDE_FRONTMATTER_KEYS, COVER_SLIDE_TEMPLATE_OPTIONS, type ChartData, type ChartTableData, type ClipBox, type ConnectorAnchor, type ConnectorPort, type ConnectorRouting, type ConnectorSnapPoint, type ContentBuildPlan, type CoverBlockInput, type CoverSlidePlayback, type CoverSlideSettings, type CoverSlideTemplate, type CoverSlideTemplateOption, DASHBOARD_AUTO_LAYOUT_ID, DASHBOARD_FRONTMATTER_KEYS, DASHBOARD_STYLES, DASHBOARD_STYLE_IDS, DASHBOARD_ZOOM_LEVELS, DATA_FILE_EXTENSIONS, DEFAULT_COVER_SLIDE_SETTINGS, DEFAULT_DASHBOARD_SETTINGS, DEFAULT_DASHBOARD_STYLE, DEFAULT_LAYOUT, DEFAULT_WORD_STAGGER, DIAGRAM_LABEL_HORIZONTAL_PADDING, DIAGRAM_LABEL_LINE_HEIGHT, DIAGRAM_LABEL_MIN_FONT_SIZE, DIAGRAM_LABEL_VERTICAL_PADDING, type DashboardCell, type DashboardCellChrome, type DashboardCellDefinition, type DashboardCellFrame, type DashboardDiagnostic, type DashboardLayoutDefinition, type DashboardLayoutSummary, type DashboardLayoutValidationError, type DashboardLayoutValidationResult, type DashboardMaterialization, type DashboardRectPct, type DashboardSettings, type DashboardSettingsOverrides, type DashboardStyleId, type DashboardStyleSummary, type DashboardTitle, type DashboardTitleSlotDefinition, type DashboardZoomCandidate, type DashboardZoomLevel, type DashboardZoomMode, type DataFenceParseResult, type DataSourceReadOptions, type DataSourceReader, type DataSourceStats, type DataSourceTable, 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, FRONTMATTER_DASHBOARD_LAYOUTS_KEY, type FirstImage, type Flashcard, type FlashcardChoice, type FlashcardDeck, type FlashcardDiagnostic, type FlashcardDiagnosticCode, type FlashcardFace, type FlashcardKind, type FlashcardSourceMode, type FrostedBigTextLayout, GEOMETRY_BOUND_TEMPLATES, type HostedVideo, type InputCoercion, type LayerMaterializationDiagnostic, type LayerMaterializationFailureMode, type LayerMaterializationSource, type LayoutLayerDefaults, type LayoutLayersResult, MAX_COVER_SLIDE_DURATION_SECONDS, type MarkdownToDocOptions, type MarkdownValidationResult, type MaterializeBlockLayersOptions, type MaterializeDashboardOptions, type MaterializeFlashcardsOptions, type NarrationResolution, type NativeMediaLayout, type NoMediaLayout, PAGE_BASE_CSS, PATH_SHAPE_KINDS, PageSection, type PageSectionContext, type PageSectionDraft, type ParsedAnnotation, type ParsedStat, PersistentLayerConfig, type PromotableDetection, type RenderAsciiDiagramOptions, type RenderAsciiTimelineOptions, type RenderTreeOptions, type RepairResult, type ResolveDataReferencesOptions, type ResolvedDashboardCell, type ResolvedDataReferences, type ResolvedPageBlock, type RichListItem, type RuntimeTemplateRegistry, SHAPE_NAMES, type SectionExtractor, type SupplementalMediaLayoutVariant, type SupplementalMediaShape, type SupplementalMediaVariantMatrix, TABLE_FED_TEMPLATES, 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, accentForViewport, adjustY, anchorPoint, applyNarrationTiming, applyRenderStyleToLayers, arrangeAsciiDiagram, asciiCellToCanvas, asciiDiagramFromBlocks, asciiDiagramFromTemplateData, asciiDiagramToTemplateData, asciiTimelineToTemplateData, autoTemplatePreservesContent, bigText, blockBuildSteps, bottomFeature, buildChartData, buildCursorAtTime, buildDashboardCellChrome, buildPageCss, buildPageCssVars, buildPreviewDoc, buildRegistry, buildSourceText, buildTargetState, canvasToAsciiCell, chooseDashboardLayout, clipEndpoints, clipPoint, coerceTemplateParams, comparisonBar, composeDashboardLayers, computeDiagramLayout, computeDrawingLayout, computeLayoutLayers, connectorPath, contentBlock, countBlocks, countUpSpecFor, coverBlock, createAccentLayers, cssFilterForTreatment, dashboardCanvasFill, dashboardCellAccent, dataSidecarPrefix, dataTable, dateEvent, definitionCard, deriveTemplateInputs, desiredCellZoom, detectAsciiDiagram, detectAsciiTimeline, detectPromotableBodyAnnotation, detectTree, diagramBlock, docToMarkdown, documentTitleFromFileName, drawingBlock, expandCoverBlock, expandDocBlocks, expandPersistentLayers, extractBlockquoteText, extractBodyPlainText, extractEmbeddedVideos, extractFirstEmbeddedVideo, extractFirstImage, extractHostedVideos, extractImages, extractListItems, extractRichListItems, extractTableData, extractTableFromContents, factCard, fallbackBlockLayers, findFirstList, findFirstTable, fitBigTextSize, fitDiagramLabel, flattenBlocks, flattenRenderableBlocks, formatCountUp, formatCountValue, frostedBigTextLayout, fullBleedQuote, getAccentLayout, getAnimationProgress, getAnimationStyle, getAvailableTemplates, getBlockBodyText, getBlockDepth, getBlockMediaLayoutPolicy, getDashboardLayoutSummaries, getDefaultAnimation, getDefaultAnimationDuration, getMotionProfile, getOverlayOpacity, getPersistentLayersFromTheme, getPinnedBlockMeta, getTemplateHint, getThemeFont, getTransitionClass, hasBlockBuilds, hasTemplate, imageWithCaption, isAsciiDiagramFence, isAsciiTimelineFence, isContainerTemplate, isDataFence, isDataFilePath, isEligibleAsciiFenceLang, isEligibleAsciiTimelineFenceLang, isEligibleTreeFenceLang, isExplicitDiagramLang, isExplicitTimelineLang, isExplicitTreeLang, isGeometryBoundTemplate, isMaterializedMediaNode, isMediaAnnotationName, isPictureFence, isPictureParagraph, isRepairableDiagram, isShapeName, isTemplatedPageBlock, isTreeFence, isWrappedFlowTimelineSource, layoutBlock, layoutCapacity, leftFeature, lineStyleDasharray, lintTemplateParams, listBlock, listDashboardLayouts, mapBlock, markdownBlockSeparatorLines, markdownToDoc, markerPath, materializeBlockLayers, materializeDashboard, materializeFlashcards, mediaOnly, motionDelay, motionEntrance, motionStateTransform, nearestSnapPoint, normalizeChartTable, normalizeDashboardZoom, normalizeShapeKind, pageStyleDataAttributes, parseAsciiDiagram, parseAsciiTimeline, parseAsciiTimelineWithStats, parseDataFence, parseStandaloneAnnotation, parseStatNumber, parseTree, parseWrappedFlowTimeline, parseYamlSubset, photoGrid, planContentBuilds, pullQuote, quoteBlock, readCustomTemplatesFromFrontmatter, readCustomThemesFromFrontmatter, readDashboardLayoutsFromFrontmatter, renderAsciiDiagram, renderAsciiTimeline, renderMarkdownBlocksHtml, renderTree, repairAsciiDiagram, replaceDataFence, resolveAudioMapping, resolveBuildTimeline, resolveColorScheme, resolveCoverSlideSettings, resolveDashboardLayoutDefinition, resolveDashboardSettings, resolveDashboardStyleId, resolveDashboardZooms, resolveDataReferences, resolveDocBuildTiming, resolveFlashcardMarker, resolveLayoutCells, resolvePageBlock, resolvePersistentLayers, resolveTemplateName, resolveThemeForDoc, rightFeature, scaleAnimationDuration, scoreTextSimilarity, sectionExtractors, sectionHeader, shapePath, shouldUseShadow, snapEndpoints, snapPoints, statHighlight, stripBlockBackdropLayer, stripsBlockBackdrop, templateRegistry, themeWantsAmbientMotion, themedEntrance, themedFontSize, themedImageTreatment, themedScrim, themedSurfaceGradient, timelineBlock, titleBlock, topFeature, transformOriginFor, transposeCells, treeBlock, treeFromMarkdownList, treeFromTemplateData, treeToTemplateData, twoColumn, validateDashboardLayoutDefinition, validateMarkdownDoc, validateMarkdownSource, videoPullQuote, videoWithCaption, wordRevealDelay, wrapWithPersistentLayers, writeCustomTemplatesToFrontmatter, writeCustomThemesToFrontmatter, writeDashboardLayoutsToFrontmatter };
package/dist/doc/index.js CHANGED
@@ -75,9 +75,9 @@ import {
75
75
  validateMarkdownSource,
76
76
  wordRevealDelay,
77
77
  writeDashboardLayoutsToFrontmatter
78
- } from "../chunk-MWJSEKM3.js";
78
+ } from "../chunk-PJHMZ26J.js";
79
79
  import "../chunk-FTN6SGW5.js";
80
- import "../chunk-CJYN3MTX.js";
80
+ import "../chunk-CS3MAZZX.js";
81
81
  import {
82
82
  BASE_INPUT_DESCRIPTORS,
83
83
  BLOCK_MEDIA_LAYOUT_POLICIES,
@@ -97,6 +97,7 @@ import {
97
97
  bigText,
98
98
  blockBuildSteps,
99
99
  bottomFeature,
100
+ buildChartData,
100
101
  buildCursorAtTime,
101
102
  buildRegistry,
102
103
  buildSourceText,
@@ -113,6 +114,7 @@ import {
113
114
  dataTable,
114
115
  dateEvent,
115
116
  definitionCard,
117
+ detectPromotableBodyAnnotation,
116
118
  diagramBlock,
117
119
  drawingBlock,
118
120
  expandCoverBlock,
@@ -158,6 +160,7 @@ import {
158
160
  mediaOnly,
159
161
  motionDelay,
160
162
  motionEntrance,
163
+ normalizeChartTable,
161
164
  normalizeShapeKind,
162
165
  parseDataFence,
163
166
  parseStatNumber,
@@ -195,7 +198,7 @@ import {
195
198
  wrapWithPersistentLayers,
196
199
  writeCustomTemplatesToFrontmatter,
197
200
  writeCustomThemesToFrontmatter
198
- } from "../chunk-TTJZXUQA.js";
201
+ } from "../chunk-5C6ZO5FV.js";
199
202
  import {
200
203
  ASCII_CHAR_H,
201
204
  ASCII_CHAR_W,
@@ -234,6 +237,7 @@ import {
234
237
  isExplicitTimelineLang,
235
238
  isExplicitTreeLang,
236
239
  isMaterializedMediaNode,
240
+ isMediaAnnotationName,
237
241
  isPictureFence,
238
242
  isPictureParagraph,
239
243
  isTreeFence,
@@ -242,13 +246,14 @@ import {
242
246
  parseAsciiDiagram,
243
247
  parseAsciiTimeline,
244
248
  parseAsciiTimelineWithStats,
249
+ parseStandaloneAnnotation,
245
250
  parseTree,
246
251
  parseWrappedFlowTimeline,
247
252
  renderMarkdownBlocksHtml,
248
253
  treeFromMarkdownList,
249
254
  treeFromTemplateData,
250
255
  treeToTemplateData
251
- } from "../chunk-NGQ5TJVX.js";
256
+ } from "../chunk-HGXZMB7K.js";
252
257
  import "../chunk-SVN7T6BK.js";
253
258
  import {
254
259
  PATH_SHAPE_KINDS,
@@ -352,6 +357,7 @@ export {
352
357
  bigText,
353
358
  blockBuildSteps,
354
359
  bottomFeature,
360
+ buildChartData,
355
361
  buildCursorAtTime,
356
362
  buildDashboardCellChrome,
357
363
  buildPageCss,
@@ -388,6 +394,7 @@ export {
388
394
  desiredCellZoom,
389
395
  detectAsciiDiagram,
390
396
  detectAsciiTimeline,
397
+ detectPromotableBodyAnnotation,
391
398
  detectTree,
392
399
  diagramBlock,
393
400
  docToMarkdown,
@@ -458,6 +465,7 @@ export {
458
465
  isExplicitTreeLang,
459
466
  isGeometryBoundTemplate,
460
467
  isMaterializedMediaNode,
468
+ isMediaAnnotationName,
461
469
  isPictureFence,
462
470
  isPictureParagraph,
463
471
  isRepairableDiagram,
@@ -487,6 +495,7 @@ export {
487
495
  motionEntrance,
488
496
  motionStateTransform,
489
497
  nearestSnapPoint,
498
+ normalizeChartTable,
490
499
  normalizeDashboardZoom,
491
500
  normalizeShapeKind,
492
501
  pageStyleDataAttributes,
@@ -494,6 +503,7 @@ export {
494
503
  parseAsciiTimeline,
495
504
  parseAsciiTimelineWithStats,
496
505
  parseDataFence,
506
+ parseStandaloneAnnotation,
497
507
  parseStatNumber,
498
508
  parseTree,
499
509
  parseWrappedFlowTimeline,
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { AVAILABLE_FONT_STACKS, CompileOptions, ContrastPreset, DocSchemaIssue,
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-BWvtBQ42.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-CSuevovH.js';
8
- export { ASCII_CHAR_H, ASCII_CHAR_W, ASCII_DIAGRAM_FENCE_LANGS, ASCII_TIMELINE_FENCE_LANGS, AccentLayout, ArrangeAsciiDiagramOptions, AsciiDiagram, AsciiDiagramDetection, AsciiDiagramEdge, AsciiDiagramNode, AsciiTimeline, AsciiTimelineDetection, AsciiTimelineEvent, AsciiTimelineLink, AsciiTimelineMarker, AsciiTimelineSide, AsciiTimelineStats, AsciiTimelineStyle, AsciiTimelineTrack, AudioSegmentTiming, BASE_INPUT_DESCRIPTORS, BLOCK_MEDIA_LAYOUT_POLICIES, BUILTIN_DASHBOARD_LAYOUTS, BlockLayerMaterialization, BlockMediaLayoutPolicy, BuildPreviewDocOptions, BuildTimeline, BuiltInTemplateName, CONTAINER_TEMPLATES, COVER_SLIDE_FRONTMATTER_KEYS, COVER_SLIDE_TEMPLATE_OPTIONS, ClipBox, ConnectorAnchor, ConnectorPort, ConnectorRouting, ConnectorSnapPoint, ContentBuildPlan, CoverBlockInput, CoverSlidePlayback, CoverSlideSettings, CoverSlideTemplate, CoverSlideTemplateOption, DASHBOARD_AUTO_LAYOUT_ID, DASHBOARD_FRONTMATTER_KEYS, DASHBOARD_STYLES, DASHBOARD_STYLE_IDS, DASHBOARD_ZOOM_LEVELS, DATA_FILE_EXTENSIONS, DEFAULT_COVER_SLIDE_SETTINGS, DEFAULT_DASHBOARD_SETTINGS, DEFAULT_DASHBOARD_STYLE, DEFAULT_LAYOUT, DEFAULT_WORD_STAGGER, DIAGRAM_LABEL_HORIZONTAL_PADDING, DIAGRAM_LABEL_LINE_HEIGHT, DIAGRAM_LABEL_MIN_FONT_SIZE, DIAGRAM_LABEL_VERTICAL_PADDING, DashboardCell, DashboardCellChrome, DashboardCellDefinition, DashboardCellFrame, DashboardDiagnostic, DashboardLayoutDefinition, DashboardLayoutSummary, DashboardLayoutValidationError, DashboardLayoutValidationResult, DashboardMaterialization, DashboardRectPct, DashboardSettings, DashboardSettingsOverrides, DashboardStyleId, DashboardStyleSummary, DashboardTitle, DashboardTitleSlotDefinition, DashboardZoomCandidate, DashboardZoomLevel, DashboardZoomMode, DataFenceParseResult, DataSourceReadOptions, DataSourceReader, DataSourceStats, DataSourceTable, DeriveTemplateInputsOptions, DetectAsciiTimelineOptions, DiagramEdge, DiagramLabelFit, DiagramLayout, DiagramLayoutOptions, DiagramNodePosition, DrawingConnector, DrawingLayout, DrawingLayoutOptions, DrawingShape, DrawingShapeKind, EmbeddedVideo, ExpandDocBlocksOptions, ExtractedTableData, FRONTMATTER_DASHBOARD_LAYOUTS_KEY, FirstImage, Flashcard, FlashcardChoice, FlashcardDeck, FlashcardDiagnostic, FlashcardDiagnosticCode, FlashcardFace, FlashcardKind, FlashcardSourceMode, FrostedBigTextLayout, GEOMETRY_BOUND_TEMPLATES, HostedVideo, InputCoercion, LayerMaterializationDiagnostic, LayerMaterializationFailureMode, LayerMaterializationSource, LayoutLayerDefaults, LayoutLayersResult, MAX_COVER_SLIDE_DURATION_SECONDS, MarkdownToDocOptions, MarkdownValidationResult, MaterializeBlockLayersOptions, MaterializeDashboardOptions, MaterializeFlashcardsOptions, NarrationResolution, NativeMediaLayout, NoMediaLayout, PAGE_BASE_CSS, PATH_SHAPE_KINDS, PageSectionContext, PageSectionDraft, ParsedStat, RenderAsciiDiagramOptions, RenderAsciiTimelineOptions, RenderTreeOptions, RepairResult, ResolveDataReferencesOptions, ResolvedDashboardCell, ResolvedDataReferences, 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, accentForViewport, adjustY, anchorPoint, applyNarrationTiming, applyRenderStyleToLayers, arrangeAsciiDiagram, asciiCellToCanvas, asciiDiagramFromBlocks, asciiDiagramFromTemplateData, asciiDiagramToTemplateData, asciiTimelineToTemplateData, autoTemplatePreservesContent, bigText, blockBuildSteps, bottomFeature, buildCursorAtTime, buildDashboardCellChrome, buildPageCss, buildPageCssVars, buildPreviewDoc, buildRegistry, buildSourceText, buildTargetState, canvasToAsciiCell, chooseDashboardLayout, clipEndpoints, clipPoint, coerceTemplateParams, comparisonBar, composeDashboardLayers, computeDiagramLayout, computeDrawingLayout, computeLayoutLayers, connectorPath, contentBlock, countBlocks, countUpSpecFor, coverBlock, createAccentLayers, cssFilterForTreatment, dashboardCanvasFill, dashboardCellAccent, dataSidecarPrefix, dataTable, dateEvent, definitionCard, deriveTemplateInputs, desiredCellZoom, detectAsciiDiagram, detectAsciiTimeline, detectTree, diagramBlock, docToMarkdown, documentTitleFromFileName, drawingBlock, expandCoverBlock, expandDocBlocks, expandPersistentLayers, extractBlockquoteText, extractBodyPlainText, extractEmbeddedVideos, extractFirstEmbeddedVideo, extractFirstImage, extractHostedVideos, extractImages, extractListItems, extractRichListItems, extractTableData, extractTableFromContents, factCard, fallbackBlockLayers, findFirstList, findFirstTable, fitBigTextSize, fitDiagramLabel, flattenBlocks, flattenRenderableBlocks, formatCountUp, formatCountValue, frostedBigTextLayout, fullBleedQuote, getAccentLayout, getAnimationProgress, getAnimationStyle, getAvailableTemplates, getBlockBodyText, getBlockDepth, getBlockMediaLayoutPolicy, getDashboardLayoutSummaries, getDefaultAnimation, getDefaultAnimationDuration, getMotionProfile, getOverlayOpacity, getPersistentLayersFromTheme, getPinnedBlockMeta, getTemplateHint, getThemeFont, getTransitionClass, hasBlockBuilds, hasTemplate, imageWithCaption, isAsciiDiagramFence, isAsciiTimelineFence, isContainerTemplate, isDataFence, isDataFilePath, isEligibleAsciiFenceLang, isEligibleAsciiTimelineFenceLang, isEligibleTreeFenceLang, isExplicitDiagramLang, isExplicitTimelineLang, isExplicitTreeLang, isGeometryBoundTemplate, isMaterializedMediaNode, isPictureFence, isPictureParagraph, isRepairableDiagram, isShapeName, isTemplatedPageBlock, isTreeFence, isWrappedFlowTimelineSource, layoutBlock, layoutCapacity, leftFeature, lineStyleDasharray, lintTemplateParams, listBlock, listDashboardLayouts, mapBlock, markdownBlockSeparatorLines, markdownToDoc, markerPath, materializeBlockLayers, materializeDashboard, materializeFlashcards, mediaOnly, motionDelay, motionEntrance, motionStateTransform, nearestSnapPoint, normalizeDashboardZoom, normalizeShapeKind, pageStyleDataAttributes, parseAsciiDiagram, parseAsciiTimeline, parseAsciiTimelineWithStats, parseDataFence, parseStatNumber, parseTree, parseWrappedFlowTimeline, parseYamlSubset, photoGrid, planContentBuilds, pullQuote, quoteBlock, readCustomTemplatesFromFrontmatter, readCustomThemesFromFrontmatter, readDashboardLayoutsFromFrontmatter, renderAsciiDiagram, renderAsciiTimeline, renderMarkdownBlocksHtml, renderTree, repairAsciiDiagram, replaceDataFence, resolveAudioMapping, resolveBuildTimeline, resolveColorScheme, resolveCoverSlideSettings, resolveDashboardLayoutDefinition, resolveDashboardSettings, resolveDashboardStyleId, resolveDashboardZooms, resolveDataReferences, resolveDocBuildTiming, resolveFlashcardMarker, resolveLayoutCells, resolvePageBlock, resolvePersistentLayers, resolveTemplateName, resolveThemeForDoc, rightFeature, scaleAnimationDuration, scoreTextSimilarity, sectionExtractors, sectionHeader, shapePath, shouldUseShadow, snapEndpoints, snapPoints, statHighlight, stripBlockBackdropLayer, stripsBlockBackdrop, templateRegistry, themeWantsAmbientMotion, themedEntrance, themedFontSize, themedImageTreatment, themedScrim, themedSurfaceGradient, timelineBlock, titleBlock, topFeature, transformOriginFor, transposeCells, treeBlock, treeFromMarkdownList, treeFromTemplateData, treeToTemplateData, twoColumn, validateDashboardLayoutDefinition, validateMarkdownDoc, validateMarkdownSource, videoPullQuote, videoWithCaption, wordRevealDelay, wrapWithPersistentLayers, writeCustomTemplatesToFrontmatter, writeCustomThemesToFrontmatter, writeDashboardLayoutsToFrontmatter } from './doc/index.js';
8
+ export { ASCII_CHAR_H, ASCII_CHAR_W, ASCII_DIAGRAM_FENCE_LANGS, ASCII_TIMELINE_FENCE_LANGS, AccentLayout, ArrangeAsciiDiagramOptions, AsciiDiagram, AsciiDiagramDetection, AsciiDiagramEdge, AsciiDiagramNode, AsciiTimeline, AsciiTimelineDetection, AsciiTimelineEvent, AsciiTimelineLink, AsciiTimelineMarker, AsciiTimelineSide, AsciiTimelineStats, AsciiTimelineStyle, AsciiTimelineTrack, AudioSegmentTiming, BASE_INPUT_DESCRIPTORS, BLOCK_MEDIA_LAYOUT_POLICIES, BUILTIN_DASHBOARD_LAYOUTS, BlockLayerMaterialization, BlockMediaLayoutPolicy, BuildPreviewDocOptions, BuildTimeline, BuiltInTemplateName, CONTAINER_TEMPLATES, COVER_SLIDE_FRONTMATTER_KEYS, COVER_SLIDE_TEMPLATE_OPTIONS, ChartData, ChartTableData, ClipBox, ConnectorAnchor, ConnectorPort, ConnectorRouting, ConnectorSnapPoint, ContentBuildPlan, CoverBlockInput, CoverSlidePlayback, CoverSlideSettings, CoverSlideTemplate, CoverSlideTemplateOption, DASHBOARD_AUTO_LAYOUT_ID, DASHBOARD_FRONTMATTER_KEYS, DASHBOARD_STYLES, DASHBOARD_STYLE_IDS, DASHBOARD_ZOOM_LEVELS, DATA_FILE_EXTENSIONS, DEFAULT_COVER_SLIDE_SETTINGS, DEFAULT_DASHBOARD_SETTINGS, DEFAULT_DASHBOARD_STYLE, DEFAULT_LAYOUT, DEFAULT_WORD_STAGGER, DIAGRAM_LABEL_HORIZONTAL_PADDING, DIAGRAM_LABEL_LINE_HEIGHT, DIAGRAM_LABEL_MIN_FONT_SIZE, DIAGRAM_LABEL_VERTICAL_PADDING, DashboardCell, DashboardCellChrome, DashboardCellDefinition, DashboardCellFrame, DashboardDiagnostic, DashboardLayoutDefinition, DashboardLayoutSummary, DashboardLayoutValidationError, DashboardLayoutValidationResult, DashboardMaterialization, DashboardRectPct, DashboardSettings, DashboardSettingsOverrides, DashboardStyleId, DashboardStyleSummary, DashboardTitle, DashboardTitleSlotDefinition, DashboardZoomCandidate, DashboardZoomLevel, DashboardZoomMode, DataFenceParseResult, DataSourceReadOptions, DataSourceReader, DataSourceStats, DataSourceTable, DeriveTemplateInputsOptions, DetectAsciiTimelineOptions, DiagramEdge, DiagramLabelFit, DiagramLayout, DiagramLayoutOptions, DiagramNodePosition, DrawingConnector, DrawingLayout, DrawingLayoutOptions, DrawingShape, DrawingShapeKind, EmbeddedVideo, ExpandDocBlocksOptions, ExtractedTableData, FRONTMATTER_DASHBOARD_LAYOUTS_KEY, FirstImage, Flashcard, FlashcardChoice, FlashcardDeck, FlashcardDiagnostic, FlashcardDiagnosticCode, FlashcardFace, FlashcardKind, FlashcardSourceMode, FrostedBigTextLayout, GEOMETRY_BOUND_TEMPLATES, HostedVideo, InputCoercion, LayerMaterializationDiagnostic, LayerMaterializationFailureMode, LayerMaterializationSource, LayoutLayerDefaults, LayoutLayersResult, MAX_COVER_SLIDE_DURATION_SECONDS, MarkdownToDocOptions, MarkdownValidationResult, MaterializeBlockLayersOptions, MaterializeDashboardOptions, MaterializeFlashcardsOptions, NarrationResolution, NativeMediaLayout, NoMediaLayout, PAGE_BASE_CSS, PATH_SHAPE_KINDS, PageSectionContext, PageSectionDraft, ParsedAnnotation, ParsedStat, PromotableDetection, RenderAsciiDiagramOptions, RenderAsciiTimelineOptions, RenderTreeOptions, RepairResult, ResolveDataReferencesOptions, ResolvedDashboardCell, ResolvedDataReferences, 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, accentForViewport, adjustY, anchorPoint, applyNarrationTiming, applyRenderStyleToLayers, arrangeAsciiDiagram, asciiCellToCanvas, asciiDiagramFromBlocks, asciiDiagramFromTemplateData, asciiDiagramToTemplateData, asciiTimelineToTemplateData, autoTemplatePreservesContent, bigText, blockBuildSteps, bottomFeature, buildChartData, buildCursorAtTime, buildDashboardCellChrome, buildPageCss, buildPageCssVars, buildPreviewDoc, buildRegistry, buildSourceText, buildTargetState, canvasToAsciiCell, chooseDashboardLayout, clipEndpoints, clipPoint, coerceTemplateParams, comparisonBar, composeDashboardLayers, computeDiagramLayout, computeDrawingLayout, computeLayoutLayers, connectorPath, contentBlock, countBlocks, countUpSpecFor, coverBlock, createAccentLayers, cssFilterForTreatment, dashboardCanvasFill, dashboardCellAccent, dataSidecarPrefix, dataTable, dateEvent, definitionCard, deriveTemplateInputs, desiredCellZoom, detectAsciiDiagram, detectAsciiTimeline, detectPromotableBodyAnnotation, detectTree, diagramBlock, docToMarkdown, documentTitleFromFileName, drawingBlock, expandCoverBlock, expandDocBlocks, expandPersistentLayers, extractBlockquoteText, extractBodyPlainText, extractEmbeddedVideos, extractFirstEmbeddedVideo, extractFirstImage, extractHostedVideos, extractImages, extractListItems, extractRichListItems, extractTableData, extractTableFromContents, factCard, fallbackBlockLayers, findFirstList, findFirstTable, fitBigTextSize, fitDiagramLabel, flattenBlocks, flattenRenderableBlocks, formatCountUp, formatCountValue, frostedBigTextLayout, fullBleedQuote, getAccentLayout, getAnimationProgress, getAnimationStyle, getAvailableTemplates, getBlockBodyText, getBlockDepth, getBlockMediaLayoutPolicy, getDashboardLayoutSummaries, getDefaultAnimation, getDefaultAnimationDuration, getMotionProfile, getOverlayOpacity, getPersistentLayersFromTheme, getPinnedBlockMeta, getTemplateHint, getThemeFont, getTransitionClass, hasBlockBuilds, hasTemplate, imageWithCaption, isAsciiDiagramFence, isAsciiTimelineFence, isContainerTemplate, isDataFence, isDataFilePath, isEligibleAsciiFenceLang, isEligibleAsciiTimelineFenceLang, isEligibleTreeFenceLang, isExplicitDiagramLang, isExplicitTimelineLang, isExplicitTreeLang, isGeometryBoundTemplate, isMaterializedMediaNode, isMediaAnnotationName, isPictureFence, isPictureParagraph, isRepairableDiagram, isShapeName, isTemplatedPageBlock, isTreeFence, isWrappedFlowTimelineSource, layoutBlock, layoutCapacity, leftFeature, lineStyleDasharray, lintTemplateParams, listBlock, listDashboardLayouts, mapBlock, markdownBlockSeparatorLines, markdownToDoc, markerPath, materializeBlockLayers, materializeDashboard, materializeFlashcards, mediaOnly, motionDelay, motionEntrance, motionStateTransform, nearestSnapPoint, normalizeChartTable, normalizeDashboardZoom, normalizeShapeKind, pageStyleDataAttributes, parseAsciiDiagram, parseAsciiTimeline, parseAsciiTimelineWithStats, parseDataFence, parseStandaloneAnnotation, parseStatNumber, parseTree, parseWrappedFlowTimeline, parseYamlSubset, photoGrid, planContentBuilds, pullQuote, quoteBlock, readCustomTemplatesFromFrontmatter, readCustomThemesFromFrontmatter, readDashboardLayoutsFromFrontmatter, renderAsciiDiagram, renderAsciiTimeline, renderMarkdownBlocksHtml, renderTree, repairAsciiDiagram, replaceDataFence, resolveAudioMapping, resolveBuildTimeline, resolveColorScheme, resolveCoverSlideSettings, resolveDashboardLayoutDefinition, resolveDashboardSettings, resolveDashboardStyleId, resolveDashboardZooms, resolveDataReferences, resolveDocBuildTiming, resolveFlashcardMarker, resolveLayoutCells, resolvePageBlock, resolvePersistentLayers, resolveTemplateName, resolveThemeForDoc, rightFeature, scaleAnimationDuration, scoreTextSimilarity, sectionExtractors, sectionHeader, shapePath, shouldUseShadow, snapEndpoints, snapPoints, statHighlight, stripBlockBackdropLayer, stripsBlockBackdrop, templateRegistry, themeWantsAmbientMotion, themedEntrance, themedFontSize, themedImageTreatment, themedScrim, themedSurfaceGradient, timelineBlock, titleBlock, topFeature, transformOriginFor, transposeCells, treeBlock, treeFromMarkdownList, treeFromTemplateData, treeToTemplateData, twoColumn, validateDashboardLayoutDefinition, validateMarkdownDoc, validateMarkdownSource, videoPullQuote, videoWithCaption, wordRevealDelay, wrapWithPersistentLayers, writeCustomTemplatesToFrontmatter, writeCustomThemesToFrontmatter, writeDashboardLayoutsToFrontmatter } from './doc/index.js';
9
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-FT1B5NOo.js';
10
10
  export { calculateBearing, decodeGeohash, destinationPoint, encodeGeohash, geohashOverlapsBounds, geohashToHierarchicalPath, getGeohash4Neighbors, getGeohashPath, getGeohashPrefix, getNeighbors, haversineDistance, interpolateGreatCircle, sampleGreatCircle } from './spatial/index.js';
11
11
  export { LocalForageAdapter, LocalForageAdapterOptions, LocalStorageAdapter, MemoryStorageAdapter, ScopedContentContainer, StorageAdapter, createMediaProviderFromContainer, scopeContainer } from './storage/index.js';
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  traceWordPosAt,
30
30
  transcriptWordKeys,
31
31
  vadStep
32
- } from "./chunk-DOKSRBW2.js";
32
+ } from "./chunk-NROIOJKY.js";
33
33
  import {
34
34
  fenceRendererLangs
35
35
  } from "./chunk-PGI7HSWE.js";
@@ -232,7 +232,7 @@ import {
232
232
  validateMarkdownSource,
233
233
  wordRevealDelay,
234
234
  writeDashboardLayoutsToFrontmatter
235
- } from "./chunk-MWJSEKM3.js";
235
+ } from "./chunk-PJHMZ26J.js";
236
236
  import {
237
237
  buildNarrationTimingJson,
238
238
  parseNarrationTimingJson,
@@ -265,7 +265,7 @@ import {
265
265
  serializePresentationPlan,
266
266
  transformNarratedSegment,
267
267
  usesDynamicPresentation
268
- } from "./chunk-CJYN3MTX.js";
268
+ } from "./chunk-CS3MAZZX.js";
269
269
  import {
270
270
  BASE_INPUT_DESCRIPTORS,
271
271
  BLOCK_MEDIA_LAYOUT_POLICIES,
@@ -285,6 +285,7 @@ import {
285
285
  bigText,
286
286
  blockBuildSteps,
287
287
  bottomFeature,
288
+ buildChartData,
288
289
  buildCursorAtTime,
289
290
  buildNarrationScript,
290
291
  buildRegistry,
@@ -302,6 +303,7 @@ import {
302
303
  dataTable,
303
304
  dateEvent,
304
305
  definitionCard,
306
+ detectPromotableBodyAnnotation,
305
307
  diagramBlock,
306
308
  drawingBlock,
307
309
  estimateSyllables,
@@ -349,6 +351,7 @@ import {
349
351
  mediaOnly,
350
352
  motionDelay,
351
353
  motionEntrance,
354
+ normalizeChartTable,
352
355
  normalizeShapeKind,
353
356
  parseDataFence,
354
357
  parseStatNumber,
@@ -389,7 +392,7 @@ import {
389
392
  wrapWithPersistentLayers,
390
393
  writeCustomTemplatesToFrontmatter,
391
394
  writeCustomThemesToFrontmatter
392
- } from "./chunk-TTJZXUQA.js";
395
+ } from "./chunk-5C6ZO5FV.js";
393
396
  import {
394
397
  ASCII_CHAR_H,
395
398
  ASCII_CHAR_W,
@@ -428,6 +431,7 @@ import {
428
431
  isExplicitTimelineLang,
429
432
  isExplicitTreeLang,
430
433
  isMaterializedMediaNode,
434
+ isMediaAnnotationName,
431
435
  isPictureFence,
432
436
  isPictureParagraph,
433
437
  isTreeFence,
@@ -436,6 +440,7 @@ import {
436
440
  parseAsciiDiagram,
437
441
  parseAsciiTimeline,
438
442
  parseAsciiTimelineWithStats,
443
+ parseStandaloneAnnotation,
439
444
  parseTree,
440
445
  parseWrappedFlowTimeline,
441
446
  profileBlockContents,
@@ -444,7 +449,7 @@ import {
444
449
  treeFromMarkdownList,
445
450
  treeFromTemplateData,
446
451
  treeToTemplateData
447
- } from "./chunk-NGQ5TJVX.js";
452
+ } from "./chunk-HGXZMB7K.js";
448
453
  import {
449
454
  extractContent,
450
455
  mapElementToBlock,
@@ -863,6 +868,7 @@ export {
863
868
  bottomFeature,
864
869
  buildAdvanceTimingJson,
865
870
  buildCaptionTrack,
871
+ buildChartData,
866
872
  buildCursorAtTime,
867
873
  buildDashboardCellChrome,
868
874
  buildDataBackupPath,
@@ -948,6 +954,7 @@ export {
948
954
  detectAsciiDiagram,
949
955
  detectAsciiTimeline,
950
956
  detectMarkdownWrapState,
957
+ detectPromotableBodyAnnotation,
951
958
  detectSyllableOnsets,
952
959
  detectTree,
953
960
  diagramBlock,
@@ -1083,6 +1090,7 @@ export {
1083
1090
  isHex,
1084
1091
  isHtmlLineBreak,
1085
1092
  isMaterializedMediaNode,
1093
+ isMediaAnnotationName,
1086
1094
  isMotionProfileName,
1087
1095
  isPersistentLayerTemplate,
1088
1096
  isPictureFence,
@@ -1135,6 +1143,7 @@ export {
1135
1143
  narrationSessionStep,
1136
1144
  nearestSnapPoint,
1137
1145
  needsQuoting,
1146
+ normalizeChartTable,
1138
1147
  normalizeDashboardZoom,
1139
1148
  normalizeDocfxMarkdown,
1140
1149
  normalizeShapeKind,
@@ -1160,6 +1169,7 @@ export {
1160
1169
  parsePresentationHints,
1161
1170
  parsePresentationPlan,
1162
1171
  parseProofDictionary,
1172
+ parseStandaloneAnnotation,
1163
1173
  parseStatNumber,
1164
1174
  parseSvgIsland,
1165
1175
  parseTheme,
@@ -29,7 +29,7 @@ import {
29
29
  traceWordPosAt,
30
30
  transcriptWordKeys,
31
31
  vadStep
32
- } from "../chunk-DOKSRBW2.js";
32
+ } from "../chunk-NROIOJKY.js";
33
33
  import "../chunk-NEWNNLWN.js";
34
34
  import {
35
35
  buildNarrationTimingJson,
@@ -43,8 +43,8 @@ import {
43
43
  wordIndexAtChar,
44
44
  wordIndexAtTime,
45
45
  wordPosAtExpectedSyllables
46
- } from "../chunk-TTJZXUQA.js";
47
- import "../chunk-NGQ5TJVX.js";
46
+ } from "../chunk-5C6ZO5FV.js";
47
+ import "../chunk-HGXZMB7K.js";
48
48
  import "../chunk-FUBMT6SJ.js";
49
49
  import "../chunk-WNEH3BZP.js";
50
50
  import "../chunk-L7QZORLB.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  profileBlockContents,
3
3
  recommendTemplatesForBlock
4
- } from "../chunk-NGQ5TJVX.js";
4
+ } from "../chunk-HGXZMB7K.js";
5
5
  import "../chunk-L7QZORLB.js";
6
6
  import "../chunk-L3KSFLTP.js";
7
7
  import "../chunk-P53Z4RYC.js";
@@ -25,9 +25,9 @@ import {
25
25
  serializePresentationPlan,
26
26
  transformNarratedSegment,
27
27
  usesDynamicPresentation
28
- } from "../chunk-CJYN3MTX.js";
29
- import "../chunk-TTJZXUQA.js";
30
- import "../chunk-NGQ5TJVX.js";
28
+ } from "../chunk-CS3MAZZX.js";
29
+ import "../chunk-5C6ZO5FV.js";
30
+ import "../chunk-HGXZMB7K.js";
31
31
  import "../chunk-SVN7T6BK.js";
32
32
  import "../chunk-FUBMT6SJ.js";
33
33
  import "../chunk-WNEH3BZP.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq",
3
- "version": "2.13.7",
3
+ "version": "2.13.8",
4
4
  "description": "Headless utilities for doc/block rendering, spatial math, Markdown, and storage",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -18,6 +18,196 @@ import {
18
18
  walkMarkdownTree
19
19
  } from "./chunk-L3KSFLTP.js";
20
20
 
21
+ // src/doc/standaloneAnnotation.ts
22
+ function parseAnnotationInner(inner) {
23
+ const tokens = tokenizeAttrTokens(inner.trim());
24
+ const firstIsParam = tokens.length > 0 && tokens[0].indexOf("=") > 0;
25
+ const template = firstIsParam || tokens.length === 0 ? void 0 : tokens[0];
26
+ const startIdx = firstIsParam ? 0 : 1;
27
+ const params = {};
28
+ for (let i = startIdx; i < tokens.length; i++) {
29
+ const kv = splitKeyValueToken(tokens[i]);
30
+ if (kv) params[kv.key] = kv.value;
31
+ }
32
+ return { template, params };
33
+ }
34
+ function parseStandaloneAnnotation(node) {
35
+ if (node.type !== "paragraph") return null;
36
+ const children = node.children ?? [];
37
+ if (children.length !== 1 || children[0].type !== "text") return null;
38
+ const text = children[0].value.trim();
39
+ const match = matchTrailingTemplateAnnotation(text);
40
+ if (!match || match.index !== 0) return null;
41
+ return parseAnnotationInner(match.inner);
42
+ }
43
+
44
+ // src/doc/mediaAnnotations.ts
45
+ var MEDIA_TEMPLATES = /* @__PURE__ */ new Set(["audio", "video", "media"]);
46
+ function isMediaAnnotationName(name) {
47
+ return name != null && MEDIA_TEMPLATES.has(name);
48
+ }
49
+ function time(raw) {
50
+ if (raw == null) return null;
51
+ return parseTimeSeconds(raw);
52
+ }
53
+ function videoPlacement(params) {
54
+ const explicit = params.placement ?? params.presentation;
55
+ if (explicit === "content") return "content";
56
+ if (explicit === "pip" || explicit === "picture-in-picture") return "picture-in-picture";
57
+ if (explicit === "overlay" || explicit === "full-frame") return "overlay";
58
+ if (params.pip === "" || params.pip === "true") return "picture-in-picture";
59
+ if (params.overlay === "" || params.overlay === "true") return "overlay";
60
+ return void 0;
61
+ }
62
+ function lockToBlock(raw) {
63
+ return raw !== "false" && raw !== "0";
64
+ }
65
+ function videoPipSize(raw) {
66
+ return raw === "small" || raw === "large" ? raw : void 0;
67
+ }
68
+ function videoPipShape(raw) {
69
+ return raw === "square" || raw === "wide" ? raw : void 0;
70
+ }
71
+ function videoPipPosition(raw) {
72
+ return raw === "top-left" || raw === "top-right" || raw === "bottom-left" || raw === "bottom-right" ? raw : void 0;
73
+ }
74
+ function toMediaClip(parsed, id) {
75
+ const { template, params } = parsed;
76
+ if (!template || !MEDIA_TEMPLATES.has(template)) return null;
77
+ const src = params.src;
78
+ if (!src) return null;
79
+ const kind = template === "video" ? "video" : "audio";
80
+ const anchor = params.anchor === "document" || params.span === "document" ? "document" : "block";
81
+ const clip = {
82
+ id,
83
+ src,
84
+ kind,
85
+ startAt: time(params.startAt ?? params.startTime) ?? 0,
86
+ anchor
87
+ };
88
+ const placement = kind === "video" ? videoPlacement(params) : void 0;
89
+ if (placement && placement !== "content") clip.placement = placement;
90
+ const pipSize = videoPipSize(params.pipSize);
91
+ const pipShape = videoPipShape(params.pipShape);
92
+ const pipPosition = videoPipPosition(params.pipPosition);
93
+ if (pipSize) clip.pipSize = pipSize;
94
+ if (pipShape) clip.pipShape = pipShape;
95
+ if (pipPosition) clip.pipPosition = pipPosition;
96
+ if (kind === "video" && placement && placement !== "content" && params.lockToBlock != null) {
97
+ const locked = lockToBlock(params.lockToBlock);
98
+ clip.lockToBlock = locked;
99
+ clip.anchor = locked ? "block" : "document";
100
+ if (locked) clip.startAt = 0;
101
+ }
102
+ const clipStart = time(params.clipStart);
103
+ const clipEnd = time(params.clipEnd);
104
+ if (clipStart != null) clip.clipStart = clipStart;
105
+ if (clipEnd != null) clip.clipEnd = clipEnd;
106
+ if (clip.lockToBlock === true) delete clip.clipEnd;
107
+ if (params.spillover === "true" || params.spillover === "") clip.spillover = true;
108
+ const edits = parseMediaEdits(mediaEditValuesFromParams(params));
109
+ if (edits) clip.edits = edits;
110
+ return clip;
111
+ }
112
+ function firstVideoElement(children) {
113
+ const visit = (nodes) => {
114
+ for (const child of nodes) {
115
+ if (child.type !== "htmlElement") continue;
116
+ if (child.tagName === "video") return child;
117
+ const nested = visit(child.children);
118
+ if (nested) return nested;
119
+ }
120
+ return null;
121
+ };
122
+ return visit(children);
123
+ }
124
+ function standaloneHtmlVideo(node) {
125
+ if (node.type === "htmlBlock") {
126
+ if (!/^\s*<video\b/i.test(node.rawHtml)) return null;
127
+ const element = firstVideoElement(node.htmlChildren);
128
+ return element ? { element, raw: node.rawHtml.trim() } : null;
129
+ }
130
+ if (node.type !== "paragraph" || !node.children.every((child) => child.type === "htmlInline")) {
131
+ return null;
132
+ }
133
+ const raw = node.children.map((child) => child.type === "htmlInline" ? child.rawHtml : "").join("");
134
+ if (!/^\s*<video\b[\s\S]*<\/video>\s*$/i.test(raw)) return null;
135
+ for (const child of node.children) {
136
+ if (child.type !== "htmlInline") continue;
137
+ const element = firstVideoElement(child.htmlChildren);
138
+ if (element) return { element, raw: raw.trim() };
139
+ }
140
+ return null;
141
+ }
142
+ function isStandaloneHtmlVideo(node) {
143
+ return standaloneHtmlVideo(node) !== null;
144
+ }
145
+ function htmlVideoClip(node, id) {
146
+ const authored = standaloneHtmlVideo(node);
147
+ if (!authored) return null;
148
+ const { element } = authored;
149
+ const placement = videoPlacement({
150
+ placement: element.attributes["data-squisq-video-placement"] ?? ""
151
+ });
152
+ if (!placement || placement === "content") return null;
153
+ const src = element.attributes.src;
154
+ if (!src) return null;
155
+ const locked = lockToBlock(element.attributes["data-squisq-video-lock-to-block"]);
156
+ const clip = {
157
+ id,
158
+ src,
159
+ kind: "video",
160
+ placement,
161
+ lockToBlock: locked,
162
+ startAt: locked ? 0 : time(element.attributes["data-squisq-video-start-at"]) ?? 0,
163
+ anchor: locked ? "block" : "document"
164
+ };
165
+ const pipSize = videoPipSize(element.attributes["data-squisq-video-pip-size"]);
166
+ const pipShape = videoPipShape(element.attributes["data-squisq-video-pip-shape"]);
167
+ const pipPosition = videoPipPosition(element.attributes["data-squisq-video-pip-position"]);
168
+ if (pipSize) clip.pipSize = pipSize;
169
+ if (pipShape) clip.pipShape = pipShape;
170
+ if (pipPosition) clip.pipPosition = pipPosition;
171
+ const clipStart = time(element.attributes["data-squisq-video-clip-start"]);
172
+ const clipEnd = time(element.attributes["data-squisq-video-clip-end"]);
173
+ if (clipStart != null) clip.clipStart = clipStart;
174
+ if (!locked && clipEnd != null) clip.clipEnd = clipEnd;
175
+ const edits = parseMediaEdits(mediaEditValuesFromAttributes("video", element.attributes));
176
+ if (edits) clip.edits = edits;
177
+ return clip;
178
+ }
179
+ function extractMediaFromContents(contents, makeId, blockId) {
180
+ const media = [];
181
+ const documentMedia = [];
182
+ const remaining = [];
183
+ let index = 0;
184
+ let originalIndex = 0;
185
+ for (const node of contents ?? []) {
186
+ const parsed = parseStandaloneAnnotation(node);
187
+ const clip = parsed ? toMediaClip(parsed, "") : htmlVideoClip(node, "");
188
+ if (clip) {
189
+ clip.id = makeId(clip.src, index++);
190
+ const line = node.position?.start.line;
191
+ if (line != null) clip.sourceLine = line;
192
+ if (blockId !== void 0) {
193
+ const authoredHtml = standaloneHtmlVideo(node);
194
+ const rawText = node.type === "paragraph" && node.children?.[0]?.type === "text" ? node.children[0].value.trim() : authoredHtml?.raw;
195
+ clip.origin = {
196
+ blockId,
197
+ index: originalIndex,
198
+ ...rawText !== void 0 ? { raw: rawText } : {},
199
+ ...authoredHtml ? { format: "html" } : {}
200
+ };
201
+ }
202
+ (clip.anchor === "document" ? documentMedia : media).push(clip);
203
+ } else {
204
+ remaining.push(node);
205
+ }
206
+ originalIndex++;
207
+ }
208
+ return { media, documentMedia, remaining };
209
+ }
210
+
21
211
  // src/doc/asciiDiagram/chars.ts
22
212
  function toCells(s) {
23
213
  return Array.from(s);
@@ -2872,196 +3062,6 @@ function matchNumberHighlight(text) {
2872
3062
  };
2873
3063
  }
2874
3064
 
2875
- // src/doc/standaloneAnnotation.ts
2876
- function parseAnnotationInner(inner) {
2877
- const tokens = tokenizeAttrTokens(inner.trim());
2878
- const firstIsParam = tokens.length > 0 && tokens[0].indexOf("=") > 0;
2879
- const template = firstIsParam || tokens.length === 0 ? void 0 : tokens[0];
2880
- const startIdx = firstIsParam ? 0 : 1;
2881
- const params = {};
2882
- for (let i = startIdx; i < tokens.length; i++) {
2883
- const kv = splitKeyValueToken(tokens[i]);
2884
- if (kv) params[kv.key] = kv.value;
2885
- }
2886
- return { template, params };
2887
- }
2888
- function parseStandaloneAnnotation(node) {
2889
- if (node.type !== "paragraph") return null;
2890
- const children = node.children ?? [];
2891
- if (children.length !== 1 || children[0].type !== "text") return null;
2892
- const text = children[0].value.trim();
2893
- const match = matchTrailingTemplateAnnotation(text);
2894
- if (!match || match.index !== 0) return null;
2895
- return parseAnnotationInner(match.inner);
2896
- }
2897
-
2898
- // src/doc/mediaAnnotations.ts
2899
- var MEDIA_TEMPLATES = /* @__PURE__ */ new Set(["audio", "video", "media"]);
2900
- function isMediaAnnotationName(name) {
2901
- return name != null && MEDIA_TEMPLATES.has(name);
2902
- }
2903
- function time(raw) {
2904
- if (raw == null) return null;
2905
- return parseTimeSeconds(raw);
2906
- }
2907
- function videoPlacement(params) {
2908
- const explicit = params.placement ?? params.presentation;
2909
- if (explicit === "content") return "content";
2910
- if (explicit === "pip" || explicit === "picture-in-picture") return "picture-in-picture";
2911
- if (explicit === "overlay" || explicit === "full-frame") return "overlay";
2912
- if (params.pip === "" || params.pip === "true") return "picture-in-picture";
2913
- if (params.overlay === "" || params.overlay === "true") return "overlay";
2914
- return void 0;
2915
- }
2916
- function lockToBlock(raw) {
2917
- return raw !== "false" && raw !== "0";
2918
- }
2919
- function videoPipSize(raw) {
2920
- return raw === "small" || raw === "large" ? raw : void 0;
2921
- }
2922
- function videoPipShape(raw) {
2923
- return raw === "square" || raw === "wide" ? raw : void 0;
2924
- }
2925
- function videoPipPosition(raw) {
2926
- return raw === "top-left" || raw === "top-right" || raw === "bottom-left" || raw === "bottom-right" ? raw : void 0;
2927
- }
2928
- function toMediaClip(parsed, id) {
2929
- const { template, params } = parsed;
2930
- if (!template || !MEDIA_TEMPLATES.has(template)) return null;
2931
- const src = params.src;
2932
- if (!src) return null;
2933
- const kind = template === "video" ? "video" : "audio";
2934
- const anchor = params.anchor === "document" || params.span === "document" ? "document" : "block";
2935
- const clip = {
2936
- id,
2937
- src,
2938
- kind,
2939
- startAt: time(params.startAt ?? params.startTime) ?? 0,
2940
- anchor
2941
- };
2942
- const placement = kind === "video" ? videoPlacement(params) : void 0;
2943
- if (placement && placement !== "content") clip.placement = placement;
2944
- const pipSize = videoPipSize(params.pipSize);
2945
- const pipShape = videoPipShape(params.pipShape);
2946
- const pipPosition = videoPipPosition(params.pipPosition);
2947
- if (pipSize) clip.pipSize = pipSize;
2948
- if (pipShape) clip.pipShape = pipShape;
2949
- if (pipPosition) clip.pipPosition = pipPosition;
2950
- if (kind === "video" && placement && placement !== "content" && params.lockToBlock != null) {
2951
- const locked = lockToBlock(params.lockToBlock);
2952
- clip.lockToBlock = locked;
2953
- clip.anchor = locked ? "block" : "document";
2954
- if (locked) clip.startAt = 0;
2955
- }
2956
- const clipStart = time(params.clipStart);
2957
- const clipEnd = time(params.clipEnd);
2958
- if (clipStart != null) clip.clipStart = clipStart;
2959
- if (clipEnd != null) clip.clipEnd = clipEnd;
2960
- if (clip.lockToBlock === true) delete clip.clipEnd;
2961
- if (params.spillover === "true" || params.spillover === "") clip.spillover = true;
2962
- const edits = parseMediaEdits(mediaEditValuesFromParams(params));
2963
- if (edits) clip.edits = edits;
2964
- return clip;
2965
- }
2966
- function firstVideoElement(children) {
2967
- const visit = (nodes) => {
2968
- for (const child of nodes) {
2969
- if (child.type !== "htmlElement") continue;
2970
- if (child.tagName === "video") return child;
2971
- const nested = visit(child.children);
2972
- if (nested) return nested;
2973
- }
2974
- return null;
2975
- };
2976
- return visit(children);
2977
- }
2978
- function standaloneHtmlVideo(node) {
2979
- if (node.type === "htmlBlock") {
2980
- if (!/^\s*<video\b/i.test(node.rawHtml)) return null;
2981
- const element = firstVideoElement(node.htmlChildren);
2982
- return element ? { element, raw: node.rawHtml.trim() } : null;
2983
- }
2984
- if (node.type !== "paragraph" || !node.children.every((child) => child.type === "htmlInline")) {
2985
- return null;
2986
- }
2987
- const raw = node.children.map((child) => child.type === "htmlInline" ? child.rawHtml : "").join("");
2988
- if (!/^\s*<video\b[\s\S]*<\/video>\s*$/i.test(raw)) return null;
2989
- for (const child of node.children) {
2990
- if (child.type !== "htmlInline") continue;
2991
- const element = firstVideoElement(child.htmlChildren);
2992
- if (element) return { element, raw: raw.trim() };
2993
- }
2994
- return null;
2995
- }
2996
- function isStandaloneHtmlVideo(node) {
2997
- return standaloneHtmlVideo(node) !== null;
2998
- }
2999
- function htmlVideoClip(node, id) {
3000
- const authored = standaloneHtmlVideo(node);
3001
- if (!authored) return null;
3002
- const { element } = authored;
3003
- const placement = videoPlacement({
3004
- placement: element.attributes["data-squisq-video-placement"] ?? ""
3005
- });
3006
- if (!placement || placement === "content") return null;
3007
- const src = element.attributes.src;
3008
- if (!src) return null;
3009
- const locked = lockToBlock(element.attributes["data-squisq-video-lock-to-block"]);
3010
- const clip = {
3011
- id,
3012
- src,
3013
- kind: "video",
3014
- placement,
3015
- lockToBlock: locked,
3016
- startAt: locked ? 0 : time(element.attributes["data-squisq-video-start-at"]) ?? 0,
3017
- anchor: locked ? "block" : "document"
3018
- };
3019
- const pipSize = videoPipSize(element.attributes["data-squisq-video-pip-size"]);
3020
- const pipShape = videoPipShape(element.attributes["data-squisq-video-pip-shape"]);
3021
- const pipPosition = videoPipPosition(element.attributes["data-squisq-video-pip-position"]);
3022
- if (pipSize) clip.pipSize = pipSize;
3023
- if (pipShape) clip.pipShape = pipShape;
3024
- if (pipPosition) clip.pipPosition = pipPosition;
3025
- const clipStart = time(element.attributes["data-squisq-video-clip-start"]);
3026
- const clipEnd = time(element.attributes["data-squisq-video-clip-end"]);
3027
- if (clipStart != null) clip.clipStart = clipStart;
3028
- if (!locked && clipEnd != null) clip.clipEnd = clipEnd;
3029
- const edits = parseMediaEdits(mediaEditValuesFromAttributes("video", element.attributes));
3030
- if (edits) clip.edits = edits;
3031
- return clip;
3032
- }
3033
- function extractMediaFromContents(contents, makeId, blockId) {
3034
- const media = [];
3035
- const documentMedia = [];
3036
- const remaining = [];
3037
- let index = 0;
3038
- let originalIndex = 0;
3039
- for (const node of contents ?? []) {
3040
- const parsed = parseStandaloneAnnotation(node);
3041
- const clip = parsed ? toMediaClip(parsed, "") : htmlVideoClip(node, "");
3042
- if (clip) {
3043
- clip.id = makeId(clip.src, index++);
3044
- const line = node.position?.start.line;
3045
- if (line != null) clip.sourceLine = line;
3046
- if (blockId !== void 0) {
3047
- const authoredHtml = standaloneHtmlVideo(node);
3048
- const rawText = node.type === "paragraph" && node.children?.[0]?.type === "text" ? node.children[0].value.trim() : authoredHtml?.raw;
3049
- clip.origin = {
3050
- blockId,
3051
- index: originalIndex,
3052
- ...rawText !== void 0 ? { raw: rawText } : {},
3053
- ...authoredHtml ? { format: "html" } : {}
3054
- };
3055
- }
3056
- (clip.anchor === "document" ? documentMedia : media).push(clip);
3057
- } else {
3058
- remaining.push(node);
3059
- }
3060
- originalIndex++;
3061
- }
3062
- return { media, documentMedia, remaining };
3063
- }
3064
-
3065
3065
  // src/doc/templateInputs.ts
3066
3066
  var VIDEO_FILE_RE = /\.(?:webm|mp4|mov|m4v|ogv)(?:[?#].*)?$/i;
3067
3067
  var INLINE_MEDIA_TAG_RE = /^<\/?(?:video|audio|source|track)\b/i;