@bendyline/squisq 1.5.2 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/README.md +63 -10
  2. package/dist/{Doc-BBVGq1_9.d.ts → Doc-ylqWKDc_.d.ts} +248 -37
  3. package/dist/{ImageEditDoc-FuyGtt6o.d.ts → ImageEditDoc-D828IXJ1.d.ts} +1 -1
  4. package/dist/annotationCoercion-Dr_DY9Hx.d.ts +86 -0
  5. package/dist/{chunk-T5UK6YOB.js → chunk-2PWOO4ZE.js} +60 -17
  6. package/dist/chunk-2PWOO4ZE.js.map +1 -0
  7. package/dist/{chunk-VWUFZ6ZG.js → chunk-3E5F2XMR.js} +2 -29
  8. package/dist/chunk-3E5F2XMR.js.map +1 -0
  9. package/dist/chunk-4X3JQXNM.js +35 -0
  10. package/dist/chunk-4X3JQXNM.js.map +1 -0
  11. package/dist/{chunk-P3K7NLHF.js → chunk-5DKBFXPY.js} +31 -121
  12. package/dist/chunk-5DKBFXPY.js.map +1 -0
  13. package/dist/{chunk-DLXZMS5K.js → chunk-5J4HKRJF.js} +51 -3
  14. package/dist/chunk-5J4HKRJF.js.map +1 -0
  15. package/dist/chunk-5UYI3RJB.js +2503 -0
  16. package/dist/chunk-5UYI3RJB.js.map +1 -0
  17. package/dist/{chunk-BEQODJWV.js → chunk-66QO7XFB.js} +11 -291
  18. package/dist/chunk-66QO7XFB.js.map +1 -0
  19. package/dist/{chunk-HWVFJAAH.js → chunk-AMIR72JP.js} +28 -10
  20. package/dist/chunk-AMIR72JP.js.map +1 -0
  21. package/dist/chunk-CY2R2VPR.js +884 -0
  22. package/dist/chunk-CY2R2VPR.js.map +1 -0
  23. package/dist/chunk-FVJUUTEM.js +74 -0
  24. package/dist/chunk-FVJUUTEM.js.map +1 -0
  25. package/dist/{chunk-Q3ROPT5H.js → chunk-GZY66SDN.js} +1 -1
  26. package/dist/{chunk-Q3ROPT5H.js.map → chunk-GZY66SDN.js.map} +1 -1
  27. package/dist/chunk-JOQYPRDZ.js +127 -0
  28. package/dist/chunk-JOQYPRDZ.js.map +1 -0
  29. package/dist/{chunk-A4O7GIWE.js → chunk-MMPBOUK7.js} +10 -73
  30. package/dist/chunk-MMPBOUK7.js.map +1 -0
  31. package/dist/{chunk-LDQ2HJIX.js → chunk-PXLVXTLW.js} +252 -54
  32. package/dist/chunk-PXLVXTLW.js.map +1 -0
  33. package/dist/{chunk-TQWLI6S2.js → chunk-Q7LROV2H.js} +4 -2
  34. package/dist/{chunk-TQWLI6S2.js.map → chunk-Q7LROV2H.js.map} +1 -1
  35. package/dist/{chunk-GPLTCSXO.js → chunk-R2GC6RLD.js} +7 -7
  36. package/dist/chunk-R2GC6RLD.js.map +1 -0
  37. package/dist/chunk-R2YZTCLO.js +292 -0
  38. package/dist/chunk-R2YZTCLO.js.map +1 -0
  39. package/dist/chunk-S7A5D7ZJ.js +174 -0
  40. package/dist/chunk-S7A5D7ZJ.js.map +1 -0
  41. package/dist/chunk-TFJVXUHH.js +2358 -0
  42. package/dist/chunk-TFJVXUHH.js.map +1 -0
  43. package/dist/{chunk-LTN6I7QW.js → chunk-TUWMK62B.js} +55 -4
  44. package/dist/chunk-TUWMK62B.js.map +1 -0
  45. package/dist/{chunk-IMSCRLLV.js → chunk-VR7UPJ7C.js} +35 -25
  46. package/dist/chunk-VR7UPJ7C.js.map +1 -0
  47. package/dist/{chunk-KKNUBQ6Y.js → chunk-W4O2TX5I.js} +157 -92
  48. package/dist/chunk-W4O2TX5I.js.map +1 -0
  49. package/dist/{chunk-5TYS5V3G.js → chunk-X6DUONGT.js} +4204 -3560
  50. package/dist/chunk-X6DUONGT.js.map +1 -0
  51. package/dist/doc/index.d.ts +2334 -5
  52. package/dist/doc/index.js +127 -33
  53. package/dist/generate/index.d.ts +7 -2
  54. package/dist/generate/index.js +1 -1
  55. package/dist/imageEdit/index.d.ts +9 -6
  56. package/dist/imageEdit/index.js +3 -3
  57. package/dist/index.d.ts +12 -10
  58. package/dist/index.js +246 -80
  59. package/dist/jsonForm/index.d.ts +7 -3
  60. package/dist/jsonForm/index.js +9 -4
  61. package/dist/markdown/index.d.ts +6 -70
  62. package/dist/markdown/index.js +13 -9
  63. package/dist/narration/index.d.ts +618 -0
  64. package/dist/narration/index.js +82 -0
  65. package/dist/recommend/index.d.ts +15 -1
  66. package/dist/recommend/index.js +2 -2
  67. package/dist/schemas/index.d.ts +28 -6
  68. package/dist/schemas/index.js +15 -13
  69. package/dist/spatial/index.d.ts +0 -1
  70. package/dist/spatial/index.js +1 -1
  71. package/dist/storage/index.js +1 -1
  72. package/dist/{themeLibrary-CehcJhzz.d.ts → themeLibrary-RjVgLpUi.d.ts} +10 -11
  73. package/dist/timing/index.js +5 -3
  74. package/dist/transform/index.d.ts +35 -24
  75. package/dist/transform/index.js +9 -10
  76. package/dist/{types-DlAZ7MW4.d.ts → types-BwMPl2CB.d.ts} +1 -1
  77. package/dist/{types-D98li1gV.d.ts → types-C4kiRn_k.d.ts} +3 -1
  78. package/dist/versions/index.d.ts +2 -1
  79. package/dist/versions/index.js +2 -2
  80. package/package.json +6 -6
  81. package/src/__tests__/applyNarrationTiming.test.ts +190 -0
  82. package/src/__tests__/applyRenderStyle.test.ts +3 -3
  83. package/src/__tests__/asciiDiagramBattle.test.ts +246 -0
  84. package/src/__tests__/asciiDiagramDetect.test.ts +162 -0
  85. package/src/__tests__/asciiDiagramMapping.test.ts +38 -0
  86. package/src/__tests__/asciiDiagramParse.test.ts +233 -0
  87. package/src/__tests__/asciiDiagramPipeline.test.ts +273 -0
  88. package/src/__tests__/asciiDiagramRender.test.ts +162 -0
  89. package/src/__tests__/asciiDiagramRepair.test.ts +84 -0
  90. package/src/__tests__/asciiTimelineDetect.test.ts +157 -0
  91. package/src/__tests__/asciiTimelineParse.test.ts +205 -0
  92. package/src/__tests__/asciiTimelinePipeline.test.ts +349 -0
  93. package/src/__tests__/asciiTimelineRender.test.ts +376 -0
  94. package/src/__tests__/attrTokens.test.ts +5 -0
  95. package/src/__tests__/contentContainer.test.ts +43 -0
  96. package/src/__tests__/customTemplatesFrontmatter.test.ts +0 -15
  97. package/src/__tests__/customThemesFrontmatter.test.ts +1 -0
  98. package/src/__tests__/dataTable.test.ts +25 -15
  99. package/src/__tests__/diagramBlock.test.ts +3 -3
  100. package/src/__tests__/diagramText.test.ts +26 -0
  101. package/src/__tests__/docToMarkdownMedia.test.ts +83 -0
  102. package/src/__tests__/drawingBlock.test.ts +3 -3
  103. package/src/__tests__/fixtures/asciiDiagramBattle.ts +512 -0
  104. package/src/__tests__/fixtures/asciiDiagrams.ts +287 -0
  105. package/src/__tests__/fixtures/asciiTimelines.ts +35 -0
  106. package/src/__tests__/fixtures/treeviewFixtures.ts +243 -0
  107. package/src/__tests__/getLayers.test.ts +32 -18
  108. package/src/__tests__/getLayersFallback.test.ts +8 -8
  109. package/src/__tests__/imageEditVersions.test.ts +2 -0
  110. package/src/__tests__/jsonForm.pointer.test.ts +47 -1
  111. package/src/__tests__/layoutBlock.test.ts +3 -3
  112. package/src/__tests__/majorApiTypes.test.ts +18 -0
  113. package/src/__tests__/markdown.test.ts +54 -4
  114. package/src/__tests__/markdownSanitize.test.ts +7 -5
  115. package/src/__tests__/matchFontFamily.test.ts +114 -0
  116. package/src/__tests__/materializeBlockLayers.test.ts +135 -0
  117. package/src/__tests__/materializeTestUtils.ts +17 -0
  118. package/src/__tests__/narrationAlign.test.ts +150 -0
  119. package/src/__tests__/narrationFeatures.test.ts +71 -0
  120. package/src/__tests__/narrationNuclei.test.ts +45 -0
  121. package/src/__tests__/narrationPacing.test.ts +189 -0
  122. package/src/__tests__/narrationScript.test.ts +149 -0
  123. package/src/__tests__/narrationSessionRepro.test.ts +62 -0
  124. package/src/__tests__/narrationSidecar.test.ts +88 -0
  125. package/src/__tests__/narrationSyllables.test.ts +65 -0
  126. package/src/__tests__/narrationTestSignals.ts +167 -0
  127. package/src/__tests__/narrationVad.test.ts +66 -0
  128. package/src/__tests__/resolveDocTheme.test.ts +16 -2
  129. package/src/__tests__/rootExports.test.ts +18 -0
  130. package/src/__tests__/scopedContentContainer.test.ts +20 -0
  131. package/src/__tests__/shapeGeometry.test.ts +12 -0
  132. package/src/__tests__/templateAnnotationParse.test.ts +10 -0
  133. package/src/__tests__/templateInputs.test.ts +69 -0
  134. package/src/__tests__/templateMetadata.test.ts +2 -1
  135. package/src/__tests__/templates.test.ts +143 -17
  136. package/src/__tests__/themeCompile.test.ts +49 -22
  137. package/src/__tests__/transformProvenance.test.ts +160 -0
  138. package/src/__tests__/transformV2.test.ts +40 -14
  139. package/src/__tests__/treeviewBattle.test.ts +76 -0
  140. package/src/__tests__/treeviewDetect.test.ts +168 -0
  141. package/src/__tests__/treeviewParse.test.ts +118 -0
  142. package/src/__tests__/treeviewPipeline.test.ts +183 -0
  143. package/src/__tests__/treeviewRender.test.ts +91 -0
  144. package/src/__tests__/versions.test.ts +44 -0
  145. package/src/doc/applyNarrationTiming.ts +244 -0
  146. package/src/doc/asciiDiagram/chars.ts +210 -0
  147. package/src/doc/asciiDiagram/detect.ts +175 -0
  148. package/src/doc/asciiDiagram/index.ts +38 -0
  149. package/src/doc/asciiDiagram/mapping.ts +225 -0
  150. package/src/doc/asciiDiagram/parse.ts +1095 -0
  151. package/src/doc/asciiDiagram/render.ts +963 -0
  152. package/src/doc/asciiDiagram/repair.ts +400 -0
  153. package/src/doc/asciiDiagram/types.ts +65 -0
  154. package/src/doc/asciiTimeline/detect.ts +138 -0
  155. package/src/doc/asciiTimeline/index.ts +26 -0
  156. package/src/doc/asciiTimeline/mapping.ts +43 -0
  157. package/src/doc/asciiTimeline/parse.ts +870 -0
  158. package/src/doc/asciiTimeline/render.ts +427 -0
  159. package/src/doc/asciiTimeline/types.ts +73 -0
  160. package/src/doc/asciiTimeline/wrappedFlow.ts +427 -0
  161. package/src/doc/audioMapping.ts +60 -46
  162. package/src/doc/customTemplatesFrontmatter.ts +0 -41
  163. package/src/doc/docToMarkdown.ts +70 -2
  164. package/src/doc/index.ts +76 -4
  165. package/src/doc/markdownToDoc.ts +138 -2
  166. package/src/doc/materializeBlockLayers.ts +304 -0
  167. package/src/doc/mediaAnnotations.ts +20 -0
  168. package/src/doc/resolveDocTheme.ts +8 -7
  169. package/src/doc/templateInputs.ts +185 -2
  170. package/src/doc/templates/__tests__/customTemplateRegistry.test.ts +22 -8
  171. package/src/doc/templates/__tests__/listBlock.test.ts +64 -0
  172. package/src/doc/templates/diagramBlock.ts +237 -38
  173. package/src/doc/templates/fallbackBlock.ts +1 -1
  174. package/src/doc/templates/index.ts +134 -279
  175. package/src/doc/templates/inputDescriptors.ts +20 -1
  176. package/src/doc/templates/listBlock.ts +88 -30
  177. package/src/doc/templates/metadata.ts +10 -0
  178. package/src/doc/templates/persistentLayers.ts +12 -126
  179. package/src/doc/templates/registry.ts +88 -0
  180. package/src/doc/templates/templateNames.ts +22 -0
  181. package/src/doc/templates/timelineBlock.ts +613 -0
  182. package/src/doc/templates/treeBlock.ts +131 -0
  183. package/src/doc/treeview/chars.ts +72 -0
  184. package/src/doc/treeview/detect.ts +145 -0
  185. package/src/doc/treeview/index.ts +30 -0
  186. package/src/doc/treeview/mapping.ts +95 -0
  187. package/src/doc/treeview/parse.ts +201 -0
  188. package/src/doc/treeview/render.ts +41 -0
  189. package/src/doc/treeview/types.ts +43 -0
  190. package/src/doc/utils/applyRenderStyle.ts +2 -9
  191. package/src/doc/utils/diagramText.ts +78 -0
  192. package/src/doc/utils/shapeGeometry.ts +67 -5
  193. package/src/doc/validate.ts +1 -1
  194. package/src/generate/templateMapper.ts +7 -0
  195. package/src/imageEdit/export.ts +6 -5
  196. package/src/imageEdit/versionPaths.ts +13 -26
  197. package/src/imageEdit/versions.ts +21 -100
  198. package/src/index.ts +1 -0
  199. package/src/internal/immutable.ts +58 -0
  200. package/src/jsonForm/index.ts +9 -1
  201. package/src/jsonForm/pointer.ts +68 -23
  202. package/src/markdown/attrTokens.ts +7 -5
  203. package/src/markdown/index.ts +1 -0
  204. package/src/markdown/stringify.ts +4 -9
  205. package/src/markdown/utils.ts +36 -14
  206. package/src/narration/align.ts +514 -0
  207. package/src/narration/features.ts +231 -0
  208. package/src/narration/index.ts +86 -0
  209. package/src/narration/nuclei.ts +118 -0
  210. package/src/narration/pacing.ts +211 -0
  211. package/src/narration/script.ts +239 -0
  212. package/src/narration/session.ts +100 -0
  213. package/src/narration/sidecar.ts +187 -0
  214. package/src/narration/syllables.ts +85 -0
  215. package/src/narration/trace.ts +50 -0
  216. package/src/narration/types.ts +299 -0
  217. package/src/narration/vad.ts +131 -0
  218. package/src/recommend/numberHighlight.ts +25 -0
  219. package/src/recommend/templates.ts +108 -12
  220. package/src/schemas/BlockTemplates.ts +156 -7
  221. package/src/schemas/Doc.ts +72 -9
  222. package/src/schemas/Media.ts +12 -2
  223. package/src/schemas/Theme.ts +45 -25
  224. package/src/schemas/Viewport.ts +2 -2
  225. package/src/schemas/fontStacks.ts +79 -0
  226. package/src/schemas/themeCompile.ts +15 -0
  227. package/src/schemas/themeConstants.ts +2 -0
  228. package/src/schemas/themeLibrary.ts +25 -19
  229. package/src/schemas/themeValidator.ts +1 -1
  230. package/src/schemas/themes/gezellig.json +1 -1
  231. package/src/spatial/Geohash.ts +0 -3
  232. package/src/storage/ContentContainer.ts +17 -9
  233. package/src/storage/ScopedContentContainer.ts +45 -15
  234. package/src/transform/applyTransform.ts +5 -5
  235. package/src/transform/index.ts +3 -1
  236. package/src/transform/registry.ts +169 -49
  237. package/src/transform/templateSelector.ts +21 -2
  238. package/src/transform/timingAllocator.ts +152 -21
  239. package/src/transform/types.ts +14 -1
  240. package/src/versions/gitignore.ts +34 -0
  241. package/src/versions/index.ts +2 -0
  242. package/src/versions/operations.ts +18 -104
  243. package/src/versions/paths.ts +13 -28
  244. package/src/versions/snapshotStore.ts +202 -0
  245. package/src/versions/types.ts +3 -1
  246. package/dist/chunk-5TYS5V3G.js.map +0 -1
  247. package/dist/chunk-A4O7GIWE.js.map +0 -1
  248. package/dist/chunk-BEQODJWV.js.map +0 -1
  249. package/dist/chunk-DLXZMS5K.js.map +0 -1
  250. package/dist/chunk-GPLTCSXO.js.map +0 -1
  251. package/dist/chunk-HWVFJAAH.js.map +0 -1
  252. package/dist/chunk-IMSCRLLV.js.map +0 -1
  253. package/dist/chunk-JELIRVDP.js +0 -24
  254. package/dist/chunk-JELIRVDP.js.map +0 -1
  255. package/dist/chunk-KKNUBQ6Y.js.map +0 -1
  256. package/dist/chunk-LDQ2HJIX.js.map +0 -1
  257. package/dist/chunk-LTN6I7QW.js.map +0 -1
  258. package/dist/chunk-P3K7NLHF.js.map +0 -1
  259. package/dist/chunk-T5UK6YOB.js.map +0 -1
  260. package/dist/chunk-UY7KGQ5R.js +0 -192
  261. package/dist/chunk-UY7KGQ5R.js.map +0 -1
  262. package/dist/chunk-VLJJHDAC.js +0 -218
  263. package/dist/chunk-VLJJHDAC.js.map +0 -1
  264. package/dist/chunk-VWUFZ6ZG.js.map +0 -1
  265. package/dist/story/index.d.ts +0 -1801
  266. package/dist/story/index.js +0 -279
  267. package/src/doc/getLayers.ts +0 -195
  268. /package/dist/{story → narration}/index.js.map +0 -0
package/README.md CHANGED
@@ -18,7 +18,7 @@ npm install @bendyline/squisq
18
18
  | Module | Description |
19
19
  | ------------ | -------------------------------------------------------------------------------- |
20
20
  | **schemas** | Type definitions — `Doc`, `BlockTemplate`, `Viewport`, `Theme`, `LayoutStrategy` |
21
- | **doc** | Template registry, 23 block templates, animation/theme utilities |
21
+ | **doc** | Template registry, 25 block templates, animation/theme utilities |
22
22
  | **markdown** | Markdown parsing, stringifying, AST types (`MarkdownDocument`), tree utilities |
23
23
  | **spatial** | Haversine distance, Geohash encode/decode |
24
24
  | **storage** | `StorageAdapter` interface, Memory + LocalStorage + LocalForage adapters |
@@ -42,16 +42,16 @@ Import only what you need:
42
42
 
43
43
  ```ts
44
44
  import type { Doc, BlockTemplate, Theme } from '@bendyline/squisq/schemas';
45
- import { getLayers, expandDocBlocks } from '@bendyline/squisq/doc';
45
+ import { materializeBlockLayers, expandDocBlocks } from '@bendyline/squisq/doc';
46
46
  import { parseMarkdown, stringifyMarkdown } from '@bendyline/squisq/markdown';
47
- import { haversineDistance, geohashEncode } from '@bendyline/squisq/spatial';
47
+ import { encodeGeohash, haversineDistance } from '@bendyline/squisq/spatial';
48
48
  import { LocalStorageAdapter } from '@bendyline/squisq/storage';
49
49
  ```
50
50
 
51
51
  Or import everything from the root:
52
52
 
53
53
  ```ts
54
- import { parseMarkdown, haversineDistance, getLayers } from '@bendyline/squisq';
54
+ import { parseMarkdown, haversineDistance, materializeBlockLayers } from '@bendyline/squisq';
55
55
  ```
56
56
 
57
57
  ## Quick Examples
@@ -67,22 +67,75 @@ console.log(doc.children); // AST nodes
67
67
  const md = stringifyMarkdown(doc);
68
68
  ```
69
69
 
70
+ ### Author an ASCII Timeline
71
+
72
+ Timeline fences are source-of-truth markdown. Unicode marker rails are
73
+ auto-detected; the explicit `timeline` language also accepts sparse/ASCII
74
+ forms. Repeat rails for multiple tracks and use event ids in `branch:` lines
75
+ for forks or cross-track links. Add longer callout text after `::`; optional
76
+ `side=above|below`, `descriptionSide=above|below`, and `callout=false` metadata
77
+ control placement or suppress labels on dense cadence points.
78
+
79
+ ````markdown
80
+ ## Runtime timing
81
+
82
+ ```timeline
83
+ Kernel: ● T28 :: Δ28 {#t28 side=above descriptionSide=below} ─────● T29 {#t29} ─────● T30 {#t30} ───►
84
+ Client: ──────────────────● Frame A {#frame-a} ───● Frame B {#frame-b} ───►
85
+ branch: t29 -> frame-a : interpolate
86
+ ```
87
+ ````
88
+
89
+ `markdownToDoc()` derives globally aligned event positions while preserving
90
+ the original fence byte-for-byte for markdown round-trips.
91
+
70
92
  ### Spatial Utilities
71
93
 
72
94
  ```ts
73
- import { haversineDistance, geohashEncode } from '@bendyline/squisq/spatial';
95
+ import { encodeGeohash, haversineDistance } from '@bendyline/squisq/spatial';
74
96
 
75
- const meters = haversineDistance(47.6, -122.3, 37.7, -122.4);
76
- const hash = geohashEncode(47.6, -122.3, 7);
97
+ const distanceKm = haversineDistance({ lat: 47.6, lng: -122.3 }, { lat: 37.7, lng: -122.4 });
98
+ const hash = encodeGeohash(47.6, -122.3, 7);
77
99
  ```
78
100
 
79
- ### Theme System
101
+ ### Materialize a Block
80
102
 
81
103
  ```ts
82
- import { resolveTheme, getAvailableThemes } from '@bendyline/squisq/schemas';
104
+ import { materializeBlockLayers } from '@bendyline/squisq/doc';
105
+
106
+ const result = materializeBlockLayers(block, {
107
+ theme,
108
+ viewport,
109
+ customTemplates: doc.customTemplates,
110
+ });
83
111
 
84
- const themes = getAvailableThemes(); // 8 built-in themes
112
+ render(result.layers);
113
+ if (result.diagnostic) report(result.diagnostic);
114
+ ```
115
+
116
+ The canonical materializer handles authored layers, built-in and document-scoped
117
+ templates, theme motion, and persistent layers. Failed templates produce a
118
+ visible fallback plus a structured diagnostic by default; pass
119
+ `failureMode: 'empty'` when a host deliberately wants no fallback UI.
120
+
121
+ ### Theme System
122
+
123
+ ```ts
124
+ import {
125
+ compileTheme,
126
+ createThemeRegistry,
127
+ getAvailableThemes,
128
+ resolveTheme,
129
+ } from '@bendyline/squisq/schemas';
130
+
131
+ const themes = getAvailableThemes(); // 11 built-in themes
85
132
  const theme = resolveTheme('cinematic');
133
+
134
+ // Host-level custom themes live in an explicit caller-owned registry.
135
+ const registry = createThemeRegistry([
136
+ compileTheme({ id: 'brand', name: 'Brand', seedColors: { primary: '#6633cc' } }),
137
+ ]);
138
+ const brand = resolveTheme('brand', registry);
86
139
  ```
87
140
 
88
141
  ## Related Packages
@@ -1,10 +1,11 @@
1
- import { Z as Transition, $ as TransitionType, M as MarkdownBlockNode, q as MarkdownHeading } from './types-DlAZ7MW4.js';
1
+ import { Z as Transition, $ as TransitionType, M as MarkdownBlockNode, q as MarkdownHeading } from './types-BwMPl2CB.js';
2
2
 
3
3
  /**
4
4
  * Media-clip timing model.
5
5
  *
6
- * An additive layer on top of the legacy sequential `Doc.audio.segments[]`
7
- * narration track. A {@link MediaClip} is a piece of audio or video whose
6
+ * An additive layer on top of the simple sequential `Doc.audio.segments[]`
7
+ * narration track, which remains first-class. A {@link MediaClip} is a piece
8
+ * of audio or video whose
8
9
  * timing is expressed *relative to its parent block* (or the whole document),
9
10
  * with an optional `startAt` offset and an optional `spillover` past the
10
11
  * block's end. {@link resolveMediaSchedule} flattens these into absolute,
@@ -51,6 +52,19 @@ interface MediaClip {
51
52
  * `startAt`) back to the exact line. Absent for programmatically built clips.
52
53
  */
53
54
  sourceLine?: number;
55
+ /**
56
+ * Round-trip home of the authoring annotation: the block whose contents
57
+ * held the paragraph, its position in that block's ORIGINAL contents
58
+ * array (before extraction), and the paragraph's exact source text.
59
+ * `docToMarkdown` re-inserts the annotation from this — `raw` verbatim
60
+ * when present, a re-serialized annotation otherwise. Absent for
61
+ * programmatically built clips (those emit at the document top).
62
+ */
63
+ origin?: {
64
+ blockId: string;
65
+ index: number;
66
+ raw?: string;
67
+ };
54
68
  }
55
69
  /**
56
70
  * A {@link MediaClip} resolved to absolute document-timeline coordinates.
@@ -95,7 +109,7 @@ declare function getDocPlaybackDuration(doc: Doc): number;
95
109
  * - landscape (16:9) - Default, standard video/presentation format
96
110
  * - portrait (9:16) - Vertical video, mobile stories
97
111
  * - square (1:1) - Social media posts
98
- * - standard (4:3) - Legacy presentation format
112
+ * - standard (4:3) - Classic presentation format
99
113
  */
100
114
  /**
101
115
  * Viewport configuration for doc rendering.
@@ -130,7 +144,7 @@ declare const VIEWPORT_PRESETS: {
130
144
  readonly height: 1080;
131
145
  readonly name: "1:1 Square";
132
146
  };
133
- /** 4:3 standard (legacy) */
147
+ /** 4:3 standard */
134
148
  readonly standard: {
135
149
  readonly width: 1440;
136
150
  readonly height: 1080;
@@ -331,6 +345,19 @@ interface BaseTemplateBlock {
331
345
  * Used with sourceStartTime to precisely position the block.
332
346
  */
333
347
  sourceDuration?: number;
348
+ /**
349
+ * Transform provenance: the id of the source Block this template block
350
+ * was derived from. Lets narration timing (and any per-source styling)
351
+ * be remapped onto transformed/summarized docs.
352
+ */
353
+ sourceBlockId?: string;
354
+ /** All source block ids when the block summarizes more than one. */
355
+ sourceBlockIds?: string[];
356
+ /**
357
+ * Char offset of the extraction inside the source block's plain text.
358
+ * Provenance only — NOT a time (see sourceStartTime for seconds).
359
+ */
360
+ sourceCharOffset?: number;
334
361
  /**
335
362
  * Per-block override for the theme's photographic image grade
336
363
  * (`theme.style.imageTreatment`). `'none'` opts this block's imagery out;
@@ -563,6 +590,86 @@ interface ListBlockInput extends BaseTemplateBlock {
563
590
  /** Optional accent image */
564
591
  accentImage?: AccentImage;
565
592
  }
593
+ /**
594
+ * Tree block — renders a hierarchical filesystem-style treeview from an
595
+ * ASCII tree fence (file trees, dependency trees, outlines). The nested
596
+ * `items` arrive via `templateData`, derived from the fence by the pipeline
597
+ * (peer to how `diagram` receives `nodes`/`edges`).
598
+ */
599
+ interface TreeBlockInput extends BaseTemplateBlock {
600
+ template: 'tree';
601
+ /** Nested tree items (usually via `templateData.items`). */
602
+ items?: TreeTemplateItem[];
603
+ /** Optional title above the tree. */
604
+ title?: string;
605
+ /** Color scheme for folder rows / icons. */
606
+ colorScheme?: ColorScheme;
607
+ }
608
+ /** One node supplied via `templateData.items` (mirrors `TreeLayerItem`). */
609
+ interface TreeTemplateItem {
610
+ id: string;
611
+ label: string;
612
+ isDir?: boolean;
613
+ comment?: string;
614
+ children: TreeTemplateItem[];
615
+ }
616
+ /**
617
+ * One point on a timeline track. Event positions are normalized across the
618
+ * whole timeline (0 = left edge, 1 = right edge) so events on separate tracks
619
+ * remain horizontally comparable.
620
+ */
621
+ interface TimelineTemplateEvent {
622
+ /** Stable id used by cross-track branch links. */
623
+ id: string;
624
+ /** Short label displayed next to the event dot. */
625
+ label: string;
626
+ /** Optional longer callout text. */
627
+ description?: string;
628
+ /** Normalized horizontal position; renderers clamp values to 0..1. */
629
+ position: number;
630
+ /** Preferred callout placement. Defaults to alternating above/below. */
631
+ side?: 'above' | 'below';
632
+ /** Description placement when it should sit opposite the event label. */
633
+ descriptionSide?: 'above' | 'below';
634
+ /** False renders the point only (useful for dense cadence tracks). */
635
+ callout?: boolean;
636
+ /** Dot treatment. Defaults to `filled`. */
637
+ marker?: 'filled' | 'hollow' | 'diamond';
638
+ }
639
+ /** A horizontal timeline lane with zero or more positioned events. */
640
+ interface TimelineTemplateTrack {
641
+ id: string;
642
+ /** Optional label displayed to the left of the track. */
643
+ label?: string;
644
+ /** Optional label displayed after the track's terminal arrow. */
645
+ endLabel?: string;
646
+ events: TimelineTemplateEvent[];
647
+ }
648
+ /**
649
+ * A branch or relationship between two events. Source and target resolve
650
+ * against event ids globally, so links may cross tracks.
651
+ */
652
+ interface TimelineTemplateLink {
653
+ source: string;
654
+ target: string;
655
+ /** Optional text displayed near the branch path. */
656
+ label?: string;
657
+ }
658
+ /**
659
+ * Timeline block - renders one or more horizontal tracks with event dots,
660
+ * text callouts, and optional branches between events.
661
+ */
662
+ interface TimelineBlockInput extends BaseTemplateBlock {
663
+ template: 'timeline';
664
+ /** Tracks and their events (usually supplied through `templateData`). */
665
+ tracks?: TimelineTemplateTrack[];
666
+ /** Optional branch/cross-track links between event ids. */
667
+ links?: TimelineTemplateLink[];
668
+ /** Optional title above the timeline. */
669
+ title?: string;
670
+ /** Color scheme for tracks, markers, and branch links. */
671
+ colorScheme?: ColorScheme;
672
+ }
566
673
  /**
567
674
  * Photo grid - 2-4 images in a tiled layout.
568
675
  * Used when multiple images are available for visual variety.
@@ -687,13 +794,54 @@ interface VideoPullQuoteInput extends BaseTemplateBlock {
687
794
  };
688
795
  }
689
796
  /**
690
- * Diagram block - renders child headings as a node-and-edge diagram.
797
+ * One diagram node supplied via `templateData.nodes` (canvas units, the
798
+ * same coordinate space as `Block.x`/`Block.y`). This is the data-driven
799
+ * alternative to child headings — used when a diagram is derived from an
800
+ * ASCII-art fence.
801
+ */
802
+ interface DiagramTemplateNode {
803
+ id: string;
804
+ /** Display label; may contain `\n` for multi-line labels. */
805
+ label: string;
806
+ x: number;
807
+ y: number;
808
+ /** Per-node width override in canvas units (defaults to the standard card width). */
809
+ w?: number;
810
+ /** Per-node height override in canvas units. */
811
+ h?: number;
812
+ /** Id of the node visually containing this one; containers draw behind their children. */
813
+ container?: string;
814
+ }
815
+ /** A position along one side of a diagram node, normalized from 0 to 1. */
816
+ interface DiagramEdgeAnchor {
817
+ side: 'top' | 'right' | 'bottom' | 'left';
818
+ /** Left→right on horizontal sides; top→bottom on vertical sides. */
819
+ offset: number;
820
+ }
821
+ /** An edge for `DiagramTemplateNode` lists. `directed` defaults to true. */
822
+ interface DiagramTemplateEdge {
823
+ source: string;
824
+ target: string;
825
+ /** Edge label rendered at the midpoint. */
826
+ label?: string;
827
+ /** False suppresses the end arrowhead (a plain connecting line). */
828
+ directed?: boolean;
829
+ /** Optional authored attachment on the source node. */
830
+ sourceAnchor?: DiagramEdgeAnchor;
831
+ /** Optional authored attachment on the target node. */
832
+ targetAnchor?: DiagramEdgeAnchor;
833
+ /** Per-edge path routing; ASCII-derived edges use orthogonal routing. */
834
+ routing?: 'straight' | 'orthogonal' | 'curved';
835
+ }
836
+ /**
837
+ * Diagram block - renders a node-and-edge diagram.
691
838
  *
692
- * Unlike other templates, the diagram template reads its content from
693
- * the parent block's `children` (passed via `context.children`) — each
694
- * child heading becomes a node, positioned by its `x`/`y` and connected
695
- * by its `connectsTo`. Per-diagram options on this input control overall
696
- * appearance; per-node data lives on the child blocks themselves.
839
+ * Two data sources, in precedence order:
840
+ * 1. Child headings (`context.children`) — each child is a node positioned
841
+ * by its `x`/`y` and connected by its `connectsTo` (legacy authored form).
842
+ * 2. `nodes`/`edges` on this input (usually via `templateData`, derived
843
+ * from an ASCII-art diagram fence in the block body).
844
+ * Per-diagram options on this input control overall appearance.
697
845
  */
698
846
  interface DiagramBlockInput extends BaseTemplateBlock {
699
847
  template: 'diagram';
@@ -711,6 +859,10 @@ interface DiagramBlockInput extends BaseTemplateBlock {
711
859
  endStyle?: MarkerStyle;
712
860
  /** Edge line style (default: 'solid'). */
713
861
  lineStyle?: 'solid' | 'dashed' | 'dotted';
862
+ /** Data-driven node list; used only when the block has no children. */
863
+ nodes?: DiagramTemplateNode[];
864
+ /** Edges for `nodes`. */
865
+ edges?: DiagramTemplateEdge[];
714
866
  }
715
867
  /**
716
868
  * Free-form 2D canvas block (`layout`). Like `drawing`/`diagram`, the
@@ -775,7 +927,7 @@ interface DataTableInput extends BaseTemplateBlock {
775
927
  /**
776
928
  * Union of all template block types.
777
929
  */
778
- type TemplateBlock = TitleBlockInput | SectionHeaderInput | StatHighlightInput | QuoteBlockInput | FactCardInput | TwoColumnInput | DateEventInput | ImageWithCaptionInput | LeftFeatureInput | RightFeatureInput | MapBlockInput | FullBleedQuoteInput | ListBlockInput | PhotoGridInput | DefinitionCardInput | ComparisonBarInput | PullQuoteInput | VideoWithCaptionInput | VideoPullQuoteInput | DataTableInput | DiagramBlockInput | DrawingBlockInput | RawLayersInput;
930
+ type TemplateBlock = TitleBlockInput | SectionHeaderInput | StatHighlightInput | QuoteBlockInput | FactCardInput | TwoColumnInput | DateEventInput | ImageWithCaptionInput | LeftFeatureInput | RightFeatureInput | MapBlockInput | FullBleedQuoteInput | ListBlockInput | PhotoGridInput | DefinitionCardInput | ComparisonBarInput | PullQuoteInput | VideoWithCaptionInput | VideoPullQuoteInput | DataTableInput | DiagramBlockInput | TreeBlockInput | TimelineBlockInput | DrawingBlockInput | RawLayersInput;
779
931
  /**
780
932
  * A block can be either a raw Block or a TemplateBlock.
781
933
  */
@@ -804,7 +956,7 @@ interface TemplateContext {
804
956
  /** Layout hints for this orientation */
805
957
  layout: LayoutHints;
806
958
  /**
807
- * The block's direct children (set by `getLayers` when the block has
959
+ * The block's direct children (set by `materializeBlockLayers` when the block has
808
960
  * `children`). Most templates ignore this; aggregate templates like
809
961
  * `diagram` consume it to render each child as part of their output.
810
962
  */
@@ -990,6 +1142,9 @@ interface ProgressIndicatorConfig {
990
1142
  color?: string;
991
1143
  }
992
1144
 
1145
+ /** Current Theme schema version. Bump on breaking changes; loader migrates. */
1146
+ declare const THEME_SCHEMA_VERSION: "1";
1147
+
993
1148
  /**
994
1149
  * Theme System
995
1150
  *
@@ -1012,8 +1167,6 @@ interface ProgressIndicatorConfig {
1012
1167
  * `seedColors`; both produce a complete `Theme`.
1013
1168
  */
1014
1169
 
1015
- /** Current Theme schema version. Bump on breaking changes; loader migrates. */
1016
- declare const THEME_SCHEMA_VERSION: "1";
1017
1170
  type ThemeSchemaVersion = typeof THEME_SCHEMA_VERSION;
1018
1171
  /**
1019
1172
  * Frontmatter key under which a document inlines its custom Theme
@@ -1228,19 +1381,19 @@ declare const DARK_SURFACE: SurfaceScheme;
1228
1381
  * style, renderStyle, colorSchemes) untouched.
1229
1382
  */
1230
1383
  declare function applySurface(theme: Theme, surface: SurfaceScheme): Theme;
1384
+ /** A caller-owned custom-theme registry for SSR tenants, tests, and embedders. */
1385
+ interface ThemeRegistry {
1386
+ register(theme: Theme): void;
1387
+ unregister(id: string): boolean;
1388
+ get(id: string): Theme | undefined;
1389
+ list(): Theme[];
1390
+ }
1231
1391
  /**
1232
- * Register a Theme so it can be looked up by id via `resolveTheme(id)`.
1233
- * Lets `Doc.themeId` round-trip through Doc serialization for custom themes.
1234
- *
1235
- * Registered themes take precedence over built-ins with the same id.
1236
- */
1237
- declare function registerTheme(theme: Theme): void;
1238
- /** Remove a previously registered theme. */
1239
- declare function unregisterTheme(id: string): void;
1240
- /** Snapshot of all currently registered (non-built-in) themes. */
1241
- declare function getRegisteredThemes(): Theme[];
1242
- /** @internal — used by themeLibrary's `resolveTheme` to check the registry first. */
1243
- declare function lookupRegisteredTheme(id: string | undefined): Theme | undefined;
1392
+ * Create a registry whose state is owned by the caller rather than the
1393
+ * process. Registered values are validated and stored as deeply frozen
1394
+ * snapshots, so later caller mutation cannot alter resolution behavior.
1395
+ */
1396
+ declare function createThemeRegistry(initialThemes?: readonly Theme[]): ThemeRegistry;
1244
1397
 
1245
1398
  /**
1246
1399
  * Custom Templates Schema
@@ -1532,11 +1685,22 @@ interface Block {
1532
1685
  duration: number;
1533
1686
  /** Which audio segment this block belongs to (0-indexed) */
1534
1687
  audioSegment: number;
1688
+ /**
1689
+ * Transform provenance: the source block id this block was derived
1690
+ * from (see `BaseTemplateBlock.sourceBlockId`). Present on blocks a
1691
+ * transform produced; lets a persisted transformed Doc keep its typed
1692
+ * link back to the source content.
1693
+ */
1694
+ sourceBlockId?: string;
1695
+ /** All source block ids when this block summarizes several. */
1696
+ sourceBlockIds?: string[];
1697
+ /** Char offset of the extraction inside the source block's plain text. */
1698
+ sourceCharOffset?: number;
1535
1699
  /**
1536
1700
  * Pre-computed visual layers, rendered back-to-front.
1537
1701
  *
1538
1702
  * Optional — template-derived blocks typically omit this and compute
1539
- * layers on demand via `getLayers()` from `@bendyline/squisq/doc`.
1703
+ * layers on demand via `materializeBlockLayers()` from `@bendyline/squisq/doc`.
1540
1704
  * Raw blocks (e.g., hand-crafted by AI) may provide layers directly.
1541
1705
  */
1542
1706
  layers?: Layer[];
@@ -1655,7 +1819,7 @@ interface Block {
1655
1819
  * A visual element within a block.
1656
1820
  * Layers are composited back-to-front (first layer is background).
1657
1821
  */
1658
- type Layer = ImageLayer | TextLayer | ShapeLayer | PathLayer | MapLayer | VideoLayer | TableLayer;
1822
+ type Layer = ImageLayer | TextLayer | ShapeLayer | PathLayer | MapLayer | VideoLayer | TableLayer | TreeLayer;
1659
1823
  interface BaseLayer {
1660
1824
  /** Unique identifier for this layer */
1661
1825
  id: string;
@@ -1847,14 +2011,9 @@ interface PathLayer extends BaseLayer {
1847
2011
  borderStyle?: BorderStyle;
1848
2012
  /** Optional stroke dash pattern (SVG `stroke-dasharray` syntax). */
1849
2013
  dasharray?: string;
1850
- /**
1851
- * Legacy arrowhead flag. Prefer `startMarker`/`endMarker`. When those are
1852
- * unset, `'end'`/`'start'`/`'both'` render a filled-triangle arrowhead.
1853
- */
1854
- arrow?: 'none' | 'end' | 'start' | 'both';
1855
- /** Marker at the path start (overrides `arrow`). Default: derived from `arrow`. */
2014
+ /** Marker at the path start. */
1856
2015
  startMarker?: MarkerStyle;
1857
- /** Marker at the path end (overrides `arrow`). Default: derived from `arrow`. */
2016
+ /** Marker at the path end. */
1858
2017
  endMarker?: MarkerStyle;
1859
2018
  };
1860
2019
  }
@@ -1965,6 +2124,58 @@ interface TableLayerStyle {
1965
2124
  /** Corner radius for the table container */
1966
2125
  borderRadius?: number;
1967
2126
  }
2127
+ /**
2128
+ * One node in a `TreeLayer` — a JSON-serializable hierarchy item (mirrors
2129
+ * the treeview codec's `TreeItem`). Rendered as an indented filesystem-style
2130
+ * row with a folder/file icon and connector rails.
2131
+ */
2132
+ interface TreeLayerItem {
2133
+ id: string;
2134
+ label: string;
2135
+ /** True renders a folder (container) icon; else a file (leaf) icon. */
2136
+ isDir?: boolean;
2137
+ /** Trailing comment shown muted after the label. */
2138
+ comment?: string;
2139
+ children: TreeLayerItem[];
2140
+ }
2141
+ /**
2142
+ * A hierarchical treeview rendered as interactive HTML inside a
2143
+ * `<foreignObject>` (like `TableLayer`): folder/file icons, connector
2144
+ * rails, and collapse chevrons. Interactive (collapse/expand) in the live
2145
+ * React player; captured fully-expanded and static in frame/PDF export.
2146
+ */
2147
+ interface TreeLayer extends BaseLayer {
2148
+ type: 'tree';
2149
+ content: {
2150
+ items: TreeLayerItem[];
2151
+ style: TreeLayerStyle;
2152
+ };
2153
+ }
2154
+ /** Styling options for a TreeLayer. */
2155
+ interface TreeLayerStyle {
2156
+ /** Leaf (file) row text color. */
2157
+ rowColor: string;
2158
+ /** Container (folder) row text color. */
2159
+ dirColor: string;
2160
+ /** Connector rail / branch color. */
2161
+ connectorColor: string;
2162
+ /** Icon color. */
2163
+ iconColor: string;
2164
+ /** Muted comment color. */
2165
+ commentColor: string;
2166
+ /** Font size in pixels. */
2167
+ fontSize: number;
2168
+ /** Row label font family. */
2169
+ fontFamily?: string;
2170
+ /** Monospace font for the connector rails. */
2171
+ monoFontFamily?: string;
2172
+ /** Indent step per depth level, in pixels. */
2173
+ indentPx: number;
2174
+ /** FontAwesome icon token for containers (default `folder`). */
2175
+ folderIcon?: string;
2176
+ /** FontAwesome icon token for leaves (default `file`). */
2177
+ fileIcon?: string;
2178
+ }
1968
2179
  /**
1969
2180
  * Available map tile styles from free/open-source providers.
1970
2181
  */
@@ -2174,4 +2385,4 @@ declare function getBlockAtTime(blocks: Block[], time: number): Block | null;
2174
2385
  */
2175
2386
  declare function getCaptionAtTime(captions: CaptionTrack | undefined, time: number): CaptionPhrase | null;
2176
2387
 
2177
- export { type MapTileStyle as $, type AccentImage as A, type Block as B, type CaptionPhrase as C, DARK_SURFACE as D, type DocDiagnostic as E, type DrawingBlockInput as F, FRONTMATTER_CUSTOM_TEMPLATES_KEY as G, FRONTMATTER_CUSTOM_THEMES_KEY as H, type FactCardInput as I, type FontFamily as J, type FontFamilyKind as K, type FullBleedQuoteInput as L, type GradientBackgroundConfig as M, type ImageBackgroundConfig as N, type ImageLayer as O, type ImageTreatment as P, type ImageWithCaptionInput as Q, LIGHT_SURFACE as R, type Layer as S, type LayerRepeat as T, type LayoutHints as U, type LeftFeatureInput as V, type LinearGradient as W, type ListBlockInput as X, type MapBlockInput as Y, type MapLayer as Z, type MapMarker as _, type AccentPosition as a, getRegisteredThemes as a$, type MarkerStyle as a0, type MediaClip as a1, type PathLayer as a2, type PatternBackgroundConfig as a3, type PersistentLayer as a4, type PersistentLayerConfig as a5, type PersistentLayerTemplate as a6, type PersistentLayerTemplateConfig as a7, type PersistentLayerTemplateType as a8, type PhotoGridInput as a9, type ThemeColorPalette as aA, type ThemeColorScheme as aB, type ThemeSchemaVersion as aC, type ThemeSeedColors as aD, type ThemeStyle as aE, type ThemeTypography as aF, type TitleBlockInput as aG, type TitleCaptionConfig as aH, type TwoColumnInput as aI, VIEWPORT_PRESETS as aJ, type VideoLayer as aK, type VideoPullQuoteInput as aL, type VideoWithCaptionInput as aM, type ViewportConfig as aN, type ViewportOrientation as aO, type ViewportPreset as aP, type VignetteConfig as aQ, applySurface as aR, calculateDuration as aS, calculateFontScale as aT, createTemplateContext as aU, createTheme as aV, getAspectRatioString as aW, getBlockAtTime as aX, getCaptionAtTime as aY, getDocPlaybackDuration as aZ, getLayoutHints as a_, type Position as aa, type ProgressIndicatorConfig as ab, type PullQuoteInput as ac, type QuoteBlockInput as ad, type RawLayersInput as ae, type RenderStyle as af, type RightFeatureInput as ag, type ScheduledClip as ah, type SectionHeaderInput as ai, type ShapeFilter as aj, type ShapeLayer as ak, type ShapePattern as al, type SolidBackgroundConfig as am, type StartBlockConfig as an, type StatHighlightInput as ao, type SurfaceScheme as ap, THEME_SCHEMA_VERSION as aq, type TableLayer as ar, type TableLayerStyle as as, type TemplateBlock as at, type TemplateContext as au, type TemplateFunction as av, type TemplateRegistry as aw, type TextLayer as ax, type TextStyle as ay, type Theme as az, type AmbientGradientConfig as b, getSafeTextBounds as b0, getSegmentAtTime as b1, getTwoColumnPositions as b2, getViewport as b3, getViewportOrientation as b4, isPersistentLayerTemplate as b5, isTemplateBlock as b6, scaledFontSize$1 as b7, lookupRegisteredTheme as b8, registerTheme as b9, resolveMediaSchedule as ba, scaledFontSize as bb, unregisterTheme as bc, type Animation as c, type AnimationType as d, type AudioBookmark as e, type AudioSegment as f, type AudioTimingData as g, type AudioTrack as h, type BlockConnection as i, type BorderStyle as j, type CaptionTrack as k, type CaptionWord as l, type ColorScheme as m, type ComparisonBarInput as n, type CornerBrandingConfig as o, type CustomTemplateDefinition as p, type CustomTemplateLayer as q, DEFAULT_DOC_FONT as r, DEFAULT_TITLE_FONT as s, type DataTableInput as t, type DateEventInput as u, type DeepPartial as v, type DefinitionCardInput as w, type DiagramBlockInput as x, type Doc as y, type DocBlock as z };
2388
+ export { type MapBlockInput as $, type AccentImage as A, type Block as B, type CaptionPhrase as C, DARK_SURFACE as D, type DiagramTemplateNode as E, type Doc as F, type DocBlock as G, type DocDiagnostic as H, type DrawingBlockInput as I, FRONTMATTER_CUSTOM_TEMPLATES_KEY as J, FRONTMATTER_CUSTOM_THEMES_KEY as K, type FactCardInput as L, type FontFamily as M, type FontFamilyKind as N, type FullBleedQuoteInput as O, type GradientBackgroundConfig as P, type ImageBackgroundConfig as Q, type ImageLayer as R, type ImageTreatment as S, type ImageWithCaptionInput as T, LIGHT_SURFACE as U, type Layer as V, type LayerRepeat as W, type LayoutHints as X, type LeftFeatureInput as Y, type LinearGradient as Z, type ListBlockInput as _, type AccentPosition as a, type ViewportOrientation as a$, type MapLayer as a0, type MapMarker as a1, type MapTileStyle as a2, type MarkerStyle as a3, type MediaClip as a4, type PathLayer as a5, type PatternBackgroundConfig as a6, type PersistentLayer as a7, type PersistentLayerConfig as a8, type PersistentLayerTemplate as a9, type TextLayer as aA, type TextStyle as aB, type Theme as aC, type ThemeColorPalette as aD, type ThemeColorScheme as aE, type ThemeRegistry as aF, type ThemeSchemaVersion as aG, type ThemeSeedColors as aH, type ThemeStyle as aI, type ThemeTypography as aJ, type TimelineBlockInput as aK, type TimelineTemplateEvent as aL, type TimelineTemplateLink as aM, type TimelineTemplateTrack as aN, type TitleBlockInput as aO, type TitleCaptionConfig as aP, type TreeBlockInput as aQ, type TreeLayer as aR, type TreeLayerItem as aS, type TreeLayerStyle as aT, type TreeTemplateItem as aU, type TwoColumnInput as aV, VIEWPORT_PRESETS as aW, type VideoLayer as aX, type VideoPullQuoteInput as aY, type VideoWithCaptionInput as aZ, type ViewportConfig as a_, type PersistentLayerTemplateConfig as aa, type PersistentLayerTemplateType as ab, type PhotoGridInput as ac, type Position as ad, type ProgressIndicatorConfig as ae, type PullQuoteInput as af, type QuoteBlockInput as ag, type RawLayersInput as ah, type RenderStyle as ai, type RightFeatureInput as aj, type ScheduledClip as ak, type SectionHeaderInput as al, type ShapeFilter as am, type ShapeLayer as an, type ShapePattern as ao, type SolidBackgroundConfig as ap, type StartBlockConfig as aq, type StatHighlightInput as ar, type SurfaceScheme as as, THEME_SCHEMA_VERSION as at, type TableLayer as au, type TableLayerStyle as av, type TemplateBlock as aw, type TemplateContext as ax, type TemplateFunction as ay, type TemplateRegistry as az, type AmbientGradientConfig as b, type ViewportPreset as b0, type VignetteConfig as b1, applySurface as b2, calculateDuration as b3, calculateFontScale as b4, createTemplateContext as b5, createTheme as b6, createThemeRegistry as b7, getAspectRatioString as b8, getBlockAtTime as b9, getCaptionAtTime as ba, getDocPlaybackDuration as bb, getLayoutHints as bc, getSafeTextBounds as bd, getSegmentAtTime as be, getTwoColumnPositions as bf, getViewport as bg, getViewportOrientation as bh, isPersistentLayerTemplate as bi, isTemplateBlock as bj, scaledFontSize$1 as bk, resolveMediaSchedule as bl, scaledFontSize as bm, type Animation as c, type AnimationType as d, type AudioBookmark as e, type AudioSegment as f, type AudioTimingData as g, type AudioTrack as h, type BlockConnection as i, type BorderStyle as j, type CaptionTrack as k, type CaptionWord as l, type ColorScheme as m, type ComparisonBarInput as n, type CornerBrandingConfig as o, type CustomTemplateDefinition as p, type CustomTemplateLayer as q, DEFAULT_DOC_FONT as r, DEFAULT_TITLE_FONT as s, type DataTableInput as t, type DateEventInput as u, type DeepPartial as v, type DefinitionCardInput as w, type DiagramBlockInput as x, type DiagramEdgeAnchor as y, type DiagramTemplateEdge as z };
@@ -1,4 +1,4 @@
1
- import { O as ImageLayer, ax as TextLayer, ak as ShapeLayer, a2 as PathLayer } from './Doc-BBVGq1_9.js';
1
+ import { R as ImageLayer, aA as TextLayer, an as ShapeLayer, a5 as PathLayer } from './Doc-ylqWKDc_.js';
2
2
 
3
3
  /**
4
4
  * ImageEditDoc — JSON document describing a layered, editable image.
@@ -0,0 +1,86 @@
1
+ import { a5 as BlockConnection, $ as TransitionType, _ as TransitionDirection } from './types-BwMPl2CB.js';
2
+
3
+ /**
4
+ * Heading-attribute value coercion.
5
+ *
6
+ * The Pandoc-style heading attribute block `{#id .class key=value}` parses
7
+ * to a flat `Record<string, string>` of `key → raw value`. This module
8
+ * coerces a known subset of keys to typed values (numbers, time-in-seconds,
9
+ * `BlockConnection[]`) so downstream consumers don't have to re-parse them.
10
+ *
11
+ * Unknown keys are returned in `metadata` as raw strings. Malformed known-key
12
+ * values are dropped from the typed result and reported via `warnings` (the
13
+ * raw string is preserved in `params` upstream for lossless round-tripping —
14
+ * coercion failures do not corrupt the source).
15
+ */
16
+
17
+ /**
18
+ * Registry of known block-meta keys and their coercion strategies.
19
+ *
20
+ * Adding a new typed key: add an entry here, add the typed field to
21
+ * `HeadingAttributes.blockMeta` in `types.ts`, and apply the coerced value
22
+ * in `markdownToDoc.ts`.
23
+ */
24
+ declare const KNOWN_BLOCK_META_KEYS: {
25
+ readonly x: "number";
26
+ readonly y: "number";
27
+ readonly startTime: "time";
28
+ readonly duration: "time";
29
+ readonly connectsTo: "connectionList";
30
+ readonly transition: "transition";
31
+ readonly transitionDuration: "time";
32
+ readonly transitionDirection: "transitionDirection";
33
+ };
34
+ type KnownBlockMetaKey = keyof typeof KNOWN_BLOCK_META_KEYS;
35
+ /**
36
+ * Editor-facing description of a known block-meta key: what it does, and
37
+ * either its closed set of valid values or a free-form format hint. This is
38
+ * the single source the markdown editor's `{[name key=value]}` attribute
39
+ * autocomplete reads from, so the suggestion list stays in lockstep with
40
+ * `KNOWN_BLOCK_META_KEYS` and the transition vocabulary rather than drifting
41
+ * in a hand-maintained copy. `values`/`valueHint` are mutually exclusive: a
42
+ * key has a closed enum (`values`) or a format hint (`valueHint`), not both.
43
+ */
44
+ interface BlockMetaKeyDescriptor {
45
+ key: KnownBlockMetaKey;
46
+ /** One-line description, shown as the completion item's detail. */
47
+ description: string;
48
+ /** Closed set of valid values, for keys backed by an enum. */
49
+ values?: readonly string[];
50
+ /** Format hint shown when the value is free-form (no closed set). */
51
+ valueHint?: string;
52
+ }
53
+ /**
54
+ * Ordered descriptors for every key in `KNOWN_BLOCK_META_KEYS`. Order is the
55
+ * suggestion display order: the transition family first (the most common
56
+ * authoring case), then timeline timing, then diagram geometry/links.
57
+ */
58
+ declare const BLOCK_META_KEY_DESCRIPTORS: readonly BlockMetaKeyDescriptor[];
59
+ /**
60
+ * The shape of the typed values produced by coercion. Mirrors
61
+ * `HeadingAttributes.blockMeta` in `types.ts`.
62
+ */
63
+ interface CoercedBlockMeta {
64
+ x?: number;
65
+ y?: number;
66
+ startTime?: number;
67
+ duration?: number;
68
+ connectsTo?: BlockConnection[];
69
+ transition?: {
70
+ type: TransitionType;
71
+ duration?: number;
72
+ direction?: TransitionDirection;
73
+ };
74
+ }
75
+ /**
76
+ * Parse a time value to seconds. Accepts:
77
+ * - bare number: `5` → 5, `5.5` → 5.5
78
+ * - `mm:ss`: `01:30` → 90
79
+ * - `mm:ss.ms`: `01:30.500` → 90.5
80
+ * - `1500ms` → 1.5
81
+ *
82
+ * Returns null on malformed input.
83
+ */
84
+ declare function parseTimeSeconds(raw: string): number | null;
85
+
86
+ export { BLOCK_META_KEY_DESCRIPTORS as B, type CoercedBlockMeta as C, KNOWN_BLOCK_META_KEYS as K, type BlockMetaKeyDescriptor as a, type KnownBlockMetaKey as b, parseTimeSeconds as p };