@file-viewer/react
Advanced tools
+2
-2
| { | ||
| "name": "@file-viewer/react", | ||
| "version": "2.1.20", | ||
| "version": "2.1.21", | ||
| "private": false, | ||
@@ -58,3 +58,3 @@ "type": "module", | ||
| "dependencies": { | ||
| "@file-viewer/core": "^2.1.20" | ||
| "@file-viewer/core": "^2.1.21" | ||
| }, | ||
@@ -61,0 +61,0 @@ "devDependencies": { |
+5
-4
@@ -187,3 +187,3 @@ # @file-viewer/react | ||
| - `scan:true` detects `fileViewerFormats`, `data-file-viewer-formats`, and upload `accept` hints so development and production builds select matching renderers automatically. | ||
| - `copyAssets:true` copies PDF/CAD/Typst/Archive/Data workers, WASM, and vendor assets for offline and enterprise intranet deployment. | ||
| - `copyAssets:true` copies PDF/CAD/Typst/Archive/Data workers, WASM, and vendor assets for offline and enterprise intranet deployment; archive directories use `vendor/libarchive/worker-bundle.js` / `libarchive.wasm` first, while the compatibility path only covers ZIP/TAR/GZIP when the Worker cannot start. | ||
| - `builtinRenderers` remains available for advanced baseline control or historical compatibility. Normal quick starts only need `preset` / `renderers` plus `rendererMode`. | ||
@@ -232,3 +232,3 @@ - If a file is in the supported matrix but its renderer is not assembled, the viewer shows the recommended preset / renderer package. Truly unknown extensions still show an unsupported-format state. | ||
| | `ai` | Text collection, chunk size, and max text length for provenance, location, vectorization, and external AI workflows. | | ||
| | `archive` | Archive Worker/WASM URLs, timeout, cache, archive limits, and nested entry preview limits. | | ||
| | `archive` | Archive Worker/WASM URLs, timeout, cache, archive limits, nested entry preview limits, and legacy GBK/GB18030 ZIP filename decoding. | | ||
| | `pdf` | PDF.js worker, navigation pane, outline, thumbnails, rotation, streaming, range chunk size, and credentials. | | ||
@@ -339,7 +339,8 @@ | `docx` / `spreadsheet` | DOCX is provided by @file-viewer/renderer-word and uses the self-maintained @file-viewer/docx engine with automatic worker/main-thread selection, continuous flow reading, and async rendering by default; visual pagination is opt-in. Spreadsheet is provided by @file-viewer/renderer-spreadsheet with fidelity-first parsing, automatic Worker use for large files, and opt-in header drag column resizing. | | ||
| | PDF / DOCX / Excel / PPTX | Configure `options.pdf.workerUrl`, `options.pdf.cMapUrl`, `options.pdf.wasmUrl`, `options.pdf.standardFontDataUrl`, `options.docx.workerUrl`, `options.docx.workerJsZipUrl`, `options.spreadsheet.workerUrl`, and `options.presentation.workerUrl` / `options.presentation.workerType`; PDF probes the real static worker first and lazy-loads the packaged handler when unavailable; DOCX chooses worker or main-thread parsing automatically, Electron `file://` and other unsafe local protocols fall back without user configuration; Excel defaults to `worker: auto`, enabling Worker automatically for files at or above `workerAutoThreshold`, and header drag column resizing is controlled by `options.spreadsheet.resizableColumns`; PPTX creates a module Worker on demand and can pin the worker URL/type for strict CSP, legacy WebViews, or self-hosted CDNs. | | ||
| | Typst / SQLite / Archive | Configure Typst compiler/renderer WASM, `data.sqlWasmUrl`, and `archive.workerUrl` / `archive.wasmUrl` as needed; Typst renders through local WASM only and never falls back to a public CDN. | | ||
| | Typst / SQLite / Archive | Configure Typst compiler/renderer WASM, `data.sqlWasmUrl`, and `archive.workerUrl` / `archive.wasmUrl` as needed; Typst renders through local WASM only and never falls back to a public CDN; Archive decodes legacy GBK/GB18030 ZIP entry names, while RAR, 7z, and encrypted archives still require the libarchive Worker/WASM assets. | | ||
| | Drawing | Draw.io uses the official diagrams.net offline viewer shipped with viewer assets by default; override `options.drawing.viewerScriptUrl` for custom paths, or set `preferOfficial:false` for the built-in SVG fallback. | | ||
| | Offline deployment | Runtime preview code does not depend on public CDN or third-party online assets; `file-viewer-copy-assets` copies PDF, CAD, Typst, SQLite, archive, Draw.io, DOCX worker/JSZip, PPTX worker, and Office worker/vendor assets. | | ||
| | Offline deployment | Runtime preview code does not depend on public CDN or third-party online assets; `file-viewer-copy-assets` copies PDF, CAD, Typst, SQLite, archive, Draw.io, DOCX worker/JSZip, PPTX worker, and Office worker/vendor assets. Vue full packages default to `/file-viewer/` as the asset root; call `setDefaultFullAssetBaseUrl()` first when your static prefix differs. | | ||
| | Deployment principle | Heavy workers, WASM files, and parser libraries stay lazy-loaded and are only requested when the active file type needs them. | | ||
| ## Quality Gates | ||
@@ -346,0 +347,0 @@ |
+5
-4
@@ -187,3 +187,3 @@ # @file-viewer/react | ||
| - `scan:true` 会识别 `fileViewerFormats`、`data-file-viewer-formats` 和上传控件 `accept`,调试与打包时自动选择 renderer。 | ||
| - `copyAssets:true` 会复制 PDF/CAD/Typst/Archive/Data 等 worker、WASM 和 vendor 资源,满足离线和企业内网部署。 | ||
| - `copyAssets:true` 会复制 PDF/CAD/Typst/Archive/Data 等 worker、WASM 和 vendor 资源,满足离线和企业内网部署;压缩包目录会优先使用 `vendor/libarchive/worker-bundle.js` / `libarchive.wasm`,Worker 不可用时只对 ZIP/TAR/GZIP 进入兼容路径。 | ||
| - `builtinRenderers` 仍可用于高级基线控制或历史兼容;普通快速接入只需要 `preset` / `renderers` 与 `rendererMode`。 | ||
@@ -232,3 +232,3 @@ - 如果打开的是支持矩阵内但未装配的格式,预览器会提示应安装的 preset / renderer;只有真正不在矩阵中的扩展名才提示不支持。 | ||
| | `ai` | 控制文本结构采集、分块大小和最大文本长度,为溯源、定位、向量化和外部 AI 流程提供基础。 | | ||
| | `archive` | 配置压缩包 Worker/WASM、超时、缓存、包体限制和压缩包内单文件预览大小。 | | ||
| | `archive` | 配置压缩包 Worker/WASM、超时、缓存、包体限制和压缩包内单文件预览大小;旧 ZIP 中文文件名会自动按 GBK/GB18030 兼容解码。 | | ||
| | `pdf` | 配置 PDF.js Worker、导航栏、目录、缩略图、旋转、流式读取、Range chunk 和凭据。 | | ||
@@ -339,7 +339,8 @@ | `docx` / `spreadsheet` | DOCX 由 @file-viewer/renderer-word 承接并使用自研 @file-viewer/docx,默认自动选择 Worker 或主线程解析,连续流式阅读和异步分批渲染,可按需显式开启视觉分页;表格由 @file-viewer/renderer-spreadsheet 承接,默认保真解析,大文件自动启用 Worker,表头拖拽调列宽可按需显式开启。 | | ||
| | PDF / DOCX / Excel / PPTX | 按需配置 `options.pdf.workerUrl`、`options.pdf.cMapUrl`、`options.pdf.wasmUrl`、`options.pdf.standardFontDataUrl`、`options.docx.workerUrl`、`options.docx.workerJsZipUrl`、`options.spreadsheet.workerUrl`、`options.presentation.workerUrl` / `options.presentation.workerType`;PDF 默认探测真实静态 Worker,不可用时懒加载包内 handler 兜底;DOCX 默认自动选择 Worker 或主线程解析,Electron `file://` 等本地不安全协议会自动回退;Excel 默认 `worker: auto`,大文件达到 `workerAutoThreshold` 自动启用 Worker,列宽拖拽可通过 `options.spreadsheet.resizableColumns` 显式开启;PPTX 默认按需创建模块 Worker,严格 CSP、旧 WebView 或自托管 CDN 场景可固定 Worker 地址。 | | ||
| | Typst / SQLite / Archive | 按需配置 Typst compiler/renderer WASM、`data.sqlWasmUrl`、`archive.workerUrl` / `archive.wasmUrl`;Typst 仅使用本地 WASM 真实渲染,不访问公共 CDN。 | | ||
| | Typst / SQLite / Archive | 按需配置 Typst compiler/renderer WASM、`data.sqlWasmUrl`、`archive.workerUrl` / `archive.wasmUrl`;Typst 仅使用本地 WASM 真实渲染,不访问公共 CDN;Archive 兼容 GBK/GB18030 旧 ZIP 中文文件名,RAR、7z 和加密压缩包仍需要 libarchive Worker/WASM。 | | ||
| | Drawing | Draw.io 默认使用随 viewer assets 分发的官方 diagrams.net 离线 viewer;路径特殊时可通过 `options.drawing.viewerScriptUrl` 覆盖,`preferOfficial:false` 才切到内置 SVG 兜底。 | | ||
| | 离线部署 | 运行时不依赖公共 CDN 或第三方在线资源;`file-viewer-copy-assets` 会复制 PDF、CAD、Typst、SQLite、压缩包、Draw.io、DOCX worker/JSZip、PPTX worker 和 Office worker/vendor 资产。 | | ||
| | 离线部署 | 运行时不依赖公共 CDN 或第三方在线资源;`file-viewer-copy-assets` 会复制 PDF、CAD、Typst、SQLite、压缩包、Draw.io、DOCX worker/JSZip、PPTX worker 和 Office worker/vendor 资产。Vue full 包默认使用 `/file-viewer/` 作为资源根,路径不同可先调用 `setDefaultFullAssetBaseUrl()`。 | | ||
| | 部署原则 | 默认只在命中特定格式时异步加载对应依赖;没有命中的格式不会拉取重型 Worker、WASM 或解析库。 | | ||
| ## 质量门禁 | ||
@@ -346,0 +347,0 @@ |
104042
0.91%353
0.28%Updated