@inpageedit/core 0.4.1 → 0.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/dist/ActionButton-BgbTKTg7.js +24 -0
- package/dist/ActionButton-BgbTKTg7.js.map +1 -0
- package/dist/{RadioBox-BZFhTEo5.js → RadioBox-CaA8VgLu.js} +16 -16
- package/dist/{RadioBox-BZFhTEo5.js.map → RadioBox-CaA8VgLu.js.map} +1 -1
- package/dist/components/TwinSwapInput/index.d.ts +1 -0
- package/dist/components/index.js +21 -22
- package/dist/components/index.js.map +1 -1
- package/dist/index-BIgWRk98.js +4826 -0
- package/dist/index-BIgWRk98.js.map +1 -0
- package/dist/index-BMmKF_kG.js +165 -0
- package/dist/index-BMmKF_kG.js.map +1 -0
- package/dist/{index-BPsDFq9U.js → index-Bh70Udzi.js} +14 -13
- package/dist/index-Bh70Udzi.js.map +1 -0
- package/dist/index-CBphMyYJ.js +5170 -0
- package/dist/index-CBphMyYJ.js.map +1 -0
- package/dist/{index-X1X416tZ.js → index-CJLKdEqr.js} +41 -25
- package/dist/index-CJLKdEqr.js.map +1 -0
- package/dist/{index-BsYzf3Yw.js → index-CX5H4xCe.js} +12 -12
- package/dist/index-CX5H4xCe.js.map +1 -0
- package/dist/{index-BByzm2Fz.js → index-DNm9SNqM.js} +128 -120
- package/dist/{index-BByzm2Fz.js.map → index-DNm9SNqM.js.map} +1 -1
- package/dist/{index-Ch5DJDZZ.js → index-Djd6Ddcm.js} +125 -121
- package/dist/index-Djd6Ddcm.js.map +1 -0
- package/dist/index-Dk3xR25y.js +96 -0
- package/dist/index-Dk3xR25y.js.map +1 -0
- package/dist/{index-D-zQLFuZ.js → index-QF8lvEam.js} +14 -21
- package/dist/index-QF8lvEam.js.map +1 -0
- package/dist/index.js +9 -4639
- package/dist/index.js.map +1 -1
- package/dist/models/WikiPage/index.d.ts +5 -4
- package/dist/plugins/BasePlugin.d.ts +12 -4
- package/dist/plugins/_debug/index.d.ts +1 -1
- package/dist/plugins/quick-diff/PluginQuickDiffCore.d.ts +2 -1
- package/dist/plugins/quick-edit/index.d.ts +2 -1
- package/dist/plugins/quick-move/index.d.ts +1 -1
- package/dist/plugins/quick-preview/index.d.ts +4 -3
- package/dist/plugins/quick-redirect/index.d.ts +1 -1
- package/dist/plugins/toolbox/index.d.ts +2 -2
- package/dist/services/ModalService/IPEModal.d.ts +235 -0
- package/dist/services/ModalService/index.d.ts +35 -0
- package/dist/style.css +1 -1
- package/dist/utils/interpolate.d.ts +20 -0
- package/dist/utils/interpolate.spec.d.ts +1 -0
- package/lib/index.umd.js +32 -32
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +24 -25
- package/dist/ActionButton-ByMKIthQ.js +0 -24
- package/dist/ActionButton-ByMKIthQ.js.map +0 -1
- package/dist/index-BPsDFq9U.js.map +0 -1
- package/dist/index-BTngTj1f.js +0 -4682
- package/dist/index-BTngTj1f.js.map +0 -1
- package/dist/index-BsYzf3Yw.js.map +0 -1
- package/dist/index-Ch5DJDZZ.js.map +0 -1
- package/dist/index-Cq9xxVsu.js +0 -149
- package/dist/index-Cq9xxVsu.js.map +0 -1
- package/dist/index-D-zQLFuZ.js.map +0 -1
- package/dist/index-HyxA2rYz.js +0 -87
- package/dist/index-HyxA2rYz.js.map +0 -1
- package/dist/index-X1X416tZ.js.map +0 -1
- package/dist/services/SsiModalService.d.ts +0 -36
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as m, F as
|
|
2
|
-
import {
|
|
1
|
+
import { j as m, F as be, P as Se } from "./index-CvhkVj_L.js";
|
|
2
|
+
import { B as G, a as Pe, S as E } from "./index-CBphMyYJ.js";
|
|
3
3
|
import { R as Ne } from "./Preferences-Bg3J5Ur9.js";
|
|
4
|
-
import { R as Ee, M as We } from "./RadioBox-
|
|
5
|
-
class
|
|
4
|
+
import { R as Ee, M as We } from "./RadioBox-CaA8VgLu.js";
|
|
5
|
+
class S {
|
|
6
6
|
diff(e, n, i = {}) {
|
|
7
7
|
let s;
|
|
8
8
|
typeof i == "function" ? (s = i, i = {}) : "callback" in i && (s = i.callback);
|
|
@@ -11,14 +11,14 @@ class b {
|
|
|
11
11
|
}
|
|
12
12
|
diffWithOptionsObj(e, n, i, s) {
|
|
13
13
|
var r;
|
|
14
|
-
const l = (
|
|
15
|
-
if (
|
|
14
|
+
const l = (c) => {
|
|
15
|
+
if (c = this.postProcess(c, i), s) {
|
|
16
16
|
setTimeout(function() {
|
|
17
|
-
s(
|
|
17
|
+
s(c);
|
|
18
18
|
}, 0);
|
|
19
19
|
return;
|
|
20
20
|
} else
|
|
21
|
-
return
|
|
21
|
+
return c;
|
|
22
22
|
}, o = n.length, f = e.length;
|
|
23
23
|
let g = 1, a = o + f;
|
|
24
24
|
i.maxEditLength != null && (a = Math.min(a, i.maxEditLength));
|
|
@@ -28,39 +28,39 @@ class b {
|
|
|
28
28
|
return l(this.buildValues(v[0].lastComponent, n, e));
|
|
29
29
|
let p = -1 / 0, x = 1 / 0;
|
|
30
30
|
const C = () => {
|
|
31
|
-
for (let
|
|
32
|
-
let
|
|
33
|
-
const w = v[
|
|
34
|
-
w && (v[
|
|
35
|
-
let
|
|
31
|
+
for (let c = Math.max(p, -g); c <= Math.min(x, g); c += 2) {
|
|
32
|
+
let u;
|
|
33
|
+
const w = v[c - 1], k = v[c + 1];
|
|
34
|
+
w && (v[c - 1] = void 0);
|
|
35
|
+
let b = !1;
|
|
36
36
|
if (k) {
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const P = k.oldPos - c;
|
|
38
|
+
b = k && 0 <= P && P < o;
|
|
39
39
|
}
|
|
40
40
|
const D = w && w.oldPos + 1 < f;
|
|
41
|
-
if (!
|
|
42
|
-
v[
|
|
41
|
+
if (!b && !D) {
|
|
42
|
+
v[c] = void 0;
|
|
43
43
|
continue;
|
|
44
44
|
}
|
|
45
|
-
if (!D ||
|
|
46
|
-
return l(this.buildValues(
|
|
47
|
-
v[
|
|
45
|
+
if (!D || b && w.oldPos < k.oldPos ? u = this.addToPath(k, !0, !1, 0, i) : u = this.addToPath(w, !1, !0, 1, i), d = this.extractCommon(u, n, e, c, i), u.oldPos + 1 >= f && d + 1 >= o)
|
|
46
|
+
return l(this.buildValues(u.lastComponent, n, e)) || !0;
|
|
47
|
+
v[c] = u, u.oldPos + 1 >= f && (x = Math.min(x, c - 1)), d + 1 >= o && (p = Math.max(p, c + 1));
|
|
48
48
|
}
|
|
49
49
|
g++;
|
|
50
50
|
};
|
|
51
51
|
if (s)
|
|
52
|
-
(function
|
|
52
|
+
(function c() {
|
|
53
53
|
setTimeout(function() {
|
|
54
54
|
if (g > a || Date.now() > y)
|
|
55
55
|
return s(void 0);
|
|
56
|
-
C() ||
|
|
56
|
+
C() || c();
|
|
57
57
|
}, 0);
|
|
58
58
|
})();
|
|
59
59
|
else
|
|
60
60
|
for (; g <= a && Date.now() <= y; ) {
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
return
|
|
61
|
+
const c = C();
|
|
62
|
+
if (c)
|
|
63
|
+
return c;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
addToPath(e, n, i, s, r) {
|
|
@@ -133,7 +133,7 @@ class b {
|
|
|
133
133
|
return s;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
class _e extends
|
|
136
|
+
class _e extends S {
|
|
137
137
|
}
|
|
138
138
|
const K = new _e();
|
|
139
139
|
function ee(t, e, n) {
|
|
@@ -218,7 +218,7 @@ function N(t) {
|
|
|
218
218
|
return e ? e[0] : "";
|
|
219
219
|
}
|
|
220
220
|
const T = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}", Ae = new RegExp(`[${T}]+|\\s+|[^${T}]`, "ug");
|
|
221
|
-
class Le extends
|
|
221
|
+
class Le extends S {
|
|
222
222
|
equals(e, n, i) {
|
|
223
223
|
return i.ignoreCase && (e = e.toLowerCase(), n = n.toLowerCase()), e.trim() === n.trim();
|
|
224
224
|
}
|
|
@@ -251,7 +251,7 @@ class Le extends b {
|
|
|
251
251
|
}
|
|
252
252
|
const te = new Le();
|
|
253
253
|
function ne(t, e, n) {
|
|
254
|
-
return n?.ignoreWhitespace != null && !n.ignoreWhitespace ?
|
|
254
|
+
return n?.ignoreWhitespace != null && !n.ignoreWhitespace ? $(t, e, n) : te.diff(t, e, n);
|
|
255
255
|
}
|
|
256
256
|
function X(t, e, n, i) {
|
|
257
257
|
if (e && n) {
|
|
@@ -286,14 +286,14 @@ function X(t, e, n, i) {
|
|
|
286
286
|
e.value = W(e.value, l);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
class je extends
|
|
289
|
+
class je extends S {
|
|
290
290
|
tokenize(e) {
|
|
291
291
|
const n = new RegExp(`(\\r?\\n)|[${T}]+|[^\\S\\n\\r]+|[^${T}]`, "ug");
|
|
292
292
|
return e.match(n) || [];
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
const ie = new je();
|
|
296
|
-
function
|
|
296
|
+
function $(t, e, n) {
|
|
297
297
|
return ie.diff(t, e, n);
|
|
298
298
|
}
|
|
299
299
|
function ze(t, e) {
|
|
@@ -304,7 +304,7 @@ function ze(t, e) {
|
|
|
304
304
|
Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
305
305
|
return e;
|
|
306
306
|
}
|
|
307
|
-
class Ie extends
|
|
307
|
+
class Ie extends S {
|
|
308
308
|
constructor() {
|
|
309
309
|
super(...arguments), this.tokenize = se;
|
|
310
310
|
}
|
|
@@ -337,7 +337,7 @@ function se(t, e) {
|
|
|
337
337
|
function He(t) {
|
|
338
338
|
return t == "." || t == "!" || t == "?";
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class qe extends S {
|
|
341
341
|
tokenize(e) {
|
|
342
342
|
var n;
|
|
343
343
|
const i = [];
|
|
@@ -356,20 +356,20 @@ class $e extends b {
|
|
|
356
356
|
return i;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
const le = new
|
|
359
|
+
const le = new qe();
|
|
360
360
|
function oe(t, e, n) {
|
|
361
361
|
return le.diff(t, e, n);
|
|
362
362
|
}
|
|
363
|
-
class
|
|
363
|
+
class $e extends S {
|
|
364
364
|
tokenize(e) {
|
|
365
365
|
return e.split(/([{}:;,]|\s+)/);
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
const fe = new
|
|
368
|
+
const fe = new $e();
|
|
369
369
|
function ae(t, e, n) {
|
|
370
370
|
return fe.diff(t, e, n);
|
|
371
371
|
}
|
|
372
|
-
class Me extends
|
|
372
|
+
class Me extends S {
|
|
373
373
|
constructor() {
|
|
374
374
|
super(...arguments), this.tokenize = se;
|
|
375
375
|
}
|
|
@@ -384,9 +384,9 @@ class Me extends b {
|
|
|
384
384
|
return super.equals(e.replace(/,([\r\n])/g, "$1"), n.replace(/,([\r\n])/g, "$1"), i);
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
|
-
const
|
|
388
|
-
function
|
|
389
|
-
return
|
|
387
|
+
const ue = new Me();
|
|
388
|
+
function ce(t, e, n) {
|
|
389
|
+
return ue.diff(t, e, n);
|
|
390
390
|
}
|
|
391
391
|
function A(t, e, n, i, s) {
|
|
392
392
|
e = e || [], n = n || [], i && (t = i(s === void 0 ? "" : s, t));
|
|
@@ -413,7 +413,7 @@ function A(t, e, n, i, s) {
|
|
|
413
413
|
l = t;
|
|
414
414
|
return l;
|
|
415
415
|
}
|
|
416
|
-
class Re extends
|
|
416
|
+
class Re extends S {
|
|
417
417
|
tokenize(e) {
|
|
418
418
|
return e.slice();
|
|
419
419
|
}
|
|
@@ -440,7 +440,7 @@ function ge(t) {
|
|
|
440
440
|
function Je(t) {
|
|
441
441
|
return Array.isArray(t) || (t = [t]), !t.some((e) => e.hunks.some((n) => n.lines.some((i) => !i.startsWith("\\") && i.endsWith("\r"))));
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function Be(t) {
|
|
444
444
|
return Array.isArray(t) || (t = [t]), t.some((e) => e.hunks.some((n) => n.lines.some((i) => i.endsWith("\r")))) && t.every((e) => e.hunks.every((n) => n.lines.every((i, s) => {
|
|
445
445
|
var r;
|
|
446
446
|
return i.startsWith("\\") || i.endsWith("\r") || ((r = n.lines[s + 1]) === null || r === void 0 ? void 0 : r.startsWith("\\"));
|
|
@@ -507,7 +507,7 @@ function R(t) {
|
|
|
507
507
|
s();
|
|
508
508
|
return n;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Qe(t, e, n) {
|
|
511
511
|
let i = !0, s = !1, r = !1, l = 1;
|
|
512
512
|
return function o() {
|
|
513
513
|
if (i && !r) {
|
|
@@ -526,7 +526,7 @@ function pe(t, e, n = {}) {
|
|
|
526
526
|
return Ue(t, i[0], n);
|
|
527
527
|
}
|
|
528
528
|
function Ue(t, e, n = {}) {
|
|
529
|
-
(n.autoConvertLineEndings || n.autoConvertLineEndings == null) && (Te(t) && Je(e) ? e = he(e) : Fe(t) &&
|
|
529
|
+
(n.autoConvertLineEndings || n.autoConvertLineEndings == null) && (Te(t) && Je(e) ? e = he(e) : Fe(t) && Be(e) && (e = ge(e)));
|
|
530
530
|
const i = t.split(`
|
|
531
531
|
`), s = e.hunks, r = n.compareLine || ((d, p, x, C) => p === C), l = n.fuzzFactor || 0;
|
|
532
532
|
let o = 0;
|
|
@@ -553,28 +553,28 @@ function Ue(t, e, n = {}) {
|
|
|
553
553
|
else if (!l)
|
|
554
554
|
return !1;
|
|
555
555
|
}
|
|
556
|
-
function h(d, p, x, C = 0,
|
|
557
|
-
let k = 0,
|
|
556
|
+
function h(d, p, x, C = 0, c = !0, u = [], w = 0) {
|
|
557
|
+
let k = 0, b = !1;
|
|
558
558
|
for (; C < d.length; C++) {
|
|
559
|
-
const D = d[C],
|
|
560
|
-
if (
|
|
561
|
-
if (r(p + 1, i[p],
|
|
559
|
+
const D = d[C], P = D.length > 0 ? D[0] : " ", z = D.length > 0 ? D.substr(1) : D;
|
|
560
|
+
if (P === "-")
|
|
561
|
+
if (r(p + 1, i[p], P, z))
|
|
562
562
|
p++, k = 0;
|
|
563
563
|
else
|
|
564
|
-
return !x || i[p] == null ? null : (
|
|
565
|
-
if (
|
|
566
|
-
if (!
|
|
564
|
+
return !x || i[p] == null ? null : (u[w] = i[p], h(d, p + 1, x - 1, C, !1, u, w + 1));
|
|
565
|
+
if (P === "+") {
|
|
566
|
+
if (!c)
|
|
567
567
|
return null;
|
|
568
|
-
|
|
568
|
+
u[w] = z, w++, k = 0, b = !0;
|
|
569
569
|
}
|
|
570
|
-
if (
|
|
571
|
-
if (k++,
|
|
572
|
-
w++,
|
|
570
|
+
if (P === " ")
|
|
571
|
+
if (k++, u[w] = i[p], r(p + 1, i[p], P, z))
|
|
572
|
+
w++, c = !0, b = !1, p++;
|
|
573
573
|
else
|
|
574
|
-
return
|
|
574
|
+
return b || !x ? null : i[p] && (h(d, p + 1, x - 1, C + 1, !1, u, w + 1) || h(d, p + 1, x - 1, C, !1, u, w + 1)) || h(d, p, x - 1, C + 1, !1, u, w);
|
|
575
575
|
}
|
|
576
|
-
return w -= k, p -= k,
|
|
577
|
-
patchedLines:
|
|
576
|
+
return w -= k, p -= k, u.length = w, {
|
|
577
|
+
patchedLines: u,
|
|
578
578
|
oldLineLastI: p - 1
|
|
579
579
|
};
|
|
580
580
|
}
|
|
@@ -584,24 +584,24 @@ function Ue(t, e, n = {}) {
|
|
|
584
584
|
const p = s[d];
|
|
585
585
|
let x;
|
|
586
586
|
const C = i.length - p.oldLines + l;
|
|
587
|
-
let
|
|
588
|
-
for (let
|
|
589
|
-
|
|
590
|
-
const w =
|
|
591
|
-
for (;
|
|
587
|
+
let c;
|
|
588
|
+
for (let u = 0; u <= l; u++) {
|
|
589
|
+
c = p.oldStart + v - 1;
|
|
590
|
+
const w = Qe(c, o, C);
|
|
591
|
+
for (; c !== void 0 && (x = h(p.lines, c, u), !x); c = w())
|
|
592
592
|
;
|
|
593
593
|
if (x)
|
|
594
594
|
break;
|
|
595
595
|
}
|
|
596
596
|
if (!x)
|
|
597
597
|
return !1;
|
|
598
|
-
for (let
|
|
599
|
-
y.push(i[
|
|
600
|
-
for (let
|
|
601
|
-
const w = x.patchedLines[
|
|
598
|
+
for (let u = o; u < c; u++)
|
|
599
|
+
y.push(i[u]);
|
|
600
|
+
for (let u = 0; u < x.patchedLines.length; u++) {
|
|
601
|
+
const w = x.patchedLines[u];
|
|
602
602
|
y.push(w);
|
|
603
603
|
}
|
|
604
|
-
o = x.oldLineLastI + 1, v =
|
|
604
|
+
o = x.oldLineLastI + 1, v = c + 1 - p.oldStart;
|
|
605
605
|
}
|
|
606
606
|
for (let d = o; d < i.length; d++)
|
|
607
607
|
y.push(i[d]);
|
|
@@ -637,7 +637,7 @@ function we(t) {
|
|
|
637
637
|
lines: e.lines.map((n) => n.startsWith("-") ? `+${n.slice(1)}` : n.startsWith("+") ? `-${n.slice(1)}` : n)
|
|
638
638
|
})) });
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function q(t, e, n, i, s, r, l) {
|
|
641
641
|
let o;
|
|
642
642
|
l ? typeof l == "function" ? o = { callback: l } : o = l : o = {}, typeof o.context > "u" && (o.context = 4);
|
|
643
643
|
const f = o.context;
|
|
@@ -655,48 +655,48 @@ function $(t, e, n, i, s, r, l) {
|
|
|
655
655
|
if (!a)
|
|
656
656
|
return;
|
|
657
657
|
a.push({ value: "", lines: [] });
|
|
658
|
-
function h(
|
|
659
|
-
return
|
|
660
|
-
return " " +
|
|
658
|
+
function h(c) {
|
|
659
|
+
return c.map(function(u) {
|
|
660
|
+
return " " + u;
|
|
661
661
|
});
|
|
662
662
|
}
|
|
663
663
|
const y = [];
|
|
664
664
|
let v = 0, d = 0, p = [], x = 1, C = 1;
|
|
665
|
-
for (let
|
|
666
|
-
const
|
|
667
|
-
if (
|
|
665
|
+
for (let c = 0; c < a.length; c++) {
|
|
666
|
+
const u = a[c], w = u.lines || Xe(u.value);
|
|
667
|
+
if (u.lines = w, u.added || u.removed) {
|
|
668
668
|
if (!v) {
|
|
669
|
-
const k = a[
|
|
669
|
+
const k = a[c - 1];
|
|
670
670
|
v = x, d = C, k && (p = f > 0 ? h(k.lines.slice(-f)) : [], v -= p.length, d -= p.length);
|
|
671
671
|
}
|
|
672
672
|
for (const k of w)
|
|
673
|
-
p.push((
|
|
674
|
-
|
|
673
|
+
p.push((u.added ? "+" : "-") + k);
|
|
674
|
+
u.added ? C += w.length : x += w.length;
|
|
675
675
|
} else {
|
|
676
676
|
if (v)
|
|
677
|
-
if (w.length <= f * 2 &&
|
|
677
|
+
if (w.length <= f * 2 && c < a.length - 2)
|
|
678
678
|
for (const k of h(w))
|
|
679
679
|
p.push(k);
|
|
680
680
|
else {
|
|
681
681
|
const k = Math.min(w.length, f);
|
|
682
682
|
for (const D of h(w.slice(0, k)))
|
|
683
683
|
p.push(D);
|
|
684
|
-
const
|
|
684
|
+
const b = {
|
|
685
685
|
oldStart: v,
|
|
686
686
|
oldLines: x - v + k,
|
|
687
687
|
newStart: d,
|
|
688
688
|
newLines: C - d + k,
|
|
689
689
|
lines: p
|
|
690
690
|
};
|
|
691
|
-
y.push(
|
|
691
|
+
y.push(b), v = 0, d = 0, p = [];
|
|
692
692
|
}
|
|
693
693
|
x += w.length, C += w.length;
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
for (const
|
|
697
|
-
for (let
|
|
698
|
-
|
|
699
|
-
`) ?
|
|
696
|
+
for (const c of y)
|
|
697
|
+
for (let u = 0; u < c.lines.length; u++)
|
|
698
|
+
c.lines[u].endsWith(`
|
|
699
|
+
`) ? c.lines[u] = c.lines[u].slice(0, -1) : (c.lines.splice(u + 1, 0, "\"), u++);
|
|
700
700
|
return {
|
|
701
701
|
oldFileName: t,
|
|
702
702
|
newFileName: e,
|
|
@@ -725,11 +725,11 @@ function L(t) {
|
|
|
725
725
|
function J(t, e, n, i, s, r, l) {
|
|
726
726
|
if (typeof l == "function" && (l = { callback: l }), l?.callback) {
|
|
727
727
|
const { callback: o } = l;
|
|
728
|
-
|
|
728
|
+
q(t, e, n, i, s, r, Object.assign(Object.assign({}, l), { callback: (f) => {
|
|
729
729
|
o(f ? L(f) : void 0);
|
|
730
730
|
} }));
|
|
731
731
|
} else {
|
|
732
|
-
const o =
|
|
732
|
+
const o = q(t, e, n, i, s, r, l);
|
|
733
733
|
return o ? L(o) : void 0;
|
|
734
734
|
}
|
|
735
735
|
}
|
|
@@ -764,7 +764,7 @@ function Ke(t) {
|
|
|
764
764
|
}
|
|
765
765
|
const et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
766
766
|
__proto__: null,
|
|
767
|
-
Diff:
|
|
767
|
+
Diff: S,
|
|
768
768
|
applyPatch: pe,
|
|
769
769
|
applyPatches: Ve,
|
|
770
770
|
arrayDiff: de,
|
|
@@ -778,25 +778,25 @@ const et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
778
778
|
diffArrays: me,
|
|
779
779
|
diffChars: ee,
|
|
780
780
|
diffCss: ae,
|
|
781
|
-
diffJson:
|
|
781
|
+
diffJson: ce,
|
|
782
782
|
diffLines: F,
|
|
783
783
|
diffSentences: oe,
|
|
784
784
|
diffTrimmedLines: re,
|
|
785
785
|
diffWords: ne,
|
|
786
|
-
diffWordsWithSpace:
|
|
786
|
+
diffWordsWithSpace: $,
|
|
787
787
|
formatPatch: L,
|
|
788
|
-
jsonDiff:
|
|
788
|
+
jsonDiff: ue,
|
|
789
789
|
lineDiff: M,
|
|
790
790
|
parsePatch: R,
|
|
791
791
|
reversePatch: we,
|
|
792
792
|
sentenceDiff: le,
|
|
793
|
-
structuredPatch:
|
|
793
|
+
structuredPatch: q,
|
|
794
794
|
wordDiff: te,
|
|
795
795
|
wordsWithSpaceDiff: ie
|
|
796
796
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
797
797
|
class tt {
|
|
798
798
|
constructor(e) {
|
|
799
|
-
this.ctx = e, this.JsDiff = et, this.diffChars = ee, this.diffWords = ne, this.diffWordsWithSpace =
|
|
799
|
+
this.ctx = e, this.JsDiff = et, this.diffChars = ee, this.diffWords = ne, this.diffWordsWithSpace = $, this.diffLines = F, this.diffTrimmedLines = re, this.diffSentences = oe, this.diffCss = ae, this.diffJson = ce, this.diffArrays = me, this.createTwoFilesPatch = J, this.ctx.set("jsdiff", this);
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
const nt = {
|
|
@@ -842,7 +842,7 @@ const nt = {
|
|
|
842
842
|
/* @__PURE__ */ m("div", { className: "mw-diff-title--title", children: t.pagetitle || t.timestamp }),
|
|
843
843
|
/* @__PURE__ */ m("div", { className: "mw-diff-title--user", children: t.username && /* @__PURE__ */ m(it, { user: t.username, target: "_blank" }) }),
|
|
844
844
|
/* @__PURE__ */ m("div", { className: "mw-diff-title--timestamp", children: t.timestamp && rt(new Date(t.timestamp)) }),
|
|
845
|
-
/* @__PURE__ */ m("div", { className: "mw-diff-title--comment", children: t.parsedcomment && /* @__PURE__ */ m(
|
|
845
|
+
/* @__PURE__ */ m("div", { className: "mw-diff-title--comment", children: t.parsedcomment && /* @__PURE__ */ m(be, { children: [
|
|
846
846
|
"(",
|
|
847
847
|
/* @__PURE__ */ m("i", { innerHTML: t.parsedcomment }),
|
|
848
848
|
")"
|
|
@@ -910,18 +910,18 @@ const nt = {
|
|
|
910
910
|
}
|
|
911
911
|
) }) })).outerHTML, i;
|
|
912
912
|
}, lt = (t, e = document) => e.querySelector(t), ot = (t, e = document) => e.querySelectorAll(t);
|
|
913
|
-
var ft = Object.create,
|
|
913
|
+
var ft = Object.create, B = Object.defineProperty, at = Object.getOwnPropertyDescriptor, ve = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), ye = (t) => {
|
|
914
914
|
throw TypeError(t);
|
|
915
|
-
},
|
|
915
|
+
}, ut = (t, e, n) => e in t ? B(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ct = (t, e) => B(t, "name", { value: e, configurable: !0 }), dt = (t) => [, , , ft(t?.[ve("metadata")] ?? null)], mt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], xe = (t) => t !== void 0 && typeof t != "function" ? ye("Function expected") : t, ht = (t, e, n, i, s) => ({ kind: mt[t], name: e, metadata: i, addInitializer: (r) => n._ ? ye("Already initialized") : s.push(xe(r || null)) }), gt = (t, e) => ut(e, ve("metadata"), t[3]), pt = (t, e, n, i) => {
|
|
916
916
|
for (var s = 0, r = t[e >> 1], l = r && r.length; s < l; s++) r[s].call(n);
|
|
917
917
|
return i;
|
|
918
918
|
}, wt = (t, e, n, i, s, r) => {
|
|
919
919
|
var l, o, f, g = e & 7, a = !1, h = 0, y = t[h] || (t[h] = []), v = g && (s = s.prototype, g < 5 && (g > 3 || !a) && at(s, n));
|
|
920
|
-
|
|
920
|
+
ct(s, n);
|
|
921
921
|
for (var d = i.length - 1; d >= 0; d--)
|
|
922
922
|
f = ht(g, n, o = {}, t[3], y), l = (0, i[d])(s, f), o._ = 1, xe(l) && (s = l);
|
|
923
|
-
return gt(t, s), v &&
|
|
924
|
-
}, ke,
|
|
923
|
+
return gt(t, s), v && B(s, n, v), a ? g ^ 4 ? r : v : s;
|
|
924
|
+
}, ke, Q, Ce;
|
|
925
925
|
const De = [
|
|
926
926
|
"diffChars",
|
|
927
927
|
"diffWords",
|
|
@@ -929,7 +929,7 @@ const De = [
|
|
|
929
929
|
"diffLines",
|
|
930
930
|
"createTwoFilesPatch"
|
|
931
931
|
];
|
|
932
|
-
ke = [
|
|
932
|
+
ke = [Pe(["jsdiff"]), Ne(
|
|
933
933
|
E.object({
|
|
934
934
|
"quickDiff.preferredCompareMode": E.union([E.const("jsDiff"), E.const("mwApi")]).description("The preferred comparison mode for quick diff").default("mwApi"),
|
|
935
935
|
"quickDiff.jsDiff.defaultType": E.union(De.map((t) => E.const(t))).description("The default diff type for JsDiff").default("diffSentences")
|
|
@@ -989,22 +989,29 @@ class j extends (Ce = G) {
|
|
|
989
989
|
});
|
|
990
990
|
}
|
|
991
991
|
injectQuickEdit({ modal: e, wikiPage: n }) {
|
|
992
|
-
|
|
992
|
+
if (n.pageid === 0)
|
|
993
|
+
return;
|
|
994
|
+
let i;
|
|
995
|
+
e.addButton(
|
|
993
996
|
{
|
|
994
997
|
label: "Diff",
|
|
995
998
|
side: "left",
|
|
996
999
|
className: "btn btn-secondary",
|
|
997
1000
|
method: () => {
|
|
998
|
-
const
|
|
999
|
-
return this.comparePages(
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1001
|
+
const s = n.title, r = n.revisions?.[0]?.content || "", l = e.get$content().querySelector('textarea[name="text"]')?.value || "";
|
|
1002
|
+
return i = this.comparePages(
|
|
1003
|
+
{
|
|
1004
|
+
fromtitle: s,
|
|
1005
|
+
fromtext: r,
|
|
1006
|
+
totitle: s,
|
|
1007
|
+
totext: l
|
|
1008
|
+
},
|
|
1009
|
+
i
|
|
1010
|
+
), i;
|
|
1005
1011
|
}
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1012
|
+
},
|
|
1013
|
+
1
|
|
1014
|
+
);
|
|
1008
1015
|
}
|
|
1009
1016
|
simpleTextDiff(e, n) {
|
|
1010
1017
|
const i = this.ctx.modal.show({
|
|
@@ -1078,13 +1085,14 @@ class j extends (Ce = G) {
|
|
|
1078
1085
|
}
|
|
1079
1086
|
return s;
|
|
1080
1087
|
}
|
|
1081
|
-
comparePages(e) {
|
|
1082
|
-
|
|
1088
|
+
comparePages(e, n) {
|
|
1089
|
+
return (!n || n.isDestroyed) && (n = this.ctx.modal.createObject({
|
|
1083
1090
|
title: "Loading diff...",
|
|
1084
|
-
content:
|
|
1085
|
-
className: "quick-diff"
|
|
1086
|
-
|
|
1087
|
-
|
|
1091
|
+
content: "",
|
|
1092
|
+
className: "quick-diff",
|
|
1093
|
+
backdrop: !1,
|
|
1094
|
+
draggable: !0
|
|
1095
|
+
}).init()), n.setContent(/* @__PURE__ */ m(Se, {})), n.bringToFront(), window.mw && mw.loader.getState("mediawiki.diff.styles") !== "ready" && mw.loader.load(["mediawiki.diff.styles"]), this.ctx.api.post({
|
|
1088
1096
|
...this.COMPARE_API_DEFAULT_OPTIONS,
|
|
1089
1097
|
...e,
|
|
1090
1098
|
action: "compare",
|
|
@@ -1115,9 +1123,9 @@ class j extends (Ce = G) {
|
|
|
1115
1123
|
}), n.show();
|
|
1116
1124
|
}
|
|
1117
1125
|
}
|
|
1118
|
-
|
|
1119
|
-
j = wt(
|
|
1120
|
-
pt(
|
|
1126
|
+
Q = dt(Ce);
|
|
1127
|
+
j = wt(Q, 0, "PluginQuickDiffCore", ke, j);
|
|
1128
|
+
pt(Q, 1, j);
|
|
1121
1129
|
class Ct extends G {
|
|
1122
1130
|
constructor(e) {
|
|
1123
1131
|
super(e, {}, "quick-diff-loader"), this.ctx = e, e.plugin(tt), e.plugin(j);
|
|
@@ -1129,4 +1137,4 @@ class Ct extends G {
|
|
|
1129
1137
|
export {
|
|
1130
1138
|
Ct as PluginQuickDiff
|
|
1131
1139
|
};
|
|
1132
|
-
//# sourceMappingURL=index-
|
|
1140
|
+
//# sourceMappingURL=index-DNm9SNqM.js.map
|