theseus/extensions/docx-editor
Local Dev 862e92543c extensions: real PDF/DOC icons + fix translate default URL
- pdf-editor 0.1.1 → 0.1.2: manifest.icon is a data:image/svg+xml red PDF
  document badge (dock renders it as <img>). Same on toolbar-menu.icon.
  Item-level icons dropped — those go through the native OS menu that
  doesn't render data URIs.
- translate 0.1.0 → 0.1.1: default LibreTranslate mirror was
  translate.argosopentech.com, which is now a dead domain — panel just
  said "Failed" on every request. Switched default to
  translate.disroot.org (currently up), added a datalist of known
  mirrors, and a one-shot migration off the dead default so existing
  installs recover on next load.
- docx-editor 0.1.0 → 0.1.1: manifest.icon is a data:image/svg+xml blue
  DOC document badge, index.js no longer overrides it with 📝, and the
  panel header uses the same inline SVG. Same rationale as pdf-editor —
  every extension was rendering as either 📄 or 📝, so PDF and Word
  were visually identical to the Notepad.
2026-09-21 02:41:16 +02:00
..
lib refactor(docx-editor): ship it as a community extension, not part of the browser 2026-09-21 01:06:58 +02:00
vendor refactor(docx-editor): ship it as a community extension, not part of the browser 2026-09-21 01:06:58 +02:00
addon.json extensions: real PDF/DOC icons + fix translate default URL 2026-09-21 02:41:16 +02:00
editor.css refactor(docx-editor): ship it as a community extension, not part of the browser 2026-09-21 01:06:58 +02:00
editor.html refactor(docx-editor): ship it as a community extension, not part of the browser 2026-09-21 01:06:58 +02:00
editor.js refactor(docx-editor): ship it as a community extension, not part of the browser 2026-09-21 01:06:58 +02:00
index.js extensions: real PDF/DOC icons + fix translate default URL 2026-09-21 02:41:16 +02:00
panel.html extensions: real PDF/DOC icons + fix translate default URL 2026-09-21 02:41:16 +02:00
README.md refactor(docx-editor): ship it as a community extension, not part of the browser 2026-09-21 01:06:58 +02:00
ROUND-TRIP.md refactor(docx-editor): ship it as a community extension, not part of the browser 2026-09-21 01:06:58 +02:00

Word editor — a Theseus community extension

Opens, edits and saves Word documents (.docx) in a full Theseus tab.

This is not a bundled add-on. It isn't in bundled-addons/, it isn't in the installer's extraResources, and a fresh Theseus profile doesn't have it. Users get it the same way they'd get anyone else's extension: from Settings Extensions Community, which lists whatever is in the catalogue at theseus.x/extensions.

Living outside the browser build is the point. A .docx editor is a big dependency — a megabyte of vendored library — and nobody should carry it because they wanted a browser.

Building

The vendored libraries (mammoth, ProseMirror, docx, JSZip) are bundled by a build step that lives outside this folder, because mammoth needs local patches before it can carry everything the editor edits:

cd ../../addon-build/docx-editor
npm install
npm run build        # writes vendor/docx-vendor.js here
npm run pack         # writes out/docx-editor-<version>.tar.gz

vendor/docx-vendor.js is committed, so the extension is installable straight from a checkout; re-run npm run build after touching anything under addon-build/.

Publishing

npm run pack produces the tarball and its sha256. Uploading it is a separate step, and this repo can't do it: a community extension is signed by the owner of a BNS name, using that name's wallet.

The straightforward route is the publish page at theseus.x/extensions/publish — it unlocks a wallet in the browser, checks that the name is yours, then signs and PUTs the tarball to /api/ext/<publisher-name>/docx-editor/<version>. The gateway verifies both signatures against the name's current owner, stores the tarball on Sia and updates catalog.json, which is what Settings and the site both read.

Version numbers must increase, and the id docx-editor belongs to whichever name publishes it first.

Testing

Three levels, all re-runnable, all from ../../addon-build/docx-editor:

node test/roundtrip.mjs                  # the built-in fixture
node test/corpus.mjs <folder of .docx>   # real documents
node ../../../scratchpad/verify-docx-editor/drive.mjs   # a real Theseus, over CDP

The last one installs this folder into a throwaway profile the way the community channel would, and is the only one that catches browser-only breakage.

What survives a round trip, and what doesn't, is written up in ROUND-TRIP.md. Read that before promising anyone a Word feature.