Render Microsoft Compiled HTML Help files. CHMate (pure-JS, MIT) parses the ITSF container and LZX-decompresses topics; its hardened renderTopic sanitizes each topic, inlines resources as blob: URLs and adds a strict CSP. The new CHMRenderer shows topics in a sandboxed iframe (no allow-scripts), wires internal (data-chm-href) and external (confirm + new tab) link navigation, and builds the .hhc table of contents into the sidebar. - New src/renderers/chm-renderer.js; wired into EXT_MAP + RENDERER_LOADERS, dropzone pill + toolbar badge (#006064), file-picker accept list - chmate pinned as a git dep; `chmate/render` exposed via a Vite resolve alias (CHMate's package exports only "."), inherited by the embed-app build - README / CREDITS / EMBEDDING updated (chmate is the 3rd git-dep engine) - Also: re-fit the page when the viewer area resizes — a ResizeObserver on #viewerContainer re-applies the fit-to-width/height/page scale, so opening the sidebar (or resizing the window) no longer leaves the page clipped at its old scale. Benefits every renderer, not just CHM. - /simplify applied: merged duplicate MHTML/CHM iframe CSS, dropped a dead field + an inert TOC wrapper div, replaced a parallel Map with data-target. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
39 lines
1.3 KiB
JSON
39 lines
1.3 KiB
JSON
{
|
|
"name": "preview-js",
|
|
"version": "1.0.0",
|
|
"description": "Client-side universal document viewer — PDF, DjVu, ODF, Office, e-books, comics and images — permissive, no server, no upload",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vite build",
|
|
"build:embed:app": "vite build --config vite.config.app.js",
|
|
"build:embed:loader": "vite build --config vite.config.embed.js",
|
|
"build:embed": "npm run build:embed:app && npm run build:embed:loader",
|
|
"preview": "vite preview",
|
|
"docs": "jsdoc src -r -d docs"
|
|
},
|
|
"dependencies": {
|
|
"chart.js": "^4.5.1",
|
|
"chmate": "github:Alpaq92/CHMate#86b26bb8c33255de89db4fa68e610b9ac7cc286a",
|
|
"dejaview": "github:Alpaq92/dejaview#ae7aed28a7e9f1ef9658d421471ffb66336ada09",
|
|
"diff": "^9.0.0",
|
|
"exifr": "^7.1.3",
|
|
"foliate-js": "github:johnfactotum/foliate-js#78914aef4466eb960965702401634c2cb348e9b1",
|
|
"highlight.js": "^11.11.1",
|
|
"jszip": "^3.10.1",
|
|
"libarchive.js": "^2.0.2",
|
|
"mammoth": "^1.8.0",
|
|
"marked": "^18.0.5",
|
|
"mhtml-to-html": "^2.0.1",
|
|
"papaparse": "^5.5.4",
|
|
"pdfjs-dist": "^6.0.227",
|
|
"pptxviewjs": "^1.1.9",
|
|
"rtf.js": "^3.0.9",
|
|
"utif": "^3.1.0",
|
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
},
|
|
"devDependencies": {
|
|
"vite": "^8.1.0"
|
|
}
|
|
}
|