Browse Source

web: add typealias AttrsBuilder referencing new AttrsScopeBuilder (#1778)

This mitigates possible breaking API changes

Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
pull/1782/head
Oleksandr Karpovich 3 years ago committed by GitHub
parent
commit
0c30a3e2af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 43
      web/core/src/jsMain/kotlin/org/jetbrains/compose/web/attributes/AttrsScope.kt
  2. 131
      web/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Elements.kt
  3. 78
      web/svg/src/jsMain/kotlin/org/jetbrains/compose/web/svg/svg.kt

43
web/core/src/jsMain/kotlin/org/jetbrains/compose/web/attributes/AttrsScope.kt

@ -8,6 +8,15 @@ import org.jetbrains.compose.web.internal.runtime.ComposeWebInternalApi
import org.w3c.dom.Element import org.w3c.dom.Element
import org.w3c.dom.HTMLElement import org.w3c.dom.HTMLElement
@Deprecated(
message = "Renamed to AttrsScopeBuilder",
replaceWith = ReplaceWith(
expression = "AttrsScopeBuilder<T>",
imports = arrayOf("org.jetbrains.compose.web.attributes.AttrsScopeBuilder")
)
)
typealias AttrsBuilder<T> = AttrsScopeBuilder<T>
/** /**
* [AttrsScope] is a class that is used (as a builder context, that is as AttrsBuilder<T>.() -> Unit) * [AttrsScope] is a class that is used (as a builder context, that is as AttrsBuilder<T>.() -> Unit)
* in all DOM-element creating API calls. It's used for adding attributes to the element created, * in all DOM-element creating API calls. It's used for adding attributes to the element created,
@ -23,12 +32,12 @@ interface AttrsScope<TElement : Element>: EventsListenerScope {
val attributesMap: Map<String, String> val attributesMap: Map<String, String>
@ComposeWebInternalApi @ComposeWebInternalApi
val styleScope: StyleScope val styleScope: StyleScope
@ComposeWebInternalApi @ComposeWebInternalApi
val propertyUpdates: List<Pair<(Element, Any) -> Unit, Any>> val propertyUpdates: List<Pair<(Element, Any) -> Unit, Any>>
@ComposeWebInternalApi @ComposeWebInternalApi
var refEffect: (DisposableEffectScope.(TElement) -> DisposableEffectResult)? var refEffect: (DisposableEffectScope.(TElement) -> DisposableEffectResult)?
/** /**
* [style] add inline CSS-style properties to the element via [StyleScope] context * [style] add inline CSS-style properties to the element via [StyleScope] context
* *
@ -42,7 +51,7 @@ interface AttrsScope<TElement : Element>: EventsListenerScope {
fun style(builder: StyleScope.() -> Unit) { fun style(builder: StyleScope.() -> Unit) {
styleScope.apply(builder) styleScope.apply(builder)
} }
/** /**
* [classes] adds all values passed as params to the element's classList. * [classes] adds all values passed as params to the element's classList.
* This method acts cumulatively, that is, each call adds values to the classList. * This method acts cumulatively, that is, each call adds values to the classList.
@ -50,7 +59,7 @@ interface AttrsScope<TElement : Element>: EventsListenerScope {
* since if your classList is, for instance, condition-dependent, you can always just call this method conditionally. * since if your classList is, for instance, condition-dependent, you can always just call this method conditionally.
*/ */
fun classes(vararg classes: String)= prop(setClassList, classes) fun classes(vararg classes: String)= prop(setClassList, classes)
fun id(value: String) = attr(ID, value) fun id(value: String) = attr(ID, value)
fun hidden() = attr(HIDDEN, true.toString()) fun hidden() = attr(HIDDEN, true.toString())
fun title(value: String) = attr(TITLE, value) fun title(value: String) = attr(TITLE, value)
@ -60,17 +69,17 @@ interface AttrsScope<TElement : Element>: EventsListenerScope {
fun lang(value: String) = attr(LANG, value) fun lang(value: String) = attr(LANG, value)
fun tabIndex(value: Int) = attr(TAB_INDEX, value.toString()) fun tabIndex(value: Int) = attr(TAB_INDEX, value.toString())
fun spellCheck(value: Boolean) = attr(SPELLCHECK, value.toString()) fun spellCheck(value: Boolean) = attr(SPELLCHECK, value.toString())
/** /**
* see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode * see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
*/ */
fun inputMode(value: String) = attr("inputmode", value) fun inputMode(value: String) = attr("inputmode", value)
/** /**
* see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode * see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
*/ */
fun inputMode(value: InputMode) = attr("inputmode", value.str) fun inputMode(value: InputMode) = attr("inputmode", value.str)
/** /**
* [ref] can be used to retrieve a reference to a html element. * [ref] can be used to retrieve a reference to a html element.
* The lambda that `ref` takes in is not Composable. It will be called only once when an element added into a composition. * The lambda that `ref` takes in is not Composable. It will be called only once when an element added into a composition.
@ -79,7 +88,7 @@ interface AttrsScope<TElement : Element>: EventsListenerScope {
* Under the hood, `ref` uses [DisposableEffect](https://developer.android.com/jetpack/compose/side-effects#disposableeffect) * Under the hood, `ref` uses [DisposableEffect](https://developer.android.com/jetpack/compose/side-effects#disposableeffect)
*/ */
fun ref(effect: DisposableEffectScope.(TElement) -> DisposableEffectResult) fun ref(effect: DisposableEffectScope.(TElement) -> DisposableEffectResult)
/** /**
* [attr] adds arbitrary attribute to the Element. * [attr] adds arbitrary attribute to the Element.
* If it called twice for the same attribute name, attribute value will be resolved to the last call. * If it called twice for the same attribute name, attribute value will be resolved to the last call.
@ -90,7 +99,7 @@ interface AttrsScope<TElement : Element>: EventsListenerScope {
* For boolean attributes cast boolean value to String and pass it as value. * For boolean attributes cast boolean value to String and pass it as value.
*/ */
fun attr(attr: String, value: String): AttrsScope<TElement> fun attr(attr: String, value: String): AttrsScope<TElement>
/** /**
* [prop] allows setting values of element's properties which can't be set by ussing [attr]. * [prop] allows setting values of element's properties which can't be set by ussing [attr].
* [update] is a lambda with two parameters: `element` and `value`. `element` is a reference to a native element. * [update] is a lambda with two parameters: `element` and `value`. `element` is a reference to a native element.
@ -110,9 +119,10 @@ interface AttrsScope<TElement : Element>: EventsListenerScope {
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
fun <E : HTMLElement, V> prop(update: (E, V) -> Unit, value: V) fun <E : HTMLElement, V> prop(update: (E, V) -> Unit, value: V)
@ComposeWebInternalApi
fun copyFrom(attrsScope: AttrsScope<TElement>) fun copyFrom(attrsScope: AttrsScope<TElement>)
companion object { companion object {
const val CLASS = "class" const val CLASS = "class"
const val ID = "id" const val ID = "id"
@ -130,10 +140,10 @@ interface AttrsScope<TElement : Element>: EventsListenerScope {
open class AttrsScopeBuilder<TElement : Element> : AttrsScope<TElement>, EventsListenerScope by EventsListenerScopeBuilder() { open class AttrsScopeBuilder<TElement : Element> : AttrsScope<TElement>, EventsListenerScope by EventsListenerScopeBuilder() {
override val attributesMap = mutableMapOf<String, String>() override val attributesMap = mutableMapOf<String, String>()
override val styleScope: StyleScope = StyleScopeBuilder() override val styleScope: StyleScope = StyleScopeBuilder()
override val propertyUpdates = mutableListOf<Pair<(Element, Any) -> Unit, Any>>() override val propertyUpdates = mutableListOf<Pair<(Element, Any) -> Unit, Any>>()
override var refEffect: (DisposableEffectScope.(TElement) -> DisposableEffectResult)? = null override var refEffect: (DisposableEffectScope.(TElement) -> DisposableEffectResult)? = null
/** /**
* [ref] can be used to retrieve a reference to a html element. * [ref] can be used to retrieve a reference to a html element.
* The lambda that `ref` takes in is not Composable. It will be called only once when an element added into a composition. * The lambda that `ref` takes in is not Composable. It will be called only once when an element added into a composition.
@ -184,14 +194,15 @@ open class AttrsScopeBuilder<TElement : Element> : AttrsScope<TElement>, EventsL
internal fun collect(): Map<String, String> { internal fun collect(): Map<String, String> {
return attributesMap return attributesMap
} }
@ComposeWebInternalApi
override fun copyFrom(attrsScope: AttrsScope<TElement>) { override fun copyFrom(attrsScope: AttrsScope<TElement>) {
refEffect = attrsScope.refEffect refEffect = attrsScope.refEffect
styleScope.copyFrom(attrsScope.styleScope) styleScope.copyFrom(attrsScope.styleScope)
attributesMap.putAll(attrsScope.attributesMap) attributesMap.putAll(attrsScope.attributesMap)
propertyUpdates.addAll(attrsScope.propertyUpdates) propertyUpdates.addAll(attrsScope.propertyUpdates)
copyListenersFrom(attrsScope) copyListenersFrom(attrsScope)
} }
} }

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

@ -60,12 +60,7 @@ import org.w3c.dom.HTMLVideoElement
import org.w3c.dom.Text import org.w3c.dom.Text
import org.w3c.dom.css.CSSStyleSheet import org.w3c.dom.css.CSSStyleSheet
@Deprecated( typealias AttrBuilderContext<T> = AttrsScope<T>.() -> Unit
message = "Renamed to AttrsBuilder<T>",
replaceWith = ReplaceWith("AttrsBuilder<T>", "org.jetbrains.compose.web.dom.AttrsBuilder")
)
typealias AttrBuilderContext<T> = AttrsBuilder<T>
typealias AttrsBuilder<T> = AttrsScope<T>.() -> Unit
typealias ContentBuilder<T> = @Composable ElementScope<T>.() -> Unit typealias ContentBuilder<T> = @Composable ElementScope<T>.() -> Unit
private open class ElementBuilderImplementation<TElement : Element>(private val tagName: String) : ElementBuilder<TElement> { private open class ElementBuilderImplementation<TElement : Element>(private val tagName: String) : ElementBuilder<TElement> {
@ -168,7 +163,7 @@ fun interface ElementBuilder<TElement : Element> {
@Composable @Composable
fun Address( fun Address(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) { ) {
TagElement( TagElement(
@ -180,7 +175,7 @@ fun Address(
@Composable @Composable
fun Article( fun Article(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) { ) {
TagElement( TagElement(
@ -192,7 +187,7 @@ fun Article(
@Composable @Composable
fun Aside( fun Aside(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) { ) {
TagElement( TagElement(
@ -204,7 +199,7 @@ fun Aside(
@Composable @Composable
fun Header( fun Header(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) { ) {
TagElement( TagElement(
@ -216,7 +211,7 @@ fun Header(
@Composable @Composable
fun Area( fun Area(
attrs: AttrsBuilder<HTMLAreaElement>? = null, attrs: AttrBuilderContext<HTMLAreaElement>? = null,
content: ContentBuilder<HTMLAreaElement>? = null content: ContentBuilder<HTMLAreaElement>? = null
) { ) {
TagElement( TagElement(
@ -228,7 +223,7 @@ fun Area(
@Composable @Composable
fun Audio( fun Audio(
attrs: AttrsBuilder<HTMLAudioElement>? = null, attrs: AttrBuilderContext<HTMLAudioElement>? = null,
content: ContentBuilder<HTMLAudioElement>? = null content: ContentBuilder<HTMLAudioElement>? = null
) { ) {
TagElement( TagElement(
@ -240,7 +235,7 @@ fun Audio(
@Composable @Composable
fun HTMLMap( fun HTMLMap(
attrs: AttrsBuilder<HTMLMapElement>? = null, attrs: AttrBuilderContext<HTMLMapElement>? = null,
content: ContentBuilder<HTMLMapElement>? = null content: ContentBuilder<HTMLMapElement>? = null
) { ) {
TagElement( TagElement(
@ -252,7 +247,7 @@ fun HTMLMap(
@Composable @Composable
fun Track( fun Track(
attrs: AttrsBuilder<HTMLTrackElement>? = null, attrs: AttrBuilderContext<HTMLTrackElement>? = null,
content: ContentBuilder<HTMLTrackElement>? = null content: ContentBuilder<HTMLTrackElement>? = null
) { ) {
TagElement( TagElement(
@ -264,7 +259,7 @@ fun Track(
@Composable @Composable
fun Video( fun Video(
attrs: AttrsBuilder<HTMLVideoElement>? = null, attrs: AttrBuilderContext<HTMLVideoElement>? = null,
content: ContentBuilder<HTMLVideoElement>? = null content: ContentBuilder<HTMLVideoElement>? = null
) { ) {
TagElement( TagElement(
@ -276,7 +271,7 @@ fun Video(
@Composable @Composable
fun Datalist( fun Datalist(
attrs: AttrsBuilder<HTMLDataListElement>? = null, attrs: AttrBuilderContext<HTMLDataListElement>? = null,
content: ContentBuilder<HTMLDataListElement>? = null content: ContentBuilder<HTMLDataListElement>? = null
) { ) {
TagElement( TagElement(
@ -288,7 +283,7 @@ fun Datalist(
@Composable @Composable
fun Fieldset( fun Fieldset(
attrs: AttrsBuilder<HTMLFieldSetElement>? = null, attrs: AttrBuilderContext<HTMLFieldSetElement>? = null,
content: ContentBuilder<HTMLFieldSetElement>? = null content: ContentBuilder<HTMLFieldSetElement>? = null
) { ) {
TagElement( TagElement(
@ -300,7 +295,7 @@ fun Fieldset(
@Composable @Composable
fun Legend( fun Legend(
attrs: AttrsBuilder<HTMLLegendElement>? = null, attrs: AttrBuilderContext<HTMLLegendElement>? = null,
content: ContentBuilder<HTMLLegendElement>? = null content: ContentBuilder<HTMLLegendElement>? = null
) { ) {
TagElement( TagElement(
@ -312,7 +307,7 @@ fun Legend(
@Composable @Composable
fun Meter( fun Meter(
attrs: AttrsBuilder<HTMLMeterElement>? = null, attrs: AttrBuilderContext<HTMLMeterElement>? = null,
content: ContentBuilder<HTMLMeterElement>? = null content: ContentBuilder<HTMLMeterElement>? = null
) { ) {
TagElement( TagElement(
@ -324,7 +319,7 @@ fun Meter(
@Composable @Composable
fun Output( fun Output(
attrs: AttrsBuilder<HTMLOutputElement>? = null, attrs: AttrBuilderContext<HTMLOutputElement>? = null,
content: ContentBuilder<HTMLOutputElement>? = null content: ContentBuilder<HTMLOutputElement>? = null
) { ) {
TagElement( TagElement(
@ -336,7 +331,7 @@ fun Output(
@Composable @Composable
fun Progress( fun Progress(
attrs: AttrsBuilder<HTMLProgressElement>? = null, attrs: AttrBuilderContext<HTMLProgressElement>? = null,
content: ContentBuilder<HTMLProgressElement>? = null content: ContentBuilder<HTMLProgressElement>? = null
) { ) {
TagElement( TagElement(
@ -348,7 +343,7 @@ fun Progress(
@Composable @Composable
fun Embed( fun Embed(
attrs: AttrsBuilder<HTMLEmbedElement>? = null, attrs: AttrBuilderContext<HTMLEmbedElement>? = null,
content: ContentBuilder<HTMLEmbedElement>? = null content: ContentBuilder<HTMLEmbedElement>? = null
) { ) {
TagElement( TagElement(
@ -360,7 +355,7 @@ fun Embed(
@Composable @Composable
fun Iframe( fun Iframe(
attrs: AttrsBuilder<HTMLIFrameElement>? = null, attrs: AttrBuilderContext<HTMLIFrameElement>? = null,
content: ContentBuilder<HTMLIFrameElement>? = null content: ContentBuilder<HTMLIFrameElement>? = null
) { ) {
TagElement( TagElement(
@ -372,7 +367,7 @@ fun Iframe(
@Composable @Composable
fun Object( fun Object(
attrs: AttrsBuilder<HTMLObjectElement>? = null, attrs: AttrBuilderContext<HTMLObjectElement>? = null,
content: ContentBuilder<HTMLObjectElement>? = null content: ContentBuilder<HTMLObjectElement>? = null
) { ) {
TagElement( TagElement(
@ -384,7 +379,7 @@ fun Object(
@Composable @Composable
fun Param( fun Param(
attrs: AttrsBuilder<HTMLParamElement>? = null, attrs: AttrBuilderContext<HTMLParamElement>? = null,
content: ContentBuilder<HTMLParamElement>? = null content: ContentBuilder<HTMLParamElement>? = null
) { ) {
TagElement( TagElement(
@ -396,7 +391,7 @@ fun Param(
@Composable @Composable
fun Picture( fun Picture(
attrs: AttrsBuilder<HTMLPictureElement>? = null, attrs: AttrBuilderContext<HTMLPictureElement>? = null,
content: ContentBuilder<HTMLPictureElement>? = null content: ContentBuilder<HTMLPictureElement>? = null
) { ) {
TagElement( TagElement(
@ -408,7 +403,7 @@ fun Picture(
@Composable @Composable
fun Source( fun Source(
attrs: AttrsBuilder<HTMLSourceElement>? = null, attrs: AttrBuilderContext<HTMLSourceElement>? = null,
content: ContentBuilder<HTMLSourceElement>? = null content: ContentBuilder<HTMLSourceElement>? = null
) { ) {
TagElement( TagElement(
@ -431,7 +426,7 @@ fun Text(value: String) {
@Composable @Composable
fun Div( fun Div(
attrs: AttrsBuilder<HTMLDivElement>? = null, attrs: AttrBuilderContext<HTMLDivElement>? = null,
content: ContentBuilder<HTMLDivElement>? = null content: ContentBuilder<HTMLDivElement>? = null
) { ) {
TagElement( TagElement(
@ -444,7 +439,7 @@ fun Div(
@Composable @Composable
fun A( fun A(
href: String? = null, href: String? = null,
attrs: AttrsBuilder<HTMLAnchorElement>? = null, attrs: AttrBuilderContext<HTMLAnchorElement>? = null,
content: ContentBuilder<HTMLAnchorElement>? = null content: ContentBuilder<HTMLAnchorElement>? = null
) { ) {
TagElement( TagElement(
@ -463,101 +458,101 @@ fun A(
@Composable @Composable
fun Button( fun Button(
attrs: AttrsBuilder<HTMLButtonElement>? = null, attrs: AttrBuilderContext<HTMLButtonElement>? = null,
content: ContentBuilder<HTMLButtonElement>? = null content: ContentBuilder<HTMLButtonElement>? = null
) = TagElement(elementBuilder = Button, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = Button, applyAttrs = attrs, content = content)
@Composable @Composable
fun H1( fun H1(
attrs: AttrsBuilder<HTMLHeadingElement>? = null, attrs: AttrBuilderContext<HTMLHeadingElement>? = null,
content: ContentBuilder<HTMLHeadingElement>? = null content: ContentBuilder<HTMLHeadingElement>? = null
) = TagElement(elementBuilder = H1, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = H1, applyAttrs = attrs, content = content)
@Composable @Composable
fun H2( fun H2(
attrs: AttrsBuilder<HTMLHeadingElement>? = null, attrs: AttrBuilderContext<HTMLHeadingElement>? = null,
content: ContentBuilder<HTMLHeadingElement>? = null content: ContentBuilder<HTMLHeadingElement>? = null
) = TagElement(elementBuilder = H2, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = H2, applyAttrs = attrs, content = content)
@Composable @Composable
fun H3( fun H3(
attrs: AttrsBuilder<HTMLHeadingElement>? = null, attrs: AttrBuilderContext<HTMLHeadingElement>? = null,
content: ContentBuilder<HTMLHeadingElement>? = null content: ContentBuilder<HTMLHeadingElement>? = null
) = TagElement(elementBuilder = H3, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = H3, applyAttrs = attrs, content = content)
@Composable @Composable
fun H4( fun H4(
attrs: AttrsBuilder<HTMLHeadingElement>? = null, attrs: AttrBuilderContext<HTMLHeadingElement>? = null,
content: ContentBuilder<HTMLHeadingElement>? = null content: ContentBuilder<HTMLHeadingElement>? = null
) = TagElement(elementBuilder = H4, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = H4, applyAttrs = attrs, content = content)
@Composable @Composable
fun H5( fun H5(
attrs: AttrsBuilder<HTMLHeadingElement>? = null, attrs: AttrBuilderContext<HTMLHeadingElement>? = null,
content: ContentBuilder<HTMLHeadingElement>? = null content: ContentBuilder<HTMLHeadingElement>? = null
) = TagElement(elementBuilder = H5, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = H5, applyAttrs = attrs, content = content)
@Composable @Composable
fun H6( fun H6(
attrs: AttrsBuilder<HTMLHeadingElement>? = null, attrs: AttrBuilderContext<HTMLHeadingElement>? = null,
content: ContentBuilder<HTMLHeadingElement>? = null content: ContentBuilder<HTMLHeadingElement>? = null
) = TagElement(elementBuilder = H6, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = H6, applyAttrs = attrs, content = content)
@Composable @Composable
fun P( fun P(
attrs: AttrsBuilder<HTMLParagraphElement>? = null, attrs: AttrBuilderContext<HTMLParagraphElement>? = null,
content: ContentBuilder<HTMLParagraphElement>? = null content: ContentBuilder<HTMLParagraphElement>? = null
) = TagElement(elementBuilder = P, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = P, applyAttrs = attrs, content = content)
@Composable @Composable
fun Em( fun Em(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) = TagElement(elementBuilder = Em, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = Em, applyAttrs = attrs, content = content)
@Composable @Composable
fun I( fun I(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) = TagElement(elementBuilder = I, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = I, applyAttrs = attrs, content = content)
@Composable @Composable
fun B( fun B(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) = TagElement(elementBuilder = B, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = B, applyAttrs = attrs, content = content)
@Composable @Composable
fun Small( fun Small(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) = TagElement(elementBuilder = Small, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = Small, applyAttrs = attrs, content = content)
@Composable @Composable
fun Span( fun Span(
attrs: AttrsBuilder<HTMLSpanElement>? = null, attrs: AttrBuilderContext<HTMLSpanElement>? = null,
content: ContentBuilder<HTMLSpanElement>? = null content: ContentBuilder<HTMLSpanElement>? = null
) = TagElement(elementBuilder = Span, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = Span, applyAttrs = attrs, content = content)
@Composable @Composable
fun Br(attrs: AttrsBuilder<HTMLBRElement>? = null) = fun Br(attrs: AttrBuilderContext<HTMLBRElement>? = null) =
TagElement(elementBuilder = Br, applyAttrs = attrs, content = null) TagElement(elementBuilder = Br, applyAttrs = attrs, content = null)
@Composable @Composable
fun Ul( fun Ul(
attrs: AttrsBuilder<HTMLUListElement>? = null, attrs: AttrBuilderContext<HTMLUListElement>? = null,
content: ContentBuilder<HTMLUListElement>? = null content: ContentBuilder<HTMLUListElement>? = null
) = TagElement(elementBuilder = Ul, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = Ul, applyAttrs = attrs, content = content)
@Composable @Composable
fun Ol( fun Ol(
attrs: AttrsBuilder<HTMLOListElement>? = null, attrs: AttrBuilderContext<HTMLOListElement>? = null,
content: ContentBuilder<HTMLOListElement>? = null content: ContentBuilder<HTMLOListElement>? = null
) = TagElement(elementBuilder = Ol, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = Ol, applyAttrs = attrs, content = content)
@Composable @Composable
fun Li( fun Li(
attrs: AttrsBuilder<HTMLLIElement>? = null, attrs: AttrBuilderContext<HTMLLIElement>? = null,
content: ContentBuilder<HTMLLIElement>? = null content: ContentBuilder<HTMLLIElement>? = null
) = TagElement(elementBuilder = Li, applyAttrs = attrs, content = content) ) = TagElement(elementBuilder = Li, applyAttrs = attrs, content = content)
@ -565,7 +560,7 @@ fun Li(
fun Img( fun Img(
src: String, src: String,
alt: String = "", alt: String = "",
attrs: AttrsBuilder<HTMLImageElement>? = null attrs: AttrBuilderContext<HTMLImageElement>? = null
) = TagElement( ) = TagElement(
elementBuilder = Img, elementBuilder = Img,
applyAttrs = { applyAttrs = {
@ -580,7 +575,7 @@ fun Img(
@Composable @Composable
fun Form( fun Form(
action: String? = null, action: String? = null,
attrs: AttrsBuilder<HTMLFormElement>? = null, attrs: AttrBuilderContext<HTMLFormElement>? = null,
content: ContentBuilder<HTMLFormElement>? = null content: ContentBuilder<HTMLFormElement>? = null
) = TagElement( ) = TagElement(
elementBuilder = Form, elementBuilder = Form,
@ -616,7 +611,7 @@ fun Select(
@Composable @Composable
fun Option( fun Option(
value: String, value: String,
attrs: AttrsBuilder<HTMLOptionElement>? = null, attrs: AttrBuilderContext<HTMLOptionElement>? = null,
content: ContentBuilder<HTMLOptionElement>? = null content: ContentBuilder<HTMLOptionElement>? = null
) = TagElement( ) = TagElement(
elementBuilder = Option, elementBuilder = Option,
@ -632,7 +627,7 @@ fun Option(
@Composable @Composable
fun OptGroup( fun OptGroup(
label: String, label: String,
attrs: AttrsBuilder<HTMLOptGroupElement>? = null, attrs: AttrBuilderContext<HTMLOptGroupElement>? = null,
content: ContentBuilder<HTMLOptGroupElement>? = null content: ContentBuilder<HTMLOptGroupElement>? = null
) = TagElement( ) = TagElement(
elementBuilder = OptGroup, elementBuilder = OptGroup,
@ -647,7 +642,7 @@ fun OptGroup(
@Composable @Composable
fun Section( fun Section(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) = TagElement( ) = TagElement(
elementBuilder = Section, elementBuilder = Section,
@ -713,7 +708,7 @@ private val textAreaRestoreControlledStateEffect: DomEffectScope.(HTMLTextAreaEl
@Composable @Composable
fun Nav( fun Nav(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) = TagElement( ) = TagElement(
elementBuilder = Nav, elementBuilder = Nav,
@ -723,7 +718,7 @@ fun Nav(
@Composable @Composable
fun Pre( fun Pre(
attrs: AttrsBuilder<HTMLPreElement>? = null, attrs: AttrBuilderContext<HTMLPreElement>? = null,
content: ContentBuilder<HTMLPreElement>? = null content: ContentBuilder<HTMLPreElement>? = null
) { ) {
TagElement( TagElement(
@ -735,7 +730,7 @@ fun Pre(
@Composable @Composable
fun Code( fun Code(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) { ) {
TagElement( TagElement(
@ -747,7 +742,7 @@ fun Code(
@Composable @Composable
fun Main( fun Main(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) { ) {
TagElement( TagElement(
@ -759,7 +754,7 @@ fun Main(
@Composable @Composable
fun Footer( fun Footer(
attrs: AttrsBuilder<HTMLElement>? = null, attrs: AttrBuilderContext<HTMLElement>? = null,
content: ContentBuilder<HTMLElement>? = null content: ContentBuilder<HTMLElement>? = null
) { ) {
TagElement( TagElement(
@ -771,7 +766,7 @@ fun Footer(
@Composable @Composable
fun Hr( fun Hr(
attrs: AttrsBuilder<HTMLHRElement>? = null attrs: AttrBuilderContext<HTMLHRElement>? = null
) { ) {
TagElement( TagElement(
elementBuilder = Hr, elementBuilder = Hr,
@ -783,7 +778,7 @@ fun Hr(
@Composable @Composable
fun Label( fun Label(
forId: String? = null, forId: String? = null,
attrs: AttrsBuilder<HTMLLabelElement>? = null, attrs: AttrBuilderContext<HTMLLabelElement>? = null,
content: ContentBuilder<HTMLLabelElement>? = null content: ContentBuilder<HTMLLabelElement>? = null
) { ) {
TagElement( TagElement(
@ -802,7 +797,7 @@ fun Label(
@Composable @Composable
fun Table( fun Table(
attrs: AttrsBuilder<HTMLTableElement>? = null, attrs: AttrBuilderContext<HTMLTableElement>? = null,
content: ContentBuilder<HTMLTableElement>? = null content: ContentBuilder<HTMLTableElement>? = null
) { ) {
TagElement( TagElement(
@ -814,7 +809,7 @@ fun Table(
@Composable @Composable
fun Caption( fun Caption(
attrs: AttrsBuilder<HTMLTableCaptionElement>? = null, attrs: AttrBuilderContext<HTMLTableCaptionElement>? = null,
content: ContentBuilder<HTMLTableCaptionElement>? = null content: ContentBuilder<HTMLTableCaptionElement>? = null
) { ) {
TagElement( TagElement(
@ -826,7 +821,7 @@ fun Caption(
@Composable @Composable
fun Col( fun Col(
attrs: AttrsBuilder<HTMLTableColElement>? = null attrs: AttrBuilderContext<HTMLTableColElement>? = null
) { ) {
TagElement( TagElement(
elementBuilder = Col, elementBuilder = Col,
@ -837,7 +832,7 @@ fun Col(
@Composable @Composable
fun Colgroup( fun Colgroup(
attrs: AttrsBuilder<HTMLTableColElement>? = null, attrs: AttrBuilderContext<HTMLTableColElement>? = null,
content: ContentBuilder<HTMLTableColElement>? = null content: ContentBuilder<HTMLTableColElement>? = null
) { ) {
TagElement( TagElement(
@ -849,7 +844,7 @@ fun Colgroup(
@Composable @Composable
fun Tr( fun Tr(
attrs: AttrsBuilder<HTMLTableRowElement>? = null, attrs: AttrBuilderContext<HTMLTableRowElement>? = null,
content: ContentBuilder<HTMLTableRowElement>? = null content: ContentBuilder<HTMLTableRowElement>? = null
) { ) {
TagElement( TagElement(
@ -861,7 +856,7 @@ fun Tr(
@Composable @Composable
fun Thead( fun Thead(
attrs: AttrsBuilder<HTMLTableSectionElement>? = null, attrs: AttrBuilderContext<HTMLTableSectionElement>? = null,
content: ContentBuilder<HTMLTableSectionElement>? = null content: ContentBuilder<HTMLTableSectionElement>? = null
) { ) {
TagElement( TagElement(
@ -873,7 +868,7 @@ fun Thead(
@Composable @Composable
fun Th( fun Th(
attrs: AttrsBuilder<HTMLTableCellElement>? = null, attrs: AttrBuilderContext<HTMLTableCellElement>? = null,
content: ContentBuilder<HTMLTableCellElement>? = null content: ContentBuilder<HTMLTableCellElement>? = null
) { ) {
TagElement( TagElement(
@ -885,7 +880,7 @@ fun Th(
@Composable @Composable
fun Td( fun Td(
attrs: AttrsBuilder<HTMLTableCellElement>? = null, attrs: AttrBuilderContext<HTMLTableCellElement>? = null,
content: ContentBuilder<HTMLTableCellElement>? = null content: ContentBuilder<HTMLTableCellElement>? = null
) { ) {
TagElement( TagElement(
@ -897,7 +892,7 @@ fun Td(
@Composable @Composable
fun Tbody( fun Tbody(
attrs: AttrsBuilder<HTMLTableSectionElement>? = null, attrs: AttrBuilderContext<HTMLTableSectionElement>? = null,
content: ContentBuilder<HTMLTableSectionElement>? = null content: ContentBuilder<HTMLTableSectionElement>? = null
) { ) {
TagElement( TagElement(
@ -909,7 +904,7 @@ fun Tbody(
@Composable @Composable
fun Tfoot( fun Tfoot(
attrs: AttrsBuilder<HTMLTableSectionElement>? = null, attrs: AttrBuilderContext<HTMLTableSectionElement>? = null,
content: ContentBuilder<HTMLTableSectionElement>? = null content: ContentBuilder<HTMLTableSectionElement>? = null
) { ) {
TagElement( TagElement(

78
web/svg/src/jsMain/kotlin/org/jetbrains/compose/web/svg/svg.kt

@ -62,7 +62,7 @@ private val View = ElementBuilderNS<SVGViewElement>("view", SVG_NS)
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun Svg( fun Svg(
viewBox: String? = null, viewBox: String? = null,
attrs: AttrsBuilder<SVGElement>? = null, attrs: AttrBuilderContext<SVGElement>? = null,
content: ContentBuilder<SVGElement>? = null content: ContentBuilder<SVGElement>? = null
) { ) {
TagElement( TagElement(
@ -79,7 +79,7 @@ fun Svg(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.SvgA( fun ElementScope<SVGElement>.SvgA(
href: String, href: String,
attrs: AttrsBuilder<SVGAElement>? = null, attrs: AttrBuilderContext<SVGAElement>? = null,
content: ContentBuilder<SVGAElement>? = null content: ContentBuilder<SVGAElement>? = null
) { ) {
TagElement( TagElement(
@ -98,7 +98,7 @@ fun ElementScope<SVGElement>.Circle(
cx: CSSLengthOrPercentageValue, cx: CSSLengthOrPercentageValue,
cy: CSSLengthOrPercentageValue, cy: CSSLengthOrPercentageValue,
r: CSSLengthOrPercentageValue, r: CSSLengthOrPercentageValue,
attrs: AttrsBuilder<SVGCircleElement>? = null, attrs: AttrBuilderContext<SVGCircleElement>? = null,
content: ContentBuilder<SVGCircleElement>? = null content: ContentBuilder<SVGCircleElement>? = null
) { ) {
TagElement( TagElement(
@ -120,7 +120,7 @@ fun ElementScope<SVGElement>.Circle(
cx: Number, cx: Number,
cy: Number, cy: Number,
r: Number, r: Number,
attrs: AttrsBuilder<SVGCircleElement>? = null, attrs: AttrBuilderContext<SVGCircleElement>? = null,
content: ContentBuilder<SVGCircleElement>? = null content: ContentBuilder<SVGCircleElement>? = null
) { ) {
TagElement( TagElement(
@ -142,7 +142,7 @@ fun ElementScope<SVGElement>.SvgText(
text: String, text: String,
x: Number = 0, x: Number = 0,
y: Number = 0, y: Number = 0,
attrs: AttrsBuilder<SVGTextElement>? = null, attrs: AttrBuilderContext<SVGTextElement>? = null,
) { ) {
TagElement( TagElement(
elementBuilder = Text, elementBuilder = Text,
@ -162,7 +162,7 @@ fun ElementScope<SVGElement>.SvgText(
fun ElementScope<SVGElement>.View( fun ElementScope<SVGElement>.View(
id: String, id: String,
viewBox: String, viewBox: String,
attrs: AttrsBuilder<SVGViewElement>? = null, attrs: AttrBuilderContext<SVGViewElement>? = null,
) { ) {
TagElement( TagElement(
elementBuilder = View, elementBuilder = View,
@ -182,7 +182,7 @@ fun ElementScope<SVGElement>.Rect(
y: Number, y: Number,
width: Number, width: Number,
height: Number, height: Number,
attrs: AttrsBuilder<SVGRectElement>? = null, attrs: AttrBuilderContext<SVGRectElement>? = null,
content: ContentBuilder<SVGRectElement>? = null content: ContentBuilder<SVGRectElement>? = null
) { ) {
TagElement( TagElement(
@ -205,7 +205,7 @@ fun ElementScope<SVGElement>.Rect(
y: CSSLengthOrPercentageValue, y: CSSLengthOrPercentageValue,
width: CSSLengthOrPercentageValue, width: CSSLengthOrPercentageValue,
height: CSSLengthOrPercentageValue, height: CSSLengthOrPercentageValue,
attrs: AttrsBuilder<SVGRectElement>? = null, attrs: AttrBuilderContext<SVGRectElement>? = null,
content: ContentBuilder<SVGRectElement>? = null content: ContentBuilder<SVGRectElement>? = null
) { ) {
TagElement( TagElement(
@ -228,7 +228,7 @@ fun ElementScope<SVGElement>.Ellipse(
cy: CSSLengthOrPercentageValue, cy: CSSLengthOrPercentageValue,
rx: CSSLengthOrPercentageValue, rx: CSSLengthOrPercentageValue,
ry: CSSLengthOrPercentageValue, ry: CSSLengthOrPercentageValue,
attrs: AttrsBuilder<SVGEllipseElement>? = null, attrs: AttrBuilderContext<SVGEllipseElement>? = null,
content: ContentBuilder<SVGEllipseElement>? = null content: ContentBuilder<SVGEllipseElement>? = null
) { ) {
TagElement( TagElement(
@ -251,7 +251,7 @@ fun ElementScope<SVGElement>.Ellipse(
cy: Number, cy: Number,
rx: Number, rx: Number,
ry: Number, ry: Number,
attrs: AttrsBuilder<SVGEllipseElement>? = null, attrs: AttrBuilderContext<SVGEllipseElement>? = null,
content: ContentBuilder<SVGEllipseElement>? = null content: ContentBuilder<SVGEllipseElement>? = null
) { ) {
TagElement( TagElement(
@ -272,7 +272,7 @@ fun ElementScope<SVGElement>.Ellipse(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Symbol( fun ElementScope<SVGElement>.Symbol(
id: String? = null, id: String? = null,
attrs: AttrsBuilder<SVGSymbolElement>? = null, attrs: AttrBuilderContext<SVGSymbolElement>? = null,
content: ContentBuilder<SVGSymbolElement>? = null content: ContentBuilder<SVGSymbolElement>? = null
) { ) {
TagElement( TagElement(
@ -289,7 +289,7 @@ fun ElementScope<SVGElement>.Symbol(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Use( fun ElementScope<SVGElement>.Use(
href: String, href: String,
attrs: AttrsBuilder<SVGUseElement>? = null, attrs: AttrBuilderContext<SVGUseElement>? = null,
content: ContentBuilder<SVGUseElement>? = null content: ContentBuilder<SVGUseElement>? = null
) { ) {
TagElement( TagElement(
@ -309,7 +309,7 @@ fun ElementScope<SVGElement>.Line(
y1: CSSLengthOrPercentageValue, y1: CSSLengthOrPercentageValue,
x2: CSSLengthOrPercentageValue, x2: CSSLengthOrPercentageValue,
y2: CSSLengthOrPercentageValue, y2: CSSLengthOrPercentageValue,
attrs: AttrsBuilder<SVGLineElement>? = null, attrs: AttrBuilderContext<SVGLineElement>? = null,
content: ContentBuilder<SVGLineElement>? = null content: ContentBuilder<SVGLineElement>? = null
) { ) {
TagElement( TagElement(
@ -332,7 +332,7 @@ fun ElementScope<SVGElement>.Line(
y1: Number, y1: Number,
x2: Number, x2: Number,
y2: Number, y2: Number,
attrs: AttrsBuilder<SVGLineElement>? = null, attrs: AttrBuilderContext<SVGLineElement>? = null,
content: ContentBuilder<SVGLineElement>? = null content: ContentBuilder<SVGLineElement>? = null
) { ) {
TagElement( TagElement(
@ -353,7 +353,7 @@ fun ElementScope<SVGElement>.Line(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.ClipPath( fun ElementScope<SVGElement>.ClipPath(
id: String, id: String,
attrs: AttrsBuilder<SVGClipPathElement>? = null, attrs: AttrBuilderContext<SVGClipPathElement>? = null,
content: ContentBuilder<SVGClipPathElement>? = null content: ContentBuilder<SVGClipPathElement>? = null
) { ) {
TagElement( TagElement(
@ -370,7 +370,7 @@ fun ElementScope<SVGElement>.ClipPath(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Path( fun ElementScope<SVGElement>.Path(
d: String, d: String,
attrs: AttrsBuilder<SVGPathElement>? = null, attrs: AttrBuilderContext<SVGPathElement>? = null,
content: ContentBuilder<SVGPathElement>? = null content: ContentBuilder<SVGPathElement>? = null
) { ) {
TagElement( TagElement(
@ -386,7 +386,7 @@ fun ElementScope<SVGElement>.Path(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.G( fun ElementScope<SVGElement>.G(
attrs: AttrsBuilder<SVGElement>? = null, attrs: AttrBuilderContext<SVGElement>? = null,
content: ContentBuilder<SVGElement>? = null content: ContentBuilder<SVGElement>? = null
) { ) {
TagElement( TagElement(
@ -400,7 +400,7 @@ fun ElementScope<SVGElement>.G(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Image( fun ElementScope<SVGElement>.Image(
href: String, href: String,
attrs: AttrsBuilder<SVGImageElement>? = null, attrs: AttrBuilderContext<SVGImageElement>? = null,
content: ContentBuilder<SVGImageElement>? = null content: ContentBuilder<SVGImageElement>? = null
) { ) {
TagElement( TagElement(
@ -417,7 +417,7 @@ fun ElementScope<SVGElement>.Image(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Mask( fun ElementScope<SVGElement>.Mask(
id: String? = null, id: String? = null,
attrs: AttrsBuilder<SVGMaskElement>? = null, attrs: AttrBuilderContext<SVGMaskElement>? = null,
content: ContentBuilder<SVGMaskElement>? = null content: ContentBuilder<SVGMaskElement>? = null
) { ) {
TagElement( TagElement(
@ -433,7 +433,7 @@ fun ElementScope<SVGElement>.Mask(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Defs( fun ElementScope<SVGElement>.Defs(
attrs: AttrsBuilder<SVGDefsElement>? = null, attrs: AttrBuilderContext<SVGDefsElement>? = null,
content: ContentBuilder<SVGDefsElement>? = null content: ContentBuilder<SVGDefsElement>? = null
) { ) {
TagElement( TagElement(
@ -447,7 +447,7 @@ fun ElementScope<SVGElement>.Defs(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Pattern( fun ElementScope<SVGElement>.Pattern(
id: String, id: String,
attrs: AttrsBuilder<SVGPatternElement>? = null, attrs: AttrBuilderContext<SVGPatternElement>? = null,
content: ContentBuilder<SVGPatternElement>? = null content: ContentBuilder<SVGPatternElement>? = null
) { ) {
TagElement( TagElement(
@ -464,7 +464,7 @@ fun ElementScope<SVGElement>.Pattern(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Polygon( fun ElementScope<SVGElement>.Polygon(
vararg points: Number, vararg points: Number,
attrs: AttrsBuilder<SVGPolygonElement>? = null, attrs: AttrBuilderContext<SVGPolygonElement>? = null,
content: ContentBuilder<SVGPolygonElement>? = null content: ContentBuilder<SVGPolygonElement>? = null
) { ) {
TagElement( TagElement(
@ -481,7 +481,7 @@ fun ElementScope<SVGElement>.Polygon(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Polyline( fun ElementScope<SVGElement>.Polyline(
vararg points: Number, vararg points: Number,
attrs: AttrsBuilder<SVGPolylineElement>? = null, attrs: AttrBuilderContext<SVGPolylineElement>? = null,
content: ContentBuilder<SVGPolylineElement>? = null content: ContentBuilder<SVGPolylineElement>? = null
) { ) {
TagElement( TagElement(
@ -499,7 +499,7 @@ fun ElementScope<SVGElement>.Polyline(
fun ElementScope<SVGElement>.TextPath( fun ElementScope<SVGElement>.TextPath(
href: String, href: String,
text: String, text: String,
attrs: AttrsBuilder<SVGTextPathElement>? = null, attrs: AttrBuilderContext<SVGTextPathElement>? = null,
) { ) {
TagElement( TagElement(
elementBuilder = TextPath, elementBuilder = TextPath,
@ -516,7 +516,7 @@ fun ElementScope<SVGElement>.TextPath(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Animate( fun ElementScope<SVGElement>.Animate(
attrs: AttrsBuilder<SVGElement>? = null, attrs: AttrBuilderContext<SVGElement>? = null,
content: ContentBuilder<SVGElement>? = null content: ContentBuilder<SVGElement>? = null
) { ) {
TagElement( TagElement(
@ -529,7 +529,7 @@ fun ElementScope<SVGElement>.Animate(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.AnimateMotion( fun ElementScope<SVGElement>.AnimateMotion(
attrs: AttrsBuilder<SVGElement>? = null, attrs: AttrBuilderContext<SVGElement>? = null,
content: ContentBuilder<SVGElement>? = null content: ContentBuilder<SVGElement>? = null
) { ) {
TagElement( TagElement(
@ -542,7 +542,7 @@ fun ElementScope<SVGElement>.AnimateMotion(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.AnimateTransform( fun ElementScope<SVGElement>.AnimateTransform(
attrs: AttrsBuilder<SVGElement>? = null, attrs: AttrBuilderContext<SVGElement>? = null,
content: ContentBuilder<SVGElement>? = null content: ContentBuilder<SVGElement>? = null
) { ) {
TagElement( TagElement(
@ -556,7 +556,7 @@ fun ElementScope<SVGElement>.AnimateTransform(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.LinearGradient( fun ElementScope<SVGElement>.LinearGradient(
id: String? = null, id: String? = null,
attrs: AttrsBuilder<SVGLinearGradientElement>? = null, attrs: AttrBuilderContext<SVGLinearGradientElement>? = null,
content: ContentBuilder<SVGLinearGradientElement>? = null content: ContentBuilder<SVGLinearGradientElement>? = null
) { ) {
TagElement( TagElement(
@ -574,7 +574,7 @@ fun ElementScope<SVGElement>.LinearGradient(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.RadialGradient( fun ElementScope<SVGElement>.RadialGradient(
id: String? = null, id: String? = null,
attrs: AttrsBuilder<SVGRadialGradientElement>? = null, attrs: AttrBuilderContext<SVGRadialGradientElement>? = null,
content: ContentBuilder<SVGRadialGradientElement>? = null content: ContentBuilder<SVGRadialGradientElement>? = null
) { ) {
TagElement( TagElement(
@ -590,7 +590,7 @@ fun ElementScope<SVGElement>.RadialGradient(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Stop( fun ElementScope<SVGElement>.Stop(
attrs: AttrsBuilder<SVGStopElement>? = null, attrs: AttrBuilderContext<SVGStopElement>? = null,
content: ContentBuilder<SVGStopElement>? = null content: ContentBuilder<SVGStopElement>? = null
) { ) {
TagElement( TagElement(
@ -603,7 +603,7 @@ fun ElementScope<SVGElement>.Stop(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Switch( fun ElementScope<SVGElement>.Switch(
attrs: AttrsBuilder<SVGSwitchElement>? = null, attrs: AttrBuilderContext<SVGSwitchElement>? = null,
content: ContentBuilder<SVGSwitchElement>? = null content: ContentBuilder<SVGSwitchElement>? = null
) { ) {
TagElement( TagElement(
@ -617,7 +617,7 @@ fun ElementScope<SVGElement>.Switch(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Title( fun ElementScope<SVGElement>.Title(
text: String, text: String,
attrs: AttrsBuilder<SVGTitleElement>? = null, attrs: AttrBuilderContext<SVGTitleElement>? = null,
) { ) {
TagElement( TagElement(
elementBuilder = Title, elementBuilder = Title,
@ -631,7 +631,7 @@ fun ElementScope<SVGElement>.Title(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Tspan( fun ElementScope<SVGElement>.Tspan(
attrs: AttrsBuilder<SVGTSpanElement>? = null, attrs: AttrBuilderContext<SVGTSpanElement>? = null,
content: ContentBuilder<SVGTSpanElement>? = null content: ContentBuilder<SVGTSpanElement>? = null
) { ) {
TagElement( TagElement(
@ -645,7 +645,7 @@ fun ElementScope<SVGElement>.Tspan(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Desc( fun ElementScope<SVGElement>.Desc(
content: String, content: String,
attrs: AttrsBuilder<SVGDescElement>? = null, attrs: AttrBuilderContext<SVGDescElement>? = null,
) { ) {
TagElement( TagElement(
elementBuilder = Desc, elementBuilder = Desc,
@ -659,7 +659,7 @@ fun ElementScope<SVGElement>.Desc(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Marker( fun ElementScope<SVGElement>.Marker(
attrs: AttrsBuilder<SVGMarkerElement>? = null, attrs: AttrBuilderContext<SVGMarkerElement>? = null,
content: ContentBuilder<SVGMarkerElement>? = null content: ContentBuilder<SVGMarkerElement>? = null
) { ) {
TagElement( TagElement(
@ -672,7 +672,7 @@ fun ElementScope<SVGElement>.Marker(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Mpath( fun ElementScope<SVGElement>.Mpath(
attrs: AttrsBuilder<SVGElement>? = null, attrs: AttrBuilderContext<SVGElement>? = null,
content: ContentBuilder<SVGElement>? = null content: ContentBuilder<SVGElement>? = null
) { ) {
TagElement( TagElement(
@ -685,7 +685,7 @@ fun ElementScope<SVGElement>.Mpath(
@Composable @Composable
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun ElementScope<SVGElement>.Filter( fun ElementScope<SVGElement>.Filter(
attrs: AttrsBuilder<SVGElement>? = null, attrs: AttrBuilderContext<SVGElement>? = null,
content: ContentBuilder<SVGElement>? = null content: ContentBuilder<SVGElement>? = null
) { ) {
TagElement( TagElement(
@ -700,7 +700,7 @@ fun ElementScope<SVGElement>.Filter(
fun ElementScope<SVGElement>.Set( fun ElementScope<SVGElement>.Set(
attributeName: String, attributeName: String,
to: String, to: String,
attrs: AttrsBuilder<SVGElement>? = null, attrs: AttrBuilderContext<SVGElement>? = null,
content: ContentBuilder<SVGElement>? = null content: ContentBuilder<SVGElement>? = null
) { ) {
TagElement( TagElement(
@ -718,7 +718,7 @@ fun ElementScope<SVGElement>.Set(
@ExperimentalComposeWebSvgApi @ExperimentalComposeWebSvgApi
fun <T : SVGElement> SvgElement( fun <T : SVGElement> SvgElement(
name: String, name: String,
attrs: AttrsBuilder<T>? = null, attrs: AttrBuilderContext<T>? = null,
content: ContentBuilder<T>? = null content: ContentBuilder<T>? = null
) { ) {
TagElement( TagElement(

Loading…
Cancel
Save