@work-zhanguo/light-file-preview 0.0.4 → 0.0.6

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 (35) hide show
  1. package/README.md +14 -2
  2. package/dist/{DocxRenderer-B8Ed3qFw.js → DocxRenderer-D0ngcG2T.js} +2 -2
  3. package/dist/{PdfRenderer-CYtwJLrP.js → PdfRenderer-SICIjXYT.js} +2 -2
  4. package/dist/{SheetRenderer-C9AKQiKN.js → SheetRenderer-D4Y1dYZX.js} +2 -2
  5. package/dist/{TextRenderer-W4uPsa5O.js → TextRenderer-KUhpnf63.js} +14 -14
  6. package/dist/{UnsupportedRenderer-BpyBTIIE.js → UnsupportedRenderer-Y2AgN0-l.js} +1 -1
  7. package/dist/{docx-preview-B2OPGnfm.js → docx-preview-D_8kC8vU.js} +666 -652
  8. package/dist/{index-BlBE9ZR-.js → index-DZOrV9D_.js} +86 -85
  9. package/dist/light-file-preview.js +1 -1
  10. package/dist/light-file-preview.umd.cjs +29 -29
  11. package/dist/{marked.esm-toXckLRC.js → marked.esm-CRmQbSOC.js} +15 -15
  12. package/dist/{pdf-B2JYpzlX.js → pdf-CV932zwQ.js} +1863 -1849
  13. package/dist/{purify.es-D5dazAgD.js → purify.es-CCmmh-Lt.js} +10 -10
  14. package/dist/standalone/light-file-preview.iife.js +68 -68
  15. package/dist/standalone/style.css +1 -1
  16. package/dist/style.css +1 -1
  17. package/dist/{text-CcxmtFce.js → text-Bqxn_tMI.js} +5 -5
  18. package/dist/vue2/{DocxRenderer-IkLQeCjg.js → DocxRenderer-D-MItvaP.js} +3 -3
  19. package/dist/vue2/{PdfRenderer-DmgMRpqS.js → PdfRenderer-rw-3PY9w.js} +3 -3
  20. package/dist/vue2/{SheetRenderer-CuAyFgj9.js → SheetRenderer-BxfF54Q3.js} +3 -3
  21. package/dist/vue2/{TextRenderer-Bxqs7APd.js → TextRenderer-DOzgi4YR.js} +14 -14
  22. package/dist/vue2/{UnsupportedRenderer-Cs2uPl_6.js → UnsupportedRenderer-VozD1bVb.js} +1 -1
  23. package/dist/vue2/{docx-preview-B2OPGnfm.js → docx-preview-D_8kC8vU.js} +666 -652
  24. package/dist/vue2/light-file-preview-vue2.js +1 -1
  25. package/dist/vue2/light-file-preview-vue2.umd.cjs +76 -76
  26. package/dist/vue2/{marked.esm-toXckLRC.js → marked.esm-CRmQbSOC.js} +15 -15
  27. package/dist/vue2/{pdf-B2JYpzlX.js → pdf-CV932zwQ.js} +1863 -1849
  28. package/dist/vue2/{purify.es-D5dazAgD.js → purify.es-CCmmh-Lt.js} +10 -10
  29. package/dist/vue2/{text-CcxmtFce.js → text-Bqxn_tMI.js} +5 -5
  30. package/dist/vue2/{vue2-CzAkhodr.js → vue2-rrMAk2-n.js} +119 -118
  31. package/dist/vue2/{xlsx-CZNBZqms.js → xlsx-j9Zzywas.js} +82 -82
  32. package/dist/{xlsx-CZNBZqms.js → xlsx-j9Zzywas.js} +82 -82
  33. package/package.json +4 -2
  34. package/style.css +1 -0
  35. package/vue2.js +2 -0
@@ -1,5 +1,5 @@
1
- import { d as B, g as $, o as E, a as F, b as e, c as t, F as f, h as v, e as w, t as r, f as b, r as k, n as L } from "./vue2-CzAkhodr.js";
2
- import { r as M } from "./text-CcxmtFce.js";
1
+ import { d as B, g as $, o as E, a as F, b as e, c as t, F as f, h as v, e as w, t as r, f as b, r as k, n as L } from "./vue2-rrMAk2-n.js";
2
+ import { r as M } from "./text-Bqxn_tMI.js";
3
3
  const N = { class: "lfp-document lfp-sheet" }, V = {
4
4
  key: 0,
5
5
  class: "lfp-sheet__tabs"
@@ -22,7 +22,7 @@ const N = { class: "lfp-document lfp-sheet" }, V = {
22
22
  async function g() {
23
23
  m("loading", !0);
24
24
  try {
25
- const l = await M(i.source, y.signal), h = await import("./xlsx-CZNBZqms.js"), o = h.read(l, { type: "array" });
25
+ const l = await M(i.source, y.signal), h = await import("./xlsx-j9Zzywas.js"), o = h.read(l, { type: "array" });
26
26
  c.value = o.SheetNames.map((a) => {
27
27
  const n = h.utils.sheet_to_json(o.Sheets[a], {
28
28
  header: 1,
@@ -1,5 +1,5 @@
1
- import { d as g, g as f, o as h, a as k, b as n, c as a, t as p, e as B, f as w, r as l } from "./vue2-CzAkhodr.js";
2
- import { a as M } from "./text-CcxmtFce.js";
1
+ import { d as g, g as f, o as h, a as k, b as n, c as a, t as p, e as B, f as w, r as c } from "./vue2-rrMAk2-n.js";
2
+ import { a as M } from "./text-Bqxn_tMI.js";
3
3
  const C = { class: "lfp-document" }, T = {
4
4
  key: 0,
5
5
  class: "lfp-hint"
@@ -15,21 +15,21 @@ const C = { class: "lfp-document" }, T = {
15
15
  maxBytes: {}
16
16
  },
17
17
  emits: ["loading", "error"],
18
- setup(c, { emit: v }) {
19
- const e = c, s = v, t = l(""), i = l(!1), u = new AbortController(), r = l(""), d = f(() => e.extension === "md"), y = f(() => e.extension === "json");
18
+ setup(i, { emit: v }) {
19
+ const e = i, s = v, t = c(""), u = c(!1), d = new AbortController(), r = c(""), m = f(() => e.extension === "md"), y = f(() => e.extension === "json");
20
20
  async function x() {
21
21
  s("loading", !0);
22
22
  try {
23
- t.value = await M(e.source, e.encoding, e.maxBytes, u.signal);
23
+ t.value = await M(e.source, e.encoding, e.maxBytes, d.signal);
24
24
  const o = typeof e.source == "string" ? t.value.length : e.source.size;
25
- if (i.value = o > e.maxBytes, y.value)
25
+ if (u.value = o > e.maxBytes, y.value)
26
26
  try {
27
27
  t.value = JSON.stringify(JSON.parse(t.value), null, 2);
28
- } catch {
28
+ } catch (l) {
29
29
  }
30
- if (d.value) {
31
- const [{ marked: m }, { default: _ }] = await Promise.all([import("./marked.esm-toXckLRC.js"), import("./purify.es-D5dazAgD.js")]);
32
- r.value = _.sanitize(m.parse(t.value));
30
+ if (m.value) {
31
+ const [{ marked: l }, { default: _ }] = await Promise.all([import("./marked.esm-CRmQbSOC.js"), import("./purify.es-CCmmh-Lt.js")]);
32
+ r.value = _.sanitize(l.parse(t.value));
33
33
  } else
34
34
  r.value = "";
35
35
  } catch (o) {
@@ -41,10 +41,10 @@ const C = { class: "lfp-document" }, T = {
41
41
  return h(() => {
42
42
  x();
43
43
  }), k(() => {
44
- u.abort();
45
- }), (o, m) => (n(), a("div", C, [
46
- i.value ? (n(), a("p", T, "文件较大,当前仅展示前 " + p(Math.round(c.maxBytes / 1024)) + " KB 内容。", 1)) : B("", !0),
47
- d.value ? (n(), a("article", {
44
+ d.abort();
45
+ }), (o, l) => (n(), a("div", C, [
46
+ u.value ? (n(), a("p", T, "文件较大,当前仅展示前 " + p(Math.round(i.maxBytes / 1024)) + " KB 内容。", 1)) : B("", !0),
47
+ m.value ? (n(), a("article", {
48
48
  key: 1,
49
49
  class: "lfp-markdown",
50
50
  innerHTML: r.value
@@ -1,4 +1,4 @@
1
- import { d as n, b as l, c as o, f as t, t as s, u as i, i as r } from "./vue2-CzAkhodr.js";
1
+ import { d as n, b as l, c as o, f as t, t as s, u as i, i as r } from "./vue2-rrMAk2-n.js";
2
2
  const d = { class: "lfp-empty" }, p = { class: "lfp-hint" }, c = /* @__PURE__ */ n({
3
3
  __name: "UnsupportedRenderer",
4
4
  props: {