@file-viewer/vue3 3.3.0 → 3.3.3

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
@@ -2,6 +2,8 @@
2
2
 
3
3
  [English](https://github.com/flyfish-dev/file-viewer/blob/main/packages/components/vue3/README.md) · [简体中文](https://github.com/flyfish-dev/file-viewer/blob/main/packages/components/vue3/README.zh-CN.md)
4
4
 
5
+ Browser-side file preview for Vue 3. Use one component API for loading, search, zoom, page navigation, print and export where supported by the selected format. This is the lightweight package: add renderer presets for PDF, Office and other document formats.
6
+
5
7
  <!-- FILE_VIEWER_PACKAGE_HEADER -->
6
8
  <p>
7
9
  <a href="https://www.npmjs.com/package/@file-viewer/vue3"><img src="https://img.shields.io/npm/v/@file-viewer%2Fvue3?logo=npm" alt="npm version"></a>
@@ -20,10 +22,23 @@
20
22
 
21
23
  > ⭐ If File Viewer helps you, please [star the repo on GitHub](https://github.com/flyfish-dev/file-viewer).
22
24
 
23
- The standard Vue 3 native component package for Flyfish File Viewer. It owns the Vue 3 component lifecycle and local controller while consuming the shared `@file-viewer/core` contracts and core browser engine. It exposes plugin install, component props, lifecycle events, search, zoom, print, export, and document-location ref APIs.
25
+ ## Quick start
26
+
27
+ Create an application with renderers and local assets configured:
24
28
 
25
29
  ```bash
26
- npm install vue @file-viewer/vue3
30
+ npx file-viewer-cli@latest create my-viewer --framework vue3 --profile standard
31
+ ```
32
+
33
+ For an existing project, use `npx file-viewer-cli@latest add .`, or follow the [manual integration guide](https://doc.file-viewer.app/guide/on-demand-renderers). The component alone does not install document engines or deploy their Worker/WASM files.
34
+
35
+ ## Manual integration
36
+
37
+ The examples below require the matching renderer preset and self-hosted assets. The CLI configures these for you; a bare component install is not a PDF or Office viewer.
38
+
39
+ ```bash
40
+ npm install vue @file-viewer/vue3 @file-viewer/preset-standard file-viewer-copy-assets
41
+ npx --no-install file-viewer-copy-assets ./public/file-viewer
27
42
  ```
28
43
 
29
44
  ```ts
@@ -37,16 +52,21 @@ createApp(App).use(FileViewer).mount('#app')
37
52
  ```
38
53
 
39
54
  ```vue
55
+ <script setup lang="ts">
56
+ import standardRenderers from '@file-viewer/preset-standard'
57
+
58
+ const viewerOptions = {
59
+ preset: standardRenderers,
60
+ theme: 'light' as const,
61
+ toolbar: { position: 'bottom-right' as const }
62
+ }
63
+ </script>
64
+
40
65
  <template>
41
66
  <section style="height: 100vh">
42
67
  <file-viewer
43
- ref="viewer"
44
68
  url="/example/demo.pdf"
45
- :options="{
46
- theme: 'light',
47
- toolbar: { position: 'bottom-right' }
48
- }"
49
- @load-complete="handleLoadComplete"
69
+ :options="viewerOptions"
50
70
  />
51
71
  </section>
52
72
  </template>
@@ -289,7 +309,7 @@ The table below lists the real props, event channel, and customization entry for
289
309
  | `iwork` | After explicitly installing the iWork capability, configure its Pages / Numbers / Keynote module Worker, timeout, ZIP/Snappy/IWA safety limits, and Quick Look fallback policy. It is not in the standard/full default closure. |
290
310
  | `hangul` | After explicitly installing the Hangul capability, configure its HWP/HWPX module Worker, timeout, ZIP limits, and HWP record limits. It is not in the standard/full default closure. |
291
311
  | `wordPerfect` | After explicitly installing the WordPerfect capability, configure its Worker, libwpd/librevenge WASM URL, and timeout. It is not in the standard/full default closure. |
292
- | `presentation` | The standard/full default includes only the PPTX/OpenXML `@file-viewer/pptx` Worker, with optional `workerUrl` / `workerType` overrides. Binary PowerPoint 97–2003 `.ppt` is a separate heavy capability; run `file-viewer add ppt --write` to install its Worker/WASM and assets explicitly. |
312
+ | `presentation` | Standard includes PPTX/OpenXML; Office/All presets and Full packages also support binary `.ppt` / `.pot`. PPT uses an Apache-2.0 TypeScript engine and parsing Worker, without WASM or embedded fonts. Minimal installs can use `file-viewer add ppt --write`; custom routes can override `pptModuleUrl` / `pptWorkerUrl`. |
293
313
  | `typst` / `data` / `cad` | After explicitly installing the matching capability, configure Typst, SQLite, or CAD/DWG/DXF/DWF WASM, worker, encoding, and rendering options. These capabilities are not in the standard/full default closure. |
294
314
  | `hooks` / `beforeOperation` | Shared lifecycle hooks and operation preflight checks for audit, permission, telemetry, and safety controls. |
295
315
 
@@ -415,7 +435,7 @@ View-state sync is designed for projection systems, remote-control displays, sid
415
435
 
416
436
  See the official documentation for options, lifecycle hooks, beforeOperation, theme, watermark, search, zoom, print, and export APIs: https://doc.file-viewer.app/
417
437
 
418
- Online demo: https://demo.file-viewer.app/. File Viewer-authored source and component packages generated by this repository use Apache-2.0. Any distribution that includes the `@file-viewer/ppt` runtime retains its independent LICENSE and NOTICE and does not relicense it under Apache-2.0. For derivative or commercial use, keep clear Flyfish Viewer attribution; shared compatibility fixes are welcome in the matching component repository.
438
+ Online demo: https://demo.file-viewer.app/. File Viewer-authored source, component packages and the new compiled TypeScript PPT runtime use Apache-2.0. The PPT engine source remains private; retain its LICENSE and NOTICE.md. Previous native PPT license and watermark requirements are unchanged, and other third-party runtimes retain their original licenses. Keep Flyfish Viewer attribution in derivative and commercial use.
419
439
  <!-- FILE_VIEWER_GENERATED:END -->
420
440
 
421
441
  ## Extending the native toolbar
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [English](https://github.com/flyfish-dev/file-viewer/blob/main/packages/components/vue3/README.md) · [简体中文](https://github.com/flyfish-dev/file-viewer/blob/main/packages/components/vue3/README.zh-CN.md)
4
4
 
5
+ Browser-side file preview for Vue 3. Use one component API for loading, search, zoom, page navigation, print and export where supported by the selected format. This is the lightweight package: add renderer presets for PDF, Office and other document formats.
6
+
5
7
  <!-- FILE_VIEWER_PACKAGE_HEADER -->
6
8
  <p>
7
9
  <a href="https://www.npmjs.com/package/@file-viewer/vue3"><img src="https://img.shields.io/npm/v/@file-viewer%2Fvue3?logo=npm" alt="npm version"></a>
@@ -20,10 +22,23 @@
20
22
 
21
23
  > ⭐ If File Viewer helps you, please [star the repo on GitHub](https://github.com/flyfish-dev/file-viewer).
22
24
 
23
- The standard Vue 3 native component package for Flyfish File Viewer. It owns the Vue 3 component lifecycle and local controller while consuming the shared `@file-viewer/core` contracts and core browser engine. It exposes plugin install, component props, lifecycle events, search, zoom, print, export, and document-location ref APIs.
25
+ ## Quick start
26
+
27
+ Create an application with renderers and local assets configured:
24
28
 
25
29
  ```bash
26
- npm install vue @file-viewer/vue3
30
+ npx file-viewer-cli@latest create my-viewer --framework vue3 --profile standard
31
+ ```
32
+
33
+ For an existing project, use `npx file-viewer-cli@latest add .`, or follow the [manual integration guide](https://doc.file-viewer.app/guide/on-demand-renderers). The component alone does not install document engines or deploy their Worker/WASM files.
34
+
35
+ ## Manual integration
36
+
37
+ The examples below require the matching renderer preset and self-hosted assets. The CLI configures these for you; a bare component install is not a PDF or Office viewer.
38
+
39
+ ```bash
40
+ npm install vue @file-viewer/vue3 @file-viewer/preset-standard file-viewer-copy-assets
41
+ npx --no-install file-viewer-copy-assets ./public/file-viewer
27
42
  ```
28
43
 
29
44
  ```ts
@@ -37,16 +52,21 @@ createApp(App).use(FileViewer).mount('#app')
37
52
  ```
38
53
 
39
54
  ```vue
55
+ <script setup lang="ts">
56
+ import standardRenderers from '@file-viewer/preset-standard'
57
+
58
+ const viewerOptions = {
59
+ preset: standardRenderers,
60
+ theme: 'light' as const,
61
+ toolbar: { position: 'bottom-right' as const }
62
+ }
63
+ </script>
64
+
40
65
  <template>
41
66
  <section style="height: 100vh">
42
67
  <file-viewer
43
- ref="viewer"
44
68
  url="/example/demo.pdf"
45
- :options="{
46
- theme: 'light',
47
- toolbar: { position: 'bottom-right' }
48
- }"
49
- @load-complete="handleLoadComplete"
69
+ :options="viewerOptions"
50
70
  />
51
71
  </section>
52
72
  </template>
@@ -289,7 +309,7 @@ The table below lists the real props, event channel, and customization entry for
289
309
  | `iwork` | After explicitly installing the iWork capability, configure its Pages / Numbers / Keynote module Worker, timeout, ZIP/Snappy/IWA safety limits, and Quick Look fallback policy. It is not in the standard/full default closure. |
290
310
  | `hangul` | After explicitly installing the Hangul capability, configure its HWP/HWPX module Worker, timeout, ZIP limits, and HWP record limits. It is not in the standard/full default closure. |
291
311
  | `wordPerfect` | After explicitly installing the WordPerfect capability, configure its Worker, libwpd/librevenge WASM URL, and timeout. It is not in the standard/full default closure. |
292
- | `presentation` | The standard/full default includes only the PPTX/OpenXML `@file-viewer/pptx` Worker, with optional `workerUrl` / `workerType` overrides. Binary PowerPoint 97–2003 `.ppt` is a separate heavy capability; run `file-viewer add ppt --write` to install its Worker/WASM and assets explicitly. |
312
+ | `presentation` | Standard includes PPTX/OpenXML; Office/All presets and Full packages also support binary `.ppt` / `.pot`. PPT uses an Apache-2.0 TypeScript engine and parsing Worker, without WASM or embedded fonts. Minimal installs can use `file-viewer add ppt --write`; custom routes can override `pptModuleUrl` / `pptWorkerUrl`. |
293
313
  | `typst` / `data` / `cad` | After explicitly installing the matching capability, configure Typst, SQLite, or CAD/DWG/DXF/DWF WASM, worker, encoding, and rendering options. These capabilities are not in the standard/full default closure. |
294
314
  | `hooks` / `beforeOperation` | Shared lifecycle hooks and operation preflight checks for audit, permission, telemetry, and safety controls. |
295
315
 
@@ -415,7 +435,7 @@ View-state sync is designed for projection systems, remote-control displays, sid
415
435
 
416
436
  See the official documentation for options, lifecycle hooks, beforeOperation, theme, watermark, search, zoom, print, and export APIs: https://doc.file-viewer.app/
417
437
 
418
- Online demo: https://demo.file-viewer.app/. File Viewer-authored source and component packages generated by this repository use Apache-2.0. Any distribution that includes the `@file-viewer/ppt` runtime retains its independent LICENSE and NOTICE and does not relicense it under Apache-2.0. For derivative or commercial use, keep clear Flyfish Viewer attribution; shared compatibility fixes are welcome in the matching component repository.
438
+ Online demo: https://demo.file-viewer.app/. File Viewer-authored source, component packages and the new compiled TypeScript PPT runtime use Apache-2.0. The PPT engine source remains private; retain its LICENSE and NOTICE.md. Previous native PPT license and watermark requirements are unchanged, and other third-party runtimes retain their original licenses. Keep Flyfish Viewer attribution in derivative and commercial use.
419
439
  <!-- FILE_VIEWER_GENERATED:END -->
420
440
 
421
441
  ## Extending the native toolbar
package/README.zh-CN.md CHANGED
@@ -292,7 +292,7 @@ const options = {
292
292
  | `iwork` | 显式安装 iWork capability 后,配置 Pages / Numbers / Keynote 的模块 Worker、超时、ZIP/Snappy/IWA 安全上限与 Quick Look 降级策略;它不属于 standard/full 默认闭包。 |
293
293
  | `hangul` | 显式安装 Hangul capability 后,配置 HWP/HWPX 模块 Worker、超时、ZIP 解压/压缩率/条目数与 HWP 记录数安全上限;它不属于 standard/full 默认闭包。 |
294
294
  | `wordPerfect` | 显式安装 WordPerfect capability 后,配置 Worker、libwpd/librevenge WASM 地址与超时;它不属于 standard/full 默认闭包。 |
295
- | `presentation` | standard/full 默认只装配 PPTX/OpenXML 的 `@file-viewer/pptx` Worker,可通过 `workerUrl` / `workerType` 覆盖。PowerPoint 97–2003 `.ppt` 是独立重型 capability,需用 `file-viewer add ppt --write` 显式安装其 Worker/WASM 和资产。 |
295
+ | `presentation` | standard 默认包含 PPTX/OpenXML;Office/All preset 和 Full 包同时支持二进制 `.ppt` / `.pot`。PPT 使用 Apache-2.0 的 TypeScript 引擎与解析 Worker,无需 WASM 或内置字体。精简安装可用 `file-viewer add ppt --write`;自定义路径可覆盖 `pptModuleUrl` / `pptWorkerUrl`。 |
296
296
  | `typst` / `data` / `cad` | 显式安装相应 capability 后,配置 Typst、SQLite、CAD/DWG/DXF/DWF 等 WASM、Worker、编码和渲染策略;这些能力不属于 standard/full 默认闭包。 |
297
297
  | `hooks` / `beforeOperation` | 统一生命周期 hooks 和操作前置校验,可用于审计、权限、埋点和安全控制。 |
298
298
 
@@ -418,7 +418,7 @@ const options = {
418
418
 
419
419
  完整参数、生命周期 hooks、beforeOperation、主题、水印、搜索、缩放、打印和导出说明见官方文档: https://doc.file-viewer.app/
420
420
 
421
- 在线 Demo: https://demo.file-viewer.app/ 。File Viewer 自身源码与本仓生成的组件包使用 Apache-2.0;发行物若包含 `@file-viewer/ppt` 运行时,该运行时保留其独立 LICENSE 与 NOTICE,不被 Apache-2.0 重新许可。二开或商用请保留 Flyfish Viewer 来源说明;如果修复了通用兼容问题,也欢迎贡献回对应组件仓库。
421
+ 在线 Demo: https://demo.file-viewer.app/ 。File Viewer 自身源码、组件包和新 TypeScript PPT 公共编译包使用 Apache-2.0;PPT 引擎源码保持私有,发行时保留其 LICENSE 与 NOTICE.md。旧 native PPT 的许可和水印要求不变,其余第三方运行时保留原许可证。二开或商用请保留 Flyfish Viewer 来源说明。
422
422
  <!-- FILE_VIEWER_GENERATED:END -->
423
423
 
424
424
  ## 扩展原生工具栏
@@ -1,5 +1,5 @@
1
1
  import { r as e } from "./objectSpread2.js";
2
- //#region ../../core/dist/output/export.js
2
+ // ../../core/dist/output/export.js
3
3
  var t = (e, t) => {
4
4
  let n = URL.createObjectURL(e), r = document.createElement("a");
5
5
  r.href = n, r.download = t, r.rel = "noopener", document.body.appendChild(r), r.click(), r.remove(), window.setTimeout(() => URL.revokeObjectURL(n), 4e3);
@@ -19,7 +19,7 @@ var t = (e, t) => {
19
19
  let r = n.getPropertyValue(i);
20
20
  r && t.style.setProperty(i, r, e.style.getPropertyPriority(i));
21
21
  }
22
- (!t.style.width || t.style.width === "auto") && (t.style.width = `${a.width}px`), (!t.style.height || t.style.height === "auto") && (t.style.height = `${a.height}px`), e.replaceWith(t);
22
+ t.style.width && t.style.width !== "auto" || (t.style.width = `${a.width}px`), t.style.height && t.style.height !== "auto" || (t.style.height = `${a.height}px`), e.replaceWith(t);
23
23
  } catch (e) {}
24
24
  });
25
25
  }, a = (e) => new Promise((t) => {
@@ -154,5 +154,4 @@ var t = (e, t) => {
154
154
  return t.apply(this, arguments);
155
155
  };
156
156
  }();
157
- //#endregion
158
157
  export { t as a, a as c, m as i, p as l, h as n, n as o, i as r, c as s, f as t };
@@ -1,7 +1,7 @@
1
1
  import { r as e, t } from "./objectSpread2.js";
2
2
  import { a as n, c as r, i, l as a, n as o, o as s, r as c, s as l, t as u } from "./export.js";
3
3
  import { i as d, n as f, r as p, t as ee } from "./printMask.js";
4
- //#region ../../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
4
+ // ../../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
5
5
  function m(e, t) {
6
6
  this.v = e, this.k = t;
7
7
  }
@@ -451,7 +451,7 @@ function ct() {
451
451
  }, ln = function() {
452
452
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
453
453
  if (on && on === e) return;
454
- (!e || typeof e != "object") && (e = {}), e = N(e), rn = an.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, X = rn === "application/xhtml+xml" ? ve : E, z = I(e, "ALLOWED_TAGS", xt, { transform: X }), B = I(e, "ALLOWED_ATTR", St, { transform: X }), Xt = I(e, "ALLOWED_NAMESPACES", Zt, { transform: ve }), Wt = I(e, "ADD_URI_SAFE_ATTR", Gt, {
454
+ e && typeof e == "object" || (e = {}), e = N(e), rn = an.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, X = rn === "application/xhtml+xml" ? ve : E, z = I(e, "ALLOWED_TAGS", xt, { transform: X }), B = I(e, "ALLOWED_ATTR", St, { transform: X }), Xt = I(e, "ALLOWED_NAMESPACES", Zt, { transform: ve }), Wt = I(e, "ADD_URI_SAFE_ATTR", Gt, {
455
455
  transform: X,
456
456
  base: Gt
457
457
  }), Ht = I(e, "ADD_DATA_URI_TAGS", Ut, {
@@ -1016,7 +1016,7 @@ var lt = ct(), ut = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").repl
1016
1016
  else {
1017
1017
  if (a === "@" && e.slice(i + 1, i + 7).toLowerCase() === "import") {
1018
1018
  let n = e[i + 7] || "";
1019
- (!n || !L(n)) && (t = !0);
1019
+ n && L(n) || (t = !0);
1020
1020
  }
1021
1021
  if (e.slice(i, i + 3).toLowerCase() === "url" && !L(e[i - 1] || "")) {
1022
1022
  let t = i + 3;
@@ -1097,7 +1097,7 @@ var lt = ct(), ut = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").repl
1097
1097
  e ? n.setAttribute("style", e) : n.removeAttribute("style");
1098
1098
  }
1099
1099
  }), n) : null;
1100
- }, Ct = ["<meta charset=\"utf-8\" />", "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />"].join("\n "), U = (e, t) => {
1100
+ }, Ct = "<meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />", U = (e, t) => {
1101
1101
  let n = ft(t), r = n ? H(n) : null;
1102
1102
  return r ? `<!doctype html>\n${String(r.sanitize(e, dt)).replace("<head>", `<head>\n ${Ct}`)}` : "<!doctype html>\n<html lang=\"en\"><head><meta charset=\"utf-8\" /></head><body></body></html>";
1103
1103
  }, wt = (e) => {
@@ -1214,5 +1214,4 @@ var lt = ct(), ut = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").repl
1214
1214
  return t.apply(this, arguments);
1215
1215
  };
1216
1216
  }();
1217
- //#endregion
1218
1217
  export { Ot as buildExportDomDocument, K as buildExportHtmlDocument, jt as buildFileViewerRenderedDomDocument, At as buildFileViewerRenderedHtmlDocument, W as collectDocumentStyles, u as inlineFileViewerBlobUrlsInHtml, o as prepareFileViewerRenderedContentForSnapshot, c as replaceFileViewerCanvasWithImages, i as resolveFileViewerPrintStyle, Et as sanitizeFileViewerExportDocumentDom, U as sanitizeFileViewerExportDocumentHtml, n as triggerFileViewerBlobDownload, s as triggerFileViewerUrlDownload, l as waitForFileViewerImages, r as waitForFileViewerNextPaint, a as waitForFileViewerPrintWindowReady };
@@ -51,14 +51,7 @@ var n = (e = {}) => {
51
51
  n += i - o, r += 1;
52
52
  }
53
53
  }), c;
54
- }, s = (/* @__PURE__ */ "[data-viewer-anchor-id],.pdfViewer .page,.docx-wrapper section,.docx p,.docx li,.docx table,.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6,.markdown-body p,.markdown-body li,.markdown-body pre,.markdown-body table,article h1,article h2,article h3,article h4,article h5,article h6,article p,article li,article pre,article table,pre code,p,li,tr,h1,h2,h3,h4,h5,h6,pre,table".split(",")).join(","), c = [
55
- ".viewer-actions",
56
- ".viewer-watermark",
57
- ".state-panel",
58
- ".pdf-toolbar",
59
- ".pdf-nav-pane",
60
- ".flyfish-search-match"
61
- ].join(","), l = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&"), u = (e, t = 160) => {
54
+ }, s = (/* @__PURE__ */ "[data-viewer-anchor-id],.pdfViewer .page,.docx-wrapper section,.docx p,.docx li,.docx table,.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6,.markdown-body p,.markdown-body li,.markdown-body pre,.markdown-body table,article h1,article h2,article h3,article h4,article h5,article h6,article p,article li,article pre,article table,pre code,p,li,tr,h1,h2,h3,h4,h5,h6,pre,table".split(",")).join(","), c = ".viewer-actions,.viewer-watermark,.state-panel,.pdf-toolbar,.pdf-nav-pane,.flyfish-search-match", l = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&"), u = (e, t = 160) => {
62
55
  let n = e.replace(/\s+/g, " ").trim();
63
56
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
64
57
  }, d = (e) => {
@@ -162,8 +155,7 @@ var n = (e = {}) => {
162
155
  let n = w(e, "[data-viewer-view-state-provider]"), r = n.find((e) => e.dataset.viewerViewStateProvider !== "generic"), i = n.find((e) => e.dataset.viewerViewStateProvider === "generic"), a = r || i;
163
156
  return a ? S.get(a) || a.__flyfishViewerViewStateProvider || null : t || null;
164
157
  };
165
- //#endregion
166
- //#region ../../core/dist/features/document/zoomGestures.js
158
+ // ../../core/dist/features/document/zoomGestures.js
167
159
  function M(t, n) {
168
160
  let r = t.ownerDocument.defaultView;
169
161
  if (!r) return () => {};
@@ -175,7 +167,7 @@ function M(t, n) {
175
167
  let i = t.getState();
176
168
  return Math.min((n = i.maxScale) == null ? 4 : n, Math.max((r = i.minScale) == null ? .1 : r, e));
177
169
  }, p = () => {
178
- !i && !o && !a && s !== null && (a = r.requestAnimationFrame(() => {
170
+ i || o || a || s === null || (a = r.requestAnimationFrame(() => {
179
171
  a = 0, m();
180
172
  }));
181
173
  }, m = function() {
@@ -224,8 +216,7 @@ function M(t, n) {
224
216
  i = !0, s = null, c = null, l = null, a && r.cancelAnimationFrame(a), t.removeEventListener("wheel", g), t.removeEventListener("touchstart", v), t.removeEventListener("touchmove", y), t.removeEventListener("touchend", b), t.removeEventListener("touchcancel", b);
225
217
  };
226
218
  }
227
- //#endregion
228
- //#region ../../core/dist/features/document/zoom.js
219
+ // ../../core/dist/features/document/zoom.js
229
220
  var N = (e) => ({
230
221
  scale: e.scale,
231
222
  label: e.label,
@@ -542,5 +533,4 @@ var I = () => {
542
533
  }
543
534
  };
544
535
  };
545
- //#endregion
546
536
  export { o as _, R as a, O as c, A as d, D as f, y as g, v as h, I as i, k as l, _ as m, ee as n, T as o, g as p, Z as r, j as s, re as t, E as u, i as v, r as y };
@@ -1,7 +1,7 @@
1
1
  import { r as e } from "./objectSpread2.js";
2
2
  import { f as t, i as n, r, u as i } from "./fit.js";
3
3
  import { t as a } from "./messages.js";
4
- //#region ../../core/dist/features/document/imageHandTool.js
4
+ // ../../core/dist/features/document/imageHandTool.js
5
5
  function o(e, t) {
6
6
  let n = e.ownerDocument.defaultView;
7
7
  if (!n || t != null && t.aborted) return () => {};
@@ -66,8 +66,7 @@ function o(e, t) {
66
66
  };
67
67
  return e.addEventListener("pointerdown", y), e.addEventListener("pointermove", h), e.addEventListener("pointerover", h), e.addEventListener("lostpointercapture", v), e.addEventListener("click", b, !0), e.addEventListener("dragstart", x), t == null || t.addEventListener("abort", C, { once: !0 }), h(), C;
68
68
  }
69
- //#endregion
70
- //#region ../../core/dist/renderers/image.js
69
+ // ../../core/dist/renderers/image.js
71
70
  var s = {
72
71
  avif: "image/avif",
73
72
  bmp: "image/bmp",
@@ -233,5 +232,4 @@ function g() {
233
232
  };
234
233
  }), g.apply(this, arguments);
235
234
  }
236
- //#endregion
237
235
  export { h as default };
@@ -1,4 +1,4 @@
1
- //#region ../../core/dist/i18n/messages.ja.js
1
+ // ../../core/dist/i18n/messages.ja.js
2
2
  var e = {
3
3
  "toolbar.zoomGroup": "ズーム操作",
4
4
  "toolbar.zoomOut": "縮小",
@@ -135,7 +135,7 @@ var e = {
135
135
  "presentation.ppt.state.loading": "PowerPoint 97–2003 を解析しています...",
136
136
  "presentation.ppt.error.title": "PPT プレビューに失敗しました",
137
137
  "presentation.ppt.error.parseFailed": "この PPT ファイルを解析できませんでした。",
138
- "presentation.ppt.error.assetHint": "@file-viewer/ppt モジュール、pptWasmUrl、application/wasm MIME タイプ、Web Crypto、CSP 設定を確認してください。",
138
+ "presentation.ppt.error.assetHint": "@file-viewer/ppt モジュール、解析 Worker の JavaScript MIME タイプ、CSP 設定を確認してください。",
139
139
  "presentation.slideshow.start": "スライドショーを開始",
140
140
  "presentation.slideshow.exit": "スライドショーを終了",
141
141
  "presentation.slideshow.hint": "← → 移動 · Esc 終了",
@@ -597,7 +597,7 @@ var e = {
597
597
  "presentation.ppt.state.loading": "Parsen von PowerPoint 97–2003...",
598
598
  "presentation.ppt.error.title": "PPT-Vorschau fehlgeschlagen",
599
599
  "presentation.ppt.error.parseFailed": "Diese PPT-Datei konnte nicht analysiert werden.",
600
- "presentation.ppt.error.assetHint": "Überprüfen Sie die Einstellungen für Modul @file-viewer/ppt, pptWasmUrl, application/wasm MIME, Web Crypto und CSP.",
600
+ "presentation.ppt.error.assetHint": "Überprüfen Sie das Modul @file-viewer/ppt, den JavaScript-MIME-Typ des Parsing-Workers und die CSP-Einstellungen.",
601
601
  "presentation.slideshow.start": "Diashow starten",
602
602
  "presentation.slideshow.exit": "Diashow beenden",
603
603
  "presentation.slideshow.hint": "← → navigieren · Esc beenden",
@@ -1060,7 +1060,7 @@ var e = {
1060
1060
  "presentation.ppt.state.loading": "正在解析 PowerPoint 97–2003...",
1061
1061
  "presentation.ppt.error.title": "PPT 预览失败",
1062
1062
  "presentation.ppt.error.parseFailed": "无法解析这个 PPT 文件。",
1063
- "presentation.ppt.error.assetHint": "请检查 @file-viewer/ppt 模块、pptWasmUrl、application/wasm MIME 类型、Web Crypto 和 CSP 配置。",
1063
+ "presentation.ppt.error.assetHint": "请检查 @file-viewer/ppt 模块、解析 Worker 的 JavaScript MIME 类型和 CSP 配置。",
1064
1064
  "presentation.slideshow.start": "开始放映",
1065
1065
  "presentation.slideshow.exit": "退出放映",
1066
1066
  "presentation.slideshow.hint": "← → 翻页 · Esc 退出",
@@ -1523,7 +1523,7 @@ var e = {
1523
1523
  "presentation.ppt.state.loading": "Parsing PowerPoint 97–2003...",
1524
1524
  "presentation.ppt.error.title": "PPT preview failed",
1525
1525
  "presentation.ppt.error.parseFailed": "This PPT file could not be parsed.",
1526
- "presentation.ppt.error.assetHint": "Check the @file-viewer/ppt module, pptWasmUrl, application/wasm MIME type, Web Crypto, and CSP settings.",
1526
+ "presentation.ppt.error.assetHint": "Check the @file-viewer/ppt module, parsing Worker JavaScript MIME type, and CSP settings.",
1527
1527
  "presentation.slideshow.start": "Start slideshow",
1528
1528
  "presentation.slideshow.exit": "Exit slideshow",
1529
1529
  "presentation.slideshow.hint": "← → navigate · Esc exit",
@@ -1884,5 +1884,4 @@ var e = {
1884
1884
  let r = l(e), a = c(e);
1885
1885
  return u((typeof a == "function" ? a(t, n, r) : a == null ? void 0 : a[t]) || i[r][t] || i["en-US"][t] || i["zh-CN"][t], n);
1886
1886
  }, f = (e) => (t, n) => d(e, t, n);
1887
- //#endregion
1888
1887
  export { l as n, d as r, f as t };
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/asyncToGenerator.js
1
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/asyncToGenerator.js
2
2
  function e(e, t, n, r, i, a, o) {
3
3
  try {
4
4
  var s = e[a](o), c = s.value;
@@ -23,8 +23,7 @@ function t(t) {
23
23
  });
24
24
  };
25
25
  }
26
- //#endregion
27
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
26
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/typeof.js
28
27
  function n(e) {
29
28
  "@babel/helpers - typeof";
30
29
  return n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
@@ -33,8 +32,7 @@ function n(e) {
33
32
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
34
33
  }, n(e);
35
34
  }
36
- //#endregion
37
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
35
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/toPrimitive.js
38
36
  function r(e, t) {
39
37
  if (n(e) != "object" || !e) return e;
40
38
  var r = e[Symbol.toPrimitive];
@@ -45,14 +43,12 @@ function r(e, t) {
45
43
  }
46
44
  return (t === "string" ? String : Number)(e);
47
45
  }
48
- //#endregion
49
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
46
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/toPropertyKey.js
50
47
  function i(e) {
51
48
  var t = r(e, "string");
52
49
  return n(t) == "symbol" ? t : t + "";
53
50
  }
54
- //#endregion
55
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
51
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/defineProperty.js
56
52
  function a(e, t, n) {
57
53
  return (t = i(t)) in e ? Object.defineProperty(e, t, {
58
54
  value: n,
@@ -61,8 +57,7 @@ function a(e, t, n) {
61
57
  writable: !0
62
58
  }) : e[t] = n, e;
63
59
  }
64
- //#endregion
65
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectSpread2.js
60
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/objectSpread2.js
66
61
  function o(e, t) {
67
62
  var n = Object.keys(e);
68
63
  if (Object.getOwnPropertySymbols) {
@@ -84,5 +79,4 @@ function s(e) {
84
79
  }
85
80
  return e;
86
81
  }
87
- //#endregion
88
82
  export { a as n, t as r, s as t };
@@ -1,7 +1,7 @@
1
1
  import { r as e, t } from "./objectSpread2.js";
2
2
  import { t as n } from "./messages.js";
3
3
  import { a as r, o as i } from "./printMask.js";
4
- //#region ../../core/dist/features/printMaskDesigner.js
4
+ // ../../core/dist/features/printMaskDesigner.js
5
5
  var a = "\n.fv-print-mask-layer{position:absolute;inset:0;z-index:2147483000;pointer-events:none;}\n.fv-print-mask-canvas{position:absolute;inset:0;z-index:2147483000;pointer-events:none;cursor:default;}\n.fv-print-mask-canvas.is-armed{pointer-events:auto;cursor:crosshair;touch-action:none;}\n.fv-print-mask-block{position:absolute;background:#000;box-sizing:border-box;pointer-events:auto;}\n.fv-print-mask-block-remove{position:absolute;right:-8px;top:-8px;width:18px;height:18px;border:0;border-radius:999px;background:#111;color:#fff;font:700 12px/18px system-ui,sans-serif;cursor:pointer;padding:0;}\n.fv-print-stamp{position:absolute;box-sizing:border-box;border:1px dashed rgba(22,119,76,.7);border-radius:4px;pointer-events:auto;touch-action:none;cursor:move;transform-origin:center center;}\n.fv-print-stamp img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none;}\n.fv-print-stamp-resize{position:absolute;right:-7px;bottom:-7px;width:15px;height:15px;border:2px solid #fff;border-radius:4px;background:#16774c;box-shadow:0 1px 5px rgba(15,23,42,.22);cursor:nwse-resize;touch-action:none;}\n.fv-print-stamp-input{display:none!important;}\n.fv-print-mask-toolbar{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);z-index:2147483001;display:inline-flex;align-items:center;gap:6px;padding:6px 8px;border:1px solid rgba(20,35,53,.12);border-radius:999px;background:rgba(255,255,255,.94);box-shadow:0 12px 28px rgba(15,23,42,.16);pointer-events:auto;max-width:calc(100% - 24px);flex-wrap:wrap;justify-content:center;}\n.fv-print-mask-toolbar span{font:600 12px/1.2 system-ui,sans-serif;color:#40546a;white-space:nowrap;}\n.fv-print-mask-toolbar button{min-width:42px;height:30px;padding:0 10px;border:0;border-radius:999px;background:transparent;color:#40546a;font:800 12px/1 system-ui,sans-serif;cursor:pointer;}\n.fv-print-mask-toolbar button:hover,.fv-print-mask-toolbar button.is-active{background:rgba(33,163,102,.1);color:#16774c;}\n.fv-print-mask-toolbar button.primary{background:#16774c;color:#fff;}\n.fv-print-mask-toolbar button.primary:hover{background:#0f5f3c;}\n", o = (e) => {
6
6
  let t = e.ownerDocument, n = e.getRootNode(), r = n === t ? t.head : n;
7
7
  if (r.querySelector("#fv-print-mask-designer-style")) return;
@@ -202,5 +202,4 @@ var a = "\n.fv-print-mask-layer{position:absolute;inset:0;z-index:2147483000;poi
202
202
  }), F();
203
203
  });
204
204
  };
205
- //#endregion
206
205
  export { d as openFileViewerPrintMaskDesigner };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./objectSpread2.js";
2
- //#region ../../core/dist/features/printMask.js
2
+ // ../../core/dist/features/printMask.js
3
3
  var t = (e) => Math.max(0, Math.min(100, e)), n = (e) => {
4
4
  if (typeof e != "string") return "#000000";
5
5
  let t = e.trim();
@@ -122,5 +122,4 @@ var t = (e) => Math.max(0, Math.min(100, e)), n = (e) => {
122
122
  }
123
123
  return s.length ? (s.push(e.slice(l)), s.join("")) : e;
124
124
  };
125
- //#endregion
126
125
  export { r as a, c as i, _ as n, s as o, u as r, d as t };