Browse Source

Prepare examples for the publicaiton of 0.0.0-web-dev-14

pull/735/merge
Shagen Ogandzhanian 4 years ago
parent
commit
2132dac284
  1. 6
      examples/web-getting-started/src/jsMain/kotlin/Main.kt
  2. 22
      examples/web-with-react/src/jsMain/kotlin/ReactInComposeApp.kt
  3. 22
      examples/web_landing/src/jsMain/kotlin/com/sample/components/Card.kt
  4. 22
      examples/web_landing/src/jsMain/kotlin/com/sample/components/Layout.kt
  5. 6
      examples/web_landing/src/jsMain/kotlin/com/sample/content/AboutComposeWebLibsSection.kt
  6. 45
      examples/web_landing/src/jsMain/kotlin/com/sample/content/CodeSnippets.kt
  7. 51
      examples/web_landing/src/jsMain/kotlin/com/sample/content/Footer.kt
  8. 5
      examples/web_landing/src/jsMain/kotlin/com/sample/content/GetStartedSection.kt
  9. 13
      examples/web_landing/src/jsMain/kotlin/com/sample/content/Header.kt
  10. 114
      examples/web_landing/src/jsMain/kotlin/com/sample/content/IntroSection.kt
  11. 2
      web/gradle.properties
  12. 1
      web/settings.gradle.kts

6
examples/web-getting-started/src/jsMain/kotlin/Main.kt

@ -13,18 +13,18 @@ fun main() {
var count: Int by mutableStateOf(0) var count: Int by mutableStateOf(0)
renderComposable(rootElementId = "root") { renderComposable(rootElementId = "root") {
Div(style = { padding(25.px) }) { Div({ style { padding(25.px) } }) {
Button(attrs = { Button(attrs = {
onClick { count -= 1 } onClick { count -= 1 }
}) { }) {
Text("-") Text("-")
} }
Span(style = { padding(15.px) }) { Span({style { padding(15.px) }}) {
Text("$count") Text("$count")
} }
Button(attrs = { Button({
onClick { count += 1 } onClick { count += 1 }
}) { }) {
Text("+") Text("+")

22
examples/web-with-react/src/jsMain/kotlin/ReactInComposeApp.kt

@ -39,11 +39,11 @@ private fun ElementScope<HTMLElement>.UseReactEffect(
@Composable @Composable
fun YoutubeReactPlayerWrapper(videoUrl: String) { fun YoutubeReactPlayerWrapper(videoUrl: String) {
if (videoUrl.isEmpty()) return if (videoUrl.isEmpty()) return
Div( Div({
style = { style {
width(50.percent) width(50.percent)
} }
) { }) {
UseReactEffect(key = videoUrl) { UseReactEffect(key = videoUrl) {
reactPlayer { reactPlayer {
attrs.url = videoUrl attrs.url = videoUrl
@ -70,20 +70,22 @@ fun reactInComposeAppExample() {
Button( Button(
attrs = { attrs = {
onClick { videoUrl = url } onClick { videoUrl = url }
}, style {
style = { margin(10.px)
margin(10.px) }
} }
) { Text("Video ${ix + 1}") } ) { Text("Video ${ix + 1}") }
} }
Button( Button(
attrs = { attrs = {
onClick { videoUrl = "" } onClick {
videoUrl = ""
style {
margin(10.px)
}
}
}, },
style = {
margin(10.px)
}
) { Text("Reset") } ) { Text("Reset") }
YoutubeReactPlayerWrapper(videoUrl) YoutubeReactPlayerWrapper(videoUrl)

22
examples/web_landing/src/jsMain/kotlin/com/sample/components/Card.kt

@ -12,10 +12,10 @@ data class LinkOnCard(val linkText: String, val linkUrl: String)
@Composable @Composable
private fun CardTitle(title: String, darkTheme: Boolean = false) { private fun CardTitle(title: String, darkTheme: Boolean = false) {
H3(attrs = { H3({
classes { classes(WtTexts.wtH3)
+WtTexts.wtH3 if (darkTheme) {
if (darkTheme) +WtTexts.wtH3ThemeDark classes(WtTexts.wtH3ThemeDark)
} }
}) { }) {
Text(title) Text(title)
@ -43,19 +43,15 @@ fun Card(
wtExtraStyleClasses: List<String> = listOf(WtCols.wtCol6, WtCols.wtColMd6, WtCols.wtColSm12), wtExtraStyleClasses: List<String> = listOf(WtCols.wtCol6, WtCols.wtColMd6, WtCols.wtColSm12),
content: @Composable () -> Unit content: @Composable () -> Unit
) { ) {
Div(attrs = { Div({
classes { classes(WtCards.wtCard, WtOffsets.wtTopOffset24, *wtExtraStyleClasses.toTypedArray())
+WtCards.wtCard classes(if (darkTheme) WtCards.wtCardThemeDark else WtCards.wtCardThemeLight)
+WtOffsets.wtTopOffset24
wtExtraStyleClasses.forEach { +it }
+if (darkTheme) WtCards.wtCardThemeDark else WtCards.wtCardThemeLight
}
}) { }) {
Div(attrs = { Div({
classes(WtCards.wtCardSection, WtCards.wtVerticalFlex) classes(WtCards.wtCardSection, WtCards.wtVerticalFlex)
}) { }) {
Div(attrs = { classes(WtCards.wtVerticalFlexGrow) }) { Div({ classes(WtCards.wtVerticalFlexGrow) }) {
CardTitle(title = title, darkTheme = darkTheme) CardTitle(title = title, darkTheme = darkTheme)
content() content()
} }

22
examples/web_landing/src/jsMain/kotlin/com/sample/components/Layout.kt

@ -11,45 +11,43 @@ import com.sample.style.WtSections
@Composable @Composable
fun Layout(content: @Composable () -> Unit) { fun Layout(content: @Composable () -> Unit) {
Div( Div({
style = { style {
display(DisplayStyle.Flex) display(DisplayStyle.Flex)
flexDirection(FlexDirection.Column) flexDirection(FlexDirection.Column)
height(100.percent) height(100.percent)
margin(0.px) margin(0.px)
property("box-sizing", StylePropertyValue("border-box")) property("box-sizing", StylePropertyValue("border-box"))
} }
) { }) {
content() content()
} }
} }
@Composable @Composable
fun MainContentLayout(content: @Composable () -> Unit) { fun MainContentLayout(content: @Composable () -> Unit) {
Main( Main({
style = { style {
property("flex", value("1 0 auto")) property("flex", value("1 0 auto"))
property("box-sizing", value("border-box")) property("box-sizing", value("border-box"))
} }
) { }) {
content() content()
} }
} }
@Composable @Composable
fun ContainerInSection(sectionThemeStyleClass: String? = null, content: @Composable () -> Unit) { fun ContainerInSection(sectionThemeStyleClass: String? = null, content: @Composable () -> Unit) {
Section(attrs = { Section({
if (sectionThemeStyleClass != null) { if (sectionThemeStyleClass != null) {
classes(WtSections.wtSection, sectionThemeStyleClass) classes(WtSections.wtSection, sectionThemeStyleClass)
} else { } else {
classes(WtSections.wtSection) classes(WtSections.wtSection)
} }
}) { }) {
Div( Div({
attrs = { classes(WtContainer.wtContainer, WtOffsets.wtTopOffset96)
classes(WtContainer.wtContainer, WtOffsets.wtTopOffset96) }) {
}
) {
content() content()
} }
} }

6
examples/web_landing/src/jsMain/kotlin/com/sample/content/AboutComposeWebLibsSection.kt

@ -85,8 +85,10 @@ private fun CardWithList(card: CardWithListPresentation) {
classes(WtTexts.wtText2) classes(WtTexts.wtText2)
}) { }) {
card.list.forEachIndexed { ix, it -> card.list.forEachIndexed { ix, it ->
Li(style = { Li({
property("padding-top", value(24.px)) style {
property("padding-top", value(24.px))
}
}) { Text(it) } }) { Text(it) }
} }
} }

45
examples/web_landing/src/jsMain/kotlin/com/sample/content/CodeSnippets.kt

@ -28,7 +28,7 @@ private val SimpleCounterSnippet = CodeSnippetData(
}) { }) {
Text("-") Text("-")
} }
Span(style = { padding(15.px) }) { /* we use inline style here */ Span(attrs = { style { padding(15.px) }}) { /* we use inline style here */
Text("${"$"}{count.value}") Text("${"$"}{count.value}")
} }
Button(attrs = { Button(attrs = {
@ -198,18 +198,21 @@ private var selectedSnippetIx: Int by mutableStateOf(0)
@Composable @Composable
fun CodeSamples() { fun CodeSamples() {
ContainerInSection { ContainerInSection {
Div(attrs = { classes(WtRows.wtRow) }, style = { Div({
justifyContent(JustifyContent.SpaceBetween) classes(WtRows.wtRow)
style {
justifyContent(JustifyContent.SpaceBetween)
}
}) { }) {
Div(attrs = { classes(WtCols.wtCol6, WtCols.wtColMd4, WtCols.wtColSm12) }) { Div({ classes(WtCols.wtCol6, WtCols.wtColMd4, WtCols.wtColSm12) }) {
H1(attrs = { H1({
classes(WtTexts.wtH2) classes(WtTexts.wtH2)
}) { }) {
Text("Code samples") Text("Code samples")
} }
} }
Div(attrs = { classes(WtOffsets.wtTopOffsetSm24) }) { Div({ classes(WtOffsets.wtTopOffsetSm24) }) {
CodeSampleSwitcher(count = allSnippets.size, current = selectedSnippetIx) { CodeSampleSwitcher(count = allSnippets.size, current = selectedSnippetIx) {
selectedSnippetIx = it selectedSnippetIx = it
currentCodeSnippet = allSnippets[it] currentCodeSnippet = allSnippets[it]
@ -223,42 +226,42 @@ fun CodeSamples() {
@Composable @Composable
private fun TitledCodeSample(title: String, code: String) { private fun TitledCodeSample(title: String, code: String) {
H3(attrs = { H3({
classes(WtTexts.wtH3, WtOffsets.wtTopOffset48) classes(WtTexts.wtH3, WtOffsets.wtTopOffset48)
}) { }) {
Text(title) Text(title)
} }
Div( Div({
attrs = { classes(WtOffsets.wtTopOffset24) }, classes(WtOffsets.wtTopOffset24)
style = { style {
backgroundColor(Color.RGBA(39, 40, 44, 0.05)) backgroundColor(Color.RGBA(39, 40, 44, 0.05))
borderRadius(8.px, 8.px, 8.px) borderRadius(8.px, 8.px, 8.px)
property("padding", value("12px 16px")) property("padding", value("12px 16px"))
} }
) { }) {
FormattedCodeSnippet(code = code) FormattedCodeSnippet(code = code)
} }
} }
@Composable @Composable
fun FormattedCodeSnippet(code: String, language: String = "kotlin") { fun FormattedCodeSnippet(code: String, language: String = "kotlin") {
Pre(style = { Pre({
property("max-height", value(25.em)) style {
property("overflow", value("auto")) property("max-height", value(25.em))
height(auto) property("overflow", value("auto"))
height(auto)
}
}) { }) {
Code( Code({
attrs = { classes("language-$language", "hljs")
classes("language-$language", "hljs") style {
},
style = {
property("font-family", value("'JetBrains Mono', monospace")) property("font-family", value("'JetBrains Mono', monospace"))
property("tab-size", value(4)) property("tab-size", value(4))
fontSize(10.pt) fontSize(10.pt)
backgroundColor(Color("transparent")) backgroundColor(Color("transparent"))
} }
) { }) {
DomSideEffect(code) { DomSideEffect(code) {
it.setHighlightedCode(code) it.setHighlightedCode(code)
} }

51
examples/web_landing/src/jsMain/kotlin/com/sample/content/Footer.kt

@ -10,34 +10,38 @@ import com.sample.style.*
@Composable @Composable
fun PageFooter() { fun PageFooter() {
Footer(style = { Footer({
flexShrink(0) style {
property("box-sizing", value("border-box")) flexShrink(0)
property("box-sizing", value("border-box"))
}
}) { }) {
Section(attrs = { Section({
classes(WtSections.wtSectionBgGrayDark) classes(WtSections.wtSectionBgGrayDark)
}, style = { style {
property("padding", value("24px 0")) property("padding", value("24px 0"))
}
}) { }) {
Div(attrs = { classes(WtContainer.wtContainer) }) { Div({ classes(WtContainer.wtContainer) }) {
Div(attrs = { Div({
classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter) classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter)
}, style = { style {
justifyContent(JustifyContent.Center) justifyContent(JustifyContent.Center)
flexWrap(FlexWrap.Wrap) flexWrap(FlexWrap.Wrap)
}
}) { }) {
Div(attrs = { Div({
classes(WtCols.wtColInline) classes(WtCols.wtColInline)
}) { }) {
P(attrs = { P({
classes(WtTexts.wtText1, WtTexts.wtText1ThemeDark) classes(WtTexts.wtText1, WtTexts.wtText1ThemeDark)
}) { }) {
Text("Follow us") Text("Follow us")
} }
} }
Div(attrs = { Div({
classes(WtCols.wtColInline) classes(WtCols.wtColInline)
}) { }) {
getSocialLinks().forEach { SocialIconLink(it) } getSocialLinks().forEach { SocialIconLink(it) }
@ -52,20 +56,21 @@ fun PageFooter() {
@Composable @Composable
private fun CopyrightInFooter() { private fun CopyrightInFooter() {
Div(attrs = { Div({
classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter, WtOffsets.wtTopOffset48) classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter, WtOffsets.wtTopOffset48)
}, style = { style {
justifyContent(JustifyContent.SpaceEvenly) justifyContent(JustifyContent.SpaceEvenly)
flexWrap(FlexWrap.Wrap) flexWrap(FlexWrap.Wrap)
property("padding", value("0px 12px")) property("padding", value("0px 12px"))
}
}) { }) {
Span(attrs = { Span({
classes(WtTexts.wtText3, WtTexts.wtTextPale) classes(WtTexts.wtText3, WtTexts.wtTextPale)
}) { }) {
Text("Copyright © 2000-2021 JetBrains s.r.o.") Text("Copyright © 2000-2021 JetBrains s.r.o.")
} }
Span(attrs = { Span({
classes(WtTexts.wtText3, WtTexts.wtTextPale) classes(WtTexts.wtText3, WtTexts.wtTextPale)
}) { }) {
Text("Developed with drive and IntelliJ IDEA") Text("Developed with drive and IntelliJ IDEA")
@ -78,9 +83,7 @@ private fun SocialIconLink(link: SocialLink) {
A(attrs = { A(attrs = {
classes(WtTexts.wtSocialButtonItem) classes(WtTexts.wtSocialButtonItem)
target(ATarget.Blank) target(ATarget.Blank)
}, href = link.url, style = { }, href = link.url) {
}) {
Img(src = link.iconSvg) {} Img(src = link.iconSvg) {}
} }
} }

5
examples/web_landing/src/jsMain/kotlin/com/sample/content/GetStartedSection.kt

@ -79,8 +79,9 @@ fun GetStarted() {
}) { }) {
P(attrs = { P(attrs = {
classes(WtTexts.wtText1) classes(WtTexts.wtText1)
}, style = { style {
color(Color("#fff")) color(Color("#fff"))
}
}) { }) {
Text("Ready for your next adventure? Learn how to build reactive user interfaces with Compose for Web.") Text("Ready for your next adventure? Learn how to build reactive user interfaces with Compose for Web.")
} }

13
examples/web_landing/src/jsMain/kotlin/com/sample/content/Header.kt

@ -13,12 +13,9 @@ fun Header() {
Section(attrs = { Section(attrs = {
classes(WtSections.wtSectionBgGrayDark) classes(WtSections.wtSectionBgGrayDark)
}) { }) {
Div(attrs = { classes(WtContainer.wtContainer) }) { Div({ classes(WtContainer.wtContainer) }) {
Div(attrs = { Div({
classes(WtRows.wtRow, WtRows.wtRowSizeM) classes(WtRows.wtRow, WtRows.wtRowSizeM)
}, style = {
alignItems(AlignItems.Center)
justifyContent(JustifyContent.SpaceBetween)
}) { }) {
Logo() Logo()
// TODO: support i18n // TODO: support i18n
@ -51,13 +48,11 @@ private fun LanguageButton() {
Button(attrs = { Button(attrs = {
classes(WtTexts.wtButton, WtTexts.wtLangButton) classes(WtTexts.wtButton, WtTexts.wtLangButton)
onClick { window.alert("Oops! This feature is yet to be implemented") } onClick { window.alert("Oops! This feature is yet to be implemented") }
}, style = {
property("cursor", value("pointer"))
}) { }) {
Img(src = "ic_lang.svg", style = { Img(src = "ic_lang.svg", attrs = { style {
property("padding-left", value(8.px)) property("padding-left", value(8.px))
property("padding-right", value(8.px)) property("padding-right", value(8.px))
}) {} }}) {}
Text("English") Text("English")
} }
} }

114
examples/web_landing/src/jsMain/kotlin/com/sample/content/IntroSection.kt

@ -14,19 +14,20 @@ import org.w3c.dom.HTMLElement
@Composable @Composable
fun Intro() { fun Intro() {
ContainerInSection { ContainerInSection {
Div(attrs = { Div({
classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter) classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter)
}) { }) {
Div(attrs = { Div({
classes(WtCols.wtCol2, WtCols.wtColMd3) classes(WtCols.wtCol2, WtCols.wtColMd3)
}, style = { style {
alignSelf(AlignSelf.Start) alignSelf(AlignSelf.Start)
}
}) { }) {
Img(src = "i1.svg", attrs = { classes(AppStylesheet.composeLogo) }) {} Img(src = "i1.svg", attrs = { classes(AppStylesheet.composeLogo) }) {}
} }
Div(attrs = { Div({
classes( classes(
WtCols.wtCol10, WtCols.wtCol10,
WtCols.wtColMd8, WtCols.wtColMd8,
@ -36,10 +37,13 @@ fun Intro() {
}) { }) {
H1(attrs = { classes(WtTexts.wtHero) }) { H1(attrs = { classes(WtTexts.wtHero) }) {
Text("Compose for ") Text("Compose for ")
Span(style = { Span({
display(DisplayStyle.InlineBlock) classes(WtTexts.wtHero)
property("white-space", value("nowrap")) style {
}, attrs = { classes(WtTexts.wtHero) }) { display(DisplayStyle.InlineBlock)
property("white-space", value("nowrap"))
}
}) {
Text("Web") Text("Web")
Span(attrs = { classes(AppStylesheet.composeTitleTag) }) { Span(attrs = { classes(AppStylesheet.composeTitleTag) }) {
@ -47,7 +51,7 @@ fun Intro() {
} }
} }
} }
Div(attrs = { Div({
classes(WtDisplay.wtDisplayMdNone) classes(WtDisplay.wtDisplayMdNone)
}) { }) {
IntroAboutComposeWeb() IntroAboutComposeWeb()
@ -66,14 +70,14 @@ fun Intro() {
@Composable @Composable
private fun IntroAboutComposeWeb() { private fun IntroAboutComposeWeb() {
Div(attrs = { Div({
classes(WtRows.wtRow, WtRows.wtRowSizeM) classes(WtRows.wtRow, WtRows.wtRowSizeM)
}) { }) {
Div(attrs = { Div({
classes(WtCols.wtCol9, WtCols.wtColMd9, WtCols.wtColSm12) classes(WtCols.wtCol9, WtCols.wtColMd9, WtCols.wtColSm12)
}) { }) {
P(attrs = { classes(WtTexts.wtSubtitle2, WtOffsets.wtTopOffset24) }) { P({ classes(WtTexts.wtSubtitle2, WtOffsets.wtTopOffset24) }) {
Text("Reactive web UIs for Kotlin, based on Google's ") Text("Reactive web UIs for Kotlin, based on Google's ")
A(href = "https://developer.android.com/jetpack/compose", attrs = { A(href = "https://developer.android.com/jetpack/compose", attrs = {
@ -86,15 +90,15 @@ private fun IntroAboutComposeWeb() {
Text(" and brought to you by JetBrains") Text(" and brought to you by JetBrains")
} }
P(attrs = { P({
classes(WtTexts.wtText1, WtOffsets.wtTopOffset24) classes(WtTexts.wtText1, WtOffsets.wtTopOffset24)
}) { }) {
Text( Text(
"Compose for Web simplifies and accelerates UI development for web applications, " + "Compose for Web simplifies and accelerates UI development for web applications, " +
"and aims to enable UI code sharing between web, desktop, and Android applications " + "and aims to enable UI code sharing between web, desktop, and Android applications " +
"in the future. Currently in technology preview." "in the future. Currently in technology preview."
) )
} }
ComposeWebStatusMessage() ComposeWebStatusMessage()
@ -115,14 +119,18 @@ private fun IntroAboutComposeWeb() {
@Composable @Composable
private fun IntroCodeSample() { private fun IntroCodeSample() {
Div(style = { Div({
marginTop(24.px) style {
backgroundColor(Color.RGBA(39, 40, 44, 0.05)) marginTop(24.px)
borderRadius(8.px) backgroundColor(Color.RGBA(39, 40, 44, 0.05))
property("font-family", value("'JetBrains Mono', monospace")) borderRadius(8.px)
property("font-family", value("'JetBrains Mono', monospace"))
}
}) { }) {
Div(style = { Div({
property("padding", value("12px 16px")) style {
property("padding", value("12px 16px"))
}
}) { }) {
FormattedCodeSnippet( FormattedCodeSnippet(
code = """ code = """
@ -138,10 +146,12 @@ private fun IntroCodeSample() {
) )
} }
Hr(style = { Hr({
height(1.px) style {
border(width = 0.px) height(1.px)
backgroundColor(Color.RGBA(39, 40, 44, 0.15)) border(width = 0.px)
backgroundColor(Color.RGBA(39, 40, 44, 0.15))
}
}) })
IntroCodeSampleResult() IntroCodeSampleResult()
@ -150,24 +160,26 @@ private fun IntroCodeSample() {
@Composable @Composable
private fun IntroCodeSampleResult() { private fun IntroCodeSampleResult() {
Div(style = { Div({
property("padding", value("12px 16px")) style {
display(DisplayStyle.Flex) property("padding", value("12px 16px"))
flexDirection(FlexDirection.Row) display(DisplayStyle.Flex)
alignItems(AlignItems.Center) flexDirection(FlexDirection.Row)
alignItems(AlignItems.Center)
}
}) { }) {
Span( Span({
attrs = { classes(WtTexts.wtText2) }, classes(WtTexts.wtText2)
style = { style {
property("margin-right", value(8.px)) property("margin-right", value(8.px))
} }
) { }) {
Text("Result:") Text("Result:")
} }
fun greet() = listOf("Hello", "Hallo", "Hola", "Servus").random() fun greet() = listOf("Hello", "Hallo", "Hola", "Servus").random()
Div(attrs = { Div({
id("greetingContainer") id("greetingContainer")
}) { }) {
var greeting by remember { mutableStateOf(greet()) } var greeting by remember { mutableStateOf(greet()) }
@ -180,22 +192,24 @@ private fun IntroCodeSampleResult() {
@Composable @Composable
private fun ComposeWebStatusMessage() { private fun ComposeWebStatusMessage() {
Div(attrs = { Div({
classes(WtRows.wtRow, WtRows.wtRowSizeXs, WtOffsets.wtTopOffset24) classes(WtRows.wtRow, WtRows.wtRowSizeXs, WtOffsets.wtTopOffset24)
}) { }) {
Div(attrs = { Div({
classes(WtCols.wtColInline) classes(WtCols.wtColInline)
}) { }) {
Img(src = "ic_info.svg", style = { Img(src = "ic_info.svg", attrs = {
width(24.px) style {
height(24.px) width(24.px)
height(24.px)
}
}) {} }) {}
} }
Div(attrs = { Div({
classes(WtCols.wtColAutoFill) classes(WtCols.wtColAutoFill)
}) { }) {
P(attrs = { P({
classes(WtTexts.wtText3) classes(WtTexts.wtText3)
}) { }) {
Text( Text(
@ -211,13 +225,11 @@ private fun ComposeWebStatusMessage() {
@Composable @Composable
inline fun Hr( inline fun Hr(
crossinline attrs: (AttrsBuilder<Tag.Div>.() -> Unit) = {}, crossinline attrs: (AttrsBuilder<Tag.Div>.() -> Unit) = {}
crossinline style: (StyleBuilder.() -> Unit) = {},
) { ) {
TagElement<Tag.Div, HTMLElement>( TagElement<Tag.Div, HTMLElement>(
tagName = "hr", tagName = "hr",
applyAttrs = attrs, applyAttrs = attrs,
applyStyle = style,
content = { } content = { }
) )
} }

2
web/gradle.properties

@ -1,3 +1,3 @@
COMPOSE_CORE_VERSION=0.0.12-SNAPSHOT COMPOSE_CORE_VERSION=0.0.12-SNAPSHOT
COMPOSE_WEB_VERSION=0.0.12-SNAPSHOT COMPOSE_WEB_VERSION=0.0.12-SNAPSHOT
COMPOSE_BUILD_WITH_EXAMPLES=false COMPOSE_WEB_BUILD_WITH_EXAMPLES=false

1
web/settings.gradle.kts

@ -37,4 +37,5 @@ if (extra["COMPOSE_WEB_BUILD_WITH_EXAMPLES"]!!.toString().toBoolean() == true) {
module(":examples:falling_balls_with_web", "../examples/falling_balls_with_web") module(":examples:falling_balls_with_web", "../examples/falling_balls_with_web")
module(":examples:web_landing", "../examples/web_landing") module(":examples:web_landing", "../examples/web_landing")
module(":examples:web-with-react", "../examples/web-with-react") module(":examples:web-with-react", "../examples/web-with-react")
module(":examples:web-getting-started", "../examples/web-getting-started")
} }

Loading…
Cancel
Save