@file-viewer/react-legacy-full 2.1.20 → 2.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -160,7 +160,7 @@ const options = {
160
160
  - For the smallest custom bundle, skip presets, install individual renderers such as `@file-viewer/renderer-pdf` or `@file-viewer/renderer-word`, and pass them through `options.renderers`.
161
161
  - `fileViewerRenderers()` or `fileViewerRenderers({ copyAssets:true })` auto-discovers installed presets without explicit configuration. When `scan:true` is also enabled, use `preset:'auto'` or `autoPresets:true` to keep preset auto-discovery.
162
162
  - `scan:true` detects `fileViewerFormats`, `data-file-viewer-formats`, and upload `accept` hints so development and production builds select matching renderers automatically.
163
- - `copyAssets:true` copies PDF/CAD/Typst/Archive/Data workers, WASM, and vendor assets for offline and enterprise intranet deployment.
163
+ - `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.
164
164
  - `builtinRenderers` remains available for advanced baseline control or historical compatibility. Normal quick starts only need `preset` / `renderers` plus `rendererMode`.
165
165
  - 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.
166
166
  - `@file-viewer/preset-all` is the full one-step capability path for demos, admin tools, and enterprise all-format workbenches. Normal product surfaces should still prefer narrower presets.
@@ -204,7 +204,7 @@ The table below lists the real props, event channel, and customization entry for
204
204
  | `toolbar` | Controls download, print, HTML export, zoom, toolbar position, and operation-level preflight checks. |
205
205
  | `search` | Document search, highlight class names, case sensitivity, whole-word matching, max matches, and debounce. |
206
206
  | `ai` | Text collection, chunk size, and max text length for provenance, location, vectorization, and external AI workflows. |
207
- | `archive` | Archive Worker/WASM URLs, timeout, cache, archive limits, and nested entry preview limits. |
207
+ | `archive` | Archive Worker/WASM URLs, timeout, cache, archive limits, nested entry preview limits, and legacy GBK/GB18030 ZIP filename decoding. |
208
208
  | `pdf` | PDF.js worker, navigation pane, outline, thumbnails, rotation, streaming, range chunk size, and credentials. |
209
209
  | `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. |
210
210
  | `typst` / `data` / `cad` | Typst, SQLite, CAD/DWG/DXF/DWF WASM, worker, encoding, and rendering strategy options. |
@@ -310,11 +310,12 @@ View-state sync is designed for projection systems, remote-control displays, sid
310
310
  | Shared viewer assets | The Pure Web package ships `file-viewer-copy-assets` to copy workers, WASM, vendor files, and examples into your static directory. |
311
311
  | CAD / DWG / DXF / DWF | Configure `options.cad.wasmPath`, `workerUrl`, `dwfWasmUrl`, and `dxfEncoding` for self-hosted or intranet deployment. |
312
312
  | 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. |
313
- | 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. |
313
+ | 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. |
314
314
  | 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. |
315
- | 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. |
315
+ | 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. |
316
316
  | Deployment principle | Heavy workers, WASM files, and parser libraries stay lazy-loaded and are only requested when the active file type needs them. |
317
317
 
318
+
318
319
  ## Quality Gates
319
320
 
320
321
  - Component packages only depend on `@file-viewer/core` and their own ecosystem dependencies. They do not nest through another framework component package.
package/README.md CHANGED
@@ -160,7 +160,7 @@ const options = {
160
160
  - 想要最小包体时,可以不用 preset,直接安装 `@file-viewer/renderer-pdf`、`@file-viewer/renderer-word` 等单个 renderer,并通过 `options.renderers` 手动注入。
161
161
  - `fileViewerRenderers()` 或 `fileViewerRenderers({ copyAssets:true })` 会免配置自动发现已安装 preset;如果同时开启 `scan:true`,请使用 `preset:'auto'` 或 `autoPresets:true` 保留 preset 自动发现。
162
162
  - `scan:true` 会识别 `fileViewerFormats`、`data-file-viewer-formats` 和上传控件 `accept`,调试与打包时自动选择 renderer。
163
- - `copyAssets:true` 会复制 PDF/CAD/Typst/Archive/Data 等 worker、WASM 和 vendor 资源,满足离线和企业内网部署。
163
+ - `copyAssets:true` 会复制 PDF/CAD/Typst/Archive/Data 等 worker、WASM 和 vendor 资源,满足离线和企业内网部署;压缩包目录会优先使用 `vendor/libarchive/worker-bundle.js` / `libarchive.wasm`,Worker 不可用时只对 ZIP/TAR/GZIP 进入兼容路径。
164
164
  - `builtinRenderers` 仍可用于高级基线控制或历史兼容;普通快速接入只需要 `preset` / `renderers` 与 `rendererMode`。
165
165
  - 如果打开的是支持矩阵内但未装配的格式,预览器会提示应安装的 preset / renderer;只有真正不在矩阵中的扩展名才提示不支持。
166
166
  - `@file-viewer/preset-all` 是全量一键方案,适合 demo、后台运维工具和企业全格式附件中心;普通业务仍建议优先选择更窄的 preset。
@@ -204,7 +204,7 @@ const options = {
204
204
  | `toolbar` | 控制下载、打印、HTML 导出、缩放和工具栏位置,并支持操作级前置校验。 |
205
205
  | `search` | 配置文档搜索、高亮 class、大小写、整词匹配、最大命中数和 debounce。 |
206
206
  | `ai` | 控制文本结构采集、分块大小和最大文本长度,为溯源、定位、向量化和外部 AI 流程提供基础。 |
207
- | `archive` | 配置压缩包 Worker/WASM、超时、缓存、包体限制和压缩包内单文件预览大小。 |
207
+ | `archive` | 配置压缩包 Worker/WASM、超时、缓存、包体限制和压缩包内单文件预览大小;旧 ZIP 中文文件名会自动按 GBK/GB18030 兼容解码。 |
208
208
  | `pdf` | 配置 PDF.js Worker、导航栏、目录、缩略图、旋转、流式读取、Range chunk 和凭据。 |
209
209
  | `docx` / `spreadsheet` | DOCX 由 @file-viewer/renderer-word 承接并使用自研 @file-viewer/docx,默认自动选择 Worker 或主线程解析,连续流式阅读和异步分批渲染,可按需显式开启视觉分页;表格由 @file-viewer/renderer-spreadsheet 承接,默认保真解析,大文件自动启用 Worker,表头拖拽调列宽可按需显式开启。 |
210
210
  | `typst` / `data` / `cad` | 配置 Typst、SQLite、CAD/DWG/DXF/DWF 等 WASM、Worker、编码和渲染策略。 |
@@ -310,11 +310,12 @@ const options = {
310
310
  | 通用 viewer assets | Pure Web 包提供 `file-viewer-copy-assets`,可把 Worker、WASM、vendor 和示例资源复制到业务静态目录。 |
311
311
  | CAD / DWG / DXF / DWF | 按需配置 `options.cad.wasmPath`、`workerUrl`、`dwfWasmUrl`、`dxfEncoding`,支持自托管和内网部署。 |
312
312
  | 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 地址。 |
313
- | Typst / SQLite / Archive | 按需配置 Typst compiler/renderer WASM、`data.sqlWasmUrl`、`archive.workerUrl` / `archive.wasmUrl`;Typst 仅使用本地 WASM 真实渲染,不访问公共 CDN。 |
313
+ | 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。 |
314
314
  | Drawing | Draw.io 默认使用随 viewer assets 分发的官方 diagrams.net 离线 viewer;路径特殊时可通过 `options.drawing.viewerScriptUrl` 覆盖,`preferOfficial:false` 才切到内置 SVG 兜底。 |
315
- | 离线部署 | 运行时不依赖公共 CDN 或第三方在线资源;`file-viewer-copy-assets` 会复制 PDF、CAD、Typst、SQLite、压缩包、Draw.io、DOCX worker/JSZip、PPTX worker 和 Office worker/vendor 资产。 |
315
+ | 离线部署 | 运行时不依赖公共 CDN 或第三方在线资源;`file-viewer-copy-assets` 会复制 PDF、CAD、Typst、SQLite、压缩包、Draw.io、DOCX worker/JSZip、PPTX worker 和 Office worker/vendor 资产。Vue full 包默认使用 `/file-viewer/` 作为资源根,路径不同可先调用 `setDefaultFullAssetBaseUrl()`。 |
316
316
  | 部署原则 | 默认只在命中特定格式时异步加载对应依赖;没有命中的格式不会拉取重型 Worker、WASM 或解析库。 |
317
317
 
318
+
318
319
  ## 质量门禁
319
320
 
320
321
  - 组件包只依赖 `@file-viewer/core` 和自身生态依赖,不嵌套引用其他框架组件包。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@file-viewer/react-legacy-full",
3
- "version": "2.1.20",
3
+ "version": "2.1.22",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Full React 16.8/17 package for Flyfish File Viewer with the complete preset enabled by default.",
@@ -56,8 +56,8 @@
56
56
  "react": ">=16.8 <18"
57
57
  },
58
58
  "dependencies": {
59
- "@file-viewer/preset-all": "^2.1.20",
60
- "@file-viewer/react-legacy": "^2.1.20"
59
+ "@file-viewer/preset-all": "^2.1.22",
60
+ "@file-viewer/react-legacy": "^2.1.22"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/react": "^17.0.0",