@file-viewer/thumbnail 2.2.0 → 2.2.2

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
@@ -29,8 +29,9 @@ Failures use `FileViewerThumbnailError` with stable codes: `browser-required`, `
29
29
 
30
30
  - Requires a real browser. Server applications must invoke it inside Chromium.
31
31
  - The string form `preset: 'all'` only works after a Vite plugin or preset side-effect import has registered it. Pass the imported preset object, as above, for bundler-neutral setup.
32
- - Embedded previews take priority over rendering. EPUB uses its declared cover; OOXML and 3MF use package thumbnail relationships; OpenDocument and XMind use their packaged thumbnails; and Apple Numbers uses its Quick Look thumbnail when present.
32
+ - Embedded previews take priority over rendering. EPUB uses its declared cover through the pinned, lazy-loaded engine shipped with this package; OOXML and 3MF use package thumbnail relationships; OpenDocument and XMind use their packaged thumbnails; and Apple Numbers uses its Quick Look thumbnail when present.
33
33
  - Missing, corrupt, empty, or undecodable embedded images safely fall back to renderer-native or first-content capture.
34
34
  - PDF and images use native capture; Office, OFD, and ebooks expose a first-content target when no embedded preview is available.
35
35
  - Other renderers use a DOM fallback and return `degraded: true`.
36
36
  - Source files and generated thumbnails are never persisted by this package.
37
+ - Versions, sources, and license texts for the EPUB engine and its inlined dependencies are recorded in `dist/vendor/epubjs.NOTICE.txt`.
package/README.md CHANGED
@@ -40,8 +40,9 @@ await generator.destroy()
40
40
 
41
41
  - 只支持真实浏览器;服务端需要自行在 Chromium 页面中调用。
42
42
  - 字符串形式的 `preset: 'all'` 只在 Vite 插件或 preset side-effect import 已完成注册时有效;跨 bundler 示例应直接传入上面导入的 preset 对象。
43
- - 内嵌预览始终优先于完整渲染:EPUB 使用声明的封面,OOXML 与 3MF 使用 package thumbnail relationship,OpenDocument 与 XMind 使用包内缩略图,Apple Numbers 存在 Quick Look 缩略图时直接复用。
43
+ - 内嵌预览始终优先于完整渲染:EPUB 使用声明的封面,其解析引擎作为安全固定、按需加载的离线产物随包发布;OOXML 与 3MF 使用 package thumbnail relationship,OpenDocument 与 XMind 使用包内缩略图,Apple Numbers 存在 Quick Look 缩略图时直接复用。
44
44
  - 内嵌图片缺失、损坏、为空或浏览器无法解码时,会安全回退到 renderer 原生直出或首页捕获。
45
45
  - PDF 与图片使用原生直出;没有内嵌预览时,Office、OFD、电子书等使用 renderer 提供的首页目标。
46
46
  - 其他 renderer 使用 DOM fallback,并在结果中设置 `degraded: true`。
47
47
  - 不持久化源文件或缩略图;缓存与上传由调用方负责。
48
+ - EPUB 引擎及内联依赖的版本、来源和许可证文本记录在 `dist/vendor/epubjs.NOTICE.txt`。
@@ -15,7 +15,7 @@ export const extractEpubCover = async (source, signal) => {
15
15
  return null;
16
16
  }
17
17
  throwIfAborted(signal);
18
- const ePub = resolveEpubFactory(await import('epubjs'));
18
+ const ePub = resolveEpubFactory(await import('../vendor/epubjs.js'));
19
19
  const book = ePub(source.buffer.slice(0), { openAs: 'binary', replacements: 'blobUrl' });
20
20
  let destroyed = false;
21
21
  const destroyBook = () => {