ll-plus 2.10.24 → 2.10.25

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 (191) hide show
  1. package/package.json +1 -1
  2. package/theme-chalk/code-editor-vue3/addon/comment/comment.js +211 -0
  3. package/theme-chalk/code-editor-vue3/addon/comment/continuecomment.js +114 -0
  4. package/theme-chalk/code-editor-vue3/addon/dialog/dialog.css +32 -0
  5. package/theme-chalk/code-editor-vue3/addon/dialog/dialog.js +163 -0
  6. package/theme-chalk/code-editor-vue3/addon/display/autorefresh.js +47 -0
  7. package/theme-chalk/code-editor-vue3/addon/display/fullscreen.css +6 -0
  8. package/theme-chalk/code-editor-vue3/addon/display/fullscreen.js +41 -0
  9. package/theme-chalk/code-editor-vue3/addon/display/panel.js +133 -0
  10. package/theme-chalk/code-editor-vue3/addon/display/placeholder.js +78 -0
  11. package/theme-chalk/code-editor-vue3/addon/display/rulers.js +51 -0
  12. package/theme-chalk/code-editor-vue3/addon/edit/closebrackets.js +201 -0
  13. package/theme-chalk/code-editor-vue3/addon/edit/closetag.js +185 -0
  14. package/theme-chalk/code-editor-vue3/addon/edit/continuelist.js +101 -0
  15. package/theme-chalk/code-editor-vue3/addon/edit/matchbrackets.js +160 -0
  16. package/theme-chalk/code-editor-vue3/addon/edit/matchtags.js +66 -0
  17. package/theme-chalk/code-editor-vue3/addon/edit/trailingspace.js +27 -0
  18. package/theme-chalk/code-editor-vue3/addon/fold/brace-fold.js +119 -0
  19. package/theme-chalk/code-editor-vue3/addon/fold/comment-fold.js +59 -0
  20. package/theme-chalk/code-editor-vue3/addon/fold/foldcode.js +159 -0
  21. package/theme-chalk/code-editor-vue3/addon/fold/foldgutter.css +20 -0
  22. package/theme-chalk/code-editor-vue3/addon/fold/foldgutter.js +169 -0
  23. package/theme-chalk/code-editor-vue3/addon/fold/indent-fold.js +48 -0
  24. package/theme-chalk/code-editor-vue3/addon/fold/markdown-fold.js +49 -0
  25. package/theme-chalk/code-editor-vue3/addon/fold/xml-fold.js +184 -0
  26. package/theme-chalk/code-editor-vue3/addon/hint/anyword-hint.js +41 -0
  27. package/theme-chalk/code-editor-vue3/addon/hint/css-hint.js +66 -0
  28. package/theme-chalk/code-editor-vue3/addon/hint/html-hint.js +351 -0
  29. package/theme-chalk/code-editor-vue3/addon/hint/javascript-hint.js +162 -0
  30. package/theme-chalk/code-editor-vue3/addon/hint/show-hint.css +37 -0
  31. package/theme-chalk/code-editor-vue3/addon/hint/show-hint.js +523 -0
  32. package/theme-chalk/code-editor-vue3/addon/hint/sql-hint.js +304 -0
  33. package/theme-chalk/code-editor-vue3/addon/hint/xml-hint.js +132 -0
  34. package/theme-chalk/code-editor-vue3/addon/lint/coffeescript-lint.js +47 -0
  35. package/theme-chalk/code-editor-vue3/addon/lint/css-lint.js +40 -0
  36. package/theme-chalk/code-editor-vue3/addon/lint/html-lint.js +59 -0
  37. package/theme-chalk/code-editor-vue3/addon/lint/javascript-lint.js +65 -0
  38. package/theme-chalk/code-editor-vue3/addon/lint/json-lint.js +40 -0
  39. package/theme-chalk/code-editor-vue3/addon/lint/lint.css +79 -0
  40. package/theme-chalk/code-editor-vue3/addon/lint/lint.js +288 -0
  41. package/theme-chalk/code-editor-vue3/addon/lint/yaml-lint.js +41 -0
  42. package/theme-chalk/code-editor-vue3/addon/merge/merge.css +119 -0
  43. package/theme-chalk/code-editor-vue3/addon/merge/merge.js +1018 -0
  44. package/theme-chalk/code-editor-vue3/addon/mode/loadmode.js +66 -0
  45. package/theme-chalk/code-editor-vue3/addon/mode/multiplex.js +136 -0
  46. package/theme-chalk/code-editor-vue3/addon/mode/multiplex_test.js +49 -0
  47. package/theme-chalk/code-editor-vue3/addon/mode/overlay.js +90 -0
  48. package/theme-chalk/code-editor-vue3/addon/mode/simple.js +216 -0
  49. package/theme-chalk/code-editor-vue3/addon/runmode/colorize.js +40 -0
  50. package/theme-chalk/code-editor-vue3/addon/runmode/runmode-standalone.js +334 -0
  51. package/theme-chalk/code-editor-vue3/addon/runmode/runmode.js +76 -0
  52. package/theme-chalk/code-editor-vue3/addon/runmode/runmode.node.js +329 -0
  53. package/theme-chalk/code-editor-vue3/addon/scroll/annotatescrollbar.js +128 -0
  54. package/theme-chalk/code-editor-vue3/addon/scroll/scrollpastend.js +48 -0
  55. package/theme-chalk/code-editor-vue3/addon/scroll/simplescrollbars.css +66 -0
  56. package/theme-chalk/code-editor-vue3/addon/scroll/simplescrollbars.js +152 -0
  57. package/theme-chalk/code-editor-vue3/addon/search/jump-to-line.js +53 -0
  58. package/theme-chalk/code-editor-vue3/addon/search/match-highlighter.js +167 -0
  59. package/theme-chalk/code-editor-vue3/addon/search/matchesonscrollbar.css +8 -0
  60. package/theme-chalk/code-editor-vue3/addon/search/matchesonscrollbar.js +97 -0
  61. package/theme-chalk/code-editor-vue3/addon/search/search.js +295 -0
  62. package/theme-chalk/code-editor-vue3/addon/search/searchcursor.js +305 -0
  63. package/theme-chalk/code-editor-vue3/addon/selection/active-line.js +72 -0
  64. package/theme-chalk/code-editor-vue3/addon/selection/mark-selection.js +119 -0
  65. package/theme-chalk/code-editor-vue3/addon/selection/selection-pointer.js +98 -0
  66. package/theme-chalk/code-editor-vue3/addon/tern/tern.css +87 -0
  67. package/theme-chalk/code-editor-vue3/addon/tern/tern.js +756 -0
  68. package/theme-chalk/code-editor-vue3/addon/tern/worker.js +44 -0
  69. package/theme-chalk/code-editor-vue3/addon/wrap/hardwrap.js +160 -0
  70. package/theme-chalk/code-editor-vue3/lib/codemirror.css +344 -0
  71. package/theme-chalk/code-editor-vue3/lib/codemirror.js +9884 -0
  72. package/theme-chalk/code-editor-vue3/mode/apl/apl.js +174 -0
  73. package/theme-chalk/code-editor-vue3/mode/asciiarmor/asciiarmor.js +74 -0
  74. package/theme-chalk/code-editor-vue3/mode/asn.1/asn.1.js +204 -0
  75. package/theme-chalk/code-editor-vue3/mode/asterisk/asterisk.js +220 -0
  76. package/theme-chalk/code-editor-vue3/mode/brainfuck/brainfuck.js +85 -0
  77. package/theme-chalk/code-editor-vue3/mode/clike/clike.js +942 -0
  78. package/theme-chalk/code-editor-vue3/mode/clojure/clojure.js +293 -0
  79. package/theme-chalk/code-editor-vue3/mode/cmake/cmake.js +97 -0
  80. package/theme-chalk/code-editor-vue3/mode/cobol/cobol.js +255 -0
  81. package/theme-chalk/code-editor-vue3/mode/coffeescript/coffeescript.js +359 -0
  82. package/theme-chalk/code-editor-vue3/mode/commonlisp/commonlisp.js +125 -0
  83. package/theme-chalk/code-editor-vue3/mode/crystal/crystal.js +433 -0
  84. package/theme-chalk/code-editor-vue3/mode/cypher/cypher.js +152 -0
  85. package/theme-chalk/code-editor-vue3/mode/d/d.js +223 -0
  86. package/theme-chalk/code-editor-vue3/mode/dart/dart.js +168 -0
  87. package/theme-chalk/code-editor-vue3/mode/diff/diff.js +47 -0
  88. package/theme-chalk/code-editor-vue3/mode/django/django.js +356 -0
  89. package/theme-chalk/code-editor-vue3/mode/dockerfile/dockerfile.js +211 -0
  90. package/theme-chalk/code-editor-vue3/mode/dtd/dtd.js +142 -0
  91. package/theme-chalk/code-editor-vue3/mode/dylan/dylan.js +352 -0
  92. package/theme-chalk/code-editor-vue3/mode/ebnf/ebnf.js +195 -0
  93. package/theme-chalk/code-editor-vue3/mode/ecl/ecl.js +206 -0
  94. package/theme-chalk/code-editor-vue3/mode/eiffel/eiffel.js +160 -0
  95. package/theme-chalk/code-editor-vue3/mode/elm/elm.js +245 -0
  96. package/theme-chalk/code-editor-vue3/mode/erlang/erlang.js +619 -0
  97. package/theme-chalk/code-editor-vue3/mode/factor/factor.js +85 -0
  98. package/theme-chalk/code-editor-vue3/mode/fcl/fcl.js +173 -0
  99. package/theme-chalk/code-editor-vue3/mode/forth/forth.js +180 -0
  100. package/theme-chalk/code-editor-vue3/mode/fortran/fortran.js +188 -0
  101. package/theme-chalk/code-editor-vue3/mode/gas/gas.js +353 -0
  102. package/theme-chalk/code-editor-vue3/mode/gfm/gfm.js +129 -0
  103. package/theme-chalk/code-editor-vue3/mode/gherkin/gherkin.js +178 -0
  104. package/theme-chalk/code-editor-vue3/mode/go/go.js +187 -0
  105. package/theme-chalk/code-editor-vue3/mode/groovy/groovy.js +245 -0
  106. package/theme-chalk/code-editor-vue3/mode/haml/haml.js +161 -0
  107. package/theme-chalk/code-editor-vue3/mode/handlebars/handlebars.js +70 -0
  108. package/theme-chalk/code-editor-vue3/mode/haskell/haskell.js +268 -0
  109. package/theme-chalk/code-editor-vue3/mode/haskell-literate/haskell-literate.js +43 -0
  110. package/theme-chalk/code-editor-vue3/mode/haxe/haxe.js +515 -0
  111. package/theme-chalk/code-editor-vue3/mode/htmlmixed/htmlmixed.js +153 -0
  112. package/theme-chalk/code-editor-vue3/mode/http/http.js +113 -0
  113. package/theme-chalk/code-editor-vue3/mode/idl/idl.js +290 -0
  114. package/theme-chalk/code-editor-vue3/mode/jinja2/jinja2.js +193 -0
  115. package/theme-chalk/code-editor-vue3/mode/julia/julia.js +390 -0
  116. package/theme-chalk/code-editor-vue3/mode/livescript/livescript.js +280 -0
  117. package/theme-chalk/code-editor-vue3/mode/lua/lua.js +160 -0
  118. package/theme-chalk/code-editor-vue3/mode/markdown/markdown.js +886 -0
  119. package/theme-chalk/code-editor-vue3/mode/mathematica/mathematica.js +176 -0
  120. package/theme-chalk/code-editor-vue3/mode/mbox/mbox.js +129 -0
  121. package/theme-chalk/code-editor-vue3/mode/meta.js +221 -0
  122. package/theme-chalk/code-editor-vue3/mode/mirc/mirc.js +193 -0
  123. package/theme-chalk/code-editor-vue3/mode/mllike/mllike.js +359 -0
  124. package/theme-chalk/code-editor-vue3/mode/modelica/modelica.js +245 -0
  125. package/theme-chalk/code-editor-vue3/mode/mscgen/mscgen.js +175 -0
  126. package/theme-chalk/code-editor-vue3/mode/mumps/mumps.js +148 -0
  127. package/theme-chalk/code-editor-vue3/mode/nginx/nginx.js +178 -0
  128. package/theme-chalk/code-editor-vue3/mode/nsis/nsis.js +95 -0
  129. package/theme-chalk/code-editor-vue3/mode/ntriples/ntriples.js +195 -0
  130. package/theme-chalk/code-editor-vue3/mode/octave/octave.js +139 -0
  131. package/theme-chalk/code-editor-vue3/mode/oz/oz.js +252 -0
  132. package/theme-chalk/code-editor-vue3/mode/pascal/pascal.js +136 -0
  133. package/theme-chalk/code-editor-vue3/mode/pegjs/pegjs.js +111 -0
  134. package/theme-chalk/code-editor-vue3/mode/perl/perl.js +836 -0
  135. package/theme-chalk/code-editor-vue3/mode/php/php.js +234 -0
  136. package/theme-chalk/code-editor-vue3/mode/pig/pig.js +178 -0
  137. package/theme-chalk/code-editor-vue3/mode/powershell/powershell.js +398 -0
  138. package/theme-chalk/code-editor-vue3/mode/properties/properties.js +78 -0
  139. package/theme-chalk/code-editor-vue3/mode/protobuf/protobuf.js +72 -0
  140. package/theme-chalk/code-editor-vue3/mode/pug/pug.js +591 -0
  141. package/theme-chalk/code-editor-vue3/mode/puppet/puppet.js +220 -0
  142. package/theme-chalk/code-editor-vue3/mode/python/python.js +402 -0
  143. package/theme-chalk/code-editor-vue3/mode/q/q.js +139 -0
  144. package/theme-chalk/code-editor-vue3/mode/r/r.js +190 -0
  145. package/theme-chalk/code-editor-vue3/mode/rpm/changes/index.html +66 -0
  146. package/theme-chalk/code-editor-vue3/mode/rpm/rpm.js +109 -0
  147. package/theme-chalk/code-editor-vue3/mode/rst/rst.js +557 -0
  148. package/theme-chalk/code-editor-vue3/mode/ruby/ruby.js +303 -0
  149. package/theme-chalk/code-editor-vue3/mode/rust/rust.js +72 -0
  150. package/theme-chalk/code-editor-vue3/mode/sas/sas.js +303 -0
  151. package/theme-chalk/code-editor-vue3/mode/sass/sass.js +459 -0
  152. package/theme-chalk/code-editor-vue3/mode/scheme/scheme.js +284 -0
  153. package/theme-chalk/code-editor-vue3/mode/shell/shell.js +168 -0
  154. package/theme-chalk/code-editor-vue3/mode/sieve/sieve.js +193 -0
  155. package/theme-chalk/code-editor-vue3/mode/slim/slim.js +575 -0
  156. package/theme-chalk/code-editor-vue3/mode/smalltalk/smalltalk.js +168 -0
  157. package/theme-chalk/code-editor-vue3/mode/smarty/smarty.js +225 -0
  158. package/theme-chalk/code-editor-vue3/mode/solr/solr.js +104 -0
  159. package/theme-chalk/code-editor-vue3/mode/soy/soy.js +665 -0
  160. package/theme-chalk/code-editor-vue3/mode/sparql/sparql.js +184 -0
  161. package/theme-chalk/code-editor-vue3/mode/spreadsheet/spreadsheet.js +112 -0
  162. package/theme-chalk/code-editor-vue3/mode/sql/sql.js +525 -0
  163. package/theme-chalk/code-editor-vue3/mode/stex/stex.js +264 -0
  164. package/theme-chalk/code-editor-vue3/mode/stylus/stylus.js +775 -0
  165. package/theme-chalk/code-editor-vue3/mode/swift/swift.js +221 -0
  166. package/theme-chalk/code-editor-vue3/mode/tcl/tcl.js +140 -0
  167. package/theme-chalk/code-editor-vue3/mode/textile/textile.js +469 -0
  168. package/theme-chalk/code-editor-vue3/mode/tiddlywiki/tiddlywiki.css +14 -0
  169. package/theme-chalk/code-editor-vue3/mode/tiddlywiki/tiddlywiki.js +308 -0
  170. package/theme-chalk/code-editor-vue3/mode/tiki/tiki.css +26 -0
  171. package/theme-chalk/code-editor-vue3/mode/tiki/tiki.js +312 -0
  172. package/theme-chalk/code-editor-vue3/mode/toml/toml.js +88 -0
  173. package/theme-chalk/code-editor-vue3/mode/tornado/tornado.js +68 -0
  174. package/theme-chalk/code-editor-vue3/mode/troff/troff.js +84 -0
  175. package/theme-chalk/code-editor-vue3/mode/ttcn/ttcn.js +283 -0
  176. package/theme-chalk/code-editor-vue3/mode/ttcn-cfg/ttcn-cfg.js +214 -0
  177. package/theme-chalk/code-editor-vue3/mode/turtle/turtle.js +162 -0
  178. package/theme-chalk/code-editor-vue3/mode/twig/twig.js +141 -0
  179. package/theme-chalk/code-editor-vue3/mode/vb/vb.js +275 -0
  180. package/theme-chalk/code-editor-vue3/mode/vbscript/vbscript.js +350 -0
  181. package/theme-chalk/code-editor-vue3/mode/velocity/velocity.js +202 -0
  182. package/theme-chalk/code-editor-vue3/mode/verilog/verilog.js +781 -0
  183. package/theme-chalk/code-editor-vue3/mode/vhdl/vhdl.js +189 -0
  184. package/theme-chalk/code-editor-vue3/mode/wast/wast.js +132 -0
  185. package/theme-chalk/code-editor-vue3/mode/webidl/webidl.js +195 -0
  186. package/theme-chalk/code-editor-vue3/mode/xml/xml.js +417 -0
  187. package/theme-chalk/code-editor-vue3/mode/xquery/xquery.js +448 -0
  188. package/theme-chalk/code-editor-vue3/mode/yacas/yacas.js +204 -0
  189. package/theme-chalk/code-editor-vue3/mode/yaml/yaml.js +120 -0
  190. package/theme-chalk/code-editor-vue3/mode/yaml-frontmatter/yaml-frontmatter.js +72 -0
  191. package/theme-chalk/code-editor-vue3/mode/z80/z80.js +116 -0
@@ -0,0 +1,334 @@
1
+ (function () {
2
+ 'use strict';
3
+
4
+ function copyObj(obj, target, overwrite) {
5
+ if (!target) { target = {}; }
6
+ for (var prop in obj)
7
+ { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
8
+ { target[prop] = obj[prop]; } }
9
+ return target
10
+ }
11
+
12
+ // Counts the column offset in a string, taking tabs into account.
13
+ // Used mostly to find indentation.
14
+ function countColumn(string, end, tabSize, startIndex, startValue) {
15
+ if (end == null) {
16
+ end = string.search(/[^\s\u00a0]/);
17
+ if (end == -1) { end = string.length; }
18
+ }
19
+ for (var i = startIndex || 0, n = startValue || 0;;) {
20
+ var nextTab = string.indexOf("\t", i);
21
+ if (nextTab < 0 || nextTab >= end)
22
+ { return n + (end - i) }
23
+ n += nextTab - i;
24
+ n += tabSize - (n % tabSize);
25
+ i = nextTab + 1;
26
+ }
27
+ }
28
+
29
+ function nothing() {}
30
+
31
+ function createObj(base, props) {
32
+ var inst;
33
+ if (Object.create) {
34
+ inst = Object.create(base);
35
+ } else {
36
+ nothing.prototype = base;
37
+ inst = new nothing();
38
+ }
39
+ if (props) { copyObj(props, inst); }
40
+ return inst
41
+ }
42
+
43
+ // STRING STREAM
44
+
45
+ // Fed to the mode parsers, provides helper functions to make
46
+ // parsers more succinct.
47
+
48
+ var StringStream = function(string, tabSize, lineOracle) {
49
+ this.pos = this.start = 0;
50
+ this.string = string;
51
+ this.tabSize = tabSize || 8;
52
+ this.lastColumnPos = this.lastColumnValue = 0;
53
+ this.lineStart = 0;
54
+ this.lineOracle = lineOracle;
55
+ };
56
+
57
+ StringStream.prototype.eol = function () {return this.pos >= this.string.length};
58
+ StringStream.prototype.sol = function () {return this.pos == this.lineStart};
59
+ StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};
60
+ StringStream.prototype.next = function () {
61
+ if (this.pos < this.string.length)
62
+ { return this.string.charAt(this.pos++) }
63
+ };
64
+ StringStream.prototype.eat = function (match) {
65
+ var ch = this.string.charAt(this.pos);
66
+ var ok;
67
+ if (typeof match == "string") { ok = ch == match; }
68
+ else { ok = ch && (match.test ? match.test(ch) : match(ch)); }
69
+ if (ok) {++this.pos; return ch}
70
+ };
71
+ StringStream.prototype.eatWhile = function (match) {
72
+ var start = this.pos;
73
+ while (this.eat(match)){}
74
+ return this.pos > start
75
+ };
76
+ StringStream.prototype.eatSpace = function () {
77
+ var start = this.pos;
78
+ while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }
79
+ return this.pos > start
80
+ };
81
+ StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};
82
+ StringStream.prototype.skipTo = function (ch) {
83
+ var found = this.string.indexOf(ch, this.pos);
84
+ if (found > -1) {this.pos = found; return true}
85
+ };
86
+ StringStream.prototype.backUp = function (n) {this.pos -= n;};
87
+ StringStream.prototype.column = function () {
88
+ if (this.lastColumnPos < this.start) {
89
+ this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);
90
+ this.lastColumnPos = this.start;
91
+ }
92
+ return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
93
+ };
94
+ StringStream.prototype.indentation = function () {
95
+ return countColumn(this.string, null, this.tabSize) -
96
+ (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
97
+ };
98
+ StringStream.prototype.match = function (pattern, consume, caseInsensitive) {
99
+ if (typeof pattern == "string") {
100
+ var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };
101
+ var substr = this.string.substr(this.pos, pattern.length);
102
+ if (cased(substr) == cased(pattern)) {
103
+ if (consume !== false) { this.pos += pattern.length; }
104
+ return true
105
+ }
106
+ } else {
107
+ var match = this.string.slice(this.pos).match(pattern);
108
+ if (match && match.index > 0) { return null }
109
+ if (match && consume !== false) { this.pos += match[0].length; }
110
+ return match
111
+ }
112
+ };
113
+ StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};
114
+ StringStream.prototype.hideFirstChars = function (n, inner) {
115
+ this.lineStart += n;
116
+ try { return inner() }
117
+ finally { this.lineStart -= n; }
118
+ };
119
+ StringStream.prototype.lookAhead = function (n) {
120
+ var oracle = this.lineOracle;
121
+ return oracle && oracle.lookAhead(n)
122
+ };
123
+ StringStream.prototype.baseToken = function () {
124
+ var oracle = this.lineOracle;
125
+ return oracle && oracle.baseToken(this.pos)
126
+ };
127
+
128
+ // Known modes, by name and by MIME
129
+ var modes = {}, mimeModes = {};
130
+
131
+ // Extra arguments are stored as the mode's dependencies, which is
132
+ // used by (legacy) mechanisms like loadmode.js to automatically
133
+ // load a mode. (Preferred mechanism is the require/define calls.)
134
+ function defineMode(name, mode) {
135
+ if (arguments.length > 2)
136
+ { mode.dependencies = Array.prototype.slice.call(arguments, 2); }
137
+ modes[name] = mode;
138
+ }
139
+
140
+ function defineMIME(mime, spec) {
141
+ mimeModes[mime] = spec;
142
+ }
143
+
144
+ // Given a MIME type, a {name, ...options} config object, or a name
145
+ // string, return a mode config object.
146
+ function resolveMode(spec) {
147
+ if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
148
+ spec = mimeModes[spec];
149
+ } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
150
+ var found = mimeModes[spec.name];
151
+ if (typeof found == "string") { found = {name: found}; }
152
+ spec = createObj(found, spec);
153
+ spec.name = found.name;
154
+ } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
155
+ return resolveMode("application/xml")
156
+ } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) {
157
+ return resolveMode("application/json")
158
+ }
159
+ if (typeof spec == "string") { return {name: spec} }
160
+ else { return spec || {name: "null"} }
161
+ }
162
+
163
+ // Given a mode spec (anything that resolveMode accepts), find and
164
+ // initialize an actual mode object.
165
+ function getMode(options, spec) {
166
+ spec = resolveMode(spec);
167
+ var mfactory = modes[spec.name];
168
+ if (!mfactory) { return getMode(options, "text/plain") }
169
+ var modeObj = mfactory(options, spec);
170
+ if (modeExtensions.hasOwnProperty(spec.name)) {
171
+ var exts = modeExtensions[spec.name];
172
+ for (var prop in exts) {
173
+ if (!exts.hasOwnProperty(prop)) { continue }
174
+ if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop]; }
175
+ modeObj[prop] = exts[prop];
176
+ }
177
+ }
178
+ modeObj.name = spec.name;
179
+ if (spec.helperType) { modeObj.helperType = spec.helperType; }
180
+ if (spec.modeProps) { for (var prop$1 in spec.modeProps)
181
+ { modeObj[prop$1] = spec.modeProps[prop$1]; } }
182
+
183
+ return modeObj
184
+ }
185
+
186
+ // This can be used to attach properties to mode objects from
187
+ // outside the actual mode definition.
188
+ var modeExtensions = {};
189
+ function extendMode(mode, properties) {
190
+ var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});
191
+ copyObj(properties, exts);
192
+ }
193
+
194
+ function copyState(mode, state) {
195
+ if (state === true) { return state }
196
+ if (mode.copyState) { return mode.copyState(state) }
197
+ var nstate = {};
198
+ for (var n in state) {
199
+ var val = state[n];
200
+ if (val instanceof Array) { val = val.concat([]); }
201
+ nstate[n] = val;
202
+ }
203
+ return nstate
204
+ }
205
+
206
+ // Given a mode and a state (for that mode), find the inner mode and
207
+ // state at the position that the state refers to.
208
+ function innerMode(mode, state) {
209
+ var info;
210
+ while (mode.innerMode) {
211
+ info = mode.innerMode(state);
212
+ if (!info || info.mode == mode) { break }
213
+ state = info.state;
214
+ mode = info.mode;
215
+ }
216
+ return info || {mode: mode, state: state}
217
+ }
218
+
219
+ function startState(mode, a1, a2) {
220
+ return mode.startState ? mode.startState(a1, a2) : true
221
+ }
222
+
223
+ var modeMethods = {
224
+ __proto__: null,
225
+ modes: modes,
226
+ mimeModes: mimeModes,
227
+ defineMode: defineMode,
228
+ defineMIME: defineMIME,
229
+ resolveMode: resolveMode,
230
+ getMode: getMode,
231
+ modeExtensions: modeExtensions,
232
+ extendMode: extendMode,
233
+ copyState: copyState,
234
+ innerMode: innerMode,
235
+ startState: startState
236
+ };
237
+
238
+ // declare global: globalThis, CodeMirror
239
+
240
+ // Create a minimal CodeMirror needed to use runMode, and assign to root.
241
+ var root = typeof globalThis !== 'undefined' ? globalThis : window;
242
+ root.CodeMirror = {};
243
+
244
+ // Copy StringStream and mode methods into CodeMirror object.
245
+ CodeMirror.StringStream = StringStream;
246
+ for (var exported in modeMethods) { CodeMirror[exported] = modeMethods[exported]; }
247
+
248
+ // Minimal default mode.
249
+ CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });
250
+ CodeMirror.defineMIME("text/plain", "null");
251
+
252
+ CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min;
253
+ CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/) };
254
+ CodeMirror.countColumn = countColumn;
255
+
256
+ CodeMirror.defaults = { indentUnit: 2 };
257
+
258
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
259
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
260
+
261
+ (function(mod) {
262
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
263
+ { mod(require("../../lib/codemirror")); }
264
+ else if (typeof define == "function" && define.amd) // AMD
265
+ { define(["../../lib/codemirror"], mod); }
266
+ else // Plain browser env
267
+ { mod(CodeMirror); }
268
+ })(function(CodeMirror) {
269
+
270
+ CodeMirror.runMode = function(string, modespec, callback, options) {
271
+ var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
272
+ var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
273
+
274
+ // Create a tokenizing callback function if passed-in callback is a DOM element.
275
+ if (callback.appendChild) {
276
+ var ie = /MSIE \d/.test(navigator.userAgent);
277
+ var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
278
+ var node = callback, col = 0;
279
+ node.textContent = "";
280
+ callback = function(text, style) {
281
+ if (text == "\n") {
282
+ // Emitting LF or CRLF on IE8 or earlier results in an incorrect display.
283
+ // Emitting a carriage return makes everything ok.
284
+ node.appendChild(document.createTextNode(ie_lt9 ? '\r' : text));
285
+ col = 0;
286
+ return;
287
+ }
288
+ var content = "";
289
+ // replace tabs
290
+ for (var pos = 0;;) {
291
+ var idx = text.indexOf("\t", pos);
292
+ if (idx == -1) {
293
+ content += text.slice(pos);
294
+ col += text.length - pos;
295
+ break;
296
+ } else {
297
+ col += idx - pos;
298
+ content += text.slice(pos, idx);
299
+ var size = tabSize - col % tabSize;
300
+ col += size;
301
+ for (var i = 0; i < size; ++i) { content += " "; }
302
+ pos = idx + 1;
303
+ }
304
+ }
305
+ // Create a node with token style and append it to the callback DOM element.
306
+ if (style) {
307
+ var sp = node.appendChild(document.createElement("span"));
308
+ sp.className = "cm-" + style.replace(/ +/g, " cm-");
309
+ sp.appendChild(document.createTextNode(content));
310
+ } else {
311
+ node.appendChild(document.createTextNode(content));
312
+ }
313
+ };
314
+ }
315
+
316
+ var lines = CodeMirror.splitLines(string), state = (options && options.state) || CodeMirror.startState(mode);
317
+ for (var i = 0, e = lines.length; i < e; ++i) {
318
+ if (i) { callback("\n"); }
319
+ var stream = new CodeMirror.StringStream(lines[i], null, {
320
+ lookAhead: function(n) { return lines[i + n] },
321
+ baseToken: function() {}
322
+ });
323
+ if (!stream.string && mode.blankLine) { mode.blankLine(state); }
324
+ while (!stream.eol()) {
325
+ var style = mode.token(stream, state);
326
+ callback(stream.current(), style, i, stream.start, state, mode);
327
+ stream.start = stream.pos;
328
+ }
329
+ }
330
+ };
331
+
332
+ });
333
+
334
+ }());
@@ -0,0 +1,76 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.runMode = function(string, modespec, callback, options) {
15
+ var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
16
+ var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
17
+
18
+ // Create a tokenizing callback function if passed-in callback is a DOM element.
19
+ if (callback.appendChild) {
20
+ var ie = /MSIE \d/.test(navigator.userAgent);
21
+ var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
22
+ var node = callback, col = 0;
23
+ node.textContent = "";
24
+ callback = function(text, style) {
25
+ if (text == "\n") {
26
+ // Emitting LF or CRLF on IE8 or earlier results in an incorrect display.
27
+ // Emitting a carriage return makes everything ok.
28
+ node.appendChild(document.createTextNode(ie_lt9 ? '\r' : text));
29
+ col = 0;
30
+ return;
31
+ }
32
+ var content = "";
33
+ // replace tabs
34
+ for (var pos = 0;;) {
35
+ var idx = text.indexOf("\t", pos);
36
+ if (idx == -1) {
37
+ content += text.slice(pos);
38
+ col += text.length - pos;
39
+ break;
40
+ } else {
41
+ col += idx - pos;
42
+ content += text.slice(pos, idx);
43
+ var size = tabSize - col % tabSize;
44
+ col += size;
45
+ for (var i = 0; i < size; ++i) content += " ";
46
+ pos = idx + 1;
47
+ }
48
+ }
49
+ // Create a node with token style and append it to the callback DOM element.
50
+ if (style) {
51
+ var sp = node.appendChild(document.createElement("span"));
52
+ sp.className = "cm-" + style.replace(/ +/g, " cm-");
53
+ sp.appendChild(document.createTextNode(content));
54
+ } else {
55
+ node.appendChild(document.createTextNode(content));
56
+ }
57
+ };
58
+ }
59
+
60
+ var lines = CodeMirror.splitLines(string), state = (options && options.state) || CodeMirror.startState(mode);
61
+ for (var i = 0, e = lines.length; i < e; ++i) {
62
+ if (i) callback("\n");
63
+ var stream = new CodeMirror.StringStream(lines[i], null, {
64
+ lookAhead: function(n) { return lines[i + n] },
65
+ baseToken: function() {}
66
+ });
67
+ if (!stream.string && mode.blankLine) mode.blankLine(state);
68
+ while (!stream.eol()) {
69
+ var style = mode.token(stream, state);
70
+ callback(stream.current(), style, i, stream.start, state, mode);
71
+ stream.start = stream.pos;
72
+ }
73
+ }
74
+ };
75
+
76
+ });