@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.
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/lib/apl-p0IPP13W.js +76 -0
- package/lib/asciiarmor-lJsBxlJJ.js +34 -0
- package/lib/asn1-Q9v1zIy5.js +102 -0
- package/lib/asterisk-foNkeTjy.js +273 -0
- package/lib/brainfuck-0XqyXpNS.js +35 -0
- package/lib/clike-ak6Z6Yhe.js +639 -0
- package/lib/clojure-iYO8U8Sg.js +810 -0
- package/lib/clsx-7d8NmkQq.js +21 -0
- package/lib/cmake-SVzjkxV_.js +28 -0
- package/lib/cobol-APHEnAOX.js +74 -0
- package/lib/coffeescript-KqQa0SYG.js +182 -0
- package/lib/commonlisp-bwqNqR5V.js +79 -0
- package/lib/core/crepe.d.ts +21 -0
- package/lib/core/crepe.d.ts.map +1 -0
- package/lib/core/index.d.ts +3 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/slice.d.ts +12 -0
- package/lib/core/slice.d.ts.map +1 -0
- package/lib/crystal-BViWuDpA.js +217 -0
- package/lib/css-KHXHXfXg.js +1572 -0
- package/lib/cypher-XpTt4zQ3.js +69 -0
- package/lib/d-fLig6yqY.js +139 -0
- package/lib/diff-WoKGLpy6.js +18 -0
- package/lib/dockerfile-u6f6Vw2s.js +194 -0
- package/lib/dtd-SIJRUW6K.js +91 -0
- package/lib/dylan-4HCLhpWP.js +238 -0
- package/lib/ebnf-h_0lged5.js +77 -0
- package/lib/ecl-Lf4FF0lf.js +133 -0
- package/lib/eiffel-qlw8KUyf.js +112 -0
- package/lib/elm-QRnB3zXs.js +108 -0
- package/lib/erlang-fyVKb7eK.js +488 -0
- package/lib/factor-BEeN4upY.js +65 -0
- package/lib/fcl-lRek3hEb.js +106 -0
- package/lib/feature/block-edit/handle/component.d.ts +9 -0
- package/lib/feature/block-edit/handle/component.d.ts.map +1 -0
- package/lib/feature/block-edit/handle/index.d.ts +12 -0
- package/lib/feature/block-edit/handle/index.d.ts.map +1 -0
- package/lib/feature/block-edit/index.d.ts +3 -0
- package/lib/feature/block-edit/index.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/component.d.ts +14 -0
- package/lib/feature/block-edit/menu/component.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/config.d.ts +21 -0
- package/lib/feature/block-edit/menu/config.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/icons.d.ts +14 -0
- package/lib/feature/block-edit/menu/icons.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/index.d.ts +9 -0
- package/lib/feature/block-edit/menu/index.d.ts.map +1 -0
- package/lib/feature/code-mirror/index.d.ts +3 -0
- package/lib/feature/code-mirror/index.d.ts.map +1 -0
- package/lib/feature/gap-cursor/index.d.ts +3 -0
- package/lib/feature/gap-cursor/index.d.ts.map +1 -0
- package/lib/feature/image-block/index.d.ts +3 -0
- package/lib/feature/image-block/index.d.ts.map +1 -0
- package/lib/feature/index.d.ts +18 -0
- package/lib/feature/index.d.ts.map +1 -0
- package/lib/feature/link-tooltip/consts.d.ts +5 -0
- package/lib/feature/link-tooltip/consts.d.ts.map +1 -0
- package/lib/feature/link-tooltip/index.d.ts +3 -0
- package/lib/feature/link-tooltip/index.d.ts.map +1 -0
- package/lib/feature/list-item/consts.d.ts +2 -0
- package/lib/feature/list-item/consts.d.ts.map +1 -0
- package/lib/feature/list-item/index.d.ts +3 -0
- package/lib/feature/list-item/index.d.ts.map +1 -0
- package/lib/feature/placeholder/index.d.ts +10 -0
- package/lib/feature/placeholder/index.d.ts.map +1 -0
- package/lib/feature/shared.d.ts +3 -0
- package/lib/feature/shared.d.ts.map +1 -0
- package/lib/feature/toolbar/component.d.ts +13 -0
- package/lib/feature/toolbar/component.d.ts.map +1 -0
- package/lib/feature/toolbar/consts.d.ts +5 -0
- package/lib/feature/toolbar/consts.d.ts.map +1 -0
- package/lib/feature/toolbar/index.d.ts +3 -0
- package/lib/feature/toolbar/index.d.ts.map +1 -0
- package/lib/forth-ua2bRd8T.js +60 -0
- package/lib/fortran-WnF7znuN.js +443 -0
- package/lib/gas-wowve1o7.js +183 -0
- package/lib/gherkin-m7GIChu3.js +34 -0
- package/lib/go-th443Dhb.js +158 -0
- package/lib/groovy-tR4RiZnc.js +161 -0
- package/lib/haskell-jxVBofv5.js +375 -0
- package/lib/haxe-kWPI2tq3.js +390 -0
- package/lib/hooks-82sqkbtE.js +21 -0
- package/lib/http-3GIFWUlG.js +45 -0
- package/lib/icons-HYkfuR-O.js +50 -0
- package/lib/idl-PvpMZg-l.js +947 -0
- package/lib/index-0RbcZMbq.js +8 -0
- package/lib/index-4afXjFMY.js +517 -0
- package/lib/index-7MeyepDG.js +78 -0
- package/lib/index-7QgQq3x3.js +551 -0
- package/lib/index-7pgP6qYs.js +107 -0
- package/lib/index-8DvtgRVa.js +19511 -0
- package/lib/index-8Gg-jEP4.js +288 -0
- package/lib/index-8S8qcncB.js +507 -0
- package/lib/index-9A_GmGh4.js +1039 -0
- package/lib/index-EJJfYLzA.js +928 -0
- package/lib/index-Eg39w5kL.js +984 -0
- package/lib/index-FIk_7oPb.js +168 -0
- package/lib/index-LlbrXb_n.js +368 -0
- package/lib/index-MovKtgMG.js +121 -0
- package/lib/index-N9GtIS4X.js +64 -0
- package/lib/index-Pwn25-kf.js +8 -0
- package/lib/index-SdFSDosa.js +1295 -0
- package/lib/index-W5Th22-Z.js +1744 -0
- package/lib/index-XiXSFLmI.js +20975 -0
- package/lib/index-bknOViGv.js +47 -0
- package/lib/index-bkuIUPFS.js +275 -0
- package/lib/index-jPA8J9Eo.js +8 -0
- package/lib/index-lsG76a9s.js +552 -0
- package/lib/index-oTRzPo3B.js +146 -0
- package/lib/index-rrf6_6DC.js +317 -0
- package/lib/index-vJbZIHYF.js +81 -0
- package/lib/index-vPRh55CO.js +137 -0
- package/lib/index-vxy63hib.js +323 -0
- package/lib/index-wn1_LgCS.js +99 -0
- package/lib/index-xHADmDT3.js +12 -0
- package/lib/index-yt2EpMtv.js +141 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.es.js +7 -0
- package/lib/javascript-8ZHqHagw.js +758 -0
- package/lib/jinja2-vsOFe0qD.js +154 -0
- package/lib/julia-dlp_pbN1.js +241 -0
- package/lib/livescript-Gf5R-LT6.js +273 -0
- package/lib/lua-c5Y_JsBp.js +221 -0
- package/lib/mathematica-iiGTGmUs.js +35 -0
- package/lib/mbox-ZJh86H8B.js +78 -0
- package/lib/meta-tAGyVRPE.js +511 -0
- package/lib/mirc-i0qkCa0y.js +73 -0
- package/lib/mllike-Dy551fZW.js +275 -0
- package/lib/modelica-n6tGqUT9.js +94 -0
- package/lib/mscgen-aKSbB7D9.js +104 -0
- package/lib/mumps-lNiKA6sp.js +25 -0
- package/lib/nginx--YmuCfDj.js +93 -0
- package/lib/nsis-zhS8iA09.js +62 -0
- package/lib/ntriples-E3jQl3MC.js +79 -0
- package/lib/octave-EQvkGIeG.js +144 -0
- package/lib/oz-W2cpqFf6.js +152 -0
- package/lib/pascal-lCh6ouNZ.js +79 -0
- package/lib/perl-PxEQBX0B.js +915 -0
- package/lib/pig-Y_bNcrzS.js +56 -0
- package/lib/powershell-GaQP-TZr.js +249 -0
- package/lib/properties-mbRyn54L.js +26 -0
- package/lib/prosemirror-noTDkx-k.js +4 -0
- package/lib/protobuf-8CJideyJ.js +49 -0
- package/lib/puppet-ABBaChNZ.js +45 -0
- package/lib/python-sKdHg3Ka.js +321 -0
- package/lib/q-_1yG40Nm.js +89 -0
- package/lib/r-Ziz56bHT.js +108 -0
- package/lib/rpm-ORjGOHaQ.js +57 -0
- package/lib/ruby-jlbYq0dT.js +233 -0
- package/lib/sas-2n7xeUuO.js +107 -0
- package/lib/schema-tKk3m1fu.js +62 -0
- package/lib/scheme-XCs-NPeU.js +126 -0
- package/lib/shell-0_1Um7Dq.js +184 -0
- package/lib/sieve-7uyJD1x1.js +73 -0
- package/lib/simple-mode--HIzBxba.js +95 -0
- package/lib/smalltalk-PEFzrlQ-.js +48 -0
- package/lib/solr-BLBaHahN.js +41 -0
- package/lib/sparql-4F9ZWf1b.js +204 -0
- package/lib/spreadsheet-SGSo6blj.js +49 -0
- package/lib/sql-tebLBzN0.js +291 -0
- package/lib/stex-SFJcFGOO.js +130 -0
- package/lib/stylus-rwwWYWFm.js +256 -0
- package/lib/swift-eorJ0tCv.js +238 -0
- package/lib/tcl-IwXMB8U4.js +82 -0
- package/lib/textile-ok2VyjwC.js +299 -0
- package/lib/theme/classic/index.d.ts +3 -0
- package/lib/theme/classic/index.d.ts.map +1 -0
- package/lib/theme/classic-dark/index.d.ts +3 -0
- package/lib/theme/classic-dark/index.d.ts.map +1 -0
- package/lib/theme/headless/index.d.ts +3 -0
- package/lib/theme/headless/index.d.ts.map +1 -0
- package/lib/theme/index.d.ts +8 -0
- package/lib/theme/index.d.ts.map +1 -0
- package/lib/theme/shared.d.ts +3 -0
- package/lib/theme/shared.d.ts.map +1 -0
- package/lib/tiddlywiki-DLhz8_pc.js +156 -0
- package/lib/tiki-DFAqFElY.js +183 -0
- package/lib/tippy.esm-MZ2vxByW.js +1813 -0
- package/lib/toml-ryxpTZEV.js +49 -0
- package/lib/tooltip-plugin-gcwyQdiT.js +119 -0
- package/lib/troff-ZzZyvNct.js +36 -0
- package/lib/ttcn-6gvkqqpW.js +136 -0
- package/lib/ttcn-cfg-oSu-Dq5C.js +98 -0
- package/lib/turtle-10ofr5au.js +87 -0
- package/lib/use-css-light-dom-EKWZDmbJ.js +82 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/vb-a6n6fzrD.js +74 -0
- package/lib/vbscript-dgvo8jPt.js +324 -0
- package/lib/velocity-CBncCrwO.js +97 -0
- package/lib/verilog-KlcACt6C.js +271 -0
- package/lib/vhdl-NMd7Gf35.js +117 -0
- package/lib/webidl-z1UE5DN_.js +160 -0
- package/lib/xquery-hDt5jWTp.js +431 -0
- package/lib/yacas-ftgh_qwr.js +74 -0
- package/lib/yaml-DnNTfjXK.js +53 -0
- package/lib/z80-dA1PqWe1.js +62 -0
- package/package.json +87 -0
- package/src/core/crepe.ts +98 -0
- package/src/core/index.ts +4 -0
- package/src/core/slice.ts +44 -0
- package/src/feature/block-edit/handle/component.ts +68 -0
- package/src/feature/block-edit/handle/index.ts +81 -0
- package/src/feature/block-edit/index.ts +17 -0
- package/src/feature/block-edit/menu/component.ts +210 -0
- package/src/feature/block-edit/menu/config.ts +335 -0
- package/src/feature/block-edit/menu/icons.ts +171 -0
- package/src/feature/block-edit/menu/index.ts +113 -0
- package/src/feature/block-edit/style.css +126 -0
- package/src/feature/code-mirror/index.ts +60 -0
- package/src/feature/code-mirror/style.css +159 -0
- package/src/feature/gap-cursor/index.ts +31 -0
- package/src/feature/image-block/index.ts +59 -0
- package/src/feature/image-block/style.css +215 -0
- package/src/feature/index.ts +66 -0
- package/src/feature/link-tooltip/consts.ts +47 -0
- package/src/feature/link-tooltip/index.ts +22 -0
- package/src/feature/link-tooltip/style.css +107 -0
- package/src/feature/list-item/consts.ts +15 -0
- package/src/feature/list-item/index.ts +30 -0
- package/src/feature/list-item/style.css +23 -0
- package/src/feature/placeholder/index.ts +87 -0
- package/src/feature/placeholder/style.css +9 -0
- package/src/feature/shared.ts +4 -0
- package/src/feature/toolbar/component.ts +101 -0
- package/src/feature/toolbar/consts.ts +26 -0
- package/src/feature/toolbar/index.ts +92 -0
- package/src/feature/toolbar/style.css +37 -0
- package/src/index.ts +5 -0
- package/src/theme/classic/index.ts +12 -0
- package/src/theme/classic/style.css +192 -0
- package/src/theme/classic-dark/index.ts +12 -0
- package/src/theme/classic-dark/style.css +197 -0
- package/src/theme/headless/index.ts +9 -0
- package/src/theme/index.ts +26 -0
- package/src/theme/shared.ts +4 -0
- package/src/utils/index.ts +12 -0
- 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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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
|
+
};
|