@threadlabs/looma 0.18.6 → 0.19.0
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/components/ui-editor-table-overlay/ui-editor-table-overlay.html +34 -3
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +55 -0
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +7 -2
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +29 -0
- package/dist/index.js +1 -1
- package/editor/chunks/extensions.js +24 -3
- package/editor/extensions/preset.d.ts +2 -0
- package/editor/extensions/table-commands.d.ts +1 -1
- package/editor/table-overlay.d.ts +8 -3
- package/package.json +2 -1
- package/styles/ui-editor-table-overlay.css +30 -0
- package/styles/ui-editor-table-toolbar.css +7 -2
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +9 -3
- package/vue/UiEditorTableOverlay.d.ts +8 -0
- package/vue/UiEditorTableOverlay.vue +45 -2
- package/vue/UiEditorTableToolbar.vue +7 -2
- package/vue/chunks/1c.js +106 -0
- package/vue/chunks/UiEditorTableOverlay.js +14 -4
- package/vue/chunks/UiEditorTableToolbar.js +1 -1
- package/vue/chunks/abnf.js +61 -0
- package/vue/chunks/accesslog.js +72 -0
- package/vue/chunks/actionscript.js +139 -0
- package/vue/chunks/ada.js +183 -0
- package/vue/chunks/angelscript.js +141 -0
- package/vue/chunks/apache.js +88 -0
- package/vue/chunks/applescript.js +99 -0
- package/vue/chunks/arcade.js +405 -0
- package/vue/chunks/arduino.js +871 -0
- package/vue/chunks/armasm.js +65 -0
- package/vue/chunks/asciidoc.js +181 -0
- package/vue/chunks/aspectj.js +202 -0
- package/vue/chunks/autohotkey.js +54 -0
- package/vue/chunks/autoit.js +132 -0
- package/vue/chunks/avrasm.js +46 -0
- package/vue/chunks/awk.js +58 -0
- package/vue/chunks/axapta.js +167 -0
- package/vue/chunks/bash.js +358 -0
- package/vue/chunks/basic.js +221 -0
- package/vue/chunks/bnf.js +27 -0
- package/vue/chunks/brainfuck.js +40 -0
- package/vue/chunks/c.js +265 -0
- package/vue/chunks/cal.js +136 -0
- package/vue/chunks/capnproto.js +86 -0
- package/vue/chunks/ceylon.js +125 -0
- package/vue/chunks/clean.js +54 -0
- package/vue/chunks/clojure-repl.js +17 -0
- package/vue/chunks/clojure.js +133 -0
- package/vue/chunks/cmake.js +23 -0
- package/vue/chunks/coffeescript.js +291 -0
- package/vue/chunks/coq.js +436 -0
- package/vue/chunks/cos.js +77 -0
- package/vue/chunks/cpp.js +492 -0
- package/vue/chunks/crmsh.js +80 -0
- package/vue/chunks/crystal.js +260 -0
- package/vue/chunks/csharp.js +376 -0
- package/vue/chunks/csp.js +52 -0
- package/vue/chunks/css.js +890 -0
- package/vue/chunks/d.js +184 -0
- package/vue/chunks/dart.js +226 -0
- package/vue/chunks/delphi.js +227 -0
- package/vue/chunks/diff.js +40 -0
- package/vue/chunks/django.js +43 -0
- package/vue/chunks/dns.js +66 -0
- package/vue/chunks/dockerfile.js +35 -0
- package/vue/chunks/dos.js +147 -0
- package/vue/chunks/dsconfig.js +55 -0
- package/vue/chunks/dts.js +119 -0
- package/vue/chunks/dust.js +33 -0
- package/vue/chunks/ebnf.js +40 -0
- package/vue/chunks/elixir.js +241 -0
- package/vue/chunks/elm.js +103 -0
- package/vue/chunks/erb.js +17 -0
- package/vue/chunks/erlang-repl.js +41 -0
- package/vue/chunks/erlang.js +236 -0
- package/vue/chunks/excel.js +562 -0
- package/vue/chunks/fix.js +30 -0
- package/vue/chunks/flix.js +60 -0
- package/vue/chunks/fortran.js +543 -0
- package/vue/chunks/fsharp.js +440 -0
- package/vue/chunks/gams.js +134 -0
- package/vue/chunks/gauss.js +167 -0
- package/vue/chunks/gcode.js +131 -0
- package/vue/chunks/gherkin.js +41 -0
- package/vue/chunks/glsl.js +25 -0
- package/vue/chunks/gml.js +3119 -0
- package/vue/chunks/go.js +140 -0
- package/vue/chunks/golo.js +72 -0
- package/vue/chunks/gradle.js +181 -0
- package/vue/chunks/graphql.js +68 -0
- package/vue/chunks/groovy.js +159 -0
- package/vue/chunks/haml.js +96 -0
- package/vue/chunks/handlebars.js +191 -0
- package/vue/chunks/haskell.js +149 -0
- package/vue/chunks/haxe.js +142 -0
- package/vue/chunks/hsp.js +45 -0
- package/vue/chunks/http.js +77 -0
- package/vue/chunks/hy.js +92 -0
- package/vue/chunks/inform7.js +45 -0
- package/vue/chunks/ini.js +94 -0
- package/vue/chunks/irpf90.js +52 -0
- package/vue/chunks/isbl.js +112 -0
- package/vue/chunks/java.js +237 -0
- package/vue/chunks/javascript.js +570 -0
- package/vue/chunks/jboss-cli.js +46 -0
- package/vue/chunks/json.js +45 -0
- package/vue/chunks/julia-repl.js +18 -0
- package/vue/chunks/julia.js +353 -0
- package/vue/chunks/kotlin.js +216 -0
- package/vue/chunks/lasso.js +127 -0
- package/vue/chunks/latex.js +206 -0
- package/vue/chunks/ldif.js +25 -0
- package/vue/chunks/leaf.js +72 -0
- package/vue/chunks/less.js +953 -0
- package/vue/chunks/lisp.js +119 -0
- package/vue/chunks/livecodeserver.js +86 -0
- package/vue/chunks/livescript.js +309 -0
- package/vue/chunks/llvm.js +77 -0
- package/vue/chunks/lsl.js +55 -0
- package/vue/chunks/lua.js +49 -0
- package/vue/chunks/makefile.js +62 -0
- package/vue/chunks/markdown.js +194 -0
- package/vue/chunks/mathematica.js +7317 -0
- package/vue/chunks/matlab.js +70 -0
- package/vue/chunks/maxima.js +38 -0
- package/vue/chunks/mel.js +24 -0
- package/vue/chunks/mercury.js +62 -0
- package/vue/chunks/mipsasm.js +53 -0
- package/vue/chunks/mizar.js +10 -0
- package/vue/chunks/mojolicious.js +27 -0
- package/vue/chunks/monkey.js +158 -0
- package/vue/chunks/moonscript.js +102 -0
- package/vue/chunks/n1ql.js +346 -0
- package/vue/chunks/nestedtext.js +66 -0
- package/vue/chunks/nginx.js +127 -0
- package/vue/chunks/nim.js +174 -0
- package/vue/chunks/nix.js +334 -0
- package/vue/chunks/node-repl.js +20 -0
- package/vue/chunks/nsis.js +515 -0
- package/vue/chunks/objectivec.js +235 -0
- package/vue/chunks/ocaml.js +52 -0
- package/vue/chunks/openscad.js +66 -0
- package/vue/chunks/oxygene.js +58 -0
- package/vue/chunks/parser3.js +40 -0
- package/vue/chunks/perl.js +454 -0
- package/vue/chunks/pf.js +30 -0
- package/vue/chunks/pgsql.js +196 -0
- package/vue/chunks/php-template.js +43 -0
- package/vue/chunks/php.js +527 -0
- package/vue/chunks/plaintext.js +10 -0
- package/vue/chunks/pony.js +60 -0
- package/vue/chunks/powershell.js +208 -0
- package/vue/chunks/processing.js +407 -0
- package/vue/chunks/profile.js +38 -0
- package/vue/chunks/prolog.js +62 -0
- package/vue/chunks/properties.js +45 -0
- package/vue/chunks/protobuf.js +63 -0
- package/vue/chunks/puppet.js +87 -0
- package/vue/chunks/purebasic.js +42 -0
- package/vue/chunks/python-repl.js +19 -0
- package/vue/chunks/python.js +357 -0
- package/vue/chunks/q.js +21 -0
- package/vue/chunks/qml.js +134 -0
- package/vue/chunks/r.js +145 -0
- package/vue/chunks/reasonml.js +134 -0
- package/vue/chunks/rib.js +16 -0
- package/vue/chunks/roboconf.js +54 -0
- package/vue/chunks/routeros.js +109 -0
- package/vue/chunks/rsl.js +138 -0
- package/vue/chunks/ruby.js +322 -0
- package/vue/chunks/ruleslanguage.js +26 -0
- package/vue/chunks/rust.js +296 -0
- package/vue/chunks/sas.js +533 -0
- package/vue/chunks/scala.js +173 -0
- package/vue/chunks/scheme.js +118 -0
- package/vue/chunks/scilab.js +45 -0
- package/vue/chunks/scss.js +900 -0
- package/vue/chunks/shell.js +18 -0
- package/vue/chunks/smali.js +113 -0
- package/vue/chunks/smalltalk.js +59 -0
- package/vue/chunks/sml.js +49 -0
- package/vue/chunks/sqf.js +2599 -0
- package/vue/chunks/sql.js +624 -0
- package/vue/chunks/stan.js +471 -0
- package/vue/chunks/stata.js +33 -0
- package/vue/chunks/step21.js +53 -0
- package/vue/chunks/stylus.js +925 -0
- package/vue/chunks/subunit.js +34 -0
- package/vue/chunks/swift.js +699 -0
- package/vue/chunks/taggerscript.js +37 -0
- package/vue/chunks/tap.js +30 -0
- package/vue/chunks/tcl.js +165 -0
- package/vue/chunks/thrift.js +65 -0
- package/vue/chunks/tp.js +155 -0
- package/vue/chunks/twig.js +232 -0
- package/vue/chunks/typescript.js +672 -0
- package/vue/chunks/vala.js +39 -0
- package/vue/chunks/vbnet.js +86 -0
- package/vue/chunks/vbscript-html.js +14 -0
- package/vue/chunks/vbscript.js +200 -0
- package/vue/chunks/verilog.js +534 -0
- package/vue/chunks/vhdl.js +190 -0
- package/vue/chunks/vim.js +54 -0
- package/vue/chunks/wasm.js +111 -0
- package/vue/chunks/wren.js +229 -0
- package/vue/chunks/x86asm.js +64 -0
- package/vue/chunks/xl.js +192 -0
- package/vue/chunks/xml.js +175 -0
- package/vue/chunks/xquery.js +303 -0
- package/vue/chunks/yaml.js +159 -0
- package/vue/chunks/zephir.js +74 -0
- package/vue/components.css +119 -85
- package/vue/editor/LoomaEditor.d.ts +7 -7
- package/vue/editor/code-language-catalog.d.ts +196 -0
- package/vue/editor/index.js +290 -20
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/typescript.js
|
|
2
|
+
var IDENT_RE = "[A-Za-z$_][0-9A-Za-z$_]*";
|
|
3
|
+
var KEYWORDS = [
|
|
4
|
+
"as",
|
|
5
|
+
"in",
|
|
6
|
+
"of",
|
|
7
|
+
"if",
|
|
8
|
+
"for",
|
|
9
|
+
"while",
|
|
10
|
+
"finally",
|
|
11
|
+
"var",
|
|
12
|
+
"new",
|
|
13
|
+
"function",
|
|
14
|
+
"do",
|
|
15
|
+
"return",
|
|
16
|
+
"void",
|
|
17
|
+
"else",
|
|
18
|
+
"break",
|
|
19
|
+
"catch",
|
|
20
|
+
"instanceof",
|
|
21
|
+
"with",
|
|
22
|
+
"throw",
|
|
23
|
+
"case",
|
|
24
|
+
"default",
|
|
25
|
+
"try",
|
|
26
|
+
"switch",
|
|
27
|
+
"continue",
|
|
28
|
+
"typeof",
|
|
29
|
+
"delete",
|
|
30
|
+
"let",
|
|
31
|
+
"yield",
|
|
32
|
+
"const",
|
|
33
|
+
"class",
|
|
34
|
+
"debugger",
|
|
35
|
+
"async",
|
|
36
|
+
"await",
|
|
37
|
+
"static",
|
|
38
|
+
"import",
|
|
39
|
+
"from",
|
|
40
|
+
"export",
|
|
41
|
+
"extends",
|
|
42
|
+
"using"
|
|
43
|
+
];
|
|
44
|
+
var LITERALS = [
|
|
45
|
+
"true",
|
|
46
|
+
"false",
|
|
47
|
+
"null",
|
|
48
|
+
"undefined",
|
|
49
|
+
"NaN",
|
|
50
|
+
"Infinity"
|
|
51
|
+
];
|
|
52
|
+
var TYPES = [
|
|
53
|
+
"Object",
|
|
54
|
+
"Function",
|
|
55
|
+
"Boolean",
|
|
56
|
+
"Symbol",
|
|
57
|
+
"Math",
|
|
58
|
+
"Date",
|
|
59
|
+
"Number",
|
|
60
|
+
"BigInt",
|
|
61
|
+
"String",
|
|
62
|
+
"RegExp",
|
|
63
|
+
"Array",
|
|
64
|
+
"Float32Array",
|
|
65
|
+
"Float64Array",
|
|
66
|
+
"Int8Array",
|
|
67
|
+
"Uint8Array",
|
|
68
|
+
"Uint8ClampedArray",
|
|
69
|
+
"Int16Array",
|
|
70
|
+
"Int32Array",
|
|
71
|
+
"Uint16Array",
|
|
72
|
+
"Uint32Array",
|
|
73
|
+
"BigInt64Array",
|
|
74
|
+
"BigUint64Array",
|
|
75
|
+
"Set",
|
|
76
|
+
"Map",
|
|
77
|
+
"WeakSet",
|
|
78
|
+
"WeakMap",
|
|
79
|
+
"ArrayBuffer",
|
|
80
|
+
"SharedArrayBuffer",
|
|
81
|
+
"Atomics",
|
|
82
|
+
"DataView",
|
|
83
|
+
"JSON",
|
|
84
|
+
"Promise",
|
|
85
|
+
"Generator",
|
|
86
|
+
"GeneratorFunction",
|
|
87
|
+
"AsyncFunction",
|
|
88
|
+
"Reflect",
|
|
89
|
+
"Proxy",
|
|
90
|
+
"Intl",
|
|
91
|
+
"WebAssembly"
|
|
92
|
+
];
|
|
93
|
+
var ERROR_TYPES = [
|
|
94
|
+
"Error",
|
|
95
|
+
"EvalError",
|
|
96
|
+
"InternalError",
|
|
97
|
+
"RangeError",
|
|
98
|
+
"ReferenceError",
|
|
99
|
+
"SyntaxError",
|
|
100
|
+
"TypeError",
|
|
101
|
+
"URIError"
|
|
102
|
+
];
|
|
103
|
+
var BUILT_IN_GLOBALS = [
|
|
104
|
+
"setInterval",
|
|
105
|
+
"setTimeout",
|
|
106
|
+
"clearInterval",
|
|
107
|
+
"clearTimeout",
|
|
108
|
+
"require",
|
|
109
|
+
"exports",
|
|
110
|
+
"eval",
|
|
111
|
+
"isFinite",
|
|
112
|
+
"isNaN",
|
|
113
|
+
"parseFloat",
|
|
114
|
+
"parseInt",
|
|
115
|
+
"decodeURI",
|
|
116
|
+
"decodeURIComponent",
|
|
117
|
+
"encodeURI",
|
|
118
|
+
"encodeURIComponent",
|
|
119
|
+
"escape",
|
|
120
|
+
"unescape"
|
|
121
|
+
];
|
|
122
|
+
var BUILT_IN_VARIABLES = [
|
|
123
|
+
"arguments",
|
|
124
|
+
"this",
|
|
125
|
+
"super",
|
|
126
|
+
"console",
|
|
127
|
+
"window",
|
|
128
|
+
"document",
|
|
129
|
+
"localStorage",
|
|
130
|
+
"sessionStorage",
|
|
131
|
+
"module",
|
|
132
|
+
"global"
|
|
133
|
+
];
|
|
134
|
+
var BUILT_INS = [].concat(BUILT_IN_GLOBALS, TYPES, ERROR_TYPES);
|
|
135
|
+
/** @type LanguageFn */
|
|
136
|
+
function javascript(hljs) {
|
|
137
|
+
const regex = hljs.regex;
|
|
138
|
+
/**
|
|
139
|
+
* Takes a string like "<Booger" and checks to see
|
|
140
|
+
* if we can find a matching "</Booger" later in the
|
|
141
|
+
* content.
|
|
142
|
+
* @param {RegExpMatchArray} match
|
|
143
|
+
* @param {{after:number}} param1
|
|
144
|
+
*/
|
|
145
|
+
const hasClosingTag = (match, { after }) => {
|
|
146
|
+
const tag = "</" + match[0].slice(1);
|
|
147
|
+
return match.input.indexOf(tag, after) !== -1;
|
|
148
|
+
};
|
|
149
|
+
const IDENT_RE$1 = IDENT_RE;
|
|
150
|
+
const FRAGMENT = {
|
|
151
|
+
begin: "<>",
|
|
152
|
+
end: "</>"
|
|
153
|
+
};
|
|
154
|
+
const XML_SELF_CLOSING = /<[A-Za-z0-9\\._:-]+\s*\/>/;
|
|
155
|
+
const XML_TAG = {
|
|
156
|
+
begin: /<[A-Za-z0-9\\._:-]+/,
|
|
157
|
+
end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
|
|
158
|
+
/**
|
|
159
|
+
* @param {RegExpMatchArray} match
|
|
160
|
+
* @param {CallbackResponse} response
|
|
161
|
+
*/
|
|
162
|
+
isTrulyOpeningTag: (match, response) => {
|
|
163
|
+
const afterMatchIndex = match[0].length + match.index;
|
|
164
|
+
const nextChar = match.input[afterMatchIndex];
|
|
165
|
+
if (nextChar === "<" || nextChar === ",") {
|
|
166
|
+
response.ignoreMatch();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (nextChar === ">") {
|
|
170
|
+
if (!hasClosingTag(match, { after: afterMatchIndex })) response.ignoreMatch();
|
|
171
|
+
}
|
|
172
|
+
let m;
|
|
173
|
+
const afterMatch = match.input.substring(afterMatchIndex);
|
|
174
|
+
if (m = afterMatch.match(/^\s*=/)) {
|
|
175
|
+
response.ignoreMatch();
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (m = afterMatch.match(/^\s+extends\s+/)) {
|
|
179
|
+
if (m.index === 0) {
|
|
180
|
+
response.ignoreMatch();
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const KEYWORDS$1 = {
|
|
187
|
+
$pattern: IDENT_RE,
|
|
188
|
+
keyword: KEYWORDS,
|
|
189
|
+
literal: LITERALS,
|
|
190
|
+
built_in: BUILT_INS,
|
|
191
|
+
"variable.language": BUILT_IN_VARIABLES
|
|
192
|
+
};
|
|
193
|
+
const decimalDigits = "[0-9](_?[0-9])*";
|
|
194
|
+
const frac = `\\.(${decimalDigits})`;
|
|
195
|
+
const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;
|
|
196
|
+
const NUMBER = {
|
|
197
|
+
className: "number",
|
|
198
|
+
variants: [
|
|
199
|
+
{ begin: `(\\b(${decimalInteger})((${frac})|\\.)?|(${frac}))[eE][+-]?(${decimalDigits})\\b` },
|
|
200
|
+
{ begin: `\\b(${decimalInteger})\\b((${frac})\\b|\\.)?|(${frac})\\b` },
|
|
201
|
+
{ begin: `\\b(0|[1-9](_?[0-9])*)n\\b` },
|
|
202
|
+
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
|
|
203
|
+
{ begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
|
|
204
|
+
{ begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
|
|
205
|
+
{ begin: "\\b0[0-7]+n?\\b" }
|
|
206
|
+
],
|
|
207
|
+
relevance: 0
|
|
208
|
+
};
|
|
209
|
+
const SUBST = {
|
|
210
|
+
className: "subst",
|
|
211
|
+
begin: "\\$\\{",
|
|
212
|
+
end: "\\}",
|
|
213
|
+
keywords: KEYWORDS$1,
|
|
214
|
+
contains: []
|
|
215
|
+
};
|
|
216
|
+
const HTML_TEMPLATE = {
|
|
217
|
+
begin: ".?html`",
|
|
218
|
+
end: "",
|
|
219
|
+
starts: {
|
|
220
|
+
end: "`",
|
|
221
|
+
returnEnd: false,
|
|
222
|
+
contains: [hljs.BACKSLASH_ESCAPE, SUBST],
|
|
223
|
+
subLanguage: "xml"
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
const CSS_TEMPLATE = {
|
|
227
|
+
begin: ".?css`",
|
|
228
|
+
end: "",
|
|
229
|
+
starts: {
|
|
230
|
+
end: "`",
|
|
231
|
+
returnEnd: false,
|
|
232
|
+
contains: [hljs.BACKSLASH_ESCAPE, SUBST],
|
|
233
|
+
subLanguage: "css"
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
const GRAPHQL_TEMPLATE = {
|
|
237
|
+
begin: ".?gql`",
|
|
238
|
+
end: "",
|
|
239
|
+
starts: {
|
|
240
|
+
end: "`",
|
|
241
|
+
returnEnd: false,
|
|
242
|
+
contains: [hljs.BACKSLASH_ESCAPE, SUBST],
|
|
243
|
+
subLanguage: "graphql"
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
const TEMPLATE_STRING = {
|
|
247
|
+
className: "string",
|
|
248
|
+
begin: "`",
|
|
249
|
+
end: "`",
|
|
250
|
+
contains: [hljs.BACKSLASH_ESCAPE, SUBST]
|
|
251
|
+
};
|
|
252
|
+
const COMMENT = {
|
|
253
|
+
className: "comment",
|
|
254
|
+
variants: [
|
|
255
|
+
hljs.COMMENT(/\/\*\*(?!\/)/, "\\*/", {
|
|
256
|
+
relevance: 0,
|
|
257
|
+
contains: [{
|
|
258
|
+
begin: "(?=@[A-Za-z]+)",
|
|
259
|
+
relevance: 0,
|
|
260
|
+
contains: [
|
|
261
|
+
{
|
|
262
|
+
className: "doctag",
|
|
263
|
+
begin: "@[A-Za-z]+"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
className: "type",
|
|
267
|
+
begin: "\\{",
|
|
268
|
+
end: "\\}",
|
|
269
|
+
excludeEnd: true,
|
|
270
|
+
excludeBegin: true,
|
|
271
|
+
relevance: 0
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
className: "variable",
|
|
275
|
+
begin: IDENT_RE$1 + "(?=\\s*(-)|$)",
|
|
276
|
+
endsParent: true,
|
|
277
|
+
relevance: 0
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
begin: /(?=[^\n])\s/,
|
|
281
|
+
relevance: 0
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
}]
|
|
285
|
+
}),
|
|
286
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
287
|
+
hljs.C_LINE_COMMENT_MODE
|
|
288
|
+
]
|
|
289
|
+
};
|
|
290
|
+
const SUBST_INTERNALS = [
|
|
291
|
+
hljs.APOS_STRING_MODE,
|
|
292
|
+
hljs.QUOTE_STRING_MODE,
|
|
293
|
+
HTML_TEMPLATE,
|
|
294
|
+
CSS_TEMPLATE,
|
|
295
|
+
GRAPHQL_TEMPLATE,
|
|
296
|
+
TEMPLATE_STRING,
|
|
297
|
+
{ match: /\$\d+/ },
|
|
298
|
+
NUMBER
|
|
299
|
+
];
|
|
300
|
+
SUBST.contains = SUBST_INTERNALS.concat({
|
|
301
|
+
begin: /\{/,
|
|
302
|
+
end: /\}/,
|
|
303
|
+
keywords: KEYWORDS$1,
|
|
304
|
+
contains: ["self"].concat(SUBST_INTERNALS)
|
|
305
|
+
});
|
|
306
|
+
const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);
|
|
307
|
+
const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([{
|
|
308
|
+
begin: /(\s*)\(/,
|
|
309
|
+
end: /\)/,
|
|
310
|
+
keywords: KEYWORDS$1,
|
|
311
|
+
contains: ["self"].concat(SUBST_AND_COMMENTS)
|
|
312
|
+
}]);
|
|
313
|
+
const PARAMS = {
|
|
314
|
+
className: "params",
|
|
315
|
+
begin: /(\s*)\(/,
|
|
316
|
+
end: /\)/,
|
|
317
|
+
excludeBegin: true,
|
|
318
|
+
excludeEnd: true,
|
|
319
|
+
keywords: KEYWORDS$1,
|
|
320
|
+
contains: PARAMS_CONTAINS
|
|
321
|
+
};
|
|
322
|
+
const CLASS_OR_EXTENDS = { variants: [{
|
|
323
|
+
match: [
|
|
324
|
+
/class/,
|
|
325
|
+
/\s+/,
|
|
326
|
+
IDENT_RE$1,
|
|
327
|
+
/\s+/,
|
|
328
|
+
/extends/,
|
|
329
|
+
/\s+/,
|
|
330
|
+
regex.concat(IDENT_RE$1, "(", regex.concat(/\./, IDENT_RE$1), ")*")
|
|
331
|
+
],
|
|
332
|
+
scope: {
|
|
333
|
+
1: "keyword",
|
|
334
|
+
3: "title.class",
|
|
335
|
+
5: "keyword",
|
|
336
|
+
7: "title.class.inherited"
|
|
337
|
+
}
|
|
338
|
+
}, {
|
|
339
|
+
match: [
|
|
340
|
+
/class/,
|
|
341
|
+
/\s+/,
|
|
342
|
+
IDENT_RE$1
|
|
343
|
+
],
|
|
344
|
+
scope: {
|
|
345
|
+
1: "keyword",
|
|
346
|
+
3: "title.class"
|
|
347
|
+
}
|
|
348
|
+
}] };
|
|
349
|
+
const CLASS_REFERENCE = {
|
|
350
|
+
relevance: 0,
|
|
351
|
+
match: regex.either(/\bJSON/, /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/, /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/, /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),
|
|
352
|
+
className: "title.class",
|
|
353
|
+
keywords: { _: [...TYPES, ...ERROR_TYPES] }
|
|
354
|
+
};
|
|
355
|
+
const USE_STRICT = {
|
|
356
|
+
label: "use_strict",
|
|
357
|
+
className: "meta",
|
|
358
|
+
relevance: 10,
|
|
359
|
+
begin: /^\s*['"]use (strict|asm)['"]/
|
|
360
|
+
};
|
|
361
|
+
const FUNCTION_DEFINITION = {
|
|
362
|
+
variants: [{ match: [
|
|
363
|
+
/function/,
|
|
364
|
+
/\s+/,
|
|
365
|
+
IDENT_RE$1,
|
|
366
|
+
/(?=\s*\()/
|
|
367
|
+
] }, { match: [/function/, /\s*(?=\()/] }],
|
|
368
|
+
className: {
|
|
369
|
+
1: "keyword",
|
|
370
|
+
3: "title.function"
|
|
371
|
+
},
|
|
372
|
+
label: "func.def",
|
|
373
|
+
contains: [PARAMS],
|
|
374
|
+
illegal: /%/
|
|
375
|
+
};
|
|
376
|
+
const UPPER_CASE_CONSTANT = {
|
|
377
|
+
relevance: 0,
|
|
378
|
+
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
379
|
+
className: "variable.constant"
|
|
380
|
+
};
|
|
381
|
+
function noneOf(list) {
|
|
382
|
+
return regex.concat("(?!", list.join("|"), ")");
|
|
383
|
+
}
|
|
384
|
+
const FUNCTION_CALL = {
|
|
385
|
+
match: regex.concat(/\b/, noneOf([
|
|
386
|
+
...BUILT_IN_GLOBALS,
|
|
387
|
+
"super",
|
|
388
|
+
"import",
|
|
389
|
+
"await"
|
|
390
|
+
].map((x) => `${x}\\s*\\(`)), IDENT_RE$1, regex.lookahead(/\s*\(/)),
|
|
391
|
+
className: "title.function",
|
|
392
|
+
relevance: 0
|
|
393
|
+
};
|
|
394
|
+
const PROPERTY_ACCESS = {
|
|
395
|
+
begin: regex.concat(/\./, regex.lookahead(regex.concat(IDENT_RE$1, /(?![0-9A-Za-z$_(])/))),
|
|
396
|
+
end: IDENT_RE$1,
|
|
397
|
+
excludeBegin: true,
|
|
398
|
+
keywords: "prototype",
|
|
399
|
+
className: "property",
|
|
400
|
+
relevance: 0
|
|
401
|
+
};
|
|
402
|
+
const GETTER_OR_SETTER = {
|
|
403
|
+
match: [
|
|
404
|
+
/get|set/,
|
|
405
|
+
/\s+/,
|
|
406
|
+
IDENT_RE$1,
|
|
407
|
+
/(?=\()/
|
|
408
|
+
],
|
|
409
|
+
className: {
|
|
410
|
+
1: "keyword",
|
|
411
|
+
3: "title.function"
|
|
412
|
+
},
|
|
413
|
+
contains: [{ begin: /\(\)/ }, PARAMS]
|
|
414
|
+
};
|
|
415
|
+
const FUNC_LEAD_IN_RE = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + hljs.UNDERSCORE_IDENT_RE + ")\\s*=>";
|
|
416
|
+
const FUNCTION_VARIABLE = {
|
|
417
|
+
match: [
|
|
418
|
+
/const|var|let/,
|
|
419
|
+
/\s+/,
|
|
420
|
+
IDENT_RE$1,
|
|
421
|
+
/\s*/,
|
|
422
|
+
/=\s*/,
|
|
423
|
+
/(async\s*)?/,
|
|
424
|
+
regex.lookahead(FUNC_LEAD_IN_RE)
|
|
425
|
+
],
|
|
426
|
+
keywords: "async",
|
|
427
|
+
className: {
|
|
428
|
+
1: "keyword",
|
|
429
|
+
3: "title.function"
|
|
430
|
+
},
|
|
431
|
+
contains: [PARAMS]
|
|
432
|
+
};
|
|
433
|
+
return {
|
|
434
|
+
name: "JavaScript",
|
|
435
|
+
aliases: [
|
|
436
|
+
"js",
|
|
437
|
+
"jsx",
|
|
438
|
+
"mjs",
|
|
439
|
+
"cjs"
|
|
440
|
+
],
|
|
441
|
+
keywords: KEYWORDS$1,
|
|
442
|
+
exports: {
|
|
443
|
+
PARAMS_CONTAINS,
|
|
444
|
+
CLASS_REFERENCE
|
|
445
|
+
},
|
|
446
|
+
illegal: /#(?![$_A-Za-z])/,
|
|
447
|
+
contains: [
|
|
448
|
+
hljs.SHEBANG({
|
|
449
|
+
label: "shebang",
|
|
450
|
+
binary: "node",
|
|
451
|
+
relevance: 5
|
|
452
|
+
}),
|
|
453
|
+
USE_STRICT,
|
|
454
|
+
hljs.APOS_STRING_MODE,
|
|
455
|
+
hljs.QUOTE_STRING_MODE,
|
|
456
|
+
HTML_TEMPLATE,
|
|
457
|
+
CSS_TEMPLATE,
|
|
458
|
+
GRAPHQL_TEMPLATE,
|
|
459
|
+
TEMPLATE_STRING,
|
|
460
|
+
COMMENT,
|
|
461
|
+
{ match: /\$\d+/ },
|
|
462
|
+
NUMBER,
|
|
463
|
+
CLASS_REFERENCE,
|
|
464
|
+
{
|
|
465
|
+
scope: "attr",
|
|
466
|
+
match: IDENT_RE$1 + regex.lookahead(":"),
|
|
467
|
+
relevance: 0
|
|
468
|
+
},
|
|
469
|
+
FUNCTION_VARIABLE,
|
|
470
|
+
{
|
|
471
|
+
begin: "(" + hljs.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
472
|
+
keywords: "return throw case",
|
|
473
|
+
relevance: 0,
|
|
474
|
+
contains: [
|
|
475
|
+
COMMENT,
|
|
476
|
+
hljs.REGEXP_MODE,
|
|
477
|
+
{
|
|
478
|
+
className: "function",
|
|
479
|
+
begin: FUNC_LEAD_IN_RE,
|
|
480
|
+
returnBegin: true,
|
|
481
|
+
end: "\\s*=>",
|
|
482
|
+
contains: [{
|
|
483
|
+
className: "params",
|
|
484
|
+
variants: [
|
|
485
|
+
{
|
|
486
|
+
begin: hljs.UNDERSCORE_IDENT_RE,
|
|
487
|
+
relevance: 0
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
className: null,
|
|
491
|
+
begin: /\(\s*\)/,
|
|
492
|
+
skip: true
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
begin: /(\s*)\(/,
|
|
496
|
+
end: /\)/,
|
|
497
|
+
excludeBegin: true,
|
|
498
|
+
excludeEnd: true,
|
|
499
|
+
keywords: KEYWORDS$1,
|
|
500
|
+
contains: PARAMS_CONTAINS
|
|
501
|
+
}
|
|
502
|
+
]
|
|
503
|
+
}]
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
begin: /,/,
|
|
507
|
+
relevance: 0
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
match: /\s+/,
|
|
511
|
+
relevance: 0
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
variants: [
|
|
515
|
+
{
|
|
516
|
+
begin: FRAGMENT.begin,
|
|
517
|
+
end: FRAGMENT.end
|
|
518
|
+
},
|
|
519
|
+
{ match: XML_SELF_CLOSING },
|
|
520
|
+
{
|
|
521
|
+
begin: XML_TAG.begin,
|
|
522
|
+
"on:begin": XML_TAG.isTrulyOpeningTag,
|
|
523
|
+
end: XML_TAG.end
|
|
524
|
+
}
|
|
525
|
+
],
|
|
526
|
+
subLanguage: "xml",
|
|
527
|
+
contains: [{
|
|
528
|
+
begin: XML_TAG.begin,
|
|
529
|
+
end: XML_TAG.end,
|
|
530
|
+
skip: true,
|
|
531
|
+
contains: ["self"]
|
|
532
|
+
}]
|
|
533
|
+
}
|
|
534
|
+
]
|
|
535
|
+
},
|
|
536
|
+
FUNCTION_DEFINITION,
|
|
537
|
+
{ beginKeywords: "while if switch catch for" },
|
|
538
|
+
{
|
|
539
|
+
begin: "\\b(?!function)" + hljs.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
|
|
540
|
+
returnBegin: true,
|
|
541
|
+
label: "func.def",
|
|
542
|
+
contains: [PARAMS, hljs.inherit(hljs.TITLE_MODE, {
|
|
543
|
+
begin: IDENT_RE$1,
|
|
544
|
+
className: "title.function"
|
|
545
|
+
})]
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
match: /\.\.\./,
|
|
549
|
+
relevance: 0
|
|
550
|
+
},
|
|
551
|
+
PROPERTY_ACCESS,
|
|
552
|
+
{
|
|
553
|
+
match: "\\$" + IDENT_RE$1,
|
|
554
|
+
relevance: 0
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
match: [/\bconstructor(?=\s*\()/],
|
|
558
|
+
className: { 1: "title.function" },
|
|
559
|
+
contains: [PARAMS]
|
|
560
|
+
},
|
|
561
|
+
FUNCTION_CALL,
|
|
562
|
+
UPPER_CASE_CONSTANT,
|
|
563
|
+
CLASS_OR_EXTENDS,
|
|
564
|
+
GETTER_OR_SETTER,
|
|
565
|
+
{ match: /\$[(.]/ }
|
|
566
|
+
]
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
/** @type LanguageFn */
|
|
570
|
+
function typescript(hljs) {
|
|
571
|
+
const regex = hljs.regex;
|
|
572
|
+
const tsLanguage = javascript(hljs);
|
|
573
|
+
const IDENT_RE$1 = IDENT_RE;
|
|
574
|
+
const TYPES = [
|
|
575
|
+
"any",
|
|
576
|
+
"void",
|
|
577
|
+
"number",
|
|
578
|
+
"boolean",
|
|
579
|
+
"string",
|
|
580
|
+
"object",
|
|
581
|
+
"never",
|
|
582
|
+
"symbol",
|
|
583
|
+
"bigint",
|
|
584
|
+
"unknown"
|
|
585
|
+
];
|
|
586
|
+
const NAMESPACE = {
|
|
587
|
+
begin: [
|
|
588
|
+
/namespace/,
|
|
589
|
+
/\s+/,
|
|
590
|
+
hljs.IDENT_RE
|
|
591
|
+
],
|
|
592
|
+
beginScope: {
|
|
593
|
+
1: "keyword",
|
|
594
|
+
3: "title.class"
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
const INTERFACE = {
|
|
598
|
+
beginKeywords: "interface",
|
|
599
|
+
end: /\{/,
|
|
600
|
+
excludeEnd: true,
|
|
601
|
+
keywords: {
|
|
602
|
+
keyword: "interface extends",
|
|
603
|
+
built_in: TYPES
|
|
604
|
+
},
|
|
605
|
+
contains: [tsLanguage.exports.CLASS_REFERENCE]
|
|
606
|
+
};
|
|
607
|
+
const USE_STRICT = {
|
|
608
|
+
className: "meta",
|
|
609
|
+
relevance: 10,
|
|
610
|
+
begin: /^\s*['"]use strict['"]/
|
|
611
|
+
};
|
|
612
|
+
const KEYWORDS$1 = {
|
|
613
|
+
$pattern: IDENT_RE,
|
|
614
|
+
keyword: KEYWORDS.concat([
|
|
615
|
+
"type",
|
|
616
|
+
"interface",
|
|
617
|
+
"public",
|
|
618
|
+
"private",
|
|
619
|
+
"protected",
|
|
620
|
+
"implements",
|
|
621
|
+
"declare",
|
|
622
|
+
"abstract",
|
|
623
|
+
"readonly",
|
|
624
|
+
"enum",
|
|
625
|
+
"override",
|
|
626
|
+
"satisfies"
|
|
627
|
+
]),
|
|
628
|
+
literal: LITERALS,
|
|
629
|
+
built_in: BUILT_INS.concat(TYPES),
|
|
630
|
+
"variable.language": BUILT_IN_VARIABLES
|
|
631
|
+
};
|
|
632
|
+
const DECORATOR = {
|
|
633
|
+
className: "meta",
|
|
634
|
+
begin: "@" + IDENT_RE$1
|
|
635
|
+
};
|
|
636
|
+
const swapMode = (mode, label, replacement) => {
|
|
637
|
+
const indx = mode.contains.findIndex((m) => m.label === label);
|
|
638
|
+
if (indx === -1) throw new Error("can not find mode to replace");
|
|
639
|
+
mode.contains.splice(indx, 1, replacement);
|
|
640
|
+
};
|
|
641
|
+
Object.assign(tsLanguage.keywords, KEYWORDS$1);
|
|
642
|
+
tsLanguage.exports.PARAMS_CONTAINS.push(DECORATOR);
|
|
643
|
+
const ATTRIBUTE_HIGHLIGHT = tsLanguage.contains.find((c) => c.scope === "attr");
|
|
644
|
+
const OPTIONAL_KEY_OR_ARGUMENT = Object.assign({}, ATTRIBUTE_HIGHLIGHT, { match: regex.concat(IDENT_RE$1, regex.lookahead(/\s*\?:/)) });
|
|
645
|
+
tsLanguage.exports.PARAMS_CONTAINS.push([
|
|
646
|
+
tsLanguage.exports.CLASS_REFERENCE,
|
|
647
|
+
ATTRIBUTE_HIGHLIGHT,
|
|
648
|
+
OPTIONAL_KEY_OR_ARGUMENT
|
|
649
|
+
]);
|
|
650
|
+
tsLanguage.contains = tsLanguage.contains.concat([
|
|
651
|
+
DECORATOR,
|
|
652
|
+
NAMESPACE,
|
|
653
|
+
INTERFACE,
|
|
654
|
+
OPTIONAL_KEY_OR_ARGUMENT
|
|
655
|
+
]);
|
|
656
|
+
swapMode(tsLanguage, "shebang", hljs.SHEBANG());
|
|
657
|
+
swapMode(tsLanguage, "use_strict", USE_STRICT);
|
|
658
|
+
const functionDeclaration = tsLanguage.contains.find((m) => m.label === "func.def");
|
|
659
|
+
functionDeclaration.relevance = 0;
|
|
660
|
+
Object.assign(tsLanguage, {
|
|
661
|
+
name: "TypeScript",
|
|
662
|
+
aliases: [
|
|
663
|
+
"ts",
|
|
664
|
+
"tsx",
|
|
665
|
+
"mts",
|
|
666
|
+
"cts"
|
|
667
|
+
]
|
|
668
|
+
});
|
|
669
|
+
return tsLanguage;
|
|
670
|
+
}
|
|
671
|
+
//#endregion
|
|
672
|
+
export { typescript as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/vala.js
|
|
2
|
+
function vala(hljs) {
|
|
3
|
+
return {
|
|
4
|
+
name: "Vala",
|
|
5
|
+
keywords: {
|
|
6
|
+
keyword: "char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override virtual delegate if while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",
|
|
7
|
+
built_in: "DBus GLib CCode Gee Object Gtk Posix",
|
|
8
|
+
literal: "false true null"
|
|
9
|
+
},
|
|
10
|
+
contains: [
|
|
11
|
+
{
|
|
12
|
+
className: "class",
|
|
13
|
+
beginKeywords: "class interface namespace",
|
|
14
|
+
end: /\{/,
|
|
15
|
+
excludeEnd: true,
|
|
16
|
+
illegal: "[^,:\\n\\s\\.]",
|
|
17
|
+
contains: [hljs.UNDERSCORE_TITLE_MODE]
|
|
18
|
+
},
|
|
19
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
20
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
21
|
+
{
|
|
22
|
+
className: "string",
|
|
23
|
+
begin: "\"\"\"",
|
|
24
|
+
end: "\"\"\"",
|
|
25
|
+
relevance: 5
|
|
26
|
+
},
|
|
27
|
+
hljs.APOS_STRING_MODE,
|
|
28
|
+
hljs.QUOTE_STRING_MODE,
|
|
29
|
+
hljs.C_NUMBER_MODE,
|
|
30
|
+
{
|
|
31
|
+
className: "meta",
|
|
32
|
+
begin: "^#",
|
|
33
|
+
end: "$"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { vala as default };
|