@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.
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +16 -0
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +4 -0
- package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +26 -0
- package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue2.mjs +49 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue2.mjs +94 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue2.mjs +33 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue2.mjs +140 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue2.mjs +131 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue2.mjs +21 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/dialogue.vue.mjs +7 -0
- package/dist/es/KgCopilot/dialogue.vue2.mjs +131 -0
- package/dist/es/KgCopilot/dialogue.vue3.mjs +4 -0
- package/dist/es/KgCopilot/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/index.vue2.mjs +49 -0
- package/dist/es/KgCopilot/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/mdInCode.mjs +56 -0
- package/dist/es/KgCopilot/readMd.vue.mjs +7 -0
- package/dist/es/KgCopilot/readMd.vue2.mjs +87 -0
- package/dist/es/KgCopilot/readMd.vue3.mjs +4 -0
- package/dist/es/ReIcon/index.mjs +11 -0
- package/dist/es/ReIcon/src/iconfont.mjs +46 -0
- package/dist/es/ReIcon/src/iconifyIconOffline.mjs +30 -0
- package/dist/es/ReIcon/src/iconifyIconOnline.mjs +29 -0
- package/dist/es/_virtual/___vite-browser-external.mjs +6 -0
- package/dist/es/_virtual/__vite-browser-external.mjs +4 -0
- package/dist/es/_virtual/_commonjsHelpers.mjs +34 -0
- package/dist/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/dist/es/_virtual/index.mjs +13 -0
- package/dist/es/api/project.mjs +51 -0
- package/dist/es/directives/heighlight/index.mjs +69 -0
- package/dist/es/directives/index.mjs +4 -0
- package/dist/es/home/LFilter/FilterArea.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterArea.vue2.mjs +507 -0
- package/dist/es/home/LFilter/FilterArea.vue3.mjs +4 -0
- package/dist/es/home/LFilter/FilterHead.vue.mjs +129 -0
- package/dist/es/home/LFilter/FilterHead.vue2.mjs +4 -0
- package/dist/es/home/LFilter/FilterItem.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterItem.vue2.mjs +114 -0
- package/dist/es/home/LFilter/FilterItem.vue3.mjs +4 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +171 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +4 -0
- package/dist/es/home/LFilter/index.vue.mjs +17 -0
- package/dist/es/home/LFilter/index.vue2.mjs +4 -0
- package/dist/es/home/LProject/index.vue.mjs +7 -0
- package/dist/es/home/LProject/index.vue2.mjs +70 -0
- package/dist/es/home/LProject/index.vue3.mjs +4 -0
- package/dist/es/home/index.vue.mjs +7 -0
- package/dist/es/home/index.vue2.mjs +80 -0
- package/dist/es/home/index.vue3.mjs +4 -0
- package/dist/es/index.mjs +36 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/check.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/circle-plus.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/close.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/microphone.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/paperclip.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/upload.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/copy-simple.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/speaker-high-light.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-down-thin.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-up-thin.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/warning-bold.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/add-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-down-s-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-up-s-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/check-fill.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/download-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/iconify.mjs +1702 -0
- package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/offline.mjs +436 -0
- package/dist/es/node_modules/.pnpm/@pureadmin_utils@1.8.5_vue@3.2.45/node_modules/@pureadmin/utils/dist/index.mjs +70 -0
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/callBound.mjs +16 -0
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/index.mjs +36 -0
- package/dist/es/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.mjs +48 -0
- package/dist/es/node_modules/.pnpm/dompurify@3.0.10/node_modules/dompurify/dist/purify.es.mjs +949 -0
- package/dist/es/node_modules/.pnpm/es-define-property@1.0.0/node_modules/es-define-property/index.mjs +22 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.mjs +4 -0
- package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.mjs +72 -0
- package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.mjs +6 -0
- package/dist/es/node_modules/.pnpm/get-intrinsic@1.2.4/node_modules/get-intrinsic/index.mjs +320 -0
- package/dist/es/node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.mjs +14 -0
- package/dist/es/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.mjs +19 -0
- package/dist/es/node_modules/.pnpm/has-proto@1.0.3/node_modules/has-proto/index.mjs +11 -0
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.mjs +21 -0
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.mjs +48 -0
- package/dist/es/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.mjs +8 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/core.mjs +5 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/apache.mjs +91 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/bash.mjs +377 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/basic.mjs +221 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/c.mjs +280 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/css.mjs +732 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dart.mjs +247 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/django.mjs +47 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dns.mjs +71 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dos.mjs +160 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dust.mjs +38 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/erlang.mjs +176 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/go.mjs +135 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/http.mjs +89 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/java.mjs +254 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/javascript.mjs +698 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/json.mjs +40 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/markdown.mjs +227 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/nginx.mjs +144 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/php.mjs +589 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/python.mjs +414 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/ruby.mjs +414 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/stylus.mjs +766 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/swift.mjs +832 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/typescript.mjs +788 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/xml.mjs +227 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/lib/core.mjs +1580 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/styles/paraiso-light.css.mjs +4 -0
- package/dist/es/node_modules/.pnpm/marked@12.0.1/node_modules/marked/lib/marked.esm.mjs +2045 -0
- package/dist/es/node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/index.mjs +514 -0
- package/dist/es/node_modules/.pnpm/pinyin-match@1.2.4/node_modules/pinyin-match/es/main.mjs +124 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/formats.mjs +22 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/index.mjs +14 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/parse.mjs +199 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/stringify.mjs +262 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/utils.mjs +196 -0
- package/dist/es/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.mjs +54 -0
- package/dist/es/node_modules/.pnpm/side-channel@1.0.6/node_modules/side-channel/index.mjs +115 -0
- package/dist/es/store/index.mjs +8 -0
- package/dist/es/store/modules/copilot.mjs +108 -0
- package/dist/es/store/modules/filters.mjs +346 -0
- package/dist/es/store/modules/types.mjs +19 -0
- package/dist/es/style/index.scss.mjs +4 -0
- package/dist/es/style/tailwind.css.mjs +4 -0
- package/dist/es/style.css +1 -0
- package/dist/es/utils/home.mjs +129 -0
- package/dist/es/utils/http/index.mjs +90 -0
- package/dist/es/utils/message.mjs +42 -0
- package/package.json +1 -1
@@ -0,0 +1,91 @@
|
|
1
|
+
function apache(hljs) {
|
2
|
+
const NUMBER_REF = {
|
3
|
+
className: "number",
|
4
|
+
begin: /[$%]\d+/
|
5
|
+
};
|
6
|
+
const NUMBER = {
|
7
|
+
className: "number",
|
8
|
+
begin: /\b\d+/
|
9
|
+
};
|
10
|
+
const IP_ADDRESS = {
|
11
|
+
className: "number",
|
12
|
+
begin: /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?/
|
13
|
+
};
|
14
|
+
const PORT_NUMBER = {
|
15
|
+
className: "number",
|
16
|
+
begin: /:\d{1,5}/
|
17
|
+
};
|
18
|
+
return {
|
19
|
+
name: "Apache config",
|
20
|
+
aliases: ["apacheconf"],
|
21
|
+
case_insensitive: true,
|
22
|
+
contains: [
|
23
|
+
hljs.HASH_COMMENT_MODE,
|
24
|
+
{
|
25
|
+
className: "section",
|
26
|
+
begin: /<\/?/,
|
27
|
+
end: />/,
|
28
|
+
contains: [
|
29
|
+
IP_ADDRESS,
|
30
|
+
PORT_NUMBER,
|
31
|
+
// low relevance prevents us from claming XML/HTML where this rule would
|
32
|
+
// match strings inside of XML tags
|
33
|
+
hljs.inherit(hljs.QUOTE_STRING_MODE, { relevance: 0 })
|
34
|
+
]
|
35
|
+
},
|
36
|
+
{
|
37
|
+
className: "attribute",
|
38
|
+
begin: /\w+/,
|
39
|
+
relevance: 0,
|
40
|
+
// keywords aren’t needed for highlighting per se, they only boost relevance
|
41
|
+
// for a very generally defined mode (starts with a word, ends with line-end
|
42
|
+
keywords: { _: [
|
43
|
+
"order",
|
44
|
+
"deny",
|
45
|
+
"allow",
|
46
|
+
"setenv",
|
47
|
+
"rewriterule",
|
48
|
+
"rewriteengine",
|
49
|
+
"rewritecond",
|
50
|
+
"documentroot",
|
51
|
+
"sethandler",
|
52
|
+
"errordocument",
|
53
|
+
"loadmodule",
|
54
|
+
"options",
|
55
|
+
"header",
|
56
|
+
"listen",
|
57
|
+
"serverroot",
|
58
|
+
"servername"
|
59
|
+
] },
|
60
|
+
starts: {
|
61
|
+
end: /$/,
|
62
|
+
relevance: 0,
|
63
|
+
keywords: { literal: "on off all deny allow" },
|
64
|
+
contains: [
|
65
|
+
{
|
66
|
+
className: "meta",
|
67
|
+
begin: /\s\[/,
|
68
|
+
end: /\]$/
|
69
|
+
},
|
70
|
+
{
|
71
|
+
className: "variable",
|
72
|
+
begin: /[\$%]\{/,
|
73
|
+
end: /\}/,
|
74
|
+
contains: [
|
75
|
+
"self",
|
76
|
+
NUMBER_REF
|
77
|
+
]
|
78
|
+
},
|
79
|
+
IP_ADDRESS,
|
80
|
+
NUMBER,
|
81
|
+
hljs.QUOTE_STRING_MODE
|
82
|
+
]
|
83
|
+
}
|
84
|
+
}
|
85
|
+
],
|
86
|
+
illegal: /\S/
|
87
|
+
};
|
88
|
+
}
|
89
|
+
export {
|
90
|
+
apache as default
|
91
|
+
};
|
@@ -0,0 +1,377 @@
|
|
1
|
+
function bash(hljs) {
|
2
|
+
const regex = hljs.regex;
|
3
|
+
const VAR = {};
|
4
|
+
const BRACED_VAR = {
|
5
|
+
begin: /\$\{/,
|
6
|
+
end: /\}/,
|
7
|
+
contains: [
|
8
|
+
"self",
|
9
|
+
{
|
10
|
+
begin: /:-/,
|
11
|
+
contains: [VAR]
|
12
|
+
}
|
13
|
+
// default values
|
14
|
+
]
|
15
|
+
};
|
16
|
+
Object.assign(VAR, {
|
17
|
+
className: "variable",
|
18
|
+
variants: [
|
19
|
+
{ begin: regex.concat(
|
20
|
+
/\$[\w\d#@][\w\d_]*/,
|
21
|
+
// negative look-ahead tries to avoid matching patterns that are not
|
22
|
+
// Perl at all like $ident$, @ident@, etc.
|
23
|
+
`(?![\\w\\d])(?![$])`
|
24
|
+
) },
|
25
|
+
BRACED_VAR
|
26
|
+
]
|
27
|
+
});
|
28
|
+
const SUBST = {
|
29
|
+
className: "subst",
|
30
|
+
begin: /\$\(/,
|
31
|
+
end: /\)/,
|
32
|
+
contains: [hljs.BACKSLASH_ESCAPE]
|
33
|
+
};
|
34
|
+
const HERE_DOC = {
|
35
|
+
begin: /<<-?\s*(?=\w+)/,
|
36
|
+
starts: { contains: [
|
37
|
+
hljs.END_SAME_AS_BEGIN({
|
38
|
+
begin: /(\w+)/,
|
39
|
+
end: /(\w+)/,
|
40
|
+
className: "string"
|
41
|
+
})
|
42
|
+
] }
|
43
|
+
};
|
44
|
+
const QUOTE_STRING = {
|
45
|
+
className: "string",
|
46
|
+
begin: /"/,
|
47
|
+
end: /"/,
|
48
|
+
contains: [
|
49
|
+
hljs.BACKSLASH_ESCAPE,
|
50
|
+
VAR,
|
51
|
+
SUBST
|
52
|
+
]
|
53
|
+
};
|
54
|
+
SUBST.contains.push(QUOTE_STRING);
|
55
|
+
const ESCAPED_QUOTE = {
|
56
|
+
match: /\\"/
|
57
|
+
};
|
58
|
+
const APOS_STRING = {
|
59
|
+
className: "string",
|
60
|
+
begin: /'/,
|
61
|
+
end: /'/
|
62
|
+
};
|
63
|
+
const ESCAPED_APOS = {
|
64
|
+
match: /\\'/
|
65
|
+
};
|
66
|
+
const ARITHMETIC = {
|
67
|
+
begin: /\$?\(\(/,
|
68
|
+
end: /\)\)/,
|
69
|
+
contains: [
|
70
|
+
{
|
71
|
+
begin: /\d+#[0-9a-f]+/,
|
72
|
+
className: "number"
|
73
|
+
},
|
74
|
+
hljs.NUMBER_MODE,
|
75
|
+
VAR
|
76
|
+
]
|
77
|
+
};
|
78
|
+
const SH_LIKE_SHELLS = [
|
79
|
+
"fish",
|
80
|
+
"bash",
|
81
|
+
"zsh",
|
82
|
+
"sh",
|
83
|
+
"csh",
|
84
|
+
"ksh",
|
85
|
+
"tcsh",
|
86
|
+
"dash",
|
87
|
+
"scsh"
|
88
|
+
];
|
89
|
+
const KNOWN_SHEBANG = hljs.SHEBANG({
|
90
|
+
binary: `(${SH_LIKE_SHELLS.join("|")})`,
|
91
|
+
relevance: 10
|
92
|
+
});
|
93
|
+
const FUNCTION = {
|
94
|
+
className: "function",
|
95
|
+
begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
|
96
|
+
returnBegin: true,
|
97
|
+
contains: [hljs.inherit(hljs.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
|
98
|
+
relevance: 0
|
99
|
+
};
|
100
|
+
const KEYWORDS = [
|
101
|
+
"if",
|
102
|
+
"then",
|
103
|
+
"else",
|
104
|
+
"elif",
|
105
|
+
"fi",
|
106
|
+
"for",
|
107
|
+
"while",
|
108
|
+
"until",
|
109
|
+
"in",
|
110
|
+
"do",
|
111
|
+
"done",
|
112
|
+
"case",
|
113
|
+
"esac",
|
114
|
+
"function",
|
115
|
+
"select"
|
116
|
+
];
|
117
|
+
const LITERALS = [
|
118
|
+
"true",
|
119
|
+
"false"
|
120
|
+
];
|
121
|
+
const PATH_MODE = { match: /(\/[a-z._-]+)+/ };
|
122
|
+
const SHELL_BUILT_INS = [
|
123
|
+
"break",
|
124
|
+
"cd",
|
125
|
+
"continue",
|
126
|
+
"eval",
|
127
|
+
"exec",
|
128
|
+
"exit",
|
129
|
+
"export",
|
130
|
+
"getopts",
|
131
|
+
"hash",
|
132
|
+
"pwd",
|
133
|
+
"readonly",
|
134
|
+
"return",
|
135
|
+
"shift",
|
136
|
+
"test",
|
137
|
+
"times",
|
138
|
+
"trap",
|
139
|
+
"umask",
|
140
|
+
"unset"
|
141
|
+
];
|
142
|
+
const BASH_BUILT_INS = [
|
143
|
+
"alias",
|
144
|
+
"bind",
|
145
|
+
"builtin",
|
146
|
+
"caller",
|
147
|
+
"command",
|
148
|
+
"declare",
|
149
|
+
"echo",
|
150
|
+
"enable",
|
151
|
+
"help",
|
152
|
+
"let",
|
153
|
+
"local",
|
154
|
+
"logout",
|
155
|
+
"mapfile",
|
156
|
+
"printf",
|
157
|
+
"read",
|
158
|
+
"readarray",
|
159
|
+
"source",
|
160
|
+
"type",
|
161
|
+
"typeset",
|
162
|
+
"ulimit",
|
163
|
+
"unalias"
|
164
|
+
];
|
165
|
+
const ZSH_BUILT_INS = [
|
166
|
+
"autoload",
|
167
|
+
"bg",
|
168
|
+
"bindkey",
|
169
|
+
"bye",
|
170
|
+
"cap",
|
171
|
+
"chdir",
|
172
|
+
"clone",
|
173
|
+
"comparguments",
|
174
|
+
"compcall",
|
175
|
+
"compctl",
|
176
|
+
"compdescribe",
|
177
|
+
"compfiles",
|
178
|
+
"compgroups",
|
179
|
+
"compquote",
|
180
|
+
"comptags",
|
181
|
+
"comptry",
|
182
|
+
"compvalues",
|
183
|
+
"dirs",
|
184
|
+
"disable",
|
185
|
+
"disown",
|
186
|
+
"echotc",
|
187
|
+
"echoti",
|
188
|
+
"emulate",
|
189
|
+
"fc",
|
190
|
+
"fg",
|
191
|
+
"float",
|
192
|
+
"functions",
|
193
|
+
"getcap",
|
194
|
+
"getln",
|
195
|
+
"history",
|
196
|
+
"integer",
|
197
|
+
"jobs",
|
198
|
+
"kill",
|
199
|
+
"limit",
|
200
|
+
"log",
|
201
|
+
"noglob",
|
202
|
+
"popd",
|
203
|
+
"print",
|
204
|
+
"pushd",
|
205
|
+
"pushln",
|
206
|
+
"rehash",
|
207
|
+
"sched",
|
208
|
+
"setcap",
|
209
|
+
"setopt",
|
210
|
+
"stat",
|
211
|
+
"suspend",
|
212
|
+
"ttyctl",
|
213
|
+
"unfunction",
|
214
|
+
"unhash",
|
215
|
+
"unlimit",
|
216
|
+
"unsetopt",
|
217
|
+
"vared",
|
218
|
+
"wait",
|
219
|
+
"whence",
|
220
|
+
"where",
|
221
|
+
"which",
|
222
|
+
"zcompile",
|
223
|
+
"zformat",
|
224
|
+
"zftp",
|
225
|
+
"zle",
|
226
|
+
"zmodload",
|
227
|
+
"zparseopts",
|
228
|
+
"zprof",
|
229
|
+
"zpty",
|
230
|
+
"zregexparse",
|
231
|
+
"zsocket",
|
232
|
+
"zstyle",
|
233
|
+
"ztcp"
|
234
|
+
];
|
235
|
+
const GNU_CORE_UTILS = [
|
236
|
+
"chcon",
|
237
|
+
"chgrp",
|
238
|
+
"chown",
|
239
|
+
"chmod",
|
240
|
+
"cp",
|
241
|
+
"dd",
|
242
|
+
"df",
|
243
|
+
"dir",
|
244
|
+
"dircolors",
|
245
|
+
"ln",
|
246
|
+
"ls",
|
247
|
+
"mkdir",
|
248
|
+
"mkfifo",
|
249
|
+
"mknod",
|
250
|
+
"mktemp",
|
251
|
+
"mv",
|
252
|
+
"realpath",
|
253
|
+
"rm",
|
254
|
+
"rmdir",
|
255
|
+
"shred",
|
256
|
+
"sync",
|
257
|
+
"touch",
|
258
|
+
"truncate",
|
259
|
+
"vdir",
|
260
|
+
"b2sum",
|
261
|
+
"base32",
|
262
|
+
"base64",
|
263
|
+
"cat",
|
264
|
+
"cksum",
|
265
|
+
"comm",
|
266
|
+
"csplit",
|
267
|
+
"cut",
|
268
|
+
"expand",
|
269
|
+
"fmt",
|
270
|
+
"fold",
|
271
|
+
"head",
|
272
|
+
"join",
|
273
|
+
"md5sum",
|
274
|
+
"nl",
|
275
|
+
"numfmt",
|
276
|
+
"od",
|
277
|
+
"paste",
|
278
|
+
"ptx",
|
279
|
+
"pr",
|
280
|
+
"sha1sum",
|
281
|
+
"sha224sum",
|
282
|
+
"sha256sum",
|
283
|
+
"sha384sum",
|
284
|
+
"sha512sum",
|
285
|
+
"shuf",
|
286
|
+
"sort",
|
287
|
+
"split",
|
288
|
+
"sum",
|
289
|
+
"tac",
|
290
|
+
"tail",
|
291
|
+
"tr",
|
292
|
+
"tsort",
|
293
|
+
"unexpand",
|
294
|
+
"uniq",
|
295
|
+
"wc",
|
296
|
+
"arch",
|
297
|
+
"basename",
|
298
|
+
"chroot",
|
299
|
+
"date",
|
300
|
+
"dirname",
|
301
|
+
"du",
|
302
|
+
"echo",
|
303
|
+
"env",
|
304
|
+
"expr",
|
305
|
+
"factor",
|
306
|
+
// "false", // keyword literal already
|
307
|
+
"groups",
|
308
|
+
"hostid",
|
309
|
+
"id",
|
310
|
+
"link",
|
311
|
+
"logname",
|
312
|
+
"nice",
|
313
|
+
"nohup",
|
314
|
+
"nproc",
|
315
|
+
"pathchk",
|
316
|
+
"pinky",
|
317
|
+
"printenv",
|
318
|
+
"printf",
|
319
|
+
"pwd",
|
320
|
+
"readlink",
|
321
|
+
"runcon",
|
322
|
+
"seq",
|
323
|
+
"sleep",
|
324
|
+
"stat",
|
325
|
+
"stdbuf",
|
326
|
+
"stty",
|
327
|
+
"tee",
|
328
|
+
"test",
|
329
|
+
"timeout",
|
330
|
+
// "true", // keyword literal already
|
331
|
+
"tty",
|
332
|
+
"uname",
|
333
|
+
"unlink",
|
334
|
+
"uptime",
|
335
|
+
"users",
|
336
|
+
"who",
|
337
|
+
"whoami",
|
338
|
+
"yes"
|
339
|
+
];
|
340
|
+
return {
|
341
|
+
name: "Bash",
|
342
|
+
aliases: ["sh"],
|
343
|
+
keywords: {
|
344
|
+
$pattern: /\b[a-z][a-z0-9._-]+\b/,
|
345
|
+
keyword: KEYWORDS,
|
346
|
+
literal: LITERALS,
|
347
|
+
built_in: [
|
348
|
+
...SHELL_BUILT_INS,
|
349
|
+
...BASH_BUILT_INS,
|
350
|
+
// Shell modifiers
|
351
|
+
"set",
|
352
|
+
"shopt",
|
353
|
+
...ZSH_BUILT_INS,
|
354
|
+
...GNU_CORE_UTILS
|
355
|
+
]
|
356
|
+
},
|
357
|
+
contains: [
|
358
|
+
KNOWN_SHEBANG,
|
359
|
+
// to catch known shells and boost relevancy
|
360
|
+
hljs.SHEBANG(),
|
361
|
+
// to catch unknown shells but still highlight the shebang
|
362
|
+
FUNCTION,
|
363
|
+
ARITHMETIC,
|
364
|
+
hljs.HASH_COMMENT_MODE,
|
365
|
+
HERE_DOC,
|
366
|
+
PATH_MODE,
|
367
|
+
QUOTE_STRING,
|
368
|
+
ESCAPED_QUOTE,
|
369
|
+
APOS_STRING,
|
370
|
+
ESCAPED_APOS,
|
371
|
+
VAR
|
372
|
+
]
|
373
|
+
};
|
374
|
+
}
|
375
|
+
export {
|
376
|
+
bash as default
|
377
|
+
};
|
@@ -0,0 +1,221 @@
|
|
1
|
+
function basic(hljs) {
|
2
|
+
const KEYWORDS = [
|
3
|
+
"ABS",
|
4
|
+
"ASC",
|
5
|
+
"AND",
|
6
|
+
"ATN",
|
7
|
+
"AUTO|0",
|
8
|
+
"BEEP",
|
9
|
+
"BLOAD|10",
|
10
|
+
"BSAVE|10",
|
11
|
+
"CALL",
|
12
|
+
"CALLS",
|
13
|
+
"CDBL",
|
14
|
+
"CHAIN",
|
15
|
+
"CHDIR",
|
16
|
+
"CHR$|10",
|
17
|
+
"CINT",
|
18
|
+
"CIRCLE",
|
19
|
+
"CLEAR",
|
20
|
+
"CLOSE",
|
21
|
+
"CLS",
|
22
|
+
"COLOR",
|
23
|
+
"COM",
|
24
|
+
"COMMON",
|
25
|
+
"CONT",
|
26
|
+
"COS",
|
27
|
+
"CSNG",
|
28
|
+
"CSRLIN",
|
29
|
+
"CVD",
|
30
|
+
"CVI",
|
31
|
+
"CVS",
|
32
|
+
"DATA",
|
33
|
+
"DATE$",
|
34
|
+
"DEFDBL",
|
35
|
+
"DEFINT",
|
36
|
+
"DEFSNG",
|
37
|
+
"DEFSTR",
|
38
|
+
"DEF|0",
|
39
|
+
"SEG",
|
40
|
+
"USR",
|
41
|
+
"DELETE",
|
42
|
+
"DIM",
|
43
|
+
"DRAW",
|
44
|
+
"EDIT",
|
45
|
+
"END",
|
46
|
+
"ENVIRON",
|
47
|
+
"ENVIRON$",
|
48
|
+
"EOF",
|
49
|
+
"EQV",
|
50
|
+
"ERASE",
|
51
|
+
"ERDEV",
|
52
|
+
"ERDEV$",
|
53
|
+
"ERL",
|
54
|
+
"ERR",
|
55
|
+
"ERROR",
|
56
|
+
"EXP",
|
57
|
+
"FIELD",
|
58
|
+
"FILES",
|
59
|
+
"FIX",
|
60
|
+
"FOR|0",
|
61
|
+
"FRE",
|
62
|
+
"GET",
|
63
|
+
"GOSUB|10",
|
64
|
+
"GOTO",
|
65
|
+
"HEX$",
|
66
|
+
"IF",
|
67
|
+
"THEN",
|
68
|
+
"ELSE|0",
|
69
|
+
"INKEY$",
|
70
|
+
"INP",
|
71
|
+
"INPUT",
|
72
|
+
"INPUT#",
|
73
|
+
"INPUT$",
|
74
|
+
"INSTR",
|
75
|
+
"IMP",
|
76
|
+
"INT",
|
77
|
+
"IOCTL",
|
78
|
+
"IOCTL$",
|
79
|
+
"KEY",
|
80
|
+
"ON",
|
81
|
+
"OFF",
|
82
|
+
"LIST",
|
83
|
+
"KILL",
|
84
|
+
"LEFT$",
|
85
|
+
"LEN",
|
86
|
+
"LET",
|
87
|
+
"LINE",
|
88
|
+
"LLIST",
|
89
|
+
"LOAD",
|
90
|
+
"LOC",
|
91
|
+
"LOCATE",
|
92
|
+
"LOF",
|
93
|
+
"LOG",
|
94
|
+
"LPRINT",
|
95
|
+
"USING",
|
96
|
+
"LSET",
|
97
|
+
"MERGE",
|
98
|
+
"MID$",
|
99
|
+
"MKDIR",
|
100
|
+
"MKD$",
|
101
|
+
"MKI$",
|
102
|
+
"MKS$",
|
103
|
+
"MOD",
|
104
|
+
"NAME",
|
105
|
+
"NEW",
|
106
|
+
"NEXT",
|
107
|
+
"NOISE",
|
108
|
+
"NOT",
|
109
|
+
"OCT$",
|
110
|
+
"ON",
|
111
|
+
"OR",
|
112
|
+
"PEN",
|
113
|
+
"PLAY",
|
114
|
+
"STRIG",
|
115
|
+
"OPEN",
|
116
|
+
"OPTION",
|
117
|
+
"BASE",
|
118
|
+
"OUT",
|
119
|
+
"PAINT",
|
120
|
+
"PALETTE",
|
121
|
+
"PCOPY",
|
122
|
+
"PEEK",
|
123
|
+
"PMAP",
|
124
|
+
"POINT",
|
125
|
+
"POKE",
|
126
|
+
"POS",
|
127
|
+
"PRINT",
|
128
|
+
"PRINT]",
|
129
|
+
"PSET",
|
130
|
+
"PRESET",
|
131
|
+
"PUT",
|
132
|
+
"RANDOMIZE",
|
133
|
+
"READ",
|
134
|
+
"REM",
|
135
|
+
"RENUM",
|
136
|
+
"RESET|0",
|
137
|
+
"RESTORE",
|
138
|
+
"RESUME",
|
139
|
+
"RETURN|0",
|
140
|
+
"RIGHT$",
|
141
|
+
"RMDIR",
|
142
|
+
"RND",
|
143
|
+
"RSET",
|
144
|
+
"RUN",
|
145
|
+
"SAVE",
|
146
|
+
"SCREEN",
|
147
|
+
"SGN",
|
148
|
+
"SHELL",
|
149
|
+
"SIN",
|
150
|
+
"SOUND",
|
151
|
+
"SPACE$",
|
152
|
+
"SPC",
|
153
|
+
"SQR",
|
154
|
+
"STEP",
|
155
|
+
"STICK",
|
156
|
+
"STOP",
|
157
|
+
"STR$",
|
158
|
+
"STRING$",
|
159
|
+
"SWAP",
|
160
|
+
"SYSTEM",
|
161
|
+
"TAB",
|
162
|
+
"TAN",
|
163
|
+
"TIME$",
|
164
|
+
"TIMER",
|
165
|
+
"TROFF",
|
166
|
+
"TRON",
|
167
|
+
"TO",
|
168
|
+
"USR",
|
169
|
+
"VAL",
|
170
|
+
"VARPTR",
|
171
|
+
"VARPTR$",
|
172
|
+
"VIEW",
|
173
|
+
"WAIT",
|
174
|
+
"WHILE",
|
175
|
+
"WEND",
|
176
|
+
"WIDTH",
|
177
|
+
"WINDOW",
|
178
|
+
"WRITE",
|
179
|
+
"XOR"
|
180
|
+
];
|
181
|
+
return {
|
182
|
+
name: "BASIC",
|
183
|
+
case_insensitive: true,
|
184
|
+
illegal: "^.",
|
185
|
+
// Support explicitly typed variables that end with $%! or #.
|
186
|
+
keywords: {
|
187
|
+
$pattern: "[a-zA-Z][a-zA-Z0-9_$%!#]*",
|
188
|
+
keyword: KEYWORDS
|
189
|
+
},
|
190
|
+
contains: [
|
191
|
+
hljs.QUOTE_STRING_MODE,
|
192
|
+
hljs.COMMENT("REM", "$", { relevance: 10 }),
|
193
|
+
hljs.COMMENT("'", "$", { relevance: 0 }),
|
194
|
+
{
|
195
|
+
// Match line numbers
|
196
|
+
className: "symbol",
|
197
|
+
begin: "^[0-9]+ ",
|
198
|
+
relevance: 10
|
199
|
+
},
|
200
|
+
{
|
201
|
+
// Match typed numeric constants (1000, 12.34!, 1.2e5, 1.5#, 1.2D2)
|
202
|
+
className: "number",
|
203
|
+
begin: "\\b\\d+(\\.\\d+)?([edED]\\d+)?[#!]?",
|
204
|
+
relevance: 0
|
205
|
+
},
|
206
|
+
{
|
207
|
+
// Match hexadecimal numbers (&Hxxxx)
|
208
|
+
className: "number",
|
209
|
+
begin: "(&[hH][0-9a-fA-F]{1,4})"
|
210
|
+
},
|
211
|
+
{
|
212
|
+
// Match octal numbers (&Oxxxxxx)
|
213
|
+
className: "number",
|
214
|
+
begin: "(&[oO][0-7]{1,6})"
|
215
|
+
}
|
216
|
+
]
|
217
|
+
};
|
218
|
+
}
|
219
|
+
export {
|
220
|
+
basic as default
|
221
|
+
};
|