@mxmweb/rtext 1.6.12 → 1.6.13
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/adopters/ChatMessageAdapter.d.ts +4 -0
- package/adopters/Markdownit.d.ts +2 -0
- package/adopters/PromptTempDesigner.d.ts +2 -0
- package/adopters/RetriveChatMessage.d.ts +4 -0
- package/assets/style.css +1 -1
- package/core/UnifiedRichText.d.ts +2 -0
- package/core/richElements/CodeBlock.d.ts +19 -0
- package/index.js +14 -30233
- package/lib_enter-Dc5XyCCf.js +31770 -0
- package/mockserverdata.d.ts +67 -29
- package/package.json +1 -1
- package/prism-bash-zSjFhtUz.js +219 -0
- package/prism-c-CXS5tkeN.js +76 -0
- package/prism-cpp-CvP_gscY.js +113 -0
- package/prism-css-3Jya3wSQ.js +55 -0
- package/prism-diff-Apx1lkH_.js +42 -0
- package/prism-go-CHuRSSd-.js +26 -0
- package/prism-java-DUOgyYJG.js +142 -0
- package/prism-javascript-CLux6jF8.js +137 -0
- package/prism-json-iVb7He6L.js +25 -0
- package/prism-jsx-yfun9EDN.js +51 -0
- package/prism-kotlin-QHMLy1lI.js +75 -0
- package/prism-markdown-tjNeCMi3.js +300 -0
- package/prism-markup-BNGj0Tvm.js +173 -0
- package/prism-php-BQcudfaM.js +347 -0
- package/prism-python-DERGD9Re.js +89 -0
- package/prism-ruby-DfaHE8ro.js +195 -0
- package/prism-rust-ChXOQips.js +144 -0
- package/prism-sql-8Y2-THrf.js +33 -0
- package/prism-swift-CeDyTyXT.js +113 -0
- package/prism-tsx-D_jjxt3I.js +6 -0
- package/prism-typescript-FZlwMqq2.js +73 -0
- package/prism-yaml-DwdKlmeG.js +66 -0
- package/stats.html +1 -1
package/mockserverdata.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const mockServerData: {
|
|
|
12
12
|
filePath: string;
|
|
13
13
|
configId: number;
|
|
14
14
|
kbId: null;
|
|
15
|
-
queryReplyPairList: {
|
|
15
|
+
queryReplyPairList: ({
|
|
16
16
|
query: {
|
|
17
17
|
id: string;
|
|
18
18
|
gmtCreate: number;
|
|
@@ -30,37 +30,12 @@ export declare const mockServerData: {
|
|
|
30
30
|
type: string;
|
|
31
31
|
reference: string;
|
|
32
32
|
webReference: string;
|
|
33
|
-
knowledgeBases:
|
|
34
|
-
knowledgeBaseName: string;
|
|
35
|
-
treeData: {
|
|
36
|
-
name: string;
|
|
37
|
-
filePath: null;
|
|
38
|
-
folderId: null;
|
|
39
|
-
type: string;
|
|
40
|
-
fileCount: number;
|
|
41
|
-
fileType: null;
|
|
42
|
-
fetchUrl: string;
|
|
43
|
-
}[];
|
|
44
|
-
totalFileCount: number;
|
|
45
|
-
fetchUrl: null;
|
|
46
|
-
} | {
|
|
47
|
-
knowledgeBaseName: string;
|
|
48
|
-
treeData: {
|
|
49
|
-
name: string;
|
|
50
|
-
filePath: string;
|
|
51
|
-
folderId: null;
|
|
52
|
-
type: string;
|
|
53
|
-
fileCount: null;
|
|
54
|
-
fileType: string;
|
|
55
|
-
fetchUrl: string;
|
|
56
|
-
}[];
|
|
57
|
-
totalFileCount: number;
|
|
58
|
-
fetchUrl: null;
|
|
59
|
-
})[];
|
|
33
|
+
knowledgeBases: never[];
|
|
60
34
|
queryId: string;
|
|
61
35
|
feedbackResult: null;
|
|
62
36
|
feedbackId: null;
|
|
63
37
|
parsedFilePaths: null;
|
|
38
|
+
temporaryReference: string;
|
|
64
39
|
recommendQuestion: string;
|
|
65
40
|
llmType: number;
|
|
66
41
|
resultType: number;
|
|
@@ -92,11 +67,74 @@ export declare const mockServerData: {
|
|
|
92
67
|
llmType: number;
|
|
93
68
|
businessType: string;
|
|
94
69
|
nodeStatus: number;
|
|
70
|
+
temporaryReference: null;
|
|
71
|
+
config: null;
|
|
72
|
+
}[];
|
|
73
|
+
enableCot: number;
|
|
74
|
+
tokens: number;
|
|
75
|
+
};
|
|
76
|
+
} | {
|
|
77
|
+
query: {
|
|
78
|
+
id: string;
|
|
79
|
+
gmtCreate: number;
|
|
80
|
+
content: string;
|
|
81
|
+
type: string;
|
|
82
|
+
queryId: string;
|
|
83
|
+
audioUrl: string;
|
|
84
|
+
filePaths: null;
|
|
85
|
+
currentFiles: null;
|
|
86
|
+
};
|
|
87
|
+
reply: {
|
|
88
|
+
id: string;
|
|
89
|
+
gmtCreate: number;
|
|
90
|
+
content: string;
|
|
91
|
+
type: string;
|
|
92
|
+
reference: string;
|
|
93
|
+
webReference: string;
|
|
94
|
+
knowledgeBases: never[];
|
|
95
|
+
queryId: string;
|
|
96
|
+
feedbackResult: null;
|
|
97
|
+
feedbackId: null;
|
|
98
|
+
parsedFilePaths: null;
|
|
99
|
+
temporaryReference: null;
|
|
100
|
+
recommendQuestion: null;
|
|
101
|
+
llmType: number;
|
|
102
|
+
resultType: number;
|
|
103
|
+
respTime: number;
|
|
104
|
+
databaseReference: null;
|
|
105
|
+
chain: {
|
|
106
|
+
sessionId: null;
|
|
107
|
+
queryId: null;
|
|
108
|
+
lastDate: null;
|
|
109
|
+
status: number;
|
|
110
|
+
reply: {
|
|
111
|
+
content: string;
|
|
112
|
+
type: string;
|
|
113
|
+
errorMsg: null;
|
|
114
|
+
errorCode: null;
|
|
115
|
+
};
|
|
116
|
+
reference: null;
|
|
117
|
+
webReference: null;
|
|
118
|
+
databaseReference: null;
|
|
119
|
+
knowledgeBases: null;
|
|
120
|
+
docsTree: null;
|
|
121
|
+
resultType: null;
|
|
122
|
+
filePaths: null;
|
|
123
|
+
respTime: null;
|
|
124
|
+
chainRespTime: null;
|
|
125
|
+
enableCot: null;
|
|
126
|
+
tokens: number;
|
|
127
|
+
promptContent: null;
|
|
128
|
+
llmType: number;
|
|
129
|
+
businessType: string;
|
|
130
|
+
nodeStatus: number;
|
|
131
|
+
temporaryReference: null;
|
|
132
|
+
config: null;
|
|
95
133
|
}[];
|
|
96
134
|
enableCot: number;
|
|
97
135
|
tokens: number;
|
|
98
136
|
};
|
|
99
|
-
}[];
|
|
137
|
+
})[];
|
|
100
138
|
searchConfigDTO: {
|
|
101
139
|
id: number;
|
|
102
140
|
status: number;
|
package/package.json
CHANGED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
(function(e) {
|
|
2
|
+
var a = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", r = {
|
|
3
|
+
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
4
|
+
lookbehind: !0,
|
|
5
|
+
alias: "punctuation",
|
|
6
|
+
// this looks reasonably well in all themes
|
|
7
|
+
inside: null
|
|
8
|
+
// see below
|
|
9
|
+
}, t = {
|
|
10
|
+
bash: r,
|
|
11
|
+
environment: {
|
|
12
|
+
pattern: RegExp("\\$" + a),
|
|
13
|
+
alias: "constant"
|
|
14
|
+
},
|
|
15
|
+
variable: [
|
|
16
|
+
// [0]: Arithmetic Environment
|
|
17
|
+
{
|
|
18
|
+
pattern: /\$?\(\([\s\S]+?\)\)/,
|
|
19
|
+
greedy: !0,
|
|
20
|
+
inside: {
|
|
21
|
+
// If there is a $ sign at the beginning highlight $(( and )) as variable
|
|
22
|
+
variable: [
|
|
23
|
+
{
|
|
24
|
+
pattern: /(^\$\(\([\s\S]+)\)\)/,
|
|
25
|
+
lookbehind: !0
|
|
26
|
+
},
|
|
27
|
+
/^\$\(\(/
|
|
28
|
+
],
|
|
29
|
+
number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
|
|
30
|
+
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
|
|
31
|
+
operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
|
|
32
|
+
// If there is no $ sign at the beginning highlight (( and )) as punctuation
|
|
33
|
+
punctuation: /\(\(?|\)\)?|,|;/
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
// [1]: Command Substitution
|
|
37
|
+
{
|
|
38
|
+
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
|
|
39
|
+
greedy: !0,
|
|
40
|
+
inside: {
|
|
41
|
+
variable: /^\$\(|^`|\)$|`$/
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
// [2]: Brace expansion
|
|
45
|
+
{
|
|
46
|
+
pattern: /\$\{[^}]+\}/,
|
|
47
|
+
greedy: !0,
|
|
48
|
+
inside: {
|
|
49
|
+
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
50
|
+
punctuation: /[\[\]]/,
|
|
51
|
+
environment: {
|
|
52
|
+
pattern: RegExp("(\\{)" + a),
|
|
53
|
+
lookbehind: !0,
|
|
54
|
+
alias: "constant"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
/\$(?:\w+|[#?*!@$])/
|
|
59
|
+
],
|
|
60
|
+
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
61
|
+
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
62
|
+
};
|
|
63
|
+
e.languages.bash = {
|
|
64
|
+
shebang: {
|
|
65
|
+
pattern: /^#!\s*\/.*/,
|
|
66
|
+
alias: "important"
|
|
67
|
+
},
|
|
68
|
+
comment: {
|
|
69
|
+
pattern: /(^|[^"{\\$])#.*/,
|
|
70
|
+
lookbehind: !0
|
|
71
|
+
},
|
|
72
|
+
"function-name": [
|
|
73
|
+
// a) function foo {
|
|
74
|
+
// b) foo() {
|
|
75
|
+
// c) function foo() {
|
|
76
|
+
// but not “foo {”
|
|
77
|
+
{
|
|
78
|
+
// a) and c)
|
|
79
|
+
pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
|
|
80
|
+
lookbehind: !0,
|
|
81
|
+
alias: "function"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
// b)
|
|
85
|
+
pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
|
|
86
|
+
alias: "function"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
// Highlight variable names as variables in for and select beginnings.
|
|
90
|
+
"for-or-select": {
|
|
91
|
+
pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
|
|
92
|
+
alias: "variable",
|
|
93
|
+
lookbehind: !0
|
|
94
|
+
},
|
|
95
|
+
// Highlight variable names as variables in the left-hand part
|
|
96
|
+
// of assignments (“=” and “+=”).
|
|
97
|
+
"assign-left": {
|
|
98
|
+
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
|
99
|
+
inside: {
|
|
100
|
+
environment: {
|
|
101
|
+
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + a),
|
|
102
|
+
lookbehind: !0,
|
|
103
|
+
alias: "constant"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
alias: "variable",
|
|
107
|
+
lookbehind: !0
|
|
108
|
+
},
|
|
109
|
+
// Highlight parameter names as variables
|
|
110
|
+
parameter: {
|
|
111
|
+
pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
|
|
112
|
+
alias: "variable",
|
|
113
|
+
lookbehind: !0
|
|
114
|
+
},
|
|
115
|
+
string: [
|
|
116
|
+
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
|
|
117
|
+
{
|
|
118
|
+
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
119
|
+
lookbehind: !0,
|
|
120
|
+
greedy: !0,
|
|
121
|
+
inside: t
|
|
122
|
+
},
|
|
123
|
+
// Here-document with quotes around the tag
|
|
124
|
+
// → No expansion (so no “inside”).
|
|
125
|
+
{
|
|
126
|
+
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
|
|
127
|
+
lookbehind: !0,
|
|
128
|
+
greedy: !0,
|
|
129
|
+
inside: {
|
|
130
|
+
bash: r
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
// “Normal” string
|
|
134
|
+
{
|
|
135
|
+
// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
|
|
136
|
+
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
137
|
+
lookbehind: !0,
|
|
138
|
+
greedy: !0,
|
|
139
|
+
inside: t
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
143
|
+
pattern: /(^|[^$\\])'[^']*'/,
|
|
144
|
+
lookbehind: !0,
|
|
145
|
+
greedy: !0
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
|
|
149
|
+
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
150
|
+
greedy: !0,
|
|
151
|
+
inside: {
|
|
152
|
+
entity: t.entity
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
environment: {
|
|
157
|
+
pattern: RegExp("\\$?" + a),
|
|
158
|
+
alias: "constant"
|
|
159
|
+
},
|
|
160
|
+
variable: t.variable,
|
|
161
|
+
function: {
|
|
162
|
+
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
|
163
|
+
lookbehind: !0
|
|
164
|
+
},
|
|
165
|
+
keyword: {
|
|
166
|
+
pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
|
|
167
|
+
lookbehind: !0
|
|
168
|
+
},
|
|
169
|
+
// https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
|
|
170
|
+
builtin: {
|
|
171
|
+
pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
|
|
172
|
+
lookbehind: !0,
|
|
173
|
+
// Alias added to make those easier to distinguish from strings.
|
|
174
|
+
alias: "class-name"
|
|
175
|
+
},
|
|
176
|
+
boolean: {
|
|
177
|
+
pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
|
|
178
|
+
lookbehind: !0
|
|
179
|
+
},
|
|
180
|
+
"file-descriptor": {
|
|
181
|
+
pattern: /\B&\d\b/,
|
|
182
|
+
alias: "important"
|
|
183
|
+
},
|
|
184
|
+
operator: {
|
|
185
|
+
// Lots of redirections here, but not just that.
|
|
186
|
+
pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
|
|
187
|
+
inside: {
|
|
188
|
+
"file-descriptor": {
|
|
189
|
+
pattern: /^\d/,
|
|
190
|
+
alias: "important"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
|
|
195
|
+
number: {
|
|
196
|
+
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
197
|
+
lookbehind: !0
|
|
198
|
+
}
|
|
199
|
+
}, r.inside = e.languages.bash;
|
|
200
|
+
for (var o = [
|
|
201
|
+
"comment",
|
|
202
|
+
"function-name",
|
|
203
|
+
"for-or-select",
|
|
204
|
+
"assign-left",
|
|
205
|
+
"parameter",
|
|
206
|
+
"string",
|
|
207
|
+
"environment",
|
|
208
|
+
"function",
|
|
209
|
+
"keyword",
|
|
210
|
+
"builtin",
|
|
211
|
+
"boolean",
|
|
212
|
+
"file-descriptor",
|
|
213
|
+
"operator",
|
|
214
|
+
"punctuation",
|
|
215
|
+
"number"
|
|
216
|
+
], s = t.variable[1].inside, n = 0; n < o.length; n++)
|
|
217
|
+
s[o[n]] = e.languages.bash[o[n]];
|
|
218
|
+
e.languages.sh = e.languages.bash, e.languages.shell = e.languages.bash;
|
|
219
|
+
})(Prism);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Prism.languages.c = Prism.languages.extend("clike", {
|
|
2
|
+
comment: {
|
|
3
|
+
pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
4
|
+
greedy: !0
|
|
5
|
+
},
|
|
6
|
+
string: {
|
|
7
|
+
// https://en.cppreference.com/w/c/language/string_literal
|
|
8
|
+
pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
|
|
9
|
+
greedy: !0
|
|
10
|
+
},
|
|
11
|
+
"class-name": {
|
|
12
|
+
pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
|
|
13
|
+
lookbehind: !0
|
|
14
|
+
},
|
|
15
|
+
keyword: /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
|
|
16
|
+
function: /\b[a-z_]\w*(?=\s*\()/i,
|
|
17
|
+
number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
|
|
18
|
+
operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
|
|
19
|
+
});
|
|
20
|
+
Prism.languages.insertBefore("c", "string", {
|
|
21
|
+
char: {
|
|
22
|
+
// https://en.cppreference.com/w/c/language/character_constant
|
|
23
|
+
pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
|
|
24
|
+
greedy: !0
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
Prism.languages.insertBefore("c", "string", {
|
|
28
|
+
macro: {
|
|
29
|
+
// allow for multiline macro definitions
|
|
30
|
+
// spaces after the # character compile fine with gcc
|
|
31
|
+
pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
|
|
32
|
+
lookbehind: !0,
|
|
33
|
+
greedy: !0,
|
|
34
|
+
alias: "property",
|
|
35
|
+
inside: {
|
|
36
|
+
string: [
|
|
37
|
+
{
|
|
38
|
+
// highlight the path of the include statement as a string
|
|
39
|
+
pattern: /^(#\s*include\s*)<[^>]+>/,
|
|
40
|
+
lookbehind: !0
|
|
41
|
+
},
|
|
42
|
+
Prism.languages.c.string
|
|
43
|
+
],
|
|
44
|
+
char: Prism.languages.c.char,
|
|
45
|
+
comment: Prism.languages.c.comment,
|
|
46
|
+
"macro-name": [
|
|
47
|
+
{
|
|
48
|
+
pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
|
|
49
|
+
lookbehind: !0
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
|
|
53
|
+
lookbehind: !0,
|
|
54
|
+
alias: "function"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
// highlight macro directives as keywords
|
|
58
|
+
directive: {
|
|
59
|
+
pattern: /^(#\s*)[a-z]+/,
|
|
60
|
+
lookbehind: !0,
|
|
61
|
+
alias: "keyword"
|
|
62
|
+
},
|
|
63
|
+
"directive-hash": /^#/,
|
|
64
|
+
punctuation: /##|\\(?=[\r\n])/,
|
|
65
|
+
expression: {
|
|
66
|
+
pattern: /\S[\s\S]*/,
|
|
67
|
+
inside: Prism.languages.c
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Prism.languages.insertBefore("c", "function", {
|
|
73
|
+
// highlight predefined macros as constants
|
|
74
|
+
constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
|
|
75
|
+
});
|
|
76
|
+
delete Prism.languages.c.boolean;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { g as p } from "./lib_enter-Dc5XyCCf.js";
|
|
2
|
+
function u(e, t) {
|
|
3
|
+
for (var r = 0; r < t.length; r++) {
|
|
4
|
+
const n = t[r];
|
|
5
|
+
if (typeof n != "string" && !Array.isArray(n)) {
|
|
6
|
+
for (const a in n)
|
|
7
|
+
if (a !== "default" && !(a in e)) {
|
|
8
|
+
const s = Object.getOwnPropertyDescriptor(n, a);
|
|
9
|
+
s && Object.defineProperty(e, a, s.get ? s : {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: () => n[a]
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
+
}
|
|
18
|
+
var o = {}, i;
|
|
19
|
+
function l() {
|
|
20
|
+
return i || (i = 1, (function(e) {
|
|
21
|
+
var t = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, r = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function() {
|
|
22
|
+
return t.source;
|
|
23
|
+
});
|
|
24
|
+
e.languages.cpp = e.languages.extend("c", {
|
|
25
|
+
"class-name": [
|
|
26
|
+
{
|
|
27
|
+
pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g, function() {
|
|
28
|
+
return t.source;
|
|
29
|
+
})),
|
|
30
|
+
lookbehind: !0
|
|
31
|
+
},
|
|
32
|
+
// This is intended to capture the class name of method implementations like:
|
|
33
|
+
// void foo::bar() const {}
|
|
34
|
+
// However! The `foo` in the above example could also be a namespace, so we only capture the class name if
|
|
35
|
+
// it starts with an uppercase letter. This approximation should give decent results.
|
|
36
|
+
/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,
|
|
37
|
+
// This will capture the class name before destructors like:
|
|
38
|
+
// Foo::~Foo() {}
|
|
39
|
+
/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,
|
|
40
|
+
// This also intends to capture the class name of method implementations but here the class has template
|
|
41
|
+
// parameters, so it can't be a namespace (until C++ adds generic namespaces).
|
|
42
|
+
/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
|
|
43
|
+
],
|
|
44
|
+
keyword: t,
|
|
45
|
+
number: {
|
|
46
|
+
pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
|
|
47
|
+
greedy: !0
|
|
48
|
+
},
|
|
49
|
+
operator: />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
|
|
50
|
+
boolean: /\b(?:false|true)\b/
|
|
51
|
+
}), e.languages.insertBefore("cpp", "string", {
|
|
52
|
+
module: {
|
|
53
|
+
// https://en.cppreference.com/w/cpp/language/modules
|
|
54
|
+
pattern: RegExp(
|
|
55
|
+
/(\b(?:import|module)\s+)/.source + "(?:" + // header-name
|
|
56
|
+
/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + "|" + // module name or partition or both
|
|
57
|
+
/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, function() {
|
|
58
|
+
return r;
|
|
59
|
+
}) + ")"
|
|
60
|
+
),
|
|
61
|
+
lookbehind: !0,
|
|
62
|
+
greedy: !0,
|
|
63
|
+
inside: {
|
|
64
|
+
string: /^[<"][\s\S]+/,
|
|
65
|
+
operator: /:/,
|
|
66
|
+
punctuation: /\./
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"raw-string": {
|
|
70
|
+
pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
|
|
71
|
+
alias: "string",
|
|
72
|
+
greedy: !0
|
|
73
|
+
}
|
|
74
|
+
}), e.languages.insertBefore("cpp", "keyword", {
|
|
75
|
+
"generic-function": {
|
|
76
|
+
pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
|
|
77
|
+
inside: {
|
|
78
|
+
function: /^\w+/,
|
|
79
|
+
generic: {
|
|
80
|
+
pattern: /<[\s\S]+/,
|
|
81
|
+
alias: "class-name",
|
|
82
|
+
inside: e.languages.cpp
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}), e.languages.insertBefore("cpp", "operator", {
|
|
87
|
+
"double-colon": {
|
|
88
|
+
pattern: /::/,
|
|
89
|
+
alias: "punctuation"
|
|
90
|
+
}
|
|
91
|
+
}), e.languages.insertBefore("cpp", "class-name", {
|
|
92
|
+
// the base clause is an optional list of parent classes
|
|
93
|
+
// https://en.cppreference.com/w/cpp/language/class
|
|
94
|
+
"base-clause": {
|
|
95
|
+
pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
|
|
96
|
+
lookbehind: !0,
|
|
97
|
+
greedy: !0,
|
|
98
|
+
inside: e.languages.extend("cpp", {})
|
|
99
|
+
}
|
|
100
|
+
}), e.languages.insertBefore("inside", "double-colon", {
|
|
101
|
+
// All untokenized words that are not namespaces should be class names
|
|
102
|
+
"class-name": /\b[a-z_]\w*\b(?!\s*::)/i
|
|
103
|
+
}, e.languages.cpp["base-clause"]);
|
|
104
|
+
})(Prism)), o;
|
|
105
|
+
}
|
|
106
|
+
var c = l();
|
|
107
|
+
const d = /* @__PURE__ */ p(c), b = /* @__PURE__ */ u({
|
|
108
|
+
__proto__: null,
|
|
109
|
+
default: d
|
|
110
|
+
}, [c]);
|
|
111
|
+
export {
|
|
112
|
+
b as p
|
|
113
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
(function(s) {
|
|
2
|
+
var e = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
3
|
+
s.languages.css = {
|
|
4
|
+
comment: /\/\*[\s\S]*?\*\//,
|
|
5
|
+
atrule: {
|
|
6
|
+
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + e.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
7
|
+
inside: {
|
|
8
|
+
rule: /^@[\w-]+/,
|
|
9
|
+
"selector-function-argument": {
|
|
10
|
+
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
11
|
+
lookbehind: !0,
|
|
12
|
+
alias: "selector"
|
|
13
|
+
},
|
|
14
|
+
keyword: {
|
|
15
|
+
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
16
|
+
lookbehind: !0
|
|
17
|
+
}
|
|
18
|
+
// See rest below
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
url: {
|
|
22
|
+
// https://drafts.csswg.org/css-values-3/#urls
|
|
23
|
+
pattern: RegExp("\\burl\\((?:" + e.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
24
|
+
greedy: !0,
|
|
25
|
+
inside: {
|
|
26
|
+
function: /^url/i,
|
|
27
|
+
punctuation: /^\(|\)$/,
|
|
28
|
+
string: {
|
|
29
|
+
pattern: RegExp("^" + e.source + "$"),
|
|
30
|
+
alias: "url"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
selector: {
|
|
35
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + e.source + ")*(?=\\s*\\{)"),
|
|
36
|
+
lookbehind: !0
|
|
37
|
+
},
|
|
38
|
+
string: {
|
|
39
|
+
pattern: e,
|
|
40
|
+
greedy: !0
|
|
41
|
+
},
|
|
42
|
+
property: {
|
|
43
|
+
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
44
|
+
lookbehind: !0
|
|
45
|
+
},
|
|
46
|
+
important: /!important\b/i,
|
|
47
|
+
function: {
|
|
48
|
+
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
49
|
+
lookbehind: !0
|
|
50
|
+
},
|
|
51
|
+
punctuation: /[(){};:,]/
|
|
52
|
+
}, s.languages.css.atrule.inside.rest = s.languages.css;
|
|
53
|
+
var t = s.languages.markup;
|
|
54
|
+
t && (t.tag.addInlined("style", "css"), t.tag.addAttribute("style", "css"));
|
|
55
|
+
})(Prism);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
(function(i) {
|
|
2
|
+
i.languages.diff = {
|
|
3
|
+
coord: [
|
|
4
|
+
// Match all kinds of coord lines (prefixed by "+++", "---" or "***").
|
|
5
|
+
/^(?:\*{3}|-{3}|\+{3}).*$/m,
|
|
6
|
+
// Match "@@ ... @@" coord lines in unified diff.
|
|
7
|
+
/^@@.*@@$/m,
|
|
8
|
+
// Match coord lines in normal diff (starts with a number).
|
|
9
|
+
/^\d.*$/m
|
|
10
|
+
]
|
|
11
|
+
// deleted, inserted, unchanged, diff
|
|
12
|
+
};
|
|
13
|
+
var r = {
|
|
14
|
+
"deleted-sign": "-",
|
|
15
|
+
"deleted-arrow": "<",
|
|
16
|
+
"inserted-sign": "+",
|
|
17
|
+
"inserted-arrow": ">",
|
|
18
|
+
unchanged: " ",
|
|
19
|
+
diff: "!"
|
|
20
|
+
};
|
|
21
|
+
Object.keys(r).forEach(function(e) {
|
|
22
|
+
var a = r[e], n = [];
|
|
23
|
+
/^\w+$/.test(e) || n.push(/\w+/.exec(e)[0]), e === "diff" && n.push("bold"), i.languages.diff[e] = {
|
|
24
|
+
pattern: RegExp("^(?:[" + a + `].*(?:\r
|
|
25
|
+
?|
|
|
26
|
+
|(?![\\s\\S])))+`, "m"),
|
|
27
|
+
alias: n,
|
|
28
|
+
inside: {
|
|
29
|
+
line: {
|
|
30
|
+
pattern: /(.)(?=[\s\S]).*(?:\r\n?|\n)?/,
|
|
31
|
+
lookbehind: !0
|
|
32
|
+
},
|
|
33
|
+
prefix: {
|
|
34
|
+
pattern: /[\s\S]/,
|
|
35
|
+
alias: /\w+/.exec(e)[0]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}), Object.defineProperty(i.languages.diff, "PREFIXES", {
|
|
40
|
+
value: r
|
|
41
|
+
});
|
|
42
|
+
})(Prism);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Prism.languages.go = Prism.languages.extend("clike", {
|
|
2
|
+
string: {
|
|
3
|
+
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
|
|
4
|
+
lookbehind: !0,
|
|
5
|
+
greedy: !0
|
|
6
|
+
},
|
|
7
|
+
keyword: /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
|
|
8
|
+
boolean: /\b(?:_|false|iota|nil|true)\b/,
|
|
9
|
+
number: [
|
|
10
|
+
// binary and octal integers
|
|
11
|
+
/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
|
|
12
|
+
// hexadecimal integers and floats
|
|
13
|
+
/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
|
|
14
|
+
// decimal integers and floats
|
|
15
|
+
/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
|
|
16
|
+
],
|
|
17
|
+
operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
|
|
18
|
+
builtin: /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
|
|
19
|
+
});
|
|
20
|
+
Prism.languages.insertBefore("go", "string", {
|
|
21
|
+
char: {
|
|
22
|
+
pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
|
|
23
|
+
greedy: !0
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
delete Prism.languages.go["class-name"];
|