@formepdf/core 0.24.0 → 0.26.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.
package/dist/index.js CHANGED
@@ -73,6 +73,9 @@ export async function renderDocumentWithLayout(element, options) {
73
73
  return renderSerializedDocWithLayout(doc, options);
74
74
  }
75
75
  // ── Serialized document rendering ────────────────────────────────────
76
+ /** Where the adapters' serializers attach their own warnings (Symbol.for, so
77
+ * no import of an adapter package is needed). */
78
+ const SERIALIZER_WARNINGS = Symbol.for('formepdf.serializerWarnings');
76
79
  /**
77
80
  * Render a pre-serialized document object (from `serialize()`) to PDF,
78
81
  * resolving font sources (file paths, byte arrays) and HTTP image URLs
@@ -107,7 +110,14 @@ export async function renderSerializedDocWithLayout(doc, options) {
107
110
  }
108
111
  applyAttachmentOptions(doc, options);
109
112
  await Promise.all([resolveFonts(doc), resolveImages(doc)]);
110
- return renderPdfWithLayout(JSON.stringify(doc), options);
113
+ const result = await renderPdfWithLayout(JSON.stringify(doc), options);
114
+ // Warnings the serializer raised (a dropped list child) ride on the
115
+ // document under a symbol key, which JSON.stringify leaves out.
116
+ const serializerWarnings = doc[SERIALIZER_WARNINGS];
117
+ if (serializerWarnings?.length) {
118
+ result.warnings = [...serializerWarnings, ...result.warnings];
119
+ }
120
+ return result;
111
121
  }
112
122
  // ── Template rendering ──────────────────────────────────────────────
113
123
  export async function renderTemplate(templateJson, dataJson) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formepdf/core",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "WASM-powered PDF rendering engine for Forme",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -64,22 +64,22 @@
64
64
  "prepublishOnly": "npm run build && ./scripts/assert-tarball.sh"
65
65
  },
66
66
  "dependencies": {
67
- "@formepdf/react": "0.24.0"
67
+ "@formepdf/react": "0.26.0"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react": "^18 || ^19"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@cloudflare/vitest-pool-workers": "^0.22.0",
74
- "@formepdf/templates": "0.24.0",
75
- "@formepdf/html": "^0.24.0",
74
+ "@formepdf/templates": "0.26.0",
75
+ "@formepdf/html": "^0.26.0",
76
76
  "@pdf-testkit/vitest": "^0.5.0",
77
77
  "@types/node": "^22.0.0",
78
78
  "@types/react": "^19.0.0",
79
79
  "react": "^19.0.0",
80
80
  "typescript": "^5.7.0",
81
81
  "vitest": "^4.1.0",
82
- "@formepdf/fonts-standard": "0.24.0"
82
+ "@formepdf/fonts-standard": "0.26.0"
83
83
  },
84
84
  "files": [
85
85
  "dist/",
package/pkg/forme_bg.wasm CHANGED
Binary file
package/pkg/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "forme-pdf",
3
3
  "type": "module",
4
4
  "description": "A page-native PDF rendering engine. Layout INTO pages, not onto an infinite canvas.",
5
- "version": "0.24.0",
5
+ "version": "0.26.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
Binary file
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "forme-pdf",
3
3
  "description": "A page-native PDF rendering engine. Layout INTO pages, not onto an infinite canvas.",
4
- "version": "0.24.0",
4
+ "version": "0.26.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
Binary file
@@ -2,7 +2,7 @@
2
2
  "name": "forme-pdf",
3
3
  "type": "module",
4
4
  "description": "A page-native PDF rendering engine. Layout INTO pages, not onto an infinite canvas.",
5
- "version": "0.24.0",
5
+ "version": "0.26.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",