diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f2e1a6..73fe71d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,15 +5,11 @@ on: [push] jobs: build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 + - name: Set up JDK 11 uses: actions/setup-java@v1 with: - java-version: 1.8 - - name: Fix android 31.0.0 dx - continue-on-error: true - run: cd /usr/local/lib/android/sdk/build-tools/31.0.0/ && mv d8 dx && cd lib && mv d8.jar dx.jar + java-version: 11 - name: Build with Gradle run: ./gradlew build diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab560b..0f4e090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.2.0 + +**ALL DEPRECATIONS HAVE BEEN REMOVED** + +* `Kotlin`: `1.7.0` +* `Compose`: `1.2.0-alpha01-dev753` + ## 0.1.10 * `Grid` support improvements diff --git a/gradle.properties b/gradle.properties index f895ddf..f66aed2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ android.enableJetifier=true # Project data group=dev.inmo -version=0.1.10 +version=0.2.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1755958..99c5a74 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,8 @@ [versions] -kt = "1.6.21" -jb-compose = "1.2.0-alpha01-dev731" -jb-dokka = "1.6.21" +kt = "1.7.0" +jb-compose = "1.2.0-alpha01-dev753" +jb-dokka = "1.7.0" gh-release = "2.4.1" [libraries] diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/UIKitAttributeValueBuilder.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/UIKitAttributeValueBuilder.kt index d6f23b9..965004e 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/UIKitAttributeValueBuilder.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/UIKitAttributeValueBuilder.kt @@ -1,26 +1,8 @@ package dev.inmo.jsuikit -import dev.inmo.jsuikit.modifiers.AttributeValue import dev.inmo.jsuikit.utils.* import org.jetbrains.compose.web.attributes.AttrsScope -@Deprecated("Will be removed soon") -class UIKitAttributeValueBuilder { - private val attrs = mutableListOf>() - - infix fun String.to(other: String?) { - other ?.let { - attrs.add(Pair(this, other)) - } - } - - infix fun String.to(other: AttributeValue?) { - this to other ?.name - } - - fun build(): String = attrs.joinToString(";") { (k, v) -> "$k: $v" } -} - fun AttrsScope<*>.buildAndAddAttribute( attributeName: String, skipNullValues: Boolean = true, diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/List.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/List.kt index 2e1f505..d9dd2af 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/List.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/List.kt @@ -43,25 +43,3 @@ fun ListWithTitle( besidesTitleAndList ?.invoke() List(data, Attrs(*ulModifiers) { ulCustomizer(this) }, elementAllocator) } - -@Deprecated("Renamed", ReplaceWith("ListWithTitle", "dev.inmo.jsuikit.elements.ListWithTitle")) -@Composable -fun List( - title: String, - data: SnapshotStateList, - vararg titleModifiers: UIKitModifier, - ulModifiers: Array = emptyArray(), - besidesTitleAndList: (@Composable () -> Unit)? = null, - titleCustomizer: AttrBuilderContext = {}, - ulCustomizer: AttrBuilderContext = {}, - elementAllocator: @Composable ElementScope.(T) -> Unit -) = ListWithTitle( - title, - data, - *titleModifiers, - ulModifiers = ulModifiers, - besidesTitleAndList = besidesTitleAndList, - titleCustomizer = titleCustomizer, - ulCustomizer = ulCustomizer, - elementAllocator = elementAllocator -) diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Navbar.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Navbar.kt index ca54814..94e9ead 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Navbar.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Navbar.kt @@ -22,33 +22,6 @@ fun Navbar( } } -@Deprecated("Will be removed soon. Use the variant with AttrsWithContentBuilders") -@Composable -fun Navbar( - leftBuilder: NavbarNavBuilder?, - centerBuilder: NavbarNavBuilder? = null, - rightBuilder: NavbarNavBuilder? = null, - vararg navModifiers: UIKitModifier, - attributesCustomizer: AttrBuilderContext = {}, -) { - Navbar( - { - include(*navModifiers) - attributesCustomizer() - } - ) { - leftBuilder ?.let { - Div({ include(UIKitNavbar.Alignment.Left) }) { it.draw() } - } - centerBuilder ?.let { - Div({ include(UIKitNavbar.Alignment.Center) }) { it.draw() } - } - rightBuilder ?.let { - Div({ include(UIKitNavbar.Alignment.Right) }) { it.draw() } - } - } -} - @Composable fun Navbar( leftBuilder: AttrsWithContentBuilder? = null, diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/NavbarNavBuilder.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/NavbarNavBuilder.kt index b919dc1..f749d62 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/NavbarNavBuilder.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/NavbarNavBuilder.kt @@ -30,58 +30,3 @@ fun NavbarNav( vararg elements: AttrsWithContentBuilder, attrs: Attrs = Attrs.empty() ) = NavbarNav(elements.toList(), attrs) - -@Deprecated("Will be removed soon. Use NavbarNavPart with AttrsWithContentBuilder instead") -interface NavbarNavElement { - fun AttrsScope.setup() {} - @Composable - fun ElementScope.fill() - - class Default( - private val setupCallback: AttrsScope.() -> Unit, - private val fillCallback: @Composable ElementScope.() -> Unit - ) : NavbarNavElement { - override fun AttrsScope.setup() { - setupCallback() - } - - @Composable - override fun ElementScope.fill() { - fillCallback() - } - } -} - -@Deprecated("Will be removed soon. Use NavbarNavPart with AttrsWithContentBuilder instead") -class NavbarNavBuilder( - private val modifiers: Array, - private val elements: List, - private val attributesCustomizer: AttrBuilderContext = {} -) { - constructor( - modifiers: Array, - vararg elements: NavbarNavElement, - attributesCustomizer: AttrBuilderContext = {} - ) : this(modifiers, elements.toList(), attributesCustomizer) - constructor( - vararg elements: NavbarNavElement, - attributesCustomizer: AttrBuilderContext = {} - ) : this(emptyArray(), elements.toList(), attributesCustomizer) - @Composable - fun draw() { - Ul( - { - include(UIKitNavbar.Nav, *modifiers) - attributesCustomizer() - } - ) { - elements.forEach { element -> - Li( - { element.apply { setup() } } - ) { - element.apply { fill() } - } - } - } - } -} diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/StandardInput.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/StandardInput.kt index 85044fa..f5d5dd4 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/StandardInput.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/StandardInput.kt @@ -41,14 +41,3 @@ fun StandardInput( attributesCustomizer() } } - -@Composable -@Deprecated("Renamed", ReplaceWith("StandardInput", "dev.inmo.jsuikit.elements.StandardInput")) -fun TextField( - type: InputType, - state: MutableState, - disabledState: State? = null, - placeholder: String? = null, - vararg modifiers: UIKitModifier, - attributesCustomizer: AttrBuilderContext = {}, -) = StandardInput(type, state, disabledState, placeholder, modifiers = modifiers, attributesCustomizer)