@flyfish-group/file-viewer-react 1.0.22 → 1.0.23
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.md +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
React 文件预览组件。只提供私有化部署路线: 依赖的 `@flyfish-group/file-viewer-web` 会随包携带 Vue 基线 viewer 产物;使用 `npm install` 或已允许 pnpm 安装脚本后,会复制到宿主项目 `public/file-viewer`。React 组件默认加载 `/file-viewer/index.html`,不依赖任何外部服务。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npm install @flyfish-group/file-viewer-react@1.0.
|
|
6
|
+
npm install @flyfish-group/file-viewer-react@1.0.23
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
pnpm 10 默认会拦截依赖包的 `postinstall`。如果安装后提示 `Ignored build scripts: @flyfish-group/file-viewer-web`,请执行 `pnpm approve-builds` 允许该包,或运行 `pnpm exec file-viewer-copy-assets ./public/file-viewer`。复制脚本会先清空目标目录再复制,避免 `index.html` 和 `assets/*` hash 不同版本导致动态 import 404。
|
|
@@ -48,4 +48,4 @@ export function Preview() {
|
|
|
48
48
|
|
|
49
49
|
React 组件内部复用 `mountViewerFrame` 的地址协议,会默认追加 `__flyfish_viewer_version` 来绕开旧 iframe 入口页缓存;静态服务已经保证 HTML 不缓存时,可传 `cacheKey={false}` 关闭。
|
|
50
50
|
|
|
51
|
-
`options` 会透传给 Vue 基线预览器,可配置主题、下载/打印/导出 HTML
|
|
51
|
+
`options` 会透传给 Vue 基线预览器,可配置主题、下载/打印/导出 HTML 操作栏、文字或图片水印、搜索高亮、AI 友好文本切片,以及压缩包预览的 `libarchive.js` Worker、IndexedDB 缓存和体积上限。`theme` 支持 `light`、`dark`、`system`,默认跟随系统;固定浅色宿主 UI 建议传 `theme: 'light'`。`toolbar.position` 支持 `auto`、`top`、`bottom-right`,默认 `auto`,PDF 会自动悬浮到右下角以避开自身导航栏;`pdf.toolbar` 可隐藏 PDF 自身工具栏,适合文档比对等紧凑场景。搜索 API 会按格式选择最佳链路,PDF 走 PDF.js 原生搜索,文本类格式走通用 DOM 高亮。打印按钮会按当前格式和渲染链路动态显隐;Word / PDF 打印和导出会生成完整页面,不依赖当前 iframe 视口或已渲染 canvas。生命周期、操作能力变化、搜索状态和当前位置会通过 `onViewerEvent` 回传给宿主,适合记录加载耗时、审计下载/打印尝试、搜索命中、页码/行号、AI 切片和溯源状态。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flyfish-group/file-viewer-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Private-deploy React component for Flyfish Viewer",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"react": ">=17 <20"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@flyfish-group/file-viewer-web": "^1.0.
|
|
50
|
+
"@flyfish-group/file-viewer-web": "^1.0.23"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/react": "^19.2.17",
|