@eternalheart/vue-file-preview 1.7.2 → 1.8.0

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 (54) hide show
  1. package/README.md +28 -0
  2. package/README.zh-CN.md +28 -0
  3. package/lib/FilePreviewContent.vue.d.ts +25 -11
  4. package/lib/FilePreviewEmbed.vue.d.ts +20 -11
  5. package/lib/FilePreviewModal.vue.d.ts +20 -11
  6. package/lib/chunks/{EmptyState.vue_vue_type_script_setup_true_lang-Dna6LmVT.mjs → EmptyState.vue_vue_type_script_setup_true_lang-98G0nOSe.mjs} +1 -1
  7. package/lib/chunks/{avifLoader-CAUzjn-d-dPsP28D5.mjs → avifLoader-CAUzjn-d-BaqsWKGB.mjs} +1 -1
  8. package/lib/chunks/{heicLoader-D_9PukkA-T-k1DSgY.mjs → heicLoader-D_9PukkA-C9OkgWGg.mjs} +1 -1
  9. package/lib/chunks/index-B5B5upNy.mjs +112 -0
  10. package/lib/chunks/{index-cRhwUlQN.mjs → index-B9xl_UYv.mjs} +26 -26
  11. package/lib/chunks/{index-B5hprvcF.mjs → index-BKpp6GvN.mjs} +2516 -2085
  12. package/lib/chunks/{index-oJF-hur2.mjs → index-BNNGXI8X.mjs} +1 -1
  13. package/lib/chunks/{index-eNZr1h6f.mjs → index-BV5eiYIr.mjs} +23 -23
  14. package/lib/chunks/{index-BjHEHkZ8.mjs → index-Bghv1art.mjs} +1 -1
  15. package/lib/chunks/{index-TZv0MqBH.mjs → index-Bl530kxA.mjs} +5 -5
  16. package/lib/chunks/index-CCHdh2Ta.mjs +220 -0
  17. package/lib/chunks/{index-QPk2c2Tl.mjs → index-CDd2zFE5.mjs} +2 -2
  18. package/lib/chunks/{index-C95y29OL.mjs → index-CHpO-VOr.mjs} +19 -19
  19. package/lib/chunks/index-CSxcgc5S.mjs +401 -0
  20. package/lib/chunks/{index-Cv3Sg87O.mjs → index-CcyrSSZO.mjs} +17 -17
  21. package/lib/chunks/{index-JjVQZbDt.mjs → index-CzBIAq6E.mjs} +25 -25
  22. package/lib/chunks/{index-BPutNVAf.mjs → index-D-18qa-n.mjs} +1 -1
  23. package/lib/chunks/{index-BN__EwfT.mjs → index-D4OWPWnl.mjs} +1 -1
  24. package/lib/chunks/{index-Dnyl1HQk.mjs → index-DcEoeHsV.mjs} +10 -10
  25. package/lib/chunks/{index-DInI3RTN.mjs → index-DjCn0C-U.mjs} +33 -33
  26. package/lib/chunks/{index-DHba2Axz.mjs → index-Dtr0MERf.mjs} +53 -53
  27. package/lib/chunks/{index-CqOGKCyE.mjs → index-UBINFnHY.mjs} +1 -1
  28. package/lib/chunks/{index-BlZ6RmeR.mjs → index-YyZE4Nkm.mjs} +4 -4
  29. package/lib/chunks/{index-CegPYMyO.mjs → index-mdCIanDM.mjs} +27 -27
  30. package/lib/chunks/{index-DXzvgRuo.mjs → index-s_jqndx-.mjs} +1 -1
  31. package/lib/chunks/{jp2Loader-Dig19xyo-hrIg_KJ3.mjs → jp2Loader-Dig19xyo-CD7_CVVV.mjs} +1 -1
  32. package/lib/chunks/{psdLoader-C0tKUXXl-B2cJ4s7t.mjs → psdLoader-C0tKUXXl-Bf25O3n4.mjs} +1 -1
  33. package/lib/chunks/{rawLoader-C-tPeFAB-BNV-Wmzr.mjs → rawLoader-C-tPeFAB-CZ65svhu.mjs} +5 -5
  34. package/lib/chunks/{tiffLoader-BlhByX8w-BzSrLE9Y.mjs → tiffLoader-BlhByX8w-BEFJubN7.mjs} +1 -1
  35. package/lib/chunks/{useShikiHighlight-CpL0RAQg.mjs → useShikiHighlight-axL5ux5r.mjs} +1 -1
  36. package/lib/composables/useRendererBridge.d.ts +19 -0
  37. package/lib/composables/useRequest.d.ts +1 -13
  38. package/lib/core/index.d.ts +9 -1
  39. package/lib/core/renderer-bridge/bridge.d.ts +53 -0
  40. package/lib/core/renderer-bridge/hub.d.ts +58 -0
  41. package/lib/core/renderer-bridge/types.d.ts +141 -0
  42. package/lib/core/types.d.ts +0 -7
  43. package/lib/core/utils/rendererId.d.ts +7 -0
  44. package/lib/core/utils/spreadsheetSheets.d.ts +17 -0
  45. package/lib/index.cjs +60 -60
  46. package/lib/index.css +1 -1
  47. package/lib/index.d.ts +1 -1
  48. package/lib/index.mjs +8 -8
  49. package/lib/renderers/Xlsx/index.vue.d.ts +4 -0
  50. package/lib/types.d.ts +7 -2
  51. package/package.json +1 -1
  52. package/lib/chunks/index-B_Spz6Wn.mjs +0 -359
  53. package/lib/chunks/index-DcvlMm9Q.mjs +0 -137
  54. package/lib/chunks/index-dOxDeWYi.mjs +0 -104
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as m, ref as p, watch as g, openBlock as u, createElementBlock as c, createElementVNode as o, toDisplayString as h, unref as y, createBlock as w } from "vue";
2
- import { u as k, a as x, b, J as T, s as B } from "./index-B5hprvcF.mjs";
2
+ import { u as k, a as x, b as T, k as b, T as B } from "./index-BKpp6GvN.mjs";
3
3
  import { _ as E } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
4
4
  const G = {
5
5
  key: 0,
@@ -7,33 +7,33 @@ const G = {
7
7
  }, H = { class: "vfp-renderer-loading-content" }, L = { class: "vfp-renderer-loading-text" }, M = {
8
8
  key: 2,
9
9
  class: "vfp-w-full vfp-h-full vfp-overflow-auto vfp-py-6 vfp-px-4"
10
- }, P = ["innerHTML"], N = /* @__PURE__ */ m({
10
+ }, P = ["innerHTML"], S = /* @__PURE__ */ m({
11
11
  __name: "index",
12
12
  props: {
13
13
  url: {}
14
14
  },
15
15
  setup(f, { expose: v }) {
16
- const s = f, { t } = k(), d = x(), l = b(), n = p(""), i = p(!0), r = p(null), _ = async () => {
17
- l.begin(s.url), i.value = !0, r.value = null, n.value = "";
16
+ const t = f, { t: s } = k(), d = x(), l = T(), n = p(""), i = p(!0), r = p(null), _ = async () => {
17
+ l.begin(t.url), i.value = !0, r.value = null, n.value = "";
18
18
  try {
19
- const e = await d.value(s.url);
20
- if (!e.ok) throw new T("file.load_failed");
19
+ const e = await d.value(t.url);
20
+ if (!e.ok) throw new b("file.load_failed");
21
21
  const a = await e.arrayBuffer();
22
22
  n.value = await B(a), l.ready();
23
23
  } catch (e) {
24
- console.error(t.value("ppt.parse_failed") + ":", e), r.value = t.value("ppt.parse_failed"), l.error(e);
24
+ console.error(s.value("ppt.parse_failed") + ":", e), r.value = s.value("ppt.parse_failed"), l.error(e);
25
25
  } finally {
26
26
  i.value = !1;
27
27
  }
28
28
  };
29
- return g(() => s.url, (e) => {
29
+ return g(() => t.url, (e) => {
30
30
  e && _();
31
31
  }, { immediate: !0 }), v({
32
32
  getToolbarGroups: () => []
33
33
  }), (e, a) => i.value ? (u(), c("div", G, [
34
34
  o("div", H, [
35
35
  a[0] || (a[0] = o("div", { class: "vfp-renderer-spinner" }, null, -1)),
36
- o("span", L, h(y(t)("common.loading")), 1)
36
+ o("span", L, h(y(s)("common.loading")), 1)
37
37
  ])
38
38
  ])) : r.value ? (u(), w(E, {
39
39
  key: 1,
@@ -47,5 +47,5 @@ const G = {
47
47
  }
48
48
  });
49
49
  export {
50
- N as default
50
+ S as default
51
51
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as J, ref as U, watch as C, openBlock as j, createElementBlock as $, createElementVNode as R, toDisplayString as ee, unref as Q, createBlock as W, createVNode as ne, h as g, inject as le, computed as S } from "vue";
2
- import { u as te, a as ie, b as ue, T as oe, f as se, S as fe, g as ce, h as pe, e as ke } from "./index-B5hprvcF.mjs";
1
+ import { defineComponent as H, ref as U, watch as C, openBlock as j, createElementBlock as $, createElementVNode as R, toDisplayString as ee, unref as Q, createBlock as W, createVNode as ne, h as g, inject as le, computed as Y } from "vue";
2
+ import { u as te, a as ie, b as ue, l as oe, t as se, G as fe, L as ce, w as pe, p as ke } from "./index-BKpp6GvN.mjs";
3
3
  import { _ as ge } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
4
- import { _ as re } from "./EmptyState.vue_vue_type_script_setup_true_lang-Dna6LmVT.mjs";
4
+ import { _ as re } from "./EmptyState.vue_vue_type_script_setup_true_lang-98G0nOSe.mjs";
5
5
  import { ChevronDown as ae, ChevronRight as me } from "lucide-vue-next";
6
6
  function be(e, o = !1) {
7
7
  const f = e.length;
@@ -237,17 +237,17 @@ function E(e) {
237
237
  function B(e) {
238
238
  return e >= 48 && e <= 57;
239
239
  }
240
- var Y;
240
+ var z;
241
241
  (function(e) {
242
242
  e[e.lineFeed = 10] = "lineFeed", e[e.carriageReturn = 13] = "carriageReturn", e[e.space = 32] = "space", e[e._0 = 48] = "_0", e[e._1 = 49] = "_1", e[e._2 = 50] = "_2", e[e._3 = 51] = "_3", e[e._4 = 52] = "_4", e[e._5 = 53] = "_5", e[e._6 = 54] = "_6", e[e._7 = 55] = "_7", e[e._8 = 56] = "_8", e[e._9 = 57] = "_9", e[e.a = 97] = "a", e[e.b = 98] = "b", e[e.c = 99] = "c", e[e.d = 100] = "d", e[e.e = 101] = "e", e[e.f = 102] = "f", e[e.g = 103] = "g", e[e.h = 104] = "h", e[e.i = 105] = "i", e[e.j = 106] = "j", e[e.k = 107] = "k", e[e.l = 108] = "l", e[e.m = 109] = "m", e[e.n = 110] = "n", e[e.o = 111] = "o", e[e.p = 112] = "p", e[e.q = 113] = "q", e[e.r = 114] = "r", e[e.s = 115] = "s", e[e.t = 116] = "t", e[e.u = 117] = "u", e[e.v = 118] = "v", e[e.w = 119] = "w", e[e.x = 120] = "x", e[e.y = 121] = "y", e[e.z = 122] = "z", e[e.A = 65] = "A", e[e.B = 66] = "B", e[e.C = 67] = "C", e[e.D = 68] = "D", e[e.E = 69] = "E", e[e.F = 70] = "F", e[e.G = 71] = "G", e[e.H = 72] = "H", e[e.I = 73] = "I", e[e.J = 74] = "J", e[e.K = 75] = "K", e[e.L = 76] = "L", e[e.M = 77] = "M", e[e.N = 78] = "N", e[e.O = 79] = "O", e[e.P = 80] = "P", e[e.Q = 81] = "Q", e[e.R = 82] = "R", e[e.S = 83] = "S", e[e.T = 84] = "T", e[e.U = 85] = "U", e[e.V = 86] = "V", e[e.W = 87] = "W", e[e.X = 88] = "X", e[e.Y = 89] = "Y", e[e.Z = 90] = "Z", e[e.asterisk = 42] = "asterisk", e[e.backslash = 92] = "backslash", e[e.closeBrace = 125] = "closeBrace", e[e.closeBracket = 93] = "closeBracket", e[e.colon = 58] = "colon", e[e.comma = 44] = "comma", e[e.dot = 46] = "dot", e[e.doubleQuote = 34] = "doubleQuote", e[e.minus = 45] = "minus", e[e.openBrace = 123] = "openBrace", e[e.openBracket = 91] = "openBracket", e[e.plus = 43] = "plus", e[e.slash = 47] = "slash", e[e.formFeed = 12] = "formFeed", e[e.tab = 9] = "tab";
243
- })(Y || (Y = {}));
244
- var I;
243
+ })(z || (z = {}));
244
+ var V;
245
245
  (function(e) {
246
246
  e.DEFAULT = {
247
247
  allowTrailingComma: !1
248
248
  };
249
- })(I || (I = {}));
250
- function Te(e, o = [], f = I.DEFAULT) {
249
+ })(V || (V = {}));
250
+ function Te(e, o = [], f = V.DEFAULT) {
251
251
  let n = null, t = [];
252
252
  const s = [];
253
253
  function i(p) {
@@ -277,7 +277,7 @@ function Te(e, o = [], f = I.DEFAULT) {
277
277
  }
278
278
  }, f), t[0];
279
279
  }
280
- function ve(e, o, f = I.DEFAULT) {
280
+ function ve(e, o, f = V.DEFAULT) {
281
281
  const n = be(e, !1), t = [];
282
282
  let s = 0;
283
283
  function i(c) {
@@ -365,18 +365,18 @@ function ve(e, o, f = I.DEFAULT) {
365
365
  }
366
366
  function u(c, r = [], q = []) {
367
367
  if (l(c), r.length + q.length > 0) {
368
- let V = n.getToken();
369
- for (; V !== 17; ) {
370
- if (r.indexOf(V) !== -1) {
368
+ let I = n.getToken();
369
+ for (; I !== 17; ) {
370
+ if (r.indexOf(I) !== -1) {
371
371
  k();
372
372
  break;
373
- } else if (q.indexOf(V) !== -1)
373
+ } else if (q.indexOf(I) !== -1)
374
374
  break;
375
- V = k();
375
+ I = k();
376
376
  }
377
377
  }
378
378
  }
379
- function G(c) {
379
+ function J(c) {
380
380
  const r = n.getTokenValue();
381
381
  return c ? A(r) : (_(r), t.push(r)), k(), !0;
382
382
  }
@@ -409,7 +409,7 @@ function ve(e, o, f = I.DEFAULT) {
409
409
  2,
410
410
  5
411
411
  /* SyntaxKind.CommaToken */
412
- ]), !1) : (G(!1), n.getToken() === 6 ? (N(":"), k(), F() || u(4, [], [
412
+ ]), !1) : (J(!1), n.getToken() === 6 ? (N(":"), k(), F() || u(4, [], [
413
413
  2,
414
414
  5
415
415
  /* SyntaxKind.CommaToken */
@@ -464,26 +464,26 @@ function ve(e, o, f = I.DEFAULT) {
464
464
  case 1:
465
465
  return x();
466
466
  case 10:
467
- return G(!0);
467
+ return J(!0);
468
468
  default:
469
469
  return P();
470
470
  }
471
471
  }
472
472
  return k(), n.getToken() === 17 ? f.allowEmptyContent ? !0 : (u(4, [], []), !1) : F() ? (n.getToken() !== 17 && u(9, [], []), !0) : (u(4, [], []), !1);
473
473
  }
474
- var z;
474
+ var M;
475
475
  (function(e) {
476
476
  e[e.None = 0] = "None", e[e.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 4] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 6] = "InvalidCharacter";
477
- })(z || (z = {}));
478
- var M;
477
+ })(M || (M = {}));
478
+ var X;
479
479
  (function(e) {
480
480
  e[e.OpenBraceToken = 1] = "OpenBraceToken", e[e.CloseBraceToken = 2] = "CloseBraceToken", e[e.OpenBracketToken = 3] = "OpenBracketToken", e[e.CloseBracketToken = 4] = "CloseBracketToken", e[e.CommaToken = 5] = "CommaToken", e[e.ColonToken = 6] = "ColonToken", e[e.NullKeyword = 7] = "NullKeyword", e[e.TrueKeyword = 8] = "TrueKeyword", e[e.FalseKeyword = 9] = "FalseKeyword", e[e.StringLiteral = 10] = "StringLiteral", e[e.NumericLiteral = 11] = "NumericLiteral", e[e.LineCommentTrivia = 12] = "LineCommentTrivia", e[e.BlockCommentTrivia = 13] = "BlockCommentTrivia", e[e.LineBreakTrivia = 14] = "LineBreakTrivia", e[e.Trivia = 15] = "Trivia", e[e.Unknown = 16] = "Unknown", e[e.EOF = 17] = "EOF";
481
- })(M || (M = {}));
481
+ })(X || (X = {}));
482
482
  const we = Te;
483
- var X;
483
+ var Z;
484
484
  (function(e) {
485
485
  e[e.InvalidSymbol = 1] = "InvalidSymbol", e[e.InvalidNumberFormat = 2] = "InvalidNumberFormat", e[e.PropertyNameExpected = 3] = "PropertyNameExpected", e[e.ValueExpected = 4] = "ValueExpected", e[e.ColonExpected = 5] = "ColonExpected", e[e.CommaExpected = 6] = "CommaExpected", e[e.CloseBraceExpected = 7] = "CloseBraceExpected", e[e.CloseBracketExpected = 8] = "CloseBracketExpected", e[e.EndOfFileExpected = 9] = "EndOfFileExpected", e[e.InvalidCommentToken = 10] = "InvalidCommentToken", e[e.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 14] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 16] = "InvalidCharacter";
486
- })(X || (X = {}));
486
+ })(Z || (Z = {}));
487
487
  const ye = {
488
488
  key: 0,
489
489
  class: "vfp-renderer-loading"
@@ -493,7 +493,7 @@ const ye = {
493
493
  }, Le = {
494
494
  key: 4,
495
495
  class: "vfp-w-full vfp-h-full vfp-overflow-auto vfp-bg-code-bg vfp-py-6 vfp-px-4"
496
- }, Be = J({ name: "JsonRenderer" }), Ne = {
496
+ }, Be = H({ name: "JsonRenderer" }), Ne = {
497
497
  key: "#9cdcfe",
498
498
  string: "#ce9178",
499
499
  number: "#b5cea8",
@@ -518,7 +518,7 @@ function Ee(e) {
518
518
  function Ue(e, o) {
519
519
  return e === null ? g("span", { class: "json-null", style: { color: o.keyword } }, "null") : e === void 0 ? g("span", { class: "json-null", style: { color: o.keyword } }, "undefined") : typeof e == "boolean" ? g("span", { style: { color: o.keyword } }, String(e)) : typeof e == "number" ? g("span", { style: { color: o.number } }, String(e)) : typeof e == "string" ? g("span", { style: { color: o.string } }, `"${e}"`) : g("span", { style: { color: o.bracket } }, String(e));
520
520
  }
521
- function Z(e, o, f, n, t) {
521
+ function S(e, o, f, n, t) {
522
522
  return g("div", { class: "json-row", style: { paddingLeft: `${f}px` } }, [
523
523
  g("span", { class: "json-arrow-placeholder" }),
524
524
  e !== void 0 ? g("span", { class: "json-key", style: { color: n.key } }, [
@@ -528,7 +528,7 @@ function Z(e, o, f, n, t) {
528
528
  t ? g("span", { style: { color: n.bracket } }, t) : Ue(o, n)
529
529
  ]);
530
530
  }
531
- const H = J({
531
+ const G = H({
532
532
  name: "JsonNode",
533
533
  props: {
534
534
  keyName: { type: String, default: void 0 },
@@ -539,16 +539,16 @@ const H = J({
539
539
  setup(e) {
540
540
  const o = U(e.defaultExpanded), f = () => {
541
541
  o.value = !o.value;
542
- }, n = le(ce, null), t = S(() => (n == null ? void 0 : n.t.value) ?? pe({ locale: "en-US" })), s = ke(), i = S(() => Ee(s.value));
542
+ }, n = le(ce, null), t = Y(() => (n == null ? void 0 : n.t.value) ?? pe({ locale: "en-US" })), s = ke(), i = Y(() => Ee(s.value));
543
543
  return { expanded: o, toggle: f, tFunc: t, colors: i };
544
544
  },
545
545
  render() {
546
546
  const { keyName: e, value: o, depth: f, expanded: n, toggle: t, tFunc: s, colors: i } = this, m = f * 20;
547
547
  if (o == null || typeof o != "object")
548
- return Z(e, o, m, i);
548
+ return S(e, o, m, i);
549
549
  const p = Array.isArray(o), y = (p ? o : Object.entries(o)).length, a = p ? "[" : "{", _ = p ? "]" : "}";
550
550
  if (y === 0)
551
- return Z(e, null, m, i, `${a}${_}`);
551
+ return S(e, null, m, i, `${a}${_}`);
552
552
  const b = [];
553
553
  return b.push(
554
554
  g("div", {
@@ -571,11 +571,11 @@ const H = J({
571
571
  ])
572
572
  ), n && (p ? o.forEach((O, L) => {
573
573
  b.push(
574
- g(H, { key: L, value: O, depth: f + 1, defaultExpanded: f < 1 })
574
+ g(G, { key: L, value: O, depth: f + 1, defaultExpanded: f < 1 })
575
575
  );
576
576
  }) : Object.entries(o).forEach(([O, L]) => {
577
577
  b.push(
578
- g(H, { key: O, keyName: O, value: L, depth: f + 1, defaultExpanded: f < 1 })
578
+ g(G, { key: O, keyName: O, value: L, depth: f + 1, defaultExpanded: f < 1 })
579
579
  );
580
580
  }), b.push(
581
581
  g("div", { class: "json-row", style: { paddingLeft: `${m + 20}px` } }, [
@@ -583,7 +583,7 @@ const H = J({
583
583
  ])
584
584
  )), g("div", null, b);
585
585
  }
586
- }), Re = /* @__PURE__ */ J({
586
+ }), Re = /* @__PURE__ */ H({
587
587
  ...Be,
588
588
  props: {
589
589
  url: {},
@@ -613,7 +613,7 @@ const H = J({
613
613
  key: 1,
614
614
  message: v.value
615
615
  }, null, 8, ["message"])) : m.value && y() ? (j(), W(re, { key: 2 })) : m.value ? (j(), $("div", Ae)) : (j(), $("div", Le, [
616
- ne(Q(H), {
616
+ ne(Q(G), {
617
617
  value: i.value,
618
618
  depth: 0,
619
619
  "default-expanded": !0
@@ -1,15 +1,15 @@
1
- import { defineComponent as ke, ref as s, watch as I, onBeforeUnmount as ae, onMounted as Ee, computed as le, openBlock as w, createElementBlock as U, normalizeStyle as oe, createElementVNode as _, createTextVNode as Ce, toDisplayString as b, unref as D, createCommentVNode as E, createBlock as ne, normalizeClass as Te } from "vue";
2
- import { u as Ue, a as Ye, b as ze, $ as Se, _ as Xe, J as ie, M as Be, I as De, p as se, A as Oe } from "./index-B5hprvcF.mjs";
3
- import { ZoomOut as We, ZoomIn as $e, Scan as Pe, Maximize2 as je, RotateCcw as He, RotateCw as Ze, RefreshCw as Ie } from "lucide-vue-next";
1
+ import { defineComponent as ke, ref as s, watch as N, onBeforeUnmount as ae, onMounted as Ee, computed as le, openBlock as w, createElementBlock as U, normalizeStyle as oe, createElementVNode as _, createTextVNode as Ce, toDisplayString as b, unref as D, createCommentVNode as E, createBlock as ne, normalizeClass as Te } from "vue";
2
+ import { u as Ue, a as Ye, b as ze, C as Se, g as Xe, k as ie, y as Be, s as De, h as se, c as Oe } from "./index-BKpp6GvN.mjs";
3
+ import { ZoomOut as We, ZoomIn as Pe, Scan as $e, Maximize2 as je, RotateCcw as He, RotateCw as Ze, RefreshCw as Ne } from "lucide-vue-next";
4
4
  import { _ as re } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
- import { T as Ne } from "./base.types-DaftHyg7.mjs";
6
- const Ae = {
5
+ import { T as Ve } from "./base.types-DaftHyg7.mjs";
6
+ const Fe = {
7
7
  key: 0,
8
8
  class: "vfp-absolute vfp-inset-0 vfp-renderer-loading vfp-bg-surface-1/80 vfp-z-10"
9
- }, Ve = { class: "vfp-renderer-loading-content" }, Fe = { class: "vfp-renderer-loading-text" }, Ge = { key: 0 }, Qe = {
9
+ }, Ge = { class: "vfp-renderer-loading-content" }, Ie = { class: "vfp-renderer-loading-text" }, Qe = { key: 0 }, qe = {
10
10
  key: 2,
11
11
  class: "vfp-renderer-loading"
12
- }, qe = { class: "vfp-renderer-loading-content" }, Je = { class: "vfp-renderer-loading-text" }, Ke = ["src"], et = {
12
+ }, Ae = { class: "vfp-renderer-loading-content" }, Ke = { class: "vfp-renderer-loading-text" }, Je = ["src"], et = {
13
13
  key: 5,
14
14
  class: "vfp-absolute vfp-bottom-2 vfp-right-3 vfp-text-[10px] vfp-text-fg-disabled hover:vfp-text-fg-secondary vfp-transition-colors vfp-pointer-events-auto vfp-select-none vfp-cursor-default"
15
15
  }, tt = {
@@ -23,11 +23,11 @@ const Ae = {
23
23
  file: {}
24
24
  },
25
25
  setup(ue, { expose: ce }) {
26
- const f = ue, V = new Ne(), { t: i } = Ue(), ve = Ye(), B = ze(), r = s(1), C = s(0), T = s(!1), M = s(null), p = s(!1), O = s(0), R = s(null), L = s(""), k = s(1), Y = s(1), F = s(!1), l = s({ x: 0, y: 0 }), y = s(!1);
26
+ const f = ue, G = new Ve(), { t: i } = Ue(), ve = Ye(), B = ze(), r = s(1), C = s(0), T = s(!1), M = s(null), p = s(!1), O = s(0), R = s(null), L = s(""), k = s(1), Y = s(1), I = s(!1), l = s({ x: 0, y: 0 }), y = s(!1);
27
27
  let z = { x: 0, y: 0 };
28
28
  const m = s(1), v = s({ width: 0, height: 0 });
29
- I([r, C], () => {
30
- V.notify();
29
+ N([r, C], () => {
30
+ G.notify();
31
31
  }), ce({
32
32
  getToolbarGroups: () => [
33
33
  {
@@ -46,7 +46,7 @@ const Ae = {
46
46
  },
47
47
  {
48
48
  type: "button",
49
- icon: $e,
49
+ icon: Pe,
50
50
  tooltip: i.value("toolbar.zoom_in"),
51
51
  action: de,
52
52
  disabled: r.value >= 10
@@ -57,9 +57,9 @@ const Ae = {
57
57
  items: [
58
58
  {
59
59
  type: "button",
60
- icon: Pe,
60
+ icon: $e,
61
61
  tooltip: i.value("toolbar.fit_to_window"),
62
- action: G
62
+ action: Q
63
63
  },
64
64
  {
65
65
  type: "button",
@@ -89,14 +89,14 @@ const Ae = {
89
89
  items: [
90
90
  {
91
91
  type: "button",
92
- icon: Ie,
92
+ icon: Ne,
93
93
  tooltip: i.value("toolbar.reset"),
94
94
  action: ge
95
95
  }
96
96
  ]
97
97
  }
98
98
  ],
99
- onToolbarChange: (e) => V.subscribe(e)
99
+ onToolbarChange: (e) => G.subscribe(e)
100
100
  });
101
101
  const de = () => {
102
102
  r.value = Math.min(r.value + 0.1, 10);
@@ -109,20 +109,20 @@ const Ae = {
109
109
  }, me = () => {
110
110
  r.value = 1, C.value = 0, l.value = { x: 0, y: 0 };
111
111
  }, ge = () => {
112
- G();
113
- }, G = () => {
112
+ Q();
113
+ }, Q = () => {
114
114
  if (h.value && v.value.width > 0 && v.value.height > 0) {
115
115
  const e = h.value.clientWidth, t = h.value.clientHeight, a = e / v.value.width, u = t / v.value.height;
116
116
  r.value = Math.max(0.01, Math.min(10, Math.min(a, u))), l.value = { x: 0, y: 0 };
117
117
  }
118
118
  }, be = s(null), h = s(null);
119
- let S = null, W = null, $ = null;
119
+ let S = null, W = null, P = null;
120
120
  const g = /* @__PURE__ */ new Map();
121
- let P = !1, j = 0, Q = 1, N = { x: 0, y: 0 }, q = 0;
122
- I(
121
+ let $ = !1, j = 0, q = 1, V = { x: 0, y: 0 }, A = 0;
122
+ N(
123
123
  () => [f.url, f.file],
124
124
  async () => {
125
- if (B.begin(f.url), L.value = "", T.value = !1, M.value = null, p.value = !1, R.value = null, O.value = 0, l.value = { x: 0, y: 0 }, m.value = 1, r.value = 1, k.value = 1, Y.value = 1, F.value = !1, S && (URL.revokeObjectURL(S), S = null), g.forEach((e) => URL.revokeObjectURL(e)), g.clear(), W = null, $ = null, !f.file) {
125
+ if (B.begin(f.url), L.value = "", T.value = !1, M.value = null, p.value = !1, R.value = null, O.value = 0, l.value = { x: 0, y: 0 }, m.value = 1, r.value = 1, k.value = 1, Y.value = 1, I.value = !1, S && (URL.revokeObjectURL(S), S = null), g.forEach((e) => URL.revokeObjectURL(e)), g.clear(), W = null, P = null, !f.file) {
126
126
  L.value = f.url;
127
127
  return;
128
128
  }
@@ -143,7 +143,7 @@ const Ae = {
143
143
  if (!n.ok) throw new ie("file.load_failed");
144
144
  a = await n.blob();
145
145
  }
146
- if (W = a, $ = t, e.startsWith("image/x-") && (F.value = !0), t.getMetadata)
146
+ if (W = a, P = t, e.startsWith("image/x-") && (I.value = !0), t.getMetadata)
147
147
  try {
148
148
  const n = await t.getMetadata(a);
149
149
  n.pageCount && n.pageCount > 1 && (Y.value = n.pageCount);
@@ -177,8 +177,8 @@ const Ae = {
177
177
  },
178
178
  { immediate: !0 }
179
179
  );
180
- const J = async (e) => {
181
- if (!W || !$ || e < 1 || e > Y.value) return;
180
+ const K = async (e) => {
181
+ if (!W || !P || e < 1 || e > Y.value) return;
182
182
  const t = g.get(e);
183
183
  if (t) {
184
184
  k.value = e, L.value = t;
@@ -186,7 +186,7 @@ const Ae = {
186
186
  }
187
187
  p.value = !0;
188
188
  try {
189
- const a = await $.decode(W, { page: e }), u = typeof a == "string" ? a : URL.createObjectURL(a);
189
+ const a = await P.decode(W, { page: e }), u = typeof a == "string" ? a : URL.createObjectURL(a);
190
190
  if (g.size >= 10) {
191
191
  const c = g.keys().next().value;
192
192
  if (c !== void 0) {
@@ -202,10 +202,10 @@ const Ae = {
202
202
  ae(() => {
203
203
  S && URL.revokeObjectURL(S), g.forEach((t) => URL.revokeObjectURL(t)), g.clear();
204
204
  const e = h.value;
205
- e && e.removeEventListener("wheel", A);
206
- }), I(r, (e) => {
205
+ e && e.removeEventListener("wheel", F);
206
+ }), N(r, (e) => {
207
207
  m.value = e;
208
- }), I(m, (e) => {
208
+ }), N(m, (e) => {
209
209
  r.value = e;
210
210
  });
211
211
  const H = (e, t) => {
@@ -227,7 +227,7 @@ const Ae = {
227
227
  M.value = i.value("image.load_failed"), T.value = !0, B.error(new ie("image.load_failed"), "request");
228
228
  }, we = () => {
229
229
  l.value = { x: 0, y: 0 }, r.value = 1;
230
- }, A = (e) => {
230
+ }, F = (e) => {
231
231
  e.preventDefault(), e.stopPropagation();
232
232
  const t = h.value;
233
233
  if (!t) return;
@@ -242,28 +242,28 @@ const Ae = {
242
242
  };
243
243
  Ee(() => {
244
244
  const e = h.value;
245
- e && (e.addEventListener("wheel", A, { passive: !1 }), e.addEventListener("touchstart", ee, { passive: !1 }), e.addEventListener("touchmove", te, { passive: !1 }), e.addEventListener("touchend", Z), e.addEventListener("touchcancel", Z));
245
+ e && (e.addEventListener("wheel", F, { passive: !1 }), e.addEventListener("touchstart", ee, { passive: !1 }), e.addEventListener("touchmove", te, { passive: !1 }), e.addEventListener("touchend", Z), e.addEventListener("touchcancel", Z));
246
246
  }), ae(() => {
247
247
  const e = h.value;
248
- e && (e.removeEventListener("wheel", A), e.removeEventListener("touchstart", ee), e.removeEventListener("touchmove", te), e.removeEventListener("touchend", Z), e.removeEventListener("touchcancel", Z));
248
+ e && (e.removeEventListener("wheel", F), e.removeEventListener("touchstart", ee), e.removeEventListener("touchmove", te), e.removeEventListener("touchend", Z), e.removeEventListener("touchcancel", Z));
249
249
  });
250
250
  const _e = (e) => {
251
- P || e.button === 0 && (y.value = !0, z = {
251
+ $ || e.button === 0 && (y.value = !0, z = {
252
252
  x: e.clientX - l.value.x,
253
253
  y: e.clientY - l.value.y
254
254
  });
255
255
  }, Me = (e) => {
256
- P || y.value && (l.value = H(
256
+ $ || y.value && (l.value = H(
257
257
  {
258
258
  x: e.clientX - z.x,
259
259
  y: e.clientY - z.y
260
260
  },
261
261
  m.value
262
262
  ));
263
- }, K = () => {
264
- P || (y.value = !1);
263
+ }, J = () => {
264
+ $ || (y.value = !1);
265
265
  }, ee = (e) => {
266
- P = !0, e.preventDefault();
266
+ $ = !0, e.preventDefault();
267
267
  const t = e.touches;
268
268
  if (t.length === 1) {
269
269
  y.value = !0, z = {
@@ -271,11 +271,11 @@ const Ae = {
271
271
  y: t[0].clientY - l.value.y
272
272
  };
273
273
  const a = Date.now();
274
- a - q < 300 && (l.value = { x: 0, y: 0 }, r.value = 1), q = a;
274
+ a - A < 300 && (l.value = { x: 0, y: 0 }, r.value = 1), A = a;
275
275
  } else t.length === 2 && (y.value = !1, j = Math.hypot(
276
276
  t[1].clientX - t[0].clientX,
277
277
  t[1].clientY - t[0].clientY
278
- ), Q = m.value, N = { ...l.value });
278
+ ), q = m.value, V = { ...l.value });
279
279
  }, te = (e) => {
280
280
  e.preventDefault();
281
281
  const t = e.touches;
@@ -295,11 +295,11 @@ const Ae = {
295
295
  t[1].clientY - t[0].clientY
296
296
  );
297
297
  if (Math.abs(u - j) < 5) return;
298
- const c = u / j, o = Math.max(0.01, Math.min(10, Q * c)), d = a.getBoundingClientRect(), n = (t[0].clientX + t[1].clientX) / 2 - d.left - d.width / 2, x = (t[0].clientY + t[1].clientY) / 2 - d.top - d.height / 2, X = o / m.value;
298
+ const c = u / j, o = Math.max(0.01, Math.min(10, q * c)), d = a.getBoundingClientRect(), n = (t[0].clientX + t[1].clientX) / 2 - d.left - d.width / 2, x = (t[0].clientY + t[1].clientY) / 2 - d.top - d.height / 2, X = o / m.value;
299
299
  l.value = H(
300
300
  {
301
- x: n - X * (n - N.x),
302
- y: x - X * (x - N.y)
301
+ x: n - X * (n - V.x),
302
+ y: x - X * (x - V.y)
303
303
  },
304
304
  o
305
305
  ), m.value = o;
@@ -319,15 +319,15 @@ const Ae = {
319
319
  style: oe({ cursor: y.value ? "grabbing" : "grab", touchAction: "none" }),
320
320
  onMousedown: _e,
321
321
  onMousemove: Me,
322
- onMouseup: K,
323
- onMouseleave: K
322
+ onMouseup: J,
323
+ onMouseleave: J
324
324
  }, [
325
- p.value ? (w(), U("div", Ae, [
326
- _("div", Ve, [
325
+ p.value ? (w(), U("div", Fe, [
326
+ _("div", Ge, [
327
327
  t[2] || (t[2] = _("div", { class: "vfp-renderer-spinner" }, null, -1)),
328
- _("p", Fe, [
328
+ _("p", Ie, [
329
329
  Ce(b(D(i)("image.decoding")) + " ", 1),
330
- O.value > 0 ? (w(), U("span", Ge, b(Math.round(O.value)) + "%", 1)) : E("", !0)
330
+ O.value > 0 ? (w(), U("span", Qe, b(Math.round(O.value)) + "%", 1)) : E("", !0)
331
331
  ])
332
332
  ])
333
333
  ])) : E("", !0),
@@ -336,10 +336,10 @@ const Ae = {
336
336
  message: D(i)("image.decode_failed"),
337
337
  detail: R.value
338
338
  }, null, 8, ["message", "detail"])) : E("", !0),
339
- !T.value && !M.value && !p.value && !R.value ? (w(), U("div", Qe, [
340
- _("div", qe, [
339
+ !T.value && !M.value && !p.value && !R.value ? (w(), U("div", qe, [
340
+ _("div", Ae, [
341
341
  t[3] || (t[3] = _("div", { class: "vfp-renderer-spinner" }, null, -1)),
342
- _("span", Je, b(D(i)("common.loading")), 1)
342
+ _("span", Ke, b(D(i)("common.loading")), 1)
343
343
  ])
344
344
  ])) : E("", !0),
345
345
  M.value ? (w(), ne(re, {
@@ -358,21 +358,21 @@ const Ae = {
358
358
  onLoad: ye,
359
359
  onError: xe,
360
360
  onDblclick: we
361
- }, null, 46, Ke)) : E("", !0),
361
+ }, null, 46, Je)) : E("", !0),
362
362
  T.value && !M.value && v.value.width > 0 ? (w(), U("div", et, b(v.value.width) + " × " + b(v.value.height) + b(Le.value), 1)) : E("", !0),
363
363
  Y.value > 1 ? (w(), U("div", tt, [
364
364
  _("button", {
365
365
  type: "button",
366
366
  disabled: k.value <= 1 || p.value,
367
367
  class: "vfp-px-2 vfp-py-0.5 vfp-rounded hover:vfp-bg-surface-nav-hover disabled:vfp-opacity-40 disabled:vfp-cursor-not-allowed",
368
- onClick: t[0] || (t[0] = (a) => J(k.value - 1))
368
+ onClick: t[0] || (t[0] = (a) => K(k.value - 1))
369
369
  }, b(D(i)("toolbar.prev_page")), 9, at),
370
370
  _("span", lt, b(k.value) + " / " + b(Y.value), 1),
371
371
  _("button", {
372
372
  type: "button",
373
373
  disabled: k.value >= Y.value || p.value,
374
374
  class: "vfp-px-2 vfp-py-0.5 vfp-rounded hover:vfp-bg-surface-nav-hover disabled:vfp-opacity-40 disabled:vfp-cursor-not-allowed",
375
- onClick: t[1] || (t[1] = (a) => J(k.value + 1))
375
+ onClick: t[1] || (t[1] = (a) => K(k.value + 1))
376
376
  }, b(D(i)("toolbar.next_page")), 9, ot)
377
377
  ])) : E("", !0)
378
378
  ], 36));
@@ -14,7 +14,7 @@ var _t = (u, e, t, s) => ({
14
14
  }
15
15
  });
16
16
  import { defineComponent as _b, ref as si, watch as aa, nextTick as wu, onMounted as Gb, onBeforeUnmount as zb, openBlock as zh, createElementBlock as Eu, normalizeStyle as Ep, createElementVNode as ii, toDisplayString as Pm, unref as Sp, createVNode as Vb, createCommentVNode as Su, createBlock as Wb } from "vue";
17
- import { v as Xb, u as Yb, b as Kb, O as Mm, r as Jb } from "./index-B5hprvcF.mjs";
17
+ import { $ as Xb, u as Yb, b as Kb, I as Mm, M as Jb } from "./index-BKpp6GvN.mjs";
18
18
  import { _ as Qb } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
19
19
  import { X as Zb, Menu as qb, ChevronLeft as tA, ChevronRight as eA, ZoomOut as sA, ZoomIn as iA, RefreshCw as nA } from "lucide-vue-next";
20
20
  import { T as rA } from "./base.types-DaftHyg7.mjs";
@@ -1,6 +1,6 @@
1
- import { defineComponent as h, ref as c, onMounted as w, watch as x, onBeforeUnmount as E, openBlock as f, createBlock as C, createElementBlock as _, createElementVNode as a, toDisplayString as B, unref as D, createCommentVNode as P } from "vue";
1
+ import { defineComponent as h, ref as c, onMounted as w, watch as x, onBeforeUnmount as E, openBlock as f, createBlock as C, createElementBlock as _, createElementVNode as a, toDisplayString as D, unref as P, createCommentVNode as B } from "vue";
2
2
  import N from "video.js";
3
- import { u as R, b as S, B as y } from "./index-B5hprvcF.mjs";
3
+ import { u as R, b as S, x as y } from "./index-BKpp6GvN.mjs";
4
4
  import { _ as U } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
5
5
  const V = {
6
6
  key: 1,
@@ -100,9 +100,9 @@ const V = {
100
100
  d.value ? (f(), _("div", q, [
101
101
  a("div", L, [
102
102
  r[0] || (r[0] = a("div", { class: "vfp-renderer-spinner" }, null, -1)),
103
- a("p", G, B(D(t)("video.loading")), 1)
103
+ a("p", G, D(P(t)("video.loading")), 1)
104
104
  ])
105
- ])) : P("", !0),
105
+ ])) : B("", !0),
106
106
  a("div", {
107
107
  ref_key: "videoContainerRef",
108
108
  ref: p,