@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,299 @@
1
+ var f = {
2
+ addition: "inserted",
3
+ attributes: "propertyName",
4
+ bold: "strong",
5
+ cite: "keyword",
6
+ code: "monospace",
7
+ definitionList: "list",
8
+ deletion: "deleted",
9
+ div: "punctuation",
10
+ em: "emphasis",
11
+ footnote: "variable",
12
+ footCite: "qualifier",
13
+ header: "heading",
14
+ html: "comment",
15
+ image: "atom",
16
+ italic: "emphasis",
17
+ link: "link",
18
+ linkDefinition: "link",
19
+ list1: "list",
20
+ list2: "list.special",
21
+ list3: "list",
22
+ notextile: "string.special",
23
+ pre: "operator",
24
+ p: "content",
25
+ quote: "bracket",
26
+ span: "quote",
27
+ specialChar: "character",
28
+ strong: "strong",
29
+ sub: "content.special",
30
+ sup: "content.special",
31
+ table: "variableName.special",
32
+ tableHeading: "operator"
33
+ };
34
+ function h(i, e) {
35
+ e.mode = r.newLayout, e.tableHeading = !1, e.layoutType === "definitionList" && e.spanningLayout && i.match(l("definitionListEnd"), !1) && (e.spanningLayout = !1);
36
+ }
37
+ function s(i, e, n) {
38
+ if (n === "_")
39
+ return i.eat("_") ? a(i, e, "italic", /__/, 2) : a(i, e, "em", /_/, 1);
40
+ if (n === "*")
41
+ return i.eat("*") ? a(i, e, "bold", /\*\*/, 2) : a(i, e, "strong", /\*/, 1);
42
+ if (n === "[")
43
+ return i.match(/\d+\]/) && (e.footCite = !0), u(e);
44
+ if (n === "(") {
45
+ var o = i.match(/^(r|tm|c)\)/);
46
+ if (o)
47
+ return f.specialChar;
48
+ }
49
+ if (n === "<" && i.match(/(\w+)[^>]+>[^<]+<\/\1>/))
50
+ return f.html;
51
+ if (n === "?" && i.eat("?"))
52
+ return a(i, e, "cite", /\?\?/, 2);
53
+ if (n === "=" && i.eat("="))
54
+ return a(i, e, "notextile", /==/, 2);
55
+ if (n === "-" && !i.eat("-"))
56
+ return a(i, e, "deletion", /-/, 1);
57
+ if (n === "+")
58
+ return a(i, e, "addition", /\+/, 1);
59
+ if (n === "~")
60
+ return a(i, e, "sub", /~/, 1);
61
+ if (n === "^")
62
+ return a(i, e, "sup", /\^/, 1);
63
+ if (n === "%")
64
+ return a(i, e, "span", /%/, 1);
65
+ if (n === "@")
66
+ return a(i, e, "code", /@/, 1);
67
+ if (n === "!") {
68
+ var c = a(i, e, "image", /(?:\([^\)]+\))?!/, 1);
69
+ return i.match(/^:\S+/), c;
70
+ }
71
+ return u(e);
72
+ }
73
+ function a(i, e, n, o, c) {
74
+ var d = i.pos > c ? i.string.charAt(i.pos - c - 1) : null, p = i.peek();
75
+ if (e[n]) {
76
+ if ((!p || /\W/.test(p)) && d && /\S/.test(d)) {
77
+ var y = u(e);
78
+ return e[n] = !1, y;
79
+ }
80
+ } else
81
+ (!d || /\W/.test(d)) && p && /\S/.test(p) && i.match(new RegExp("^.*\\S" + o.source + "(?:\\W|$)"), !1) && (e[n] = !0, e.mode = r.attributes);
82
+ return u(e);
83
+ }
84
+ function u(i) {
85
+ var e = b(i);
86
+ if (e)
87
+ return e;
88
+ var n = [];
89
+ return i.layoutType && n.push(f[i.layoutType]), n = n.concat(g(
90
+ i,
91
+ "addition",
92
+ "bold",
93
+ "cite",
94
+ "code",
95
+ "deletion",
96
+ "em",
97
+ "footCite",
98
+ "image",
99
+ "italic",
100
+ "link",
101
+ "span",
102
+ "strong",
103
+ "sub",
104
+ "sup",
105
+ "table",
106
+ "tableHeading"
107
+ )), i.layoutType === "header" && n.push(f.header + "-" + i.header), n.length ? n.join(" ") : null;
108
+ }
109
+ function b(i) {
110
+ var e = i.layoutType;
111
+ switch (e) {
112
+ case "notextile":
113
+ case "code":
114
+ case "pre":
115
+ return f[e];
116
+ default:
117
+ return i.notextile ? f.notextile + (e ? " " + f[e] : "") : null;
118
+ }
119
+ }
120
+ function g(i) {
121
+ for (var e = [], n = 1; n < arguments.length; ++n)
122
+ i[arguments[n]] && e.push(f[arguments[n]]);
123
+ return e;
124
+ }
125
+ function m(i) {
126
+ var e = i.spanningLayout, n = i.layoutType;
127
+ for (var o in i)
128
+ i.hasOwnProperty(o) && delete i[o];
129
+ i.mode = r.newLayout, e && (i.layoutType = n, i.spanningLayout = !0);
130
+ }
131
+ var t = {
132
+ cache: {},
133
+ single: {
134
+ bc: "bc",
135
+ bq: "bq",
136
+ definitionList: /- .*?:=+/,
137
+ definitionListEnd: /.*=:\s*$/,
138
+ div: "div",
139
+ drawTable: /\|.*\|/,
140
+ foot: /fn\d+/,
141
+ header: /h[1-6]/,
142
+ html: /\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/,
143
+ link: /[^"]+":\S/,
144
+ linkDefinition: /\[[^\s\]]+\]\S+/,
145
+ list: /(?:#+|\*+)/,
146
+ notextile: "notextile",
147
+ para: "p",
148
+ pre: "pre",
149
+ table: "table",
150
+ tableCellAttributes: /[\/\\]\d+/,
151
+ tableHeading: /\|_\./,
152
+ tableText: /[^"_\*\[\(\?\+~\^%@|-]+/,
153
+ text: /[^!"_=\*\[\(<\?\+~\^%@-]+/
154
+ },
155
+ attributes: {
156
+ align: /(?:<>|<|>|=)/,
157
+ selector: /\([^\(][^\)]+\)/,
158
+ lang: /\[[^\[\]]+\]/,
159
+ pad: /(?:\(+|\)+){1,2}/,
160
+ css: /\{[^\}]+\}/
161
+ },
162
+ createRe: function(i) {
163
+ switch (i) {
164
+ case "drawTable":
165
+ return t.makeRe("^", t.single.drawTable, "$");
166
+ case "html":
167
+ return t.makeRe("^", t.single.html, "(?:", t.single.html, ")*", "$");
168
+ case "linkDefinition":
169
+ return t.makeRe("^", t.single.linkDefinition, "$");
170
+ case "listLayout":
171
+ return t.makeRe("^", t.single.list, l("allAttributes"), "*\\s+");
172
+ case "tableCellAttributes":
173
+ return t.makeRe("^", t.choiceRe(
174
+ t.single.tableCellAttributes,
175
+ l("allAttributes")
176
+ ), "+\\.");
177
+ case "type":
178
+ return t.makeRe("^", l("allTypes"));
179
+ case "typeLayout":
180
+ return t.makeRe(
181
+ "^",
182
+ l("allTypes"),
183
+ l("allAttributes"),
184
+ "*\\.\\.?",
185
+ "(\\s+|$)"
186
+ );
187
+ case "attributes":
188
+ return t.makeRe("^", l("allAttributes"), "+");
189
+ case "allTypes":
190
+ return t.choiceRe(
191
+ t.single.div,
192
+ t.single.foot,
193
+ t.single.header,
194
+ t.single.bc,
195
+ t.single.bq,
196
+ t.single.notextile,
197
+ t.single.pre,
198
+ t.single.table,
199
+ t.single.para
200
+ );
201
+ case "allAttributes":
202
+ return t.choiceRe(
203
+ t.attributes.selector,
204
+ t.attributes.css,
205
+ t.attributes.lang,
206
+ t.attributes.align,
207
+ t.attributes.pad
208
+ );
209
+ default:
210
+ return t.makeRe("^", t.single[i]);
211
+ }
212
+ },
213
+ makeRe: function() {
214
+ for (var i = "", e = 0; e < arguments.length; ++e) {
215
+ var n = arguments[e];
216
+ i += typeof n == "string" ? n : n.source;
217
+ }
218
+ return new RegExp(i);
219
+ },
220
+ choiceRe: function() {
221
+ for (var i = [arguments[0]], e = 1; e < arguments.length; ++e)
222
+ i[e * 2 - 1] = "|", i[e * 2] = arguments[e];
223
+ return i.unshift("(?:"), i.push(")"), t.makeRe.apply(null, i);
224
+ }
225
+ };
226
+ function l(i) {
227
+ return t.cache[i] || (t.cache[i] = t.createRe(i));
228
+ }
229
+ var r = {
230
+ newLayout: function(i, e) {
231
+ if (i.match(l("typeLayout"), !1))
232
+ return e.spanningLayout = !1, (e.mode = r.blockType)(i, e);
233
+ var n;
234
+ return b(e) || (i.match(l("listLayout"), !1) ? n = r.list : i.match(l("drawTable"), !1) ? n = r.table : i.match(l("linkDefinition"), !1) ? n = r.linkDefinition : i.match(l("definitionList")) ? n = r.definitionList : i.match(l("html"), !1) && (n = r.html)), (e.mode = n || r.text)(i, e);
235
+ },
236
+ blockType: function(i, e) {
237
+ var n, o;
238
+ if (e.layoutType = null, n = i.match(l("type")))
239
+ o = n[0];
240
+ else
241
+ return (e.mode = r.text)(i, e);
242
+ return (n = o.match(l("header"))) ? (e.layoutType = "header", e.header = parseInt(n[0][1])) : o.match(l("bq")) ? e.layoutType = "quote" : o.match(l("bc")) ? e.layoutType = "code" : o.match(l("foot")) ? e.layoutType = "footnote" : o.match(l("notextile")) ? e.layoutType = "notextile" : o.match(l("pre")) ? e.layoutType = "pre" : o.match(l("div")) ? e.layoutType = "div" : o.match(l("table")) && (e.layoutType = "table"), e.mode = r.attributes, u(e);
243
+ },
244
+ text: function(i, e) {
245
+ if (i.match(l("text")))
246
+ return u(e);
247
+ var n = i.next();
248
+ return n === '"' ? (e.mode = r.link)(i, e) : s(i, e, n);
249
+ },
250
+ attributes: function(i, e) {
251
+ return e.mode = r.layoutLength, i.match(l("attributes")) ? f.attributes : u(e);
252
+ },
253
+ layoutLength: function(i, e) {
254
+ return i.eat(".") && i.eat(".") && (e.spanningLayout = !0), e.mode = r.text, u(e);
255
+ },
256
+ list: function(i, e) {
257
+ var n = i.match(l("list"));
258
+ e.listDepth = n[0].length;
259
+ var o = (e.listDepth - 1) % 3;
260
+ return o ? o === 1 ? e.layoutType = "list2" : e.layoutType = "list3" : e.layoutType = "list1", e.mode = r.attributes, u(e);
261
+ },
262
+ link: function(i, e) {
263
+ return e.mode = r.text, i.match(l("link")) ? (i.match(/\S+/), f.link) : u(e);
264
+ },
265
+ linkDefinition: function(i) {
266
+ return i.skipToEnd(), f.linkDefinition;
267
+ },
268
+ definitionList: function(i, e) {
269
+ return i.match(l("definitionList")), e.layoutType = "definitionList", i.match(/\s*$/) ? e.spanningLayout = !0 : e.mode = r.attributes, u(e);
270
+ },
271
+ html: function(i) {
272
+ return i.skipToEnd(), f.html;
273
+ },
274
+ table: function(i, e) {
275
+ return e.layoutType = "table", (e.mode = r.tableCell)(i, e);
276
+ },
277
+ tableCell: function(i, e) {
278
+ return i.match(l("tableHeading")) ? e.tableHeading = !0 : i.eat("|"), e.mode = r.tableCellAttributes, u(e);
279
+ },
280
+ tableCellAttributes: function(i, e) {
281
+ return e.mode = r.tableText, i.match(l("tableCellAttributes")) ? f.attributes : u(e);
282
+ },
283
+ tableText: function(i, e) {
284
+ return i.match(l("tableText")) ? u(e) : i.peek() === "|" ? (e.mode = r.tableCell, u(e)) : s(i, e, i.next());
285
+ }
286
+ };
287
+ const k = {
288
+ name: "textile",
289
+ startState: function() {
290
+ return { mode: r.newLayout };
291
+ },
292
+ token: function(i, e) {
293
+ return i.sol() && h(i, e), e.mode(i, e);
294
+ },
295
+ blankLine: m
296
+ };
297
+ export {
298
+ k as textile
299
+ };
@@ -0,0 +1,3 @@
1
+ import type { DefineTheme } from '../shared';
2
+ export declare const defineTheme: DefineTheme;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/classic/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAG5C,eAAO,MAAM,WAAW,EAAE,WAIzB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { DefineTheme } from '../shared';
2
+ export declare const defineTheme: DefineTheme;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/classic-dark/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAG5C,eAAO,MAAM,WAAW,EAAE,WAIzB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { DefineTheme } from '../shared';
2
+ export declare const defineTheme: DefineTheme;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/headless/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,WAAW,EAAE,WAEzB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { Editor } from '@milkdown/core';
2
+ export declare enum CrepeTheme {
3
+ Headless = "headless",
4
+ Classic = "classic",
5
+ ClassicDark = "classic-dark"
6
+ }
7
+ export declare function loadTheme(theme: CrepeTheme, editor: Editor): Promise<void>;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5C,oBAAY,UAAU;IACpB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,WAAW,iBAAiB;CAC7B;AAED,wBAAsB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAehE"}
@@ -0,0 +1,3 @@
1
+ import type { Editor } from '@milkdown/core';
2
+ export type DefineTheme = (editor: Editor) => void;
3
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/theme/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5C,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA"}
@@ -0,0 +1,156 @@
1
+ var c = {}, l = {
2
+ allTags: !0,
3
+ closeAll: !0,
4
+ list: !0,
5
+ newJournal: !0,
6
+ newTiddler: !0,
7
+ permaview: !0,
8
+ saveChanges: !0,
9
+ search: !0,
10
+ slider: !0,
11
+ tabs: !0,
12
+ tag: !0,
13
+ tagging: !0,
14
+ tags: !0,
15
+ tiddler: !0,
16
+ timeline: !0,
17
+ today: !0,
18
+ version: !0,
19
+ option: !0,
20
+ with: !0,
21
+ filter: !0
22
+ }, f = /[\w_\-]/i, k = /^\-\-\-\-+$/, h = /^\/\*\*\*$/, d = /^\*\*\*\/$/, a = /^<<<$/, p = /^\/\/\{\{\{$/, w = /^\/\/\}\}\}$/, b = /^<!--\{\{\{-->$/, v = /^<!--\}\}\}-->$/, S = /^\{\{\{$/, y = /^\}\}\}$/, $ = /.*?\}\}\}/;
23
+ function o(e, t, r) {
24
+ return t.tokenize = r, r(e, t);
25
+ }
26
+ function i(e, t) {
27
+ var r = e.sol(), n = e.peek();
28
+ if (t.block = !1, r && /[<\/\*{}\-]/.test(n)) {
29
+ if (e.match(S))
30
+ return t.block = !0, o(e, t, u);
31
+ if (e.match(a))
32
+ return "quote";
33
+ if (e.match(h) || e.match(d) || e.match(p) || e.match(w) || e.match(b) || e.match(v))
34
+ return "comment";
35
+ if (e.match(k))
36
+ return "contentSeparator";
37
+ }
38
+ if (e.next(), r && /[\/\*!#;:>|]/.test(n)) {
39
+ if (n == "!")
40
+ return e.skipToEnd(), "header";
41
+ if (n == "*")
42
+ return e.eatWhile("*"), "comment";
43
+ if (n == "#")
44
+ return e.eatWhile("#"), "comment";
45
+ if (n == ";")
46
+ return e.eatWhile(";"), "comment";
47
+ if (n == ":")
48
+ return e.eatWhile(":"), "comment";
49
+ if (n == ">")
50
+ return e.eatWhile(">"), "quote";
51
+ if (n == "|")
52
+ return "header";
53
+ }
54
+ if (n == "{" && e.match("{{"))
55
+ return o(e, t, u);
56
+ if (/[hf]/i.test(n) && /[ti]/i.test(e.peek()) && e.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))
57
+ return "link";
58
+ if (n == '"')
59
+ return "string";
60
+ if (n == "~" || /[\[\]]/.test(n) && e.match(n))
61
+ return "brace";
62
+ if (n == "@")
63
+ return e.eatWhile(f), "link";
64
+ if (/\d/.test(n))
65
+ return e.eatWhile(/\d/), "number";
66
+ if (n == "/") {
67
+ if (e.eat("%"))
68
+ return o(e, t, z);
69
+ if (e.eat("/"))
70
+ return o(e, t, W);
71
+ }
72
+ if (n == "_" && e.eat("_"))
73
+ return o(e, t, x);
74
+ if (n == "-" && e.eat("-")) {
75
+ if (e.peek() != " ")
76
+ return o(e, t, g);
77
+ if (e.peek() == " ")
78
+ return "brace";
79
+ }
80
+ return n == "'" && e.eat("'") ? o(e, t, C) : n == "<" && e.eat("<") ? o(e, t, T) : (e.eatWhile(/[\w\$_]/), c.propertyIsEnumerable(e.current()) ? "keyword" : null);
81
+ }
82
+ function z(e, t) {
83
+ for (var r = !1, n; n = e.next(); ) {
84
+ if (n == "/" && r) {
85
+ t.tokenize = i;
86
+ break;
87
+ }
88
+ r = n == "%";
89
+ }
90
+ return "comment";
91
+ }
92
+ function C(e, t) {
93
+ for (var r = !1, n; n = e.next(); ) {
94
+ if (n == "'" && r) {
95
+ t.tokenize = i;
96
+ break;
97
+ }
98
+ r = n == "'";
99
+ }
100
+ return "strong";
101
+ }
102
+ function u(e, t) {
103
+ var r = t.block;
104
+ return r && e.current() ? "comment" : !r && e.match($) || r && e.sol() && e.match(y) ? (t.tokenize = i, "comment") : (e.next(), "comment");
105
+ }
106
+ function W(e, t) {
107
+ for (var r = !1, n; n = e.next(); ) {
108
+ if (n == "/" && r) {
109
+ t.tokenize = i;
110
+ break;
111
+ }
112
+ r = n == "/";
113
+ }
114
+ return "emphasis";
115
+ }
116
+ function x(e, t) {
117
+ for (var r = !1, n; n = e.next(); ) {
118
+ if (n == "_" && r) {
119
+ t.tokenize = i;
120
+ break;
121
+ }
122
+ r = n == "_";
123
+ }
124
+ return "link";
125
+ }
126
+ function g(e, t) {
127
+ for (var r = !1, n; n = e.next(); ) {
128
+ if (n == "-" && r) {
129
+ t.tokenize = i;
130
+ break;
131
+ }
132
+ r = n == "-";
133
+ }
134
+ return "deleted";
135
+ }
136
+ function T(e, t) {
137
+ if (e.current() == "<<")
138
+ return "meta";
139
+ var r = e.next();
140
+ return r ? r == ">" && e.peek() == ">" ? (e.next(), t.tokenize = i, "meta") : (e.eatWhile(/[\w\$_]/), l.propertyIsEnumerable(e.current()) ? "keyword" : null) : (t.tokenize = i, null);
141
+ }
142
+ const m = {
143
+ name: "tiddlywiki",
144
+ startState: function() {
145
+ return { tokenize: i };
146
+ },
147
+ token: function(e, t) {
148
+ if (e.eatSpace())
149
+ return null;
150
+ var r = t.tokenize(e, t);
151
+ return r;
152
+ }
153
+ };
154
+ export {
155
+ m as tiddlyWiki
156
+ };
@@ -0,0 +1,183 @@
1
+ function c(e, t, n) {
2
+ return function(r, a) {
3
+ for (; !r.eol(); ) {
4
+ if (r.match(t)) {
5
+ a.tokenize = o;
6
+ break;
7
+ }
8
+ r.next();
9
+ }
10
+ return n && (a.tokenize = n), e;
11
+ };
12
+ }
13
+ function f(e) {
14
+ return function(t, n) {
15
+ for (; !t.eol(); )
16
+ t.next();
17
+ return n.tokenize = o, e;
18
+ };
19
+ }
20
+ function o(e, t) {
21
+ function n(p) {
22
+ return t.tokenize = p, p(e, t);
23
+ }
24
+ var r = e.sol(), a = e.next();
25
+ switch (a) {
26
+ case "{":
27
+ return e.eat("/"), e.eatSpace(), e.eatWhile(/[^\s\u00a0=\"\'\/?(}]/), t.tokenize = h, "tag";
28
+ case "_":
29
+ if (e.eat("_"))
30
+ return n(c("strong", "__", o));
31
+ break;
32
+ case "'":
33
+ if (e.eat("'"))
34
+ return n(c("em", "''", o));
35
+ break;
36
+ case "(":
37
+ if (e.eat("("))
38
+ return n(c("link", "))", o));
39
+ break;
40
+ case "[":
41
+ return n(c("url", "]", o));
42
+ case "|":
43
+ if (e.eat("|"))
44
+ return n(c("comment", "||"));
45
+ break;
46
+ case "-":
47
+ if (e.eat("="))
48
+ return n(c("header string", "=-", o));
49
+ if (e.eat("-"))
50
+ return n(c("error tw-deleted", "--", o));
51
+ break;
52
+ case "=":
53
+ if (e.match("=="))
54
+ return n(c("tw-underline", "===", o));
55
+ break;
56
+ case ":":
57
+ if (e.eat(":"))
58
+ return n(c("comment", "::"));
59
+ break;
60
+ case "^":
61
+ return n(c("tw-box", "^"));
62
+ case "~":
63
+ if (e.match("np~"))
64
+ return n(c("meta", "~/np~"));
65
+ break;
66
+ }
67
+ if (r)
68
+ switch (a) {
69
+ case "!":
70
+ return e.match("!!!!!") || e.match("!!!!") || e.match("!!!") || e.match("!!"), n(f("header string"));
71
+ case "*":
72
+ case "#":
73
+ case "+":
74
+ return n(f("tw-listitem bracket"));
75
+ }
76
+ return null;
77
+ }
78
+ var g, s;
79
+ function h(e, t) {
80
+ var n = e.next(), r = e.peek();
81
+ return n == "}" ? (t.tokenize = o, "tag") : n == "(" || n == ")" ? "bracket" : n == "=" ? (s = "equals", r == ">" && (e.next(), r = e.peek()), /[\'\"]/.test(r) || (t.tokenize = z()), "operator") : /[\'\"]/.test(n) ? (t.tokenize = w(n), t.tokenize(e, t)) : (e.eatWhile(/[^\s\u00a0=\"\'\/?]/), "keyword");
82
+ }
83
+ function w(e) {
84
+ return function(t, n) {
85
+ for (; !t.eol(); )
86
+ if (t.next() == e) {
87
+ n.tokenize = h;
88
+ break;
89
+ }
90
+ return "string";
91
+ };
92
+ }
93
+ function z() {
94
+ return function(e, t) {
95
+ for (; !e.eol(); ) {
96
+ var n = e.next(), r = e.peek();
97
+ if (n == " " || n == "," || /[ )}]/.test(r)) {
98
+ t.tokenize = h;
99
+ break;
100
+ }
101
+ }
102
+ return "string";
103
+ };
104
+ }
105
+ var i, l;
106
+ function k() {
107
+ for (var e = arguments.length - 1; e >= 0; e--)
108
+ i.cc.push(arguments[e]);
109
+ }
110
+ function u() {
111
+ return k.apply(null, arguments), !0;
112
+ }
113
+ function b(e, t) {
114
+ var n = i.context && i.context.noIndent;
115
+ i.context = {
116
+ prev: i.context,
117
+ pluginName: e,
118
+ indent: i.indented,
119
+ startOfLine: t,
120
+ noIndent: n
121
+ };
122
+ }
123
+ function x() {
124
+ i.context && (i.context = i.context.prev);
125
+ }
126
+ function L(e) {
127
+ if (e == "openPlugin")
128
+ return i.pluginName = g, u(d, N(i.startOfLine));
129
+ if (e == "closePlugin") {
130
+ var t = !1;
131
+ return i.context ? (t = i.context.pluginName != g, x()) : t = !0, t && (l = "error"), u(P(t));
132
+ } else
133
+ return e == "string" && ((!i.context || i.context.name != "!cdata") && b("!cdata"), i.tokenize == o && x()), u();
134
+ }
135
+ function N(e) {
136
+ return function(t) {
137
+ return t == "selfclosePlugin" || t == "endPlugin" || t == "endPlugin" && b(i.pluginName, e), u();
138
+ };
139
+ }
140
+ function P(e) {
141
+ return function(t) {
142
+ return e && (l = "error"), t == "endPlugin" ? u() : k();
143
+ };
144
+ }
145
+ function d(e) {
146
+ return e == "keyword" ? (l = "attribute", u(d)) : e == "equals" ? u(O, d) : k();
147
+ }
148
+ function O(e) {
149
+ return e == "keyword" ? (l = "string", u()) : e == "string" ? u(v) : k();
150
+ }
151
+ function v(e) {
152
+ return e == "string" ? u(v) : k();
153
+ }
154
+ const S = {
155
+ name: "tiki",
156
+ startState: function() {
157
+ return { tokenize: o, cc: [], indented: 0, startOfLine: !0, pluginName: null, context: null };
158
+ },
159
+ token: function(e, t) {
160
+ if (e.sol() && (t.startOfLine = !0, t.indented = e.indentation()), e.eatSpace())
161
+ return null;
162
+ l = s = g = null;
163
+ var n = t.tokenize(e, t);
164
+ if ((n || s) && n != "comment")
165
+ for (i = t; ; ) {
166
+ var r = t.cc.pop() || L;
167
+ if (r(s || n))
168
+ break;
169
+ }
170
+ return t.startOfLine = !1, l || n;
171
+ },
172
+ indent: function(e, t, n) {
173
+ var r = e.context;
174
+ if (r && r.noIndent)
175
+ return 0;
176
+ for (r && /^{\//.test(t) && (r = r.prev); r && !r.startOfLine; )
177
+ r = r.prev;
178
+ return r ? r.indent + n.unit : 0;
179
+ }
180
+ };
181
+ export {
182
+ S as tiki
183
+ };