@reportwright/engine 0.13.2-rc.1 → 0.13.2-rc.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.
- package/CHANGELOG.md +13 -0
- package/dist/index.js +19 -11
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
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.2-rc.2 — 2026-10-09 (release candidate)
|
|
6
|
+
|
|
7
|
+
### Fixed (from the rc.1 release gate)
|
|
8
|
+
- **E11 Viewer accessibility:** the scrolling page area (`div.vpages`) is keyboard-focusable (`tabindex="0"`), a named `region`, with a visible inset focus ring; the arrow keys scroll it (axe `scrollable-region-focusable`).
|
|
9
|
+
- **E12 Designer arrow keys on pages with margins:** Arrow and Shift+Arrow move the selection by the whole step (1/10 pt, or 1/10 grid steps with Snap to grid). The step used to be clamped to the band's leftover width, so an item as wide as an A4 body with 36 pt margins (523.28 pt) moved 0.28 pt and then not at all. A keyboard nudge still stops at the band's start; overflow past its end shows in the Issues panel. Dragging still keeps items inside the band.
|
|
10
|
+
- **E10 webpack and Next.js builds:** `@reportwright/viewer` (`dist/`, `dist/peer/`) and `@reportwright/cli` ship `pdfstreamworker.js` next to the bundles that name it with `new URL('./pdfstreamworker.js', import.meta.url)`, so bundlers resolve it. The parallel PDF paint worker itself is `@reportwright/engine`'s (Node only); the stand-ins answer that `exportPdfStream` with `parallel` needs the engine.
|
|
11
|
+
- **E13 missing HarfBuzz subset WASM:** when `harfbuzz-subset.wasm` cannot be loaded (fonts then embed in full, PDFs many times larger), `exportPdf` and `exportPdfStream` warn once on the console and add a warning to the result (the model's `warnings`, the stream result's `warnings`), naming the expected path (`@reportwright/fonts/public/harfbuzz-subset.wasm`) and the fix: install `@reportwright/fonts`, or pass `subset: createSubsetter(() => wasmBytes)`.
|
|
12
|
+
- **E09 importer:**
|
|
13
|
+
- files are read in their own encoding: a UTF-16 LE/BE or UTF-8 byte-order mark, else the XML declaration's `encoding` (ISO-8859-1, Latin-1, windows-1252, …), else UTF-8. `Straße` and `Grüße` survive. Applies to `pw import`, `pw import <folder>` and `POST /api/reports/import`.
|
|
14
|
+
- a compiled `.jasper` file gets "This is a compiled JasperReports file; import the .jrxml source instead."
|
|
15
|
+
- `pw import` prints each error once (it printed it twice, the second time cut short).
|
|
16
|
+
- **E07 SQL connection pool:** a PostgreSQL or MySQL query that cannot get a pooled connection within `PW_DB_ACQUIRE_MS` (default 5000) fails with 503 and `Retry-After` instead of a 500; a connection that frees later goes back to the pool. A streaming query whose reader aborts frees its connection at once (the backend is terminated and the connection discarded) instead of holding it until the deadline. PostgreSQL queries run under `statement_timeout` from their first statement.
|
|
17
|
+
|
|
5
18
|
## 0.13.2-rc.1 — 2026-10-09 (release candidate)
|
|
6
19
|
|
|
7
20
|
### Changed
|
package/dist/index.js
CHANGED
|
@@ -29203,6 +29203,19 @@ function defaultStore() {
|
|
|
29203
29203
|
return sharedStore;
|
|
29204
29204
|
}
|
|
29205
29205
|
var defaultSubset;
|
|
29206
|
+
var subsetMissing = "";
|
|
29207
|
+
var defaultSubsetter = () => defaultSubset ||= createSubsetter(async () => {
|
|
29208
|
+
const url = fontsUrl("harfbuzz-subset.wasm");
|
|
29209
|
+
try {
|
|
29210
|
+
if (!url) throw new Error("@reportwright/fonts is not installed");
|
|
29211
|
+
return await readUrl(url);
|
|
29212
|
+
} catch (e2) {
|
|
29213
|
+
subsetMissing = `harfbuzz-subset.wasm did not load from ${url?.href || "@reportwright/fonts/public/harfbuzz-subset.wasm"} (${/** @type {any} */
|
|
29214
|
+
e2?.message || e2}), so fonts are embedded in full and PDFs are many times larger. Install @reportwright/fonts next to the engine, or pass subset: createSubsetter(() => wasmBytes) with the file's bytes (subset: false embeds fonts in full on purpose).`;
|
|
29215
|
+
console.warn(`ReportWright: ${subsetMissing}`);
|
|
29216
|
+
throw e2;
|
|
29217
|
+
}
|
|
29218
|
+
});
|
|
29206
29219
|
var warned = /* @__PURE__ */ new Set();
|
|
29207
29220
|
async function render2(def, opts) {
|
|
29208
29221
|
const warn = checkOptions(opts);
|
|
@@ -29261,23 +29274,21 @@ var modelFonts = async (model, o) => {
|
|
|
29261
29274
|
async function exportPdf2(model, options) {
|
|
29262
29275
|
const opt = optionsOf("exportPdf", [...arguments], "fonts");
|
|
29263
29276
|
for (const w of checkOptions(opt)) (opt.onWarning || console.warn)(w);
|
|
29264
|
-
const subset = opt.subset === false ? void 0 : opt.subset || (
|
|
29265
|
-
const url = fontsUrl("harfbuzz-subset.wasm");
|
|
29266
|
-
if (!url) throw new Error("@reportwright/fonts is not installed");
|
|
29267
|
-
return readUrl(url);
|
|
29268
|
-
}));
|
|
29277
|
+
const subset = opt.subset === false ? void 0 : opt.subset || defaultSubsetter();
|
|
29269
29278
|
const { fonts, fontStore, ...rest } = opt;
|
|
29270
29279
|
if (rest.pdfa && !(typeof rest.pdfa === "object" && rest.pdfa.icc)) {
|
|
29271
29280
|
const url = fontsUrl("icc/sRGB-v2-magic.icc");
|
|
29272
29281
|
if (!url) throw new Error("PDF/A needs an sRGB colour profile: install @reportwright/fonts, or pass pdfa: { icc: bytes }");
|
|
29273
29282
|
rest.pdfa = { ...typeof rest.pdfa === "object" ? rest.pdfa : {}, icc: new Uint8Array(await readUrl(url)) };
|
|
29274
29283
|
}
|
|
29275
|
-
|
|
29284
|
+
const pdf = await exportPdf(
|
|
29276
29285
|
model,
|
|
29277
29286
|
fontsOf(opt),
|
|
29278
29287
|
/** @type {any} */
|
|
29279
29288
|
{ ...rest, subset }
|
|
29280
29289
|
);
|
|
29290
|
+
if (subsetMissing && subset === defaultSubset && model?.warnings && !model.warnings.includes(subsetMissing)) model.warnings.push(subsetMissing);
|
|
29291
|
+
return pdf;
|
|
29281
29292
|
}
|
|
29282
29293
|
function exportXlsx2(model, options) {
|
|
29283
29294
|
const opt = optionsOf("exportXlsx", [...arguments], "excel");
|
|
@@ -29300,11 +29311,7 @@ async function exportPdfStream2(def, options, sink) {
|
|
|
29300
29311
|
options || {}
|
|
29301
29312
|
);
|
|
29302
29313
|
const store = fonts || fontStore || defaultStore();
|
|
29303
|
-
const subset = sub === false ? void 0 : sub || (
|
|
29304
|
-
const url = fontsUrl("harfbuzz-subset.wasm");
|
|
29305
|
-
if (!url) throw new Error("@reportwright/fonts is not installed");
|
|
29306
|
-
return readUrl(url);
|
|
29307
|
-
}));
|
|
29314
|
+
const subset = sub === false ? void 0 : sub || defaultSubsetter();
|
|
29308
29315
|
let pdfaOpt = pdfa;
|
|
29309
29316
|
if (pdfa && !(typeof pdfa === "object" && pdfa.icc)) {
|
|
29310
29317
|
const url = fontsUrl("icc/sRGB-v2-magic.icc");
|
|
@@ -29314,6 +29321,7 @@ async function exportPdfStream2(def, options, sink) {
|
|
|
29314
29321
|
const sorter = rest.sorter || (spill !== false && canSpill() ? spillSorter(spillOptions(spill)) : void 0);
|
|
29315
29322
|
const r = await exportPdfStream(def, { ...rest, sorter, fontStore: store, subset, pdfa: pdfaOpt, exportData: !!rest.tagged }, sink);
|
|
29316
29323
|
if (unknown.length) r.warnings = [...unknown, ...r.warnings];
|
|
29324
|
+
if (subsetMissing && subset === defaultSubset) r.warnings = [...r.warnings, subsetMissing];
|
|
29317
29325
|
return r;
|
|
29318
29326
|
}
|
|
29319
29327
|
var officeOpts = (o = {}) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reportwright/engine",
|
|
3
|
-
"version": "0.13.2-rc.
|
|
3
|
+
"version": "0.13.2-rc.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"bidi-js": "1.0.3"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@reportwright/fonts": "0.13.2-rc.
|
|
75
|
+
"@reportwright/fonts": "0.13.2-rc.2"
|
|
76
76
|
},
|
|
77
77
|
"peerDependenciesMeta": {
|
|
78
78
|
"@reportwright/fonts": {
|