@work-zhanguo/light-file-preview 0.0.12 → 0.0.14

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.
Files changed (32) hide show
  1. package/README.md +119 -91
  2. package/dist/DocxRenderer-Cck1uOjU.js +110 -0
  3. package/dist/{PdfRenderer-Due2M5cA.js → PdfRenderer-DweDxjLS.js} +102 -36
  4. package/dist/SheetRenderer-CMDoDBXR.js +940 -0
  5. package/dist/{UnsupportedRenderer-_3Y2XGCI.js → UnsupportedRenderer-pjXuzLhC.js} +1 -1
  6. package/dist/index-AN7FkZtw.js +346 -0
  7. package/dist/light-file-preview.js +1 -1
  8. package/dist/light-file-preview.umd.cjs +68 -68
  9. package/dist/standalone/light-file-preview.iife.js +72 -72
  10. package/dist/standalone/style.css +1 -1
  11. package/dist/style.css +1 -1
  12. package/dist/vue2/DocxRenderer-DR_4KeGA.js +110 -0
  13. package/dist/vue2/{PdfRenderer-pDvWG0pi.js → PdfRenderer-DNDmJ3M6.js} +102 -36
  14. package/dist/vue2/SheetRenderer-XW8dLaab.js +940 -0
  15. package/dist/vue2/{TextRenderer-B0bVXhgh.js → TextRenderer-CQsD7GMD.js} +1 -1
  16. package/dist/vue2/{UnsupportedRenderer-CvvKjt07.js → UnsupportedRenderer-fr1iHYbj.js} +3 -3
  17. package/dist/vue2/light-file-preview-vue2.js +1 -1
  18. package/dist/vue2/light-file-preview-vue2.umd.cjs +115 -115
  19. package/dist/vue2/{vue2-CqSgN38_.js → vue2-C42eMKpL.js} +1495 -1453
  20. package/package.json +4 -1
  21. package/public/screenshots/effect-docx.png +0 -0
  22. package/public/screenshots/effect-pdf.png +0 -0
  23. package/public/screenshots/effect-pptx.png +0 -0
  24. package/public/screenshots/effect-xlsx.png +0 -0
  25. package/public/screenshots/preview-dialog.png +0 -0
  26. package/public/screenshots/preview-docs.png +0 -0
  27. package/public/screenshots/preview-home.png +0 -0
  28. package/dist/DocxRenderer-DogNhBLd.js +0 -42
  29. package/dist/SheetRenderer-D1DAXE1c.js +0 -706
  30. package/dist/index-wdafvObE.js +0 -305
  31. package/dist/vue2/DocxRenderer-BUzCqs85.js +0 -42
  32. package/dist/vue2/SheetRenderer-Z48WXEZj.js +0 -706
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@work-zhanguo/light-file-preview",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "轻量级通用文件预览组件,支持 Vue3、Vue2 适配与独立产物嵌入。",
5
5
  "type": "module",
6
6
  "main": "./dist/light-file-preview.umd.cjs",
@@ -19,11 +19,13 @@
19
19
  "require": "./dist/vue2/light-file-preview-vue2.umd.cjs"
20
20
  },
21
21
  "./style.css": "./dist/style.css",
22
+ "./standalone/style.css": "./dist/standalone/style.css",
22
23
  "./vue2/style.css": "./dist/vue2/style.css",
23
24
  "./standalone": "./dist/standalone/light-file-preview.iife.js"
24
25
  },
25
26
  "files": [
26
27
  "dist",
28
+ "public/screenshots",
27
29
  "vue2.js",
28
30
  "style.css"
29
31
  ],
@@ -61,6 +63,7 @@
61
63
  "xlsx": "^0.18.5"
62
64
  },
63
65
  "devDependencies": {
66
+ "@types/node": "^24.6.1",
64
67
  "@vitejs/plugin-vue": "^5.2.1",
65
68
  "typescript": "^5.8.3",
66
69
  "vite": "^6.2.4",
@@ -1,42 +0,0 @@
1
- import { defineComponent as s, ref as f, onMounted as u, onBeforeUnmount as d, openBlock as m, createElementBlock as p } from "vue";
2
- import { r as v } from "./text-Bqxn_tMI.js";
3
- const x = /* @__PURE__ */ s({
4
- __name: "DocxRenderer",
5
- props: {
6
- source: {}
7
- },
8
- emits: ["loading", "error"],
9
- setup(a, { emit: c }) {
10
- const i = a, n = c, e = f(null), o = new AbortController();
11
- async function l() {
12
- n("loading", !0);
13
- try {
14
- const r = await v(i.source, o.signal), { renderAsync: t } = await import("./docx-preview-BV-bQyiM.js");
15
- if (!e.value)
16
- return;
17
- e.value.innerHTML = "", await t(r, e.value, void 0, {
18
- className: "lfp-docx-content",
19
- ignoreWidth: !1,
20
- ignoreHeight: !1,
21
- useBase64URL: !0
22
- });
23
- } catch (r) {
24
- n("error", r instanceof Error ? r : new Error("DOCX 预览失败"));
25
- } finally {
26
- n("loading", !1);
27
- }
28
- }
29
- return u(() => {
30
- l();
31
- }), d(() => {
32
- o.abort(), e.value && (e.value.innerHTML = "");
33
- }), (r, t) => (m(), p("div", {
34
- ref_key: "containerRef",
35
- ref: e,
36
- class: "lfp-document lfp-docx"
37
- }, null, 512));
38
- }
39
- });
40
- export {
41
- x as default
42
- };