@bendyline/squisq 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE.md +24 -0
  3. package/dist/{ContentContainer-BXUlIf18.d.ts → ContentContainer-B2w9sUoL.d.ts} +15 -0
  4. package/dist/{Doc-DynJleo-.d.ts → Doc-BubIpWsp.d.ts} +1 -1
  5. package/dist/{ImageEditDoc-Ca4Tr9uN.d.ts → ImageEditDoc-CGxk5CHc.d.ts} +1 -1
  6. package/dist/{annotationCoercion-Dr_DY9Hx.d.ts → annotationCoercion-PtRQhk5V.d.ts} +1 -1
  7. package/dist/chunk-2L55443L.js +0 -0
  8. package/dist/{chunk-VWCJ2WXC.js → chunk-2ZWIXGAC.js} +0 -1
  9. package/dist/{chunk-VYFRI7R6.js → chunk-32R2RZAO.js} +72 -3
  10. package/dist/chunk-3IGPAPQ7.js +645 -0
  11. package/dist/{chunk-QE7TWGVT.js → chunk-4VOD55SX.js} +0 -1
  12. package/dist/{chunk-3E5F2XMR.js → chunk-67L6WRJN.js} +0 -1
  13. package/dist/{chunk-5DKBFXPY.js → chunk-6ECMNUIP.js} +26 -18
  14. package/dist/{chunk-JI77MGAK.js → chunk-7ARJZYQY.js} +159 -120
  15. package/dist/{chunk-DBS6RIFL.js → chunk-7N4G32LG.js} +0 -1
  16. package/dist/{chunk-JOQYPRDZ.js → chunk-7YEZFHLS.js} +10 -8
  17. package/dist/{chunk-2UQOHYE2.js → chunk-7ZAAICW4.js} +0 -1
  18. package/dist/{chunk-66QO7XFB.js → chunk-ACZOVWX3.js} +117 -7
  19. package/dist/{chunk-5J4HKRJF.js → chunk-BAOV476U.js} +0 -1
  20. package/dist/chunk-BCCXTMN5.js +699 -0
  21. package/dist/{chunk-JHZWYRSW.js → chunk-C33GTPUZ.js} +11 -4
  22. package/dist/{chunk-QUUPYOSP.js → chunk-CB45YGAM.js} +2 -3
  23. package/dist/{chunk-XNLB57UD.js → chunk-DYPMOPIW.js} +18 -2
  24. package/dist/{chunk-VR7UPJ7C.js → chunk-FCG3BIZN.js} +12 -1
  25. package/dist/{chunk-5UYI3RJB.js → chunk-FDYDYL77.js} +54 -40
  26. package/dist/{chunk-OTKVFVL6.js → chunk-I2O6W7DX.js} +116 -44
  27. package/dist/{chunk-Q7LROV2H.js → chunk-NKNMGIIN.js} +0 -1
  28. package/dist/chunk-OPO5K4DZ.js +241 -0
  29. package/dist/{chunk-TUWMK62B.js → chunk-PUS54YU6.js} +45 -2
  30. package/dist/chunk-QKPXHDLR.js +0 -0
  31. package/dist/{chunk-GZY66SDN.js → chunk-R3KTTOMS.js} +0 -1
  32. package/dist/{chunk-ILWDXLUK.js → chunk-RS5AP3J4.js} +49 -10
  33. package/dist/chunk-WV5ARNDA.js +0 -0
  34. package/dist/{chunk-4X3JQXNM.js → chunk-XOFT65EX.js} +1 -2
  35. package/dist/{chunk-FVTQSNR7.js → chunk-XRW6P7IF.js} +13 -5
  36. package/dist/chunk-XWNNA3KE.js +0 -0
  37. package/dist/chunk-YZNGMV3G.js +0 -0
  38. package/dist/{chunk-R2YZTCLO.js → chunk-ZQKZSJAX.js} +1 -2
  39. package/dist/doc/index.d.ts +27 -12
  40. package/dist/doc/index.js +16 -17
  41. package/dist/generate/index.d.ts +2 -2
  42. package/dist/generate/index.js +2 -3
  43. package/dist/icons/index.js +3 -4
  44. package/dist/icons/inlineIconMarker.js +1 -2
  45. package/dist/imageEdit/index.d.ts +48 -17
  46. package/dist/imageEdit/index.js +3 -4
  47. package/dist/index.d.ts +11 -11
  48. package/dist/index.js +60 -33
  49. package/dist/jsonForm/index.d.ts +10 -3
  50. package/dist/jsonForm/index.js +8 -7
  51. package/dist/markdown/index.d.ts +75 -11
  52. package/dist/markdown/index.js +32 -7
  53. package/dist/{materializePageSection-DDzubQXo.d.ts → materializePageSection-wSLA2A1g.d.ts} +2 -2
  54. package/dist/narration/index.d.ts +16 -3
  55. package/dist/narration/index.js +13 -14
  56. package/dist/random/index.d.ts +11 -2
  57. package/dist/random/index.js +2 -3
  58. package/dist/recommend/index.d.ts +1 -1
  59. package/dist/recommend/index.js +3 -4
  60. package/dist/schemas/index.d.ts +5 -5
  61. package/dist/schemas/index.js +5 -6
  62. package/dist/spatial/index.d.ts +2 -1
  63. package/dist/spatial/index.js +1 -2
  64. package/dist/storage/index.d.ts +4 -2
  65. package/dist/storage/index.js +1 -2
  66. package/dist/{themeLibrary-B72m0W1y.d.ts → themeLibrary-DU9mUmVl.d.ts} +1 -1
  67. package/dist/timing/index.js +3 -4
  68. package/dist/transform/index.d.ts +3 -3
  69. package/dist/transform/index.js +6 -7
  70. package/dist/{types-C4kiRn_k.d.ts → types-8QjefM9J.d.ts} +38 -2
  71. package/dist/{types-BwMPl2CB.d.ts → types-CUNc9biN.d.ts} +24 -1
  72. package/dist/versions/index.d.ts +14 -11
  73. package/dist/versions/index.js +2 -3
  74. package/package.json +4 -2
  75. package/dist/chunk-2UQOHYE2.js.map +0 -1
  76. package/dist/chunk-3E5F2XMR.js.map +0 -1
  77. package/dist/chunk-4X3JQXNM.js.map +0 -1
  78. package/dist/chunk-5DKBFXPY.js.map +0 -1
  79. package/dist/chunk-5J4HKRJF.js.map +0 -1
  80. package/dist/chunk-5UYI3RJB.js.map +0 -1
  81. package/dist/chunk-66QO7XFB.js.map +0 -1
  82. package/dist/chunk-AMIR72JP.js +0 -380
  83. package/dist/chunk-AMIR72JP.js.map +0 -1
  84. package/dist/chunk-DBS6RIFL.js.map +0 -1
  85. package/dist/chunk-DNJKBAI7.js +0 -1
  86. package/dist/chunk-DNJKBAI7.js.map +0 -1
  87. package/dist/chunk-ET53IIEP.js +0 -1
  88. package/dist/chunk-ET53IIEP.js.map +0 -1
  89. package/dist/chunk-FVTQSNR7.js.map +0 -1
  90. package/dist/chunk-GZY66SDN.js.map +0 -1
  91. package/dist/chunk-ILWDXLUK.js.map +0 -1
  92. package/dist/chunk-JHZWYRSW.js.map +0 -1
  93. package/dist/chunk-JI77MGAK.js.map +0 -1
  94. package/dist/chunk-JOQYPRDZ.js.map +0 -1
  95. package/dist/chunk-OTKVFVL6.js.map +0 -1
  96. package/dist/chunk-PGGGKYWG.js +0 -1
  97. package/dist/chunk-PGGGKYWG.js.map +0 -1
  98. package/dist/chunk-Q7LROV2H.js.map +0 -1
  99. package/dist/chunk-QE7TWGVT.js.map +0 -1
  100. package/dist/chunk-QUUPYOSP.js.map +0 -1
  101. package/dist/chunk-R2GC6RLD.js +0 -344
  102. package/dist/chunk-R2GC6RLD.js.map +0 -1
  103. package/dist/chunk-R2YZTCLO.js.map +0 -1
  104. package/dist/chunk-S7A5D7ZJ.js +0 -174
  105. package/dist/chunk-S7A5D7ZJ.js.map +0 -1
  106. package/dist/chunk-TUWMK62B.js.map +0 -1
  107. package/dist/chunk-V543AI2F.js +0 -1
  108. package/dist/chunk-V543AI2F.js.map +0 -1
  109. package/dist/chunk-VR7UPJ7C.js.map +0 -1
  110. package/dist/chunk-VWCJ2WXC.js.map +0 -1
  111. package/dist/chunk-VYFRI7R6.js.map +0 -1
  112. package/dist/chunk-XNLB57UD.js.map +0 -1
  113. package/dist/chunk-ZLQKNOZQ.js +0 -1
  114. package/dist/chunk-ZLQKNOZQ.js.map +0 -1
  115. package/dist/doc/index.js.map +0 -1
  116. package/dist/generate/index.js.map +0 -1
  117. package/dist/icons/index.js.map +0 -1
  118. package/dist/icons/inlineIconMarker.js.map +0 -1
  119. package/dist/imageEdit/index.js.map +0 -1
  120. package/dist/index.js.map +0 -1
  121. package/dist/jsonForm/index.js.map +0 -1
  122. package/dist/markdown/index.js.map +0 -1
  123. package/dist/narration/index.js.map +0 -1
  124. package/dist/random/index.js.map +0 -1
  125. package/dist/recommend/index.js.map +0 -1
  126. package/dist/schemas/index.js.map +0 -1
  127. package/dist/spatial/index.js.map +0 -1
  128. package/dist/storage/index.js.map +0 -1
  129. package/dist/timing/index.js.map +0 -1
  130. package/dist/transform/index.js.map +0 -1
  131. package/dist/versions/index.js.map +0 -1
  132. package/src/__tests__/animationUtils.test.ts +0 -117
  133. package/src/__tests__/annotationCoercion.test.ts +0 -243
  134. package/src/__tests__/applyNarrationTiming.test.ts +0 -190
  135. package/src/__tests__/applyRenderStyle.test.ts +0 -146
  136. package/src/__tests__/asciiDiagramBattle.test.ts +0 -246
  137. package/src/__tests__/asciiDiagramDetect.test.ts +0 -162
  138. package/src/__tests__/asciiDiagramMapping.test.ts +0 -38
  139. package/src/__tests__/asciiDiagramParse.test.ts +0 -233
  140. package/src/__tests__/asciiDiagramPipeline.test.ts +0 -273
  141. package/src/__tests__/asciiDiagramRender.test.ts +0 -162
  142. package/src/__tests__/asciiDiagramRepair.test.ts +0 -84
  143. package/src/__tests__/asciiTimelineDetect.test.ts +0 -157
  144. package/src/__tests__/asciiTimelineParse.test.ts +0 -205
  145. package/src/__tests__/asciiTimelinePipeline.test.ts +0 -349
  146. package/src/__tests__/asciiTimelineRender.test.ts +0 -376
  147. package/src/__tests__/atmosphereLayers.test.ts +0 -108
  148. package/src/__tests__/attrTokens.test.ts +0 -167
  149. package/src/__tests__/colorUtils.test.ts +0 -112
  150. package/src/__tests__/contentContainer.test.ts +0 -325
  151. package/src/__tests__/contentExtractor.test.ts +0 -243
  152. package/src/__tests__/coverBlock.test.ts +0 -310
  153. package/src/__tests__/customTemplateSample.test.ts +0 -144
  154. package/src/__tests__/customTemplatesFrontmatter.test.ts +0 -221
  155. package/src/__tests__/customThemesFrontmatter.test.ts +0 -146
  156. package/src/__tests__/dataTable.test.ts +0 -145
  157. package/src/__tests__/diagramBlock.test.ts +0 -122
  158. package/src/__tests__/diagramLayout.test.ts +0 -134
  159. package/src/__tests__/diagramText.test.ts +0 -26
  160. package/src/__tests__/docToMarkdownMedia.test.ts +0 -83
  161. package/src/__tests__/drawing.test.ts +0 -109
  162. package/src/__tests__/drawingBlock.test.ts +0 -124
  163. package/src/__tests__/drawingLayout.test.ts +0 -171
  164. package/src/__tests__/fixtures/asciiDiagramBattle.ts +0 -512
  165. package/src/__tests__/fixtures/asciiDiagrams.ts +0 -287
  166. package/src/__tests__/fixtures/asciiTimelines.ts +0 -35
  167. package/src/__tests__/fixtures/treeviewFixtures.ts +0 -243
  168. package/src/__tests__/geohash.test.ts +0 -110
  169. package/src/__tests__/getLayers.test.ts +0 -243
  170. package/src/__tests__/getLayersFallback.test.ts +0 -103
  171. package/src/__tests__/haversine.test.ts +0 -63
  172. package/src/__tests__/iconResolve.test.ts +0 -122
  173. package/src/__tests__/imageEditExportSvg.test.ts +0 -70
  174. package/src/__tests__/imageEditState.test.ts +0 -74
  175. package/src/__tests__/imageEditVersions.test.ts +0 -243
  176. package/src/__tests__/inferDocumentTitle.test.ts +0 -50
  177. package/src/__tests__/inlineIconMarker.test.ts +0 -36
  178. package/src/__tests__/inputDescriptors.test.ts +0 -162
  179. package/src/__tests__/jsonForm.chooseControl.test.ts +0 -86
  180. package/src/__tests__/jsonForm.evaluateWhen.test.ts +0 -59
  181. package/src/__tests__/jsonForm.inferSchema.test.ts +0 -25
  182. package/src/__tests__/jsonForm.pointer.test.ts +0 -149
  183. package/src/__tests__/jsonForm.tokens.test.ts +0 -84
  184. package/src/__tests__/layoutBlock.test.ts +0 -83
  185. package/src/__tests__/layoutLayout.test.ts +0 -169
  186. package/src/__tests__/localForageAdapter.test.ts +0 -155
  187. package/src/__tests__/majorApiTypes.test.ts +0 -18
  188. package/src/__tests__/markdown.test.ts +0 -1009
  189. package/src/__tests__/markdownIcons.test.ts +0 -104
  190. package/src/__tests__/markdownSanitize.test.ts +0 -81
  191. package/src/__tests__/markdownToDoc.test.ts +0 -957
  192. package/src/__tests__/matchFontFamily.test.ts +0 -114
  193. package/src/__tests__/materializeBlockLayers.test.ts +0 -167
  194. package/src/__tests__/materializePageSections.test.ts +0 -404
  195. package/src/__tests__/materializeTestUtils.ts +0 -17
  196. package/src/__tests__/mediaAnnotations.test.ts +0 -91
  197. package/src/__tests__/mediaSchedule.test.ts +0 -118
  198. package/src/__tests__/narrationAlign.test.ts +0 -150
  199. package/src/__tests__/narrationFeatures.test.ts +0 -71
  200. package/src/__tests__/narrationNuclei.test.ts +0 -45
  201. package/src/__tests__/narrationPacing.test.ts +0 -189
  202. package/src/__tests__/narrationScript.test.ts +0 -149
  203. package/src/__tests__/narrationSessionRepro.test.ts +0 -62
  204. package/src/__tests__/narrationSidecar.test.ts +0 -88
  205. package/src/__tests__/narrationSyllables.test.ts +0 -65
  206. package/src/__tests__/narrationTestSignals.ts +0 -167
  207. package/src/__tests__/narrationVad.test.ts +0 -66
  208. package/src/__tests__/pageStyle.test.ts +0 -258
  209. package/src/__tests__/pandocAttrParse.test.ts +0 -187
  210. package/src/__tests__/recommendTemplates.test.ts +0 -183
  211. package/src/__tests__/resolveDocTheme.test.ts +0 -69
  212. package/src/__tests__/rootExports.test.ts +0 -61
  213. package/src/__tests__/scopedContentContainer.test.ts +0 -109
  214. package/src/__tests__/seededRandom.test.ts +0 -142
  215. package/src/__tests__/shapeGeometry.test.ts +0 -138
  216. package/src/__tests__/shapeVocabulary.test.ts +0 -133
  217. package/src/__tests__/storage.test.ts +0 -60
  218. package/src/__tests__/structuredData.test.ts +0 -249
  219. package/src/__tests__/surface.test.ts +0 -68
  220. package/src/__tests__/templateAnnotationParse.test.ts +0 -173
  221. package/src/__tests__/templateInputs.test.ts +0 -69
  222. package/src/__tests__/templateMetadata.test.ts +0 -32
  223. package/src/__tests__/templates.test.ts +0 -710
  224. package/src/__tests__/themeCompile.test.ts +0 -225
  225. package/src/__tests__/themeValidator.test.ts +0 -131
  226. package/src/__tests__/timing.test.ts +0 -167
  227. package/src/__tests__/transformProvenance.test.ts +0 -160
  228. package/src/__tests__/transformV2.test.ts +0 -163
  229. package/src/__tests__/transitionNormalize.test.ts +0 -61
  230. package/src/__tests__/treeviewBattle.test.ts +0 -76
  231. package/src/__tests__/treeviewDetect.test.ts +0 -168
  232. package/src/__tests__/treeviewParse.test.ts +0 -118
  233. package/src/__tests__/treeviewPipeline.test.ts +0 -183
  234. package/src/__tests__/treeviewRender.test.ts +0 -91
  235. package/src/__tests__/validateDoc.test.ts +0 -260
  236. package/src/__tests__/versions.test.ts +0 -459
  237. package/src/doc/annotationBlocks.ts +0 -117
  238. package/src/doc/applyNarrationTiming.ts +0 -244
  239. package/src/doc/asciiDiagram/chars.ts +0 -210
  240. package/src/doc/asciiDiagram/detect.ts +0 -175
  241. package/src/doc/asciiDiagram/index.ts +0 -38
  242. package/src/doc/asciiDiagram/mapping.ts +0 -225
  243. package/src/doc/asciiDiagram/parse.ts +0 -1095
  244. package/src/doc/asciiDiagram/render.ts +0 -963
  245. package/src/doc/asciiDiagram/repair.ts +0 -400
  246. package/src/doc/asciiDiagram/types.ts +0 -65
  247. package/src/doc/asciiTimeline/detect.ts +0 -138
  248. package/src/doc/asciiTimeline/index.ts +0 -26
  249. package/src/doc/asciiTimeline/mapping.ts +0 -43
  250. package/src/doc/asciiTimeline/parse.ts +0 -870
  251. package/src/doc/asciiTimeline/render.ts +0 -427
  252. package/src/doc/asciiTimeline/types.ts +0 -73
  253. package/src/doc/asciiTimeline/wrappedFlow.ts +0 -427
  254. package/src/doc/audioMapping.ts +0 -442
  255. package/src/doc/customTemplatesFrontmatter.ts +0 -273
  256. package/src/doc/customThemesFrontmatter.ts +0 -95
  257. package/src/doc/docToMarkdown.ts +0 -284
  258. package/src/doc/index.ts +0 -161
  259. package/src/doc/markdownToDoc.ts +0 -1054
  260. package/src/doc/materializeBlockLayers.ts +0 -465
  261. package/src/doc/mediaAnnotations.ts +0 -120
  262. package/src/doc/page/PageSection.ts +0 -174
  263. package/src/doc/page/materializePageSection.ts +0 -616
  264. package/src/doc/page/resolvePageBlock.ts +0 -108
  265. package/src/doc/page/sectionExtractors.ts +0 -466
  266. package/src/doc/pageCss.ts +0 -628
  267. package/src/doc/resolveDocTheme.ts +0 -56
  268. package/src/doc/standaloneAnnotation.ts +0 -58
  269. package/src/doc/structuredData.ts +0 -301
  270. package/src/doc/templateInputs.ts +0 -424
  271. package/src/doc/templates/__tests__/customTemplate.test.ts +0 -170
  272. package/src/doc/templates/__tests__/customTemplateRegistry.test.ts +0 -124
  273. package/src/doc/templates/__tests__/listBlock.test.ts +0 -64
  274. package/src/doc/templates/accentImage.ts +0 -362
  275. package/src/doc/templates/captionUtils.ts +0 -56
  276. package/src/doc/templates/comparisonBar.ts +0 -173
  277. package/src/doc/templates/coverBlock.ts +0 -255
  278. package/src/doc/templates/customTemplate.ts +0 -51
  279. package/src/doc/templates/dataTable.ts +0 -102
  280. package/src/doc/templates/dateEvent.ts +0 -147
  281. package/src/doc/templates/definitionCard.ts +0 -140
  282. package/src/doc/templates/diagramBlock.ts +0 -403
  283. package/src/doc/templates/diagramLayout.ts +0 -159
  284. package/src/doc/templates/drawingBlock.ts +0 -325
  285. package/src/doc/templates/drawingLayout.ts +0 -539
  286. package/src/doc/templates/factCard.ts +0 -146
  287. package/src/doc/templates/fallbackBlock.ts +0 -123
  288. package/src/doc/templates/featureBlock.ts +0 -209
  289. package/src/doc/templates/fullBleedQuote.ts +0 -83
  290. package/src/doc/templates/imageWithCaption.ts +0 -186
  291. package/src/doc/templates/index.ts +0 -642
  292. package/src/doc/templates/inputDescriptors.ts +0 -451
  293. package/src/doc/templates/layoutBlock.ts +0 -43
  294. package/src/doc/templates/layoutLayout.ts +0 -243
  295. package/src/doc/templates/listBlock.ts +0 -207
  296. package/src/doc/templates/mapBlock.ts +0 -138
  297. package/src/doc/templates/metadata.ts +0 -130
  298. package/src/doc/templates/persistentLayers.ts +0 -526
  299. package/src/doc/templates/photoGrid.ts +0 -190
  300. package/src/doc/templates/pullQuote.ts +0 -141
  301. package/src/doc/templates/quoteBlock.ts +0 -141
  302. package/src/doc/templates/registry.ts +0 -88
  303. package/src/doc/templates/sectionHeader.ts +0 -120
  304. package/src/doc/templates/statHighlight.ts +0 -146
  305. package/src/doc/templates/templateNames.ts +0 -22
  306. package/src/doc/templates/timelineBlock.ts +0 -613
  307. package/src/doc/templates/titleBlock.ts +0 -150
  308. package/src/doc/templates/tokens/__tests__/resolveTokens.test.ts +0 -487
  309. package/src/doc/templates/tokens/resolveTokens.ts +0 -453
  310. package/src/doc/templates/treeBlock.ts +0 -131
  311. package/src/doc/templates/twoColumn.ts +0 -263
  312. package/src/doc/templates/videoPullQuote.ts +0 -142
  313. package/src/doc/templates/videoWithCaption.ts +0 -135
  314. package/src/doc/treeview/chars.ts +0 -72
  315. package/src/doc/treeview/detect.ts +0 -145
  316. package/src/doc/treeview/index.ts +0 -30
  317. package/src/doc/treeview/mapping.ts +0 -95
  318. package/src/doc/treeview/parse.ts +0 -201
  319. package/src/doc/treeview/render.ts +0 -41
  320. package/src/doc/treeview/types.ts +0 -43
  321. package/src/doc/utils/animationUtils.ts +0 -399
  322. package/src/doc/utils/applyRenderStyle.ts +0 -106
  323. package/src/doc/utils/diagramText.ts +0 -78
  324. package/src/doc/utils/imageTreatment.ts +0 -70
  325. package/src/doc/utils/nearest.ts +0 -59
  326. package/src/doc/utils/shapeGeometry.ts +0 -614
  327. package/src/doc/utils/themeUtils.ts +0 -243
  328. package/src/doc/validate.ts +0 -575
  329. package/src/generate/contentExtractor.ts +0 -921
  330. package/src/generate/index.ts +0 -18
  331. package/src/generate/templateMapper.ts +0 -177
  332. package/src/icons/iconData.ts +0 -31
  333. package/src/icons/index.ts +0 -26
  334. package/src/icons/inlineIconMarker.ts +0 -73
  335. package/src/icons/resolve.ts +0 -139
  336. package/src/imageEdit/ImageEditVersionManager.ts +0 -73
  337. package/src/imageEdit/export.ts +0 -410
  338. package/src/imageEdit/index.ts +0 -72
  339. package/src/imageEdit/persistence.ts +0 -113
  340. package/src/imageEdit/state.ts +0 -112
  341. package/src/imageEdit/versionPaths.ts +0 -44
  342. package/src/imageEdit/versions.ts +0 -152
  343. package/src/index.ts +0 -15
  344. package/src/internal/immutable.ts +0 -58
  345. package/src/jsonForm/chooseControl.ts +0 -88
  346. package/src/jsonForm/evaluateWhen.ts +0 -59
  347. package/src/jsonForm/index.ts +0 -32
  348. package/src/jsonForm/inferSchema.ts +0 -25
  349. package/src/jsonForm/pointer.ts +0 -154
  350. package/src/jsonForm/tokens.ts +0 -78
  351. package/src/jsonForm/types.ts +0 -167
  352. package/src/markdown/annotationCoercion.ts +0 -295
  353. package/src/markdown/attrTokens.ts +0 -243
  354. package/src/markdown/convert.ts +0 -1353
  355. package/src/markdown/htmlParse.ts +0 -212
  356. package/src/markdown/index.ts +0 -152
  357. package/src/markdown/parse.ts +0 -103
  358. package/src/markdown/sanitize.ts +0 -318
  359. package/src/markdown/stringify.ts +0 -207
  360. package/src/markdown/types.ts +0 -710
  361. package/src/markdown/utils.ts +0 -459
  362. package/src/narration/align.ts +0 -514
  363. package/src/narration/features.ts +0 -231
  364. package/src/narration/index.ts +0 -86
  365. package/src/narration/nuclei.ts +0 -118
  366. package/src/narration/pacing.ts +0 -211
  367. package/src/narration/script.ts +0 -239
  368. package/src/narration/session.ts +0 -100
  369. package/src/narration/sidecar.ts +0 -187
  370. package/src/narration/syllables.ts +0 -85
  371. package/src/narration/trace.ts +0 -50
  372. package/src/narration/types.ts +0 -299
  373. package/src/narration/vad.ts +0 -131
  374. package/src/ngeohash.d.ts +0 -11
  375. package/src/random/SeededRandom.ts +0 -127
  376. package/src/random/index.ts +0 -1
  377. package/src/recommend/index.ts +0 -16
  378. package/src/recommend/numberHighlight.ts +0 -25
  379. package/src/recommend/templates.ts +0 -393
  380. package/src/schemas/BlockTemplates.ts +0 -1046
  381. package/src/schemas/CustomTemplates.ts +0 -126
  382. package/src/schemas/Doc.ts +0 -1073
  383. package/src/schemas/ImageEditDoc.ts +0 -102
  384. package/src/schemas/LayoutStrategy.ts +0 -178
  385. package/src/schemas/Media.ts +0 -179
  386. package/src/schemas/MediaProvider.ts +0 -70
  387. package/src/schemas/PageStyle.ts +0 -213
  388. package/src/schemas/Theme.ts +0 -413
  389. package/src/schemas/Transitions.ts +0 -224
  390. package/src/schemas/Types.ts +0 -15
  391. package/src/schemas/Viewport.ts +0 -91
  392. package/src/schemas/colorUtils.ts +0 -219
  393. package/src/schemas/fontStacks.ts +0 -339
  394. package/src/schemas/index.ts +0 -31
  395. package/src/schemas/pageStyleDefaults.ts +0 -204
  396. package/src/schemas/themeCompile.ts +0 -244
  397. package/src/schemas/themeConstants.ts +0 -2
  398. package/src/schemas/themeLibrary.ts +0 -60
  399. package/src/schemas/themeValidator.ts +0 -609
  400. package/src/schemas/themes/bold.json +0 -77
  401. package/src/schemas/themes/cinematic.json +0 -143
  402. package/src/schemas/themes/documentary.json +0 -125
  403. package/src/schemas/themes/gezellig.json +0 -123
  404. package/src/schemas/themes/index.ts +0 -53
  405. package/src/schemas/themes/magazine.json +0 -126
  406. package/src/schemas/themes/minimalist.json +0 -74
  407. package/src/schemas/themes/morning-light.json +0 -117
  408. package/src/schemas/themes/standard-dark.json +0 -109
  409. package/src/schemas/themes/standard.json +0 -98
  410. package/src/schemas/themes/tech-dark.json +0 -143
  411. package/src/schemas/themes/warm-earth.json +0 -74
  412. package/src/spatial/Geohash.ts +0 -196
  413. package/src/spatial/Haversine.ts +0 -59
  414. package/src/spatial/index.ts +0 -2
  415. package/src/storage/ContentContainer.ts +0 -220
  416. package/src/storage/LocalForageAdapter.ts +0 -103
  417. package/src/storage/LocalStorageAdapter.ts +0 -57
  418. package/src/storage/MediaProviderFromContainer.ts +0 -92
  419. package/src/storage/MemoryStorageAdapter.ts +0 -37
  420. package/src/storage/ScopedContentContainer.ts +0 -143
  421. package/src/storage/Storage.ts +0 -28
  422. package/src/storage/index.ts +0 -9
  423. package/src/timing/index.ts +0 -17
  424. package/src/timing/narrationTiming.ts +0 -220
  425. package/src/timing/readingTime.ts +0 -94
  426. package/src/transform/applyTransform.ts +0 -122
  427. package/src/transform/blockAnalyzer.ts +0 -181
  428. package/src/transform/index.ts +0 -23
  429. package/src/transform/registry.ts +0 -217
  430. package/src/transform/styles/dataDriven.ts +0 -18
  431. package/src/transform/styles/documentary.ts +0 -18
  432. package/src/transform/styles/index.ts +0 -5
  433. package/src/transform/styles/magazine.ts +0 -19
  434. package/src/transform/styles/minimal.ts +0 -18
  435. package/src/transform/styles/narrative.ts +0 -19
  436. package/src/transform/templateSelector.ts +0 -389
  437. package/src/transform/timingAllocator.ts +0 -257
  438. package/src/transform/types.ts +0 -158
  439. package/src/versions/DocumentVersionManager.ts +0 -70
  440. package/src/versions/gitignore.ts +0 -34
  441. package/src/versions/index.ts +0 -56
  442. package/src/versions/operations.ts +0 -144
  443. package/src/versions/paths.ts +0 -51
  444. package/src/versions/snapshotStore.ts +0 -202
  445. package/src/versions/timestamp.ts +0 -48
  446. package/src/versions/types.ts +0 -93
@@ -23,7 +23,7 @@ import {
23
23
  reanchorSession,
24
24
  traceWordPosAt,
25
25
  vadStep
26
- } from "../chunk-XNLB57UD.js";
26
+ } from "../chunk-DYPMOPIW.js";
27
27
  import {
28
28
  buildNarrationScript,
29
29
  buildNarrationTimingJson,
@@ -33,18 +33,18 @@ import {
33
33
  wordIndexAtChar,
34
34
  wordIndexAtTime,
35
35
  wordPosAtExpectedSyllables
36
- } from "../chunk-JI77MGAK.js";
37
- import "../chunk-TUWMK62B.js";
38
- import "../chunk-5UYI3RJB.js";
39
- import "../chunk-JHZWYRSW.js";
40
- import "../chunk-5J4HKRJF.js";
41
- import "../chunk-R2YZTCLO.js";
42
- import "../chunk-AMIR72JP.js";
43
- import "../chunk-QE7TWGVT.js";
44
- import "../chunk-4X3JQXNM.js";
45
- import "../chunk-3E5F2XMR.js";
46
- import "../chunk-V543AI2F.js";
47
- import "../chunk-FVTQSNR7.js";
36
+ } from "../chunk-7ARJZYQY.js";
37
+ import "../chunk-PUS54YU6.js";
38
+ import "../chunk-FDYDYL77.js";
39
+ import "../chunk-C33GTPUZ.js";
40
+ import "../chunk-BAOV476U.js";
41
+ import "../chunk-ZQKZSJAX.js";
42
+ import "../chunk-BCCXTMN5.js";
43
+ import "../chunk-4VOD55SX.js";
44
+ import "../chunk-XOFT65EX.js";
45
+ import "../chunk-67L6WRJN.js";
46
+ import "../chunk-QKPXHDLR.js";
47
+ import "../chunk-XRW6P7IF.js";
48
48
  export {
49
49
  DEFAULT_ALIGN_CONFIG,
50
50
  DEFAULT_FEATURE_CONFIG,
@@ -79,4 +79,3 @@ export {
79
79
  wordIndexAtTime,
80
80
  wordPosAtExpectedSyllables
81
81
  };
82
- //# sourceMappingURL=index.js.map
@@ -14,7 +14,16 @@
14
14
  declare class SeededRandom {
15
15
  private state;
16
16
  constructor(seed: number);
17
- /** Random float in [0, 1). */
17
+ /**
18
+ * Random float in [0, 1).
19
+ *
20
+ * The state increment wraps to 32 bits, as Mulberry32 specifies. Leaving it
21
+ * unwrapped (the shape of the widely-copied reference snippet) keeps the
22
+ * state as an ever-growing float: the bitwise ops below still coerce it
23
+ * mod 2^32, so the OUTPUT is identical — until the state passes 2^53 and
24
+ * `+= 0x6d2b79f5` stops being exact. From that point the low bits rot and
25
+ * the sequence silently drifts from Mulberry32 (measured: draw 4,917,758).
26
+ */
18
27
  next(): number;
19
28
  /** Random integer in [0, max). */
20
29
  nextInt(max: number): number;
@@ -37,7 +46,7 @@ declare class SeededRandom {
37
46
  item: T;
38
47
  weight: number;
39
48
  }[]): T | undefined;
40
- /** Current internal state (for debugging / serialization). */
49
+ /** Current internal state as a uint32 (for debugging / serialization). */
41
50
  getState(): number;
42
51
  /** Create an independent sub-stream keyed by a modifier. */
43
52
  derive(modifier: string | number): SeededRandom;
@@ -1,10 +1,9 @@
1
- import "../chunk-V543AI2F.js";
1
+ import "../chunk-QKPXHDLR.js";
2
2
  import {
3
3
  SeededRandom,
4
4
  hashString
5
- } from "../chunk-FVTQSNR7.js";
5
+ } from "../chunk-XRW6P7IF.js";
6
6
  export {
7
7
  SeededRandom,
8
8
  hashString
9
9
  };
10
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { M as MarkdownBlockNode } from '../types-BwMPl2CB.js';
1
+ import { M as MarkdownBlockNode } from '../types-CUNc9biN.js';
2
2
 
3
3
  /**
4
4
  * Block template recommendations.
@@ -1,11 +1,10 @@
1
- import "../chunk-ZLQKNOZQ.js";
1
+ import "../chunk-XWNNA3KE.js";
2
2
  import {
3
3
  profileBlockContents,
4
4
  recommendTemplatesForBlock
5
- } from "../chunk-5UYI3RJB.js";
6
- import "../chunk-AMIR72JP.js";
5
+ } from "../chunk-FDYDYL77.js";
6
+ import "../chunk-BCCXTMN5.js";
7
7
  export {
8
8
  profileBlockContents,
9
9
  recommendTemplatesForBlock
10
10
  };
11
- //# sourceMappingURL=index.js.map
@@ -1,10 +1,10 @@
1
1
  export { B as BoundingBox, C as Coordinates } from '../Types-sh2VRxfo.js';
2
- import { b1 as Theme, b4 as ThemePageStyle, b3 as ThemeColorScheme, v as DeepPartial, b7 as ThemeSeedColors, b2 as ThemeColorPalette, N as FontFamilyKind, M as FontFamily } from '../Doc-DynJleo-.js';
3
- export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AudioBookmark, f as AudioSegment, g as AudioTimingData, h as AudioTrack, B as Block, i as BlockConnection, j as BorderStyle, C as CaptionPhrase, k as CaptionTrack, l as CaptionWord, m as ColorScheme, n as ComparisonBarInput, o as CornerBrandingConfig, p as CustomTemplateDefinition, q as CustomTemplateLayer, D as DARK_SURFACE, r as DEFAULT_DOC_FONT, s as DEFAULT_TITLE_FONT, t as DataTableInput, u as DateEventInput, w as DefinitionCardInput, x as DiagramBlockInput, y as DiagramEdgeAnchor, z as DiagramTemplateEdge, E as DiagramTemplateNode, F as Doc, G as DocBlock, H as DocDiagnostic, I as DrawingBlockInput, J as FRONTMATTER_CUSTOM_TEMPLATES_KEY, K as FRONTMATTER_CUSTOM_THEMES_KEY, L as FactCardInput, O as FullBleedQuoteInput, P as GradientBackgroundConfig, Q as ImageBackgroundConfig, R as ImageLayer, S as ImageTreatment, T as ImageWithCaptionInput, U as LIGHT_SURFACE, V as Layer, W as LayerRepeat, X as LayoutHints, Y as LeftFeatureInput, Z as LinearGradient, _ as ListBlockInput, $ as MapBlockInput, a0 as MapLayer, a1 as MapMarker, a2 as MapTileStyle, a3 as MarkerStyle, a4 as MediaClip, a5 as MermaidLayer, a6 as PAGE_ACCENT_STRATEGIES, a7 as PAGE_BACKGROUNDS, a8 as PAGE_BACKGROUND_RHYTHMS, a9 as PAGE_DESIGN_FAMILIES, aa as PAGE_DIVIDERS, ab as PAGE_EMPHASES, ac as PAGE_EYEBROWS, ad as PAGE_HEADING_CASES, ae as PAGE_HEADING_SCALES, af as PAGE_HEADING_UNDERLINES, ag as PAGE_HERO_STYLES, ah as PAGE_IMAGE_FRAMINGS, ai as PAGE_NUMERAL_STYLES, aj as PAGE_PATTERNS, ak as PAGE_QUOTE_MARKS, al as PAGE_SECTION_KINDS, am as PAGE_SECTION_SPACINGS, an as PAGE_SHADOWS, ao as PageAccentRotation, ap as PageBackground, aq as PageDesignFamily, ar as PageEmphasis, as as PageHeadingTreatment, at as PageSectionKind, au as PageSectionOverride, av as PageTokens, aw as PathLayer, ax as PatternBackgroundConfig, ay as PersistentLayer, az as PersistentLayerConfig, aA as PersistentLayerTemplate, aB as PersistentLayerTemplateConfig, aC as PersistentLayerTemplateType, aD as PhotoGridInput, aE as Position, aF as ProgressIndicatorConfig, aG as PullQuoteInput, aH as QuoteBlockInput, aI as RawLayersInput, aJ as RenderStyle, aK as RightFeatureInput, aL as ScheduledClip, aM as SectionHeaderInput, aN as ShapeFilter, aO as ShapeLayer, aP as ShapePattern, aQ as SolidBackgroundConfig, aR as StartBlockConfig, aS as StatHighlightInput, aT as SurfaceScheme, aU as THEME_SCHEMA_VERSION, aV as TableLayer, aW as TableLayerStyle, aX as TemplateBlock, aY as TemplateContext, aZ as TemplateFunction, a_ as TemplateRegistry, a$ as TextLayer, b0 as TextStyle, b5 as ThemeRegistry, b6 as ThemeSchemaVersion, b8 as ThemeStyle, b9 as ThemeTypography, ba as TimelineBlockInput, bb as TimelineTemplateEvent, bc as TimelineTemplateLink, bd as TimelineTemplateTrack, be as TitleBlockInput, bf as TitleCaptionConfig, bg as TreeBlockInput, bh as TreeLayer, bi as TreeLayerItem, bj as TreeLayerStyle, bk as TreeTemplateItem, bl as TwoColumnInput, bm as VIEWPORT_PRESETS, bn as VideoLayer, bo as VideoPullQuoteInput, bp as VideoWithCaptionInput, bq as ViewportConfig, br as ViewportOrientation, bs as ViewportPreset, bt as VignetteConfig, bu as applySurface, bv as calculateDuration, bw as calculateFontScale, bx as createTemplateContext, by as createTheme, bz as createThemeRegistry, bA as getAspectRatioString, bB as getBlockAtTime, bC as getCaptionAtTime, bD as getDocPlaybackDuration, bE as getLayoutHints, bF as getSafeTextBounds, bG as getSegmentAtTime, bH as getTwoColumnPositions, bI as getViewport, bJ as getViewportOrientation, bK as isPersistentLayerTemplate, bL as isTemplateBlock, bM as layoutScaledFontSize, bN as resolveMediaSchedule, bO as scaledFontSize } from '../Doc-DynJleo-.js';
4
- export { D as DEFAULT_TRANSITION_DURATION_SECONDS, X as TRANSITION_DIRECTIONS, Y as TRANSITION_TYPES, Z as Transition, _ as TransitionDirection, $ as TransitionType, a0 as isTransitionType, a1 as normalizeTransitionDirection, a2 as normalizeTransitionType, a3 as resolveBlockTransition, a4 as resolveTransitionDuration } from '../types-BwMPl2CB.js';
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-B72m0W1y.js';
2
+ import { b1 as Theme, b4 as ThemePageStyle, b3 as ThemeColorScheme, v as DeepPartial, b7 as ThemeSeedColors, b2 as ThemeColorPalette, N as FontFamilyKind, M as FontFamily } from '../Doc-BubIpWsp.js';
3
+ export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AudioBookmark, f as AudioSegment, g as AudioTimingData, h as AudioTrack, B as Block, i as BlockConnection, j as BorderStyle, C as CaptionPhrase, k as CaptionTrack, l as CaptionWord, m as ColorScheme, n as ComparisonBarInput, o as CornerBrandingConfig, p as CustomTemplateDefinition, q as CustomTemplateLayer, D as DARK_SURFACE, r as DEFAULT_DOC_FONT, s as DEFAULT_TITLE_FONT, t as DataTableInput, u as DateEventInput, w as DefinitionCardInput, x as DiagramBlockInput, y as DiagramEdgeAnchor, z as DiagramTemplateEdge, E as DiagramTemplateNode, F as Doc, G as DocBlock, H as DocDiagnostic, I as DrawingBlockInput, J as FRONTMATTER_CUSTOM_TEMPLATES_KEY, K as FRONTMATTER_CUSTOM_THEMES_KEY, L as FactCardInput, O as FullBleedQuoteInput, P as GradientBackgroundConfig, Q as ImageBackgroundConfig, R as ImageLayer, S as ImageTreatment, T as ImageWithCaptionInput, U as LIGHT_SURFACE, V as Layer, W as LayerRepeat, X as LayoutHints, Y as LeftFeatureInput, Z as LinearGradient, _ as ListBlockInput, $ as MapBlockInput, a0 as MapLayer, a1 as MapMarker, a2 as MapTileStyle, a3 as MarkerStyle, a4 as MediaClip, a5 as MermaidLayer, a6 as PAGE_ACCENT_STRATEGIES, a7 as PAGE_BACKGROUNDS, a8 as PAGE_BACKGROUND_RHYTHMS, a9 as PAGE_DESIGN_FAMILIES, aa as PAGE_DIVIDERS, ab as PAGE_EMPHASES, ac as PAGE_EYEBROWS, ad as PAGE_HEADING_CASES, ae as PAGE_HEADING_SCALES, af as PAGE_HEADING_UNDERLINES, ag as PAGE_HERO_STYLES, ah as PAGE_IMAGE_FRAMINGS, ai as PAGE_NUMERAL_STYLES, aj as PAGE_PATTERNS, ak as PAGE_QUOTE_MARKS, al as PAGE_SECTION_KINDS, am as PAGE_SECTION_SPACINGS, an as PAGE_SHADOWS, ao as PageAccentRotation, ap as PageBackground, aq as PageDesignFamily, ar as PageEmphasis, as as PageHeadingTreatment, at as PageSectionKind, au as PageSectionOverride, av as PageTokens, aw as PathLayer, ax as PatternBackgroundConfig, ay as PersistentLayer, az as PersistentLayerConfig, aA as PersistentLayerTemplate, aB as PersistentLayerTemplateConfig, aC as PersistentLayerTemplateType, aD as PhotoGridInput, aE as Position, aF as ProgressIndicatorConfig, aG as PullQuoteInput, aH as QuoteBlockInput, aI as RawLayersInput, aJ as RenderStyle, aK as RightFeatureInput, aL as ScheduledClip, aM as SectionHeaderInput, aN as ShapeFilter, aO as ShapeLayer, aP as ShapePattern, aQ as SolidBackgroundConfig, aR as StartBlockConfig, aS as StatHighlightInput, aT as SurfaceScheme, aU as THEME_SCHEMA_VERSION, aV as TableLayer, aW as TableLayerStyle, aX as TemplateBlock, aY as TemplateContext, aZ as TemplateFunction, a_ as TemplateRegistry, a$ as TextLayer, b0 as TextStyle, b5 as ThemeRegistry, b6 as ThemeSchemaVersion, b8 as ThemeStyle, b9 as ThemeTypography, ba as TimelineBlockInput, bb as TimelineTemplateEvent, bc as TimelineTemplateLink, bd as TimelineTemplateTrack, be as TitleBlockInput, bf as TitleCaptionConfig, bg as TreeBlockInput, bh as TreeLayer, bi as TreeLayerItem, bj as TreeLayerStyle, bk as TreeTemplateItem, bl as TwoColumnInput, bm as VIEWPORT_PRESETS, bn as VideoLayer, bo as VideoPullQuoteInput, bp as VideoWithCaptionInput, bq as ViewportConfig, br as ViewportOrientation, bs as ViewportPreset, bt as VignetteConfig, bu as applySurface, bv as calculateDuration, bw as calculateFontScale, bx as createTemplateContext, by as createTheme, bz as createThemeRegistry, bA as getAspectRatioString, bB as getBlockAtTime, bC as getCaptionAtTime, bD as getDocPlaybackDuration, bE as getLayoutHints, bF as getSafeTextBounds, bG as getSegmentAtTime, bH as getTwoColumnPositions, bI as getViewport, bJ as getViewportOrientation, bK as isPersistentLayerTemplate, bL as isTemplateBlock, bM as layoutScaledFontSize, bN as resolveMediaSchedule, bO as scaledFontSize } from '../Doc-BubIpWsp.js';
4
+ export { a as DEFAULT_TRANSITION_DURATION_SECONDS, _ as TRANSITION_DIRECTIONS, $ as TRANSITION_TYPES, a0 as Transition, a1 as TransitionDirection, a2 as TransitionType, a5 as isTransitionType, a6 as normalizeTransitionDirection, a7 as normalizeTransitionType, a8 as resolveBlockTransition, aa as resolveTransitionDuration } from '../types-CUNc9biN.js';
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-DU9mUmVl.js';
6
6
  export { M as MediaEntry, a as MediaProvider } from '../MediaProvider-wpSe21B3.js';
7
- export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-Ca4Tr9uN.js';
7
+ export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-CGxk5CHc.js';
8
8
 
9
9
  /**
10
10
  * Page Style Defaults
@@ -9,12 +9,12 @@ import {
9
9
  getSegmentAtTime,
10
10
  parseTheme,
11
11
  serializeTheme
12
- } from "../chunk-QUUPYOSP.js";
12
+ } from "../chunk-CB45YGAM.js";
13
13
  import {
14
14
  defaultPageStyle,
15
15
  getDocPlaybackDuration,
16
16
  resolveMediaSchedule
17
- } from "../chunk-VWCJ2WXC.js";
17
+ } from "../chunk-2ZWIXGAC.js";
18
18
  import {
19
19
  AVAILABLE_FONT_STACKS,
20
20
  DARK_SURFACE,
@@ -68,7 +68,7 @@ import {
68
68
  resolveTheme,
69
69
  validateTheme,
70
70
  withAlpha
71
- } from "../chunk-JHZWYRSW.js";
71
+ } from "../chunk-C33GTPUZ.js";
72
72
  import {
73
73
  DEFAULT_DOC_FONT,
74
74
  DEFAULT_TITLE_FONT,
@@ -85,7 +85,7 @@ import {
85
85
  isTemplateBlock,
86
86
  scaledFontSize,
87
87
  scaledFontSize2
88
- } from "../chunk-5J4HKRJF.js";
88
+ } from "../chunk-BAOV476U.js";
89
89
  import {
90
90
  DEFAULT_TRANSITION_DURATION_SECONDS,
91
91
  TRANSITION_DIRECTIONS,
@@ -95,7 +95,7 @@ import {
95
95
  normalizeTransitionType,
96
96
  resolveBlockTransition,
97
97
  resolveTransitionDuration
98
- } from "../chunk-QE7TWGVT.js";
98
+ } from "../chunk-4VOD55SX.js";
99
99
  export {
100
100
  AVAILABLE_FONT_STACKS,
101
101
  DARK_SURFACE,
@@ -186,4 +186,3 @@ export {
186
186
  validateTheme,
187
187
  withAlpha
188
188
  };
189
- //# sourceMappingURL=index.js.map
@@ -62,7 +62,8 @@ declare function decodeGeohash(hash: string): {
62
62
  declare function getNeighbors(hash: string): string[];
63
63
  /**
64
64
  * Get a 3x3 grid of geohash4 cells (center + 8 neighbors).
65
- * Used for landing bonus expansions in Fly mode.
65
+ * Useful for expanding a query to the cells adjacent to a center cell, so a
66
+ * point near a cell boundary still matches its neighbors' contents.
66
67
  *
67
68
  * @param geohash4 - Center geohash4 cell
68
69
  * @returns Array of 9 geohash4 cells (center first, then neighbors)
@@ -9,7 +9,7 @@ import {
9
9
  getGeohashPrefix,
10
10
  getNeighbors,
11
11
  haversineDistance
12
- } from "../chunk-GZY66SDN.js";
12
+ } from "../chunk-R3KTTOMS.js";
13
13
  export {
14
14
  calculateBearing,
15
15
  decodeGeohash,
@@ -22,4 +22,3 @@ export {
22
22
  getNeighbors,
23
23
  haversineDistance
24
24
  };
25
- //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- import { C as ContentContainer, a as ContentEntry } from '../ContentContainer-BXUlIf18.js';
2
- export { M as MemoryContentContainer, f as findDocumentPath } from '../ContentContainer-BXUlIf18.js';
1
+ import { C as ContentContainer, a as ContentEntry } from '../ContentContainer-B2w9sUoL.js';
2
+ export { M as MemoryContentContainer, f as findDocumentPath } from '../ContentContainer-B2w9sUoL.js';
3
3
  import { a as MediaProvider } from '../MediaProvider-wpSe21B3.js';
4
4
 
5
5
  /**
@@ -119,6 +119,8 @@ declare class ScopedContentContainer implements ContentContainer {
119
119
  readonly prefix: string;
120
120
  /** Prefix with trailing slash. */
121
121
  private readonly prefixSlash;
122
+ readonly mutationLock: object;
123
+ readonly writeFileExclusive?: (path: string, data: ArrayBuffer | Uint8Array, mimeType?: string) => Promise<boolean>;
122
124
  constructor(parent: ContentContainer, prefix: string);
123
125
  private toParent;
124
126
  /** Strip the prefix from a parent-space path. Returns null if the path is outside the scope. */
@@ -7,7 +7,7 @@ import {
7
7
  createMediaProviderFromContainer,
8
8
  findDocumentPath,
9
9
  scopeContainer
10
- } from "../chunk-VR7UPJ7C.js";
10
+ } from "../chunk-FCG3BIZN.js";
11
11
  export {
12
12
  LocalForageAdapter,
13
13
  LocalStorageAdapter,
@@ -18,4 +18,3 @@ export {
18
18
  findDocumentPath,
19
19
  scopeContainer
20
20
  };
21
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { b1 as Theme, b5 as ThemeRegistry } from './Doc-DynJleo-.js';
1
+ import { b1 as Theme, b5 as ThemeRegistry } from './Doc-BubIpWsp.js';
2
2
 
3
3
  /**
4
4
  * Built-in Theme Library
@@ -1,8 +1,8 @@
1
- import "../chunk-DNJKBAI7.js";
1
+ import "../chunk-YZNGMV3G.js";
2
2
  import {
3
3
  estimateNarrationTime,
4
4
  estimateReadingTime
5
- } from "../chunk-4X3JQXNM.js";
5
+ } from "../chunk-XOFT65EX.js";
6
6
  import {
7
7
  DEFAULT_WORDS_PER_SECOND,
8
8
  calculatePrefixDuration,
@@ -10,7 +10,7 @@ import {
10
10
  estimateNarrationDuration,
11
11
  estimateSpokenWordCount,
12
12
  estimateTimeFromText
13
- } from "../chunk-3E5F2XMR.js";
13
+ } from "../chunk-67L6WRJN.js";
14
14
  export {
15
15
  DEFAULT_WORDS_PER_SECOND,
16
16
  calculatePrefixDuration,
@@ -21,4 +21,3 @@ export {
21
21
  estimateSpokenWordCount,
22
22
  estimateTimeFromText
23
23
  };
24
- //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- import { m as ColorScheme, F as Doc, B as Block } from '../Doc-DynJleo-.js';
2
- import { i as PageTransformHints } from '../materializePageSection-DDzubQXo.js';
1
+ import { m as ColorScheme, F as Doc, B as Block } from '../Doc-BubIpWsp.js';
2
+ import { i as PageTransformHints } from '../materializePageSection-wSLA2A1g.js';
3
3
  import { d as ExtractionType, E as ExtractedElement, b as ExtractionOptions } from '../contentExtractor-BNfVJV2U.js';
4
- import '../types-BwMPl2CB.js';
4
+ import '../types-CUNc9biN.js';
5
5
 
6
6
  /** Identifier for a built-in or caller-registered transform style. */
7
7
  type TransformStyleId = string;
@@ -7,12 +7,12 @@ import {
7
7
  getTransformStyleIds,
8
8
  getTransformStyleSummaries,
9
9
  resolveTransformStyle
10
- } from "../chunk-ILWDXLUK.js";
11
- import "../chunk-Q7LROV2H.js";
12
- import "../chunk-5J4HKRJF.js";
13
- import "../chunk-AMIR72JP.js";
14
- import "../chunk-3E5F2XMR.js";
15
- import "../chunk-FVTQSNR7.js";
10
+ } from "../chunk-RS5AP3J4.js";
11
+ import "../chunk-NKNMGIIN.js";
12
+ import "../chunk-BAOV476U.js";
13
+ import "../chunk-BCCXTMN5.js";
14
+ import "../chunk-67L6WRJN.js";
15
+ import "../chunk-XRW6P7IF.js";
16
16
  export {
17
17
  DEFAULT_TRANSFORM_STYLE_ID,
18
18
  analyzeBlocks,
@@ -23,4 +23,3 @@ export {
23
23
  getTransformStyleSummaries,
24
24
  resolveTransformStyle
25
25
  };
26
- //# sourceMappingURL=index.js.map
@@ -41,7 +41,7 @@ interface SaveVersionResult {
41
41
  * - `'saved'` — a new snapshot was written.
42
42
  * - `'unchanged'` — current content matches the latest snapshot byte-for-byte.
43
43
  * - `'no-document'` — the container has no primary markdown document.
44
- * - `'empty'` — the resolved content was empty.
44
+ * - `'empty'` — legacy value retained for source compatibility; no longer emitted.
45
45
  */
46
46
  reason: 'saved' | 'unchanged' | 'no-document' | 'empty';
47
47
  }
@@ -80,6 +80,42 @@ interface RevertOptions {
80
80
  * Defaults to `true` so a revert is always recoverable.
81
81
  */
82
82
  snapshotCurrent?: boolean;
83
+ /**
84
+ * Content to capture as the pre-revert snapshot. Hosts that keep the
85
+ * live document outside the container (an editor buffer, say) MUST pass
86
+ * it: without it the snapshot falls back to reading the container, which
87
+ * is stale whenever there are unsaved edits and yields `no-document`
88
+ * when the container holds no markdown at all. In both cases the
89
+ * pre-revert state would not actually be recoverable.
90
+ *
91
+ * Ignored when `snapshotCurrent` is `false`.
92
+ */
93
+ content?: string;
94
+ /**
95
+ * Override the document basename used to file the pre-revert snapshot.
96
+ * Defaults to the container's resolved primary document. Ignored when
97
+ * `snapshotCurrent` is `false`.
98
+ */
99
+ basename?: string;
100
+ }
101
+ /**
102
+ * Why a {@link revertToVersion} call declined to revert.
103
+ *
104
+ * - `'missing-snapshot'` — the requested version could not be read.
105
+ * - `'snapshot-failed'` — the pre-revert snapshot could not be written, so
106
+ * reverting would have destroyed the current state irrecoverably.
107
+ */
108
+ type RevertFailureReason = 'missing-snapshot' | 'snapshot-failed';
109
+ /**
110
+ * Result of a {@link revertToVersion} call.
111
+ */
112
+ interface RevertResult {
113
+ /** True when the document was replaced with the snapshot's content. */
114
+ reverted: boolean;
115
+ /** The pre-revert snapshot, when one was written. */
116
+ snapshotted: Version | null;
117
+ /** Present only when `reverted` is false. */
118
+ reason?: RevertFailureReason;
83
119
  }
84
120
  /**
85
121
  * Options for {@link coalesceVersions}.
@@ -92,4 +128,4 @@ interface CoalesceOptions {
92
128
  windowMs?: number;
93
129
  }
94
130
 
95
- export type { CoalesceOptions as C, PrunePolicy as P, RevertOptions as R, SaveVersionOptions as S, Version as V, SaveVersionResult as a };
131
+ export type { CoalesceOptions as C, PrunePolicy as P, RevertFailureReason as R, SaveVersionOptions as S, Version as V, RevertOptions as a, RevertResult as b, SaveVersionResult as c };
@@ -1,3 +1,18 @@
1
+ interface MarkdownSafetyLimits {
2
+ maxSourceBytes: number;
3
+ maxNodes: number;
4
+ maxDepth: number;
5
+ maxTableCells: number;
6
+ }
7
+ declare const DEFAULT_MARKDOWN_SAFETY_LIMITS: Readonly<MarkdownSafetyLimits>;
8
+ declare class MarkdownLimitError extends RangeError {
9
+ readonly code: 'SOURCE_BYTES' | 'NODES' | 'DEPTH' | 'TABLE_CELLS';
10
+ constructor(code: MarkdownLimitError['code'], message: string);
11
+ }
12
+ declare function assertMarkdownSourceWithinLimits(source: string, limits: Partial<MarkdownSafetyLimits> | false | undefined): void;
13
+ declare function assertMarkdownDocumentWithinLimits(document: MarkdownDocument, limits: Partial<MarkdownSafetyLimits> | false | undefined, signal?: AbortSignal): void;
14
+ declare function resolveMarkdownSafetyLimits(limits?: Partial<MarkdownSafetyLimits>): MarkdownSafetyLimits;
15
+
1
16
  /**
2
17
  * Shared transition vocabulary for block-to-block slide changes.
3
18
  *
@@ -605,6 +620,10 @@ type MarkdownNode = MarkdownDocument | MarkdownBlockNode | MarkdownInlineNode |
605
620
  * Options for parseMarkdown().
606
621
  */
607
622
  interface ParseOptions {
623
+ /** Safety limits for untrusted input. Pass false only for trusted documents. */
624
+ limits?: Partial<MarkdownSafetyLimits> | false;
625
+ /** Cancel before parse and during post-parse validation. */
626
+ signal?: AbortSignal;
608
627
  /** Enable GFM extensions (tables, strikethrough, task lists, autolinks, footnotes). Default: true */
609
628
  gfm?: boolean;
610
629
  /** Enable math extensions ($...$ and $$...$$). Default: true */
@@ -620,6 +639,10 @@ interface ParseOptions {
620
639
  * Options for stringifyMarkdown().
621
640
  */
622
641
  interface StringifyOptions {
642
+ /** Safety limits for untrusted trees. Pass false only for trusted documents. */
643
+ limits?: Partial<MarkdownSafetyLimits> | false;
644
+ /** Cancel before serialization and during validation. */
645
+ signal?: AbortSignal;
623
646
  /** Enable GFM extensions in output. Default: true */
624
647
  gfm?: boolean;
625
648
  /** Enable math extensions in output. Default: true */
@@ -642,4 +665,4 @@ interface StringifyOptions {
642
665
  setext?: boolean;
643
666
  }
644
667
 
645
- export { type TransitionType as $, type MarkdownLinkDefinition as A, type MarkdownLinkReference as B, type MarkdownList as C, DEFAULT_TRANSITION_DURATION_SECONDS as D, type MarkdownListItem as E, type MarkdownMathBlock as F, type MarkdownMention as G, type HeadingAttributes as H, type MarkdownNode as I, type MarkdownParagraph as J, type MarkdownPoint as K, type MarkdownSourcePosition as L, type MarkdownBlockNode as M, type MarkdownStrikethrough as N, type MarkdownStrong as O, type MarkdownTable as P, type MarkdownTableCell as Q, type MarkdownTableRow as R, type MarkdownText as S, type MarkdownTextDirective as T, type MarkdownThematicBreak as U, type ParseOptions as V, type StringifyOptions as W, TRANSITION_DIRECTIONS as X, TRANSITION_TYPES as Y, type Transition as Z, type TransitionDirection as _, type HeadingTemplateAnnotation as a, isTransitionType as a0, normalizeTransitionDirection as a1, normalizeTransitionType as a2, resolveBlockTransition as a3, resolveTransitionDuration as a4, type BlockConnection as a5, type HtmlComment as b, type HtmlElement as c, type HtmlNode as d, type HtmlText as e, type MarkdownBlockquote as f, type MarkdownBreak as g, type MarkdownCodeBlock as h, type MarkdownContainerDirective as i, type MarkdownDefinitionDescription as j, type MarkdownDefinitionList as k, type MarkdownDefinitionTerm as l, type MarkdownDocument as m, type MarkdownEmphasis as n, type MarkdownFootnoteDefinition as o, type MarkdownFootnoteReference as p, type MarkdownHeading as q, type MarkdownHtmlBlock as r, type MarkdownImage as s, type MarkdownImageReference as t, type MarkdownInlineCode as u, type MarkdownInlineHtml as v, type MarkdownInlineMath as w, type MarkdownInlineNode as x, type MarkdownLeafDirective as y, type MarkdownLink as z };
668
+ export { TRANSITION_TYPES as $, MarkdownLimitError as A, type MarkdownLink as B, type MarkdownLinkDefinition as C, DEFAULT_MARKDOWN_SAFETY_LIMITS as D, type MarkdownLinkReference as E, type MarkdownList as F, type MarkdownListItem as G, type HeadingAttributes as H, type MarkdownMathBlock as I, type MarkdownMention as J, type MarkdownNode as K, type MarkdownParagraph as L, type MarkdownBlockNode as M, type MarkdownPoint as N, type MarkdownSafetyLimits as O, type MarkdownSourcePosition as P, type MarkdownStrikethrough as Q, type MarkdownStrong as R, type MarkdownTable as S, type MarkdownTableCell as T, type MarkdownTableRow as U, type MarkdownText as V, type MarkdownTextDirective as W, type MarkdownThematicBreak as X, type ParseOptions as Y, type StringifyOptions as Z, TRANSITION_DIRECTIONS as _, DEFAULT_TRANSITION_DURATION_SECONDS as a, type Transition as a0, type TransitionDirection as a1, type TransitionType as a2, assertMarkdownDocumentWithinLimits as a3, assertMarkdownSourceWithinLimits as a4, isTransitionType as a5, normalizeTransitionDirection as a6, normalizeTransitionType as a7, resolveBlockTransition as a8, resolveMarkdownSafetyLimits as a9, resolveTransitionDuration as aa, type BlockConnection as ab, type HeadingTemplateAnnotation as b, type HtmlComment as c, type HtmlElement as d, type HtmlNode as e, type HtmlText as f, type MarkdownBlockquote as g, type MarkdownBreak as h, type MarkdownCodeBlock as i, type MarkdownContainerDirective as j, type MarkdownDefinitionDescription as k, type MarkdownDefinitionList as l, type MarkdownDefinitionTerm as m, type MarkdownDocument as n, type MarkdownEmphasis as o, type MarkdownFootnoteDefinition as p, type MarkdownFootnoteReference as q, type MarkdownHeading as r, type MarkdownHtmlBlock as s, type MarkdownImage as t, type MarkdownImageReference as u, type MarkdownInlineCode as v, type MarkdownInlineHtml as w, type MarkdownInlineMath as x, type MarkdownInlineNode as y, type MarkdownLeafDirective as z };
@@ -1,5 +1,6 @@
1
- import { C as CoalesceOptions, V as Version, P as PrunePolicy, R as RevertOptions, S as SaveVersionOptions, a as SaveVersionResult } from '../types-C4kiRn_k.js';
2
- import { C as ContentContainer } from '../ContentContainer-BXUlIf18.js';
1
+ import { C as CoalesceOptions, V as Version, P as PrunePolicy, a as RevertOptions, b as RevertResult, S as SaveVersionOptions, c as SaveVersionResult } from '../types-8QjefM9J.js';
2
+ export { R as RevertFailureReason } from '../types-8QjefM9J.js';
3
+ import { C as ContentContainer } from '../ContentContainer-B2w9sUoL.js';
3
4
 
4
5
  /**
5
6
  * Pure-ish version operations against a {@link ContentContainer}.
@@ -28,11 +29,16 @@ declare function saveVersion(container: ContentContainer, options?: SaveVersionO
28
29
  /**
29
30
  * Revert the document to a prior snapshot. By default, the *current*
30
31
  * document is snapshotted first so the revert is itself recoverable.
32
+ *
33
+ * When that snapshot cannot be written, the revert is ABANDONED rather
34
+ * than performed unrecoverably — losing the current state is a worse
35
+ * outcome than a revert that didn't happen. Callers that have already
36
+ * preserved the current state themselves should pass
37
+ * `snapshotCurrent: false`; callers whose live document lives outside the
38
+ * container should pass `content` so the right bytes get snapshotted (see
39
+ * {@link RevertOptions.content}).
31
40
  */
32
- declare function revertToVersion(container: ContentContainer, version: Version | string, options?: RevertOptions): Promise<{
33
- reverted: boolean;
34
- snapshotted: Version | null;
35
- }>;
41
+ declare function revertToVersion(container: ContentContainer, version: Version | string, options?: RevertOptions): Promise<RevertResult>;
36
42
  /**
37
43
  * Delete snapshots that don't satisfy the policy. Returns the deleted
38
44
  * versions in their original (newest-first) order.
@@ -66,10 +72,7 @@ declare class DocumentVersionManager {
66
72
  saveVersion(options?: SaveVersionOptions): Promise<SaveVersionResult>;
67
73
  listVersions(): Promise<Version[]>;
68
74
  readVersion(version: Version | string): Promise<string | null>;
69
- revertToVersion(version: Version | string, options?: RevertOptions): Promise<{
70
- reverted: boolean;
71
- snapshotted: Version | null;
72
- }>;
75
+ revertToVersion(version: Version | string, options?: RevertOptions): Promise<RevertResult>;
73
76
  pruneVersions(policy: PrunePolicy): Promise<Version[]>;
74
77
  coalesceVersions(options?: CoalesceOptions): Promise<Version[]>;
75
78
  }
@@ -126,4 +129,4 @@ declare function parseVersionPath(path: string): {
126
129
  collision: number;
127
130
  } | null;
128
131
 
129
- export { CoalesceOptions, DocumentVersionManager, type DocumentVersionManagerOptions, PrunePolicy, RevertOptions, SaveVersionOptions, SaveVersionResult, VERSIONS_PREFIX, VERSION_TIMESTAMP_PATTERN, Version, buildVersionPath, coalesceVersions, formatVersionTimestamp, getDocBasename, listVersions, parseVersionPath, parseVersionTimestamp, pruneVersions, readVersion, revertToVersion, saveVersion };
132
+ export { CoalesceOptions, DocumentVersionManager, type DocumentVersionManagerOptions, PrunePolicy, RevertOptions, RevertResult, SaveVersionOptions, SaveVersionResult, VERSIONS_PREFIX, VERSION_TIMESTAMP_PATTERN, Version, buildVersionPath, coalesceVersions, formatVersionTimestamp, getDocBasename, listVersions, parseVersionPath, parseVersionTimestamp, pruneVersions, readVersion, revertToVersion, saveVersion };
@@ -10,12 +10,12 @@ import {
10
10
  readVersion,
11
11
  revertToVersion,
12
12
  saveVersion
13
- } from "../chunk-JOQYPRDZ.js";
13
+ } from "../chunk-7YEZFHLS.js";
14
14
  import {
15
15
  VERSION_TIMESTAMP_PATTERN,
16
16
  formatVersionTimestamp,
17
17
  parseVersionTimestamp
18
- } from "../chunk-S7A5D7ZJ.js";
18
+ } from "../chunk-OPO5K4DZ.js";
19
19
  export {
20
20
  DocumentVersionManager,
21
21
  VERSIONS_PREFIX,
@@ -32,4 +32,3 @@ export {
32
32
  revertToVersion,
33
33
  saveVersion
34
34
  };
35
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Headless utilities for doc/block rendering, spatial math, Markdown, and storage",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -28,7 +28,9 @@
28
28
  "types": "./dist/index.d.ts",
29
29
  "files": [
30
30
  "dist",
31
- "src"
31
+ "!dist/**/*.map",
32
+ "LICENSE",
33
+ "NOTICE.md"
32
34
  ],
33
35
  "exports": {
34
36
  ".": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/icons/inlineIconMarker.ts"],"sourcesContent":["/**\n * Inline-icon markers for template text.\n *\n * Slide templates flatten rich markdown body content into strings before\n * rendering. Inline icons need to survive that flattening step, so we encode\n * them as sentinel-delimited text markers and let `TextLayer` turn them back\n * into FontAwesome glyphs when rendering.\n */\n\nimport type { IconFamily } from './iconData.js';\n\n/**\n * Private-Use-Area sentinel that brackets an encoded icon.\n * Kept as an escape sequence so the source remains valid TypeScript text.\n */\nconst SENTINEL = '\\uE000';\n\n/** Matches one encoded marker: `<sentinel><family>:<name><sentinel>`. */\nconst MARKER_RE = new RegExp(`${SENTINEL}([a-z]+):([a-zA-Z0-9-]+)${SENTINEL}`, 'g');\n\n/** Encode a resolved icon (family + name) as an embeddable text marker. */\nexport function iconMarker(family: IconFamily, name: string): string {\n return `${SENTINEL}${family}:${name}${SENTINEL}`;\n}\n\n/** True when a string contains at least one encoded icon marker. */\nexport function hasIconMarker(value: string): boolean {\n return value.includes(SENTINEL);\n}\n\n/** Remove every icon marker, leaving a clean plain-text projection. */\nexport function stripIconMarkers(value: string): string {\n return value.replace(MARKER_RE, '');\n}\n\n/** A run of a marker-bearing string: literal text or a resolved icon. */\nexport type IconTextRun =\n | { type: 'text'; text: string }\n | { type: 'icon'; family: IconFamily; name: string };\n\n/**\n * Split a string into ordered text/icon runs. Text between markers is\n * preserved verbatim, including whitespace; each marker becomes an icon run.\n */\nexport function splitIconMarkers(value: string): IconTextRun[] {\n const runs: IconTextRun[] = [];\n let lastIndex = 0;\n MARKER_RE.lastIndex = 0;\n\n let match: RegExpExecArray | null;\n while ((match = MARKER_RE.exec(value)) !== null) {\n if (match.index > lastIndex) {\n runs.push({ type: 'text', text: value.slice(lastIndex, match.index) });\n }\n runs.push({\n type: 'icon',\n family: match[1] as IconFamily,\n name: match[2],\n });\n lastIndex = match.index + match[0].length;\n }\n\n if (lastIndex < value.length) {\n runs.push({ type: 'text', text: value.slice(lastIndex) });\n }\n\n return runs;\n}\n\n/** FontAwesome CSS class for a resolved icon, e.g. `fa-solid fa-rocket`. */\nexport function iconClass(family: IconFamily, name: string): string {\n return `fa-${family} fa-${name}`;\n}\n"],"mappings":";AAeA,IAAM,WAAW;AAGjB,IAAM,YAAY,IAAI,OAAO,GAAG,QAAQ,2BAA2B,QAAQ,IAAI,GAAG;AAG3E,SAAS,WAAW,QAAoB,MAAsB;AACnE,SAAO,GAAG,QAAQ,GAAG,MAAM,IAAI,IAAI,GAAG,QAAQ;AAChD;AAGO,SAAS,cAAc,OAAwB;AACpD,SAAO,MAAM,SAAS,QAAQ;AAChC;AAGO,SAAS,iBAAiB,OAAuB;AACtD,SAAO,MAAM,QAAQ,WAAW,EAAE;AACpC;AAWO,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,OAAsB,CAAC;AAC7B,MAAI,YAAY;AAChB,YAAU,YAAY;AAEtB,MAAI;AACJ,UAAQ,QAAQ,UAAU,KAAK,KAAK,OAAO,MAAM;AAC/C,QAAI,MAAM,QAAQ,WAAW;AAC3B,WAAK,KAAK,EAAE,MAAM,QAAQ,MAAM,MAAM,MAAM,WAAW,MAAM,KAAK,EAAE,CAAC;AAAA,IACvE;AACA,SAAK,KAAK;AAAA,MACR,MAAM;AAAA,MACN,QAAQ,MAAM,CAAC;AAAA,MACf,MAAM,MAAM,CAAC;AAAA,IACf,CAAC;AACD,gBAAY,MAAM,QAAQ,MAAM,CAAC,EAAE;AAAA,EACrC;AAEA,MAAI,YAAY,MAAM,QAAQ;AAC5B,SAAK,KAAK,EAAE,MAAM,QAAQ,MAAM,MAAM,MAAM,SAAS,EAAE,CAAC;AAAA,EAC1D;AAEA,SAAO;AACT;AAGO,SAAS,UAAU,QAAoB,MAAsB;AAClE,SAAO,MAAM,MAAM,OAAO,IAAI;AAChC;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/timing/narrationTiming.ts"],"sourcesContent":["/**\n * Narration timing estimation.\n *\n * Estimates how long text takes to speak aloud, accounting for:\n * - Numbers spoken as multiple words (e.g., \"1910\" → \"nineteen ten\")\n * - Pauses at commas\n * - Year pronunciation conventions (1000–2099)\n *\n * Ported from qualla-internal's AudioTiming.ts (pure functions, no Node.js deps).\n */\n\n/** Numbers are spoken more slowly than regular words (1.3× multiplier). */\nconst NUMBER_SPEAKING_MULTIPLIER = 1.3;\n\n/** Comma pause in \"word equivalents\" — speakers pause ~0.3 words at commas. */\nconst COMMA_PAUSE_PENALTY = 0.3;\n\n/** Default speaking rate in words per second (~150 WPM). */\nexport const DEFAULT_WORDS_PER_SECOND = 2.5;\n\n/**\n * Estimate how many \"spoken word equivalents\" a single token represents.\n * Numbers get expanded (e.g., \"175,000\" → ~5 words × 1.3 multiplier).\n */\nexport function estimateSpokenWordCount(token: string): number {\n const cleaned = token.replace(/,/g, '');\n const num = parseFloat(cleaned);\n\n if (isNaN(num) || !isFinite(num)) {\n return 1; // Not a number — count as 1 word\n }\n\n return estimateNumberWordCount(cleaned, num) * NUMBER_SPEAKING_MULTIPLIER;\n}\n\n/**\n * Raw word count for a number (before the speaking multiplier).\n */\nfunction estimateNumberWordCount(cleaned: string, num: number): number {\n // Handle decimals: \"3.14\" → words(\"3\") + \"point\" + 2 digits\n if (cleaned.includes('.')) {\n const [whole, decimal] = cleaned.split('.');\n const wholeNum = parseFloat(whole) || 0;\n return estimateNumberWordCount(whole, wholeNum) + 1 + decimal.length;\n }\n\n const absNum = Math.abs(num);\n let words = num < 0 ? 1 : 0; // \"negative\" / \"minus\"\n\n if (absNum === 0) return 1; // \"zero\"\n\n // Years (1000–2099) are spoken as two two-digit groups:\n // \"1910\" → \"nineteen ten\", \"2024\" → \"twenty twenty-four\"\n if (absNum >= 1000 && absNum <= 2099 && Number.isInteger(absNum)) {\n const yearStr = absNum.toString();\n if (yearStr.length === 4) {\n const firstTwo = parseInt(yearStr.slice(0, 2));\n const lastTwo = parseInt(yearStr.slice(2));\n\n // First part\n if (firstTwo >= 10 && firstTwo <= 19) {\n words += 1;\n } else if (firstTwo >= 20 && firstTwo <= 99) {\n words += firstTwo % 10 === 0 ? 1 : 2;\n } else {\n words += 2; // \"two thousand\"\n }\n\n // Second part\n if (lastTwo === 0) {\n if (firstTwo >= 10 && firstTwo <= 99 && firstTwo !== 20) {\n words += 1; // \"hundred\"\n }\n } else if (lastTwo >= 1 && lastTwo <= 9) {\n words += 2; // \"oh five\"\n } else if (lastTwo >= 10 && lastTwo <= 19) {\n words += 1;\n } else {\n words += lastTwo % 10 === 0 ? 1 : 2;\n }\n\n return Math.max(words, 2);\n }\n }\n\n // General number handling — each magnitude group adds words\n let remaining = absNum;\n\n if (remaining >= 1_000_000_000) {\n const billions = Math.floor(remaining / 1_000_000_000);\n words += estimateNumberWordCount(String(billions), billions);\n words += 1; // \"billion\"\n remaining %= 1_000_000_000;\n }\n\n if (remaining >= 1_000_000) {\n const millions = Math.floor(remaining / 1_000_000);\n words += estimateNumberWordCount(String(millions), millions);\n words += 1; // \"million\"\n remaining %= 1_000_000;\n }\n\n if (remaining >= 1_000) {\n const thousands = Math.floor(remaining / 1_000);\n words += estimateNumberWordCount(String(thousands), thousands);\n words += 1; // \"thousand\"\n remaining %= 1_000;\n }\n\n if (remaining >= 100) {\n words += 2; // digit + \"hundred\"\n remaining %= 100;\n }\n\n if (remaining >= 1) {\n if (remaining >= 20) {\n words += remaining % 10 === 0 ? 1 : 2;\n } else {\n words += 1; // 1–19\n }\n }\n\n return Math.max(words, 1);\n}\n\n/**\n * Count \"spoken word equivalents\" in a block of text,\n * expanding numbers and adding comma pauses.\n */\nexport function countSpokenWords(text: string): number {\n const tokens = text.split(/\\s+/).filter((w) => w.length > 0);\n let count = 0;\n\n for (const token of tokens) {\n // Strip punctuation only at token boundaries so internal punctuation\n // (e.g., decimals like \"3.14\" or digit-grouping commas \"1,000\") is preserved.\n const stripped = token.replace(/^[.,!?;:'\"()[\\]{}]+|[.,!?;:'\"()[\\]{}]+$/g, '');\n count += estimateSpokenWordCount(stripped);\n\n // Count only punctuation commas for pauses: exclude digit-grouping commas\n // (i.e., commas with digits on both sides, like in \"1,234\").\n let punctuationCommaCount = 0;\n for (let i = 0; i < token.length; i++) {\n if (token[i] === ',') {\n const prev = i > 0 ? token[i - 1] : '';\n const next = i < token.length - 1 ? token[i + 1] : '';\n const prevIsDigit = prev >= '0' && prev <= '9';\n const nextIsDigit = next >= '0' && next <= '9';\n if (!(prevIsDigit && nextIsDigit)) {\n punctuationCommaCount++;\n }\n }\n }\n count += punctuationCommaCount * COMMA_PAUSE_PENALTY;\n }\n\n return count;\n}\n\n/**\n * Estimate audio time at a character offset using word-proportion mapping.\n *\n * Given the full source text and a character position, returns the\n * estimated time (in seconds) at which that position would be spoken.\n *\n * @param text - Full source text\n * @param charOffset - Character offset to estimate timing for\n * @param totalDuration - Total audio duration in seconds\n * @returns Estimated time in seconds\n */\nexport function estimateTimeFromText(\n text: string,\n charOffset: number,\n totalDuration: number,\n): number {\n const textBefore = text.slice(0, charOffset);\n const spokenWordsBefore = countSpokenWords(textBefore);\n const totalSpokenWords = countSpokenWords(text);\n\n if (totalSpokenWords === 0) return 0;\n return (spokenWordsBefore / totalSpokenWords) * totalDuration;\n}\n\n/**\n * Estimate how long a spoken prefix adds to audio duration.\n *\n * When audio includes a spoken title or header before the main content,\n * this calculates the extra duration to offset timing calculations.\n *\n * @param prefix - Prefix text (e.g., an article title spoken before the body)\n * @param wordsPerSecond - Speaking rate (default: 2.5)\n * @returns Estimated duration in seconds\n */\nexport function calculatePrefixDuration(\n prefix: string,\n wordsPerSecond: number = DEFAULT_WORDS_PER_SECOND,\n): number {\n if (!prefix) return 0;\n\n const words = prefix.split(/\\s+/).filter((w) => w.length > 0);\n const newlineCount = (prefix.match(/\\n\\n/g) || []).length;\n const pauseTime = newlineCount * 0.5;\n\n return words.length / wordsPerSecond + pauseTime;\n}\n\n/**\n * Estimate narration duration for a block of text.\n *\n * @param text - The text to estimate\n * @param wordsPerSecond - Speaking rate (default: 2.5, i.e. ~150 WPM)\n * @returns Duration in seconds\n */\nexport function estimateNarrationDuration(\n text: string,\n wordsPerSecond: number = DEFAULT_WORDS_PER_SECOND,\n): number {\n const spokenWords = countSpokenWords(text);\n return spokenWords / wordsPerSecond;\n}\n"],"mappings":";AAYA,IAAM,6BAA6B;AAGnC,IAAM,sBAAsB;AAGrB,IAAM,2BAA2B;AAMjC,SAAS,wBAAwB,OAAuB;AAC7D,QAAM,UAAU,MAAM,QAAQ,MAAM,EAAE;AACtC,QAAM,MAAM,WAAW,OAAO;AAE9B,MAAI,MAAM,GAAG,KAAK,CAAC,SAAS,GAAG,GAAG;AAChC,WAAO;AAAA,EACT;AAEA,SAAO,wBAAwB,SAAS,GAAG,IAAI;AACjD;AAKA,SAAS,wBAAwB,SAAiB,KAAqB;AAErE,MAAI,QAAQ,SAAS,GAAG,GAAG;AACzB,UAAM,CAAC,OAAO,OAAO,IAAI,QAAQ,MAAM,GAAG;AAC1C,UAAM,WAAW,WAAW,KAAK,KAAK;AACtC,WAAO,wBAAwB,OAAO,QAAQ,IAAI,IAAI,QAAQ;AAAA,EAChE;AAEA,QAAM,SAAS,KAAK,IAAI,GAAG;AAC3B,MAAI,QAAQ,MAAM,IAAI,IAAI;AAE1B,MAAI,WAAW,EAAG,QAAO;AAIzB,MAAI,UAAU,OAAQ,UAAU,QAAQ,OAAO,UAAU,MAAM,GAAG;AAChE,UAAM,UAAU,OAAO,SAAS;AAChC,QAAI,QAAQ,WAAW,GAAG;AACxB,YAAM,WAAW,SAAS,QAAQ,MAAM,GAAG,CAAC,CAAC;AAC7C,YAAM,UAAU,SAAS,QAAQ,MAAM,CAAC,CAAC;AAGzC,UAAI,YAAY,MAAM,YAAY,IAAI;AACpC,iBAAS;AAAA,MACX,WAAW,YAAY,MAAM,YAAY,IAAI;AAC3C,iBAAS,WAAW,OAAO,IAAI,IAAI;AAAA,MACrC,OAAO;AACL,iBAAS;AAAA,MACX;AAGA,UAAI,YAAY,GAAG;AACjB,YAAI,YAAY,MAAM,YAAY,MAAM,aAAa,IAAI;AACvD,mBAAS;AAAA,QACX;AAAA,MACF,WAAW,WAAW,KAAK,WAAW,GAAG;AACvC,iBAAS;AAAA,MACX,WAAW,WAAW,MAAM,WAAW,IAAI;AACzC,iBAAS;AAAA,MACX,OAAO;AACL,iBAAS,UAAU,OAAO,IAAI,IAAI;AAAA,MACpC;AAEA,aAAO,KAAK,IAAI,OAAO,CAAC;AAAA,IAC1B;AAAA,EACF;AAGA,MAAI,YAAY;AAEhB,MAAI,aAAa,KAAe;AAC9B,UAAM,WAAW,KAAK,MAAM,YAAY,GAAa;AACrD,aAAS,wBAAwB,OAAO,QAAQ,GAAG,QAAQ;AAC3D,aAAS;AACT,iBAAa;AAAA,EACf;AAEA,MAAI,aAAa,KAAW;AAC1B,UAAM,WAAW,KAAK,MAAM,YAAY,GAAS;AACjD,aAAS,wBAAwB,OAAO,QAAQ,GAAG,QAAQ;AAC3D,aAAS;AACT,iBAAa;AAAA,EACf;AAEA,MAAI,aAAa,KAAO;AACtB,UAAM,YAAY,KAAK,MAAM,YAAY,GAAK;AAC9C,aAAS,wBAAwB,OAAO,SAAS,GAAG,SAAS;AAC7D,aAAS;AACT,iBAAa;AAAA,EACf;AAEA,MAAI,aAAa,KAAK;AACpB,aAAS;AACT,iBAAa;AAAA,EACf;AAEA,MAAI,aAAa,GAAG;AAClB,QAAI,aAAa,IAAI;AACnB,eAAS,YAAY,OAAO,IAAI,IAAI;AAAA,IACtC,OAAO;AACL,eAAS;AAAA,IACX;AAAA,EACF;AAEA,SAAO,KAAK,IAAI,OAAO,CAAC;AAC1B;AAMO,SAAS,iBAAiB,MAAsB;AACrD,QAAM,SAAS,KAAK,MAAM,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC;AAC3D,MAAI,QAAQ;AAEZ,aAAW,SAAS,QAAQ;AAG1B,UAAM,WAAW,MAAM,QAAQ,4CAA4C,EAAE;AAC7E,aAAS,wBAAwB,QAAQ;AAIzC,QAAI,wBAAwB;AAC5B,aAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAI,MAAM,CAAC,MAAM,KAAK;AACpB,cAAM,OAAO,IAAI,IAAI,MAAM,IAAI,CAAC,IAAI;AACpC,cAAM,OAAO,IAAI,MAAM,SAAS,IAAI,MAAM,IAAI,CAAC,IAAI;AACnD,cAAM,cAAc,QAAQ,OAAO,QAAQ;AAC3C,cAAM,cAAc,QAAQ,OAAO,QAAQ;AAC3C,YAAI,EAAE,eAAe,cAAc;AACjC;AAAA,QACF;AAAA,MACF;AAAA,IACF;AACA,aAAS,wBAAwB;AAAA,EACnC;AAEA,SAAO;AACT;AAaO,SAAS,qBACd,MACA,YACA,eACQ;AACR,QAAM,aAAa,KAAK,MAAM,GAAG,UAAU;AAC3C,QAAM,oBAAoB,iBAAiB,UAAU;AACrD,QAAM,mBAAmB,iBAAiB,IAAI;AAE9C,MAAI,qBAAqB,EAAG,QAAO;AACnC,SAAQ,oBAAoB,mBAAoB;AAClD;AAYO,SAAS,wBACd,QACA,iBAAyB,0BACjB;AACR,MAAI,CAAC,OAAQ,QAAO;AAEpB,QAAM,QAAQ,OAAO,MAAM,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC;AAC5D,QAAM,gBAAgB,OAAO,MAAM,OAAO,KAAK,CAAC,GAAG;AACnD,QAAM,YAAY,eAAe;AAEjC,SAAO,MAAM,SAAS,iBAAiB;AACzC;AASO,SAAS,0BACd,MACA,iBAAyB,0BACjB;AACR,QAAM,cAAc,iBAAiB,IAAI;AACzC,SAAO,cAAc;AACvB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/timing/readingTime.ts"],"sourcesContent":["/**\n * Reading time estimation.\n *\n * Estimates how long it takes to read text silently vs. narrate it aloud.\n * Uses configurable words-per-minute rates.\n */\n\nimport { countSpokenWords, DEFAULT_WORDS_PER_SECOND } from './narrationTiming.js';\n\n/** Default silent reading rate (adults average ~200–250 WPM). */\nconst DEFAULT_READING_WPM = 200;\n\n/** Result of a reading-time estimate. */\nexport interface ReadingTimeEstimate {\n /** Number of words (plain word count, not spoken equivalents). */\n words: number;\n /** Estimated minutes (decimal). */\n minutes: number;\n /** Estimated seconds (rounded). */\n seconds: number;\n}\n\n/** Options for reading-time estimation. */\nexport interface ReadingTimeOptions {\n /** Words per minute for silent reading (default: 200). */\n wordsPerMinute?: number;\n}\n\n/**\n * Estimate silent reading time for a block of text.\n *\n * @param text - The text to estimate\n * @param options - Optional configuration\n * @returns Word count + time estimate\n */\nexport function estimateReadingTime(\n text: string,\n options?: ReadingTimeOptions,\n): ReadingTimeEstimate {\n const configuredWpm = options?.wordsPerMinute;\n const wpm =\n typeof configuredWpm === 'number' && configuredWpm > 0 ? configuredWpm : DEFAULT_READING_WPM;\n const words = text.split(/\\s+/).filter((w) => w.length > 0).length;\n const minutes = words / wpm;\n\n return {\n words,\n minutes,\n seconds: Math.round(minutes * 60),\n };\n}\n\n/** Result of a narration-time estimate. */\nexport interface NarrationTimeEstimate {\n /** Spoken word equivalents (numbers expanded, comma pauses added). */\n spokenWords: number;\n /** Estimated minutes (decimal). */\n minutes: number;\n /** Estimated seconds (rounded). */\n seconds: number;\n}\n\n/** Options for narration-time estimation. */\nexport interface NarrationTimeOptions {\n /** Words per second for narration (default: 2.5 ≈ 150 WPM). */\n wordsPerSecond?: number;\n}\n\n/**\n * Estimate narration (spoken) time for a block of text.\n *\n * Unlike silent reading, this accounts for numbers being spoken as\n * multiple words and pauses at commas.\n *\n * @param text - The text to estimate\n * @param options - Optional configuration\n * @returns Spoken word equivalents + time estimate\n */\nexport function estimateNarrationTime(\n text: string,\n options?: NarrationTimeOptions,\n): NarrationTimeEstimate {\n const providedWps = options?.wordsPerSecond;\n const wps =\n typeof providedWps === 'number' && providedWps > 0 ? providedWps : DEFAULT_WORDS_PER_SECOND;\n const spokenWords = countSpokenWords(text);\n const totalSeconds = spokenWords / wps;\n\n return {\n spokenWords,\n minutes: totalSeconds / 60,\n seconds: Math.round(totalSeconds),\n };\n}\n"],"mappings":";;;;;;AAUA,IAAM,sBAAsB;AAyBrB,SAAS,oBACd,MACA,SACqB;AACrB,QAAM,gBAAgB,SAAS;AAC/B,QAAM,MACJ,OAAO,kBAAkB,YAAY,gBAAgB,IAAI,gBAAgB;AAC3E,QAAM,QAAQ,KAAK,MAAM,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;AAC5D,QAAM,UAAU,QAAQ;AAExB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,SAAS,KAAK,MAAM,UAAU,EAAE;AAAA,EAClC;AACF;AA4BO,SAAS,sBACd,MACA,SACuB;AACvB,QAAM,cAAc,SAAS;AAC7B,QAAM,MACJ,OAAO,gBAAgB,YAAY,cAAc,IAAI,cAAc;AACrE,QAAM,cAAc,iBAAiB,IAAI;AACzC,QAAM,eAAe,cAAc;AAEnC,SAAO;AAAA,IACL;AAAA,IACA,SAAS,eAAe;AAAA,IACxB,SAAS,KAAK,MAAM,YAAY;AAAA,EAClC;AACF;","names":[]}