@kg-ui/kg-ui-plus 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +16 -0
  2. package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +4 -0
  3. package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +26 -0
  4. package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +4 -0
  5. package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue.mjs +7 -0
  6. package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue2.mjs +49 -0
  7. package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue3.mjs +4 -0
  8. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue.mjs +7 -0
  9. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue2.mjs +94 -0
  10. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue3.mjs +4 -0
  11. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue.mjs +7 -0
  12. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue2.mjs +33 -0
  13. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue3.mjs +4 -0
  14. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue.mjs +7 -0
  15. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue2.mjs +140 -0
  16. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue3.mjs +4 -0
  17. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue.mjs +7 -0
  18. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue2.mjs +131 -0
  19. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue3.mjs +4 -0
  20. package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +7 -0
  21. package/dist/es/KgCopilot/CopiFooter/index.vue2.mjs +21 -0
  22. package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +4 -0
  23. package/dist/es/KgCopilot/dialogue.vue.mjs +7 -0
  24. package/dist/es/KgCopilot/dialogue.vue2.mjs +131 -0
  25. package/dist/es/KgCopilot/dialogue.vue3.mjs +4 -0
  26. package/dist/es/KgCopilot/index.vue.mjs +7 -0
  27. package/dist/es/KgCopilot/index.vue2.mjs +49 -0
  28. package/dist/es/KgCopilot/index.vue3.mjs +4 -0
  29. package/dist/es/KgCopilot/mdInCode.mjs +56 -0
  30. package/dist/es/KgCopilot/readMd.vue.mjs +7 -0
  31. package/dist/es/KgCopilot/readMd.vue2.mjs +87 -0
  32. package/dist/es/KgCopilot/readMd.vue3.mjs +4 -0
  33. package/dist/es/ReIcon/index.mjs +11 -0
  34. package/dist/es/ReIcon/src/iconfont.mjs +46 -0
  35. package/dist/es/ReIcon/src/iconifyIconOffline.mjs +30 -0
  36. package/dist/es/ReIcon/src/iconifyIconOnline.mjs +29 -0
  37. package/dist/es/_virtual/___vite-browser-external.mjs +6 -0
  38. package/dist/es/_virtual/__vite-browser-external.mjs +4 -0
  39. package/dist/es/_virtual/_commonjsHelpers.mjs +34 -0
  40. package/dist/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
  41. package/dist/es/_virtual/index.mjs +13 -0
  42. package/dist/es/api/project.mjs +51 -0
  43. package/dist/es/directives/heighlight/index.mjs +69 -0
  44. package/dist/es/directives/index.mjs +4 -0
  45. package/dist/es/home/LFilter/FilterArea.vue.mjs +7 -0
  46. package/dist/es/home/LFilter/FilterArea.vue2.mjs +507 -0
  47. package/dist/es/home/LFilter/FilterArea.vue3.mjs +4 -0
  48. package/dist/es/home/LFilter/FilterHead.vue.mjs +129 -0
  49. package/dist/es/home/LFilter/FilterHead.vue2.mjs +4 -0
  50. package/dist/es/home/LFilter/FilterItem.vue.mjs +7 -0
  51. package/dist/es/home/LFilter/FilterItem.vue2.mjs +114 -0
  52. package/dist/es/home/LFilter/FilterItem.vue3.mjs +4 -0
  53. package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +7 -0
  54. package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +171 -0
  55. package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +4 -0
  56. package/dist/es/home/LFilter/index.vue.mjs +17 -0
  57. package/dist/es/home/LFilter/index.vue2.mjs +4 -0
  58. package/dist/es/home/LProject/index.vue.mjs +7 -0
  59. package/dist/es/home/LProject/index.vue2.mjs +70 -0
  60. package/dist/es/home/LProject/index.vue3.mjs +4 -0
  61. package/dist/es/home/index.vue.mjs +7 -0
  62. package/dist/es/home/index.vue2.mjs +80 -0
  63. package/dist/es/home/index.vue3.mjs +4 -0
  64. package/dist/es/index.mjs +36 -0
  65. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/check.mjs +8 -0
  66. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/circle-plus.mjs +8 -0
  67. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/close.mjs +8 -0
  68. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/microphone.mjs +8 -0
  69. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/paperclip.mjs +8 -0
  70. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs +8 -0
  71. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/upload.mjs +8 -0
  72. package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/copy-simple.mjs +8 -0
  73. package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/speaker-high-light.mjs +8 -0
  74. package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-down-thin.mjs +8 -0
  75. package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-up-thin.mjs +8 -0
  76. package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/warning-bold.mjs +8 -0
  77. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/add-line.mjs +8 -0
  78. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-down-s-line.mjs +8 -0
  79. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-up-s-line.mjs +8 -0
  80. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/check-fill.mjs +8 -0
  81. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/download-line.mjs +8 -0
  82. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs +8 -0
  83. package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/iconify.mjs +1702 -0
  84. package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/offline.mjs +436 -0
  85. package/dist/es/node_modules/.pnpm/@pureadmin_utils@1.8.5_vue@3.2.45/node_modules/@pureadmin/utils/dist/index.mjs +70 -0
  86. package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/callBound.mjs +16 -0
  87. package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/index.mjs +36 -0
  88. package/dist/es/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.mjs +48 -0
  89. package/dist/es/node_modules/.pnpm/dompurify@3.0.10/node_modules/dompurify/dist/purify.es.mjs +949 -0
  90. package/dist/es/node_modules/.pnpm/es-define-property@1.0.0/node_modules/es-define-property/index.mjs +22 -0
  91. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.mjs +4 -0
  92. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.mjs +4 -0
  93. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.mjs +4 -0
  94. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.mjs +4 -0
  95. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.mjs +4 -0
  96. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.mjs +4 -0
  97. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.mjs +4 -0
  98. package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.mjs +72 -0
  99. package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.mjs +6 -0
  100. package/dist/es/node_modules/.pnpm/get-intrinsic@1.2.4/node_modules/get-intrinsic/index.mjs +320 -0
  101. package/dist/es/node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.mjs +14 -0
  102. package/dist/es/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.mjs +19 -0
  103. package/dist/es/node_modules/.pnpm/has-proto@1.0.3/node_modules/has-proto/index.mjs +11 -0
  104. package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.mjs +21 -0
  105. package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.mjs +48 -0
  106. package/dist/es/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.mjs +8 -0
  107. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/core.mjs +5 -0
  108. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/apache.mjs +91 -0
  109. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/bash.mjs +377 -0
  110. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/basic.mjs +221 -0
  111. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/c.mjs +280 -0
  112. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/css.mjs +732 -0
  113. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dart.mjs +247 -0
  114. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/django.mjs +47 -0
  115. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dns.mjs +71 -0
  116. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dos.mjs +160 -0
  117. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dust.mjs +38 -0
  118. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/erlang.mjs +176 -0
  119. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/go.mjs +135 -0
  120. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/http.mjs +89 -0
  121. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/java.mjs +254 -0
  122. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/javascript.mjs +698 -0
  123. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/json.mjs +40 -0
  124. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/markdown.mjs +227 -0
  125. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/nginx.mjs +144 -0
  126. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/php.mjs +589 -0
  127. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/python.mjs +414 -0
  128. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/ruby.mjs +414 -0
  129. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/stylus.mjs +766 -0
  130. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/swift.mjs +832 -0
  131. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/typescript.mjs +788 -0
  132. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/xml.mjs +227 -0
  133. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/lib/core.mjs +1580 -0
  134. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/styles/paraiso-light.css.mjs +4 -0
  135. package/dist/es/node_modules/.pnpm/marked@12.0.1/node_modules/marked/lib/marked.esm.mjs +2045 -0
  136. package/dist/es/node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/index.mjs +514 -0
  137. package/dist/es/node_modules/.pnpm/pinyin-match@1.2.4/node_modules/pinyin-match/es/main.mjs +124 -0
  138. package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/formats.mjs +22 -0
  139. package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/index.mjs +14 -0
  140. package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/parse.mjs +199 -0
  141. package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/stringify.mjs +262 -0
  142. package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/utils.mjs +196 -0
  143. package/dist/es/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.mjs +54 -0
  144. package/dist/es/node_modules/.pnpm/side-channel@1.0.6/node_modules/side-channel/index.mjs +115 -0
  145. package/dist/es/store/index.mjs +8 -0
  146. package/dist/es/store/modules/copilot.mjs +108 -0
  147. package/dist/es/store/modules/filters.mjs +346 -0
  148. package/dist/es/store/modules/types.mjs +19 -0
  149. package/dist/es/style/index.scss.mjs +4 -0
  150. package/dist/es/style/tailwind.css.mjs +4 -0
  151. package/dist/es/style.css +1 -0
  152. package/dist/es/utils/home.mjs +129 -0
  153. package/dist/es/utils/http/index.mjs +90 -0
  154. package/dist/es/utils/message.mjs +42 -0
  155. package/package.json +1 -1
@@ -0,0 +1,698 @@
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
+ export {
697
+ javascript as default
698
+ };