@cloudbase/weda-ui 0.2.6 → 0.2.10

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 (158) hide show
  1. package/package.json +3 -4
  2. package/src/configs/components/container.json +2 -1
  3. package/src/configs/components/form/input.json +6 -0
  4. package/src/configs/components/form/richText.json +2 -1
  5. package/src/configs/components/form/uploader.json +4 -5
  6. package/src/configs/components/image.json +2 -1
  7. package/src/configs/components/link.json +2 -1
  8. package/src/configs/components/richtextview.json +2 -1
  9. package/src/configs/components/scrollVeiw.json +2 -1
  10. package/src/configs/components/swiper.json +2 -1
  11. package/src/configs/components/tabs.json +31 -86
  12. package/src/configs/components/text.json +2 -1
  13. package/src/configs/index.js +4 -7
  14. package/src/mp/components/form/input/index.js +5 -1
  15. package/src/mp/components/form/input/index.wxml +2 -1
  16. package/src/mp/components/form/select/index.js +2 -2
  17. package/src/mp/components/form/textarea/index.wxml +1 -0
  18. package/src/mp/components/form/uploader/index.js +48 -14
  19. package/src/mp/components/form/uploader/index.wxml +9 -2
  20. package/src/mp/components/image/index.js +57 -8
  21. package/src/mp/components/image/index.json +4 -1
  22. package/src/mp/components/image/index.wxml +4 -2
  23. package/src/mp/components/image/index.wxss +14 -0
  24. package/src/mp/components/richText/index.wxml +1 -1
  25. package/src/mp/components/tabs/index.js +14 -1
  26. package/src/mp/utils/deepEqual.js +42 -0
  27. package/src/web/components/form/enumSelect/MultipleSelect.jsx +94 -0
  28. package/src/web/components/form/enumSelect/NormalSelect.jsx +105 -0
  29. package/src/web/components/form/enumSelect/SelectContainer.jsx +43 -0
  30. package/src/web/components/form/enumSelect/hooks/index.js +49 -0
  31. package/src/web/components/form/enumSelect/index.jsx +9 -0
  32. package/src/web/components/form/enumSelect/props/defaultProps.js +39 -0
  33. package/src/web/components/form/enumSelect/props/propsTypes.js +50 -0
  34. package/src/web/components/form/input/index.jsx +14 -10
  35. package/src/web/components/form/radio/index.jsx +1 -1
  36. package/src/web/components/form/select/h5.jsx +1 -1
  37. package/src/web/components/form/select/region/{cities.json → cities.js} +2 -2
  38. package/src/web/components/form/select/region/index.js +3 -3
  39. package/src/web/components/form/select/region/{provinces.json → provinces.js} +2 -2
  40. package/src/web/components/form/select/region/{regions.json → regions.js} +2 -2
  41. package/src/web/components/form/switch/index.jsx +1 -0
  42. package/src/web/components/form/uploader/index.css +15 -0
  43. package/src/web/components/form/uploader/index.jsx +2 -2
  44. package/src/web/components/form/uploader/uploader.h5.jsx +237 -0
  45. package/src/web/components/form/uploader/{uploaderPc.jsx → uploader.pc.jsx} +69 -59
  46. package/src/web/components/image/image.jsx +79 -5
  47. package/src/web/components/image/index.css +17 -0
  48. package/src/web/components/image/index.jsx +1 -0
  49. package/src/web/components/index.js +1 -1
  50. package/src/web/components/link/test/__snapshots__/storybook.test.js.snap +754 -0
  51. package/src/web/components/modal/index.jsx +3 -2
  52. package/src/web/components/richTextView/index.css +0 -10
  53. package/src/web/components/richTextView/index.jsx +1 -12
  54. package/src/web/components/tabs/index.jsx +3 -3
  55. package/src/web/components/tabs/{tabsH5.jsx → tabs.h5.jsx} +9 -47
  56. package/src/web/components/tabs/{tabsPc.jsx → tabs.pc.jsx} +13 -47
  57. package/src/web/components/uploaderView/index.jsx +1 -1
  58. package/src/web/utils/tcb.js +8 -0
  59. package/CHANGELOG.md +0 -240
  60. package/src/.DS_Store +0 -0
  61. package/src/configs/components/markdown.json +0 -17
  62. package/src/mp/.gitignore +0 -10
  63. package/src/mp/components/markdown/index.js +0 -27
  64. package/src/mp/components/markdown/index.json +0 -6
  65. package/src/mp/components/markdown/index.wxml +0 -1
  66. package/src/mp/components/markdown/towxml/audio-player/Audio.js +0 -99
  67. package/src/mp/components/markdown/towxml/audio-player/audio-player.js +0 -102
  68. package/src/mp/components/markdown/towxml/audio-player/audio-player.json +0 -5
  69. package/src/mp/components/markdown/towxml/audio-player/audio-player.wxml +0 -14
  70. package/src/mp/components/markdown/towxml/audio-player/audio-player.wxss +0 -175
  71. package/src/mp/components/markdown/towxml/audio-player/loading.svg +0 -1
  72. package/src/mp/components/markdown/towxml/config.js +0 -285
  73. package/src/mp/components/markdown/towxml/decode.js +0 -26
  74. package/src/mp/components/markdown/towxml/decode.json +0 -12
  75. package/src/mp/components/markdown/towxml/decode.wxml +0 -1
  76. package/src/mp/components/markdown/towxml/decode.wxss +0 -0
  77. package/src/mp/components/markdown/towxml/img/img.js +0 -98
  78. package/src/mp/components/markdown/towxml/img/img.json +0 -3
  79. package/src/mp/components/markdown/towxml/img/img.wxml +0 -1
  80. package/src/mp/components/markdown/towxml/img/img.wxss +0 -0
  81. package/src/mp/components/markdown/towxml/index.js +0 -19
  82. package/src/mp/components/markdown/towxml/latex/latex.js +0 -53
  83. package/src/mp/components/markdown/towxml/latex/latex.json +0 -5
  84. package/src/mp/components/markdown/towxml/latex/latex.wxml +0 -1
  85. package/src/mp/components/markdown/towxml/latex/latex.wxss +0 -0
  86. package/src/mp/components/markdown/towxml/parse/highlight/highlight.js +0 -729
  87. package/src/mp/components/markdown/towxml/parse/highlight/index.js +0 -7
  88. package/src/mp/components/markdown/towxml/parse/highlight/languages/bash.js +0 -91
  89. package/src/mp/components/markdown/towxml/parse/highlight/languages/c-like.js +0 -244
  90. package/src/mp/components/markdown/towxml/parse/highlight/languages/c.js +0 -20
  91. package/src/mp/components/markdown/towxml/parse/highlight/languages/css.js +0 -138
  92. package/src/mp/components/markdown/towxml/parse/highlight/languages/dart.js +0 -135
  93. package/src/mp/components/markdown/towxml/parse/highlight/languages/go.js +0 -57
  94. package/src/mp/components/markdown/towxml/parse/highlight/languages/htmlbars.js +0 -79
  95. package/src/mp/components/markdown/towxml/parse/highlight/languages/java.js +0 -126
  96. package/src/mp/components/markdown/towxml/parse/highlight/languages/javascript.js +0 -263
  97. package/src/mp/components/markdown/towxml/parse/highlight/languages/json.js +0 -51
  98. package/src/mp/components/markdown/towxml/parse/highlight/languages/less.js +0 -177
  99. package/src/mp/components/markdown/towxml/parse/highlight/languages/nginx.js +0 -103
  100. package/src/mp/components/markdown/towxml/parse/highlight/languages/php.js +0 -152
  101. package/src/mp/components/markdown/towxml/parse/highlight/languages/python-repl.js +0 -27
  102. package/src/mp/components/markdown/towxml/parse/highlight/languages/python.js +0 -146
  103. package/src/mp/components/markdown/towxml/parse/highlight/languages/scss.js +0 -137
  104. package/src/mp/components/markdown/towxml/parse/highlight/languages/shell.js +0 -23
  105. package/src/mp/components/markdown/towxml/parse/highlight/languages/typescript.js +0 -198
  106. package/src/mp/components/markdown/towxml/parse/highlight/languages/xml.js +0 -143
  107. package/src/mp/components/markdown/towxml/parse/highlight/style/github.wxss +0 -99
  108. package/src/mp/components/markdown/towxml/parse/highlight/style/monokai.wxss +0 -70
  109. package/src/mp/components/markdown/towxml/parse/index.js +0 -106
  110. package/src/mp/components/markdown/towxml/parse/markdown/index.js +0 -53
  111. package/src/mp/components/markdown/towxml/parse/markdown/markdown.js +0 -5834
  112. package/src/mp/components/markdown/towxml/parse/markdown/plugins/emoji.js +0 -1773
  113. package/src/mp/components/markdown/towxml/parse/markdown/plugins/ins.js +0 -120
  114. package/src/mp/components/markdown/towxml/parse/markdown/plugins/latex.js +0 -193
  115. package/src/mp/components/markdown/towxml/parse/markdown/plugins/mark.js +0 -120
  116. package/src/mp/components/markdown/towxml/parse/markdown/plugins/sub.js +0 -95
  117. package/src/mp/components/markdown/towxml/parse/markdown/plugins/sup.js +0 -95
  118. package/src/mp/components/markdown/towxml/parse/markdown/plugins/todo.js +0 -220
  119. package/src/mp/components/markdown/towxml/parse/markdown/plugins/yuml.js +0 -18
  120. package/src/mp/components/markdown/towxml/parse/parse2/Parser.js +0 -263
  121. package/src/mp/components/markdown/towxml/parse/parse2/Tokenizer.js +0 -507
  122. package/src/mp/components/markdown/towxml/parse/parse2/domhandler/index.js +0 -104
  123. package/src/mp/components/markdown/towxml/parse/parse2/domhandler/node.js +0 -169
  124. package/src/mp/components/markdown/towxml/parse/parse2/entities/decode.js +0 -54
  125. package/src/mp/components/markdown/towxml/parse/parse2/entities/decode_codepoint.js +0 -19
  126. package/src/mp/components/markdown/towxml/parse/parse2/entities/encode.js +0 -54
  127. package/src/mp/components/markdown/towxml/parse/parse2/entities/index.js +0 -30
  128. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/decode.js +0 -31
  129. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/entities.js +0 -2128
  130. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/legacy.js +0 -109
  131. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/xml.js +0 -2
  132. package/src/mp/components/markdown/towxml/parse/parse2/index.js +0 -8
  133. package/src/mp/components/markdown/towxml/style/main.wxss +0 -378
  134. package/src/mp/components/markdown/towxml/style/theme/dark.wxss +0 -73
  135. package/src/mp/components/markdown/towxml/style/theme/light.wxss +0 -63
  136. package/src/mp/components/markdown/towxml/table/table.js +0 -11
  137. package/src/mp/components/markdown/towxml/table/table.json +0 -6
  138. package/src/mp/components/markdown/towxml/table/table.wxml +0 -24
  139. package/src/mp/components/markdown/towxml/table/table.wxss +0 -0
  140. package/src/mp/components/markdown/towxml/todogroup/todogroup.js +0 -19
  141. package/src/mp/components/markdown/towxml/todogroup/todogroup.json +0 -6
  142. package/src/mp/components/markdown/towxml/todogroup/todogroup.wxml +0 -13
  143. package/src/mp/components/markdown/towxml/todogroup/todogroup.wxss +0 -3
  144. package/src/mp/components/markdown/towxml/towxml.js +0 -17
  145. package/src/mp/components/markdown/towxml/towxml.json +0 -6
  146. package/src/mp/components/markdown/towxml/towxml.wxml +0 -5
  147. package/src/mp/components/markdown/towxml/towxml.wxss +0 -8
  148. package/src/mp/components/markdown/towxml/yuml/yuml.js +0 -51
  149. package/src/mp/components/markdown/towxml/yuml/yuml.json +0 -5
  150. package/src/mp/components/markdown/towxml/yuml/yuml.wxml +0 -5
  151. package/src/mp/components/markdown/towxml/yuml/yuml.wxss +0 -0
  152. package/src/web/.DS_Store +0 -0
  153. package/src/web/components/form/uploader/uploaderH5.jsx +0 -208
  154. package/src/web/components/markdown/index.jsx +0 -40
  155. package/src/web/wedatheme/.git +0 -1
  156. package/src/web/wedatheme/.gitignore +0 -5
  157. package/src/web/wedatheme/.npmrc +0 -1
  158. package/src/web/wedatheme/package-lock.json +0 -14335
@@ -1,103 +0,0 @@
1
- /*
2
- Language: Nginx config
3
- Author: Peter Leonov <gojpeg@yandex.ru>
4
- Contributors: Ivan Sagalaev <maniac@softwaremaniacs.org>
5
- Category: common, config
6
- Website: https://www.nginx.com
7
- */
8
-
9
- export default function (hljs) {
10
- const VAR = {
11
- className: 'variable',
12
- variants: [{ begin: /\$\d+/ }, { begin: /\$\{/, end: /}/ }, { begin: `[\\$\\@]${hljs.UNDERSCORE_IDENT_RE}` }],
13
- };
14
- const DEFAULT = {
15
- endsWithParent: true,
16
- lexemes: '[a-z/_]+',
17
- keywords: {
18
- literal:
19
- 'on off yes no true false none blocked debug info notice warn error crit ' +
20
- 'select break last permanent redirect kqueue rtsig epoll poll /dev/poll',
21
- },
22
- relevance: 0,
23
- illegal: '=>',
24
- contains: [
25
- hljs.HASH_COMMENT_MODE,
26
- {
27
- className: 'string',
28
- contains: [hljs.BACKSLASH_ESCAPE, VAR],
29
- variants: [
30
- { begin: /"/, end: /"/ },
31
- { begin: /'/, end: /'/ },
32
- ],
33
- },
34
- // this swallows entire URLs to avoid detecting numbers within
35
- {
36
- begin: '([a-z]+):/',
37
- end: '\\s',
38
- endsWithParent: true,
39
- excludeEnd: true,
40
- contains: [VAR],
41
- },
42
- {
43
- className: 'regexp',
44
- contains: [hljs.BACKSLASH_ESCAPE, VAR],
45
- variants: [
46
- { begin: '\\s\\^', end: '\\s|{|;', returnEnd: true },
47
- // regexp locations (~, ~*)
48
- { begin: '~\\*?\\s+', end: '\\s|{|;', returnEnd: true },
49
- // *.example.com
50
- { begin: '\\*(\\.[a-z\\-]+)+' },
51
- // sub.example.*
52
- { begin: '([a-z\\-]+\\.)+\\*' },
53
- ],
54
- },
55
- // IP
56
- {
57
- className: 'number',
58
- begin: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b',
59
- },
60
- // units
61
- {
62
- className: 'number',
63
- begin: '\\b\\d+[kKmMgGdshdwy]*\\b',
64
- relevance: 0,
65
- },
66
- VAR,
67
- ],
68
- };
69
-
70
- return {
71
- name: 'Nginx config',
72
- aliases: ['nginxconf'],
73
- contains: [
74
- hljs.HASH_COMMENT_MODE,
75
- {
76
- begin: `${hljs.UNDERSCORE_IDENT_RE}\\s+{`,
77
- returnBegin: true,
78
- end: '{',
79
- contains: [
80
- {
81
- className: 'section',
82
- begin: hljs.UNDERSCORE_IDENT_RE,
83
- },
84
- ],
85
- relevance: 0,
86
- },
87
- {
88
- begin: `${hljs.UNDERSCORE_IDENT_RE}\\s`,
89
- end: ';|{',
90
- returnBegin: true,
91
- contains: [
92
- {
93
- className: 'attribute',
94
- begin: hljs.UNDERSCORE_IDENT_RE,
95
- starts: DEFAULT,
96
- },
97
- ],
98
- relevance: 0,
99
- },
100
- ],
101
- illegal: '[^\\s\\}]',
102
- };
103
- }
@@ -1,152 +0,0 @@
1
- /*
2
- Language: PHP
3
- Author: Victor Karamzin <Victor.Karamzin@enterra-inc.com>
4
- Contributors: Evgeny Stepanischev <imbolk@gmail.com>, Ivan Sagalaev <maniac@softwaremaniacs.org>
5
- Website: https://www.php.net
6
- Category: common
7
- */
8
-
9
- export default function (hljs) {
10
- const VARIABLE = {
11
- begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*',
12
- };
13
- const PREPROCESSOR = {
14
- className: 'meta',
15
- variants: [
16
- { begin: /<\?php/, relevance: 10 }, // boost for obvious PHP
17
- { begin: /<\?[=]?/ },
18
- { begin: /\?>/ }, // end php tag
19
- ],
20
- };
21
- const STRING = {
22
- className: 'string',
23
- contains: [hljs.BACKSLASH_ESCAPE, PREPROCESSOR],
24
- variants: [
25
- {
26
- begin: 'b"',
27
- end: '"',
28
- },
29
- {
30
- begin: "b'",
31
- end: "'",
32
- },
33
- hljs.inherit(hljs.APOS_STRING_MODE, { illegal: null }),
34
- hljs.inherit(hljs.QUOTE_STRING_MODE, { illegal: null }),
35
- ],
36
- };
37
- const NUMBER = { variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE] };
38
- const KEYWORDS = {
39
- keyword:
40
- // Magic constants:
41
- // <https://www.php.net/manual/en/language.constants.predefined.php>
42
- '__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ ' +
43
- // Function that look like language construct or language construct that look like function:
44
- // List of keywords that may not require parenthesis
45
- 'die echo exit include include_once print require require_once ' +
46
- // These are not language construct (function) but operate on the currently-executing function and can access the current symbol table
47
- // 'compact extract func_get_arg func_get_args func_num_args get_called_class get_parent_class ' +
48
- // Other keywords:
49
- // <https://www.php.net/manual/en/reserved.php>
50
- // <https://www.php.net/manual/en/language.types.type-juggling.php>
51
- 'array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list new object or private protected public real return string switch throw trait try unset use var void while xor yield',
52
- literal: 'false null true',
53
- built_in:
54
- // Standard PHP library:
55
- // <https://www.php.net/manual/en/book.spl.php>
56
- 'Error|0 ' + // error is too common a name esp since PHP is case in-sensitive
57
- 'AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException ' +
58
- // Reserved interfaces:
59
- // <https://www.php.net/manual/en/reserved.interfaces.php>
60
- 'ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Throwable Traversable WeakReference ' +
61
- // Reserved classes:
62
- // <https://www.php.net/manual/en/reserved.classes.php>
63
- 'Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass',
64
- };
65
- return {
66
- aliases: ['php', 'php3', 'php4', 'php5', 'php6', 'php7'],
67
- case_insensitive: true,
68
- keywords: KEYWORDS,
69
- contains: [
70
- hljs.HASH_COMMENT_MODE,
71
- hljs.COMMENT('//', '$', { contains: [PREPROCESSOR] }),
72
- hljs.COMMENT('/\\*', '\\*/', {
73
- contains: [
74
- {
75
- className: 'doctag',
76
- begin: '@[A-Za-z]+',
77
- },
78
- ],
79
- }),
80
- hljs.COMMENT('__halt_compiler.+?;', false, {
81
- endsWithParent: true,
82
- keywords: '__halt_compiler',
83
- lexemes: hljs.UNDERSCORE_IDENT_RE,
84
- }),
85
- {
86
- className: 'string',
87
- begin: /<<<['"]?\w+['"]?$/,
88
- end: /^\w+;?$/,
89
- contains: [
90
- hljs.BACKSLASH_ESCAPE,
91
- {
92
- className: 'subst',
93
- variants: [{ begin: /\$\w+/ }, { begin: /\{\$/, end: /\}/ }],
94
- },
95
- ],
96
- },
97
- PREPROCESSOR,
98
- {
99
- className: 'keyword',
100
- begin: /\$this\b/,
101
- },
102
- VARIABLE,
103
- {
104
- // swallow composed identifiers to avoid parsing them as keywords
105
- begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,
106
- },
107
- {
108
- className: 'function',
109
- beginKeywords: 'fn function',
110
- end: /[;{]/,
111
- excludeEnd: true,
112
- illegal: '[$%\\[]',
113
- contains: [
114
- hljs.UNDERSCORE_TITLE_MODE,
115
- {
116
- className: 'params',
117
- begin: '\\(',
118
- end: '\\)',
119
- excludeBegin: true,
120
- excludeEnd: true,
121
- keywords: KEYWORDS,
122
- contains: ['self', VARIABLE, hljs.C_BLOCK_COMMENT_MODE, STRING, NUMBER],
123
- },
124
- ],
125
- },
126
- {
127
- className: 'class',
128
- beginKeywords: 'class interface',
129
- end: '{',
130
- excludeEnd: true,
131
- illegal: /[:\(\$"]/,
132
- contains: [{ beginKeywords: 'extends implements' }, hljs.UNDERSCORE_TITLE_MODE],
133
- },
134
- {
135
- beginKeywords: 'namespace',
136
- end: ';',
137
- illegal: /[\.']/,
138
- contains: [hljs.UNDERSCORE_TITLE_MODE],
139
- },
140
- {
141
- beginKeywords: 'use',
142
- end: ';',
143
- contains: [hljs.UNDERSCORE_TITLE_MODE],
144
- },
145
- {
146
- begin: '=>', // No markup, just a relevance booster
147
- },
148
- STRING,
149
- NUMBER,
150
- ],
151
- };
152
- }
@@ -1,27 +0,0 @@
1
- /*
2
- Language: Python REPL
3
- Requires: python.js
4
- Author: Josh Goebel <hello@joshgoebel.com>
5
- Category: common
6
- */
7
-
8
- export default function (hljs) {
9
- return {
10
- aliases: ['pycon'],
11
- contains: [
12
- {
13
- className: 'meta',
14
- starts: {
15
- // a space separates the REPL prefix from the actual code
16
- // this is purely for cleaner HTML output
17
- end: / |$/,
18
- starts: {
19
- end: '$',
20
- subLanguage: 'python',
21
- },
22
- },
23
- variants: [{ begin: /^>>>(?=[ ]|$)/ }, { begin: /^\.\.\.(?=[ ]|$)/ }],
24
- },
25
- ],
26
- };
27
- }
@@ -1,146 +0,0 @@
1
- /*
2
- Language: Python
3
- Description: Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.
4
- Website: https://www.python.org
5
- Category: common
6
- */
7
-
8
- export default function (hljs) {
9
- const KEYWORDS = {
10
- keyword:
11
- 'and elif is global as in if from raise for except finally print import pass return ' +
12
- 'exec else break not with class assert yield try while continue del or def lambda ' +
13
- 'async await nonlocal|10',
14
- built_in: 'Ellipsis NotImplemented',
15
- literal: 'False None True',
16
- };
17
- const PROMPT = {
18
- className: 'meta',
19
- begin: /^(>>>|\.\.\.) /,
20
- };
21
- const SUBST = {
22
- className: 'subst',
23
- begin: /\{/,
24
- end: /\}/,
25
- keywords: KEYWORDS,
26
- illegal: /#/,
27
- };
28
- const LITERAL_BRACKET = {
29
- begin: /\{\{/,
30
- relevance: 0,
31
- };
32
- const STRING = {
33
- className: 'string',
34
- contains: [hljs.BACKSLASH_ESCAPE],
35
- variants: [
36
- {
37
- begin: /(u|b)?r?'''/,
38
- end: /'''/,
39
- contains: [hljs.BACKSLASH_ESCAPE, PROMPT],
40
- relevance: 10,
41
- },
42
- {
43
- begin: /(u|b)?r?"""/,
44
- end: /"""/,
45
- contains: [hljs.BACKSLASH_ESCAPE, PROMPT],
46
- relevance: 10,
47
- },
48
- {
49
- begin: /(fr|rf|f)'''/,
50
- end: /'''/,
51
- contains: [hljs.BACKSLASH_ESCAPE, PROMPT, LITERAL_BRACKET, SUBST],
52
- },
53
- {
54
- begin: /(fr|rf|f)"""/,
55
- end: /"""/,
56
- contains: [hljs.BACKSLASH_ESCAPE, PROMPT, LITERAL_BRACKET, SUBST],
57
- },
58
- {
59
- begin: /(u|r|ur)'/,
60
- end: /'/,
61
- relevance: 10,
62
- },
63
- {
64
- begin: /(u|r|ur)"/,
65
- end: /"/,
66
- relevance: 10,
67
- },
68
- {
69
- begin: /(b|br)'/,
70
- end: /'/,
71
- },
72
- {
73
- begin: /(b|br)"/,
74
- end: /"/,
75
- },
76
- {
77
- begin: /(fr|rf|f)'/,
78
- end: /'/,
79
- contains: [hljs.BACKSLASH_ESCAPE, LITERAL_BRACKET, SUBST],
80
- },
81
- {
82
- begin: /(fr|rf|f)"/,
83
- end: /"/,
84
- contains: [hljs.BACKSLASH_ESCAPE, LITERAL_BRACKET, SUBST],
85
- },
86
- hljs.APOS_STRING_MODE,
87
- hljs.QUOTE_STRING_MODE,
88
- ],
89
- };
90
- const NUMBER = {
91
- className: 'number',
92
- relevance: 0,
93
- variants: [
94
- { begin: `${hljs.BINARY_NUMBER_RE}[lLjJ]?` },
95
- { begin: '\\b(0o[0-7]+)[lLjJ]?' },
96
- { begin: `${hljs.C_NUMBER_RE}[lLjJ]?` },
97
- ],
98
- };
99
- const PARAMS = {
100
- className: 'params',
101
- begin: /\(/,
102
- end: /\)/,
103
- contains: ['self', PROMPT, NUMBER, STRING, hljs.HASH_COMMENT_MODE],
104
- };
105
- SUBST.contains = [STRING, NUMBER, PROMPT];
106
- return {
107
- name: 'Python',
108
- aliases: ['py', 'gyp', 'ipython'],
109
- keywords: KEYWORDS,
110
- illegal: /(<\/|->|\?)|=>/,
111
- contains: [
112
- PROMPT,
113
- NUMBER,
114
- // eat "if" prior to string so that it won't accidentally be
115
- // labeled as an f-string as in:
116
- { beginKeywords: 'if', relevance: 0 },
117
- STRING,
118
- hljs.HASH_COMMENT_MODE,
119
- {
120
- variants: [
121
- { className: 'function', beginKeywords: 'def' },
122
- { className: 'class', beginKeywords: 'class' },
123
- ],
124
- end: /:/,
125
- illegal: /[${=;\n,]/,
126
- contains: [
127
- hljs.UNDERSCORE_TITLE_MODE,
128
- PARAMS,
129
- {
130
- begin: /->/,
131
- endsWithParent: true,
132
- keywords: 'None',
133
- },
134
- ],
135
- },
136
- {
137
- className: 'meta',
138
- begin: /^[\t ]*@/,
139
- end: /$/,
140
- },
141
- {
142
- begin: /\b(print|exec)\(/, // don’t highlight keywords-turned-functions in Python 3
143
- },
144
- ],
145
- };
146
- }
@@ -1,137 +0,0 @@
1
- /*
2
- Language: SCSS
3
- Description: Scss is an extension of the syntax of CSS.
4
- Author: Kurt Emch <kurt@kurtemch.com>
5
- Website: https://sass-lang.com
6
- Category: common, css
7
- */
8
- export default function (hljs) {
9
- const AT_IDENTIFIER = '@[a-z-]+'; // @font-face
10
- const AT_MODIFIERS = 'and or not only';
11
- const IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
12
- const VARIABLE = {
13
- className: 'variable',
14
- begin: `(\\$${IDENT_RE})\\b`,
15
- };
16
- const HEXCOLOR = {
17
- className: 'number',
18
- begin: '#[0-9A-Fa-f]+',
19
- };
20
- const DEF_INTERNALS = {
21
- className: 'attribute',
22
- begin: '[A-Z\\_\\.\\-]+',
23
- end: ':',
24
- excludeEnd: true,
25
- illegal: '[^\\s]',
26
- starts: {
27
- endsWithParent: true,
28
- excludeEnd: true,
29
- contains: [
30
- HEXCOLOR,
31
- hljs.CSS_NUMBER_MODE,
32
- hljs.QUOTE_STRING_MODE,
33
- hljs.APOS_STRING_MODE,
34
- hljs.C_BLOCK_COMMENT_MODE,
35
- {
36
- className: 'meta',
37
- begin: '!important',
38
- },
39
- ],
40
- },
41
- };
42
- return {
43
- name: 'SCSS',
44
- case_insensitive: true,
45
- illegal: "[=/|']",
46
- contains: [
47
- hljs.C_LINE_COMMENT_MODE,
48
- hljs.C_BLOCK_COMMENT_MODE,
49
- {
50
- className: 'selector-id',
51
- begin: '\\#[A-Za-z0-9_-]+',
52
- relevance: 0,
53
- },
54
- {
55
- className: 'selector-class',
56
- begin: '\\.[A-Za-z0-9_-]+',
57
- relevance: 0,
58
- },
59
- {
60
- className: 'selector-attr',
61
- begin: '\\[',
62
- end: '\\]',
63
- illegal: '$',
64
- },
65
- {
66
- className: 'selector-tag', // begin: IDENT_RE, end: '[,|\\s]'
67
- begin:
68
- '\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b',
69
- relevance: 0,
70
- },
71
- {
72
- className: 'selector-pseudo',
73
- begin:
74
- ':(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)',
75
- },
76
- {
77
- className: 'selector-pseudo',
78
- begin: '::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)',
79
- },
80
- VARIABLE,
81
- {
82
- className: 'attribute',
83
- begin:
84
- '\\b(src|z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b',
85
- illegal: '[^\\s]',
86
- },
87
- {
88
- begin:
89
- '\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b',
90
- },
91
- {
92
- begin: ':',
93
- end: ';',
94
- contains: [
95
- VARIABLE,
96
- HEXCOLOR,
97
- hljs.CSS_NUMBER_MODE,
98
- hljs.QUOTE_STRING_MODE,
99
- hljs.APOS_STRING_MODE,
100
- {
101
- className: 'meta',
102
- begin: '!important',
103
- },
104
- ],
105
- },
106
- // matching these here allows us to treat them more like regular CSS
107
- // rules so everything between the {} gets regular rule highlighting,
108
- // which is what we want for page and font-face
109
- {
110
- begin: '@(page|font-face)',
111
- lexemes: AT_IDENTIFIER,
112
- keywords: '@page @font-face',
113
- },
114
- {
115
- begin: '@',
116
- end: '[{;]',
117
- returnBegin: true,
118
- keywords: AT_MODIFIERS,
119
- contains: [
120
- {
121
- begin: AT_IDENTIFIER,
122
- className: 'keyword',
123
- },
124
- VARIABLE,
125
- hljs.QUOTE_STRING_MODE,
126
- hljs.APOS_STRING_MODE,
127
- HEXCOLOR,
128
- hljs.CSS_NUMBER_MODE,
129
- // {
130
- // begin: '\\s[A-Za-z0-9_.-]+',
131
- // relevance: 0
132
- // }
133
- ],
134
- },
135
- ],
136
- };
137
- }
@@ -1,23 +0,0 @@
1
- /*
2
- Language: Shell Session
3
- Requires: bash.js
4
- Author: TSUYUSATO Kitsune <make.just.on@gmail.com>
5
- Category: common
6
- */
7
-
8
- export default function (hljs) {
9
- return {
10
- name: 'Shell Session',
11
- aliases: ['console'],
12
- contains: [
13
- {
14
- className: 'meta',
15
- begin: '^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]',
16
- starts: {
17
- end: '$',
18
- subLanguage: 'bash',
19
- },
20
- },
21
- ],
22
- };
23
- }