@inpageedit/core 0.2.0 → 0.3.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-ByMKIthQ.js +24 -0
- package/dist/ActionButton-ByMKIthQ.js.map +1 -0
- package/dist/{InputBox-B-BAGjgs.js → InputBox-FIzJ-rPN.js} +2 -2
- package/dist/InputBox-FIzJ-rPN.js.map +1 -0
- package/dist/Preferences-Bg3J5Ur9.js.map +1 -1
- package/dist/{RadioBox-CQ9xz5nk.js → RadioBox-BZFhTEo5.js} +2 -2
- package/dist/RadioBox-BZFhTEo5.js.map +1 -0
- package/dist/components/ActionButton.d.ts +6 -9
- package/dist/components/index.d.ts +7 -7
- package/dist/components/index.js +6 -6
- package/dist/components/index.js.map +1 -1
- package/dist/{index-Do5exwYg.js → index-BByzm2Fz.js} +172 -171
- package/dist/index-BByzm2Fz.js.map +1 -0
- package/dist/{index-wYcxrK6G.js → index-BPsDFq9U.js} +2 -2
- package/dist/index-BPsDFq9U.js.map +1 -0
- package/dist/{index-vjK9PEyV.js → index-BsYzf3Yw.js} +2 -2
- package/dist/index-BsYzf3Yw.js.map +1 -0
- package/dist/index-BzhKErte.js +4677 -0
- package/dist/index-BzhKErte.js.map +1 -0
- package/dist/{index-CavCnbOz.js → index-Ch5DJDZZ.js} +4 -4
- package/dist/index-Ch5DJDZZ.js.map +1 -0
- package/dist/{index-C6PwuH_U.js → index-Cq9xxVsu.js} +13 -24
- package/dist/index-Cq9xxVsu.js.map +1 -0
- package/dist/{index-B02kaEy5.js → index-CqM9JQKf.js} +13 -14
- package/dist/index-CqM9JQKf.js.map +1 -0
- package/dist/{index-D3QOS3-Q.js → index-CvhkVj_L.js} +81 -68
- package/dist/index-CvhkVj_L.js.map +1 -0
- package/dist/{index-BIFsoDor.js → index-HyxA2rYz.js} +4 -4
- package/dist/index-HyxA2rYz.js.map +1 -0
- package/dist/{index-D1nQg-aN.js → index-X1X416tZ.js} +36 -35
- package/dist/index-X1X416tZ.js.map +1 -0
- package/dist/index.js +2976 -2909
- package/dist/index.js.map +1 -1
- package/dist/plugins/preferences/{PluginPreferencesUI.d.ts → ui/index.d.ts} +3 -2
- package/dist/sleep-DpyIipK-.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/{plugins/preferences/components/hooks.d.ts → utils/vueHooks.d.ts} +1 -1
- package/lib/index.umd.js +57 -2620
- package/lib/index.umd.js.map +1 -0
- package/lib/style.css +1 -1
- package/package.json +8 -3
- package/dist/ActionButton-DkQu8dfH.js +0 -33
- package/dist/ActionButton-DkQu8dfH.js.map +0 -1
- package/dist/InputBox-B-BAGjgs.js.map +0 -1
- package/dist/PluginPreferencesUI-CHdAGK8T.js +0 -33922
- package/dist/PluginPreferencesUI-CHdAGK8T.js.map +0 -1
- package/dist/RadioBox-CQ9xz5nk.js.map +0 -1
- package/dist/i18n/languages.json +0 -1527
- package/dist/index-B02kaEy5.js.map +0 -1
- package/dist/index-BIFsoDor.js.map +0 -1
- package/dist/index-C6PwuH_U.js.map +0 -1
- package/dist/index-CavCnbOz.js.map +0 -1
- package/dist/index-D1nQg-aN.js.map +0 -1
- package/dist/index-D3QOS3-Q.js.map +0 -1
- package/dist/index-Do5exwYg.js.map +0 -1
- package/dist/index-vjK9PEyV.js.map +0 -1
- package/dist/index-wYcxrK6G.js.map +0 -1
- package/dist/utils/schemaValidator.d.ts +0 -12
- package/lib/i18n/languages.json +0 -1527
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as m, F as
|
|
2
|
-
import { BasePlugin as
|
|
3
|
-
import { R as
|
|
4
|
-
import { R as
|
|
5
|
-
class
|
|
1
|
+
import { j as m, F as Pe, P as be } from "./index-CvhkVj_L.js";
|
|
2
|
+
import { BasePlugin as G, Inject as Se, Schema as E } from "./index.js";
|
|
3
|
+
import { R as Ne } from "./Preferences-Bg3J5Ur9.js";
|
|
4
|
+
import { R as Ee, M as We } from "./RadioBox-BZFhTEo5.js";
|
|
5
|
+
class b {
|
|
6
6
|
diff(e, n, i = {}) {
|
|
7
7
|
let s;
|
|
8
8
|
typeof i == "function" ? (s = i, i = {}) : "callback" in i && (s = i.callback);
|
|
@@ -32,17 +32,17 @@ class S {
|
|
|
32
32
|
let c;
|
|
33
33
|
const w = v[u - 1], k = v[u + 1];
|
|
34
34
|
w && (v[u - 1] = void 0);
|
|
35
|
-
let
|
|
35
|
+
let P = !1;
|
|
36
36
|
if (k) {
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const S = k.oldPos - u;
|
|
38
|
+
P = k && 0 <= S && S < o;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
40
|
+
const D = w && w.oldPos + 1 < f;
|
|
41
|
+
if (!P && !D) {
|
|
42
42
|
v[u] = void 0;
|
|
43
43
|
continue;
|
|
44
44
|
}
|
|
45
|
-
if (!
|
|
45
|
+
if (!D || P && w.oldPos < k.oldPos ? c = this.addToPath(k, !0, !1, 0, i) : c = this.addToPath(w, !1, !0, 1, i), d = this.extractCommon(c, n, e, u, i), c.oldPos + 1 >= f && d + 1 >= o)
|
|
46
46
|
return l(this.buildValues(c.lastComponent, n, e)) || !0;
|
|
47
47
|
v[u] = c, c.oldPos + 1 >= f && (x = Math.min(x, u - 1)), d + 1 >= o && (p = Math.max(p, u + 1));
|
|
48
48
|
}
|
|
@@ -133,20 +133,20 @@ class S {
|
|
|
133
133
|
return s;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
class
|
|
136
|
+
class _e extends b {
|
|
137
137
|
}
|
|
138
|
-
const
|
|
139
|
-
function
|
|
140
|
-
return
|
|
138
|
+
const K = new _e();
|
|
139
|
+
function ee(t, e, n) {
|
|
140
|
+
return K.diff(t, e, n);
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function U(t, e) {
|
|
143
143
|
let n;
|
|
144
144
|
for (n = 0; n < t.length && n < e.length; n++)
|
|
145
145
|
if (t[n] != e[n])
|
|
146
146
|
return t.slice(0, n);
|
|
147
147
|
return t.slice(0, n);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function V(t, e) {
|
|
150
150
|
let n;
|
|
151
151
|
if (!t || !e || t[t.length - 1] != e[e.length - 1])
|
|
152
152
|
return "";
|
|
@@ -173,10 +173,10 @@ function W(t, e) {
|
|
|
173
173
|
function O(t, e) {
|
|
174
174
|
return H(t, e, "");
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
return e.slice(0,
|
|
176
|
+
function Y(t, e) {
|
|
177
|
+
return e.slice(0, Oe(t, e));
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function Oe(t, e) {
|
|
180
180
|
let n = 0;
|
|
181
181
|
t.length > e.length && (n = t.length - e.length);
|
|
182
182
|
let i = e.length;
|
|
@@ -197,12 +197,12 @@ function Fe(t, e) {
|
|
|
197
197
|
}
|
|
198
198
|
return r;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function Te(t) {
|
|
201
201
|
return t.includes(`\r
|
|
202
202
|
`) && !t.startsWith(`
|
|
203
203
|
`) && !t.match(/[^\r]\n/);
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function Fe(t) {
|
|
206
206
|
return !t.includes(`\r
|
|
207
207
|
`) && t.includes(`
|
|
208
208
|
`);
|
|
@@ -213,12 +213,12 @@ function _(t) {
|
|
|
213
213
|
;
|
|
214
214
|
return t.substring(e + 1);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function N(t) {
|
|
217
217
|
const e = t.match(/^\s*/);
|
|
218
218
|
return e ? e[0] : "";
|
|
219
219
|
}
|
|
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}",
|
|
221
|
-
class
|
|
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 b {
|
|
222
222
|
equals(e, n, i) {
|
|
223
223
|
return i.ignoreCase && (e = e.toLowerCase(), n = n.toLowerCase()), e.trim() === n.trim();
|
|
224
224
|
}
|
|
@@ -230,7 +230,7 @@ class ze extends S {
|
|
|
230
230
|
throw new Error('The segmenter passed must have a granularity of "word"');
|
|
231
231
|
i = Array.from(l.segment(e), (o) => o.segment);
|
|
232
232
|
} else
|
|
233
|
-
i = e.match(
|
|
233
|
+
i = e.match(Ae) || [];
|
|
234
234
|
const s = [];
|
|
235
235
|
let r = null;
|
|
236
236
|
return i.forEach((l) => {
|
|
@@ -245,58 +245,58 @@ class ze extends S {
|
|
|
245
245
|
return e;
|
|
246
246
|
let i = null, s = null, r = null;
|
|
247
247
|
return e.forEach((l) => {
|
|
248
|
-
l.added ? s = l : l.removed ? r = l : ((s || r) &&
|
|
249
|
-
}), (s || r) &&
|
|
248
|
+
l.added ? s = l : l.removed ? r = l : ((s || r) && X(i, r, s, l), i = l, s = null, r = null);
|
|
249
|
+
}), (s || r) && X(i, r, s, null), e;
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
const
|
|
253
|
-
function
|
|
254
|
-
return n?.ignoreWhitespace != null && !n.ignoreWhitespace ? q(t, e, n) :
|
|
252
|
+
const te = new Le();
|
|
253
|
+
function ne(t, e, n) {
|
|
254
|
+
return n?.ignoreWhitespace != null && !n.ignoreWhitespace ? q(t, e, n) : te.diff(t, e, n);
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function X(t, e, n, i) {
|
|
257
257
|
if (e && n) {
|
|
258
|
-
const s =
|
|
258
|
+
const s = N(e.value), r = _(e.value), l = N(n.value), o = _(n.value);
|
|
259
259
|
if (t) {
|
|
260
|
-
const f =
|
|
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);
|
|
262
262
|
}
|
|
263
263
|
if (i) {
|
|
264
|
-
const f =
|
|
264
|
+
const f = V(r, o);
|
|
265
265
|
i.value = I(i.value, o, f), e.value = O(e.value, f), n.value = O(n.value, f);
|
|
266
266
|
}
|
|
267
267
|
} else if (n) {
|
|
268
268
|
if (t) {
|
|
269
|
-
const s =
|
|
269
|
+
const s = N(n.value);
|
|
270
270
|
n.value = n.value.substring(s.length);
|
|
271
271
|
}
|
|
272
272
|
if (i) {
|
|
273
|
-
const s =
|
|
273
|
+
const s = N(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 = N(i.value), r = N(e.value), l = _(e.value), o = U(s, r);
|
|
278
278
|
e.value = W(e.value, o);
|
|
279
|
-
const f =
|
|
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 = N(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 = N(e.value), l = Y(s, r);
|
|
286
286
|
e.value = W(e.value, l);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
class
|
|
289
|
+
class je extends b {
|
|
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
|
-
const
|
|
295
|
+
const ie = new je();
|
|
296
296
|
function q(t, e, n) {
|
|
297
|
-
return
|
|
297
|
+
return ie.diff(t, e, n);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function ze(t, e) {
|
|
300
300
|
if (typeof t == "function")
|
|
301
301
|
e.callback = t;
|
|
302
302
|
else if (t)
|
|
@@ -304,9 +304,9 @@ function He(t, e) {
|
|
|
304
304
|
Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
305
305
|
return e;
|
|
306
306
|
}
|
|
307
|
-
class
|
|
307
|
+
class Ie extends b {
|
|
308
308
|
constructor() {
|
|
309
|
-
super(...arguments), this.tokenize =
|
|
309
|
+
super(...arguments), this.tokenize = se;
|
|
310
310
|
}
|
|
311
311
|
equals(e, n, i) {
|
|
312
312
|
return i.ignoreWhitespace ? ((!i.newlineIsToken || !e.includes(`
|
|
@@ -316,14 +316,14 @@ class $e extends S {
|
|
|
316
316
|
`) && (n = n.slice(0, -1))), super.equals(e, n, i);
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
const M = new
|
|
319
|
+
const M = new Ie();
|
|
320
320
|
function F(t, e, n) {
|
|
321
321
|
return M.diff(t, e, n);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
return n =
|
|
323
|
+
function re(t, e, n) {
|
|
324
|
+
return n = ze(n, { ignoreWhitespace: !0 }), M.diff(t, e, n);
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function se(t, e) {
|
|
327
327
|
e.stripTrailingCr && (t = t.replace(/\r\n/g, `
|
|
328
328
|
`));
|
|
329
329
|
const n = [], i = t.split(/(\n|\r\n)/);
|
|
@@ -334,10 +334,10 @@ function oe(t, e) {
|
|
|
334
334
|
}
|
|
335
335
|
return n;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function He(t) {
|
|
338
338
|
return t == "." || t == "!" || t == "?";
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class $e extends b {
|
|
341
341
|
tokenize(e) {
|
|
342
342
|
var n;
|
|
343
343
|
const i = [];
|
|
@@ -347,7 +347,7 @@ class Me extends S {
|
|
|
347
347
|
i.push(e.slice(s));
|
|
348
348
|
break;
|
|
349
349
|
}
|
|
350
|
-
if (
|
|
350
|
+
if (He(e[r]) && e[r + 1].match(/\s/)) {
|
|
351
351
|
for (i.push(e.slice(s, r + 1)), r = s = r + 1; !((n = e[r + 1]) === null || n === void 0) && n.match(/\s/); )
|
|
352
352
|
r++;
|
|
353
353
|
i.push(e.slice(s, r + 1)), s = r + 1;
|
|
@@ -356,22 +356,22 @@ class Me extends S {
|
|
|
356
356
|
return i;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
const
|
|
360
|
-
function
|
|
361
|
-
return
|
|
359
|
+
const le = new $e();
|
|
360
|
+
function oe(t, e, n) {
|
|
361
|
+
return le.diff(t, e, n);
|
|
362
362
|
}
|
|
363
|
-
class
|
|
363
|
+
class qe extends b {
|
|
364
364
|
tokenize(e) {
|
|
365
365
|
return e.split(/([{}:;,]|\s+)/);
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
const
|
|
369
|
-
function
|
|
370
|
-
return
|
|
368
|
+
const fe = new qe();
|
|
369
|
+
function ae(t, e, n) {
|
|
370
|
+
return fe.diff(t, e, n);
|
|
371
371
|
}
|
|
372
|
-
class
|
|
372
|
+
class Me extends b {
|
|
373
373
|
constructor() {
|
|
374
|
-
super(...arguments), this.tokenize =
|
|
374
|
+
super(...arguments), this.tokenize = se;
|
|
375
375
|
}
|
|
376
376
|
get useLongestToken() {
|
|
377
377
|
return !0;
|
|
@@ -384,9 +384,9 @@ class Je extends S {
|
|
|
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 ce = new Me();
|
|
388
|
+
function ue(t, e, n) {
|
|
389
|
+
return ce.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
|
|
416
|
+
class Re extends b {
|
|
417
417
|
tokenize(e) {
|
|
418
418
|
return e.slice();
|
|
419
419
|
}
|
|
@@ -424,20 +424,20 @@ class Be extends S {
|
|
|
424
424
|
return e;
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
const
|
|
428
|
-
function
|
|
429
|
-
return
|
|
427
|
+
const de = new Re();
|
|
428
|
+
function me(t, e, n) {
|
|
429
|
+
return de.diff(t, e, n);
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
return Array.isArray(t) ? t.map((e) =>
|
|
431
|
+
function he(t) {
|
|
432
|
+
return Array.isArray(t) ? t.map((e) => he(e)) : Object.assign(Object.assign({}, t), { hunks: t.hunks.map((e) => Object.assign(Object.assign({}, e), { lines: e.lines.map((n, i) => {
|
|
433
433
|
var s;
|
|
434
434
|
return n.startsWith("\\") || n.endsWith("\r") || !((s = e.lines[i + 1]) === null || s === void 0) && s.startsWith("\\") ? n : n + "\r";
|
|
435
435
|
}) })) });
|
|
436
436
|
}
|
|
437
|
-
function
|
|
438
|
-
return Array.isArray(t) ? t.map((e) =>
|
|
437
|
+
function ge(t) {
|
|
438
|
+
return Array.isArray(t) ? t.map((e) => ge(e)) : Object.assign(Object.assign({}, t), { hunks: t.hunks.map((e) => Object.assign(Object.assign({}, e), { lines: e.lines.map((n) => n.endsWith("\r") ? n.substring(0, n.length - 1) : n) })) });
|
|
439
439
|
}
|
|
440
|
-
function
|
|
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
443
|
function Qe(t) {
|
|
@@ -507,7 +507,7 @@ function R(t) {
|
|
|
507
507
|
s();
|
|
508
508
|
return n;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Be(t, e, n) {
|
|
511
511
|
let i = !0, s = !1, r = !1, l = 1;
|
|
512
512
|
return function o() {
|
|
513
513
|
if (i && !r) {
|
|
@@ -519,14 +519,14 @@ function Ve(t, e, n) {
|
|
|
519
519
|
return r || (i = !0), e <= t - l ? t - l++ : (s = !0, o());
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function pe(t, e, n = {}) {
|
|
523
523
|
let i;
|
|
524
524
|
if (typeof e == "string" ? i = R(e) : Array.isArray(e) ? i = e : i = [e], i.length > 1)
|
|
525
525
|
throw new Error("applyPatch only works with a single input.");
|
|
526
|
-
return
|
|
526
|
+
return Ue(t, i[0], n);
|
|
527
527
|
}
|
|
528
|
-
function
|
|
529
|
-
(n.autoConvertLineEndings || n.autoConvertLineEndings == null) && (
|
|
528
|
+
function Ue(t, e, n = {}) {
|
|
529
|
+
(n.autoConvertLineEndings || n.autoConvertLineEndings == null) && (Te(t) && Je(e) ? e = he(e) : Fe(t) && Qe(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;
|
|
@@ -554,24 +554,24 @@ function Ye(t, e, n = {}) {
|
|
|
554
554
|
return !1;
|
|
555
555
|
}
|
|
556
556
|
function h(d, p, x, C = 0, u = !0, c = [], w = 0) {
|
|
557
|
-
let k = 0,
|
|
557
|
+
let k = 0, P = !1;
|
|
558
558
|
for (; C < d.length; C++) {
|
|
559
|
-
const
|
|
560
|
-
if (
|
|
561
|
-
if (r(p + 1, i[p],
|
|
559
|
+
const D = d[C], S = D.length > 0 ? D[0] : " ", z = D.length > 0 ? D.substr(1) : D;
|
|
560
|
+
if (S === "-")
|
|
561
|
+
if (r(p + 1, i[p], S, z))
|
|
562
562
|
p++, k = 0;
|
|
563
563
|
else
|
|
564
564
|
return !x || i[p] == null ? null : (c[w] = i[p], h(d, p + 1, x - 1, C, !1, c, w + 1));
|
|
565
|
-
if (
|
|
565
|
+
if (S === "+") {
|
|
566
566
|
if (!u)
|
|
567
567
|
return null;
|
|
568
|
-
c[w] = z, w++, k = 0,
|
|
568
|
+
c[w] = z, w++, k = 0, P = !0;
|
|
569
569
|
}
|
|
570
|
-
if (
|
|
571
|
-
if (k++, c[w] = i[p], r(p + 1, i[p],
|
|
572
|
-
w++, u = !0,
|
|
570
|
+
if (S === " ")
|
|
571
|
+
if (k++, c[w] = i[p], r(p + 1, i[p], S, z))
|
|
572
|
+
w++, u = !0, P = !1, p++;
|
|
573
573
|
else
|
|
574
|
-
return
|
|
574
|
+
return P || !x ? null : i[p] && (h(d, p + 1, x - 1, C + 1, !1, c, w + 1) || h(d, p + 1, x - 1, C, !1, c, w + 1)) || h(d, p, x - 1, C + 1, !1, c, w);
|
|
575
575
|
}
|
|
576
576
|
return w -= k, p -= k, c.length = w, {
|
|
577
577
|
patchedLines: c,
|
|
@@ -587,7 +587,7 @@ function Ye(t, e, n = {}) {
|
|
|
587
587
|
let u;
|
|
588
588
|
for (let c = 0; c <= l; c++) {
|
|
589
589
|
u = p.oldStart + v - 1;
|
|
590
|
-
const w =
|
|
590
|
+
const w = Be(u, o, C);
|
|
591
591
|
for (; u !== void 0 && (x = h(p.lines, u, c), !x); u = w())
|
|
592
592
|
;
|
|
593
593
|
if (x)
|
|
@@ -608,7 +608,7 @@ function Ye(t, e, n = {}) {
|
|
|
608
608
|
return y.join(`
|
|
609
609
|
`);
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function Ve(t, e) {
|
|
612
612
|
const n = typeof t == "string" ? R(t) : t;
|
|
613
613
|
let i = 0;
|
|
614
614
|
function s() {
|
|
@@ -618,7 +618,7 @@ function Xe(t, e) {
|
|
|
618
618
|
e.loadFile(r, function(l, o) {
|
|
619
619
|
if (l)
|
|
620
620
|
return e.complete(l);
|
|
621
|
-
const f =
|
|
621
|
+
const f = pe(o, r, e);
|
|
622
622
|
e.patched(r, f, function(g) {
|
|
623
623
|
if (g)
|
|
624
624
|
return e.complete(g);
|
|
@@ -628,8 +628,8 @@ function Xe(t, e) {
|
|
|
628
628
|
}
|
|
629
629
|
s();
|
|
630
630
|
}
|
|
631
|
-
function
|
|
632
|
-
return Array.isArray(t) ? t.map((e) =>
|
|
631
|
+
function we(t) {
|
|
632
|
+
return Array.isArray(t) ? t.map((e) => we(e)).reverse() : Object.assign(Object.assign({}, t), { oldFileName: t.newFileName, oldHeader: t.newHeader, newFileName: t.oldFileName, newHeader: t.oldHeader, hunks: t.hunks.map((e) => ({
|
|
633
633
|
oldLines: e.newLines,
|
|
634
634
|
oldStart: e.newStart,
|
|
635
635
|
newLines: e.oldLines,
|
|
@@ -663,7 +663,7 @@ function $(t, e, n, i, s, r, l) {
|
|
|
663
663
|
const y = [];
|
|
664
664
|
let v = 0, d = 0, p = [], x = 1, C = 1;
|
|
665
665
|
for (let u = 0; u < a.length; u++) {
|
|
666
|
-
const c = a[u], w = c.lines ||
|
|
666
|
+
const c = a[u], w = c.lines || Xe(c.value);
|
|
667
667
|
if (c.lines = w, c.added || c.removed) {
|
|
668
668
|
if (!v) {
|
|
669
669
|
const k = a[u - 1];
|
|
@@ -679,16 +679,16 @@ function $(t, e, n, i, s, r, l) {
|
|
|
679
679
|
p.push(k);
|
|
680
680
|
else {
|
|
681
681
|
const k = Math.min(w.length, f);
|
|
682
|
-
for (const
|
|
683
|
-
p.push(
|
|
684
|
-
const
|
|
682
|
+
for (const D of h(w.slice(0, k)))
|
|
683
|
+
p.push(D);
|
|
684
|
+
const P = {
|
|
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(P), v = 0, d = 0, p = [];
|
|
692
692
|
}
|
|
693
693
|
x += w.length, C += w.length;
|
|
694
694
|
}
|
|
@@ -733,75 +733,75 @@ function J(t, e, n, i, s, r, l) {
|
|
|
733
733
|
return o ? L(o) : void 0;
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function Ye(t, e, n, i, s, r) {
|
|
737
737
|
return J(t, t, e, n, i, s, r);
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function Xe(t) {
|
|
740
740
|
const e = t.endsWith(`
|
|
741
741
|
`), n = t.split(`
|
|
742
742
|
`).map((i) => i + `
|
|
743
743
|
`);
|
|
744
744
|
return e ? n.pop() : n.push(n.pop().slice(0, -1)), n;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Ze(t) {
|
|
747
747
|
const e = [];
|
|
748
748
|
let n, i;
|
|
749
749
|
for (let s = 0; s < t.length; s++)
|
|
750
750
|
n = t[s], n.added ? i = 1 : n.removed ? i = -1 : i = 0, e.push([i, n.value]);
|
|
751
751
|
return e;
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function Ge(t) {
|
|
754
754
|
const e = [];
|
|
755
755
|
for (let n = 0; n < t.length; n++) {
|
|
756
756
|
const i = t[n];
|
|
757
|
-
i.added ? e.push("<ins>") : i.removed && e.push("<del>"), e.push(
|
|
757
|
+
i.added ? e.push("<ins>") : i.removed && e.push("<del>"), e.push(Ke(i.value)), i.added ? e.push("</ins>") : i.removed && e.push("</del>");
|
|
758
758
|
}
|
|
759
759
|
return e.join("");
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function Ke(t) {
|
|
762
762
|
let e = t;
|
|
763
763
|
return e = e.replace(/&/g, "&"), e = e.replace(/</g, "<"), e = e.replace(/>/g, ">"), e = e.replace(/"/g, """), e;
|
|
764
764
|
}
|
|
765
|
-
const
|
|
765
|
+
const et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
766
766
|
__proto__: null,
|
|
767
|
-
Diff:
|
|
768
|
-
applyPatch:
|
|
769
|
-
applyPatches:
|
|
770
|
-
arrayDiff:
|
|
767
|
+
Diff: b,
|
|
768
|
+
applyPatch: pe,
|
|
769
|
+
applyPatches: Ve,
|
|
770
|
+
arrayDiff: de,
|
|
771
771
|
canonicalize: A,
|
|
772
|
-
characterDiff:
|
|
773
|
-
convertChangesToDMP:
|
|
774
|
-
convertChangesToXML:
|
|
775
|
-
createPatch:
|
|
772
|
+
characterDiff: K,
|
|
773
|
+
convertChangesToDMP: Ze,
|
|
774
|
+
convertChangesToXML: Ge,
|
|
775
|
+
createPatch: Ye,
|
|
776
776
|
createTwoFilesPatch: J,
|
|
777
|
-
cssDiff:
|
|
778
|
-
diffArrays:
|
|
779
|
-
diffChars:
|
|
780
|
-
diffCss:
|
|
781
|
-
diffJson:
|
|
777
|
+
cssDiff: fe,
|
|
778
|
+
diffArrays: me,
|
|
779
|
+
diffChars: ee,
|
|
780
|
+
diffCss: ae,
|
|
781
|
+
diffJson: ue,
|
|
782
782
|
diffLines: F,
|
|
783
|
-
diffSentences:
|
|
784
|
-
diffTrimmedLines:
|
|
785
|
-
diffWords:
|
|
783
|
+
diffSentences: oe,
|
|
784
|
+
diffTrimmedLines: re,
|
|
785
|
+
diffWords: ne,
|
|
786
786
|
diffWordsWithSpace: q,
|
|
787
787
|
formatPatch: L,
|
|
788
|
-
jsonDiff:
|
|
788
|
+
jsonDiff: ce,
|
|
789
789
|
lineDiff: M,
|
|
790
790
|
parsePatch: R,
|
|
791
|
-
reversePatch:
|
|
792
|
-
sentenceDiff:
|
|
791
|
+
reversePatch: we,
|
|
792
|
+
sentenceDiff: le,
|
|
793
793
|
structuredPatch: $,
|
|
794
|
-
wordDiff:
|
|
795
|
-
wordsWithSpaceDiff:
|
|
794
|
+
wordDiff: te,
|
|
795
|
+
wordsWithSpaceDiff: ie
|
|
796
796
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
797
|
-
class
|
|
797
|
+
class tt {
|
|
798
798
|
constructor(e) {
|
|
799
|
-
this.ctx = e, this.JsDiff =
|
|
799
|
+
this.ctx = e, this.JsDiff = et, this.diffChars = ee, this.diffWords = ne, this.diffWordsWithSpace = q, this.diffLines = F, this.diffTrimmedLines = re, this.diffSentences = oe, this.diffCss = ae, this.diffJson = ue, this.diffArrays = me, this.createTwoFilesPatch = J, this.ctx.set("jsdiff", this);
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
|
-
const
|
|
802
|
+
const nt = {
|
|
803
803
|
"diff-container": "_diff-container_lq0si_2"
|
|
804
|
-
},
|
|
804
|
+
}, it = (t) => {
|
|
805
805
|
let { user: e, target: n } = t;
|
|
806
806
|
const i = window.mw?.config?.get("wgArticlePath") || "/$1", s = (r) => i.replace("$1", r);
|
|
807
807
|
return /* @__PURE__ */ m("span", { className: "mw-userlinks", children: [
|
|
@@ -833,23 +833,23 @@ const rt = {
|
|
|
833
833
|
")"
|
|
834
834
|
] })
|
|
835
835
|
] });
|
|
836
|
-
},
|
|
836
|
+
}, rt = new Intl.DateTimeFormat(void 0, {
|
|
837
837
|
dateStyle: "medium",
|
|
838
838
|
timeStyle: "medium"
|
|
839
|
-
}).format,
|
|
839
|
+
}).format, Z = (t) => {
|
|
840
840
|
let e = ["diff-title"];
|
|
841
841
|
return t.type === "from" ? e.push("diff-otitle") : t.type === "to" && e.push("diff-ntitle"), !t.pageid || !t.userid ? /* @__PURE__ */ m("td", { colSpan: 2, className: e, children: /* @__PURE__ */ m("div", { className: "mw-diff-title--title", children: t.type === "from" ? "Original content" : t.type === "to" ? "Your content" : "" }) }) : /* @__PURE__ */ m("td", { colSpan: 2, className: e, children: [
|
|
842
842
|
/* @__PURE__ */ m("div", { className: "mw-diff-title--title", children: t.pagetitle || t.timestamp }),
|
|
843
|
-
/* @__PURE__ */ m("div", { className: "mw-diff-title--user", children: t.username && /* @__PURE__ */ m(
|
|
844
|
-
/* @__PURE__ */ m("div", { className: "mw-diff-title--timestamp", children: t.timestamp &&
|
|
845
|
-
/* @__PURE__ */ m("div", { className: "mw-diff-title--comment", children: t.parsedcomment && /* @__PURE__ */ m(
|
|
843
|
+
/* @__PURE__ */ m("div", { className: "mw-diff-title--user", children: t.username && /* @__PURE__ */ m(it, { user: t.username, target: "_blank" }) }),
|
|
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(Pe, { children: [
|
|
846
846
|
"(",
|
|
847
847
|
/* @__PURE__ */ m("i", { innerHTML: t.parsedcomment }),
|
|
848
848
|
")"
|
|
849
849
|
] }) }),
|
|
850
850
|
/* @__PURE__ */ m("div", { className: "mw-diff-title--navigation" })
|
|
851
851
|
] });
|
|
852
|
-
},
|
|
852
|
+
}, st = (t) => {
|
|
853
853
|
const { data: e, ...n } = t, i = /* @__PURE__ */ m("table", { className: "theme-ipe diff diff-type-table", "data-mw": "interface", ...n, children: [
|
|
854
854
|
/* @__PURE__ */ m("colgroup", { children: [
|
|
855
855
|
/* @__PURE__ */ m("col", { className: "diff-marker" }),
|
|
@@ -860,7 +860,7 @@ const rt = {
|
|
|
860
860
|
/* @__PURE__ */ m("tbody", { children: [
|
|
861
861
|
/* @__PURE__ */ m("tr", { children: [
|
|
862
862
|
/* @__PURE__ */ m(
|
|
863
|
-
|
|
863
|
+
Z,
|
|
864
864
|
{
|
|
865
865
|
type: "from",
|
|
866
866
|
pageid: e.fromid,
|
|
@@ -875,7 +875,7 @@ const rt = {
|
|
|
875
875
|
}
|
|
876
876
|
),
|
|
877
877
|
/* @__PURE__ */ m(
|
|
878
|
-
|
|
878
|
+
Z,
|
|
879
879
|
{
|
|
880
880
|
type: "to",
|
|
881
881
|
pageid: e.toid,
|
|
@@ -909,39 +909,39 @@ const rt = {
|
|
|
909
909
|
children: /* @__PURE__ */ m("i", { children: "No changes" })
|
|
910
910
|
}
|
|
911
911
|
) }) })).outerHTML, i;
|
|
912
|
-
},
|
|
913
|
-
var
|
|
912
|
+
}, lt = (t, e = document) => e.querySelector(t), ot = (t, e = document) => e.querySelectorAll(t);
|
|
913
|
+
var ft = Object.create, Q = 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
|
+
}, ct = (t, e, n) => e in t ? Q(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ut = (t, e) => Q(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) => ct(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
|
-
},
|
|
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) &&
|
|
920
|
-
|
|
918
|
+
}, wt = (t, e, n, i, s, r) => {
|
|
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
|
+
ut(s, n);
|
|
921
921
|
for (var d = i.length - 1; d >= 0; d--)
|
|
922
|
-
f =
|
|
923
|
-
return
|
|
924
|
-
},
|
|
925
|
-
const
|
|
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 && Q(s, n, v), a ? g ^ 4 ? r : v : s;
|
|
924
|
+
}, ke, B, Ce;
|
|
925
|
+
const De = [
|
|
926
926
|
"diffChars",
|
|
927
927
|
"diffWords",
|
|
928
928
|
"diffSentences",
|
|
929
929
|
"diffLines",
|
|
930
930
|
"createTwoFilesPatch"
|
|
931
931
|
];
|
|
932
|
-
|
|
932
|
+
ke = [Se(["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
|
-
"quickDiff.jsDiff.defaultType": E.union(
|
|
935
|
+
"quickDiff.jsDiff.defaultType": E.union(De.map((t) => E.const(t))).description("The default diff type for JsDiff").default("diffSentences")
|
|
936
936
|
}).description("Quick Diff Preferences"),
|
|
937
937
|
{
|
|
938
938
|
"quickDiff.preferredCompareMode": "mwApi",
|
|
939
939
|
"quickDiff.jsDiff.defaultType": "diffSentences"
|
|
940
940
|
}
|
|
941
941
|
)];
|
|
942
|
-
class j extends (
|
|
942
|
+
class j extends (Ce = G) {
|
|
943
943
|
constructor(e) {
|
|
944
|
-
super(e, {}, "quick-diff"), this.ctx = e, this.VALID_DIFF_TYPES =
|
|
944
|
+
super(e, {}, "quick-diff"), this.ctx = e, this.VALID_DIFF_TYPES = De, this.COMPARE_API_DEFAULT_OPTIONS = {
|
|
945
945
|
prop: [
|
|
946
946
|
"comment",
|
|
947
947
|
"diff",
|
|
@@ -963,10 +963,10 @@ class j extends (De = ee) {
|
|
|
963
963
|
this.ctx.off("quickEdit/wikiPage", this.injectQuickEdit.bind(this));
|
|
964
964
|
}
|
|
965
965
|
injectHistoryPage() {
|
|
966
|
-
const e =
|
|
966
|
+
const e = lt("#mw-history-compare");
|
|
967
967
|
if (!e)
|
|
968
968
|
return;
|
|
969
|
-
|
|
969
|
+
ot(".mw-history-compareselectedversions-button", e).forEach((i) => {
|
|
970
970
|
i.after(
|
|
971
971
|
/* @__PURE__ */ m(
|
|
972
972
|
"button",
|
|
@@ -1012,7 +1012,7 @@ class j extends (De = ee) {
|
|
|
1012
1012
|
className: "in-page-edit ipe-quickDiff"
|
|
1013
1013
|
});
|
|
1014
1014
|
i.show();
|
|
1015
|
-
const s = /* @__PURE__ */ m("pre", { className:
|
|
1015
|
+
const s = /* @__PURE__ */ m("pre", { className: nt["diff-container"] }), r = /* @__PURE__ */ m(
|
|
1016
1016
|
"div",
|
|
1017
1017
|
{
|
|
1018
1018
|
style: {
|
|
@@ -1020,7 +1020,7 @@ class j extends (De = ee) {
|
|
|
1020
1020
|
gap: "1em"
|
|
1021
1021
|
},
|
|
1022
1022
|
children: this.VALID_DIFF_TYPES.map((l, o) => /* @__PURE__ */ m(
|
|
1023
|
-
|
|
1023
|
+
Ee,
|
|
1024
1024
|
{
|
|
1025
1025
|
name: "diffType",
|
|
1026
1026
|
value: l,
|
|
@@ -1081,7 +1081,7 @@ class j extends (De = ee) {
|
|
|
1081
1081
|
comparePages(e) {
|
|
1082
1082
|
const n = this.ctx.modal.createObject({
|
|
1083
1083
|
title: "Loading diff...",
|
|
1084
|
-
content: /* @__PURE__ */ m(
|
|
1084
|
+
content: /* @__PURE__ */ m(be, {}),
|
|
1085
1085
|
className: "quick-diff"
|
|
1086
1086
|
}).init();
|
|
1087
1087
|
return window.mw && mw.loader.getState("mediawiki.diff.styles") !== "ready" && mw.loader.load(["mediawiki.diff.styles"]), this.ctx.api.post({
|
|
@@ -1106,26 +1106,27 @@ class j extends (De = ee) {
|
|
|
1106
1106
|
n.setTitle(
|
|
1107
1107
|
s.fromtitle && s.totitle ? `${s.fromtitle} ⇔ ${s.totitle}` : "Differences"
|
|
1108
1108
|
), n.setContent(
|
|
1109
|
-
/* @__PURE__ */ m("section", { children: /* @__PURE__ */ m(
|
|
1109
|
+
/* @__PURE__ */ m("section", { children: /* @__PURE__ */ m(st, { data: s }) })
|
|
1110
1110
|
);
|
|
1111
1111
|
}).catch((i) => {
|
|
1112
1112
|
n.setContent(
|
|
1113
|
-
/* @__PURE__ */ m(
|
|
1113
|
+
/* @__PURE__ */ m(We, { title: "Failed to load diff", type: "error", children: /* @__PURE__ */ m("pre", { children: i instanceof Error ? i.message : String(i) }) })
|
|
1114
1114
|
);
|
|
1115
1115
|
}), n.show();
|
|
1116
1116
|
}
|
|
1117
1117
|
}
|
|
1118
|
-
|
|
1119
|
-
j =
|
|
1120
|
-
|
|
1121
|
-
|
|
1118
|
+
B = dt(Ce);
|
|
1119
|
+
j = wt(B, 0, "PluginQuickDiffCore", ke, j);
|
|
1120
|
+
pt(B, 1, j);
|
|
1121
|
+
class Ct extends G {
|
|
1122
1122
|
constructor(e) {
|
|
1123
|
-
super(e, {}, "quick-diff-loader"), this.ctx = e, e.plugin(
|
|
1123
|
+
super(e, {}, "quick-diff-loader"), this.ctx = e, e.plugin(tt), e.plugin(j);
|
|
1124
1124
|
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1125
|
+
static {
|
|
1126
|
+
this.inject = ["api", "wikiPage", "modal"];
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1128
1129
|
export {
|
|
1129
|
-
|
|
1130
|
+
Ct as PluginQuickDiff
|
|
1130
1131
|
};
|
|
1131
|
-
//# sourceMappingURL=index-
|
|
1132
|
+
//# sourceMappingURL=index-BByzm2Fz.js.map
|