From f67ad312f65e19f5d2633df803b4e20a670ba8d0 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Fri, 4 Sep 2026 08:43:24 +0200 Subject: [PATCH] Take the renderer's 6.13.0, and keep the call its readme now gets wrong The engine's javascript surface did not move: `index.js`, `odr-core.mjs` and `index.d.ts` are byte-identical to 6.12.0, and `fileTypes()` and the enum tables come back the same, so there is no binding here to start calling. What grew is the wasm, and what it renders - paged content restates its zoom as a `text-size-adjust` percentage, so a phone stops scaling the type a second time over the box it was fitted to, and a table cell starts at its top the way word and odf say it should rather than at the browser's centre. Both arrive by opening a document; nothing on this side opts in. The one thing that did change in the package is its readme, and it changed to something untrue: it now says `generateDiff()` returns json already and that `edit` wants that object, not a string. The binding underneath is a `std::string`, in 6.13.0 as in 6.12.0 - an object throws `BindingError` at both - so following it would break saving an edited document. `saveDocument` keeps stringifying, and says why, because the next reader of that readme will come back here. Checked against the built site rather than the tarball: the sample document opens on the served 6.13.0, and a diff in the shape this page sends applies and survives into the saved file it reopens. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_019JsBLdSBxzmHFQ4CFDiknj --- package-lock.json | 8 ++++---- package.json | 2 +- src/scripts/viewer.ts | 5 +++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e892a8a..f6fe024 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "@astrojs/sitemap": "^3.7.3", - "@opendocument/odr-core": "^6.12.0", + "@opendocument/odr-core": "^6.13.0", "@tailwindcss/vite": "^4.3.3", "astro": "^7.2.3", "tailwindcss": "^4.3.3" @@ -1686,9 +1686,9 @@ } }, "node_modules/@opendocument/odr-core": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@opendocument/odr-core/-/odr-core-6.12.0.tgz", - "integrity": "sha512-YVNj0FxDb3skDsxMHHPdqfLDqNKqelB2wHhQDVoc8BOPWzk1vUZ5YKiBf+8ryOFt6TwoX47hthSOe9z/2DzdIg==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/@opendocument/odr-core/-/odr-core-6.13.0.tgz", + "integrity": "sha512-YwzUfiINXs8xyYaC4aMw1fSAu3MoryepXXtkPNe60JB43pOdakVLhZDRwonmy3WTwaxYhN2qdXA3NvfDlT0tFQ==", "license": "MPL-2.0", "engines": { "node": ">=18" diff --git a/package.json b/package.json index e8ae3c4..a481f56 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "@astrojs/sitemap": "^3.7.3", - "@opendocument/odr-core": "^6.12.0", + "@opendocument/odr-core": "^6.13.0", "@tailwindcss/vite": "^4.3.3", "astro": "^7.2.3", "tailwindcss": "^4.3.3" diff --git a/src/scripts/viewer.ts b/src/scripts/viewer.ts index 2a86b9a..63fbcff 100644 --- a/src/scripts/viewer.ts +++ b/src/scripts/viewer.ts @@ -441,6 +441,11 @@ export function mountViewer({ in as a diff, and the document - not the html it was rendered into - comes out as bytes. The edits stay in the frame either way, so a failure costs the visitor nothing but the file. + + The diff goes in as a json string, and stays one: 6.13.0's readme says to + hand `edit` the object instead, but the binding underneath is a + `std::string` and an object throws `BindingError` there - in 6.13.0 exactly + as in 6.12.0. The readme is what is wrong, so this call is left alone. */ async function saveDocument() { if (!currentDoc) return;