@cloudbase/weda-ui 0.2.7 → 0.2.8

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 (114) hide show
  1. package/package.json +1 -3
  2. package/src/configs/components/container.json +2 -1
  3. package/src/configs/components/form/richText.json +2 -1
  4. package/src/configs/components/form/uploader.json +4 -4
  5. package/src/configs/components/image.json +2 -1
  6. package/src/configs/components/link.json +2 -1
  7. package/src/configs/components/richtextview.json +2 -1
  8. package/src/configs/components/scrollVeiw.json +2 -1
  9. package/src/configs/components/swiper.json +2 -1
  10. package/src/configs/components/tabs.json +2 -1
  11. package/src/configs/components/text.json +2 -1
  12. package/src/configs/index.js +3 -5
  13. package/src/mp/components/form/uploader/index.js +15 -8
  14. package/src/mp/components/form/uploader/index.wxml +1 -1
  15. package/src/web/components/form/select/region/{cities.json → cities.js} +2 -2
  16. package/src/web/components/form/select/region/index.js +3 -3
  17. package/src/web/components/form/select/region/{provinces.json → provinces.js} +2 -2
  18. package/src/web/components/form/select/region/{regions.json → regions.js} +2 -2
  19. package/src/web/components/form/switch/index.jsx +1 -0
  20. package/src/web/components/form/uploader/uploader.h5.jsx +42 -16
  21. package/src/web/components/form/uploader/uploader.pc.jsx +1 -1
  22. package/src/web/components/image/image.jsx +0 -1
  23. package/src/web/components/index.js +0 -1
  24. package/src/configs/components/markdown.json +0 -17
  25. package/src/mp/components/markdown/index.js +0 -27
  26. package/src/mp/components/markdown/index.json +0 -6
  27. package/src/mp/components/markdown/index.wxml +0 -1
  28. package/src/mp/components/markdown/towxml/audio-player/Audio.js +0 -99
  29. package/src/mp/components/markdown/towxml/audio-player/audio-player.js +0 -102
  30. package/src/mp/components/markdown/towxml/audio-player/audio-player.json +0 -5
  31. package/src/mp/components/markdown/towxml/audio-player/audio-player.wxml +0 -14
  32. package/src/mp/components/markdown/towxml/audio-player/audio-player.wxss +0 -175
  33. package/src/mp/components/markdown/towxml/audio-player/loading.svg +0 -1
  34. package/src/mp/components/markdown/towxml/config.js +0 -285
  35. package/src/mp/components/markdown/towxml/decode.js +0 -26
  36. package/src/mp/components/markdown/towxml/decode.json +0 -12
  37. package/src/mp/components/markdown/towxml/decode.wxml +0 -1
  38. package/src/mp/components/markdown/towxml/decode.wxss +0 -0
  39. package/src/mp/components/markdown/towxml/img/img.js +0 -98
  40. package/src/mp/components/markdown/towxml/img/img.json +0 -3
  41. package/src/mp/components/markdown/towxml/img/img.wxml +0 -1
  42. package/src/mp/components/markdown/towxml/img/img.wxss +0 -0
  43. package/src/mp/components/markdown/towxml/index.js +0 -19
  44. package/src/mp/components/markdown/towxml/latex/latex.js +0 -53
  45. package/src/mp/components/markdown/towxml/latex/latex.json +0 -5
  46. package/src/mp/components/markdown/towxml/latex/latex.wxml +0 -1
  47. package/src/mp/components/markdown/towxml/latex/latex.wxss +0 -0
  48. package/src/mp/components/markdown/towxml/parse/highlight/highlight.js +0 -729
  49. package/src/mp/components/markdown/towxml/parse/highlight/index.js +0 -7
  50. package/src/mp/components/markdown/towxml/parse/highlight/languages/bash.js +0 -91
  51. package/src/mp/components/markdown/towxml/parse/highlight/languages/c-like.js +0 -244
  52. package/src/mp/components/markdown/towxml/parse/highlight/languages/c.js +0 -20
  53. package/src/mp/components/markdown/towxml/parse/highlight/languages/css.js +0 -138
  54. package/src/mp/components/markdown/towxml/parse/highlight/languages/dart.js +0 -135
  55. package/src/mp/components/markdown/towxml/parse/highlight/languages/go.js +0 -57
  56. package/src/mp/components/markdown/towxml/parse/highlight/languages/htmlbars.js +0 -79
  57. package/src/mp/components/markdown/towxml/parse/highlight/languages/java.js +0 -126
  58. package/src/mp/components/markdown/towxml/parse/highlight/languages/javascript.js +0 -263
  59. package/src/mp/components/markdown/towxml/parse/highlight/languages/json.js +0 -51
  60. package/src/mp/components/markdown/towxml/parse/highlight/languages/less.js +0 -177
  61. package/src/mp/components/markdown/towxml/parse/highlight/languages/nginx.js +0 -103
  62. package/src/mp/components/markdown/towxml/parse/highlight/languages/php.js +0 -152
  63. package/src/mp/components/markdown/towxml/parse/highlight/languages/python-repl.js +0 -27
  64. package/src/mp/components/markdown/towxml/parse/highlight/languages/python.js +0 -146
  65. package/src/mp/components/markdown/towxml/parse/highlight/languages/scss.js +0 -137
  66. package/src/mp/components/markdown/towxml/parse/highlight/languages/shell.js +0 -23
  67. package/src/mp/components/markdown/towxml/parse/highlight/languages/typescript.js +0 -198
  68. package/src/mp/components/markdown/towxml/parse/highlight/languages/xml.js +0 -143
  69. package/src/mp/components/markdown/towxml/parse/highlight/style/github.wxss +0 -99
  70. package/src/mp/components/markdown/towxml/parse/highlight/style/monokai.wxss +0 -70
  71. package/src/mp/components/markdown/towxml/parse/index.js +0 -106
  72. package/src/mp/components/markdown/towxml/parse/markdown/index.js +0 -53
  73. package/src/mp/components/markdown/towxml/parse/markdown/markdown.js +0 -5834
  74. package/src/mp/components/markdown/towxml/parse/markdown/plugins/emoji.js +0 -1773
  75. package/src/mp/components/markdown/towxml/parse/markdown/plugins/ins.js +0 -120
  76. package/src/mp/components/markdown/towxml/parse/markdown/plugins/latex.js +0 -193
  77. package/src/mp/components/markdown/towxml/parse/markdown/plugins/mark.js +0 -120
  78. package/src/mp/components/markdown/towxml/parse/markdown/plugins/sub.js +0 -95
  79. package/src/mp/components/markdown/towxml/parse/markdown/plugins/sup.js +0 -95
  80. package/src/mp/components/markdown/towxml/parse/markdown/plugins/todo.js +0 -220
  81. package/src/mp/components/markdown/towxml/parse/markdown/plugins/yuml.js +0 -18
  82. package/src/mp/components/markdown/towxml/parse/parse2/Parser.js +0 -263
  83. package/src/mp/components/markdown/towxml/parse/parse2/Tokenizer.js +0 -507
  84. package/src/mp/components/markdown/towxml/parse/parse2/domhandler/index.js +0 -104
  85. package/src/mp/components/markdown/towxml/parse/parse2/domhandler/node.js +0 -169
  86. package/src/mp/components/markdown/towxml/parse/parse2/entities/decode.js +0 -54
  87. package/src/mp/components/markdown/towxml/parse/parse2/entities/decode_codepoint.js +0 -19
  88. package/src/mp/components/markdown/towxml/parse/parse2/entities/encode.js +0 -54
  89. package/src/mp/components/markdown/towxml/parse/parse2/entities/index.js +0 -30
  90. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/decode.js +0 -31
  91. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/entities.js +0 -2128
  92. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/legacy.js +0 -109
  93. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/xml.js +0 -2
  94. package/src/mp/components/markdown/towxml/parse/parse2/index.js +0 -8
  95. package/src/mp/components/markdown/towxml/style/main.wxss +0 -378
  96. package/src/mp/components/markdown/towxml/style/theme/dark.wxss +0 -73
  97. package/src/mp/components/markdown/towxml/style/theme/light.wxss +0 -63
  98. package/src/mp/components/markdown/towxml/table/table.js +0 -11
  99. package/src/mp/components/markdown/towxml/table/table.json +0 -6
  100. package/src/mp/components/markdown/towxml/table/table.wxml +0 -24
  101. package/src/mp/components/markdown/towxml/table/table.wxss +0 -0
  102. package/src/mp/components/markdown/towxml/todogroup/todogroup.js +0 -19
  103. package/src/mp/components/markdown/towxml/todogroup/todogroup.json +0 -6
  104. package/src/mp/components/markdown/towxml/todogroup/todogroup.wxml +0 -13
  105. package/src/mp/components/markdown/towxml/todogroup/todogroup.wxss +0 -3
  106. package/src/mp/components/markdown/towxml/towxml.js +0 -17
  107. package/src/mp/components/markdown/towxml/towxml.json +0 -6
  108. package/src/mp/components/markdown/towxml/towxml.wxml +0 -5
  109. package/src/mp/components/markdown/towxml/towxml.wxss +0 -8
  110. package/src/mp/components/markdown/towxml/yuml/yuml.js +0 -51
  111. package/src/mp/components/markdown/towxml/yuml/yuml.json +0 -5
  112. package/src/mp/components/markdown/towxml/yuml/yuml.wxml +0 -5
  113. package/src/mp/components/markdown/towxml/yuml/yuml.wxss +0 -0
  114. package/src/web/components/markdown/index.jsx +0 -40
@@ -1,7 +0,0 @@
1
- const config = require('../../config');
2
- const hljs = require('./highlight');
3
- config.highlight.forEach((item) => {
4
- hljs.registerLanguage(item, require(`./languages/${item}`).default);
5
- });
6
-
7
- module.exports = hljs;
@@ -1,91 +0,0 @@
1
- /*
2
- Language: Bash
3
- Author: vah <vahtenberg@gmail.com>
4
- Contributrors: Benjamin Pannell <contact@sierrasoftworks.com>
5
- Website: https://www.gnu.org/software/bash/
6
- Category: common
7
- */
8
-
9
- export default function (hljs) {
10
- const VAR = {};
11
- const BRACED_VAR = {
12
- begin: /\$\{/,
13
- end: /\}/,
14
- contains: [
15
- { begin: /:-/, contains: [VAR] }, // default values
16
- ],
17
- };
18
- Object.assign(VAR, {
19
- className: 'variable',
20
- variants: [{ begin: /\$[\w\d#@][\w\d_]*/ }, BRACED_VAR],
21
- });
22
-
23
- const SUBST = {
24
- className: 'subst',
25
- begin: /\$\(/,
26
- end: /\)/,
27
- contains: [hljs.BACKSLASH_ESCAPE],
28
- };
29
- const QUOTE_STRING = {
30
- className: 'string',
31
- begin: /"/,
32
- end: /"/,
33
- contains: [hljs.BACKSLASH_ESCAPE, VAR, SUBST],
34
- };
35
- SUBST.contains.push(QUOTE_STRING);
36
- const ESCAPED_QUOTE = {
37
- className: '',
38
- begin: /\\"/,
39
- };
40
- const APOS_STRING = {
41
- className: 'string',
42
- begin: /'/,
43
- end: /'/,
44
- };
45
- const ARITHMETIC = {
46
- begin: /\$\(\(/,
47
- end: /\)\)/,
48
- contains: [{ begin: /\d+#[0-9a-f]+/, className: 'number' }, hljs.NUMBER_MODE, VAR],
49
- };
50
- const SHEBANG = {
51
- className: 'meta',
52
- begin: /^#![^\n]+sh\s*$/,
53
- relevance: 10,
54
- };
55
- const FUNCTION = {
56
- className: 'function',
57
- begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
58
- returnBegin: true,
59
- contains: [hljs.inherit(hljs.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
60
- relevance: 0,
61
- };
62
-
63
- return {
64
- name: 'Bash',
65
- aliases: ['sh', 'zsh'],
66
- lexemes: /\b-?[a-z\._]+\b/,
67
- keywords: {
68
- keyword: 'if then else elif fi for while in do done case esac function',
69
- literal: 'true false',
70
- built_in:
71
- // Shell built-ins
72
- // http://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
73
- 'break cd continue eval exec exit export getopts hash pwd readonly return shift test times ' +
74
- 'trap umask unset ' +
75
- // Bash built-ins
76
- 'alias bind builtin caller command declare echo enable help let local logout mapfile printf ' +
77
- 'read readarray source type typeset ulimit unalias ' +
78
- // Shell modifiers
79
- 'set shopt ' +
80
- // Zsh built-ins
81
- 'autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles ' +
82
- 'compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate ' +
83
- 'fc fg float functions getcap getln history integer jobs kill limit log noglob popd print ' +
84
- 'pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit ' +
85
- 'unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof ' +
86
- 'zpty zregexparse zsocket zstyle ztcp',
87
- _: '-ne -eq -lt -gt -f -d -e -s -l -a', // relevance booster
88
- },
89
- contains: [SHEBANG, FUNCTION, ARITHMETIC, hljs.HASH_COMMENT_MODE, QUOTE_STRING, ESCAPED_QUOTE, APOS_STRING, VAR],
90
- };
91
- }
@@ -1,244 +0,0 @@
1
- /*
2
- Language: C-like foundation grammar for C/C++ grammars
3
- Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
4
- Contributors: Evgeny Stepanischev <imbolk@gmail.com>, Zaven Muradyan <megalivoithos@gmail.com>, Roel Deckers <admin@codingcat.nl>, Sam Wu <samsam2310@gmail.com>, Jordi Petit <jordi.petit@gmail.com>, Pieter Vantorre <pietervantorre@gmail.com>, Google Inc. (David Benjamin) <davidben@google.com>
5
- Category: common, system
6
- */
7
-
8
- /* In the future the intention is to split out the C/C++ grammars distinctly
9
- since they are separate languages. They will likely share a common foundation
10
- though, and this file sets the groundwork for that - so that we get the breaking
11
- change in v10 and don't have to change the requirements again later.
12
-
13
- See: https://github.com/highlightjs/highlight.js/issues/2146
14
- */
15
-
16
- export default function (hljs) {
17
- function optional(s) {
18
- return `(?:${s})?`;
19
- }
20
- const DECLTYPE_AUTO_RE = 'decltype\\(auto\\)';
21
- const NAMESPACE_RE = '[a-zA-Z_]\\w*::';
22
- const TEMPLATE_ARGUMENT_RE = '<.*?>';
23
- const FUNCTION_TYPE_RE = `(${DECLTYPE_AUTO_RE}|${optional(NAMESPACE_RE)}[a-zA-Z_]\\w*${optional(
24
- TEMPLATE_ARGUMENT_RE,
25
- )})`;
26
- const CPP_PRIMITIVE_TYPES = {
27
- className: 'keyword',
28
- begin: '\\b[a-z\\d_]*_t\\b',
29
- };
30
-
31
- // https://en.cppreference.com/w/cpp/language/escape
32
- // \\ \x \xFF \u2837 \u00323747 \374
33
- const CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)';
34
- const STRINGS = {
35
- className: 'string',
36
- variants: [
37
- {
38
- begin: '(u8?|U|L)?"',
39
- end: '"',
40
- illegal: '\\n',
41
- contains: [hljs.BACKSLASH_ESCAPE],
42
- },
43
- {
44
- begin: `(u8?|U|L)?'(${CHARACTER_ESCAPES}|.)`,
45
- end: "'",
46
- illegal: '.',
47
- },
48
- { begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\((?:.|\n)*?\)\1"/ },
49
- ],
50
- };
51
-
52
- const NUMBERS = {
53
- className: 'number',
54
- variants: [
55
- { begin: "\\b(0b[01']+)" },
56
- { begin: "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)" },
57
- { begin: "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" },
58
- ],
59
- relevance: 0,
60
- };
61
-
62
- const PREPROCESSOR = {
63
- className: 'meta',
64
- begin: /#\s*[a-z]+\b/,
65
- end: /$/,
66
- keywords: {
67
- 'meta-keyword': 'if else elif endif define undef warning error line ' + 'pragma _Pragma ifdef ifndef include',
68
- },
69
- contains: [
70
- {
71
- begin: /\\\n/,
72
- relevance: 0,
73
- },
74
- hljs.inherit(STRINGS, { className: 'meta-string' }),
75
- {
76
- className: 'meta-string',
77
- begin: /<.*?>/,
78
- end: /$/,
79
- illegal: '\\n',
80
- },
81
- hljs.C_LINE_COMMENT_MODE,
82
- hljs.C_BLOCK_COMMENT_MODE,
83
- ],
84
- };
85
-
86
- const TITLE_MODE = {
87
- className: 'title',
88
- begin: optional(NAMESPACE_RE) + hljs.IDENT_RE,
89
- relevance: 0,
90
- };
91
-
92
- const FUNCTION_TITLE = `${optional(NAMESPACE_RE) + hljs.IDENT_RE}\\s*\\(`;
93
-
94
- const CPP_KEYWORDS = {
95
- keyword:
96
- 'int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof ' +
97
- 'dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace ' +
98
- 'unsigned long volatile static protected bool template mutable if public friend ' +
99
- 'do goto auto void enum else break extern using asm case typeid wchar_t ' +
100
- 'short reinterpret_cast|10 default double register explicit signed typename try this ' +
101
- 'switch continue inline delete alignas alignof constexpr consteval constinit decltype ' +
102
- 'concept co_await co_return co_yield requires ' +
103
- 'noexcept static_assert thread_local restrict final override ' +
104
- 'atomic_bool atomic_char atomic_schar ' +
105
- 'atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong ' +
106
- 'atomic_ullong new throw return ' +
107
- 'and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq',
108
- built_in:
109
- 'std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream ' +
110
- 'auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set ' +
111
- 'unordered_map unordered_multiset unordered_multimap array shared_ptr abort terminate abs acos ' +
112
- 'asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp ' +
113
- 'fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper ' +
114
- 'isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow ' +
115
- 'printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp ' +
116
- 'strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan ' +
117
- 'vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary',
118
- literal: 'true false nullptr NULL',
119
- };
120
-
121
- const EXPRESSION_CONTAINS = [
122
- CPP_PRIMITIVE_TYPES,
123
- hljs.C_LINE_COMMENT_MODE,
124
- hljs.C_BLOCK_COMMENT_MODE,
125
- NUMBERS,
126
- STRINGS,
127
- ];
128
-
129
- const EXPRESSION_CONTEXT = {
130
- // This mode covers expression context where we can't expect a function
131
- // definition and shouldn't highlight anything that looks like one:
132
- // `return some()`, `else if()`, `(x*sum(1, 2))`
133
- variants: [
134
- { begin: /=/, end: /;/ },
135
- { begin: /\(/, end: /\)/ },
136
- { beginKeywords: 'new throw return else', end: /;/ },
137
- ],
138
- keywords: CPP_KEYWORDS,
139
- contains: EXPRESSION_CONTAINS.concat([
140
- {
141
- begin: /\(/,
142
- end: /\)/,
143
- keywords: CPP_KEYWORDS,
144
- contains: EXPRESSION_CONTAINS.concat(['self']),
145
- relevance: 0,
146
- },
147
- ]),
148
- relevance: 0,
149
- };
150
-
151
- const FUNCTION_DECLARATION = {
152
- className: 'function',
153
- begin: `(${FUNCTION_TYPE_RE}[\\*&\\s]+)+${FUNCTION_TITLE}`,
154
- returnBegin: true,
155
- end: /[{;=]/,
156
- excludeEnd: true,
157
- keywords: CPP_KEYWORDS,
158
- illegal: /[^\w\s\*&:<>]/,
159
- contains: [
160
- {
161
- // to prevent it from being confused as the function title
162
- begin: DECLTYPE_AUTO_RE,
163
- keywords: CPP_KEYWORDS,
164
- relevance: 0,
165
- },
166
- {
167
- begin: FUNCTION_TITLE,
168
- returnBegin: true,
169
- contains: [TITLE_MODE],
170
- relevance: 0,
171
- },
172
- {
173
- className: 'params',
174
- begin: /\(/,
175
- end: /\)/,
176
- keywords: CPP_KEYWORDS,
177
- relevance: 0,
178
- contains: [
179
- hljs.C_LINE_COMMENT_MODE,
180
- hljs.C_BLOCK_COMMENT_MODE,
181
- STRINGS,
182
- NUMBERS,
183
- CPP_PRIMITIVE_TYPES,
184
- // Count matching parentheses.
185
- {
186
- begin: /\(/,
187
- end: /\)/,
188
- keywords: CPP_KEYWORDS,
189
- relevance: 0,
190
- contains: [
191
- 'self',
192
- hljs.C_LINE_COMMENT_MODE,
193
- hljs.C_BLOCK_COMMENT_MODE,
194
- STRINGS,
195
- NUMBERS,
196
- CPP_PRIMITIVE_TYPES,
197
- ],
198
- },
199
- ],
200
- },
201
- CPP_PRIMITIVE_TYPES,
202
- hljs.C_LINE_COMMENT_MODE,
203
- hljs.C_BLOCK_COMMENT_MODE,
204
- PREPROCESSOR,
205
- ],
206
- };
207
-
208
- return {
209
- aliases: ['c', 'cc', 'h', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx'],
210
- keywords: CPP_KEYWORDS,
211
- // the base c-like language will NEVER be auto-detected, rather the
212
- // derivitives: c, c++, arduino turn auto-detect back on for themselves
213
- disableAutodetect: true,
214
- illegal: '</',
215
- contains: [].concat(EXPRESSION_CONTEXT, FUNCTION_DECLARATION, EXPRESSION_CONTAINS, [
216
- PREPROCESSOR,
217
- {
218
- begin:
219
- '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<',
220
- end: '>',
221
- keywords: CPP_KEYWORDS,
222
- contains: ['self', CPP_PRIMITIVE_TYPES],
223
- },
224
- {
225
- begin: `${hljs.IDENT_RE}::`,
226
- keywords: CPP_KEYWORDS,
227
- },
228
- {
229
- className: 'class',
230
- beginKeywords: 'class struct',
231
- end: /[{;:]/,
232
- contains: [
233
- { begin: /</, end: />/, contains: ['self'] }, // skip generic stuff
234
- hljs.TITLE_MODE,
235
- ],
236
- },
237
- ]),
238
- exports: {
239
- preprocessor: PREPROCESSOR,
240
- strings: STRINGS,
241
- keywords: CPP_KEYWORDS,
242
- },
243
- };
244
- }
@@ -1,20 +0,0 @@
1
- /*
2
- Language: C
3
- Category: common, system
4
- Website: https://en.wikipedia.org/wiki/C_(programming_language)
5
- Requires: c-like.js
6
- */
7
-
8
- export default function (hljs) {
9
- const lang = hljs.getLanguage('c-like').rawDefinition();
10
- // Until C is actually different than C++ there is no reason to auto-detect C
11
- // as it's own language since it would just fail auto-detect testing or
12
- // simply match with C++.
13
- //
14
- // See further comments in c-like.js.
15
-
16
- // lang.disableAutodetect = false;
17
- lang.name = 'C';
18
- lang.aliases = ['c', 'h'];
19
- return lang;
20
- }
@@ -1,138 +0,0 @@
1
- /*
2
- Language: CSS
3
- Category: common, css
4
- Website: https://developer.mozilla.org/en-US/docs/Web/CSS
5
- */
6
-
7
- export default function (hljs) {
8
- const FUNCTION_LIKE = {
9
- begin: /[\w-]+\(/,
10
- returnBegin: true,
11
- contains: [
12
- {
13
- className: 'built_in',
14
- begin: /[\w-]+/,
15
- },
16
- {
17
- begin: /\(/,
18
- end: /\)/,
19
- contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, hljs.CSS_NUMBER_MODE],
20
- },
21
- ],
22
- };
23
- const ATTRIBUTE = {
24
- className: 'attribute',
25
- begin: /\S/,
26
- end: ':',
27
- excludeEnd: true,
28
- starts: {
29
- endsWithParent: true,
30
- excludeEnd: true,
31
- contains: [
32
- FUNCTION_LIKE,
33
- hljs.CSS_NUMBER_MODE,
34
- hljs.QUOTE_STRING_MODE,
35
- hljs.APOS_STRING_MODE,
36
- hljs.C_BLOCK_COMMENT_MODE,
37
- {
38
- className: 'number',
39
- begin: '#[0-9A-Fa-f]+',
40
- },
41
- {
42
- className: 'meta',
43
- begin: '!important',
44
- },
45
- ],
46
- },
47
- };
48
- const AT_IDENTIFIER = '@[a-z-]+'; // @font-face
49
- const AT_MODIFIERS = 'and or not only';
50
- const MEDIA_TYPES = 'all print screen speech';
51
- const AT_PROPERTY_RE = /@\-?\w[\w]*(\-\w+)*/; // @-webkit-keyframes
52
- const IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
53
- const RULE = {
54
- begin: /(?:[A-Z\_\.\-]+|--[a-zA-Z0-9_-]+)\s*:/,
55
- returnBegin: true,
56
- end: ';',
57
- endsWithParent: true,
58
- contains: [ATTRIBUTE],
59
- };
60
-
61
- return {
62
- name: 'CSS',
63
- case_insensitive: true,
64
- illegal: /[=\/|'\$]/,
65
- contains: [
66
- hljs.C_BLOCK_COMMENT_MODE,
67
- {
68
- className: 'selector-id',
69
- begin: /#[A-Za-z0-9_-]+/,
70
- },
71
- {
72
- className: 'selector-class',
73
- begin: /\.[A-Za-z0-9_-]+/,
74
- },
75
- {
76
- className: 'selector-attr',
77
- begin: /\[/,
78
- end: /\]/,
79
- illegal: '$',
80
- contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE],
81
- },
82
- {
83
- className: 'selector-pseudo',
84
- begin: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/,
85
- },
86
- // matching these here allows us to treat them more like regular CSS
87
- // rules so everything between the {} gets regular rule highlighting,
88
- // which is what we want for page and font-face
89
- {
90
- begin: '@(page|font-face)',
91
- lexemes: AT_IDENTIFIER,
92
- keywords: '@page @font-face',
93
- },
94
- {
95
- begin: '@',
96
- end: '[{;]', // at_rule eating first "{" is a good thing
97
- // because it doesn’t let it to be parsed as
98
- // a rule set but instead drops parser into
99
- // the default mode which is how it should be.
100
- illegal: /:/, // break on Less variables @var: ...
101
- returnBegin: true,
102
- contains: [
103
- {
104
- className: 'keyword',
105
- begin: AT_PROPERTY_RE,
106
- },
107
- {
108
- begin: /\s/,
109
- endsWithParent: true,
110
- excludeEnd: true,
111
- relevance: 0,
112
- keywords: AT_MODIFIERS,
113
- contains: [
114
- {
115
- begin: /[a-z-]+:/,
116
- className: 'attribute',
117
- },
118
- hljs.APOS_STRING_MODE,
119
- hljs.QUOTE_STRING_MODE,
120
- hljs.CSS_NUMBER_MODE,
121
- ],
122
- },
123
- ],
124
- },
125
- {
126
- className: 'selector-tag',
127
- begin: IDENT_RE,
128
- relevance: 0,
129
- },
130
- {
131
- begin: '{',
132
- end: '}',
133
- illegal: /\S/,
134
- contains: [hljs.C_BLOCK_COMMENT_MODE, RULE],
135
- },
136
- ],
137
- };
138
- }
@@ -1,135 +0,0 @@
1
- /*
2
- Language: Dart
3
- Requires: markdown.js
4
- Author: Maxim Dikun <dikmax@gmail.com>
5
- Description: Dart a modern, object-oriented language developed by Google. For more information see https://www.dartlang.org/
6
- Website: https://dart.dev
7
- Category: scripting
8
- */
9
-
10
- export default function (hljs) {
11
- const SUBST = {
12
- className: 'subst',
13
- variants: [
14
- {
15
- begin: '\\$[A-Za-z0-9_]+',
16
- },
17
- ],
18
- };
19
-
20
- const BRACED_SUBST = {
21
- className: 'subst',
22
- variants: [
23
- {
24
- begin: '\\${',
25
- end: '}',
26
- },
27
- ],
28
- keywords: 'true false null this is new super',
29
- };
30
-
31
- const STRING = {
32
- className: 'string',
33
- variants: [
34
- {
35
- begin: "r'''",
36
- end: "'''",
37
- },
38
- {
39
- begin: 'r"""',
40
- end: '"""',
41
- },
42
- {
43
- begin: "r'",
44
- end: "'",
45
- illegal: '\\n',
46
- },
47
- {
48
- begin: 'r"',
49
- end: '"',
50
- illegal: '\\n',
51
- },
52
- {
53
- begin: "'''",
54
- end: "'''",
55
- contains: [hljs.BACKSLASH_ESCAPE, SUBST, BRACED_SUBST],
56
- },
57
- {
58
- begin: '"""',
59
- end: '"""',
60
- contains: [hljs.BACKSLASH_ESCAPE, SUBST, BRACED_SUBST],
61
- },
62
- {
63
- begin: "'",
64
- end: "'",
65
- illegal: '\\n',
66
- contains: [hljs.BACKSLASH_ESCAPE, SUBST, BRACED_SUBST],
67
- },
68
- {
69
- begin: '"',
70
- end: '"',
71
- illegal: '\\n',
72
- contains: [hljs.BACKSLASH_ESCAPE, SUBST, BRACED_SUBST],
73
- },
74
- ],
75
- };
76
- BRACED_SUBST.contains = [hljs.C_NUMBER_MODE, STRING];
77
-
78
- const KEYWORDS = {
79
- keyword:
80
- 'abstract as assert async await break case catch class const continue covariant default deferred do ' +
81
- 'dynamic else enum export extends extension external factory false final finally for Function get hide if ' +
82
- 'implements import in inferface is library mixin new null on operator part rethrow return set show static ' +
83
- 'super switch sync this throw true try typedef var void while with yield',
84
- built_in:
85
- // dart:core
86
- 'Comparable DateTime Duration Function Iterable Iterator List Map Match Null Object Pattern RegExp Set ' +
87
- 'Stopwatch String StringBuffer StringSink Symbol Type Uri bool double dynamic int num print ' +
88
- // dart:html
89
- 'Element ElementList document querySelector querySelectorAll window',
90
- };
91
-
92
- return {
93
- name: 'Dart',
94
- keywords: KEYWORDS,
95
- contains: [
96
- STRING,
97
- hljs.COMMENT('/\\*\\*', '\\*/', {
98
- subLanguage: 'markdown',
99
- relevance: 0,
100
- }),
101
- hljs.COMMENT('///+\\s*', '$', {
102
- contains: [
103
- {
104
- subLanguage: 'markdown',
105
- begin: '.',
106
- end: '$',
107
- relevance: 0,
108
- },
109
- ],
110
- }),
111
- hljs.C_LINE_COMMENT_MODE,
112
- hljs.C_BLOCK_COMMENT_MODE,
113
- {
114
- className: 'class',
115
- beginKeywords: 'class interface',
116
- end: '{',
117
- excludeEnd: true,
118
- contains: [
119
- {
120
- beginKeywords: 'extends implements',
121
- },
122
- hljs.UNDERSCORE_TITLE_MODE,
123
- ],
124
- },
125
- hljs.C_NUMBER_MODE,
126
- {
127
- className: 'meta',
128
- begin: '@[A-Za-z]+',
129
- },
130
- {
131
- begin: '=>', // No markup, just a relevance booster
132
- },
133
- ],
134
- };
135
- }
@@ -1,57 +0,0 @@
1
- /*
2
- Language: Go
3
- Author: Stephan Kountso aka StepLg <steplg@gmail.com>
4
- Contributors: Evgeny Stepanischev <imbolk@gmail.com>
5
- Description: Google go language (golang). For info about language
6
- Website: http://golang.org/
7
- Category: common, system
8
- */
9
-
10
- export default function (hljs) {
11
- const GO_KEYWORDS = {
12
- keyword:
13
- 'break default func interface select case map struct chan else goto package switch ' +
14
- 'const fallthrough if range type continue for import return var go defer ' +
15
- 'bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 ' +
16
- 'uint16 uint32 uint64 int uint uintptr rune',
17
- literal: 'true false iota nil',
18
- built_in: 'append cap close complex copy imag len make new panic print println real recover delete',
19
- };
20
- return {
21
- name: 'Go',
22
- aliases: ['golang'],
23
- keywords: GO_KEYWORDS,
24
- illegal: '</',
25
- contains: [
26
- hljs.C_LINE_COMMENT_MODE,
27
- hljs.C_BLOCK_COMMENT_MODE,
28
- {
29
- className: 'string',
30
- variants: [hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE, { begin: '`', end: '`' }],
31
- },
32
- {
33
- className: 'number',
34
- variants: [{ begin: `${hljs.C_NUMBER_RE}[i]`, relevance: 1 }, hljs.C_NUMBER_MODE],
35
- },
36
- {
37
- begin: /:=/, // relevance booster
38
- },
39
- {
40
- className: 'function',
41
- beginKeywords: 'func',
42
- end: '\\s*(\\{|$)',
43
- excludeEnd: true,
44
- contains: [
45
- hljs.TITLE_MODE,
46
- {
47
- className: 'params',
48
- begin: /\(/,
49
- end: /\)/,
50
- keywords: GO_KEYWORDS,
51
- illegal: /["']/,
52
- },
53
- ],
54
- },
55
- ],
56
- };
57
- }