@pyreon/code 0.5.0
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/lib/analysis/index.js.html +5406 -0
- package/lib/dist-B5vB-rif.js +3904 -0
- package/lib/dist-B5vB-rif.js.map +1 -0
- package/lib/dist-BAfzu5eu.js +1428 -0
- package/lib/dist-BAfzu5eu.js.map +1 -0
- package/lib/dist-BLlV_D16.js +1166 -0
- package/lib/dist-BLlV_D16.js.map +1 -0
- package/lib/dist-BNmKLTu8.js +373 -0
- package/lib/dist-BNmKLTu8.js.map +1 -0
- package/lib/dist-BZtTlC1J.js +692 -0
- package/lib/dist-BZtTlC1J.js.map +1 -0
- package/lib/dist-CTDqGIAf.js +856 -0
- package/lib/dist-CTDqGIAf.js.map +1 -0
- package/lib/dist-CTPisNZp.js +83 -0
- package/lib/dist-CTPisNZp.js.map +1 -0
- package/lib/dist-Ce2tvOxv.js +379 -0
- package/lib/dist-Ce2tvOxv.js.map +1 -0
- package/lib/dist-CttF0OTv.js +465 -0
- package/lib/dist-CttF0OTv.js.map +1 -0
- package/lib/dist-DS2tluW9.js +818 -0
- package/lib/dist-DS2tluW9.js.map +1 -0
- package/lib/dist-DUNx9ldu.js +460 -0
- package/lib/dist-DUNx9ldu.js.map +1 -0
- package/lib/dist-Dej_yf3k.js +473 -0
- package/lib/dist-Dej_yf3k.js.map +1 -0
- package/lib/dist-DshStUxU.js +283 -0
- package/lib/dist-DshStUxU.js.map +1 -0
- package/lib/dist-qTrOe7xY.js +461 -0
- package/lib/dist-qTrOe7xY.js.map +1 -0
- package/lib/dist-v09vikKr.js +2421 -0
- package/lib/dist-v09vikKr.js.map +1 -0
- package/lib/index.js +915 -0
- package/lib/index.js.map +1 -0
- package/lib/types/dist.d.ts +798 -0
- package/lib/types/dist.d.ts.map +1 -0
- package/lib/types/dist10.d.ts +67 -0
- package/lib/types/dist10.d.ts.map +1 -0
- package/lib/types/dist11.d.ts +126 -0
- package/lib/types/dist11.d.ts.map +1 -0
- package/lib/types/dist12.d.ts +21 -0
- package/lib/types/dist12.d.ts.map +1 -0
- package/lib/types/dist13.d.ts +404 -0
- package/lib/types/dist13.d.ts.map +1 -0
- package/lib/types/dist14.d.ts +292 -0
- package/lib/types/dist14.d.ts.map +1 -0
- package/lib/types/dist15.d.ts +132 -0
- package/lib/types/dist15.d.ts.map +1 -0
- package/lib/types/dist2.d.ts +15 -0
- package/lib/types/dist2.d.ts.map +1 -0
- package/lib/types/dist3.d.ts +106 -0
- package/lib/types/dist3.d.ts.map +1 -0
- package/lib/types/dist4.d.ts +67 -0
- package/lib/types/dist4.d.ts.map +1 -0
- package/lib/types/dist5.d.ts +95 -0
- package/lib/types/dist5.d.ts.map +1 -0
- package/lib/types/dist6.d.ts +330 -0
- package/lib/types/dist6.d.ts.map +1 -0
- package/lib/types/dist7.d.ts +15 -0
- package/lib/types/dist7.d.ts.map +1 -0
- package/lib/types/dist8.d.ts +15 -0
- package/lib/types/dist8.d.ts.map +1 -0
- package/lib/types/dist9.d.ts +635 -0
- package/lib/types/dist9.d.ts.map +1 -0
- package/lib/types/index.d.ts +852 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index2.d.ts +347 -0
- package/lib/types/index2.d.ts.map +1 -0
- package/package.json +79 -0
- package/src/components/code-editor.tsx +42 -0
- package/src/components/diff-editor.tsx +97 -0
- package/src/components/tabbed-editor.tsx +86 -0
- package/src/editor.ts +652 -0
- package/src/index.ts +52 -0
- package/src/languages.ts +77 -0
- package/src/minimap.ts +160 -0
- package/src/tabbed-editor.ts +231 -0
- package/src/tests/code.test.ts +505 -0
- package/src/themes.ts +87 -0
- package/src/types.ts +253 -0
|
@@ -0,0 +1,1428 @@
|
|
|
1
|
+
import { a as ExternalTokenizer, h as parseMixed, i as ContextTracker, n as styleTags, o as LRParser, r as tags } from "./dist-B5vB-rif.js";
|
|
2
|
+
import { n as cssLanguage, t as css } from "./dist-BLlV_D16.js";
|
|
3
|
+
import { a as tsxLanguage, i as jsxLanguage, n as javascript, o as typescriptLanguage, r as javascriptLanguage } from "./dist-CTDqGIAf.js";
|
|
4
|
+
import { LRLanguage, LanguageSupport, bracketMatchingHandle, foldNodeProp, indentNodeProp, syntaxTree } from "@codemirror/language";
|
|
5
|
+
import { EditorSelection } from "@codemirror/state";
|
|
6
|
+
import { EditorView } from "@codemirror/view";
|
|
7
|
+
|
|
8
|
+
//#region ../../node_modules/.bun/@lezer+html@1.3.13/node_modules/@lezer/html/dist/index.js
|
|
9
|
+
const scriptText = 55, StartCloseScriptTag = 1, styleText = 56, StartCloseStyleTag = 2, textareaText = 57, StartCloseTextareaTag = 3, EndTag = 4, SelfClosingEndTag = 5, StartTag = 6, StartScriptTag = 7, StartStyleTag = 8, StartTextareaTag = 9, StartSelfClosingTag = 10, StartCloseTag = 11, NoMatchStartCloseTag = 12, MismatchedStartCloseTag = 13, missingCloseTag = 58, IncompleteTag = 14, IncompleteCloseTag = 15, commentContent$1 = 59, Element = 21, TagName = 23, Attribute = 24, AttributeName = 25, AttributeValue = 27, UnquotedAttributeValue = 28, ScriptText = 29, StyleText = 32, TextareaText = 35, OpenTag = 37, CloseTag = 38, Dialect_noMatch = 0, Dialect_selfClosing = 1;
|
|
10
|
+
const selfClosers$1 = {
|
|
11
|
+
area: true,
|
|
12
|
+
base: true,
|
|
13
|
+
br: true,
|
|
14
|
+
col: true,
|
|
15
|
+
command: true,
|
|
16
|
+
embed: true,
|
|
17
|
+
frame: true,
|
|
18
|
+
hr: true,
|
|
19
|
+
img: true,
|
|
20
|
+
input: true,
|
|
21
|
+
keygen: true,
|
|
22
|
+
link: true,
|
|
23
|
+
meta: true,
|
|
24
|
+
param: true,
|
|
25
|
+
source: true,
|
|
26
|
+
track: true,
|
|
27
|
+
wbr: true,
|
|
28
|
+
menuitem: true
|
|
29
|
+
};
|
|
30
|
+
const implicitlyClosed = {
|
|
31
|
+
dd: true,
|
|
32
|
+
li: true,
|
|
33
|
+
optgroup: true,
|
|
34
|
+
option: true,
|
|
35
|
+
p: true,
|
|
36
|
+
rp: true,
|
|
37
|
+
rt: true,
|
|
38
|
+
tbody: true,
|
|
39
|
+
td: true,
|
|
40
|
+
tfoot: true,
|
|
41
|
+
th: true,
|
|
42
|
+
tr: true
|
|
43
|
+
};
|
|
44
|
+
const closeOnOpen = {
|
|
45
|
+
dd: {
|
|
46
|
+
dd: true,
|
|
47
|
+
dt: true
|
|
48
|
+
},
|
|
49
|
+
dt: {
|
|
50
|
+
dd: true,
|
|
51
|
+
dt: true
|
|
52
|
+
},
|
|
53
|
+
li: { li: true },
|
|
54
|
+
option: {
|
|
55
|
+
option: true,
|
|
56
|
+
optgroup: true
|
|
57
|
+
},
|
|
58
|
+
optgroup: { optgroup: true },
|
|
59
|
+
p: {
|
|
60
|
+
address: true,
|
|
61
|
+
article: true,
|
|
62
|
+
aside: true,
|
|
63
|
+
blockquote: true,
|
|
64
|
+
dir: true,
|
|
65
|
+
div: true,
|
|
66
|
+
dl: true,
|
|
67
|
+
fieldset: true,
|
|
68
|
+
footer: true,
|
|
69
|
+
form: true,
|
|
70
|
+
h1: true,
|
|
71
|
+
h2: true,
|
|
72
|
+
h3: true,
|
|
73
|
+
h4: true,
|
|
74
|
+
h5: true,
|
|
75
|
+
h6: true,
|
|
76
|
+
header: true,
|
|
77
|
+
hgroup: true,
|
|
78
|
+
hr: true,
|
|
79
|
+
menu: true,
|
|
80
|
+
nav: true,
|
|
81
|
+
ol: true,
|
|
82
|
+
p: true,
|
|
83
|
+
pre: true,
|
|
84
|
+
section: true,
|
|
85
|
+
table: true,
|
|
86
|
+
ul: true
|
|
87
|
+
},
|
|
88
|
+
rp: {
|
|
89
|
+
rp: true,
|
|
90
|
+
rt: true
|
|
91
|
+
},
|
|
92
|
+
rt: {
|
|
93
|
+
rp: true,
|
|
94
|
+
rt: true
|
|
95
|
+
},
|
|
96
|
+
tbody: {
|
|
97
|
+
tbody: true,
|
|
98
|
+
tfoot: true
|
|
99
|
+
},
|
|
100
|
+
td: {
|
|
101
|
+
td: true,
|
|
102
|
+
th: true
|
|
103
|
+
},
|
|
104
|
+
tfoot: { tbody: true },
|
|
105
|
+
th: {
|
|
106
|
+
td: true,
|
|
107
|
+
th: true
|
|
108
|
+
},
|
|
109
|
+
thead: {
|
|
110
|
+
tbody: true,
|
|
111
|
+
tfoot: true
|
|
112
|
+
},
|
|
113
|
+
tr: { tr: true }
|
|
114
|
+
};
|
|
115
|
+
function nameChar(ch) {
|
|
116
|
+
return ch == 45 || ch == 46 || ch == 58 || ch >= 65 && ch <= 90 || ch == 95 || ch >= 97 && ch <= 122 || ch >= 161;
|
|
117
|
+
}
|
|
118
|
+
let cachedName = null, cachedInput = null, cachedPos = 0;
|
|
119
|
+
function tagNameAfter(input, offset) {
|
|
120
|
+
let pos = input.pos + offset;
|
|
121
|
+
if (cachedPos == pos && cachedInput == input) return cachedName;
|
|
122
|
+
let next = input.peek(offset), name = "";
|
|
123
|
+
for (;;) {
|
|
124
|
+
if (!nameChar(next)) break;
|
|
125
|
+
name += String.fromCharCode(next);
|
|
126
|
+
next = input.peek(++offset);
|
|
127
|
+
}
|
|
128
|
+
cachedInput = input;
|
|
129
|
+
cachedPos = pos;
|
|
130
|
+
return cachedName = name ? name.toLowerCase() : next == question || next == bang ? void 0 : null;
|
|
131
|
+
}
|
|
132
|
+
const lessThan = 60, greaterThan = 62, slash = 47, question = 63, bang = 33, dash = 45;
|
|
133
|
+
function ElementContext(name, parent) {
|
|
134
|
+
this.name = name;
|
|
135
|
+
this.parent = parent;
|
|
136
|
+
}
|
|
137
|
+
const startTagTerms = [
|
|
138
|
+
StartTag,
|
|
139
|
+
StartSelfClosingTag,
|
|
140
|
+
StartScriptTag,
|
|
141
|
+
StartStyleTag,
|
|
142
|
+
StartTextareaTag
|
|
143
|
+
];
|
|
144
|
+
const elementContext = new ContextTracker({
|
|
145
|
+
start: null,
|
|
146
|
+
shift(context, term, stack, input) {
|
|
147
|
+
return startTagTerms.indexOf(term) > -1 ? new ElementContext(tagNameAfter(input, 1) || "", context) : context;
|
|
148
|
+
},
|
|
149
|
+
reduce(context, term) {
|
|
150
|
+
return term == Element && context ? context.parent : context;
|
|
151
|
+
},
|
|
152
|
+
reuse(context, node, stack, input) {
|
|
153
|
+
let type = node.type.id;
|
|
154
|
+
return type == StartTag || type == OpenTag ? new ElementContext(tagNameAfter(input, 1) || "", context) : context;
|
|
155
|
+
},
|
|
156
|
+
strict: false
|
|
157
|
+
});
|
|
158
|
+
const tagStart = new ExternalTokenizer((input, stack) => {
|
|
159
|
+
if (input.next != lessThan) {
|
|
160
|
+
if (input.next < 0 && stack.context) input.acceptToken(missingCloseTag);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
input.advance();
|
|
164
|
+
let close = input.next == slash;
|
|
165
|
+
if (close) input.advance();
|
|
166
|
+
let name = tagNameAfter(input, 0);
|
|
167
|
+
if (name === void 0) return;
|
|
168
|
+
if (!name) return input.acceptToken(close ? IncompleteCloseTag : IncompleteTag);
|
|
169
|
+
let parent = stack.context ? stack.context.name : null;
|
|
170
|
+
if (close) {
|
|
171
|
+
if (name == parent) return input.acceptToken(StartCloseTag);
|
|
172
|
+
if (parent && implicitlyClosed[parent]) return input.acceptToken(missingCloseTag, -2);
|
|
173
|
+
if (stack.dialectEnabled(Dialect_noMatch)) return input.acceptToken(NoMatchStartCloseTag);
|
|
174
|
+
for (let cx = stack.context; cx; cx = cx.parent) if (cx.name == name) return;
|
|
175
|
+
input.acceptToken(MismatchedStartCloseTag);
|
|
176
|
+
} else {
|
|
177
|
+
if (name == "script") return input.acceptToken(StartScriptTag);
|
|
178
|
+
if (name == "style") return input.acceptToken(StartStyleTag);
|
|
179
|
+
if (name == "textarea") return input.acceptToken(StartTextareaTag);
|
|
180
|
+
if (selfClosers$1.hasOwnProperty(name)) return input.acceptToken(StartSelfClosingTag);
|
|
181
|
+
if (parent && closeOnOpen[parent] && closeOnOpen[parent][name]) input.acceptToken(missingCloseTag, -1);
|
|
182
|
+
else input.acceptToken(StartTag);
|
|
183
|
+
}
|
|
184
|
+
}, { contextual: true });
|
|
185
|
+
const commentContent = new ExternalTokenizer((input) => {
|
|
186
|
+
for (let dashes = 0, i = 0;; i++) {
|
|
187
|
+
if (input.next < 0) {
|
|
188
|
+
if (i) input.acceptToken(commentContent$1);
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
if (input.next == dash) dashes++;
|
|
192
|
+
else if (input.next == greaterThan && dashes >= 2) {
|
|
193
|
+
if (i >= 3) input.acceptToken(commentContent$1, -2);
|
|
194
|
+
break;
|
|
195
|
+
} else dashes = 0;
|
|
196
|
+
input.advance();
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
function inForeignElement(context) {
|
|
200
|
+
for (; context; context = context.parent) if (context.name == "svg" || context.name == "math") return true;
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
const endTag = new ExternalTokenizer((input, stack) => {
|
|
204
|
+
if (input.next == slash && input.peek(1) == greaterThan) {
|
|
205
|
+
let selfClosing = stack.dialectEnabled(Dialect_selfClosing) || inForeignElement(stack.context);
|
|
206
|
+
input.acceptToken(selfClosing ? SelfClosingEndTag : EndTag, 2);
|
|
207
|
+
} else if (input.next == greaterThan) input.acceptToken(EndTag, 1);
|
|
208
|
+
});
|
|
209
|
+
function contentTokenizer(tag, textToken, endToken) {
|
|
210
|
+
let lastState = 2 + tag.length;
|
|
211
|
+
return new ExternalTokenizer((input) => {
|
|
212
|
+
for (let state = 0, matchedLen = 0, i = 0;; i++) {
|
|
213
|
+
if (input.next < 0) {
|
|
214
|
+
if (i) input.acceptToken(textToken);
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
if (state == 0 && input.next == lessThan || state == 1 && input.next == slash || state >= 2 && state < lastState && input.next == tag.charCodeAt(state - 2)) {
|
|
218
|
+
state++;
|
|
219
|
+
matchedLen++;
|
|
220
|
+
} else if (state == lastState && input.next == greaterThan) {
|
|
221
|
+
if (i > matchedLen) input.acceptToken(textToken, -matchedLen);
|
|
222
|
+
else input.acceptToken(endToken, -(matchedLen - 2));
|
|
223
|
+
break;
|
|
224
|
+
} else if ((input.next == 10 || input.next == 13) && i) {
|
|
225
|
+
input.acceptToken(textToken, 1);
|
|
226
|
+
break;
|
|
227
|
+
} else state = matchedLen = 0;
|
|
228
|
+
input.advance();
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
const scriptTokens = contentTokenizer("script", scriptText, StartCloseScriptTag);
|
|
233
|
+
const styleTokens = contentTokenizer("style", styleText, StartCloseStyleTag);
|
|
234
|
+
const textareaTokens = contentTokenizer("textarea", textareaText, StartCloseTextareaTag);
|
|
235
|
+
const htmlHighlighting = styleTags({
|
|
236
|
+
"Text RawText IncompleteTag IncompleteCloseTag": tags.content,
|
|
237
|
+
"StartTag StartCloseTag SelfClosingEndTag EndTag": tags.angleBracket,
|
|
238
|
+
TagName: tags.tagName,
|
|
239
|
+
"MismatchedCloseTag/TagName": [tags.tagName, tags.invalid],
|
|
240
|
+
AttributeName: tags.attributeName,
|
|
241
|
+
"AttributeValue UnquotedAttributeValue": tags.attributeValue,
|
|
242
|
+
Is: tags.definitionOperator,
|
|
243
|
+
"EntityReference CharacterReference": tags.character,
|
|
244
|
+
Comment: tags.blockComment,
|
|
245
|
+
ProcessingInst: tags.processingInstruction,
|
|
246
|
+
DoctypeDecl: tags.documentMeta
|
|
247
|
+
});
|
|
248
|
+
const parser = LRParser.deserialize({
|
|
249
|
+
version: 14,
|
|
250
|
+
states: ",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&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O!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",
|
|
252
|
+
goto: "%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",
|
|
253
|
+
nodeNames: "⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",
|
|
254
|
+
maxTerm: 68,
|
|
255
|
+
context: elementContext,
|
|
256
|
+
nodeProps: [
|
|
257
|
+
[
|
|
258
|
+
"closedBy",
|
|
259
|
+
-10,
|
|
260
|
+
1,
|
|
261
|
+
2,
|
|
262
|
+
3,
|
|
263
|
+
7,
|
|
264
|
+
8,
|
|
265
|
+
9,
|
|
266
|
+
10,
|
|
267
|
+
11,
|
|
268
|
+
12,
|
|
269
|
+
13,
|
|
270
|
+
"EndTag",
|
|
271
|
+
6,
|
|
272
|
+
"EndTag SelfClosingEndTag",
|
|
273
|
+
-4,
|
|
274
|
+
22,
|
|
275
|
+
31,
|
|
276
|
+
34,
|
|
277
|
+
37,
|
|
278
|
+
"CloseTag"
|
|
279
|
+
],
|
|
280
|
+
[
|
|
281
|
+
"openedBy",
|
|
282
|
+
4,
|
|
283
|
+
"StartTag StartCloseTag",
|
|
284
|
+
5,
|
|
285
|
+
"StartTag",
|
|
286
|
+
-4,
|
|
287
|
+
30,
|
|
288
|
+
33,
|
|
289
|
+
36,
|
|
290
|
+
38,
|
|
291
|
+
"OpenTag"
|
|
292
|
+
],
|
|
293
|
+
[
|
|
294
|
+
"group",
|
|
295
|
+
-10,
|
|
296
|
+
14,
|
|
297
|
+
15,
|
|
298
|
+
18,
|
|
299
|
+
19,
|
|
300
|
+
20,
|
|
301
|
+
21,
|
|
302
|
+
40,
|
|
303
|
+
41,
|
|
304
|
+
42,
|
|
305
|
+
43,
|
|
306
|
+
"Entity",
|
|
307
|
+
17,
|
|
308
|
+
"Entity TextContent",
|
|
309
|
+
-3,
|
|
310
|
+
29,
|
|
311
|
+
32,
|
|
312
|
+
35,
|
|
313
|
+
"TextContent Entity"
|
|
314
|
+
],
|
|
315
|
+
[
|
|
316
|
+
"isolate",
|
|
317
|
+
-11,
|
|
318
|
+
22,
|
|
319
|
+
30,
|
|
320
|
+
31,
|
|
321
|
+
33,
|
|
322
|
+
34,
|
|
323
|
+
36,
|
|
324
|
+
37,
|
|
325
|
+
38,
|
|
326
|
+
39,
|
|
327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6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",
|
|
341
|
+
tokenizers: [
|
|
342
|
+
scriptTokens,
|
|
343
|
+
styleTokens,
|
|
344
|
+
textareaTokens,
|
|
345
|
+
endTag,
|
|
346
|
+
tagStart,
|
|
347
|
+
commentContent,
|
|
348
|
+
0,
|
|
349
|
+
1,
|
|
350
|
+
2,
|
|
351
|
+
3,
|
|
352
|
+
4,
|
|
353
|
+
5
|
|
354
|
+
],
|
|
355
|
+
topRules: { "Document": [0, 16] },
|
|
356
|
+
dialects: {
|
|
357
|
+
noMatch: 0,
|
|
358
|
+
selfClosing: 515
|
|
359
|
+
},
|
|
360
|
+
tokenPrec: 517
|
|
361
|
+
});
|
|
362
|
+
function getAttrs(openTag, input) {
|
|
363
|
+
let attrs = Object.create(null);
|
|
364
|
+
for (let att of openTag.getChildren(Attribute)) {
|
|
365
|
+
let name = att.getChild(AttributeName), value = att.getChild(AttributeValue) || att.getChild(UnquotedAttributeValue);
|
|
366
|
+
if (name) attrs[input.read(name.from, name.to)] = !value ? "" : value.type.id == AttributeValue ? input.read(value.from + 1, value.to - 1) : input.read(value.from, value.to);
|
|
367
|
+
}
|
|
368
|
+
return attrs;
|
|
369
|
+
}
|
|
370
|
+
function findTagName(openTag, input) {
|
|
371
|
+
let tagNameNode = openTag.getChild(TagName);
|
|
372
|
+
return tagNameNode ? input.read(tagNameNode.from, tagNameNode.to) : " ";
|
|
373
|
+
}
|
|
374
|
+
function maybeNest(node, input, tags) {
|
|
375
|
+
let attrs;
|
|
376
|
+
for (let tag of tags) if (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(node.node.parent.firstChild, input)))) return {
|
|
377
|
+
parser: tag.parser,
|
|
378
|
+
bracketed: true
|
|
379
|
+
};
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
function configureNesting(tags = [], attributes = []) {
|
|
383
|
+
let script = [], style = [], textarea = [], other = [];
|
|
384
|
+
for (let tag of tags) (tag.tag == "script" ? script : tag.tag == "style" ? style : tag.tag == "textarea" ? textarea : other).push(tag);
|
|
385
|
+
let attrs = attributes.length ? Object.create(null) : null;
|
|
386
|
+
for (let attr of attributes) (attrs[attr.name] || (attrs[attr.name] = [])).push(attr);
|
|
387
|
+
return parseMixed((node, input) => {
|
|
388
|
+
let id = node.type.id;
|
|
389
|
+
if (id == ScriptText) return maybeNest(node, input, script);
|
|
390
|
+
if (id == StyleText) return maybeNest(node, input, style);
|
|
391
|
+
if (id == TextareaText) return maybeNest(node, input, textarea);
|
|
392
|
+
if (id == Element && other.length) {
|
|
393
|
+
let n = node.node, open = n.firstChild, tagName = open && findTagName(open, input), attrs;
|
|
394
|
+
if (tagName) {
|
|
395
|
+
for (let tag of other) if (tag.tag == tagName && (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(open, input))))) {
|
|
396
|
+
let close = n.lastChild;
|
|
397
|
+
let to = close.type.id == CloseTag ? close.from : n.to;
|
|
398
|
+
if (to > open.to) return {
|
|
399
|
+
parser: tag.parser,
|
|
400
|
+
overlay: [{
|
|
401
|
+
from: open.to,
|
|
402
|
+
to
|
|
403
|
+
}]
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
if (attrs && id == Attribute) {
|
|
409
|
+
let n = node.node, nameNode;
|
|
410
|
+
if (nameNode = n.firstChild) {
|
|
411
|
+
let matches = attrs[input.read(nameNode.from, nameNode.to)];
|
|
412
|
+
if (matches) for (let attr of matches) {
|
|
413
|
+
if (attr.tagName && attr.tagName != findTagName(n.parent, input)) continue;
|
|
414
|
+
let value = n.lastChild;
|
|
415
|
+
if (value.type.id == AttributeValue) {
|
|
416
|
+
let from = value.from + 1;
|
|
417
|
+
let last = value.lastChild, to = value.to - (last && last.isError ? 0 : 1);
|
|
418
|
+
if (to > from) return {
|
|
419
|
+
parser: attr.parser,
|
|
420
|
+
overlay: [{
|
|
421
|
+
from,
|
|
422
|
+
to
|
|
423
|
+
}],
|
|
424
|
+
bracketed: true
|
|
425
|
+
};
|
|
426
|
+
} else if (value.type.id == UnquotedAttributeValue) return {
|
|
427
|
+
parser: attr.parser,
|
|
428
|
+
overlay: [{
|
|
429
|
+
from: value.from,
|
|
430
|
+
to: value.to
|
|
431
|
+
}]
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
return null;
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region ../../node_modules/.bun/@codemirror+lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js
|
|
442
|
+
const Targets = [
|
|
443
|
+
"_blank",
|
|
444
|
+
"_self",
|
|
445
|
+
"_top",
|
|
446
|
+
"_parent"
|
|
447
|
+
];
|
|
448
|
+
const Charsets = [
|
|
449
|
+
"ascii",
|
|
450
|
+
"utf-8",
|
|
451
|
+
"utf-16",
|
|
452
|
+
"latin1",
|
|
453
|
+
"latin1"
|
|
454
|
+
];
|
|
455
|
+
const Methods = [
|
|
456
|
+
"get",
|
|
457
|
+
"post",
|
|
458
|
+
"put",
|
|
459
|
+
"delete"
|
|
460
|
+
];
|
|
461
|
+
const Encs = [
|
|
462
|
+
"application/x-www-form-urlencoded",
|
|
463
|
+
"multipart/form-data",
|
|
464
|
+
"text/plain"
|
|
465
|
+
];
|
|
466
|
+
const Bool = ["true", "false"];
|
|
467
|
+
const S = {};
|
|
468
|
+
const Tags = {
|
|
469
|
+
a: { attrs: {
|
|
470
|
+
href: null,
|
|
471
|
+
ping: null,
|
|
472
|
+
type: null,
|
|
473
|
+
media: null,
|
|
474
|
+
target: Targets,
|
|
475
|
+
hreflang: null
|
|
476
|
+
} },
|
|
477
|
+
abbr: S,
|
|
478
|
+
address: S,
|
|
479
|
+
area: { attrs: {
|
|
480
|
+
alt: null,
|
|
481
|
+
coords: null,
|
|
482
|
+
href: null,
|
|
483
|
+
target: null,
|
|
484
|
+
ping: null,
|
|
485
|
+
media: null,
|
|
486
|
+
hreflang: null,
|
|
487
|
+
type: null,
|
|
488
|
+
shape: [
|
|
489
|
+
"default",
|
|
490
|
+
"rect",
|
|
491
|
+
"circle",
|
|
492
|
+
"poly"
|
|
493
|
+
]
|
|
494
|
+
} },
|
|
495
|
+
article: S,
|
|
496
|
+
aside: S,
|
|
497
|
+
audio: { attrs: {
|
|
498
|
+
src: null,
|
|
499
|
+
mediagroup: null,
|
|
500
|
+
crossorigin: ["anonymous", "use-credentials"],
|
|
501
|
+
preload: [
|
|
502
|
+
"none",
|
|
503
|
+
"metadata",
|
|
504
|
+
"auto"
|
|
505
|
+
],
|
|
506
|
+
autoplay: ["autoplay"],
|
|
507
|
+
loop: ["loop"],
|
|
508
|
+
controls: ["controls"]
|
|
509
|
+
} },
|
|
510
|
+
b: S,
|
|
511
|
+
base: { attrs: {
|
|
512
|
+
href: null,
|
|
513
|
+
target: Targets
|
|
514
|
+
} },
|
|
515
|
+
bdi: S,
|
|
516
|
+
bdo: S,
|
|
517
|
+
blockquote: { attrs: { cite: null } },
|
|
518
|
+
body: S,
|
|
519
|
+
br: S,
|
|
520
|
+
button: { attrs: {
|
|
521
|
+
form: null,
|
|
522
|
+
formaction: null,
|
|
523
|
+
name: null,
|
|
524
|
+
value: null,
|
|
525
|
+
autofocus: ["autofocus"],
|
|
526
|
+
disabled: ["autofocus"],
|
|
527
|
+
formenctype: Encs,
|
|
528
|
+
formmethod: Methods,
|
|
529
|
+
formnovalidate: ["novalidate"],
|
|
530
|
+
formtarget: Targets,
|
|
531
|
+
type: [
|
|
532
|
+
"submit",
|
|
533
|
+
"reset",
|
|
534
|
+
"button"
|
|
535
|
+
]
|
|
536
|
+
} },
|
|
537
|
+
canvas: { attrs: {
|
|
538
|
+
width: null,
|
|
539
|
+
height: null
|
|
540
|
+
} },
|
|
541
|
+
caption: S,
|
|
542
|
+
center: S,
|
|
543
|
+
cite: S,
|
|
544
|
+
code: S,
|
|
545
|
+
col: { attrs: { span: null } },
|
|
546
|
+
colgroup: { attrs: { span: null } },
|
|
547
|
+
command: { attrs: {
|
|
548
|
+
type: [
|
|
549
|
+
"command",
|
|
550
|
+
"checkbox",
|
|
551
|
+
"radio"
|
|
552
|
+
],
|
|
553
|
+
label: null,
|
|
554
|
+
icon: null,
|
|
555
|
+
radiogroup: null,
|
|
556
|
+
command: null,
|
|
557
|
+
title: null,
|
|
558
|
+
disabled: ["disabled"],
|
|
559
|
+
checked: ["checked"]
|
|
560
|
+
} },
|
|
561
|
+
data: { attrs: { value: null } },
|
|
562
|
+
datagrid: { attrs: {
|
|
563
|
+
disabled: ["disabled"],
|
|
564
|
+
multiple: ["multiple"]
|
|
565
|
+
} },
|
|
566
|
+
datalist: { attrs: { data: null } },
|
|
567
|
+
dd: S,
|
|
568
|
+
del: { attrs: {
|
|
569
|
+
cite: null,
|
|
570
|
+
datetime: null
|
|
571
|
+
} },
|
|
572
|
+
details: { attrs: { open: ["open"] } },
|
|
573
|
+
dfn: S,
|
|
574
|
+
div: S,
|
|
575
|
+
dl: S,
|
|
576
|
+
dt: S,
|
|
577
|
+
em: S,
|
|
578
|
+
embed: { attrs: {
|
|
579
|
+
src: null,
|
|
580
|
+
type: null,
|
|
581
|
+
width: null,
|
|
582
|
+
height: null
|
|
583
|
+
} },
|
|
584
|
+
eventsource: { attrs: { src: null } },
|
|
585
|
+
fieldset: { attrs: {
|
|
586
|
+
disabled: ["disabled"],
|
|
587
|
+
form: null,
|
|
588
|
+
name: null
|
|
589
|
+
} },
|
|
590
|
+
figcaption: S,
|
|
591
|
+
figure: S,
|
|
592
|
+
footer: S,
|
|
593
|
+
form: { attrs: {
|
|
594
|
+
action: null,
|
|
595
|
+
name: null,
|
|
596
|
+
"accept-charset": Charsets,
|
|
597
|
+
autocomplete: ["on", "off"],
|
|
598
|
+
enctype: Encs,
|
|
599
|
+
method: Methods,
|
|
600
|
+
novalidate: ["novalidate"],
|
|
601
|
+
target: Targets
|
|
602
|
+
} },
|
|
603
|
+
h1: S,
|
|
604
|
+
h2: S,
|
|
605
|
+
h3: S,
|
|
606
|
+
h4: S,
|
|
607
|
+
h5: S,
|
|
608
|
+
h6: S,
|
|
609
|
+
head: { children: [
|
|
610
|
+
"title",
|
|
611
|
+
"base",
|
|
612
|
+
"link",
|
|
613
|
+
"style",
|
|
614
|
+
"meta",
|
|
615
|
+
"script",
|
|
616
|
+
"noscript",
|
|
617
|
+
"command"
|
|
618
|
+
] },
|
|
619
|
+
header: S,
|
|
620
|
+
hgroup: S,
|
|
621
|
+
hr: S,
|
|
622
|
+
html: { attrs: { manifest: null } },
|
|
623
|
+
i: S,
|
|
624
|
+
iframe: { attrs: {
|
|
625
|
+
src: null,
|
|
626
|
+
srcdoc: null,
|
|
627
|
+
name: null,
|
|
628
|
+
width: null,
|
|
629
|
+
height: null,
|
|
630
|
+
sandbox: [
|
|
631
|
+
"allow-top-navigation",
|
|
632
|
+
"allow-same-origin",
|
|
633
|
+
"allow-forms",
|
|
634
|
+
"allow-scripts"
|
|
635
|
+
],
|
|
636
|
+
seamless: ["seamless"]
|
|
637
|
+
} },
|
|
638
|
+
img: { attrs: {
|
|
639
|
+
alt: null,
|
|
640
|
+
src: null,
|
|
641
|
+
ismap: null,
|
|
642
|
+
usemap: null,
|
|
643
|
+
width: null,
|
|
644
|
+
height: null,
|
|
645
|
+
crossorigin: ["anonymous", "use-credentials"]
|
|
646
|
+
} },
|
|
647
|
+
input: { attrs: {
|
|
648
|
+
alt: null,
|
|
649
|
+
dirname: null,
|
|
650
|
+
form: null,
|
|
651
|
+
formaction: null,
|
|
652
|
+
height: null,
|
|
653
|
+
list: null,
|
|
654
|
+
max: null,
|
|
655
|
+
maxlength: null,
|
|
656
|
+
min: null,
|
|
657
|
+
name: null,
|
|
658
|
+
pattern: null,
|
|
659
|
+
placeholder: null,
|
|
660
|
+
size: null,
|
|
661
|
+
src: null,
|
|
662
|
+
step: null,
|
|
663
|
+
value: null,
|
|
664
|
+
width: null,
|
|
665
|
+
accept: [
|
|
666
|
+
"audio/*",
|
|
667
|
+
"video/*",
|
|
668
|
+
"image/*"
|
|
669
|
+
],
|
|
670
|
+
autocomplete: ["on", "off"],
|
|
671
|
+
autofocus: ["autofocus"],
|
|
672
|
+
checked: ["checked"],
|
|
673
|
+
disabled: ["disabled"],
|
|
674
|
+
formenctype: Encs,
|
|
675
|
+
formmethod: Methods,
|
|
676
|
+
formnovalidate: ["novalidate"],
|
|
677
|
+
formtarget: Targets,
|
|
678
|
+
multiple: ["multiple"],
|
|
679
|
+
readonly: ["readonly"],
|
|
680
|
+
required: ["required"],
|
|
681
|
+
type: [
|
|
682
|
+
"hidden",
|
|
683
|
+
"text",
|
|
684
|
+
"search",
|
|
685
|
+
"tel",
|
|
686
|
+
"url",
|
|
687
|
+
"email",
|
|
688
|
+
"password",
|
|
689
|
+
"datetime",
|
|
690
|
+
"date",
|
|
691
|
+
"month",
|
|
692
|
+
"week",
|
|
693
|
+
"time",
|
|
694
|
+
"datetime-local",
|
|
695
|
+
"number",
|
|
696
|
+
"range",
|
|
697
|
+
"color",
|
|
698
|
+
"checkbox",
|
|
699
|
+
"radio",
|
|
700
|
+
"file",
|
|
701
|
+
"submit",
|
|
702
|
+
"image",
|
|
703
|
+
"reset",
|
|
704
|
+
"button"
|
|
705
|
+
]
|
|
706
|
+
} },
|
|
707
|
+
ins: { attrs: {
|
|
708
|
+
cite: null,
|
|
709
|
+
datetime: null
|
|
710
|
+
} },
|
|
711
|
+
kbd: S,
|
|
712
|
+
keygen: { attrs: {
|
|
713
|
+
challenge: null,
|
|
714
|
+
form: null,
|
|
715
|
+
name: null,
|
|
716
|
+
autofocus: ["autofocus"],
|
|
717
|
+
disabled: ["disabled"],
|
|
718
|
+
keytype: ["RSA"]
|
|
719
|
+
} },
|
|
720
|
+
label: { attrs: {
|
|
721
|
+
for: null,
|
|
722
|
+
form: null
|
|
723
|
+
} },
|
|
724
|
+
legend: S,
|
|
725
|
+
li: { attrs: { value: null } },
|
|
726
|
+
link: { attrs: {
|
|
727
|
+
href: null,
|
|
728
|
+
type: null,
|
|
729
|
+
hreflang: null,
|
|
730
|
+
media: null,
|
|
731
|
+
sizes: [
|
|
732
|
+
"all",
|
|
733
|
+
"16x16",
|
|
734
|
+
"16x16 32x32",
|
|
735
|
+
"16x16 32x32 64x64"
|
|
736
|
+
]
|
|
737
|
+
} },
|
|
738
|
+
map: { attrs: { name: null } },
|
|
739
|
+
mark: S,
|
|
740
|
+
menu: { attrs: {
|
|
741
|
+
label: null,
|
|
742
|
+
type: [
|
|
743
|
+
"list",
|
|
744
|
+
"context",
|
|
745
|
+
"toolbar"
|
|
746
|
+
]
|
|
747
|
+
} },
|
|
748
|
+
meta: { attrs: {
|
|
749
|
+
content: null,
|
|
750
|
+
charset: Charsets,
|
|
751
|
+
name: [
|
|
752
|
+
"viewport",
|
|
753
|
+
"application-name",
|
|
754
|
+
"author",
|
|
755
|
+
"description",
|
|
756
|
+
"generator",
|
|
757
|
+
"keywords"
|
|
758
|
+
],
|
|
759
|
+
"http-equiv": [
|
|
760
|
+
"content-language",
|
|
761
|
+
"content-type",
|
|
762
|
+
"default-style",
|
|
763
|
+
"refresh"
|
|
764
|
+
]
|
|
765
|
+
} },
|
|
766
|
+
meter: { attrs: {
|
|
767
|
+
value: null,
|
|
768
|
+
min: null,
|
|
769
|
+
low: null,
|
|
770
|
+
high: null,
|
|
771
|
+
max: null,
|
|
772
|
+
optimum: null
|
|
773
|
+
} },
|
|
774
|
+
nav: S,
|
|
775
|
+
noscript: S,
|
|
776
|
+
object: { attrs: {
|
|
777
|
+
data: null,
|
|
778
|
+
type: null,
|
|
779
|
+
name: null,
|
|
780
|
+
usemap: null,
|
|
781
|
+
form: null,
|
|
782
|
+
width: null,
|
|
783
|
+
height: null,
|
|
784
|
+
typemustmatch: ["typemustmatch"]
|
|
785
|
+
} },
|
|
786
|
+
ol: {
|
|
787
|
+
attrs: {
|
|
788
|
+
reversed: ["reversed"],
|
|
789
|
+
start: null,
|
|
790
|
+
type: [
|
|
791
|
+
"1",
|
|
792
|
+
"a",
|
|
793
|
+
"A",
|
|
794
|
+
"i",
|
|
795
|
+
"I"
|
|
796
|
+
]
|
|
797
|
+
},
|
|
798
|
+
children: [
|
|
799
|
+
"li",
|
|
800
|
+
"script",
|
|
801
|
+
"template",
|
|
802
|
+
"ul",
|
|
803
|
+
"ol"
|
|
804
|
+
]
|
|
805
|
+
},
|
|
806
|
+
optgroup: { attrs: {
|
|
807
|
+
disabled: ["disabled"],
|
|
808
|
+
label: null
|
|
809
|
+
} },
|
|
810
|
+
option: { attrs: {
|
|
811
|
+
disabled: ["disabled"],
|
|
812
|
+
label: null,
|
|
813
|
+
selected: ["selected"],
|
|
814
|
+
value: null
|
|
815
|
+
} },
|
|
816
|
+
output: { attrs: {
|
|
817
|
+
for: null,
|
|
818
|
+
form: null,
|
|
819
|
+
name: null
|
|
820
|
+
} },
|
|
821
|
+
p: S,
|
|
822
|
+
param: { attrs: {
|
|
823
|
+
name: null,
|
|
824
|
+
value: null
|
|
825
|
+
} },
|
|
826
|
+
pre: S,
|
|
827
|
+
progress: { attrs: {
|
|
828
|
+
value: null,
|
|
829
|
+
max: null
|
|
830
|
+
} },
|
|
831
|
+
q: { attrs: { cite: null } },
|
|
832
|
+
rp: S,
|
|
833
|
+
rt: S,
|
|
834
|
+
ruby: S,
|
|
835
|
+
samp: S,
|
|
836
|
+
script: { attrs: {
|
|
837
|
+
type: ["text/javascript"],
|
|
838
|
+
src: null,
|
|
839
|
+
async: ["async"],
|
|
840
|
+
defer: ["defer"],
|
|
841
|
+
charset: Charsets
|
|
842
|
+
} },
|
|
843
|
+
section: S,
|
|
844
|
+
select: { attrs: {
|
|
845
|
+
form: null,
|
|
846
|
+
name: null,
|
|
847
|
+
size: null,
|
|
848
|
+
autofocus: ["autofocus"],
|
|
849
|
+
disabled: ["disabled"],
|
|
850
|
+
multiple: ["multiple"]
|
|
851
|
+
} },
|
|
852
|
+
slot: { attrs: { name: null } },
|
|
853
|
+
small: S,
|
|
854
|
+
source: { attrs: {
|
|
855
|
+
src: null,
|
|
856
|
+
type: null,
|
|
857
|
+
media: null
|
|
858
|
+
} },
|
|
859
|
+
span: S,
|
|
860
|
+
strong: S,
|
|
861
|
+
style: { attrs: {
|
|
862
|
+
type: ["text/css"],
|
|
863
|
+
media: null,
|
|
864
|
+
scoped: null
|
|
865
|
+
} },
|
|
866
|
+
sub: S,
|
|
867
|
+
summary: S,
|
|
868
|
+
sup: S,
|
|
869
|
+
table: S,
|
|
870
|
+
tbody: S,
|
|
871
|
+
td: { attrs: {
|
|
872
|
+
colspan: null,
|
|
873
|
+
rowspan: null,
|
|
874
|
+
headers: null
|
|
875
|
+
} },
|
|
876
|
+
template: S,
|
|
877
|
+
textarea: { attrs: {
|
|
878
|
+
dirname: null,
|
|
879
|
+
form: null,
|
|
880
|
+
maxlength: null,
|
|
881
|
+
name: null,
|
|
882
|
+
placeholder: null,
|
|
883
|
+
rows: null,
|
|
884
|
+
cols: null,
|
|
885
|
+
autofocus: ["autofocus"],
|
|
886
|
+
disabled: ["disabled"],
|
|
887
|
+
readonly: ["readonly"],
|
|
888
|
+
required: ["required"],
|
|
889
|
+
wrap: ["soft", "hard"]
|
|
890
|
+
} },
|
|
891
|
+
tfoot: S,
|
|
892
|
+
th: { attrs: {
|
|
893
|
+
colspan: null,
|
|
894
|
+
rowspan: null,
|
|
895
|
+
headers: null,
|
|
896
|
+
scope: [
|
|
897
|
+
"row",
|
|
898
|
+
"col",
|
|
899
|
+
"rowgroup",
|
|
900
|
+
"colgroup"
|
|
901
|
+
]
|
|
902
|
+
} },
|
|
903
|
+
thead: S,
|
|
904
|
+
time: { attrs: { datetime: null } },
|
|
905
|
+
title: S,
|
|
906
|
+
tr: S,
|
|
907
|
+
track: { attrs: {
|
|
908
|
+
src: null,
|
|
909
|
+
label: null,
|
|
910
|
+
default: null,
|
|
911
|
+
kind: [
|
|
912
|
+
"subtitles",
|
|
913
|
+
"captions",
|
|
914
|
+
"descriptions",
|
|
915
|
+
"chapters",
|
|
916
|
+
"metadata"
|
|
917
|
+
],
|
|
918
|
+
srclang: null
|
|
919
|
+
} },
|
|
920
|
+
ul: { children: [
|
|
921
|
+
"li",
|
|
922
|
+
"script",
|
|
923
|
+
"template",
|
|
924
|
+
"ul",
|
|
925
|
+
"ol"
|
|
926
|
+
] },
|
|
927
|
+
var: S,
|
|
928
|
+
video: { attrs: {
|
|
929
|
+
src: null,
|
|
930
|
+
poster: null,
|
|
931
|
+
width: null,
|
|
932
|
+
height: null,
|
|
933
|
+
crossorigin: ["anonymous", "use-credentials"],
|
|
934
|
+
preload: [
|
|
935
|
+
"auto",
|
|
936
|
+
"metadata",
|
|
937
|
+
"none"
|
|
938
|
+
],
|
|
939
|
+
autoplay: ["autoplay"],
|
|
940
|
+
mediagroup: ["movie"],
|
|
941
|
+
muted: ["muted"],
|
|
942
|
+
controls: ["controls"]
|
|
943
|
+
} },
|
|
944
|
+
wbr: S
|
|
945
|
+
};
|
|
946
|
+
const GlobalAttrs = {
|
|
947
|
+
accesskey: null,
|
|
948
|
+
class: null,
|
|
949
|
+
contenteditable: Bool,
|
|
950
|
+
contextmenu: null,
|
|
951
|
+
dir: [
|
|
952
|
+
"ltr",
|
|
953
|
+
"rtl",
|
|
954
|
+
"auto"
|
|
955
|
+
],
|
|
956
|
+
draggable: [
|
|
957
|
+
"true",
|
|
958
|
+
"false",
|
|
959
|
+
"auto"
|
|
960
|
+
],
|
|
961
|
+
dropzone: [
|
|
962
|
+
"copy",
|
|
963
|
+
"move",
|
|
964
|
+
"link",
|
|
965
|
+
"string:",
|
|
966
|
+
"file:"
|
|
967
|
+
],
|
|
968
|
+
hidden: ["hidden"],
|
|
969
|
+
id: null,
|
|
970
|
+
inert: ["inert"],
|
|
971
|
+
itemid: null,
|
|
972
|
+
itemprop: null,
|
|
973
|
+
itemref: null,
|
|
974
|
+
itemscope: ["itemscope"],
|
|
975
|
+
itemtype: null,
|
|
976
|
+
lang: [
|
|
977
|
+
"ar",
|
|
978
|
+
"bn",
|
|
979
|
+
"de",
|
|
980
|
+
"en-GB",
|
|
981
|
+
"en-US",
|
|
982
|
+
"es",
|
|
983
|
+
"fr",
|
|
984
|
+
"hi",
|
|
985
|
+
"id",
|
|
986
|
+
"ja",
|
|
987
|
+
"pa",
|
|
988
|
+
"pt",
|
|
989
|
+
"ru",
|
|
990
|
+
"tr",
|
|
991
|
+
"zh"
|
|
992
|
+
],
|
|
993
|
+
spellcheck: Bool,
|
|
994
|
+
autocorrect: Bool,
|
|
995
|
+
autocapitalize: Bool,
|
|
996
|
+
style: null,
|
|
997
|
+
tabindex: null,
|
|
998
|
+
title: null,
|
|
999
|
+
translate: ["yes", "no"],
|
|
1000
|
+
rel: [
|
|
1001
|
+
"stylesheet",
|
|
1002
|
+
"alternate",
|
|
1003
|
+
"author",
|
|
1004
|
+
"bookmark",
|
|
1005
|
+
"help",
|
|
1006
|
+
"license",
|
|
1007
|
+
"next",
|
|
1008
|
+
"nofollow",
|
|
1009
|
+
"noreferrer",
|
|
1010
|
+
"prefetch",
|
|
1011
|
+
"prev",
|
|
1012
|
+
"search",
|
|
1013
|
+
"tag"
|
|
1014
|
+
],
|
|
1015
|
+
role: /* @__PURE__ */ "alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),
|
|
1016
|
+
"aria-activedescendant": null,
|
|
1017
|
+
"aria-atomic": Bool,
|
|
1018
|
+
"aria-autocomplete": [
|
|
1019
|
+
"inline",
|
|
1020
|
+
"list",
|
|
1021
|
+
"both",
|
|
1022
|
+
"none"
|
|
1023
|
+
],
|
|
1024
|
+
"aria-busy": Bool,
|
|
1025
|
+
"aria-checked": [
|
|
1026
|
+
"true",
|
|
1027
|
+
"false",
|
|
1028
|
+
"mixed",
|
|
1029
|
+
"undefined"
|
|
1030
|
+
],
|
|
1031
|
+
"aria-controls": null,
|
|
1032
|
+
"aria-describedby": null,
|
|
1033
|
+
"aria-disabled": Bool,
|
|
1034
|
+
"aria-dropeffect": null,
|
|
1035
|
+
"aria-expanded": [
|
|
1036
|
+
"true",
|
|
1037
|
+
"false",
|
|
1038
|
+
"undefined"
|
|
1039
|
+
],
|
|
1040
|
+
"aria-flowto": null,
|
|
1041
|
+
"aria-grabbed": [
|
|
1042
|
+
"true",
|
|
1043
|
+
"false",
|
|
1044
|
+
"undefined"
|
|
1045
|
+
],
|
|
1046
|
+
"aria-haspopup": Bool,
|
|
1047
|
+
"aria-hidden": Bool,
|
|
1048
|
+
"aria-invalid": [
|
|
1049
|
+
"true",
|
|
1050
|
+
"false",
|
|
1051
|
+
"grammar",
|
|
1052
|
+
"spelling"
|
|
1053
|
+
],
|
|
1054
|
+
"aria-label": null,
|
|
1055
|
+
"aria-labelledby": null,
|
|
1056
|
+
"aria-level": null,
|
|
1057
|
+
"aria-live": [
|
|
1058
|
+
"off",
|
|
1059
|
+
"polite",
|
|
1060
|
+
"assertive"
|
|
1061
|
+
],
|
|
1062
|
+
"aria-multiline": Bool,
|
|
1063
|
+
"aria-multiselectable": Bool,
|
|
1064
|
+
"aria-owns": null,
|
|
1065
|
+
"aria-posinset": null,
|
|
1066
|
+
"aria-pressed": [
|
|
1067
|
+
"true",
|
|
1068
|
+
"false",
|
|
1069
|
+
"mixed",
|
|
1070
|
+
"undefined"
|
|
1071
|
+
],
|
|
1072
|
+
"aria-readonly": Bool,
|
|
1073
|
+
"aria-relevant": null,
|
|
1074
|
+
"aria-required": Bool,
|
|
1075
|
+
"aria-selected": [
|
|
1076
|
+
"true",
|
|
1077
|
+
"false",
|
|
1078
|
+
"undefined"
|
|
1079
|
+
],
|
|
1080
|
+
"aria-setsize": null,
|
|
1081
|
+
"aria-sort": [
|
|
1082
|
+
"ascending",
|
|
1083
|
+
"descending",
|
|
1084
|
+
"none",
|
|
1085
|
+
"other"
|
|
1086
|
+
],
|
|
1087
|
+
"aria-valuemax": null,
|
|
1088
|
+
"aria-valuemin": null,
|
|
1089
|
+
"aria-valuenow": null,
|
|
1090
|
+
"aria-valuetext": null
|
|
1091
|
+
};
|
|
1092
|
+
const eventAttributes = /* @__PURE__ */ "beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((n) => "on" + n);
|
|
1093
|
+
for (let a of eventAttributes) GlobalAttrs[a] = null;
|
|
1094
|
+
var Schema = class {
|
|
1095
|
+
constructor(extraTags, extraAttrs) {
|
|
1096
|
+
this.tags = {
|
|
1097
|
+
...Tags,
|
|
1098
|
+
...extraTags
|
|
1099
|
+
};
|
|
1100
|
+
this.globalAttrs = {
|
|
1101
|
+
...GlobalAttrs,
|
|
1102
|
+
...extraAttrs
|
|
1103
|
+
};
|
|
1104
|
+
this.allTags = Object.keys(this.tags);
|
|
1105
|
+
this.globalAttrNames = Object.keys(this.globalAttrs);
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
Schema.default = /* @__PURE__ */ new Schema();
|
|
1109
|
+
function elementName(doc, tree, max = doc.length) {
|
|
1110
|
+
if (!tree) return "";
|
|
1111
|
+
let tag = tree.firstChild;
|
|
1112
|
+
let name = tag && tag.getChild("TagName");
|
|
1113
|
+
return name ? doc.sliceString(name.from, Math.min(name.to, max)) : "";
|
|
1114
|
+
}
|
|
1115
|
+
function findParentElement(tree, skip = false) {
|
|
1116
|
+
for (; tree; tree = tree.parent) if (tree.name == "Element") if (skip) skip = false;
|
|
1117
|
+
else return tree;
|
|
1118
|
+
return null;
|
|
1119
|
+
}
|
|
1120
|
+
function allowedChildren(doc, tree, schema) {
|
|
1121
|
+
let parentInfo = schema.tags[elementName(doc, findParentElement(tree))];
|
|
1122
|
+
return (parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.children) || schema.allTags;
|
|
1123
|
+
}
|
|
1124
|
+
function openTags(doc, tree) {
|
|
1125
|
+
let open = [];
|
|
1126
|
+
for (let parent = findParentElement(tree); parent && !parent.type.isTop; parent = findParentElement(parent.parent)) {
|
|
1127
|
+
let tagName = elementName(doc, parent);
|
|
1128
|
+
if (tagName && parent.lastChild.name == "CloseTag") break;
|
|
1129
|
+
if (tagName && open.indexOf(tagName) < 0 && (tree.name == "EndTag" || tree.from >= parent.firstChild.to)) open.push(tagName);
|
|
1130
|
+
}
|
|
1131
|
+
return open;
|
|
1132
|
+
}
|
|
1133
|
+
const identifier = /^[:\-\.\w\u00b7-\uffff]*$/;
|
|
1134
|
+
function completeTag(state, schema, tree, from, to) {
|
|
1135
|
+
let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">";
|
|
1136
|
+
let parent = findParentElement(tree, tree.name == "StartTag" || tree.name == "TagName");
|
|
1137
|
+
return {
|
|
1138
|
+
from,
|
|
1139
|
+
to,
|
|
1140
|
+
options: allowedChildren(state.doc, parent, schema).map((tagName) => ({
|
|
1141
|
+
label: tagName,
|
|
1142
|
+
type: "type"
|
|
1143
|
+
})).concat(openTags(state.doc, tree).map((tag, i) => ({
|
|
1144
|
+
label: "/" + tag,
|
|
1145
|
+
apply: "/" + tag + end,
|
|
1146
|
+
type: "type",
|
|
1147
|
+
boost: 99 - i
|
|
1148
|
+
}))),
|
|
1149
|
+
validFor: /^\/?[:\-\.\w\u00b7-\uffff]*$/
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
function completeCloseTag(state, tree, from, to) {
|
|
1153
|
+
let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">";
|
|
1154
|
+
return {
|
|
1155
|
+
from,
|
|
1156
|
+
to,
|
|
1157
|
+
options: openTags(state.doc, tree).map((tag, i) => ({
|
|
1158
|
+
label: tag,
|
|
1159
|
+
apply: tag + end,
|
|
1160
|
+
type: "type",
|
|
1161
|
+
boost: 99 - i
|
|
1162
|
+
})),
|
|
1163
|
+
validFor: identifier
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
function completeStartTag(state, schema, tree, pos) {
|
|
1167
|
+
let options = [], level = 0;
|
|
1168
|
+
for (let tagName of allowedChildren(state.doc, tree, schema)) options.push({
|
|
1169
|
+
label: "<" + tagName,
|
|
1170
|
+
type: "type"
|
|
1171
|
+
});
|
|
1172
|
+
for (let open of openTags(state.doc, tree)) options.push({
|
|
1173
|
+
label: "</" + open + ">",
|
|
1174
|
+
type: "type",
|
|
1175
|
+
boost: 99 - level++
|
|
1176
|
+
});
|
|
1177
|
+
return {
|
|
1178
|
+
from: pos,
|
|
1179
|
+
to: pos,
|
|
1180
|
+
options,
|
|
1181
|
+
validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
function completeAttrName(state, schema, tree, from, to) {
|
|
1185
|
+
let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;
|
|
1186
|
+
let localAttrs = info && info.attrs ? Object.keys(info.attrs) : [];
|
|
1187
|
+
return {
|
|
1188
|
+
from,
|
|
1189
|
+
to,
|
|
1190
|
+
options: (info && info.globalAttrs === false ? localAttrs : localAttrs.length ? localAttrs.concat(schema.globalAttrNames) : schema.globalAttrNames).map((attrName) => ({
|
|
1191
|
+
label: attrName,
|
|
1192
|
+
type: "property"
|
|
1193
|
+
})),
|
|
1194
|
+
validFor: identifier
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
function completeAttrValue(state, schema, tree, from, to) {
|
|
1198
|
+
var _a;
|
|
1199
|
+
let nameNode = (_a = tree.parent) === null || _a === void 0 ? void 0 : _a.getChild("AttributeName");
|
|
1200
|
+
let options = [], token = void 0;
|
|
1201
|
+
if (nameNode) {
|
|
1202
|
+
let attrName = state.sliceDoc(nameNode.from, nameNode.to);
|
|
1203
|
+
let attrs = schema.globalAttrs[attrName];
|
|
1204
|
+
if (!attrs) {
|
|
1205
|
+
let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;
|
|
1206
|
+
attrs = (info === null || info === void 0 ? void 0 : info.attrs) && info.attrs[attrName];
|
|
1207
|
+
}
|
|
1208
|
+
if (attrs) {
|
|
1209
|
+
let base = state.sliceDoc(from, to).toLowerCase(), quoteStart = "\"", quoteEnd = "\"";
|
|
1210
|
+
if (/^['"]/.test(base)) {
|
|
1211
|
+
token = base[0] == "\"" ? /^[^"]*$/ : /^[^']*$/;
|
|
1212
|
+
quoteStart = "";
|
|
1213
|
+
quoteEnd = state.sliceDoc(to, to + 1) == base[0] ? "" : base[0];
|
|
1214
|
+
base = base.slice(1);
|
|
1215
|
+
from++;
|
|
1216
|
+
} else token = /^[^\s<>='"]*$/;
|
|
1217
|
+
for (let value of attrs) options.push({
|
|
1218
|
+
label: value,
|
|
1219
|
+
apply: quoteStart + value + quoteEnd,
|
|
1220
|
+
type: "constant"
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
return {
|
|
1225
|
+
from,
|
|
1226
|
+
to,
|
|
1227
|
+
options,
|
|
1228
|
+
validFor: token
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
function htmlCompletionFor(schema, context) {
|
|
1232
|
+
let { state, pos } = context, tree = syntaxTree(state).resolveInner(pos, -1), around = tree.resolve(pos);
|
|
1233
|
+
for (let scan = pos, before; around == tree && (before = tree.childBefore(scan));) {
|
|
1234
|
+
let last = before.lastChild;
|
|
1235
|
+
if (!last || !last.type.isError || last.from < last.to) break;
|
|
1236
|
+
around = tree = before;
|
|
1237
|
+
scan = last.from;
|
|
1238
|
+
}
|
|
1239
|
+
if (tree.name == "TagName") return tree.parent && /CloseTag$/.test(tree.parent.name) ? completeCloseTag(state, tree, tree.from, pos) : completeTag(state, schema, tree, tree.from, pos);
|
|
1240
|
+
else if (tree.name == "StartTag" || tree.name == "IncompleteTag") return completeTag(state, schema, tree, pos, pos);
|
|
1241
|
+
else if (tree.name == "StartCloseTag" || tree.name == "IncompleteCloseTag") return completeCloseTag(state, tree, pos, pos);
|
|
1242
|
+
else if (tree.name == "OpenTag" || tree.name == "SelfClosingTag" || tree.name == "AttributeName") return completeAttrName(state, schema, tree, tree.name == "AttributeName" ? tree.from : pos, pos);
|
|
1243
|
+
else if (tree.name == "Is" || tree.name == "AttributeValue" || tree.name == "UnquotedAttributeValue") return completeAttrValue(state, schema, tree, tree.name == "Is" ? pos : tree.from, pos);
|
|
1244
|
+
else if (context.explicit && (around.name == "Element" || around.name == "Text" || around.name == "Document")) return completeStartTag(state, schema, tree, pos);
|
|
1245
|
+
else return null;
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
HTML tag completion. Opens and closes tags and attributes in a
|
|
1249
|
+
context-aware way.
|
|
1250
|
+
*/
|
|
1251
|
+
function htmlCompletionSource(context) {
|
|
1252
|
+
return htmlCompletionFor(Schema.default, context);
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
Create a completion source for HTML extended with additional tags
|
|
1256
|
+
or attributes.
|
|
1257
|
+
*/
|
|
1258
|
+
function htmlCompletionSourceWith(config) {
|
|
1259
|
+
let { extraTags, extraGlobalAttributes: extraAttrs } = config;
|
|
1260
|
+
let schema = extraAttrs || extraTags ? new Schema(extraTags, extraAttrs) : Schema.default;
|
|
1261
|
+
return (context) => htmlCompletionFor(schema, context);
|
|
1262
|
+
}
|
|
1263
|
+
const jsonParser = /* @__PURE__ */ javascriptLanguage.parser.configure({ top: "SingleExpression" });
|
|
1264
|
+
const defaultNesting = [
|
|
1265
|
+
{
|
|
1266
|
+
tag: "script",
|
|
1267
|
+
attrs: (attrs) => attrs.type == "text/typescript" || attrs.lang == "ts",
|
|
1268
|
+
parser: typescriptLanguage.parser
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
tag: "script",
|
|
1272
|
+
attrs: (attrs) => attrs.type == "text/babel" || attrs.type == "text/jsx",
|
|
1273
|
+
parser: jsxLanguage.parser
|
|
1274
|
+
},
|
|
1275
|
+
{
|
|
1276
|
+
tag: "script",
|
|
1277
|
+
attrs: (attrs) => attrs.type == "text/typescript-jsx",
|
|
1278
|
+
parser: tsxLanguage.parser
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
tag: "script",
|
|
1282
|
+
attrs(attrs) {
|
|
1283
|
+
return /^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(attrs.type);
|
|
1284
|
+
},
|
|
1285
|
+
parser: jsonParser
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
tag: "script",
|
|
1289
|
+
attrs(attrs) {
|
|
1290
|
+
return !attrs.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type);
|
|
1291
|
+
},
|
|
1292
|
+
parser: javascriptLanguage.parser
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
tag: "style",
|
|
1296
|
+
attrs(attrs) {
|
|
1297
|
+
return (!attrs.lang || attrs.lang == "css") && (!attrs.type || /^(text\/)?(x-)?(stylesheet|css)$/i.test(attrs.type));
|
|
1298
|
+
},
|
|
1299
|
+
parser: cssLanguage.parser
|
|
1300
|
+
}
|
|
1301
|
+
];
|
|
1302
|
+
const defaultAttrs = /* @__PURE__ */ [{
|
|
1303
|
+
name: "style",
|
|
1304
|
+
parser: /* @__PURE__ */ cssLanguage.parser.configure({ top: "Styles" })
|
|
1305
|
+
}].concat(/* @__PURE__ */ eventAttributes.map((name) => ({
|
|
1306
|
+
name,
|
|
1307
|
+
parser: javascriptLanguage.parser
|
|
1308
|
+
})));
|
|
1309
|
+
const htmlPlain = /* @__PURE__ */ LRLanguage.define({
|
|
1310
|
+
name: "html",
|
|
1311
|
+
parser: /* @__PURE__ */ parser.configure({ props: [
|
|
1312
|
+
/* @__PURE__ */ indentNodeProp.add({
|
|
1313
|
+
Element(context) {
|
|
1314
|
+
let after = /^(\s*)(<\/)?/.exec(context.textAfter);
|
|
1315
|
+
if (context.node.to <= context.pos + after[0].length) return context.continue();
|
|
1316
|
+
return context.lineIndent(context.node.from) + (after[2] ? 0 : context.unit);
|
|
1317
|
+
},
|
|
1318
|
+
"OpenTag CloseTag SelfClosingTag"(context) {
|
|
1319
|
+
return context.column(context.node.from) + context.unit;
|
|
1320
|
+
},
|
|
1321
|
+
Document(context) {
|
|
1322
|
+
if (context.pos + /\s*/.exec(context.textAfter)[0].length < context.node.to) return context.continue();
|
|
1323
|
+
let endElt = null, close;
|
|
1324
|
+
for (let cur = context.node;;) {
|
|
1325
|
+
let last = cur.lastChild;
|
|
1326
|
+
if (!last || last.name != "Element" || last.to != cur.to) break;
|
|
1327
|
+
endElt = cur = last;
|
|
1328
|
+
}
|
|
1329
|
+
if (endElt && !((close = endElt.lastChild) && (close.name == "CloseTag" || close.name == "SelfClosingTag"))) return context.lineIndent(endElt.from) + context.unit;
|
|
1330
|
+
return null;
|
|
1331
|
+
}
|
|
1332
|
+
}),
|
|
1333
|
+
/* @__PURE__ */ foldNodeProp.add({ Element(node) {
|
|
1334
|
+
let first = node.firstChild, last = node.lastChild;
|
|
1335
|
+
if (!first || first.name != "OpenTag") return null;
|
|
1336
|
+
return {
|
|
1337
|
+
from: first.to,
|
|
1338
|
+
to: last.name == "CloseTag" ? last.from : node.to
|
|
1339
|
+
};
|
|
1340
|
+
} }),
|
|
1341
|
+
/* @__PURE__ */ bracketMatchingHandle.add({ "OpenTag CloseTag": (node) => node.getChild("TagName") })
|
|
1342
|
+
] }),
|
|
1343
|
+
languageData: {
|
|
1344
|
+
commentTokens: { block: {
|
|
1345
|
+
open: "<!--",
|
|
1346
|
+
close: "-->"
|
|
1347
|
+
} },
|
|
1348
|
+
indentOnInput: /^\s*<\/\w+\W$/,
|
|
1349
|
+
wordChars: "-_"
|
|
1350
|
+
}
|
|
1351
|
+
});
|
|
1352
|
+
/**
|
|
1353
|
+
A language provider based on the [Lezer HTML
|
|
1354
|
+
parser](https://github.com/lezer-parser/html), extended with the
|
|
1355
|
+
JavaScript and CSS parsers to parse the content of `<script>` and
|
|
1356
|
+
`<style>` tags.
|
|
1357
|
+
*/
|
|
1358
|
+
const htmlLanguage = /* @__PURE__ */ htmlPlain.configure({ wrap: /* @__PURE__ */ configureNesting(defaultNesting, defaultAttrs) });
|
|
1359
|
+
/**
|
|
1360
|
+
Language support for HTML, including
|
|
1361
|
+
[`htmlCompletion`](https://codemirror.net/6/docs/ref/#lang-html.htmlCompletion) and JavaScript and
|
|
1362
|
+
CSS support extensions.
|
|
1363
|
+
*/
|
|
1364
|
+
function html(config = {}) {
|
|
1365
|
+
let dialect = "", wrap;
|
|
1366
|
+
if (config.matchClosingTags === false) dialect = "noMatch";
|
|
1367
|
+
if (config.selfClosingTags === true) dialect = (dialect ? dialect + " " : "") + "selfClosing";
|
|
1368
|
+
if (config.nestedLanguages && config.nestedLanguages.length || config.nestedAttributes && config.nestedAttributes.length) wrap = configureNesting((config.nestedLanguages || []).concat(defaultNesting), (config.nestedAttributes || []).concat(defaultAttrs));
|
|
1369
|
+
return new LanguageSupport(wrap ? htmlPlain.configure({
|
|
1370
|
+
wrap,
|
|
1371
|
+
dialect
|
|
1372
|
+
}) : dialect ? htmlLanguage.configure({ dialect }) : htmlLanguage, [
|
|
1373
|
+
htmlLanguage.data.of({ autocomplete: htmlCompletionSourceWith(config) }),
|
|
1374
|
+
config.autoCloseTags !== false ? autoCloseTags : [],
|
|
1375
|
+
javascript().support,
|
|
1376
|
+
css().support
|
|
1377
|
+
]);
|
|
1378
|
+
}
|
|
1379
|
+
const selfClosers = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));
|
|
1380
|
+
/**
|
|
1381
|
+
Extension that will automatically insert close tags when a `>` or
|
|
1382
|
+
`/` is typed.
|
|
1383
|
+
*/
|
|
1384
|
+
const autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((view, from, to, text, insertTransaction) => {
|
|
1385
|
+
if (view.composing || view.state.readOnly || from != to || text != ">" && text != "/" || !htmlLanguage.isActiveAt(view.state, from, -1)) return false;
|
|
1386
|
+
let base = insertTransaction(), { state } = base;
|
|
1387
|
+
let closeTags = state.changeByRange((range) => {
|
|
1388
|
+
var _a, _b, _c;
|
|
1389
|
+
let didType = state.doc.sliceString(range.from - 1, range.to) == text;
|
|
1390
|
+
let { head } = range, after = syntaxTree(state).resolveInner(head, -1), name;
|
|
1391
|
+
if (didType && text == ">" && after.name == "EndTag") {
|
|
1392
|
+
let tag = after.parent;
|
|
1393
|
+
if (((_b = (_a = tag.parent) === null || _a === void 0 ? void 0 : _a.lastChild) === null || _b === void 0 ? void 0 : _b.name) != "CloseTag" && (name = elementName(state.doc, tag.parent, head)) && !selfClosers.has(name)) return {
|
|
1394
|
+
range,
|
|
1395
|
+
changes: {
|
|
1396
|
+
from: head,
|
|
1397
|
+
to: head + (state.doc.sliceString(head, head + 1) === ">" ? 1 : 0),
|
|
1398
|
+
insert: `</${name}>`
|
|
1399
|
+
}
|
|
1400
|
+
};
|
|
1401
|
+
} else if (didType && text == "/" && after.name == "IncompleteCloseTag") {
|
|
1402
|
+
let tag = after.parent;
|
|
1403
|
+
if (after.from == head - 2 && ((_c = tag.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "CloseTag" && (name = elementName(state.doc, tag, head)) && !selfClosers.has(name)) {
|
|
1404
|
+
let to = head + (state.doc.sliceString(head, head + 1) === ">" ? 1 : 0);
|
|
1405
|
+
let insert = `${name}>`;
|
|
1406
|
+
return {
|
|
1407
|
+
range: EditorSelection.cursor(head + insert.length, -1),
|
|
1408
|
+
changes: {
|
|
1409
|
+
from: head,
|
|
1410
|
+
to,
|
|
1411
|
+
insert
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
return { range };
|
|
1417
|
+
});
|
|
1418
|
+
if (closeTags.changes.empty) return false;
|
|
1419
|
+
view.dispatch([base, state.update(closeTags, {
|
|
1420
|
+
userEvent: "input.complete",
|
|
1421
|
+
scrollIntoView: true
|
|
1422
|
+
})]);
|
|
1423
|
+
return true;
|
|
1424
|
+
});
|
|
1425
|
+
|
|
1426
|
+
//#endregion
|
|
1427
|
+
export { html, htmlCompletionSource };
|
|
1428
|
+
//# sourceMappingURL=dist-BAfzu5eu.js.map
|