@reportwright/viewer 0.12.1 → 0.13.0

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 (81) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +16 -1
  3. package/THIRD-PARTY-NOTICES.md +52 -0
  4. package/dist/{chunk-S2IUUI6N.js → chunk-BF7GCWZY.js} +67 -49
  5. package/dist/chunk-BF7GCWZY.js.map +6 -0
  6. package/dist/chunk-BR5K6SBL.js +324 -0
  7. package/dist/chunk-BR5K6SBL.js.map +6 -0
  8. package/dist/{peer/chunk-BQFI3DHK.js → chunk-CNDUJ7IV.js} +289 -25
  9. package/dist/chunk-CNDUJ7IV.js.map +6 -0
  10. package/dist/{chunk-VNOWPSE6.js → chunk-EK5CJY22.js} +1223 -899
  11. package/dist/chunk-EK5CJY22.js.map +6 -0
  12. package/dist/{chunk-2BPBQMH2.js → chunk-F5EPQTPF.js} +3 -3
  13. package/dist/chunk-FEM2QVOO.js +18 -0
  14. package/dist/{chunk-3D2KFKG2.js → chunk-IFYCJZNS.js} +8 -6
  15. package/dist/chunk-IFYCJZNS.js.map +6 -0
  16. package/dist/{chunk-NR2G4TMG.js → chunk-L6YEIVVD.js} +43 -22
  17. package/dist/chunk-L6YEIVVD.js.map +6 -0
  18. package/dist/{chunk-DPVJEFKP.js → chunk-PQNM6ET7.js} +4 -4
  19. package/dist/{chunk-DPVJEFKP.js.map → chunk-PQNM6ET7.js.map} +1 -1
  20. package/dist/{chunk-Z7MKH66Z.js → chunk-QFLVVM3H.js} +225 -11
  21. package/dist/chunk-QFLVVM3H.js.map +6 -0
  22. package/dist/{chunk-PGP3QA6L.js → chunk-TZXEEVKE.js} +1301 -70
  23. package/dist/chunk-TZXEEVKE.js.map +6 -0
  24. package/dist/{chunk-Q6MMPKQA.js → chunk-UHHURTSV.js} +11 -10
  25. package/dist/chunk-UHHURTSV.js.map +6 -0
  26. package/dist/{chunk-M6AYND5G.js → chunk-UJL7C2AS.js} +16 -7
  27. package/dist/chunk-UJL7C2AS.js.map +6 -0
  28. package/dist/chunk-YIX3OJXU.js +34 -0
  29. package/dist/designer.d.ts +11 -3
  30. package/dist/designer.js +587 -386
  31. package/dist/designer.js.map +3 -3
  32. package/dist/engine.worker.js +16729 -18
  33. package/dist/engine.worker.js.map +3 -3
  34. package/dist/peer/{chunk-6I2EAAVN.js → chunk-2CD5COHN.js} +43 -22
  35. package/dist/peer/chunk-2CD5COHN.js.map +6 -0
  36. package/dist/peer/{chunk-BMAXIBP2.js → chunk-3CBV5SAI.js} +4 -4
  37. package/dist/peer/{chunk-BMAXIBP2.js.map → chunk-3CBV5SAI.js.map} +1 -1
  38. package/dist/peer/{chunk-WSNRD2AQ.js → chunk-45GVDKP5.js} +11 -10
  39. package/dist/{chunk-Q6MMPKQA.js.map → peer/chunk-45GVDKP5.js.map} +1 -1
  40. package/dist/peer/{chunk-R4VX5UC7.js → chunk-LWXQX3NJ.js} +3 -3
  41. package/dist/{chunk-6TPZ7G74.js → peer/chunk-MKY3SDXU.js} +289 -25
  42. package/dist/peer/chunk-MKY3SDXU.js.map +6 -0
  43. package/dist/peer/chunk-S6LSPHSU.js +17 -0
  44. package/dist/peer/chunk-S6LSPHSU.js.map +6 -0
  45. package/dist/peer/{chunk-TSC4RAH3.js → chunk-VZHHNQYB.js} +1301 -70
  46. package/dist/peer/chunk-VZHHNQYB.js.map +6 -0
  47. package/dist/peer/{chunk-WQGENQZO.js → chunk-YITWGAR4.js} +8 -6
  48. package/dist/peer/chunk-YITWGAR4.js.map +6 -0
  49. package/dist/peer/chunk-Z5II55QT.js +33 -0
  50. package/dist/peer/chunk-Z5II55QT.js.map +6 -0
  51. package/dist/peer/designer.js +444 -243
  52. package/dist/peer/designer.js.map +3 -3
  53. package/dist/peer/engine.worker.js +16729 -17
  54. package/dist/peer/engine.worker.js.map +3 -3
  55. package/dist/peer/viewer.js +14 -11
  56. package/dist/peer/viewer.js.map +1 -1
  57. package/dist/viewer.d.ts +2 -1
  58. package/dist/viewer.js +14 -11
  59. package/dist/viewer.js.map +1 -1
  60. package/package.json +4 -2
  61. package/dist/chunk-3D2KFKG2.js.map +0 -6
  62. package/dist/chunk-6TPZ7G74.js.map +0 -6
  63. package/dist/chunk-BRB34AJ2.js +0 -16
  64. package/dist/chunk-M6AYND5G.js.map +0 -6
  65. package/dist/chunk-NR2G4TMG.js.map +0 -6
  66. package/dist/chunk-PGP3QA6L.js.map +0 -6
  67. package/dist/chunk-S2IUUI6N.js.map +0 -6
  68. package/dist/chunk-ULKEEARQ.js +0 -553
  69. package/dist/chunk-ULKEEARQ.js.map +0 -6
  70. package/dist/chunk-VNOWPSE6.js.map +0 -6
  71. package/dist/chunk-Z7MKH66Z.js.map +0 -6
  72. package/dist/peer/chunk-2FZTYEDE.js +0 -15
  73. package/dist/peer/chunk-6I2EAAVN.js.map +0 -6
  74. package/dist/peer/chunk-BQFI3DHK.js.map +0 -6
  75. package/dist/peer/chunk-TSC4RAH3.js.map +0 -6
  76. package/dist/peer/chunk-WQGENQZO.js.map +0 -6
  77. package/dist/peer/chunk-WSNRD2AQ.js.map +0 -6
  78. /package/dist/{chunk-2BPBQMH2.js.map → chunk-F5EPQTPF.js.map} +0 -0
  79. /package/dist/{chunk-BRB34AJ2.js.map → chunk-FEM2QVOO.js.map} +0 -0
  80. /package/dist/{peer/chunk-2FZTYEDE.js.map → chunk-YIX3OJXU.js.map} +0 -0
  81. /package/dist/peer/{chunk-R4VX5UC7.js.map → chunk-LWXQX3NJ.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,84 @@
2
2
 
3
3
  All `@reportwright/*` packages (formerly `@pagewrightjs/*`) share one version. The versioning policy is in [CONTRIBUTING.md](CONTRIBUTING.md#versioning-semver).
4
4
 
5
+ ## 0.13.0 — 2026-10-09
6
+
7
+ A minor release: new options (`largeReportRows`, `signal`, `warnOnLeave`, `onDirtyChange`), the 14 standard PDF fonts, streamed Excel and Word exports, and warnings where mistakes used to be silent. The tester's 0.12.1 tickets are fixed except where noted; fonts are still TTF (WOFF2 is not done).
8
+
9
+ ### Fixed
10
+ - **Cold Helvetica invoice (A1.1):** a report that names only the standard PDF fonts loads no font file and no fontkit (Inter loads in a second layout pass only when some text needs it, such as a character WinAnsi lacks), and `exportPdf` writes such a model (standard-font text, boxes, lines, links) with the engine's own PDF writer instead of pdf-lib. A new process making a 1-page Helvetica invoice PDF: about 115 ms instead of 224 ms on an M2, with the same text, fonts and page content. Embedded fonts, images, form fields, PDF/A, tagged, encrypted and signed files still go through pdf-lib.
11
+ - **Cold start (A1.1):** pdf-lib and fontkit load on first use (in Node through `require`, elsewhere `import()`), not
12
+ when the engine is imported: `import('@reportwright/engine')` takes about 42 ms instead of 175 ms on an M2, a render
13
+ loads only fontkit, and the streaming PDF writer never loads pdf-lib. A new process making a 1-page invoice PDF:
14
+ about 318 ms instead of 364 ms (most of what is left is compiling harfbuzz-subset.wasm, about 150 ms).
15
+ - **Large classic renders (A1.4, A1.5):** `render()` past 100,000 rows warns once (`Large report (N rows):
16
+ exportPdfStream writes it in about 320 MB; render + exportPdf holds it all in memory`), in the model's warnings and
17
+ once per process on the console. The threshold is the render option `largeReportRows` (100000; `0` or `false`: off). `exportPdf` takes a rendered model, so it cannot switch to streaming itself; the
18
+ engine README shows `exportPdfStream` with a sink that keeps the bytes.
19
+ - **Excel streams; Word is written page by page (A1.9):** `exportXlsxStream` keeps memory flat; `exportDocxStream` lowers it, but a Word export's memory still grows slowly with the rows, so it is not yet a flat stream. `exportDocxStream` and `exportXlsxStream` (engine package and `src/exporters/officestream.js`) write a report's Word or Excel file to a sink as its pages or rows are made, with `exportPdfStream`'s sink, `timeoutMs` and `signal`; a report that cannot stream is written whole (`why`). `exportDocx` writes the document XML into the zip page by page instead of holding it. Peak RSS of a Word export, 20k / 50k rows: 329 / 499 MB before (render + exportDocx), 259 / 286 MB streamed with a flat live heap (17.5 / 17.3 MB after GC); Excel 251 / 432 MB before, 125 / 126 MB streamed (`scripts/mem-office.mjs`).
20
+ - **Viewer first load (A1.6):** the embedded viewer no longer loads the engine (layout, expressions, charts, maps, barcodes) on the main thread up front: the worker renders, and the engine loads on the main thread on the first export, parameter list or main-thread render. First load 827 → 652 KB gzipped (about 262 KB once fontkit loads lazily); the render worker 908 → 579 KB, with bwip-js in `engine.worker.bwip.js` beside it, imported for a report with a barcode (a worker copied alone renders such a report on the main thread). `tests/engine/b10-bundle-size.test.js` holds both to a budget.
21
+ - **`pw render -f pdf` streams (A1.4):** into a file, a flowing report is written by `exportPdfStream` (the message says
22
+ `streamed`; the text is the whole-model PDF's), through a temporary file renamed on success, so a failed run leaves
23
+ no damaged PDF. Encrypted files, reports that cannot stream and `-o -` render the whole model as before. A streamed
24
+ grouped report no longer warns that the group totals' internal fields (`__g0_0`) are missing.
25
+ - **First PDF of a cold process (Node):** harfbuzz-subset.wasm is compiled synchronously, which V8 does lazily; the async compile also optimized the whole module in the background, and the first export waited for it. A cold 1-page invoice in Inter: export 215 ms → 40 ms, whole process 498 ms → 305 ms (median of 10, M2). Browsers keep the async compile. A PDF in the standard fonts never loads the subsetter.
26
+ - **CJK fonts survive upgrades (N10):** `@reportwright/fonts-cjk` downloads into a cache folder outside the package (`REPORTWRIGHT_FONTS_DIR`, else `$XDG_CACHE_HOME/reportwright/fonts-cjk`, else `%LOCALAPPDATA%\reportwright\fonts-cjk` on Windows or `~/.cache/reportwright/fonts-cjk`), so upgrading the package no longer deletes them; `defaultFontStore()` reads that folder, then the package's old `fonts/` folder, so existing installs keep working. New exports: `cacheDir()`, `fontPath(name)`.
27
+ - **The 14 standard PDF fonts (A1.2):** `fontFamily` `Helvetica`, `Times-Roman` and `Courier` (four faces each, PostScript names such as `Helvetica-BoldOblique`), `Symbol` and `ZapfDingbats` are named in the PDF and not embedded (Type1, WinAnsiEncoding, the Adobe AFM widths from `@pdf-lib/standard-fonts`); layout measures with the same widths. Aliases: Arial → Helvetica, Times New Roman → Times-Roman, Courier New → Courier. An invoice in Helvetica is about 1.6 KB. Characters WinAnsi lacks are drawn in Inter with a warning; PDF/A and PDF/UA embed Inter (JetBrains Mono for Courier) at the standard font's glyph positions, with a warning; `exportPdfStream` does the same. SVG/HTML name the font with a CSS fallback list, Word and PowerPoint name Arial, Times New Roman or Courier New. `@pdf-lib/standard-fonts` (already installed with pdf-lib) is now a declared dependency, kept external in the packages.
28
+ - **Unknown fonts (N39):** a `fontFamily` the engine does not have is no longer swapped silently: the render warns once per name (`Font "NoSuchFont" is not available; using Inter.`), and monospace names (Consolas, Menlo, Monaco…) use the shipped JetBrains Mono instead of Inter, so aligned columns stay aligned. Family names match in any case, a CSS list (`"Brand, Inter"`) uses its first available font, and the generic names `sans-serif` and `monospace` map to Inter and JetBrains Mono without a warning.
29
+ - **Streaming tickets, from the 0.12.1 retest (N23-N29):** `exportPdfStream` with `encrypt` or `prepare` and `sqlRows` no
30
+ longer fails with "Save the report first" (the rows are gathered for the whole-model render); a misspelled option
31
+ key (`encrpyt`, `windw`) warns with "Did you mean" in `render()`'s model warnings, `exportPdfStream`'s result and
32
+ `exportPdf`'s `onWarning`, and a misspelling of `encrypt` or `prepare` throws so no file is written without its
33
+ password or signature; `sqlRows` yielding single rows says "sqlRows must yield arrays of rows (got an object with
34
+ keys …)" and sync iterables are accepted; `spill.dir` that does not exist says so; `pw render --base` on a private
35
+ address names `--allow-internal`; README: the temp-file + rename pattern for a failed stream and a `pg` +
36
+ `pg-cursor` `sqlRows` example; the `exportPdf` option docs (pdfa, prepare, save) say what the code does.
37
+ - **Data and form-field retest tickets (B9):**
38
+ - A `number` (or `date`) field with text in it (N26) warns once per field with the first bad row and how many values
39
+ are empty, in a render and in a streamed export. Numeric strings such as "12.34" stay silent.
40
+ - A data set whose path matches an object that holds the rows (`data: { orders: { rows: [...] } }`) warns and names
41
+ the array key (N8). An object of fields, such as `$.meta`, does not.
42
+ - `validate()` warns on an aggregate with no scope outside a table, list or data-set item (it uses the first data
43
+ set), and on `nullable: false` or `allowBlank: false` with no default on a parameter that is not required.
44
+ - A form field has a `label` (falls back to `tooltip`); a tagged PDF uses it as the field's accessible name (`/TU`)
45
+ and warns for each field without one (N30).
46
+ - **Tagged PDF table of contents (N32):** a TOC is tagged `TOC > TOCI > Reference > Link`, with the entry text, its page number and the link annotation inside one Link (it was plain `P` elements with a Link around the number only), and its title is an `H1`. veraPDF PDF/UA-1: compliant. The streaming PDF's tagging is unchanged.
47
+ - **Cascading parameters in the viewer:** when a parent parameter changes, a dependent value its list no longer offers is replaced (by the default if still offered, else the first choice) in the state the run uses, and the report re-runs with it. Before, the panel dropped the value but the run kept the old one ("Delhi, South region" with no rows).
48
+ - **Viewer page thumbnails (A11Y-3):** `.vthumb` no longer has an `aria-label` that differs from its visible number (axe `label-content-name-mismatch`); its name "Page 1" comes from hidden text beside the visible 1.
49
+ - **Viewer worker fallback (N1):** when the render worker cannot load (Vite 7 without `worker: { format: 'es' }`, or esbuild not following `new Worker(new URL(...))`), the viewer logs once `[reportwright] worker did not load (<reason>); rendering on the main thread`, and `handle.usesWorker` says which one you got. The viewer README now starts with the bundler setup. No Vite plugin: the setting is one line.
50
+ - **Worker file (N18):** `engine.worker.js` is one self-contained file (no `chunk-*.js` imports), so copying it alone next to a page works.
51
+ - **Viewer fonts (N31):** the viewer fetches a font face only when the layout first needs it, not all seven up front. A report in Inter Regular and Bold now downloads 670 KB (two files) instead of 4.9 MB. Serve `fontsUrl` with `Cache-Control: public, max-age=31536000, immutable` (in the viewer README). WOFF2 for the browser is not done yet.
52
+ - **Streaming PDF (`exportPdfStream`) failures, from the 0.12.1 retest:**
53
+ - A sink that stops reading no longer hangs the export: `timeoutMs` covers the waits for drain (504, `code:
54
+ 'ETIMEDOUT'`), a sink's `error` or `close` ends the wait, and the new `signal` option (an `AbortSignal`) stops the
55
+ export at its next wait (rows, sink, sort, page) with an `AbortError`. `sqlRows` gets `{ signal }` as its third
56
+ argument. On timeout or abort the rows' cursors are closed and spill files removed.
57
+ - **Polar chart without `xValue`** (the angle) says so in validate() and the render ("a polar chart needs xValue"), instead of
58
+ "N of N rows have no x or y value". A valid polar chart gets no warnings.
59
+ - **Variable font subsets say their weight:** a variable font cut at Regular is named Regular (family, subfamily, full and PostScript names) with usWeightClass 400, and its variation tables are dropped, in the PDF and HTML subsets.
60
+ - **Deprecation messages** all say "will be removed in 1.0" (exportHtml's said 0.9). A test greps the source for a deprecation string that names 0.9.
61
+ - **Rich text warnings** say "Rich text:" once (an unnamed item was named "Rich text" and the parser repeated it). The legend warning says what is accepted: a chart's legend is "bottom" or "none", and it is drawn at the bottom.
62
+
63
+ - **Designer (b9):**
64
+ - Embedded designer: `mountDesigner` asks before the page is left with unsaved changes (`warnOnLeave`, default
65
+ true; false leaves it to the host), and the handle has `isDirty()` and an `onDirtyChange(dirty)` option. The guard is
66
+ removed on save and on `unmount()` (N34). A blank report is named "Untitled report" (it was "New report").
67
+ - Keyboard: the outline rows are a listbox with one Tab stop (Up/Down/Home/End move, Enter or Space selects, Shift
68
+ adds; then Delete and the arrows act on the selection); the left rail's tabs take the focus to their section;
69
+ canvas items are Tab stops named "Text box T1, x 10, y 10" that Enter selects (N35).
70
+ - Paste uses the paste event's clipboard (no clipboard-read permission), else the copy made in this tab, and says
71
+ when there is nothing to paste (N36).
72
+ - Width and height are at least 1 pt (a line may be 0 one way) (N33). Ctrl+D offsets the copy by 12 pt, as a paste
73
+ does (N37).
74
+ - Opening a report gives an item without an `id` a stable one (a hash of its band, place and name), so the same
75
+ file always reads back the same; the other normalisation (names, band heights, a table's size) is unchanged (N38).
76
+ - Embedded designer (shadow root): the table cell menu acts again, and Esc and Ctrl+S work after a click on a band
77
+ label, a matrix or a drill-through in Preview.
78
+ - A table that gets taller (Add group) grows its band; a drop into a 0 pt band grows it. A number field dropped on a
79
+ group header cell gives `=Sum(...)`, as on a footer. A matrix value shown as a percentage gets the format P1 while
80
+ its format is still the default N0. The matrix's drill-down toggle starts closed, as the table's.
81
+ - Accessibility: the fx button is named "fx: Open the expression editor"; table row tags have 4.85:1 contrast.
82
+
5
83
  ## 0.12.1 — 2026-10-08
6
84
 
7
85
  ### Fixed
package/README.md CHANGED
@@ -4,6 +4,19 @@
4
4
 
5
5
  The ReportWright report viewer in any web app (React is bundled inside, in a shadow root, so your styles do not leak in). A React app imports `@reportwright/viewer/react-peer` (and `/react-peer/designer`) instead, the same viewer using the app's own React, so the page loads React once; `@reportwright/react` does this for you:
6
6
 
7
+ ## Bundler setup (read this first)
8
+
9
+ The viewer renders in a Web Worker (`engine.worker.js`, one self-contained file next to the viewer). Bundlers that understand
10
+ `new Worker(new URL(...))` pick it up; two settings matter:
11
+
12
+ - **Vite 7**: set `worker: { format: 'es' }` in `vite.config.js`. Without it the build fails with
13
+ `Invalid value "iife" for option "worker.format"`.
14
+ - **esbuild** (plain bundling) does not follow `new Worker(new URL(...))`: copy `node_modules/@reportwright/viewer/dist/engine.worker.js`
15
+ next to your bundle (it is one file; its only imports are the package's own dependencies).
16
+
17
+ If the worker cannot load, the viewer still renders, on the main thread (slow and janky at 100k rows), and logs once
18
+ `[reportwright] worker did not load (<reason>); rendering on the main thread`. `handle.usesWorker` tells you which one you got.
19
+
7
20
  Import it through your bundler (Vite, webpack, esbuild, Rollup, Next…). Its third-party libraries (pdf-lib,
8
21
  @pdf-lib/fontkit, bwip-js, fflate, bidi-js) are ordinary dependencies, pinned to the versions the tests ran
9
22
  against, so the package itself holds only ReportWright's own readable code.
@@ -28,7 +41,7 @@ mountViewer('#report', {
28
41
  });
29
42
  ```
30
43
 
31
- Nothing calls `/api`; each font is downloaded once; the toolbar uses the system font.
44
+ Nothing calls `/api`; each font is downloaded once, and only when the layout first needs it (a report in Inter Regular and Bold fetches those two files, not all seven); the toolbar uses the system font.
32
45
 
33
46
  If a font cannot be loaded (wrong `fontsUrl`, the folder not served), the report does not draw: the viewer shows
34
47
  "The report did not run. Font "Inter-Regular" did not load (HTTP 404)" with a Retry button, and `onReady(error)` is called
@@ -37,6 +50,8 @@ with that error. Fix the path and retry; there is no fallback font. `onReady(err
37
50
  you pass as `fontsUrl`; `fontsUrl` is not inferred from the package. Copying only `fonts/` works too
38
51
  (PDFs then embed whole fonts, and PDF/A export needs `icc/`).
39
52
 
53
+ Serve `fontsUrl` with `Cache-Control: public, max-age=31536000, immutable`: the files do not change within a package version, so a returning visitor downloads none of them.
54
+
40
55
  ## What works standalone, what needs the server
41
56
 
42
57
  The npm packages are a library: nothing here needs a ReportWright server. The server is a separate, self-hosted app
@@ -0,0 +1,52 @@
1
+ # Third-party notices
2
+
3
+ ReportWright is MIT licensed (see LICENSE). It ships or bundles the following third-party work, under their own licenses.
4
+
5
+ ## Bundled code
6
+
7
+ | Component | Version | License | Used for |
8
+ |---|---|---|---|
9
+ | [HarfBuzz](https://github.com/harfbuzz/harfbuzz), compiled to WebAssembly by [harfbuzzjs](https://github.com/harfbuzz/harfbuzzjs) | harfbuzzjs 1.6.2 | HarfBuzz: "Old MIT" (below); harfbuzzjs: MIT, Copyright (c) 2019-2026 The harfbuzzjs project authors | text shaping (`harfbuzz.wasm`) and font subsetting (`harfbuzz-subset.wasm`) |
10
+ | [pdf-lib](https://github.com/Hopding/pdf-lib) | 1.17.1 | MIT, Copyright (c) 2019 Andrew Dillon | the classic PDF writer (encryption, `prepare`, `save`) |
11
+ | [@pdf-lib/fontkit](https://github.com/Hopding/fontkit) | 1.1.1 | MIT | reading font files |
12
+ | [@pdf-lib/standard-fonts](https://github.com/Hopding/standard-fonts) | 1.0.0 | MIT; the metrics are Adobe's AFM files for the 14 standard PDF fonts | Helvetica, Times and Courier widths |
13
+ | [bwip-js](https://github.com/metafloor/bwip-js) | 4.11.4 | MIT | barcodes |
14
+ | [fflate](https://github.com/101arrowz/fflate) | 0.8.3 | MIT | zip and deflate (Excel, Word, PowerPoint, PDF streams) |
15
+ | [bidi-js](https://github.com/lojjic/bidi-js) | 1.0.3 | MIT | right-to-left text |
16
+
17
+ The full license text of each npm dependency is in its package under `node_modules`.
18
+
19
+ ### HarfBuzz ("Old MIT" license)
20
+
21
+ HarfBuzz is licensed under the so-called "Old MIT" license. Its copyright holders are listed in
22
+ [COPYING](https://github.com/harfbuzz/harfbuzz/blob/main/COPYING) in the HarfBuzz repository.
23
+
24
+ > Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify,
25
+ > and distribute this software and its documentation for any purpose, provided that the above copyright notice and
26
+ > the following two paragraphs appear in all copies of this software.
27
+ >
28
+ > IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
29
+ > CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE COPYRIGHT HOLDER HAS
30
+ > BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ >
32
+ > THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
33
+ > MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE
34
+ > COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
35
+
36
+ ## Fonts (in @reportwright/fonts and @reportwright/fonts-cjk)
37
+
38
+ All fonts are under the [SIL Open Font License 1.1](https://openfontlicense.org); each family's license file ships next
39
+ to it in `public/fonts` (OFL-Inter.txt, OFL-JetBrainsMono.txt, OFL-NotoSans*.txt).
40
+
41
+ | Family | Source |
42
+ |---|---|
43
+ | Inter | [rsms/inter](https://github.com/rsms/inter) |
44
+ | JetBrains Mono | [JetBrains/JetBrainsMono](https://github.com/JetBrains/JetBrainsMono) |
45
+ | Noto Sans Arabic, Bengali, Devanagari, Gujarati, Hebrew, Kannada, Khmer, Lao, Myanmar, Tamil, Telugu, Thai | [notofonts](https://github.com/notofonts) |
46
+ | Noto Sans CJK and Noto Emoji (fonts-cjk, downloaded on demand) | [notofonts](https://github.com/notofonts) |
47
+
48
+ ## Colour profile
49
+
50
+ `sRGB-v2-magic.icc` (the PDF/A output intent) is from
51
+ [Compact-ICC-Profiles](https://github.com/saucecontrol/Compact-ICC-Profiles) by Clinton Ingram, released under
52
+ CC0 1.0 (public domain).
@@ -15,12 +15,20 @@ import {
15
15
  figures,
16
16
  hexOrNull,
17
17
  rasterize
18
- } from "./chunk-M6AYND5G.js";
18
+ } from "./chunk-UJL7C2AS.js";
19
+ import {
20
+ officeFamily
21
+ } from "./chunk-QFLVVM3H.js";
19
22
 
20
23
  // src/exporters/docx.js
21
24
  import { Zip, ZipDeflate, strToU8 } from "fflate";
22
25
  var TW = 20;
23
26
  var EMU = 12700;
27
+ var CONTENT_TYPES = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
28
+ <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Default Extension="png" ContentType="image/png"/><Default Extension="jpeg" ContentType="image/jpeg"/><Default Extension="svg" ContentType="image/svg+xml"/><Override Part\
29
+ Name="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/></Types>`;
30
+ var RELS = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
31
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/></Relationships>`;
24
32
  var XML_CHUNK = 4 * 1024 * 1024;
25
33
  function slices(s, max) {
26
34
  const out = [];
@@ -41,11 +49,11 @@ var hex = (c) => {
41
49
  };
42
50
  function rPr(it) {
43
51
  const f = String(it.font || "");
44
- const family = /mono/i.test(f) ? "JetBrains Mono" : f.split("-")[0] || "Inter";
52
+ const family = officeFamily(f);
45
53
  const deco = String(it.deco || "");
46
54
  const script = it.rich?.s ? `<w:vertAlign w:val="${it.rich.s === "sup" ? "superscript" : "subscript"}"/>` : "";
47
55
  const size = it.rich?.s ? it.rich.z : it.size;
48
- return `<w:rPr><w:rFonts w:ascii="${esc(family)}" w:hAnsi="${esc(family)}" w:cs="${esc(family)}"/>${/bold/i.test(f) ? "<w:b/>" : ""}${/italic/i.test(f) ? "<w:i/>" : ""}${deco.includes("line-through") ? "<w:strike/>" : ""}<w:color w:val="${hex(it.color)}"/><w:sz w:val="${Math.round((size || 9) * 2)}"/>${deco.includes("underline") ? '<w:u w:val="single"/>' : ""}${script}</w:rPr>`;
56
+ return `<w:rPr><w:rFonts w:ascii="${esc(family)}" w:hAnsi="${esc(family)}" w:cs="${esc(family)}"/>${/bold/i.test(f) ? "<w:b/>" : ""}${/italic|oblique/i.test(f) ? "<w:i/>" : ""}${deco.includes("line-through") ? "<w:strike/>" : ""}<w:color w:val="${hex(it.color)}"/><w:sz w:val="${Math.round((size || 9) * 2)}"/>${deco.includes("underline") ? '<w:u w:val="single"/>' : ""}${script}</w:rPr>`;
49
57
  }
50
58
  function alignOf(it) {
51
59
  if (isJustified(it)) return "both";
@@ -174,12 +182,25 @@ function exportDocx(model, opt = {}) {
174
182
  }
175
183
  async function docxOf(model, opt) {
176
184
  needsTableData(model, "Word");
185
+ const chunks = [];
186
+ await writeDocx(model.pages, model, opt, (u8) => {
187
+ chunks.push(u8);
188
+ });
189
+ const bytes = new Uint8Array(chunks.reduce((n, c) => n + c.length, 0));
190
+ let at = 0;
191
+ for (const c of chunks) {
192
+ bytes.set(c, at);
193
+ at += c.length;
194
+ }
195
+ return bytes;
196
+ }
197
+ async function writeDocx(pages, model, opt, put) {
177
198
  const margin = 18;
178
199
  const media = [];
179
200
  let docPr = 0;
180
- const addMedia = (bytes2, ext) => {
201
+ const addMedia = (bytes, ext) => {
181
202
  const rid = `rIdm${media.length + 1}`;
182
- media.push({ name: `image${media.length + 1}.${ext}`, bytes: bytes2, rid });
203
+ media.push({ name: `image${media.length + 1}.${ext}`, bytes, rid });
183
204
  return rid;
184
205
  };
185
206
  const pictureRun = (pic, alt) => {
@@ -193,8 +214,7 @@ async function docxOf(model, opt) {
193
214
  ><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${main}">${ext}</a:blip><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${cx}" cy="${cy}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`;
194
215
  };
195
216
  const picOpt = { fontStore: opt.fontStore, fetchImage: opt.fetchImage, rasterize: opt.rasterize };
196
- const body = [];
197
- for (const pg of model.pages) {
217
+ const pageXml = async (pg) => {
198
218
  const all = pg.items.flatMap((i) => i.t === "field" ? i.draw : [i]);
199
219
  const figs = opt.figures === false ? [] : figures(all);
200
220
  const used = /* @__PURE__ */ new Set();
@@ -278,47 +298,59 @@ async function docxOf(model, opt) {
278
298
  else for (const r of row) xml += para(r.it, (r.it.clip?.x ?? r.x) - margin, r.decor);
279
299
  }
280
300
  }
281
- body.push(xml);
282
- }
301
+ return xml;
302
+ };
283
303
  const M = margin * TW, V = 36 * TW;
284
304
  const sectPr = (pg) => {
285
305
  const W = Math.round((pg.width ?? model.width) * TW), H = Math.round((pg.height ?? model.height) * TW);
286
306
  return `<w:sectPr><w:pgSz w:w="${W}" w:h="${H}"${W > H ? ' w:orient="landscape"' : ""}/><w:pgMar w:top="${V}" w:right="${M}" w:bottom="${V}" w:left="${M}" w:header="0" w:footer="0" w:gutter="0"/></w:sectPr>`;
287
307
  };
288
308
  const sizeOf = (pg) => `${pg.width ?? model.width}x${pg.height ?? model.height}`;
289
- const zipOut = [];
309
+ let zipOut = [], zerr = null;
290
310
  const zip = new Zip((err, data) => {
291
- if (err) throw err;
292
- zipOut.push(data);
311
+ if (err) zerr = err;
312
+ else zipOut.push(data);
293
313
  });
294
- const put = (name, bytes2) => {
314
+ const drain = async () => {
315
+ if (zerr) throw zerr;
316
+ const o = zipOut;
317
+ zipOut = [];
318
+ for (const c of o) await put(c);
319
+ };
320
+ const file = async (name, bytes) => {
295
321
  const e = new ZipDeflate(name, { level: 6 });
296
322
  zip.add(e);
297
- e.push(bytes2, true);
323
+ e.push(bytes, true);
324
+ await drain();
298
325
  };
299
- const parts = [];
326
+ const doc = new ZipDeflate("word/document.xml", { level: 6 });
300
327
  const max = opt.xmlChunk || XML_CHUNK;
301
328
  let buf = "";
302
- const write = (str) => {
329
+ const write = async (str) => {
303
330
  for (const p of slices(str, max)) {
304
331
  if (buf.length + p.length > max) {
305
- parts.push(buf);
332
+ doc.push(strToU8(buf), false);
306
333
  buf = "";
334
+ await drain();
307
335
  }
308
336
  buf += p;
309
337
  }
310
338
  };
311
- write(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
339
+ await file("[Content_Types].xml", strToU8(CONTENT_TYPES));
340
+ await file("_rels/.rels", strToU8(RELS));
341
+ zip.add(doc);
342
+ await write(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
312
343
  <w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><w:body>`);
313
- model.pages.forEach((pg, i) => {
314
- write(body[i]);
315
- const next = model.pages[i + 1];
316
- if (!next) return;
317
- write(sizeOf(next) !== sizeOf(pg) ? `<w:p><w:pPr>${sectPr(pg)}</w:pPr></w:p>` : '<w:p><w:pPr><w:pageBreakBefore/><w:spacing w:before="0" w:after="0" w:line="20" w:lineRule="exact"/><w:rPr><w:sz w:val="2"/></w:rPr></w:pPr></w:p>');
318
- });
319
- const last = model.pages[model.pages.length - 1] || {};
320
- write(`${sectPr(last)}</w:body></w:document>`);
321
- parts.push(buf);
344
+ let prev = null;
345
+ for await (const pg of pages) {
346
+ if (prev) await write(sizeOf(pg) !== sizeOf(prev) ? `<w:p><w:pPr>${sectPr(prev)}</w:pPr></w:p>` : '<w:p><w:pPr><w:pageBreakBefore/><w:spacing w:before="0" w:after="0" w:line="20" w:lineRule="exact"/><w:rPr><w:sz w:val="2"/></w:rPr></w:pPr></w:p>');
347
+ await write(await pageXml(pg));
348
+ prev = pg;
349
+ }
350
+ await write(`${sectPr(prev || {})}</w:body></w:document>`);
351
+ doc.push(strToU8(buf), true);
352
+ buf = "";
353
+ await drain();
322
354
  const lang = `<w:lang w:val="${esc(opt.lang || model.locale || "en-US")}"/>`;
323
355
  const headings = [28, 24, 22, 20, 18, 18].map((sz, i) => `<w:style w:type="paragraph" w:styleId="Heading${i + 1}"><w:name w:val="heading ${i + 1}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:outlineLvl w:val="${i}"/></w:pPr><w:rPr><w:b/><w:sz w:val="${sz}"/></w:rPr></w:style>`).join("");
324
356
  const styles = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
@@ -328,33 +360,19 @@ name w:val="Normal"/></w:style>${headings}</w:styles>`;
328
360
  const core = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
329
361
  <cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title>${esc(opt.title || model.name || "Report")}</dc:title>${opt.author ? `<dc:creator>${esc(opt.author)}</dc:creator>` : ""}<dcterms:created xsi:type="d\
330
362
  cterms:W3CDTF">${now}</dcterms:created></cp:coreProperties>`;
331
- put("[Content_Types].xml", strToU8(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
332
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Default Extension="png" ContentType="image/png"/><Default Extension="jpeg" ContentType="image/jpeg"/><Default Extension="svg" ContentType="image/svg+xml"/><Override Part\
333
- Name="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/></Types>`));
334
- put("_rels/.rels", strToU8(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
335
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/></Relationships>`));
336
- put("word/_rels/document.xml.rels", strToU8(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
363
+ await file("word/_rels/document.xml.rels", strToU8(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
337
364
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>${media.map((m) => `<Relationship Id="${m.rid}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/${m.name}"/>`).join("")}</Relationships>`));
338
- const doc = new ZipDeflate("word/document.xml", { level: 6 });
339
- zip.add(doc);
340
- for (const p of parts) doc.push(strToU8(p), false);
341
- doc.push(new Uint8Array(0), true);
342
- put("word/styles.xml", strToU8(styles));
343
- put("docProps/core.xml", strToU8(core));
344
- for (const m of media) put(`word/media/${m.name}`, m.bytes);
365
+ await file("word/styles.xml", strToU8(styles));
366
+ await file("docProps/core.xml", strToU8(core));
367
+ for (const m of media) await file(`word/media/${m.name}`, m.bytes);
345
368
  zip.end();
346
- const total = zipOut.reduce((n, c) => n + c.length, 0), bytes = new Uint8Array(total);
347
- let at = 0;
348
- for (const c of zipOut) {
349
- bytes.set(c, at);
350
- at += c.length;
351
- }
352
- return bytes;
369
+ await drain();
353
370
  }
354
371
 
355
372
  export {
356
373
  slices,
357
374
  alignOf,
358
- exportDocx
375
+ exportDocx,
376
+ writeDocx
359
377
  };
360
- //# sourceMappingURL=chunk-S2IUUI6N.js.map
378
+ //# sourceMappingURL=chunk-BF7GCWZY.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/exporters/docx.js"],
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,KAAK,YAAY,eAAe;AAMzC,IAAM,KAAK;AACX,IAAM,MAAM;AACZ,IAAM,gBAAgB;AAAA;AAAA;AAEtB,IAAM,OAAO;AAAA;AAEb,IAAM,YAAY,IAAI,OAAO;AAEtB,SAAS,OAAO,GAAG,KAAK;AAC7B,QAAM,MAAM,CAAC;AACb,MAAI,IAAI;AACR,SAAO,EAAE,SAAS,IAAI,KAAK;AACzB,UAAM,IAAI,EAAE,QAAQ,KAAK,IAAI,GAAG;AAChC,QAAI,IAAI,EAAG;AACX,QAAI,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;AAC1B,QAAI,IAAI;AAAA,EACV;AACA,MAAI,KAAK,EAAE,MAAM,CAAC,CAAC;AACnB,SAAO;AACT;AACA,IAAM,MAAM,CAAC,MAAM,OAAO,CAAC,EAAE,QAAQ,MAAM,OA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