@inpageedit/core 0.5.0 → 0.5.2
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/{index-K73DMVec.js → index-3FdvKxaN.js} +5 -5
- package/dist/{index-K73DMVec.js.map → index-3FdvKxaN.js.map} +1 -1
- package/dist/{index-Bo1hNwWJ.js → index-6bp2nmez.js} +17 -17
- package/dist/index-6bp2nmez.js.map +1 -0
- package/dist/{index-z5MR2HJ2.js → index-B0QzYk-q.js} +301 -295
- package/dist/index-B0QzYk-q.js.map +1 -0
- package/dist/{index-jKU6cYcH.js → index-BwVAO_o4.js} +5 -5
- package/dist/{index-jKU6cYcH.js.map → index-BwVAO_o4.js.map} +1 -1
- package/dist/index-CIzmjtBz.js +5170 -0
- package/dist/index-CIzmjtBz.js.map +1 -0
- package/dist/{index-D3yG7jFv.js → index-D1plOuGc.js} +32 -32
- package/dist/{index-D3yG7jFv.js.map → index-D1plOuGc.js.map} +1 -1
- package/dist/{index-mMAGhnbR.js → index-DXvJqlhL.js} +2 -2
- package/dist/{index-mMAGhnbR.js.map → index-DXvJqlhL.js.map} +1 -1
- package/dist/{index-BxR7MsNM.js → index-DlE7PWxs.js} +145 -130
- package/dist/index-DlE7PWxs.js.map +1 -0
- package/dist/{index-CUXLgVhg.js → index-DnpXoEP3.js} +4 -4
- package/dist/{index-CUXLgVhg.js.map → index-DnpXoEP3.js.map} +1 -1
- package/dist/index.js +9 -5139
- 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/in-article-links/index.d.ts +31 -0
- package/dist/plugins/quick-edit/index.d.ts +7 -3
- package/dist/plugins/quick-preview/index.d.ts +2 -2
- package/dist/plugins/toolbox/index.d.ts +2 -2
- package/dist/style.css +1 -1
- package/lib/index.umd.js +32 -32
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +20 -19
- package/dist/index-Bo1hNwWJ.js.map +0 -1
- package/dist/index-BxR7MsNM.js.map +0 -1
- package/dist/index-z5MR2HJ2.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as m, F as be, P as Se } from "./index-CvhkVj_L.js";
|
|
2
|
-
import {
|
|
3
|
-
import { R as
|
|
2
|
+
import { B as G, a as Ne, S as E } from "./index-CIzmjtBz.js";
|
|
3
|
+
import { R as Pe } from "./Preferences-Bg3J5Ur9.js";
|
|
4
4
|
import { R as Ee, M as We } from "./RadioBox-CaA8VgLu.js";
|
|
5
5
|
class S {
|
|
6
6
|
diff(e, n, i = {}) {
|
|
@@ -34,8 +34,8 @@ class S {
|
|
|
34
34
|
w && (v[c - 1] = void 0);
|
|
35
35
|
let b = !1;
|
|
36
36
|
if (k) {
|
|
37
|
-
const
|
|
38
|
-
b = k && 0 <=
|
|
37
|
+
const N = k.oldPos - c;
|
|
38
|
+
b = k && 0 <= N && N < o;
|
|
39
39
|
}
|
|
40
40
|
const D = w && w.oldPos + 1 < f;
|
|
41
41
|
if (!b && !D) {
|
|
@@ -213,7 +213,7 @@ function _(t) {
|
|
|
213
213
|
;
|
|
214
214
|
return t.substring(e + 1);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function P(t) {
|
|
217
217
|
const e = t.match(/^\s*/);
|
|
218
218
|
return e ? e[0] : "";
|
|
219
219
|
}
|
|
@@ -255,7 +255,7 @@ function ne(t, e, n) {
|
|
|
255
255
|
}
|
|
256
256
|
function X(t, e, n, i) {
|
|
257
257
|
if (e && n) {
|
|
258
|
-
const s =
|
|
258
|
+
const s = P(e.value), r = _(e.value), l = P(n.value), o = _(n.value);
|
|
259
259
|
if (t) {
|
|
260
260
|
const f = U(s, l);
|
|
261
261
|
t.value = H(t.value, l, f), e.value = W(e.value, f), n.value = W(n.value, f);
|
|
@@ -266,23 +266,23 @@ function X(t, e, n, i) {
|
|
|
266
266
|
}
|
|
267
267
|
} else if (n) {
|
|
268
268
|
if (t) {
|
|
269
|
-
const s =
|
|
269
|
+
const s = P(n.value);
|
|
270
270
|
n.value = n.value.substring(s.length);
|
|
271
271
|
}
|
|
272
272
|
if (i) {
|
|
273
|
-
const s =
|
|
273
|
+
const s = P(i.value);
|
|
274
274
|
i.value = i.value.substring(s.length);
|
|
275
275
|
}
|
|
276
276
|
} else if (t && i) {
|
|
277
|
-
const s =
|
|
277
|
+
const s = P(i.value), r = P(e.value), l = _(e.value), o = U(s, r);
|
|
278
278
|
e.value = W(e.value, o);
|
|
279
279
|
const f = V(W(s, o), l);
|
|
280
280
|
e.value = O(e.value, f), i.value = I(i.value, s, f), t.value = H(t.value, s, s.slice(0, s.length - f.length));
|
|
281
281
|
} else if (i) {
|
|
282
|
-
const s =
|
|
282
|
+
const s = P(i.value), r = _(e.value), l = Y(r, s);
|
|
283
283
|
e.value = O(e.value, l);
|
|
284
284
|
} else if (t) {
|
|
285
|
-
const s = _(t.value), r =
|
|
285
|
+
const s = _(t.value), r = P(e.value), l = Y(s, r);
|
|
286
286
|
e.value = W(e.value, l);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -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;
|
|
@@ -556,19 +556,19 @@ function Ue(t, e, n = {}) {
|
|
|
556
556
|
function h(d, p, x, C = 0, c = !0, u = [], w = 0) {
|
|
557
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], N = D.length > 0 ? D[0] : " ", z = D.length > 0 ? D.substr(1) : D;
|
|
560
|
+
if (N === "-")
|
|
561
|
+
if (r(p + 1, i[p], N, z))
|
|
562
562
|
p++, k = 0;
|
|
563
563
|
else
|
|
564
564
|
return !x || i[p] == null ? null : (u[w] = i[p], h(d, p + 1, x - 1, C, !1, u, w + 1));
|
|
565
|
-
if (
|
|
565
|
+
if (N === "+") {
|
|
566
566
|
if (!c)
|
|
567
567
|
return null;
|
|
568
568
|
u[w] = z, w++, k = 0, b = !0;
|
|
569
569
|
}
|
|
570
|
-
if (
|
|
571
|
-
if (k++, u[w] = i[p], r(p + 1, i[p],
|
|
570
|
+
if (N === " ")
|
|
571
|
+
if (k++, u[w] = i[p], r(p + 1, i[p], N, z))
|
|
572
572
|
w++, c = !0, b = !1, p++;
|
|
573
573
|
else
|
|
574
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);
|
|
@@ -587,7 +587,7 @@ function Ue(t, e, n = {}) {
|
|
|
587
587
|
let c;
|
|
588
588
|
for (let u = 0; u <= l; u++) {
|
|
589
589
|
c = p.oldStart + v - 1;
|
|
590
|
-
const w =
|
|
590
|
+
const w = Qe(c, o, C);
|
|
591
591
|
for (; c !== void 0 && (x = h(p.lines, c, u), !x); c = w())
|
|
592
592
|
;
|
|
593
593
|
if (x)
|
|
@@ -910,9 +910,9 @@ 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
|
-
}, ut = (t, e, n) => e in t ?
|
|
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) => {
|
|
@@ -920,8 +920,8 @@ var ft = Object.create, Q = Object.defineProperty, at = Object.getOwnPropertyDes
|
|
|
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 = [Ne(["jsdiff"]), Pe(
|
|
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")
|
|
@@ -957,10 +957,10 @@ class j extends (Ce = G) {
|
|
|
957
957
|
};
|
|
958
958
|
}
|
|
959
959
|
start() {
|
|
960
|
-
this.ctx.set("quickDiff", this), this.ctx.on("
|
|
960
|
+
this.ctx.set("quickDiff", this), this.ctx.on("quick-edit/wiki-page", this.injectQuickEdit.bind(this)), window.RLQ.push(this.injectHistoryPage.bind(this));
|
|
961
961
|
}
|
|
962
962
|
stop() {
|
|
963
|
-
this.ctx.off("
|
|
963
|
+
this.ctx.off("quick-edit/wiki-page", this.injectQuickEdit.bind(this));
|
|
964
964
|
}
|
|
965
965
|
injectHistoryPage() {
|
|
966
966
|
const e = lt("#mw-history-compare");
|
|
@@ -1123,9 +1123,9 @@ class j extends (Ce = G) {
|
|
|
1123
1123
|
}), n.show();
|
|
1124
1124
|
}
|
|
1125
1125
|
}
|
|
1126
|
-
|
|
1127
|
-
j = wt(
|
|
1128
|
-
pt(
|
|
1126
|
+
Q = dt(Ce);
|
|
1127
|
+
j = wt(Q, 0, "PluginQuickDiffCore", ke, j);
|
|
1128
|
+
pt(Q, 1, j);
|
|
1129
1129
|
class Ct extends G {
|
|
1130
1130
|
constructor(e) {
|
|
1131
1131
|
super(e, {}, "quick-diff-loader"), this.ctx = e, e.plugin(tt), e.plugin(j);
|
|
@@ -1137,4 +1137,4 @@ class Ct extends G {
|
|
|
1137
1137
|
export {
|
|
1138
1138
|
Ct as PluginQuickDiff
|
|
1139
1139
|
};
|
|
1140
|
-
//# sourceMappingURL=index-
|
|
1140
|
+
//# sourceMappingURL=index-D1plOuGc.js.map
|