diff --git a/build.gradle.kts b/build.gradle.kts index 1a69f7e..df10d06 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,12 +1,12 @@ plugins { - kotlin("multiplatform") version "1.6.10" + kotlin("multiplatform") version "1.7.20" `maven-publish` signing id("org.jetbrains.dokka") version "1.5.31" } group = "nl.astraeus" -version = "1.0.7-SNAPSHOT" +version = "1.0.7" repositories { mavenCentral() diff --git a/build.gradle.kts b/build.gradle.kts index 1a69f7e..df10d06 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,12 +1,12 @@ plugins { - kotlin("multiplatform") version "1.6.10" + kotlin("multiplatform") version "1.7.20" `maven-publish` signing id("org.jetbrains.dokka") version "1.5.31" } group = "nl.astraeus" -version = "1.0.7-SNAPSHOT" +version = "1.0.7" repositories { mavenCentral() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 191b356..982aaee 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.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/build.gradle.kts b/build.gradle.kts index 1a69f7e..df10d06 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,12 +1,12 @@ plugins { - kotlin("multiplatform") version "1.6.10" + kotlin("multiplatform") version "1.7.20" `maven-publish` signing id("org.jetbrains.dokka") version "1.5.31" } group = "nl.astraeus" -version = "1.0.7-SNAPSHOT" +version = "1.0.7" repositories { mavenCentral() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 191b356..982aaee 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.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt b/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt index a363bbb..e8bb905 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt @@ -74,7 +74,10 @@ private fun ArrayList.replace(new: Node) { if (this.currentElement() != null) { - this.currentElement()?.parentElement?.replaceChild(new, this.currentElement()!!) + this.currentElement()?.parentElement?.replaceChild( + new, + this.currentElement()!! + ) } else { this.last().parent.appendChild(new) } @@ -104,7 +107,9 @@ ) { currentPosition.replace(komponent.element!!) if (Komponent.logRenderEvent) { - console.log("Skipped include $komponent, memoize hasn't changed") + console.log( + "Skipped include $komponent, memoize hasn't changed" + ) } } else { komponent.create( @@ -140,7 +145,9 @@ } override fun onTagStart(tag: Tag) { - logReplace { "onTagStart, [${tag.tagName}, ${tag.namespace}], currentPosition: $currentPosition" } + logReplace { + "onTagStart, [${tag.tagName}, ${tag.namespace}], currentPosition: $currentPosition" + } currentNode = currentPosition.currentElement() @@ -161,8 +168,12 @@ !currentNode?.asElement()?.namespaceURI.equals(tag.namespace, true) ) ) { - logReplace { "onTagStart, currentElement, namespace: ${currentNode?.asElement()?.namespaceURI} -> ${tag.namespace}" } - logReplace { "onTagStart, currentElement, replace: ${currentNode?.asElement()?.tagName} -> ${tag.tagName}" } + logReplace { + "onTagStart, currentElement, namespace: ${currentNode?.asElement()?.namespaceURI} -> ${tag.namespace}" + } + logReplace { + "onTagStart, currentElement, replace: ${currentNode?.asElement()?.tagName} -> ${tag.tagName}" + } currentNode = if (tag.namespace != null) { document.createElementNS(tag.namespace, tag.tagName) @@ -207,7 +218,11 @@ } } - override fun onTagAttributeChange(tag: Tag, attribute: String, value: String?) { + override fun onTagAttributeChange( + tag: Tag, + attribute: String, + value: String? + ) { logReplace { "onTagAttributeChange, ${tag.tagName} [$attribute, $value]" } if (Komponent.enableAssertions) { @@ -222,14 +237,18 @@ } } - override fun onTagEvent(tag: Tag, event: String, value: (Event) -> Unit) { + override fun onTagEvent( + tag: Tag, + event: String, + value: (Event) -> Unit + ) { logReplace { "onTagEvent, ${tag.tagName} [$event, $value]" } if (Komponent.enableAssertions) { checkTag(tag) } - currentElement?.setKompEvent(event.lowercase(), value) + currentElement?.setKompEvent(event.toLowerCase(), value) } override fun onTagEnd(tag: Tag) { @@ -347,7 +366,10 @@ //logReplace"onTagContentUnsafe, namespace: [$namespace]") if (Komponent.unsafeMode == UnsafeMode.UNSAFE_ALLOWED || - (Komponent.unsafeMode == UnsafeMode.UNSAFE_SVG_ONLY && namespace == "http://www.w3.org/2000/svg") + ( + Komponent.unsafeMode == UnsafeMode.UNSAFE_SVG_ONLY && + namespace == "http://www.w3.org/2000/svg" + ) ) { if (currentElement?.innerHTML != textContent) { currentElement?.innerHTML += textContent @@ -413,7 +435,9 @@ override fun finalize(): Element { //logReplace"finalize, currentPosition: $currentPosition") - return root ?: throw IllegalStateException("We can't finalize as there was no tags") + return root ?: throw IllegalStateException( + "We can't finalize as there was no tags" + ) } companion object {