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

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 (156) hide show
  1. package/README.md +2 -38
  2. package/package.json +1 -2
  3. package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +0 -16
  4. package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +0 -4
  5. package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +0 -26
  6. package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +0 -4
  7. package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue.mjs +0 -7
  8. package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue2.mjs +0 -49
  9. package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue3.mjs +0 -4
  10. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue.mjs +0 -7
  11. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue2.mjs +0 -94
  12. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue3.mjs +0 -4
  13. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue.mjs +0 -7
  14. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue2.mjs +0 -33
  15. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue3.mjs +0 -4
  16. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue.mjs +0 -7
  17. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue2.mjs +0 -140
  18. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue3.mjs +0 -4
  19. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue.mjs +0 -7
  20. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue2.mjs +0 -131
  21. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue3.mjs +0 -4
  22. package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +0 -7
  23. package/dist/es/KgCopilot/CopiFooter/index.vue2.mjs +0 -21
  24. package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +0 -4
  25. package/dist/es/KgCopilot/dialogue.vue.mjs +0 -7
  26. package/dist/es/KgCopilot/dialogue.vue2.mjs +0 -131
  27. package/dist/es/KgCopilot/dialogue.vue3.mjs +0 -4
  28. package/dist/es/KgCopilot/index.vue.mjs +0 -7
  29. package/dist/es/KgCopilot/index.vue2.mjs +0 -49
  30. package/dist/es/KgCopilot/index.vue3.mjs +0 -4
  31. package/dist/es/KgCopilot/mdInCode.mjs +0 -56
  32. package/dist/es/KgCopilot/readMd.vue.mjs +0 -7
  33. package/dist/es/KgCopilot/readMd.vue2.mjs +0 -87
  34. package/dist/es/KgCopilot/readMd.vue3.mjs +0 -4
  35. package/dist/es/ReIcon/index.mjs +0 -11
  36. package/dist/es/ReIcon/src/iconfont.mjs +0 -46
  37. package/dist/es/ReIcon/src/iconifyIconOffline.mjs +0 -30
  38. package/dist/es/ReIcon/src/iconifyIconOnline.mjs +0 -29
  39. package/dist/es/_virtual/___vite-browser-external.mjs +0 -6
  40. package/dist/es/_virtual/__vite-browser-external.mjs +0 -4
  41. package/dist/es/_virtual/_commonjsHelpers.mjs +0 -34
  42. package/dist/es/_virtual/_plugin-vue_export-helper.mjs +0 -10
  43. package/dist/es/_virtual/index.mjs +0 -13
  44. package/dist/es/api/project.mjs +0 -51
  45. package/dist/es/directives/heighlight/index.mjs +0 -69
  46. package/dist/es/directives/index.mjs +0 -4
  47. package/dist/es/home/LFilter/FilterArea.vue.mjs +0 -7
  48. package/dist/es/home/LFilter/FilterArea.vue2.mjs +0 -507
  49. package/dist/es/home/LFilter/FilterArea.vue3.mjs +0 -4
  50. package/dist/es/home/LFilter/FilterHead.vue.mjs +0 -129
  51. package/dist/es/home/LFilter/FilterHead.vue2.mjs +0 -4
  52. package/dist/es/home/LFilter/FilterItem.vue.mjs +0 -7
  53. package/dist/es/home/LFilter/FilterItem.vue2.mjs +0 -114
  54. package/dist/es/home/LFilter/FilterItem.vue3.mjs +0 -4
  55. package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +0 -7
  56. package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +0 -171
  57. package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +0 -4
  58. package/dist/es/home/LFilter/index.vue.mjs +0 -17
  59. package/dist/es/home/LFilter/index.vue2.mjs +0 -4
  60. package/dist/es/home/LProject/index.vue.mjs +0 -7
  61. package/dist/es/home/LProject/index.vue2.mjs +0 -70
  62. package/dist/es/home/LProject/index.vue3.mjs +0 -4
  63. package/dist/es/home/index.vue.mjs +0 -7
  64. package/dist/es/home/index.vue2.mjs +0 -80
  65. package/dist/es/home/index.vue3.mjs +0 -4
  66. package/dist/es/index.mjs +0 -36
  67. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/check.mjs +0 -8
  68. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/circle-plus.mjs +0 -8
  69. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/close.mjs +0 -8
  70. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/microphone.mjs +0 -8
  71. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/paperclip.mjs +0 -8
  72. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs +0 -8
  73. package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/upload.mjs +0 -8
  74. package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/copy-simple.mjs +0 -8
  75. package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/speaker-high-light.mjs +0 -8
  76. package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-down-thin.mjs +0 -8
  77. package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-up-thin.mjs +0 -8
  78. package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/warning-bold.mjs +0 -8
  79. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/add-line.mjs +0 -8
  80. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-down-s-line.mjs +0 -8
  81. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-up-s-line.mjs +0 -8
  82. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/check-fill.mjs +0 -8
  83. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/download-line.mjs +0 -8
  84. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs +0 -8
  85. package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/iconify.mjs +0 -1702
  86. package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/offline.mjs +0 -436
  87. package/dist/es/node_modules/.pnpm/@pureadmin_utils@1.8.5_vue@3.2.45/node_modules/@pureadmin/utils/dist/index.mjs +0 -70
  88. package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/callBound.mjs +0 -16
  89. package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/index.mjs +0 -36
  90. package/dist/es/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.mjs +0 -48
  91. package/dist/es/node_modules/.pnpm/dompurify@3.0.10/node_modules/dompurify/dist/purify.es.mjs +0 -949
  92. package/dist/es/node_modules/.pnpm/es-define-property@1.0.0/node_modules/es-define-property/index.mjs +0 -22
  93. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.mjs +0 -4
  94. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.mjs +0 -4
  95. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.mjs +0 -4
  96. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.mjs +0 -4
  97. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.mjs +0 -4
  98. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.mjs +0 -4
  99. package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.mjs +0 -4
  100. package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.mjs +0 -72
  101. package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.mjs +0 -6
  102. package/dist/es/node_modules/.pnpm/get-intrinsic@1.2.4/node_modules/get-intrinsic/index.mjs +0 -320
  103. package/dist/es/node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.mjs +0 -14
  104. package/dist/es/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.mjs +0 -19
  105. package/dist/es/node_modules/.pnpm/has-proto@1.0.3/node_modules/has-proto/index.mjs +0 -11
  106. package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.mjs +0 -21
  107. package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.mjs +0 -48
  108. package/dist/es/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.mjs +0 -8
  109. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/core.mjs +0 -5
  110. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/apache.mjs +0 -91
  111. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/bash.mjs +0 -377
  112. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/basic.mjs +0 -221
  113. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/c.mjs +0 -280
  114. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/css.mjs +0 -732
  115. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dart.mjs +0 -247
  116. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/django.mjs +0 -47
  117. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dns.mjs +0 -71
  118. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dos.mjs +0 -160
  119. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dust.mjs +0 -38
  120. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/erlang.mjs +0 -176
  121. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/go.mjs +0 -135
  122. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/http.mjs +0 -89
  123. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/java.mjs +0 -254
  124. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/javascript.mjs +0 -698
  125. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/json.mjs +0 -40
  126. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/markdown.mjs +0 -227
  127. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/nginx.mjs +0 -144
  128. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/php.mjs +0 -589
  129. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/python.mjs +0 -414
  130. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/ruby.mjs +0 -414
  131. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/stylus.mjs +0 -766
  132. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/swift.mjs +0 -832
  133. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/typescript.mjs +0 -788
  134. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/xml.mjs +0 -227
  135. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/lib/core.mjs +0 -1580
  136. package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/styles/paraiso-light.css.mjs +0 -4
  137. package/dist/es/node_modules/.pnpm/marked@12.0.1/node_modules/marked/lib/marked.esm.mjs +0 -2045
  138. package/dist/es/node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/index.mjs +0 -514
  139. package/dist/es/node_modules/.pnpm/pinyin-match@1.2.4/node_modules/pinyin-match/es/main.mjs +0 -124
  140. package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/formats.mjs +0 -22
  141. package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/index.mjs +0 -14
  142. package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/parse.mjs +0 -199
  143. package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/stringify.mjs +0 -262
  144. package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/utils.mjs +0 -196
  145. package/dist/es/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.mjs +0 -54
  146. package/dist/es/node_modules/.pnpm/side-channel@1.0.6/node_modules/side-channel/index.mjs +0 -115
  147. package/dist/es/store/index.mjs +0 -8
  148. package/dist/es/store/modules/copilot.mjs +0 -108
  149. package/dist/es/store/modules/filters.mjs +0 -346
  150. package/dist/es/store/modules/types.mjs +0 -19
  151. package/dist/es/style/index.scss.mjs +0 -4
  152. package/dist/es/style/tailwind.css.mjs +0 -4
  153. package/dist/es/style.css +0 -1
  154. package/dist/es/utils/home.mjs +0 -129
  155. package/dist/es/utils/http/index.mjs +0 -90
  156. package/dist/es/utils/message.mjs +0 -42
@@ -1,414 +0,0 @@
1
- function ruby(hljs) {
2
- const regex = hljs.regex;
3
- const RUBY_METHOD_RE = "([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)";
4
- const CLASS_NAME_RE = regex.either(
5
- /\b([A-Z]+[a-z0-9]+)+/,
6
- // ends in caps
7
- /\b([A-Z]+[a-z0-9]+)+[A-Z]+/
8
- );
9
- const CLASS_NAME_WITH_NAMESPACE_RE = regex.concat(CLASS_NAME_RE, /(::\w+)*/);
10
- const PSEUDO_KWS = [
11
- "include",
12
- "extend",
13
- "prepend",
14
- "public",
15
- "private",
16
- "protected",
17
- "raise",
18
- "throw"
19
- ];
20
- const RUBY_KEYWORDS = {
21
- "variable.constant": [
22
- "__FILE__",
23
- "__LINE__",
24
- "__ENCODING__"
25
- ],
26
- "variable.language": [
27
- "self",
28
- "super"
29
- ],
30
- keyword: [
31
- "alias",
32
- "and",
33
- "begin",
34
- "BEGIN",
35
- "break",
36
- "case",
37
- "class",
38
- "defined",
39
- "do",
40
- "else",
41
- "elsif",
42
- "end",
43
- "END",
44
- "ensure",
45
- "for",
46
- "if",
47
- "in",
48
- "module",
49
- "next",
50
- "not",
51
- "or",
52
- "redo",
53
- "require",
54
- "rescue",
55
- "retry",
56
- "return",
57
- "then",
58
- "undef",
59
- "unless",
60
- "until",
61
- "when",
62
- "while",
63
- "yield",
64
- ...PSEUDO_KWS
65
- ],
66
- built_in: [
67
- "proc",
68
- "lambda",
69
- "attr_accessor",
70
- "attr_reader",
71
- "attr_writer",
72
- "define_method",
73
- "private_constant",
74
- "module_function"
75
- ],
76
- literal: [
77
- "true",
78
- "false",
79
- "nil"
80
- ]
81
- };
82
- const YARDOCTAG = {
83
- className: "doctag",
84
- begin: "@[A-Za-z]+"
85
- };
86
- const IRB_OBJECT = {
87
- begin: "#<",
88
- end: ">"
89
- };
90
- const COMMENT_MODES = [
91
- hljs.COMMENT(
92
- "#",
93
- "$",
94
- { contains: [YARDOCTAG] }
95
- ),
96
- hljs.COMMENT(
97
- "^=begin",
98
- "^=end",
99
- {
100
- contains: [YARDOCTAG],
101
- relevance: 10
102
- }
103
- ),
104
- hljs.COMMENT("^__END__", hljs.MATCH_NOTHING_RE)
105
- ];
106
- const SUBST = {
107
- className: "subst",
108
- begin: /#\{/,
109
- end: /\}/,
110
- keywords: RUBY_KEYWORDS
111
- };
112
- const STRING = {
113
- className: "string",
114
- contains: [
115
- hljs.BACKSLASH_ESCAPE,
116
- SUBST
117
- ],
118
- variants: [
119
- {
120
- begin: /'/,
121
- end: /'/
122
- },
123
- {
124
- begin: /"/,
125
- end: /"/
126
- },
127
- {
128
- begin: /`/,
129
- end: /`/
130
- },
131
- {
132
- begin: /%[qQwWx]?\(/,
133
- end: /\)/
134
- },
135
- {
136
- begin: /%[qQwWx]?\[/,
137
- end: /\]/
138
- },
139
- {
140
- begin: /%[qQwWx]?\{/,
141
- end: /\}/
142
- },
143
- {
144
- begin: /%[qQwWx]?</,
145
- end: />/
146
- },
147
- {
148
- begin: /%[qQwWx]?\//,
149
- end: /\//
150
- },
151
- {
152
- begin: /%[qQwWx]?%/,
153
- end: /%/
154
- },
155
- {
156
- begin: /%[qQwWx]?-/,
157
- end: /-/
158
- },
159
- {
160
- begin: /%[qQwWx]?\|/,
161
- end: /\|/
162
- },
163
- // in the following expressions, \B in the beginning suppresses recognition of ?-sequences
164
- // where ? is the last character of a preceding identifier, as in: `func?4`
165
- { begin: /\B\?(\\\d{1,3})/ },
166
- { begin: /\B\?(\\x[A-Fa-f0-9]{1,2})/ },
167
- { begin: /\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/ },
168
- { begin: /\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/ },
169
- { begin: /\B\?\\(c|C-)[\x20-\x7e]/ },
170
- { begin: /\B\?\\?\S/ },
171
- // heredocs
172
- {
173
- // this guard makes sure that we have an entire heredoc and not a false
174
- // positive (auto-detect, etc.)
175
- begin: regex.concat(
176
- /<<[-~]?'?/,
177
- regex.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)
178
- ),
179
- contains: [
180
- hljs.END_SAME_AS_BEGIN({
181
- begin: /(\w+)/,
182
- end: /(\w+)/,
183
- contains: [
184
- hljs.BACKSLASH_ESCAPE,
185
- SUBST
186
- ]
187
- })
188
- ]
189
- }
190
- ]
191
- };
192
- const decimal = "[1-9](_?[0-9])*|0";
193
- const digits = "[0-9](_?[0-9])*";
194
- const NUMBER = {
195
- className: "number",
196
- relevance: 0,
197
- variants: [
198
- // decimal integer/float, optionally exponential or rational, optionally imaginary
199
- { begin: `\\b(${decimal})(\\.(${digits}))?([eE][+-]?(${digits})|r)?i?\\b` },
200
- // explicit decimal/binary/octal/hexadecimal integer,
201
- // optionally rational and/or imaginary
202
- { begin: "\\b0[dD][0-9](_?[0-9])*r?i?\\b" },
203
- { begin: "\\b0[bB][0-1](_?[0-1])*r?i?\\b" },
204
- { begin: "\\b0[oO][0-7](_?[0-7])*r?i?\\b" },
205
- { begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b" },
206
- // 0-prefixed implicit octal integer, optionally rational and/or imaginary
207
- { begin: "\\b0(_?[0-7])+r?i?\\b" }
208
- ]
209
- };
210
- const PARAMS = {
211
- variants: [
212
- {
213
- match: /\(\)/
214
- },
215
- {
216
- className: "params",
217
- begin: /\(/,
218
- end: /(?=\))/,
219
- excludeBegin: true,
220
- endsParent: true,
221
- keywords: RUBY_KEYWORDS
222
- }
223
- ]
224
- };
225
- const INCLUDE_EXTEND = {
226
- match: [
227
- /(include|extend)\s+/,
228
- CLASS_NAME_WITH_NAMESPACE_RE
229
- ],
230
- scope: {
231
- 2: "title.class"
232
- },
233
- keywords: RUBY_KEYWORDS
234
- };
235
- const CLASS_DEFINITION = {
236
- variants: [
237
- {
238
- match: [
239
- /class\s+/,
240
- CLASS_NAME_WITH_NAMESPACE_RE,
241
- /\s+<\s+/,
242
- CLASS_NAME_WITH_NAMESPACE_RE
243
- ]
244
- },
245
- {
246
- match: [
247
- /\b(class|module)\s+/,
248
- CLASS_NAME_WITH_NAMESPACE_RE
249
- ]
250
- }
251
- ],
252
- scope: {
253
- 2: "title.class",
254
- 4: "title.class.inherited"
255
- },
256
- keywords: RUBY_KEYWORDS
257
- };
258
- const UPPER_CASE_CONSTANT = {
259
- relevance: 0,
260
- match: /\b[A-Z][A-Z_0-9]+\b/,
261
- className: "variable.constant"
262
- };
263
- const METHOD_DEFINITION = {
264
- match: [
265
- /def/,
266
- /\s+/,
267
- RUBY_METHOD_RE
268
- ],
269
- scope: {
270
- 1: "keyword",
271
- 3: "title.function"
272
- },
273
- contains: [
274
- PARAMS
275
- ]
276
- };
277
- const OBJECT_CREATION = {
278
- relevance: 0,
279
- match: [
280
- CLASS_NAME_WITH_NAMESPACE_RE,
281
- /\.new[. (]/
282
- ],
283
- scope: {
284
- 1: "title.class"
285
- }
286
- };
287
- const CLASS_REFERENCE = {
288
- relevance: 0,
289
- match: CLASS_NAME_RE,
290
- scope: "title.class"
291
- };
292
- const RUBY_DEFAULT_CONTAINS = [
293
- STRING,
294
- CLASS_DEFINITION,
295
- INCLUDE_EXTEND,
296
- OBJECT_CREATION,
297
- UPPER_CASE_CONSTANT,
298
- CLASS_REFERENCE,
299
- METHOD_DEFINITION,
300
- {
301
- // swallow namespace qualifiers before symbols
302
- begin: hljs.IDENT_RE + "::"
303
- },
304
- {
305
- className: "symbol",
306
- begin: hljs.UNDERSCORE_IDENT_RE + "(!|\\?)?:",
307
- relevance: 0
308
- },
309
- {
310
- className: "symbol",
311
- begin: ":(?!\\s)",
312
- contains: [
313
- STRING,
314
- { begin: RUBY_METHOD_RE }
315
- ],
316
- relevance: 0
317
- },
318
- NUMBER,
319
- {
320
- // negative-look forward attempts to prevent false matches like:
321
- // @ident@ or $ident$ that might indicate this is not ruby at all
322
- className: "variable",
323
- begin: `(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`
324
- },
325
- {
326
- className: "params",
327
- begin: /\|/,
328
- end: /\|/,
329
- excludeBegin: true,
330
- excludeEnd: true,
331
- relevance: 0,
332
- // this could be a lot of things (in other languages) other than params
333
- keywords: RUBY_KEYWORDS
334
- },
335
- {
336
- // regexp container
337
- begin: "(" + hljs.RE_STARTERS_RE + "|unless)\\s*",
338
- keywords: "unless",
339
- contains: [
340
- {
341
- className: "regexp",
342
- contains: [
343
- hljs.BACKSLASH_ESCAPE,
344
- SUBST
345
- ],
346
- illegal: /\n/,
347
- variants: [
348
- {
349
- begin: "/",
350
- end: "/[a-z]*"
351
- },
352
- {
353
- begin: /%r\{/,
354
- end: /\}[a-z]*/
355
- },
356
- {
357
- begin: "%r\\(",
358
- end: "\\)[a-z]*"
359
- },
360
- {
361
- begin: "%r!",
362
- end: "![a-z]*"
363
- },
364
- {
365
- begin: "%r\\[",
366
- end: "\\][a-z]*"
367
- }
368
- ]
369
- }
370
- ].concat(IRB_OBJECT, COMMENT_MODES),
371
- relevance: 0
372
- }
373
- ].concat(IRB_OBJECT, COMMENT_MODES);
374
- SUBST.contains = RUBY_DEFAULT_CONTAINS;
375
- PARAMS.contains = RUBY_DEFAULT_CONTAINS;
376
- const SIMPLE_PROMPT = "[>?]>";
377
- const DEFAULT_PROMPT = "[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]";
378
- const RVM_PROMPT = "(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>";
379
- const IRB_DEFAULT = [
380
- {
381
- begin: /^\s*=>/,
382
- starts: {
383
- end: "$",
384
- contains: RUBY_DEFAULT_CONTAINS
385
- }
386
- },
387
- {
388
- className: "meta.prompt",
389
- begin: "^(" + SIMPLE_PROMPT + "|" + DEFAULT_PROMPT + "|" + RVM_PROMPT + ")(?=[ ])",
390
- starts: {
391
- end: "$",
392
- keywords: RUBY_KEYWORDS,
393
- contains: RUBY_DEFAULT_CONTAINS
394
- }
395
- }
396
- ];
397
- COMMENT_MODES.unshift(IRB_OBJECT);
398
- return {
399
- name: "Ruby",
400
- aliases: [
401
- "rb",
402
- "gemspec",
403
- "podspec",
404
- "thor",
405
- "irb"
406
- ],
407
- keywords: RUBY_KEYWORDS,
408
- illegal: /\/\*/,
409
- contains: [hljs.SHEBANG({ binary: "ruby" })].concat(IRB_DEFAULT).concat(COMMENT_MODES).concat(RUBY_DEFAULT_CONTAINS)
410
- };
411
- }
412
- export {
413
- ruby as default
414
- };