@eternalheart/vue-file-preview 1.7.0 → 1.7.1
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.
- package/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/lib/FilePreviewContent.vue.d.ts +9 -1
- package/lib/FilePreviewEmbed.vue.d.ts +6 -1
- package/lib/FilePreviewModal.vue.d.ts +6 -1
- package/lib/chunks/{EmptyState.vue_vue_type_script_setup_true_lang--ZOobbGi.mjs → EmptyState.vue_vue_type_script_setup_true_lang-DSQp7H-K.mjs} +1 -1
- package/lib/chunks/{avifLoader-CAUzjn-d-CnJpGYJ2.mjs → avifLoader-CAUzjn-d-Cf00sjt2.mjs} +1 -1
- package/lib/chunks/{heicLoader-D_9PukkA-g_dLrWLP.mjs → heicLoader-D_9PukkA-cn1P7b2x.mjs} +1 -1
- package/lib/chunks/{index-C8lyQPe3.mjs → index-0VXtKKev.mjs} +3 -3
- package/lib/chunks/index-0fXL30y0.mjs +333 -0
- package/lib/chunks/{index-CWPdNhoe.mjs → index-B1AwVHWI.mjs} +60 -60
- package/lib/chunks/{index-C4hIk6pa.mjs → index-B77rFiau.mjs} +2 -2
- package/lib/chunks/{index-BzwJ0VWu.mjs → index-BB10as16.mjs} +33 -33
- package/lib/chunks/{index-BfOWoMpY.mjs → index-BBIn-k4u.mjs} +77 -77
- package/lib/chunks/{index-6XZXYqbp.mjs → index-BSzaI9ea.mjs} +29 -32
- package/lib/chunks/{index-Bg8poMIm.mjs → index-BZvy39tn.mjs} +29 -29
- package/lib/chunks/{index-zLQlyNR2.mjs → index-BlJEM2Lb.mjs} +62 -62
- package/lib/chunks/{index-z9RqL2wI.mjs → index-CZlnxQFA.mjs} +453 -453
- package/lib/chunks/{index-BPSzwMOC.mjs → index-ClhTPqDI.mjs} +46 -46
- package/lib/chunks/{index-Bf94DwQu.mjs → index-D690gnNu.mjs} +24 -24
- package/lib/chunks/index-D7WykPYL.mjs +51 -0
- package/lib/chunks/{index-c-pYJEmH.mjs → index-DBzyeU0G.mjs} +1028 -989
- package/lib/chunks/{index-LPGxJDnT.mjs → index-DKFX5ToE.mjs} +18 -18
- package/lib/chunks/{index-aKiIuKKx.mjs → index-DRmKaFXK.mjs} +50 -50
- package/lib/chunks/{index-D5IF9F-D.mjs → index-DXf3wXT5.mjs} +22 -22
- package/lib/chunks/{index-CrVQPnFj.mjs → index-Dp7QQjNH.mjs} +18 -18
- package/lib/chunks/{index-BYQ9S7Mk.mjs → index-FzI__DHC.mjs} +30 -30
- package/lib/chunks/{index-DZe0BxAB.mjs → index-PWjCziZG.mjs} +20 -20
- package/lib/chunks/{index-DM8Dfl-m.mjs → index-bT6XWKO_.mjs} +15 -15
- package/lib/chunks/{index-DFeKS8tR.mjs → index-tX9VR6Vo.mjs} +22 -22
- package/lib/chunks/{jp2Loader-Dig19xyo-fCO1knZ0.mjs → jp2Loader-Dig19xyo-D-OEDL3n.mjs} +1 -1
- package/lib/chunks/{psdLoader-C0tKUXXl-DihMskai.mjs → psdLoader-C0tKUXXl-CVN06LUc.mjs} +1 -1
- package/lib/chunks/{rawLoader-C-tPeFAB-BSfDPl-z.mjs → rawLoader-C-tPeFAB-DBqcJPFK.mjs} +1 -1
- package/lib/chunks/{tiffLoader-BlhByX8w-JY5DaTre.mjs → tiffLoader-BlhByX8w-8-0icdyL.mjs} +1 -1
- package/lib/chunks/{useShikiHighlight-C-ztcJBE.mjs → useShikiHighlight-a_GUszuU.mjs} +1 -1
- package/lib/composables/usePreviewEvents.d.ts +2 -2
- package/lib/core/events.d.ts +18 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/index.cjs +48 -48
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.mjs +5 -5
- package/package.json +1 -1
- package/lib/chunks/index-C41YET0_.mjs +0 -51
- package/lib/chunks/index-GFcSJEwj.mjs +0 -330
|
@@ -1,11 +1,11 @@
|
|
|
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
|
|
2
|
-
import { u as te, a as ie, b as ue,
|
|
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-DBzyeU0G.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
|
|
4
|
+
import { _ as re } from "./EmptyState.vue_vue_type_script_setup_true_lang-DSQp7H-K.mjs";
|
|
5
5
|
import { ChevronDown as ae, ChevronRight as me } from "lucide-vue-next";
|
|
6
6
|
function be(e, o = !1) {
|
|
7
|
-
const
|
|
8
|
-
let n = 0, t = "",
|
|
7
|
+
const f = e.length;
|
|
8
|
+
let n = 0, t = "", s = 0, i = 16, m = 0, p = 0, v = 0, y = 0, a = 0;
|
|
9
9
|
function _(l, T) {
|
|
10
10
|
let w = 0, k = 0;
|
|
11
11
|
for (; w < l; ) {
|
|
@@ -23,7 +23,7 @@ function be(e, o = !1) {
|
|
|
23
23
|
return w < l && (k = -1), k;
|
|
24
24
|
}
|
|
25
25
|
function b(l) {
|
|
26
|
-
n = l, t = "",
|
|
26
|
+
n = l, t = "", s = 0, i = 16, a = 0;
|
|
27
27
|
}
|
|
28
28
|
function O() {
|
|
29
29
|
let l = n;
|
|
@@ -51,7 +51,7 @@ function be(e, o = !1) {
|
|
|
51
51
|
function L() {
|
|
52
52
|
let l = "", T = n;
|
|
53
53
|
for (; ; ) {
|
|
54
|
-
if (n >=
|
|
54
|
+
if (n >= f) {
|
|
55
55
|
l += e.substring(T, n), a = 2;
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
@@ -61,7 +61,7 @@ function be(e, o = !1) {
|
|
|
61
61
|
break;
|
|
62
62
|
}
|
|
63
63
|
if (w === 92) {
|
|
64
|
-
if (l += e.substring(T, n), n++, n >=
|
|
64
|
+
if (l += e.substring(T, n), n++, n >= f) {
|
|
65
65
|
a = 2;
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
@@ -112,8 +112,8 @@ function be(e, o = !1) {
|
|
|
112
112
|
return l;
|
|
113
113
|
}
|
|
114
114
|
function A() {
|
|
115
|
-
if (t = "", a = 0,
|
|
116
|
-
return
|
|
115
|
+
if (t = "", a = 0, s = n, p = m, y = v, n >= f)
|
|
116
|
+
return s = f, i = 17;
|
|
117
117
|
let l = e.charCodeAt(n);
|
|
118
118
|
if (D(l)) {
|
|
119
119
|
do
|
|
@@ -142,13 +142,13 @@ function be(e, o = !1) {
|
|
|
142
142
|
case 47:
|
|
143
143
|
const T = n - 1;
|
|
144
144
|
if (e.charCodeAt(n + 1) === 47) {
|
|
145
|
-
for (n += 2; n <
|
|
145
|
+
for (n += 2; n < f && !E(e.charCodeAt(n)); )
|
|
146
146
|
n++;
|
|
147
147
|
return t = e.substring(T, n), i = 12;
|
|
148
148
|
}
|
|
149
149
|
if (e.charCodeAt(n + 1) === 42) {
|
|
150
150
|
n += 2;
|
|
151
|
-
const w =
|
|
151
|
+
const w = f - 1;
|
|
152
152
|
let k = !1;
|
|
153
153
|
for (; n < w; ) {
|
|
154
154
|
const u = e.charCodeAt(n);
|
|
@@ -162,7 +162,7 @@ function be(e, o = !1) {
|
|
|
162
162
|
}
|
|
163
163
|
return t += String.fromCharCode(l), n++, i = 16;
|
|
164
164
|
case 45:
|
|
165
|
-
if (t += String.fromCharCode(l), n++, n ===
|
|
165
|
+
if (t += String.fromCharCode(l), n++, n === f || !B(e.charCodeAt(n)))
|
|
166
166
|
return i = 16;
|
|
167
167
|
case 48:
|
|
168
168
|
case 49:
|
|
@@ -176,10 +176,10 @@ function be(e, o = !1) {
|
|
|
176
176
|
case 57:
|
|
177
177
|
return t += O(), i = 11;
|
|
178
178
|
default:
|
|
179
|
-
for (; n <
|
|
179
|
+
for (; n < f && N(l); )
|
|
180
180
|
n++, l = e.charCodeAt(n);
|
|
181
|
-
if (
|
|
182
|
-
switch (t = e.substring(
|
|
181
|
+
if (s !== n) {
|
|
182
|
+
switch (t = e.substring(s, n), t) {
|
|
183
183
|
case "true":
|
|
184
184
|
return i = 8;
|
|
185
185
|
case "false":
|
|
@@ -221,10 +221,10 @@ function be(e, o = !1) {
|
|
|
221
221
|
scan: o ? d : A,
|
|
222
222
|
getToken: () => i,
|
|
223
223
|
getTokenValue: () => t,
|
|
224
|
-
getTokenOffset: () =>
|
|
225
|
-
getTokenLength: () => n -
|
|
224
|
+
getTokenOffset: () => s,
|
|
225
|
+
getTokenLength: () => n - s,
|
|
226
226
|
getTokenStartLine: () => p,
|
|
227
|
-
getTokenStartCharacter: () =>
|
|
227
|
+
getTokenStartCharacter: () => s - y,
|
|
228
228
|
getTokenError: () => a
|
|
229
229
|
};
|
|
230
230
|
}
|
|
@@ -237,69 +237,69 @@ function E(e) {
|
|
|
237
237
|
function B(e) {
|
|
238
238
|
return e >= 48 && e <= 57;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var Y;
|
|
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
|
-
})(
|
|
243
|
+
})(Y || (Y = {}));
|
|
244
244
|
var I;
|
|
245
245
|
(function(e) {
|
|
246
246
|
e.DEFAULT = {
|
|
247
247
|
allowTrailingComma: !1
|
|
248
248
|
};
|
|
249
249
|
})(I || (I = {}));
|
|
250
|
-
function Te(e, o = [],
|
|
250
|
+
function Te(e, o = [], f = I.DEFAULT) {
|
|
251
251
|
let n = null, t = [];
|
|
252
|
-
const
|
|
252
|
+
const s = [];
|
|
253
253
|
function i(p) {
|
|
254
254
|
Array.isArray(t) ? t.push(p) : n !== null && (t[n] = p);
|
|
255
255
|
}
|
|
256
256
|
return ve(e, {
|
|
257
257
|
onObjectBegin: () => {
|
|
258
258
|
const p = {};
|
|
259
|
-
i(p),
|
|
259
|
+
i(p), s.push(t), t = p, n = null;
|
|
260
260
|
},
|
|
261
261
|
onObjectProperty: (p) => {
|
|
262
262
|
n = p;
|
|
263
263
|
},
|
|
264
264
|
onObjectEnd: () => {
|
|
265
|
-
t =
|
|
265
|
+
t = s.pop();
|
|
266
266
|
},
|
|
267
267
|
onArrayBegin: () => {
|
|
268
268
|
const p = [];
|
|
269
|
-
i(p),
|
|
269
|
+
i(p), s.push(t), t = p, n = null;
|
|
270
270
|
},
|
|
271
271
|
onArrayEnd: () => {
|
|
272
|
-
t =
|
|
272
|
+
t = s.pop();
|
|
273
273
|
},
|
|
274
274
|
onLiteralValue: i,
|
|
275
275
|
onError: (p, v, y) => {
|
|
276
276
|
o.push({ error: p, offset: v, length: y });
|
|
277
277
|
}
|
|
278
|
-
},
|
|
278
|
+
}, f), t[0];
|
|
279
279
|
}
|
|
280
|
-
function ve(e, o,
|
|
280
|
+
function ve(e, o, f = I.DEFAULT) {
|
|
281
281
|
const n = be(e, !1), t = [];
|
|
282
|
-
let
|
|
282
|
+
let s = 0;
|
|
283
283
|
function i(c) {
|
|
284
|
-
return c ? () =>
|
|
284
|
+
return c ? () => s === 0 && c(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
|
|
285
285
|
}
|
|
286
286
|
function m(c) {
|
|
287
|
-
return c ? (r) =>
|
|
287
|
+
return c ? (r) => s === 0 && c(r, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
|
|
288
288
|
}
|
|
289
289
|
function p(c) {
|
|
290
|
-
return c ? (r) =>
|
|
290
|
+
return c ? (r) => s === 0 && c(r, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => t.slice()) : () => !0;
|
|
291
291
|
}
|
|
292
292
|
function v(c) {
|
|
293
293
|
return c ? () => {
|
|
294
|
-
|
|
294
|
+
s > 0 ? s++ : c(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => t.slice()) === !1 && (s = 1);
|
|
295
295
|
} : () => !0;
|
|
296
296
|
}
|
|
297
297
|
function y(c) {
|
|
298
298
|
return c ? () => {
|
|
299
|
-
|
|
299
|
+
s > 0 && s--, s === 0 && c(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
|
|
300
300
|
} : () => !0;
|
|
301
301
|
}
|
|
302
|
-
const a = v(o.onObjectBegin), _ = p(o.onObjectProperty), b = y(o.onObjectEnd), O = v(o.onArrayBegin), L = y(o.onArrayEnd), A = p(o.onLiteralValue), N = m(o.onSeparator), d = i(o.onComment), l = m(o.onError), T =
|
|
302
|
+
const a = v(o.onObjectBegin), _ = p(o.onObjectProperty), b = y(o.onObjectEnd), O = v(o.onArrayBegin), L = y(o.onArrayEnd), A = p(o.onLiteralValue), N = m(o.onSeparator), d = i(o.onComment), l = m(o.onError), T = f && f.disallowComments, w = f && f.allowTrailingComma;
|
|
303
303
|
function k() {
|
|
304
304
|
for (; ; ) {
|
|
305
305
|
const c = n.scan();
|
|
@@ -469,21 +469,21 @@ function ve(e, o, s = I.DEFAULT) {
|
|
|
469
469
|
return P();
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
return k(), n.getToken() === 17 ?
|
|
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
|
|
474
|
+
var z;
|
|
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
|
-
})(
|
|
478
|
-
var
|
|
477
|
+
})(z || (z = {}));
|
|
478
|
+
var M;
|
|
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
|
-
})(
|
|
481
|
+
})(M || (M = {}));
|
|
482
482
|
const we = Te;
|
|
483
|
-
var
|
|
483
|
+
var X;
|
|
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
|
-
})(
|
|
486
|
+
})(X || (X = {}));
|
|
487
487
|
const ye = {
|
|
488
488
|
key: 0,
|
|
489
489
|
class: "vfp-renderer-loading"
|
|
@@ -518,8 +518,8 @@ 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
|
|
522
|
-
return g("div", { class: "json-row", style: { paddingLeft: `${
|
|
521
|
+
function Z(e, o, f, n, t) {
|
|
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 } }, [
|
|
525
525
|
`"${e}"`,
|
|
@@ -537,18 +537,18 @@ const H = J({
|
|
|
537
537
|
defaultExpanded: { type: Boolean, default: !1 }
|
|
538
538
|
},
|
|
539
539
|
setup(e) {
|
|
540
|
-
const o = U(e.defaultExpanded),
|
|
540
|
+
const o = U(e.defaultExpanded), f = () => {
|
|
541
541
|
o.value = !o.value;
|
|
542
|
-
}, n = le(ce, null), t =
|
|
543
|
-
return { expanded: o, toggle:
|
|
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));
|
|
543
|
+
return { expanded: o, toggle: f, tFunc: t, colors: i };
|
|
544
544
|
},
|
|
545
545
|
render() {
|
|
546
|
-
const { keyName: e, value: o, depth:
|
|
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
|
|
548
|
+
return Z(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
|
|
551
|
+
return Z(e, null, m, i, `${a}${_}`);
|
|
552
552
|
const b = [];
|
|
553
553
|
return b.push(
|
|
554
554
|
g("div", {
|
|
@@ -565,17 +565,17 @@ const H = J({
|
|
|
565
565
|
]) : null,
|
|
566
566
|
g("span", { style: { color: i.bracket } }, a),
|
|
567
567
|
n ? null : g("span", { class: "json-collapsed", style: { color: i.collapsed } }, [
|
|
568
|
-
p ? `${y} ${
|
|
568
|
+
p ? `${y} ${s("json.items")}` : `${y} ${s("json.keys")}`,
|
|
569
569
|
g("span", { style: { color: i.bracket } }, ` ${_}`)
|
|
570
570
|
])
|
|
571
571
|
])
|
|
572
572
|
), n && (p ? o.forEach((O, L) => {
|
|
573
573
|
b.push(
|
|
574
|
-
g(H, { key: L, value: O, depth:
|
|
574
|
+
g(H, { 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:
|
|
578
|
+
g(H, { 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` } }, [
|
|
@@ -591,14 +591,14 @@ const H = J({
|
|
|
591
591
|
emptyHint: {}
|
|
592
592
|
},
|
|
593
593
|
setup(e, { expose: o }) {
|
|
594
|
-
const
|
|
595
|
-
return C(() =>
|
|
596
|
-
|
|
594
|
+
const f = e, { t: n } = te(), t = ie(), s = ue(), i = U(null), m = U(!1), p = U(!0), v = U(null), y = () => oe(f.emptyHint, "textual");
|
|
595
|
+
return C(() => f.url, async () => {
|
|
596
|
+
s.begin(f.url), p.value = !0, v.value = null;
|
|
597
597
|
try {
|
|
598
|
-
const b = await se(
|
|
599
|
-
m.value = fe(b), i.value = m.value ? null : we(b);
|
|
598
|
+
const b = await se(f.url, { fetcher: t.value });
|
|
599
|
+
m.value = fe(b), i.value = m.value ? null : we(b), s.ready();
|
|
600
600
|
} catch (b) {
|
|
601
|
-
console.error(b), v.value = n.value("json.load_failed"),
|
|
601
|
+
console.error(b), v.value = n.value("json.load_failed"), s.error(b);
|
|
602
602
|
} finally {
|
|
603
603
|
p.value = !1;
|
|
604
604
|
}
|
|
@@ -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 {
|
|
17
|
+
import { v as Xb, u as Yb, b as Kb, O as Mm, r as Jb } from "./index-DBzyeU0G.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";
|
|
@@ -22011,7 +22011,7 @@ const ew = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
22011
22011
|
viewport: F,
|
|
22012
22012
|
transform: z === 1 ? void 0 : [z, 0, 0, z, 0, 0]
|
|
22013
22013
|
});
|
|
22014
|
-
O.renderTask = q, await q.promise, O.element.innerHTML = "", O.element.appendChild(Z), O.rendered = !0, B === 1 && (m.value = !0);
|
|
22014
|
+
O.renderTask = q, await q.promise, O.element.innerHTML = "", O.element.appendChild(Z), O.rendered = !0, B === 1 && (m.value = !0, o.ready());
|
|
22015
22015
|
} catch (R) {
|
|
22016
22016
|
(R == null ? void 0 : R.name) !== "RenderingCancelledException" && (console.error(a.value("pdf.page_render_failed", { page: B }) + ":", R), o.error(R, "render"));
|
|
22017
22017
|
} finally {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
1
|
+
import { defineComponent as $, ref as o, watch as w, nextTick as B, computed as T, openBlock as i, createElementBlock as p, createElementVNode as l, toDisplayString as N, unref as I, createBlock as F, normalizeStyle as d, Fragment as V, renderList as C } from "vue";
|
|
2
|
+
import { u as R, a as j, b as q, V as z, J, c as O, n as U } from "./index-DBzyeU0G.mjs";
|
|
3
3
|
import W from "mammoth";
|
|
4
4
|
import { _ as X } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
|
|
5
5
|
const Y = {
|
|
@@ -9,55 +9,55 @@ const Y = {
|
|
|
9
9
|
key: 2,
|
|
10
10
|
class: "vfp-docx-container vfp-w-full vfp-h-full vfp-overflow-auto",
|
|
11
11
|
style: { background: "rgba(0, 0, 0, 0.15)" }
|
|
12
|
-
}, ee = ["innerHTML"], te = ["innerHTML"], b = 1123, k = 60, E = 50, ne = 24, ie = /* @__PURE__ */
|
|
12
|
+
}, ee = ["innerHTML"], te = ["innerHTML"], b = 1123, k = 60, E = 50, ne = 24, ie = /* @__PURE__ */ $({
|
|
13
13
|
__name: "index",
|
|
14
14
|
props: {
|
|
15
15
|
url: {}
|
|
16
16
|
},
|
|
17
17
|
setup(G, { expose: H }) {
|
|
18
|
-
const P = b - k * 2,
|
|
19
|
-
|
|
18
|
+
const P = b - k * 2, v = G, { t: f } = R(), A = j(), m = q(), a = o(""), h = o(!0), c = o(null), s = o([]), _ = o({}), g = o(null), S = async () => {
|
|
19
|
+
m.begin(v.url), h.value = !0, c.value = null, a.value = "", s.value = [], _.value = {};
|
|
20
20
|
try {
|
|
21
|
-
const e = await A.value(
|
|
22
|
-
if (!e.ok) throw new
|
|
23
|
-
const n = await e.arrayBuffer(), [t,
|
|
24
|
-
W.convertToHtml({ arrayBuffer: n }, { styleMap:
|
|
25
|
-
|
|
21
|
+
const e = await A.value(v.url);
|
|
22
|
+
if (!e.ok) throw new J("file.load_failed");
|
|
23
|
+
const n = await e.arrayBuffer(), [t, r] = await Promise.all([
|
|
24
|
+
W.convertToHtml({ arrayBuffer: n }, { styleMap: O }),
|
|
25
|
+
U(n).catch(() => ({}))
|
|
26
26
|
]);
|
|
27
|
-
|
|
27
|
+
_.value = r, a.value = t.value, m.ready();
|
|
28
28
|
} catch (e) {
|
|
29
|
-
console.error(
|
|
29
|
+
console.error(f.value("docx.parse_failed") + ":", e), c.value = f.value("docx.parse_failed"), m.error(e);
|
|
30
30
|
} finally {
|
|
31
|
-
|
|
31
|
+
h.value = !1;
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, D = () => {
|
|
34
34
|
const e = g.value;
|
|
35
|
-
if (!e || !
|
|
35
|
+
if (!e || !a.value) return;
|
|
36
36
|
const n = Array.from(e.children);
|
|
37
37
|
if (n.length === 0) {
|
|
38
|
-
s.value = [
|
|
38
|
+
s.value = [a.value];
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
const t = [[]];
|
|
42
|
-
let
|
|
42
|
+
let r = 0;
|
|
43
43
|
for (const u of n) {
|
|
44
44
|
const y = u.offsetHeight;
|
|
45
|
-
|
|
45
|
+
r > 0 && r + y > P && (t.push([]), r = 0), t[t.length - 1].push(u.outerHTML), r += y;
|
|
46
46
|
}
|
|
47
47
|
t.length === 0 && t.push([]), s.value = t.map((u) => u.join(""));
|
|
48
48
|
};
|
|
49
|
-
w(() =>
|
|
49
|
+
w(() => v.url, (e) => {
|
|
50
50
|
e && S();
|
|
51
|
-
}, { immediate: !0 }), w(
|
|
52
|
-
|
|
51
|
+
}, { immediate: !0 }), w(a, async () => {
|
|
52
|
+
a.value && (await B(), requestAnimationFrame(() => D()));
|
|
53
53
|
});
|
|
54
|
-
const x = T(() =>
|
|
54
|
+
const x = T(() => z(_.value)), L = T(() => ({
|
|
55
55
|
...x.value,
|
|
56
56
|
position: "absolute",
|
|
57
57
|
visibility: "hidden",
|
|
58
58
|
width: `${794 - E * 2}px`,
|
|
59
59
|
pointerEvents: "none"
|
|
60
|
-
})),
|
|
60
|
+
})), M = {
|
|
61
61
|
width: "100%",
|
|
62
62
|
maxWidth: "794px",
|
|
63
63
|
minHeight: `${b}px`,
|
|
@@ -68,10 +68,10 @@ const Y = {
|
|
|
68
68
|
};
|
|
69
69
|
return H({
|
|
70
70
|
getToolbarGroups: () => []
|
|
71
|
-
}), (e, n) =>
|
|
71
|
+
}), (e, n) => h.value ? (i(), p("div", Y, [
|
|
72
72
|
l("div", K, [
|
|
73
73
|
n[0] || (n[0] = l("div", { class: "vfp-renderer-spinner" }, null, -1)),
|
|
74
|
-
l("span", Q,
|
|
74
|
+
l("span", Q, N(I(f)("common.loading")), 1)
|
|
75
75
|
])
|
|
76
76
|
])) : c.value ? (i(), F(X, {
|
|
77
77
|
key: 1,
|
|
@@ -80,22 +80,22 @@ const Y = {
|
|
|
80
80
|
l("div", {
|
|
81
81
|
ref_key: "measureRef",
|
|
82
82
|
ref: g,
|
|
83
|
-
style:
|
|
84
|
-
innerHTML:
|
|
83
|
+
style: d(L.value),
|
|
84
|
+
innerHTML: a.value
|
|
85
85
|
}, null, 12, ee),
|
|
86
86
|
l("div", {
|
|
87
87
|
class: "vfp-flex vfp-flex-col vfp-items-center",
|
|
88
|
-
style:
|
|
88
|
+
style: d({ gap: `${ne}px` })
|
|
89
89
|
}, [
|
|
90
|
-
(i(!0), p(
|
|
91
|
-
key:
|
|
92
|
-
style:
|
|
93
|
-
...
|
|
90
|
+
(i(!0), p(V, null, C(s.value.length > 0 ? s.value : [""], (t, r) => (i(), p("div", {
|
|
91
|
+
key: r,
|
|
92
|
+
style: d({
|
|
93
|
+
...M,
|
|
94
94
|
boxShadow: "0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.10)"
|
|
95
95
|
})
|
|
96
96
|
}, [
|
|
97
97
|
l("div", {
|
|
98
|
-
style:
|
|
98
|
+
style: d(x.value),
|
|
99
99
|
innerHTML: t
|
|
100
100
|
}, null, 12, te)
|
|
101
101
|
], 4))), 128))
|