@milkdown/crepe 7.3.3

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 (241) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -0
  3. package/lib/apl-p0IPP13W.js +76 -0
  4. package/lib/asciiarmor-lJsBxlJJ.js +34 -0
  5. package/lib/asn1-Q9v1zIy5.js +102 -0
  6. package/lib/asterisk-foNkeTjy.js +273 -0
  7. package/lib/brainfuck-0XqyXpNS.js +35 -0
  8. package/lib/clike-ak6Z6Yhe.js +639 -0
  9. package/lib/clojure-iYO8U8Sg.js +810 -0
  10. package/lib/clsx-7d8NmkQq.js +21 -0
  11. package/lib/cmake-SVzjkxV_.js +28 -0
  12. package/lib/cobol-APHEnAOX.js +74 -0
  13. package/lib/coffeescript-KqQa0SYG.js +182 -0
  14. package/lib/commonlisp-bwqNqR5V.js +79 -0
  15. package/lib/core/crepe.d.ts +21 -0
  16. package/lib/core/crepe.d.ts.map +1 -0
  17. package/lib/core/index.d.ts +3 -0
  18. package/lib/core/index.d.ts.map +1 -0
  19. package/lib/core/slice.d.ts +12 -0
  20. package/lib/core/slice.d.ts.map +1 -0
  21. package/lib/crystal-BViWuDpA.js +217 -0
  22. package/lib/css-KHXHXfXg.js +1572 -0
  23. package/lib/cypher-XpTt4zQ3.js +69 -0
  24. package/lib/d-fLig6yqY.js +139 -0
  25. package/lib/diff-WoKGLpy6.js +18 -0
  26. package/lib/dockerfile-u6f6Vw2s.js +194 -0
  27. package/lib/dtd-SIJRUW6K.js +91 -0
  28. package/lib/dylan-4HCLhpWP.js +238 -0
  29. package/lib/ebnf-h_0lged5.js +77 -0
  30. package/lib/ecl-Lf4FF0lf.js +133 -0
  31. package/lib/eiffel-qlw8KUyf.js +112 -0
  32. package/lib/elm-QRnB3zXs.js +108 -0
  33. package/lib/erlang-fyVKb7eK.js +488 -0
  34. package/lib/factor-BEeN4upY.js +65 -0
  35. package/lib/fcl-lRek3hEb.js +106 -0
  36. package/lib/feature/block-edit/handle/component.d.ts +9 -0
  37. package/lib/feature/block-edit/handle/component.d.ts.map +1 -0
  38. package/lib/feature/block-edit/handle/index.d.ts +12 -0
  39. package/lib/feature/block-edit/handle/index.d.ts.map +1 -0
  40. package/lib/feature/block-edit/index.d.ts +3 -0
  41. package/lib/feature/block-edit/index.d.ts.map +1 -0
  42. package/lib/feature/block-edit/menu/component.d.ts +14 -0
  43. package/lib/feature/block-edit/menu/component.d.ts.map +1 -0
  44. package/lib/feature/block-edit/menu/config.d.ts +21 -0
  45. package/lib/feature/block-edit/menu/config.d.ts.map +1 -0
  46. package/lib/feature/block-edit/menu/icons.d.ts +14 -0
  47. package/lib/feature/block-edit/menu/icons.d.ts.map +1 -0
  48. package/lib/feature/block-edit/menu/index.d.ts +9 -0
  49. package/lib/feature/block-edit/menu/index.d.ts.map +1 -0
  50. package/lib/feature/code-mirror/index.d.ts +3 -0
  51. package/lib/feature/code-mirror/index.d.ts.map +1 -0
  52. package/lib/feature/gap-cursor/index.d.ts +3 -0
  53. package/lib/feature/gap-cursor/index.d.ts.map +1 -0
  54. package/lib/feature/image-block/index.d.ts +3 -0
  55. package/lib/feature/image-block/index.d.ts.map +1 -0
  56. package/lib/feature/index.d.ts +18 -0
  57. package/lib/feature/index.d.ts.map +1 -0
  58. package/lib/feature/link-tooltip/consts.d.ts +5 -0
  59. package/lib/feature/link-tooltip/consts.d.ts.map +1 -0
  60. package/lib/feature/link-tooltip/index.d.ts +3 -0
  61. package/lib/feature/link-tooltip/index.d.ts.map +1 -0
  62. package/lib/feature/list-item/consts.d.ts +2 -0
  63. package/lib/feature/list-item/consts.d.ts.map +1 -0
  64. package/lib/feature/list-item/index.d.ts +3 -0
  65. package/lib/feature/list-item/index.d.ts.map +1 -0
  66. package/lib/feature/placeholder/index.d.ts +10 -0
  67. package/lib/feature/placeholder/index.d.ts.map +1 -0
  68. package/lib/feature/shared.d.ts +3 -0
  69. package/lib/feature/shared.d.ts.map +1 -0
  70. package/lib/feature/toolbar/component.d.ts +13 -0
  71. package/lib/feature/toolbar/component.d.ts.map +1 -0
  72. package/lib/feature/toolbar/consts.d.ts +5 -0
  73. package/lib/feature/toolbar/consts.d.ts.map +1 -0
  74. package/lib/feature/toolbar/index.d.ts +3 -0
  75. package/lib/feature/toolbar/index.d.ts.map +1 -0
  76. package/lib/forth-ua2bRd8T.js +60 -0
  77. package/lib/fortran-WnF7znuN.js +443 -0
  78. package/lib/gas-wowve1o7.js +183 -0
  79. package/lib/gherkin-m7GIChu3.js +34 -0
  80. package/lib/go-th443Dhb.js +158 -0
  81. package/lib/groovy-tR4RiZnc.js +161 -0
  82. package/lib/haskell-jxVBofv5.js +375 -0
  83. package/lib/haxe-kWPI2tq3.js +390 -0
  84. package/lib/hooks-82sqkbtE.js +21 -0
  85. package/lib/http-3GIFWUlG.js +45 -0
  86. package/lib/icons-HYkfuR-O.js +50 -0
  87. package/lib/idl-PvpMZg-l.js +947 -0
  88. package/lib/index-0RbcZMbq.js +8 -0
  89. package/lib/index-4afXjFMY.js +517 -0
  90. package/lib/index-7MeyepDG.js +78 -0
  91. package/lib/index-7QgQq3x3.js +551 -0
  92. package/lib/index-7pgP6qYs.js +107 -0
  93. package/lib/index-8DvtgRVa.js +19511 -0
  94. package/lib/index-8Gg-jEP4.js +288 -0
  95. package/lib/index-8S8qcncB.js +507 -0
  96. package/lib/index-9A_GmGh4.js +1039 -0
  97. package/lib/index-EJJfYLzA.js +928 -0
  98. package/lib/index-Eg39w5kL.js +984 -0
  99. package/lib/index-FIk_7oPb.js +168 -0
  100. package/lib/index-LlbrXb_n.js +368 -0
  101. package/lib/index-MovKtgMG.js +121 -0
  102. package/lib/index-N9GtIS4X.js +64 -0
  103. package/lib/index-Pwn25-kf.js +8 -0
  104. package/lib/index-SdFSDosa.js +1295 -0
  105. package/lib/index-W5Th22-Z.js +1744 -0
  106. package/lib/index-XiXSFLmI.js +20975 -0
  107. package/lib/index-bknOViGv.js +47 -0
  108. package/lib/index-bkuIUPFS.js +275 -0
  109. package/lib/index-jPA8J9Eo.js +8 -0
  110. package/lib/index-lsG76a9s.js +552 -0
  111. package/lib/index-oTRzPo3B.js +146 -0
  112. package/lib/index-rrf6_6DC.js +317 -0
  113. package/lib/index-vJbZIHYF.js +81 -0
  114. package/lib/index-vPRh55CO.js +137 -0
  115. package/lib/index-vxy63hib.js +323 -0
  116. package/lib/index-wn1_LgCS.js +99 -0
  117. package/lib/index-xHADmDT3.js +12 -0
  118. package/lib/index-yt2EpMtv.js +141 -0
  119. package/lib/index.d.ts +4 -0
  120. package/lib/index.d.ts.map +1 -0
  121. package/lib/index.es.js +7 -0
  122. package/lib/javascript-8ZHqHagw.js +758 -0
  123. package/lib/jinja2-vsOFe0qD.js +154 -0
  124. package/lib/julia-dlp_pbN1.js +241 -0
  125. package/lib/livescript-Gf5R-LT6.js +273 -0
  126. package/lib/lua-c5Y_JsBp.js +221 -0
  127. package/lib/mathematica-iiGTGmUs.js +35 -0
  128. package/lib/mbox-ZJh86H8B.js +78 -0
  129. package/lib/meta-tAGyVRPE.js +511 -0
  130. package/lib/mirc-i0qkCa0y.js +73 -0
  131. package/lib/mllike-Dy551fZW.js +275 -0
  132. package/lib/modelica-n6tGqUT9.js +94 -0
  133. package/lib/mscgen-aKSbB7D9.js +104 -0
  134. package/lib/mumps-lNiKA6sp.js +25 -0
  135. package/lib/nginx--YmuCfDj.js +93 -0
  136. package/lib/nsis-zhS8iA09.js +62 -0
  137. package/lib/ntriples-E3jQl3MC.js +79 -0
  138. package/lib/octave-EQvkGIeG.js +144 -0
  139. package/lib/oz-W2cpqFf6.js +152 -0
  140. package/lib/pascal-lCh6ouNZ.js +79 -0
  141. package/lib/perl-PxEQBX0B.js +915 -0
  142. package/lib/pig-Y_bNcrzS.js +56 -0
  143. package/lib/powershell-GaQP-TZr.js +249 -0
  144. package/lib/properties-mbRyn54L.js +26 -0
  145. package/lib/prosemirror-noTDkx-k.js +4 -0
  146. package/lib/protobuf-8CJideyJ.js +49 -0
  147. package/lib/puppet-ABBaChNZ.js +45 -0
  148. package/lib/python-sKdHg3Ka.js +321 -0
  149. package/lib/q-_1yG40Nm.js +89 -0
  150. package/lib/r-Ziz56bHT.js +108 -0
  151. package/lib/rpm-ORjGOHaQ.js +57 -0
  152. package/lib/ruby-jlbYq0dT.js +233 -0
  153. package/lib/sas-2n7xeUuO.js +107 -0
  154. package/lib/schema-tKk3m1fu.js +62 -0
  155. package/lib/scheme-XCs-NPeU.js +126 -0
  156. package/lib/shell-0_1Um7Dq.js +184 -0
  157. package/lib/sieve-7uyJD1x1.js +73 -0
  158. package/lib/simple-mode--HIzBxba.js +95 -0
  159. package/lib/smalltalk-PEFzrlQ-.js +48 -0
  160. package/lib/solr-BLBaHahN.js +41 -0
  161. package/lib/sparql-4F9ZWf1b.js +204 -0
  162. package/lib/spreadsheet-SGSo6blj.js +49 -0
  163. package/lib/sql-tebLBzN0.js +291 -0
  164. package/lib/stex-SFJcFGOO.js +130 -0
  165. package/lib/stylus-rwwWYWFm.js +256 -0
  166. package/lib/swift-eorJ0tCv.js +238 -0
  167. package/lib/tcl-IwXMB8U4.js +82 -0
  168. package/lib/textile-ok2VyjwC.js +299 -0
  169. package/lib/theme/classic/index.d.ts +3 -0
  170. package/lib/theme/classic/index.d.ts.map +1 -0
  171. package/lib/theme/classic-dark/index.d.ts +3 -0
  172. package/lib/theme/classic-dark/index.d.ts.map +1 -0
  173. package/lib/theme/headless/index.d.ts +3 -0
  174. package/lib/theme/headless/index.d.ts.map +1 -0
  175. package/lib/theme/index.d.ts +8 -0
  176. package/lib/theme/index.d.ts.map +1 -0
  177. package/lib/theme/shared.d.ts +3 -0
  178. package/lib/theme/shared.d.ts.map +1 -0
  179. package/lib/tiddlywiki-DLhz8_pc.js +156 -0
  180. package/lib/tiki-DFAqFElY.js +183 -0
  181. package/lib/tippy.esm-MZ2vxByW.js +1813 -0
  182. package/lib/toml-ryxpTZEV.js +49 -0
  183. package/lib/tooltip-plugin-gcwyQdiT.js +119 -0
  184. package/lib/troff-ZzZyvNct.js +36 -0
  185. package/lib/ttcn-6gvkqqpW.js +136 -0
  186. package/lib/ttcn-cfg-oSu-Dq5C.js +98 -0
  187. package/lib/turtle-10ofr5au.js +87 -0
  188. package/lib/use-css-light-dom-EKWZDmbJ.js +82 -0
  189. package/lib/utils/index.d.ts +4 -0
  190. package/lib/utils/index.d.ts.map +1 -0
  191. package/lib/vb-a6n6fzrD.js +74 -0
  192. package/lib/vbscript-dgvo8jPt.js +324 -0
  193. package/lib/velocity-CBncCrwO.js +97 -0
  194. package/lib/verilog-KlcACt6C.js +271 -0
  195. package/lib/vhdl-NMd7Gf35.js +117 -0
  196. package/lib/webidl-z1UE5DN_.js +160 -0
  197. package/lib/xquery-hDt5jWTp.js +431 -0
  198. package/lib/yacas-ftgh_qwr.js +74 -0
  199. package/lib/yaml-DnNTfjXK.js +53 -0
  200. package/lib/z80-dA1PqWe1.js +62 -0
  201. package/package.json +87 -0
  202. package/src/core/crepe.ts +98 -0
  203. package/src/core/index.ts +4 -0
  204. package/src/core/slice.ts +44 -0
  205. package/src/feature/block-edit/handle/component.ts +68 -0
  206. package/src/feature/block-edit/handle/index.ts +81 -0
  207. package/src/feature/block-edit/index.ts +17 -0
  208. package/src/feature/block-edit/menu/component.ts +210 -0
  209. package/src/feature/block-edit/menu/config.ts +335 -0
  210. package/src/feature/block-edit/menu/icons.ts +171 -0
  211. package/src/feature/block-edit/menu/index.ts +113 -0
  212. package/src/feature/block-edit/style.css +126 -0
  213. package/src/feature/code-mirror/index.ts +60 -0
  214. package/src/feature/code-mirror/style.css +159 -0
  215. package/src/feature/gap-cursor/index.ts +31 -0
  216. package/src/feature/image-block/index.ts +59 -0
  217. package/src/feature/image-block/style.css +215 -0
  218. package/src/feature/index.ts +66 -0
  219. package/src/feature/link-tooltip/consts.ts +47 -0
  220. package/src/feature/link-tooltip/index.ts +22 -0
  221. package/src/feature/link-tooltip/style.css +107 -0
  222. package/src/feature/list-item/consts.ts +15 -0
  223. package/src/feature/list-item/index.ts +30 -0
  224. package/src/feature/list-item/style.css +23 -0
  225. package/src/feature/placeholder/index.ts +87 -0
  226. package/src/feature/placeholder/style.css +9 -0
  227. package/src/feature/shared.ts +4 -0
  228. package/src/feature/toolbar/component.ts +101 -0
  229. package/src/feature/toolbar/consts.ts +26 -0
  230. package/src/feature/toolbar/index.ts +92 -0
  231. package/src/feature/toolbar/style.css +37 -0
  232. package/src/index.ts +5 -0
  233. package/src/theme/classic/index.ts +12 -0
  234. package/src/theme/classic/style.css +192 -0
  235. package/src/theme/classic-dark/index.ts +12 -0
  236. package/src/theme/classic-dark/style.css +197 -0
  237. package/src/theme/headless/index.ts +9 -0
  238. package/src/theme/index.ts +26 -0
  239. package/src/theme/shared.ts +4 -0
  240. package/src/utils/index.ts +12 -0
  241. package/src/vite-env.d.ts +2 -0
@@ -0,0 +1,69 @@
1
+ var l = function(n) {
2
+ return new RegExp("^(?:" + n.join("|") + ")$", "i");
3
+ }, p = function(n) {
4
+ i = null;
5
+ var e = n.next();
6
+ if (e === '"')
7
+ return n.match(/^.*?"/), "string";
8
+ if (e === "'")
9
+ return n.match(/^.*?'/), "string";
10
+ if (/[{}\(\),\.;\[\]]/.test(e))
11
+ return i = e, "punctuation";
12
+ if (e === "/" && n.eat("/"))
13
+ return n.skipToEnd(), "comment";
14
+ if (u.test(e))
15
+ return n.eatWhile(u), null;
16
+ if (n.eatWhile(/[_\w\d]/), n.eat(":"))
17
+ return n.eatWhile(/[\w\d_\-]/), "atom";
18
+ var t = n.current();
19
+ return d.test(t) ? "builtin" : f.test(t) ? "def" : h.test(t) || x.test(t) ? "keyword" : "variable";
20
+ }, o = function(n, e, t) {
21
+ return n.context = {
22
+ prev: n.context,
23
+ indent: n.indent,
24
+ col: t,
25
+ type: e
26
+ };
27
+ }, c = function(n) {
28
+ return n.indent = n.context.indent, n.context = n.context.prev;
29
+ }, i, d = l(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]), f = l(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]), h = l(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with", "call", "yield"]), x = l(["access", "active", "assign", "all", "alter", "as", "catalog", "change", "copy", "create", "constraint", "constraints", "current", "database", "databases", "dbms", "default", "deny", "drop", "element", "elements", "exists", "from", "grant", "graph", "graphs", "if", "index", "indexes", "label", "labels", "management", "match", "name", "names", "new", "node", "nodes", "not", "of", "on", "or", "password", "populated", "privileges", "property", "read", "relationship", "relationships", "remove", "replace", "required", "revoke", "role", "roles", "set", "show", "start", "status", "stop", "suspended", "to", "traverse", "type", "types", "user", "users", "with", "write"]), u = /[*+\-<>=&|~%^]/;
30
+ const g = {
31
+ name: "cypher",
32
+ startState: function() {
33
+ return {
34
+ tokenize: p,
35
+ context: null,
36
+ indent: 0,
37
+ col: 0
38
+ };
39
+ },
40
+ token: function(n, e) {
41
+ if (n.sol() && (e.context && e.context.align == null && (e.context.align = !1), e.indent = n.indentation()), n.eatSpace())
42
+ return null;
43
+ var t = e.tokenize(n, e);
44
+ if (t !== "comment" && e.context && e.context.align == null && e.context.type !== "pattern" && (e.context.align = !0), i === "(")
45
+ o(e, ")", n.column());
46
+ else if (i === "[")
47
+ o(e, "]", n.column());
48
+ else if (i === "{")
49
+ o(e, "}", n.column());
50
+ else if (/[\]\}\)]/.test(i)) {
51
+ for (; e.context && e.context.type === "pattern"; )
52
+ c(e);
53
+ e.context && i === e.context.type && c(e);
54
+ } else
55
+ i === "." && e.context && e.context.type === "pattern" ? c(e) : /atom|string|variable/.test(t) && e.context && (/[\}\]]/.test(e.context.type) ? o(e, "pattern", n.column()) : e.context.type === "pattern" && !e.context.align && (e.context.align = !0, e.context.col = n.column()));
56
+ return t;
57
+ },
58
+ indent: function(n, e, t) {
59
+ var a = e && e.charAt(0), r = n.context;
60
+ if (/[\]\}]/.test(a))
61
+ for (; r && r.type === "pattern"; )
62
+ r = r.prev;
63
+ var s = r && a === r.type;
64
+ return r ? r.type === "keywords" ? null : r.align ? r.col + (s ? 0 : 1) : r.indent + (s ? 0 : t.unit) : 0;
65
+ }
66
+ };
67
+ export {
68
+ g as cypher
69
+ };
@@ -0,0 +1,139 @@
1
+ function c(e) {
2
+ for (var n = {}, t = e.split(" "), i = 0; i < t.length; ++i)
3
+ n[t[i]] = !0;
4
+ return n;
5
+ }
6
+ var s = "body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with";
7
+ const l = {
8
+ keywords: c("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters " + s),
9
+ blockKeywords: c(s),
10
+ builtin: c("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t"),
11
+ atoms: c("exit failure success true false null"),
12
+ hooks: {
13
+ "@": function(e, n) {
14
+ return e.eatWhile(/[\w\$_]/), "meta";
15
+ }
16
+ }
17
+ };
18
+ var w = l.statementIndentUnit, v = l.keywords, x = l.builtin, d = l.blockKeywords, g = l.atoms, p = l.hooks, _ = l.multiLineStrings, h = /[+\-*&%=<>!?|\/]/, o;
19
+ function m(e, n) {
20
+ var t = e.next();
21
+ if (p[t]) {
22
+ var i = p[t](e, n);
23
+ if (i !== !1)
24
+ return i;
25
+ }
26
+ if (t == '"' || t == "'" || t == "`")
27
+ return n.tokenize = z(t), n.tokenize(e, n);
28
+ if (/[\[\]{}\(\),;\:\.]/.test(t))
29
+ return o = t, null;
30
+ if (/\d/.test(t))
31
+ return e.eatWhile(/[\w\.]/), "number";
32
+ if (t == "/") {
33
+ if (e.eat("+"))
34
+ return n.tokenize = k, k(e, n);
35
+ if (e.eat("*"))
36
+ return n.tokenize = y, y(e, n);
37
+ if (e.eat("/"))
38
+ return e.skipToEnd(), "comment";
39
+ }
40
+ if (h.test(t))
41
+ return e.eatWhile(h), "operator";
42
+ e.eatWhile(/[\w\$_\xa1-\uffff]/);
43
+ var r = e.current();
44
+ return v.propertyIsEnumerable(r) ? (d.propertyIsEnumerable(r) && (o = "newstatement"), "keyword") : x.propertyIsEnumerable(r) ? (d.propertyIsEnumerable(r) && (o = "newstatement"), "builtin") : g.propertyIsEnumerable(r) ? "atom" : "variable";
45
+ }
46
+ function z(e) {
47
+ return function(n, t) {
48
+ for (var i = !1, r, u = !1; (r = n.next()) != null; ) {
49
+ if (r == e && !i) {
50
+ u = !0;
51
+ break;
52
+ }
53
+ i = !i && r == "\\";
54
+ }
55
+ return (u || !(i || _)) && (t.tokenize = null), "string";
56
+ };
57
+ }
58
+ function y(e, n) {
59
+ for (var t = !1, i; i = e.next(); ) {
60
+ if (i == "/" && t) {
61
+ n.tokenize = null;
62
+ break;
63
+ }
64
+ t = i == "*";
65
+ }
66
+ return "comment";
67
+ }
68
+ function k(e, n) {
69
+ for (var t = !1, i; i = e.next(); ) {
70
+ if (i == "/" && t) {
71
+ n.tokenize = null;
72
+ break;
73
+ }
74
+ t = i == "+";
75
+ }
76
+ return "comment";
77
+ }
78
+ function b(e, n, t, i, r) {
79
+ this.indented = e, this.column = n, this.type = t, this.align = i, this.prev = r;
80
+ }
81
+ function f(e, n, t) {
82
+ var i = e.indented;
83
+ return e.context && e.context.type == "statement" && (i = e.context.indented), e.context = new b(i, n, t, null, e.context);
84
+ }
85
+ function a(e) {
86
+ var n = e.context.type;
87
+ return (n == ")" || n == "]" || n == "}") && (e.indented = e.context.indented), e.context = e.context.prev;
88
+ }
89
+ const E = {
90
+ name: "d",
91
+ startState: function(e) {
92
+ return {
93
+ tokenize: null,
94
+ context: new b(-e, 0, "top", !1),
95
+ indented: 0,
96
+ startOfLine: !0
97
+ };
98
+ },
99
+ token: function(e, n) {
100
+ var t = n.context;
101
+ if (e.sol() && (t.align == null && (t.align = !1), n.indented = e.indentation(), n.startOfLine = !0), e.eatSpace())
102
+ return null;
103
+ o = null;
104
+ var i = (n.tokenize || m)(e, n);
105
+ if (i == "comment" || i == "meta")
106
+ return i;
107
+ if (t.align == null && (t.align = !0), (o == ";" || o == ":" || o == ",") && t.type == "statement")
108
+ a(n);
109
+ else if (o == "{")
110
+ f(n, e.column(), "}");
111
+ else if (o == "[")
112
+ f(n, e.column(), "]");
113
+ else if (o == "(")
114
+ f(n, e.column(), ")");
115
+ else if (o == "}") {
116
+ for (; t.type == "statement"; )
117
+ t = a(n);
118
+ for (t.type == "}" && (t = a(n)); t.type == "statement"; )
119
+ t = a(n);
120
+ } else
121
+ o == t.type ? a(n) : ((t.type == "}" || t.type == "top") && o != ";" || t.type == "statement" && o == "newstatement") && f(n, e.column(), "statement");
122
+ return n.startOfLine = !1, i;
123
+ },
124
+ indent: function(e, n, t) {
125
+ if (e.tokenize != m && e.tokenize != null)
126
+ return null;
127
+ var i = e.context, r = n && n.charAt(0);
128
+ i.type == "statement" && r == "}" && (i = i.prev);
129
+ var u = r == i.type;
130
+ return i.type == "statement" ? i.indented + (r == "{" ? 0 : w || t.unit) : i.align ? i.column + (u ? 0 : 1) : i.indented + (u ? 0 : t.unit);
131
+ },
132
+ languageData: {
133
+ indentOnInput: /^\s*[{}]$/,
134
+ commentTokens: { line: "//", block: { open: "/*", close: "*/" } }
135
+ }
136
+ };
137
+ export {
138
+ E as d
139
+ };
@@ -0,0 +1,18 @@
1
+ var o = {
2
+ "+": "inserted",
3
+ "-": "deleted",
4
+ "@": "meta"
5
+ };
6
+ const r = {
7
+ name: "diff",
8
+ token: function(n) {
9
+ var e = n.string.search(/[\t ]+?$/);
10
+ if (!n.sol() || e === 0)
11
+ return n.skipToEnd(), ("error " + (o[n.string.charAt(0)] || "")).replace(/ $/, "");
12
+ var i = o[n.peek()] || n.skipToEnd();
13
+ return e === -1 ? n.skipToEnd() : n.pos = e, i;
14
+ }
15
+ };
16
+ export {
17
+ r as diff
18
+ };
@@ -0,0 +1,194 @@
1
+ import { s as o } from "./simple-mode--HIzBxba.js";
2
+ var e = "from", s = new RegExp("^(\\s*)\\b(" + e + ")\\b", "i"), n = ["run", "cmd", "entrypoint", "shell"], l = new RegExp("^(\\s*)(" + n.join("|") + ")(\\s+\\[)", "i"), t = "expose", x = new RegExp("^(\\s*)(" + t + ")(\\s+)", "i"), g = [
3
+ "arg",
4
+ "from",
5
+ "maintainer",
6
+ "label",
7
+ "env",
8
+ "add",
9
+ "copy",
10
+ "volume",
11
+ "user",
12
+ "workdir",
13
+ "onbuild",
14
+ "stopsignal",
15
+ "healthcheck",
16
+ "shell"
17
+ ], u = [e, t].concat(n).concat(g), r = "(" + u.join("|") + ")", a = new RegExp("^(\\s*)" + r + "(\\s*)(#.*)?$", "i"), k = new RegExp("^(\\s*)" + r + "(\\s+)", "i");
18
+ const m = o({
19
+ start: [
20
+ // Block comment: This is a line starting with a comment
21
+ {
22
+ regex: /^\s*#.*$/,
23
+ sol: !0,
24
+ token: "comment"
25
+ },
26
+ {
27
+ regex: s,
28
+ token: [null, "keyword"],
29
+ sol: !0,
30
+ next: "from"
31
+ },
32
+ // Highlight an instruction without any arguments (for convenience)
33
+ {
34
+ regex: a,
35
+ token: [null, "keyword", null, "error"],
36
+ sol: !0
37
+ },
38
+ {
39
+ regex: l,
40
+ token: [null, "keyword", null],
41
+ sol: !0,
42
+ next: "array"
43
+ },
44
+ {
45
+ regex: x,
46
+ token: [null, "keyword", null],
47
+ sol: !0,
48
+ next: "expose"
49
+ },
50
+ // Highlight an instruction followed by arguments
51
+ {
52
+ regex: k,
53
+ token: [null, "keyword", null],
54
+ sol: !0,
55
+ next: "arguments"
56
+ },
57
+ {
58
+ regex: /./,
59
+ token: null
60
+ }
61
+ ],
62
+ from: [
63
+ {
64
+ regex: /\s*$/,
65
+ token: null,
66
+ next: "start"
67
+ },
68
+ {
69
+ // Line comment without instruction arguments is an error
70
+ regex: /(\s*)(#.*)$/,
71
+ token: [null, "error"],
72
+ next: "start"
73
+ },
74
+ {
75
+ regex: /(\s*\S+\s+)(as)/i,
76
+ token: [null, "keyword"],
77
+ next: "start"
78
+ },
79
+ // Fail safe return to start
80
+ {
81
+ token: null,
82
+ next: "start"
83
+ }
84
+ ],
85
+ single: [
86
+ {
87
+ regex: /(?:[^\\']|\\.)/,
88
+ token: "string"
89
+ },
90
+ {
91
+ regex: /'/,
92
+ token: "string",
93
+ pop: !0
94
+ }
95
+ ],
96
+ double: [
97
+ {
98
+ regex: /(?:[^\\"]|\\.)/,
99
+ token: "string"
100
+ },
101
+ {
102
+ regex: /"/,
103
+ token: "string",
104
+ pop: !0
105
+ }
106
+ ],
107
+ array: [
108
+ {
109
+ regex: /\]/,
110
+ token: null,
111
+ next: "start"
112
+ },
113
+ {
114
+ regex: /"(?:[^\\"]|\\.)*"?/,
115
+ token: "string"
116
+ }
117
+ ],
118
+ expose: [
119
+ {
120
+ regex: /\d+$/,
121
+ token: "number",
122
+ next: "start"
123
+ },
124
+ {
125
+ regex: /[^\d]+$/,
126
+ token: null,
127
+ next: "start"
128
+ },
129
+ {
130
+ regex: /\d+/,
131
+ token: "number"
132
+ },
133
+ {
134
+ regex: /[^\d]+/,
135
+ token: null
136
+ },
137
+ // Fail safe return to start
138
+ {
139
+ token: null,
140
+ next: "start"
141
+ }
142
+ ],
143
+ arguments: [
144
+ {
145
+ regex: /^\s*#.*$/,
146
+ sol: !0,
147
+ token: "comment"
148
+ },
149
+ {
150
+ regex: /"(?:[^\\"]|\\.)*"?$/,
151
+ token: "string",
152
+ next: "start"
153
+ },
154
+ {
155
+ regex: /"/,
156
+ token: "string",
157
+ push: "double"
158
+ },
159
+ {
160
+ regex: /'(?:[^\\']|\\.)*'?$/,
161
+ token: "string",
162
+ next: "start"
163
+ },
164
+ {
165
+ regex: /'/,
166
+ token: "string",
167
+ push: "single"
168
+ },
169
+ {
170
+ regex: /[^#"']+[\\`]$/,
171
+ token: null
172
+ },
173
+ {
174
+ regex: /[^#"']+$/,
175
+ token: null,
176
+ next: "start"
177
+ },
178
+ {
179
+ regex: /[^#"']+/,
180
+ token: null
181
+ },
182
+ // Fail safe return to start
183
+ {
184
+ token: null,
185
+ next: "start"
186
+ }
187
+ ],
188
+ languageData: {
189
+ commentTokens: { line: "#" }
190
+ }
191
+ });
192
+ export {
193
+ m as dockerFile
194
+ };
@@ -0,0 +1,91 @@
1
+ var u;
2
+ function r(e, n) {
3
+ return u = n, e;
4
+ }
5
+ function t(e, n) {
6
+ var l = e.next();
7
+ if (l == "<" && e.eat("!")) {
8
+ if (e.eatWhile(/[\-]/))
9
+ return n.tokenize = o, o(e, n);
10
+ if (e.eatWhile(/[\w]/))
11
+ return r("keyword", "doindent");
12
+ } else {
13
+ if (l == "<" && e.eat("?"))
14
+ return n.tokenize = a("meta", "?>"), r("meta", l);
15
+ if (l == "#" && e.eatWhile(/[\w]/))
16
+ return r("atom", "tag");
17
+ if (l == "|")
18
+ return r("keyword", "separator");
19
+ if (l.match(/[\(\)\[\]\-\.,\+\?>]/))
20
+ return r(null, l);
21
+ if (l.match(/[\[\]]/))
22
+ return r("rule", l);
23
+ if (l == '"' || l == "'")
24
+ return n.tokenize = k(l), n.tokenize(e, n);
25
+ if (e.eatWhile(/[a-zA-Z\?\+\d]/)) {
26
+ var i = e.current();
27
+ return i.substr(i.length - 1, i.length).match(/\?|\+/) !== null && e.backUp(1), r("tag", "tag");
28
+ } else
29
+ return l == "%" || l == "*" ? r("number", "number") : (e.eatWhile(/[\w\\\-_%.{,]/), r(null, null));
30
+ }
31
+ }
32
+ function o(e, n) {
33
+ for (var l = 0, i; (i = e.next()) != null; ) {
34
+ if (l >= 2 && i == ">") {
35
+ n.tokenize = t;
36
+ break;
37
+ }
38
+ l = i == "-" ? l + 1 : 0;
39
+ }
40
+ return r("comment", "comment");
41
+ }
42
+ function k(e) {
43
+ return function(n, l) {
44
+ for (var i = !1, c; (c = n.next()) != null; ) {
45
+ if (c == e && !i) {
46
+ l.tokenize = t;
47
+ break;
48
+ }
49
+ i = !i && c == "\\";
50
+ }
51
+ return r("string", "tag");
52
+ };
53
+ }
54
+ function a(e, n) {
55
+ return function(l, i) {
56
+ for (; !l.eol(); ) {
57
+ if (l.match(n)) {
58
+ i.tokenize = t;
59
+ break;
60
+ }
61
+ l.next();
62
+ }
63
+ return e;
64
+ };
65
+ }
66
+ const f = {
67
+ name: "dtd",
68
+ startState: function() {
69
+ return {
70
+ tokenize: t,
71
+ baseIndent: 0,
72
+ stack: []
73
+ };
74
+ },
75
+ token: function(e, n) {
76
+ if (e.eatSpace())
77
+ return null;
78
+ var l = n.tokenize(e, n), i = n.stack[n.stack.length - 1];
79
+ return e.current() == "[" || u === "doindent" || u == "[" ? n.stack.push("rule") : u === "endtag" ? n.stack[n.stack.length - 1] = "endtag" : e.current() == "]" || u == "]" || u == ">" && i == "rule" ? n.stack.pop() : u == "[" && n.stack.push("["), l;
80
+ },
81
+ indent: function(e, n, l) {
82
+ var i = e.stack.length;
83
+ return n.charAt(0) === "]" ? i-- : n.substr(n.length - 1, n.length) === ">" && (n.substr(0, 1) === "<" || u == "doindent" && n.length > 1 || (u == "doindent" ? i-- : u == ">" && n.length > 1 || u == "tag" && n !== ">" || (u == "tag" && e.stack[e.stack.length - 1] == "rule" ? i-- : u == "tag" ? i++ : n === ">" && e.stack[e.stack.length - 1] == "rule" && u === ">" ? i-- : n === ">" && e.stack[e.stack.length - 1] == "rule" || (n.substr(0, 1) !== "<" && n.substr(0, 1) === ">" ? i = i - 1 : n === ">" || (i = i - 1)))), (u == null || u == "]") && i--), e.baseIndent + i * l.unit;
84
+ },
85
+ languageData: {
86
+ indentOnInput: /^\s*[\]>]$/
87
+ }
88
+ };
89
+ export {
90
+ f as dtd
91
+ };