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.
- package/dist/ast/djot.d.ts +123 -0
- package/dist/ast/djot.js +458 -0
- package/dist/ast/djot.js.map +1 -0
- package/dist/ast/index.d.ts +10 -0
- package/dist/ast/index.js +11 -0
- package/dist/ast/index.js.map +1 -0
- package/dist/ast/locator.d.ts +27 -0
- package/dist/ast/locator.js +77 -0
- package/dist/ast/locator.js.map +1 -0
- package/dist/ast/nodes.d.ts +534 -0
- package/dist/ast/nodes.js +48 -0
- package/dist/ast/nodes.js.map +1 -0
- package/dist/ast/position.d.ts +88 -0
- package/dist/ast/position.js +98 -0
- package/dist/ast/position.js.map +1 -0
- package/dist/ast/traverse.d.ts +12 -0
- package/dist/ast/traverse.js +37 -0
- package/dist/ast/traverse.js.map +1 -0
- package/dist/bibliography/biblatex.d.ts +13 -0
- package/dist/bibliography/biblatex.js +849 -0
- package/dist/bibliography/biblatex.js.map +1 -0
- package/dist/bibliography/bibtex.d.ts +39 -0
- package/dist/bibliography/bibtex.js +259 -0
- package/dist/bibliography/bibtex.js.map +1 -0
- package/dist/bibliography/csl.d.ts +9 -0
- package/dist/bibliography/csl.js +241 -0
- package/dist/bibliography/csl.js.map +1 -0
- package/dist/bibliography/dates.d.ts +33 -0
- package/dist/bibliography/dates.js +223 -0
- package/dist/bibliography/dates.js.map +1 -0
- package/dist/bibliography/index.d.ts +8 -0
- package/dist/bibliography/index.js +9 -0
- package/dist/bibliography/index.js.map +1 -0
- package/dist/bibliography/item.d.ts +142 -0
- package/dist/bibliography/item.js +181 -0
- package/dist/bibliography/item.js.map +1 -0
- package/dist/bibliography/latex.d.ts +21 -0
- package/dist/bibliography/latex.js +586 -0
- package/dist/bibliography/latex.js.map +1 -0
- package/dist/bibliography/names.d.ts +23 -0
- package/dist/bibliography/names.js +244 -0
- package/dist/bibliography/names.js.map +1 -0
- package/dist/bibliography/read.d.ts +24 -0
- package/dist/bibliography/read.js +50 -0
- package/dist/bibliography/read.js.map +1 -0
- package/dist/citations/book.d.ts +91 -0
- package/dist/citations/book.js +206 -0
- package/dist/citations/book.js.map +1 -0
- package/dist/citations/collect.d.ts +52 -0
- package/dist/citations/collect.js +125 -0
- package/dist/citations/collect.js.map +1 -0
- package/dist/citations/hast.d.ts +12 -0
- package/dist/citations/hast.js +49 -0
- package/dist/citations/hast.js.map +1 -0
- package/dist/citations/index.d.ts +14 -0
- package/dist/citations/index.js +15 -0
- package/dist/citations/index.js.map +1 -0
- package/dist/citations/lint.d.ts +70 -0
- package/dist/citations/lint.js +92 -0
- package/dist/citations/lint.js.map +1 -0
- package/dist/citations/notes.d.ts +11 -0
- package/dist/citations/notes.js +120 -0
- package/dist/citations/notes.js.map +1 -0
- package/dist/citations/positions.d.ts +34 -0
- package/dist/citations/positions.js +90 -0
- package/dist/citations/positions.js.map +1 -0
- package/dist/citations/project.d.ts +7 -0
- package/dist/citations/project.js +24 -0
- package/dist/citations/project.js.map +1 -0
- package/dist/colour/cmyk.d.ts +71 -0
- package/dist/colour/cmyk.js +210 -0
- package/dist/colour/cmyk.js.map +1 -0
- package/dist/colour/images.d.ts +36 -0
- package/dist/colour/images.js +106 -0
- package/dist/colour/images.js.map +1 -0
- package/dist/colour/index.d.ts +7 -0
- package/dist/colour/index.js +8 -0
- package/dist/colour/index.js.map +1 -0
- package/dist/colour/ink-limit.d.ts +68 -0
- package/dist/colour/ink-limit.js +109 -0
- package/dist/colour/ink-limit.js.map +1 -0
- package/dist/colour/intents.d.ts +135 -0
- package/dist/colour/intents.js +183 -0
- package/dist/colour/intents.js.map +1 -0
- package/dist/colour/lcms.d.ts +79 -0
- package/dist/colour/lcms.js +229 -0
- package/dist/colour/lcms.js.map +1 -0
- package/dist/colour/previews.d.ts +49 -0
- package/dist/colour/previews.js +116 -0
- package/dist/colour/previews.js.map +1 -0
- package/dist/colour/wasm/LICENSE-lcms2 +22 -0
- package/dist/colour/wasm/lcms2.wasm +0 -0
- package/dist/config/config.d.ts +109 -0
- package/dist/config/config.js +295 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/page.d.ts +42 -0
- package/dist/config/page.js +95 -0
- package/dist/config/page.js.map +1 -0
- package/dist/config/project-schema.d.ts +23 -0
- package/dist/config/project-schema.js +209 -0
- package/dist/config/project-schema.js.map +1 -0
- package/dist/config/schema.d.ts +68 -0
- package/dist/config/schema.js +333 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/toml.d.ts +54 -0
- package/dist/config/toml.js +238 -0
- package/dist/config/toml.js.map +1 -0
- package/dist/contents/index.d.ts +8 -0
- package/dist/contents/index.js +9 -0
- package/dist/contents/index.js.map +1 -0
- package/dist/contents/transform.d.ts +64 -0
- package/dist/contents/transform.js +149 -0
- package/dist/contents/transform.js.map +1 -0
- package/dist/csl/affix.d.ts +16 -0
- package/dist/csl/affix.js +74 -0
- package/dist/csl/affix.js.map +1 -0
- package/dist/csl/data/chicago-author-date.d.ts +2 -0
- package/dist/csl/data/chicago-author-date.js +3 -0
- package/dist/csl/data/chicago-author-date.js.map +1 -0
- package/dist/csl/data/chicago-notes-bibliography.d.ts +2 -0
- package/dist/csl/data/chicago-notes-bibliography.js +3 -0
- package/dist/csl/data/chicago-notes-bibliography.js.map +1 -0
- package/dist/csl/data/locales-en-GB.d.ts +2 -0
- package/dist/csl/data/locales-en-GB.js +3 -0
- package/dist/csl/data/locales-en-GB.js.map +1 -0
- package/dist/csl/data/locales-en-US.d.ts +2 -0
- package/dist/csl/data/locales-en-US.js +3 -0
- package/dist/csl/data/locales-en-US.js.map +1 -0
- package/dist/csl/dates.d.ts +30 -0
- package/dist/csl/dates.js +223 -0
- package/dist/csl/dates.js.map +1 -0
- package/dist/csl/format.d.ts +29 -0
- package/dist/csl/format.js +157 -0
- package/dist/csl/format.js.map +1 -0
- package/dist/csl/index.d.ts +26 -0
- package/dist/csl/index.js +16 -0
- package/dist/csl/index.js.map +1 -0
- package/dist/csl/ir.d.ts +103 -0
- package/dist/csl/ir.js +549 -0
- package/dist/csl/ir.js.map +1 -0
- package/dist/csl/load.d.ts +98 -0
- package/dist/csl/load.js +163 -0
- package/dist/csl/load.js.map +1 -0
- package/dist/csl/locale.d.ts +90 -0
- package/dist/csl/locale.js +251 -0
- package/dist/csl/locale.js.map +1 -0
- package/dist/csl/names.d.ts +41 -0
- package/dist/csl/names.js +203 -0
- package/dist/csl/names.js.map +1 -0
- package/dist/csl/numbers.d.ts +48 -0
- package/dist/csl/numbers.js +170 -0
- package/dist/csl/numbers.js.map +1 -0
- package/dist/csl/processor.d.ts +177 -0
- package/dist/csl/processor.js +759 -0
- package/dist/csl/processor.js.map +1 -0
- package/dist/csl/project.d.ts +21 -0
- package/dist/csl/project.js +78 -0
- package/dist/csl/project.js.map +1 -0
- package/dist/csl/render.d.ts +130 -0
- package/dist/csl/render.js +748 -0
- package/dist/csl/render.js.map +1 -0
- package/dist/csl/style.d.ts +168 -0
- package/dist/csl/style.js +262 -0
- package/dist/csl/style.js.map +1 -0
- package/dist/csl/xml.d.ts +28 -0
- package/dist/csl/xml.js +162 -0
- package/dist/csl/xml.js.map +1 -0
- package/dist/djot/djot.js/LICENSE +20 -0
- package/dist/djot/djot.js/src/ast.d.ts +324 -0
- package/dist/djot/djot.js/src/ast.js +61 -0
- package/dist/djot/djot.js/src/ast.js.map +1 -0
- package/dist/djot/djot.js/src/attributes.d.ts +31 -0
- package/dist/djot/djot.js/src/attributes.js +300 -0
- package/dist/djot/djot.js/src/attributes.js.map +1 -0
- package/dist/djot/djot.js/src/block.d.ts +87 -0
- package/dist/djot/djot.js/src/block.js +1201 -0
- package/dist/djot/djot.js/src/block.js.map +1 -0
- package/dist/djot/djot.js/src/djot-renderer.d.ts +8 -0
- package/dist/djot/djot.js/src/djot-renderer.js +755 -0
- package/dist/djot/djot.js/src/djot-renderer.js.map +1 -0
- package/dist/djot/djot.js/src/event.d.ts +6 -0
- package/dist/djot/djot.js/src/event.js +2 -0
- package/dist/djot/djot.js/src/event.js.map +1 -0
- package/dist/djot/djot.js/src/filter.d.ts +13 -0
- package/dist/djot/djot.js/src/filter.js +159 -0
- package/dist/djot/djot.js/src/filter.js.map +1 -0
- package/dist/djot/djot.js/src/find.d.ts +7 -0
- package/dist/djot/djot.js/src/find.js +33 -0
- package/dist/djot/djot.js/src/find.js.map +1 -0
- package/dist/djot/djot.js/src/html.d.ts +40 -0
- package/dist/djot/djot.js/src/html.js +656 -0
- package/dist/djot/djot.js/src/html.js.map +1 -0
- package/dist/djot/djot.js/src/index.d.ts +9 -0
- package/dist/djot/djot.js/src/index.js +9 -0
- package/dist/djot/djot.js/src/index.js.map +1 -0
- package/dist/djot/djot.js/src/inline.d.ts +62 -0
- package/dist/djot/djot.js/src/inline.js +1019 -0
- package/dist/djot/djot.js/src/inline.js.map +1 -0
- package/dist/djot/djot.js/src/options.d.ts +13 -0
- package/dist/djot/djot.js/src/options.js +27 -0
- package/dist/djot/djot.js/src/options.js.map +1 -0
- package/dist/djot/djot.js/src/pandoc.d.ts +20 -0
- package/dist/djot/djot.js/src/pandoc.js +1040 -0
- package/dist/djot/djot.js/src/pandoc.js.map +1 -0
- package/dist/djot/djot.js/src/parse.d.ts +19 -0
- package/dist/djot/djot.js/src/parse.js +1436 -0
- package/dist/djot/djot.js/src/parse.js.map +1 -0
- package/dist/djot/djot.js/src/version.d.ts +1 -0
- package/dist/djot/djot.js/src/version.js +2 -0
- package/dist/djot/djot.js/src/version.js.map +1 -0
- package/dist/djot/index.d.ts +5 -0
- package/dist/djot/index.js +6 -0
- package/dist/djot/index.js.map +1 -0
- package/dist/djot/read.d.ts +57 -0
- package/dist/djot/read.js +146 -0
- package/dist/djot/read.js.map +1 -0
- package/dist/fonts/css.d.ts +82 -0
- package/dist/fonts/css.js +329 -0
- package/dist/fonts/css.js.map +1 -0
- package/dist/fonts/faces.d.ts +101 -0
- package/dist/fonts/faces.js +226 -0
- package/dist/fonts/faces.js.map +1 -0
- package/dist/fonts/index.d.ts +12 -0
- package/dist/fonts/index.js +13 -0
- package/dist/fonts/index.js.map +1 -0
- package/dist/fonts/lint.d.ts +58 -0
- package/dist/fonts/lint.js +209 -0
- package/dist/fonts/lint.js.map +1 -0
- package/dist/fonts/match.d.ts +36 -0
- package/dist/fonts/match.js +104 -0
- package/dist/fonts/match.js.map +1 -0
- package/dist/fonts/names.d.ts +9 -0
- package/dist/fonts/names.js +50 -0
- package/dist/fonts/names.js.map +1 -0
- package/dist/fonts/subset.d.ts +72 -0
- package/dist/fonts/subset.js +169 -0
- package/dist/fonts/subset.js.map +1 -0
- package/dist/fonts/walk.d.ts +33 -0
- package/dist/fonts/walk.js +120 -0
- package/dist/fonts/walk.js.map +1 -0
- package/dist/fonts/wasm/LICENSE-harfbuzzjs +19 -0
- package/dist/fonts/wasm/harfbuzz-subset.wasm +0 -0
- package/dist/html/check.d.ts +62 -0
- package/dist/html/check.js +186 -0
- package/dist/html/check.js.map +1 -0
- package/dist/html/counters.d.ts +32 -0
- package/dist/html/counters.js +72 -0
- package/dist/html/counters.js.map +1 -0
- package/dist/html/css.d.ts +33 -0
- package/dist/html/css.js +72 -0
- package/dist/html/css.js.map +1 -0
- package/dist/html/dom.d.ts +28 -0
- package/dist/html/dom.js +162 -0
- package/dist/html/dom.js.map +1 -0
- package/dist/html/editions.d.ts +26 -0
- package/dist/html/editions.js +57 -0
- package/dist/html/editions.js.map +1 -0
- package/dist/html/images.d.ts +13 -0
- package/dist/html/images.js +62 -0
- package/dist/html/images.js.map +1 -0
- package/dist/html/index.d.ts +14 -0
- package/dist/html/index.js +15 -0
- package/dist/html/index.js.map +1 -0
- package/dist/html/registry.d.ts +120 -0
- package/dist/html/registry.js +48 -0
- package/dist/html/registry.js.map +1 -0
- package/dist/html/render.d.ts +99 -0
- package/dist/html/render.js +687 -0
- package/dist/html/render.js.map +1 -0
- package/dist/hyphenation/NOTICE +429 -0
- package/dist/hyphenation/exceptions.d.ts +60 -0
- package/dist/hyphenation/exceptions.js +79 -0
- package/dist/hyphenation/exceptions.js.map +1 -0
- package/dist/hyphenation/hyphenator.d.ts +66 -0
- package/dist/hyphenation/hyphenator.js +245 -0
- package/dist/hyphenation/hyphenator.js.map +1 -0
- package/dist/hyphenation/index.d.ts +4 -0
- package/dist/hyphenation/index.js +5 -0
- package/dist/hyphenation/index.js.map +1 -0
- package/dist/hyphenation/languages.d.ts +20 -0
- package/dist/hyphenation/languages.js +75 -0
- package/dist/hyphenation/languages.js.map +1 -0
- package/dist/hyphenation/patterns/af.wasm +0 -0
- package/dist/hyphenation/patterns/as.wasm +0 -0
- package/dist/hyphenation/patterns/be.wasm +0 -0
- package/dist/hyphenation/patterns/bg.wasm +0 -0
- package/dist/hyphenation/patterns/bn.wasm +0 -0
- package/dist/hyphenation/patterns/ca.wasm +0 -0
- package/dist/hyphenation/patterns/cy.wasm +0 -0
- package/dist/hyphenation/patterns/da.wasm +0 -0
- package/dist/hyphenation/patterns/de.wasm +0 -0
- package/dist/hyphenation/patterns/el-monoton.wasm +0 -0
- package/dist/hyphenation/patterns/el-polyton.wasm +0 -0
- package/dist/hyphenation/patterns/en-gb.wasm +0 -0
- package/dist/hyphenation/patterns/en-us.wasm +0 -0
- package/dist/hyphenation/patterns/eo.wasm +0 -0
- package/dist/hyphenation/patterns/es.wasm +0 -0
- package/dist/hyphenation/patterns/et.wasm +0 -0
- package/dist/hyphenation/patterns/eu.wasm +0 -0
- package/dist/hyphenation/patterns/fi-x-school.wasm +0 -0
- package/dist/hyphenation/patterns/fr.wasm +0 -0
- package/dist/hyphenation/patterns/fur.wasm +0 -0
- package/dist/hyphenation/patterns/ga.wasm +0 -0
- package/dist/hyphenation/patterns/gl.wasm +0 -0
- package/dist/hyphenation/patterns/gu.wasm +0 -0
- package/dist/hyphenation/patterns/hi.wasm +0 -0
- package/dist/hyphenation/patterns/hr.wasm +0 -0
- package/dist/hyphenation/patterns/hsb.wasm +0 -0
- package/dist/hyphenation/patterns/ia.wasm +0 -0
- package/dist/hyphenation/patterns/is.wasm +0 -0
- package/dist/hyphenation/patterns/it.wasm +0 -0
- package/dist/hyphenation/patterns/ka.wasm +0 -0
- package/dist/hyphenation/patterns/kmr.wasm +0 -0
- package/dist/hyphenation/patterns/kn.wasm +0 -0
- package/dist/hyphenation/patterns/la.wasm +0 -0
- package/dist/hyphenation/patterns/lt.wasm +0 -0
- package/dist/hyphenation/patterns/ml.wasm +0 -0
- package/dist/hyphenation/patterns/mn-cyrl.wasm +0 -0
- package/dist/hyphenation/patterns/mr.wasm +0 -0
- package/dist/hyphenation/patterns/nb.wasm +0 -0
- package/dist/hyphenation/patterns/nl.wasm +0 -0
- package/dist/hyphenation/patterns/nn.wasm +0 -0
- package/dist/hyphenation/patterns/no.wasm +0 -0
- package/dist/hyphenation/patterns/oc.wasm +0 -0
- package/dist/hyphenation/patterns/or.wasm +0 -0
- package/dist/hyphenation/patterns/pa.wasm +0 -0
- package/dist/hyphenation/patterns/pi.wasm +0 -0
- package/dist/hyphenation/patterns/pl.wasm +0 -0
- package/dist/hyphenation/patterns/pms.wasm +0 -0
- package/dist/hyphenation/patterns/pt.wasm +0 -0
- package/dist/hyphenation/patterns/rm.wasm +0 -0
- package/dist/hyphenation/patterns/ru.wasm +0 -0
- package/dist/hyphenation/patterns/sh-cyrl.wasm +0 -0
- package/dist/hyphenation/patterns/sh-latn.wasm +0 -0
- package/dist/hyphenation/patterns/sk.wasm +0 -0
- package/dist/hyphenation/patterns/sl.wasm +0 -0
- package/dist/hyphenation/patterns/sq.wasm +0 -0
- package/dist/hyphenation/patterns/sv.wasm +0 -0
- package/dist/hyphenation/patterns/ta.wasm +0 -0
- package/dist/hyphenation/patterns/te.wasm +0 -0
- package/dist/hyphenation/patterns/th.wasm +0 -0
- package/dist/hyphenation/patterns/tk.wasm +0 -0
- package/dist/hyphenation/patterns/tr.wasm +0 -0
- package/dist/hyphenation/patterns/uk.wasm +0 -0
- package/dist/hyphenation/patterns/zh-latn-pinyin.wasm +0 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/indexes/index.d.ts +10 -0
- package/dist/indexes/index.js +11 -0
- package/dist/indexes/index.js.map +1 -0
- package/dist/indexes/layout.d.ts +30 -0
- package/dist/indexes/layout.js +83 -0
- package/dist/indexes/layout.js.map +1 -0
- package/dist/indexes/locators.d.ts +33 -0
- package/dist/indexes/locators.js +51 -0
- package/dist/indexes/locators.js.map +1 -0
- package/dist/indexes/terms.d.ts +97 -0
- package/dist/indexes/terms.js +211 -0
- package/dist/indexes/terms.js.map +1 -0
- package/dist/indexes/transform.d.ts +90 -0
- package/dist/indexes/transform.js +154 -0
- package/dist/indexes/transform.js.map +1 -0
- package/dist/layout/calibrate.d.ts +12 -0
- package/dist/layout/calibrate.js +50 -0
- package/dist/layout/calibrate.js.map +1 -0
- package/dist/layout/converge.d.ts +31 -0
- package/dist/layout/converge.js +84 -0
- package/dist/layout/converge.js.map +1 -0
- package/dist/layout/counters.d.ts +16 -0
- package/dist/layout/counters.js +62 -0
- package/dist/layout/counters.js.map +1 -0
- package/dist/layout/first-letter.d.ts +34 -0
- package/dist/layout/first-letter.js +183 -0
- package/dist/layout/first-letter.js.map +1 -0
- package/dist/layout/fonts.d.ts +67 -0
- package/dist/layout/fonts.js +110 -0
- package/dist/layout/fonts.js.map +1 -0
- package/dist/layout/generated.d.ts +9 -0
- package/dist/layout/generated.js +83 -0
- package/dist/layout/generated.js.map +1 -0
- package/dist/layout/glue.d.ts +18 -0
- package/dist/layout/glue.js +48 -0
- package/dist/layout/glue.js.map +1 -0
- package/dist/layout/index.d.ts +17 -0
- package/dist/layout/index.js +18 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/lists.d.ts +91 -0
- package/dist/layout/lists.js +1068 -0
- package/dist/layout/lists.js.map +1 -0
- package/dist/layout/margin-boxes.d.ts +114 -0
- package/dist/layout/margin-boxes.js +429 -0
- package/dist/layout/margin-boxes.js.map +1 -0
- package/dist/layout/minipage.d.ts +85 -0
- package/dist/layout/minipage.js +83 -0
- package/dist/layout/minipage.js.map +1 -0
- package/dist/layout/page-box.d.ts +32 -0
- package/dist/layout/page-box.js +110 -0
- package/dist/layout/page-box.js.map +1 -0
- package/dist/layout/page-rules.d.ts +47 -0
- package/dist/layout/page-rules.js +202 -0
- package/dist/layout/page-rules.js.map +1 -0
- package/dist/layout/page.d.ts +51 -0
- package/dist/layout/page.js +133 -0
- package/dist/layout/page.js.map +1 -0
- package/dist/layout/pagebuilder.d.ts +243 -0
- package/dist/layout/pagebuilder.js +591 -0
- package/dist/layout/pagebuilder.js.map +1 -0
- package/dist/layout/pages.d.ts +71 -0
- package/dist/layout/pages.js +741 -0
- package/dist/layout/pages.js.map +1 -0
- package/dist/layout/paragraph.d.ts +194 -0
- package/dist/layout/paragraph.js +1148 -0
- package/dist/layout/paragraph.js.map +1 -0
- package/dist/layout/pre.d.ts +8 -0
- package/dist/layout/pre.js +151 -0
- package/dist/layout/pre.js.map +1 -0
- package/dist/layout/region.d.ts +66 -0
- package/dist/layout/region.js +200 -0
- package/dist/layout/region.js.map +1 -0
- package/dist/layout/vlist.d.ts +218 -0
- package/dist/layout/vlist.js +72 -0
- package/dist/layout/vlist.js.map +1 -0
- package/dist/linebreak/items.d.ts +69 -0
- package/dist/linebreak/items.js +44 -0
- package/dist/linebreak/items.js.map +1 -0
- package/dist/linebreak/knuth-plass.d.ts +149 -0
- package/dist/linebreak/knuth-plass.js +461 -0
- package/dist/linebreak/knuth-plass.js.map +1 -0
- package/dist/lint/config.d.ts +48 -0
- package/dist/lint/config.js +185 -0
- package/dist/lint/config.js.map +1 -0
- package/dist/lint/context.d.ts +64 -0
- package/dist/lint/context.js +37 -0
- package/dist/lint/context.js.map +1 -0
- package/dist/lint/fix.d.ts +40 -0
- package/dist/lint/fix.js +86 -0
- package/dist/lint/fix.js.map +1 -0
- package/dist/lint/index.d.ts +14 -0
- package/dist/lint/index.js +15 -0
- package/dist/lint/index.js.map +1 -0
- package/dist/lint/linter.d.ts +59 -0
- package/dist/lint/linter.js +239 -0
- package/dist/lint/linter.js.map +1 -0
- package/dist/lint/presets.d.ts +20 -0
- package/dist/lint/presets.js +65 -0
- package/dist/lint/presets.js.map +1 -0
- package/dist/lint/project.d.ts +31 -0
- package/dist/lint/project.js +100 -0
- package/dist/lint/project.js.map +1 -0
- package/dist/lint/rules/html.d.ts +30 -0
- package/dist/lint/rules/html.js +163 -0
- package/dist/lint/rules/html.js.map +1 -0
- package/dist/lint/rules/layout.d.ts +42 -0
- package/dist/lint/rules/layout.js +428 -0
- package/dist/lint/rules/layout.js.map +1 -0
- package/dist/lint/rules/source.d.ts +65 -0
- package/dist/lint/rules/source.js +334 -0
- package/dist/lint/rules/source.js.map +1 -0
- package/dist/lint/testing.d.ts +7 -0
- package/dist/lint/testing.js +77 -0
- package/dist/lint/testing.js.map +1 -0
- package/dist/math/hast.d.ts +46 -0
- package/dist/math/hast.js +297 -0
- package/dist/math/hast.js.map +1 -0
- package/dist/math/index.d.ts +9 -0
- package/dist/math/index.js +10 -0
- package/dist/math/index.js.map +1 -0
- package/dist/math/mathjax/LICENSE-mathjax +202 -0
- package/dist/math/mathjax/LICENSE-speech-rule-engine +177 -0
- package/dist/math/mathjax/sre/af.json +146 -0
- package/dist/math/mathjax/sre/base.json +140 -0
- package/dist/math/mathjax/sre/ca.json +140 -0
- package/dist/math/mathjax/sre/da.json +140 -0
- package/dist/math/mathjax/sre/de.json +146 -0
- package/dist/math/mathjax/sre/en.json +158 -0
- package/dist/math/mathjax/sre/es.json +140 -0
- package/dist/math/mathjax/sre/euro.json +32 -0
- package/dist/math/mathjax/sre/fr.json +146 -0
- package/dist/math/mathjax/sre/hi.json +146 -0
- package/dist/math/mathjax/sre/it.json +146 -0
- package/dist/math/mathjax/sre/ko.json +146 -0
- package/dist/math/mathjax/sre/nb.json +146 -0
- package/dist/math/mathjax/sre/nemeth.json +125 -0
- package/dist/math/mathjax/sre/nn.json +146 -0
- package/dist/math/mathjax/sre/sv.json +146 -0
- package/dist/math/mathjax/svg/PUA.json +1 -0
- package/dist/math/mathjax/svg/accents-b-i.json +1 -0
- package/dist/math/mathjax/svg/accents.json +1 -0
- package/dist/math/mathjax/svg/arabic.json +1 -0
- package/dist/math/mathjax/svg/arrows.json +1 -0
- package/dist/math/mathjax/svg/braille-d.json +1 -0
- package/dist/math/mathjax/svg/braille.json +1 -0
- package/dist/math/mathjax/svg/calligraphic.json +1 -0
- package/dist/math/mathjax/svg/cherokee.json +1 -0
- package/dist/math/mathjax/svg/cyrillic-ss.json +1 -0
- package/dist/math/mathjax/svg/cyrillic.json +1 -0
- package/dist/math/mathjax/svg/devanagari.json +1 -0
- package/dist/math/mathjax/svg/double-struck.json +1 -0
- package/dist/math/mathjax/svg/fraktur.json +1 -0
- package/dist/math/mathjax/svg/greek-ss.json +1 -0
- package/dist/math/mathjax/svg/greek.json +1 -0
- package/dist/math/mathjax/svg/hebrew.json +1 -0
- package/dist/math/mathjax/svg/latin-b.json +1 -0
- package/dist/math/mathjax/svg/latin-bi.json +1 -0
- package/dist/math/mathjax/svg/latin-i.json +1 -0
- package/dist/math/mathjax/svg/latin.json +1 -0
- package/dist/math/mathjax/svg/marrows.json +1 -0
- package/dist/math/mathjax/svg/math.json +1 -0
- package/dist/math/mathjax/svg/monospace-ex.json +1 -0
- package/dist/math/mathjax/svg/monospace-l.json +1 -0
- package/dist/math/mathjax/svg/monospace.json +1 -0
- package/dist/math/mathjax/svg/mshapes.json +1 -0
- package/dist/math/mathjax/svg/phonetics-ss.json +1 -0
- package/dist/math/mathjax/svg/phonetics.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-b.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-bi.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-ex.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-i.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-r.json +1 -0
- package/dist/math/mathjax/svg/sans-serif.json +1 -0
- package/dist/math/mathjax/svg/script.json +1 -0
- package/dist/math/mathjax/svg/shapes.json +1 -0
- package/dist/math/mathjax/svg/symbols-b-i.json +1 -0
- package/dist/math/mathjax/svg/symbols.json +1 -0
- package/dist/math/mathjax/svg/variants.json +1 -0
- package/dist/math/mathjax.d.ts +67 -0
- package/dist/math/mathjax.js +162 -0
- package/dist/math/mathjax.js.map +1 -0
- package/dist/math/speech.d.ts +27 -0
- package/dist/math/speech.js +87 -0
- package/dist/math/speech.js.map +1 -0
- package/dist/math/typeset.d.ts +75 -0
- package/dist/math/typeset.js +108 -0
- package/dist/math/typeset.js.map +1 -0
- package/dist/measure/css.d.ts +44 -0
- package/dist/measure/css.js +158 -0
- package/dist/measure/css.js.map +1 -0
- package/dist/measure/index.d.ts +3 -0
- package/dist/measure/index.js +4 -0
- package/dist/measure/index.js.map +1 -0
- package/dist/measure/measurer.d.ts +159 -0
- package/dist/measure/measurer.js +300 -0
- package/dist/measure/measurer.js.map +1 -0
- package/dist/measure/model.d.ts +46 -0
- package/dist/measure/model.js +47 -0
- package/dist/measure/model.js.map +1 -0
- package/dist/output/assets.d.ts +10 -0
- package/dist/output/assets.js +65 -0
- package/dist/output/assets.js.map +1 -0
- package/dist/output/index.d.ts +4 -0
- package/dist/output/index.js +5 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/output.d.ts +103 -0
- package/dist/output/output.js +86 -0
- package/dist/output/output.js.map +1 -0
- package/dist/output/stylesheets.d.ts +45 -0
- package/dist/output/stylesheets.js +50 -0
- package/dist/output/stylesheets.js.map +1 -0
- package/dist/paint/backgrounds.d.ts +56 -0
- package/dist/paint/backgrounds.js +261 -0
- package/dist/paint/backgrounds.js.map +1 -0
- package/dist/paint/blend.d.ts +61 -0
- package/dist/paint/blend.js +157 -0
- package/dist/paint/blend.js.map +1 -0
- package/dist/paint/border-image.d.ts +13 -0
- package/dist/paint/border-image.js +149 -0
- package/dist/paint/border-image.js.map +1 -0
- package/dist/paint/borders.d.ts +47 -0
- package/dist/paint/borders.js +329 -0
- package/dist/paint/borders.js.map +1 -0
- package/dist/paint/canvas.d.ts +52 -0
- package/dist/paint/canvas.js +274 -0
- package/dist/paint/canvas.js.map +1 -0
- package/dist/paint/colours.d.ts +55 -0
- package/dist/paint/colours.js +380 -0
- package/dist/paint/colours.js.map +1 -0
- package/dist/paint/columns.d.ts +11 -0
- package/dist/paint/columns.js +42 -0
- package/dist/paint/columns.js.map +1 -0
- package/dist/paint/context.d.ts +47 -0
- package/dist/paint/context.js +2 -0
- package/dist/paint/context.js.map +1 -0
- package/dist/paint/decoration.d.ts +97 -0
- package/dist/paint/decoration.js +280 -0
- package/dist/paint/decoration.js.map +1 -0
- package/dist/paint/effects.d.ts +64 -0
- package/dist/paint/effects.js +342 -0
- package/dist/paint/effects.js.map +1 -0
- package/dist/paint/emphasis.d.ts +13 -0
- package/dist/paint/emphasis.js +95 -0
- package/dist/paint/emphasis.js.map +1 -0
- package/dist/paint/flatten.d.ts +33 -0
- package/dist/paint/flatten.js +968 -0
- package/dist/paint/flatten.js.map +1 -0
- package/dist/paint/geometry.d.ts +62 -0
- package/dist/paint/geometry.js +170 -0
- package/dist/paint/geometry.js.map +1 -0
- package/dist/paint/gradients.d.ts +31 -0
- package/dist/paint/gradients.js +394 -0
- package/dist/paint/gradients.js.map +1 -0
- package/dist/paint/images.d.ts +17 -0
- package/dist/paint/images.js +80 -0
- package/dist/paint/images.js.map +1 -0
- package/dist/paint/lint.d.ts +46 -0
- package/dist/paint/lint.js +105 -0
- package/dist/paint/lint.js.map +1 -0
- package/dist/paint/overprint.d.ts +13 -0
- package/dist/paint/overprint.js +12 -0
- package/dist/paint/overprint.js.map +1 -0
- package/dist/paint/painter.d.ts +92 -0
- package/dist/paint/painter.js +281 -0
- package/dist/paint/painter.js.map +1 -0
- package/dist/paint/path.d.ts +9 -0
- package/dist/paint/path.js +173 -0
- package/dist/paint/path.js.map +1 -0
- package/dist/paint/raster.d.ts +32 -0
- package/dist/paint/raster.js +180 -0
- package/dist/paint/raster.js.map +1 -0
- package/dist/paint/shadows.d.ts +28 -0
- package/dist/paint/shadows.js +104 -0
- package/dist/paint/shadows.js.map +1 -0
- package/dist/paint/sources.d.ts +13 -0
- package/dist/paint/sources.js +17 -0
- package/dist/paint/sources.js.map +1 -0
- package/dist/paint/stacking.d.ts +75 -0
- package/dist/paint/stacking.js +327 -0
- package/dist/paint/stacking.js.map +1 -0
- package/dist/paint/svg-lint.d.ts +57 -0
- package/dist/paint/svg-lint.js +119 -0
- package/dist/paint/svg-lint.js.map +1 -0
- package/dist/paint/svg.d.ts +95 -0
- package/dist/paint/svg.js +728 -0
- package/dist/paint/svg.js.map +1 -0
- package/dist/paint/tables.d.ts +18 -0
- package/dist/paint/tables.js +178 -0
- package/dist/paint/tables.js.map +1 -0
- package/dist/paint/text-shadow.d.ts +26 -0
- package/dist/paint/text-shadow.js +187 -0
- package/dist/paint/text-shadow.js.map +1 -0
- package/dist/paint/text.d.ts +144 -0
- package/dist/paint/text.js +713 -0
- package/dist/paint/text.js.map +1 -0
- package/dist/paint/values.d.ts +24 -0
- package/dist/paint/values.js +160 -0
- package/dist/paint/values.js.map +1 -0
- package/dist/paint/vertical.d.ts +19 -0
- package/dist/paint/vertical.js +236 -0
- package/dist/paint/vertical.js.map +1 -0
- package/dist/pdf/index.d.ts +6 -0
- package/dist/pdf/index.js +7 -0
- package/dist/pdf/index.js.map +1 -0
- package/dist/pdf/pdfx.d.ts +30 -0
- package/dist/pdf/pdfx.js +18 -0
- package/dist/pdf/pdfx.js.map +1 -0
- package/dist/pdf/structure/index.d.ts +53 -0
- package/dist/pdf/structure/index.js +52 -0
- package/dist/pdf/structure/index.js.map +1 -0
- package/dist/pdf/structure/labels.d.ts +16 -0
- package/dist/pdf/structure/labels.js +45 -0
- package/dist/pdf/structure/labels.js.map +1 -0
- package/dist/pdf/structure/links.d.ts +49 -0
- package/dist/pdf/structure/links.js +136 -0
- package/dist/pdf/structure/links.js.map +1 -0
- package/dist/pdf/structure/tags.d.ts +79 -0
- package/dist/pdf/structure/tags.js +314 -0
- package/dist/pdf/structure/tags.js.map +1 -0
- package/dist/pdf/types.d.ts +534 -0
- package/dist/pdf/types.js +16 -0
- package/dist/pdf/types.js.map +1 -0
- package/dist/pdf/wasm/pulpweaver4_pdf.d.ts +41 -0
- package/dist/pdf/wasm/pulpweaver4_pdf.js +286 -0
- package/dist/pdf/wasm/pulpweaver4_pdf_bg.wasm +0 -0
- package/dist/pdf/writer.d.ts +41 -0
- package/dist/pdf/writer.js +78 -0
- package/dist/pdf/writer.js.map +1 -0
- package/dist/plugin/attributes.d.ts +10 -0
- package/dist/plugin/attributes.js +63 -0
- package/dist/plugin/attributes.js.map +1 -0
- package/dist/plugin/define.d.ts +425 -0
- package/dist/plugin/define.js +311 -0
- package/dist/plugin/define.js.map +1 -0
- package/dist/plugin/failure.d.ts +80 -0
- package/dist/plugin/failure.js +97 -0
- package/dist/plugin/failure.js.map +1 -0
- package/dist/plugin/index.d.ts +11 -0
- package/dist/plugin/index.js +12 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/load.d.ts +105 -0
- package/dist/plugin/load.js +197 -0
- package/dist/plugin/load.js.map +1 -0
- package/dist/plugin/register.d.ts +166 -0
- package/dist/plugin/register.js +306 -0
- package/dist/plugin/register.js.map +1 -0
- package/dist/plugin/render.d.ts +4 -0
- package/dist/plugin/render.js +28 -0
- package/dist/plugin/render.js.map +1 -0
- package/dist/preflight/index.d.ts +3 -0
- package/dist/preflight/index.js +4 -0
- package/dist/preflight/index.js.map +1 -0
- package/dist/preflight/pdfx.d.ts +440 -0
- package/dist/preflight/pdfx.js +1779 -0
- package/dist/preflight/pdfx.js.map +1 -0
- package/dist/preflight/reader.d.ts +126 -0
- package/dist/preflight/reader.js +832 -0
- package/dist/preflight/reader.js.map +1 -0
- package/dist/preflight/xmp.d.ts +30 -0
- package/dist/preflight/xmp.js +145 -0
- package/dist/preflight/xmp.js.map +1 -0
- package/dist/print/index.d.ts +2 -0
- package/dist/print/index.js +3 -0
- package/dist/print/index.js.map +1 -0
- package/dist/print/output.d.ts +5 -0
- package/dist/print/output.js +199 -0
- package/dist/print/output.js.map +1 -0
- package/dist/problem.d.ts +142 -0
- package/dist/problem.js +234 -0
- package/dist/problem.js.map +1 -0
- package/dist/profile/index.d.ts +10 -0
- package/dist/profile/index.js +11 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/profile/lint.d.ts +69 -0
- package/dist/profile/lint.js +282 -0
- package/dist/profile/lint.js.map +1 -0
- package/dist/profile/metadata.d.ts +27 -0
- package/dist/profile/metadata.js +38 -0
- package/dist/profile/metadata.js.map +1 -0
- package/dist/profile/profile.d.ts +92 -0
- package/dist/profile/profile.js +282 -0
- package/dist/profile/profile.js.map +1 -0
- package/dist/project.d.ts +56 -0
- package/dist/project.js +137 -0
- package/dist/project.js.map +1 -0
- package/dist/reproducible/clock.d.ts +46 -0
- package/dist/reproducible/clock.js +173 -0
- package/dist/reproducible/clock.js.map +1 -0
- package/dist/reproducible/date.d.ts +42 -0
- package/dist/reproducible/date.js +82 -0
- package/dist/reproducible/date.js.map +1 -0
- package/dist/reproducible/index.d.ts +8 -0
- package/dist/reproducible/index.js +9 -0
- package/dist/reproducible/index.js.map +1 -0
- package/dist/spike/spike-page.chromium.json +330 -0
- package/dist/spike/spike.d.ts +75 -0
- package/dist/spike/spike.js +106 -0
- package/dist/spike/spike.js.map +1 -0
- package/dist/style/borders.d.ts +25 -0
- package/dist/style/borders.js +177 -0
- package/dist/style/borders.js.map +1 -0
- package/dist/style/colours.d.ts +34 -0
- package/dist/style/colours.js +138 -0
- package/dist/style/colours.js.map +1 -0
- package/dist/style/compile.d.ts +79 -0
- package/dist/style/compile.js +325 -0
- package/dist/style/compile.js.map +1 -0
- package/dist/style/defaults.d.ts +20 -0
- package/dist/style/defaults.js +45 -0
- package/dist/style/defaults.js.map +1 -0
- package/dist/style/gcpm.d.ts +22 -0
- package/dist/style/gcpm.js +86 -0
- package/dist/style/gcpm.js.map +1 -0
- package/dist/style/index.d.ts +4 -0
- package/dist/style/index.js +5 -0
- package/dist/style/index.js.map +1 -0
- package/dist/style/media.d.ts +22 -0
- package/dist/style/media.js +342 -0
- package/dist/style/media.js.map +1 -0
- package/dist/style/properties.d.ts +44 -0
- package/dist/style/properties.js +497 -0
- package/dist/style/properties.js.map +1 -0
- package/dist/style/scope.d.ts +6 -0
- package/dist/style/scope.js +134 -0
- package/dist/style/scope.js.map +1 -0
- package/dist/style/values.d.ts +45 -0
- package/dist/style/values.js +106 -0
- package/dist/style/values.js.map +1 -0
- package/dist/test/book.d.ts +180 -0
- package/dist/test/book.js +314 -0
- package/dist/test/book.js.map +1 -0
- package/dist/test/build.d.ts +58 -0
- package/dist/test/build.js +222 -0
- package/dist/test/build.js.map +1 -0
- package/dist/test/environment.d.ts +63 -0
- package/dist/test/environment.js +46 -0
- package/dist/test/environment.js.map +1 -0
- package/dist/test/index.d.ts +17 -0
- package/dist/test/index.js +18 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/indexes.d.ts +4 -0
- package/dist/test/indexes.js +48 -0
- package/dist/test/indexes.js.map +1 -0
- package/dist/test/layout.d.ts +8 -0
- package/dist/test/layout.js +120 -0
- package/dist/test/layout.js.map +1 -0
- package/dist/test/matchers.d.ts +80 -0
- package/dist/test/matchers.js +177 -0
- package/dist/test/matchers.js.map +1 -0
- package/dist/test/pipeline.d.ts +228 -0
- package/dist/test/pipeline.js +73 -0
- package/dist/test/pipeline.js.map +1 -0
- package/dist/test/plugins.d.ts +13 -0
- package/dist/test/plugins.js +22 -0
- package/dist/test/plugins.js.map +1 -0
- package/dist/test/render.d.ts +46 -0
- package/dist/test/render.js +149 -0
- package/dist/test/render.js.map +1 -0
- package/dist/test/runner.d.ts +61 -0
- package/dist/test/runner.js +256 -0
- package/dist/test/runner.js.map +1 -0
- package/dist/test/select.d.ts +54 -0
- package/dist/test/select.js +193 -0
- package/dist/test/select.js.map +1 -0
- package/dist/test/snapshot.d.ts +52 -0
- package/dist/test/snapshot.js +175 -0
- package/dist/test/snapshot.js.map +1 -0
- package/dist/test/text.d.ts +7 -0
- package/dist/test/text.js +46 -0
- package/dist/test/text.js.map +1 -0
- package/dist/test/vitest.d.ts +3 -0
- package/dist/test/vitest.js +39 -0
- package/dist/test/vitest.js.map +1 -0
- package/dist/text/index.d.ts +5 -0
- package/dist/text/index.js +6 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/output.d.ts +5 -0
- package/dist/text/output.js +39 -0
- package/dist/text/output.js.map +1 -0
- package/dist/text/render.d.ts +82 -0
- package/dist/text/render.js +583 -0
- package/dist/text/render.js.map +1 -0
- package/dist/text/width.d.ts +16 -0
- package/dist/text/width.js +90 -0
- package/dist/text/width.js.map +1 -0
- package/dist/text/wrap.d.ts +19 -0
- package/dist/text/wrap.js +151 -0
- package/dist/text/wrap.js.map +1 -0
- package/dist/transform/core.d.ts +19 -0
- package/dist/transform/core.js +22 -0
- package/dist/transform/core.js.map +1 -0
- package/dist/transform/index.d.ts +10 -0
- package/dist/transform/index.js +11 -0
- package/dist/transform/index.js.map +1 -0
- package/dist/transform/numbering.d.ts +47 -0
- package/dist/transform/numbering.js +142 -0
- package/dist/transform/numbering.js.map +1 -0
- package/dist/transform/references.d.ts +38 -0
- package/dist/transform/references.js +182 -0
- package/dist/transform/references.js.map +1 -0
- package/dist/transform/run.d.ts +32 -0
- package/dist/transform/run.js +210 -0
- package/dist/transform/run.js.map +1 -0
- package/dist/transform/store.d.ts +111 -0
- package/dist/transform/store.js +331 -0
- package/dist/transform/store.js.map +1 -0
- package/dist/transform/testing.d.ts +31 -0
- package/dist/transform/testing.js +76 -0
- package/dist/transform/testing.js.map +1 -0
- package/dist/transform/transform.d.ts +104 -0
- package/dist/transform/transform.js +89 -0
- package/dist/transform/transform.js.map +1 -0
- package/dist/vfs/fsa.d.ts +14 -0
- package/dist/vfs/fsa.js +123 -0
- package/dist/vfs/fsa.js.map +1 -0
- package/dist/vfs/index.d.ts +7 -0
- package/dist/vfs/index.js +8 -0
- package/dist/vfs/index.js.map +1 -0
- package/dist/vfs/memory.d.ts +15 -0
- package/dist/vfs/memory.js +101 -0
- package/dist/vfs/memory.js.map +1 -0
- package/dist/vfs/path.d.ts +30 -0
- package/dist/vfs/path.js +67 -0
- package/dist/vfs/path.js.map +1 -0
- package/dist/vfs/vfs.d.ts +66 -0
- package/dist/vfs/vfs.js +68 -0
- package/dist/vfs/vfs.js.map +1 -0
- package/dist/vfs/zip.d.ts +27 -0
- package/dist/vfs/zip.js +67 -0
- package/dist/vfs/zip.js.map +1 -0
- package/dist/web/css.d.ts +15 -0
- package/dist/web/css.js +80 -0
- package/dist/web/css.js.map +1 -0
- package/dist/web/hast.d.ts +44 -0
- package/dist/web/hast.js +175 -0
- package/dist/web/hast.js.map +1 -0
- package/dist/web/index.d.ts +11 -0
- package/dist/web/index.js +12 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/justify-main.d.ts +1 -0
- package/dist/web/justify-main.js +38 -0
- package/dist/web/justify-main.js.map +1 -0
- package/dist/web/justify.d.ts +46 -0
- package/dist/web/justify.js +147 -0
- package/dist/web/justify.js.map +1 -0
- package/dist/web/output.d.ts +28 -0
- package/dist/web/output.js +251 -0
- package/dist/web/output.js.map +1 -0
- package/dist/web/runtime/LICENSE-harfbuzzjs.txt +19 -0
- package/dist/web/runtime/NOTICE-patterns.txt +429 -0
- package/dist/web/runtime/harfbuzz.wasm +0 -0
- package/dist/web/runtime/justify.js.txt +2 -0
- package/dist/web/site.d.ts +53 -0
- package/dist/web/site.js +219 -0
- package/dist/web/site.js.map +1 -0
- package/docs/README.md +16 -0
- package/docs/reference/css-properties/index.md +94 -0
- package/docs/reference/css-properties/pw-adj-demerits.md +22 -0
- package/docs/reference/css-properties/pw-border-bottom-width.md +24 -0
- package/docs/reference/css-properties/pw-border-left-width.md +24 -0
- package/docs/reference/css-properties/pw-border-right-width.md +24 -0
- package/docs/reference/css-properties/pw-border-top-width.md +24 -0
- package/docs/reference/css-properties/pw-box.md +28 -0
- package/docs/reference/css-properties/pw-broken-penalty.md +22 -0
- package/docs/reference/css-properties/pw-club-penalty.md +24 -0
- package/docs/reference/css-properties/pw-column-rule-width.md +23 -0
- package/docs/reference/css-properties/pw-content-after.md +31 -0
- package/docs/reference/css-properties/pw-content-before.md +31 -0
- package/docs/reference/css-properties/pw-double-hyphen-demerits.md +23 -0
- package/docs/reference/css-properties/pw-emergency-stretch.md +28 -0
- package/docs/reference/css-properties/pw-ex-hyphen-penalty.md +22 -0
- package/docs/reference/css-properties/pw-final-hyphen-demerits.md +22 -0
- package/docs/reference/css-properties/pw-float-skip.md +22 -0
- package/docs/reference/css-properties/pw-float.md +33 -0
- package/docs/reference/css-properties/pw-footnote-max-height.md +22 -0
- package/docs/reference/css-properties/pw-footnote-skip.md +23 -0
- package/docs/reference/css-properties/pw-hyphen-penalty.md +24 -0
- package/docs/reference/css-properties/pw-inter-line-penalty.md +24 -0
- package/docs/reference/css-properties/pw-leader-space.md +22 -0
- package/docs/reference/css-properties/pw-leader.md +29 -0
- package/docs/reference/css-properties/pw-left-hyphen-min.md +23 -0
- package/docs/reference/css-properties/pw-line-breaking.md +29 -0
- package/docs/reference/css-properties/pw-line-penalty.md +23 -0
- package/docs/reference/css-properties/pw-list-indent.md +18 -0
- package/docs/reference/css-properties/pw-looseness.md +30 -0
- package/docs/reference/css-properties/pw-max-depth.md +22 -0
- package/docs/reference/css-properties/pw-minipage-footnotes.md +23 -0
- package/docs/reference/css-properties/pw-orphans.md +24 -0
- package/docs/reference/css-properties/pw-outline-width.md +23 -0
- package/docs/reference/css-properties/pw-overprint.md +26 -0
- package/docs/reference/css-properties/pw-padding-bottom.md +22 -0
- package/docs/reference/css-properties/pw-padding-left.md +22 -0
- package/docs/reference/css-properties/pw-padding-right.md +22 -0
- package/docs/reference/css-properties/pw-padding-top.md +22 -0
- package/docs/reference/css-properties/pw-page-prefix.md +28 -0
- package/docs/reference/css-properties/pw-page.md +32 -0
- package/docs/reference/css-properties/pw-penalty-after.md +23 -0
- package/docs/reference/css-properties/pw-penalty-before.md +30 -0
- package/docs/reference/css-properties/pw-pretolerance.md +23 -0
- package/docs/reference/css-properties/pw-right-hyphen-min.md +22 -0
- package/docs/reference/css-properties/pw-running.md +23 -0
- package/docs/reference/css-properties/pw-site-background.md +21 -0
- package/docs/reference/css-properties/pw-site-link.md +17 -0
- package/docs/reference/css-properties/pw-site-measure.md +17 -0
- package/docs/reference/css-properties/pw-site-muted.md +21 -0
- package/docs/reference/css-properties/pw-site-rule.md +17 -0
- package/docs/reference/css-properties/pw-site-text.md +22 -0
- package/docs/reference/css-properties/pw-space-after.md +23 -0
- package/docs/reference/css-properties/pw-space-before.md +29 -0
- package/docs/reference/css-properties/pw-string-set.md +32 -0
- package/docs/reference/css-properties/pw-tolerance.md +33 -0
- package/docs/reference/css-properties/pw-top-skip.md +22 -0
- package/docs/reference/css-properties/pw-widow-penalty.md +32 -0
- package/docs/reference/css-properties/pw-widows.md +24 -0
- package/docs/reference/css-properties/pw-word-space.md +22 -0
- package/docs/reference/css-properties/pw-xspace.md +22 -0
- package/docs/reference/index.md +17 -0
- package/docs/reference/lint-rules/black-text.md +31 -0
- package/docs/reference/lint-rules/blank-page.md +35 -0
- package/docs/reference/lint-rules/chapter-verso.md +34 -0
- package/docs/reference/lint-rules/citation-in-heading.md +24 -0
- package/docs/reference/lint-rules/consecutive-hyphens.md +34 -0
- package/docs/reference/lint-rules/empty-link.md +32 -0
- package/docs/reference/lint-rules/figure-distance.md +34 -0
- package/docs/reference/lint-rules/fonts.md +24 -0
- package/docs/reference/lint-rules/generated-text.md +24 -0
- package/docs/reference/lint-rules/heading-levels.md +30 -0
- package/docs/reference/lint-rules/ibid-across-page.md +30 -0
- package/docs/reference/lint-rules/image-alt.md +30 -0
- package/docs/reference/lint-rules/image-resolution.md +34 -0
- package/docs/reference/lint-rules/index.md +120 -0
- package/docs/reference/lint-rules/ink-limit.md +30 -0
- package/docs/reference/lint-rules/missing-field.md +37 -0
- package/docs/reference/lint-rules/orphan.md +34 -0
- package/docs/reference/lint-rules/overfull-line.md +28 -0
- package/docs/reference/lint-rules/profile.md +24 -0
- package/docs/reference/lint-rules/raw-html.md +30 -0
- package/docs/reference/lint-rules/signature.md +34 -0
- package/docs/reference/lint-rules/straight-quotes.md +33 -0
- package/docs/reference/lint-rules/svg-use-css.md +24 -0
- package/docs/reference/lint-rules/underfull-line.md +35 -0
- package/docs/reference/lint-rules/unknown-citation.md +30 -0
- package/docs/reference/lint-rules/unknown-label.md +31 -0
- package/docs/reference/lint-rules/unpaintable.md +24 -0
- package/docs/reference/lint-rules/unplaced-index.md +31 -0
- package/docs/reference/lint-rules/unused-entry.md +36 -0
- package/docs/reference/lint-rules/widow.md +34 -0
- package/docs/reference/plugin-api/assert-no-errors.md +18 -0
- package/docs/reference/plugin-api/asset-processor.md +28 -0
- package/docs/reference/plugin-api/attribute-problem.md +26 -0
- package/docs/reference/plugin-api/attribute-type.md +18 -0
- package/docs/reference/plugin-api/capabilities.md +18 -0
- package/docs/reference/plugin-api/capability.md +22 -0
- package/docs/reference/plugin-api/check-attributes.md +18 -0
- package/docs/reference/plugin-api/claim-kind.md +20 -0
- package/docs/reference/plugin-api/combine-penalties.md +17 -0
- package/docs/reference/plugin-api/command-context.md +30 -0
- package/docs/reference/plugin-api/command-definition.md +34 -0
- package/docs/reference/plugin-api/core-claims.md +18 -0
- package/docs/reference/plugin-api/define-plugin.md +20 -0
- package/docs/reference/plugin-api/define-rule.md +19 -0
- package/docs/reference/plugin-api/describe-error.md +14 -0
- package/docs/reference/plugin-api/describe-node.md +14 -0
- package/docs/reference/plugin-api/empty-registry.md +18 -0
- package/docs/reference/plugin-api/failed-on.md +32 -0
- package/docs/reference/plugin-api/fails-as.md +18 -0
- package/docs/reference/plugin-api/import-plugins.md +20 -0
- package/docs/reference/plugin-api/import-text.md +14 -0
- package/docs/reference/plugin-api/index.md +123 -0
- package/docs/reference/plugin-api/layout-definition.md +42 -0
- package/docs/reference/plugin-api/layout-slot.md +28 -0
- package/docs/reference/plugin-api/line-breaker.md +18 -0
- package/docs/reference/plugin-api/lint-context.md +48 -0
- package/docs/reference/plugin-api/lint-definition.md +32 -0
- package/docs/reference/plugin-api/lint-edition.md +38 -0
- package/docs/reference/plugin-api/lint-fix.md +36 -0
- package/docs/reference/plugin-api/lint-level.md +20 -0
- package/docs/reference/plugin-api/lint-preset.md +30 -0
- package/docs/reference/plugin-api/lint-rule.md +42 -0
- package/docs/reference/plugin-api/load-failure.md +32 -0
- package/docs/reference/plugin-api/load-plugins-options.md +32 -0
- package/docs/reference/plugin-api/load-plugins.md +20 -0
- package/docs/reference/plugin-api/loaded-plugin.md +32 -0
- package/docs/reference/plugin-api/node-claim.md +34 -0
- package/docs/reference/plugin-api/output-definition.md +28 -0
- package/docs/reference/plugin-api/owned.md +28 -0
- package/docs/reference/plugin-api/page-builder-hook.md +18 -0
- package/docs/reference/plugin-api/penalty-rule.md +34 -0
- package/docs/reference/plugin-api/plugin-api.md +18 -0
- package/docs/reference/plugin-api/plugin-definition.md +66 -0
- package/docs/reference/plugin-api/plugin-error.md +22 -0
- package/docs/reference/plugin-api/plugin-failure.md +30 -0
- package/docs/reference/plugin-api/plugin-importer.md +34 -0
- package/docs/reference/plugin-api/plugin-problem.md +30 -0
- package/docs/reference/plugin-api/plugin-registry.md +83 -0
- package/docs/reference/plugin-api/plugin-scope.md +15 -0
- package/docs/reference/plugin-api/plugin-stage.md +18 -0
- package/docs/reference/plugin-api/plugin-threw-problem.md +34 -0
- package/docs/reference/plugin-api/plugin-threw.md +21 -0
- package/docs/reference/plugin-api/plugin.md +69 -0
- package/docs/reference/plugin-api/project-with-plugins.md +36 -0
- package/docs/reference/plugin-api/read-context.md +30 -0
- package/docs/reference/plugin-api/read-failure.md +18 -0
- package/docs/reference/plugin-api/read-plugin-styles.md +22 -0
- package/docs/reference/plugin-api/reader.md +22 -0
- package/docs/reference/plugin-api/register-options.md +28 -0
- package/docs/reference/plugin-api/register-plugins.md +20 -0
- package/docs/reference/plugin-api/render-format.md +18 -0
- package/docs/reference/plugin-api/render-formats.md +18 -0
- package/docs/reference/plugin-api/renderer-registry.md +18 -0
- package/docs/reference/plugin-api/renderer-set.md +34 -0
- package/docs/reference/plugin-api/renderers.md +34 -0
- package/docs/reference/plugin-api/specifier-kind.md +14 -0
- package/docs/reference/plugin-api/style-source.md +18 -0
- package/docs/reference/plugin-api/text-context.md +28 -0
- package/docs/reference/plugin-api/text-edit.md +28 -0
- package/docs/reference/plugin-api/text-renderer.md +24 -0
- package/docs/reference/plugin-api/try-plugin-async.md +18 -0
- package/docs/reference/plugin-api/try-plugin.md +20 -0
- package/docs/reference/pulpweaver4-toml/editions.md +194 -0
- package/docs/reference/pulpweaver4-toml/index.md +182 -0
- package/docs/reference/pulpweaver4-toml/inks.md +50 -0
- package/docs/reference/pulpweaver4-toml/lint.md +36 -0
- package/docs/reference/test-matchers/index.md +33 -0
- package/docs/reference/test-matchers/to-be-recto.md +20 -0
- package/docs/reference/test-matchers/to-cite.md +22 -0
- package/docs/reference/test-matchers/to-fit-on-one-page.md +20 -0
- package/docs/reference/test-matchers/to-have-no-overfull-lines.md +20 -0
- package/docs/reference/test-matchers/to-match-html-snapshot.md +20 -0
- package/docs/reference/test-matchers/to-match-page-snapshot.md +20 -0
- package/docs/reference/test-matchers/to-match-text-snapshot.md +21 -0
- package/docs/reference/test-matchers/to-start-page.md +20 -0
- package/package.json +75 -4
- package/README.md +0 -3
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `ink-limit` lint rule (https://plans.inkylabs.com/pulpweaver#linting):
|
|
3
|
+
* in a CMYK edition no colour may put down more ink, its four process inks
|
|
4
|
+
* added up, than the output intent’s total ink limit (GRACoL 2013’s is 320%,
|
|
5
|
+
* FOGRA39’s and SWOP’s 300%). Past it the ink doesn’t dry on the press, sets
|
|
6
|
+
* off on the next sheet, and the paper cockles. Colours converted from sRGB
|
|
7
|
+
* through the profile keep within it, so what the rule catches is CMYK the
|
|
8
|
+
* author wrote: a rich black of `device-cmyk(1 1 1 1)`, an ink’s CMYK
|
|
9
|
+
* fallback, or black text overprinted on a dark background, whose inks add.
|
|
10
|
+
*
|
|
11
|
+
* It walks the laid-out pages and reads each element’s painted colours as
|
|
12
|
+
* the painter does: a preview through the {@link ColourMap} to the CMYK it
|
|
13
|
+
* stands for, any other colour through the profile. A translucent colour
|
|
14
|
+
* counts for its alpha’s share; a spot ink counts at its tint, since it is
|
|
15
|
+
* ink too. Images aren’t checked: the `assets` stage converts them through
|
|
16
|
+
* the profile, within its limit, and passes a CMYK JPEG through as it is.
|
|
17
|
+
*
|
|
18
|
+
* It is a `layout` rule with the shape the linter (`lint/`) registers: a name, a
|
|
19
|
+
* level and `check(context)`; `checkInkLimit` runs
|
|
20
|
+
* it alone.
|
|
21
|
+
*/
|
|
22
|
+
import type { Position } from '../ast/position.js';
|
|
23
|
+
import type { ProblemFields } from '../problem.js';
|
|
24
|
+
import type { CmykConverter } from './cmyk.js';
|
|
25
|
+
import type { ColourMap } from './previews.js';
|
|
26
|
+
/** An ink-limit problem, found in an element of a page. */
|
|
27
|
+
export interface InkProblem extends ProblemFields {
|
|
28
|
+
/** `ink-limit`. */
|
|
29
|
+
readonly code: string;
|
|
30
|
+
/** The element’s source, if the renderer knows it. */
|
|
31
|
+
readonly position?: Position;
|
|
32
|
+
/** The element whose colour puts down too much ink. */
|
|
33
|
+
readonly node: Element;
|
|
34
|
+
/** Its total ink, as a fraction (3.5 for 350%). */
|
|
35
|
+
readonly total: number;
|
|
36
|
+
/** The CSS property whose colour it is. */
|
|
37
|
+
readonly property: string;
|
|
38
|
+
}
|
|
39
|
+
/** What the `ink-limit` rule is given. */
|
|
40
|
+
export interface InkLimitContext {
|
|
41
|
+
/** The laid-out pages, in a document with the edition’s stylesheet applied. */
|
|
42
|
+
readonly root: Node;
|
|
43
|
+
/** How the edition converts sRGB to CMYK, and the profile’s own limit. */
|
|
44
|
+
readonly cmyk: Pick<CmykConverter, 'fromSrgb' | 'inkLimit'>;
|
|
45
|
+
/** The previews the stylesheet compiler lowered `device-cmyk()` and inks to. */
|
|
46
|
+
readonly colours?: ColourMap;
|
|
47
|
+
/**
|
|
48
|
+
* The output intent: a standard one’s name, whose registered limit holds,
|
|
49
|
+
* or a printer’s profile, by its file, whose limit is read off the profile
|
|
50
|
+
* ({@link CmykConverter.inkLimit}). Messages name it.
|
|
51
|
+
*/
|
|
52
|
+
readonly intent?: string;
|
|
53
|
+
/** The rule’s options: `max`, the limit in percent, to hold a press to less than its profile allows. */
|
|
54
|
+
readonly options?: {
|
|
55
|
+
readonly max?: number;
|
|
56
|
+
};
|
|
57
|
+
readonly locate?: (element: Element) => Position | undefined;
|
|
58
|
+
report(problem: InkProblem): void;
|
|
59
|
+
}
|
|
60
|
+
export declare const inkLimitRule: {
|
|
61
|
+
readonly name: 'ink-limit';
|
|
62
|
+
readonly level: 'layout';
|
|
63
|
+
readonly description: 'No colour in a CMYK edition puts down more ink than its output intent’s total ink limit';
|
|
64
|
+
readonly defaultSeverity: 'error';
|
|
65
|
+
readonly check: (ctx: InkLimitContext) => void;
|
|
66
|
+
};
|
|
67
|
+
/** Runs the `ink-limit` rule over `root` and returns what it reports. */
|
|
68
|
+
export declare function checkInkLimit(root: Node, opts: Omit<InkLimitContext, 'root' | 'report'>): InkProblem[];
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { colourOf, coloursIn } from '../paint/painter.js';
|
|
2
|
+
import { STANDARD_OUTPUT_INTENTS } from './intents.js';
|
|
3
|
+
/** Rounding the 8-bit CMYK the PDF keeps can add up to this much over four inks. */
|
|
4
|
+
const SLACK = 0.01;
|
|
5
|
+
export const inkLimitRule = {
|
|
6
|
+
name: 'ink-limit',
|
|
7
|
+
level: 'layout',
|
|
8
|
+
description: 'No colour in a CMYK edition puts down more ink than its output intent’s total ink limit',
|
|
9
|
+
defaultSeverity: 'error',
|
|
10
|
+
check(ctx) {
|
|
11
|
+
const standard = ctx.intent !== undefined && Object.hasOwn(STANDARD_OUTPUT_INTENTS, ctx.intent) ? STANDARD_OUTPUT_INTENTS[ctx.intent].profile : undefined;
|
|
12
|
+
const limit = ctx.options?.max !== undefined ? ctx.options.max / 100 : standard?.inkLimit ?? ctx.cmyk.inkLimit;
|
|
13
|
+
const whose = ctx.options?.max !== undefined ? 'the ink-limit rule’s' : ctx.intent ? `${ctx.intent}’s` : 'the output intent’s';
|
|
14
|
+
const ink = (c) => {
|
|
15
|
+
if ('ink' in c)
|
|
16
|
+
return { total: c.ink.tint ?? 1, text: `${c.ink.name} ${pct(c.ink.tint ?? 1)}` };
|
|
17
|
+
if (!('rgb' in c))
|
|
18
|
+
return 'cmyk' in c ? process(c.cmyk) : process([0, 0, 0, 1 - c.grey]);
|
|
19
|
+
const preview = ctx.colours?.lookup(c.rgb);
|
|
20
|
+
if (preview?.ink !== undefined)
|
|
21
|
+
return { total: 1, text: `${preview.ink} 100%` };
|
|
22
|
+
return process(preview ? preview.cmyk : ctx.cmyk.fromSrgb(c.rgb));
|
|
23
|
+
};
|
|
24
|
+
const backgrounds = new Map();
|
|
25
|
+
const background = (el) => {
|
|
26
|
+
if (!el)
|
|
27
|
+
return undefined;
|
|
28
|
+
if (backgrounds.has(el))
|
|
29
|
+
return backgrounds.get(el);
|
|
30
|
+
const bg = colourOf(getComputedStyle(el).backgroundColor);
|
|
31
|
+
const found = bg ? scaled(ink(bg.colour), bg.alpha) : background(el.parentElement);
|
|
32
|
+
backgrounds.set(el, found);
|
|
33
|
+
return found;
|
|
34
|
+
};
|
|
35
|
+
const elements = ctx.root instanceof Element ? [ctx.root, ...ctx.root.querySelectorAll('*')] : [...ctx.root.querySelectorAll('*')];
|
|
36
|
+
for (const el of elements) {
|
|
37
|
+
const cs = getComputedStyle(el);
|
|
38
|
+
if (cs.display === 'none')
|
|
39
|
+
continue;
|
|
40
|
+
const overprint = cs.getPropertyValue('--pw-overprint').trim() === 'on';
|
|
41
|
+
let worst;
|
|
42
|
+
const consider = (property, value, overprinted) => {
|
|
43
|
+
for (const c of coloursIn(value)) {
|
|
44
|
+
if (c.alpha === 0)
|
|
45
|
+
continue;
|
|
46
|
+
let found = { ...scaled(ink(c.colour), c.alpha), property };
|
|
47
|
+
const under = overprinted ? background(property === 'color' ? el : el.parentElement) : undefined;
|
|
48
|
+
if (under)
|
|
49
|
+
found = { total: found.total + under.total, text: `${found.text}, overprinting ${under.text} beneath`, property: `${property}, overprinted` };
|
|
50
|
+
if (!worst || found.total > worst.total)
|
|
51
|
+
worst = found;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
consider('background-color', cs.backgroundColor, false);
|
|
55
|
+
consider('background-image', cs.backgroundImage, false);
|
|
56
|
+
for (const side of ['top', 'right', 'bottom', 'left']) {
|
|
57
|
+
if (Number.parseFloat(cs.getPropertyValue(`--pw-border-${side}-width`) || cs.getPropertyValue(`border-${side}-width`)) > 0 && !/none|hidden/.test(cs.getPropertyValue(`border-${side}-style`))) {
|
|
58
|
+
consider(`border-${side}-color`, cs.getPropertyValue(`border-${side}-color`), overprint);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (cs.outlineStyle !== 'none')
|
|
62
|
+
consider('outline-color', cs.outlineColor, overprint);
|
|
63
|
+
consider('box-shadow', cs.boxShadow, false);
|
|
64
|
+
if (hasText(el)) {
|
|
65
|
+
consider('color', cs.color, overprint);
|
|
66
|
+
if (cs.textDecorationLine !== 'none')
|
|
67
|
+
consider('text-decoration-color', cs.textDecorationColor, overprint);
|
|
68
|
+
consider('text-shadow', cs.textShadow, false);
|
|
69
|
+
}
|
|
70
|
+
if (!worst || worst.total <= limit + SLACK)
|
|
71
|
+
continue;
|
|
72
|
+
const position = ctx.locate?.(el);
|
|
73
|
+
ctx.report({
|
|
74
|
+
severity: 'error',
|
|
75
|
+
code: 'ink-limit',
|
|
76
|
+
message: `${worst.property} puts down ${pct(worst.total)} of ink (${worst.text}), over ${whose} limit of ${pct(limit)}`,
|
|
77
|
+
fix: `use less ink: a rich black of device-cmyk(0.6 0.4 0.4 1) is 240%, and black text needs K alone`,
|
|
78
|
+
...(position ? { position } : {}),
|
|
79
|
+
node: el,
|
|
80
|
+
total: worst.total,
|
|
81
|
+
property: worst.property,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
/** Runs the `ink-limit` rule over `root` and returns what it reports. */
|
|
87
|
+
export function checkInkLimit(root, opts) {
|
|
88
|
+
const problems = [];
|
|
89
|
+
inkLimitRule.check({ ...opts, root, report: (p) => problems.push(p) });
|
|
90
|
+
return problems;
|
|
91
|
+
}
|
|
92
|
+
function process(cmyk) {
|
|
93
|
+
const parts = cmyk.map((v, i) => (v > 0 ? `${'CMYK'[i]} ${pct(v)}` : '')).filter(Boolean);
|
|
94
|
+
return { total: cmyk.reduce((a, b) => a + b, 0), text: parts.join(', ') || 'no ink' };
|
|
95
|
+
}
|
|
96
|
+
function scaled(ink, alpha) {
|
|
97
|
+
return alpha === 1 ? ink : { total: ink.total * alpha, text: `${ink.text} at ${pct(alpha)} opacity` };
|
|
98
|
+
}
|
|
99
|
+
function pct(v) {
|
|
100
|
+
return `${Math.round(v * 100)}%`;
|
|
101
|
+
}
|
|
102
|
+
/** Whether an element has text of its own to paint: a text node child with more than white space. */
|
|
103
|
+
function hasText(el) {
|
|
104
|
+
for (const n of el.childNodes)
|
|
105
|
+
if (n.nodeType === 3 && /\S/.test(n.nodeValue ?? ''))
|
|
106
|
+
return true;
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=ink-limit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ink-limit.js","sourceRoot":"","sources":["../../src/colour/ink-limit.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGzD,OAAO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ml`’s
|
|
4
|
+
* `output-intent` names it, a standard one by name or a printer’s own
|
|
5
|
+
* profile by its file. A CMYK edition’s colours are converted through its
|
|
6
|
+
* profile, and a PDF/X file carries it with the condition’s registered name.
|
|
7
|
+
*
|
|
8
|
+
* No profile is bundled. The standard ones are in the ICC’s profile registry
|
|
9
|
+
* (https://registry.color.org/profile-registry/), each under its owner’s
|
|
10
|
+
* terms, which let some be shared and not others, so a host fetches a
|
|
11
|
+
* shareable one when a build needs it, and the core checks it against the
|
|
12
|
+
* hash here. FOGRA51’s may not be redistributed, but each user may download
|
|
13
|
+
* it from its owner, ECI: a host that can (the CLI’s `pw profiles get`)
|
|
14
|
+
* fetches it on the user’s own machine once they accept ECI’s terms, and
|
|
15
|
+
* otherwise the edition names the file the user downloaded.
|
|
16
|
+
*/
|
|
17
|
+
import { OUTPUT_INTENTS } from '../config/project-schema.js';
|
|
18
|
+
import type { Problem } from '../problem.js';
|
|
19
|
+
/** A name `output-intent` accepts. */
|
|
20
|
+
export type OutputIntentName = keyof typeof OUTPUT_INTENTS;
|
|
21
|
+
/** The ICC’s registry of characterizations, PDF/X’s `RegistryName` for each standard condition here. */
|
|
22
|
+
export declare const ICC_REGISTRY = "http://www.color.org";
|
|
23
|
+
/** A standard printing condition, and the profile for it in the ICC’s registry. */
|
|
24
|
+
export interface StandardOutputIntent {
|
|
25
|
+
readonly name: OutputIntentName;
|
|
26
|
+
readonly colourSpace: 'CMYK' | 'RGB';
|
|
27
|
+
/** `OutputConditionIdentifier`: the characterization’s reference name in the registry. */
|
|
28
|
+
readonly identifier: string;
|
|
29
|
+
/** `OutputCondition`: a readable name for it. */
|
|
30
|
+
readonly condition: string;
|
|
31
|
+
/** The profile, absent for sRGB, whose profile the PDF writer has (krilla’s own). */
|
|
32
|
+
readonly profile?: StandardProfile;
|
|
33
|
+
}
|
|
34
|
+
/** A registered profile: where it is, its hash, and its owner’s terms. */
|
|
35
|
+
export interface StandardProfile {
|
|
36
|
+
readonly file: string;
|
|
37
|
+
readonly url: string;
|
|
38
|
+
/** SHA-256 of the file, hex. */
|
|
39
|
+
readonly sha256: string;
|
|
40
|
+
/** Who makes it available, and on what terms (the registry’s words). */
|
|
41
|
+
readonly provider: string;
|
|
42
|
+
readonly terms: string;
|
|
43
|
+
/** Whether its terms let it be shared, so that pulpweaver4 may fetch it for a build. */
|
|
44
|
+
readonly shareable: boolean;
|
|
45
|
+
/** Its total ink limit, as the registry gives it, as a fraction (3.2 for 320%). */
|
|
46
|
+
readonly inkLimit: number;
|
|
47
|
+
/** For a profile that may not be shared: where its owner lets each user download it. */
|
|
48
|
+
readonly download?: ProfileDownload;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A profile its owner gives each user to download but no one else to
|
|
52
|
+
* redistribute: the owner’s own page and file, and the licence a user
|
|
53
|
+
* accepts before a host downloads it for them.
|
|
54
|
+
*/
|
|
55
|
+
export interface ProfileDownload {
|
|
56
|
+
/** The owner’s download page, for a person: its terms, and the file. */
|
|
57
|
+
readonly page: string;
|
|
58
|
+
/** The owner’s own file, a zip, which is all a host may download it from. */
|
|
59
|
+
readonly url: string;
|
|
60
|
+
/** The profile’s path in the zip. */
|
|
61
|
+
readonly entry: string;
|
|
62
|
+
/** Who gives it, by a short name. */
|
|
63
|
+
readonly owner: string;
|
|
64
|
+
/** The licence, the owner’s words, as the profile’s copyright tag gives them. */
|
|
65
|
+
readonly licence: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The output intents `pulpweaver4.toml` knows by name, checked against the
|
|
69
|
+
* ICC’s registry in November 2026.
|
|
70
|
+
*/
|
|
71
|
+
export declare const STANDARD_OUTPUT_INTENTS: {
|
|
72
|
+
readonly [N in OutputIntentName]: StandardOutputIntent & {
|
|
73
|
+
readonly name: N;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/** An edition’s output intent, loaded: what the painter converts through and the PDF writer embeds. */
|
|
77
|
+
export interface LoadedOutputIntent {
|
|
78
|
+
colourSpace: 'CMYK' | 'RGB' | 'GRAY';
|
|
79
|
+
/** The profile’s bytes; absent for sRGB, which the PDF writer has. */
|
|
80
|
+
profile?: Uint8Array;
|
|
81
|
+
/** `OutputConditionIdentifier`: a registered name, or `Custom` for a printer’s own profile. */
|
|
82
|
+
identifier: string;
|
|
83
|
+
condition?: string;
|
|
84
|
+
registryName?: string;
|
|
85
|
+
/** The profile’s file, for a printer’s own. */
|
|
86
|
+
info?: string;
|
|
87
|
+
/** The standard condition it is, by name, if it is one: named, or a file with a standard profile’s bytes. */
|
|
88
|
+
standard?: OutputIntentName;
|
|
89
|
+
}
|
|
90
|
+
/** Where a build gets profiles from. */
|
|
91
|
+
export interface OutputIntentHost {
|
|
92
|
+
/** A file of the project, by its path: a printer’s profile. */
|
|
93
|
+
readFile?(path: string): Promise<Uint8Array>;
|
|
94
|
+
/**
|
|
95
|
+
* A standard profile that may be shared, which the core checks against its
|
|
96
|
+
* hash: from a host’s cache, say. By default it is fetched from the ICC’s
|
|
97
|
+
* registry, which a browser may refuse across origins.
|
|
98
|
+
*/
|
|
99
|
+
standardProfile?(intent: StandardOutputIntent & {
|
|
100
|
+
readonly profile: StandardProfile;
|
|
101
|
+
}): Promise<Uint8Array>;
|
|
102
|
+
/**
|
|
103
|
+
* A profile that may not be shared but that its owner lets each user
|
|
104
|
+
* download (`profile.download`), from where the host keeps what its user
|
|
105
|
+
* downloaded, which the core checks against its hash. If the user hasn't,
|
|
106
|
+
* it throws an {@link OutputIntentError} saying how to get it in this
|
|
107
|
+
* host. Without it, the edition is told to download the file into the
|
|
108
|
+
* project and name it.
|
|
109
|
+
*/
|
|
110
|
+
downloadedProfile?(intent: StandardOutputIntent & {
|
|
111
|
+
readonly profile: StandardProfile & {
|
|
112
|
+
readonly download: ProfileDownload;
|
|
113
|
+
};
|
|
114
|
+
}): Promise<Uint8Array>;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* An output intent that can't be loaded, with a code and a fix: a host
|
|
118
|
+
* puts it at the edition's `output-intent` ({@link outputIntentProblem}).
|
|
119
|
+
*/
|
|
120
|
+
export declare class OutputIntentError extends Error {
|
|
121
|
+
readonly code: string;
|
|
122
|
+
readonly fix?: string | undefined;
|
|
123
|
+
constructor(code: string, message: string, fix?: string | undefined);
|
|
124
|
+
}
|
|
125
|
+
/** An output intent's error as the build's problem, at the edition's `output-intent` in `pulpweaver4.toml`. */
|
|
126
|
+
export declare function outputIntentProblem(error: OutputIntentError, configText: string, edition: string): Problem;
|
|
127
|
+
/**
|
|
128
|
+
* Loads an edition’s output intent: a standard one by name, or a profile’s
|
|
129
|
+
* file in the project. A file whose bytes are a standard profile’s takes
|
|
130
|
+
* that condition’s registered name; any other is PDF/X’s `Custom`, with its
|
|
131
|
+
* file as the condition.
|
|
132
|
+
*/
|
|
133
|
+
export declare function loadOutputIntent(nameOrFile: string, host?: OutputIntentHost): Promise<LoadedOutputIntent>;
|
|
134
|
+
/** The standard condition a profile’s bytes are, if any. */
|
|
135
|
+
export declare function standardOutputIntentOf(bytes: Uint8Array): Promise<StandardOutputIntent | undefined>;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output intents (https://plans.inkylabs.com/pulpweaver#colour-and-prepress):
|
|
3
|
+
* the printing condition a print edition is made for, as `pulpweaver4.toml`’s
|
|
4
|
+
* `output-intent` names it, a standard one by name or a printer’s own
|
|
5
|
+
* profile by its file. A CMYK edition’s colours are converted through its
|
|
6
|
+
* profile, and a PDF/X file carries it with the condition’s registered name.
|
|
7
|
+
*
|
|
8
|
+
* No profile is bundled. The standard ones are in the ICC’s profile registry
|
|
9
|
+
* (https://registry.color.org/profile-registry/), each under its owner’s
|
|
10
|
+
* terms, which let some be shared and not others, so a host fetches a
|
|
11
|
+
* shareable one when a build needs it, and the core checks it against the
|
|
12
|
+
* hash here. FOGRA51’s may not be redistributed, but each user may download
|
|
13
|
+
* it from its owner, ECI: a host that can (the CLI’s `pw profiles get`)
|
|
14
|
+
* fetches it on the user’s own machine once they accept ECI’s terms, and
|
|
15
|
+
* otherwise the edition names the file the user downloaded.
|
|
16
|
+
*/
|
|
17
|
+
import { OUTPUT_INTENTS } from '../config/project-schema.js';
|
|
18
|
+
import { TomlDocument } from '../config/toml.js';
|
|
19
|
+
import { IccProfile, initColour } from './lcms.js';
|
|
20
|
+
/** The ICC’s registry of characterizations, PDF/X’s `RegistryName` for each standard condition here. */
|
|
21
|
+
export const ICC_REGISTRY = 'http://www.color.org';
|
|
22
|
+
const REGISTRY = 'https://registry.color.org/profile-registry/profiles/';
|
|
23
|
+
/**
|
|
24
|
+
* The output intents `pulpweaver4.toml` knows by name, checked against the
|
|
25
|
+
* ICC’s registry in November 2026.
|
|
26
|
+
*/
|
|
27
|
+
export const STANDARD_OUTPUT_INTENTS = {
|
|
28
|
+
GRACoL2013: {
|
|
29
|
+
name: 'GRACoL2013',
|
|
30
|
+
colourSpace: 'CMYK',
|
|
31
|
+
identifier: 'CGATS21-2-CRPC6',
|
|
32
|
+
condition: 'GRACoL 2013: Universal PremCoated, large gamut commercial printing (CGATS 21-2 CRPC6)',
|
|
33
|
+
profile: {
|
|
34
|
+
file: 'GRACoL2013_CRPC6.icc',
|
|
35
|
+
url: `${REGISTRY}GRACoL2013_CRPC6.icc`,
|
|
36
|
+
sha256: '4ebbfad6bc9cfc033fdafdd8ac5df8159208932cb16d9a6596d349ae7ab50443',
|
|
37
|
+
provider: 'Idealliance, with permission of X-Rite, Inc.',
|
|
38
|
+
terms: 'may be used, embedded, exchanged, and shared without restriction; may not be altered, or sold without written permission of Idealliance',
|
|
39
|
+
shareable: true,
|
|
40
|
+
inkLimit: 3.2,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
FOGRA39: {
|
|
44
|
+
name: 'FOGRA39',
|
|
45
|
+
colourSpace: 'CMYK',
|
|
46
|
+
identifier: 'FOGRA39',
|
|
47
|
+
condition: 'Offset printing according to ISO 12647-2:2004/Amd 1, paper type 1 or 2, coated (FOGRA39)',
|
|
48
|
+
profile: {
|
|
49
|
+
file: 'Coated_Fogra39L_VIGC_300.icc',
|
|
50
|
+
url: `${REGISTRY}Coated_Fogra39L_VIGC_300.icc`,
|
|
51
|
+
sha256: '6df43849a84d2632e7900a125f657bd09364ed56775bc4740c1e39a5492d47e3',
|
|
52
|
+
provider: 'VIGC, with permission of X-Rite, Inc.',
|
|
53
|
+
terms: 'may be used, embedded, exchanged, and shared without restriction; may not be altered or sold without written permission of VIGC',
|
|
54
|
+
shareable: true,
|
|
55
|
+
inkLimit: 3,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
FOGRA51: {
|
|
59
|
+
name: 'FOGRA51',
|
|
60
|
+
colourSpace: 'CMYK',
|
|
61
|
+
identifier: 'FOGRA51',
|
|
62
|
+
condition: 'Offset printing according to ISO 12647-2:2013, printing substrate 1, premium coated (FOGRA51)',
|
|
63
|
+
profile: {
|
|
64
|
+
file: 'PSOcoated_v3.icc',
|
|
65
|
+
url: `${REGISTRY}PSOcoated_v3.icc`,
|
|
66
|
+
sha256: 'c30ad2c01e8f93135ec7682c535e0a81bc2d177c301e196376c5f5838b5c8e86',
|
|
67
|
+
provider: 'European Color Initiative (ECI), with permission of Heidelberger Druckmaschinen AG',
|
|
68
|
+
terms: 'may be used, embedded and exchanged without restriction; may not be distributed, sold or altered without written permission of ECI',
|
|
69
|
+
shareable: false,
|
|
70
|
+
inkLimit: 3,
|
|
71
|
+
// ECI's downloads page offers it to anyone, with no account or
|
|
72
|
+
// click-through; its terms are the profile's own copyright tag, checked
|
|
73
|
+
// in November 2026. The zip holds the profile and an info sheet.
|
|
74
|
+
download: {
|
|
75
|
+
page: 'https://www.eci.org/doku.php?id=en:downloads',
|
|
76
|
+
url: 'https://eci.org/lib/exe/pso-coated_v3.zip',
|
|
77
|
+
entry: 'PSOcoated_v3.icc',
|
|
78
|
+
owner: 'ECI',
|
|
79
|
+
licence: 'This profile is made available by ECI European Color Initiative (www.eci.org), with permission of Heidelberger Druckmaschinen AG (www.heidelberg.com), and may be used, embedded and exchanged without restriction. It may not be distributed, sold or altered without written permission of ECI European Color Initiative.',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
SWOP: {
|
|
84
|
+
name: 'SWOP',
|
|
85
|
+
colourSpace: 'CMYK',
|
|
86
|
+
identifier: 'CGATS21-2-CRPC5',
|
|
87
|
+
condition: 'SWOP 2013 C3: publication printing on grade 3 paper (CGATS 21-2 CRPC5)',
|
|
88
|
+
profile: {
|
|
89
|
+
file: 'SWOP2013C3_CRPC5.icc',
|
|
90
|
+
url: `${REGISTRY}SWOP2013C3_CRPC5.icc`,
|
|
91
|
+
sha256: '01123776855855378ed540228875458dfe88fca233a14d5b537800353c04faaf',
|
|
92
|
+
provider: 'Idealliance, with permission of X-Rite, Inc.',
|
|
93
|
+
terms: 'may be used, embedded, exchanged, and shared without restriction; may not be altered, or sold without written permission of Idealliance',
|
|
94
|
+
shareable: true,
|
|
95
|
+
inkLimit: 3,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
sRGB: {
|
|
99
|
+
name: 'sRGB',
|
|
100
|
+
colourSpace: 'RGB',
|
|
101
|
+
identifier: 'sRGB IEC61966-2.1',
|
|
102
|
+
condition: 'sRGB (IEC 61966-2-1)',
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* An output intent that can't be loaded, with a code and a fix: a host
|
|
107
|
+
* puts it at the edition's `output-intent` ({@link outputIntentProblem}).
|
|
108
|
+
*/
|
|
109
|
+
export class OutputIntentError extends Error {
|
|
110
|
+
code;
|
|
111
|
+
fix;
|
|
112
|
+
constructor(code, message, fix) {
|
|
113
|
+
super(message);
|
|
114
|
+
this.code = code;
|
|
115
|
+
this.fix = fix;
|
|
116
|
+
this.name = 'OutputIntentError';
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/** An output intent's error as the build's problem, at the edition's `output-intent` in `pulpweaver4.toml`. */
|
|
120
|
+
export function outputIntentProblem(error, configText, edition) {
|
|
121
|
+
return TomlDocument.parse(configText, 'pulpweaver4.toml').problem(['editions', edition, 'output-intent'], 'value', error.code, error.message, error.fix);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Loads an edition’s output intent: a standard one by name, or a profile’s
|
|
125
|
+
* file in the project. A file whose bytes are a standard profile’s takes
|
|
126
|
+
* that condition’s registered name; any other is PDF/X’s `Custom`, with its
|
|
127
|
+
* file as the condition.
|
|
128
|
+
*/
|
|
129
|
+
export async function loadOutputIntent(nameOrFile, host = {}) {
|
|
130
|
+
if (Object.hasOwn(STANDARD_OUTPUT_INTENTS, nameOrFile)) {
|
|
131
|
+
const intent = STANDARD_OUTPUT_INTENTS[nameOrFile];
|
|
132
|
+
const { profile } = intent;
|
|
133
|
+
const named = { colourSpace: intent.colourSpace, identifier: intent.identifier, condition: intent.condition, registryName: ICC_REGISTRY, standard: intent.name };
|
|
134
|
+
if (!profile)
|
|
135
|
+
return named;
|
|
136
|
+
const { download } = profile;
|
|
137
|
+
if (!profile.shareable && !(download && host.downloadedProfile)) {
|
|
138
|
+
const from = download ? `${download.owner}’s downloads page, ${download.page},` : profile.url;
|
|
139
|
+
throw new OutputIntentError('unshareable-profile', `output-intent ${intent.name}: its profile, ${profile.file} (${profile.provider}), ${profile.terms}, so pulpweaver4 doesn’t fetch it: download it from ${from} into the project and set output-intent to its path`, `download ${profile.file} from ${download?.page ?? profile.url} into the project and set output-intent = "${profile.file}"`);
|
|
140
|
+
}
|
|
141
|
+
const bytes = profile.shareable ? await (host.standardProfile ?? fetchProfile)({ ...intent, profile }) : await host.downloadedProfile({ ...intent, profile: { ...profile, download: download } });
|
|
142
|
+
const sha = await sha256(bytes);
|
|
143
|
+
if (sha !== profile.sha256)
|
|
144
|
+
throw new OutputIntentError('wrong-profile', `output-intent ${intent.name}: ${profile.file} isn’t the registered profile (its SHA-256 is ${sha}, not ${profile.sha256})`, `fetch it again from ${download?.page ?? profile.url}`);
|
|
145
|
+
return { ...named, profile: bytes };
|
|
146
|
+
}
|
|
147
|
+
if (!host.readFile)
|
|
148
|
+
throw new OutputIntentError('unreadable-profile', `output-intent ${nameOrFile}: the build can’t read the project’s files`);
|
|
149
|
+
const bytes = await host.readFile(nameOrFile);
|
|
150
|
+
await initColour();
|
|
151
|
+
let space;
|
|
152
|
+
try {
|
|
153
|
+
const p = IccProfile.fromBytes(bytes);
|
|
154
|
+
space = p.colourSpace;
|
|
155
|
+
p.close();
|
|
156
|
+
}
|
|
157
|
+
catch (e) {
|
|
158
|
+
throw new OutputIntentError('unreadable-profile', `output-intent ${nameOrFile}: ${e.message}`, 'name the printer’s ICC profile, an .icc file');
|
|
159
|
+
}
|
|
160
|
+
if (space !== 'CMYK' && space !== 'RGB' && space !== 'GRAY')
|
|
161
|
+
throw new OutputIntentError('bad-profile', `output-intent ${nameOrFile}: a ${space} profile can’t be an output intent`, 'name an output profile: CMYK, RGB or grey');
|
|
162
|
+
const sha = await sha256(bytes);
|
|
163
|
+
const known = Object.values(STANDARD_OUTPUT_INTENTS).find((i) => i.profile?.sha256 === sha);
|
|
164
|
+
if (known)
|
|
165
|
+
return { colourSpace: known.colourSpace, profile: bytes, identifier: known.identifier, condition: known.condition, registryName: ICC_REGISTRY, info: nameOrFile, standard: known.name };
|
|
166
|
+
return { colourSpace: space, profile: bytes, identifier: 'Custom', condition: nameOrFile, info: nameOrFile };
|
|
167
|
+
}
|
|
168
|
+
/** The standard condition a profile’s bytes are, if any. */
|
|
169
|
+
export async function standardOutputIntentOf(bytes) {
|
|
170
|
+
const sha = await sha256(bytes);
|
|
171
|
+
return Object.values(STANDARD_OUTPUT_INTENTS).find((i) => i.profile?.sha256 === sha);
|
|
172
|
+
}
|
|
173
|
+
async function fetchProfile(intent) {
|
|
174
|
+
const res = await fetch(intent.profile.url);
|
|
175
|
+
if (!res.ok)
|
|
176
|
+
throw new Error(`${intent.profile.url}: ${res.status}`);
|
|
177
|
+
return new Uint8Array(await res.arrayBuffer());
|
|
178
|
+
}
|
|
179
|
+
async function sha256(bytes) {
|
|
180
|
+
const digest = await crypto.subtle.digest('SHA-256', bytes);
|
|
181
|
+
return [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=intents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intents.js","sourceRoot":"","sources":["../../src/colour/intents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAKlD,wGAAwG;AACxG,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAA;AAiDlD,MAAM,QAAQ,GAAG,uDAAuD,CAAA;AAExE;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsF;IACxH,UAAU,EAAE;QACV,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,MAAM;QACnB,UAAU,EAAE,iBAAiB;QAC7B,SAAS,EAAE,uFAAuF;QAClG,OAAO,EAAE;YACP,IAAI,EAAE,sBAAsB;YAC5B,GAAG,EAAE,GAAG,QAAQ,sBAAsB;YACtC,MAAM,EAAE,kEAAkE;YAC1E,QAAQ,EAAE,8CAA8C;YACxD,KAAK,EAAE,yIAAyI;YAChJ,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,GAAG;SACd;KACF;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,MAAM;QACnB,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,0FAA0F;QACrG,OAAO,EAAE;YACP,IAAI,EAAE,8BAA8B;YACpC,GAAG,EAAE,GAAG,QAAQ,8BAA8B;YAC9C,MAAM,EAAE,kEAAkE;YAC1E,QAAQ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E,CAAA;AAC9G,CAAC;AAED,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,KAAiB;IAC5D,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,CAAA;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC,CAAA;AACtF,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,MAA6C;IACvE,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC3C,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC,CAAA;IACpE,OAAO,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC,CAAA;AAChD,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,KAAiB;IACrC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAgC,CAAC,CAAA;IACtF,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACzF,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Little CMS (https://littlecms.com, MIT), compiled to WebAssembly from
|
|
3
|
+
* `third_party/lcms2`: colour conversion through ICC profiles, for print
|
|
4
|
+
* editions’ output intents (https://plans.inkylabs.com/pulpweaver#colour-and-prepress).
|
|
5
|
+
* The module is plain C over wasi-libc with no JavaScript runtime of its own,
|
|
6
|
+
* so the same bytes run in every browser and in Node; the few WASI calls the
|
|
7
|
+
* C library links are answered here, and none does anything.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Where the module sits beside this one. Vite and esbuild leave
|
|
11
|
+
* `new URL(…, import.meta.url)` pointing at it; a Node host reads the file at
|
|
12
|
+
* this URL and passes the bytes to {@link initColour}.
|
|
13
|
+
*/
|
|
14
|
+
export declare const LCMS_WASM_URL: URL;
|
|
15
|
+
/** The source of the module: bytes, a compiled module, a `Response` or a URL. */
|
|
16
|
+
export type ColourWasmSource = BufferSource | WebAssembly.Module | Response | URL | string;
|
|
17
|
+
/**
|
|
18
|
+
* Loads Little CMS. By default it is fetched from {@link LCMS_WASM_URL}, which
|
|
19
|
+
* works in browsers (Node’s `fetch` reads no `file:` URLs, so a Node host
|
|
20
|
+
* passes the bytes). Later calls return the first load.
|
|
21
|
+
*/
|
|
22
|
+
export declare function initColour(source?: ColourWasmSource | Promise<ColourWasmSource>): Promise<void>;
|
|
23
|
+
/** A colour space an ICC profile describes, as its four-letter signature names it. */
|
|
24
|
+
export type IccColourSpace = 'GRAY' | 'RGB' | 'CMYK' | 'Lab' | 'XYZ' | string;
|
|
25
|
+
/** The class of device a profile is for: `prtr` (output), `mntr`, `scnr`, `spac`… */
|
|
26
|
+
export type IccDeviceClass = 'prtr' | 'mntr' | 'scnr' | 'spac' | 'link' | 'abst' | 'nmcl' | string;
|
|
27
|
+
/** An ICC profile, opened in Little CMS. {@link close} it when done. */
|
|
28
|
+
export declare class IccProfile {
|
|
29
|
+
/** @internal Little CMS’s handle. */
|
|
30
|
+
readonly handle: number;
|
|
31
|
+
/** The profile’s colour space: what its device values are. */
|
|
32
|
+
readonly colourSpace: IccColourSpace;
|
|
33
|
+
readonly deviceClass: IccDeviceClass;
|
|
34
|
+
/** How many components a colour in {@link colourSpace} has. */
|
|
35
|
+
readonly channels: number;
|
|
36
|
+
private constructor();
|
|
37
|
+
/** A profile from its bytes, such as a printer’s CMYK `.icc` file. */
|
|
38
|
+
static fromBytes(bytes: Uint8Array): IccProfile;
|
|
39
|
+
/** sRGB, as Little CMS builds it: CSS’s colours. */
|
|
40
|
+
static srgb(): IccProfile;
|
|
41
|
+
/** CIELAB under D50, the profile connection space’s white (L* 0–100). */
|
|
42
|
+
static lab(): IccProfile;
|
|
43
|
+
close(): void;
|
|
44
|
+
}
|
|
45
|
+
/** How colours outside the destination’s gamut, and its white, are mapped (ICC.1’s rendering intents). */
|
|
46
|
+
export type RenderingIntent = 'perceptual' | 'relative' | 'saturation' | 'absolute';
|
|
47
|
+
export interface TransformOptions {
|
|
48
|
+
/** `relative` (relative colorimetric) by default, prepress’s usual choice. */
|
|
49
|
+
intent?: RenderingIntent;
|
|
50
|
+
/** Black-point compensation, mapping black to the destination’s black; on by default. */
|
|
51
|
+
blackPointCompensation?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A conversion from one profile’s colour space to another’s, for colours as
|
|
55
|
+
* numbers or images as 8-bit pixels. Device components run from 0 to 1
|
|
56
|
+
* (CMYK too, though Little CMS counts it in percent); Lab is L* 0–100 with a*
|
|
57
|
+
* and b* as they are. {@link close} it when done.
|
|
58
|
+
*/
|
|
59
|
+
export declare class ColourTransform {
|
|
60
|
+
private readonly float;
|
|
61
|
+
private readonly bytes;
|
|
62
|
+
private readonly scaleIn;
|
|
63
|
+
private readonly scaleOut;
|
|
64
|
+
/** Components per colour on each side. */
|
|
65
|
+
readonly channelsIn: number;
|
|
66
|
+
readonly channelsOut: number;
|
|
67
|
+
private constructor();
|
|
68
|
+
static create(from: IccProfile, to: IccProfile, opts?: TransformOptions): ColourTransform;
|
|
69
|
+
/** Converts one colour. */
|
|
70
|
+
convert(colour: readonly number[]): number[];
|
|
71
|
+
/** Converts colours packed one after another (`channelsIn` numbers each). */
|
|
72
|
+
convertMany(colours: Float64Array): Float64Array;
|
|
73
|
+
/**
|
|
74
|
+
* Converts 8-bit pixels, interleaved with no alpha (RGB as `r g b r g b …`),
|
|
75
|
+
* as an image’s are.
|
|
76
|
+
*/
|
|
77
|
+
convertPixels(pixels: Uint8Array): Uint8Array;
|
|
78
|
+
close(): void;
|
|
79
|
+
}
|