@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
1
  import { defineComponent as $, ref as k, computed as B, onMounted as E, onBeforeUnmount as L, openBlock as e, createElementBlock as t, Fragment as v, renderList as f, normalizeClass as M, toDisplayString as r, createCommentVNode as w, createElementVNode as b } from "vue";
2
- import { r as N } from "./text-CcxmtFce.js";
2
+ import { r as N } from "./text-Bqxn_tMI.js";
3
3
  const V = { class: "lfp-document lfp-sheet" }, X = {
4
4
  key: 0,
5
5
  class: "lfp-sheet__tabs"
@@ -22,7 +22,7 @@ const V = { class: "lfp-document lfp-sheet" }, X = {
22
22
  async function g() {
23
23
  m("loading", !0);
24
24
  try {
25
- const l = await N(i.source, y.signal), h = await import("./xlsx-CZNBZqms.js"), a = h.read(l, { type: "array" });
25
+ const l = await N(i.source, y.signal), h = await import("./xlsx-j9Zzywas.js"), a = h.read(l, { type: "array" });
26
26
  c.value = a.SheetNames.map((o) => {
27
27
  const s = h.utils.sheet_to_json(a.Sheets[o], {
28
28
  header: 1,
@@ -1,5 +1,5 @@
1
- import { defineComponent as g, ref as l, computed as f, onMounted as h, onBeforeUnmount as k, openBlock as n, createElementBlock as r, toDisplayString as p, createCommentVNode as B, createElementVNode as w } from "vue";
2
- import { a as M } from "./text-CcxmtFce.js";
1
+ import { defineComponent as g, ref as i, computed as f, onMounted as h, onBeforeUnmount as k, openBlock as n, createElementBlock as r, toDisplayString as p, createCommentVNode as B, createElementVNode as w } from "vue";
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(i, { emit: v }) {
19
- const e = i, a = v, t = l(""), c = l(!1), u = new AbortController(), s = l(""), d = f(() => e.extension === "md"), y = f(() => e.extension === "json");
18
+ setup(c, { emit: v }) {
19
+ const e = c, a = v, t = i(""), u = i(!1), d = new AbortController(), s = i(""), m = f(() => e.extension === "md"), y = f(() => e.extension === "json");
20
20
  async function x() {
21
21
  a("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 (c.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
- s.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
+ s.value = _.sanitize(l.parse(t.value));
33
33
  } else
34
34
  s.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(), r("div", C, [
46
- c.value ? (n(), r("p", T, "文件较大,当前仅展示前 " + p(Math.round(i.maxBytes / 1024)) + " KB 内容。", 1)) : B("", !0),
47
- d.value ? (n(), r("article", {
44
+ d.abort();
45
+ }), (o, l) => (n(), r("div", C, [
46
+ u.value ? (n(), r("p", T, "文件较大,当前仅展示前 " + p(Math.round(c.maxBytes / 1024)) + " KB 内容。", 1)) : B("", !0),
47
+ m.value ? (n(), r("article", {
48
48
  key: 1,
49
49
  class: "lfp-markdown",
50
50
  innerHTML: s.value
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as o, openBlock as l, createElementBlock as a, createElementVNode as t, toDisplayString as i, unref as r } from "vue";
2
- import { d as s } from "./index-BlBE9ZR-.js";
2
+ import { d as s } from "./index-DZOrV9D_.js";
3
3
  const d = { class: "lfp-empty" }, p = { class: "lfp-hint" }, c = /* @__PURE__ */ o({
4
4
  __name: "UnsupportedRenderer",
5
5
  props: {