@hep-code-runner/vue2 1.5.0 → 1.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.js +61 -16
- package/dist/index.mjs +261 -216
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ae = Object.defineProperty, ie = (
|
|
1
|
+
var ae = Object.defineProperty, ie = (n, e, t) => e in n ? ae(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, q = (n, e, t) => ie(n, typeof e != "symbol" ? e + "" : e, t);
|
|
2
2
|
let W = null;
|
|
3
3
|
class se {
|
|
4
4
|
constructor(e = {}) {
|
|
@@ -31,12 +31,12 @@ class se {
|
|
|
31
31
|
);
|
|
32
32
|
if (!p)
|
|
33
33
|
throw new Error(`Language '${e}' is not supported`);
|
|
34
|
-
const
|
|
34
|
+
const m = this.getFileName(e), b = {
|
|
35
35
|
language: p.language,
|
|
36
36
|
version: l.version || p.version,
|
|
37
37
|
files: [
|
|
38
38
|
{
|
|
39
|
-
name:
|
|
39
|
+
name: m,
|
|
40
40
|
content: t
|
|
41
41
|
}
|
|
42
42
|
],
|
|
@@ -206,17 +206,17 @@ h1 {
|
|
|
206
206
|
|
|
207
207
|
This is a sample markdown document.`
|
|
208
208
|
};
|
|
209
|
-
function z(
|
|
210
|
-
const e =
|
|
211
|
-
return oe[e] || `// ${
|
|
209
|
+
function z(n) {
|
|
210
|
+
const e = n.toLowerCase();
|
|
211
|
+
return oe[e] || `// ${n}
|
|
212
212
|
// Write your code here`;
|
|
213
213
|
}
|
|
214
214
|
var J = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
215
|
-
function le(
|
|
216
|
-
return
|
|
215
|
+
function le(n) {
|
|
216
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
217
217
|
}
|
|
218
218
|
var Q = { exports: {} };
|
|
219
|
-
(function(
|
|
219
|
+
(function(n) {
|
|
220
220
|
var e = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
221
221
|
/**
|
|
222
222
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
@@ -227,7 +227,7 @@ var Q = { exports: {} };
|
|
|
227
227
|
* @public
|
|
228
228
|
*/
|
|
229
229
|
var t = function(l) {
|
|
230
|
-
var p = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,
|
|
230
|
+
var p = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, m = 0, b = {}, u = {
|
|
231
231
|
/**
|
|
232
232
|
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
233
233
|
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
@@ -282,8 +282,8 @@ var Q = { exports: {} };
|
|
|
282
282
|
* @memberof Prism
|
|
283
283
|
*/
|
|
284
284
|
util: {
|
|
285
|
-
encode: function a(
|
|
286
|
-
return
|
|
285
|
+
encode: function a(r) {
|
|
286
|
+
return r instanceof h ? new h(r.type, a(r.content), r.alias) : Array.isArray(r) ? r.map(a) : r.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
287
287
|
},
|
|
288
288
|
/**
|
|
289
289
|
* Returns the name of the type of the given value.
|
|
@@ -311,7 +311,7 @@ var Q = { exports: {} };
|
|
|
311
311
|
* @returns {number}
|
|
312
312
|
*/
|
|
313
313
|
objId: function(a) {
|
|
314
|
-
return a.__id || Object.defineProperty(a, "__id", { value: ++
|
|
314
|
+
return a.__id || Object.defineProperty(a, "__id", { value: ++m }), a.__id;
|
|
315
315
|
},
|
|
316
316
|
/**
|
|
317
317
|
* Creates a deep clone of the given object.
|
|
@@ -323,30 +323,30 @@ var Q = { exports: {} };
|
|
|
323
323
|
* @returns {T}
|
|
324
324
|
* @template T
|
|
325
325
|
*/
|
|
326
|
-
clone: function a(
|
|
326
|
+
clone: function a(r, i) {
|
|
327
327
|
i = i || {};
|
|
328
328
|
var s, o;
|
|
329
|
-
switch (u.util.type(
|
|
329
|
+
switch (u.util.type(r)) {
|
|
330
330
|
case "Object":
|
|
331
|
-
if (o = u.util.objId(
|
|
331
|
+
if (o = u.util.objId(r), i[o])
|
|
332
332
|
return i[o];
|
|
333
333
|
s = /** @type {Record<string, any>} */
|
|
334
334
|
{}, i[o] = s;
|
|
335
|
-
for (var d in
|
|
336
|
-
|
|
335
|
+
for (var d in r)
|
|
336
|
+
r.hasOwnProperty(d) && (s[d] = a(r[d], i));
|
|
337
337
|
return (
|
|
338
338
|
/** @type {any} */
|
|
339
339
|
s
|
|
340
340
|
);
|
|
341
341
|
case "Array":
|
|
342
|
-
return o = u.util.objId(
|
|
342
|
+
return o = u.util.objId(r), i[o] ? i[o] : (s = [], i[o] = s, /** @type {Array} */
|
|
343
343
|
/** @type {any} */
|
|
344
|
-
|
|
344
|
+
r.forEach(function(g, c) {
|
|
345
345
|
s[c] = a(g, i);
|
|
346
346
|
}), /** @type {any} */
|
|
347
347
|
s);
|
|
348
348
|
default:
|
|
349
|
-
return
|
|
349
|
+
return r;
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
/**
|
|
@@ -359,9 +359,9 @@ var Q = { exports: {} };
|
|
|
359
359
|
*/
|
|
360
360
|
getLanguage: function(a) {
|
|
361
361
|
for (; a; ) {
|
|
362
|
-
var
|
|
363
|
-
if (
|
|
364
|
-
return
|
|
362
|
+
var r = p.exec(a.className);
|
|
363
|
+
if (r)
|
|
364
|
+
return r[1].toLowerCase();
|
|
365
365
|
a = a.parentElement;
|
|
366
366
|
}
|
|
367
367
|
return "none";
|
|
@@ -373,8 +373,8 @@ var Q = { exports: {} };
|
|
|
373
373
|
* @param {string} language
|
|
374
374
|
* @returns {void}
|
|
375
375
|
*/
|
|
376
|
-
setLanguage: function(a,
|
|
377
|
-
a.className = a.className.replace(RegExp(p, "gi"), ""), a.classList.add("language-" +
|
|
376
|
+
setLanguage: function(a, r) {
|
|
377
|
+
a.className = a.className.replace(RegExp(p, "gi"), ""), a.classList.add("language-" + r);
|
|
378
378
|
},
|
|
379
379
|
/**
|
|
380
380
|
* Returns the script element that is currently executing.
|
|
@@ -396,10 +396,10 @@ var Q = { exports: {} };
|
|
|
396
396
|
} catch (s) {
|
|
397
397
|
var a = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(s.stack) || [])[1];
|
|
398
398
|
if (a) {
|
|
399
|
-
var
|
|
400
|
-
for (var i in
|
|
401
|
-
if (
|
|
402
|
-
return
|
|
399
|
+
var r = document.getElementsByTagName("script");
|
|
400
|
+
for (var i in r)
|
|
401
|
+
if (r[i].src == a)
|
|
402
|
+
return r[i];
|
|
403
403
|
}
|
|
404
404
|
return null;
|
|
405
405
|
}
|
|
@@ -423,10 +423,10 @@ var Q = { exports: {} };
|
|
|
423
423
|
* @param {boolean} [defaultActivation=false]
|
|
424
424
|
* @returns {boolean}
|
|
425
425
|
*/
|
|
426
|
-
isActive: function(a,
|
|
427
|
-
for (var s = "no-" +
|
|
426
|
+
isActive: function(a, r, i) {
|
|
427
|
+
for (var s = "no-" + r; a; ) {
|
|
428
428
|
var o = a.classList;
|
|
429
|
-
if (o.contains(
|
|
429
|
+
if (o.contains(r))
|
|
430
430
|
return !0;
|
|
431
431
|
if (o.contains(s))
|
|
432
432
|
return !1;
|
|
@@ -478,10 +478,10 @@ var Q = { exports: {} };
|
|
|
478
478
|
* 'color': /\b(?:red|green|blue)\b/
|
|
479
479
|
* });
|
|
480
480
|
*/
|
|
481
|
-
extend: function(a,
|
|
481
|
+
extend: function(a, r) {
|
|
482
482
|
var i = u.util.clone(u.languages[a]);
|
|
483
|
-
for (var s in
|
|
484
|
-
i[s] =
|
|
483
|
+
for (var s in r)
|
|
484
|
+
i[s] = r[s];
|
|
485
485
|
return i;
|
|
486
486
|
},
|
|
487
487
|
/**
|
|
@@ -559,13 +559,13 @@ var Q = { exports: {} };
|
|
|
559
559
|
* @returns {Grammar} The new grammar object.
|
|
560
560
|
* @public
|
|
561
561
|
*/
|
|
562
|
-
insertBefore: function(a,
|
|
562
|
+
insertBefore: function(a, r, i, s) {
|
|
563
563
|
s = s || /** @type {any} */
|
|
564
564
|
u.languages;
|
|
565
565
|
var o = s[a], d = {};
|
|
566
566
|
for (var g in o)
|
|
567
567
|
if (o.hasOwnProperty(g)) {
|
|
568
|
-
if (g ==
|
|
568
|
+
if (g == r)
|
|
569
569
|
for (var c in i)
|
|
570
570
|
i.hasOwnProperty(c) && (d[c] = i[c]);
|
|
571
571
|
i.hasOwnProperty(g) || (d[g] = o[g]);
|
|
@@ -576,13 +576,13 @@ var Q = { exports: {} };
|
|
|
576
576
|
}), d;
|
|
577
577
|
},
|
|
578
578
|
// Traverse a language definition with Depth First Search
|
|
579
|
-
DFS: function a(
|
|
579
|
+
DFS: function a(r, i, s, o) {
|
|
580
580
|
o = o || {};
|
|
581
581
|
var d = u.util.objId;
|
|
582
|
-
for (var g in
|
|
583
|
-
if (
|
|
584
|
-
i.call(
|
|
585
|
-
var c =
|
|
582
|
+
for (var g in r)
|
|
583
|
+
if (r.hasOwnProperty(g)) {
|
|
584
|
+
i.call(r, g, r[g], s || g);
|
|
585
|
+
var c = r[g], E = u.util.type(c);
|
|
586
586
|
E === "Object" && !o[d(c)] ? (o[d(c)] = !0, a(c, i, null, o)) : E === "Array" && !o[d(c)] && (o[d(c)] = !0, a(c, i, g, o));
|
|
587
587
|
}
|
|
588
588
|
}
|
|
@@ -600,8 +600,8 @@ var Q = { exports: {} };
|
|
|
600
600
|
* @memberof Prism
|
|
601
601
|
* @public
|
|
602
602
|
*/
|
|
603
|
-
highlightAll: function(a,
|
|
604
|
-
u.highlightAllUnder(document, a,
|
|
603
|
+
highlightAll: function(a, r) {
|
|
604
|
+
u.highlightAllUnder(document, a, r);
|
|
605
605
|
},
|
|
606
606
|
/**
|
|
607
607
|
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
@@ -618,7 +618,7 @@ var Q = { exports: {} };
|
|
|
618
618
|
* @memberof Prism
|
|
619
619
|
* @public
|
|
620
620
|
*/
|
|
621
|
-
highlightAllUnder: function(a,
|
|
621
|
+
highlightAllUnder: function(a, r, i) {
|
|
622
622
|
var s = {
|
|
623
623
|
callback: i,
|
|
624
624
|
container: a,
|
|
@@ -626,7 +626,7 @@ var Q = { exports: {} };
|
|
|
626
626
|
};
|
|
627
627
|
u.hooks.run("before-highlightall", s), s.elements = Array.prototype.slice.apply(s.container.querySelectorAll(s.selector)), u.hooks.run("before-all-elements-highlight", s);
|
|
628
628
|
for (var o = 0, d; d = s.elements[o++]; )
|
|
629
|
-
u.highlightElement(d,
|
|
629
|
+
u.highlightElement(d, r === !0, s.callback);
|
|
630
630
|
},
|
|
631
631
|
/**
|
|
632
632
|
* Highlights the code inside a single element.
|
|
@@ -656,7 +656,7 @@ var Q = { exports: {} };
|
|
|
656
656
|
* @memberof Prism
|
|
657
657
|
* @public
|
|
658
658
|
*/
|
|
659
|
-
highlightElement: function(a,
|
|
659
|
+
highlightElement: function(a, r, i) {
|
|
660
660
|
var s = u.util.getLanguage(a), o = u.languages[s];
|
|
661
661
|
u.util.setLanguage(a, s);
|
|
662
662
|
var d = a.parentElement;
|
|
@@ -678,7 +678,7 @@ var Q = { exports: {} };
|
|
|
678
678
|
E(u.util.encode(c.code));
|
|
679
679
|
return;
|
|
680
680
|
}
|
|
681
|
-
if (
|
|
681
|
+
if (r && l.Worker) {
|
|
682
682
|
var S = new Worker(u.filename);
|
|
683
683
|
S.onmessage = function(F) {
|
|
684
684
|
E(F.data);
|
|
@@ -710,10 +710,10 @@ var Q = { exports: {} };
|
|
|
710
710
|
* @example
|
|
711
711
|
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
712
712
|
*/
|
|
713
|
-
highlight: function(a,
|
|
713
|
+
highlight: function(a, r, i) {
|
|
714
714
|
var s = {
|
|
715
715
|
code: a,
|
|
716
|
-
grammar:
|
|
716
|
+
grammar: r,
|
|
717
717
|
language: i
|
|
718
718
|
};
|
|
719
719
|
if (u.hooks.run("before-tokenize", s), !s.grammar)
|
|
@@ -744,15 +744,15 @@ var Q = { exports: {} };
|
|
|
744
744
|
* }
|
|
745
745
|
* });
|
|
746
746
|
*/
|
|
747
|
-
tokenize: function(a,
|
|
748
|
-
var i =
|
|
747
|
+
tokenize: function(a, r) {
|
|
748
|
+
var i = r.rest;
|
|
749
749
|
if (i) {
|
|
750
750
|
for (var s in i)
|
|
751
|
-
|
|
752
|
-
delete
|
|
751
|
+
r[s] = i[s];
|
|
752
|
+
delete r.rest;
|
|
753
753
|
}
|
|
754
754
|
var o = new x();
|
|
755
|
-
return I(o, o.head, a), _(a, o,
|
|
755
|
+
return I(o, o.head, a), _(a, o, r, o.head, 0), O(o);
|
|
756
756
|
},
|
|
757
757
|
/**
|
|
758
758
|
* @namespace
|
|
@@ -773,9 +773,9 @@ var Q = { exports: {} };
|
|
|
773
773
|
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
774
774
|
* @public
|
|
775
775
|
*/
|
|
776
|
-
add: function(a,
|
|
776
|
+
add: function(a, r) {
|
|
777
777
|
var i = u.hooks.all;
|
|
778
|
-
i[a] = i[a] || [], i[a].push(
|
|
778
|
+
i[a] = i[a] || [], i[a].push(r);
|
|
779
779
|
},
|
|
780
780
|
/**
|
|
781
781
|
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
@@ -786,44 +786,44 @@ var Q = { exports: {} };
|
|
|
786
786
|
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
787
787
|
* @public
|
|
788
788
|
*/
|
|
789
|
-
run: function(a,
|
|
789
|
+
run: function(a, r) {
|
|
790
790
|
var i = u.hooks.all[a];
|
|
791
791
|
if (!(!i || !i.length))
|
|
792
792
|
for (var s = 0, o; o = i[s++]; )
|
|
793
|
-
o(
|
|
793
|
+
o(r);
|
|
794
794
|
}
|
|
795
795
|
},
|
|
796
796
|
Token: h
|
|
797
797
|
};
|
|
798
798
|
l.Prism = u;
|
|
799
|
-
function h(a,
|
|
800
|
-
this.type = a, this.content =
|
|
799
|
+
function h(a, r, i, s) {
|
|
800
|
+
this.type = a, this.content = r, this.alias = i, this.length = (s || "").length | 0;
|
|
801
801
|
}
|
|
802
|
-
h.stringify = function a(
|
|
803
|
-
if (typeof
|
|
804
|
-
return
|
|
805
|
-
if (Array.isArray(
|
|
802
|
+
h.stringify = function a(r, i) {
|
|
803
|
+
if (typeof r == "string")
|
|
804
|
+
return r;
|
|
805
|
+
if (Array.isArray(r)) {
|
|
806
806
|
var s = "";
|
|
807
|
-
return
|
|
807
|
+
return r.forEach(function(E) {
|
|
808
808
|
s += a(E, i);
|
|
809
809
|
}), s;
|
|
810
810
|
}
|
|
811
811
|
var o = {
|
|
812
|
-
type:
|
|
813
|
-
content: a(
|
|
812
|
+
type: r.type,
|
|
813
|
+
content: a(r.content, i),
|
|
814
814
|
tag: "span",
|
|
815
|
-
classes: ["token",
|
|
815
|
+
classes: ["token", r.type],
|
|
816
816
|
attributes: {},
|
|
817
817
|
language: i
|
|
818
|
-
}, d =
|
|
818
|
+
}, d = r.alias;
|
|
819
819
|
d && (Array.isArray(d) ? Array.prototype.push.apply(o.classes, d) : o.classes.push(d)), u.hooks.run("wrap", o);
|
|
820
820
|
var g = "";
|
|
821
821
|
for (var c in o.attributes)
|
|
822
822
|
g += " " + c + '="' + (o.attributes[c] || "").replace(/"/g, """) + '"';
|
|
823
823
|
return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + g + ">" + o.content + "</" + o.tag + ">";
|
|
824
824
|
};
|
|
825
|
-
function A(a,
|
|
826
|
-
a.lastIndex =
|
|
825
|
+
function A(a, r, i, s) {
|
|
826
|
+
a.lastIndex = r;
|
|
827
827
|
var o = a.exec(i);
|
|
828
828
|
if (o && s && o[1]) {
|
|
829
829
|
var d = o[1].length;
|
|
@@ -831,7 +831,7 @@ var Q = { exports: {} };
|
|
|
831
831
|
}
|
|
832
832
|
return o;
|
|
833
833
|
}
|
|
834
|
-
function _(a,
|
|
834
|
+
function _(a, r, i, s, o, d) {
|
|
835
835
|
for (var g in i)
|
|
836
836
|
if (!(!i.hasOwnProperty(g) || !i[g])) {
|
|
837
837
|
var c = i[g];
|
|
@@ -844,21 +844,21 @@ var Q = { exports: {} };
|
|
|
844
844
|
var te = S.pattern.toString().match(/[imsuy]*$/)[0];
|
|
845
845
|
S.pattern = RegExp(S.pattern.source, te + "g");
|
|
846
846
|
}
|
|
847
|
-
for (var K = S.pattern || S, T = s.next, k = o; T !==
|
|
847
|
+
for (var K = S.pattern || S, T = s.next, k = o; T !== r.tail && !(d && k >= d.reach); k += T.value.length, T = T.next) {
|
|
848
848
|
var C = T.value;
|
|
849
|
-
if (
|
|
849
|
+
if (r.length > a.length)
|
|
850
850
|
return;
|
|
851
851
|
if (!(C instanceof h)) {
|
|
852
852
|
var N = 1, w;
|
|
853
853
|
if (Z) {
|
|
854
854
|
if (w = A(K, k, a, X), !w || w.index >= a.length)
|
|
855
855
|
break;
|
|
856
|
-
var D = w.index,
|
|
856
|
+
var D = w.index, re = w.index + w[0].length, R = k;
|
|
857
857
|
for (R += T.value.length; D >= R; )
|
|
858
858
|
T = T.next, R += T.value.length;
|
|
859
859
|
if (R -= T.value.length, k = R, T.value instanceof h)
|
|
860
860
|
continue;
|
|
861
|
-
for (var L = T; L !==
|
|
861
|
+
for (var L = T; L !== r.tail && (R < re || typeof L.value == "string"); L = L.next)
|
|
862
862
|
N++, R += L.value.length;
|
|
863
863
|
N--, C = a.slice(k, R), w.index -= k;
|
|
864
864
|
} else if (w = A(K, 0, C, X), !w)
|
|
@@ -866,14 +866,14 @@ var Q = { exports: {} };
|
|
|
866
866
|
var D = w.index, P = w[0], H = C.slice(0, D), V = C.slice(D + P.length), B = k + C.length;
|
|
867
867
|
d && B > d.reach && (d.reach = B);
|
|
868
868
|
var $ = T.prev;
|
|
869
|
-
H && ($ = I(
|
|
870
|
-
var
|
|
871
|
-
if (T = I(
|
|
869
|
+
H && ($ = I(r, $, H), k += H.length), U(r, $, N);
|
|
870
|
+
var ne = new h(g, F ? u.tokenize(P, F) : P, ee, P);
|
|
871
|
+
if (T = I(r, $, ne), V && I(r, T, V), N > 1) {
|
|
872
872
|
var G = {
|
|
873
873
|
cause: g + "," + E,
|
|
874
874
|
reach: B
|
|
875
875
|
};
|
|
876
|
-
_(a,
|
|
876
|
+
_(a, r, i, T.prev, k, G), d && G.reach > d.reach && (d.reach = G.reach);
|
|
877
877
|
}
|
|
878
878
|
}
|
|
879
879
|
}
|
|
@@ -881,40 +881,40 @@ var Q = { exports: {} };
|
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
function x() {
|
|
884
|
-
var a = { value: null, prev: null, next: null },
|
|
885
|
-
a.next =
|
|
884
|
+
var a = { value: null, prev: null, next: null }, r = { value: null, prev: a, next: null };
|
|
885
|
+
a.next = r, this.head = a, this.tail = r, this.length = 0;
|
|
886
886
|
}
|
|
887
|
-
function I(a,
|
|
888
|
-
var s =
|
|
889
|
-
return
|
|
887
|
+
function I(a, r, i) {
|
|
888
|
+
var s = r.next, o = { value: i, prev: r, next: s };
|
|
889
|
+
return r.next = o, s.prev = o, a.length++, o;
|
|
890
890
|
}
|
|
891
|
-
function U(a,
|
|
892
|
-
for (var s =
|
|
891
|
+
function U(a, r, i) {
|
|
892
|
+
for (var s = r.next, o = 0; o < i && s !== a.tail; o++)
|
|
893
893
|
s = s.next;
|
|
894
|
-
|
|
894
|
+
r.next = s, s.prev = r, a.length -= o;
|
|
895
895
|
}
|
|
896
896
|
function O(a) {
|
|
897
|
-
for (var
|
|
898
|
-
|
|
899
|
-
return
|
|
897
|
+
for (var r = [], i = a.head.next; i !== a.tail; )
|
|
898
|
+
r.push(i.value), i = i.next;
|
|
899
|
+
return r;
|
|
900
900
|
}
|
|
901
901
|
if (!l.document)
|
|
902
902
|
return l.addEventListener && (u.disableWorkerMessageHandler || l.addEventListener("message", function(a) {
|
|
903
|
-
var
|
|
903
|
+
var r = JSON.parse(a.data), i = r.language, s = r.code, o = r.immediateClose;
|
|
904
904
|
l.postMessage(u.highlight(s, u.languages[i], i)), o && l.close();
|
|
905
905
|
}, !1)), u;
|
|
906
906
|
var v = u.util.currentScript();
|
|
907
907
|
v && (u.filename = v.src, v.hasAttribute("data-manual") && (u.manual = !0));
|
|
908
|
-
function
|
|
908
|
+
function f() {
|
|
909
909
|
u.manual || u.highlightAll();
|
|
910
910
|
}
|
|
911
911
|
if (!u.manual) {
|
|
912
912
|
var y = document.readyState;
|
|
913
|
-
y === "loading" || y === "interactive" && v && v.defer ? document.addEventListener("DOMContentLoaded",
|
|
913
|
+
y === "loading" || y === "interactive" && v && v.defer ? document.addEventListener("DOMContentLoaded", f) : window.requestAnimationFrame ? window.requestAnimationFrame(f) : window.setTimeout(f, 16);
|
|
914
914
|
}
|
|
915
915
|
return u;
|
|
916
916
|
}(e);
|
|
917
|
-
|
|
917
|
+
n.exports && (n.exports = t), typeof J < "u" && (J.Prism = t), t.languages.markup = {
|
|
918
918
|
comment: {
|
|
919
919
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
920
920
|
greedy: !0
|
|
@@ -1005,12 +1005,12 @@ var Q = { exports: {} };
|
|
|
1005
1005
|
* @example
|
|
1006
1006
|
* addInlined('style', 'css');
|
|
1007
1007
|
*/
|
|
1008
|
-
value: function(p,
|
|
1008
|
+
value: function(p, m) {
|
|
1009
1009
|
var b = {};
|
|
1010
|
-
b["language-" +
|
|
1010
|
+
b["language-" + m] = {
|
|
1011
1011
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1012
1012
|
lookbehind: !0,
|
|
1013
|
-
inside: t.languages[
|
|
1013
|
+
inside: t.languages[m]
|
|
1014
1014
|
}, b.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1015
1015
|
var u = {
|
|
1016
1016
|
"included-cdata": {
|
|
@@ -1018,9 +1018,9 @@ var Q = { exports: {} };
|
|
|
1018
1018
|
inside: b
|
|
1019
1019
|
}
|
|
1020
1020
|
};
|
|
1021
|
-
u["language-" +
|
|
1021
|
+
u["language-" + m] = {
|
|
1022
1022
|
pattern: /[\s\S]+/,
|
|
1023
|
-
inside: t.languages[
|
|
1023
|
+
inside: t.languages[m]
|
|
1024
1024
|
};
|
|
1025
1025
|
var h = {};
|
|
1026
1026
|
h[p] = {
|
|
@@ -1126,8 +1126,8 @@ var Q = { exports: {} };
|
|
|
1126
1126
|
},
|
|
1127
1127
|
punctuation: /[(){};:,]/
|
|
1128
1128
|
}, l.languages.css.atrule.inside.rest = l.languages.css;
|
|
1129
|
-
var
|
|
1130
|
-
|
|
1129
|
+
var m = l.languages.markup;
|
|
1130
|
+
m && (m.tag.addInlined("style", "css"), m.tag.addAttribute("style", "css"));
|
|
1131
1131
|
}(t), t.languages.clike = {
|
|
1132
1132
|
comment: [
|
|
1133
1133
|
{
|
|
@@ -1292,9 +1292,9 @@ var Q = { exports: {} };
|
|
|
1292
1292
|
if (typeof t > "u" || typeof document > "u")
|
|
1293
1293
|
return;
|
|
1294
1294
|
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1295
|
-
var l = "Loading…", p = function(v,
|
|
1296
|
-
return "✖ Error " + v + " while fetching file: " +
|
|
1297
|
-
},
|
|
1295
|
+
var l = "Loading…", p = function(v, f) {
|
|
1296
|
+
return "✖ Error " + v + " while fetching file: " + f;
|
|
1297
|
+
}, m = "✖ Error: File does not exist or is empty", b = {
|
|
1298
1298
|
js: "javascript",
|
|
1299
1299
|
py: "python",
|
|
1300
1300
|
rb: "ruby",
|
|
@@ -1305,51 +1305,51 @@ var Q = { exports: {} };
|
|
|
1305
1305
|
h: "c",
|
|
1306
1306
|
tex: "latex"
|
|
1307
1307
|
}, u = "data-src-status", h = "loading", A = "loaded", _ = "failed", x = "pre[data-src]:not([" + u + '="' + A + '"]):not([' + u + '="' + h + '"])';
|
|
1308
|
-
function I(v,
|
|
1308
|
+
function I(v, f, y) {
|
|
1309
1309
|
var a = new XMLHttpRequest();
|
|
1310
1310
|
a.open("GET", v, !0), a.onreadystatechange = function() {
|
|
1311
|
-
a.readyState == 4 && (a.status < 400 && a.responseText ?
|
|
1311
|
+
a.readyState == 4 && (a.status < 400 && a.responseText ? f(a.responseText) : a.status >= 400 ? y(p(a.status, a.statusText)) : y(m));
|
|
1312
1312
|
}, a.send(null);
|
|
1313
1313
|
}
|
|
1314
1314
|
function U(v) {
|
|
1315
|
-
var
|
|
1316
|
-
if (
|
|
1317
|
-
var y = Number(
|
|
1318
|
-
return a ?
|
|
1315
|
+
var f = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v || "");
|
|
1316
|
+
if (f) {
|
|
1317
|
+
var y = Number(f[1]), a = f[2], r = f[3];
|
|
1318
|
+
return a ? r ? [y, Number(r)] : [y, void 0] : [y, y];
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
1321
|
t.hooks.add("before-highlightall", function(v) {
|
|
1322
1322
|
v.selector += ", " + x;
|
|
1323
1323
|
}), t.hooks.add("before-sanity-check", function(v) {
|
|
1324
|
-
var
|
|
1324
|
+
var f = (
|
|
1325
1325
|
/** @type {HTMLPreElement} */
|
|
1326
1326
|
v.element
|
|
1327
1327
|
);
|
|
1328
|
-
if (
|
|
1329
|
-
v.code = "",
|
|
1330
|
-
var y =
|
|
1328
|
+
if (f.matches(x)) {
|
|
1329
|
+
v.code = "", f.setAttribute(u, h);
|
|
1330
|
+
var y = f.appendChild(document.createElement("CODE"));
|
|
1331
1331
|
y.textContent = l;
|
|
1332
|
-
var a =
|
|
1333
|
-
if (
|
|
1332
|
+
var a = f.getAttribute("data-src"), r = v.language;
|
|
1333
|
+
if (r === "none") {
|
|
1334
1334
|
var i = (/\.(\w+)$/.exec(a) || [, "none"])[1];
|
|
1335
|
-
|
|
1335
|
+
r = b[i] || i;
|
|
1336
1336
|
}
|
|
1337
|
-
t.util.setLanguage(y,
|
|
1337
|
+
t.util.setLanguage(y, r), t.util.setLanguage(f, r);
|
|
1338
1338
|
var s = t.plugins.autoloader;
|
|
1339
|
-
s && s.loadLanguages(
|
|
1339
|
+
s && s.loadLanguages(r), I(
|
|
1340
1340
|
a,
|
|
1341
1341
|
function(o) {
|
|
1342
|
-
|
|
1343
|
-
var d = U(
|
|
1342
|
+
f.setAttribute(u, A);
|
|
1343
|
+
var d = U(f.getAttribute("data-range"));
|
|
1344
1344
|
if (d) {
|
|
1345
1345
|
var g = o.split(/\r\n?|\n/g), c = d[0], E = d[1] == null ? g.length : d[1];
|
|
1346
1346
|
c < 0 && (c += g.length), c = Math.max(0, Math.min(c - 1, g.length)), E < 0 && (E += g.length), E = Math.max(0, Math.min(E, g.length)), o = g.slice(c, E).join(`
|
|
1347
|
-
`),
|
|
1347
|
+
`), f.hasAttribute("data-start") || f.setAttribute("data-start", String(c + 1));
|
|
1348
1348
|
}
|
|
1349
1349
|
y.textContent = o, t.highlightElement(y);
|
|
1350
1350
|
},
|
|
1351
1351
|
function(o) {
|
|
1352
|
-
|
|
1352
|
+
f.setAttribute(u, _), y.textContent = o;
|
|
1353
1353
|
}
|
|
1354
1354
|
);
|
|
1355
1355
|
}
|
|
@@ -1361,9 +1361,9 @@ var Q = { exports: {} };
|
|
|
1361
1361
|
*
|
|
1362
1362
|
* @param {ParentNode} [container=document]
|
|
1363
1363
|
*/
|
|
1364
|
-
highlight: function(
|
|
1365
|
-
for (var y = (
|
|
1366
|
-
t.highlightElement(
|
|
1364
|
+
highlight: function(f) {
|
|
1365
|
+
for (var y = (f || document).querySelectorAll(x), a = 0, r; r = y[a++]; )
|
|
1366
|
+
t.highlightElement(r);
|
|
1367
1367
|
}
|
|
1368
1368
|
};
|
|
1369
1369
|
var O = !1;
|
|
@@ -1631,7 +1631,7 @@ Prism.languages.insertBefore("go", "string", {
|
|
|
1631
1631
|
}
|
|
1632
1632
|
});
|
|
1633
1633
|
delete Prism.languages.go["class-name"];
|
|
1634
|
-
(function(
|
|
1634
|
+
(function(n) {
|
|
1635
1635
|
var e = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, t = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, l = {
|
|
1636
1636
|
pattern: RegExp(/(^|[^\w.])/.source + t + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
|
|
1637
1637
|
lookbehind: !0,
|
|
@@ -1645,7 +1645,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1645
1645
|
punctuation: /\./
|
|
1646
1646
|
}
|
|
1647
1647
|
};
|
|
1648
|
-
|
|
1648
|
+
n.languages.java = n.languages.extend("clike", {
|
|
1649
1649
|
string: {
|
|
1650
1650
|
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
|
|
1651
1651
|
lookbehind: !0,
|
|
@@ -1670,7 +1670,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1670
1670
|
],
|
|
1671
1671
|
keyword: e,
|
|
1672
1672
|
function: [
|
|
1673
|
-
|
|
1673
|
+
n.languages.clike.function,
|
|
1674
1674
|
{
|
|
1675
1675
|
pattern: /(::\s*)[a-z_]\w*/,
|
|
1676
1676
|
lookbehind: !0
|
|
@@ -1682,7 +1682,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1682
1682
|
lookbehind: !0
|
|
1683
1683
|
},
|
|
1684
1684
|
constant: /\b[A-Z][A-Z_\d]+\b/
|
|
1685
|
-
}),
|
|
1685
|
+
}), n.languages.insertBefore("java", "string", {
|
|
1686
1686
|
"triple-quoted-string": {
|
|
1687
1687
|
// http://openjdk.java.net/jeps/355#Description
|
|
1688
1688
|
pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
|
|
@@ -1693,7 +1693,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1693
1693
|
pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
|
|
1694
1694
|
greedy: !0
|
|
1695
1695
|
}
|
|
1696
|
-
}),
|
|
1696
|
+
}), n.languages.insertBefore("java", "class-name", {
|
|
1697
1697
|
annotation: {
|
|
1698
1698
|
pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
|
|
1699
1699
|
lookbehind: !0,
|
|
@@ -1821,14 +1821,14 @@ Prism.languages.insertBefore("c", "function", {
|
|
|
1821
1821
|
constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
|
|
1822
1822
|
});
|
|
1823
1823
|
delete Prism.languages.c.boolean;
|
|
1824
|
-
(function(
|
|
1824
|
+
(function(n) {
|
|
1825
1825
|
for (var e = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, t = 0; t < 2; t++)
|
|
1826
1826
|
e = e.replace(/<self>/g, function() {
|
|
1827
1827
|
return e;
|
|
1828
1828
|
});
|
|
1829
1829
|
e = e.replace(/<self>/g, function() {
|
|
1830
1830
|
return /[^\s\S]/.source;
|
|
1831
|
-
}),
|
|
1831
|
+
}), n.languages.rust = {
|
|
1832
1832
|
comment: [
|
|
1833
1833
|
{
|
|
1834
1834
|
pattern: RegExp(/(^|[^\\])/.source + e),
|
|
@@ -1935,7 +1935,7 @@ delete Prism.languages.c.boolean;
|
|
|
1935
1935
|
boolean: /\b(?:false|true)\b/,
|
|
1936
1936
|
punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
|
|
1937
1937
|
operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
|
|
1938
|
-
},
|
|
1938
|
+
}, n.languages.rust["closure-params"].inside.rest = n.languages.rust, n.languages.rust.attribute.inside.string = n.languages.rust.string;
|
|
1939
1939
|
})(Prism);
|
|
1940
1940
|
Prism.languages.sql = {
|
|
1941
1941
|
comment: {
|
|
@@ -1970,7 +1970,7 @@ Prism.languages.sql = {
|
|
|
1970
1970
|
operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
|
|
1971
1971
|
punctuation: /[;[\]()`,.]/
|
|
1972
1972
|
};
|
|
1973
|
-
(function(
|
|
1973
|
+
(function(n) {
|
|
1974
1974
|
var e = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", t = {
|
|
1975
1975
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
1976
1976
|
lookbehind: !0,
|
|
@@ -2032,7 +2032,7 @@ Prism.languages.sql = {
|
|
|
2032
2032
|
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
2033
2033
|
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
2034
2034
|
};
|
|
2035
|
-
|
|
2035
|
+
n.languages.bash = {
|
|
2036
2036
|
shebang: {
|
|
2037
2037
|
pattern: /^#!\s*\/.*/,
|
|
2038
2038
|
alias: "important"
|
|
@@ -2168,7 +2168,7 @@ Prism.languages.sql = {
|
|
|
2168
2168
|
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
2169
2169
|
lookbehind: !0
|
|
2170
2170
|
}
|
|
2171
|
-
}, t.inside =
|
|
2171
|
+
}, t.inside = n.languages.bash;
|
|
2172
2172
|
for (var p = [
|
|
2173
2173
|
"comment",
|
|
2174
2174
|
"function-name",
|
|
@@ -2185,9 +2185,9 @@ Prism.languages.sql = {
|
|
|
2185
2185
|
"operator",
|
|
2186
2186
|
"punctuation",
|
|
2187
2187
|
"number"
|
|
2188
|
-
],
|
|
2189
|
-
|
|
2190
|
-
|
|
2188
|
+
], m = l.variable[1].inside, b = 0; b < p.length; b++)
|
|
2189
|
+
m[p[b]] = n.languages.bash[p[b]];
|
|
2190
|
+
n.languages.sh = n.languages.bash, n.languages.shell = n.languages.bash;
|
|
2191
2191
|
})(Prism);
|
|
2192
2192
|
Prism.languages.json = {
|
|
2193
2193
|
property: {
|
|
@@ -2215,15 +2215,21 @@ Prism.languages.json = {
|
|
|
2215
2215
|
};
|
|
2216
2216
|
Prism.languages.webmanifest = Prism.languages.json;
|
|
2217
2217
|
const ce = `
|
|
2218
|
+
/* 默认代码颜色 */
|
|
2219
|
+
.hep-cr-editor .hep-cr-highlight code,
|
|
2220
|
+
.hep-cr-editor .hep-cr-highlight pre {
|
|
2221
|
+
color: #f8f8f2 !important;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2218
2224
|
.hep-cr-editor .token.comment,
|
|
2219
2225
|
.hep-cr-editor .token.prolog,
|
|
2220
2226
|
.hep-cr-editor .token.doctype,
|
|
2221
2227
|
.hep-cr-editor .token.cdata {
|
|
2222
|
-
color: #8292a2;
|
|
2228
|
+
color: #8292a2 !important;
|
|
2223
2229
|
}
|
|
2224
2230
|
|
|
2225
2231
|
.hep-cr-editor .token.punctuation {
|
|
2226
|
-
color: #f8f8f2;
|
|
2232
|
+
color: #f8f8f2 !important;
|
|
2227
2233
|
}
|
|
2228
2234
|
|
|
2229
2235
|
.hep-cr-editor .token.property,
|
|
@@ -2231,12 +2237,18 @@ const ce = `
|
|
|
2231
2237
|
.hep-cr-editor .token.constant,
|
|
2232
2238
|
.hep-cr-editor .token.symbol,
|
|
2233
2239
|
.hep-cr-editor .token.deleted {
|
|
2234
|
-
color: #f92672;
|
|
2240
|
+
color: #f92672 !important;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
/* console 单独处理 - 必须是白色 */
|
|
2244
|
+
.hep-cr-editor .token.property.console,
|
|
2245
|
+
.hep-cr-editor .token.console {
|
|
2246
|
+
color: #f8f8f2 !important;
|
|
2235
2247
|
}
|
|
2236
2248
|
|
|
2237
2249
|
.hep-cr-editor .token.boolean,
|
|
2238
2250
|
.hep-cr-editor .token.number {
|
|
2239
|
-
color: #ae81ff;
|
|
2251
|
+
color: #ae81ff !important;
|
|
2240
2252
|
}
|
|
2241
2253
|
|
|
2242
2254
|
.hep-cr-editor .token.selector,
|
|
@@ -2245,7 +2257,7 @@ const ce = `
|
|
|
2245
2257
|
.hep-cr-editor .token.char,
|
|
2246
2258
|
.hep-cr-editor .token.builtin,
|
|
2247
2259
|
.hep-cr-editor .token.inserted {
|
|
2248
|
-
color: #a6e22e;
|
|
2260
|
+
color: #a6e22e !important;
|
|
2249
2261
|
}
|
|
2250
2262
|
|
|
2251
2263
|
.hep-cr-editor .token.operator,
|
|
@@ -2254,25 +2266,45 @@ const ce = `
|
|
|
2254
2266
|
.hep-cr-editor .language-css .hep-cr-editor .token.string,
|
|
2255
2267
|
.hep-cr-editor .style .hep-cr-editor .token.string,
|
|
2256
2268
|
.hep-cr-editor .token.variable {
|
|
2257
|
-
color: #f8f8f2;
|
|
2269
|
+
color: #f8f8f2 !important;
|
|
2258
2270
|
}
|
|
2259
2271
|
|
|
2260
2272
|
.hep-cr-editor .token.atrule,
|
|
2261
2273
|
.hep-cr-editor .token.attr-value,
|
|
2262
2274
|
.hep-cr-editor .token.function,
|
|
2263
2275
|
.hep-cr-editor .token.class-name {
|
|
2264
|
-
color: #e6db74;
|
|
2276
|
+
color: #e6db74 !important;
|
|
2265
2277
|
}
|
|
2266
2278
|
|
|
2267
|
-
.hep-cr-editor .token.keyword
|
|
2268
|
-
|
|
2279
|
+
.hep-cr-editor .token.keyword,
|
|
2280
|
+
.hep-cr-editor .token.keyword-control {
|
|
2281
|
+
color: #66d9ef !important;
|
|
2269
2282
|
}
|
|
2270
2283
|
|
|
2271
2284
|
.hep-cr-editor .token.regex,
|
|
2272
2285
|
.hep-cr-editor .token.important {
|
|
2273
|
-
color: #fd971f;
|
|
2286
|
+
color: #fd971f !important;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
/* 覆盖用户项目的 text-shadow 样式,避免白边 */
|
|
2290
|
+
.hep-cr-editor code[class*="language-"],
|
|
2291
|
+
.hep-cr-editor pre[class*="language-"],
|
|
2292
|
+
.hep-cr-editor .hep-cr-highlight code,
|
|
2293
|
+
.hep-cr-editor .hep-cr-highlight pre {
|
|
2294
|
+
text-shadow: none !important;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
/* 覆盖 console 等内置对象 */
|
|
2298
|
+
.hep-cr-editor .token.console {
|
|
2299
|
+
color: #f8f8f2 !important;
|
|
2274
2300
|
}
|
|
2275
2301
|
`, de = `
|
|
2302
|
+
/* 默认代码颜色 */
|
|
2303
|
+
.hep-cr-editor .hep-cr-highlight code,
|
|
2304
|
+
.hep-cr-editor .hep-cr-highlight pre {
|
|
2305
|
+
color: #333 !important;
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2276
2308
|
.hep-cr-editor .token.comment,
|
|
2277
2309
|
.hep-cr-editor .token.prolog,
|
|
2278
2310
|
.hep-cr-editor .token.doctype,
|
|
@@ -2330,11 +2362,24 @@ const ce = `
|
|
|
2330
2362
|
.hep-cr-editor .token.important {
|
|
2331
2363
|
color: #e36209;
|
|
2332
2364
|
}
|
|
2365
|
+
|
|
2366
|
+
/* 覆盖用户项目的 text-shadow 样式,避免白边 */
|
|
2367
|
+
.hep-cr-editor code[class*="language-"],
|
|
2368
|
+
.hep-cr-editor pre[class*="language-"],
|
|
2369
|
+
.hep-cr-editor .hep-cr-highlight code,
|
|
2370
|
+
.hep-cr-editor .hep-cr-highlight pre {
|
|
2371
|
+
text-shadow: none !important;
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
/* 覆盖 console 等内置对象 */
|
|
2375
|
+
.hep-cr-editor .token.console {
|
|
2376
|
+
color: #333 !important;
|
|
2377
|
+
}
|
|
2333
2378
|
`;
|
|
2334
|
-
function Y(
|
|
2335
|
-
var h = typeof
|
|
2336
|
-
return e && (h.render = e, h.staticRenderFns = t, h._compiled = !0),
|
|
2337
|
-
exports:
|
|
2379
|
+
function Y(n, e, t, l, p, m, b, u) {
|
|
2380
|
+
var h = typeof n == "function" ? n.options : n;
|
|
2381
|
+
return e && (h.render = e, h.staticRenderFns = t, h._compiled = !0), m && (h._scopeId = "data-v-" + m), {
|
|
2382
|
+
exports: n,
|
|
2338
2383
|
options: h
|
|
2339
2384
|
};
|
|
2340
2385
|
}
|
|
@@ -2368,8 +2413,8 @@ const pe = {
|
|
|
2368
2413
|
this.loadPrismTheme(this.theme);
|
|
2369
2414
|
},
|
|
2370
2415
|
watch: {
|
|
2371
|
-
theme(
|
|
2372
|
-
this.loadPrismTheme(
|
|
2416
|
+
theme(n) {
|
|
2417
|
+
this.loadPrismTheme(n);
|
|
2373
2418
|
}
|
|
2374
2419
|
},
|
|
2375
2420
|
computed: {
|
|
@@ -2415,11 +2460,11 @@ const pe = {
|
|
|
2415
2460
|
},
|
|
2416
2461
|
highlightedCode: function() {
|
|
2417
2462
|
try {
|
|
2418
|
-
var
|
|
2419
|
-
if (
|
|
2463
|
+
var n = j.languages[this.prismLanguage];
|
|
2464
|
+
if (n)
|
|
2420
2465
|
return j.highlight(
|
|
2421
2466
|
this.value || "",
|
|
2422
|
-
|
|
2467
|
+
n,
|
|
2423
2468
|
this.prismLanguage
|
|
2424
2469
|
);
|
|
2425
2470
|
} catch {
|
|
@@ -2428,27 +2473,27 @@ const pe = {
|
|
|
2428
2473
|
}
|
|
2429
2474
|
},
|
|
2430
2475
|
methods: {
|
|
2431
|
-
loadPrismTheme(
|
|
2432
|
-
const e = "hep-cr-prism-styles";
|
|
2433
|
-
|
|
2434
|
-
const
|
|
2435
|
-
|
|
2476
|
+
loadPrismTheme(n) {
|
|
2477
|
+
const e = "hep-cr-prism-styles", t = document.getElementById(e), l = n === "dark" ? ce : de;
|
|
2478
|
+
t && t.remove();
|
|
2479
|
+
const p = document.createElement("style");
|
|
2480
|
+
p.id = e, p.textContent = l, document.head.appendChild(p);
|
|
2436
2481
|
},
|
|
2437
|
-
escapeHtml: function(
|
|
2482
|
+
escapeHtml: function(n) {
|
|
2438
2483
|
var e = document.createElement("div");
|
|
2439
|
-
return e.textContent =
|
|
2484
|
+
return e.textContent = n, e.innerHTML;
|
|
2440
2485
|
},
|
|
2441
|
-
handleInput: function(
|
|
2442
|
-
this.$emit("input",
|
|
2486
|
+
handleInput: function(n) {
|
|
2487
|
+
this.$emit("input", n.target.value), this.$emit("update:value", n.target.value);
|
|
2443
2488
|
},
|
|
2444
|
-
handleScroll: function(
|
|
2489
|
+
handleScroll: function(n) {
|
|
2445
2490
|
var e = this.$refs.highlightRef;
|
|
2446
|
-
e && (e.scrollTop =
|
|
2491
|
+
e && (e.scrollTop = n.target.scrollTop, e.scrollLeft = n.target.scrollLeft);
|
|
2447
2492
|
},
|
|
2448
|
-
handleKeydown: function(
|
|
2449
|
-
if (
|
|
2450
|
-
|
|
2451
|
-
var e =
|
|
2493
|
+
handleKeydown: function(n) {
|
|
2494
|
+
if (n.key === "Tab") {
|
|
2495
|
+
n.preventDefault();
|
|
2496
|
+
var e = n.target, t = e.selectionStart, l = e.selectionEnd, p = e.value;
|
|
2452
2497
|
e.value = p.substring(0, t) + " " + p.substring(l), e.selectionStart = e.selectionEnd = t + 2, this.$emit("input", e.value), this.$emit("update:value", e.value);
|
|
2453
2498
|
}
|
|
2454
2499
|
}
|
|
@@ -2457,18 +2502,18 @@ const pe = {
|
|
|
2457
2502
|
var ge = function() {
|
|
2458
2503
|
var e = this, t = e._self._c;
|
|
2459
2504
|
return t("div", { staticClass: "hep-cr-editor", class: "hep-cr-theme-" + e.theme, style: { background: e.editorBackground } }, [t("pre", { ref: "highlightRef", staticClass: "hep-cr-highlight", class: "language-" + e.prismLanguage, attrs: { "aria-hidden": "true" } }, [t("code", { domProps: { innerHTML: e._s(e.highlightedCode) } })]), t("textarea", { staticClass: "hep-cr-input", attrs: { disabled: e.disabled, spellcheck: "false", placeholder: "Write your code here..." }, domProps: { value: e.value }, on: { input: e.handleInput, scroll: e.handleScroll, keydown: e.handleKeydown } })]);
|
|
2460
|
-
}, he = [],
|
|
2505
|
+
}, he = [], me = /* @__PURE__ */ Y(
|
|
2461
2506
|
pe,
|
|
2462
2507
|
ge,
|
|
2463
2508
|
he,
|
|
2464
2509
|
!1,
|
|
2465
2510
|
null,
|
|
2466
|
-
"
|
|
2511
|
+
"54283826"
|
|
2467
2512
|
);
|
|
2468
|
-
const
|
|
2513
|
+
const fe = me.exports, be = {
|
|
2469
2514
|
name: "CodeRunner",
|
|
2470
2515
|
components: {
|
|
2471
|
-
CodeEditor:
|
|
2516
|
+
CodeEditor: fe
|
|
2472
2517
|
},
|
|
2473
2518
|
props: {
|
|
2474
2519
|
pistonUrl: {
|
|
@@ -2482,8 +2527,8 @@ const me = fe.exports, be = {
|
|
|
2482
2527
|
theme: {
|
|
2483
2528
|
type: String,
|
|
2484
2529
|
default: "light",
|
|
2485
|
-
validator: function(
|
|
2486
|
-
return ["light", "dark"].indexOf(
|
|
2530
|
+
validator: function(n) {
|
|
2531
|
+
return ["light", "dark"].indexOf(n) !== -1;
|
|
2487
2532
|
}
|
|
2488
2533
|
},
|
|
2489
2534
|
showLanguageSelector: {
|
|
@@ -2529,21 +2574,21 @@ const me = fe.exports, be = {
|
|
|
2529
2574
|
return "hep-cr-runner-" + this.currentTheme;
|
|
2530
2575
|
},
|
|
2531
2576
|
languageOptions: function() {
|
|
2532
|
-
return this.runtimes.map(function(
|
|
2577
|
+
return this.runtimes.map(function(n) {
|
|
2533
2578
|
return {
|
|
2534
|
-
value:
|
|
2535
|
-
label:
|
|
2579
|
+
value: n.language + ":" + n.version,
|
|
2580
|
+
label: n.language.charAt(0).toUpperCase() + n.language.slice(1) + " " + n.version
|
|
2536
2581
|
};
|
|
2537
2582
|
});
|
|
2538
2583
|
},
|
|
2539
2584
|
languageName: function() {
|
|
2540
|
-
var
|
|
2541
|
-
return
|
|
2585
|
+
var n = this.currentLanguage;
|
|
2586
|
+
return n.includes(":") ? n.split(":")[0] : n;
|
|
2542
2587
|
}
|
|
2543
2588
|
},
|
|
2544
2589
|
watch: {
|
|
2545
|
-
currentLanguage: function(
|
|
2546
|
-
var e =
|
|
2590
|
+
currentLanguage: function(n) {
|
|
2591
|
+
var e = n.includes(":") ? n.split(":")[0] : n;
|
|
2547
2592
|
this.code = z(e), this.$emit("language-change", e, this.code);
|
|
2548
2593
|
}
|
|
2549
2594
|
},
|
|
@@ -2552,36 +2597,36 @@ const me = fe.exports, be = {
|
|
|
2552
2597
|
},
|
|
2553
2598
|
methods: {
|
|
2554
2599
|
loadRuntimes: function() {
|
|
2555
|
-
var
|
|
2600
|
+
var n = this;
|
|
2556
2601
|
this.runtimesLoading = !0, this.error = null, this.client.getRuntimes().then(function(e) {
|
|
2557
|
-
|
|
2602
|
+
n.runtimes = e;
|
|
2558
2603
|
}).catch(function(e) {
|
|
2559
|
-
|
|
2604
|
+
n.error = e.message || "Failed to load runtimes";
|
|
2560
2605
|
}).finally(function() {
|
|
2561
|
-
|
|
2606
|
+
n.runtimesLoading = !1;
|
|
2562
2607
|
});
|
|
2563
2608
|
},
|
|
2564
2609
|
execute: function() {
|
|
2565
|
-
var
|
|
2610
|
+
var n = this;
|
|
2566
2611
|
this.isRunning || (this.isRunning = !0, this.output = "", this.stderr = "", this.executionTime = null, this.error = null, this.activeTab = "stdout", this.$emit("execute-start"), this.client.execute(this.languageName, this.code).then(function(e) {
|
|
2567
|
-
|
|
2612
|
+
n.output = e.output, n.stderr = e.stderr, n.executionTime = e.executionTime || null, n.activeTab = e.stderr ? "stderr" : "stdout", n.$emit("execute-end", e);
|
|
2568
2613
|
}).catch(function(e) {
|
|
2569
|
-
|
|
2614
|
+
n.error = e.message || "Execution failed", n.$emit("execute-end", {
|
|
2570
2615
|
success: !1,
|
|
2571
2616
|
output: "",
|
|
2572
|
-
stderr:
|
|
2617
|
+
stderr: n.error,
|
|
2573
2618
|
code: -1
|
|
2574
2619
|
});
|
|
2575
2620
|
}).finally(function() {
|
|
2576
|
-
|
|
2621
|
+
n.isRunning = !1;
|
|
2577
2622
|
}));
|
|
2578
2623
|
},
|
|
2579
2624
|
clearOutput: function() {
|
|
2580
2625
|
this.output = "", this.stderr = "", this.executionTime = null, this.error = null;
|
|
2581
2626
|
},
|
|
2582
2627
|
copyOutput: function() {
|
|
2583
|
-
var
|
|
2584
|
-
navigator.clipboard.writeText(
|
|
2628
|
+
var n = this.activeTab === "stdout" ? this.output : this.stderr;
|
|
2629
|
+
navigator.clipboard.writeText(n);
|
|
2585
2630
|
},
|
|
2586
2631
|
resetCode: function() {
|
|
2587
2632
|
this.code = z(this.languageName);
|
|
@@ -2589,11 +2634,11 @@ const me = fe.exports, be = {
|
|
|
2589
2634
|
toggleTheme: function() {
|
|
2590
2635
|
this.currentTheme = this.currentTheme === "light" ? "dark" : "light";
|
|
2591
2636
|
},
|
|
2592
|
-
startDrag: function(
|
|
2637
|
+
startDrag: function(n) {
|
|
2593
2638
|
var e = this, t = document.querySelector(".hep-cr-runner-main");
|
|
2594
2639
|
if (t) {
|
|
2595
|
-
var l = function(
|
|
2596
|
-
var b = t.getBoundingClientRect(), u = (
|
|
2640
|
+
var l = function(m) {
|
|
2641
|
+
var b = t.getBoundingClientRect(), u = (m.clientX - b.left) / b.width * 100;
|
|
2597
2642
|
e.editorWidth = Math.max(20, Math.min(80, u));
|
|
2598
2643
|
}, p = function() {
|
|
2599
2644
|
document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", p), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
@@ -2606,10 +2651,10 @@ const me = fe.exports, be = {
|
|
|
2606
2651
|
var Ee = function() {
|
|
2607
2652
|
var e = this, t = e._self._c;
|
|
2608
2653
|
return t("div", { class: ["hep-cr-runner", e.themeClass] }, [t("div", { staticClass: "hep-cr-runner-header" }, [t("div", { staticClass: "hep-cr-runner-controls" }, [e.showLanguageSelector ? t("select", { directives: [{ name: "model", rawName: "v-model", value: e.currentLanguage, expression: "currentLanguage" }], staticClass: "hep-cr-language-select", attrs: { disabled: e.isRunning }, on: { change: function(l) {
|
|
2609
|
-
var p = Array.prototype.filter.call(l.target.options, function(
|
|
2610
|
-
return
|
|
2611
|
-
}).map(function(
|
|
2612
|
-
var b = "_value" in
|
|
2654
|
+
var p = Array.prototype.filter.call(l.target.options, function(m) {
|
|
2655
|
+
return m.selected;
|
|
2656
|
+
}).map(function(m) {
|
|
2657
|
+
var b = "_value" in m ? m._value : m.value;
|
|
2613
2658
|
return b;
|
|
2614
2659
|
});
|
|
2615
2660
|
e.currentLanguage = l.target.multiple ? p : p[0];
|
|
@@ -2664,16 +2709,16 @@ const M = ye.exports, Ae = {
|
|
|
2664
2709
|
}
|
|
2665
2710
|
},
|
|
2666
2711
|
watch: {
|
|
2667
|
-
value(
|
|
2668
|
-
this.localVisible =
|
|
2712
|
+
value(n) {
|
|
2713
|
+
this.localVisible = n;
|
|
2669
2714
|
}
|
|
2670
2715
|
},
|
|
2671
2716
|
methods: {
|
|
2672
2717
|
close() {
|
|
2673
2718
|
this.localVisible = !1, this.$emit("input", !1), this.$emit("update:value", !1), this.$emit("close");
|
|
2674
2719
|
},
|
|
2675
|
-
handleOverlayClick(
|
|
2676
|
-
|
|
2720
|
+
handleOverlayClick(n) {
|
|
2721
|
+
n.target === n.currentTarget && this.close();
|
|
2677
2722
|
}
|
|
2678
2723
|
},
|
|
2679
2724
|
expose: ["close"]
|
|
@@ -2690,12 +2735,12 @@ var Se = function() {
|
|
|
2690
2735
|
"ec700b03"
|
|
2691
2736
|
);
|
|
2692
2737
|
const ke = we.exports;
|
|
2693
|
-
M.install = (
|
|
2694
|
-
|
|
2738
|
+
M.install = (n) => {
|
|
2739
|
+
n.component("CodeRunner", M);
|
|
2695
2740
|
};
|
|
2696
2741
|
const _e = {
|
|
2697
|
-
install(
|
|
2698
|
-
|
|
2742
|
+
install(n) {
|
|
2743
|
+
n.component("CodeRunner", M);
|
|
2699
2744
|
}
|
|
2700
2745
|
};
|
|
2701
2746
|
export {
|