From 0beb781e2c0ae798f6dd6fc774d2beb066b8fe38 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 13 Jan 2022 19:56:39 +0600 Subject: [PATCH] now project is multiplatform and correctly working --- CHANGELOG.md | 2 + build.gradle | 39 +++++--- gradle/libs.versions.toml | 2 +- publish.gradle | 93 ++++++++----------- publish.kpsb | 2 +- .../jsuikit/UIKitAttributeValueBuilder.kt | 0 .../dev/inmo/jsuikit/elements/Button.kt | 8 +- .../dev/inmo/jsuikit/elements/Dialog.kt | 2 +- .../dev/inmo/jsuikit/elements/Divider.kt | 0 .../dev/inmo/jsuikit/elements/Dropdown.kt | 2 +- .../kotlin/dev/inmo/jsuikit/elements/Flex.kt | 2 +- .../kotlin/dev/inmo/jsuikit/elements/Grid.kt | 4 +- .../kotlin/dev/inmo/jsuikit/elements/Icon.kt | 10 +- .../dev/inmo/jsuikit/elements/Labels.kt | 4 +- .../kotlin/dev/inmo/jsuikit/elements/List.kt | 2 +- .../kotlin/dev/inmo/jsuikit/elements/Nav.kt | 4 +- .../dev/inmo/jsuikit/elements/Navbar.kt | 2 +- .../inmo/jsuikit/elements/NavbarNavBuilder.kt | 0 .../dev/inmo/jsuikit/elements/Progress.kt | 2 +- .../dev/inmo/jsuikit/elements/Spinner.kt | 6 +- .../kotlin/dev/inmo/jsuikit/elements/Table.kt | 2 +- .../dev/inmo/jsuikit/elements/TextField.kt | 2 +- .../inmo/jsuikit/modifiers/AttributeValue.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKit.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKitAlign.kt | 0 .../inmo/jsuikit/modifiers/UIKitAnimation.kt | 0 .../inmo/jsuikit/modifiers/UIKitBackground.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKitButton.kt | 0 .../inmo/jsuikit/modifiers/UIKitDropdown.kt | 0 .../inmo/jsuikit/modifiers/UIKitExtensions.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKitFlex.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKitGrid.kt | 0 .../inmo/jsuikit/modifiers/UIKitIconType.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKitMargin.kt | 0 .../inmo/jsuikit/modifiers/UIKitModifier.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKitNav.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKitNavbar.kt | 0 .../inmo/jsuikit/modifiers/UIKitPadding.kt | 0 .../inmo/jsuikit/modifiers/UIKitPosition.kt | 0 .../modifiers/UIKitScreenSizeModifier.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKitTable.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKitText.kt | 0 .../jsuikit/modifiers/UIKitTooltipModifier.kt | 0 .../inmo/jsuikit/modifiers/UIKitUtility.kt | 0 .../dev/inmo/jsuikit/modifiers/UIKitWidth.kt | 0 .../dev/inmo/jsuikit/utils/Milliseconds.kt | 0 46 files changed, 92 insertions(+), 98 deletions(-) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/UIKitAttributeValueBuilder.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Button.kt (88%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Dialog.kt (98%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Divider.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Dropdown.kt (96%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Flex.kt (91%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Grid.kt (92%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Icon.kt (96%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Labels.kt (91%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/List.kt (94%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Nav.kt (92%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Navbar.kt (94%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/NavbarNavBuilder.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Progress.kt (92%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Spinner.kt (78%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/Table.kt (95%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/elements/TextField.kt (94%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/AttributeValue.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKit.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitAlign.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitAnimation.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitBackground.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitButton.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitDropdown.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitExtensions.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitFlex.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitGrid.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitIconType.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitMargin.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitModifier.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitNav.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitNavbar.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitPadding.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitPosition.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitScreenSizeModifier.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitTable.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitText.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitTooltipModifier.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitUtility.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/modifiers/UIKitWidth.kt (100%) rename src/{main => jsMain}/kotlin/dev/inmo/jsuikit/utils/Milliseconds.kt (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1c49aa..1af355d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## 0.0.7 +Rewrite project onto multiplatform paradigm and return back varargs instead of most `Array` + ## 0.0.6 Changes in signatures of text field and list diff --git a/build.gradle b/build.gradle index 4bcd692..648aad9 100644 --- a/build.gradle +++ b/build.gradle @@ -15,35 +15,44 @@ buildscript { } plugins { - alias(libs.plugins.kt.js) + alias(libs.plugins.kt.multiplatform) alias(libs.plugins.jb.compose) } project.version = "$version" project.group = "$group" -allprojects { - repositories { - mavenLocal() - mavenCentral() - google() - } +repositories { + mavenLocal() + mavenCentral() + google() } kotlin { js(IR) { browser() - binaries.executable() } -} + sourceSets { + commonMain { + dependencies { + implementation libs.kt.stdlib + implementation compose.runtime + } + } + jsMain { + dependencies { + implementation compose.web.core + } + } -dependencies { - implementation libs.kt.stdlib - implementation compose.web.core - implementation compose.runtime - testImplementation libs.kt.test.js - testImplementation libs.kt.test.junit + jsTest { + dependencies { + implementation libs.kt.test.js + implementation libs.kt.test.junit + } + } + } } apply from: "./github_release.gradle" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1fee58f..16e01c2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,5 +18,5 @@ buildscript-gh-release = { module = "com.github.breadmoirai:github-release", ver [plugins] -kt-js = { id = "org.jetbrains.kotlin.js", version.ref = "kt" } +kt-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kt" } jb-compose = { id = "org.jetbrains.compose", version.ref = "jb-compose" } diff --git a/publish.gradle b/publish.gradle index ef18e3a..d5f379c 100644 --- a/publish.gradle +++ b/publish.gradle @@ -1,72 +1,57 @@ apply plugin: 'maven-publish' -task javadocJar(type: Jar) { +task javadocsJar(type: Jar) { classifier = 'javadoc' } -task sourcesJar(type: Jar) { - kotlin.sourceSets.all { - from(kotlin) - } - classifier = 'sources' -} publishing { - publications { - maven(MavenPublication) { - kotlin.js().components.forEach { - from(it) + publications.all { + artifact javadocsJar + + pom { + description = "${project.name}" + name = "${project.name}" + url = "https://github.com/InsanusMokrassar/JSUIKitKBindings" + + scm { + developerConnection = "scm:git:[fetch=]https://github.com/InsanusMokrassar/JSUIKitKBindings.git[push=]https://github.com/InsanusMokrassar/JSUIKitKBindings.git" + url = "https://github.com/InsanusMokrassar/JSUIKitKBindings.git" } - artifact javadocJar - artifact sourcesJar - - pom { - resolveStrategy = Closure.DELEGATE_FIRST - - description = "${project.name}" - name = "${project.name}" - url = "https://github.com/InsanusMokrassar/JSUIKitKBindings" - - scm { - developerConnection = "scm:git:[fetch=]https://github.com/InsanusMokrassar/JSUIKitKBindings.git[push=]https://github.com/InsanusMokrassar/JSUIKitKBindings.git" - url = "https://github.com/InsanusMokrassar/JSUIKitKBindings.git" - } - - developers { - - developer { - id = "InsanusMokrassar" - name = "Ovsiannikov Aleksei" - email = "ovsyannikov.alexey95@gmail.com" - } - - } - - licenses { - - license { - name = "Apache Software License 2.0" - url = "https://opensource.org/licenses/Apache-2.0" - } - - } + developers { + + developer { + id = "InsanusMokrassar" + name = "Ovsiannikov Aleksei" + email = "ovsyannikov.alexey95@gmail.com" + } + } - repositories { - if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) { - maven { - name = "sonatype" - url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") - credentials { - username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER') - password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') - } + + licenses { + + license { + name = "Apache Software License 2.0" + url = "https://opensource.org/licenses/Apache-2.0" + } + + } + } + repositories { + if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) { + maven { + name = "sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER') + password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') } } } } } } - + if (project.hasProperty("signing.gnupg.keyName")) { apply plugin: 'signing' diff --git a/publish.kpsb b/publish.kpsb index e60ef97..18c674d 100644 --- a/publish.kpsb +++ b/publish.kpsb @@ -1 +1 @@ -{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://opensource.org/licenses/Apache-2.0"}],"mavenConfig":{"name":"${project.name}","description":"${project.name}","url":"https://github.com/InsanusMokrassar/JSUIKitKBindings","vcsUrl":"https://github.com/InsanusMokrassar/JSUIKitKBindings.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}},"type":"JS"} \ No newline at end of file +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://opensource.org/licenses/Apache-2.0"}],"mavenConfig":{"name":"${project.name}","description":"${project.name}","url":"https://github.com/InsanusMokrassar/JSUIKitKBindings","vcsUrl":"https://github.com/InsanusMokrassar/JSUIKitKBindings.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}} \ No newline at end of file diff --git a/src/main/kotlin/dev/inmo/jsuikit/UIKitAttributeValueBuilder.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/UIKitAttributeValueBuilder.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/UIKitAttributeValueBuilder.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/UIKitAttributeValueBuilder.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Button.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Button.kt similarity index 88% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Button.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Button.kt index 0689e36..01b0dcb 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Button.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Button.kt @@ -12,7 +12,7 @@ import org.w3c.dom.events.Event @Composable fun DefaultButton( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, disabled: Boolean = false, buttonType: UIKitButton.Type = UIKitButton.Type.Default, onClick: ((SyntheticMouseEvent) -> Unit)? = null, @@ -37,14 +37,14 @@ fun DefaultButton( @Composable fun DefaultButton( text: String, - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, disabled: Boolean = false, buttonType: UIKitButton.Type = UIKitButton.Type.Default, preTextContentAllocator: ContentBuilder? = null, afterTextContentAllocator: ContentBuilder? = null, attributesCustomizer: AttrBuilderContext = {}, onClick: ((SyntheticMouseEvent) -> Unit)? = null -) = DefaultButton(modifiers, disabled = disabled, buttonType = buttonType, onClick = onClick, attributesCustomizer = attributesCustomizer) { +) = DefaultButton(*modifiers, disabled = disabled, buttonType = buttonType, onClick = onClick, attributesCustomizer = attributesCustomizer) { preTextContentAllocator ?.apply { preTextContentAllocator() } Text(text) afterTextContentAllocator ?.apply { afterTextContentAllocator() } @@ -53,7 +53,7 @@ fun DefaultButton( @Composable fun UploadButton( text: String, - buttonModifiers: Array = emptyArray(), + vararg buttonModifiers: UIKitModifier, containerModifiers: Array = emptyArray(), disabled: Boolean = false, buttonType: UIKitButton.Type = UIKitButton.Type.Default, diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Dialog.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Dialog.kt similarity index 98% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Dialog.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Dialog.kt index f5ca7a2..39680b5 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Dialog.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Dialog.kt @@ -26,7 +26,7 @@ private class DialogDisposableEffectResult( @Composable fun Dialog( title: String? = null, - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, hide: (() -> Unit)? = null, hidden: (() -> Unit)? = null, footerBuilder: (@Composable () -> Unit)? = null, diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Divider.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Divider.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Divider.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Divider.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Dropdown.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Dropdown.kt similarity index 96% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Dropdown.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Dropdown.kt index 8ec41bb..43b1751 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Dropdown.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Dropdown.kt @@ -9,7 +9,7 @@ import org.w3c.dom.HTMLDivElement @Composable fun Dropdown( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, toggle: String? = null, pos: UIKitDropdown.Position? = null, mode: UIKitDropdown.Mode? = null, diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Flex.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Flex.kt similarity index 91% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Flex.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Flex.kt index 3064f18..278a110 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Flex.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Flex.kt @@ -8,7 +8,7 @@ import org.w3c.dom.HTMLDivElement @Composable fun Flex( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, filler: @Composable ElementScope.() -> Unit ) { diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Grid.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Grid.kt similarity index 92% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Grid.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Grid.kt index 53bd59e..d0c357e 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Grid.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Grid.kt @@ -8,7 +8,7 @@ import org.w3c.dom.HTMLDivElement @Composable fun GridColumn( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, builder: @Composable ElementScope.() -> Unit ) { @@ -24,7 +24,7 @@ fun GridColumn( @Composable fun Grid( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, masonry: Boolean = false, parallax: Int? = null, marginClass: String? = null, diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Icon.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt similarity index 96% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Icon.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt index 12eb9d8..7ae3744 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Icon.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt @@ -204,7 +204,7 @@ sealed class Icon(val name: String) { @Composable operator fun invoke( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, type: UIKitIconType = UIKitIconType.Default, ratio: Float? = null, attributesCustomizer: AttrBuilderContext = {}, @@ -228,17 +228,17 @@ sealed class Icon(val name: String) { @Composable fun drawAsButton( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, ratio: Float? = null, attributesCustomizer: AttrBuilderContext = {}, onClick: ((Event) -> Unit)? = null - ) = invoke(modifiers, type = UIKitIconType.Button, ratio = ratio, onClick = onClick, attributesCustomizer = attributesCustomizer) + ) = invoke(*modifiers, type = UIKitIconType.Button, ratio = ratio, onClick = onClick, attributesCustomizer = attributesCustomizer) @Composable fun drawAsIcon( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, ratio: Float? = null, attributesCustomizer: AttrBuilderContext = {}, onClick: ((Event) -> Unit)? = null - ) = invoke(modifiers, type = UIKitIconType.Default, ratio = ratio, onClick = onClick, attributesCustomizer = attributesCustomizer) + ) = invoke(*modifiers, type = UIKitIconType.Default, ratio = ratio, onClick = onClick, attributesCustomizer = attributesCustomizer) } diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Labels.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Labels.kt similarity index 91% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Labels.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Labels.kt index 20ed43b..686b280 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Labels.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Labels.kt @@ -10,9 +10,9 @@ sealed interface Label { val suffix: String @Composable - operator fun invoke( + fun draw( text: String, - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, ) = Span( { diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/List.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/List.kt similarity index 94% rename from src/main/kotlin/dev/inmo/jsuikit/elements/List.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/List.kt index 9772e8c..cc9ac3e 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/List.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/List.kt @@ -12,7 +12,7 @@ import org.w3c.dom.HTMLUListElement fun List( title: String, data: SnapshotStateList, - titleModifiers: Array = emptyArray(), + vararg titleModifiers: UIKitModifier, ulModifiers: Array = emptyArray(), besidesTitleAndList: (@Composable () -> Unit)? = null, titleCustomizer: AttrBuilderContext = {}, diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Nav.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Nav.kt similarity index 92% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Nav.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Nav.kt index 1191cf3..e22c623 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Nav.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Nav.kt @@ -10,7 +10,7 @@ import org.w3c.dom.HTMLUListElement @Composable fun Nav( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, multiple: Boolean? = null, collapsible: Boolean? = null, animation: UIKitAnimation? = null, @@ -37,7 +37,7 @@ fun Nav( @Composable fun NavElement( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, contentAllocator: ContentBuilder ) { diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Navbar.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Navbar.kt similarity index 94% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Navbar.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Navbar.kt index ee3ee98..5c94117 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Navbar.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Navbar.kt @@ -11,7 +11,7 @@ fun Navbar( leftBuilder: NavbarNavBuilder? = null, centerBuilder: NavbarNavBuilder? = null, rightBuilder: NavbarNavBuilder? = null, - navModifiers: Array = emptyArray(), + vararg navModifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, ) { Nav( diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/NavbarNavBuilder.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/NavbarNavBuilder.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/elements/NavbarNavBuilder.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/NavbarNavBuilder.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Progress.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Progress.kt similarity index 92% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Progress.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Progress.kt index 2b58c94..2c30ce4 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Progress.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Progress.kt @@ -10,7 +10,7 @@ import org.w3c.dom.HTMLProgressElement @Composable fun Progress( value: Int, - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, max: Int = 100, attributesCustomizer: AttrBuilderContext = {} ) { diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Spinner.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Spinner.kt similarity index 78% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Spinner.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Spinner.kt index e310731..c8f46b5 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Spinner.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Spinner.kt @@ -8,7 +8,7 @@ import org.w3c.dom.HTMLDivElement @Composable fun Spinner( - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, ratio: Float? = null, attributesCustomizer: AttrBuilderContext = {} ) { @@ -23,6 +23,4 @@ fun Spinner( } @Composable -fun DefaultSpinner() = Spinner( - arrayOf(UIKitAlign.Center, UIKitMargin.Small, UIKitText.Alignment.Center) -) +fun DefaultSpinner() = Spinner(UIKitAlign.Center, UIKitMargin.Small, UIKitText.Alignment.Center) diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/Table.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt similarity index 95% rename from src/main/kotlin/dev/inmo/jsuikit/elements/Table.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt index 22e63e6..fa76c22 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/Table.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Table.kt @@ -11,7 +11,7 @@ import org.w3c.dom.HTMLTableElement fun DefaultTable( heading: List, dataList: SnapshotStateList, - tableModifiers: Array = emptyArray(), + vararg tableModifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, cellFiller: @Composable (i: Int, t: T) -> Unit ) { diff --git a/src/main/kotlin/dev/inmo/jsuikit/elements/TextField.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/TextField.kt similarity index 94% rename from src/main/kotlin/dev/inmo/jsuikit/elements/TextField.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/elements/TextField.kt index 1cefa8a..af8a0a2 100644 --- a/src/main/kotlin/dev/inmo/jsuikit/elements/TextField.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/TextField.kt @@ -14,7 +14,7 @@ fun TextField( state: MutableState, disabledState: State? = null, placeholder: String? = null, - modifiers: Array = emptyArray(), + vararg modifiers: UIKitModifier, attributesCustomizer: AttrBuilderContext = {}, ) { Input(type) { diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/AttributeValue.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/AttributeValue.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/AttributeValue.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/AttributeValue.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKit.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKit.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKit.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKit.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitAlign.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitAlign.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitAlign.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitAlign.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitAnimation.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitAnimation.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitAnimation.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitAnimation.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitBackground.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitBackground.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitBackground.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitBackground.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitButton.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitButton.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitButton.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitButton.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitDropdown.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitDropdown.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitDropdown.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitDropdown.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitExtensions.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitExtensions.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitExtensions.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitExtensions.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitFlex.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitFlex.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitFlex.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitFlex.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitGrid.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitGrid.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitGrid.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitGrid.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitIconType.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitIconType.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitIconType.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitIconType.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitMargin.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitMargin.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitMargin.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitMargin.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitModifier.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitModifier.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitModifier.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitModifier.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitNav.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitNav.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitNav.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitNav.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitNavbar.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitNavbar.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitNavbar.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitNavbar.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitPadding.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitPadding.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitPadding.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitPadding.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitPosition.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitPosition.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitPosition.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitPosition.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitScreenSizeModifier.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitScreenSizeModifier.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitScreenSizeModifier.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitScreenSizeModifier.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitTable.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitTable.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitTable.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitTable.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitText.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitText.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitText.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitText.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitTooltipModifier.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitTooltipModifier.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitTooltipModifier.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitTooltipModifier.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitUtility.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitUtility.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitUtility.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitUtility.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitWidth.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitWidth.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/modifiers/UIKitWidth.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitWidth.kt diff --git a/src/main/kotlin/dev/inmo/jsuikit/utils/Milliseconds.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/utils/Milliseconds.kt similarity index 100% rename from src/main/kotlin/dev/inmo/jsuikit/utils/Milliseconds.kt rename to src/jsMain/kotlin/dev/inmo/jsuikit/utils/Milliseconds.kt