ODF: webodf npm package is an empty stub with no webodf.js, and there is no working CDN for it. Replace with a pure-JS ODF->HTML converter using jszip: reads content.xml from the ODF ZIP, walks text:/table:/draw: namespace elements, extracts embedded images as blob URLs. Covers ODT, ODS, ODP and ODF. DOC: catch the JSZip "not a ZIP" error thrown by mammoth on binary OLE .doc files and surface a human-readable message asking to re-save as .docx instead of showing a raw stack trace. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
567 B
JSON
23 lines
567 B
JSON
{
|
|
"name": "preview-js",
|
|
"version": "1.0.0",
|
|
"description": "Universal document viewer: PDF, ODF, RTF, DOCX — powered by pdf.js, WebODF, rtf.js and docx submodules",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"submodules:init": "git submodule update --init --recursive",
|
|
"docs": "jsdoc src -r -d docs"
|
|
},
|
|
"dependencies": {
|
|
"jszip": "^3.10.1",
|
|
"mammoth": "^1.8.0",
|
|
"pdfjs-dist": "^4.9.155",
|
|
"rtf.js": "^2.2.0"
|
|
},
|
|
"devDependencies": {
|
|
"vite": "^6.0.7"
|
|
}
|
|
}
|