@kg-ui/kg-ui-plus 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -38
- package/package.json +1 -2
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +0 -16
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +0 -4
- package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +0 -26
- package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue.mjs +0 -7
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue2.mjs +0 -49
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue.mjs +0 -7
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue2.mjs +0 -94
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue.mjs +0 -7
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue2.mjs +0 -33
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue.mjs +0 -7
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue2.mjs +0 -140
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue.mjs +0 -7
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue2.mjs +0 -131
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +0 -7
- package/dist/es/KgCopilot/CopiFooter/index.vue2.mjs +0 -21
- package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +0 -4
- package/dist/es/KgCopilot/dialogue.vue.mjs +0 -7
- package/dist/es/KgCopilot/dialogue.vue2.mjs +0 -131
- package/dist/es/KgCopilot/dialogue.vue3.mjs +0 -4
- package/dist/es/KgCopilot/index.vue.mjs +0 -7
- package/dist/es/KgCopilot/index.vue2.mjs +0 -49
- package/dist/es/KgCopilot/index.vue3.mjs +0 -4
- package/dist/es/KgCopilot/mdInCode.mjs +0 -56
- package/dist/es/KgCopilot/readMd.vue.mjs +0 -7
- package/dist/es/KgCopilot/readMd.vue2.mjs +0 -87
- package/dist/es/KgCopilot/readMd.vue3.mjs +0 -4
- package/dist/es/ReIcon/index.mjs +0 -11
- package/dist/es/ReIcon/src/iconfont.mjs +0 -46
- package/dist/es/ReIcon/src/iconifyIconOffline.mjs +0 -30
- package/dist/es/ReIcon/src/iconifyIconOnline.mjs +0 -29
- package/dist/es/_virtual/___vite-browser-external.mjs +0 -6
- package/dist/es/_virtual/__vite-browser-external.mjs +0 -4
- package/dist/es/_virtual/_commonjsHelpers.mjs +0 -34
- package/dist/es/_virtual/_plugin-vue_export-helper.mjs +0 -10
- package/dist/es/_virtual/index.mjs +0 -13
- package/dist/es/api/project.mjs +0 -51
- package/dist/es/directives/heighlight/index.mjs +0 -69
- package/dist/es/directives/index.mjs +0 -4
- package/dist/es/home/LFilter/FilterArea.vue.mjs +0 -7
- package/dist/es/home/LFilter/FilterArea.vue2.mjs +0 -507
- package/dist/es/home/LFilter/FilterArea.vue3.mjs +0 -4
- package/dist/es/home/LFilter/FilterHead.vue.mjs +0 -129
- package/dist/es/home/LFilter/FilterHead.vue2.mjs +0 -4
- package/dist/es/home/LFilter/FilterItem.vue.mjs +0 -7
- package/dist/es/home/LFilter/FilterItem.vue2.mjs +0 -114
- package/dist/es/home/LFilter/FilterItem.vue3.mjs +0 -4
- package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +0 -7
- package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +0 -171
- package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +0 -4
- package/dist/es/home/LFilter/index.vue.mjs +0 -17
- package/dist/es/home/LFilter/index.vue2.mjs +0 -4
- package/dist/es/home/LProject/index.vue.mjs +0 -7
- package/dist/es/home/LProject/index.vue2.mjs +0 -70
- package/dist/es/home/LProject/index.vue3.mjs +0 -4
- package/dist/es/home/index.vue.mjs +0 -7
- package/dist/es/home/index.vue2.mjs +0 -80
- package/dist/es/home/index.vue3.mjs +0 -4
- package/dist/es/index.mjs +0 -36
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/check.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/circle-plus.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/close.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/microphone.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/paperclip.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/upload.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/copy-simple.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/speaker-high-light.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-down-thin.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-up-thin.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/warning-bold.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/add-line.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-down-s-line.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-up-s-line.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/check-fill.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/download-line.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs +0 -8
- package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/iconify.mjs +0 -1702
- package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/offline.mjs +0 -436
- package/dist/es/node_modules/.pnpm/@pureadmin_utils@1.8.5_vue@3.2.45/node_modules/@pureadmin/utils/dist/index.mjs +0 -70
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/callBound.mjs +0 -16
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/index.mjs +0 -36
- package/dist/es/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.mjs +0 -48
- package/dist/es/node_modules/.pnpm/dompurify@3.0.10/node_modules/dompurify/dist/purify.es.mjs +0 -949
- package/dist/es/node_modules/.pnpm/es-define-property@1.0.0/node_modules/es-define-property/index.mjs +0 -22
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.mjs +0 -4
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.mjs +0 -4
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.mjs +0 -4
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.mjs +0 -4
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.mjs +0 -4
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.mjs +0 -4
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.mjs +0 -4
- package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.mjs +0 -72
- package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.mjs +0 -6
- package/dist/es/node_modules/.pnpm/get-intrinsic@1.2.4/node_modules/get-intrinsic/index.mjs +0 -320
- package/dist/es/node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.mjs +0 -14
- package/dist/es/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.mjs +0 -19
- package/dist/es/node_modules/.pnpm/has-proto@1.0.3/node_modules/has-proto/index.mjs +0 -11
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.mjs +0 -21
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.mjs +0 -48
- package/dist/es/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.mjs +0 -8
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/core.mjs +0 -5
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/apache.mjs +0 -91
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/bash.mjs +0 -377
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/basic.mjs +0 -221
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/c.mjs +0 -280
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/css.mjs +0 -732
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dart.mjs +0 -247
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/django.mjs +0 -47
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dns.mjs +0 -71
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dos.mjs +0 -160
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dust.mjs +0 -38
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/erlang.mjs +0 -176
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/go.mjs +0 -135
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/http.mjs +0 -89
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/java.mjs +0 -254
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/javascript.mjs +0 -698
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/json.mjs +0 -40
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/markdown.mjs +0 -227
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/nginx.mjs +0 -144
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/php.mjs +0 -589
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/python.mjs +0 -414
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/ruby.mjs +0 -414
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/stylus.mjs +0 -766
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/swift.mjs +0 -832
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/typescript.mjs +0 -788
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/xml.mjs +0 -227
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/lib/core.mjs +0 -1580
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/styles/paraiso-light.css.mjs +0 -4
- package/dist/es/node_modules/.pnpm/marked@12.0.1/node_modules/marked/lib/marked.esm.mjs +0 -2045
- package/dist/es/node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/index.mjs +0 -514
- package/dist/es/node_modules/.pnpm/pinyin-match@1.2.4/node_modules/pinyin-match/es/main.mjs +0 -124
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/formats.mjs +0 -22
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/index.mjs +0 -14
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/parse.mjs +0 -199
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/stringify.mjs +0 -262
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/utils.mjs +0 -196
- package/dist/es/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.mjs +0 -54
- package/dist/es/node_modules/.pnpm/side-channel@1.0.6/node_modules/side-channel/index.mjs +0 -115
- package/dist/es/store/index.mjs +0 -8
- package/dist/es/store/modules/copilot.mjs +0 -108
- package/dist/es/store/modules/filters.mjs +0 -346
- package/dist/es/store/modules/types.mjs +0 -19
- package/dist/es/style/index.scss.mjs +0 -4
- package/dist/es/style/tailwind.css.mjs +0 -4
- package/dist/es/style.css +0 -1
- package/dist/es/utils/home.mjs +0 -129
- package/dist/es/utils/http/index.mjs +0 -90
- package/dist/es/utils/message.mjs +0 -42
@@ -1,788 +0,0 @@
|
|
1
|
-
const IDENT_RE = "[A-Za-z$_][0-9A-Za-z$_]*";
|
2
|
-
const KEYWORDS = [
|
3
|
-
"as",
|
4
|
-
// for exports
|
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
|
-
// JS handles these with a special rule
|
35
|
-
// "get",
|
36
|
-
// "set",
|
37
|
-
"debugger",
|
38
|
-
"async",
|
39
|
-
"await",
|
40
|
-
"static",
|
41
|
-
"import",
|
42
|
-
"from",
|
43
|
-
"export",
|
44
|
-
"extends"
|
45
|
-
];
|
46
|
-
const LITERALS = [
|
47
|
-
"true",
|
48
|
-
"false",
|
49
|
-
"null",
|
50
|
-
"undefined",
|
51
|
-
"NaN",
|
52
|
-
"Infinity"
|
53
|
-
];
|
54
|
-
const TYPES = [
|
55
|
-
// Fundamental objects
|
56
|
-
"Object",
|
57
|
-
"Function",
|
58
|
-
"Boolean",
|
59
|
-
"Symbol",
|
60
|
-
// numbers and dates
|
61
|
-
"Math",
|
62
|
-
"Date",
|
63
|
-
"Number",
|
64
|
-
"BigInt",
|
65
|
-
// text
|
66
|
-
"String",
|
67
|
-
"RegExp",
|
68
|
-
// Indexed collections
|
69
|
-
"Array",
|
70
|
-
"Float32Array",
|
71
|
-
"Float64Array",
|
72
|
-
"Int8Array",
|
73
|
-
"Uint8Array",
|
74
|
-
"Uint8ClampedArray",
|
75
|
-
"Int16Array",
|
76
|
-
"Int32Array",
|
77
|
-
"Uint16Array",
|
78
|
-
"Uint32Array",
|
79
|
-
"BigInt64Array",
|
80
|
-
"BigUint64Array",
|
81
|
-
// Keyed collections
|
82
|
-
"Set",
|
83
|
-
"Map",
|
84
|
-
"WeakSet",
|
85
|
-
"WeakMap",
|
86
|
-
// Structured data
|
87
|
-
"ArrayBuffer",
|
88
|
-
"SharedArrayBuffer",
|
89
|
-
"Atomics",
|
90
|
-
"DataView",
|
91
|
-
"JSON",
|
92
|
-
// Control abstraction objects
|
93
|
-
"Promise",
|
94
|
-
"Generator",
|
95
|
-
"GeneratorFunction",
|
96
|
-
"AsyncFunction",
|
97
|
-
// Reflection
|
98
|
-
"Reflect",
|
99
|
-
"Proxy",
|
100
|
-
// Internationalization
|
101
|
-
"Intl",
|
102
|
-
// WebAssembly
|
103
|
-
"WebAssembly"
|
104
|
-
];
|
105
|
-
const ERROR_TYPES = [
|
106
|
-
"Error",
|
107
|
-
"EvalError",
|
108
|
-
"InternalError",
|
109
|
-
"RangeError",
|
110
|
-
"ReferenceError",
|
111
|
-
"SyntaxError",
|
112
|
-
"TypeError",
|
113
|
-
"URIError"
|
114
|
-
];
|
115
|
-
const BUILT_IN_GLOBALS = [
|
116
|
-
"setInterval",
|
117
|
-
"setTimeout",
|
118
|
-
"clearInterval",
|
119
|
-
"clearTimeout",
|
120
|
-
"require",
|
121
|
-
"exports",
|
122
|
-
"eval",
|
123
|
-
"isFinite",
|
124
|
-
"isNaN",
|
125
|
-
"parseFloat",
|
126
|
-
"parseInt",
|
127
|
-
"decodeURI",
|
128
|
-
"decodeURIComponent",
|
129
|
-
"encodeURI",
|
130
|
-
"encodeURIComponent",
|
131
|
-
"escape",
|
132
|
-
"unescape"
|
133
|
-
];
|
134
|
-
const BUILT_IN_VARIABLES = [
|
135
|
-
"arguments",
|
136
|
-
"this",
|
137
|
-
"super",
|
138
|
-
"console",
|
139
|
-
"window",
|
140
|
-
"document",
|
141
|
-
"localStorage",
|
142
|
-
"sessionStorage",
|
143
|
-
"module",
|
144
|
-
"global"
|
145
|
-
// Node.js
|
146
|
-
];
|
147
|
-
const BUILT_INS = [].concat(
|
148
|
-
BUILT_IN_GLOBALS,
|
149
|
-
TYPES,
|
150
|
-
ERROR_TYPES
|
151
|
-
);
|
152
|
-
function javascript(hljs) {
|
153
|
-
const regex = hljs.regex;
|
154
|
-
const hasClosingTag = (match, { after }) => {
|
155
|
-
const tag = "</" + match[0].slice(1);
|
156
|
-
const pos = match.input.indexOf(tag, after);
|
157
|
-
return pos !== -1;
|
158
|
-
};
|
159
|
-
const IDENT_RE$1 = IDENT_RE;
|
160
|
-
const FRAGMENT = {
|
161
|
-
begin: "<>",
|
162
|
-
end: "</>"
|
163
|
-
};
|
164
|
-
const XML_SELF_CLOSING = /<[A-Za-z0-9\\._:-]+\s*\/>/;
|
165
|
-
const XML_TAG = {
|
166
|
-
begin: /<[A-Za-z0-9\\._:-]+/,
|
167
|
-
end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
|
168
|
-
/**
|
169
|
-
* @param {RegExpMatchArray} match
|
170
|
-
* @param {CallbackResponse} response
|
171
|
-
*/
|
172
|
-
isTrulyOpeningTag: (match, response) => {
|
173
|
-
const afterMatchIndex = match[0].length + match.index;
|
174
|
-
const nextChar = match.input[afterMatchIndex];
|
175
|
-
if (
|
176
|
-
// HTML should not include another raw `<` inside a tag
|
177
|
-
// nested type?
|
178
|
-
// `<Array<Array<number>>`, etc.
|
179
|
-
nextChar === "<" || // the , gives away that this is not HTML
|
180
|
-
// `<T, A extends keyof T, V>`
|
181
|
-
nextChar === ","
|
182
|
-
) {
|
183
|
-
response.ignoreMatch();
|
184
|
-
return;
|
185
|
-
}
|
186
|
-
if (nextChar === ">") {
|
187
|
-
if (!hasClosingTag(match, { after: afterMatchIndex })) {
|
188
|
-
response.ignoreMatch();
|
189
|
-
}
|
190
|
-
}
|
191
|
-
let m;
|
192
|
-
const afterMatch = match.input.substring(afterMatchIndex);
|
193
|
-
if (m = afterMatch.match(/^\s*=/)) {
|
194
|
-
response.ignoreMatch();
|
195
|
-
return;
|
196
|
-
}
|
197
|
-
if (m = afterMatch.match(/^\s+extends\s+/)) {
|
198
|
-
if (m.index === 0) {
|
199
|
-
response.ignoreMatch();
|
200
|
-
return;
|
201
|
-
}
|
202
|
-
}
|
203
|
-
}
|
204
|
-
};
|
205
|
-
const KEYWORDS$1 = {
|
206
|
-
$pattern: IDENT_RE,
|
207
|
-
keyword: KEYWORDS,
|
208
|
-
literal: LITERALS,
|
209
|
-
built_in: BUILT_INS,
|
210
|
-
"variable.language": BUILT_IN_VARIABLES
|
211
|
-
};
|
212
|
-
const decimalDigits = "[0-9](_?[0-9])*";
|
213
|
-
const frac = `\\.(${decimalDigits})`;
|
214
|
-
const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;
|
215
|
-
const NUMBER = {
|
216
|
-
className: "number",
|
217
|
-
variants: [
|
218
|
-
// DecimalLiteral
|
219
|
-
{ begin: `(\\b(${decimalInteger})((${frac})|\\.)?|(${frac}))[eE][+-]?(${decimalDigits})\\b` },
|
220
|
-
{ begin: `\\b(${decimalInteger})\\b((${frac})\\b|\\.)?|(${frac})\\b` },
|
221
|
-
// DecimalBigIntegerLiteral
|
222
|
-
{ begin: `\\b(0|[1-9](_?[0-9])*)n\\b` },
|
223
|
-
// NonDecimalIntegerLiteral
|
224
|
-
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
|
225
|
-
{ begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
|
226
|
-
{ begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
|
227
|
-
// LegacyOctalIntegerLiteral (does not include underscore separators)
|
228
|
-
// https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
|
229
|
-
{ begin: "\\b0[0-7]+n?\\b" }
|
230
|
-
],
|
231
|
-
relevance: 0
|
232
|
-
};
|
233
|
-
const SUBST = {
|
234
|
-
className: "subst",
|
235
|
-
begin: "\\$\\{",
|
236
|
-
end: "\\}",
|
237
|
-
keywords: KEYWORDS$1,
|
238
|
-
contains: []
|
239
|
-
// defined later
|
240
|
-
};
|
241
|
-
const HTML_TEMPLATE = {
|
242
|
-
begin: "html`",
|
243
|
-
end: "",
|
244
|
-
starts: {
|
245
|
-
end: "`",
|
246
|
-
returnEnd: false,
|
247
|
-
contains: [
|
248
|
-
hljs.BACKSLASH_ESCAPE,
|
249
|
-
SUBST
|
250
|
-
],
|
251
|
-
subLanguage: "xml"
|
252
|
-
}
|
253
|
-
};
|
254
|
-
const CSS_TEMPLATE = {
|
255
|
-
begin: "css`",
|
256
|
-
end: "",
|
257
|
-
starts: {
|
258
|
-
end: "`",
|
259
|
-
returnEnd: false,
|
260
|
-
contains: [
|
261
|
-
hljs.BACKSLASH_ESCAPE,
|
262
|
-
SUBST
|
263
|
-
],
|
264
|
-
subLanguage: "css"
|
265
|
-
}
|
266
|
-
};
|
267
|
-
const GRAPHQL_TEMPLATE = {
|
268
|
-
begin: "gql`",
|
269
|
-
end: "",
|
270
|
-
starts: {
|
271
|
-
end: "`",
|
272
|
-
returnEnd: false,
|
273
|
-
contains: [
|
274
|
-
hljs.BACKSLASH_ESCAPE,
|
275
|
-
SUBST
|
276
|
-
],
|
277
|
-
subLanguage: "graphql"
|
278
|
-
}
|
279
|
-
};
|
280
|
-
const TEMPLATE_STRING = {
|
281
|
-
className: "string",
|
282
|
-
begin: "`",
|
283
|
-
end: "`",
|
284
|
-
contains: [
|
285
|
-
hljs.BACKSLASH_ESCAPE,
|
286
|
-
SUBST
|
287
|
-
]
|
288
|
-
};
|
289
|
-
const JSDOC_COMMENT = hljs.COMMENT(
|
290
|
-
/\/\*\*(?!\/)/,
|
291
|
-
"\\*/",
|
292
|
-
{
|
293
|
-
relevance: 0,
|
294
|
-
contains: [
|
295
|
-
{
|
296
|
-
begin: "(?=@[A-Za-z]+)",
|
297
|
-
relevance: 0,
|
298
|
-
contains: [
|
299
|
-
{
|
300
|
-
className: "doctag",
|
301
|
-
begin: "@[A-Za-z]+"
|
302
|
-
},
|
303
|
-
{
|
304
|
-
className: "type",
|
305
|
-
begin: "\\{",
|
306
|
-
end: "\\}",
|
307
|
-
excludeEnd: true,
|
308
|
-
excludeBegin: true,
|
309
|
-
relevance: 0
|
310
|
-
},
|
311
|
-
{
|
312
|
-
className: "variable",
|
313
|
-
begin: IDENT_RE$1 + "(?=\\s*(-)|$)",
|
314
|
-
endsParent: true,
|
315
|
-
relevance: 0
|
316
|
-
},
|
317
|
-
// eat spaces (not newlines) so we can find
|
318
|
-
// types or variables
|
319
|
-
{
|
320
|
-
begin: /(?=[^\n])\s/,
|
321
|
-
relevance: 0
|
322
|
-
}
|
323
|
-
]
|
324
|
-
}
|
325
|
-
]
|
326
|
-
}
|
327
|
-
);
|
328
|
-
const COMMENT = {
|
329
|
-
className: "comment",
|
330
|
-
variants: [
|
331
|
-
JSDOC_COMMENT,
|
332
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
333
|
-
hljs.C_LINE_COMMENT_MODE
|
334
|
-
]
|
335
|
-
};
|
336
|
-
const SUBST_INTERNALS = [
|
337
|
-
hljs.APOS_STRING_MODE,
|
338
|
-
hljs.QUOTE_STRING_MODE,
|
339
|
-
HTML_TEMPLATE,
|
340
|
-
CSS_TEMPLATE,
|
341
|
-
GRAPHQL_TEMPLATE,
|
342
|
-
TEMPLATE_STRING,
|
343
|
-
// Skip numbers when they are part of a variable name
|
344
|
-
{ match: /\$\d+/ },
|
345
|
-
NUMBER
|
346
|
-
// This is intentional:
|
347
|
-
// See https://github.com/highlightjs/highlight.js/issues/3288
|
348
|
-
// hljs.REGEXP_MODE
|
349
|
-
];
|
350
|
-
SUBST.contains = SUBST_INTERNALS.concat({
|
351
|
-
// we need to pair up {} inside our subst to prevent
|
352
|
-
// it from ending too early by matching another }
|
353
|
-
begin: /\{/,
|
354
|
-
end: /\}/,
|
355
|
-
keywords: KEYWORDS$1,
|
356
|
-
contains: [
|
357
|
-
"self"
|
358
|
-
].concat(SUBST_INTERNALS)
|
359
|
-
});
|
360
|
-
const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);
|
361
|
-
const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([
|
362
|
-
// eat recursive parens in sub expressions
|
363
|
-
{
|
364
|
-
begin: /\(/,
|
365
|
-
end: /\)/,
|
366
|
-
keywords: KEYWORDS$1,
|
367
|
-
contains: ["self"].concat(SUBST_AND_COMMENTS)
|
368
|
-
}
|
369
|
-
]);
|
370
|
-
const PARAMS = {
|
371
|
-
className: "params",
|
372
|
-
begin: /\(/,
|
373
|
-
end: /\)/,
|
374
|
-
excludeBegin: true,
|
375
|
-
excludeEnd: true,
|
376
|
-
keywords: KEYWORDS$1,
|
377
|
-
contains: PARAMS_CONTAINS
|
378
|
-
};
|
379
|
-
const CLASS_OR_EXTENDS = {
|
380
|
-
variants: [
|
381
|
-
// class Car extends vehicle
|
382
|
-
{
|
383
|
-
match: [
|
384
|
-
/class/,
|
385
|
-
/\s+/,
|
386
|
-
IDENT_RE$1,
|
387
|
-
/\s+/,
|
388
|
-
/extends/,
|
389
|
-
/\s+/,
|
390
|
-
regex.concat(IDENT_RE$1, "(", regex.concat(/\./, IDENT_RE$1), ")*")
|
391
|
-
],
|
392
|
-
scope: {
|
393
|
-
1: "keyword",
|
394
|
-
3: "title.class",
|
395
|
-
5: "keyword",
|
396
|
-
7: "title.class.inherited"
|
397
|
-
}
|
398
|
-
},
|
399
|
-
// class Car
|
400
|
-
{
|
401
|
-
match: [
|
402
|
-
/class/,
|
403
|
-
/\s+/,
|
404
|
-
IDENT_RE$1
|
405
|
-
],
|
406
|
-
scope: {
|
407
|
-
1: "keyword",
|
408
|
-
3: "title.class"
|
409
|
-
}
|
410
|
-
}
|
411
|
-
]
|
412
|
-
};
|
413
|
-
const CLASS_REFERENCE = {
|
414
|
-
relevance: 0,
|
415
|
-
match: regex.either(
|
416
|
-
// Hard coded exceptions
|
417
|
-
/\bJSON/,
|
418
|
-
// Float32Array, OutT
|
419
|
-
/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
|
420
|
-
// CSSFactory, CSSFactoryT
|
421
|
-
/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
|
422
|
-
// FPs, FPsT
|
423
|
-
/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
|
424
|
-
// P
|
425
|
-
// single letters are not highlighted
|
426
|
-
// BLAH
|
427
|
-
// this will be flagged as a UPPER_CASE_CONSTANT instead
|
428
|
-
),
|
429
|
-
className: "title.class",
|
430
|
-
keywords: {
|
431
|
-
_: [
|
432
|
-
// se we still get relevance credit for JS library classes
|
433
|
-
...TYPES,
|
434
|
-
...ERROR_TYPES
|
435
|
-
]
|
436
|
-
}
|
437
|
-
};
|
438
|
-
const USE_STRICT = {
|
439
|
-
label: "use_strict",
|
440
|
-
className: "meta",
|
441
|
-
relevance: 10,
|
442
|
-
begin: /^\s*['"]use (strict|asm)['"]/
|
443
|
-
};
|
444
|
-
const FUNCTION_DEFINITION = {
|
445
|
-
variants: [
|
446
|
-
{
|
447
|
-
match: [
|
448
|
-
/function/,
|
449
|
-
/\s+/,
|
450
|
-
IDENT_RE$1,
|
451
|
-
/(?=\s*\()/
|
452
|
-
]
|
453
|
-
},
|
454
|
-
// anonymous function
|
455
|
-
{
|
456
|
-
match: [
|
457
|
-
/function/,
|
458
|
-
/\s*(?=\()/
|
459
|
-
]
|
460
|
-
}
|
461
|
-
],
|
462
|
-
className: {
|
463
|
-
1: "keyword",
|
464
|
-
3: "title.function"
|
465
|
-
},
|
466
|
-
label: "func.def",
|
467
|
-
contains: [PARAMS],
|
468
|
-
illegal: /%/
|
469
|
-
};
|
470
|
-
const UPPER_CASE_CONSTANT = {
|
471
|
-
relevance: 0,
|
472
|
-
match: /\b[A-Z][A-Z_0-9]+\b/,
|
473
|
-
className: "variable.constant"
|
474
|
-
};
|
475
|
-
function noneOf(list) {
|
476
|
-
return regex.concat("(?!", list.join("|"), ")");
|
477
|
-
}
|
478
|
-
const FUNCTION_CALL = {
|
479
|
-
match: regex.concat(
|
480
|
-
/\b/,
|
481
|
-
noneOf([
|
482
|
-
...BUILT_IN_GLOBALS,
|
483
|
-
"super",
|
484
|
-
"import"
|
485
|
-
]),
|
486
|
-
IDENT_RE$1,
|
487
|
-
regex.lookahead(/\(/)
|
488
|
-
),
|
489
|
-
className: "title.function",
|
490
|
-
relevance: 0
|
491
|
-
};
|
492
|
-
const PROPERTY_ACCESS = {
|
493
|
-
begin: regex.concat(/\./, regex.lookahead(
|
494
|
-
regex.concat(IDENT_RE$1, /(?![0-9A-Za-z$_(])/)
|
495
|
-
)),
|
496
|
-
end: IDENT_RE$1,
|
497
|
-
excludeBegin: true,
|
498
|
-
keywords: "prototype",
|
499
|
-
className: "property",
|
500
|
-
relevance: 0
|
501
|
-
};
|
502
|
-
const GETTER_OR_SETTER = {
|
503
|
-
match: [
|
504
|
-
/get|set/,
|
505
|
-
/\s+/,
|
506
|
-
IDENT_RE$1,
|
507
|
-
/(?=\()/
|
508
|
-
],
|
509
|
-
className: {
|
510
|
-
1: "keyword",
|
511
|
-
3: "title.function"
|
512
|
-
},
|
513
|
-
contains: [
|
514
|
-
{
|
515
|
-
// eat to avoid empty params
|
516
|
-
begin: /\(\)/
|
517
|
-
},
|
518
|
-
PARAMS
|
519
|
-
]
|
520
|
-
};
|
521
|
-
const FUNC_LEAD_IN_RE = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + hljs.UNDERSCORE_IDENT_RE + ")\\s*=>";
|
522
|
-
const FUNCTION_VARIABLE = {
|
523
|
-
match: [
|
524
|
-
/const|var|let/,
|
525
|
-
/\s+/,
|
526
|
-
IDENT_RE$1,
|
527
|
-
/\s*/,
|
528
|
-
/=\s*/,
|
529
|
-
/(async\s*)?/,
|
530
|
-
// async is optional
|
531
|
-
regex.lookahead(FUNC_LEAD_IN_RE)
|
532
|
-
],
|
533
|
-
keywords: "async",
|
534
|
-
className: {
|
535
|
-
1: "keyword",
|
536
|
-
3: "title.function"
|
537
|
-
},
|
538
|
-
contains: [
|
539
|
-
PARAMS
|
540
|
-
]
|
541
|
-
};
|
542
|
-
return {
|
543
|
-
name: "JavaScript",
|
544
|
-
aliases: ["js", "jsx", "mjs", "cjs"],
|
545
|
-
keywords: KEYWORDS$1,
|
546
|
-
// this will be extended by TypeScript
|
547
|
-
exports: { PARAMS_CONTAINS, CLASS_REFERENCE },
|
548
|
-
illegal: /#(?![$_A-z])/,
|
549
|
-
contains: [
|
550
|
-
hljs.SHEBANG({
|
551
|
-
label: "shebang",
|
552
|
-
binary: "node",
|
553
|
-
relevance: 5
|
554
|
-
}),
|
555
|
-
USE_STRICT,
|
556
|
-
hljs.APOS_STRING_MODE,
|
557
|
-
hljs.QUOTE_STRING_MODE,
|
558
|
-
HTML_TEMPLATE,
|
559
|
-
CSS_TEMPLATE,
|
560
|
-
GRAPHQL_TEMPLATE,
|
561
|
-
TEMPLATE_STRING,
|
562
|
-
COMMENT,
|
563
|
-
// Skip numbers when they are part of a variable name
|
564
|
-
{ match: /\$\d+/ },
|
565
|
-
NUMBER,
|
566
|
-
CLASS_REFERENCE,
|
567
|
-
{
|
568
|
-
className: "attr",
|
569
|
-
begin: IDENT_RE$1 + regex.lookahead(":"),
|
570
|
-
relevance: 0
|
571
|
-
},
|
572
|
-
FUNCTION_VARIABLE,
|
573
|
-
{
|
574
|
-
// "value" container
|
575
|
-
begin: "(" + hljs.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
576
|
-
keywords: "return throw case",
|
577
|
-
relevance: 0,
|
578
|
-
contains: [
|
579
|
-
COMMENT,
|
580
|
-
hljs.REGEXP_MODE,
|
581
|
-
{
|
582
|
-
className: "function",
|
583
|
-
// we have to count the parens to make sure we actually have the
|
584
|
-
// correct bounding ( ) before the =>. There could be any number of
|
585
|
-
// sub-expressions inside also surrounded by parens.
|
586
|
-
begin: FUNC_LEAD_IN_RE,
|
587
|
-
returnBegin: true,
|
588
|
-
end: "\\s*=>",
|
589
|
-
contains: [
|
590
|
-
{
|
591
|
-
className: "params",
|
592
|
-
variants: [
|
593
|
-
{
|
594
|
-
begin: hljs.UNDERSCORE_IDENT_RE,
|
595
|
-
relevance: 0
|
596
|
-
},
|
597
|
-
{
|
598
|
-
className: null,
|
599
|
-
begin: /\(\s*\)/,
|
600
|
-
skip: true
|
601
|
-
},
|
602
|
-
{
|
603
|
-
begin: /\(/,
|
604
|
-
end: /\)/,
|
605
|
-
excludeBegin: true,
|
606
|
-
excludeEnd: true,
|
607
|
-
keywords: KEYWORDS$1,
|
608
|
-
contains: PARAMS_CONTAINS
|
609
|
-
}
|
610
|
-
]
|
611
|
-
}
|
612
|
-
]
|
613
|
-
},
|
614
|
-
{
|
615
|
-
// could be a comma delimited list of params to a function call
|
616
|
-
begin: /,/,
|
617
|
-
relevance: 0
|
618
|
-
},
|
619
|
-
{
|
620
|
-
match: /\s+/,
|
621
|
-
relevance: 0
|
622
|
-
},
|
623
|
-
{
|
624
|
-
// JSX
|
625
|
-
variants: [
|
626
|
-
{ begin: FRAGMENT.begin, end: FRAGMENT.end },
|
627
|
-
{ match: XML_SELF_CLOSING },
|
628
|
-
{
|
629
|
-
begin: XML_TAG.begin,
|
630
|
-
// we carefully check the opening tag to see if it truly
|
631
|
-
// is a tag and not a false positive
|
632
|
-
"on:begin": XML_TAG.isTrulyOpeningTag,
|
633
|
-
end: XML_TAG.end
|
634
|
-
}
|
635
|
-
],
|
636
|
-
subLanguage: "xml",
|
637
|
-
contains: [
|
638
|
-
{
|
639
|
-
begin: XML_TAG.begin,
|
640
|
-
end: XML_TAG.end,
|
641
|
-
skip: true,
|
642
|
-
contains: ["self"]
|
643
|
-
}
|
644
|
-
]
|
645
|
-
}
|
646
|
-
]
|
647
|
-
},
|
648
|
-
FUNCTION_DEFINITION,
|
649
|
-
{
|
650
|
-
// prevent this from getting swallowed up by function
|
651
|
-
// since they appear "function like"
|
652
|
-
beginKeywords: "while if switch catch for"
|
653
|
-
},
|
654
|
-
{
|
655
|
-
// we have to count the parens to make sure we actually have the correct
|
656
|
-
// bounding ( ). There could be any number of sub-expressions inside
|
657
|
-
// also surrounded by parens.
|
658
|
-
begin: "\\b(?!function)" + hljs.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
|
659
|
-
// end parens
|
660
|
-
returnBegin: true,
|
661
|
-
label: "func.def",
|
662
|
-
contains: [
|
663
|
-
PARAMS,
|
664
|
-
hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1, className: "title.function" })
|
665
|
-
]
|
666
|
-
},
|
667
|
-
// catch ... so it won't trigger the property rule below
|
668
|
-
{
|
669
|
-
match: /\.\.\./,
|
670
|
-
relevance: 0
|
671
|
-
},
|
672
|
-
PROPERTY_ACCESS,
|
673
|
-
// hack: prevents detection of keywords in some circumstances
|
674
|
-
// .keyword()
|
675
|
-
// $keyword = x
|
676
|
-
{
|
677
|
-
match: "\\$" + IDENT_RE$1,
|
678
|
-
relevance: 0
|
679
|
-
},
|
680
|
-
{
|
681
|
-
match: [/\bconstructor(?=\s*\()/],
|
682
|
-
className: { 1: "title.function" },
|
683
|
-
contains: [PARAMS]
|
684
|
-
},
|
685
|
-
FUNCTION_CALL,
|
686
|
-
UPPER_CASE_CONSTANT,
|
687
|
-
CLASS_OR_EXTENDS,
|
688
|
-
GETTER_OR_SETTER,
|
689
|
-
{
|
690
|
-
match: /\$[(.]/
|
691
|
-
// relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
|
692
|
-
}
|
693
|
-
]
|
694
|
-
};
|
695
|
-
}
|
696
|
-
function typescript(hljs) {
|
697
|
-
const tsLanguage = javascript(hljs);
|
698
|
-
const IDENT_RE$1 = IDENT_RE;
|
699
|
-
const TYPES2 = [
|
700
|
-
"any",
|
701
|
-
"void",
|
702
|
-
"number",
|
703
|
-
"boolean",
|
704
|
-
"string",
|
705
|
-
"object",
|
706
|
-
"never",
|
707
|
-
"symbol",
|
708
|
-
"bigint",
|
709
|
-
"unknown"
|
710
|
-
];
|
711
|
-
const NAMESPACE = {
|
712
|
-
beginKeywords: "namespace",
|
713
|
-
end: /\{/,
|
714
|
-
excludeEnd: true,
|
715
|
-
contains: [tsLanguage.exports.CLASS_REFERENCE]
|
716
|
-
};
|
717
|
-
const INTERFACE = {
|
718
|
-
beginKeywords: "interface",
|
719
|
-
end: /\{/,
|
720
|
-
excludeEnd: true,
|
721
|
-
keywords: {
|
722
|
-
keyword: "interface extends",
|
723
|
-
built_in: TYPES2
|
724
|
-
},
|
725
|
-
contains: [tsLanguage.exports.CLASS_REFERENCE]
|
726
|
-
};
|
727
|
-
const USE_STRICT = {
|
728
|
-
className: "meta",
|
729
|
-
relevance: 10,
|
730
|
-
begin: /^\s*['"]use strict['"]/
|
731
|
-
};
|
732
|
-
const TS_SPECIFIC_KEYWORDS = [
|
733
|
-
"type",
|
734
|
-
"namespace",
|
735
|
-
"interface",
|
736
|
-
"public",
|
737
|
-
"private",
|
738
|
-
"protected",
|
739
|
-
"implements",
|
740
|
-
"declare",
|
741
|
-
"abstract",
|
742
|
-
"readonly",
|
743
|
-
"enum",
|
744
|
-
"override"
|
745
|
-
];
|
746
|
-
const KEYWORDS$1 = {
|
747
|
-
$pattern: IDENT_RE,
|
748
|
-
keyword: KEYWORDS.concat(TS_SPECIFIC_KEYWORDS),
|
749
|
-
literal: LITERALS,
|
750
|
-
built_in: BUILT_INS.concat(TYPES2),
|
751
|
-
"variable.language": BUILT_IN_VARIABLES
|
752
|
-
};
|
753
|
-
const DECORATOR = {
|
754
|
-
className: "meta",
|
755
|
-
begin: "@" + IDENT_RE$1
|
756
|
-
};
|
757
|
-
const swapMode = (mode, label, replacement) => {
|
758
|
-
const indx = mode.contains.findIndex((m) => m.label === label);
|
759
|
-
if (indx === -1) {
|
760
|
-
throw new Error("can not find mode to replace");
|
761
|
-
}
|
762
|
-
mode.contains.splice(indx, 1, replacement);
|
763
|
-
};
|
764
|
-
Object.assign(tsLanguage.keywords, KEYWORDS$1);
|
765
|
-
tsLanguage.exports.PARAMS_CONTAINS.push(DECORATOR);
|
766
|
-
tsLanguage.contains = tsLanguage.contains.concat([
|
767
|
-
DECORATOR,
|
768
|
-
NAMESPACE,
|
769
|
-
INTERFACE
|
770
|
-
]);
|
771
|
-
swapMode(tsLanguage, "shebang", hljs.SHEBANG());
|
772
|
-
swapMode(tsLanguage, "use_strict", USE_STRICT);
|
773
|
-
const functionDeclaration = tsLanguage.contains.find((m) => m.label === "func.def");
|
774
|
-
functionDeclaration.relevance = 0;
|
775
|
-
Object.assign(tsLanguage, {
|
776
|
-
name: "TypeScript",
|
777
|
-
aliases: [
|
778
|
-
"ts",
|
779
|
-
"tsx",
|
780
|
-
"mts",
|
781
|
-
"cts"
|
782
|
-
]
|
783
|
-
});
|
784
|
-
return tsLanguage;
|
785
|
-
}
|
786
|
-
export {
|
787
|
-
typescript as default
|
788
|
-
};
|