@bendyline/squisq 0.1.2 → 1.1.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 (349) hide show
  1. package/dist/{themeLibrary-DySHPcgj.d.ts → Doc-1hmT1LZl.d.ts} +1 -42
  2. package/dist/MediaProvider-wpSe21B3.d.ts +66 -0
  3. package/dist/__tests__/animationUtils.test.d.ts +2 -0
  4. package/dist/__tests__/animationUtils.test.d.ts.map +1 -0
  5. package/dist/__tests__/animationUtils.test.js +60 -0
  6. package/dist/__tests__/animationUtils.test.js.map +1 -0
  7. package/dist/__tests__/contentContainer.test.d.ts +2 -0
  8. package/dist/__tests__/contentContainer.test.d.ts.map +1 -0
  9. package/dist/__tests__/contentContainer.test.js +234 -0
  10. package/dist/__tests__/contentContainer.test.js.map +1 -0
  11. package/dist/__tests__/contentExtractor.test.d.ts +2 -0
  12. package/dist/__tests__/contentExtractor.test.d.ts.map +1 -0
  13. package/dist/__tests__/contentExtractor.test.js +151 -0
  14. package/dist/__tests__/contentExtractor.test.js.map +1 -0
  15. package/dist/__tests__/geohash.test.d.ts +2 -0
  16. package/dist/__tests__/geohash.test.d.ts.map +1 -0
  17. package/dist/__tests__/geohash.test.js +87 -0
  18. package/dist/__tests__/geohash.test.js.map +1 -0
  19. package/dist/__tests__/getLayers.test.d.ts +2 -0
  20. package/dist/__tests__/getLayers.test.d.ts.map +1 -0
  21. package/dist/__tests__/getLayers.test.js +167 -0
  22. package/dist/__tests__/getLayers.test.js.map +1 -0
  23. package/dist/__tests__/haversine.test.d.ts +2 -0
  24. package/dist/__tests__/haversine.test.d.ts.map +1 -0
  25. package/dist/__tests__/haversine.test.js +56 -0
  26. package/dist/__tests__/haversine.test.js.map +1 -0
  27. package/dist/__tests__/localForageAdapter.test.d.ts +8 -0
  28. package/dist/__tests__/localForageAdapter.test.d.ts.map +1 -0
  29. package/dist/__tests__/localForageAdapter.test.js +130 -0
  30. package/dist/__tests__/localForageAdapter.test.js.map +1 -0
  31. package/dist/__tests__/markdown.test.d.ts +2 -0
  32. package/dist/__tests__/markdown.test.d.ts.map +1 -0
  33. package/dist/__tests__/markdown.test.js +654 -0
  34. package/dist/__tests__/markdown.test.js.map +1 -0
  35. package/dist/__tests__/markdownToDoc.test.d.ts +2 -0
  36. package/dist/__tests__/markdownToDoc.test.d.ts.map +1 -0
  37. package/dist/__tests__/markdownToDoc.test.js +313 -0
  38. package/dist/__tests__/markdownToDoc.test.js.map +1 -0
  39. package/dist/__tests__/seededRandom.test.d.ts +2 -0
  40. package/dist/__tests__/seededRandom.test.d.ts.map +1 -0
  41. package/dist/__tests__/seededRandom.test.js +125 -0
  42. package/dist/__tests__/seededRandom.test.js.map +1 -0
  43. package/dist/__tests__/slideshowGenerator.test.d.ts +2 -0
  44. package/dist/__tests__/slideshowGenerator.test.d.ts.map +1 -0
  45. package/dist/__tests__/slideshowGenerator.test.js +114 -0
  46. package/dist/__tests__/slideshowGenerator.test.js.map +1 -0
  47. package/dist/__tests__/storage.test.d.ts +2 -0
  48. package/dist/__tests__/storage.test.d.ts.map +1 -0
  49. package/dist/__tests__/storage.test.js +51 -0
  50. package/dist/__tests__/storage.test.js.map +1 -0
  51. package/dist/__tests__/templates.test.d.ts +2 -0
  52. package/dist/__tests__/templates.test.d.ts.map +1 -0
  53. package/dist/__tests__/templates.test.js +217 -0
  54. package/dist/__tests__/templates.test.js.map +1 -0
  55. package/dist/__tests__/timing.test.d.ts +2 -0
  56. package/dist/__tests__/timing.test.d.ts.map +1 -0
  57. package/dist/__tests__/timing.test.js +131 -0
  58. package/dist/__tests__/timing.test.js.map +1 -0
  59. package/dist/chunk-3E5F2XMR.js +129 -0
  60. package/dist/chunk-3E5F2XMR.js.map +1 -0
  61. package/dist/chunk-4CRBS35L.js +292 -0
  62. package/dist/chunk-4CRBS35L.js.map +1 -0
  63. package/dist/chunk-6YJPI6VI.js +35 -0
  64. package/dist/chunk-6YJPI6VI.js.map +1 -0
  65. package/dist/chunk-FVTQSNR7.js +100 -0
  66. package/dist/chunk-FVTQSNR7.js.map +1 -0
  67. package/dist/chunk-V543AI2F.js +1 -0
  68. package/dist/chunk-V543AI2F.js.map +1 -0
  69. package/dist/chunk-VP5SZTZ2.js +792 -0
  70. package/dist/chunk-VP5SZTZ2.js.map +1 -0
  71. package/dist/doc/docToMarkdown.d.ts +41 -0
  72. package/dist/doc/docToMarkdown.d.ts.map +1 -0
  73. package/dist/doc/docToMarkdown.js +88 -0
  74. package/dist/doc/docToMarkdown.js.map +1 -0
  75. package/dist/doc/getLayers.d.ts +65 -0
  76. package/dist/doc/getLayers.d.ts.map +1 -0
  77. package/dist/doc/getLayers.js +103 -0
  78. package/dist/doc/getLayers.js.map +1 -0
  79. package/dist/doc/index.d.ts +9 -3
  80. package/dist/doc/index.d.ts.map +1 -0
  81. package/dist/doc/index.js +6 -125
  82. package/dist/doc/index.js.map +1 -1
  83. package/dist/doc/markdownToDoc.d.ts +68 -0
  84. package/dist/doc/markdownToDoc.d.ts.map +1 -0
  85. package/dist/doc/markdownToDoc.js +225 -0
  86. package/dist/doc/markdownToDoc.js.map +1 -0
  87. package/dist/doc/templates/accentImage.d.ts +59 -0
  88. package/dist/doc/templates/accentImage.d.ts.map +1 -0
  89. package/dist/doc/templates/accentImage.js +275 -0
  90. package/dist/doc/templates/accentImage.js.map +1 -0
  91. package/dist/doc/templates/captionUtils.d.ts +20 -0
  92. package/dist/doc/templates/captionUtils.d.ts.map +1 -0
  93. package/dist/doc/templates/captionUtils.js +29 -0
  94. package/dist/doc/templates/captionUtils.js.map +1 -0
  95. package/dist/doc/templates/comparisonBar.d.ts +13 -0
  96. package/dist/doc/templates/comparisonBar.d.ts.map +1 -0
  97. package/dist/doc/templates/comparisonBar.js +127 -0
  98. package/dist/doc/templates/comparisonBar.js.map +1 -0
  99. package/dist/doc/templates/coverBlock.d.ts +51 -0
  100. package/dist/doc/templates/coverBlock.d.ts.map +1 -0
  101. package/dist/doc/templates/coverBlock.js +125 -0
  102. package/dist/doc/templates/coverBlock.js.map +1 -0
  103. package/dist/doc/templates/dateEvent.d.ts +15 -0
  104. package/dist/doc/templates/dateEvent.d.ts.map +1 -0
  105. package/dist/doc/templates/dateEvent.js +110 -0
  106. package/dist/doc/templates/dateEvent.js.map +1 -0
  107. package/dist/doc/templates/definitionCard.d.ts +13 -0
  108. package/dist/doc/templates/definitionCard.d.ts.map +1 -0
  109. package/dist/doc/templates/definitionCard.js +114 -0
  110. package/dist/doc/templates/definitionCard.js.map +1 -0
  111. package/dist/doc/templates/factCard.d.ts +15 -0
  112. package/dist/doc/templates/factCard.d.ts.map +1 -0
  113. package/dist/doc/templates/factCard.js +100 -0
  114. package/dist/doc/templates/factCard.js.map +1 -0
  115. package/dist/doc/templates/fullBleedQuote.d.ts +13 -0
  116. package/dist/doc/templates/fullBleedQuote.d.ts.map +1 -0
  117. package/dist/doc/templates/fullBleedQuote.js +54 -0
  118. package/dist/doc/templates/fullBleedQuote.js.map +1 -0
  119. package/dist/doc/templates/imageWithCaption.d.ts +13 -0
  120. package/dist/doc/templates/imageWithCaption.d.ts.map +1 -0
  121. package/dist/doc/templates/imageWithCaption.js +142 -0
  122. package/dist/doc/templates/imageWithCaption.js.map +1 -0
  123. package/dist/doc/templates/index.d.ts +104 -0
  124. package/dist/doc/templates/index.d.ts.map +1 -0
  125. package/dist/doc/templates/index.js +442 -0
  126. package/dist/doc/templates/index.js.map +1 -0
  127. package/dist/doc/templates/listBlock.d.ts +13 -0
  128. package/dist/doc/templates/listBlock.d.ts.map +1 -0
  129. package/dist/doc/templates/listBlock.js +89 -0
  130. package/dist/doc/templates/listBlock.js.map +1 -0
  131. package/dist/doc/templates/mapBlock.d.ts +17 -0
  132. package/dist/doc/templates/mapBlock.d.ts.map +1 -0
  133. package/dist/doc/templates/mapBlock.js +112 -0
  134. package/dist/doc/templates/mapBlock.js.map +1 -0
  135. package/dist/doc/templates/persistentLayers.d.ts +39 -0
  136. package/dist/doc/templates/persistentLayers.d.ts.map +1 -0
  137. package/dist/doc/templates/persistentLayers.js +447 -0
  138. package/dist/doc/templates/persistentLayers.js.map +1 -0
  139. package/dist/doc/templates/photoGrid.d.ts +20 -0
  140. package/dist/doc/templates/photoGrid.d.ts.map +1 -0
  141. package/dist/doc/templates/photoGrid.js +172 -0
  142. package/dist/doc/templates/photoGrid.js.map +1 -0
  143. package/dist/doc/templates/pullQuote.d.ts +13 -0
  144. package/dist/doc/templates/pullQuote.d.ts.map +1 -0
  145. package/dist/doc/templates/pullQuote.js +109 -0
  146. package/dist/doc/templates/pullQuote.js.map +1 -0
  147. package/dist/doc/templates/quoteBlock.d.ts +15 -0
  148. package/dist/doc/templates/quoteBlock.d.ts.map +1 -0
  149. package/dist/doc/templates/quoteBlock.js +97 -0
  150. package/dist/doc/templates/quoteBlock.js.map +1 -0
  151. package/dist/doc/templates/sectionHeader.d.ts +14 -0
  152. package/dist/doc/templates/sectionHeader.d.ts.map +1 -0
  153. package/dist/doc/templates/sectionHeader.js +96 -0
  154. package/dist/doc/templates/sectionHeader.js.map +1 -0
  155. package/dist/doc/templates/statHighlight.d.ts +15 -0
  156. package/dist/doc/templates/statHighlight.d.ts.map +1 -0
  157. package/dist/doc/templates/statHighlight.js +99 -0
  158. package/dist/doc/templates/statHighlight.js.map +1 -0
  159. package/dist/doc/templates/titleBlock.d.ts +13 -0
  160. package/dist/doc/templates/titleBlock.d.ts.map +1 -0
  161. package/dist/doc/templates/titleBlock.js +92 -0
  162. package/dist/doc/templates/titleBlock.js.map +1 -0
  163. package/dist/doc/templates/twoColumn.d.ts +15 -0
  164. package/dist/doc/templates/twoColumn.d.ts.map +1 -0
  165. package/dist/doc/templates/twoColumn.js +219 -0
  166. package/dist/doc/templates/twoColumn.js.map +1 -0
  167. package/dist/doc/templates/videoPullQuote.d.ts +20 -0
  168. package/dist/doc/templates/videoPullQuote.d.ts.map +1 -0
  169. package/dist/doc/templates/videoPullQuote.js +118 -0
  170. package/dist/doc/templates/videoPullQuote.js.map +1 -0
  171. package/dist/doc/templates/videoWithCaption.d.ts +20 -0
  172. package/dist/doc/templates/videoWithCaption.d.ts.map +1 -0
  173. package/dist/doc/templates/videoWithCaption.js +104 -0
  174. package/dist/doc/templates/videoWithCaption.js.map +1 -0
  175. package/dist/doc/utils/animationUtils.d.ts +34 -0
  176. package/dist/doc/utils/animationUtils.d.ts.map +1 -0
  177. package/dist/doc/utils/animationUtils.js +110 -0
  178. package/dist/doc/utils/animationUtils.js.map +1 -0
  179. package/dist/doc/utils/themeUtils.d.ts +55 -0
  180. package/dist/doc/utils/themeUtils.d.ts.map +1 -0
  181. package/dist/doc/utils/themeUtils.js +109 -0
  182. package/dist/doc/utils/themeUtils.js.map +1 -0
  183. package/dist/generate/contentExtractor.d.ts +112 -0
  184. package/dist/generate/contentExtractor.d.ts.map +1 -0
  185. package/dist/generate/contentExtractor.js +638 -0
  186. package/dist/generate/contentExtractor.js.map +1 -0
  187. package/dist/generate/index.d.ts +7 -0
  188. package/dist/generate/index.d.ts.map +1 -0
  189. package/dist/generate/index.js +4 -0
  190. package/dist/generate/index.js.map +1 -0
  191. package/dist/generate/slideshowGenerator.d.ts +72 -0
  192. package/dist/generate/slideshowGenerator.d.ts.map +1 -0
  193. package/dist/generate/slideshowGenerator.js +159 -0
  194. package/dist/generate/slideshowGenerator.js.map +1 -0
  195. package/dist/generate/templateMapper.d.ts +23 -0
  196. package/dist/generate/templateMapper.d.ts.map +1 -0
  197. package/dist/generate/templateMapper.js +114 -0
  198. package/dist/generate/templateMapper.js.map +1 -0
  199. package/dist/index.d.ts +9 -8
  200. package/dist/index.d.ts.map +1 -0
  201. package/dist/index.js +8 -216
  202. package/dist/index.js.map +1 -1
  203. package/dist/markdown/convert.d.ts +71 -0
  204. package/dist/markdown/convert.d.ts.map +1 -0
  205. package/dist/markdown/convert.js +746 -0
  206. package/dist/markdown/convert.js.map +1 -0
  207. package/dist/markdown/htmlParse.d.ts +26 -0
  208. package/dist/markdown/htmlParse.d.ts.map +1 -0
  209. package/dist/markdown/htmlParse.js +195 -0
  210. package/dist/markdown/htmlParse.js.map +1 -0
  211. package/dist/markdown/index.d.ts +19 -225
  212. package/dist/markdown/index.d.ts.map +1 -0
  213. package/dist/markdown/index.js +33 -32
  214. package/dist/markdown/index.js.map +1 -1
  215. package/dist/markdown/parse.d.ts +27 -0
  216. package/dist/markdown/parse.d.ts.map +1 -0
  217. package/dist/markdown/parse.js +90 -0
  218. package/dist/markdown/parse.js.map +1 -0
  219. package/dist/markdown/stringify.d.ts +32 -0
  220. package/dist/markdown/stringify.d.ts.map +1 -0
  221. package/dist/markdown/stringify.js +108 -0
  222. package/dist/markdown/stringify.js.map +1 -0
  223. package/dist/markdown/types.d.ts +496 -0
  224. package/dist/markdown/types.d.ts.map +1 -0
  225. package/dist/markdown/types.js +17 -0
  226. package/dist/markdown/types.js.map +1 -0
  227. package/dist/markdown/utils.d.ts +78 -0
  228. package/dist/markdown/utils.d.ts.map +1 -0
  229. package/dist/markdown/utils.js +149 -0
  230. package/dist/markdown/utils.js.map +1 -0
  231. package/dist/random/SeededRandom.d.ts +50 -0
  232. package/dist/random/SeededRandom.d.ts.map +1 -0
  233. package/dist/random/SeededRandom.js +115 -0
  234. package/dist/random/SeededRandom.js.map +1 -0
  235. package/dist/random/index.d.ts +2 -0
  236. package/dist/random/index.d.ts.map +1 -0
  237. package/dist/random/index.js +2 -0
  238. package/dist/random/index.js.map +1 -0
  239. package/dist/schemas/BlockTemplates.d.ts +583 -0
  240. package/dist/schemas/BlockTemplates.d.ts.map +1 -0
  241. package/dist/schemas/BlockTemplates.js +72 -0
  242. package/dist/schemas/BlockTemplates.js.map +1 -0
  243. package/dist/schemas/Doc.d.ts +411 -0
  244. package/dist/schemas/Doc.d.ts.map +1 -0
  245. package/dist/schemas/Doc.js +90 -0
  246. package/dist/schemas/Doc.js.map +1 -0
  247. package/dist/schemas/LayoutStrategy.d.ts +84 -0
  248. package/dist/schemas/LayoutStrategy.d.ts.map +1 -0
  249. package/dist/schemas/LayoutStrategy.js +123 -0
  250. package/dist/schemas/LayoutStrategy.js.map +1 -0
  251. package/dist/schemas/MediaProvider.d.ts +65 -0
  252. package/dist/schemas/MediaProvider.d.ts.map +1 -0
  253. package/dist/schemas/MediaProvider.js +13 -0
  254. package/dist/schemas/MediaProvider.js.map +1 -0
  255. package/dist/schemas/Theme.d.ts +163 -0
  256. package/dist/schemas/Theme.d.ts.map +1 -0
  257. package/dist/schemas/Theme.js +62 -0
  258. package/dist/schemas/Theme.js.map +1 -0
  259. package/dist/schemas/Types.d.ts +14 -0
  260. package/dist/schemas/Types.d.ts.map +1 -0
  261. package/dist/schemas/Types.js +5 -0
  262. package/dist/schemas/Types.js.map +1 -0
  263. package/dist/schemas/Viewport.d.ts +74 -0
  264. package/dist/schemas/Viewport.d.ts.map +1 -0
  265. package/dist/schemas/Viewport.js +63 -0
  266. package/dist/schemas/Viewport.js.map +1 -0
  267. package/dist/schemas/index.d.ts +10 -70
  268. package/dist/schemas/index.d.ts.map +1 -0
  269. package/dist/schemas/index.js +7 -60
  270. package/dist/schemas/index.js.map +1 -1
  271. package/dist/schemas/themeLibrary.d.ts +41 -0
  272. package/dist/schemas/themeLibrary.d.ts.map +1 -0
  273. package/dist/schemas/themeLibrary.js +466 -0
  274. package/dist/schemas/themeLibrary.js.map +1 -0
  275. package/dist/spatial/Geohash.d.ts +85 -0
  276. package/dist/spatial/Geohash.d.ts.map +1 -0
  277. package/dist/spatial/Geohash.js +142 -0
  278. package/dist/spatial/Geohash.js.map +1 -0
  279. package/dist/spatial/Haversine.d.ts +24 -0
  280. package/dist/spatial/Haversine.d.ts.map +1 -0
  281. package/dist/spatial/Haversine.js +48 -0
  282. package/dist/spatial/Haversine.js.map +1 -0
  283. package/dist/spatial/index.d.ts +3 -111
  284. package/dist/spatial/index.d.ts.map +1 -0
  285. package/dist/spatial/index.js +2 -24
  286. package/dist/spatial/index.js.map +1 -1
  287. package/dist/storage/ContentContainer.d.ts +87 -0
  288. package/dist/storage/ContentContainer.d.ts.map +1 -0
  289. package/dist/storage/ContentContainer.js +122 -0
  290. package/dist/storage/ContentContainer.js.map +1 -0
  291. package/dist/storage/LocalForageAdapter.d.ts +36 -0
  292. package/dist/storage/LocalForageAdapter.d.ts.map +1 -0
  293. package/dist/storage/LocalForageAdapter.js +82 -0
  294. package/dist/storage/LocalForageAdapter.js.map +1 -0
  295. package/dist/storage/LocalStorageAdapter.d.ts +16 -0
  296. package/dist/storage/LocalStorageAdapter.d.ts.map +1 -0
  297. package/dist/storage/LocalStorageAdapter.js +50 -0
  298. package/dist/storage/LocalStorageAdapter.js.map +1 -0
  299. package/dist/storage/MediaProviderFromContainer.d.ts +21 -0
  300. package/dist/storage/MediaProviderFromContainer.d.ts.map +1 -0
  301. package/dist/storage/MediaProviderFromContainer.js +79 -0
  302. package/dist/storage/MediaProviderFromContainer.js.map +1 -0
  303. package/dist/storage/MemoryStorageAdapter.d.ts +15 -0
  304. package/dist/storage/MemoryStorageAdapter.d.ts.map +1 -0
  305. package/dist/storage/MemoryStorageAdapter.js +34 -0
  306. package/dist/storage/MemoryStorageAdapter.js.map +1 -0
  307. package/dist/storage/Storage.d.ts +23 -0
  308. package/dist/storage/Storage.d.ts.map +1 -0
  309. package/dist/storage/Storage.js +9 -0
  310. package/dist/storage/Storage.js.map +1 -0
  311. package/dist/storage/index.d.ts +9 -91
  312. package/dist/storage/index.d.ts.map +1 -0
  313. package/dist/storage/index.js +5 -10
  314. package/dist/storage/index.js.map +1 -1
  315. package/dist/story/index.d.ts +3 -2
  316. package/dist/themeLibrary-DR1VRo-8.d.ts +44 -0
  317. package/dist/timing/index.d.ts +4 -0
  318. package/dist/timing/index.d.ts.map +1 -0
  319. package/dist/timing/index.js +3 -0
  320. package/dist/timing/index.js.map +1 -0
  321. package/dist/timing/narrationTiming.d.ts +54 -0
  322. package/dist/timing/narrationTiming.d.ts.map +1 -0
  323. package/dist/timing/narrationTiming.js +190 -0
  324. package/dist/timing/narrationTiming.js.map +1 -0
  325. package/dist/timing/readingTime.d.ts +54 -0
  326. package/dist/timing/readingTime.d.ts.map +1 -0
  327. package/dist/timing/readingTime.js +49 -0
  328. package/dist/timing/readingTime.js.map +1 -0
  329. package/package.json +17 -3
  330. package/src/__tests__/contentContainer.test.ts +282 -0
  331. package/src/__tests__/contentExtractor.test.ts +183 -0
  332. package/src/__tests__/seededRandom.test.ts +142 -0
  333. package/src/__tests__/slideshowGenerator.test.ts +128 -0
  334. package/src/__tests__/timing.test.ts +167 -0
  335. package/src/generate/contentExtractor.ts +808 -0
  336. package/src/generate/index.ts +21 -0
  337. package/src/generate/slideshowGenerator.ts +273 -0
  338. package/src/generate/templateMapper.ts +170 -0
  339. package/src/index.ts +3 -0
  340. package/src/random/SeededRandom.ts +127 -0
  341. package/src/random/index.ts +1 -0
  342. package/src/storage/ContentContainer.ts +200 -0
  343. package/src/storage/MediaProviderFromContainer.ts +92 -0
  344. package/src/storage/index.ts +3 -0
  345. package/src/timing/index.ts +17 -0
  346. package/src/timing/narrationTiming.ts +220 -0
  347. package/src/timing/readingTime.ts +94 -0
  348. package/dist/chunk-VJN7UB2Z.js +0 -145
  349. package/dist/chunk-VJN7UB2Z.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC"}
@@ -1,11 +1,6 @@
1
- import {
2
- LocalForageAdapter,
3
- LocalStorageAdapter,
4
- MemoryStorageAdapter
5
- } from "../chunk-VJN7UB2Z.js";
6
- export {
7
- LocalForageAdapter,
8
- LocalStorageAdapter,
9
- MemoryStorageAdapter
10
- };
1
+ export { MemoryStorageAdapter } from './MemoryStorageAdapter.js';
2
+ export { LocalStorageAdapter } from './LocalStorageAdapter.js';
3
+ export { LocalForageAdapter } from './LocalForageAdapter.js';
4
+ export { MemoryContentContainer, findDocumentPath } from './ContentContainer.js';
5
+ export { createMediaProviderFromContainer } from './MediaProviderFromContainer.js';
11
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC"}
@@ -1,6 +1,7 @@
1
- import { z as PersistentLayer, L as Layer, E as PersistentLayerConfig, a9 as TitleBlockInput, $ as TemplateContext, U as SectionHeaderInput, Y as StatHighlightInput, S as QuoteBlockInput, F as FactCardInput, ad as TwoColumnInput, m as DateEventInput, t as ImageWithCaptionInput, M as MapBlockInput, X as StartBlockConfig, r as FullBleedQuoteInput, v as ListBlockInput, N as PhotoGridInput, o as DefinitionCardInput, h as ComparisonBarInput, R as PullQuoteInput, ah as VideoWithCaptionInput, ag as VideoPullQuoteInput, A as AccentImage, a as AccentPosition, a4 as Theme, ai as ViewportConfig, q as DocBlock, B as Block, _ as TemplateBlock, a1 as TemplateRegistry, b as Animation, c as AnimationType, ac as TransitionType, a6 as ThemeColorScheme, p as Doc } from '../themeLibrary-DySHPcgj.js';
2
- export { j as DEFAULT_THEME, u as LayoutHints, T as RenderStyle, a5 as ThemeColorPalette, a7 as ThemeStyle, a8 as ThemeTypography, ae as VIEWPORT_PRESETS, aj as ViewportOrientation, ak as ViewportPreset, an as createTemplateContext, aq as getAvailableThemes, at as getLayoutHints, aw as getThemeSummaries, ax as getTwoColumnPositions, ay as getViewport, az as getViewportOrientation, aB as isTemplateBlock, aD as resolveTheme, aE as scaledFontSize } from '../themeLibrary-DySHPcgj.js';
1
+ import { x as PersistentLayer, L as Layer, y as PersistentLayerConfig, a6 as TitleBlockInput, Y as TemplateContext, S as SectionHeaderInput, W as StatHighlightInput, Q as QuoteBlockInput, F as FactCardInput, aa as TwoColumnInput, k as DateEventInput, r as ImageWithCaptionInput, M as MapBlockInput, V as StartBlockConfig, p as FullBleedQuoteInput, t as ListBlockInput, J as PhotoGridInput, m as DefinitionCardInput, h as ComparisonBarInput, O as PullQuoteInput, ae as VideoWithCaptionInput, ad as VideoPullQuoteInput, A as AccentImage, a as AccentPosition, a1 as Theme, af as ViewportConfig, o as DocBlock, B as Block, X as TemplateBlock, _ as TemplateRegistry, b as Animation, c as AnimationType, a9 as TransitionType, a3 as ThemeColorScheme, n as Doc } from '../Doc-1hmT1LZl.js';
2
+ export { s as LayoutHints, R as RenderStyle, a2 as ThemeColorPalette, a4 as ThemeStyle, a5 as ThemeTypography, ab as VIEWPORT_PRESETS, ag as ViewportOrientation, ah as ViewportPreset, ak as createTemplateContext, ap as getLayoutHints, as as getTwoColumnPositions, at as getViewport, au as getViewportOrientation, aw as isTemplateBlock, ay as scaledFontSize } from '../Doc-1hmT1LZl.js';
3
3
  import { p as MarkdownHeading, l as MarkdownDocument } from '../types-DHiv_Pnm.js';
4
+ export { D as DEFAULT_THEME, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-DR1VRo-8.js';
4
5
 
5
6
  /**
6
7
  * Persistent Layers Expansion
@@ -0,0 +1,44 @@
1
+ import { a1 as Theme } from './Doc-1hmT1LZl.js';
2
+
3
+ /**
4
+ * Built-in Theme Library
5
+ *
6
+ * Ships 8 curated themes covering documentary, editorial, minimal, and
7
+ * cinematic styles. Each theme is fully JSON-serializable.
8
+ *
9
+ * Usage:
10
+ * ```ts
11
+ * import { THEMES, resolveTheme } from '@bendyline/squisq/schemas';
12
+ *
13
+ * const theme = resolveTheme('minimalist'); // look up by id
14
+ * const theme = THEMES.documentary; // direct access
15
+ * ```
16
+ */
17
+
18
+ /**
19
+ * All built-in themes, keyed by id.
20
+ */
21
+ declare const THEMES: Record<string, Theme>;
22
+ /** The default theme id. */
23
+ declare const DEFAULT_THEME_ID = "documentary";
24
+ /** The default theme (documentary — migrated from old DEFAULT_THEME). */
25
+ declare const DEFAULT_THEME: Theme;
26
+ /**
27
+ * Resolve a theme by id. Returns the default theme when `id` is
28
+ * undefined or not found in the library.
29
+ */
30
+ declare function resolveTheme(id: string | undefined): Theme;
31
+ /**
32
+ * Get all available theme ids.
33
+ */
34
+ declare function getAvailableThemes(): string[];
35
+ /**
36
+ * Get a summary of all themes (id + name + description) for theme pickers.
37
+ */
38
+ declare function getThemeSummaries(): Array<{
39
+ id: string;
40
+ name: string;
41
+ description?: string;
42
+ }>;
43
+
44
+ export { DEFAULT_THEME as D, THEMES as T, DEFAULT_THEME_ID as a, getThemeSummaries as b, getAvailableThemes as g, resolveTheme as r };
@@ -0,0 +1,4 @@
1
+ export { DEFAULT_WORDS_PER_SECOND, estimateSpokenWordCount, countSpokenWords, estimateTimeFromText, calculatePrefixDuration, estimateNarrationDuration, } from './narrationTiming.js';
2
+ export { estimateReadingTime, estimateNarrationTime } from './readingTime.js';
3
+ export type { ReadingTimeEstimate, ReadingTimeOptions, NarrationTimeEstimate, NarrationTimeOptions, } from './readingTime.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/timing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9E,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { DEFAULT_WORDS_PER_SECOND, estimateSpokenWordCount, countSpokenWords, estimateTimeFromText, calculatePrefixDuration, estimateNarrationDuration, } from './narrationTiming.js';
2
+ export { estimateReadingTime, estimateNarrationTime } from './readingTime.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/timing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Narration timing estimation.
3
+ *
4
+ * Estimates how long text takes to speak aloud, accounting for:
5
+ * - Numbers spoken as multiple words (e.g., "1910" → "nineteen ten")
6
+ * - Pauses at commas
7
+ * - Year pronunciation conventions (1000–2099)
8
+ *
9
+ * Ported from qualla-internal's AudioTiming.ts (pure functions, no Node.js deps).
10
+ */
11
+ /** Default speaking rate in words per second (~150 WPM). */
12
+ export declare const DEFAULT_WORDS_PER_SECOND = 2.5;
13
+ /**
14
+ * Estimate how many "spoken word equivalents" a single token represents.
15
+ * Numbers get expanded (e.g., "175,000" → ~5 words × 1.3 multiplier).
16
+ */
17
+ export declare function estimateSpokenWordCount(token: string): number;
18
+ /**
19
+ * Count "spoken word equivalents" in a block of text,
20
+ * expanding numbers and adding comma pauses.
21
+ */
22
+ export declare function countSpokenWords(text: string): number;
23
+ /**
24
+ * Estimate audio time at a character offset using word-proportion mapping.
25
+ *
26
+ * Given the full source text and a character position, returns the
27
+ * estimated time (in seconds) at which that position would be spoken.
28
+ *
29
+ * @param text - Full source text
30
+ * @param charOffset - Character offset to estimate timing for
31
+ * @param totalDuration - Total audio duration in seconds
32
+ * @returns Estimated time in seconds
33
+ */
34
+ export declare function estimateTimeFromText(text: string, charOffset: number, totalDuration: number): number;
35
+ /**
36
+ * Estimate how long a spoken prefix adds to audio duration.
37
+ *
38
+ * When audio includes a spoken title or header before the main content,
39
+ * this calculates the extra duration to offset timing calculations.
40
+ *
41
+ * @param prefix - Prefix text (e.g., an article title spoken before the body)
42
+ * @param wordsPerSecond - Speaking rate (default: 2.5)
43
+ * @returns Estimated duration in seconds
44
+ */
45
+ export declare function calculatePrefixDuration(prefix: string, wordsPerSecond?: number): number;
46
+ /**
47
+ * Estimate narration duration for a block of text.
48
+ *
49
+ * @param text - The text to estimate
50
+ * @param wordsPerSecond - Speaking rate (default: 2.5, i.e. ~150 WPM)
51
+ * @returns Duration in seconds
52
+ */
53
+ export declare function estimateNarrationDuration(text: string, wordsPerSecond?: number): number;
54
+ //# sourceMappingURL=narrationTiming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"narrationTiming.d.ts","sourceRoot":"","sources":["../../src/timing/narrationTiming.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,4DAA4D;AAC5D,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7D;AA4FD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA4BrD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACpB,MAAM,CAOR;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,cAAc,GAAE,MAAiC,GAChD,MAAM,CAQR;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,cAAc,GAAE,MAAiC,GAChD,MAAM,CAGR"}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Narration timing estimation.
3
+ *
4
+ * Estimates how long text takes to speak aloud, accounting for:
5
+ * - Numbers spoken as multiple words (e.g., "1910" → "nineteen ten")
6
+ * - Pauses at commas
7
+ * - Year pronunciation conventions (1000–2099)
8
+ *
9
+ * Ported from qualla-internal's AudioTiming.ts (pure functions, no Node.js deps).
10
+ */
11
+ /** Numbers are spoken more slowly than regular words (1.3× multiplier). */
12
+ const NUMBER_SPEAKING_MULTIPLIER = 1.3;
13
+ /** Comma pause in "word equivalents" — speakers pause ~0.3 words at commas. */
14
+ const COMMA_PAUSE_PENALTY = 0.3;
15
+ /** Default speaking rate in words per second (~150 WPM). */
16
+ export const DEFAULT_WORDS_PER_SECOND = 2.5;
17
+ /**
18
+ * Estimate how many "spoken word equivalents" a single token represents.
19
+ * Numbers get expanded (e.g., "175,000" → ~5 words × 1.3 multiplier).
20
+ */
21
+ export function estimateSpokenWordCount(token) {
22
+ const cleaned = token.replace(/,/g, '');
23
+ const num = parseFloat(cleaned);
24
+ if (isNaN(num) || !isFinite(num)) {
25
+ return 1; // Not a number — count as 1 word
26
+ }
27
+ return estimateNumberWordCount(cleaned, num) * NUMBER_SPEAKING_MULTIPLIER;
28
+ }
29
+ /**
30
+ * Raw word count for a number (before the speaking multiplier).
31
+ */
32
+ function estimateNumberWordCount(cleaned, num) {
33
+ // Handle decimals: "3.14" → words("3") + "point" + 2 digits
34
+ if (cleaned.includes('.')) {
35
+ const [whole, decimal] = cleaned.split('.');
36
+ const wholeNum = parseFloat(whole) || 0;
37
+ return estimateNumberWordCount(whole, wholeNum) + 1 + decimal.length;
38
+ }
39
+ const absNum = Math.abs(num);
40
+ let words = num < 0 ? 1 : 0; // "negative" / "minus"
41
+ if (absNum === 0)
42
+ return 1; // "zero"
43
+ // Years (1000–2099) are spoken as two two-digit groups:
44
+ // "1910" → "nineteen ten", "2024" → "twenty twenty-four"
45
+ if (absNum >= 1000 && absNum <= 2099 && Number.isInteger(absNum)) {
46
+ const yearStr = absNum.toString();
47
+ if (yearStr.length === 4) {
48
+ const firstTwo = parseInt(yearStr.slice(0, 2));
49
+ const lastTwo = parseInt(yearStr.slice(2));
50
+ // First part
51
+ if (firstTwo >= 10 && firstTwo <= 19) {
52
+ words += 1;
53
+ }
54
+ else if (firstTwo >= 20 && firstTwo <= 99) {
55
+ words += firstTwo % 10 === 0 ? 1 : 2;
56
+ }
57
+ else {
58
+ words += 2; // "two thousand"
59
+ }
60
+ // Second part
61
+ if (lastTwo === 0) {
62
+ if (firstTwo >= 10 && firstTwo <= 99 && firstTwo !== 20) {
63
+ words += 1; // "hundred"
64
+ }
65
+ }
66
+ else if (lastTwo >= 1 && lastTwo <= 9) {
67
+ words += 2; // "oh five"
68
+ }
69
+ else if (lastTwo >= 10 && lastTwo <= 19) {
70
+ words += 1;
71
+ }
72
+ else {
73
+ words += lastTwo % 10 === 0 ? 1 : 2;
74
+ }
75
+ return Math.max(words, 2);
76
+ }
77
+ }
78
+ // General number handling — each magnitude group adds words
79
+ let remaining = absNum;
80
+ if (remaining >= 1000000000) {
81
+ const billions = Math.floor(remaining / 1000000000);
82
+ words += estimateNumberWordCount(String(billions), billions);
83
+ words += 1; // "billion"
84
+ remaining %= 1000000000;
85
+ }
86
+ if (remaining >= 1000000) {
87
+ const millions = Math.floor(remaining / 1000000);
88
+ words += estimateNumberWordCount(String(millions), millions);
89
+ words += 1; // "million"
90
+ remaining %= 1000000;
91
+ }
92
+ if (remaining >= 1000) {
93
+ const thousands = Math.floor(remaining / 1000);
94
+ words += estimateNumberWordCount(String(thousands), thousands);
95
+ words += 1; // "thousand"
96
+ remaining %= 1000;
97
+ }
98
+ if (remaining >= 100) {
99
+ words += 2; // digit + "hundred"
100
+ remaining %= 100;
101
+ }
102
+ if (remaining >= 1) {
103
+ if (remaining >= 20) {
104
+ words += remaining % 10 === 0 ? 1 : 2;
105
+ }
106
+ else {
107
+ words += 1; // 1–19
108
+ }
109
+ }
110
+ return Math.max(words, 1);
111
+ }
112
+ /**
113
+ * Count "spoken word equivalents" in a block of text,
114
+ * expanding numbers and adding comma pauses.
115
+ */
116
+ export function countSpokenWords(text) {
117
+ const tokens = text.split(/\s+/).filter((w) => w.length > 0);
118
+ let count = 0;
119
+ for (const token of tokens) {
120
+ // Strip punctuation only at token boundaries so internal punctuation
121
+ // (e.g., decimals like "3.14" or digit-grouping commas "1,000") is preserved.
122
+ const stripped = token.replace(/^[.,!?;:'"()[\]{}]+|[.,!?;:'"()[\]{}]+$/g, '');
123
+ count += estimateSpokenWordCount(stripped);
124
+ // Count only punctuation commas for pauses: exclude digit-grouping commas
125
+ // (i.e., commas with digits on both sides, like in "1,234").
126
+ let punctuationCommaCount = 0;
127
+ for (let i = 0; i < token.length; i++) {
128
+ if (token[i] === ',') {
129
+ const prev = i > 0 ? token[i - 1] : '';
130
+ const next = i < token.length - 1 ? token[i + 1] : '';
131
+ const prevIsDigit = prev >= '0' && prev <= '9';
132
+ const nextIsDigit = next >= '0' && next <= '9';
133
+ if (!(prevIsDigit && nextIsDigit)) {
134
+ punctuationCommaCount++;
135
+ }
136
+ }
137
+ }
138
+ count += punctuationCommaCount * COMMA_PAUSE_PENALTY;
139
+ }
140
+ return count;
141
+ }
142
+ /**
143
+ * Estimate audio time at a character offset using word-proportion mapping.
144
+ *
145
+ * Given the full source text and a character position, returns the
146
+ * estimated time (in seconds) at which that position would be spoken.
147
+ *
148
+ * @param text - Full source text
149
+ * @param charOffset - Character offset to estimate timing for
150
+ * @param totalDuration - Total audio duration in seconds
151
+ * @returns Estimated time in seconds
152
+ */
153
+ export function estimateTimeFromText(text, charOffset, totalDuration) {
154
+ const textBefore = text.slice(0, charOffset);
155
+ const spokenWordsBefore = countSpokenWords(textBefore);
156
+ const totalSpokenWords = countSpokenWords(text);
157
+ if (totalSpokenWords === 0)
158
+ return 0;
159
+ return (spokenWordsBefore / totalSpokenWords) * totalDuration;
160
+ }
161
+ /**
162
+ * Estimate how long a spoken prefix adds to audio duration.
163
+ *
164
+ * When audio includes a spoken title or header before the main content,
165
+ * this calculates the extra duration to offset timing calculations.
166
+ *
167
+ * @param prefix - Prefix text (e.g., an article title spoken before the body)
168
+ * @param wordsPerSecond - Speaking rate (default: 2.5)
169
+ * @returns Estimated duration in seconds
170
+ */
171
+ export function calculatePrefixDuration(prefix, wordsPerSecond = DEFAULT_WORDS_PER_SECOND) {
172
+ if (!prefix)
173
+ return 0;
174
+ const words = prefix.split(/\s+/).filter((w) => w.length > 0);
175
+ const newlineCount = (prefix.match(/\n\n/g) || []).length;
176
+ const pauseTime = newlineCount * 0.5;
177
+ return words.length / wordsPerSecond + pauseTime;
178
+ }
179
+ /**
180
+ * Estimate narration duration for a block of text.
181
+ *
182
+ * @param text - The text to estimate
183
+ * @param wordsPerSecond - Speaking rate (default: 2.5, i.e. ~150 WPM)
184
+ * @returns Duration in seconds
185
+ */
186
+ export function estimateNarrationDuration(text, wordsPerSecond = DEFAULT_WORDS_PER_SECOND) {
187
+ const spokenWords = countSpokenWords(text);
188
+ return spokenWords / wordsPerSecond;
189
+ }
190
+ //# sourceMappingURL=narrationTiming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"narrationTiming.js","sourceRoot":"","sources":["../../src/timing/narrationTiming.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,2EAA2E;AAC3E,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAEvC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CAAC,MAAM,CAAC;IAC1D,MAAM,SAAS,GAAG,YAAY,GAAG,GAAG,CAAC;IAErC,OAAO,KAAK,CAAC,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;AACnD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACvC,IAAY,EACZ,iBAAyB,wBAAwB;IAEjD,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,WAAW,GAAG,cAAc,CAAC;AACtC,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Reading time estimation.
3
+ *
4
+ * Estimates how long it takes to read text silently vs. narrate it aloud.
5
+ * Uses configurable words-per-minute rates.
6
+ */
7
+ /** Result of a reading-time estimate. */
8
+ export interface ReadingTimeEstimate {
9
+ /** Number of words (plain word count, not spoken equivalents). */
10
+ words: number;
11
+ /** Estimated minutes (decimal). */
12
+ minutes: number;
13
+ /** Estimated seconds (rounded). */
14
+ seconds: number;
15
+ }
16
+ /** Options for reading-time estimation. */
17
+ export interface ReadingTimeOptions {
18
+ /** Words per minute for silent reading (default: 200). */
19
+ wordsPerMinute?: number;
20
+ }
21
+ /**
22
+ * Estimate silent reading time for a block of text.
23
+ *
24
+ * @param text - The text to estimate
25
+ * @param options - Optional configuration
26
+ * @returns Word count + time estimate
27
+ */
28
+ export declare function estimateReadingTime(text: string, options?: ReadingTimeOptions): ReadingTimeEstimate;
29
+ /** Result of a narration-time estimate. */
30
+ export interface NarrationTimeEstimate {
31
+ /** Spoken word equivalents (numbers expanded, comma pauses added). */
32
+ spokenWords: number;
33
+ /** Estimated minutes (decimal). */
34
+ minutes: number;
35
+ /** Estimated seconds (rounded). */
36
+ seconds: number;
37
+ }
38
+ /** Options for narration-time estimation. */
39
+ export interface NarrationTimeOptions {
40
+ /** Words per second for narration (default: 2.5 ≈ 150 WPM). */
41
+ wordsPerSecond?: number;
42
+ }
43
+ /**
44
+ * Estimate narration (spoken) time for a block of text.
45
+ *
46
+ * Unlike silent reading, this accounts for numbers being spoken as
47
+ * multiple words and pauses at commas.
48
+ *
49
+ * @param text - The text to estimate
50
+ * @param options - Optional configuration
51
+ * @returns Spoken word equivalents + time estimate
52
+ */
53
+ export declare function estimateNarrationTime(text: string, options?: NarrationTimeOptions): NarrationTimeEstimate;
54
+ //# sourceMappingURL=readingTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readingTime.d.ts","sourceRoot":"","sources":["../../src/timing/readingTime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,yCAAyC;AACzC,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,kBAAkB,GAC3B,mBAAmB,CAYrB;AAED,2CAA2C;AAC3C,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,oBAAoB,GAC7B,qBAAqB,CAYvB"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Reading time estimation.
3
+ *
4
+ * Estimates how long it takes to read text silently vs. narrate it aloud.
5
+ * Uses configurable words-per-minute rates.
6
+ */
7
+ import { countSpokenWords, DEFAULT_WORDS_PER_SECOND } from './narrationTiming.js';
8
+ /** Default silent reading rate (adults average ~200–250 WPM). */
9
+ const DEFAULT_READING_WPM = 200;
10
+ /**
11
+ * Estimate silent reading time for a block of text.
12
+ *
13
+ * @param text - The text to estimate
14
+ * @param options - Optional configuration
15
+ * @returns Word count + time estimate
16
+ */
17
+ export function estimateReadingTime(text, options) {
18
+ const configuredWpm = options?.wordsPerMinute;
19
+ const wpm = typeof configuredWpm === 'number' && configuredWpm > 0 ? configuredWpm : DEFAULT_READING_WPM;
20
+ const words = text.split(/\s+/).filter((w) => w.length > 0).length;
21
+ const minutes = words / wpm;
22
+ return {
23
+ words,
24
+ minutes,
25
+ seconds: Math.round(minutes * 60),
26
+ };
27
+ }
28
+ /**
29
+ * Estimate narration (spoken) time for a block of text.
30
+ *
31
+ * Unlike silent reading, this accounts for numbers being spoken as
32
+ * multiple words and pauses at commas.
33
+ *
34
+ * @param text - The text to estimate
35
+ * @param options - Optional configuration
36
+ * @returns Spoken word equivalents + time estimate
37
+ */
38
+ export function estimateNarrationTime(text, options) {
39
+ const providedWps = options?.wordsPerSecond;
40
+ const wps = typeof providedWps === 'number' && providedWps > 0 ? providedWps : DEFAULT_WORDS_PER_SECOND;
41
+ const spokenWords = countSpokenWords(text);
42
+ const totalSeconds = spokenWords / wps;
43
+ return {
44
+ spokenWords,
45
+ minutes: totalSeconds / 60,
46
+ seconds: Math.round(totalSeconds),
47
+ };
48
+ }
49
+ //# sourceMappingURL=readingTime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readingTime.js","sourceRoot":"","sources":["../../src/timing/readingTime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAElF,iEAAiE;AACjE,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAkBhC;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAY,EACZ,OAA4B;IAE5B,MAAM,aAAa,GAAG,OAAO,EAAE,cAAc,CAAC;IAC9C,MAAM,GAAG,GACP,OAAO,aAAa,KAAK,QAAQ,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAC/F,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;IACnE,MAAM,OAAO,GAAG,KAAK,GAAG,GAAG,CAAC;IAE5B,OAAO;QACL,KAAK;QACL,OAAO;QACP,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;KAClC,CAAC;AACJ,CAAC;AAkBD;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAY,EACZ,OAA8B;IAE9B,MAAM,WAAW,GAAG,OAAO,EAAE,cAAc,CAAC;IAC5C,MAAM,GAAG,GACP,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,wBAAwB,CAAC;IAC9F,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,YAAY,GAAG,WAAW,GAAG,GAAG,CAAC;IAEvC,OAAO;QACL,WAAW;QACX,OAAO,EAAE,YAAY,GAAG,EAAE;QAC1B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;KAClC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq",
3
- "version": "0.1.2",
3
+ "version": "1.1.0",
4
4
  "description": "Headless utilities for doc/block rendering, spatial math, Markdown, and storage",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -65,12 +65,26 @@
65
65
  "types": "./dist/markdown/index.d.ts",
66
66
  "import": "./dist/markdown/index.js",
67
67
  "default": "./dist/markdown/index.js"
68
+ },
69
+ "./timing": {
70
+ "types": "./dist/timing/index.d.ts",
71
+ "import": "./dist/timing/index.js",
72
+ "default": "./dist/timing/index.js"
73
+ },
74
+ "./random": {
75
+ "types": "./dist/random/index.d.ts",
76
+ "import": "./dist/random/index.js",
77
+ "default": "./dist/random/index.js"
78
+ },
79
+ "./generate": {
80
+ "types": "./dist/generate/index.d.ts",
81
+ "import": "./dist/generate/index.js",
82
+ "default": "./dist/generate/index.js"
68
83
  }
69
84
  },
70
85
  "scripts": {
71
86
  "build": "tsup",
72
- "typecheck": "tsc --noEmit",
73
- "prepublishOnly": "npm run build"
87
+ "typecheck": "tsc --noEmit"
74
88
  },
75
89
  "dependencies": {
76
90
  "hast-util-from-html": "^2.0.0",