@work-zhanguo/light-file-preview 0.0.5 → 0.0.7

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 (39) hide show
  1. package/README.md +3 -1
  2. package/dist/{DocxRenderer-B8Ed3qFw.js → DocxRenderer-DogNhBLd.js} +2 -2
  3. package/dist/PdfRenderer-Due2M5cA.js +57 -0
  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-8vWx7yB8.js} +1 -1
  7. package/dist/_commonjs-dynamic-modules-C74YT1gS.js +32 -0
  8. package/dist/{docx-preview-B2OPGnfm.js → docx-preview-BV-bQyiM.js} +729 -721
  9. package/dist/{index-BlBE9ZR-.js → index-BNN8UXSN.js} +86 -85
  10. package/dist/light-file-preview.js +1 -1
  11. package/dist/light-file-preview.umd.cjs +158 -161
  12. package/dist/{marked.esm-toXckLRC.js → marked.esm-CRmQbSOC.js} +15 -15
  13. package/dist/pdf-BiKi76Et.js +15320 -0
  14. package/dist/{purify.es-D5dazAgD.js → purify.es-CCmmh-Lt.js} +10 -10
  15. package/dist/standalone/light-file-preview.iife.js +160 -163
  16. package/dist/standalone/style.css +1 -1
  17. package/dist/style.css +1 -1
  18. package/dist/{text-CcxmtFce.js → text-Bqxn_tMI.js} +5 -5
  19. package/dist/vue2/{DocxRenderer-IkLQeCjg.js → DocxRenderer-B9neMid7.js} +3 -3
  20. package/dist/vue2/PdfRenderer-iEictZ1C.js +57 -0
  21. package/dist/vue2/{SheetRenderer-CuAyFgj9.js → SheetRenderer-KITfWM9E.js} +3 -3
  22. package/dist/vue2/{TextRenderer-Bxqs7APd.js → TextRenderer-B8_BjhwJ.js} +14 -14
  23. package/dist/vue2/{UnsupportedRenderer-Cs2uPl_6.js → UnsupportedRenderer-WZYKdRc9.js} +1 -1
  24. package/dist/vue2/_commonjs-dynamic-modules-C74YT1gS.js +32 -0
  25. package/dist/vue2/{docx-preview-B2OPGnfm.js → docx-preview-BV-bQyiM.js} +729 -721
  26. package/dist/vue2/light-file-preview-vue2.js +1 -1
  27. package/dist/vue2/light-file-preview-vue2.umd.cjs +160 -163
  28. package/dist/vue2/{marked.esm-toXckLRC.js → marked.esm-CRmQbSOC.js} +15 -15
  29. package/dist/vue2/pdf-BiKi76Et.js +15320 -0
  30. package/dist/vue2/{purify.es-D5dazAgD.js → purify.es-CCmmh-Lt.js} +10 -10
  31. package/dist/vue2/{text-CcxmtFce.js → text-Bqxn_tMI.js} +5 -5
  32. package/dist/vue2/{vue2-CzAkhodr.js → vue2-C2dNeAAJ.js} +119 -118
  33. package/dist/vue2/{xlsx-CZNBZqms.js → xlsx-j9Zzywas.js} +82 -82
  34. package/dist/{xlsx-CZNBZqms.js → xlsx-j9Zzywas.js} +82 -82
  35. package/package.json +2 -2
  36. package/dist/PdfRenderer-CYtwJLrP.js +0 -57
  37. package/dist/pdf-B2JYpzlX.js +0 -14597
  38. package/dist/vue2/PdfRenderer-DmgMRpqS.js +0 -57
  39. package/dist/vue2/pdf-B2JYpzlX.js +0 -14597
@@ -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-C2dNeAAJ.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-C2dNeAAJ.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-C2dNeAAJ.js";
2
2
  const d = { class: "lfp-empty" }, p = { class: "lfp-hint" }, c = /* @__PURE__ */ n({
3
3
  __name: "UnsupportedRenderer",
4
4
  props: {
@@ -0,0 +1,32 @@
1
+ var u = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
2
+ function i(e) {
3
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
+ }
5
+ function a(e) {
6
+ if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
7
+ var r = e.default;
8
+ if (typeof r == "function") {
9
+ var t = function o() {
10
+ return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
11
+ };
12
+ t.prototype = r.prototype;
13
+ } else t = {};
14
+ return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
15
+ var n = Object.getOwnPropertyDescriptor(e, o);
16
+ Object.defineProperty(t, o, n.get ? n : {
17
+ enumerable: !0,
18
+ get: function() {
19
+ return e[o];
20
+ }
21
+ });
22
+ }), t;
23
+ }
24
+ function l(e) {
25
+ throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
26
+ }
27
+ export {
28
+ u as a,
29
+ i as b,
30
+ l as c,
31
+ a as g
32
+ };