@pfern/elements 0.1.11 → 0.2.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/src/html.js ADDED
@@ -0,0 +1,996 @@
1
+ import { elements } from './core/elements.js'
2
+ import { navigate } from './helpers.js'
3
+ import { hasNavigateHandler } from './router.js'
4
+
5
+ /**
6
+ * HTML tag helpers.
7
+ *
8
+ * This module is intentionally “flat”: each tag helper is exported by name with
9
+ * a short human-readable description so editor intellisense can act as primary
10
+ * documentation (JS-first, no TS required at runtime).
11
+ */
12
+
13
+
14
+ const isPlainLeftClick = event =>
15
+ event?.button === 0
16
+ && !event?.defaultPrevented
17
+ && !event?.metaKey
18
+ && !event?.ctrlKey
19
+ && !event?.shiftKey
20
+ && !event?.altKey
21
+
22
+ const isRoutableHref = href => {
23
+ if (typeof href !== 'string') return false
24
+ if (!href) return false
25
+ if (href.startsWith('#')) return false
26
+ if (typeof window === 'undefined') return false
27
+
28
+ let url
29
+ try { url = new URL(href, window.location.origin) }
30
+ catch { return false }
31
+
32
+ if (url.origin !== window.location.origin) return false
33
+
34
+ // Avoid intercepting obvious non-router navigations.
35
+ if (url.protocol !== 'http:' && url.protocol !== 'https:') return false
36
+
37
+ return true
38
+ }
39
+
40
+ const shouldInterceptLink = (props, event) =>
41
+ hasNavigateHandler()
42
+ && isPlainLeftClick(event)
43
+ && event?.cancelable !== false
44
+ && !props?.download
45
+ && (!props?.target || props.target === '_self')
46
+ && isRoutableHref(props?.href)
47
+
48
+ /**
49
+ * <html>
50
+ * The root element of an HTML document.
51
+ *
52
+ * Note: when `html(...)` is used as the top-level vnode, `render()` will mount
53
+ * into `document.documentElement` automatically.
54
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/html
55
+ *
56
+ */
57
+ export const html = elements.html
58
+
59
+ /**
60
+ * <base>
61
+ * Specifies the base URL to use for all relative URLs in a document. There can be only one such element in a document.
62
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/base
63
+ *
64
+ */
65
+ export const base = elements.base
66
+
67
+ /**
68
+ * <head>
69
+ * Contains machine-readable information (metadata) about the document, like its title, scripts, and style sheets.
70
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/head
71
+ *
72
+ */
73
+ export const head = elements.head
74
+
75
+ /**
76
+ * <link>
77
+ * Specifies relationships between the current document and an external resource. This element is most commonly used to link to CSS but is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
78
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link
79
+ *
80
+ */
81
+ export const link = elements.link
82
+
83
+ /**
84
+ * <meta>
85
+ * Represents metadata that cannot be represented by other HTML meta-related elements, like <base>, <link>, <script>, <style> and <title>.
86
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta
87
+ *
88
+ */
89
+ export const meta = elements.meta
90
+
91
+ /**
92
+ * <style>
93
+ * Contains style information for a document or part of a document. It contains CSS, which is applied to the contents of the document containing this element.
94
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/style
95
+ *
96
+ */
97
+ export const style = elements.style
98
+
99
+ /**
100
+ * <title>
101
+ * Defines the document's title that is shown in a browser's title bar or a page's tab. It only contains text; HTML tags within the element, if any, are also treated as plain text.
102
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/title
103
+ *
104
+ */
105
+ export const title = elements.title
106
+
107
+ /**
108
+ * <body>
109
+ * Represents the content of an HTML document. There can be only one such element in a document.
110
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/body
111
+ *
112
+ */
113
+ export const body = elements.body
114
+
115
+ /**
116
+ * <address>
117
+ * Indicates that the enclosed HTML provides contact information for a person or people, or for an organization.
118
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/address
119
+ *
120
+ */
121
+ export const address = elements.address
122
+
123
+ /**
124
+ * <article>
125
+ * Represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in syndication). Examples include a forum post, a magazine or newspaper article, a blog entry, a product card, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.
126
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/article
127
+ *
128
+ */
129
+ export const article = elements.article
130
+
131
+ /**
132
+ * <aside>
133
+ * Represents a portion of a document whose content is only indirectly related to the document's main content. Asides are frequently presented as sidebars or call-out boxes.
134
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/aside
135
+ *
136
+ */
137
+ export const aside = elements.aside
138
+
139
+ /**
140
+ * <footer>
141
+ * Represents a footer for its nearest ancestor sectioning content or sectioning root element. A <footer> typically contains information about the author of the section, copyright data, or links to related documents.
142
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/footer
143
+ *
144
+ */
145
+ export const footer = elements.footer
146
+
147
+ /**
148
+ * <header>
149
+ * Represents introductory content, typically a group of introductory or navigational aids. It may contain some heading elements but also a logo, a search form, an author name, and other elements.
150
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/header
151
+ *
152
+ */
153
+ export const header = elements.header
154
+
155
+ /**
156
+ * <h1>
157
+ * There are six levels of section headings. <h1> is the highest section level and <h6> is the lowest.
158
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/h1
159
+ *
160
+ */
161
+ export const h1 = elements.h1
162
+
163
+ /**
164
+ * <h2>
165
+ * There are six levels of section headings. <h1> is the highest section level and <h6> is the lowest.
166
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/h2
167
+ *
168
+ */
169
+ export const h2 = elements.h2
170
+
171
+ /**
172
+ * <h3>
173
+ * There are six levels of section headings. <h1> is the highest section level and <h6> is the lowest.
174
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/h3
175
+ *
176
+ */
177
+ export const h3 = elements.h3
178
+
179
+ /**
180
+ * <h4>
181
+ * There are six levels of section headings. <h1> is the highest section level and <h6> is the lowest.
182
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/h4
183
+ *
184
+ */
185
+ export const h4 = elements.h4
186
+
187
+ /**
188
+ * <h5>
189
+ * There are six levels of section headings. <h1> is the highest section level and <h6> is the lowest.
190
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/h5
191
+ *
192
+ */
193
+ export const h5 = elements.h5
194
+
195
+ /**
196
+ * <h6>
197
+ * There are six levels of section headings. <h1> is the highest section level and <h6> is the lowest.
198
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/h6
199
+ *
200
+ */
201
+ export const h6 = elements.h6
202
+
203
+ /**
204
+ * <hgroup>
205
+ * Represents a heading grouped with any secondary content, such as subheadings, an alternative title, or a tagline.
206
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/hgroup
207
+ *
208
+ */
209
+ export const hgroup = elements.hgroup
210
+
211
+ /**
212
+ * <main>
213
+ * Represents the dominant content of the body of a document. The main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application.
214
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/main
215
+ *
216
+ */
217
+ export const main = elements.main
218
+
219
+ /**
220
+ * <nav>
221
+ * Represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents. Common examples of navigation sections are menus, tables of contents, and indexes.
222
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/nav
223
+ *
224
+ */
225
+ export const nav = elements.nav
226
+
227
+ /**
228
+ * <section>
229
+ * Represents a generic standalone section of a document, which doesn't have a more specific semantic element to represent it. Sections should always have a heading, with very few exceptions.
230
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/section
231
+ *
232
+ */
233
+ export const section = elements.section
234
+
235
+ /**
236
+ * <search>
237
+ * Represents a part that contains a set of form controls or other content related to performing a search or filtering operation.
238
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/search
239
+ *
240
+ */
241
+ export const search = elements.search
242
+
243
+ /**
244
+ * <blockquote>
245
+ * Indicates that the enclosed text is an extended quotation. Usually, this is rendered visually by indentation. A URL for the source of the quotation may be given using the cite attribute, while a text representation of the source can be given using the <cite> element.
246
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/blockquote
247
+ *
248
+ */
249
+ export const blockquote = elements.blockquote
250
+
251
+ /**
252
+ * <dd>
253
+ * Provides the description, definition, or value for the preceding term (<dt>) in a description list (<dl>).
254
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dd
255
+ *
256
+ */
257
+ export const dd = elements.dd
258
+
259
+ /**
260
+ * <div>
261
+ * The generic container for flow content. It has no effect on the content or layout until styled in some way using CSS (e.g., styling is directly applied to it, or some kind of layout model like flexbox is applied to its parent element).
262
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/div
263
+ *
264
+ */
265
+ export const div = elements.div
266
+
267
+ /**
268
+ * <dl>
269
+ * Represents a description list. The element encloses a list of groups of terms (specified using the <dt> element) and descriptions (provided by <dd> elements). Common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs).
270
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dl
271
+ *
272
+ */
273
+ export const dl = elements.dl
274
+
275
+ /**
276
+ * <dt>
277
+ * Specifies a term in a description or definition list, and as such must be used inside a <dl> element. It is usually followed by a <dd> element; however, multiple <dt> elements in a row indicate several terms that are all defined by the immediate next <dd> element.
278
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dt
279
+ *
280
+ */
281
+ export const dt = elements.dt
282
+
283
+ /**
284
+ * <figcaption>
285
+ * Represents a caption or legend describing the rest of the contents of its parent <figure> element.
286
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/figcaption
287
+ *
288
+ */
289
+ export const figcaption = elements.figcaption
290
+
291
+ /**
292
+ * <figure>
293
+ * Represents self-contained content, potentially with an optional caption, which is specified using the <figcaption> element. The figure, its caption, and its contents are referenced as a single unit.
294
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/figure
295
+ *
296
+ */
297
+ export const figure = elements.figure
298
+
299
+ /**
300
+ * <hr>
301
+ * Represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section.
302
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/hr
303
+ *
304
+ */
305
+ export const hr = elements.hr
306
+
307
+ /**
308
+ * <li>
309
+ * Represents an item in a list. It must be contained in a parent element: an ordered list (<ol>), an unordered list (<ul>), or a menu (<menu>). In menus and unordered lists, list items are usually displayed using bullet points. In ordered lists, they are usually displayed with an ascending counter on the left, such as a number or letter.
310
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/li
311
+ *
312
+ */
313
+ export const li = elements.li
314
+
315
+ /**
316
+ * <menu>
317
+ * A semantic alternative to <ul>, but treated by browsers (and exposed through the accessibility tree) as no different than <ul>. It represents an unordered list of items (which are represented by <li> elements).
318
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/menu
319
+ *
320
+ */
321
+ export const menu = elements.menu
322
+
323
+ /**
324
+ * <ol>
325
+ * Represents an ordered list of items — typically rendered as a numbered list.
326
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ol
327
+ *
328
+ */
329
+ export const ol = elements.ol
330
+
331
+ /**
332
+ * <p>
333
+ * Represents a paragraph. Paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation, but HTML paragraphs can be any structural grouping of related content, such as images or form fields.
334
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/p
335
+ *
336
+ */
337
+ export const p = elements.p
338
+
339
+ /** ')
340
+ * <pre>
341
+ * Represents preformatted text which is to be presented exactly as written in the HTML file. The text is typically rendered using a non-proportional, or monospaced, font. Whitespace inside this element is displayed as written.
342
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/pre
343
+ *
344
+ */
345
+ export const pre = elements.pre
346
+
347
+ /**
348
+ * <ul>
349
+ * Represents an unordered list of items, typically rendered as a bulleted list.
350
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ul
351
+ *
352
+ */
353
+ export const ul = elements.ul
354
+
355
+ /**
356
+ * <a>
357
+ * Together with its href attribute, creates a hyperlink to web pages, files, email addresses, locations within the current page, or anything else a URL can address.
358
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a
359
+ *
360
+ */
361
+ export const a = (...args) => {
362
+ const vnode = elements.a(...args)
363
+ const props = vnode[1] || {}
364
+
365
+ if (!hasNavigateHandler() || !props.href) return vnode
366
+
367
+ const userOnclick = props.onclick
368
+
369
+ return [
370
+ vnode[0],
371
+ {
372
+ ...props,
373
+ onclick: event => {
374
+ const result = typeof userOnclick === 'function'
375
+ ? userOnclick(event)
376
+ : undefined
377
+
378
+ if (Array.isArray(result)) return result
379
+ if (!shouldInterceptLink(props, event)) return result
380
+
381
+ event.preventDefault()
382
+ navigate(props.href)
383
+ return result
384
+ }
385
+ },
386
+ ...vnode.slice(2)
387
+ ]
388
+ }
389
+
390
+ /**
391
+ * <abbr>
392
+ * Represents an abbreviation or acronym.
393
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/abbr
394
+ *
395
+ */
396
+ export const abbr = elements.abbr
397
+
398
+ /**
399
+ * <b>
400
+ * Used to draw the reader's attention to the element's contents, which are not otherwise granted special importance. This was formerly known as the Boldface element, and most browsers still draw the text in boldface. However, you should not use <b> for styling text or granting importance. If you wish to create boldface text, you should use the CSS font-weight property. If you wish to indicate an element is of special importance, you should use the <strong> element.
401
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/b
402
+ *
403
+ */
404
+ export const b = elements.b
405
+
406
+ /**
407
+ * <bdi>
408
+ * Tells the browser's bidirectional algorithm to treat the text it contains in isolation from its surrounding text. It's particularly useful when a website dynamically inserts some text and doesn't know the directionality of the text being inserted.
409
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/bdi
410
+ *
411
+ */
412
+ export const bdi = elements.bdi
413
+
414
+ /**
415
+ * <bdo>
416
+ * Overrides the current directionality of text, so that the text within is rendered in a different direction.
417
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/bdo
418
+ *
419
+ */
420
+ export const bdo = elements.bdo
421
+
422
+ /**
423
+ * <br>
424
+ * Produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.
425
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/br
426
+ *
427
+ */
428
+ export const br = elements.br
429
+
430
+ /**
431
+ * <cite>
432
+ * Used to mark up the title of a creative work. The reference may be in an abbreviated form according to context-appropriate conventions related to citation metadata.
433
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/cite
434
+ *
435
+ */
436
+ export const cite = elements.cite
437
+
438
+ /**
439
+ * <code>
440
+ * Displays its contents styled in a fashion intended to indicate that the text is a short fragment of computer code. By default, the content text is displayed using the user agent's default monospace font.
441
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/code
442
+ *
443
+ */
444
+ export const code = elements.code
445
+
446
+ /**
447
+ * <data>
448
+ * Links a given piece of content with a machine-readable translation. If the content is time- or date-related, the <time> element must be used.
449
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/data
450
+ *
451
+ */
452
+ export const data = elements.data
453
+
454
+ /**
455
+ * <dfn>
456
+ * Used to indicate the term being defined within the context of a definition phrase or sentence. The ancestor <p> element, the <dt>/<dd> pairing, or the nearest section ancestor of the <dfn> element, is considered to be the definition of the term.
457
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dfn
458
+ *
459
+ */
460
+ export const dfn = elements.dfn
461
+
462
+ /**
463
+ * <em>
464
+ * Marks text that has stress emphasis. The <em> element can be nested, with each nesting level indicating a greater degree of emphasis.
465
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/em
466
+ *
467
+ */
468
+ export const em = elements.em
469
+
470
+ /**
471
+ * <i>
472
+ * Represents a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, and taxonomical designations, among others. Historically, these have been presented using italicized type, which is the original source of the <i> naming of this element.
473
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/i
474
+ *
475
+ */
476
+ export const i = elements.i
477
+
478
+ /**
479
+ * <kbd>
480
+ * Represents a span of inline text denoting textual user input from a keyboard, voice input, or any other text entry device. By convention, the user agent defaults to rendering the contents of a <kbd> element using its default monospace font, although this is not mandated by the HTML standard.
481
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/kbd
482
+ *
483
+ */
484
+ export const kbd = elements.kbd
485
+
486
+ /**
487
+ * <mark>
488
+ * Represents text which is marked or highlighted for reference or notation purposes due to the marked passage's relevance in the enclosing context.
489
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/mark
490
+ *
491
+ */
492
+ export const mark = elements.mark
493
+
494
+ /**
495
+ * <q>
496
+ * Indicates that the enclosed text is a short inline quotation. Most modern browsers implement this by surrounding the text in quotation marks. This element is intended for short quotations that don't require paragraph breaks; for long quotations use the <blockquote> element.
497
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/q>
498
+ *
499
+ */
500
+ export const q = elements.q
501
+
502
+ /**
503
+ * <rp>
504
+ * Used to provide fall-back parentheses for browsers that do not support the display of ruby annotations using the <ruby> element. One <rp> element should enclose each of the opening and closing parentheses that wrap the <rt> element that contains the annotation's text.
505
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/rp
506
+ *
507
+ */
508
+ export const rp = elements.rp
509
+
510
+ /**
511
+ * <rt>
512
+ * Specifies the ruby text component of a ruby annotation, which is used to provide pronunciation, translation, or transliteration information for East Asian typography. The <rt> element must always be contained within a <ruby> element.
513
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/rt
514
+ *
515
+ */
516
+ export const rt = elements.rt
517
+
518
+ /**
519
+ * <ruby>
520
+ * Represents small annotations that are rendered above, below, or next to base text, usually used for showing the pronunciation of East Asian characters. It can also be used for annotating other kinds of text, but this usage is less common.
521
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ruby
522
+ *
523
+ */
524
+ export const ruby = elements.ruby
525
+
526
+ /**
527
+ * <s>
528
+ * Renders text with a strikethrough, or a line through it. Use the <s> element to represent things that are no longer relevant or no longer accurate. However, <s> is not appropriate when indicating document edits; for that, use the <del> and <ins> elements, as appropriate.
529
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/s
530
+ *
531
+ */
532
+ export const s = elements.s
533
+
534
+ /**
535
+ * <samp>
536
+ * Used to enclose inline text which represents sample (or quoted) output from a computer program. Its contents are typically rendered using the browser's default monospaced font (such as Courier or Lucida Console).
537
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/samp
538
+ *
539
+ */
540
+ export const samp = elements.samp
541
+
542
+ /**
543
+ * <small>
544
+ * Represents side-comments and small print, like copyright and legal text, independent of its styled presentation. By default, it renders text within it one font size smaller, such as from small to x-small.
545
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/small
546
+ *
547
+ */
548
+ export const small = elements.small
549
+
550
+ /**
551
+ * <span>
552
+ * A generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang. It should be used only when no other semantic element is appropriate. <span> is very much like a div element, but div is a block-level element whereas a <span> is an inline-level element.
553
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/span
554
+ *
555
+ */
556
+ export const span = elements.span
557
+
558
+ /**
559
+ * <strong>
560
+ * Indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type.
561
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/strong
562
+ *
563
+ */
564
+ export const strong = elements.strong
565
+
566
+ /**
567
+ * <sub>
568
+ * Specifies inline text which should be displayed as subscript for solely typographical reasons. Subscripts are typically rendered with a lowered baseline using smaller text.
569
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/sub
570
+ *
571
+ */
572
+ export const sub = elements.sub
573
+
574
+ /**
575
+ * <sup>
576
+ * Specifies inline text which is to be displayed as superscript for solely typographical reasons. Superscripts are usually rendered with a raised baseline using smaller text.
577
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/sup
578
+ *
579
+ */
580
+ export const sup = elements.sup
581
+
582
+ /**
583
+ * <time>
584
+ * Represents a specific period in time. It may include the datetime attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders.
585
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/time
586
+ *
587
+ */
588
+ export const time = elements.time
589
+
590
+ /**
591
+ * <u>
592
+ * Represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation. This is rendered by default as a single solid underline but may be altered using CSS.
593
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/u
594
+ *
595
+ */
596
+ export const u = elements.u
597
+
598
+ /**
599
+ * <var>
600
+ * Represents the name of a variable in a mathematical expression or a programming context. It's typically presented using an italicized version of the current typeface, although that behavior is browser-dependent.
601
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/var
602
+ *
603
+ */
604
+ export const htmlvar = elements.var
605
+
606
+ /**
607
+ * <wbr>
608
+ * Represents a word break opportunity—a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location.
609
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/wbr
610
+ *
611
+ */
612
+ export const wbr = elements.wbr
613
+
614
+ /**
615
+ * <area>
616
+ * Defines an area inside an image map that has predefined clickable areas. An image map allows geometric areas on an image to be associated with hyperlink.
617
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/area
618
+ *
619
+ */
620
+ export const area = elements.area
621
+
622
+ /**
623
+ * <audio>
624
+ * Used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the source element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.
625
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/audio
626
+ *
627
+ */
628
+ export const audio = elements.audio
629
+
630
+ /**
631
+ * <img>
632
+ * Embeds an image into the document.
633
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img
634
+ *
635
+ */
636
+ export const img = elements.img
637
+
638
+ /**
639
+ * <map>
640
+ * Used with <area> elements to define an image map (a clickable link area).
641
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/map
642
+ *
643
+ */
644
+ export const map = elements.map
645
+
646
+ /**
647
+ * <track>
648
+ * Used as a child of the media elements, audio and video. It lets you specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files)—Web Video Text Tracks.
649
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/track
650
+ *
651
+ */
652
+ export const track = elements.track
653
+
654
+ /**
655
+ * <video>
656
+ * Embeds a media player which supports video playback into the document. You can also use <video> for audio content, but the audio element may provide a more appropriate user experience.
657
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/video
658
+ *
659
+ */
660
+ export const video = elements.video
661
+
662
+ /**
663
+ * <embed>
664
+ * Embeds external content at the specified point in the document. This content is provided by an external application or other source of interactive content such as a browser plug-in.
665
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/embed
666
+ *
667
+ */
668
+ export const embed = elements.embed
669
+
670
+ /**
671
+ * <iframe>
672
+ * Represents a nested browsing context, embedding another HTML page into the current one.
673
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe
674
+ *
675
+ */
676
+ export const iframe = elements.iframe
677
+
678
+ /**
679
+ * <object>
680
+ * Represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin.
681
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/object
682
+ *
683
+ */
684
+ export const object = elements.object
685
+
686
+ /**
687
+ * <picture>
688
+ * Contains zero or more <source> elements and one <img> element to offer alternative versions of an image for different display/device scenarios.
689
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/picture
690
+ *
691
+ */
692
+ export const picture = elements.picture
693
+
694
+ /**
695
+ * <source>
696
+ * Specifies multiple media resources for the picture, the audio element, or the video element. It is a void element, meaning that it has no content and does not have a closing tag. It is commonly used to offer the same media content in multiple file formats in order to provide compatibility with a broad range of browsers given their differing support for image file formats and media file formats.
697
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/source
698
+ *
699
+ */
700
+ export const source = elements.source
701
+
702
+ /**
703
+ * <canvas>
704
+ * Container element to use with either the canvas scripting API or the WebGL API to draw graphics and animations.
705
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/canvas
706
+ *
707
+ */
708
+ export const canvas = elements.canvas
709
+
710
+ /**
711
+ * <noscript>
712
+ * Defines a section of HTML to be inserted if a script type on the page is unsupported or if scripting is currently turned off in the browser.
713
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/noscript
714
+ *
715
+ */
716
+ export const noscript = elements.noscript
717
+
718
+ /**
719
+ * <script>
720
+ * Used to embed executable code or data; this is typically used to embed or refer to JavaScript code. The <script> element can also be used with other languages, such as WebGL's GLSL shader programming language and JSON.
721
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script
722
+ *
723
+ */
724
+ export const script = elements.script
725
+
726
+ /**
727
+ * <del>
728
+ * Represents a range of text that has been deleted from a document. This can be used when rendering "track changes" or source code diff information, for example. The <ins> element can be used for the opposite purpose: to indicate text that has been added to the document.
729
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/del
730
+ *
731
+ */
732
+ export const del = elements.del
733
+
734
+ /**
735
+ * <ins>
736
+ * Represents a range of text that has been added to a document. You can use the <del> element to similarly represent a range of text that has been deleted from the document.
737
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ins
738
+ *
739
+ */
740
+ export const ins = elements.ins
741
+
742
+ /**
743
+ * <caption>
744
+ * Specifies the caption (or title) of a table.
745
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/caption
746
+ *
747
+ */
748
+ export const caption = elements.caption
749
+
750
+ /**
751
+ * <col>
752
+ * Defines one or more columns in a column group represented by its implicit or explicit parent <colgroup> element. The <col> element is only valid as a child of a <colgroup> element that has no span attribute defined.
753
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/col
754
+ *
755
+ */
756
+ export const col = elements.col
757
+
758
+ /**
759
+ * <colgroup>
760
+ * Defines a group of columns within a table.
761
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/colgroup
762
+ *
763
+ */
764
+ export const colgroup = elements.colgroup
765
+
766
+ /**
767
+ * <table>
768
+ * Represents tabular data—that is, information presented in a two-dimensional table comprised of rows and columns of cells containing data.
769
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/table
770
+ *
771
+ */
772
+ export const table = elements.table
773
+
774
+ /**
775
+ * <tbody>
776
+ * Encapsulates a set of table rows (<tr> elements), indicating that they comprise the body of a table's (main) data.
777
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/tbody
778
+ *
779
+ */
780
+ export const tbody = elements.tbody
781
+
782
+ /**
783
+ * <td>
784
+ * A child of the <tr> element, it defines a cell of a table that contains data.
785
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/td
786
+ *
787
+ */
788
+ export const td = elements.td
789
+
790
+ /**
791
+ * <tfoot>
792
+ * Encapsulates a set of table rows (<tr> elements), indicating that they comprise the foot of a table with information about the table's columns. This is usually a summary of the columns, e.g., a sum of the given numbers in a column.
793
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/tfoot
794
+ *
795
+ */
796
+ export const tfoot = elements.tfoot
797
+
798
+ /**
799
+ * <th>
800
+ * A child of the <tr> element, it defines a cell as the header of a group of table cells. The nature of this group can be explicitly defined by the scope and headers attributes.
801
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/th
802
+ *
803
+ */
804
+ export const th = elements.th
805
+
806
+ /**
807
+ * <thead>
808
+ * Encapsulates a set of table rows (<tr> elements), indicating that they comprise the head of a table with information about the table's columns. This is usually in the form of column headers (<th> elements).
809
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/thead
810
+ *
811
+ */
812
+ export const thead = elements.thead
813
+
814
+ /**
815
+ * <tr>
816
+ * Defines a row of cells in a table. The row's cells can then be established using a mix of <td> (data cell) and <th> (header cell) elements.
817
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/tr
818
+ *
819
+ */
820
+ export const tr = elements.tr
821
+
822
+ /**
823
+ * <button>
824
+ * An interactive element activated by a user with a mouse, keyboard, finger, voice command, or other assistive technology. Once activated, it performs an action, such as submitting a form or opening a dialog.
825
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button
826
+ *
827
+ */
828
+ export const button = elements.button
829
+
830
+ /**
831
+ * <datalist>
832
+ * Contains a set of <option> elements that represent the permissible or recommended options available to choose from within other controls.
833
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/datalist
834
+ *
835
+ */
836
+ export const datalist = elements.datalist
837
+
838
+ /**
839
+ * <fieldset>
840
+ * Used to group several controls as well as labels (<label>) within a web form.
841
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/fieldset
842
+ *
843
+ */
844
+ export const fieldset = elements.fieldset
845
+
846
+ /**
847
+ * <form>
848
+ * Represents a document section containing interactive controls for submitting information.
849
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/form
850
+ *
851
+ */
852
+ export const form = elements.form
853
+
854
+ /**
855
+ * <input>
856
+ * Used to create interactive controls for web-based forms to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent. The <input> element is one of the most powerful and complex in all of HTML due to the sheer number of combinations of input types and attributes.
857
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input
858
+ *
859
+ */
860
+ export const input = elements.input
861
+
862
+ /**
863
+ * <label>
864
+ * Represents a caption for an item in a user interface.
865
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/label
866
+ *
867
+ */
868
+ export const label = elements.label
869
+
870
+ /**
871
+ * <legend>
872
+ * Represents a caption for the content of its parent <fieldset>.
873
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/legend
874
+ *
875
+ */
876
+ export const legend = elements.legend
877
+
878
+ /**
879
+ * <meter>
880
+ * Represents either a scalar value within a known range or a fractional value.
881
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meter
882
+ *
883
+ */
884
+ export const meter = elements.meter
885
+
886
+ /**
887
+ * <optgroup>
888
+ * Creates a grouping of options within a <select> element.
889
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/optgroup
890
+ *
891
+ */
892
+ export const optgroup = elements.optgroup
893
+
894
+ /**
895
+ * <option>
896
+ * Used to define an item contained in a select, an <optgroup>, or a <datalist> element. As such, <option> can represent menu items in popups and other lists of items in an HTML document.
897
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/option
898
+ *
899
+ */
900
+ export const option = elements.option
901
+
902
+ /**
903
+ * <output>
904
+ * Container element into which a site or app can inject the results of a calculation or the outcome of a user action.
905
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/output
906
+ *
907
+ */
908
+ export const output = elements.output
909
+
910
+ /**
911
+ * <progress>
912
+ * Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
913
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/progress
914
+ *
915
+ */
916
+ export const progress = elements.progress
917
+
918
+ /**
919
+ * <select>
920
+ * Represents a control that provides a menu of options.
921
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/select
922
+ *
923
+ */
924
+ export const select = elements.select
925
+
926
+ /**
927
+ * <textarea>
928
+ * Represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example, a comment on a review or feedback form.
929
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/textarea
930
+ *
931
+ */
932
+ export const textarea = elements.textarea
933
+
934
+ /**
935
+ * <details>
936
+ * Creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label must be provided using the <summary> element.
937
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/details
938
+ *
939
+ */
940
+ export const details = elements.details
941
+
942
+ /**
943
+ * <dialog>
944
+ * Represents a dialog box or other interactive component, such as a dismissible alert, inspector, or subwindow.
945
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dialog
946
+ *
947
+ */
948
+ export const dialog = elements.dialog
949
+
950
+ /**
951
+ * <summary>
952
+ * Specifies a summary, caption, or legend for a details element's disclosure box. Clicking the <summary> element toggles the state of the parent <details> element open and closed.
953
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/summary
954
+ *
955
+ */
956
+ export const summary = elements.summary
957
+
958
+ /**
959
+ * <slot>
960
+ * Part of the Web Components technology suite, this element is a placeholder inside a web component that you can fill with your own markup, which lets you create separate DOM trees and present them together.
961
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/slot
962
+ *
963
+ */
964
+ export const slot = elements.slot
965
+
966
+ /**
967
+ * <template>
968
+ * A mechanism for holding HTML that is not to be rendered immediately when a page is loaded but may be instantiated subsequently during runtime using JavaScript.
969
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template
970
+ *
971
+ */
972
+ export const template = elements.template
973
+
974
+ /**
975
+ * <image>
976
+ * An ancient and poorly supported precursor to the <img> element. It should not be used.
977
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/image
978
+ *
979
+ */
980
+ export const image = elements.image
981
+
982
+ /**
983
+ * <rb>
984
+ * Used to delimit the base text component of a ruby annotation, i.e., the text that is being annotated. One <rb> element should wrap each separate atomic segment of the base text.
985
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/rb
986
+ *
987
+ */
988
+ export const rb = elements.rb
989
+
990
+ /**
991
+ * <rtc>
992
+ * Embraces semantic annotations of characters presented in a ruby of <rb> elements used inside of <ruby> element. <rb> elements can have both pronunciation (<rt>) and semantic (<rtc>) annotations.
993
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/rtc
994
+ *
995
+ */
996
+ export const rtc = elements.rtc