diff --git a/build.gradle.kts b/build.gradle.kts index 30f2d2c..817e3de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,19 +1,19 @@ plugins { - kotlin("multiplatform") version "1.7.20" + kotlin("multiplatform") version "1.9.0" `maven-publish` signing id("org.jetbrains.dokka") version "1.5.31" } group = "nl.astraeus" -version = "1.0.8-SNAPSHOT" +version = "1.1.1" repositories { mavenCentral() } kotlin { - js(BOTH) { + js(IR) { browser { testTask { useKarma { @@ -26,14 +26,11 @@ sourceSets { val commonMain by getting { dependencies { - implementation(kotlin("stdlib-common")) - - api("org.jetbrains.kotlinx:kotlinx-html:0.7.5") + api("org.jetbrains.kotlinx:kotlinx-html:0.9.1") } } val jsMain by getting { dependencies { - implementation(kotlin("stdlib-js")) } } val jsTest by getting { @@ -71,25 +68,25 @@ maven { name = "releases" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/releases") + setUrl("https://reposilite.astraeus.nl/releases") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { name = "snapshots" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/snapshots") + setUrl("https://reposilite.astraeus.nl/snapshots") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { @@ -136,3 +133,20 @@ signing { sign(publishing.publications) } + +tasks.named("signJsPublication") { + dependsOn(tasks.named("publishKotlinMultiplatformPublicationToMavenLocal")) +} + +tasks.named("publishJsPublicationToReleasesRepository") { + dependsOn(tasks.named("signKotlinMultiplatformPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToMavenLocalRepository") { + dependsOn(tasks.named("signJsPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToReleasesRepository") { + dependsOn(tasks.named("signJsPublication")) +} + diff --git a/build.gradle.kts b/build.gradle.kts index 30f2d2c..817e3de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,19 +1,19 @@ plugins { - kotlin("multiplatform") version "1.7.20" + kotlin("multiplatform") version "1.9.0" `maven-publish` signing id("org.jetbrains.dokka") version "1.5.31" } group = "nl.astraeus" -version = "1.0.8-SNAPSHOT" +version = "1.1.1" repositories { mavenCentral() } kotlin { - js(BOTH) { + js(IR) { browser { testTask { useKarma { @@ -26,14 +26,11 @@ sourceSets { val commonMain by getting { dependencies { - implementation(kotlin("stdlib-common")) - - api("org.jetbrains.kotlinx:kotlinx-html:0.7.5") + api("org.jetbrains.kotlinx:kotlinx-html:0.9.1") } } val jsMain by getting { dependencies { - implementation(kotlin("stdlib-js")) } } val jsTest by getting { @@ -71,25 +68,25 @@ maven { name = "releases" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/releases") + setUrl("https://reposilite.astraeus.nl/releases") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { name = "snapshots" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/snapshots") + setUrl("https://reposilite.astraeus.nl/snapshots") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { @@ -136,3 +133,20 @@ signing { sign(publishing.publications) } + +tasks.named("signJsPublication") { + dependsOn(tasks.named("publishKotlinMultiplatformPublicationToMavenLocal")) +} + +tasks.named("publishJsPublicationToReleasesRepository") { + dependsOn(tasks.named("signKotlinMultiplatformPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToMavenLocalRepository") { + dependsOn(tasks.named("signJsPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToReleasesRepository") { + dependsOn(tasks.named("signJsPublication")) +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 982aaee..554856b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Wed Mar 04 13:29:12 CET 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/build.gradle.kts b/build.gradle.kts index 30f2d2c..817e3de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,19 +1,19 @@ plugins { - kotlin("multiplatform") version "1.7.20" + kotlin("multiplatform") version "1.9.0" `maven-publish` signing id("org.jetbrains.dokka") version "1.5.31" } group = "nl.astraeus" -version = "1.0.8-SNAPSHOT" +version = "1.1.1" repositories { mavenCentral() } kotlin { - js(BOTH) { + js(IR) { browser { testTask { useKarma { @@ -26,14 +26,11 @@ sourceSets { val commonMain by getting { dependencies { - implementation(kotlin("stdlib-common")) - - api("org.jetbrains.kotlinx:kotlinx-html:0.7.5") + api("org.jetbrains.kotlinx:kotlinx-html:0.9.1") } } val jsMain by getting { dependencies { - implementation(kotlin("stdlib-js")) } } val jsTest by getting { @@ -71,25 +68,25 @@ maven { name = "releases" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/releases") + setUrl("https://reposilite.astraeus.nl/releases") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { name = "snapshots" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/snapshots") + setUrl("https://reposilite.astraeus.nl/snapshots") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { @@ -136,3 +133,20 @@ signing { sign(publishing.publications) } + +tasks.named("signJsPublication") { + dependsOn(tasks.named("publishKotlinMultiplatformPublicationToMavenLocal")) +} + +tasks.named("publishJsPublicationToReleasesRepository") { + dependsOn(tasks.named("signKotlinMultiplatformPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToMavenLocalRepository") { + dependsOn(tasks.named("signJsPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToReleasesRepository") { + dependsOn(tasks.named("signJsPublication")) +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 982aaee..554856b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Wed Mar 04 13:29:12 CET 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt b/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt index 2fc7d49..8810ef5 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt @@ -1,8 +1,9 @@ package nl.astraeus.komp +import org.w3c.dom.events.Event import org.w3c.dom.Element import org.w3c.dom.HTMLInputElement -import org.w3c.dom.events.Event +import org.w3c.dom.events.EventListener import org.w3c.dom.get private fun Int.asSpaces(): String { diff --git a/build.gradle.kts b/build.gradle.kts index 30f2d2c..817e3de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,19 +1,19 @@ plugins { - kotlin("multiplatform") version "1.7.20" + kotlin("multiplatform") version "1.9.0" `maven-publish` signing id("org.jetbrains.dokka") version "1.5.31" } group = "nl.astraeus" -version = "1.0.8-SNAPSHOT" +version = "1.1.1" repositories { mavenCentral() } kotlin { - js(BOTH) { + js(IR) { browser { testTask { useKarma { @@ -26,14 +26,11 @@ sourceSets { val commonMain by getting { dependencies { - implementation(kotlin("stdlib-common")) - - api("org.jetbrains.kotlinx:kotlinx-html:0.7.5") + api("org.jetbrains.kotlinx:kotlinx-html:0.9.1") } } val jsMain by getting { dependencies { - implementation(kotlin("stdlib-js")) } } val jsTest by getting { @@ -71,25 +68,25 @@ maven { name = "releases" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/releases") + setUrl("https://reposilite.astraeus.nl/releases") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { name = "snapshots" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/snapshots") + setUrl("https://reposilite.astraeus.nl/snapshots") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { @@ -136,3 +133,20 @@ signing { sign(publishing.publications) } + +tasks.named("signJsPublication") { + dependsOn(tasks.named("publishKotlinMultiplatformPublicationToMavenLocal")) +} + +tasks.named("publishJsPublicationToReleasesRepository") { + dependsOn(tasks.named("signKotlinMultiplatformPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToMavenLocalRepository") { + dependsOn(tasks.named("signJsPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToReleasesRepository") { + dependsOn(tasks.named("signJsPublication")) +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 982aaee..554856b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Wed Mar 04 13:29:12 CET 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt b/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt index 2fc7d49..8810ef5 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt @@ -1,8 +1,9 @@ package nl.astraeus.komp +import org.w3c.dom.events.Event import org.w3c.dom.Element import org.w3c.dom.HTMLInputElement -import org.w3c.dom.events.Event +import org.w3c.dom.events.EventListener import org.w3c.dom.get private fun Int.asSpaces(): String { diff --git a/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt b/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt index e8bb905..0bbec8c 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt @@ -7,13 +7,13 @@ import kotlinx.html.Tag import kotlinx.html.TagConsumer import kotlinx.html.Unsafe +import org.w3c.dom.events.Event import org.w3c.dom.Element import org.w3c.dom.HTMLElement import org.w3c.dom.HTMLInputElement import org.w3c.dom.HTMLSpanElement import org.w3c.dom.Node import org.w3c.dom.asList -import org.w3c.dom.events.Event import org.w3c.dom.get private var currentElement: Element? = null @@ -240,7 +240,7 @@ override fun onTagEvent( tag: Tag, event: String, - value: (Event) -> Unit + value: (kotlinx.html.org.w3c.dom.events.Event) -> Unit ) { logReplace { "onTagEvent, ${tag.tagName} [$event, $value]" } @@ -248,7 +248,7 @@ checkTag(tag) } - currentElement?.setKompEvent(event.toLowerCase(), value) + currentElement?.setKompEvent(event.lowercase(), value.asDynamic()) } override fun onTagEnd(tag: Tag) { @@ -395,7 +395,7 @@ currentPosition.nextElement() } - override fun onTagError(tag: Tag, exception: Throwable) { + fun onTagError(tag: Tag, exception: Throwable) { exceptionThrown = true if (exception !is KomponentException) { diff --git a/build.gradle.kts b/build.gradle.kts index 30f2d2c..817e3de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,19 +1,19 @@ plugins { - kotlin("multiplatform") version "1.7.20" + kotlin("multiplatform") version "1.9.0" `maven-publish` signing id("org.jetbrains.dokka") version "1.5.31" } group = "nl.astraeus" -version = "1.0.8-SNAPSHOT" +version = "1.1.1" repositories { mavenCentral() } kotlin { - js(BOTH) { + js(IR) { browser { testTask { useKarma { @@ -26,14 +26,11 @@ sourceSets { val commonMain by getting { dependencies { - implementation(kotlin("stdlib-common")) - - api("org.jetbrains.kotlinx:kotlinx-html:0.7.5") + api("org.jetbrains.kotlinx:kotlinx-html:0.9.1") } } val jsMain by getting { dependencies { - implementation(kotlin("stdlib-js")) } } val jsTest by getting { @@ -71,25 +68,25 @@ maven { name = "releases" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/releases") + setUrl("https://reposilite.astraeus.nl/releases") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { name = "snapshots" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/snapshots") + setUrl("https://reposilite.astraeus.nl/snapshots") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { @@ -136,3 +133,20 @@ signing { sign(publishing.publications) } + +tasks.named("signJsPublication") { + dependsOn(tasks.named("publishKotlinMultiplatformPublicationToMavenLocal")) +} + +tasks.named("publishJsPublicationToReleasesRepository") { + dependsOn(tasks.named("signKotlinMultiplatformPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToMavenLocalRepository") { + dependsOn(tasks.named("signJsPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToReleasesRepository") { + dependsOn(tasks.named("signJsPublication")) +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 982aaee..554856b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Wed Mar 04 13:29:12 CET 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt b/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt index 2fc7d49..8810ef5 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt @@ -1,8 +1,9 @@ package nl.astraeus.komp +import org.w3c.dom.events.Event import org.w3c.dom.Element import org.w3c.dom.HTMLInputElement -import org.w3c.dom.events.Event +import org.w3c.dom.events.EventListener import org.w3c.dom.get private fun Int.asSpaces(): String { diff --git a/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt b/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt index e8bb905..0bbec8c 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt @@ -7,13 +7,13 @@ import kotlinx.html.Tag import kotlinx.html.TagConsumer import kotlinx.html.Unsafe +import org.w3c.dom.events.Event import org.w3c.dom.Element import org.w3c.dom.HTMLElement import org.w3c.dom.HTMLInputElement import org.w3c.dom.HTMLSpanElement import org.w3c.dom.Node import org.w3c.dom.asList -import org.w3c.dom.events.Event import org.w3c.dom.get private var currentElement: Element? = null @@ -240,7 +240,7 @@ override fun onTagEvent( tag: Tag, event: String, - value: (Event) -> Unit + value: (kotlinx.html.org.w3c.dom.events.Event) -> Unit ) { logReplace { "onTagEvent, ${tag.tagName} [$event, $value]" } @@ -248,7 +248,7 @@ checkTag(tag) } - currentElement?.setKompEvent(event.toLowerCase(), value) + currentElement?.setKompEvent(event.lowercase(), value.asDynamic()) } override fun onTagEnd(tag: Tag) { @@ -395,7 +395,7 @@ currentPosition.nextElement() } - override fun onTagError(tag: Tag, exception: Throwable) { + fun onTagError(tag: Tag, exception: Throwable) { exceptionThrown = true if (exception !is KomponentException) { diff --git a/src/jsMain/kotlin/nl/astraeus/komp/MutableCollectionStateDelegate.kt b/src/jsMain/kotlin/nl/astraeus/komp/MutableCollectionStateDelegate.kt index c2743b2..76c63e3 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/MutableCollectionStateDelegate.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/MutableCollectionStateDelegate.kt @@ -31,7 +31,7 @@ } // todo: return iterator wrapper to update at changes? - // override fun iterator(): MutableIterator = collection.iterator() + //override fun iterator(): MutableIterator = collection.iterator() override fun remove(element: T): Boolean { komponent.requestUpdate() diff --git a/build.gradle.kts b/build.gradle.kts index 30f2d2c..817e3de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,19 +1,19 @@ plugins { - kotlin("multiplatform") version "1.7.20" + kotlin("multiplatform") version "1.9.0" `maven-publish` signing id("org.jetbrains.dokka") version "1.5.31" } group = "nl.astraeus" -version = "1.0.8-SNAPSHOT" +version = "1.1.1" repositories { mavenCentral() } kotlin { - js(BOTH) { + js(IR) { browser { testTask { useKarma { @@ -26,14 +26,11 @@ sourceSets { val commonMain by getting { dependencies { - implementation(kotlin("stdlib-common")) - - api("org.jetbrains.kotlinx:kotlinx-html:0.7.5") + api("org.jetbrains.kotlinx:kotlinx-html:0.9.1") } } val jsMain by getting { dependencies { - implementation(kotlin("stdlib-js")) } } val jsTest by getting { @@ -71,25 +68,25 @@ maven { name = "releases" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/releases") + setUrl("https://reposilite.astraeus.nl/releases") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { name = "snapshots" // change to point to your repo, e.g. http://my.org/repo - setUrl("https://nexus.astraeus.nl/nexus/content/repositories/snapshots") + setUrl("https://reposilite.astraeus.nl/snapshots") credentials { - val nexusUsername: String? by project - val nexusPassword: String? by project + val reposiliteUsername: String? by project + val reposilitePassword: String? by project - username = nexusUsername - password = nexusPassword + username = reposiliteUsername + password = reposilitePassword } } maven { @@ -136,3 +133,20 @@ signing { sign(publishing.publications) } + +tasks.named("signJsPublication") { + dependsOn(tasks.named("publishKotlinMultiplatformPublicationToMavenLocal")) +} + +tasks.named("publishJsPublicationToReleasesRepository") { + dependsOn(tasks.named("signKotlinMultiplatformPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToMavenLocalRepository") { + dependsOn(tasks.named("signJsPublication")) +} + +tasks.named("publishKotlinMultiplatformPublicationToReleasesRepository") { + dependsOn(tasks.named("signJsPublication")) +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 982aaee..554856b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Wed Mar 04 13:29:12 CET 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt b/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt index 2fc7d49..8810ef5 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/ElementExtentions.kt @@ -1,8 +1,9 @@ package nl.astraeus.komp +import org.w3c.dom.events.Event import org.w3c.dom.Element import org.w3c.dom.HTMLInputElement -import org.w3c.dom.events.Event +import org.w3c.dom.events.EventListener import org.w3c.dom.get private fun Int.asSpaces(): String { diff --git a/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt b/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt index e8bb905..0bbec8c 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt @@ -7,13 +7,13 @@ import kotlinx.html.Tag import kotlinx.html.TagConsumer import kotlinx.html.Unsafe +import org.w3c.dom.events.Event import org.w3c.dom.Element import org.w3c.dom.HTMLElement import org.w3c.dom.HTMLInputElement import org.w3c.dom.HTMLSpanElement import org.w3c.dom.Node import org.w3c.dom.asList -import org.w3c.dom.events.Event import org.w3c.dom.get private var currentElement: Element? = null @@ -240,7 +240,7 @@ override fun onTagEvent( tag: Tag, event: String, - value: (Event) -> Unit + value: (kotlinx.html.org.w3c.dom.events.Event) -> Unit ) { logReplace { "onTagEvent, ${tag.tagName} [$event, $value]" } @@ -248,7 +248,7 @@ checkTag(tag) } - currentElement?.setKompEvent(event.toLowerCase(), value) + currentElement?.setKompEvent(event.lowercase(), value.asDynamic()) } override fun onTagEnd(tag: Tag) { @@ -395,7 +395,7 @@ currentPosition.nextElement() } - override fun onTagError(tag: Tag, exception: Throwable) { + fun onTagError(tag: Tag, exception: Throwable) { exceptionThrown = true if (exception !is KomponentException) { diff --git a/src/jsMain/kotlin/nl/astraeus/komp/MutableCollectionStateDelegate.kt b/src/jsMain/kotlin/nl/astraeus/komp/MutableCollectionStateDelegate.kt index c2743b2..76c63e3 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/MutableCollectionStateDelegate.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/MutableCollectionStateDelegate.kt @@ -31,7 +31,7 @@ } // todo: return iterator wrapper to update at changes? - // override fun iterator(): MutableIterator = collection.iterator() + //override fun iterator(): MutableIterator = collection.iterator() override fun remove(element: T): Boolean { komponent.requestUpdate() diff --git a/src/jsMain/kotlin/nl/astraeus/komp/State.kt b/src/jsMain/kotlin/nl/astraeus/komp/State.kt index 0be1248..a479204 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/State.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/State.kt @@ -14,8 +14,8 @@ property: KProperty<*>, value: T ) -} +} open class StateDelegate( val komponent: Komponent, @@ -51,6 +51,6 @@ inline fun Komponent.state( initialValue: T ): Delegate = StateDelegate( - this, - initialValue - ) + this, + initialValue +)