diff --git a/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Base.kt b/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Base.kt index f292ba580a..f54cd4465f 100644 --- a/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Base.kt +++ b/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Base.kt @@ -93,104 +93,6 @@ class DisposableEffectHolder( var effect: (DisposableEffectScope.(Element) -> DisposableEffectResult)? = null ) -interface ElementBuilder { - fun create(): TElement - - private open class ElementBuilderImplementation(private val tagName: String) : ElementBuilder { - private val el: Element by lazy { document.createElement(tagName) } - override fun create(): TElement = el.cloneNode() as TElement - } - - companion object { - fun createBuilder(tagName: String): ElementBuilder { - return object : ElementBuilderImplementation(tagName) {} - } - - val Address: ElementBuilder = ElementBuilderImplementation("address") - val Article: ElementBuilder = ElementBuilderImplementation("article") - val Aside: ElementBuilder = ElementBuilderImplementation("aside") - val Header: ElementBuilder = ElementBuilderImplementation("header") - - val Area: ElementBuilder = ElementBuilderImplementation("area") - val Audio: ElementBuilder = ElementBuilderImplementation("audio") - val Map: ElementBuilder = ElementBuilderImplementation("map") - val Track: ElementBuilder = ElementBuilderImplementation("track") - val Video: ElementBuilder = ElementBuilderImplementation("video") - - val Datalist: ElementBuilder = ElementBuilderImplementation("datalist") - val Fieldset: ElementBuilder = ElementBuilderImplementation("fieldset") - val Legend: ElementBuilder = ElementBuilderImplementation("legend") - val Meter: ElementBuilder = ElementBuilderImplementation("meter") - val Output: ElementBuilder = ElementBuilderImplementation("output") - val Progress: ElementBuilder = ElementBuilderImplementation("progress") - - val Embed: ElementBuilder = ElementBuilderImplementation("embed") - val Iframe: ElementBuilder = ElementBuilderImplementation("iframe") - val Object: ElementBuilder = ElementBuilderImplementation("object") - val Param: ElementBuilder = ElementBuilderImplementation("param") - val Picture: ElementBuilder = ElementBuilderImplementation("picture") - val Source: ElementBuilder = ElementBuilderImplementation("source") - - val Div: ElementBuilder = ElementBuilderImplementation("div") - val A: ElementBuilder = ElementBuilderImplementation("a") - val Input: ElementBuilder = ElementBuilderImplementation("input") - val Button: ElementBuilder = ElementBuilderImplementation("button") - - val H1: ElementBuilder = ElementBuilderImplementation("h1") - val H2: ElementBuilder = ElementBuilderImplementation("h2") - val H3: ElementBuilder = ElementBuilderImplementation("h3") - val H4: ElementBuilder = ElementBuilderImplementation("h4") - val H5: ElementBuilder = ElementBuilderImplementation("h5") - val H6: ElementBuilder = ElementBuilderImplementation("h6") - - val P: ElementBuilder = ElementBuilderImplementation("p") - - val Em: ElementBuilder = ElementBuilderImplementation("em") - val I: ElementBuilder = ElementBuilderImplementation("i") - val B: ElementBuilder = ElementBuilderImplementation("b") - val Small: ElementBuilder = ElementBuilderImplementation("small") - - val Span: ElementBuilder = ElementBuilderImplementation("span") - - val Br: ElementBuilder = ElementBuilderImplementation("br") - - val Ul: ElementBuilder = ElementBuilderImplementation("ul") - val Ol: ElementBuilder = ElementBuilderImplementation("ol") - - val Li: ElementBuilder = ElementBuilderImplementation("li") - - val Img: ElementBuilder = ElementBuilderImplementation("img") - val Form: ElementBuilder = ElementBuilderImplementation("form") - - val Select: ElementBuilder = ElementBuilderImplementation("select") - val Option: ElementBuilder = ElementBuilderImplementation("option") - val OptGroup: ElementBuilder = ElementBuilderImplementation("optgroup") - - val Section: ElementBuilder = ElementBuilderImplementation("section") - val TextArea: ElementBuilder = ElementBuilderImplementation("textarea") - val Nav: ElementBuilder = ElementBuilderImplementation("nav") - val Pre: ElementBuilder = ElementBuilderImplementation("pre") - val Code: ElementBuilder = ElementBuilderImplementation("code") - - val Main: ElementBuilder = ElementBuilderImplementation("main") - val Footer: ElementBuilder = ElementBuilderImplementation("footer") - val Hr: ElementBuilder = ElementBuilderImplementation("hr") - val Label: ElementBuilder = ElementBuilderImplementation("label") - val Table: ElementBuilder = ElementBuilderImplementation("table") - val Caption: ElementBuilder = ElementBuilderImplementation("caption") - val Col: ElementBuilder = ElementBuilderImplementation("col") - val Colgroup: ElementBuilder = ElementBuilderImplementation("colgroup") - val Tr: ElementBuilder = ElementBuilderImplementation("tr") - val Thead: ElementBuilder = ElementBuilderImplementation("thead") - val Th: ElementBuilder = ElementBuilderImplementation("th") - val Td: ElementBuilder = ElementBuilderImplementation("td") - val Tbody: ElementBuilder = ElementBuilderImplementation("tbody") - val Tfoot: ElementBuilder = ElementBuilderImplementation("tfoot") - - val Style: ElementBuilder = ElementBuilderImplementation("style") - } -} - @Composable fun TagElement( elementBuilder: ElementBuilder, diff --git a/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Elements.kt b/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Elements.kt index c3f5635842..c6f14ef1da 100644 --- a/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Elements.kt +++ b/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Elements.kt @@ -15,6 +15,8 @@ import org.jetbrains.compose.web.attributes.src import org.jetbrains.compose.web.attributes.type import org.jetbrains.compose.web.attributes.value import kotlinx.browser.document +import org.jetbrains.compose.web.css.CSSRuleDeclarationList +import org.w3c.dom.Element import org.w3c.dom.HTMLAnchorElement import org.w3c.dom.HTMLAreaElement import org.w3c.dom.HTMLAudioElement @@ -49,6 +51,7 @@ import org.w3c.dom.HTMLProgressElement import org.w3c.dom.HTMLSelectElement import org.w3c.dom.HTMLSourceElement import org.w3c.dom.HTMLSpanElement +import org.w3c.dom.HTMLStyleElement import org.w3c.dom.HTMLTableCaptionElement import org.w3c.dom.HTMLTableCellElement import org.w3c.dom.HTMLTableColElement @@ -64,13 +67,114 @@ import org.w3c.dom.Text typealias AttrBuilderContext = AttrsBuilder.() -> Unit typealias ContentBuilder = @Composable ElementScope.() -> Unit +interface ElementBuilder { + fun create(): TElement + + companion object { + fun createBuilder(tagName: String): ElementBuilder { + return object : ElementBuilderImplementation(tagName) {} + } + } +} + +private open class ElementBuilderImplementation(private val tagName: String) : ElementBuilder { + private val el: Element by lazy { document.createElement(tagName) } + override fun create(): TElement = el.cloneNode() as TElement +} + +private object DomBuilder { + val Address: ElementBuilder = ElementBuilderImplementation("address") + val Article: ElementBuilder = ElementBuilderImplementation("article") + val Aside: ElementBuilder = ElementBuilderImplementation("aside") + val Header: ElementBuilder = ElementBuilderImplementation("header") + + val Area: ElementBuilder = ElementBuilderImplementation("area") + val Audio: ElementBuilder = ElementBuilderImplementation("audio") + val Map: ElementBuilder = ElementBuilderImplementation("map") + val Track: ElementBuilder = ElementBuilderImplementation("track") + val Video: ElementBuilder = ElementBuilderImplementation("video") + + val Datalist: ElementBuilder = ElementBuilderImplementation("datalist") + val Fieldset: ElementBuilder = ElementBuilderImplementation("fieldset") + val Legend: ElementBuilder = ElementBuilderImplementation("legend") + val Meter: ElementBuilder = ElementBuilderImplementation("meter") + val Output: ElementBuilder = ElementBuilderImplementation("output") + val Progress: ElementBuilder = ElementBuilderImplementation("progress") + + val Embed: ElementBuilder = ElementBuilderImplementation("embed") + val Iframe: ElementBuilder = ElementBuilderImplementation("iframe") + val Object: ElementBuilder = ElementBuilderImplementation("object") + val Param: ElementBuilder = ElementBuilderImplementation("param") + val Picture: ElementBuilder = ElementBuilderImplementation("picture") + val Source: ElementBuilder = ElementBuilderImplementation("source") + + val Div: ElementBuilder = ElementBuilderImplementation("div") + val A: ElementBuilder = ElementBuilderImplementation("a") + val Input: ElementBuilder = ElementBuilderImplementation("input") + val Button: ElementBuilder = ElementBuilderImplementation("button") + + val H1: ElementBuilder = ElementBuilderImplementation("h1") + val H2: ElementBuilder = ElementBuilderImplementation("h2") + val H3: ElementBuilder = ElementBuilderImplementation("h3") + val H4: ElementBuilder = ElementBuilderImplementation("h4") + val H5: ElementBuilder = ElementBuilderImplementation("h5") + val H6: ElementBuilder = ElementBuilderImplementation("h6") + + val P: ElementBuilder = ElementBuilderImplementation("p") + + val Em: ElementBuilder = ElementBuilderImplementation("em") + val I: ElementBuilder = ElementBuilderImplementation("i") + val B: ElementBuilder = ElementBuilderImplementation("b") + val Small: ElementBuilder = ElementBuilderImplementation("small") + + val Span: ElementBuilder = ElementBuilderImplementation("span") + + val Br: ElementBuilder = ElementBuilderImplementation("br") + + val Ul: ElementBuilder = ElementBuilderImplementation("ul") + val Ol: ElementBuilder = ElementBuilderImplementation("ol") + + val Li: ElementBuilder = ElementBuilderImplementation("li") + + val Img: ElementBuilder = ElementBuilderImplementation("img") + val Form: ElementBuilder = ElementBuilderImplementation("form") + + val Select: ElementBuilder = ElementBuilderImplementation("select") + val Option: ElementBuilder = ElementBuilderImplementation("option") + val OptGroup: ElementBuilder = ElementBuilderImplementation("optgroup") + + val Section: ElementBuilder = ElementBuilderImplementation("section") + val TextArea: ElementBuilder = ElementBuilderImplementation("textarea") + val Nav: ElementBuilder = ElementBuilderImplementation("nav") + val Pre: ElementBuilder = ElementBuilderImplementation("pre") + val Code: ElementBuilder = ElementBuilderImplementation("code") + + val Main: ElementBuilder = ElementBuilderImplementation("main") + val Footer: ElementBuilder = ElementBuilderImplementation("footer") + val Hr: ElementBuilder = ElementBuilderImplementation("hr") + val Label: ElementBuilder = ElementBuilderImplementation("label") + val Table: ElementBuilder = ElementBuilderImplementation("table") + val Caption: ElementBuilder = ElementBuilderImplementation("caption") + val Col: ElementBuilder = ElementBuilderImplementation("col") + val Colgroup: ElementBuilder = ElementBuilderImplementation("colgroup") + val Tr: ElementBuilder = ElementBuilderImplementation("tr") + val Thead: ElementBuilder = ElementBuilderImplementation("thead") + val Th: ElementBuilder = ElementBuilderImplementation("th") + val Td: ElementBuilder = ElementBuilderImplementation("td") + val Tbody: ElementBuilder = ElementBuilderImplementation("tbody") + val Tfoot: ElementBuilder = ElementBuilderImplementation("tfoot") + + val Style: ElementBuilder = ElementBuilderImplementation("style") +} + + @Composable fun Address( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Address, + elementBuilder = DomBuilder.Address, applyAttrs = attrs, content = content ) @@ -82,7 +186,7 @@ fun Article( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Article, + elementBuilder = DomBuilder.Article, applyAttrs = attrs, content = content ) @@ -94,7 +198,7 @@ fun Aside( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Aside, + elementBuilder = DomBuilder.Aside, applyAttrs = attrs, content = content ) @@ -106,7 +210,7 @@ fun Header( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Header, + elementBuilder = DomBuilder.Header, applyAttrs = attrs, content = content ) @@ -118,7 +222,7 @@ fun Area( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Area, + elementBuilder = DomBuilder.Area, applyAttrs = attrs, content = content ) @@ -130,7 +234,7 @@ fun Audio( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Audio, + elementBuilder = DomBuilder.Audio, applyAttrs = attrs, content = content ) @@ -142,7 +246,7 @@ fun HTMLMap( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Map, + elementBuilder = DomBuilder.Map, applyAttrs = attrs, content = content ) @@ -154,7 +258,7 @@ fun Track( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Track, + elementBuilder = DomBuilder.Track, applyAttrs = attrs, content = content ) @@ -166,7 +270,7 @@ fun Video( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Video, + elementBuilder = DomBuilder.Video, applyAttrs = attrs, content = content ) @@ -178,7 +282,7 @@ fun Datalist( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Datalist, + elementBuilder = DomBuilder.Datalist, applyAttrs = attrs, content = content ) @@ -190,7 +294,7 @@ fun Fieldset( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Fieldset, + elementBuilder = DomBuilder.Fieldset, applyAttrs = attrs, content = content ) @@ -202,7 +306,7 @@ fun Legend( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Legend, + elementBuilder = DomBuilder.Legend, applyAttrs = attrs, content = content ) @@ -214,7 +318,7 @@ fun Meter( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Meter, + elementBuilder = DomBuilder.Meter, applyAttrs = attrs, content = content ) @@ -226,7 +330,7 @@ fun Output( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Output, + elementBuilder = DomBuilder.Output, applyAttrs = attrs, content = content ) @@ -238,7 +342,7 @@ fun Progress( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Progress, + elementBuilder = DomBuilder.Progress, applyAttrs = attrs, content = content ) @@ -250,7 +354,7 @@ fun Embed( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Embed, + elementBuilder = DomBuilder.Embed, applyAttrs = attrs, content = content ) @@ -262,7 +366,7 @@ fun Iframe( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Iframe, + elementBuilder = DomBuilder.Iframe, applyAttrs = attrs, content = content ) @@ -274,7 +378,7 @@ fun Object( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Object, + elementBuilder = DomBuilder.Object, applyAttrs = attrs, content = content ) @@ -286,7 +390,7 @@ fun Param( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Param, + elementBuilder = DomBuilder.Param, applyAttrs = attrs, content = content ) @@ -298,7 +402,7 @@ fun Picture( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Picture, + elementBuilder = DomBuilder.Picture, applyAttrs = attrs, content = content ) @@ -310,7 +414,7 @@ fun Source( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Source, + elementBuilder = DomBuilder.Source, applyAttrs = attrs, content = content ) @@ -332,7 +436,7 @@ fun Div( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Div, + elementBuilder = DomBuilder.Div, applyAttrs = attrs, content = content ) @@ -345,7 +449,7 @@ fun A( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.A, + elementBuilder = DomBuilder.A, applyAttrs = { if (href != null) { this.href(href) @@ -363,7 +467,7 @@ fun Input( attrs: AttrBuilderContext = {} ) { TagElement( - elementBuilder = ElementBuilder.Input, + elementBuilder = DomBuilder.Input, applyAttrs = { type(type) value(value) @@ -377,107 +481,107 @@ fun Input( fun Button( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.Button, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.Button, applyAttrs = attrs, content = content) @Composable fun H1( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.H1, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.H1, applyAttrs = attrs, content = content) @Composable fun H2( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.H2, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.H2, applyAttrs = attrs, content = content) @Composable fun H3( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.H3, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.H3, applyAttrs = attrs, content = content) @Composable fun H4( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.H4, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.H4, applyAttrs = attrs, content = content) @Composable fun H5( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.H5, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.H5, applyAttrs = attrs, content = content) @Composable fun H6( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.H6, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.H6, applyAttrs = attrs, content = content) @Composable fun P( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.P, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.P, applyAttrs = attrs, content = content) @Composable fun Em( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.Em, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.Em, applyAttrs = attrs, content = content) @Composable fun I( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.I, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.I, applyAttrs = attrs, content = content) @Composable fun B( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.B, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.B, applyAttrs = attrs, content = content) @Composable fun Small( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.Small, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.Small, applyAttrs = attrs, content = content) @Composable fun Span( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.Span, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.Span, applyAttrs = attrs, content = content) @Composable fun Br(attrs: AttrBuilderContext = {}) = - TagElement(elementBuilder = ElementBuilder.Br, applyAttrs = attrs, content = null) + TagElement(elementBuilder = DomBuilder.Br, applyAttrs = attrs, content = null) @Composable fun Ul( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.Ul, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.Ul, applyAttrs = attrs, content = content) @Composable fun Ol( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.Ol, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.Ol, applyAttrs = attrs, content = content) @Composable fun DOMScope.Li( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.Li, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.Li, applyAttrs = attrs, content = content) @Composable fun DOMScope.Li( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null -) = TagElement(elementBuilder = ElementBuilder.Li, applyAttrs = attrs, content = content) +) = TagElement(elementBuilder = DomBuilder.Li, applyAttrs = attrs, content = content) @Composable fun Img( @@ -485,7 +589,7 @@ fun Img( alt: String = "", attrs: AttrBuilderContext = {} ) = TagElement( - elementBuilder = ElementBuilder.Img, + elementBuilder = DomBuilder.Img, applyAttrs = { src(src).alt(alt) attrs() @@ -499,7 +603,7 @@ fun Form( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null ) = TagElement( - elementBuilder = ElementBuilder.Form, + elementBuilder = DomBuilder.Form, applyAttrs = { if (!action.isNullOrEmpty()) action(action) attrs() @@ -512,7 +616,7 @@ fun Select( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null ) = TagElement( - elementBuilder = ElementBuilder.Select, + elementBuilder = DomBuilder.Select, applyAttrs = attrs, content = content ) @@ -523,7 +627,7 @@ fun Option( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null ) = TagElement( - elementBuilder = ElementBuilder.Option, + elementBuilder = DomBuilder.Option, applyAttrs = { value(value) attrs() @@ -537,7 +641,7 @@ fun OptGroup( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null ) = TagElement( - elementBuilder = ElementBuilder.OptGroup, + elementBuilder = DomBuilder.OptGroup, applyAttrs = { label(label) attrs() @@ -550,7 +654,7 @@ fun Section( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null ) = TagElement( - elementBuilder = ElementBuilder.Section, + elementBuilder = DomBuilder.Section, applyAttrs = attrs, content = content ) @@ -560,7 +664,7 @@ fun TextArea( attrs: AttrBuilderContext = {}, value: String ) = TagElement( - elementBuilder = ElementBuilder.TextArea, + elementBuilder = DomBuilder.TextArea, applyAttrs = { value(value) attrs() @@ -574,7 +678,7 @@ fun Nav( attrs: AttrBuilderContext = {}, content: ContentBuilder? = null ) = TagElement( - elementBuilder = ElementBuilder.Nav, + elementBuilder = DomBuilder.Nav, applyAttrs = attrs, content = content ) @@ -585,7 +689,7 @@ fun Pre( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Pre, + elementBuilder = DomBuilder.Pre, applyAttrs = attrs, content = content ) @@ -597,7 +701,7 @@ fun Code( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Code, + elementBuilder = DomBuilder.Code, applyAttrs = attrs, content = content ) @@ -609,7 +713,7 @@ fun Main( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Main, + elementBuilder = DomBuilder.Main, applyAttrs = attrs, content = content ) @@ -621,7 +725,7 @@ fun Footer( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Footer, + elementBuilder = DomBuilder.Footer, applyAttrs = attrs, content = content ) @@ -632,7 +736,7 @@ fun Hr( attrs: AttrBuilderContext = {} ) { TagElement( - elementBuilder = ElementBuilder.Hr, + elementBuilder = DomBuilder.Hr, applyAttrs = attrs, content = null ) @@ -645,7 +749,7 @@ fun Label( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Label, + elementBuilder = DomBuilder.Label, applyAttrs = { if (forId != null) { forId(forId) @@ -662,7 +766,7 @@ fun Table( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Table, + elementBuilder = DomBuilder.Table, applyAttrs = attrs, content = content ) @@ -674,7 +778,7 @@ fun Caption( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Caption, + elementBuilder = DomBuilder.Caption, applyAttrs = attrs, content = content ) @@ -685,7 +789,7 @@ fun Col( attrs: AttrBuilderContext = {} ) { TagElement( - elementBuilder = ElementBuilder.Col, + elementBuilder = DomBuilder.Col, applyAttrs = attrs, content = null ) @@ -697,7 +801,7 @@ fun Colgroup( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Colgroup, + elementBuilder = DomBuilder.Colgroup, applyAttrs = attrs, content = content ) @@ -709,7 +813,7 @@ fun Tr( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Tr, + elementBuilder = DomBuilder.Tr, applyAttrs = attrs, content = content ) @@ -721,7 +825,7 @@ fun Thead( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Thead, + elementBuilder = DomBuilder.Thead, applyAttrs = attrs, content = content ) @@ -733,7 +837,7 @@ fun Th( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Th, + elementBuilder = DomBuilder.Th, applyAttrs = attrs, content = content ) @@ -745,7 +849,7 @@ fun Td( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Td, + elementBuilder = DomBuilder.Td, applyAttrs = attrs, content = content ) @@ -757,7 +861,7 @@ fun Tbody( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Tbody, + elementBuilder = DomBuilder.Tbody, applyAttrs = attrs, content = content ) @@ -769,8 +873,36 @@ fun Tfoot( content: ContentBuilder? = null ) { TagElement( - elementBuilder = ElementBuilder.Tfoot, + elementBuilder = DomBuilder.Tfoot, applyAttrs = attrs, content = content ) } + +/** + * Use this function to mount the