@nldd/design-system 0.8.80 → 0.8.82

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