@aiao/code-editor-react 0.0.8 → 0.0.10
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 +118 -2
- package/package.json +7 -4
- package/dist/apl-B2DGVGxc-Dd6D39pP.js +0 -76
- package/dist/asciiarmor-2LVJmxlE-CAn4gnoC.js +0 -34
- package/dist/asn1-jKiBa2Ya-xsKwdyq9.js +0 -95
- package/dist/asterisk-DS281yxp-B5eTWk_B.js +0 -271
- package/dist/brainfuck-C_p9pTT8-DKVQ9poL.js +0 -34
- package/dist/clike-BMALKCNj-Ck7Gc35_.js +0 -620
- package/dist/clojure-CCKyeQKf-N9sg777Z.js +0 -800
- package/dist/cmake-CuaCgAKt-BbEgXraO.js +0 -28
- package/dist/cobol-BlTKFDRj-CHCoWafp.js +0 -72
- package/dist/coffeescript-BVCvwO8I-Z15ai5ac.js +0 -179
- package/dist/commonlisp-D_kxz07b-Ce7sn14o.js +0 -75
- package/dist/crystal-D309uH6_-DS6LrXoE.js +0 -217
- package/dist/css-BkF-NPzE-DiJu9Nkd.js +0 -1553
- package/dist/cypher-BMq4Fwjl-Ml-omWgp.js +0 -68
- package/dist/d-BZcgY6La-KCW6-bIm.js +0 -127
- package/dist/diff-Cg9d_RX2-C01qBVFc.js +0 -18
- package/dist/dockerfile-DFX8bq9N-BIbYUQV0.js +0 -194
- package/dist/dtd-CtLokQ-U-DCbNdeIA.js +0 -84
- package/dist/dylan-QYeExnWK-DIUVpsct.js +0 -234
- package/dist/ebnf-DUPDuY4r-7HIXKmWn.js +0 -78
- package/dist/ecl-CiXN-g_D-DOI-W0if.js +0 -121
- package/dist/eiffel-yQhjl4T1-DIX8Ceq1.js +0 -110
- package/dist/elm-CNT9vbN0-BcYlydpO.js +0 -108
- package/dist/erlang-CFOYdy9e-DULXsFZl.js +0 -487
- package/dist/factor-Clf6BoVk-DBb2EHMF.js +0 -65
- package/dist/fcl-CPC2WYrI-CuXG3fcK.js +0 -103
- package/dist/forth-BmxRyE9S-BcFwWpeL.js +0 -60
- package/dist/fortran-9bvPyrOW-CuLcq-Iu.js +0 -442
- package/dist/gas-cpmYfFX2-sZgGhMxB.js +0 -183
- package/dist/gherkin-CJuwpceU-BRrr8yjO.js +0 -34
- package/dist/groovy-DZeT_VM--CmF8wcSo.js +0 -146
- package/dist/haskell-CxiO_7JL-BuULsXvv.js +0 -375
- package/dist/haxe-70NVW1pR-CM27SfgM.js +0 -359
- package/dist/http-D9LttvKF-j9E8oQ7o.js +0 -44
- package/dist/idl-B6TRFYjl-B6TRFYjl.js +0 -947
- package/dist/index-BMiCCEB1-CFMNJD60.js +0 -305
- package/dist/index-BNuasEBW-DZ41gDvf.js +0 -94
- package/dist/index-Bg1KDWyt-C0dA4q7z.js +0 -290
- package/dist/index-BuVm7ZG6-CVgdIGdI.js +0 -1305
- package/dist/index-BvS1cnHq-CvzF_kJP.js +0 -613
- package/dist/index-C44L0DmY-y7wRzM46.js +0 -138
- package/dist/index-C71CZfUx-BtWSxfva.js +0 -247
- package/dist/index-CGKWrtgc.js +0 -29766
- package/dist/index-CQ6JWNwi-DowNkPcb.js +0 -566
- package/dist/index-CpRVx97--DylNh-Zi.js +0 -342
- package/dist/index-CqvQj6d--nBAN1vpF.js +0 -270
- package/dist/index-CrbQBmWq-DmiRVF9u.js +0 -157
- package/dist/index-CzovO10m-DDglzqnG.js +0 -301
- package/dist/index-D0BZOY-S-rNSlBO9l.js +0 -101
- package/dist/index-D0svJS59-f8ZA2hgC.js +0 -555
- package/dist/index-D93XVMi1-CZ_Q2QZM.js +0 -136
- package/dist/index-DEB5VK0f-iiwOciBu.js +0 -252
- package/dist/index-Dp8osI_J-DDFW8XvK.js +0 -960
- package/dist/index-Ds4AioqO-Cg_BlAEI.js +0 -1917
- package/dist/index-Dy-OpkyQ-DcLuBsQT.js +0 -76
- package/dist/index-Dyi9rNIT-B7p7Dpus.js +0 -391
- package/dist/index-ZJkjD9tT-DJQk0ayW.js +0 -74
- package/dist/index-qH2lMs0G-Co53S8h3.js +0 -944
- package/dist/index-srIksFxX-BLrX1cGK.js +0 -59
- package/dist/javascript-DOuB9oqA-BxiygWgm.js +0 -691
- package/dist/julia-DpvXAuO6-Bk_IfD8X.js +0 -241
- package/dist/livescript-CanGTf8u-Cx6PrvS4.js +0 -272
- package/dist/lua-XplVlWi_-8f8obHzY.js +0 -217
- package/dist/mathematica-jaRHnSxC-B83gQsL2.js +0 -35
- package/dist/mbox-BctzC1hL-Hg5U2B4l.js +0 -76
- package/dist/mirc-CFBPAOaF-CfzSSk9W.js +0 -72
- package/dist/mllike-BSnXJBGA-Ao1NpT2u.js +0 -272
- package/dist/modelica-vUgVs--1-BObVpYBg.js +0 -93
- package/dist/mscgen-Cpl0NYLN-DqNArLGH.js +0 -104
- package/dist/mumps-CQoS1kWX-CkTUOQnt.js +0 -25
- package/dist/nginx-zDPm3Z74-DJk4KP7N.js +0 -87
- package/dist/nsis-BCLyjY7m-C2MffOQ3.js +0 -62
- package/dist/ntriples-CsNjv2QF-C4aZn3EO.js +0 -79
- package/dist/octave-C8PmmSRH-DM5vTWlU.js +0 -143
- package/dist/oz-Ce8aN8oE-BcJM4SVy.js +0 -151
- package/dist/pascal-De0D6mP7-D7DGFFKL.js +0 -77
- package/dist/perl-B4bSCe1C-6aIa2glS.js +0 -915
- package/dist/pig-D24Z8EXi-BD-qt5FU.js +0 -54
- package/dist/powershell-DkYVfTzP-Blt1Rodi.js +0 -249
- package/dist/properties-Dn9wna3M-EOOwnCnk.js +0 -26
- package/dist/protobuf-BPIjwpzm-DAButU8_.js +0 -49
- package/dist/pug-TGXr6c5j-C9HfQ86E.js +0 -248
- package/dist/puppet-nyd4dhjf-CGzH5dsa.js +0 -45
- package/dist/python-BkR3uSy8-CjDnyp3B.js +0 -313
- package/dist/q-DyHZGnqm-DGuqeH_T.js +0 -86
- package/dist/r-LKEuhEGI-BFQhJnTP.js +0 -104
- package/dist/rpm-IznJm2Xc-CbZqrWCM.js +0 -57
- package/dist/ruby-CcYfvIk6-DzPSfSGo.js +0 -228
- package/dist/sas-7E8yHoCW-D726Uzkw.js +0 -105
- package/dist/scheme-DjibxsNh-Bp5gVFkm.js +0 -124
- package/dist/shell-C0C2sNA_-BTeYg6ir.js +0 -182
- package/dist/sieve-Bwz7vjP5-Cw8iTBf7.js +0 -72
- package/dist/simple-mode-mNVtnu0l-BC8mf7KF.js +0 -89
- package/dist/smalltalk-Bhddl2pB-B7URiJSp.js +0 -48
- package/dist/solr-BNlsLglM-BM2OpfTI.js +0 -41
- package/dist/sparql-FarWu_Gb-FN_uQNd4.js +0 -197
- package/dist/spreadsheet-C-cy4P5N-5CSTwVYq.js +0 -49
- package/dist/sql-CfG5lQ3l-Bd4dgm_8.js +0 -278
- package/dist/stex-Du4h4KAU-QOov_zHj.js +0 -129
- package/dist/stylus-CAdqWld3-BcRBbBxD.js +0 -250
- package/dist/swift-DSxqR9R6-2Hz4NOoF.js +0 -230
- package/dist/tcl-xfoLljhY-DAZBRGQI.js +0 -81
- package/dist/textile-D1AWE-pc-DuiIfEnb.js +0 -295
- package/dist/tiddlywiki-5wqsXtSk-WuF_8VUv.js +0 -155
- package/dist/tiki-__Kn3CeS-CWcR9ib_.js +0 -181
- package/dist/toml-DWAmxCjl-CyJoDzs6.js +0 -56
- package/dist/troff-D2UO-fKf-DVoIzS-O.js +0 -35
- package/dist/ttcn-Bsa4sfRm-hoy08sYQ.js +0 -123
- package/dist/ttcn-cfg-Bac_acMi-DaC4kQpd.js +0 -88
- package/dist/turtle-xwJUxoPV-fs94wdNM.js +0 -80
- package/dist/vb-c2kQGd6--DU726qF0.js +0 -74
- package/dist/vbscript-1f_Dhg5H-DriA32xD.js +0 -324
- package/dist/velocity-DJd0pTTC-BG368IR6.js +0 -96
- package/dist/verilog-CiS1jyi5-giQA8J-e.js +0 -259
- package/dist/vhdl-T9HkrbI2-BJ8LEDog.js +0 -106
- package/dist/webidl-CjfDENEo-BM8KXKJ5.js +0 -155
- package/dist/xquery-Ct6lEb4B-C5KDc61l.js +0 -422
- package/dist/yacas-C0absKBh-B82QJ76F.js +0 -73
- package/dist/z80-Pki2zAjW-B0IQoIbR.js +0 -61
package/dist/index.js
CHANGED
|
@@ -1,4 +1,120 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as O } from "react/jsx-runtime";
|
|
2
|
+
import { SUPPORT_LANGUAGES as P } from "@aiao/code-editor";
|
|
3
|
+
import { indentWithTab as j } from "@codemirror/commands";
|
|
4
|
+
import { indentUnit as q } from "@codemirror/language";
|
|
5
|
+
import { Compartment as f, EditorState as G } from "@codemirror/state";
|
|
6
|
+
import { oneDark as v } from "@codemirror/theme-one-dark";
|
|
7
|
+
import { EditorView as s, placeholder as z, keymap as F, highlightWhitespace as _ } from "@codemirror/view";
|
|
8
|
+
import { basicSetup as B, minimalSetup as J } from "codemirror";
|
|
9
|
+
import { useRef as r, useCallback as K, useEffect as o } from "react";
|
|
10
|
+
function re({
|
|
11
|
+
value: a = "",
|
|
12
|
+
onChange: g,
|
|
13
|
+
theme: w = "light",
|
|
14
|
+
language: d = "sql",
|
|
15
|
+
placeholder: p,
|
|
16
|
+
readonly: C = !1,
|
|
17
|
+
disabled: S = !1,
|
|
18
|
+
setup: b = "basic",
|
|
19
|
+
indentWithTab: x = !1,
|
|
20
|
+
indentUnit: h,
|
|
21
|
+
lineWrapping: E = !1,
|
|
22
|
+
highlightWhitespace: L = !1
|
|
23
|
+
}) {
|
|
24
|
+
const l = r(null), t = r(null), u = r(new f()), W = r(new f()), k = r(new f()), R = r(new f()), y = r(new f()), T = r(new f()), U = r(new f()), A = r(new f()), D = r(new f()), m = K((e, n) => {
|
|
25
|
+
if (!n || n === "plaintext") {
|
|
26
|
+
e.dispatch({
|
|
27
|
+
effects: u.current.reconfigure([])
|
|
28
|
+
});
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const i = P.find((c) => [c.name, ...c.alias || []].some((N) => N.toLowerCase() === n.toLowerCase()));
|
|
32
|
+
i ? i.load().then((c) => {
|
|
33
|
+
e.dispatch({
|
|
34
|
+
effects: u.current.reconfigure(c)
|
|
35
|
+
});
|
|
36
|
+
}).catch((c) => {
|
|
37
|
+
console.error(`[CodeEditor] Failed to load language '${n}':`, c), e.dispatch({
|
|
38
|
+
effects: u.current.reconfigure([])
|
|
39
|
+
});
|
|
40
|
+
}) : (console.error(`[CodeEditor] Language '${n}' not found.`), e.dispatch({
|
|
41
|
+
effects: u.current.reconfigure([])
|
|
42
|
+
}));
|
|
43
|
+
}, []);
|
|
44
|
+
return o(() => {
|
|
45
|
+
if (!l.current) return;
|
|
46
|
+
const e = [
|
|
47
|
+
u.current.of([]),
|
|
48
|
+
W.current.of([]),
|
|
49
|
+
k.current.of([]),
|
|
50
|
+
R.current.of([]),
|
|
51
|
+
y.current.of([]),
|
|
52
|
+
T.current.of([]),
|
|
53
|
+
U.current.of([]),
|
|
54
|
+
A.current.of([]),
|
|
55
|
+
D.current.of([]),
|
|
56
|
+
s.theme({
|
|
57
|
+
"&": { height: "100%", fontSize: "12px" },
|
|
58
|
+
".cm-scroller": { overflow: "auto" },
|
|
59
|
+
".cm-gutters": { background: "initial", border: "none" }
|
|
60
|
+
}),
|
|
61
|
+
s.updateListener.of((c) => {
|
|
62
|
+
c.docChanged && g && g(c.state.doc.toString());
|
|
63
|
+
}),
|
|
64
|
+
s.lineWrapping
|
|
65
|
+
];
|
|
66
|
+
b === "basic" ? e.push(B) : b === "minimal" && e.push(J);
|
|
67
|
+
const n = G.create({
|
|
68
|
+
doc: a,
|
|
69
|
+
extensions: e
|
|
70
|
+
}), i = new s({
|
|
71
|
+
state: n,
|
|
72
|
+
parent: l.current
|
|
73
|
+
});
|
|
74
|
+
return t.current = i, d && m(i, d), () => i.destroy();
|
|
75
|
+
}, []), o(() => {
|
|
76
|
+
t.current?.dispatch({
|
|
77
|
+
effects: W.current.reconfigure(w === "dark" ? v : [])
|
|
78
|
+
});
|
|
79
|
+
}, [w]), o(() => {
|
|
80
|
+
t.current?.dispatch({
|
|
81
|
+
effects: [
|
|
82
|
+
k.current.reconfigure(G.readOnly.of(C)),
|
|
83
|
+
R.current.reconfigure(s.editable.of(!S))
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
}, [C, S]), o(() => {
|
|
87
|
+
t.current?.dispatch({
|
|
88
|
+
effects: y.current.reconfigure(p ? z(p) : [])
|
|
89
|
+
});
|
|
90
|
+
}, [p]), o(() => {
|
|
91
|
+
t.current?.dispatch({
|
|
92
|
+
effects: T.current.reconfigure(x ? F.of([j]) : [])
|
|
93
|
+
});
|
|
94
|
+
}, [x]), o(() => {
|
|
95
|
+
t.current?.dispatch({
|
|
96
|
+
effects: U.current.reconfigure(h ? q.of(h) : [])
|
|
97
|
+
});
|
|
98
|
+
}, [h]), o(() => {
|
|
99
|
+
t.current?.dispatch({
|
|
100
|
+
effects: A.current.reconfigure(E ? s.lineWrapping : [])
|
|
101
|
+
});
|
|
102
|
+
}, [E]), o(() => {
|
|
103
|
+
t.current?.dispatch({
|
|
104
|
+
effects: D.current.reconfigure(L ? _() : [])
|
|
105
|
+
});
|
|
106
|
+
}, [L]), o(() => {
|
|
107
|
+
const e = t.current;
|
|
108
|
+
e && m(e, d);
|
|
109
|
+
}, [d, m]), o(() => {
|
|
110
|
+
const e = t.current;
|
|
111
|
+
if (!e) return;
|
|
112
|
+
const n = e.state.doc.toString();
|
|
113
|
+
a !== n && e.dispatch({
|
|
114
|
+
changes: { from: 0, to: n.length, insert: a }
|
|
115
|
+
});
|
|
116
|
+
}, [a]), /* @__PURE__ */ O("div", { ref: l, className: "h-full w-full overflow-hidden text-xs" });
|
|
117
|
+
}
|
|
2
118
|
export {
|
|
3
|
-
|
|
119
|
+
re as CodeEditor
|
|
4
120
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiao/code-editor-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"dist",
|
|
19
19
|
"!**/*.tsbuildinfo"
|
|
20
20
|
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
21
24
|
"nx": {
|
|
22
25
|
"name": "code-editor-react",
|
|
23
26
|
"tags": [
|
|
@@ -30,10 +33,10 @@
|
|
|
30
33
|
"dependencies": {
|
|
31
34
|
"@codemirror/commands": "^6.10.1",
|
|
32
35
|
"@codemirror/language": "^6.12.0",
|
|
33
|
-
"@codemirror/state": "^6.5.
|
|
36
|
+
"@codemirror/state": "^6.5.4",
|
|
34
37
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
35
|
-
"@codemirror/view": "^6.39.
|
|
38
|
+
"@codemirror/view": "^6.39.11",
|
|
36
39
|
"codemirror": "^6.0.1",
|
|
37
|
-
"@aiao/code-editor": "0.0.
|
|
40
|
+
"@aiao/code-editor": "0.0.10"
|
|
38
41
|
}
|
|
39
42
|
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var a = {
|
|
2
|
-
"+": ["conjugate", "add"],
|
|
3
|
-
"−": ["negate", "subtract"],
|
|
4
|
-
"×": ["signOf", "multiply"],
|
|
5
|
-
"÷": ["reciprocal", "divide"],
|
|
6
|
-
"⌈": ["ceiling", "greaterOf"],
|
|
7
|
-
"⌊": ["floor", "lesserOf"],
|
|
8
|
-
"∣": ["absolute", "residue"],
|
|
9
|
-
"⍳": ["indexGenerate", "indexOf"],
|
|
10
|
-
"?": ["roll", "deal"],
|
|
11
|
-
"⋆": ["exponentiate", "toThePowerOf"],
|
|
12
|
-
"⍟": ["naturalLog", "logToTheBase"],
|
|
13
|
-
"○": ["piTimes", "circularFuncs"],
|
|
14
|
-
"!": ["factorial", "binomial"],
|
|
15
|
-
"⌹": ["matrixInverse", "matrixDivide"],
|
|
16
|
-
"<": [null, "lessThan"],
|
|
17
|
-
"≤": [null, "lessThanOrEqual"],
|
|
18
|
-
"=": [null, "equals"],
|
|
19
|
-
">": [null, "greaterThan"],
|
|
20
|
-
"≥": [null, "greaterThanOrEqual"],
|
|
21
|
-
"≠": [null, "notEqual"],
|
|
22
|
-
"≡": ["depth", "match"],
|
|
23
|
-
"≢": [null, "notMatch"],
|
|
24
|
-
"∈": ["enlist", "membership"],
|
|
25
|
-
"⍷": [null, "find"],
|
|
26
|
-
"∪": ["unique", "union"],
|
|
27
|
-
"∩": [null, "intersection"],
|
|
28
|
-
"∼": ["not", "without"],
|
|
29
|
-
"∨": [null, "or"],
|
|
30
|
-
"∧": [null, "and"],
|
|
31
|
-
"⍱": [null, "nor"],
|
|
32
|
-
"⍲": [null, "nand"],
|
|
33
|
-
"⍴": ["shapeOf", "reshape"],
|
|
34
|
-
",": ["ravel", "catenate"],
|
|
35
|
-
"⍪": [null, "firstAxisCatenate"],
|
|
36
|
-
"⌽": ["reverse", "rotate"],
|
|
37
|
-
"⊖": ["axis1Reverse", "axis1Rotate"],
|
|
38
|
-
"⍉": ["transpose", null],
|
|
39
|
-
"↑": ["first", "take"],
|
|
40
|
-
"↓": [null, "drop"],
|
|
41
|
-
"⊂": ["enclose", "partitionWithAxis"],
|
|
42
|
-
"⊃": ["diclose", "pick"],
|
|
43
|
-
"⌷": [null, "index"],
|
|
44
|
-
"⍋": ["gradeUp", null],
|
|
45
|
-
"⍒": ["gradeDown", null],
|
|
46
|
-
"⊤": ["encode", null],
|
|
47
|
-
"⊥": ["decode", null],
|
|
48
|
-
"⍕": ["format", "formatByExample"],
|
|
49
|
-
"⍎": ["execute", null],
|
|
50
|
-
"⊣": ["stop", "left"],
|
|
51
|
-
"⊢": ["pass", "right"]
|
|
52
|
-
}, n = /[\.\/⌿⍀¨⍣]/, r = /⍬/, u = /[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/, s = /←/, i = /[⍝#].*$/, o = function(l) {
|
|
53
|
-
var t;
|
|
54
|
-
return t = !1, function(e) {
|
|
55
|
-
return t = e, e === l ? t === "\\" : !0;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
const f = {
|
|
59
|
-
name: "apl",
|
|
60
|
-
startState: function() {
|
|
61
|
-
return {
|
|
62
|
-
prev: !1,
|
|
63
|
-
func: !1,
|
|
64
|
-
op: !1,
|
|
65
|
-
string: !1,
|
|
66
|
-
escape: !1
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
token: function(l, t) {
|
|
70
|
-
var e;
|
|
71
|
-
return l.eatSpace() ? null : (e = l.next(), e === '"' || e === "'" ? (l.eatWhile(o(e)), l.next(), t.prev = !0, "string") : /[\[{\(]/.test(e) ? (t.prev = !1, null) : /[\]}\)]/.test(e) ? (t.prev = !0, null) : r.test(e) ? (t.prev = !1, "atom") : /[¯\d]/.test(e) ? (t.func ? (t.func = !1, t.prev = !1) : t.prev = !0, l.eatWhile(/[\w\.]/), "number") : n.test(e) || s.test(e) ? "operator" : u.test(e) ? (t.func = !0, t.prev = !1, a[e] ? "variableName.function.standard" : "variableName.function") : i.test(e) ? (l.skipToEnd(), "comment") : e === "∘" && l.peek() === "." ? (l.next(), "variableName.function") : (l.eatWhile(/[\w\$_]/), t.prev = !0, "keyword"));
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
export {
|
|
75
|
-
f as apl
|
|
76
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
function s(t) {
|
|
2
|
-
var a = t.match(/^\s*\S/);
|
|
3
|
-
return t.skipToEnd(), a ? "error" : null;
|
|
4
|
-
}
|
|
5
|
-
const r = {
|
|
6
|
-
name: "asciiarmor",
|
|
7
|
-
token: function(t, a) {
|
|
8
|
-
var e;
|
|
9
|
-
if (a.state == "top")
|
|
10
|
-
return t.sol() && (e = t.match(/^-----BEGIN (.*)?-----\s*$/)) ? (a.state = "headers", a.type = e[1], "tag") : s(t);
|
|
11
|
-
if (a.state == "headers") {
|
|
12
|
-
if (t.sol() && t.match(/^\w+:/))
|
|
13
|
-
return a.state = "header", "atom";
|
|
14
|
-
var n = s(t);
|
|
15
|
-
return n && (a.state = "body"), n;
|
|
16
|
-
} else {
|
|
17
|
-
if (a.state == "header")
|
|
18
|
-
return t.skipToEnd(), a.state = "headers", "string";
|
|
19
|
-
if (a.state == "body")
|
|
20
|
-
return t.sol() && (e = t.match(/^-----END (.*)?-----\s*$/)) ? e[1] != a.type ? "error" : (a.state = "end", "tag") : t.eatWhile(/[A-Za-z0-9+\/=]/) ? null : (t.next(), "error");
|
|
21
|
-
if (a.state == "end")
|
|
22
|
-
return s(t);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
blankLine: function(t) {
|
|
26
|
-
t.state == "headers" && (t.state = "body");
|
|
27
|
-
},
|
|
28
|
-
startState: function() {
|
|
29
|
-
return { state: "top", type: null };
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
r as asciiArmor
|
|
34
|
-
};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
function E(i) {
|
|
2
|
-
for (var S = {}, l = i.split(" "), T = 0; T < l.length; ++T) S[l[T]] = !0;
|
|
3
|
-
return S;
|
|
4
|
-
}
|
|
5
|
-
const s = {
|
|
6
|
-
keywords: E("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS MINACCESS MAXACCESS REVISION STATUS DESCRIPTION SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY IMPLIED EXPORTS"),
|
|
7
|
-
cmipVerbs: E("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"),
|
|
8
|
-
compareTypes: E("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL TEXTUAL-CONVENTION"),
|
|
9
|
-
status: E("current deprecated mandatory obsolete"),
|
|
10
|
-
tags: E("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS UNIVERSAL"),
|
|
11
|
-
storage: E("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING UTCTime InterfaceIndex IANAifType CMIP-Attribute REAL PACKAGE PACKAGES IpAddress PhysAddress NetworkAddress BITS BMPString TimeStamp TimeTicks TruthValue RowStatus DisplayString GeneralString GraphicString IA5String NumericString PrintableString SnmpAdminString TeletexString UTF8String VideotexString VisibleString StringStore ISO646String T61String UniversalString Unsigned32 Integer32 Gauge Gauge32 Counter Counter32 Counter64"),
|
|
12
|
-
modifier: E("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS DEFINED"),
|
|
13
|
-
accessTypes: E("not-accessible accessible-for-notify read-only read-create read-write"),
|
|
14
|
-
multiLineStrings: !0
|
|
15
|
-
};
|
|
16
|
-
function y(i) {
|
|
17
|
-
var S = i.keywords || s.keywords, l = i.cmipVerbs || s.cmipVerbs, T = i.compareTypes || s.compareTypes, c = i.status || s.status, O = i.tags || s.tags, C = i.storage || s.storage, d = i.modifier || s.modifier, f = i.accessTypes || s.accessTypes;
|
|
18
|
-
i.multiLineStrings || s.multiLineStrings;
|
|
19
|
-
var R = i.indentStatements !== !1, N = /[\|\^]/, a;
|
|
20
|
-
function g(e, t) {
|
|
21
|
-
var n = e.next();
|
|
22
|
-
if (n == '"' || n == "'")
|
|
23
|
-
return t.tokenize = D(n), t.tokenize(e, t);
|
|
24
|
-
if (/[\[\]\(\){}:=,;]/.test(n))
|
|
25
|
-
return a = n, "punctuation";
|
|
26
|
-
if (n == "-" && e.eat("-"))
|
|
27
|
-
return e.skipToEnd(), "comment";
|
|
28
|
-
if (/\d/.test(n))
|
|
29
|
-
return e.eatWhile(/[\w\.]/), "number";
|
|
30
|
-
if (N.test(n))
|
|
31
|
-
return e.eatWhile(N), "operator";
|
|
32
|
-
e.eatWhile(/[\w\-]/);
|
|
33
|
-
var r = e.current();
|
|
34
|
-
return S.propertyIsEnumerable(r) ? "keyword" : l.propertyIsEnumerable(r) ? "variableName" : T.propertyIsEnumerable(r) ? "atom" : c.propertyIsEnumerable(r) ? "comment" : O.propertyIsEnumerable(r) ? "typeName" : C.propertyIsEnumerable(r) || d.propertyIsEnumerable(r) || f.propertyIsEnumerable(r) ? "modifier" : "variableName";
|
|
35
|
-
}
|
|
36
|
-
function D(e) {
|
|
37
|
-
return function(t, n) {
|
|
38
|
-
for (var r = !1, u, m = !1; (u = t.next()) != null; ) {
|
|
39
|
-
if (u == e && !r) {
|
|
40
|
-
var o = t.peek();
|
|
41
|
-
o && (o = o.toLowerCase(), (o == "b" || o == "h" || o == "o") && t.next()), m = !0;
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
r = !r && u == "\\";
|
|
45
|
-
}
|
|
46
|
-
return m && (n.tokenize = null), "string";
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function p(e, t, n, r, u) {
|
|
50
|
-
this.indented = e, this.column = t, this.type = n, this.align = r, this.prev = u;
|
|
51
|
-
}
|
|
52
|
-
function A(e, t, n) {
|
|
53
|
-
var r = e.indented;
|
|
54
|
-
return e.context && e.context.type == "statement" && (r = e.context.indented), e.context = new p(r, t, n, null, e.context);
|
|
55
|
-
}
|
|
56
|
-
function I(e) {
|
|
57
|
-
var t = e.context.type;
|
|
58
|
-
return (t == ")" || t == "]" || t == "}") && (e.indented = e.context.indented), e.context = e.context.prev;
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
name: "asn1",
|
|
62
|
-
startState: function() {
|
|
63
|
-
return {
|
|
64
|
-
tokenize: null,
|
|
65
|
-
context: new p(-2, 0, "top", !1),
|
|
66
|
-
indented: 0,
|
|
67
|
-
startOfLine: !0
|
|
68
|
-
};
|
|
69
|
-
},
|
|
70
|
-
token: function(e, t) {
|
|
71
|
-
var n = t.context;
|
|
72
|
-
if (e.sol() && (n.align == null && (n.align = !1), t.indented = e.indentation(), t.startOfLine = !0), e.eatSpace()) return null;
|
|
73
|
-
a = null;
|
|
74
|
-
var r = (t.tokenize || g)(e, t);
|
|
75
|
-
if (r == "comment") return r;
|
|
76
|
-
if (n.align == null && (n.align = !0), (a == ";" || a == ":" || a == ",") && n.type == "statement")
|
|
77
|
-
I(t);
|
|
78
|
-
else if (a == "{") A(t, e.column(), "}");
|
|
79
|
-
else if (a == "[") A(t, e.column(), "]");
|
|
80
|
-
else if (a == "(") A(t, e.column(), ")");
|
|
81
|
-
else if (a == "}") {
|
|
82
|
-
for (; n.type == "statement"; ) n = I(t);
|
|
83
|
-
for (n.type == "}" && (n = I(t)); n.type == "statement"; ) n = I(t);
|
|
84
|
-
} else a == n.type ? I(t) : R && ((n.type == "}" || n.type == "top") && a != ";" || n.type == "statement" && a == "newstatement") && A(t, e.column(), "statement");
|
|
85
|
-
return t.startOfLine = !1, r;
|
|
86
|
-
},
|
|
87
|
-
languageData: {
|
|
88
|
-
indentOnInput: /^\s*[{}]$/,
|
|
89
|
-
commentTokens: { line: "--" }
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
export {
|
|
94
|
-
y as asn1
|
|
95
|
-
};
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
var n = ["exten", "same", "include", "ignorepat", "switch"], s = ["#include", "#exec"], o = [
|
|
2
|
-
"addqueuemember",
|
|
3
|
-
"adsiprog",
|
|
4
|
-
"aelsub",
|
|
5
|
-
"agentlogin",
|
|
6
|
-
"agentmonitoroutgoing",
|
|
7
|
-
"agi",
|
|
8
|
-
"alarmreceiver",
|
|
9
|
-
"amd",
|
|
10
|
-
"answer",
|
|
11
|
-
"authenticate",
|
|
12
|
-
"background",
|
|
13
|
-
"backgrounddetect",
|
|
14
|
-
"bridge",
|
|
15
|
-
"busy",
|
|
16
|
-
"callcompletioncancel",
|
|
17
|
-
"callcompletionrequest",
|
|
18
|
-
"celgenuserevent",
|
|
19
|
-
"changemonitor",
|
|
20
|
-
"chanisavail",
|
|
21
|
-
"channelredirect",
|
|
22
|
-
"chanspy",
|
|
23
|
-
"clearhash",
|
|
24
|
-
"confbridge",
|
|
25
|
-
"congestion",
|
|
26
|
-
"continuewhile",
|
|
27
|
-
"controlplayback",
|
|
28
|
-
"dahdiacceptr2call",
|
|
29
|
-
"dahdibarge",
|
|
30
|
-
"dahdiras",
|
|
31
|
-
"dahdiscan",
|
|
32
|
-
"dahdisendcallreroutingfacility",
|
|
33
|
-
"dahdisendkeypadfacility",
|
|
34
|
-
"datetime",
|
|
35
|
-
"dbdel",
|
|
36
|
-
"dbdeltree",
|
|
37
|
-
"deadagi",
|
|
38
|
-
"dial",
|
|
39
|
-
"dictate",
|
|
40
|
-
"directory",
|
|
41
|
-
"disa",
|
|
42
|
-
"dumpchan",
|
|
43
|
-
"eagi",
|
|
44
|
-
"echo",
|
|
45
|
-
"endwhile",
|
|
46
|
-
"exec",
|
|
47
|
-
"execif",
|
|
48
|
-
"execiftime",
|
|
49
|
-
"exitwhile",
|
|
50
|
-
"extenspy",
|
|
51
|
-
"externalivr",
|
|
52
|
-
"festival",
|
|
53
|
-
"flash",
|
|
54
|
-
"followme",
|
|
55
|
-
"forkcdr",
|
|
56
|
-
"getcpeid",
|
|
57
|
-
"gosub",
|
|
58
|
-
"gosubif",
|
|
59
|
-
"goto",
|
|
60
|
-
"gotoif",
|
|
61
|
-
"gotoiftime",
|
|
62
|
-
"hangup",
|
|
63
|
-
"iax2provision",
|
|
64
|
-
"ices",
|
|
65
|
-
"importvar",
|
|
66
|
-
"incomplete",
|
|
67
|
-
"ivrdemo",
|
|
68
|
-
"jabberjoin",
|
|
69
|
-
"jabberleave",
|
|
70
|
-
"jabbersend",
|
|
71
|
-
"jabbersendgroup",
|
|
72
|
-
"jabberstatus",
|
|
73
|
-
"jack",
|
|
74
|
-
"log",
|
|
75
|
-
"macro",
|
|
76
|
-
"macroexclusive",
|
|
77
|
-
"macroexit",
|
|
78
|
-
"macroif",
|
|
79
|
-
"mailboxexists",
|
|
80
|
-
"meetme",
|
|
81
|
-
"meetmeadmin",
|
|
82
|
-
"meetmechanneladmin",
|
|
83
|
-
"meetmecount",
|
|
84
|
-
"milliwatt",
|
|
85
|
-
"minivmaccmess",
|
|
86
|
-
"minivmdelete",
|
|
87
|
-
"minivmgreet",
|
|
88
|
-
"minivmmwi",
|
|
89
|
-
"minivmnotify",
|
|
90
|
-
"minivmrecord",
|
|
91
|
-
"mixmonitor",
|
|
92
|
-
"monitor",
|
|
93
|
-
"morsecode",
|
|
94
|
-
"mp3player",
|
|
95
|
-
"mset",
|
|
96
|
-
"musiconhold",
|
|
97
|
-
"nbscat",
|
|
98
|
-
"nocdr",
|
|
99
|
-
"noop",
|
|
100
|
-
"odbc",
|
|
101
|
-
"odbc",
|
|
102
|
-
"odbcfinish",
|
|
103
|
-
"originate",
|
|
104
|
-
"ospauth",
|
|
105
|
-
"ospfinish",
|
|
106
|
-
"osplookup",
|
|
107
|
-
"ospnext",
|
|
108
|
-
"page",
|
|
109
|
-
"park",
|
|
110
|
-
"parkandannounce",
|
|
111
|
-
"parkedcall",
|
|
112
|
-
"pausemonitor",
|
|
113
|
-
"pausequeuemember",
|
|
114
|
-
"pickup",
|
|
115
|
-
"pickupchan",
|
|
116
|
-
"playback",
|
|
117
|
-
"playtones",
|
|
118
|
-
"privacymanager",
|
|
119
|
-
"proceeding",
|
|
120
|
-
"progress",
|
|
121
|
-
"queue",
|
|
122
|
-
"queuelog",
|
|
123
|
-
"raiseexception",
|
|
124
|
-
"read",
|
|
125
|
-
"readexten",
|
|
126
|
-
"readfile",
|
|
127
|
-
"receivefax",
|
|
128
|
-
"receivefax",
|
|
129
|
-
"receivefax",
|
|
130
|
-
"record",
|
|
131
|
-
"removequeuemember",
|
|
132
|
-
"resetcdr",
|
|
133
|
-
"retrydial",
|
|
134
|
-
"return",
|
|
135
|
-
"ringing",
|
|
136
|
-
"sayalpha",
|
|
137
|
-
"saycountedadj",
|
|
138
|
-
"saycountednoun",
|
|
139
|
-
"saycountpl",
|
|
140
|
-
"saydigits",
|
|
141
|
-
"saynumber",
|
|
142
|
-
"sayphonetic",
|
|
143
|
-
"sayunixtime",
|
|
144
|
-
"senddtmf",
|
|
145
|
-
"sendfax",
|
|
146
|
-
"sendfax",
|
|
147
|
-
"sendfax",
|
|
148
|
-
"sendimage",
|
|
149
|
-
"sendtext",
|
|
150
|
-
"sendurl",
|
|
151
|
-
"set",
|
|
152
|
-
"setamaflags",
|
|
153
|
-
"setcallerpres",
|
|
154
|
-
"setmusiconhold",
|
|
155
|
-
"sipaddheader",
|
|
156
|
-
"sipdtmfmode",
|
|
157
|
-
"sipremoveheader",
|
|
158
|
-
"skel",
|
|
159
|
-
"slastation",
|
|
160
|
-
"slatrunk",
|
|
161
|
-
"sms",
|
|
162
|
-
"softhangup",
|
|
163
|
-
"speechactivategrammar",
|
|
164
|
-
"speechbackground",
|
|
165
|
-
"speechcreate",
|
|
166
|
-
"speechdeactivategrammar",
|
|
167
|
-
"speechdestroy",
|
|
168
|
-
"speechloadgrammar",
|
|
169
|
-
"speechprocessingsound",
|
|
170
|
-
"speechstart",
|
|
171
|
-
"speechunloadgrammar",
|
|
172
|
-
"stackpop",
|
|
173
|
-
"startmusiconhold",
|
|
174
|
-
"stopmixmonitor",
|
|
175
|
-
"stopmonitor",
|
|
176
|
-
"stopmusiconhold",
|
|
177
|
-
"stopplaytones",
|
|
178
|
-
"system",
|
|
179
|
-
"testclient",
|
|
180
|
-
"testserver",
|
|
181
|
-
"transfer",
|
|
182
|
-
"tryexec",
|
|
183
|
-
"trysystem",
|
|
184
|
-
"unpausemonitor",
|
|
185
|
-
"unpausequeuemember",
|
|
186
|
-
"userevent",
|
|
187
|
-
"verbose",
|
|
188
|
-
"vmauthenticate",
|
|
189
|
-
"vmsayname",
|
|
190
|
-
"voicemail",
|
|
191
|
-
"voicemailmain",
|
|
192
|
-
"wait",
|
|
193
|
-
"waitexten",
|
|
194
|
-
"waitfornoise",
|
|
195
|
-
"waitforring",
|
|
196
|
-
"waitforsilence",
|
|
197
|
-
"waitmusiconhold",
|
|
198
|
-
"waituntil",
|
|
199
|
-
"while",
|
|
200
|
-
"zapateller"
|
|
201
|
-
];
|
|
202
|
-
function c(e, t) {
|
|
203
|
-
var a = "", i = e.next();
|
|
204
|
-
if (t.blockComment)
|
|
205
|
-
return i == "-" && e.match("-;", !0) ? t.blockComment = !1 : e.skipTo("--;") ? (e.next(), e.next(), e.next(), t.blockComment = !1) : e.skipToEnd(), "comment";
|
|
206
|
-
if (i == ";")
|
|
207
|
-
return e.match("--", !0) && !e.match("-", !1) ? (t.blockComment = !0, "comment") : (e.skipToEnd(), "comment");
|
|
208
|
-
if (i == "[")
|
|
209
|
-
return e.skipTo("]"), e.eat("]"), "header";
|
|
210
|
-
if (i == '"')
|
|
211
|
-
return e.skipTo('"'), "string";
|
|
212
|
-
if (i == "'")
|
|
213
|
-
return e.skipTo("'"), "string.special";
|
|
214
|
-
if (i == "#" && (e.eatWhile(/\w/), a = e.current(), s.indexOf(a) !== -1))
|
|
215
|
-
return e.skipToEnd(), "strong";
|
|
216
|
-
if (i == "$") {
|
|
217
|
-
var r = e.peek();
|
|
218
|
-
if (r == "{")
|
|
219
|
-
return e.skipTo("}"), e.eat("}"), "variableName.special";
|
|
220
|
-
}
|
|
221
|
-
if (e.eatWhile(/\w/), a = e.current(), n.indexOf(a) !== -1) {
|
|
222
|
-
switch (t.extenStart = !0, a) {
|
|
223
|
-
case "same":
|
|
224
|
-
t.extenSame = !0;
|
|
225
|
-
break;
|
|
226
|
-
case "include":
|
|
227
|
-
case "switch":
|
|
228
|
-
case "ignorepat":
|
|
229
|
-
t.extenInclude = !0;
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
return "atom";
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
const l = {
|
|
236
|
-
name: "asterisk",
|
|
237
|
-
startState: function() {
|
|
238
|
-
return {
|
|
239
|
-
blockComment: !1,
|
|
240
|
-
extenStart: !1,
|
|
241
|
-
extenSame: !1,
|
|
242
|
-
extenInclude: !1,
|
|
243
|
-
extenExten: !1,
|
|
244
|
-
extenPriority: !1,
|
|
245
|
-
extenApplication: !1
|
|
246
|
-
};
|
|
247
|
-
},
|
|
248
|
-
token: function(e, t) {
|
|
249
|
-
var a = "";
|
|
250
|
-
if (e.eatSpace()) return null;
|
|
251
|
-
if (t.extenStart)
|
|
252
|
-
return e.eatWhile(/[^\s]/), a = e.current(), /^=>?$/.test(a) ? (t.extenExten = !0, t.extenStart = !1, "strong") : (t.extenStart = !1, e.skipToEnd(), "error");
|
|
253
|
-
if (t.extenExten)
|
|
254
|
-
return t.extenExten = !1, t.extenPriority = !0, e.eatWhile(/[^,]/), t.extenInclude && (e.skipToEnd(), t.extenPriority = !1, t.extenInclude = !1), t.extenSame && (t.extenPriority = !1, t.extenSame = !1, t.extenApplication = !0), "tag";
|
|
255
|
-
if (t.extenPriority)
|
|
256
|
-
return t.extenPriority = !1, t.extenApplication = !0, e.next(), t.extenSame ? null : (e.eatWhile(/[^,]/), "number");
|
|
257
|
-
if (t.extenApplication) {
|
|
258
|
-
if (e.eatWhile(/,/), a = e.current(), a === ",") return null;
|
|
259
|
-
if (e.eatWhile(/\w/), a = e.current().toLowerCase(), t.extenApplication = !1, o.indexOf(a) !== -1)
|
|
260
|
-
return "def";
|
|
261
|
-
} else
|
|
262
|
-
return c(e, t);
|
|
263
|
-
return null;
|
|
264
|
-
},
|
|
265
|
-
languageData: {
|
|
266
|
-
commentTokens: { line: ";", block: { open: ";--", close: "--;" } }
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
export {
|
|
270
|
-
l as asterisk
|
|
271
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var r = "><+-.,[]".split("");
|
|
2
|
-
const o = {
|
|
3
|
-
name: "brainfuck",
|
|
4
|
-
startState: function() {
|
|
5
|
-
return {
|
|
6
|
-
commentLine: !1,
|
|
7
|
-
left: 0,
|
|
8
|
-
right: 0,
|
|
9
|
-
commentLoop: !1
|
|
10
|
-
};
|
|
11
|
-
},
|
|
12
|
-
token: function(n, t) {
|
|
13
|
-
if (n.eatSpace()) return null;
|
|
14
|
-
n.sol() && (t.commentLine = !1);
|
|
15
|
-
var e = n.next().toString();
|
|
16
|
-
if (r.indexOf(e) !== -1) {
|
|
17
|
-
if (t.commentLine === !0)
|
|
18
|
-
return n.eol() && (t.commentLine = !1), "comment";
|
|
19
|
-
if (e === "]" || e === "[")
|
|
20
|
-
return e === "[" ? t.left++ : t.right++, "bracket";
|
|
21
|
-
if (e === "+" || e === "-")
|
|
22
|
-
return "keyword";
|
|
23
|
-
if (e === "<" || e === ">")
|
|
24
|
-
return "atom";
|
|
25
|
-
if (e === "." || e === ",")
|
|
26
|
-
return "def";
|
|
27
|
-
} else
|
|
28
|
-
return t.commentLine = !0, n.eol() && (t.commentLine = !1), "comment";
|
|
29
|
-
n.eol() && (t.commentLine = !1);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
o as brainfuck
|
|
34
|
-
};
|