@liangzhixin/canvas-office-word-engine
v0.1.0
Published
Pure-TypeScript Word `.docx` engine. Framework-agnostic. The viewer / editor shell consumes this package.
Downloads
94
Readme
@liangzhixin/canvas-office-word-engine
Pure-TypeScript Word .docx engine. Framework-agnostic. The viewer / editor shell consumes this package.
Hard rule: this package MUST NOT import Vue, React, or any DOM framework. It targets both the main thread and Web Workers.
Layers
| Folder | Phase | Purpose |
|---|---|---|
| parser/ | A1 | OOXML → DocumentModel |
| serializer/ | D | DocumentModel → OOXML (round-trip preserving _raw) |
| model/ | A1 | Immutable document AST |
| style/ | B | Style merge (direct > pStyle > docDefaults) |
| layout/ | A3+ | Pagination, line wrapping, table layout |
| render/ | A1 | Canvas drawing |
| editor/ | C | Commands, history, selection, IME bridge |
| font/ | B | FontProvider interface + default impl |
Status
Phase A1 MVP: load a .docx via JSZip, parse the first level of document.xml (paragraphs + runs + simple character formatting), draw to a 2D canvas with a naive layout. Everything else is a stub.
