pulpweaver4 0.0.0-stage → 0.0.88

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 (1085) hide show
  1. package/dist/ast/djot.d.ts +123 -0
  2. package/dist/ast/djot.js +458 -0
  3. package/dist/ast/djot.js.map +1 -0
  4. package/dist/ast/index.d.ts +10 -0
  5. package/dist/ast/index.js +11 -0
  6. package/dist/ast/index.js.map +1 -0
  7. package/dist/ast/locator.d.ts +27 -0
  8. package/dist/ast/locator.js +77 -0
  9. package/dist/ast/locator.js.map +1 -0
  10. package/dist/ast/nodes.d.ts +534 -0
  11. package/dist/ast/nodes.js +48 -0
  12. package/dist/ast/nodes.js.map +1 -0
  13. package/dist/ast/position.d.ts +88 -0
  14. package/dist/ast/position.js +98 -0
  15. package/dist/ast/position.js.map +1 -0
  16. package/dist/ast/traverse.d.ts +12 -0
  17. package/dist/ast/traverse.js +37 -0
  18. package/dist/ast/traverse.js.map +1 -0
  19. package/dist/bibliography/biblatex.d.ts +13 -0
  20. package/dist/bibliography/biblatex.js +849 -0
  21. package/dist/bibliography/biblatex.js.map +1 -0
  22. package/dist/bibliography/bibtex.d.ts +39 -0
  23. package/dist/bibliography/bibtex.js +259 -0
  24. package/dist/bibliography/bibtex.js.map +1 -0
  25. package/dist/bibliography/csl.d.ts +9 -0
  26. package/dist/bibliography/csl.js +241 -0
  27. package/dist/bibliography/csl.js.map +1 -0
  28. package/dist/bibliography/dates.d.ts +33 -0
  29. package/dist/bibliography/dates.js +223 -0
  30. package/dist/bibliography/dates.js.map +1 -0
  31. package/dist/bibliography/index.d.ts +8 -0
  32. package/dist/bibliography/index.js +9 -0
  33. package/dist/bibliography/index.js.map +1 -0
  34. package/dist/bibliography/item.d.ts +142 -0
  35. package/dist/bibliography/item.js +181 -0
  36. package/dist/bibliography/item.js.map +1 -0
  37. package/dist/bibliography/latex.d.ts +21 -0
  38. package/dist/bibliography/latex.js +586 -0
  39. package/dist/bibliography/latex.js.map +1 -0
  40. package/dist/bibliography/names.d.ts +23 -0
  41. package/dist/bibliography/names.js +244 -0
  42. package/dist/bibliography/names.js.map +1 -0
  43. package/dist/bibliography/read.d.ts +24 -0
  44. package/dist/bibliography/read.js +50 -0
  45. package/dist/bibliography/read.js.map +1 -0
  46. package/dist/citations/book.d.ts +91 -0
  47. package/dist/citations/book.js +206 -0
  48. package/dist/citations/book.js.map +1 -0
  49. package/dist/citations/collect.d.ts +52 -0
  50. package/dist/citations/collect.js +125 -0
  51. package/dist/citations/collect.js.map +1 -0
  52. package/dist/citations/hast.d.ts +12 -0
  53. package/dist/citations/hast.js +49 -0
  54. package/dist/citations/hast.js.map +1 -0
  55. package/dist/citations/index.d.ts +14 -0
  56. package/dist/citations/index.js +15 -0
  57. package/dist/citations/index.js.map +1 -0
  58. package/dist/citations/lint.d.ts +70 -0
  59. package/dist/citations/lint.js +92 -0
  60. package/dist/citations/lint.js.map +1 -0
  61. package/dist/citations/notes.d.ts +11 -0
  62. package/dist/citations/notes.js +120 -0
  63. package/dist/citations/notes.js.map +1 -0
  64. package/dist/citations/positions.d.ts +34 -0
  65. package/dist/citations/positions.js +90 -0
  66. package/dist/citations/positions.js.map +1 -0
  67. package/dist/citations/project.d.ts +7 -0
  68. package/dist/citations/project.js +24 -0
  69. package/dist/citations/project.js.map +1 -0
  70. package/dist/colour/cmyk.d.ts +71 -0
  71. package/dist/colour/cmyk.js +210 -0
  72. package/dist/colour/cmyk.js.map +1 -0
  73. package/dist/colour/images.d.ts +36 -0
  74. package/dist/colour/images.js +106 -0
  75. package/dist/colour/images.js.map +1 -0
  76. package/dist/colour/index.d.ts +7 -0
  77. package/dist/colour/index.js +8 -0
  78. package/dist/colour/index.js.map +1 -0
  79. package/dist/colour/ink-limit.d.ts +68 -0
  80. package/dist/colour/ink-limit.js +109 -0
  81. package/dist/colour/ink-limit.js.map +1 -0
  82. package/dist/colour/intents.d.ts +135 -0
  83. package/dist/colour/intents.js +183 -0
  84. package/dist/colour/intents.js.map +1 -0
  85. package/dist/colour/lcms.d.ts +79 -0
  86. package/dist/colour/lcms.js +229 -0
  87. package/dist/colour/lcms.js.map +1 -0
  88. package/dist/colour/previews.d.ts +49 -0
  89. package/dist/colour/previews.js +116 -0
  90. package/dist/colour/previews.js.map +1 -0
  91. package/dist/colour/wasm/LICENSE-lcms2 +22 -0
  92. package/dist/colour/wasm/lcms2.wasm +0 -0
  93. package/dist/config/config.d.ts +109 -0
  94. package/dist/config/config.js +295 -0
  95. package/dist/config/config.js.map +1 -0
  96. package/dist/config/index.d.ts +6 -0
  97. package/dist/config/index.js +7 -0
  98. package/dist/config/index.js.map +1 -0
  99. package/dist/config/page.d.ts +42 -0
  100. package/dist/config/page.js +95 -0
  101. package/dist/config/page.js.map +1 -0
  102. package/dist/config/project-schema.d.ts +23 -0
  103. package/dist/config/project-schema.js +209 -0
  104. package/dist/config/project-schema.js.map +1 -0
  105. package/dist/config/schema.d.ts +68 -0
  106. package/dist/config/schema.js +333 -0
  107. package/dist/config/schema.js.map +1 -0
  108. package/dist/config/toml.d.ts +54 -0
  109. package/dist/config/toml.js +238 -0
  110. package/dist/config/toml.js.map +1 -0
  111. package/dist/contents/index.d.ts +8 -0
  112. package/dist/contents/index.js +9 -0
  113. package/dist/contents/index.js.map +1 -0
  114. package/dist/contents/transform.d.ts +64 -0
  115. package/dist/contents/transform.js +149 -0
  116. package/dist/contents/transform.js.map +1 -0
  117. package/dist/csl/affix.d.ts +16 -0
  118. package/dist/csl/affix.js +74 -0
  119. package/dist/csl/affix.js.map +1 -0
  120. package/dist/csl/data/chicago-author-date.d.ts +2 -0
  121. package/dist/csl/data/chicago-author-date.js +3 -0
  122. package/dist/csl/data/chicago-author-date.js.map +1 -0
  123. package/dist/csl/data/chicago-notes-bibliography.d.ts +2 -0
  124. package/dist/csl/data/chicago-notes-bibliography.js +3 -0
  125. package/dist/csl/data/chicago-notes-bibliography.js.map +1 -0
  126. package/dist/csl/data/locales-en-GB.d.ts +2 -0
  127. package/dist/csl/data/locales-en-GB.js +3 -0
  128. package/dist/csl/data/locales-en-GB.js.map +1 -0
  129. package/dist/csl/data/locales-en-US.d.ts +2 -0
  130. package/dist/csl/data/locales-en-US.js +3 -0
  131. package/dist/csl/data/locales-en-US.js.map +1 -0
  132. package/dist/csl/dates.d.ts +30 -0
  133. package/dist/csl/dates.js +223 -0
  134. package/dist/csl/dates.js.map +1 -0
  135. package/dist/csl/format.d.ts +29 -0
  136. package/dist/csl/format.js +157 -0
  137. package/dist/csl/format.js.map +1 -0
  138. package/dist/csl/index.d.ts +26 -0
  139. package/dist/csl/index.js +16 -0
  140. package/dist/csl/index.js.map +1 -0
  141. package/dist/csl/ir.d.ts +103 -0
  142. package/dist/csl/ir.js +549 -0
  143. package/dist/csl/ir.js.map +1 -0
  144. package/dist/csl/load.d.ts +98 -0
  145. package/dist/csl/load.js +163 -0
  146. package/dist/csl/load.js.map +1 -0
  147. package/dist/csl/locale.d.ts +90 -0
  148. package/dist/csl/locale.js +251 -0
  149. package/dist/csl/locale.js.map +1 -0
  150. package/dist/csl/names.d.ts +41 -0
  151. package/dist/csl/names.js +203 -0
  152. package/dist/csl/names.js.map +1 -0
  153. package/dist/csl/numbers.d.ts +48 -0
  154. package/dist/csl/numbers.js +170 -0
  155. package/dist/csl/numbers.js.map +1 -0
  156. package/dist/csl/processor.d.ts +177 -0
  157. package/dist/csl/processor.js +759 -0
  158. package/dist/csl/processor.js.map +1 -0
  159. package/dist/csl/project.d.ts +21 -0
  160. package/dist/csl/project.js +78 -0
  161. package/dist/csl/project.js.map +1 -0
  162. package/dist/csl/render.d.ts +130 -0
  163. package/dist/csl/render.js +748 -0
  164. package/dist/csl/render.js.map +1 -0
  165. package/dist/csl/style.d.ts +168 -0
  166. package/dist/csl/style.js +262 -0
  167. package/dist/csl/style.js.map +1 -0
  168. package/dist/csl/xml.d.ts +28 -0
  169. package/dist/csl/xml.js +162 -0
  170. package/dist/csl/xml.js.map +1 -0
  171. package/dist/djot/djot.js/LICENSE +20 -0
  172. package/dist/djot/djot.js/src/ast.d.ts +324 -0
  173. package/dist/djot/djot.js/src/ast.js +61 -0
  174. package/dist/djot/djot.js/src/ast.js.map +1 -0
  175. package/dist/djot/djot.js/src/attributes.d.ts +31 -0
  176. package/dist/djot/djot.js/src/attributes.js +300 -0
  177. package/dist/djot/djot.js/src/attributes.js.map +1 -0
  178. package/dist/djot/djot.js/src/block.d.ts +87 -0
  179. package/dist/djot/djot.js/src/block.js +1201 -0
  180. package/dist/djot/djot.js/src/block.js.map +1 -0
  181. package/dist/djot/djot.js/src/djot-renderer.d.ts +8 -0
  182. package/dist/djot/djot.js/src/djot-renderer.js +755 -0
  183. package/dist/djot/djot.js/src/djot-renderer.js.map +1 -0
  184. package/dist/djot/djot.js/src/event.d.ts +6 -0
  185. package/dist/djot/djot.js/src/event.js +2 -0
  186. package/dist/djot/djot.js/src/event.js.map +1 -0
  187. package/dist/djot/djot.js/src/filter.d.ts +13 -0
  188. package/dist/djot/djot.js/src/filter.js +159 -0
  189. package/dist/djot/djot.js/src/filter.js.map +1 -0
  190. package/dist/djot/djot.js/src/find.d.ts +7 -0
  191. package/dist/djot/djot.js/src/find.js +33 -0
  192. package/dist/djot/djot.js/src/find.js.map +1 -0
  193. package/dist/djot/djot.js/src/html.d.ts +40 -0
  194. package/dist/djot/djot.js/src/html.js +656 -0
  195. package/dist/djot/djot.js/src/html.js.map +1 -0
  196. package/dist/djot/djot.js/src/index.d.ts +9 -0
  197. package/dist/djot/djot.js/src/index.js +9 -0
  198. package/dist/djot/djot.js/src/index.js.map +1 -0
  199. package/dist/djot/djot.js/src/inline.d.ts +62 -0
  200. package/dist/djot/djot.js/src/inline.js +1019 -0
  201. package/dist/djot/djot.js/src/inline.js.map +1 -0
  202. package/dist/djot/djot.js/src/options.d.ts +13 -0
  203. package/dist/djot/djot.js/src/options.js +27 -0
  204. package/dist/djot/djot.js/src/options.js.map +1 -0
  205. package/dist/djot/djot.js/src/pandoc.d.ts +20 -0
  206. package/dist/djot/djot.js/src/pandoc.js +1040 -0
  207. package/dist/djot/djot.js/src/pandoc.js.map +1 -0
  208. package/dist/djot/djot.js/src/parse.d.ts +19 -0
  209. package/dist/djot/djot.js/src/parse.js +1436 -0
  210. package/dist/djot/djot.js/src/parse.js.map +1 -0
  211. package/dist/djot/djot.js/src/version.d.ts +1 -0
  212. package/dist/djot/djot.js/src/version.js +2 -0
  213. package/dist/djot/djot.js/src/version.js.map +1 -0
  214. package/dist/djot/index.d.ts +5 -0
  215. package/dist/djot/index.js +6 -0
  216. package/dist/djot/index.js.map +1 -0
  217. package/dist/djot/read.d.ts +57 -0
  218. package/dist/djot/read.js +146 -0
  219. package/dist/djot/read.js.map +1 -0
  220. package/dist/fonts/css.d.ts +82 -0
  221. package/dist/fonts/css.js +329 -0
  222. package/dist/fonts/css.js.map +1 -0
  223. package/dist/fonts/faces.d.ts +101 -0
  224. package/dist/fonts/faces.js +226 -0
  225. package/dist/fonts/faces.js.map +1 -0
  226. package/dist/fonts/index.d.ts +12 -0
  227. package/dist/fonts/index.js +13 -0
  228. package/dist/fonts/index.js.map +1 -0
  229. package/dist/fonts/lint.d.ts +58 -0
  230. package/dist/fonts/lint.js +209 -0
  231. package/dist/fonts/lint.js.map +1 -0
  232. package/dist/fonts/match.d.ts +36 -0
  233. package/dist/fonts/match.js +104 -0
  234. package/dist/fonts/match.js.map +1 -0
  235. package/dist/fonts/names.d.ts +9 -0
  236. package/dist/fonts/names.js +50 -0
  237. package/dist/fonts/names.js.map +1 -0
  238. package/dist/fonts/subset.d.ts +72 -0
  239. package/dist/fonts/subset.js +169 -0
  240. package/dist/fonts/subset.js.map +1 -0
  241. package/dist/fonts/walk.d.ts +33 -0
  242. package/dist/fonts/walk.js +120 -0
  243. package/dist/fonts/walk.js.map +1 -0
  244. package/dist/fonts/wasm/LICENSE-harfbuzzjs +19 -0
  245. package/dist/fonts/wasm/harfbuzz-subset.wasm +0 -0
  246. package/dist/html/check.d.ts +62 -0
  247. package/dist/html/check.js +186 -0
  248. package/dist/html/check.js.map +1 -0
  249. package/dist/html/counters.d.ts +32 -0
  250. package/dist/html/counters.js +72 -0
  251. package/dist/html/counters.js.map +1 -0
  252. package/dist/html/css.d.ts +33 -0
  253. package/dist/html/css.js +72 -0
  254. package/dist/html/css.js.map +1 -0
  255. package/dist/html/dom.d.ts +28 -0
  256. package/dist/html/dom.js +162 -0
  257. package/dist/html/dom.js.map +1 -0
  258. package/dist/html/editions.d.ts +26 -0
  259. package/dist/html/editions.js +57 -0
  260. package/dist/html/editions.js.map +1 -0
  261. package/dist/html/images.d.ts +13 -0
  262. package/dist/html/images.js +62 -0
  263. package/dist/html/images.js.map +1 -0
  264. package/dist/html/index.d.ts +14 -0
  265. package/dist/html/index.js +15 -0
  266. package/dist/html/index.js.map +1 -0
  267. package/dist/html/registry.d.ts +120 -0
  268. package/dist/html/registry.js +48 -0
  269. package/dist/html/registry.js.map +1 -0
  270. package/dist/html/render.d.ts +99 -0
  271. package/dist/html/render.js +687 -0
  272. package/dist/html/render.js.map +1 -0
  273. package/dist/hyphenation/NOTICE +429 -0
  274. package/dist/hyphenation/exceptions.d.ts +60 -0
  275. package/dist/hyphenation/exceptions.js +79 -0
  276. package/dist/hyphenation/exceptions.js.map +1 -0
  277. package/dist/hyphenation/hyphenator.d.ts +66 -0
  278. package/dist/hyphenation/hyphenator.js +245 -0
  279. package/dist/hyphenation/hyphenator.js.map +1 -0
  280. package/dist/hyphenation/index.d.ts +4 -0
  281. package/dist/hyphenation/index.js +5 -0
  282. package/dist/hyphenation/index.js.map +1 -0
  283. package/dist/hyphenation/languages.d.ts +20 -0
  284. package/dist/hyphenation/languages.js +75 -0
  285. package/dist/hyphenation/languages.js.map +1 -0
  286. package/dist/hyphenation/patterns/af.wasm +0 -0
  287. package/dist/hyphenation/patterns/as.wasm +0 -0
  288. package/dist/hyphenation/patterns/be.wasm +0 -0
  289. package/dist/hyphenation/patterns/bg.wasm +0 -0
  290. package/dist/hyphenation/patterns/bn.wasm +0 -0
  291. package/dist/hyphenation/patterns/ca.wasm +0 -0
  292. package/dist/hyphenation/patterns/cy.wasm +0 -0
  293. package/dist/hyphenation/patterns/da.wasm +0 -0
  294. package/dist/hyphenation/patterns/de.wasm +0 -0
  295. package/dist/hyphenation/patterns/el-monoton.wasm +0 -0
  296. package/dist/hyphenation/patterns/el-polyton.wasm +0 -0
  297. package/dist/hyphenation/patterns/en-gb.wasm +0 -0
  298. package/dist/hyphenation/patterns/en-us.wasm +0 -0
  299. package/dist/hyphenation/patterns/eo.wasm +0 -0
  300. package/dist/hyphenation/patterns/es.wasm +0 -0
  301. package/dist/hyphenation/patterns/et.wasm +0 -0
  302. package/dist/hyphenation/patterns/eu.wasm +0 -0
  303. package/dist/hyphenation/patterns/fi-x-school.wasm +0 -0
  304. package/dist/hyphenation/patterns/fr.wasm +0 -0
  305. package/dist/hyphenation/patterns/fur.wasm +0 -0
  306. package/dist/hyphenation/patterns/ga.wasm +0 -0
  307. package/dist/hyphenation/patterns/gl.wasm +0 -0
  308. package/dist/hyphenation/patterns/gu.wasm +0 -0
  309. package/dist/hyphenation/patterns/hi.wasm +0 -0
  310. package/dist/hyphenation/patterns/hr.wasm +0 -0
  311. package/dist/hyphenation/patterns/hsb.wasm +0 -0
  312. package/dist/hyphenation/patterns/ia.wasm +0 -0
  313. package/dist/hyphenation/patterns/is.wasm +0 -0
  314. package/dist/hyphenation/patterns/it.wasm +0 -0
  315. package/dist/hyphenation/patterns/ka.wasm +0 -0
  316. package/dist/hyphenation/patterns/kmr.wasm +0 -0
  317. package/dist/hyphenation/patterns/kn.wasm +0 -0
  318. package/dist/hyphenation/patterns/la.wasm +0 -0
  319. package/dist/hyphenation/patterns/lt.wasm +0 -0
  320. package/dist/hyphenation/patterns/ml.wasm +0 -0
  321. package/dist/hyphenation/patterns/mn-cyrl.wasm +0 -0
  322. package/dist/hyphenation/patterns/mr.wasm +0 -0
  323. package/dist/hyphenation/patterns/nb.wasm +0 -0
  324. package/dist/hyphenation/patterns/nl.wasm +0 -0
  325. package/dist/hyphenation/patterns/nn.wasm +0 -0
  326. package/dist/hyphenation/patterns/no.wasm +0 -0
  327. package/dist/hyphenation/patterns/oc.wasm +0 -0
  328. package/dist/hyphenation/patterns/or.wasm +0 -0
  329. package/dist/hyphenation/patterns/pa.wasm +0 -0
  330. package/dist/hyphenation/patterns/pi.wasm +0 -0
  331. package/dist/hyphenation/patterns/pl.wasm +0 -0
  332. package/dist/hyphenation/patterns/pms.wasm +0 -0
  333. package/dist/hyphenation/patterns/pt.wasm +0 -0
  334. package/dist/hyphenation/patterns/rm.wasm +0 -0
  335. package/dist/hyphenation/patterns/ru.wasm +0 -0
  336. package/dist/hyphenation/patterns/sh-cyrl.wasm +0 -0
  337. package/dist/hyphenation/patterns/sh-latn.wasm +0 -0
  338. package/dist/hyphenation/patterns/sk.wasm +0 -0
  339. package/dist/hyphenation/patterns/sl.wasm +0 -0
  340. package/dist/hyphenation/patterns/sq.wasm +0 -0
  341. package/dist/hyphenation/patterns/sv.wasm +0 -0
  342. package/dist/hyphenation/patterns/ta.wasm +0 -0
  343. package/dist/hyphenation/patterns/te.wasm +0 -0
  344. package/dist/hyphenation/patterns/th.wasm +0 -0
  345. package/dist/hyphenation/patterns/tk.wasm +0 -0
  346. package/dist/hyphenation/patterns/tr.wasm +0 -0
  347. package/dist/hyphenation/patterns/uk.wasm +0 -0
  348. package/dist/hyphenation/patterns/zh-latn-pinyin.wasm +0 -0
  349. package/dist/index.d.ts +47 -0
  350. package/dist/index.js +48 -0
  351. package/dist/index.js.map +1 -0
  352. package/dist/indexes/index.d.ts +10 -0
  353. package/dist/indexes/index.js +11 -0
  354. package/dist/indexes/index.js.map +1 -0
  355. package/dist/indexes/layout.d.ts +30 -0
  356. package/dist/indexes/layout.js +83 -0
  357. package/dist/indexes/layout.js.map +1 -0
  358. package/dist/indexes/locators.d.ts +33 -0
  359. package/dist/indexes/locators.js +51 -0
  360. package/dist/indexes/locators.js.map +1 -0
  361. package/dist/indexes/terms.d.ts +97 -0
  362. package/dist/indexes/terms.js +211 -0
  363. package/dist/indexes/terms.js.map +1 -0
  364. package/dist/indexes/transform.d.ts +90 -0
  365. package/dist/indexes/transform.js +154 -0
  366. package/dist/indexes/transform.js.map +1 -0
  367. package/dist/layout/calibrate.d.ts +12 -0
  368. package/dist/layout/calibrate.js +50 -0
  369. package/dist/layout/calibrate.js.map +1 -0
  370. package/dist/layout/converge.d.ts +31 -0
  371. package/dist/layout/converge.js +84 -0
  372. package/dist/layout/converge.js.map +1 -0
  373. package/dist/layout/counters.d.ts +16 -0
  374. package/dist/layout/counters.js +62 -0
  375. package/dist/layout/counters.js.map +1 -0
  376. package/dist/layout/first-letter.d.ts +34 -0
  377. package/dist/layout/first-letter.js +183 -0
  378. package/dist/layout/first-letter.js.map +1 -0
  379. package/dist/layout/fonts.d.ts +67 -0
  380. package/dist/layout/fonts.js +110 -0
  381. package/dist/layout/fonts.js.map +1 -0
  382. package/dist/layout/generated.d.ts +9 -0
  383. package/dist/layout/generated.js +83 -0
  384. package/dist/layout/generated.js.map +1 -0
  385. package/dist/layout/glue.d.ts +18 -0
  386. package/dist/layout/glue.js +48 -0
  387. package/dist/layout/glue.js.map +1 -0
  388. package/dist/layout/index.d.ts +17 -0
  389. package/dist/layout/index.js +18 -0
  390. package/dist/layout/index.js.map +1 -0
  391. package/dist/layout/lists.d.ts +91 -0
  392. package/dist/layout/lists.js +1068 -0
  393. package/dist/layout/lists.js.map +1 -0
  394. package/dist/layout/margin-boxes.d.ts +114 -0
  395. package/dist/layout/margin-boxes.js +429 -0
  396. package/dist/layout/margin-boxes.js.map +1 -0
  397. package/dist/layout/minipage.d.ts +85 -0
  398. package/dist/layout/minipage.js +83 -0
  399. package/dist/layout/minipage.js.map +1 -0
  400. package/dist/layout/page-box.d.ts +32 -0
  401. package/dist/layout/page-box.js +110 -0
  402. package/dist/layout/page-box.js.map +1 -0
  403. package/dist/layout/page-rules.d.ts +47 -0
  404. package/dist/layout/page-rules.js +202 -0
  405. package/dist/layout/page-rules.js.map +1 -0
  406. package/dist/layout/page.d.ts +51 -0
  407. package/dist/layout/page.js +133 -0
  408. package/dist/layout/page.js.map +1 -0
  409. package/dist/layout/pagebuilder.d.ts +243 -0
  410. package/dist/layout/pagebuilder.js +591 -0
  411. package/dist/layout/pagebuilder.js.map +1 -0
  412. package/dist/layout/pages.d.ts +71 -0
  413. package/dist/layout/pages.js +741 -0
  414. package/dist/layout/pages.js.map +1 -0
  415. package/dist/layout/paragraph.d.ts +194 -0
  416. package/dist/layout/paragraph.js +1148 -0
  417. package/dist/layout/paragraph.js.map +1 -0
  418. package/dist/layout/pre.d.ts +8 -0
  419. package/dist/layout/pre.js +151 -0
  420. package/dist/layout/pre.js.map +1 -0
  421. package/dist/layout/region.d.ts +66 -0
  422. package/dist/layout/region.js +200 -0
  423. package/dist/layout/region.js.map +1 -0
  424. package/dist/layout/vlist.d.ts +218 -0
  425. package/dist/layout/vlist.js +72 -0
  426. package/dist/layout/vlist.js.map +1 -0
  427. package/dist/linebreak/items.d.ts +69 -0
  428. package/dist/linebreak/items.js +44 -0
  429. package/dist/linebreak/items.js.map +1 -0
  430. package/dist/linebreak/knuth-plass.d.ts +149 -0
  431. package/dist/linebreak/knuth-plass.js +461 -0
  432. package/dist/linebreak/knuth-plass.js.map +1 -0
  433. package/dist/lint/config.d.ts +48 -0
  434. package/dist/lint/config.js +185 -0
  435. package/dist/lint/config.js.map +1 -0
  436. package/dist/lint/context.d.ts +64 -0
  437. package/dist/lint/context.js +37 -0
  438. package/dist/lint/context.js.map +1 -0
  439. package/dist/lint/fix.d.ts +40 -0
  440. package/dist/lint/fix.js +86 -0
  441. package/dist/lint/fix.js.map +1 -0
  442. package/dist/lint/index.d.ts +14 -0
  443. package/dist/lint/index.js +15 -0
  444. package/dist/lint/index.js.map +1 -0
  445. package/dist/lint/linter.d.ts +59 -0
  446. package/dist/lint/linter.js +239 -0
  447. package/dist/lint/linter.js.map +1 -0
  448. package/dist/lint/presets.d.ts +20 -0
  449. package/dist/lint/presets.js +65 -0
  450. package/dist/lint/presets.js.map +1 -0
  451. package/dist/lint/project.d.ts +31 -0
  452. package/dist/lint/project.js +100 -0
  453. package/dist/lint/project.js.map +1 -0
  454. package/dist/lint/rules/html.d.ts +30 -0
  455. package/dist/lint/rules/html.js +163 -0
  456. package/dist/lint/rules/html.js.map +1 -0
  457. package/dist/lint/rules/layout.d.ts +42 -0
  458. package/dist/lint/rules/layout.js +428 -0
  459. package/dist/lint/rules/layout.js.map +1 -0
  460. package/dist/lint/rules/source.d.ts +65 -0
  461. package/dist/lint/rules/source.js +334 -0
  462. package/dist/lint/rules/source.js.map +1 -0
  463. package/dist/lint/testing.d.ts +7 -0
  464. package/dist/lint/testing.js +77 -0
  465. package/dist/lint/testing.js.map +1 -0
  466. package/dist/math/hast.d.ts +46 -0
  467. package/dist/math/hast.js +297 -0
  468. package/dist/math/hast.js.map +1 -0
  469. package/dist/math/index.d.ts +9 -0
  470. package/dist/math/index.js +10 -0
  471. package/dist/math/index.js.map +1 -0
  472. package/dist/math/mathjax/LICENSE-mathjax +202 -0
  473. package/dist/math/mathjax/LICENSE-speech-rule-engine +177 -0
  474. package/dist/math/mathjax/sre/af.json +146 -0
  475. package/dist/math/mathjax/sre/base.json +140 -0
  476. package/dist/math/mathjax/sre/ca.json +140 -0
  477. package/dist/math/mathjax/sre/da.json +140 -0
  478. package/dist/math/mathjax/sre/de.json +146 -0
  479. package/dist/math/mathjax/sre/en.json +158 -0
  480. package/dist/math/mathjax/sre/es.json +140 -0
  481. package/dist/math/mathjax/sre/euro.json +32 -0
  482. package/dist/math/mathjax/sre/fr.json +146 -0
  483. package/dist/math/mathjax/sre/hi.json +146 -0
  484. package/dist/math/mathjax/sre/it.json +146 -0
  485. package/dist/math/mathjax/sre/ko.json +146 -0
  486. package/dist/math/mathjax/sre/nb.json +146 -0
  487. package/dist/math/mathjax/sre/nemeth.json +125 -0
  488. package/dist/math/mathjax/sre/nn.json +146 -0
  489. package/dist/math/mathjax/sre/sv.json +146 -0
  490. package/dist/math/mathjax/svg/PUA.json +1 -0
  491. package/dist/math/mathjax/svg/accents-b-i.json +1 -0
  492. package/dist/math/mathjax/svg/accents.json +1 -0
  493. package/dist/math/mathjax/svg/arabic.json +1 -0
  494. package/dist/math/mathjax/svg/arrows.json +1 -0
  495. package/dist/math/mathjax/svg/braille-d.json +1 -0
  496. package/dist/math/mathjax/svg/braille.json +1 -0
  497. package/dist/math/mathjax/svg/calligraphic.json +1 -0
  498. package/dist/math/mathjax/svg/cherokee.json +1 -0
  499. package/dist/math/mathjax/svg/cyrillic-ss.json +1 -0
  500. package/dist/math/mathjax/svg/cyrillic.json +1 -0
  501. package/dist/math/mathjax/svg/devanagari.json +1 -0
  502. package/dist/math/mathjax/svg/double-struck.json +1 -0
  503. package/dist/math/mathjax/svg/fraktur.json +1 -0
  504. package/dist/math/mathjax/svg/greek-ss.json +1 -0
  505. package/dist/math/mathjax/svg/greek.json +1 -0
  506. package/dist/math/mathjax/svg/hebrew.json +1 -0
  507. package/dist/math/mathjax/svg/latin-b.json +1 -0
  508. package/dist/math/mathjax/svg/latin-bi.json +1 -0
  509. package/dist/math/mathjax/svg/latin-i.json +1 -0
  510. package/dist/math/mathjax/svg/latin.json +1 -0
  511. package/dist/math/mathjax/svg/marrows.json +1 -0
  512. package/dist/math/mathjax/svg/math.json +1 -0
  513. package/dist/math/mathjax/svg/monospace-ex.json +1 -0
  514. package/dist/math/mathjax/svg/monospace-l.json +1 -0
  515. package/dist/math/mathjax/svg/monospace.json +1 -0
  516. package/dist/math/mathjax/svg/mshapes.json +1 -0
  517. package/dist/math/mathjax/svg/phonetics-ss.json +1 -0
  518. package/dist/math/mathjax/svg/phonetics.json +1 -0
  519. package/dist/math/mathjax/svg/sans-serif-b.json +1 -0
  520. package/dist/math/mathjax/svg/sans-serif-bi.json +1 -0
  521. package/dist/math/mathjax/svg/sans-serif-ex.json +1 -0
  522. package/dist/math/mathjax/svg/sans-serif-i.json +1 -0
  523. package/dist/math/mathjax/svg/sans-serif-r.json +1 -0
  524. package/dist/math/mathjax/svg/sans-serif.json +1 -0
  525. package/dist/math/mathjax/svg/script.json +1 -0
  526. package/dist/math/mathjax/svg/shapes.json +1 -0
  527. package/dist/math/mathjax/svg/symbols-b-i.json +1 -0
  528. package/dist/math/mathjax/svg/symbols.json +1 -0
  529. package/dist/math/mathjax/svg/variants.json +1 -0
  530. package/dist/math/mathjax.d.ts +67 -0
  531. package/dist/math/mathjax.js +162 -0
  532. package/dist/math/mathjax.js.map +1 -0
  533. package/dist/math/speech.d.ts +27 -0
  534. package/dist/math/speech.js +87 -0
  535. package/dist/math/speech.js.map +1 -0
  536. package/dist/math/typeset.d.ts +75 -0
  537. package/dist/math/typeset.js +108 -0
  538. package/dist/math/typeset.js.map +1 -0
  539. package/dist/measure/css.d.ts +44 -0
  540. package/dist/measure/css.js +158 -0
  541. package/dist/measure/css.js.map +1 -0
  542. package/dist/measure/index.d.ts +3 -0
  543. package/dist/measure/index.js +4 -0
  544. package/dist/measure/index.js.map +1 -0
  545. package/dist/measure/measurer.d.ts +159 -0
  546. package/dist/measure/measurer.js +300 -0
  547. package/dist/measure/measurer.js.map +1 -0
  548. package/dist/measure/model.d.ts +46 -0
  549. package/dist/measure/model.js +47 -0
  550. package/dist/measure/model.js.map +1 -0
  551. package/dist/output/assets.d.ts +10 -0
  552. package/dist/output/assets.js +65 -0
  553. package/dist/output/assets.js.map +1 -0
  554. package/dist/output/index.d.ts +4 -0
  555. package/dist/output/index.js +5 -0
  556. package/dist/output/index.js.map +1 -0
  557. package/dist/output/output.d.ts +103 -0
  558. package/dist/output/output.js +86 -0
  559. package/dist/output/output.js.map +1 -0
  560. package/dist/output/stylesheets.d.ts +45 -0
  561. package/dist/output/stylesheets.js +50 -0
  562. package/dist/output/stylesheets.js.map +1 -0
  563. package/dist/paint/backgrounds.d.ts +56 -0
  564. package/dist/paint/backgrounds.js +261 -0
  565. package/dist/paint/backgrounds.js.map +1 -0
  566. package/dist/paint/blend.d.ts +61 -0
  567. package/dist/paint/blend.js +157 -0
  568. package/dist/paint/blend.js.map +1 -0
  569. package/dist/paint/border-image.d.ts +13 -0
  570. package/dist/paint/border-image.js +149 -0
  571. package/dist/paint/border-image.js.map +1 -0
  572. package/dist/paint/borders.d.ts +47 -0
  573. package/dist/paint/borders.js +329 -0
  574. package/dist/paint/borders.js.map +1 -0
  575. package/dist/paint/canvas.d.ts +52 -0
  576. package/dist/paint/canvas.js +274 -0
  577. package/dist/paint/canvas.js.map +1 -0
  578. package/dist/paint/colours.d.ts +55 -0
  579. package/dist/paint/colours.js +380 -0
  580. package/dist/paint/colours.js.map +1 -0
  581. package/dist/paint/columns.d.ts +11 -0
  582. package/dist/paint/columns.js +42 -0
  583. package/dist/paint/columns.js.map +1 -0
  584. package/dist/paint/context.d.ts +47 -0
  585. package/dist/paint/context.js +2 -0
  586. package/dist/paint/context.js.map +1 -0
  587. package/dist/paint/decoration.d.ts +97 -0
  588. package/dist/paint/decoration.js +280 -0
  589. package/dist/paint/decoration.js.map +1 -0
  590. package/dist/paint/effects.d.ts +64 -0
  591. package/dist/paint/effects.js +342 -0
  592. package/dist/paint/effects.js.map +1 -0
  593. package/dist/paint/emphasis.d.ts +13 -0
  594. package/dist/paint/emphasis.js +95 -0
  595. package/dist/paint/emphasis.js.map +1 -0
  596. package/dist/paint/flatten.d.ts +33 -0
  597. package/dist/paint/flatten.js +968 -0
  598. package/dist/paint/flatten.js.map +1 -0
  599. package/dist/paint/geometry.d.ts +62 -0
  600. package/dist/paint/geometry.js +170 -0
  601. package/dist/paint/geometry.js.map +1 -0
  602. package/dist/paint/gradients.d.ts +31 -0
  603. package/dist/paint/gradients.js +394 -0
  604. package/dist/paint/gradients.js.map +1 -0
  605. package/dist/paint/images.d.ts +17 -0
  606. package/dist/paint/images.js +80 -0
  607. package/dist/paint/images.js.map +1 -0
  608. package/dist/paint/lint.d.ts +46 -0
  609. package/dist/paint/lint.js +105 -0
  610. package/dist/paint/lint.js.map +1 -0
  611. package/dist/paint/overprint.d.ts +13 -0
  612. package/dist/paint/overprint.js +12 -0
  613. package/dist/paint/overprint.js.map +1 -0
  614. package/dist/paint/painter.d.ts +92 -0
  615. package/dist/paint/painter.js +281 -0
  616. package/dist/paint/painter.js.map +1 -0
  617. package/dist/paint/path.d.ts +9 -0
  618. package/dist/paint/path.js +173 -0
  619. package/dist/paint/path.js.map +1 -0
  620. package/dist/paint/raster.d.ts +32 -0
  621. package/dist/paint/raster.js +180 -0
  622. package/dist/paint/raster.js.map +1 -0
  623. package/dist/paint/shadows.d.ts +28 -0
  624. package/dist/paint/shadows.js +104 -0
  625. package/dist/paint/shadows.js.map +1 -0
  626. package/dist/paint/sources.d.ts +13 -0
  627. package/dist/paint/sources.js +17 -0
  628. package/dist/paint/sources.js.map +1 -0
  629. package/dist/paint/stacking.d.ts +75 -0
  630. package/dist/paint/stacking.js +327 -0
  631. package/dist/paint/stacking.js.map +1 -0
  632. package/dist/paint/svg-lint.d.ts +57 -0
  633. package/dist/paint/svg-lint.js +119 -0
  634. package/dist/paint/svg-lint.js.map +1 -0
  635. package/dist/paint/svg.d.ts +95 -0
  636. package/dist/paint/svg.js +728 -0
  637. package/dist/paint/svg.js.map +1 -0
  638. package/dist/paint/tables.d.ts +18 -0
  639. package/dist/paint/tables.js +178 -0
  640. package/dist/paint/tables.js.map +1 -0
  641. package/dist/paint/text-shadow.d.ts +26 -0
  642. package/dist/paint/text-shadow.js +187 -0
  643. package/dist/paint/text-shadow.js.map +1 -0
  644. package/dist/paint/text.d.ts +144 -0
  645. package/dist/paint/text.js +713 -0
  646. package/dist/paint/text.js.map +1 -0
  647. package/dist/paint/values.d.ts +24 -0
  648. package/dist/paint/values.js +160 -0
  649. package/dist/paint/values.js.map +1 -0
  650. package/dist/paint/vertical.d.ts +19 -0
  651. package/dist/paint/vertical.js +236 -0
  652. package/dist/paint/vertical.js.map +1 -0
  653. package/dist/pdf/index.d.ts +6 -0
  654. package/dist/pdf/index.js +7 -0
  655. package/dist/pdf/index.js.map +1 -0
  656. package/dist/pdf/pdfx.d.ts +30 -0
  657. package/dist/pdf/pdfx.js +18 -0
  658. package/dist/pdf/pdfx.js.map +1 -0
  659. package/dist/pdf/structure/index.d.ts +53 -0
  660. package/dist/pdf/structure/index.js +52 -0
  661. package/dist/pdf/structure/index.js.map +1 -0
  662. package/dist/pdf/structure/labels.d.ts +16 -0
  663. package/dist/pdf/structure/labels.js +45 -0
  664. package/dist/pdf/structure/labels.js.map +1 -0
  665. package/dist/pdf/structure/links.d.ts +49 -0
  666. package/dist/pdf/structure/links.js +136 -0
  667. package/dist/pdf/structure/links.js.map +1 -0
  668. package/dist/pdf/structure/tags.d.ts +79 -0
  669. package/dist/pdf/structure/tags.js +314 -0
  670. package/dist/pdf/structure/tags.js.map +1 -0
  671. package/dist/pdf/types.d.ts +534 -0
  672. package/dist/pdf/types.js +16 -0
  673. package/dist/pdf/types.js.map +1 -0
  674. package/dist/pdf/wasm/pulpweaver4_pdf.d.ts +41 -0
  675. package/dist/pdf/wasm/pulpweaver4_pdf.js +286 -0
  676. package/dist/pdf/wasm/pulpweaver4_pdf_bg.wasm +0 -0
  677. package/dist/pdf/writer.d.ts +41 -0
  678. package/dist/pdf/writer.js +78 -0
  679. package/dist/pdf/writer.js.map +1 -0
  680. package/dist/plugin/attributes.d.ts +10 -0
  681. package/dist/plugin/attributes.js +63 -0
  682. package/dist/plugin/attributes.js.map +1 -0
  683. package/dist/plugin/define.d.ts +425 -0
  684. package/dist/plugin/define.js +311 -0
  685. package/dist/plugin/define.js.map +1 -0
  686. package/dist/plugin/failure.d.ts +80 -0
  687. package/dist/plugin/failure.js +97 -0
  688. package/dist/plugin/failure.js.map +1 -0
  689. package/dist/plugin/index.d.ts +11 -0
  690. package/dist/plugin/index.js +12 -0
  691. package/dist/plugin/index.js.map +1 -0
  692. package/dist/plugin/load.d.ts +105 -0
  693. package/dist/plugin/load.js +197 -0
  694. package/dist/plugin/load.js.map +1 -0
  695. package/dist/plugin/register.d.ts +166 -0
  696. package/dist/plugin/register.js +306 -0
  697. package/dist/plugin/register.js.map +1 -0
  698. package/dist/plugin/render.d.ts +4 -0
  699. package/dist/plugin/render.js +28 -0
  700. package/dist/plugin/render.js.map +1 -0
  701. package/dist/preflight/index.d.ts +3 -0
  702. package/dist/preflight/index.js +4 -0
  703. package/dist/preflight/index.js.map +1 -0
  704. package/dist/preflight/pdfx.d.ts +440 -0
  705. package/dist/preflight/pdfx.js +1779 -0
  706. package/dist/preflight/pdfx.js.map +1 -0
  707. package/dist/preflight/reader.d.ts +126 -0
  708. package/dist/preflight/reader.js +832 -0
  709. package/dist/preflight/reader.js.map +1 -0
  710. package/dist/preflight/xmp.d.ts +30 -0
  711. package/dist/preflight/xmp.js +145 -0
  712. package/dist/preflight/xmp.js.map +1 -0
  713. package/dist/print/index.d.ts +2 -0
  714. package/dist/print/index.js +3 -0
  715. package/dist/print/index.js.map +1 -0
  716. package/dist/print/output.d.ts +5 -0
  717. package/dist/print/output.js +199 -0
  718. package/dist/print/output.js.map +1 -0
  719. package/dist/problem.d.ts +142 -0
  720. package/dist/problem.js +234 -0
  721. package/dist/problem.js.map +1 -0
  722. package/dist/profile/index.d.ts +10 -0
  723. package/dist/profile/index.js +11 -0
  724. package/dist/profile/index.js.map +1 -0
  725. package/dist/profile/lint.d.ts +69 -0
  726. package/dist/profile/lint.js +282 -0
  727. package/dist/profile/lint.js.map +1 -0
  728. package/dist/profile/metadata.d.ts +27 -0
  729. package/dist/profile/metadata.js +38 -0
  730. package/dist/profile/metadata.js.map +1 -0
  731. package/dist/profile/profile.d.ts +92 -0
  732. package/dist/profile/profile.js +282 -0
  733. package/dist/profile/profile.js.map +1 -0
  734. package/dist/project.d.ts +56 -0
  735. package/dist/project.js +137 -0
  736. package/dist/project.js.map +1 -0
  737. package/dist/reproducible/clock.d.ts +46 -0
  738. package/dist/reproducible/clock.js +173 -0
  739. package/dist/reproducible/clock.js.map +1 -0
  740. package/dist/reproducible/date.d.ts +42 -0
  741. package/dist/reproducible/date.js +82 -0
  742. package/dist/reproducible/date.js.map +1 -0
  743. package/dist/reproducible/index.d.ts +8 -0
  744. package/dist/reproducible/index.js +9 -0
  745. package/dist/reproducible/index.js.map +1 -0
  746. package/dist/spike/spike-page.chromium.json +330 -0
  747. package/dist/spike/spike.d.ts +75 -0
  748. package/dist/spike/spike.js +106 -0
  749. package/dist/spike/spike.js.map +1 -0
  750. package/dist/style/borders.d.ts +25 -0
  751. package/dist/style/borders.js +177 -0
  752. package/dist/style/borders.js.map +1 -0
  753. package/dist/style/colours.d.ts +34 -0
  754. package/dist/style/colours.js +138 -0
  755. package/dist/style/colours.js.map +1 -0
  756. package/dist/style/compile.d.ts +79 -0
  757. package/dist/style/compile.js +325 -0
  758. package/dist/style/compile.js.map +1 -0
  759. package/dist/style/defaults.d.ts +20 -0
  760. package/dist/style/defaults.js +45 -0
  761. package/dist/style/defaults.js.map +1 -0
  762. package/dist/style/gcpm.d.ts +22 -0
  763. package/dist/style/gcpm.js +86 -0
  764. package/dist/style/gcpm.js.map +1 -0
  765. package/dist/style/index.d.ts +4 -0
  766. package/dist/style/index.js +5 -0
  767. package/dist/style/index.js.map +1 -0
  768. package/dist/style/media.d.ts +22 -0
  769. package/dist/style/media.js +342 -0
  770. package/dist/style/media.js.map +1 -0
  771. package/dist/style/properties.d.ts +44 -0
  772. package/dist/style/properties.js +497 -0
  773. package/dist/style/properties.js.map +1 -0
  774. package/dist/style/scope.d.ts +6 -0
  775. package/dist/style/scope.js +134 -0
  776. package/dist/style/scope.js.map +1 -0
  777. package/dist/style/values.d.ts +45 -0
  778. package/dist/style/values.js +106 -0
  779. package/dist/style/values.js.map +1 -0
  780. package/dist/test/book.d.ts +180 -0
  781. package/dist/test/book.js +314 -0
  782. package/dist/test/book.js.map +1 -0
  783. package/dist/test/build.d.ts +58 -0
  784. package/dist/test/build.js +222 -0
  785. package/dist/test/build.js.map +1 -0
  786. package/dist/test/environment.d.ts +63 -0
  787. package/dist/test/environment.js +46 -0
  788. package/dist/test/environment.js.map +1 -0
  789. package/dist/test/index.d.ts +17 -0
  790. package/dist/test/index.js +18 -0
  791. package/dist/test/index.js.map +1 -0
  792. package/dist/test/indexes.d.ts +4 -0
  793. package/dist/test/indexes.js +48 -0
  794. package/dist/test/indexes.js.map +1 -0
  795. package/dist/test/layout.d.ts +8 -0
  796. package/dist/test/layout.js +120 -0
  797. package/dist/test/layout.js.map +1 -0
  798. package/dist/test/matchers.d.ts +80 -0
  799. package/dist/test/matchers.js +177 -0
  800. package/dist/test/matchers.js.map +1 -0
  801. package/dist/test/pipeline.d.ts +228 -0
  802. package/dist/test/pipeline.js +73 -0
  803. package/dist/test/pipeline.js.map +1 -0
  804. package/dist/test/plugins.d.ts +13 -0
  805. package/dist/test/plugins.js +22 -0
  806. package/dist/test/plugins.js.map +1 -0
  807. package/dist/test/render.d.ts +46 -0
  808. package/dist/test/render.js +149 -0
  809. package/dist/test/render.js.map +1 -0
  810. package/dist/test/runner.d.ts +61 -0
  811. package/dist/test/runner.js +256 -0
  812. package/dist/test/runner.js.map +1 -0
  813. package/dist/test/select.d.ts +54 -0
  814. package/dist/test/select.js +193 -0
  815. package/dist/test/select.js.map +1 -0
  816. package/dist/test/snapshot.d.ts +52 -0
  817. package/dist/test/snapshot.js +175 -0
  818. package/dist/test/snapshot.js.map +1 -0
  819. package/dist/test/text.d.ts +7 -0
  820. package/dist/test/text.js +46 -0
  821. package/dist/test/text.js.map +1 -0
  822. package/dist/test/vitest.d.ts +3 -0
  823. package/dist/test/vitest.js +39 -0
  824. package/dist/test/vitest.js.map +1 -0
  825. package/dist/text/index.d.ts +5 -0
  826. package/dist/text/index.js +6 -0
  827. package/dist/text/index.js.map +1 -0
  828. package/dist/text/output.d.ts +5 -0
  829. package/dist/text/output.js +39 -0
  830. package/dist/text/output.js.map +1 -0
  831. package/dist/text/render.d.ts +82 -0
  832. package/dist/text/render.js +583 -0
  833. package/dist/text/render.js.map +1 -0
  834. package/dist/text/width.d.ts +16 -0
  835. package/dist/text/width.js +90 -0
  836. package/dist/text/width.js.map +1 -0
  837. package/dist/text/wrap.d.ts +19 -0
  838. package/dist/text/wrap.js +151 -0
  839. package/dist/text/wrap.js.map +1 -0
  840. package/dist/transform/core.d.ts +19 -0
  841. package/dist/transform/core.js +22 -0
  842. package/dist/transform/core.js.map +1 -0
  843. package/dist/transform/index.d.ts +10 -0
  844. package/dist/transform/index.js +11 -0
  845. package/dist/transform/index.js.map +1 -0
  846. package/dist/transform/numbering.d.ts +47 -0
  847. package/dist/transform/numbering.js +142 -0
  848. package/dist/transform/numbering.js.map +1 -0
  849. package/dist/transform/references.d.ts +38 -0
  850. package/dist/transform/references.js +182 -0
  851. package/dist/transform/references.js.map +1 -0
  852. package/dist/transform/run.d.ts +32 -0
  853. package/dist/transform/run.js +210 -0
  854. package/dist/transform/run.js.map +1 -0
  855. package/dist/transform/store.d.ts +111 -0
  856. package/dist/transform/store.js +331 -0
  857. package/dist/transform/store.js.map +1 -0
  858. package/dist/transform/testing.d.ts +31 -0
  859. package/dist/transform/testing.js +76 -0
  860. package/dist/transform/testing.js.map +1 -0
  861. package/dist/transform/transform.d.ts +104 -0
  862. package/dist/transform/transform.js +89 -0
  863. package/dist/transform/transform.js.map +1 -0
  864. package/dist/vfs/fsa.d.ts +14 -0
  865. package/dist/vfs/fsa.js +123 -0
  866. package/dist/vfs/fsa.js.map +1 -0
  867. package/dist/vfs/index.d.ts +7 -0
  868. package/dist/vfs/index.js +8 -0
  869. package/dist/vfs/index.js.map +1 -0
  870. package/dist/vfs/memory.d.ts +15 -0
  871. package/dist/vfs/memory.js +101 -0
  872. package/dist/vfs/memory.js.map +1 -0
  873. package/dist/vfs/path.d.ts +30 -0
  874. package/dist/vfs/path.js +67 -0
  875. package/dist/vfs/path.js.map +1 -0
  876. package/dist/vfs/vfs.d.ts +66 -0
  877. package/dist/vfs/vfs.js +68 -0
  878. package/dist/vfs/vfs.js.map +1 -0
  879. package/dist/vfs/zip.d.ts +27 -0
  880. package/dist/vfs/zip.js +67 -0
  881. package/dist/vfs/zip.js.map +1 -0
  882. package/dist/web/css.d.ts +15 -0
  883. package/dist/web/css.js +80 -0
  884. package/dist/web/css.js.map +1 -0
  885. package/dist/web/hast.d.ts +44 -0
  886. package/dist/web/hast.js +175 -0
  887. package/dist/web/hast.js.map +1 -0
  888. package/dist/web/index.d.ts +11 -0
  889. package/dist/web/index.js +12 -0
  890. package/dist/web/index.js.map +1 -0
  891. package/dist/web/justify-main.d.ts +1 -0
  892. package/dist/web/justify-main.js +38 -0
  893. package/dist/web/justify-main.js.map +1 -0
  894. package/dist/web/justify.d.ts +46 -0
  895. package/dist/web/justify.js +147 -0
  896. package/dist/web/justify.js.map +1 -0
  897. package/dist/web/output.d.ts +28 -0
  898. package/dist/web/output.js +251 -0
  899. package/dist/web/output.js.map +1 -0
  900. package/dist/web/runtime/LICENSE-harfbuzzjs.txt +19 -0
  901. package/dist/web/runtime/NOTICE-patterns.txt +429 -0
  902. package/dist/web/runtime/harfbuzz.wasm +0 -0
  903. package/dist/web/runtime/justify.js.txt +2 -0
  904. package/dist/web/site.d.ts +53 -0
  905. package/dist/web/site.js +219 -0
  906. package/dist/web/site.js.map +1 -0
  907. package/docs/README.md +16 -0
  908. package/docs/reference/css-properties/index.md +94 -0
  909. package/docs/reference/css-properties/pw-adj-demerits.md +22 -0
  910. package/docs/reference/css-properties/pw-border-bottom-width.md +24 -0
  911. package/docs/reference/css-properties/pw-border-left-width.md +24 -0
  912. package/docs/reference/css-properties/pw-border-right-width.md +24 -0
  913. package/docs/reference/css-properties/pw-border-top-width.md +24 -0
  914. package/docs/reference/css-properties/pw-box.md +28 -0
  915. package/docs/reference/css-properties/pw-broken-penalty.md +22 -0
  916. package/docs/reference/css-properties/pw-club-penalty.md +24 -0
  917. package/docs/reference/css-properties/pw-column-rule-width.md +23 -0
  918. package/docs/reference/css-properties/pw-content-after.md +31 -0
  919. package/docs/reference/css-properties/pw-content-before.md +31 -0
  920. package/docs/reference/css-properties/pw-double-hyphen-demerits.md +23 -0
  921. package/docs/reference/css-properties/pw-emergency-stretch.md +28 -0
  922. package/docs/reference/css-properties/pw-ex-hyphen-penalty.md +22 -0
  923. package/docs/reference/css-properties/pw-final-hyphen-demerits.md +22 -0
  924. package/docs/reference/css-properties/pw-float-skip.md +22 -0
  925. package/docs/reference/css-properties/pw-float.md +33 -0
  926. package/docs/reference/css-properties/pw-footnote-max-height.md +22 -0
  927. package/docs/reference/css-properties/pw-footnote-skip.md +23 -0
  928. package/docs/reference/css-properties/pw-hyphen-penalty.md +24 -0
  929. package/docs/reference/css-properties/pw-inter-line-penalty.md +24 -0
  930. package/docs/reference/css-properties/pw-leader-space.md +22 -0
  931. package/docs/reference/css-properties/pw-leader.md +29 -0
  932. package/docs/reference/css-properties/pw-left-hyphen-min.md +23 -0
  933. package/docs/reference/css-properties/pw-line-breaking.md +29 -0
  934. package/docs/reference/css-properties/pw-line-penalty.md +23 -0
  935. package/docs/reference/css-properties/pw-list-indent.md +18 -0
  936. package/docs/reference/css-properties/pw-looseness.md +30 -0
  937. package/docs/reference/css-properties/pw-max-depth.md +22 -0
  938. package/docs/reference/css-properties/pw-minipage-footnotes.md +23 -0
  939. package/docs/reference/css-properties/pw-orphans.md +24 -0
  940. package/docs/reference/css-properties/pw-outline-width.md +23 -0
  941. package/docs/reference/css-properties/pw-overprint.md +26 -0
  942. package/docs/reference/css-properties/pw-padding-bottom.md +22 -0
  943. package/docs/reference/css-properties/pw-padding-left.md +22 -0
  944. package/docs/reference/css-properties/pw-padding-right.md +22 -0
  945. package/docs/reference/css-properties/pw-padding-top.md +22 -0
  946. package/docs/reference/css-properties/pw-page-prefix.md +28 -0
  947. package/docs/reference/css-properties/pw-page.md +32 -0
  948. package/docs/reference/css-properties/pw-penalty-after.md +23 -0
  949. package/docs/reference/css-properties/pw-penalty-before.md +30 -0
  950. package/docs/reference/css-properties/pw-pretolerance.md +23 -0
  951. package/docs/reference/css-properties/pw-right-hyphen-min.md +22 -0
  952. package/docs/reference/css-properties/pw-running.md +23 -0
  953. package/docs/reference/css-properties/pw-site-background.md +21 -0
  954. package/docs/reference/css-properties/pw-site-link.md +17 -0
  955. package/docs/reference/css-properties/pw-site-measure.md +17 -0
  956. package/docs/reference/css-properties/pw-site-muted.md +21 -0
  957. package/docs/reference/css-properties/pw-site-rule.md +17 -0
  958. package/docs/reference/css-properties/pw-site-text.md +22 -0
  959. package/docs/reference/css-properties/pw-space-after.md +23 -0
  960. package/docs/reference/css-properties/pw-space-before.md +29 -0
  961. package/docs/reference/css-properties/pw-string-set.md +32 -0
  962. package/docs/reference/css-properties/pw-tolerance.md +33 -0
  963. package/docs/reference/css-properties/pw-top-skip.md +22 -0
  964. package/docs/reference/css-properties/pw-widow-penalty.md +32 -0
  965. package/docs/reference/css-properties/pw-widows.md +24 -0
  966. package/docs/reference/css-properties/pw-word-space.md +22 -0
  967. package/docs/reference/css-properties/pw-xspace.md +22 -0
  968. package/docs/reference/index.md +17 -0
  969. package/docs/reference/lint-rules/black-text.md +31 -0
  970. package/docs/reference/lint-rules/blank-page.md +35 -0
  971. package/docs/reference/lint-rules/chapter-verso.md +34 -0
  972. package/docs/reference/lint-rules/citation-in-heading.md +24 -0
  973. package/docs/reference/lint-rules/consecutive-hyphens.md +34 -0
  974. package/docs/reference/lint-rules/empty-link.md +32 -0
  975. package/docs/reference/lint-rules/figure-distance.md +34 -0
  976. package/docs/reference/lint-rules/fonts.md +24 -0
  977. package/docs/reference/lint-rules/generated-text.md +24 -0
  978. package/docs/reference/lint-rules/heading-levels.md +30 -0
  979. package/docs/reference/lint-rules/ibid-across-page.md +30 -0
  980. package/docs/reference/lint-rules/image-alt.md +30 -0
  981. package/docs/reference/lint-rules/image-resolution.md +34 -0
  982. package/docs/reference/lint-rules/index.md +120 -0
  983. package/docs/reference/lint-rules/ink-limit.md +30 -0
  984. package/docs/reference/lint-rules/missing-field.md +37 -0
  985. package/docs/reference/lint-rules/orphan.md +34 -0
  986. package/docs/reference/lint-rules/overfull-line.md +28 -0
  987. package/docs/reference/lint-rules/profile.md +24 -0
  988. package/docs/reference/lint-rules/raw-html.md +30 -0
  989. package/docs/reference/lint-rules/signature.md +34 -0
  990. package/docs/reference/lint-rules/straight-quotes.md +33 -0
  991. package/docs/reference/lint-rules/svg-use-css.md +24 -0
  992. package/docs/reference/lint-rules/underfull-line.md +35 -0
  993. package/docs/reference/lint-rules/unknown-citation.md +30 -0
  994. package/docs/reference/lint-rules/unknown-label.md +31 -0
  995. package/docs/reference/lint-rules/unpaintable.md +24 -0
  996. package/docs/reference/lint-rules/unplaced-index.md +31 -0
  997. package/docs/reference/lint-rules/unused-entry.md +36 -0
  998. package/docs/reference/lint-rules/widow.md +34 -0
  999. package/docs/reference/plugin-api/assert-no-errors.md +18 -0
  1000. package/docs/reference/plugin-api/asset-processor.md +28 -0
  1001. package/docs/reference/plugin-api/attribute-problem.md +26 -0
  1002. package/docs/reference/plugin-api/attribute-type.md +18 -0
  1003. package/docs/reference/plugin-api/capabilities.md +18 -0
  1004. package/docs/reference/plugin-api/capability.md +22 -0
  1005. package/docs/reference/plugin-api/check-attributes.md +18 -0
  1006. package/docs/reference/plugin-api/claim-kind.md +20 -0
  1007. package/docs/reference/plugin-api/combine-penalties.md +17 -0
  1008. package/docs/reference/plugin-api/command-context.md +30 -0
  1009. package/docs/reference/plugin-api/command-definition.md +34 -0
  1010. package/docs/reference/plugin-api/core-claims.md +18 -0
  1011. package/docs/reference/plugin-api/define-plugin.md +20 -0
  1012. package/docs/reference/plugin-api/define-rule.md +19 -0
  1013. package/docs/reference/plugin-api/describe-error.md +14 -0
  1014. package/docs/reference/plugin-api/describe-node.md +14 -0
  1015. package/docs/reference/plugin-api/empty-registry.md +18 -0
  1016. package/docs/reference/plugin-api/failed-on.md +32 -0
  1017. package/docs/reference/plugin-api/fails-as.md +18 -0
  1018. package/docs/reference/plugin-api/import-plugins.md +20 -0
  1019. package/docs/reference/plugin-api/import-text.md +14 -0
  1020. package/docs/reference/plugin-api/index.md +123 -0
  1021. package/docs/reference/plugin-api/layout-definition.md +42 -0
  1022. package/docs/reference/plugin-api/layout-slot.md +28 -0
  1023. package/docs/reference/plugin-api/line-breaker.md +18 -0
  1024. package/docs/reference/plugin-api/lint-context.md +48 -0
  1025. package/docs/reference/plugin-api/lint-definition.md +32 -0
  1026. package/docs/reference/plugin-api/lint-edition.md +38 -0
  1027. package/docs/reference/plugin-api/lint-fix.md +36 -0
  1028. package/docs/reference/plugin-api/lint-level.md +20 -0
  1029. package/docs/reference/plugin-api/lint-preset.md +30 -0
  1030. package/docs/reference/plugin-api/lint-rule.md +42 -0
  1031. package/docs/reference/plugin-api/load-failure.md +32 -0
  1032. package/docs/reference/plugin-api/load-plugins-options.md +32 -0
  1033. package/docs/reference/plugin-api/load-plugins.md +20 -0
  1034. package/docs/reference/plugin-api/loaded-plugin.md +32 -0
  1035. package/docs/reference/plugin-api/node-claim.md +34 -0
  1036. package/docs/reference/plugin-api/output-definition.md +28 -0
  1037. package/docs/reference/plugin-api/owned.md +28 -0
  1038. package/docs/reference/plugin-api/page-builder-hook.md +18 -0
  1039. package/docs/reference/plugin-api/penalty-rule.md +34 -0
  1040. package/docs/reference/plugin-api/plugin-api.md +18 -0
  1041. package/docs/reference/plugin-api/plugin-definition.md +66 -0
  1042. package/docs/reference/plugin-api/plugin-error.md +22 -0
  1043. package/docs/reference/plugin-api/plugin-failure.md +30 -0
  1044. package/docs/reference/plugin-api/plugin-importer.md +34 -0
  1045. package/docs/reference/plugin-api/plugin-problem.md +30 -0
  1046. package/docs/reference/plugin-api/plugin-registry.md +83 -0
  1047. package/docs/reference/plugin-api/plugin-scope.md +15 -0
  1048. package/docs/reference/plugin-api/plugin-stage.md +18 -0
  1049. package/docs/reference/plugin-api/plugin-threw-problem.md +34 -0
  1050. package/docs/reference/plugin-api/plugin-threw.md +21 -0
  1051. package/docs/reference/plugin-api/plugin.md +69 -0
  1052. package/docs/reference/plugin-api/project-with-plugins.md +36 -0
  1053. package/docs/reference/plugin-api/read-context.md +30 -0
  1054. package/docs/reference/plugin-api/read-failure.md +18 -0
  1055. package/docs/reference/plugin-api/read-plugin-styles.md +22 -0
  1056. package/docs/reference/plugin-api/reader.md +22 -0
  1057. package/docs/reference/plugin-api/register-options.md +28 -0
  1058. package/docs/reference/plugin-api/register-plugins.md +20 -0
  1059. package/docs/reference/plugin-api/render-format.md +18 -0
  1060. package/docs/reference/plugin-api/render-formats.md +18 -0
  1061. package/docs/reference/plugin-api/renderer-registry.md +18 -0
  1062. package/docs/reference/plugin-api/renderer-set.md +34 -0
  1063. package/docs/reference/plugin-api/renderers.md +34 -0
  1064. package/docs/reference/plugin-api/specifier-kind.md +14 -0
  1065. package/docs/reference/plugin-api/style-source.md +18 -0
  1066. package/docs/reference/plugin-api/text-context.md +28 -0
  1067. package/docs/reference/plugin-api/text-edit.md +28 -0
  1068. package/docs/reference/plugin-api/text-renderer.md +24 -0
  1069. package/docs/reference/plugin-api/try-plugin-async.md +18 -0
  1070. package/docs/reference/plugin-api/try-plugin.md +20 -0
  1071. package/docs/reference/pulpweaver4-toml/editions.md +194 -0
  1072. package/docs/reference/pulpweaver4-toml/index.md +182 -0
  1073. package/docs/reference/pulpweaver4-toml/inks.md +50 -0
  1074. package/docs/reference/pulpweaver4-toml/lint.md +36 -0
  1075. package/docs/reference/test-matchers/index.md +33 -0
  1076. package/docs/reference/test-matchers/to-be-recto.md +20 -0
  1077. package/docs/reference/test-matchers/to-cite.md +22 -0
  1078. package/docs/reference/test-matchers/to-fit-on-one-page.md +20 -0
  1079. package/docs/reference/test-matchers/to-have-no-overfull-lines.md +20 -0
  1080. package/docs/reference/test-matchers/to-match-html-snapshot.md +20 -0
  1081. package/docs/reference/test-matchers/to-match-page-snapshot.md +20 -0
  1082. package/docs/reference/test-matchers/to-match-text-snapshot.md +21 -0
  1083. package/docs/reference/test-matchers/to-start-page.md +20 -0
  1084. package/package.json +75 -4
  1085. package/README.md +0 -3
@@ -0,0 +1,209 @@
1
+ /** The outputs the core writes; plugins add theirs (`epub`, `rst`). */
2
+ export const CORE_OUTPUTS = ['web', 'pdf', 'text'];
3
+ /** The output intents known by name. Any other is a profile’s file in the project. */
4
+ export const OUTPUT_INTENTS = {
5
+ GRACoL2013: 'CMYK',
6
+ FOGRA39: 'CMYK',
7
+ FOGRA51: 'CMYK',
8
+ SWOP: 'CMYK',
9
+ sRGB: 'RGB',
10
+ };
11
+ /** The PDF standards an edition can claim. */
12
+ export const PDF_STANDARDS = [
13
+ 'PDF/X-1a', 'PDF/X-3', 'PDF/X-4',
14
+ 'PDF/A-1a', 'PDF/A-1b', 'PDF/A-2a', 'PDF/A-2b', 'PDF/A-2u', 'PDF/A-3a', 'PDF/A-3b', 'PDF/A-3u', 'PDF/A-4', 'PDF/A-4e', 'PDF/A-4f',
15
+ 'PDF/UA-1',
16
+ ];
17
+ const LINT_LEVELS = ['off', 'on', 'warn', 'error'];
18
+ const LINT = {
19
+ type: 'object',
20
+ description: 'Lint rules, configured like ESLint’s.',
21
+ additionalProperties: false,
22
+ properties: {
23
+ extends: {
24
+ type: 'array',
25
+ description: 'Presets to start from: the core’s (`recommended`, `print-ready`, `pdf-x`, `epub`) or a plugin’s (`<plugin>/<name>`). Unlike ESLint’s, their order means nothing: if two set one rule differently, the build says so until `rules` sets it.',
26
+ items: { type: 'string', format: 'rule-name' },
27
+ uniqueItems: true,
28
+ default: [],
29
+ examples: [['recommended']],
30
+ },
31
+ rules: {
32
+ type: 'object',
33
+ description: 'Each rule’s level, `"off"`, `"on"` (its own default level), `"warn"` or `"error"`, or an array of the level and the rule’s options.',
34
+ propertyNames: { type: 'string', format: 'rule-name' },
35
+ additionalProperties: {
36
+ anyOf: [
37
+ { type: 'string', enum: LINT_LEVELS },
38
+ { type: 'array', prefixItems: [{ type: 'string', enum: LINT_LEVELS }, { type: 'object' }], items: false, minItems: 1 },
39
+ ],
40
+ },
41
+ default: {},
42
+ examples: [{ widow: 'error', 'consecutive-hyphens': ['warn', { max: 2 }] }],
43
+ },
44
+ },
45
+ };
46
+ const INKS = {
47
+ type: 'object',
48
+ description: 'Spot inks, used in CSS as `var(--ink-<name>)`, each painted in a print edition’s PDF as a Separation colour of its own.',
49
+ propertyNames: { type: 'string', format: 'name' },
50
+ additionalProperties: {
51
+ type: 'object',
52
+ additionalProperties: false,
53
+ required: ['preview', 'cmyk'],
54
+ properties: {
55
+ preview: { type: 'string', format: 'hex-colour', description: 'How the ink looks on screen.', examples: ['#00594f'] },
56
+ cmyk: {
57
+ type: 'array',
58
+ description: 'The ink’s CMYK fallback, each from 0 to 1, for a PDF without its plate.',
59
+ items: { type: 'number', minimum: 0, maximum: 1 },
60
+ minItems: 4,
61
+ maxItems: 4,
62
+ examples: [[0.9, 0, 0.5, 0.6]],
63
+ },
64
+ name: { type: 'string', minLength: 1, description: 'The ink’s name in the PDF, as the printer knows it.', default: 'the ink’s key', examples: ['PANTONE 7462 C'] },
65
+ },
66
+ },
67
+ default: {},
68
+ };
69
+ const EDITION = {
70
+ type: 'object',
71
+ description: 'An edition: a medium, a page size, an output and the settings that go with them.',
72
+ additionalProperties: false,
73
+ properties: {
74
+ media: {
75
+ type: 'string',
76
+ enum: ['screen', 'print'],
77
+ description: 'Which media queries the stylesheet is compiled for. A `screen` edition is a web site unless `output` says otherwise; a `print` edition is a PDF. Text editions have none.',
78
+ examples: ['print'],
79
+ },
80
+ output: {
81
+ type: 'string',
82
+ format: 'name',
83
+ description: 'What the edition writes: the core’s `web`, `pdf` or `text`, or an output a plugin adds, such as `epub` or `rst`.',
84
+ default: '`web` for `media = "screen"`, `pdf` for `media = "print"`',
85
+ examples: ['text'],
86
+ },
87
+ page: {
88
+ type: 'string',
89
+ format: 'page-size',
90
+ description: 'The trimmed page’s size. A PDF edition needs one.',
91
+ examples: ['5.5in 8.5in', 'letter', 'A4'],
92
+ },
93
+ bleed: { type: 'string', format: 'length', description: 'How far backgrounds and images that touch the trim run past it.', default: '0', examples: ['0.125in'] },
94
+ marks: {
95
+ type: 'string',
96
+ enum: ['none', 'crop', 'cross', 'crop cross'],
97
+ description: 'Printer’s marks outside the bleed, as CSS’s `marks`.',
98
+ default: 'none',
99
+ examples: ['crop'],
100
+ },
101
+ color: { type: 'string', enum: ['rgb', 'cmyk'], description: 'The PDF’s colour: sRGB, or CMYK through `output-intent`.', default: 'rgb', examples: ['cmyk'] },
102
+ 'output-intent': {
103
+ type: 'string',
104
+ minLength: 1,
105
+ description: `The printing condition’s ICC profile: one known by name (${Object.keys(OUTPUT_INTENTS).map((n) => `\`${n}\``).join(', ')}) or a profile’s file (\`.icc\`, \`.icm\`) in the project. A CMYK edition needs one, a CMYK profile. A name’s profile is fetched from the ICC’s registry, but FOGRA51’s, ECI’s \`PSOcoated_v3.icc\`, which may not be redistributed: \`pw profiles get FOGRA51\` downloads it from ECI once you accept ECI’s terms, or download it yourself and name its file, which is then known as FOGRA51 by its bytes.`,
106
+ default: '`sRGB` for an RGB edition',
107
+ examples: ['GRACoL2013', 'profiles/printer.icc'],
108
+ },
109
+ 'pdf-standard': {
110
+ anyOf: [
111
+ { type: 'string', enum: ['none', ...PDF_STANDARDS] },
112
+ { type: 'array', items: { type: 'string', enum: PDF_STANDARDS }, uniqueItems: true },
113
+ ],
114
+ description: 'The standard the PDF meets, or several of different families, such as `["PDF/A-2a", "PDF/UA-1"]`. PDF/X needs an output intent, a printer’s profile (not `sRGB`), and PDF/X-1a a CMYK edition. A CMYK edition’s PDF/A bases its CMYK on the output intent’s profile. Standards claimed together must share a PDF version: PDF/UA-1 (PDF 1.5 to 1.7) goes with neither PDF/X-1a, PDF/X-3 nor PDF/A-1 (PDF 1.4), nor with PDF/A-4 (PDF 2.0), which goes with no PDF/X.',
115
+ default: 'none',
116
+ examples: ['PDF/X-4'],
117
+ },
118
+ impose: { type: 'string', enum: ['booklet'], description: 'Imposes the pages onto sheets: `booklet` folds and saddle-stitches them.', examples: ['booklet'] },
119
+ 'page-list': {
120
+ type: 'string',
121
+ format: 'name',
122
+ description: 'A PDF edition whose page numbers this edition lists, so a reader of the EPUB or web edition can cite the printed book’s pages.',
123
+ examples: ['paperback'],
124
+ },
125
+ wrap: {
126
+ anyOf: [
127
+ { type: 'integer', minimum: 1 },
128
+ { type: 'string', const: 'none' },
129
+ ],
130
+ description: 'A text edition’s line length, in characters, or `"none"` for one line per paragraph.',
131
+ default: 'none',
132
+ examples: [72],
133
+ },
134
+ split: {
135
+ type: 'string',
136
+ enum: ['chapter', 'none'],
137
+ description: 'How a web edition is split into pages: `chapter`, a page for each chapter’s file with a contents page as `index.html`, or `none`, the whole book on `index.html`.',
138
+ default: 'chapter',
139
+ examples: ['none'],
140
+ },
141
+ lint: {
142
+ anyOf: [
143
+ { type: 'array', items: { type: 'string', format: 'rule-name' }, uniqueItems: true },
144
+ LINT,
145
+ ],
146
+ description: 'Lint settings for this edition, on top of the project’s: an array of presets, or a table like `[lint]`.',
147
+ examples: [['print-ready']],
148
+ },
149
+ inks: { ...INKS, description: 'Spot inks for this edition, added to the project’s `[inks]`, and replacing those of the same name.' },
150
+ },
151
+ };
152
+ /** `pulpweaver4.toml`’s schema. */
153
+ export const CONFIG_SCHEMA = {
154
+ title: 'pulpweaver4.toml',
155
+ description: 'A pulpweaver4 project: its book, its plugins, its lint rules and its editions.',
156
+ type: 'object',
157
+ additionalProperties: false,
158
+ required: ['title', 'language', 'chapters'],
159
+ properties: {
160
+ title: { type: 'string', minLength: 1, description: 'The book’s title.', examples: ['The Dorean Principle'] },
161
+ language: { type: 'string', format: 'language-tag', description: 'The book’s language, for hyphenation, quotation marks, the order of its indexes and the PDF’s metadata.', examples: ['en-US'] },
162
+ chapters: {
163
+ type: 'array',
164
+ description: 'The source files, in order. A pattern’s files come in the order of their paths, and a file matched twice comes where it is first matched.',
165
+ items: { type: 'string', format: 'glob' },
166
+ minItems: 1,
167
+ examples: [['chapters/*.dj']],
168
+ },
169
+ bibliography: {
170
+ anyOf: [
171
+ { type: 'string', format: 'path' },
172
+ { type: 'array', items: { type: 'string', format: 'path' } },
173
+ ],
174
+ description: 'The bibliography, or several: BibLaTeX (`.bib`), BibTeX (`.bibtex`), CSL-JSON (`.json`) or CSL-YAML (`.yaml`), told apart by the extension.',
175
+ default: [],
176
+ examples: ['sources.bib'],
177
+ },
178
+ date: {
179
+ type: 'string',
180
+ format: 'date',
181
+ description: 'The book’s date, which its PDFs give as their creation date: a day, or a day and a time with its offset from UTC. Without it, a build takes the date from `SOURCE_DATE_EPOCH`, and with neither a PDF has no date; never the clock’s, so that a build is reproducible. A PDF/X edition needs one.',
182
+ examples: ['2026-11-13'],
183
+ },
184
+ 'citation-style': {
185
+ type: 'string',
186
+ minLength: 1,
187
+ description: 'The CSL style citations are written in: a style’s id, or a `.csl` file in the project. An id is a bundled style (`chicago-notes-bibliography`, `chicago-author-date`), one in the project’s `styles/` (`styles/<id>.csl`), or any in the CSL project’s styles repository (`apa`, `society-of-biblical-literature-fullnote-bibliography`), which a build fetches at the commit pulpweaver4 pins and `pw` keeps in its cache (`~/.cache/pulpweaver4/csl`), so later builds need no network. A language with no bundled locale (all but `en-US` and `en-GB`) has its CSL locale fetched the same way.',
188
+ examples: ['chicago-notes-bibliography'],
189
+ },
190
+ plugins: {
191
+ type: 'object',
192
+ description: 'The project’s plugins, each with a table of its options, checked against the plugin’s schema. They are a set: their order means nothing.',
193
+ propertyNames: { type: 'string', format: 'plugin' },
194
+ additionalProperties: { type: 'object' },
195
+ default: {},
196
+ examples: [{ 'pulpweaver4-scripture': {}, 'pulpweaver4-epub': {} }],
197
+ },
198
+ lint: LINT,
199
+ inks: INKS,
200
+ editions: {
201
+ type: 'object',
202
+ description: 'The editions, by name: the name is the `pw build --edition` argument, `dist/`’s folder and the `.edition-<name>` class.',
203
+ propertyNames: { type: 'string', format: 'name' },
204
+ additionalProperties: EDITION,
205
+ examples: [{ web: { media: 'screen' } }],
206
+ },
207
+ },
208
+ };
209
+ //# sourceMappingURL=project-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-schema.js","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,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC;SACzC;KACF;CACF,CAAA"}
@@ -0,0 +1,68 @@
1
+ import { type ConfigPath } from './toml.js';
2
+ export type SchemaType = 'string' | 'integer' | 'number' | 'boolean' | 'array' | 'object';
3
+ /** A schema: the subset of JSON Schema that configuration is checked against. */
4
+ export interface Schema {
5
+ readonly type?: SchemaType;
6
+ readonly title?: string;
7
+ /** What the key is for, in a sentence or two of Markdown, for the docs. */
8
+ readonly description?: string;
9
+ /** What the key is when it’s left out, as the docs should state it. */
10
+ readonly default?: unknown;
11
+ /** Values as an author would write them; the first is offered in fixes. */
12
+ readonly examples?: readonly unknown[];
13
+ readonly enum?: readonly (string | number | boolean)[];
14
+ readonly const?: string | number | boolean;
15
+ /** One of {@link FORMATS}, for strings. */
16
+ readonly format?: string;
17
+ readonly pattern?: string;
18
+ readonly minLength?: number;
19
+ readonly minimum?: number;
20
+ readonly maximum?: number;
21
+ readonly items?: Schema | false;
22
+ readonly prefixItems?: readonly Schema[];
23
+ readonly minItems?: number;
24
+ readonly maxItems?: number;
25
+ readonly uniqueItems?: boolean;
26
+ readonly properties?: Readonly<Record<string, Schema>>;
27
+ readonly required?: readonly string[];
28
+ /** False for a closed table, whose unknown keys are errors with a suggestion. */
29
+ readonly additionalProperties?: boolean | Schema;
30
+ readonly propertyNames?: Schema;
31
+ /** The first branch whose type the value has is the one checked. */
32
+ readonly anyOf?: readonly Schema[];
33
+ readonly $comment?: string;
34
+ }
35
+ /** A problem with a value, by where it is: its key (an unknown key) or its value. */
36
+ export interface SchemaProblem {
37
+ readonly path: ConfigPath;
38
+ readonly part: 'key' | 'value';
39
+ readonly code: 'unknown-key' | 'missing-key' | 'wrong-type' | 'bad-value';
40
+ readonly message: string;
41
+ readonly fix?: string;
42
+ }
43
+ /** A string format: what it is, for the docs and messages, and its check. */
44
+ export interface Format {
45
+ /** A noun phrase: “a length, such as "0.125in"”. */
46
+ readonly description: string;
47
+ /** What is wrong with `value`, as a predicate (“has no unit”), and how to fix it, or undefined if nothing is. */
48
+ check(value: string): {
49
+ readonly error: string;
50
+ readonly fix?: string;
51
+ } | undefined;
52
+ }
53
+ /** The string formats a schema may name: pulpweaver4’s own, for its own keys and plugins’. */
54
+ export declare const FORMATS: Readonly<Record<string, Format>>;
55
+ /** Checks `value`, found at `path`, against `schema`, and lists every problem. */
56
+ export declare function checkSchema(value: unknown, schema: Schema, path?: ConfigPath): SchemaProblem[];
57
+ /** The type of a TOML value, in a schema’s words, with `datetime` for TOML’s dates and times. */
58
+ export declare function typeOf(value: unknown): SchemaType | 'datetime' | 'null';
59
+ /** What a schema takes, as a noun phrase: `a string`, `"screen" or "print"`. */
60
+ export declare function describe(schema: Schema): string;
61
+ /** A key as TOML writes it: bare if it can be, quoted if not. */
62
+ export declare function tomlKey(key: string): string;
63
+ /** A value as TOML writes it, for fixes and the docs. */
64
+ export declare function tomlValue(value: unknown): string;
65
+ /** A value’s place, as its dotted key: `editions.web.media`, `lint.rules.widow[1]`. */
66
+ export declare function describePath(path: ConfigPath): string;
67
+ /** A table, as its header would name it: `[editions.web]`, or `the file` for the top level. */
68
+ export declare function describeTable(path: ConfigPath): string;
@@ -0,0 +1,333 @@
1
+ /**
2
+ * Schemas for configuration: `pulpweaver4.toml`’s own, and each plugin’s
3
+ * options. A schema is a plain object in a subset of JSON Schema (2020-12),
4
+ * so the reference docs can be generated from it, editors that read JSON
5
+ * Schema for TOML (Taplo, Even Better TOML) can complete and check the file,
6
+ * and a plugin author writes one in a language they may know already.
7
+ *
8
+ * The keywords below are all that is checked; anything else (`$comment`,
9
+ * `x-…`) is carried for the docs and ignored. `format` is asserted, not just
10
+ * an annotation, with pulpweaver4’s own formats ({@link FORMATS}).
11
+ */
12
+ import { didYouMean } from '../problem.js';
13
+ import { readDate } from '../reproducible/date.js';
14
+ import { readLength, readPageSize } from './page.js';
15
+ import { TomlDateTime } from './toml.js';
16
+ /** The string formats a schema may name: pulpweaver4’s own, for its own keys and plugins’. */
17
+ export const FORMATS = {
18
+ length: {
19
+ description: 'a length with a unit (`pt`, `pc`, `in`, `cm`, `mm`, `Q`, `px`), such as "0.125in"',
20
+ check(value) {
21
+ const length = readLength(value);
22
+ return typeof length === 'number' ? undefined : length;
23
+ },
24
+ },
25
+ 'page-size': {
26
+ description: 'a page size: a name (`letter`, `legal`, `ledger`, `A3` to `A7`, `B4` to `B6`, `JIS-B4` to `JIS-B6`), with `landscape` if wanted, or a width and a height, such as "5.5in 8.5in"',
27
+ check(value) {
28
+ const size = readPageSize(value);
29
+ return 'error' in size ? size : undefined;
30
+ },
31
+ },
32
+ 'language-tag': {
33
+ description: 'a BCP 47 language tag, such as "en-US"',
34
+ check(value) {
35
+ try {
36
+ Intl.getCanonicalLocales(value);
37
+ return undefined;
38
+ }
39
+ catch {
40
+ return { error: 'is not a BCP 47 language tag', fix: 'write a language, and a region or script if needed, such as "en-US", "de" or "zh-Hant"' };
41
+ }
42
+ },
43
+ },
44
+ path: {
45
+ description: 'a path in the project, relative to `pulpweaver4.toml`, with `/` between folders',
46
+ check: checkPath,
47
+ },
48
+ glob: {
49
+ description: 'a path in the project, relative to `pulpweaver4.toml`, in which `*` matches any name, `**` any folders and `?` one character',
50
+ check: checkPath,
51
+ },
52
+ name: {
53
+ description: 'a name of lowercase letters, digits and single hyphens, starting with a letter, such as "paperback"',
54
+ check(value) {
55
+ if (/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(value))
56
+ return undefined;
57
+ const suggestion = value.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^[^a-z]+|-+$/g, '');
58
+ return { error: 'is not a name', fix: `use lowercase letters, digits and hyphens${suggestion ? `, such as "${suggestion}"` : ''}` };
59
+ },
60
+ },
61
+ 'rule-name': {
62
+ description: 'a lint rule’s or preset’s name, such as "widow", or "psalter/tune-and-words" for a plugin’s',
63
+ check(value) {
64
+ return /^([a-z0-9@][a-z0-9._~-]*\/)*[a-z0-9][a-z0-9-]*$/.test(value) ? undefined : { error: 'is not a rule’s name', fix: 'rules are named in lowercase with hyphens, a plugin’s after its name and a slash' };
65
+ },
66
+ },
67
+ plugin: {
68
+ description: 'a plugin: an npm package’s name, such as "pulpweaver4-epub", a module in the project, such as "./plugins/psalter.js", or an https URL',
69
+ check(value) {
70
+ if (/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(value))
71
+ return undefined;
72
+ if (value.startsWith('./'))
73
+ return checkPath(value.slice(2));
74
+ if (value.startsWith('https://'))
75
+ return undefined;
76
+ return { error: 'is not a plugin', fix: 'name an npm package in lowercase, a module in the project starting with ./, or an https URL' };
77
+ },
78
+ },
79
+ date: {
80
+ description: 'a date, such as 2026-11-13, or a date and time with its offset from UTC, such as 2026-11-13T12:00:00-08:00: a TOML date, or a string',
81
+ check(value) {
82
+ const date = readDate(value);
83
+ return 'error' in date ? date : undefined;
84
+ },
85
+ },
86
+ 'hex-colour': {
87
+ description: 'an sRGB colour in hex, such as "#00594f"',
88
+ check(value) {
89
+ return /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(value) ? undefined : { error: 'is not a hex colour', fix: 'write # and six hex digits, such as "#00594f"' };
90
+ },
91
+ },
92
+ };
93
+ function checkPath(value) {
94
+ if (value === '')
95
+ return { error: 'is empty' };
96
+ if (value.includes('\\'))
97
+ return { error: 'has a backslash', fix: `use / between folders: "${value.replaceAll('\\', '/')}"` };
98
+ if (value.startsWith('/') || /^[a-zA-Z]:/.test(value))
99
+ return { error: 'is not a path in the project', fix: 'write it relative to pulpweaver4.toml' };
100
+ if (value.split('/').includes('..'))
101
+ return { error: 'is outside the project', fix: 'keep the project’s files inside its folder' };
102
+ return undefined;
103
+ }
104
+ /** Checks `value`, found at `path`, against `schema`, and lists every problem. */
105
+ export function checkSchema(value, schema, path = []) {
106
+ const problems = [];
107
+ check(value, schema, path, problems);
108
+ return problems;
109
+ }
110
+ /** The type of a TOML value, in a schema’s words, with `datetime` for TOML’s dates and times. */
111
+ export function typeOf(value) {
112
+ if (Array.isArray(value))
113
+ return 'array';
114
+ if (value instanceof TomlDateTime)
115
+ return 'datetime';
116
+ if (value === null || value === undefined)
117
+ return 'null';
118
+ if (typeof value === 'number')
119
+ return Number.isInteger(value) ? 'integer' : 'number';
120
+ if (typeof value === 'string' || typeof value === 'boolean')
121
+ return typeof value;
122
+ return 'object';
123
+ }
124
+ function check(value, schema, path, out) {
125
+ const at = (code, message, fix, part = 'value') => out.push({ path, part, code, message, ...(fix === undefined ? {} : { fix }) });
126
+ const name = describePath(path);
127
+ // A TOML date is a string of the `date` format, as Taplo has it, read as written.
128
+ if (value instanceof TomlDateTime && isDateString(schema))
129
+ value = value.text;
130
+ if (schema.anyOf) {
131
+ const branches = schema.anyOf.filter((b) => accepts(b, value));
132
+ if (branches.length === 0) {
133
+ at('wrong-type', `${name} must be ${describe(schema)}, not ${describeValue(value)}`, exampleFix(schema, path));
134
+ return;
135
+ }
136
+ // The first branch that takes the value cleanly, else the first that takes its type.
137
+ let first;
138
+ for (const branch of branches) {
139
+ const problems = [];
140
+ check(value, branch, path, problems);
141
+ if (problems.length === 0)
142
+ return;
143
+ first ??= problems;
144
+ }
145
+ out.push(...first);
146
+ return;
147
+ }
148
+ if (schema.type !== undefined && !typeMatches(schema.type, value)) {
149
+ at('wrong-type', `${name} must be ${describe(schema)}, not ${describeValue(value)}`, exampleFix(schema, path));
150
+ return;
151
+ }
152
+ if (schema.const !== undefined && value !== schema.const) {
153
+ at('bad-value', `${name} must be ${literal(schema.const)}, not ${describeValue(value)}`);
154
+ return;
155
+ }
156
+ if (schema.enum !== undefined && !schema.enum.includes(value)) {
157
+ const near = typeof value === 'string' ? didYouMean(value, schema.enum.filter((e) => typeof e === 'string')) : undefined;
158
+ at('bad-value', `${name} must be ${orList(schema.enum.map(literal))}, not ${describeValue(value)}`, near === undefined ? undefined : `did you mean ${literal(near)}?`);
159
+ return;
160
+ }
161
+ if (typeof value === 'string') {
162
+ if (schema.minLength !== undefined && value.length < schema.minLength) {
163
+ at('bad-value', value === '' ? `${name} is empty` : `${name} is too short: at least ${schema.minLength} characters`, exampleFix(schema, path));
164
+ }
165
+ if (schema.pattern !== undefined && !new RegExp(schema.pattern, 'u').test(value)) {
166
+ at('bad-value', `${name} must match ${schema.pattern}, not ${literal(value)}`, exampleFix(schema, path));
167
+ }
168
+ if (schema.format !== undefined) {
169
+ const format = FORMATS[schema.format];
170
+ if (!format)
171
+ throw new Error(`schema: unknown format ${JSON.stringify(schema.format)} at ${name}`);
172
+ const problem = format.check(value);
173
+ if (problem)
174
+ at('bad-value', `${name} must be ${format.description.replace(/,? such as .*$/, '')}: ${literal(value)} ${problem.error}`, problem.fix);
175
+ }
176
+ }
177
+ if (typeof value === 'number') {
178
+ if (schema.minimum !== undefined && value < schema.minimum)
179
+ at('bad-value', `${name} must be at least ${schema.minimum}, not ${value}`);
180
+ if (schema.maximum !== undefined && value > schema.maximum)
181
+ at('bad-value', `${name} must be at most ${schema.maximum}, not ${value}`);
182
+ }
183
+ if (Array.isArray(value)) {
184
+ if (schema.minItems !== undefined && value.length < schema.minItems) {
185
+ at('bad-value', schema.minItems === 1 ? `${name} is empty` : `${name} must have at least ${schema.minItems} items, not ${value.length}`, exampleFix(schema, path));
186
+ }
187
+ if (schema.maxItems !== undefined && value.length > schema.maxItems)
188
+ at('bad-value', `${name} must have at most ${schema.maxItems} items, not ${value.length}`);
189
+ value.forEach((item, i) => {
190
+ const itemSchema = schema.prefixItems?.[i] ?? schema.items;
191
+ if (itemSchema === false) {
192
+ out.push({ path: [...path, i], part: 'value', code: 'bad-value', message: `${describePath([...path, i])} is one item too many: ${name} has at most ${schema.prefixItems?.length ?? 0}` });
193
+ }
194
+ else if (itemSchema)
195
+ check(item, itemSchema, [...path, i], out);
196
+ });
197
+ if (schema.uniqueItems) {
198
+ const seen = new Set();
199
+ value.forEach((item, i) => {
200
+ const key = JSON.stringify(item);
201
+ if (seen.has(key))
202
+ out.push({ path: [...path, i], part: 'value', code: 'bad-value', message: `${name} lists ${describeValue(item)} twice`, fix: 'remove one' });
203
+ seen.add(key);
204
+ });
205
+ }
206
+ }
207
+ if (typeOf(value) === 'object') {
208
+ const table = value;
209
+ const known = Object.keys(schema.properties ?? {});
210
+ for (const key of schema.required ?? []) {
211
+ if (!Object.hasOwn(table, key)) {
212
+ const example = schema.properties?.[key]?.examples?.[0];
213
+ out.push({
214
+ path,
215
+ part: 'key',
216
+ code: 'missing-key',
217
+ message: `${path.length === 0 ? 'the file' : describeTable(path)} needs ${key}`,
218
+ ...(example === undefined ? {} : { fix: `add ${tomlKey(key)} = ${tomlValue(example)}` }),
219
+ });
220
+ }
221
+ }
222
+ for (const [key, item] of Object.entries(table)) {
223
+ const keyPath = [...path, key];
224
+ if (schema.propertyNames) {
225
+ for (const p of checkSchema(key, schema.propertyNames, keyPath)) {
226
+ out.push({ ...p, part: 'key', message: p.message.replace(describePath(keyPath), `the key ${literal(key)}`) });
227
+ }
228
+ }
229
+ const propertySchema = schema.properties?.[key];
230
+ if (propertySchema)
231
+ check(item, propertySchema, keyPath, out);
232
+ else if (schema.additionalProperties === false) {
233
+ const near = didYouMean(key, known);
234
+ const fix = near !== undefined
235
+ ? `did you mean ${near}?`
236
+ : known.length === 0 ? 'remove it: this table takes no keys' : known.length <= 12 ? `the keys here are ${known.join(', ')}` : undefined;
237
+ out.push({ path: keyPath, part: 'key', code: 'unknown-key', message: `unknown key ${tomlKey(key)} in ${describeTable(path)}`, ...(fix === undefined ? {} : { fix }) });
238
+ }
239
+ else if (typeof schema.additionalProperties === 'object')
240
+ check(item, schema.additionalProperties, keyPath, out);
241
+ }
242
+ }
243
+ }
244
+ function isDateString(schema) {
245
+ return schema.type === 'string' && schema.format === 'date';
246
+ }
247
+ /** Whether a branch of `anyOf` takes `value`’s type. */
248
+ function accepts(schema, value) {
249
+ if (value instanceof TomlDateTime && isDateString(schema))
250
+ return true;
251
+ if (schema.anyOf)
252
+ return schema.anyOf.some((b) => accepts(b, value));
253
+ if (schema.const !== undefined)
254
+ return typeof schema.const === typeof value && (typeof value !== 'string' || schema.type === undefined || schema.type === 'string');
255
+ if (schema.enum !== undefined && schema.type === undefined)
256
+ return schema.enum.some((e) => typeof e === typeof value);
257
+ return schema.type === undefined || typeMatches(schema.type, value);
258
+ }
259
+ function typeMatches(type, value) {
260
+ const actual = typeOf(value);
261
+ return actual === type || (type === 'number' && actual === 'integer');
262
+ }
263
+ /** What a schema takes, as a noun phrase: `a string`, `"screen" or "print"`. */
264
+ export function describe(schema) {
265
+ if (schema.anyOf)
266
+ return orList(schema.anyOf.map(describe));
267
+ if (schema.const !== undefined)
268
+ return literal(schema.const);
269
+ if (schema.enum !== undefined)
270
+ return orList(schema.enum.map(literal));
271
+ if (schema.format !== undefined && FORMATS[schema.format])
272
+ return FORMATS[schema.format].description.replace(/,? such as .*$/, '');
273
+ switch (schema.type) {
274
+ case 'string': return 'a string';
275
+ case 'integer': return schema.minimum === 1 ? 'a positive whole number' : 'a whole number';
276
+ case 'number': return 'a number';
277
+ case 'boolean': return 'true or false';
278
+ case 'array': return schema.items && schema.items.type === 'string' ? 'an array of strings' : 'an array';
279
+ case 'object': return 'a table';
280
+ }
281
+ return 'any value';
282
+ }
283
+ function describeValue(value) {
284
+ switch (typeOf(value)) {
285
+ case 'string': return literal(value);
286
+ case 'integer':
287
+ case 'number':
288
+ case 'boolean': return String(value);
289
+ case 'datetime': return 'a date';
290
+ case 'array': return 'an array';
291
+ case 'object': return 'a table';
292
+ case 'null': return 'nothing';
293
+ }
294
+ }
295
+ function literal(value) {
296
+ return typeof value === 'string' ? JSON.stringify(value) : String(value);
297
+ }
298
+ function orList(items) {
299
+ return items.length <= 2 ? items.join(' or ') : `${items.slice(0, -1).join(', ')} or ${items.at(-1)}`;
300
+ }
301
+ function exampleFix(schema, path) {
302
+ const example = schema.examples?.[0] ?? schema.anyOf?.find((b) => b.examples)?.examples?.[0];
303
+ const key = path.at(-1);
304
+ if (example === undefined || typeof key !== 'string')
305
+ return undefined;
306
+ return `for example, ${tomlKey(key)} = ${tomlValue(example)}`;
307
+ }
308
+ /** A key as TOML writes it: bare if it can be, quoted if not. */
309
+ export function tomlKey(key) {
310
+ return /^[A-Za-z0-9_-]+$/.test(key) ? key : JSON.stringify(key);
311
+ }
312
+ /** A value as TOML writes it, for fixes and the docs. */
313
+ export function tomlValue(value) {
314
+ if (Array.isArray(value))
315
+ return `[${value.map(tomlValue).join(', ')}]`;
316
+ if (typeOf(value) === 'object') {
317
+ const entries = Object.entries(value);
318
+ return entries.length === 0 ? '{}' : `{ ${entries.map(([k, v]) => `${tomlKey(k)} = ${tomlValue(v)}`).join(', ')} }`;
319
+ }
320
+ return typeof value === 'string' ? JSON.stringify(value) : String(value);
321
+ }
322
+ /** A value’s place, as its dotted key: `editions.web.media`, `lint.rules.widow[1]`. */
323
+ export function describePath(path) {
324
+ let out = '';
325
+ for (const segment of path)
326
+ out += typeof segment === 'number' ? `[${segment}]` : `${out === '' ? '' : '.'}${tomlKey(segment)}`;
327
+ return out === '' ? 'the file' : out;
328
+ }
329
+ /** A table, as its header would name it: `[editions.web]`, or `the file` for the top level. */
330
+ export function describeTable(path) {
331
+ return path.length === 0 ? 'the top level' : `[${describePath(path)}]`;
332
+ }
333
+ //# sourceMappingURL=schema.js.map