postext-epub 0.32.1 → 0.32.2

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 (2) hide show
  1. package/README.md +2 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -94,10 +94,11 @@ The same array is what `renderToPdf` from `postext-pdf` takes for a book, so a P
94
94
  <tr><td><code>fonts</code></td><td>The faces to embed: <code>{ family, weight, style, bytes, format, unicodeRange? }</code>, with <code>format</code> one of <code>woff2</code>, <code>woff</code>, <code>ttf</code>, <code>otf</code>. Each face becomes a file and an <code>@font-face</code> rule. Several files of one face, each with its <code>unicodeRange</code> (Google Fonts slices), are allowed. A face with <code>redistributable: false</code> is never written into the file, neither as a book font nor inside an SVG picture.</td></tr>
95
95
  <tr><td><code>svgFonts</code></td><td>How SVG pictures get the book's fonts: a reading system shows an SVG as an image that cannot see the book's fonts, so the faces its text names are embedded in it as <code>@font-face</code> data URIs, from <code>fonts</code> (the slices that hold its characters), then from <code>provider</code> (the contract of postext-pdf's <code>PdfFontProvider</code>) for a family the book's text does not use. <code>{ inline?, provider?, withhold?, maxBytes? }</code>: <code>inline: false</code> keeps every SVG as given (so do <code>diagramStyle.inlineFonts: false</code> and a resource's <code>svg.inlineFonts: false</code>), <code>withhold(family)</code> keeps a family out (reported as <code>fontWithheld</code>), <code>maxBytes</code> caps the font bytes per SVG (2 MiB, <code>svgFontsTooLarge</code> above it). A family with no face is reported as <code>svgFontUnavailable</code>. On the worker, a <code>provider</code> or <code>withhold</code> runs on the calling thread.</td></tr>
96
96
  <tr><td><code>resourceBytes</code></td><td><code>(fileId) =&gt; { bytes, mediaType } | undefined</code>, sync or async: the pictures the pages place, by file id. Bitmaps as they are, SVGs as their source (not a PDF print master). An empty <code>mediaType</code> is read from the bytes. A single-ink book (<code>diagramStyle.singleInk</code>) has its SVGs recoloured in the file, and every SVG gets the fonts its text names (see <code>svgFonts</code>).</td></tr>
97
- <tr><td><code>cover</code></td><td><code>{ bytes, mediaType, alt? }</code>: a JPEG, PNG, WebP or SVG cover picture. It opens the book on a cover document of its own and is marked as the <code>cover-image</code>. Without it, the fixed layout names its first page as the cover, and the reflowable book has no cover picture.</td></tr>
97
+ <tr><td><code>cover</code></td><td><code>{ bytes, mediaType, alt?, showsFirstPage? }</code>: a JPEG, PNG, WebP or SVG cover picture. It opens the book on a cover document of its own and is marked as the <code>cover-image</code>. With <code>showsFirstPage: true</code> (the picture is a capture of the first printed page), the fixed layout gives it no page of its own, so the cover is not shown twice: it is only the package's cover image and the first page is the cover document. Without a cover, the fixed layout names its first page as the cover, and the reflowable book has no cover picture.</td></tr>
98
98
  <tr><td><code>onProgress</code></td><td><code>{ phase, done, total }</code>, with <code>phase</code> one of <code>resources</code> (fonts and pictures), <code>documents</code> (pages for a fixed layout, chapters for a reflowable one) and <code>package</code> (the package document, the navigation and the zip).</td></tr>
99
99
  <tr><td><code>onWarning</code></td><td>Problems that do not stop the file: <code>missingImage</code> (a picture with no bytes, left as an empty frame), <code>missingFont</code> (a family, weight or style the pages use with no embedded face, which reading systems replace), <code>svgFontUnavailable</code>, <code>svgFontsTooLarge</code> and <code>fontWithheld</code> (see <code>svgFonts</code>) and <code>unsupported</code>.</td></tr>
100
100
  <tr><td><code>signal</code></td><td>An <code>AbortSignal</code>; aborting rejects the promise between steps.</td></tr>
101
+ <tr><td><code>kindlePanelView</code></td><td>Fixed layout with comic pages (<code>:::page</code>): adds Kindle Panel View, a tap target over each panel that magnifies it, and the Kindle comic metadata, for books bound for Kindle. Each target holds a copy of its page's comic, so pages grow by one copy per panel. Default false; the region-based navigation every reading system may use is written either way.</td></tr>
101
102
  </tbody>
102
103
  </table>
103
104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postext-epub",
3
- "version": "0.32.1",
3
+ "version": "0.32.2",
4
4
  "description": "Browser-native EPUB 3 writer for Postext documents: fixed-layout (pre-paginated) books that reproduce every printed page with real text, and reflowable books in semantic XHTML styled from the same configuration.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,7 +42,7 @@
42
42
  "./package.json": "./package.json"
43
43
  },
44
44
  "peerDependencies": {
45
- "postext": "^1.46.1"
45
+ "postext": "^1.46.2"
46
46
  },
47
47
  "dependencies": {
48
48
  "fflate": "^0.8.3"
@@ -51,7 +51,7 @@
51
51
  "@postext/typescript-config": "0.0.0",
52
52
  "@types/node": "^26.5.0",
53
53
  "eslint": "^9.39.4",
54
- "postext": "1.46.1",
54
+ "postext": "1.46.2",
55
55
  "typescript": "^6.0.3",
56
56
  "typescript-eslint": "^8.70.0",
57
57
  "vitest": "^5.0.0"