Browse Source

Adding sub sup and blockquote web component (#3325)

Some HTML markup are missing. This pull request add following components
:

- Sup
- Sub
- Blockquote
pull/3884/head
Arthur Pavarino 1 year ago committed by GitHub
parent
commit
8741329f91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      html/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Elements.kt
  2. 5
      html/core/src/jsTest/kotlin/elements/ElementsTests.kt

21
html/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Elements.kt

@ -119,6 +119,9 @@ private val Em: ElementBuilder<HTMLElement> = ElementBuilderImplementation("em")
private val I: ElementBuilder<HTMLElement> = ElementBuilderImplementation("i") private val I: ElementBuilder<HTMLElement> = ElementBuilderImplementation("i")
private val B: ElementBuilder<HTMLElement> = ElementBuilderImplementation("b") private val B: ElementBuilder<HTMLElement> = ElementBuilderImplementation("b")
private val Small: ElementBuilder<HTMLElement> = ElementBuilderImplementation("small") private val Small: ElementBuilder<HTMLElement> = ElementBuilderImplementation("small")
private val Sup: ElementBuilder<HTMLElement> = ElementBuilderImplementation("sup")
private val Sub: ElementBuilder<HTMLElement> = ElementBuilderImplementation("sub")
private val Blockquote: ElementBuilder<HTMLElement> = ElementBuilderImplementation("blockquote")
private val Span: ElementBuilder<HTMLSpanElement> = ElementBuilderImplementation("span") private val Span: ElementBuilder<HTMLSpanElement> = ElementBuilderImplementation("span")
@ -590,6 +593,24 @@ fun Small(
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) = TagElement(elementBuilder = Small, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = Small, applyAttrs = attrs, content = content)
@Composable
fun Sup(
attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null
) = TagElement(elementBuilder = Sup, applyAttrs = attrs, content = content)
@Composable
fun Sub(
attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null
) = TagElement(elementBuilder = Sub, applyAttrs = attrs, content = content)
@Composable
fun Blockquote(
attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null
) = TagElement(elementBuilder = Blockquote, applyAttrs = attrs, content = content)
@Composable @Composable
fun Span( fun Span(
attrs: AttrBuilderContext<HTMLSpanElement>? = null, attrs: AttrBuilderContext<HTMLSpanElement>? = null,

5
html/core/src/jsTest/kotlin/elements/ElementsTests.kt

@ -61,8 +61,11 @@ class ElementsTests {
Pair({ Em() }, "EM"), Pair({ Em() }, "EM"),
Pair({ I() }, "I"), Pair({ I() }, "I"),
Pair({ B() }, "B"), Pair({ B() }, "B"),
Pair({ Small() }, "SMALL"), Pair({ Small() }, "SMALL"),
Pair({ Sup() }, "SUB"),
Pair({ Sub() }, "SUP"),
Pair({ Blockquote()}, "BLOCKQUOTE"),
Pair({ Span() }, "SPAN"), Pair({ Span() }, "SPAN"),
Pair({ Br() }, "BR"), Pair({ Br() }, "BR"),
Pair({ Ul() }, "UL"), Pair({ Ul() }, "UL"),

Loading…
Cancel
Save