v-code-diff 1.5.0 → 1.5.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 +1 -1
- package/dist/v2/index.cjs.js +11 -11
- package/dist/v2/index.es.js +88 -88
- package/dist/v2/index.umd.js +10 -10
- package/dist/v2.7/index.cjs.js +3 -3
- package/dist/v2.7/index.es.js +6 -6
- package/dist/v2.7/index.umd.js +3 -3
- package/dist/v3/index.cjs.js +3 -3
- package/dist/v3/index.es.js +6 -6
- package/dist/v3/index.umd.js +3 -3
- package/package.json +1 -1
- package/src/CodeDiff.vue +8 -4
package/dist/v2/index.es.js
CHANGED
|
@@ -311,10 +311,10 @@ var ce = {}, Vn = {
|
|
|
311
311
|
for (var s = t.length, o = r.length, l = Math.ceil((s + o) / 2), c = l, f = 2 * l, g = new Array(f), d = new Array(f), p = 0; p < f; p++)
|
|
312
312
|
g[p] = -1, d[p] = -1;
|
|
313
313
|
g[c + 1] = 0, d[c + 1] = 0;
|
|
314
|
-
for (var _ = s - o, v = _ % 2 != 0, E = 0, w = 0, m = 0, T = 0,
|
|
315
|
-
for (var N = -
|
|
314
|
+
for (var _ = s - o, v = _ % 2 != 0, E = 0, w = 0, m = 0, T = 0, D = 0; D < l && !(new Date().getTime() > i); D++) {
|
|
315
|
+
for (var N = -D + E; N <= D - w; N += 2) {
|
|
316
316
|
var I = c + N, R;
|
|
317
|
-
N == -
|
|
317
|
+
N == -D || N != D && g[I - 1] < g[I + 1] ? R = g[I + 1] : R = g[I - 1] + 1;
|
|
318
318
|
for (var H = R - N; R < s && H < o && t.charAt(R) == r.charAt(H); )
|
|
319
319
|
R++, H++;
|
|
320
320
|
if (g[I] = R, R > s)
|
|
@@ -330,9 +330,9 @@ var ce = {}, Vn = {
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
for (var F = -
|
|
333
|
+
for (var F = -D + m; F <= D - T; F += 2) {
|
|
334
334
|
var U = c + F, $;
|
|
335
|
-
F == -
|
|
335
|
+
F == -D || F != D && d[U - 1] < d[U + 1] ? $ = d[U + 1] : $ = d[U - 1] + 1;
|
|
336
336
|
for (var G = $ - F; $ < s && G < o && t.charAt(s - $ - 1) == r.charAt(o - G - 1); )
|
|
337
337
|
$++, G++;
|
|
338
338
|
if (d[U] = $, $ > s)
|
|
@@ -412,7 +412,7 @@ var ce = {}, Vn = {
|
|
|
412
412
|
return null;
|
|
413
413
|
var o = this;
|
|
414
414
|
function l(w, m, T) {
|
|
415
|
-
for (var
|
|
415
|
+
for (var D = w.substring(T, T + Math.floor(w.length / 4)), N = -1, I = "", R, H, U, $; (N = m.indexOf(D, N + 1)) != -1; ) {
|
|
416
416
|
var F = o.diff_commonPrefix(
|
|
417
417
|
w.substring(T),
|
|
418
418
|
m.substring(N)
|
|
@@ -473,8 +473,8 @@ var ce = {}, Vn = {
|
|
|
473
473
|
function r(E, w) {
|
|
474
474
|
if (!E || !w)
|
|
475
475
|
return 6;
|
|
476
|
-
var m = E.charAt(E.length - 1), T = w.charAt(0),
|
|
477
|
-
return $ || F ? 5 : H || U ? 4 :
|
|
476
|
+
var m = E.charAt(E.length - 1), T = w.charAt(0), D = m.match(n.nonAlphaNumericRegex_), N = T.match(n.nonAlphaNumericRegex_), I = D && m.match(n.whitespaceRegex_), R = N && T.match(n.whitespaceRegex_), H = I && m.match(n.linebreakRegex_), U = R && T.match(n.linebreakRegex_), $ = H && E.match(n.blanklineEndRegex_), F = U && w.match(n.blanklineStartRegex_);
|
|
477
|
+
return $ || F ? 5 : H || U ? 4 : D && !I && R ? 3 : I || R ? 2 : D || N ? 1 : 0;
|
|
478
478
|
}
|
|
479
479
|
for (var i = 1; i < t.length - 1; ) {
|
|
480
480
|
if (t[i - 1][0] == h && t[i + 1][0] == h) {
|
|
@@ -638,12 +638,12 @@ var ce = {}, Vn = {
|
|
|
638
638
|
_ = p;
|
|
639
639
|
var w = Math.max(1, i - p + 1), m = Math.min(i + p, t.length) + r.length, T = Array(m + 2);
|
|
640
640
|
T[m + 1] = (1 << E) - 1;
|
|
641
|
-
for (var
|
|
642
|
-
var N = s[t.charAt(
|
|
643
|
-
if (E === 0 ? T[
|
|
644
|
-
var I = l(E,
|
|
641
|
+
for (var D = m; D >= w; D--) {
|
|
642
|
+
var N = s[t.charAt(D - 1)];
|
|
643
|
+
if (E === 0 ? T[D] = (T[D + 1] << 1 | 1) & N : T[D] = (T[D + 1] << 1 | 1) & N | ((v[D + 1] | v[D]) << 1 | 1) | v[D + 1], T[D] & g) {
|
|
644
|
+
var I = l(E, D - 1);
|
|
645
645
|
if (I <= c)
|
|
646
|
-
if (c = I, f =
|
|
646
|
+
if (c = I, f = D - 1, f > i)
|
|
647
647
|
w = Math.max(1, 2 * i - f);
|
|
648
648
|
else
|
|
649
649
|
break;
|
|
@@ -1304,14 +1304,14 @@ function At(e, n) {
|
|
|
1304
1304
|
function Tt(e, n) {
|
|
1305
1305
|
Array.isArray(e.illegal) && (e.illegal = Fe(...e.illegal));
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1307
|
+
function Dt(e, n) {
|
|
1308
1308
|
if (e.match) {
|
|
1309
1309
|
if (e.begin || e.end)
|
|
1310
1310
|
throw new Error("begin & end are not supported with match");
|
|
1311
1311
|
e.begin = e.match, delete e.match;
|
|
1312
1312
|
}
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function St(e, n) {
|
|
1315
1315
|
e.relevance === void 0 && (e.relevance = 1);
|
|
1316
1316
|
}
|
|
1317
1317
|
const Rt = (e, n) => {
|
|
@@ -1371,7 +1371,7 @@ const nn = {}, ie = (e) => {
|
|
|
1371
1371
|
console.log(`WARN: ${e}`, ...n);
|
|
1372
1372
|
}, ae = (e, n) => {
|
|
1373
1373
|
nn[`${e}/${n}`] || (console.log(`Deprecated as of ${e}. ${n}`), nn[`${e}/${n}`] = !0);
|
|
1374
|
-
},
|
|
1374
|
+
}, De = new Error();
|
|
1375
1375
|
function wn(e, n, { key: a }) {
|
|
1376
1376
|
let u = 0;
|
|
1377
1377
|
const h = e[a], t = {}, r = {};
|
|
@@ -1382,18 +1382,18 @@ function wn(e, n, { key: a }) {
|
|
|
1382
1382
|
function kt(e) {
|
|
1383
1383
|
if (Array.isArray(e.begin)) {
|
|
1384
1384
|
if (e.skip || e.excludeBegin || e.returnBegin)
|
|
1385
|
-
throw ie("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),
|
|
1385
|
+
throw ie("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), De;
|
|
1386
1386
|
if (typeof e.beginScope != "object" || e.beginScope === null)
|
|
1387
|
-
throw ie("beginScope must be object"),
|
|
1387
|
+
throw ie("beginScope must be object"), De;
|
|
1388
1388
|
wn(e, e.begin, { key: "beginScope" }), e.begin = ze(e.begin, { joinWith: "" });
|
|
1389
1389
|
}
|
|
1390
1390
|
}
|
|
1391
1391
|
function Bt(e) {
|
|
1392
1392
|
if (Array.isArray(e.end)) {
|
|
1393
1393
|
if (e.skip || e.excludeEnd || e.returnEnd)
|
|
1394
|
-
throw ie("skip, excludeEnd, returnEnd not compatible with endScope: {}"),
|
|
1394
|
+
throw ie("skip, excludeEnd, returnEnd not compatible with endScope: {}"), De;
|
|
1395
1395
|
if (typeof e.endScope != "object" || e.endScope === null)
|
|
1396
|
-
throw ie("endScope must be object"),
|
|
1396
|
+
throw ie("endScope must be object"), De;
|
|
1397
1397
|
wn(e, e.end, { key: "endScope" }), e.end = ze(e.end, { joinWith: "" });
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
@@ -1481,7 +1481,7 @@ function Pt(e) {
|
|
|
1481
1481
|
Nt,
|
|
1482
1482
|
// do this early so compiler extensions generally don't have to worry about
|
|
1483
1483
|
// the distinction between match/begin
|
|
1484
|
-
|
|
1484
|
+
Dt,
|
|
1485
1485
|
Ut,
|
|
1486
1486
|
Rt
|
|
1487
1487
|
].forEach((l) => l(r, i)), e.compilerExtensions.forEach((l) => l(r, i)), r.__beforeBegin = null, [
|
|
@@ -1490,7 +1490,7 @@ function Pt(e) {
|
|
|
1490
1490
|
// raw array if they wanted to perhaps manipulate it, etc.
|
|
1491
1491
|
Tt,
|
|
1492
1492
|
// default to 1 relevance if not specified
|
|
1493
|
-
|
|
1493
|
+
St
|
|
1494
1494
|
].forEach((l) => l(r, i)), r.isCompiled = !0;
|
|
1495
1495
|
let o = null;
|
|
1496
1496
|
return typeof r.keywords == "object" && r.keywords.$pattern && (r.keywords = Object.assign({}, r.keywords), o = r.keywords.$pattern, delete r.keywords.$pattern), o = o || /\w+/, r.keywords && (r.keywords = yn(r.keywords, e.case_insensitive)), s.keywordPatternRe = n(o, !0), i && (r.begin || (r.begin = /\B|\b/), s.beginRe = n(s.begin), !r.end && !r.endsWithParent && (r.end = /\B|\b/), r.end && (s.endRe = n(s.end)), s.terminatorEnd = fe(s.end) || "", r.endsWithParent && i.terminatorEnd && (s.terminatorEnd += (r.end ? "|" : "") + i.terminatorEnd)), r.illegal && (s.illegalRe = n(
|
|
@@ -1835,7 +1835,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = M), C ===
|
|
|
1835
1835
|
w && m();
|
|
1836
1836
|
}
|
|
1837
1837
|
typeof window != "undefined" && window.addEventListener && window.addEventListener("DOMContentLoaded", T, !1);
|
|
1838
|
-
function
|
|
1838
|
+
function D(b, M) {
|
|
1839
1839
|
let C = null;
|
|
1840
1840
|
try {
|
|
1841
1841
|
C = M(e);
|
|
@@ -1901,7 +1901,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = M), C ===
|
|
|
1901
1901
|
configure: _,
|
|
1902
1902
|
initHighlighting: v,
|
|
1903
1903
|
initHighlightingOnLoad: E,
|
|
1904
|
-
registerLanguage:
|
|
1904
|
+
registerLanguage: D,
|
|
1905
1905
|
unregisterLanguage: N,
|
|
1906
1906
|
listLanguages: I,
|
|
1907
1907
|
getLanguage: R,
|
|
@@ -2472,7 +2472,7 @@ function Vt(e) {
|
|
|
2472
2472
|
excludeEnd: !0,
|
|
2473
2473
|
keywords: i,
|
|
2474
2474
|
contains: m
|
|
2475
|
-
},
|
|
2475
|
+
}, D = {
|
|
2476
2476
|
variants: [
|
|
2477
2477
|
// class Car extends vehicle
|
|
2478
2478
|
{
|
|
@@ -2771,7 +2771,7 @@ function Vt(e) {
|
|
|
2771
2771
|
},
|
|
2772
2772
|
$,
|
|
2773
2773
|
H,
|
|
2774
|
-
|
|
2774
|
+
D,
|
|
2775
2775
|
G,
|
|
2776
2776
|
{
|
|
2777
2777
|
match: /\$[(.]/
|
|
@@ -3405,11 +3405,11 @@ var oe = "[0-9](_*[0-9])*", Ne = `\\.(${oe})`, Ae = "[0-9a-fA-F](_*[0-9a-fA-F])*
|
|
|
3405
3405
|
],
|
|
3406
3406
|
relevance: 0
|
|
3407
3407
|
};
|
|
3408
|
-
function
|
|
3409
|
-
return a === -1 ? "" : e.replace(n, (u) =>
|
|
3408
|
+
function Dn(e, n, a) {
|
|
3409
|
+
return a === -1 ? "" : e.replace(n, (u) => Dn(e, n, a - 1));
|
|
3410
3410
|
}
|
|
3411
3411
|
function nr(e) {
|
|
3412
|
-
const n = e.regex, a = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", u = a +
|
|
3412
|
+
const n = e.regex, a = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", u = a + Dn("(?:<" + a + "~~~(?:\\s*,\\s*" + a + "~~~)*>)?", /~~~/g, 2), s = {
|
|
3413
3413
|
keyword: [
|
|
3414
3414
|
"synchronized",
|
|
3415
3415
|
"abstract",
|
|
@@ -4538,8 +4538,8 @@ function rr(e) {
|
|
|
4538
4538
|
exceptions: m,
|
|
4539
4539
|
when: T
|
|
4540
4540
|
} = {}) {
|
|
4541
|
-
const
|
|
4542
|
-
return m = m || [], w.map((N) => N.match(/\|\d+$/) || m.includes(N) ? N :
|
|
4541
|
+
const D = T;
|
|
4542
|
+
return m = m || [], w.map((N) => N.match(/\|\d+$/) || m.includes(N) ? N : D(N) ? `${N}|0` : N);
|
|
4543
4543
|
}
|
|
4544
4544
|
return {
|
|
4545
4545
|
name: "SQL",
|
|
@@ -4588,11 +4588,11 @@ Y.registerLanguage("python", er);
|
|
|
4588
4588
|
Y.registerLanguage("java", nr);
|
|
4589
4589
|
Y.registerLanguage("bash", tr);
|
|
4590
4590
|
Y.registerLanguage("sql", rr);
|
|
4591
|
-
var
|
|
4592
|
-
const j = "<code-diff-modified>", q = "</code-diff-modified>", ir = j.replace("<", "<").replace(">", ">"), sr = q.replace("<", "<").replace(">", ">"), le = (e) => e === void 0 ?
|
|
4593
|
-
(h) => le(h) ===
|
|
4591
|
+
var S = /* @__PURE__ */ ((e) => (e.EQUAL = "equal", e.DELETE = "removed", e.ADD = "added", e.EMPTY = "empty", e))(S || {});
|
|
4592
|
+
const j = "<code-diff-modified>", q = "</code-diff-modified>", ir = j.replace("<", "<").replace(">", ">"), sr = q.replace("<", "<").replace(">", ">"), le = (e) => e === void 0 ? S.EQUAL : e.added ? S.ADD : e.removed ? S.DELETE : S.EQUAL, Se = (e, n, a = "word") => typeof e == "undefined" ? n : typeof n == "undefined" ? e : (a === "char" ? Kn : Qn)(e, n).filter((h) => le(h) !== S.DELETE).map(
|
|
4593
|
+
(h) => le(h) === S.ADD ? `${j}${h.value}${q}` : h.value
|
|
4594
4594
|
).join("");
|
|
4595
|
-
function
|
|
4595
|
+
function Sn(e, n) {
|
|
4596
4596
|
const a = new ce.diff_match_patch(), u = a.diff_linesToChars_(e, n), h = u.chars1, t = u.chars2, r = u.lineArray, i = a.diff_main(h, t, !1);
|
|
4597
4597
|
return a.diff_charsToLines_(i, r), i.map((s) => {
|
|
4598
4598
|
const [o, l] = s;
|
|
@@ -4646,7 +4646,7 @@ function Rn(e) {
|
|
|
4646
4646
|
return { additionsNum: a, deletionsNum: u };
|
|
4647
4647
|
}
|
|
4648
4648
|
function ar(e, n, a = "plaintext", u = "word", h = 10) {
|
|
4649
|
-
const t = () => ({ type:
|
|
4649
|
+
const t = () => ({ type: S.EMPTY }), r = (p, _, v) => ({ type: p, num: _, code: v }), i = Sn(e, n);
|
|
4650
4650
|
let s = 0, o = 0, l = !1;
|
|
4651
4651
|
const c = [], f = {
|
|
4652
4652
|
changes: c,
|
|
@@ -4661,46 +4661,46 @@ function ar(e, n, a = "plaintext", u = "word", h = 10) {
|
|
|
4661
4661
|
const [_, v] = [i[p], i[p + 1]], [E, w] = [le(_), le(v)], m = _.value.replace(/\n$/, "").split(`
|
|
4662
4662
|
`);
|
|
4663
4663
|
if (v === void 0) {
|
|
4664
|
-
for (const
|
|
4664
|
+
for (const D of m) {
|
|
4665
4665
|
let N = t(), I = t();
|
|
4666
|
-
const R = Z(a,
|
|
4667
|
-
E ===
|
|
4666
|
+
const R = Z(a, D);
|
|
4667
|
+
E === S.EQUAL && (s++, o++, N = r(S.EQUAL, s, R), I = r(S.EQUAL, o, R)), E === S.DELETE && (s++, N = r(S.DELETE, s, R), I = t()), E === S.ADD && (o++, N = t(), I = r(S.ADD, o, R)), c.push({ left: N, right: I });
|
|
4668
4668
|
}
|
|
4669
4669
|
break;
|
|
4670
4670
|
}
|
|
4671
|
-
if (E ===
|
|
4672
|
-
for (const
|
|
4671
|
+
if (E === S.EQUAL)
|
|
4672
|
+
for (const D of m) {
|
|
4673
4673
|
s++, o++;
|
|
4674
|
-
const N = Z(a,
|
|
4674
|
+
const N = Z(a, D);
|
|
4675
4675
|
c.push({
|
|
4676
|
-
left: r(
|
|
4677
|
-
right: r(
|
|
4676
|
+
left: r(S.EQUAL, s, N),
|
|
4677
|
+
right: r(S.EQUAL, o, N)
|
|
4678
4678
|
});
|
|
4679
4679
|
}
|
|
4680
4680
|
const T = v.value.replace(/\n$/, "").split(`
|
|
4681
4681
|
`);
|
|
4682
|
-
if (E ===
|
|
4683
|
-
if (w ===
|
|
4684
|
-
for (const
|
|
4682
|
+
if (E === S.DELETE) {
|
|
4683
|
+
if (w === S.EQUAL)
|
|
4684
|
+
for (const D of m)
|
|
4685
4685
|
s++, c.push({
|
|
4686
|
-
left: r(
|
|
4686
|
+
left: r(S.DELETE, s, Z(a, D)),
|
|
4687
4687
|
right: t()
|
|
4688
4688
|
});
|
|
4689
|
-
if (w ===
|
|
4689
|
+
if (w === S.ADD) {
|
|
4690
4690
|
l = !0;
|
|
4691
|
-
const
|
|
4692
|
-
for (let N = 0; N <
|
|
4691
|
+
const D = Math.max(_.count, v.count);
|
|
4692
|
+
for (let N = 0; N < D; N++) {
|
|
4693
4693
|
N < _.count && s++, N < v.count && o++;
|
|
4694
|
-
const [I, R] = [m[N], T[N]], H = m.length === T.length ?
|
|
4694
|
+
const [I, R] = [m[N], T[N]], H = m.length === T.length ? Se(R, I, u) : I, U = m.length === T.length ? Se(I, R, u) : R, $ = N < _.count ? r(S.DELETE, s, Z(a, H)) : t(), F = N < v.count ? r(S.ADD, o, Z(a, U)) : t();
|
|
4695
4695
|
c.push({ left: $, right: F });
|
|
4696
4696
|
}
|
|
4697
4697
|
}
|
|
4698
4698
|
}
|
|
4699
|
-
if (E ===
|
|
4700
|
-
for (const
|
|
4699
|
+
if (E === S.ADD)
|
|
4700
|
+
for (const D of m)
|
|
4701
4701
|
o++, c.push({
|
|
4702
4702
|
left: t(),
|
|
4703
|
-
right: r(
|
|
4703
|
+
right: r(S.ADD, o, Z(a, D))
|
|
4704
4704
|
});
|
|
4705
4705
|
}
|
|
4706
4706
|
if (e === n) {
|
|
@@ -4710,7 +4710,7 @@ function ar(e, n, a = "plaintext", u = "word", h = 10) {
|
|
|
4710
4710
|
}
|
|
4711
4711
|
for (let p = 0; p < c.length; p++) {
|
|
4712
4712
|
const _ = c[p];
|
|
4713
|
-
if (_.left.type ===
|
|
4713
|
+
if (_.left.type === S.DELETE || _.right.type === S.ADD) {
|
|
4714
4714
|
const [v, E] = [Math.max(p - h, 0), Math.min(p + h + 1, c.length)];
|
|
4715
4715
|
for (let w = v; w < E; w++)
|
|
4716
4716
|
c[w].fold = !1;
|
|
@@ -4736,7 +4736,7 @@ function ar(e, n, a = "plaintext", u = "word", h = 10) {
|
|
|
4736
4736
|
}), d = []), f.changes = g, f;
|
|
4737
4737
|
}
|
|
4738
4738
|
function or(e, n, a = "plaintext", u = "word", h = 10) {
|
|
4739
|
-
const t =
|
|
4739
|
+
const t = Sn(e, n);
|
|
4740
4740
|
let r = 0, i = 0, s = !1;
|
|
4741
4741
|
const o = [], l = {
|
|
4742
4742
|
changes: o,
|
|
@@ -4752,56 +4752,56 @@ function or(e, n, a = "plaintext", u = "word", h = 10) {
|
|
|
4752
4752
|
`);
|
|
4753
4753
|
if (p === void 0) {
|
|
4754
4754
|
for (const m of E) {
|
|
4755
|
-
_ ===
|
|
4755
|
+
_ === S.EQUAL && (r++, i++), _ === S.DELETE && r++, _ === S.ADD && i++;
|
|
4756
4756
|
const T = Z(a, m);
|
|
4757
4757
|
o.push({
|
|
4758
4758
|
type: _,
|
|
4759
4759
|
code: T,
|
|
4760
|
-
addNum: _ ===
|
|
4761
|
-
delNum: _ ===
|
|
4760
|
+
addNum: _ === S.DELETE ? void 0 : i,
|
|
4761
|
+
delNum: _ === S.ADD ? void 0 : r
|
|
4762
4762
|
});
|
|
4763
4763
|
}
|
|
4764
4764
|
break;
|
|
4765
4765
|
}
|
|
4766
|
-
if (_ ===
|
|
4766
|
+
if (_ === S.EQUAL)
|
|
4767
4767
|
for (const m of E) {
|
|
4768
4768
|
r++, i++;
|
|
4769
4769
|
const T = Z(a, m);
|
|
4770
|
-
o.push({ type:
|
|
4770
|
+
o.push({ type: S.EQUAL, code: T, delNum: r, addNum: i });
|
|
4771
4771
|
}
|
|
4772
4772
|
const w = p.value.replace(/\n$/, "").split(`
|
|
4773
4773
|
`);
|
|
4774
|
-
if (_ ===
|
|
4775
|
-
if (v ===
|
|
4774
|
+
if (_ === S.DELETE)
|
|
4775
|
+
if (v === S.ADD && E.length === w.length) {
|
|
4776
4776
|
for (let m = 0; m < E.length; m++) {
|
|
4777
|
-
const T = E[m],
|
|
4777
|
+
const T = E[m], D = w[m];
|
|
4778
4778
|
r++;
|
|
4779
|
-
const N = Z(a,
|
|
4780
|
-
o.push({ type:
|
|
4779
|
+
const N = Z(a, Se(D, T, u));
|
|
4780
|
+
o.push({ type: S.DELETE, code: N, delNum: r });
|
|
4781
4781
|
}
|
|
4782
4782
|
for (let m = 0; m < w.length; m++) {
|
|
4783
|
-
const T = E[m],
|
|
4783
|
+
const T = E[m], D = w[m];
|
|
4784
4784
|
i++;
|
|
4785
|
-
const N = Z(a,
|
|
4786
|
-
o.push({ type:
|
|
4785
|
+
const N = Z(a, Se(T, D, u));
|
|
4786
|
+
o.push({ type: S.ADD, code: N, addNum: i });
|
|
4787
4787
|
}
|
|
4788
4788
|
s = !0;
|
|
4789
4789
|
} else
|
|
4790
4790
|
for (const m of E) {
|
|
4791
4791
|
r++;
|
|
4792
4792
|
const T = Z(a, m);
|
|
4793
|
-
o.push({ type:
|
|
4793
|
+
o.push({ type: S.DELETE, code: T, delNum: r });
|
|
4794
4794
|
}
|
|
4795
|
-
if (_ ===
|
|
4795
|
+
if (_ === S.ADD)
|
|
4796
4796
|
for (const m of E) {
|
|
4797
4797
|
i++;
|
|
4798
4798
|
const T = Z(a, m);
|
|
4799
|
-
o.push({ type:
|
|
4799
|
+
o.push({ type: S.ADD, code: T, addNum: i });
|
|
4800
4800
|
}
|
|
4801
4801
|
}
|
|
4802
4802
|
for (let g = 0; g < o.length; g++) {
|
|
4803
4803
|
const d = o[g];
|
|
4804
|
-
if (d.type ===
|
|
4804
|
+
if (d.type === S.DELETE || d.type === S.ADD) {
|
|
4805
4805
|
const [p, _] = [Math.max(g - h, 0), Math.min(g + h + 1, o.length)];
|
|
4806
4806
|
for (let v = p; v < _; v++)
|
|
4807
4807
|
o[v].fold = !1;
|
|
@@ -4842,9 +4842,9 @@ Ke.props = {
|
|
|
4842
4842
|
Ke.setup = (e, n) => {
|
|
4843
4843
|
const a = n.emit;
|
|
4844
4844
|
return {
|
|
4845
|
-
DiffType:
|
|
4845
|
+
DiffType: S,
|
|
4846
4846
|
emit: a,
|
|
4847
|
-
getCodeMarker: (h) => h ===
|
|
4847
|
+
getCodeMarker: (h) => h === S.DELETE ? "-" : h === S.ADD ? "+" : ""
|
|
4848
4848
|
};
|
|
4849
4849
|
};
|
|
4850
4850
|
var lr = function() {
|
|
@@ -5012,9 +5012,9 @@ We.props = {
|
|
|
5012
5012
|
We.setup = (e, n) => {
|
|
5013
5013
|
const a = n.emit;
|
|
5014
5014
|
return {
|
|
5015
|
-
DiffType:
|
|
5015
|
+
DiffType: S,
|
|
5016
5016
|
emit: a,
|
|
5017
|
-
getCodeMarker: (h) => h ===
|
|
5017
|
+
getCodeMarker: (h) => h === S.DELETE ? "-" : h === S.ADD ? "+" : ""
|
|
5018
5018
|
};
|
|
5019
5019
|
};
|
|
5020
5020
|
var vr = function() {
|
|
@@ -5150,7 +5150,7 @@ function Tr(e) {
|
|
|
5150
5150
|
for (let n in fn)
|
|
5151
5151
|
this[n] = fn[n];
|
|
5152
5152
|
}
|
|
5153
|
-
const
|
|
5153
|
+
const Dr = /* @__PURE__ */ function() {
|
|
5154
5154
|
return Ar.exports;
|
|
5155
5155
|
}();
|
|
5156
5156
|
const _e = {};
|
|
@@ -5216,13 +5216,13 @@ _e.props = {
|
|
|
5216
5216
|
};
|
|
5217
5217
|
_e.setup = (e, n) => {
|
|
5218
5218
|
const a = e, u = we(() => a.outputFormat === "line-by-line"), h = we(() => {
|
|
5219
|
-
|
|
5220
|
-
return a.noDiffLineFeed ? s.replace(/(\r\n)/g, `
|
|
5221
|
-
`) : s;
|
|
5219
|
+
let s = a.oldString || "";
|
|
5220
|
+
return s = a.trim ? s.trim() : s, s = a.noDiffLineFeed ? s.replace(/(\r\n)/g, `
|
|
5221
|
+
`) : s, s;
|
|
5222
5222
|
}), t = we(() => {
|
|
5223
|
-
|
|
5224
|
-
return a.noDiffLineFeed ? s.replace(/(\r\n)/g, `
|
|
5225
|
-
`) : s;
|
|
5223
|
+
let s = a.newString || "";
|
|
5224
|
+
return s = a.trim ? s.trim() : s, s = a.noDiffLineFeed ? s.replace(/(\r\n)/g, `
|
|
5225
|
+
`) : s, s;
|
|
5226
5226
|
}), r = we(() => u.value ? or(h.value, t.value, a.language, a.diffStyle, a.context) : ar(h.value, t.value, a.language, a.diffStyle, a.context)), i = Pn(r.value);
|
|
5227
5227
|
return xn(() => a, () => {
|
|
5228
5228
|
i.value = r.value;
|
|
@@ -5235,9 +5235,9 @@ _e.setup = (e, n) => {
|
|
|
5235
5235
|
};
|
|
5236
5236
|
_e.components = Object.assign({
|
|
5237
5237
|
UnifiedViewer: br,
|
|
5238
|
-
SplitViewer:
|
|
5238
|
+
SplitViewer: Dr
|
|
5239
5239
|
}, _e.components);
|
|
5240
|
-
var
|
|
5240
|
+
var Sr = function() {
|
|
5241
5241
|
var e = this, n = e.$createElement, a = e._self._c || n;
|
|
5242
5242
|
return a("div", {
|
|
5243
5243
|
staticClass: "code-diff-view",
|
|
@@ -5272,7 +5272,7 @@ var Dr = function() {
|
|
|
5272
5272
|
const gn = {};
|
|
5273
5273
|
var Or = /* @__PURE__ */ be(
|
|
5274
5274
|
_e,
|
|
5275
|
-
|
|
5275
|
+
Sr,
|
|
5276
5276
|
Rr,
|
|
5277
5277
|
!1,
|
|
5278
5278
|
Cr,
|