pulpweaver4 0.0.88 → 0.0.185

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 (540) hide show
  1. package/dist/ast/djot.d.ts +2 -1
  2. package/dist/ast/djot.js +31 -2
  3. package/dist/ast/djot.js.map +1 -1
  4. package/dist/ast/index.d.ts +1 -0
  5. package/dist/ast/index.js +1 -0
  6. package/dist/ast/index.js.map +1 -1
  7. package/dist/ast/nodes.d.ts +72 -9
  8. package/dist/ast/nodes.js +8 -0
  9. package/dist/ast/nodes.js.map +1 -1
  10. package/dist/ast/table.d.ts +27 -0
  11. package/dist/ast/table.js +32 -0
  12. package/dist/ast/table.js.map +1 -0
  13. package/dist/browser.js +2420 -0
  14. package/dist/citations/book.d.ts +2 -0
  15. package/dist/citations/book.js +17 -6
  16. package/dist/citations/book.js.map +1 -1
  17. package/dist/citations/collect.d.ts +5 -1
  18. package/dist/citations/collect.js +5 -1
  19. package/dist/citations/collect.js.map +1 -1
  20. package/dist/citations/index.d.ts +1 -1
  21. package/dist/citations/index.js +1 -1
  22. package/dist/citations/index.js.map +1 -1
  23. package/dist/citations/notes.js +54 -11
  24. package/dist/citations/notes.js.map +1 -1
  25. package/dist/citations/positions.js +4 -4
  26. package/dist/citations/positions.js.map +1 -1
  27. package/dist/citations/project.d.ts +12 -2
  28. package/dist/citations/project.js +21 -7
  29. package/dist/citations/project.js.map +1 -1
  30. package/dist/colour/images.d.ts +11 -2
  31. package/dist/colour/images.js +53 -3
  32. package/dist/colour/images.js.map +1 -1
  33. package/dist/colour/ink-limit.d.ts +2 -2
  34. package/dist/colour/ink-limit.js +6 -0
  35. package/dist/colour/ink-limit.js.map +1 -1
  36. package/dist/colour/intents.d.ts +10 -0
  37. package/dist/colour/intents.js +10 -0
  38. package/dist/colour/intents.js.map +1 -1
  39. package/dist/colour/previews.d.ts +8 -4
  40. package/dist/colour/previews.js +11 -8
  41. package/dist/colour/previews.js.map +1 -1
  42. package/dist/config/config.d.ts +99 -6
  43. package/dist/config/config.js +217 -6
  44. package/dist/config/config.js.map +1 -1
  45. package/dist/config/project-schema.d.ts +0 -8
  46. package/dist/config/project-schema.js +221 -12
  47. package/dist/config/project-schema.js.map +1 -1
  48. package/dist/config/schema.js +10 -0
  49. package/dist/config/schema.js.map +1 -1
  50. package/dist/config/secrets.d.ts +11 -0
  51. package/dist/config/secrets.js +19 -0
  52. package/dist/config/secrets.js.map +1 -0
  53. package/dist/csl/processor.d.ts +3 -1
  54. package/dist/csl/processor.js +19 -13
  55. package/dist/csl/processor.js.map +1 -1
  56. package/dist/csl/project.d.ts +19 -4
  57. package/dist/csl/project.js +31 -11
  58. package/dist/csl/project.js.map +1 -1
  59. package/dist/djot/djot.js/src/ast.d.ts +4 -1
  60. package/dist/djot/djot.js/src/ast.js +8 -1
  61. package/dist/djot/djot.js/src/ast.js.map +1 -1
  62. package/dist/djot/djot.js/src/djot-renderer.js +3 -3
  63. package/dist/djot/djot.js/src/djot-renderer.js.map +1 -1
  64. package/dist/djot/djot.js/src/html.js +2 -1
  65. package/dist/djot/djot.js/src/html.js.map +1 -1
  66. package/dist/djot/djot.js/src/inline.d.ts +1 -1
  67. package/dist/djot/djot.js/src/inline.js +25 -12
  68. package/dist/djot/djot.js/src/inline.js.map +1 -1
  69. package/dist/djot/djot.js/src/pandoc.js +81 -11
  70. package/dist/djot/djot.js/src/pandoc.js.map +1 -1
  71. package/dist/djot/djot.js/src/parse.js +12 -3
  72. package/dist/djot/djot.js/src/parse.js.map +1 -1
  73. package/dist/fonts/index.d.ts +1 -1
  74. package/dist/fonts/index.js +1 -1
  75. package/dist/fonts/index.js.map +1 -1
  76. package/dist/fonts/lint.d.ts +51 -0
  77. package/dist/fonts/lint.js +101 -16
  78. package/dist/fonts/lint.js.map +1 -1
  79. package/dist/fonts/walk.d.ts +13 -0
  80. package/dist/fonts/walk.js +50 -33
  81. package/dist/fonts/walk.js.map +1 -1
  82. package/dist/html/css.d.ts +4 -0
  83. package/dist/html/css.js +11 -3
  84. package/dist/html/css.js.map +1 -1
  85. package/dist/html/dom.d.ts +6 -1
  86. package/dist/html/dom.js +28 -6
  87. package/dist/html/dom.js.map +1 -1
  88. package/dist/html/generated.d.ts +17 -0
  89. package/dist/html/generated.js +21 -0
  90. package/dist/html/generated.js.map +1 -0
  91. package/dist/html/images.d.ts +18 -0
  92. package/dist/html/images.js +49 -2
  93. package/dist/html/images.js.map +1 -1
  94. package/dist/html/index.d.ts +1 -0
  95. package/dist/html/index.js +1 -0
  96. package/dist/html/index.js.map +1 -1
  97. package/dist/html/render.d.ts +5 -4
  98. package/dist/html/render.js +34 -9
  99. package/dist/html/render.js.map +1 -1
  100. package/dist/hyphenation/exceptions.d.ts +5 -0
  101. package/dist/hyphenation/exceptions.js +11 -0
  102. package/dist/hyphenation/exceptions.js.map +1 -1
  103. package/dist/hyphenation/index.d.ts +1 -1
  104. package/dist/hyphenation/index.js +1 -1
  105. package/dist/hyphenation/index.js.map +1 -1
  106. package/dist/import/convert.d.ts +21 -0
  107. package/dist/import/convert.js +65 -0
  108. package/dist/import/convert.js.map +1 -0
  109. package/dist/incremental/cache.d.ts +59 -0
  110. package/dist/incremental/cache.js +64 -0
  111. package/dist/incremental/cache.js.map +1 -0
  112. package/dist/incremental/index.d.ts +3 -0
  113. package/dist/incremental/index.js +4 -0
  114. package/dist/incremental/index.js.map +1 -0
  115. package/dist/incremental/keys.d.ts +27 -0
  116. package/dist/incremental/keys.js +89 -0
  117. package/dist/incremental/keys.js.map +1 -0
  118. package/dist/incremental/session.d.ts +180 -0
  119. package/dist/incremental/session.js +401 -0
  120. package/dist/incremental/session.js.map +1 -0
  121. package/dist/index.d.ts +6 -0
  122. package/dist/index.js +6 -0
  123. package/dist/index.js.map +1 -1
  124. package/dist/indexes/layout.d.ts +8 -2
  125. package/dist/indexes/layout.js +6 -4
  126. package/dist/indexes/layout.js.map +1 -1
  127. package/dist/layout/cache.d.ts +174 -0
  128. package/dist/layout/cache.js +150 -0
  129. package/dist/layout/cache.js.map +1 -0
  130. package/dist/layout/converge.d.ts +28 -0
  131. package/dist/layout/converge.js +102 -9
  132. package/dist/layout/converge.js.map +1 -1
  133. package/dist/layout/counters.d.ts +4 -0
  134. package/dist/layout/counters.js +15 -0
  135. package/dist/layout/counters.js.map +1 -1
  136. package/dist/layout/index.d.ts +5 -2
  137. package/dist/layout/index.js +3 -0
  138. package/dist/layout/index.js.map +1 -1
  139. package/dist/layout/lists.d.ts +52 -3
  140. package/dist/layout/lists.js +513 -46
  141. package/dist/layout/lists.js.map +1 -1
  142. package/dist/layout/lookahead.d.ts +151 -0
  143. package/dist/layout/lookahead.js +581 -0
  144. package/dist/layout/lookahead.js.map +1 -0
  145. package/dist/layout/margin-boxes.d.ts +11 -1
  146. package/dist/layout/margin-boxes.js +24 -1
  147. package/dist/layout/margin-boxes.js.map +1 -1
  148. package/dist/layout/page-box.d.ts +2 -0
  149. package/dist/layout/page-box.js +6 -4
  150. package/dist/layout/page-box.js.map +1 -1
  151. package/dist/layout/page-rules.d.ts +8 -1
  152. package/dist/layout/page-rules.js +46 -2
  153. package/dist/layout/page-rules.js.map +1 -1
  154. package/dist/layout/page.js +4 -2
  155. package/dist/layout/page.js.map +1 -1
  156. package/dist/layout/pagebuilder.d.ts +248 -3
  157. package/dist/layout/pagebuilder.js +512 -19
  158. package/dist/layout/pagebuilder.js.map +1 -1
  159. package/dist/layout/pages.d.ts +116 -3
  160. package/dist/layout/pages.js +1396 -162
  161. package/dist/layout/pages.js.map +1 -1
  162. package/dist/layout/paragraph.d.ts +14 -0
  163. package/dist/layout/paragraph.js +304 -31
  164. package/dist/layout/paragraph.js.map +1 -1
  165. package/dist/layout/pre.js +4 -0
  166. package/dist/layout/pre.js.map +1 -1
  167. package/dist/layout/protrusion.d.ts +26 -0
  168. package/dist/layout/protrusion.js +39 -0
  169. package/dist/layout/protrusion.js.map +1 -0
  170. package/dist/layout/ranges.d.ts +2 -0
  171. package/dist/layout/ranges.js +22 -0
  172. package/dist/layout/ranges.js.map +1 -0
  173. package/dist/layout/region.d.ts +2 -1
  174. package/dist/layout/region.js +9 -5
  175. package/dist/layout/region.js.map +1 -1
  176. package/dist/layout/templates.d.ts +71 -0
  177. package/dist/layout/templates.js +290 -0
  178. package/dist/layout/templates.js.map +1 -0
  179. package/dist/layout/vlist.d.ts +3 -3
  180. package/dist/linebreak/items.d.ts +27 -2
  181. package/dist/linebreak/items.js +10 -3
  182. package/dist/linebreak/items.js.map +1 -1
  183. package/dist/linebreak/knuth-plass.d.ts +20 -0
  184. package/dist/linebreak/knuth-plass.js +68 -16
  185. package/dist/linebreak/knuth-plass.js.map +1 -1
  186. package/dist/lint/book.d.ts +13 -0
  187. package/dist/lint/book.js +52 -0
  188. package/dist/lint/book.js.map +1 -0
  189. package/dist/lint/config.d.ts +9 -0
  190. package/dist/lint/config.js +40 -6
  191. package/dist/lint/config.js.map +1 -1
  192. package/dist/lint/linter.js +1 -0
  193. package/dist/lint/linter.js.map +1 -1
  194. package/dist/lint/project.js +1 -1
  195. package/dist/lint/project.js.map +1 -1
  196. package/dist/lint/rules/layout.d.ts +3 -1
  197. package/dist/lint/rules/layout.js +8 -6
  198. package/dist/lint/rules/layout.js.map +1 -1
  199. package/dist/lint/rules/source.d.ts +3 -1
  200. package/dist/lint/rules/source.js +9 -4
  201. package/dist/lint/rules/source.js.map +1 -1
  202. package/dist/lint/testing.js +1 -0
  203. package/dist/lint/testing.js.map +1 -1
  204. package/dist/measure/bidi-data.d.ts +14 -0
  205. package/dist/measure/bidi-data.js +69 -0
  206. package/dist/measure/bidi-data.js.map +1 -0
  207. package/dist/measure/bidi.d.ts +70 -0
  208. package/dist/measure/bidi.js +225 -0
  209. package/dist/measure/bidi.js.map +1 -0
  210. package/dist/measure/css.d.ts +5 -0
  211. package/dist/measure/css.js +2 -0
  212. package/dist/measure/css.js.map +1 -1
  213. package/dist/measure/measurer.d.ts +36 -2
  214. package/dist/measure/measurer.js +220 -22
  215. package/dist/measure/measurer.js.map +1 -1
  216. package/dist/measure/model.d.ts +20 -2
  217. package/dist/measure/model.js +13 -6
  218. package/dist/measure/model.js.map +1 -1
  219. package/dist/measure/script-data.d.ts +6 -0
  220. package/dist/measure/script-data.js +34 -0
  221. package/dist/measure/script-data.js.map +1 -0
  222. package/dist/measure/scripts.d.ts +36 -0
  223. package/dist/measure/scripts.js +293 -0
  224. package/dist/measure/scripts.js.map +1 -0
  225. package/dist/output/output.d.ts +35 -3
  226. package/dist/output/output.js +26 -4
  227. package/dist/output/output.js.map +1 -1
  228. package/dist/paint/backgrounds.js +7 -20
  229. package/dist/paint/backgrounds.js.map +1 -1
  230. package/dist/paint/blend.d.ts +33 -13
  231. package/dist/paint/blend.js +73 -21
  232. package/dist/paint/blend.js.map +1 -1
  233. package/dist/paint/cache.d.ts +80 -0
  234. package/dist/paint/cache.js +537 -0
  235. package/dist/paint/cache.js.map +1 -0
  236. package/dist/paint/canvas.d.ts +4 -13
  237. package/dist/paint/canvas.js +45 -5
  238. package/dist/paint/canvas.js.map +1 -1
  239. package/dist/paint/context.d.ts +2 -0
  240. package/dist/paint/emphasis.js +1 -1
  241. package/dist/paint/emphasis.js.map +1 -1
  242. package/dist/paint/flatten.d.ts +24 -2
  243. package/dist/paint/flatten.js +55 -12
  244. package/dist/paint/flatten.js.map +1 -1
  245. package/dist/paint/forms.d.ts +64 -0
  246. package/dist/paint/forms.js +319 -0
  247. package/dist/paint/forms.js.map +1 -0
  248. package/dist/paint/images.d.ts +4 -1
  249. package/dist/paint/images.js +13 -2
  250. package/dist/paint/images.js.map +1 -1
  251. package/dist/paint/layers.d.ts +64 -0
  252. package/dist/paint/layers.js +137 -0
  253. package/dist/paint/layers.js.map +1 -0
  254. package/dist/paint/painter.d.ts +19 -6
  255. package/dist/paint/painter.js +15 -135
  256. package/dist/paint/painter.js.map +1 -1
  257. package/dist/paint/stacking.d.ts +1 -1
  258. package/dist/paint/stacking.js +9 -2
  259. package/dist/paint/stacking.js.map +1 -1
  260. package/dist/paint/text.d.ts +14 -3
  261. package/dist/paint/text.js +25 -4
  262. package/dist/paint/text.js.map +1 -1
  263. package/dist/paint/vertical.js +2 -2
  264. package/dist/paint/vertical.js.map +1 -1
  265. package/dist/pdf/encoded.d.ts +16 -0
  266. package/dist/pdf/encoded.js +35 -0
  267. package/dist/pdf/encoded.js.map +1 -0
  268. package/dist/pdf/include/colour.d.ts +105 -0
  269. package/dist/pdf/include/colour.js +349 -0
  270. package/dist/pdf/include/colour.js.map +1 -0
  271. package/dist/pdf/include/functions.d.ts +17 -0
  272. package/dist/pdf/include/functions.js +389 -0
  273. package/dist/pdf/include/functions.js.map +1 -0
  274. package/dist/pdf/include/pages.d.ts +14 -0
  275. package/dist/pdf/include/pages.js +27 -0
  276. package/dist/pdf/include/pages.js.map +1 -0
  277. package/dist/pdf/include/pdfjs/LICENSE +177 -0
  278. package/dist/pdf/include/pdfjs/pdf.min.mjs +27 -0
  279. package/dist/pdf/include/pdfjs/pdf.worker.min.mjs +27 -0
  280. package/dist/pdf/include/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  281. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  282. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  283. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  284. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  285. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  286. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  287. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  288. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  289. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  290. package/dist/pdf/include/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  291. package/dist/pdf/include/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  292. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  293. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  294. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  295. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  296. package/dist/pdf/include/pdfjs/wasm/LICENSE_JBIG2 +196 -0
  297. package/dist/pdf/include/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
  298. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  299. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  300. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
  301. package/dist/pdf/include/pdfjs/wasm/LICENSE_QCMS +21 -0
  302. package/dist/pdf/include/pdfjs/wasm/jbig2.wasm +0 -0
  303. package/dist/pdf/include/pdfjs/wasm/openjpeg.wasm +0 -0
  304. package/dist/pdf/include/pdfjs/wasm/qcms_bg.wasm +0 -0
  305. package/dist/pdf/include/pdfjs/wasm/quickjs-eval.wasm +0 -0
  306. package/dist/pdf/include/prepare.d.ts +58 -0
  307. package/dist/pdf/include/prepare.js +266 -0
  308. package/dist/pdf/include/prepare.js.map +1 -0
  309. package/dist/pdf/include/preview.d.ts +38 -0
  310. package/dist/pdf/include/preview.js +101 -0
  311. package/dist/pdf/include/preview.js.map +1 -0
  312. package/dist/pdf/include/rewrite.d.ts +57 -0
  313. package/dist/pdf/include/rewrite.js +803 -0
  314. package/dist/pdf/include/rewrite.js.map +1 -0
  315. package/dist/pdf/include/serialize.d.ts +32 -0
  316. package/dist/pdf/include/serialize.js +158 -0
  317. package/dist/pdf/include/serialize.js.map +1 -0
  318. package/dist/pdf/include/testing.d.ts +26 -0
  319. package/dist/pdf/include/testing.js +50 -0
  320. package/dist/pdf/include/testing.js.map +1 -0
  321. package/dist/pdf/index.d.ts +1 -0
  322. package/dist/pdf/index.js +1 -0
  323. package/dist/pdf/index.js.map +1 -1
  324. package/dist/pdf/structure/annotations.d.ts +33 -0
  325. package/dist/pdf/structure/annotations.js +112 -0
  326. package/dist/pdf/structure/annotations.js.map +1 -0
  327. package/dist/pdf/structure/forms.d.ts +10 -0
  328. package/dist/pdf/structure/forms.js +46 -0
  329. package/dist/pdf/structure/forms.js.map +1 -0
  330. package/dist/pdf/structure/index.d.ts +41 -5
  331. package/dist/pdf/structure/index.js +40 -5
  332. package/dist/pdf/structure/index.js.map +1 -1
  333. package/dist/pdf/structure/links.d.ts +2 -0
  334. package/dist/pdf/structure/links.js +1 -1
  335. package/dist/pdf/structure/links.js.map +1 -1
  336. package/dist/pdf/structure/presentation.d.ts +28 -0
  337. package/dist/pdf/structure/presentation.js +79 -0
  338. package/dist/pdf/structure/presentation.js.map +1 -0
  339. package/dist/pdf/structure/tags.d.ts +34 -2
  340. package/dist/pdf/structure/tags.js +117 -14
  341. package/dist/pdf/structure/tags.js.map +1 -1
  342. package/dist/pdf/types.d.ts +378 -15
  343. package/dist/pdf/wasm/pulpweaver4_pdf.d.ts +44 -2
  344. package/dist/pdf/wasm/pulpweaver4_pdf.js +191 -2
  345. package/dist/pdf/wasm/pulpweaver4_pdf_bg.wasm +0 -0
  346. package/dist/pdf/writer.d.ts +13 -1
  347. package/dist/pdf/writer.js +26 -1
  348. package/dist/pdf/writer.js.map +1 -1
  349. package/dist/plugin/define.d.ts +200 -15
  350. package/dist/plugin/define.js +124 -15
  351. package/dist/plugin/define.js.map +1 -1
  352. package/dist/plugin/failure.d.ts +1 -1
  353. package/dist/plugin/index.d.ts +5 -4
  354. package/dist/plugin/index.js +5 -4
  355. package/dist/plugin/index.js.map +1 -1
  356. package/dist/plugin/reference.d.ts +38 -0
  357. package/dist/plugin/reference.js +287 -0
  358. package/dist/plugin/reference.js.map +1 -0
  359. package/dist/plugin/register.d.ts +39 -7
  360. package/dist/plugin/register.js +83 -2
  361. package/dist/plugin/register.js.map +1 -1
  362. package/dist/preflight/index.d.ts +1 -1
  363. package/dist/preflight/index.js +1 -1
  364. package/dist/preflight/index.js.map +1 -1
  365. package/dist/preflight/pdfx.d.ts +35 -0
  366. package/dist/preflight/pdfx.js +37 -4
  367. package/dist/preflight/pdfx.js.map +1 -1
  368. package/dist/preflight/reader.d.ts +10 -3
  369. package/dist/preflight/reader.js +86 -5
  370. package/dist/preflight/reader.js.map +1 -1
  371. package/dist/print/impose.d.ts +66 -0
  372. package/dist/print/impose.js +331 -0
  373. package/dist/print/impose.js.map +1 -0
  374. package/dist/print/output.js +426 -60
  375. package/dist/print/output.js.map +1 -1
  376. package/dist/problem.js +4 -3
  377. package/dist/problem.js.map +1 -1
  378. package/dist/profile/index.d.ts +1 -0
  379. package/dist/profile/index.js +1 -0
  380. package/dist/profile/index.js.map +1 -1
  381. package/dist/profile/lint.d.ts +1 -1
  382. package/dist/profile/lint.js +29 -1
  383. package/dist/profile/lint.js.map +1 -1
  384. package/dist/profile/list-table.d.ts +51 -0
  385. package/dist/profile/list-table.js +137 -0
  386. package/dist/profile/list-table.js.map +1 -0
  387. package/dist/profile/metadata.js +3 -0
  388. package/dist/profile/metadata.js.map +1 -1
  389. package/dist/profile/profile.d.ts +3 -0
  390. package/dist/profile/profile.js +9 -1
  391. package/dist/profile/profile.js.map +1 -1
  392. package/dist/project.js +3 -0
  393. package/dist/project.js.map +1 -1
  394. package/dist/qpdf/index.d.ts +2 -0
  395. package/dist/qpdf/index.js +3 -0
  396. package/dist/qpdf/index.js.map +1 -0
  397. package/dist/qpdf/qpdf.d.ts +125 -0
  398. package/dist/qpdf/qpdf.js +205 -0
  399. package/dist/qpdf/qpdf.js.map +1 -0
  400. package/dist/qpdf/testing.d.ts +12 -0
  401. package/dist/qpdf/testing.js +9 -0
  402. package/dist/qpdf/testing.js.map +1 -0
  403. package/dist/qpdf/wasm/LICENSE-qpdf +202 -0
  404. package/dist/qpdf/wasm/LICENSE-zlib +22 -0
  405. package/dist/qpdf/wasm/NOTICE-qpdf.md +42 -0
  406. package/dist/qpdf/wasm/qpdf.wasm +0 -0
  407. package/dist/render/index.d.ts +3 -0
  408. package/dist/render/index.js +2 -0
  409. package/dist/render/index.js.map +1 -0
  410. package/dist/render/render.d.ts +98 -0
  411. package/dist/render/render.js +243 -0
  412. package/dist/render/render.js.map +1 -0
  413. package/dist/reproducible/clock.d.ts +4 -5
  414. package/dist/reproducible/clock.js +4 -5
  415. package/dist/reproducible/clock.js.map +1 -1
  416. package/dist/spike/spike-page.chromium.json +4 -4
  417. package/dist/style/colours.d.ts +7 -2
  418. package/dist/style/colours.js +24 -2
  419. package/dist/style/colours.js.map +1 -1
  420. package/dist/style/compile.js +1 -1
  421. package/dist/style/compile.js.map +1 -1
  422. package/dist/style/defaults.d.ts +9 -3
  423. package/dist/style/defaults.js +14 -2
  424. package/dist/style/defaults.js.map +1 -1
  425. package/dist/style/gcpm.d.ts +1 -1
  426. package/dist/style/gcpm.js +17 -5
  427. package/dist/style/gcpm.js.map +1 -1
  428. package/dist/style/properties.js +84 -0
  429. package/dist/style/properties.js.map +1 -1
  430. package/dist/test/book.d.ts +22 -2
  431. package/dist/test/book.js +35 -2
  432. package/dist/test/book.js.map +1 -1
  433. package/dist/test/build.d.ts +23 -0
  434. package/dist/test/build.js +86 -33
  435. package/dist/test/build.js.map +1 -1
  436. package/dist/test/layout.js +132 -22
  437. package/dist/test/layout.js.map +1 -1
  438. package/dist/test/limits.d.ts +8 -0
  439. package/dist/test/limits.js +9 -0
  440. package/dist/test/limits.js.map +1 -0
  441. package/dist/test/pipeline.d.ts +26 -0
  442. package/dist/test/pipeline.js +4 -2
  443. package/dist/test/pipeline.js.map +1 -1
  444. package/dist/test/render.d.ts +26 -3
  445. package/dist/test/render.js +151 -23
  446. package/dist/test/render.js.map +1 -1
  447. package/dist/test/runner.d.ts +6 -3
  448. package/dist/test/runner.js +172 -105
  449. package/dist/test/runner.js.map +1 -1
  450. package/dist/test/text.js +2 -2
  451. package/dist/test/text.js.map +1 -1
  452. package/dist/text/output.js +2 -2
  453. package/dist/text/output.js.map +1 -1
  454. package/dist/text/render.d.ts +4 -3
  455. package/dist/text/render.js +128 -6
  456. package/dist/text/render.js.map +1 -1
  457. package/dist/transform/index.d.ts +1 -1
  458. package/dist/transform/index.js +1 -1
  459. package/dist/transform/index.js.map +1 -1
  460. package/dist/transform/run.d.ts +2 -0
  461. package/dist/transform/run.js +32 -16
  462. package/dist/transform/run.js.map +1 -1
  463. package/dist/web/output.js +116 -10
  464. package/dist/web/output.js.map +1 -1
  465. package/dist/web/runtime/justify.js.txt +2 -2
  466. package/dist/web/site.d.ts +2 -0
  467. package/dist/web/site.js +8 -1
  468. package/dist/web/site.js.map +1 -1
  469. package/docs/README.md +6 -1
  470. package/docs/manual/chapters/front.dj +34 -0
  471. package/docs/manual/chapters/guides/citations.dj +426 -0
  472. package/docs/manual/chapters/guides/colour-and-prepress.dj +261 -0
  473. package/docs/manual/chapters/guides/editions.dj +329 -0
  474. package/docs/manual/chapters/guides/in-a-web-page.dj +143 -0
  475. package/docs/manual/chapters/guides/lines-and-pages.dj +681 -0
  476. package/docs/manual/chapters/guides/lint-rules.dj +355 -0
  477. package/docs/manual/chapters/guides/pdfs.dj +501 -0
  478. package/docs/manual/chapters/guides/plugins.dj +425 -0
  479. package/docs/manual/chapters/guides/testing.dj +264 -0
  480. package/docs/manual/chapters/guides/writing-in-djot.dj +537 -0
  481. package/docs/manual/chapters/start/for-latex-users.dj +256 -0
  482. package/docs/manual/chapters/start/getting-started.dj +167 -0
  483. package/docs/manual/chapters/start/your-first-book.dj +426 -0
  484. package/docs/manual/fonts/CrimsonPro-Italic-VF.ttf +0 -0
  485. package/docs/manual/fonts/CrimsonPro-VF.ttf +0 -0
  486. package/docs/manual/fonts/JetBrainsMono-Regular.otf +0 -0
  487. package/docs/manual/fonts/NotoSansSymbols2-Boxes.ttf +0 -0
  488. package/docs/manual/fonts/OFL.txt +95 -0
  489. package/docs/manual/pulpweaver4.toml +39 -0
  490. package/docs/manual/styles/manual.css +137 -0
  491. package/docs/reference/css-properties/index.md +9 -0
  492. package/docs/reference/css-properties/pw-expansion.md +31 -0
  493. package/docs/reference/css-properties/pw-flow-into.md +31 -0
  494. package/docs/reference/css-properties/pw-knockout.md +26 -0
  495. package/docs/reference/css-properties/pw-layer.md +24 -0
  496. package/docs/reference/css-properties/pw-page-breaking.md +30 -0
  497. package/docs/reference/css-properties/pw-page-duration.md +28 -0
  498. package/docs/reference/css-properties/pw-page-rotate.md +29 -0
  499. package/docs/reference/css-properties/pw-page-transition.md +29 -0
  500. package/docs/reference/css-properties/pw-protrusion.md +31 -0
  501. package/docs/reference/lint-rules/ibid-across-page.md +2 -2
  502. package/docs/reference/lint-rules/unused-entry.md +3 -1
  503. package/docs/reference/plugin-api/capabilities.md +2 -2
  504. package/docs/reference/plugin-api/claim-kind.md +1 -1
  505. package/docs/reference/plugin-api/combine-exceptions.md +19 -0
  506. package/docs/reference/plugin-api/element-break-context.md +34 -0
  507. package/docs/reference/plugin-api/element-break-item.md +24 -0
  508. package/docs/reference/plugin-api/element-breaker.md +24 -0
  509. package/docs/reference/plugin-api/flow-definition.md +30 -0
  510. package/docs/reference/plugin-api/generated-reference.md +32 -0
  511. package/docs/reference/plugin-api/index-definition.md +32 -0
  512. package/docs/reference/plugin-api/index-titles.md +18 -0
  513. package/docs/reference/plugin-api/index.md +27 -3
  514. package/docs/reference/plugin-api/insert-class-definition.md +46 -0
  515. package/docs/reference/plugin-api/insert-placement.md +22 -0
  516. package/docs/reference/plugin-api/insert-placements.md +18 -0
  517. package/docs/reference/plugin-api/layout-definition.md +9 -5
  518. package/docs/reference/plugin-api/layout-slot.md +6 -16
  519. package/docs/reference/plugin-api/lint-context.md +3 -1
  520. package/docs/reference/plugin-api/lint-definition.md +1 -1
  521. package/docs/reference/plugin-api/lint-edition.md +2 -0
  522. package/docs/reference/plugin-api/page-builder-event.md +22 -0
  523. package/docs/reference/plugin-api/page-builder-hook.md +7 -3
  524. package/docs/reference/plugin-api/page-builder-page-event.md +30 -0
  525. package/docs/reference/plugin-api/page-template-definition.md +34 -0
  526. package/docs/reference/plugin-api/page-template-region-definition.md +46 -0
  527. package/docs/reference/plugin-api/plugin-definition.md +5 -1
  528. package/docs/reference/plugin-api/plugin-reference-options.md +32 -0
  529. package/docs/reference/plugin-api/plugin-reference.md +22 -0
  530. package/docs/reference/plugin-api/plugin-registry.md +15 -5
  531. package/docs/reference/plugin-api/plugin-stage.md +1 -1
  532. package/docs/reference/plugin-api/plugin.md +9 -2
  533. package/docs/reference/plugin-api/reference-page.md +34 -0
  534. package/docs/reference/plugin-api/render-reference-page.md +18 -0
  535. package/docs/reference/plugin-api/renderers.md +1 -1
  536. package/docs/reference/pulpweaver4-toml/editions.md +253 -2
  537. package/docs/reference/pulpweaver4-toml/index.md +57 -1
  538. package/docs/reference/pulpweaver4-toml/inks.md +15 -4
  539. package/docs/reference/pulpweaver4-toml/lint.md +1 -1
  540. package/package.json +5 -1
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,22 @@
1
+ Copyright notice:
2
+
3
+ (C) 1995-2026 Jean-loup Gailly and Mark Adler
4
+
5
+ This software is provided 'as-is', without any express or implied
6
+ warranty. In no event will the authors be held liable for any damages
7
+ arising from the use of this software.
8
+
9
+ Permission is granted to anyone to use this software for any purpose,
10
+ including commercial applications, and to alter it and redistribute it
11
+ freely, subject to the following restrictions:
12
+
13
+ 1. The origin of this software must not be misrepresented; you must not
14
+ claim that you wrote the original software. If you use this software
15
+ in a product, an acknowledgment in the product documentation would be
16
+ appreciated but is not required.
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+ 3. This notice may not be removed or altered from any source distribution.
20
+
21
+ Jean-loup Gailly Mark Adler
22
+ jloup@gzip.org madler@alumni.caltech.edu
@@ -0,0 +1,42 @@
1
+ qpdf is copyright (c) 2005-2021 Jay Berkenbilt, 2022-2026 Jay Berkenbilt and Manfred Holger
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
4
+
5
+ http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
+
9
+ Versions of qpdf prior to version 7 were released under the terms of version 2.0 of the Artistic License. At your option, you may continue to consider qpdf to be licensed under those terms. Please see the manual for additional information.
10
+
11
+ The qpdf distribution includes a copy of [qtest](https://qtest.sourceforge.io), which is released under the terms of the [version 2.0 of the Artistic license](https://opensource.org/licenses/Artistic-2.0), which can be found at https://opensource.org/licenses/Artistic-2.0.
12
+
13
+ The Rijndael encryption implementation used as the basis for AES encryption and decryption support comes from Philip J. Erdelsky's public domain implementation. The files `libqpdf/rijndael.cc` and `libqpdf/qpdf/rijndael.h` remain in the public domain. They were obtained from
14
+ * http://www.efgh.com/software/rijndael.htm
15
+ * http://www.efgh.com/software/rijndael.txt
16
+
17
+ The embedded sha2 code comes from sphlib 3.0
18
+ * http://www.saphir2.com/sphlib/
19
+
20
+ That code has the following license:
21
+ ```
22
+ Copyright (c) 2007-2011 Projet RNRT SAPHIR
23
+
24
+ Permission is hereby granted, free of charge, to any person obtaining
25
+ a copy of this software and associated documentation files (the
26
+ "Software"), to deal in the Software without restriction, including
27
+ without limitation the rights to use, copy, modify, merge, publish,
28
+ distribute, sublicense, and/or sell copies of the Software, and to
29
+ permit persons to whom the Software is furnished to do so, subject to
30
+ the following conditions:
31
+
32
+ The above copyright notice and this permission notice shall be included
33
+ in all copies or substantial portions of the Software.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
37
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
38
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
39
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
40
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
41
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42
+ ```
Binary file
@@ -0,0 +1,3 @@
1
+ export { render, type ProjectFiles, type RenderOptions, type Rendering, type RenderSource } from './render.js';
2
+ export type { Book, Page, Pages } from '../test/book.js';
3
+ export type { FontSource } from '../test/pipeline.js';
@@ -0,0 +1,2 @@
1
+ export { render } from './render.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA4E,MAAM,aAAa,CAAA"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * `render()`: pulpweaver4 in any browser page, as a library
3
+ * (https://plans.inkylabs.com/pulpweaver#where-it-runs). It renders Djot, a
4
+ * page's own HTML or a whole project's files and paginates them in place,
5
+ * in the calling page, as Paged.js does: the pages a print edition's build
6
+ * lays out, styled by the project's stylesheets over the core's defaults,
7
+ * with its `pulpweaver4.toml`'s editions and the plugins it is given.
8
+ *
9
+ * Under it is a build session (`incremental/session.ts`) on a project in
10
+ * memory: the source is its chapter (`index.dj`), the CSS its
11
+ * stylesheet (`styles/render.css`), the configuration its
12
+ * `pulpweaver4.toml`, with the title, language and chapter filled in where
13
+ * it leaves them out. `render()` again on the same container, or the same
14
+ * element, is an edit to that session: a changed chapter is laid out again
15
+ * from what the last build made, anything else builds the book again from
16
+ * nothing, in the same place.
17
+ */
18
+ import { BuildSession, type PageState } from '../incremental/session.js';
19
+ import type { Plugin } from '../plugin/define.js';
20
+ import { type Problem } from '../problem.js';
21
+ import type { Book } from '../test/book.js';
22
+ import type { FontSource } from '../test/pipeline.js';
23
+ /** A project's files, by their paths in it: text, or bytes (a font, an image). */
24
+ export type ProjectFiles = Readonly<Record<string, string | Uint8Array>>;
25
+ /**
26
+ * What `render()` lays out: Djot, the text of the book's one chapter; an
27
+ * element of the page, whose contents are the document; or a whole
28
+ * project's files, `pulpweaver4.toml` among them.
29
+ */
30
+ export type RenderSource = string | HTMLElement | ProjectFiles;
31
+ export interface RenderOptions {
32
+ /**
33
+ * Where the pages go: the build's own element is put in it. For Djot or
34
+ * a project, `document.body` if absent; for an element, a new one just
35
+ * after it, which the element is hidden behind until `dispose()`. In a
36
+ * shadow root, the stylesheet's `:root` is the host.
37
+ */
38
+ readonly container?: HTMLElement;
39
+ /**
40
+ * The project's `pulpweaver4.toml`, for Djot or an element: its editions,
41
+ * lint rules and plugins' options. Its `title`, `language` (the page's
42
+ * `lang`) and `chapters` are filled in where absent; without it, the book
43
+ * has one print edition on a trade page.
44
+ */
45
+ readonly config?: string;
46
+ /** The author's stylesheet, as a project's `styles/*.css`, over the core's defaults, the theme's and the plugins'. */
47
+ readonly css?: string;
48
+ /** The project's other files, for Djot or an element: a bibliography, images, fonts its CSS names. */
49
+ readonly files?: ProjectFiles;
50
+ /** The edition to lay out, as `pulpweaver4.toml` names it: its first PDF edition if absent. */
51
+ readonly edition?: string;
52
+ /**
53
+ * Plugins, as imported (`definePlugin`'s). One `[plugins]` names, by its
54
+ * name, takes its options from there; the others are added with none.
55
+ * `[plugins]` may also name a module by its URL, which is imported.
56
+ */
57
+ readonly plugins?: readonly Plugin[];
58
+ /** Fonts to register with the measurer and the page, beside those the stylesheets' `@font-face` rules name in the project's files. */
59
+ readonly fonts?: readonly FontSource[];
60
+ /** Whether the edition's lint rules run over the book, as `pw build` runs them, their problems among the rendering's. Off by default. */
61
+ readonly lint?: boolean;
62
+ /**
63
+ * What a book with errors does: shown, its problems in `problems` (the
64
+ * default, as an editor shows them), or thrown as a `BuildProblemsError`.
65
+ * A `pulpweaver4.toml` with errors always throws.
66
+ */
67
+ readonly errors?: 'throw' | 'keep';
68
+ /**
69
+ * Told of each update the pages get on their own: when an edit's lookahead
70
+ * search, left to idle time behind a preview, has finished (`state`).
71
+ */
72
+ readonly onUpdate?: (rendering: Rendering) => void;
73
+ }
74
+ /** A document rendered into the page: its book as laid out, and its problems. */
75
+ export interface Rendering {
76
+ /** The book as laid out: its AST (but for HTML), its HTML and its pages (`book.pages`). */
77
+ readonly book: Book;
78
+ /** Every problem, sorted: the configuration's, the plugins' and the book's. */
79
+ readonly problems: readonly Problem[];
80
+ /** The pages, counted from 1, that this update made or changed; every page, the first time. */
81
+ readonly changed: readonly number[];
82
+ /** Whether the pages are exact, or a preview's while the lookahead search goes on in idle time. */
83
+ readonly state: PageState;
84
+ /** The element the pages are in. */
85
+ readonly container: HTMLElement;
86
+ /** The build session under it, for its PDF (`writePdf`) among the rest. */
87
+ readonly session: BuildSession;
88
+ /** Makes the pages exact, finishing any search a preview left. */
89
+ exact(): Promise<Rendering>;
90
+ /** Takes the pages out of the page, and shows the element rendered again. */
91
+ dispose(): void;
92
+ }
93
+ /**
94
+ * Renders a document and paginates it in place, in this page. Called again
95
+ * on the same container or element, it updates the pages (only a chapter's
96
+ * edit is laid out incrementally), and returns the new rendering.
97
+ */
98
+ export declare function render(source: RenderSource, options?: RenderOptions): Promise<Rendering>;
@@ -0,0 +1,243 @@
1
+ /**
2
+ * `render()`: pulpweaver4 in any browser page, as a library
3
+ * (https://plans.inkylabs.com/pulpweaver#where-it-runs). It renders Djot, a
4
+ * page's own HTML or a whole project's files and paginates them in place,
5
+ * in the calling page, as Paged.js does: the pages a print edition's build
6
+ * lays out, styled by the project's stylesheets over the core's defaults,
7
+ * with its `pulpweaver4.toml`'s editions and the plugins it is given.
8
+ *
9
+ * Under it is a build session (`incremental/session.ts`) on a project in
10
+ * memory: the source is its chapter (`index.dj`), the CSS its
11
+ * stylesheet (`styles/render.css`), the configuration its
12
+ * `pulpweaver4.toml`, with the title, language and chapter filled in where
13
+ * it leaves them out. `render()` again on the same container, or the same
14
+ * element, is an edit to that session: a changed chapter is laid out again
15
+ * from what the last build made, anything else builds the book again from
16
+ * nothing, in the same place.
17
+ */
18
+ import { BuildSession } from '../incremental/session.js';
19
+ import { TomlDocument } from '../config/toml.js';
20
+ import { loadPlugins, readPluginStyles } from '../plugin/load.js';
21
+ import { problemKey, sortProblems } from '../problem.js';
22
+ import { loadProject } from '../project.js';
23
+ import { BuildProblemsError } from '../test/plugins.js';
24
+ import { MemoryFS } from '../vfs/memory.js';
25
+ const CONFIG = 'pulpweaver4.toml';
26
+ const CHAPTER = 'index.dj';
27
+ const STYLESHEET = 'styles/render.css';
28
+ const DEFAULT_CONFIG = '[editions.print]\nmedia = "print"\npage = "5.5in 8.5in"\n';
29
+ const targets = new WeakMap();
30
+ /**
31
+ * Renders a document and paginates it in place, in this page. Called again
32
+ * on the same container or element, it updates the pages (only a chapter's
33
+ * edit is laid out incrementally), and returns the new rendering.
34
+ */
35
+ export function render(source, options = {}) {
36
+ const element = isElement(source) ? source : undefined;
37
+ const key = element ?? options.container ?? document.body;
38
+ // One render of a target at a time, each after the last.
39
+ const last = targets.get(key) ?? Promise.resolve(undefined);
40
+ const next = last.catch(() => undefined).then(async (target) => {
41
+ const t = target && !target.disposed ? await update(target, source, options) : await open(key, source, options);
42
+ return t;
43
+ });
44
+ targets.set(key, next.then((r) => r.target, () => undefined));
45
+ return next.then((r) => r.rendering);
46
+ }
47
+ async function open(key, source, options, previous) {
48
+ const element = isElement(source) ? source : undefined;
49
+ let host = previous?.host ?? options.container;
50
+ if (!host && element) {
51
+ host = document.createElement('div');
52
+ host.className = 'pw-render';
53
+ element.after(host);
54
+ }
55
+ host ??= document.body;
56
+ const setup = setupOf(options, element !== undefined);
57
+ const plugins = await Promise.all(setup.plugins.map((p) => readPluginStyles(p)));
58
+ const fs = new MemoryFS();
59
+ const files = projectFiles(source, options, plugins);
60
+ for (const [path, data] of files)
61
+ await fs.writeFile(path, data);
62
+ const { project, registry, problems } = await loadWithPlugins(fs, plugins);
63
+ const html = element?.innerHTML;
64
+ const target = {
65
+ key, host, setup, fs, files, problems, plugged: registry !== undefined, onUpdate: options.onUpdate, disposed: false, session: undefined,
66
+ ...(element ? { element: previous?.element ?? { el: element, hidden: element.hidden } } : {}),
67
+ ...(html !== undefined ? { html } : {}),
68
+ };
69
+ const sessionOptions = {
70
+ project, container: host, styled: true, lint: setup.lint, errors: setup.errors,
71
+ ...(setup.edition !== undefined ? { edition: setup.edition } : {}),
72
+ ...(setup.fonts.length ? { fonts: [...setup.fonts] } : {}),
73
+ ...(registry ? { registry } : plugins.length ? { plugins } : {}),
74
+ ...(html !== undefined ? { html } : {}),
75
+ onUpdate: (u) => {
76
+ if (!target.disposed)
77
+ target.onUpdate?.(view(target, u));
78
+ },
79
+ };
80
+ const { session, update } = await BuildSession.open(sessionOptions);
81
+ target.session = session;
82
+ // A new session's pages are in; the last one's come out.
83
+ if (previous)
84
+ dispose(previous, false);
85
+ if (element)
86
+ element.hidden = true;
87
+ return { target, rendering: view(target, update) };
88
+ }
89
+ async function update(target, source, options) {
90
+ const element = isElement(source) ? source : undefined;
91
+ const setup = setupOf(options, element !== undefined);
92
+ const plugins = await Promise.all(setup.plugins.map((p) => readPluginStyles(p)));
93
+ const files = projectFiles(source, options, plugins);
94
+ const changed = [...new Set([...files.keys(), ...target.files.keys()])].filter((path) => !same(files.get(path), target.files.get(path)));
95
+ // Other plugins, fonts or edition, or a pulpweaver4.toml that may change what the plugins are given: a new session, in the same place.
96
+ if (!sameSetup(setup, target.setup) || (changed.includes(CONFIG) && (target.plugged || plugins.length))) {
97
+ return open(target.key, source, options, target);
98
+ }
99
+ target.onUpdate = options.onUpdate;
100
+ for (const path of changed) {
101
+ const data = files.get(path);
102
+ if (data === undefined)
103
+ await target.fs.remove(path);
104
+ else
105
+ await target.fs.writeFile(path, data);
106
+ }
107
+ target.files = files;
108
+ const edits = changed.map((path) => {
109
+ const text = files.get(path);
110
+ const chapter = target.session.files.some((s) => s.path === path);
111
+ return chapter && typeof text === 'string' ? { path, text } : { path };
112
+ });
113
+ const html = element?.innerHTML;
114
+ if (html !== undefined && html !== target.html) {
115
+ target.html = html;
116
+ edits.push({ html });
117
+ }
118
+ if (changed.includes(CONFIG))
119
+ target.problems = (await loadProject(target.fs)).problems.slice();
120
+ if (!edits.length)
121
+ return { target, rendering: current(target) };
122
+ const u = await target.session.update(edits);
123
+ return { target, rendering: view(target, u) };
124
+ }
125
+ /** The project's files: a project's own, or Djot's or an element's in a project made for it. */
126
+ function projectFiles(source, options, plugins) {
127
+ const files = new Map();
128
+ if (typeof source === 'object' && !isElement(source)) {
129
+ for (const [path, data] of Object.entries(source))
130
+ files.set(path, data);
131
+ }
132
+ else {
133
+ for (const [path, data] of Object.entries(options.files ?? {}))
134
+ files.set(path, data);
135
+ files.set(CONFIG, completeConfig(options.config ?? DEFAULT_CONFIG));
136
+ files.set(CHAPTER, typeof source === 'string' ? source : '');
137
+ }
138
+ if (options.css !== undefined)
139
+ files.set(STYLESHEET, options.css);
140
+ // A plugin `[plugins]` doesn't name is added to it, with no options.
141
+ const config = files.get(CONFIG);
142
+ if (typeof config === 'string') {
143
+ const table = TomlDocument.parse(config, CONFIG).value?.plugins;
144
+ const named = table && typeof table === 'object' && !Array.isArray(table) ? Object.keys(table) : [];
145
+ const added = plugins.filter((p) => !named.includes(p.name));
146
+ if (added.length)
147
+ files.set(CONFIG, config + added.map((p) => `\n[plugins.${JSON.stringify(p.name)}]\n`).join(''));
148
+ }
149
+ return files;
150
+ }
151
+ /** `pulpweaver4.toml` with the keys a project needs, where it leaves them out: a title, the page's language, the one chapter. */
152
+ function completeConfig(config) {
153
+ const head = config.split(/^\s*\[/m)[0];
154
+ const has = (key) => new RegExp(`^\\s*${key}\\s*=`, 'm').test(head);
155
+ const added = [
156
+ has('title') ? '' : `title = ${JSON.stringify(document.title || 'Untitled')}\n`,
157
+ has('language') ? '' : `language = ${JSON.stringify(document.documentElement.lang || 'en')}\n`,
158
+ has('chapters') ? '' : `chapters = [${JSON.stringify(CHAPTER)}]\n`,
159
+ ].join('');
160
+ return added + config;
161
+ }
162
+ /** The project, its plugins registered (those `[plugins]` names by name from those given, by URL imported): it throws if its `pulpweaver4.toml` has errors. */
163
+ async function loadWithPlugins(fs, plugins) {
164
+ const project = await loadProject(fs);
165
+ if (!project.config)
166
+ throw new BuildProblemsError(project.problems.filter((p) => p.severity === 'error'), project.configText);
167
+ if (!Object.keys(project.config.plugins).length)
168
+ return { project, problems: project.problems.slice() };
169
+ const importer = {
170
+ package: async (name) => {
171
+ const plugin = plugins.find((p) => p.name === name);
172
+ if (!plugin)
173
+ throw new Error(`it isn't among the plugins render() was given (${plugins.map((p) => p.name).join(', ') || 'none'})`);
174
+ return { default: plugin };
175
+ },
176
+ };
177
+ const loaded = await loadPlugins(project, { importer });
178
+ const problems = [...loaded.project.problems, ...loaded.problems];
179
+ if (!loaded.project.config)
180
+ throw new BuildProblemsError(problems.filter((p) => p.severity === 'error'), project.configText);
181
+ return { project: loaded.project, registry: loaded.registry, problems };
182
+ }
183
+ function view(target, update) {
184
+ const { session } = target;
185
+ const known = new Set(update.book.problems.map(problemKey));
186
+ const problems = sortProblems([...target.problems.filter((p) => !known.has(problemKey(p))), ...update.book.problems], session.files.map((s) => s.path));
187
+ return {
188
+ book: update.book,
189
+ problems,
190
+ changed: update.changed,
191
+ get state() {
192
+ return session.state;
193
+ },
194
+ container: target.host.querySelector(':scope > .pw-build') ?? target.host,
195
+ session,
196
+ exact: async () => {
197
+ const u = await session.exact();
198
+ return u ? view(target, u) : current(target);
199
+ },
200
+ dispose: () => dispose(target, true),
201
+ };
202
+ }
203
+ /** The rendering as it stands, no page changed. */
204
+ function current(target) {
205
+ const book = target.session.book;
206
+ return view(target, { book, changed: [], removed: 0, full: false, paragraphs: { reused: 0, laidOut: 0 }, made: 0, ms: 0, state: target.session.state });
207
+ }
208
+ function dispose(target, all) {
209
+ if (target.disposed)
210
+ return;
211
+ target.disposed = true;
212
+ target.session.dispose();
213
+ if (!all)
214
+ return;
215
+ if (target.element) {
216
+ target.element.el.hidden = target.element.hidden;
217
+ if (target.host.className === 'pw-render' && target.host !== target.element.el)
218
+ target.host.remove();
219
+ }
220
+ targets.delete(target.key);
221
+ }
222
+ function setupOf(options, html) {
223
+ return {
224
+ edition: options.edition, plugins: options.plugins ?? [], fonts: options.fonts ?? [], lint: options.lint ?? false,
225
+ errors: options.errors ?? 'keep', html,
226
+ };
227
+ }
228
+ function sameSetup(a, b) {
229
+ const list = (x, y) => x.length === y.length && x.every((v, i) => v === y[i]);
230
+ return a.edition === b.edition && a.lint === b.lint && a.errors === b.errors && a.html === b.html &&
231
+ list(a.plugins, b.plugins) && list(a.fonts, b.fonts);
232
+ }
233
+ function same(a, b) {
234
+ if (a === b)
235
+ return true;
236
+ if (!(a instanceof Uint8Array) || !(b instanceof Uint8Array) || a.length !== b.length)
237
+ return false;
238
+ return a.every((v, i) => v === b[i]);
239
+ }
240
+ function isElement(source) {
241
+ return typeof HTMLElement !== 'undefined' && source instanceof HTMLElement;
242
+ }
243
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/render/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,YAAY,EAAgF,MAAM,2BAA2B,CAAA;AACtI,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAuB,MAAM,mBAAmB,CAAA;AAEtF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAgB,MAAM,eAAe,CAAA;AACtE,OAAO,EAAE,WAAW,EAAgB,MAAM,eAAe,CAAA;AAGzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oB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