@bendyline/squisq 1.3.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (533) hide show
  1. package/dist/{Doc-Ch4tc3vv.d.ts → Doc-BeSeH2iX.d.ts} +118 -41
  2. package/dist/ImageEditDoc-BTIvw0oq.d.ts +84 -0
  3. package/dist/{chunk-CYQHG27J.js → chunk-2TMAWB4Y.js} +74 -1
  4. package/dist/chunk-2TMAWB4Y.js.map +1 -0
  5. package/dist/{chunk-OASJKWO5.js → chunk-3K5OG6KI.js} +92 -7
  6. package/dist/chunk-3K5OG6KI.js.map +1 -0
  7. package/dist/chunk-57CVQCFX.js +193 -0
  8. package/dist/chunk-57CVQCFX.js.map +1 -0
  9. package/dist/{chunk-QM5PKNPW.js → chunk-5WFRKURX.js} +1 -1
  10. package/dist/chunk-5WFRKURX.js.map +1 -0
  11. package/dist/chunk-B4EEON3N.js +1317 -0
  12. package/dist/chunk-B4EEON3N.js.map +1 -0
  13. package/dist/chunk-DBS6RIFL.js +81 -0
  14. package/dist/chunk-DBS6RIFL.js.map +1 -0
  15. package/dist/{chunk-MIBRIRGJ.js → chunk-FR2RBTKO.js} +3 -3
  16. package/dist/{chunk-MIBRIRGJ.js.map → chunk-FR2RBTKO.js.map} +1 -1
  17. package/dist/chunk-H3AXU4MJ.js +179 -0
  18. package/dist/chunk-H3AXU4MJ.js.map +1 -0
  19. package/dist/chunk-JELIRVDP.js +24 -0
  20. package/dist/chunk-JELIRVDP.js.map +1 -0
  21. package/dist/chunk-K32VJONL.js +193 -0
  22. package/dist/chunk-K32VJONL.js.map +1 -0
  23. package/dist/{chunk-6BAVXFYC.js → chunk-KSWJR66U.js} +218 -42
  24. package/dist/chunk-KSWJR66U.js.map +1 -0
  25. package/dist/{chunk-TSG2OSE6.js → chunk-MYIH7FWD.js} +3 -3
  26. package/dist/chunk-MYIH7FWD.js.map +1 -0
  27. package/dist/chunk-VLJJHDAC.js +218 -0
  28. package/dist/chunk-VLJJHDAC.js.map +1 -0
  29. package/dist/chunk-WMOI7FN3.js +182 -0
  30. package/dist/chunk-WMOI7FN3.js.map +1 -0
  31. package/dist/chunk-ZTX4PFFT.js +520 -0
  32. package/dist/chunk-ZTX4PFFT.js.map +1 -0
  33. package/dist/doc/index.d.ts +5 -10
  34. package/dist/doc/index.js +145 -7
  35. package/dist/doc/index.js.map +1 -1
  36. package/dist/generate/index.d.ts +99 -7
  37. package/dist/generate/index.js +16 -3
  38. package/dist/generate/index.js.map +1 -1
  39. package/dist/icons/index.d.ts +87 -0
  40. package/dist/icons/index.js +17 -0
  41. package/dist/icons/index.js.map +1 -0
  42. package/dist/imageEdit/index.d.ts +216 -0
  43. package/dist/imageEdit/index.js +54 -0
  44. package/dist/imageEdit/index.js.map +1 -0
  45. package/dist/index.d.ts +21 -9
  46. package/dist/index.js +461 -8
  47. package/dist/index.js.map +1 -1
  48. package/dist/jsonForm/index.d.ts +191 -0
  49. package/dist/jsonForm/index.js +27 -0
  50. package/dist/jsonForm/index.js.map +1 -0
  51. package/dist/markdown/index.d.ts +265 -19
  52. package/dist/markdown/index.js +39 -33
  53. package/dist/markdown/index.js.map +1 -1
  54. package/dist/random/index.d.ts +51 -2
  55. package/dist/random/index.js +9 -1
  56. package/dist/random/index.js.map +1 -1
  57. package/dist/recommend/index.d.ts +42 -0
  58. package/dist/recommend/index.js +10 -0
  59. package/dist/recommend/index.js.map +1 -0
  60. package/dist/schemas/index.d.ts +188 -10
  61. package/dist/schemas/index.js +120 -7
  62. package/dist/schemas/index.js.map +1 -1
  63. package/dist/spatial/index.d.ts +111 -3
  64. package/dist/spatial/index.js +24 -2
  65. package/dist/spatial/index.js.map +1 -1
  66. package/dist/storage/index.d.ts +159 -9
  67. package/dist/storage/index.js +20 -5
  68. package/dist/storage/index.js.map +1 -1
  69. package/dist/story/index.d.ts +53 -13
  70. package/dist/story/index.js +12 -4
  71. package/dist/themeLibrary-BHjJ0Qx6.d.ts +40 -0
  72. package/dist/timing/index.d.ts +109 -4
  73. package/dist/timing/index.js +23 -2
  74. package/dist/timing/index.js.map +1 -1
  75. package/dist/transform/index.d.ts +175 -6
  76. package/dist/transform/index.js +490 -3
  77. package/dist/transform/index.js.map +1 -1
  78. package/dist/{types-CkNttVSF.d.ts → types-BdZkdJ3z.d.ts} +17 -2
  79. package/dist/types-D98li1gV.d.ts +93 -0
  80. package/dist/versions/index.d.ts +128 -0
  81. package/dist/versions/index.js +35 -0
  82. package/dist/versions/index.js.map +1 -0
  83. package/package.json +28 -1
  84. package/src/__tests__/colorUtils.test.ts +112 -0
  85. package/src/__tests__/getLayers.test.ts +32 -7
  86. package/src/__tests__/iconResolve.test.ts +122 -0
  87. package/src/__tests__/imageEditState.test.ts +74 -0
  88. package/src/__tests__/imageEditVersions.test.ts +169 -0
  89. package/src/__tests__/inferDocumentTitle.test.ts +50 -0
  90. package/src/__tests__/jsonForm.chooseControl.test.ts +86 -0
  91. package/src/__tests__/jsonForm.evaluateWhen.test.ts +59 -0
  92. package/src/__tests__/jsonForm.inferSchema.test.ts +25 -0
  93. package/src/__tests__/jsonForm.pointer.test.ts +103 -0
  94. package/src/__tests__/markdownIcons.test.ts +104 -0
  95. package/src/__tests__/markdownToDoc.test.ts +19 -4
  96. package/src/__tests__/recommendTemplates.test.ts +183 -0
  97. package/src/__tests__/scopedContentContainer.test.ts +89 -0
  98. package/src/__tests__/slideshowGenerator.test.ts +1 -1
  99. package/src/__tests__/templateAnnotationParse.test.ts +42 -0
  100. package/src/__tests__/templates.test.ts +93 -9
  101. package/src/__tests__/themeCompile.test.ts +156 -0
  102. package/src/__tests__/themeValidator.test.ts +125 -0
  103. package/src/__tests__/versions.test.ts +415 -0
  104. package/src/doc/audioMapping.ts +55 -11
  105. package/src/doc/getLayers.ts +32 -21
  106. package/src/doc/markdownToDoc.ts +45 -7
  107. package/src/doc/templates/featureBlock.ts +202 -0
  108. package/src/doc/templates/fullBleedQuote.ts +13 -0
  109. package/src/doc/templates/index.ts +50 -16
  110. package/src/doc/templates/listBlock.ts +24 -5
  111. package/src/doc/templates/statHighlight.ts +13 -0
  112. package/src/doc/templates/titleBlock.ts +9 -0
  113. package/src/doc/utils/themeUtils.ts +8 -7
  114. package/src/generate/slideshowGenerator.ts +1 -1
  115. package/src/generate/templateMapper.ts +2 -2
  116. package/src/icons/iconData.ts +31 -0
  117. package/src/icons/index.ts +18 -0
  118. package/src/icons/resolve.ts +139 -0
  119. package/src/imageEdit/ImageEditVersionManager.ts +73 -0
  120. package/src/imageEdit/export.ts +326 -0
  121. package/src/imageEdit/index.ts +71 -0
  122. package/src/imageEdit/persistence.ts +62 -0
  123. package/src/imageEdit/state.ts +112 -0
  124. package/src/imageEdit/versionPaths.ts +57 -0
  125. package/src/imageEdit/versions.ts +231 -0
  126. package/src/index.ts +4 -0
  127. package/src/jsonForm/chooseControl.ts +88 -0
  128. package/src/jsonForm/evaluateWhen.ts +59 -0
  129. package/src/jsonForm/index.ts +22 -0
  130. package/src/jsonForm/inferSchema.ts +25 -0
  131. package/src/jsonForm/pointer.ts +109 -0
  132. package/src/jsonForm/types.ts +167 -0
  133. package/src/markdown/convert.ts +145 -5
  134. package/src/markdown/index.ts +3 -0
  135. package/src/markdown/types.ts +19 -2
  136. package/src/markdown/utils.ts +159 -0
  137. package/src/recommend/index.ts +16 -0
  138. package/src/recommend/templates.ts +273 -0
  139. package/src/schemas/BlockTemplates.ts +50 -7
  140. package/src/schemas/ImageEditDoc.ts +95 -0
  141. package/src/schemas/Theme.ts +98 -31
  142. package/src/schemas/colorUtils.ts +186 -0
  143. package/src/schemas/fontStacks.ts +257 -0
  144. package/src/schemas/index.ts +12 -0
  145. package/src/schemas/themeCompile.ts +203 -0
  146. package/src/schemas/themeLibrary.ts +18 -597
  147. package/src/schemas/themeValidator.ts +388 -0
  148. package/src/schemas/themes/bold.json +48 -0
  149. package/src/schemas/themes/cinematic.json +54 -0
  150. package/src/schemas/themes/documentary.json +49 -0
  151. package/src/schemas/themes/gezellig.json +44 -0
  152. package/src/schemas/themes/index.ts +53 -0
  153. package/src/schemas/themes/magazine.json +44 -0
  154. package/src/schemas/themes/minimalist.json +45 -0
  155. package/src/schemas/themes/morning-light.json +42 -0
  156. package/src/schemas/themes/standard-dark.json +50 -0
  157. package/src/schemas/themes/standard.json +42 -0
  158. package/src/schemas/themes/tech-dark.json +48 -0
  159. package/src/schemas/themes/warm-earth.json +50 -0
  160. package/src/storage/ScopedContentContainer.ts +113 -0
  161. package/src/storage/index.ts +1 -0
  162. package/src/versions/DocumentVersionManager.ts +70 -0
  163. package/src/versions/index.ts +54 -0
  164. package/src/versions/operations.ts +230 -0
  165. package/src/versions/paths.ts +66 -0
  166. package/src/versions/timestamp.ts +48 -0
  167. package/src/versions/types.ts +91 -0
  168. package/dist/__tests__/animationUtils.test.d.ts +0 -2
  169. package/dist/__tests__/animationUtils.test.d.ts.map +0 -1
  170. package/dist/__tests__/animationUtils.test.js +0 -60
  171. package/dist/__tests__/animationUtils.test.js.map +0 -1
  172. package/dist/__tests__/contentContainer.test.d.ts +0 -2
  173. package/dist/__tests__/contentContainer.test.d.ts.map +0 -1
  174. package/dist/__tests__/contentContainer.test.js +0 -234
  175. package/dist/__tests__/contentContainer.test.js.map +0 -1
  176. package/dist/__tests__/contentExtractor.test.d.ts +0 -2
  177. package/dist/__tests__/contentExtractor.test.d.ts.map +0 -1
  178. package/dist/__tests__/contentExtractor.test.js +0 -151
  179. package/dist/__tests__/contentExtractor.test.js.map +0 -1
  180. package/dist/__tests__/coverBlock.test.d.ts +0 -2
  181. package/dist/__tests__/coverBlock.test.d.ts.map +0 -1
  182. package/dist/__tests__/coverBlock.test.js +0 -197
  183. package/dist/__tests__/coverBlock.test.js.map +0 -1
  184. package/dist/__tests__/dataTable.test.d.ts +0 -2
  185. package/dist/__tests__/dataTable.test.d.ts.map +0 -1
  186. package/dist/__tests__/dataTable.test.js +0 -110
  187. package/dist/__tests__/dataTable.test.js.map +0 -1
  188. package/dist/__tests__/geohash.test.d.ts +0 -2
  189. package/dist/__tests__/geohash.test.d.ts.map +0 -1
  190. package/dist/__tests__/geohash.test.js +0 -87
  191. package/dist/__tests__/geohash.test.js.map +0 -1
  192. package/dist/__tests__/getLayers.test.d.ts +0 -2
  193. package/dist/__tests__/getLayers.test.d.ts.map +0 -1
  194. package/dist/__tests__/getLayers.test.js +0 -167
  195. package/dist/__tests__/getLayers.test.js.map +0 -1
  196. package/dist/__tests__/haversine.test.d.ts +0 -2
  197. package/dist/__tests__/haversine.test.d.ts.map +0 -1
  198. package/dist/__tests__/haversine.test.js +0 -56
  199. package/dist/__tests__/haversine.test.js.map +0 -1
  200. package/dist/__tests__/localForageAdapter.test.d.ts +0 -8
  201. package/dist/__tests__/localForageAdapter.test.d.ts.map +0 -1
  202. package/dist/__tests__/localForageAdapter.test.js +0 -130
  203. package/dist/__tests__/localForageAdapter.test.js.map +0 -1
  204. package/dist/__tests__/markdown.test.d.ts +0 -2
  205. package/dist/__tests__/markdown.test.d.ts.map +0 -1
  206. package/dist/__tests__/markdown.test.js +0 -715
  207. package/dist/__tests__/markdown.test.js.map +0 -1
  208. package/dist/__tests__/markdownToDoc.test.d.ts +0 -2
  209. package/dist/__tests__/markdownToDoc.test.d.ts.map +0 -1
  210. package/dist/__tests__/markdownToDoc.test.js +0 -447
  211. package/dist/__tests__/markdownToDoc.test.js.map +0 -1
  212. package/dist/__tests__/seededRandom.test.d.ts +0 -2
  213. package/dist/__tests__/seededRandom.test.d.ts.map +0 -1
  214. package/dist/__tests__/seededRandom.test.js +0 -125
  215. package/dist/__tests__/seededRandom.test.js.map +0 -1
  216. package/dist/__tests__/slideshowGenerator.test.d.ts +0 -2
  217. package/dist/__tests__/slideshowGenerator.test.d.ts.map +0 -1
  218. package/dist/__tests__/slideshowGenerator.test.js +0 -114
  219. package/dist/__tests__/slideshowGenerator.test.js.map +0 -1
  220. package/dist/__tests__/storage.test.d.ts +0 -2
  221. package/dist/__tests__/storage.test.d.ts.map +0 -1
  222. package/dist/__tests__/storage.test.js +0 -51
  223. package/dist/__tests__/storage.test.js.map +0 -1
  224. package/dist/__tests__/surface.test.d.ts +0 -2
  225. package/dist/__tests__/surface.test.d.ts.map +0 -1
  226. package/dist/__tests__/surface.test.js +0 -57
  227. package/dist/__tests__/surface.test.js.map +0 -1
  228. package/dist/__tests__/templates.test.d.ts +0 -2
  229. package/dist/__tests__/templates.test.d.ts.map +0 -1
  230. package/dist/__tests__/templates.test.js +0 -217
  231. package/dist/__tests__/templates.test.js.map +0 -1
  232. package/dist/__tests__/timing.test.d.ts +0 -2
  233. package/dist/__tests__/timing.test.d.ts.map +0 -1
  234. package/dist/__tests__/timing.test.js +0 -131
  235. package/dist/__tests__/timing.test.js.map +0 -1
  236. package/dist/chunk-6BAVXFYC.js.map +0 -1
  237. package/dist/chunk-7GF6RDED.js +0 -82
  238. package/dist/chunk-7GF6RDED.js.map +0 -1
  239. package/dist/chunk-CYQHG27J.js.map +0 -1
  240. package/dist/chunk-F22AE6BY.js +0 -121
  241. package/dist/chunk-F22AE6BY.js.map +0 -1
  242. package/dist/chunk-FIQR4AJG.js +0 -517
  243. package/dist/chunk-FIQR4AJG.js.map +0 -1
  244. package/dist/chunk-OASJKWO5.js.map +0 -1
  245. package/dist/chunk-QM5PKNPW.js.map +0 -1
  246. package/dist/chunk-TSG2OSE6.js.map +0 -1
  247. package/dist/doc/audioMapping.d.ts +0 -36
  248. package/dist/doc/audioMapping.d.ts.map +0 -1
  249. package/dist/doc/audioMapping.js +0 -315
  250. package/dist/doc/audioMapping.js.map +0 -1
  251. package/dist/doc/docToMarkdown.d.ts +0 -41
  252. package/dist/doc/docToMarkdown.d.ts.map +0 -1
  253. package/dist/doc/docToMarkdown.js +0 -88
  254. package/dist/doc/docToMarkdown.js.map +0 -1
  255. package/dist/doc/getLayers.d.ts +0 -65
  256. package/dist/doc/getLayers.d.ts.map +0 -1
  257. package/dist/doc/getLayers.js +0 -103
  258. package/dist/doc/getLayers.js.map +0 -1
  259. package/dist/doc/index.d.ts.map +0 -1
  260. package/dist/doc/markdownToDoc.d.ts +0 -75
  261. package/dist/doc/markdownToDoc.d.ts.map +0 -1
  262. package/dist/doc/markdownToDoc.js +0 -398
  263. package/dist/doc/markdownToDoc.js.map +0 -1
  264. package/dist/doc/templates/accentImage.d.ts +0 -59
  265. package/dist/doc/templates/accentImage.d.ts.map +0 -1
  266. package/dist/doc/templates/accentImage.js +0 -275
  267. package/dist/doc/templates/accentImage.js.map +0 -1
  268. package/dist/doc/templates/captionUtils.d.ts +0 -20
  269. package/dist/doc/templates/captionUtils.d.ts.map +0 -1
  270. package/dist/doc/templates/captionUtils.js +0 -29
  271. package/dist/doc/templates/captionUtils.js.map +0 -1
  272. package/dist/doc/templates/comparisonBar.d.ts +0 -13
  273. package/dist/doc/templates/comparisonBar.d.ts.map +0 -1
  274. package/dist/doc/templates/comparisonBar.js +0 -145
  275. package/dist/doc/templates/comparisonBar.js.map +0 -1
  276. package/dist/doc/templates/coverBlock.d.ts +0 -51
  277. package/dist/doc/templates/coverBlock.d.ts.map +0 -1
  278. package/dist/doc/templates/coverBlock.js +0 -153
  279. package/dist/doc/templates/coverBlock.js.map +0 -1
  280. package/dist/doc/templates/dataTable.d.ts +0 -14
  281. package/dist/doc/templates/dataTable.d.ts.map +0 -1
  282. package/dist/doc/templates/dataTable.js +0 -73
  283. package/dist/doc/templates/dataTable.js.map +0 -1
  284. package/dist/doc/templates/dateEvent.d.ts +0 -15
  285. package/dist/doc/templates/dateEvent.d.ts.map +0 -1
  286. package/dist/doc/templates/dateEvent.js +0 -114
  287. package/dist/doc/templates/dateEvent.js.map +0 -1
  288. package/dist/doc/templates/definitionCard.d.ts +0 -13
  289. package/dist/doc/templates/definitionCard.d.ts.map +0 -1
  290. package/dist/doc/templates/definitionCard.js +0 -117
  291. package/dist/doc/templates/definitionCard.js.map +0 -1
  292. package/dist/doc/templates/factCard.d.ts +0 -15
  293. package/dist/doc/templates/factCard.d.ts.map +0 -1
  294. package/dist/doc/templates/factCard.js +0 -104
  295. package/dist/doc/templates/factCard.js.map +0 -1
  296. package/dist/doc/templates/fullBleedQuote.d.ts +0 -13
  297. package/dist/doc/templates/fullBleedQuote.d.ts.map +0 -1
  298. package/dist/doc/templates/fullBleedQuote.js +0 -55
  299. package/dist/doc/templates/fullBleedQuote.js.map +0 -1
  300. package/dist/doc/templates/imageWithCaption.d.ts +0 -13
  301. package/dist/doc/templates/imageWithCaption.d.ts.map +0 -1
  302. package/dist/doc/templates/imageWithCaption.js +0 -146
  303. package/dist/doc/templates/imageWithCaption.js.map +0 -1
  304. package/dist/doc/templates/index.d.ts +0 -105
  305. package/dist/doc/templates/index.d.ts.map +0 -1
  306. package/dist/doc/templates/index.js +0 -445
  307. package/dist/doc/templates/index.js.map +0 -1
  308. package/dist/doc/templates/listBlock.d.ts +0 -13
  309. package/dist/doc/templates/listBlock.d.ts.map +0 -1
  310. package/dist/doc/templates/listBlock.js +0 -92
  311. package/dist/doc/templates/listBlock.js.map +0 -1
  312. package/dist/doc/templates/mapBlock.d.ts +0 -17
  313. package/dist/doc/templates/mapBlock.d.ts.map +0 -1
  314. package/dist/doc/templates/mapBlock.js +0 -115
  315. package/dist/doc/templates/mapBlock.js.map +0 -1
  316. package/dist/doc/templates/persistentLayers.d.ts +0 -39
  317. package/dist/doc/templates/persistentLayers.d.ts.map +0 -1
  318. package/dist/doc/templates/persistentLayers.js +0 -447
  319. package/dist/doc/templates/persistentLayers.js.map +0 -1
  320. package/dist/doc/templates/photoGrid.d.ts +0 -20
  321. package/dist/doc/templates/photoGrid.d.ts.map +0 -1
  322. package/dist/doc/templates/photoGrid.js +0 -175
  323. package/dist/doc/templates/photoGrid.js.map +0 -1
  324. package/dist/doc/templates/pullQuote.d.ts +0 -13
  325. package/dist/doc/templates/pullQuote.d.ts.map +0 -1
  326. package/dist/doc/templates/pullQuote.js +0 -113
  327. package/dist/doc/templates/pullQuote.js.map +0 -1
  328. package/dist/doc/templates/quoteBlock.d.ts +0 -15
  329. package/dist/doc/templates/quoteBlock.d.ts.map +0 -1
  330. package/dist/doc/templates/quoteBlock.js +0 -101
  331. package/dist/doc/templates/quoteBlock.js.map +0 -1
  332. package/dist/doc/templates/sectionHeader.d.ts +0 -14
  333. package/dist/doc/templates/sectionHeader.d.ts.map +0 -1
  334. package/dist/doc/templates/sectionHeader.js +0 -97
  335. package/dist/doc/templates/sectionHeader.js.map +0 -1
  336. package/dist/doc/templates/statHighlight.d.ts +0 -15
  337. package/dist/doc/templates/statHighlight.d.ts.map +0 -1
  338. package/dist/doc/templates/statHighlight.js +0 -102
  339. package/dist/doc/templates/statHighlight.js.map +0 -1
  340. package/dist/doc/templates/titleBlock.d.ts +0 -13
  341. package/dist/doc/templates/titleBlock.d.ts.map +0 -1
  342. package/dist/doc/templates/titleBlock.js +0 -95
  343. package/dist/doc/templates/titleBlock.js.map +0 -1
  344. package/dist/doc/templates/twoColumn.d.ts +0 -15
  345. package/dist/doc/templates/twoColumn.d.ts.map +0 -1
  346. package/dist/doc/templates/twoColumn.js +0 -225
  347. package/dist/doc/templates/twoColumn.js.map +0 -1
  348. package/dist/doc/templates/videoPullQuote.d.ts +0 -20
  349. package/dist/doc/templates/videoPullQuote.d.ts.map +0 -1
  350. package/dist/doc/templates/videoPullQuote.js +0 -122
  351. package/dist/doc/templates/videoPullQuote.js.map +0 -1
  352. package/dist/doc/templates/videoWithCaption.d.ts +0 -20
  353. package/dist/doc/templates/videoWithCaption.d.ts.map +0 -1
  354. package/dist/doc/templates/videoWithCaption.js +0 -107
  355. package/dist/doc/templates/videoWithCaption.js.map +0 -1
  356. package/dist/doc/utils/animationUtils.d.ts +0 -34
  357. package/dist/doc/utils/animationUtils.d.ts.map +0 -1
  358. package/dist/doc/utils/animationUtils.js +0 -110
  359. package/dist/doc/utils/animationUtils.js.map +0 -1
  360. package/dist/doc/utils/themeUtils.d.ts +0 -64
  361. package/dist/doc/utils/themeUtils.d.ts.map +0 -1
  362. package/dist/doc/utils/themeUtils.js +0 -135
  363. package/dist/doc/utils/themeUtils.js.map +0 -1
  364. package/dist/generate/contentExtractor.d.ts +0 -112
  365. package/dist/generate/contentExtractor.d.ts.map +0 -1
  366. package/dist/generate/contentExtractor.js +0 -638
  367. package/dist/generate/contentExtractor.js.map +0 -1
  368. package/dist/generate/index.d.ts.map +0 -1
  369. package/dist/generate/slideshowGenerator.d.ts +0 -72
  370. package/dist/generate/slideshowGenerator.d.ts.map +0 -1
  371. package/dist/generate/slideshowGenerator.js +0 -159
  372. package/dist/generate/slideshowGenerator.js.map +0 -1
  373. package/dist/generate/templateMapper.d.ts +0 -23
  374. package/dist/generate/templateMapper.d.ts.map +0 -1
  375. package/dist/generate/templateMapper.js +0 -114
  376. package/dist/generate/templateMapper.js.map +0 -1
  377. package/dist/index.d.ts.map +0 -1
  378. package/dist/markdown/convert.d.ts +0 -71
  379. package/dist/markdown/convert.d.ts.map +0 -1
  380. package/dist/markdown/convert.js +0 -845
  381. package/dist/markdown/convert.js.map +0 -1
  382. package/dist/markdown/htmlParse.d.ts +0 -26
  383. package/dist/markdown/htmlParse.d.ts.map +0 -1
  384. package/dist/markdown/htmlParse.js +0 -195
  385. package/dist/markdown/htmlParse.js.map +0 -1
  386. package/dist/markdown/index.d.ts.map +0 -1
  387. package/dist/markdown/parse.d.ts +0 -27
  388. package/dist/markdown/parse.d.ts.map +0 -1
  389. package/dist/markdown/parse.js +0 -90
  390. package/dist/markdown/parse.js.map +0 -1
  391. package/dist/markdown/stringify.d.ts +0 -32
  392. package/dist/markdown/stringify.d.ts.map +0 -1
  393. package/dist/markdown/stringify.js +0 -108
  394. package/dist/markdown/stringify.js.map +0 -1
  395. package/dist/markdown/types.d.ts +0 -516
  396. package/dist/markdown/types.d.ts.map +0 -1
  397. package/dist/markdown/types.js +0 -17
  398. package/dist/markdown/types.js.map +0 -1
  399. package/dist/markdown/utils.d.ts +0 -78
  400. package/dist/markdown/utils.d.ts.map +0 -1
  401. package/dist/markdown/utils.js +0 -153
  402. package/dist/markdown/utils.js.map +0 -1
  403. package/dist/random/SeededRandom.d.ts +0 -50
  404. package/dist/random/SeededRandom.d.ts.map +0 -1
  405. package/dist/random/SeededRandom.js +0 -115
  406. package/dist/random/SeededRandom.js.map +0 -1
  407. package/dist/random/index.d.ts.map +0 -1
  408. package/dist/schemas/BlockTemplates.d.ts +0 -600
  409. package/dist/schemas/BlockTemplates.d.ts.map +0 -1
  410. package/dist/schemas/BlockTemplates.js +0 -72
  411. package/dist/schemas/BlockTemplates.js.map +0 -1
  412. package/dist/schemas/Doc.d.ts +0 -503
  413. package/dist/schemas/Doc.d.ts.map +0 -1
  414. package/dist/schemas/Doc.js +0 -90
  415. package/dist/schemas/Doc.js.map +0 -1
  416. package/dist/schemas/LayoutStrategy.d.ts +0 -84
  417. package/dist/schemas/LayoutStrategy.d.ts.map +0 -1
  418. package/dist/schemas/LayoutStrategy.js +0 -123
  419. package/dist/schemas/LayoutStrategy.js.map +0 -1
  420. package/dist/schemas/MediaProvider.d.ts +0 -65
  421. package/dist/schemas/MediaProvider.d.ts.map +0 -1
  422. package/dist/schemas/MediaProvider.js +0 -13
  423. package/dist/schemas/MediaProvider.js.map +0 -1
  424. package/dist/schemas/Theme.d.ts +0 -194
  425. package/dist/schemas/Theme.d.ts.map +0 -1
  426. package/dist/schemas/Theme.js +0 -97
  427. package/dist/schemas/Theme.js.map +0 -1
  428. package/dist/schemas/Types.d.ts +0 -14
  429. package/dist/schemas/Types.d.ts.map +0 -1
  430. package/dist/schemas/Types.js +0 -5
  431. package/dist/schemas/Types.js.map +0 -1
  432. package/dist/schemas/Viewport.d.ts +0 -74
  433. package/dist/schemas/Viewport.d.ts.map +0 -1
  434. package/dist/schemas/Viewport.js +0 -63
  435. package/dist/schemas/Viewport.js.map +0 -1
  436. package/dist/schemas/index.d.ts.map +0 -1
  437. package/dist/schemas/themeLibrary.d.ts +0 -41
  438. package/dist/schemas/themeLibrary.d.ts.map +0 -1
  439. package/dist/schemas/themeLibrary.js +0 -597
  440. package/dist/schemas/themeLibrary.js.map +0 -1
  441. package/dist/spatial/Geohash.d.ts +0 -85
  442. package/dist/spatial/Geohash.d.ts.map +0 -1
  443. package/dist/spatial/Geohash.js +0 -142
  444. package/dist/spatial/Geohash.js.map +0 -1
  445. package/dist/spatial/Haversine.d.ts +0 -24
  446. package/dist/spatial/Haversine.d.ts.map +0 -1
  447. package/dist/spatial/Haversine.js +0 -48
  448. package/dist/spatial/Haversine.js.map +0 -1
  449. package/dist/spatial/index.d.ts.map +0 -1
  450. package/dist/storage/ContentContainer.d.ts +0 -87
  451. package/dist/storage/ContentContainer.d.ts.map +0 -1
  452. package/dist/storage/ContentContainer.js +0 -131
  453. package/dist/storage/ContentContainer.js.map +0 -1
  454. package/dist/storage/LocalForageAdapter.d.ts +0 -36
  455. package/dist/storage/LocalForageAdapter.d.ts.map +0 -1
  456. package/dist/storage/LocalForageAdapter.js +0 -82
  457. package/dist/storage/LocalForageAdapter.js.map +0 -1
  458. package/dist/storage/LocalStorageAdapter.d.ts +0 -16
  459. package/dist/storage/LocalStorageAdapter.d.ts.map +0 -1
  460. package/dist/storage/LocalStorageAdapter.js +0 -50
  461. package/dist/storage/LocalStorageAdapter.js.map +0 -1
  462. package/dist/storage/MediaProviderFromContainer.d.ts +0 -21
  463. package/dist/storage/MediaProviderFromContainer.d.ts.map +0 -1
  464. package/dist/storage/MediaProviderFromContainer.js +0 -79
  465. package/dist/storage/MediaProviderFromContainer.js.map +0 -1
  466. package/dist/storage/MemoryStorageAdapter.d.ts +0 -15
  467. package/dist/storage/MemoryStorageAdapter.d.ts.map +0 -1
  468. package/dist/storage/MemoryStorageAdapter.js +0 -34
  469. package/dist/storage/MemoryStorageAdapter.js.map +0 -1
  470. package/dist/storage/Storage.d.ts +0 -23
  471. package/dist/storage/Storage.d.ts.map +0 -1
  472. package/dist/storage/Storage.js +0 -9
  473. package/dist/storage/Storage.js.map +0 -1
  474. package/dist/storage/index.d.ts.map +0 -1
  475. package/dist/themeLibrary-CEo2D4b6.d.ts +0 -44
  476. package/dist/timing/index.d.ts.map +0 -1
  477. package/dist/timing/narrationTiming.d.ts +0 -54
  478. package/dist/timing/narrationTiming.d.ts.map +0 -1
  479. package/dist/timing/narrationTiming.js +0 -190
  480. package/dist/timing/narrationTiming.js.map +0 -1
  481. package/dist/timing/readingTime.d.ts +0 -54
  482. package/dist/timing/readingTime.d.ts.map +0 -1
  483. package/dist/timing/readingTime.js +0 -49
  484. package/dist/timing/readingTime.js.map +0 -1
  485. package/dist/transform/applyTransform.d.ts +0 -22
  486. package/dist/transform/applyTransform.d.ts.map +0 -1
  487. package/dist/transform/applyTransform.js +0 -68
  488. package/dist/transform/applyTransform.js.map +0 -1
  489. package/dist/transform/blockAnalyzer.d.ts +0 -48
  490. package/dist/transform/blockAnalyzer.d.ts.map +0 -1
  491. package/dist/transform/blockAnalyzer.js +0 -135
  492. package/dist/transform/blockAnalyzer.js.map +0 -1
  493. package/dist/transform/index.d.ts.map +0 -1
  494. package/dist/transform/registry.d.ts +0 -19
  495. package/dist/transform/registry.d.ts.map +0 -1
  496. package/dist/transform/registry.js +0 -41
  497. package/dist/transform/registry.js.map +0 -1
  498. package/dist/transform/styles/dataDriven.d.ts +0 -4
  499. package/dist/transform/styles/dataDriven.d.ts.map +0 -1
  500. package/dist/transform/styles/dataDriven.js +0 -15
  501. package/dist/transform/styles/dataDriven.js.map +0 -1
  502. package/dist/transform/styles/documentary.d.ts +0 -4
  503. package/dist/transform/styles/documentary.d.ts.map +0 -1
  504. package/dist/transform/styles/documentary.js +0 -15
  505. package/dist/transform/styles/documentary.js.map +0 -1
  506. package/dist/transform/styles/index.d.ts +0 -6
  507. package/dist/transform/styles/index.d.ts.map +0 -1
  508. package/dist/transform/styles/index.js +0 -6
  509. package/dist/transform/styles/index.js.map +0 -1
  510. package/dist/transform/styles/magazine.d.ts +0 -4
  511. package/dist/transform/styles/magazine.d.ts.map +0 -1
  512. package/dist/transform/styles/magazine.js +0 -15
  513. package/dist/transform/styles/magazine.js.map +0 -1
  514. package/dist/transform/styles/minimal.d.ts +0 -4
  515. package/dist/transform/styles/minimal.d.ts.map +0 -1
  516. package/dist/transform/styles/minimal.js +0 -15
  517. package/dist/transform/styles/minimal.js.map +0 -1
  518. package/dist/transform/styles/narrative.d.ts +0 -4
  519. package/dist/transform/styles/narrative.d.ts.map +0 -1
  520. package/dist/transform/styles/narrative.js +0 -15
  521. package/dist/transform/styles/narrative.js.map +0 -1
  522. package/dist/transform/templateSelector.d.ts +0 -30
  523. package/dist/transform/templateSelector.d.ts.map +0 -1
  524. package/dist/transform/templateSelector.js +0 -218
  525. package/dist/transform/templateSelector.js.map +0 -1
  526. package/dist/transform/timingAllocator.d.ts +0 -21
  527. package/dist/transform/timingAllocator.d.ts.map +0 -1
  528. package/dist/transform/timingAllocator.js +0 -111
  529. package/dist/transform/timingAllocator.js.map +0 -1
  530. package/dist/transform/types.d.ts +0 -86
  531. package/dist/transform/types.d.ts.map +0 -1
  532. package/dist/transform/types.js +0 -9
  533. package/dist/transform/types.js.map +0 -1
@@ -0,0 +1,191 @@
1
+ /**
2
+ * JSON Form types — Squisq's hint vocabulary layered on JSON Schema.
3
+ *
4
+ * Hints live inline on a JSON Schema under a single `squisq` key. The
5
+ * schema remains a valid JSON Schema; the extra key is ignored by
6
+ * standard validators. Renderers consult the hints to pick a control
7
+ * and tune its presentation.
8
+ */
9
+ /**
10
+ * Every concrete control rendered by `<JsonView>` and `<JsonEditor>`.
11
+ *
12
+ * Auto-defaults pick one based on schema shape; hosts override via
13
+ * `squisq.control` when they want something specific (e.g. radio over
14
+ * segmented for a long, descriptive enum).
15
+ */
16
+ type ControlKind = 'text' | 'multiline' | 'richtext' | 'color' | 'date' | 'time' | 'datetime' | 'slider' | 'stepper' | 'segmented' | 'radio' | 'combobox' | 'toggle' | 'checkbox' | 'card' | 'card-stack' | 'chip-bin' | 'tabs' | 'group';
17
+ /**
18
+ * Conditional rule: looked up by field path against the root data and
19
+ * compared with one of the operators. The first defined operator wins
20
+ * (in declaration order: equals, oneOf, matches, truthy).
21
+ */
22
+ interface SquisqWhen {
23
+ /**
24
+ * Path to the controlling field, relative to the root data.
25
+ * Accepts dotted-path (`user.role`) or JSON Pointer (`/user/role`).
26
+ */
27
+ field: string;
28
+ equals?: unknown;
29
+ oneOf?: readonly unknown[];
30
+ /** ECMAScript regex source; matched against the string value. */
31
+ matches?: string;
32
+ /** When true, condition holds if value is truthy; when false, if falsy. */
33
+ truthy?: boolean;
34
+ }
35
+ /**
36
+ * Hints for a single schema node. Attach via `squisq` on any JSON
37
+ * Schema object — properties, items, the root, or sub-schemas inside
38
+ * `oneOf`/`anyOf`.
39
+ */
40
+ interface SquisqHints {
41
+ /** Force a specific control. If omitted, picked from type/format/enum cardinality. */
42
+ control?: ControlKind;
43
+ /** Override schema `title` for display. */
44
+ label?: string;
45
+ /** Override schema `description` for the inline helper text. */
46
+ help?: string;
47
+ /** Placeholder text for empty fields. */
48
+ placeholder?: string;
49
+ /** Suggested layout sizing in a parent grid. Renderers may ignore on narrow viewports. */
50
+ width?: 'full' | 'half' | 'third' | 'auto';
51
+ /** Hide the field — literal, or a `SquisqWhen` evaluated against root data. */
52
+ hidden?: boolean | SquisqWhen;
53
+ /** Disable the field — literal, or a `SquisqWhen` evaluated against root data. */
54
+ disabled?: boolean | SquisqWhen;
55
+ /** Override schema's required-ness for the UI only. */
56
+ required?: boolean;
57
+ /** For arrays of objects: how to label each card in a `card-stack`. */
58
+ itemLabel?: string | {
59
+ fromField: string;
60
+ };
61
+ /** Label for the "+ Add" button on arrays. */
62
+ addLabel?: string;
63
+ /** Label for the remove button on arrays. */
64
+ removeLabel?: string;
65
+ /** Slider/stepper visual step. Falls back to schema `multipleOf`. */
66
+ step?: number;
67
+ /** Optional human-readable labels for enum values. */
68
+ enumLabels?: Record<string, string>;
69
+ }
70
+ /**
71
+ * The subset of JSON Schema we understand, with an optional `squisq`
72
+ * key. We deliberately keep this as a structural type so any JSON
73
+ * Schema authored elsewhere can be passed in without conversion.
74
+ */
75
+ interface SquisqAnnotatedSchema {
76
+ type?: string | readonly string[];
77
+ format?: string;
78
+ title?: string;
79
+ description?: string;
80
+ default?: unknown;
81
+ examples?: readonly unknown[];
82
+ enum?: readonly unknown[];
83
+ const?: unknown;
84
+ properties?: Record<string, SquisqAnnotatedSchema>;
85
+ required?: readonly string[];
86
+ additionalProperties?: boolean | SquisqAnnotatedSchema;
87
+ items?: SquisqAnnotatedSchema | readonly SquisqAnnotatedSchema[];
88
+ minItems?: number;
89
+ maxItems?: number;
90
+ minimum?: number;
91
+ maximum?: number;
92
+ exclusiveMinimum?: number;
93
+ exclusiveMaximum?: number;
94
+ multipleOf?: number;
95
+ minLength?: number;
96
+ maxLength?: number;
97
+ pattern?: string;
98
+ oneOf?: readonly SquisqAnnotatedSchema[];
99
+ anyOf?: readonly SquisqAnnotatedSchema[];
100
+ allOf?: readonly SquisqAnnotatedSchema[];
101
+ $ref?: string;
102
+ $defs?: Record<string, SquisqAnnotatedSchema>;
103
+ definitions?: Record<string, SquisqAnnotatedSchema>;
104
+ squisq?: SquisqHints;
105
+ }
106
+ /**
107
+ * A validation error reported by the consumer-supplied `validate` prop.
108
+ * Matches the shape of common validators (ajv, etc.) without depending
109
+ * on any specific one.
110
+ */
111
+ interface JsonFormValidationError {
112
+ /** JSON Pointer to the failing value, e.g. `/sections/0/heading`. */
113
+ path: string;
114
+ /** Human-readable message. */
115
+ message: string;
116
+ /** Optional schema keyword that failed (e.g. "required", "minimum"). */
117
+ keyword?: string;
118
+ }
119
+ type JsonFormValidator = (value: unknown, schema: SquisqAnnotatedSchema) => readonly JsonFormValidationError[];
120
+
121
+ /**
122
+ * Pick a `ControlKind` for a schema node. The single dispatcher used by
123
+ * both `<JsonView>` and `<JsonEditor>` so view and edit modes always
124
+ * agree on what each field _is_, even when their UIs differ.
125
+ *
126
+ * Order of precedence:
127
+ * 1. Explicit `squisq.control` hint
128
+ * 2. `format` keyword (color/date/time/datetime/markdown/textarea)
129
+ * 3. Enum cardinality (segmented vs. combobox)
130
+ * 4. Numeric range (slider when both min and max present)
131
+ * 5. String length (multiline when maxLength > 200)
132
+ * 6. Type-default (object/array/boolean/string/number)
133
+ */
134
+
135
+ declare function chooseControl(schema: SquisqAnnotatedSchema): ControlKind;
136
+ /** Return the first concrete type of a schema, ignoring `null` for nullable shorthand. */
137
+ declare function primaryType(schema: SquisqAnnotatedSchema): string | undefined;
138
+ /** Inspect `items` to decide whether an array holds objects or primitives. */
139
+ declare function arrayItemKind(schema: SquisqAnnotatedSchema): 'object' | 'primitive';
140
+
141
+ /**
142
+ * Evaluate a `SquisqWhen` rule against the current root data. Pure;
143
+ * renderers call this on every render with fresh data.
144
+ */
145
+
146
+ declare function evaluateWhen(when: SquisqWhen, rootData: unknown): boolean;
147
+ /**
148
+ * Resolve a `boolean | SquisqWhen` flag (used by `hidden`/`disabled`)
149
+ * to a final boolean. Literal booleans pass through.
150
+ */
151
+ declare function resolveFlag(flag: boolean | SquisqWhen | undefined, rootData: unknown): boolean;
152
+
153
+ /**
154
+ * JSON Pointer helpers (RFC 6901) plus immutable get/set, plus a tiny
155
+ * dotted-path normalizer so hosts can write `user.role` instead of
156
+ * `/user/role`. `$ref` resolution is local-only (`#/$defs/Foo`).
157
+ */
158
+
159
+ /** Normalize a path to a JSON Pointer string. Accepts both forms. */
160
+ declare function toPointer(path: string): string;
161
+ /** Split a JSON Pointer into decoded segments. Empty string → []. */
162
+ declare function pointerSegments(pointer: string): string[];
163
+ /** Read a value from data by path (dotted or pointer). Returns undefined if missing. */
164
+ declare function getByPointer(data: unknown, path: string): unknown;
165
+ /**
166
+ * Return a structurally-shared copy of `data` with the value at `path`
167
+ * replaced. Intermediate objects/arrays are cloned along the path; the
168
+ * rest is shared by reference. Creates intermediate objects if missing.
169
+ */
170
+ declare function setByPointer<T>(data: T, path: string, value: unknown): T;
171
+ /**
172
+ * Resolve a local `$ref` (e.g. `#/$defs/Foo`) against the root schema.
173
+ * Returns the original schema if no `$ref` is present, or `undefined`
174
+ * if the reference cannot be resolved. Cross-document refs are not
175
+ * supported.
176
+ */
177
+ declare function resolveRef(schema: SquisqAnnotatedSchema, root: SquisqAnnotatedSchema): SquisqAnnotatedSchema | undefined;
178
+
179
+ /**
180
+ * Infer a JSON Schema from an example JSON value. Thin facade over
181
+ * `genson-js` so consumers don't depend on it directly and we can swap
182
+ * the implementation later.
183
+ */
184
+
185
+ interface InferSchemaOptions {
186
+ /** Additional samples merged into the inferred schema for broader coverage. */
187
+ additionalSamples?: readonly unknown[];
188
+ }
189
+ declare function inferSchema(sample: unknown, options?: InferSchemaOptions): SquisqAnnotatedSchema;
190
+
191
+ export { type ControlKind, type InferSchemaOptions, type JsonFormValidationError, type JsonFormValidator, type SquisqAnnotatedSchema, type SquisqHints, type SquisqWhen, arrayItemKind, chooseControl, evaluateWhen, getByPointer, inferSchema, pointerSegments, primaryType, resolveFlag, resolveRef, setByPointer, toPointer };
@@ -0,0 +1,27 @@
1
+ import {
2
+ arrayItemKind,
3
+ chooseControl,
4
+ evaluateWhen,
5
+ getByPointer,
6
+ inferSchema,
7
+ pointerSegments,
8
+ primaryType,
9
+ resolveFlag,
10
+ resolveRef,
11
+ setByPointer,
12
+ toPointer
13
+ } from "../chunk-K32VJONL.js";
14
+ export {
15
+ arrayItemKind,
16
+ chooseControl,
17
+ evaluateWhen,
18
+ getByPointer,
19
+ inferSchema,
20
+ pointerSegments,
21
+ primaryType,
22
+ resolveFlag,
23
+ resolveRef,
24
+ setByPointer,
25
+ toPointer
26
+ };
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,31 +1,277 @@
1
+ import { T as ParseOptions, l as MarkdownDocument, U as StringifyOptions, c as HtmlNode, F as MarkdownNode } from '../types-BdZkdJ3z.js';
2
+ export { H as HeadingTemplateAnnotation, a as HtmlComment, b as HtmlElement, d as HtmlText, M as MarkdownBlockNode, e as MarkdownBlockquote, f as MarkdownBreak, g as MarkdownCodeBlock, h as MarkdownContainerDirective, i as MarkdownDefinitionDescription, j as MarkdownDefinitionList, k as MarkdownDefinitionTerm, m as MarkdownEmphasis, n as MarkdownFootnoteDefinition, o as MarkdownFootnoteReference, p as MarkdownHeading, q as MarkdownHtmlBlock, r as MarkdownImage, s as MarkdownImageReference, t as MarkdownInlineCode, u as MarkdownInlineHtml, v as MarkdownInlineMath, w as MarkdownInlineNode, x as MarkdownLeafDirective, y as MarkdownLink, z as MarkdownLinkDefinition, A as MarkdownLinkReference, B as MarkdownList, C as MarkdownListItem, D as MarkdownMathBlock, E as MarkdownMention, G as MarkdownParagraph, I as MarkdownPoint, J as MarkdownSourcePosition, K as MarkdownStrikethrough, L as MarkdownStrong, N as MarkdownTable, O as MarkdownTableCell, P as MarkdownTableRow, Q as MarkdownText, R as MarkdownTextDirective, S as MarkdownThematicBreak } from '../types-BdZkdJ3z.js';
3
+
1
4
  /**
2
- * @bendyline/squisq Markdown Module
5
+ * Markdown → JSON Parser
3
6
  *
4
- * Provides a complete JSON representation of markdown documents with
5
- * perfect-fidelity round-trip conversion (markdown JSON).
7
+ * Parses a markdown string into a MarkdownDocument JSON structure
8
+ * using the unified/remark ecosystem with GFM, math, and directive extensions.
9
+ */
10
+
11
+ /**
12
+ * Parse a markdown string into a MarkdownDocument.
13
+ *
14
+ * All extensions (GFM, math, directives) are enabled by default.
15
+ * Use the `options` parameter to disable specific extensions.
6
16
  *
7
- * Supports CommonMark + GFM (tables, strikethrough, task lists, footnotes) +
8
- * math ($...$, $$...$$) + directives (:::container, ::leaf, :text).
9
- * Raw HTML is parsed into a structured HtmlNode sub-DOM.
17
+ * @param markdown - The markdown source text
18
+ * @param options - Parser options (extensions, HTML parsing)
19
+ * @returns A MarkdownDocument representing the parsed markdown
10
20
  *
11
21
  * @example
12
22
  * ```ts
13
- * import { parseMarkdown, stringifyMarkdown } from '@bendyline/squisq/markdown';
14
- *
15
- * // Parse markdown to JSON
16
23
  * const doc = parseMarkdown('# Hello\n\nWorld **bold** and *italic*');
24
+ * // doc.type === 'document'
25
+ * // doc.children[0].type === 'heading'
26
+ * // doc.children[1].type === 'paragraph'
27
+ * ```
28
+ */
29
+ declare function parseMarkdown(markdown: string, options?: ParseOptions): MarkdownDocument;
30
+
31
+ /**
32
+ * JSON → Markdown Serializer
33
+ *
34
+ * Converts a MarkdownDocument JSON structure back to a markdown string
35
+ * using the unified/remark ecosystem with GFM, math, and directive extensions.
36
+ */
37
+
38
+ /**
39
+ * Serialize a MarkdownDocument back to a markdown string.
17
40
  *
18
- * // Inspect the tree
19
- * console.log(doc.children[0].type); // 'heading'
41
+ * All extensions (GFM, math, directives) are enabled by default.
42
+ * Use the `options` parameter to control formatting and disable extensions.
20
43
  *
21
- * // Serialize back to markdown
44
+ * @param doc - The MarkdownDocument to serialize
45
+ * @param options - Serialization options (formatting, extensions)
46
+ * @returns A markdown string
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const doc: MarkdownDocument = {
51
+ * type: 'document',
52
+ * children: [
53
+ * { type: 'heading', depth: 1, children: [{ type: 'text', value: 'Hello' }] },
54
+ * { type: 'paragraph', children: [{ type: 'text', value: 'World' }] },
55
+ * ],
56
+ * };
22
57
  * const md = stringifyMarkdown(doc);
58
+ * // '# Hello\n\nWorld\n'
23
59
  * ```
24
60
  */
25
- export type { MarkdownPoint, MarkdownSourcePosition, HeadingTemplateAnnotation, HtmlElement, HtmlText, HtmlComment, HtmlNode, MarkdownDocument, MarkdownHeading, MarkdownParagraph, MarkdownBlockquote, MarkdownList, MarkdownListItem, MarkdownCodeBlock, MarkdownThematicBreak, MarkdownTable, MarkdownTableRow, MarkdownTableCell, MarkdownHtmlBlock, MarkdownMathBlock, MarkdownLinkDefinition, MarkdownFootnoteDefinition, MarkdownContainerDirective, MarkdownLeafDirective, MarkdownDefinitionList, MarkdownDefinitionTerm, MarkdownDefinitionDescription, MarkdownText, MarkdownEmphasis, MarkdownStrong, MarkdownStrikethrough, MarkdownInlineCode, MarkdownLink, MarkdownImage, MarkdownBreak, MarkdownInlineHtml, MarkdownInlineMath, MarkdownFootnoteReference, MarkdownLinkReference, MarkdownImageReference, MarkdownTextDirective, MarkdownMention, MarkdownBlockNode, MarkdownInlineNode, MarkdownNode, ParseOptions, StringifyOptions, } from './types.js';
26
- export { parseMarkdown } from './parse.js';
27
- export { stringifyMarkdown } from './stringify.js';
28
- export { fromMdast, toMdast } from './convert.js';
29
- export { parseHtmlToNodes, stringifyHtmlNodes } from './htmlParse.js';
30
- export { getChildren, walkMarkdownTree, findNodesByType, extractPlainText, countNodes, createDocument, parseFrontmatter, } from './utils.js';
31
- //# sourceMappingURL=index.d.ts.map
61
+ declare function stringifyMarkdown(doc: MarkdownDocument, options?: StringifyOptions): string;
62
+
63
+ /**
64
+ * mdast Squisq Markdown Node Conversion
65
+ *
66
+ * Converts between the remark/mdast AST format and the squisq
67
+ * MarkdownDocument JSON format. This is the bridge layer that allows
68
+ * us to use the battle-tested unified/remark ecosystem for parsing
69
+ * and serialization while exposing our own clean, well-typed interfaces.
70
+ *
71
+ * The conversion is designed for perfect round-tripping:
72
+ * toMdast(fromMdast(tree)) should produce an equivalent mdast tree.
73
+ */
74
+
75
+ /**
76
+ * Minimal interface for mdast/unist nodes.
77
+ * Using a generic shape avoids hard dependency on @types/mdast
78
+ * and handles extension nodes (GFM, math, directive) uniformly.
79
+ */
80
+ interface MdastPosition {
81
+ start: {
82
+ line: number;
83
+ column: number;
84
+ offset?: number;
85
+ };
86
+ end: {
87
+ line: number;
88
+ column: number;
89
+ offset?: number;
90
+ };
91
+ }
92
+ interface MdastNode {
93
+ type: string;
94
+ position?: MdastPosition;
95
+ children?: MdastNode[];
96
+ value?: string;
97
+ depth?: number;
98
+ ordered?: boolean | null;
99
+ start?: number | null;
100
+ spread?: boolean | null;
101
+ checked?: boolean | null;
102
+ lang?: string | null;
103
+ meta?: string | null;
104
+ url?: string;
105
+ title?: string | null;
106
+ alt?: string;
107
+ identifier?: string;
108
+ label?: string;
109
+ referenceType?: string;
110
+ align?: (string | null)[];
111
+ name?: string;
112
+ attributes?: Record<string, string>;
113
+ data?: Record<string, unknown>;
114
+ }
115
+ /**
116
+ * Convert an mdast Root node to a MarkdownDocument.
117
+ *
118
+ * @param root - The mdast root node (from remark-parse)
119
+ * @param options - Conversion options
120
+ * @returns A MarkdownDocument
121
+ */
122
+ declare function fromMdast(root: MdastNode, options?: {
123
+ parseHtml?: boolean;
124
+ }): MarkdownDocument;
125
+ /**
126
+ * Convert a MarkdownDocument back to an mdast Root node.
127
+ *
128
+ * @param doc - A MarkdownDocument
129
+ * @returns An mdast Root node suitable for remark-stringify
130
+ */
131
+ declare function toMdast(doc: MarkdownDocument): MdastNode;
132
+
133
+ /**
134
+ * HTML ↔ HtmlNode Conversion
135
+ *
136
+ * Parses raw HTML strings into the squisq HtmlNode tree representation
137
+ * using hast-util-from-html (parse5-backed), and serializes HtmlNode trees
138
+ * back to HTML strings with a lightweight custom serializer.
139
+ */
140
+
141
+ /**
142
+ * Parse a raw HTML string into an HtmlNode[] tree.
143
+ *
144
+ * Uses the HTML5 parsing algorithm (via parse5) for correct handling of
145
+ * self-closing tags, optional end tags, entity decoding, etc.
146
+ *
147
+ * @param html - Raw HTML string to parse
148
+ * @returns Array of top-level HtmlNode elements
149
+ */
150
+ declare function parseHtmlToNodes(html: string): HtmlNode[];
151
+ /**
152
+ * Serialize an HtmlNode[] tree back to an HTML string.
153
+ *
154
+ * @param nodes - Array of HtmlNode elements to serialize
155
+ * @returns HTML string
156
+ */
157
+ declare function stringifyHtmlNodes(nodes: HtmlNode[]): string;
158
+
159
+ /**
160
+ * Markdown Tree Utilities
161
+ *
162
+ * Helper functions for traversing and querying the MarkdownDocument tree.
163
+ * All functions are pure and operate on the JSON node interfaces.
164
+ */
165
+
166
+ /**
167
+ * Get the children of any markdown node, if it has children.
168
+ * Returns an empty array for leaf nodes (text, code, break, etc.).
169
+ *
170
+ * This is useful for generic tree walking where you don't want to
171
+ * check the specific node type.
172
+ */
173
+ declare function getChildren(node: MarkdownNode): MarkdownNode[];
174
+ /**
175
+ * Walk the markdown tree depth-first, calling the visitor for each node.
176
+ *
177
+ * The visitor receives the current node and its parent. Return `true`
178
+ * from the visitor to skip the node's children (prune).
179
+ *
180
+ * @param node - The root node to start walking from
181
+ * @param visitor - Called for each node; return true to skip children
182
+ * @param parent - (internal) Parent node
183
+ */
184
+ declare function walkMarkdownTree(node: MarkdownNode, visitor: (node: MarkdownNode, parent?: MarkdownNode) => void | boolean, parent?: MarkdownNode): void;
185
+ /**
186
+ * Find all nodes of a specific type in the tree.
187
+ *
188
+ * @param root - The document or node to search within
189
+ * @param type - The node type to find (e.g., 'heading', 'link', 'text')
190
+ * @returns Array of matching nodes
191
+ *
192
+ * @example
193
+ * ```ts
194
+ * const headings = findNodesByType(doc, 'heading');
195
+ * const links = findNodesByType(doc, 'link');
196
+ * ```
197
+ */
198
+ declare function findNodesByType<T extends MarkdownNode>(root: MarkdownNode, type: T['type']): T[];
199
+ /**
200
+ * Extract all plain text content from a node and its descendants.
201
+ * Concatenates text values, ignoring formatting, links, etc.
202
+ *
203
+ * @param node - The node to extract text from
204
+ * @returns Plain text content
205
+ *
206
+ * @example
207
+ * ```ts
208
+ * const heading = doc.children[0]; // { type: 'heading', children: [{ type: 'text', value: 'Hello' }] }
209
+ * extractPlainText(heading); // 'Hello'
210
+ * ```
211
+ */
212
+ declare function extractPlainText(node: MarkdownNode): string;
213
+ /**
214
+ * Count the total number of nodes in the tree.
215
+ *
216
+ * @param node - The root node
217
+ * @returns Total node count (including the root)
218
+ */
219
+ declare function countNodes(node: MarkdownNode): number;
220
+ /**
221
+ * Parse a YAML frontmatter string into a key-value record.
222
+ *
223
+ * Handles simple `key: value` pairs common in markdown frontmatter.
224
+ * Values are trimmed; quoted strings have their quotes removed.
225
+ * Returns `null` if parsing fails or the input is empty.
226
+ *
227
+ * @param yaml - The raw YAML string (without the `---` delimiters)
228
+ * @returns A record of string keys to parsed values, or null
229
+ */
230
+ declare function parseFrontmatter(yaml: string): Record<string, unknown> | null;
231
+ /**
232
+ * Update a markdown source string's YAML frontmatter block, applying the
233
+ * given key/value updates. A `null` or `undefined` value removes the key.
234
+ * If no frontmatter block exists and any non-null update is supplied, a
235
+ * new block is prepended; if every update is a removal and no block
236
+ * exists, the source is returned unchanged.
237
+ *
238
+ * Existing key order is preserved; new keys are appended in the order
239
+ * they appear in `updates`. The simple parser used here handles plain
240
+ * `key: value` pairs only — comments, multi-line scalars, and nested
241
+ * structures are left untouched (we only rewrite lines whose key matches
242
+ * one in `updates`).
243
+ *
244
+ * @param source - The markdown source string.
245
+ * @param updates - Map of key → new value (or null/undefined to remove).
246
+ * @returns The updated markdown source string.
247
+ */
248
+ declare function setFrontmatterValues(source: string, updates: Record<string, string | number | boolean | null | undefined>): string;
249
+ /**
250
+ * Create a minimal MarkdownDocument from a list of block nodes.
251
+ * Convenience function for programmatic document construction.
252
+ */
253
+ declare function createDocument(...children: MarkdownDocument['children']): MarkdownDocument;
254
+ /**
255
+ * Infer a human-readable title for a markdown document.
256
+ *
257
+ * Resolution order:
258
+ * 1. `title:` value in YAML frontmatter (when present and non-empty)
259
+ * 2. Text of the first heading found, walking top-level depth (H1, then
260
+ * H2, etc.) — the shallowest heading wins regardless of source order
261
+ *
262
+ * Returns `undefined` when no usable title is found.
263
+ */
264
+ declare function inferDocumentTitle(doc: MarkdownDocument): string | undefined;
265
+ /**
266
+ * Read a theme id from a markdown document's frontmatter.
267
+ *
268
+ * Checks the editor's canonical `squisq-theme` key first, then the
269
+ * shorter legacy aliases (`themeId`, `theme`). Returns `undefined`
270
+ * when none of them carry a non-empty string. Centralizing the lookup
271
+ * keeps the export pipelines (DOCX, PPTX, HTML, plain-HTML bundle) in
272
+ * sync with whatever the editor writes — adding a new frontmatter
273
+ * spelling later is a one-file change.
274
+ */
275
+ declare function readFrontmatterThemeId(frontmatter: Record<string, unknown> | undefined): string | undefined;
276
+
277
+ export { HtmlNode, MarkdownDocument, MarkdownNode, ParseOptions, StringifyOptions, countNodes, createDocument, extractPlainText, findNodesByType, fromMdast, getChildren, inferDocumentTitle, parseFrontmatter, parseHtmlToNodes, parseMarkdown, readFrontmatterThemeId, setFrontmatterValues, stringifyHtmlNodes, stringifyMarkdown, toMdast, walkMarkdownTree };
@@ -1,34 +1,40 @@
1
- /**
2
- * @bendyline/squisq Markdown Module
3
- *
4
- * Provides a complete JSON representation of markdown documents with
5
- * perfect-fidelity round-trip conversion (markdown ↔ JSON).
6
- *
7
- * Supports CommonMark + GFM (tables, strikethrough, task lists, footnotes) +
8
- * math ($...$, $$...$$) + directives (:::container, ::leaf, :text).
9
- * Raw HTML is parsed into a structured HtmlNode sub-DOM.
10
- *
11
- * @example
12
- * ```ts
13
- * import { parseMarkdown, stringifyMarkdown } from '@bendyline/squisq/markdown';
14
- *
15
- * // Parse markdown to JSON
16
- * const doc = parseMarkdown('# Hello\n\nWorld **bold** and *italic*');
17
- *
18
- * // Inspect the tree
19
- * console.log(doc.children[0].type); // 'heading'
20
- *
21
- * // Serialize back to markdown
22
- * const md = stringifyMarkdown(doc);
23
- * ```
24
- */
25
- // Parser + serializer
26
- export { parseMarkdown } from './parse.js';
27
- export { stringifyMarkdown } from './stringify.js';
28
- // Conversion layer (for advanced use: working with remark plugins directly)
29
- export { fromMdast, toMdast } from './convert.js';
30
- // HTML sub-DOM utilities
31
- export { parseHtmlToNodes, stringifyHtmlNodes } from './htmlParse.js';
32
- // Tree utilities
33
- export { getChildren, walkMarkdownTree, findNodesByType, extractPlainText, countNodes, createDocument, parseFrontmatter, } from './utils.js';
1
+ import {
2
+ fromMdast,
3
+ parseHtmlToNodes,
4
+ parseMarkdown,
5
+ stringifyHtmlNodes,
6
+ stringifyMarkdown,
7
+ toMdast
8
+ } from "../chunk-3K5OG6KI.js";
9
+ import "../chunk-DBS6RIFL.js";
10
+ import {
11
+ countNodes,
12
+ createDocument,
13
+ extractPlainText,
14
+ findNodesByType,
15
+ getChildren,
16
+ inferDocumentTitle,
17
+ parseFrontmatter,
18
+ readFrontmatterThemeId,
19
+ setFrontmatterValues,
20
+ walkMarkdownTree
21
+ } from "../chunk-H3AXU4MJ.js";
22
+ export {
23
+ countNodes,
24
+ createDocument,
25
+ extractPlainText,
26
+ findNodesByType,
27
+ fromMdast,
28
+ getChildren,
29
+ inferDocumentTitle,
30
+ parseFrontmatter,
31
+ parseHtmlToNodes,
32
+ parseMarkdown,
33
+ readFrontmatterThemeId,
34
+ setFrontmatterValues,
35
+ stringifyHtmlNodes,
36
+ stringifyMarkdown,
37
+ toMdast,
38
+ walkMarkdownTree
39
+ };
34
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAoEH,sBAAsB;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,4EAA4E;AAC5E,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAElD,yBAAyB;AACzB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,iBAAiB;AACjB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,51 @@
1
- export { SeededRandom, hashString } from './SeededRandom.js';
2
- //# sourceMappingURL=index.d.ts.map
1
+ /**
2
+ * Seeded pseudo-random number generator (Mulberry32 algorithm).
3
+ *
4
+ * Provides deterministic, reproducible randomness from an integer seed.
5
+ * Useful for consistent slideshow generation, shuffling, and selection.
6
+ *
7
+ * ```ts
8
+ * const rng = new SeededRandom(42);
9
+ * rng.next(); // 0.0–1.0
10
+ * rng.nextInt(10); // 0–9
11
+ * rng.pick(['a', 'b']); // 'a' or 'b'
12
+ * ```
13
+ */
14
+ declare class SeededRandom {
15
+ private state;
16
+ constructor(seed: number);
17
+ /** Random float in [0, 1). */
18
+ next(): number;
19
+ /** Random integer in [0, max). */
20
+ nextInt(max: number): number;
21
+ /** Random integer in [min, max). */
22
+ nextIntRange(min: number, max: number): number;
23
+ /** Random boolean with given probability of `true` (default 0.5). */
24
+ nextBool(probability?: number): boolean;
25
+ /** Pick a random element, or `undefined` if array is empty. */
26
+ pick<T>(array: T[]): T | undefined;
27
+ /** Pick a random element; throws if empty. */
28
+ pickRequired<T>(array: T[]): T;
29
+ /** Pick `count` unique random elements (fewer if array is smaller). */
30
+ pickMultiple<T>(array: T[], count: number): T[];
31
+ /** Fisher-Yates shuffle **in place**. Returns the same array. */
32
+ shuffle<T>(array: T[]): T[];
33
+ /** Return a **new** shuffled copy. */
34
+ shuffled<T>(array: readonly T[]): T[];
35
+ /** Weighted random selection. Returns `undefined` if items is empty. */
36
+ pickWeighted<T>(items: {
37
+ item: T;
38
+ weight: number;
39
+ }[]): T | undefined;
40
+ /** Current internal state (for debugging / serialization). */
41
+ getState(): number;
42
+ /** Create an independent sub-stream keyed by a modifier. */
43
+ derive(modifier: string | number): SeededRandom;
44
+ }
45
+ /**
46
+ * Simple string → 32-bit hash (djb2 algorithm).
47
+ * Useful for turning a document ID into a numeric seed.
48
+ */
49
+ declare function hashString(str: string): number;
50
+
51
+ export { SeededRandom, hashString };
@@ -1,2 +1,10 @@
1
- export { SeededRandom, hashString } from './SeededRandom.js';
1
+ import "../chunk-V543AI2F.js";
2
+ import {
3
+ SeededRandom,
4
+ hashString
5
+ } from "../chunk-FVTQSNR7.js";
6
+ export {
7
+ SeededRandom,
8
+ hashString
9
+ };
2
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/random/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}