@inpageedit/core 0.8.0 → 0.8.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/LICENSE +20 -20
- package/README.md +55 -55
- package/dist/ActionButton-BgbTKTg7.js.map +1 -1
- package/dist/CheckBox-D3rHnX7I.js.map +1 -1
- package/dist/{IconQuickEdit-YVn1ANbm.js → IconQuickEdit-CAL1HXIb.js} +4 -4
- package/dist/IconQuickEdit-CAL1HXIb.js.map +1 -0
- package/dist/InputBox-BV4m05Xs.js.map +1 -1
- package/dist/Preferences-Bg3J5Ur9.js.map +1 -1
- package/dist/RadioBox-nJqWsxW2.js.map +1 -1
- package/dist/__test__/utils/constants.d.ts +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/index-9M1QcjCN.js +354 -0
- package/dist/index-9M1QcjCN.js.map +1 -0
- package/dist/{index-C0V2s48o.js → index-Ba7Wkale.js} +38 -33
- package/dist/index-Ba7Wkale.js.map +1 -0
- package/dist/index-Bh70Udzi.js.map +1 -1
- package/dist/{index--xn9BebC.js → index-C8dOYIIz.js} +61 -69
- package/dist/{index--xn9BebC.js.map → index-C8dOYIIz.js.map} +1 -1
- package/dist/{index-DpLwTw4C.js → index-COlXHFRg.js} +2599 -2080
- package/dist/index-COlXHFRg.js.map +1 -0
- package/dist/{index-DTA86mHU.js → index-CeXR4lOu.js} +5 -5
- package/dist/index-CeXR4lOu.js.map +1 -0
- package/dist/index-CvhkVj_L.js.map +1 -1
- package/dist/{index-VzP81S7B.js → index-DBV8FBjA.js} +2 -2
- package/dist/index-DBV8FBjA.js.map +1 -0
- package/dist/{index-DlgTb4XY.js → index-DwyuBkCK.js} +3 -3
- package/dist/index-DwyuBkCK.js.map +1 -0
- package/dist/{index-DDWds9Jg.js → index-OBerV4GU.js} +28 -28
- package/dist/index-OBerV4GU.js.map +1 -0
- package/dist/{index-TzKe6Ebm.js → index-Tn22YSmW.js} +2 -2
- package/dist/index-Tn22YSmW.js.map +1 -0
- package/dist/index-kRdAN8h3.js +193 -0
- package/dist/index-kRdAN8h3.js.map +1 -0
- package/dist/index-lZkYoUca.js.map +1 -1
- package/dist/{index-BT1mN_St.js → index-mntCdHRr.js} +3 -3
- package/dist/{index-BT1mN_St.js.map → index-mntCdHRr.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/makeCallable-LDU0xZMJ.js.map +1 -1
- package/dist/models/WikiTitle/index.d.ts +1 -0
- package/dist/noop-ClDc6zv4.js.map +1 -1
- package/dist/plugins/in-article-links/index.d.ts +1 -1
- package/dist/plugins/quick-delete/index.d.ts +1 -1
- package/dist/plugins/quick-diff/PluginQuickDiffCore.d.ts +1 -1
- package/dist/plugins/quick-edit/index.d.ts +1 -1
- package/dist/plugins/quick-preview/index.d.ts +1 -1
- package/dist/services/CurrentPageService.d.ts +27 -0
- package/dist/services/{ModalService/index.d.ts → ModalService.d.ts} +4 -4
- package/dist/services/WikiTitleService.d.ts +19 -7
- package/dist/style.css +1 -1
- package/lib/index.umd.js +34 -35
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +7 -6
- package/dist/IconQuickEdit-YVn1ANbm.js.map +0 -1
- package/dist/index-C0V2s48o.js.map +0 -1
- package/dist/index-DDWds9Jg.js.map +0 -1
- package/dist/index-DDef1ojx.js +0 -166
- package/dist/index-DDef1ojx.js.map +0 -1
- package/dist/index-DTA86mHU.js.map +0 -1
- package/dist/index-DlgTb4XY.js.map +0 -1
- package/dist/index-DpLwTw4C.js.map +0 -1
- package/dist/index-TzKe6Ebm.js.map +0 -1
- package/dist/index-VzP81S7B.js.map +0 -1
- package/dist/index-loWqosf7.js +0 -331
- package/dist/index-loWqosf7.js.map +0 -1
- package/dist/services/ModalService/IPEModal.d.ts +0 -235
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { j as a, F as
|
|
2
|
-
import { B as K, I as Se, S as P } from "./index-
|
|
3
|
-
import { I as Pe } from "./IconQuickEdit-
|
|
1
|
+
import { j as a, F as Ne, P as Ee } from "./index-CvhkVj_L.js";
|
|
2
|
+
import { B as K, I as Se, S as P } from "./index-COlXHFRg.js";
|
|
3
|
+
import { I as Pe } from "./IconQuickEdit-CAL1HXIb.js";
|
|
4
4
|
import { R as We } from "./Preferences-Bg3J5Ur9.js";
|
|
5
5
|
import { R as _e } from "./RadioBox-nJqWsxW2.js";
|
|
6
6
|
import { M as Oe } from "./index-lZkYoUca.js";
|
|
7
|
-
class
|
|
7
|
+
class N {
|
|
8
8
|
diff(e, n, i = {}) {
|
|
9
9
|
let s;
|
|
10
10
|
typeof i == "function" ? (s = i, i = {}) : "callback" in i && (s = i.callback);
|
|
@@ -36,8 +36,8 @@ class E {
|
|
|
36
36
|
p && (w[d - 1] = void 0);
|
|
37
37
|
let D = !1;
|
|
38
38
|
if (k) {
|
|
39
|
-
const
|
|
40
|
-
D = k && 0 <=
|
|
39
|
+
const E = k.oldPos - d;
|
|
40
|
+
D = k && 0 <= E && E < o;
|
|
41
41
|
}
|
|
42
42
|
const b = p && p.oldPos + 1 < f;
|
|
43
43
|
if (!D && !b) {
|
|
@@ -135,7 +135,7 @@ class E {
|
|
|
135
135
|
return s;
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
class Te extends
|
|
138
|
+
class Te extends N {
|
|
139
139
|
}
|
|
140
140
|
const ee = new Te();
|
|
141
141
|
function te(t, e, n) {
|
|
@@ -162,7 +162,7 @@ function $(t, e, n) {
|
|
|
162
162
|
throw Error(`string ${JSON.stringify(t)} doesn't start with prefix ${JSON.stringify(e)}; this is a bug`);
|
|
163
163
|
return n + t.slice(e.length);
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function H(t, e, n) {
|
|
166
166
|
if (!e)
|
|
167
167
|
return t + n;
|
|
168
168
|
if (t.slice(-e.length) != e)
|
|
@@ -173,7 +173,7 @@ function W(t, e) {
|
|
|
173
173
|
return $(t, e, "");
|
|
174
174
|
}
|
|
175
175
|
function O(t, e) {
|
|
176
|
-
return
|
|
176
|
+
return H(t, e, "");
|
|
177
177
|
}
|
|
178
178
|
function X(t, e) {
|
|
179
179
|
return e.slice(0, Le(t, e));
|
|
@@ -204,7 +204,7 @@ function Fe(t) {
|
|
|
204
204
|
`) && !t.startsWith(`
|
|
205
205
|
`) && !t.match(/[^\r]\n/);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Ae(t) {
|
|
208
208
|
return !t.includes(`\r
|
|
209
209
|
`) && t.includes(`
|
|
210
210
|
`);
|
|
@@ -219,8 +219,8 @@ function S(t) {
|
|
|
219
219
|
const e = t.match(/^\s*/);
|
|
220
220
|
return e ? e[0] : "";
|
|
221
221
|
}
|
|
222
|
-
const L = "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}",
|
|
223
|
-
class Ie extends
|
|
222
|
+
const L = "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}", je = new RegExp(`[${L}]+|\\s+|[^${L}]`, "ug");
|
|
223
|
+
class Ie extends N {
|
|
224
224
|
equals(e, n, i) {
|
|
225
225
|
return i.ignoreCase && (e = e.toLowerCase(), n = n.toLowerCase()), e.trim() === n.trim();
|
|
226
226
|
}
|
|
@@ -232,7 +232,7 @@ class Ie extends E {
|
|
|
232
232
|
throw new Error('The segmenter passed must have a granularity of "word"');
|
|
233
233
|
i = Array.from(l.segment(e), (o) => o.segment);
|
|
234
234
|
} else
|
|
235
|
-
i = e.match(
|
|
235
|
+
i = e.match(je) || [];
|
|
236
236
|
const s = [];
|
|
237
237
|
let r = null;
|
|
238
238
|
return i.forEach((l) => {
|
|
@@ -260,7 +260,7 @@ function Z(t, e, n, i) {
|
|
|
260
260
|
const s = S(e.value), r = _(e.value), l = S(n.value), o = _(n.value);
|
|
261
261
|
if (t) {
|
|
262
262
|
const f = V(s, l);
|
|
263
|
-
t.value =
|
|
263
|
+
t.value = H(t.value, l, f), e.value = W(e.value, f), n.value = W(n.value, f);
|
|
264
264
|
}
|
|
265
265
|
if (i) {
|
|
266
266
|
const f = Y(r, o);
|
|
@@ -279,7 +279,7 @@ function Z(t, e, n, i) {
|
|
|
279
279
|
const s = S(i.value), r = S(e.value), l = _(e.value), o = V(s, r);
|
|
280
280
|
e.value = W(e.value, o);
|
|
281
281
|
const f = Y(W(s, o), l);
|
|
282
|
-
e.value = O(e.value, f), i.value = $(i.value, s, f), t.value =
|
|
282
|
+
e.value = O(e.value, f), i.value = $(i.value, s, f), t.value = H(t.value, s, s.slice(0, s.length - f.length));
|
|
283
283
|
} else if (i) {
|
|
284
284
|
const s = S(i.value), r = _(e.value), l = X(r, s);
|
|
285
285
|
e.value = O(e.value, l);
|
|
@@ -288,7 +288,7 @@ function Z(t, e, n, i) {
|
|
|
288
288
|
e.value = W(e.value, l);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
class ze extends
|
|
291
|
+
class ze extends N {
|
|
292
292
|
tokenize(e) {
|
|
293
293
|
const n = new RegExp(`(\\r?\\n)|[${L}]+|[^\\S\\n\\r]+|[^${L}]`, "ug");
|
|
294
294
|
return e.match(n) || [];
|
|
@@ -306,7 +306,7 @@ function $e(t, e) {
|
|
|
306
306
|
Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
307
307
|
return e;
|
|
308
308
|
}
|
|
309
|
-
class
|
|
309
|
+
class He extends N {
|
|
310
310
|
constructor() {
|
|
311
311
|
super(...arguments), this.tokenize = le;
|
|
312
312
|
}
|
|
@@ -318,7 +318,7 @@ class qe extends E {
|
|
|
318
318
|
`) && (n = n.slice(0, -1))), super.equals(e, n, i);
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
const R = new
|
|
321
|
+
const R = new He();
|
|
322
322
|
function F(t, e, n) {
|
|
323
323
|
return R.diff(t, e, n);
|
|
324
324
|
}
|
|
@@ -336,10 +336,10 @@ function le(t, e) {
|
|
|
336
336
|
}
|
|
337
337
|
return n;
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function qe(t) {
|
|
340
340
|
return t == "." || t == "!" || t == "?";
|
|
341
341
|
}
|
|
342
|
-
class Me extends
|
|
342
|
+
class Me extends N {
|
|
343
343
|
tokenize(e) {
|
|
344
344
|
var n;
|
|
345
345
|
const i = [];
|
|
@@ -349,7 +349,7 @@ class Me extends E {
|
|
|
349
349
|
i.push(e.slice(s));
|
|
350
350
|
break;
|
|
351
351
|
}
|
|
352
|
-
if (
|
|
352
|
+
if (qe(e[r]) && e[r + 1].match(/\s/)) {
|
|
353
353
|
for (i.push(e.slice(s, r + 1)), r = s = r + 1; !((n = e[r + 1]) === null || n === void 0) && n.match(/\s/); )
|
|
354
354
|
r++;
|
|
355
355
|
i.push(e.slice(s, r + 1)), s = r + 1;
|
|
@@ -362,7 +362,7 @@ const oe = new Me();
|
|
|
362
362
|
function fe(t, e, n) {
|
|
363
363
|
return oe.diff(t, e, n);
|
|
364
364
|
}
|
|
365
|
-
class Re extends
|
|
365
|
+
class Re extends N {
|
|
366
366
|
tokenize(e) {
|
|
367
367
|
return e.split(/([{}:;,]|\s+)/);
|
|
368
368
|
}
|
|
@@ -371,7 +371,7 @@ const ae = new Re();
|
|
|
371
371
|
function ce(t, e, n) {
|
|
372
372
|
return ae.diff(t, e, n);
|
|
373
373
|
}
|
|
374
|
-
class Je extends
|
|
374
|
+
class Je extends N {
|
|
375
375
|
constructor() {
|
|
376
376
|
super(...arguments), this.tokenize = le;
|
|
377
377
|
}
|
|
@@ -380,7 +380,7 @@ class Je extends E {
|
|
|
380
380
|
}
|
|
381
381
|
castInput(e, n) {
|
|
382
382
|
const { undefinedReplacement: i, stringifyReplacer: s = (r, l) => typeof l > "u" ? i : l } = n;
|
|
383
|
-
return typeof e == "string" ? e : JSON.stringify(
|
|
383
|
+
return typeof e == "string" ? e : JSON.stringify(A(e, null, null, s), null, " ");
|
|
384
384
|
}
|
|
385
385
|
equals(e, n, i) {
|
|
386
386
|
return super.equals(e.replace(/,([\r\n])/g, "$1"), n.replace(/,([\r\n])/g, "$1"), i);
|
|
@@ -390,7 +390,7 @@ const ue = new Je();
|
|
|
390
390
|
function de(t, e, n) {
|
|
391
391
|
return ue.diff(t, e, n);
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function A(t, e, n, i, s) {
|
|
394
394
|
e = e || [], n = n || [], i && (t = i(s === void 0 ? "" : s, t));
|
|
395
395
|
let r;
|
|
396
396
|
for (r = 0; r < e.length; r += 1)
|
|
@@ -399,7 +399,7 @@ function j(t, e, n, i, s) {
|
|
|
399
399
|
let l;
|
|
400
400
|
if (Object.prototype.toString.call(t) === "[object Array]") {
|
|
401
401
|
for (e.push(t), l = new Array(t.length), n.push(l), r = 0; r < t.length; r += 1)
|
|
402
|
-
l[r] =
|
|
402
|
+
l[r] = A(t[r], e, n, i, String(r));
|
|
403
403
|
return e.pop(), n.pop(), l;
|
|
404
404
|
}
|
|
405
405
|
if (t && t.toJSON && (t = t.toJSON()), typeof t == "object" && t !== null) {
|
|
@@ -409,13 +409,13 @@ function j(t, e, n, i, s) {
|
|
|
409
409
|
for (f in t)
|
|
410
410
|
Object.prototype.hasOwnProperty.call(t, f) && o.push(f);
|
|
411
411
|
for (o.sort(), r = 0; r < o.length; r += 1)
|
|
412
|
-
f = o[r], l[f] =
|
|
412
|
+
f = o[r], l[f] = A(t[f], e, n, i, f);
|
|
413
413
|
e.pop(), n.pop();
|
|
414
414
|
} else
|
|
415
415
|
l = t;
|
|
416
416
|
return l;
|
|
417
417
|
}
|
|
418
|
-
class Ue extends
|
|
418
|
+
class Ue extends N {
|
|
419
419
|
tokenize(e) {
|
|
420
420
|
return e.slice();
|
|
421
421
|
}
|
|
@@ -528,7 +528,7 @@ function pe(t, e, n = {}) {
|
|
|
528
528
|
return Ye(t, i[0], n);
|
|
529
529
|
}
|
|
530
530
|
function Ye(t, e, n = {}) {
|
|
531
|
-
(n.autoConvertLineEndings || n.autoConvertLineEndings == null) && (Fe(t) && Qe(e) ? e = ge(e) :
|
|
531
|
+
(n.autoConvertLineEndings || n.autoConvertLineEndings == null) && (Fe(t) && Qe(e) ? e = ge(e) : Ae(t) && Be(e) && (e = ve(e)));
|
|
532
532
|
const i = t.split(`
|
|
533
533
|
`), s = e.hunks, r = n.compareLine || ((m, v, x, C) => v === C), l = n.fuzzFactor || 0;
|
|
534
534
|
let o = 0;
|
|
@@ -558,19 +558,19 @@ function Ye(t, e, n = {}) {
|
|
|
558
558
|
function g(m, v, x, C = 0, d = !0, u = [], p = 0) {
|
|
559
559
|
let k = 0, D = !1;
|
|
560
560
|
for (; C < m.length; C++) {
|
|
561
|
-
const b = m[C],
|
|
562
|
-
if (
|
|
563
|
-
if (r(v + 1, i[v],
|
|
561
|
+
const b = m[C], E = b.length > 0 ? b[0] : " ", z = b.length > 0 ? b.substr(1) : b;
|
|
562
|
+
if (E === "-")
|
|
563
|
+
if (r(v + 1, i[v], E, z))
|
|
564
564
|
v++, k = 0;
|
|
565
565
|
else
|
|
566
566
|
return !x || i[v] == null ? null : (u[p] = i[v], g(m, v + 1, x - 1, C, !1, u, p + 1));
|
|
567
|
-
if (
|
|
567
|
+
if (E === "+") {
|
|
568
568
|
if (!d)
|
|
569
569
|
return null;
|
|
570
570
|
u[p] = z, p++, k = 0, D = !0;
|
|
571
571
|
}
|
|
572
|
-
if (
|
|
573
|
-
if (k++, u[p] = i[v], r(v + 1, i[v],
|
|
572
|
+
if (E === " ")
|
|
573
|
+
if (k++, u[p] = i[v], r(v + 1, i[v], E, z))
|
|
574
574
|
p++, d = !0, D = !1, v++;
|
|
575
575
|
else
|
|
576
576
|
return D || !x ? null : i[v] && (g(m, v + 1, x - 1, C + 1, !1, u, p + 1) || g(m, v + 1, x - 1, C, !1, u, p + 1)) || g(m, v, x - 1, C + 1, !1, u, p);
|
|
@@ -639,7 +639,7 @@ function we(t) {
|
|
|
639
639
|
lines: e.lines.map((n) => n.startsWith("-") ? `+${n.slice(1)}` : n.startsWith("+") ? `-${n.slice(1)}` : n)
|
|
640
640
|
})) });
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function q(t, e, n, i, s, r, l) {
|
|
643
643
|
let o;
|
|
644
644
|
l ? typeof l == "function" ? o = { callback: l } : o = l : o = {}, typeof o.context > "u" && (o.context = 4);
|
|
645
645
|
const f = o.context;
|
|
@@ -708,9 +708,9 @@ function H(t, e, n, i, s, r, l) {
|
|
|
708
708
|
};
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function j(t) {
|
|
712
712
|
if (Array.isArray(t))
|
|
713
|
-
return t.map(
|
|
713
|
+
return t.map(j).join(`
|
|
714
714
|
`);
|
|
715
715
|
const e = [];
|
|
716
716
|
t.oldFileName == t.newFileName && e.push("Index: " + t.oldFileName), e.push("==================================================================="), e.push("--- " + t.oldFileName + (typeof t.oldHeader > "u" ? "" : " " + t.oldHeader)), e.push("+++ " + t.newFileName + (typeof t.newHeader > "u" ? "" : " " + t.newHeader));
|
|
@@ -727,12 +727,12 @@ function A(t) {
|
|
|
727
727
|
function U(t, e, n, i, s, r, l) {
|
|
728
728
|
if (typeof l == "function" && (l = { callback: l }), l?.callback) {
|
|
729
729
|
const { callback: o } = l;
|
|
730
|
-
|
|
731
|
-
o(f ?
|
|
730
|
+
q(t, e, n, i, s, r, Object.assign(Object.assign({}, l), { callback: (f) => {
|
|
731
|
+
o(f ? j(f) : void 0);
|
|
732
732
|
} }));
|
|
733
733
|
} else {
|
|
734
|
-
const o =
|
|
735
|
-
return o ?
|
|
734
|
+
const o = q(t, e, n, i, s, r, l);
|
|
735
|
+
return o ? j(o) : void 0;
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
function Ze(t, e, n, i, s, r) {
|
|
@@ -766,11 +766,11 @@ function tt(t) {
|
|
|
766
766
|
}
|
|
767
767
|
const nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
768
768
|
__proto__: null,
|
|
769
|
-
Diff:
|
|
769
|
+
Diff: N,
|
|
770
770
|
applyPatch: pe,
|
|
771
771
|
applyPatches: Xe,
|
|
772
772
|
arrayDiff: me,
|
|
773
|
-
canonicalize:
|
|
773
|
+
canonicalize: A,
|
|
774
774
|
characterDiff: ee,
|
|
775
775
|
convertChangesToDMP: Ke,
|
|
776
776
|
convertChangesToXML: et,
|
|
@@ -786,13 +786,13 @@ const nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
786
786
|
diffTrimmedLines: se,
|
|
787
787
|
diffWords: ie,
|
|
788
788
|
diffWordsWithSpace: M,
|
|
789
|
-
formatPatch:
|
|
789
|
+
formatPatch: j,
|
|
790
790
|
jsonDiff: ue,
|
|
791
791
|
lineDiff: R,
|
|
792
792
|
parsePatch: J,
|
|
793
793
|
reversePatch: we,
|
|
794
794
|
sentenceDiff: oe,
|
|
795
|
-
structuredPatch:
|
|
795
|
+
structuredPatch: q,
|
|
796
796
|
wordDiff: ne,
|
|
797
797
|
wordsWithSpaceDiff: re
|
|
798
798
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -870,7 +870,7 @@ const lt = new Intl.DateTimeFormat(void 0, {
|
|
|
870
870
|
) }),
|
|
871
871
|
/* @__PURE__ */ a("div", { className: "mw-diff-title--user", children: t.username && /* @__PURE__ */ a(st, { ctx: t.ctx, user: t.username, target: "_blank" }) }),
|
|
872
872
|
/* @__PURE__ */ a("div", { className: "mw-diff-title--timestamp", children: t.timestamp && lt(new Date(t.timestamp)) }),
|
|
873
|
-
/* @__PURE__ */ a("div", { className: "mw-diff-title--comment", children: t.parsedcomment && /* @__PURE__ */ a(
|
|
873
|
+
/* @__PURE__ */ a("div", { className: "mw-diff-title--comment", children: t.parsedcomment && /* @__PURE__ */ a(Ne, { children: [
|
|
874
874
|
"(",
|
|
875
875
|
/* @__PURE__ */ a("i", { innerHTML: t.parsedcomment }),
|
|
876
876
|
")"
|
|
@@ -1021,7 +1021,6 @@ class I extends (be = K) {
|
|
|
1021
1021
|
this.ctx.set("quickDiff", this), this.ctx.on("quick-edit/wiki-page", this.injectQuickEdit.bind(this)), window.RLQ.push(this.injectHistoryPage.bind(this));
|
|
1022
1022
|
}
|
|
1023
1023
|
stop() {
|
|
1024
|
-
this.ctx.off("quick-edit/wiki-page", this.injectQuickEdit.bind(this));
|
|
1025
1024
|
}
|
|
1026
1025
|
injectHistoryPage() {
|
|
1027
1026
|
const e = at("#mw-history-compare");
|
|
@@ -1049,10 +1048,10 @@ class I extends (be = K) {
|
|
|
1049
1048
|
);
|
|
1050
1049
|
});
|
|
1051
1050
|
}
|
|
1052
|
-
injectQuickEdit({ modal: e, wikiPage: n }) {
|
|
1053
|
-
if (n.pageid === 0)
|
|
1051
|
+
injectQuickEdit({ modal: e, wikiPage: n, options: i }) {
|
|
1052
|
+
if (n.pageid === 0 || i.section === "new")
|
|
1054
1053
|
return;
|
|
1055
|
-
let
|
|
1054
|
+
let s;
|
|
1056
1055
|
e.addButton(
|
|
1057
1056
|
{
|
|
1058
1057
|
label: "Diff",
|
|
@@ -1060,26 +1059,26 @@ class I extends (be = K) {
|
|
|
1060
1059
|
keyPress: "ctrl-d",
|
|
1061
1060
|
className: "btn btn-secondary",
|
|
1062
1061
|
method: () => {
|
|
1063
|
-
const
|
|
1064
|
-
return
|
|
1062
|
+
const r = n.title, l = n.revisions?.[0]?.content || "", o = e.get$content().querySelector('textarea[name="text"]')?.value || "";
|
|
1063
|
+
return l === o ? this.ctx.modal.notify("info", { title: "Quick Diff", content: "No changes" }) : (s = this.comparePages(
|
|
1065
1064
|
{
|
|
1066
|
-
fromtitle:
|
|
1067
|
-
fromtext:
|
|
1068
|
-
totitle:
|
|
1069
|
-
totext:
|
|
1065
|
+
fromtitle: r,
|
|
1066
|
+
fromtext: l,
|
|
1067
|
+
totitle: r,
|
|
1068
|
+
totext: o,
|
|
1070
1069
|
topst: !0
|
|
1071
1070
|
},
|
|
1072
|
-
|
|
1071
|
+
s,
|
|
1073
1072
|
{
|
|
1074
1073
|
backdrop: !1,
|
|
1075
1074
|
draggable: !0
|
|
1076
1075
|
}
|
|
1077
|
-
),
|
|
1076
|
+
), s);
|
|
1078
1077
|
}
|
|
1079
1078
|
},
|
|
1080
1079
|
2
|
|
1081
1080
|
), e.on(e.Event.Close, () => {
|
|
1082
|
-
|
|
1081
|
+
s?.destroy(), s = void 0;
|
|
1083
1082
|
});
|
|
1084
1083
|
}
|
|
1085
1084
|
simpleTextDiff(e, n) {
|
|
@@ -1166,7 +1165,7 @@ class I extends (be = K) {
|
|
|
1166
1165
|
"section",
|
|
1167
1166
|
{
|
|
1168
1167
|
style: { height: "70vh", display: "flex", justifyContent: "center", alignItems: "center" },
|
|
1169
|
-
children: /* @__PURE__ */ a(
|
|
1168
|
+
children: /* @__PURE__ */ a(Ee, {})
|
|
1170
1169
|
}
|
|
1171
1170
|
)
|
|
1172
1171
|
), n.bringToFront(), window.mw && mw.loader.getState("mediawiki.diff.styles") !== "ready" && mw.loader.load(["mediawiki.diff.styles"]), this.ctx.api.post({
|
|
@@ -1176,13 +1175,6 @@ class I extends (be = K) {
|
|
|
1176
1175
|
format: "json",
|
|
1177
1176
|
formatversion: 2
|
|
1178
1177
|
}).then((s) => {
|
|
1179
|
-
if (s.data?.error || s.data?.errors) {
|
|
1180
|
-
const o = [s.data?.error, ...s.data?.errors || []].filter(
|
|
1181
|
-
Boolean
|
|
1182
|
-
);
|
|
1183
|
-
throw new Error(o.map((f) => f.info).join(`
|
|
1184
|
-
`), { cause: s });
|
|
1185
|
-
}
|
|
1186
1178
|
if (!s.data.compare)
|
|
1187
1179
|
throw new Error("No compare data received", { cause: s });
|
|
1188
1180
|
const {
|
|
@@ -1254,4 +1246,4 @@ class St extends K {
|
|
|
1254
1246
|
export {
|
|
1255
1247
|
St as PluginQuickDiff
|
|
1256
1248
|
};
|
|
1257
|
-
//# sourceMappingURL=index
|
|
1249
|
+
//# sourceMappingURL=index-C8dOYIIz.js.map
|