v. 0.5.12 - fix child index in refresh
Took 4 minutes
This commit is contained in:
@@ -4,7 +4,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "nl.astraeus"
|
group = "nl.astraeus"
|
||||||
version = "0.5.9-SNAPSHOT"
|
version = "0.5.12"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module external.linked.project.id="komp:commonMain" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.type="sourceSet" external.system.module.version="0.5.8-SNAPSHOT" type="JAVA_MODULE" version="4">
|
<module external.linked.project.id="komp:commonMain" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.type="sourceSet" external.system.module.version="0.5.9-SNAPSHOT" type="JAVA_MODULE" version="4">
|
||||||
<component name="FacetManager">
|
<component name="FacetManager">
|
||||||
<facet type="kotlin-language" name="Kotlin">
|
<facet type="kotlin-language" name="Kotlin">
|
||||||
<configuration version="3" platform="Common (experimental) " allPlatforms="JS []/JVM [1.8]/Native []/Native [general]" useProjectSettings="false" isTestModule="false" externalProjectId="komp">
|
<configuration version="3" platform="Common (experimental) " allPlatforms="JS []/JVM [1.8]/Native []/Native [general]" useProjectSettings="false" isTestModule="false" externalProjectId="komp">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module external.linked.project.id="komp:commonTest" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.type="sourceSet" external.system.module.version="0.5.8-SNAPSHOT" type="JAVA_MODULE" version="4">
|
<module external.linked.project.id="komp:commonTest" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.type="sourceSet" external.system.module.version="0.5.9-SNAPSHOT" type="JAVA_MODULE" version="4">
|
||||||
<component name="FacetManager">
|
<component name="FacetManager">
|
||||||
<facet type="kotlin-language" name="Kotlin">
|
<facet type="kotlin-language" name="Kotlin">
|
||||||
<configuration version="3" platform="Common (experimental) " allPlatforms="JS []/JVM [1.8]/Native []/Native [general]" useProjectSettings="false" isTestModule="true" externalProjectId="komp">
|
<configuration version="3" platform="Common (experimental) " allPlatforms="JS []/JVM [1.8]/Native []/Native [general]" useProjectSettings="false" isTestModule="true" externalProjectId="komp">
|
||||||
|
|||||||
2
komp.iml
2
komp.iml
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module external.linked.project.id="komp" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.version="0.5.8-SNAPSHOT" type="JAVA_MODULE" version="4">
|
<module external.linked.project.id="komp" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.version="0.5.9-SNAPSHOT" type="JAVA_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
|
|||||||
17
komp.ipr
17
komp.ipr
@@ -109,6 +109,12 @@
|
|||||||
<element id="module-output" name="komp.jsMain" />
|
<element id="module-output" name="komp.jsMain" />
|
||||||
</root>
|
</root>
|
||||||
</artifact>
|
</artifact>
|
||||||
|
<artifact type="jar" name="komp-jslegacy-0.5.9-SNAPSHOT">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="komp-jslegacy-0.5.9-SNAPSHOT.jar">
|
||||||
|
<element id="module-output" name="komp.jsMain" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
</component>
|
</component>
|
||||||
<component name="CheckStyle-IDEA">
|
<component name="CheckStyle-IDEA">
|
||||||
<option name="configuration">
|
<option name="configuration">
|
||||||
@@ -316,9 +322,6 @@
|
|||||||
<H2CodeStyleSettings version="6">
|
<H2CodeStyleSettings version="6">
|
||||||
<option name="USE_GENERAL_STYLE" value="false" />
|
<option name="USE_GENERAL_STYLE" value="false" />
|
||||||
</H2CodeStyleSettings>
|
</H2CodeStyleSettings>
|
||||||
<H2CodeStyleSettings version="6">
|
|
||||||
<option name="USE_GENERAL_STYLE" value="false" />
|
|
||||||
</H2CodeStyleSettings>
|
|
||||||
<JavaCodeStyleSettings>
|
<JavaCodeStyleSettings>
|
||||||
<option name="ANNOTATION_PARAMETER_WRAP" value="5" />
|
<option name="ANNOTATION_PARAMETER_WRAP" value="5" />
|
||||||
<option name="ALIGN_MULTILINE_ANNOTATION_PARAMETERS" value="true" />
|
<option name="ALIGN_MULTILINE_ANNOTATION_PARAMETERS" value="true" />
|
||||||
@@ -432,13 +435,6 @@
|
|||||||
<option name="url" value="https://jcenter.bintray.com/" />
|
<option name="url" value="https://jcenter.bintray.com/" />
|
||||||
</remote-repository>
|
</remote-repository>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunConfigurationProducerService">
|
|
||||||
<option name="ignoredProducers">
|
|
||||||
<set>
|
|
||||||
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="RunManager">
|
<component name="RunManager">
|
||||||
<configuration default="true" type="Applet" factoryName="Applet">
|
<configuration default="true" type="Applet" factoryName="Applet">
|
||||||
<option name="WIDTH" value="400" />
|
<option name="WIDTH" value="400" />
|
||||||
@@ -502,7 +498,6 @@
|
|||||||
<mapping directory="" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
<component name="accountSettings">
|
<component name="accountSettings">
|
||||||
<option name="activeRegion" value="us-east-1" />
|
|
||||||
<option name="recentlyUsedRegions">
|
<option name="recentlyUsedRegions">
|
||||||
<list>
|
<list>
|
||||||
<option value="us-east-1" />
|
<option value="us-east-1" />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module external.linked.project.id="komp:jsMain" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.type="sourceSet" external.system.module.version="0.5.8-SNAPSHOT" type="JAVA_MODULE" version="4">
|
<module external.linked.project.id="komp:jsMain" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.type="sourceSet" external.system.module.version="0.5.9-SNAPSHOT" type="JAVA_MODULE" version="4">
|
||||||
<component name="FacetManager">
|
<component name="FacetManager">
|
||||||
<facet type="kotlin-language" name="Kotlin">
|
<facet type="kotlin-language" name="Kotlin">
|
||||||
<configuration version="3" platform="JavaScript " allPlatforms="JS []" useProjectSettings="false" isTestModule="false" externalProjectId="komp">
|
<configuration version="3" platform="JavaScript " allPlatforms="JS []" useProjectSettings="false" isTestModule="false" externalProjectId="komp">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module external.linked.project.id="komp:jsTest" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.type="sourceSet" external.system.module.version="0.5.8-SNAPSHOT" type="JAVA_MODULE" version="4">
|
<module external.linked.project.id="komp:jsTest" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="nl.astraeus" external.system.module.type="sourceSet" external.system.module.version="0.5.9-SNAPSHOT" type="JAVA_MODULE" version="4">
|
||||||
<component name="FacetManager">
|
<component name="FacetManager">
|
||||||
<facet type="kotlin-language" name="Kotlin">
|
<facet type="kotlin-language" name="Kotlin">
|
||||||
<configuration version="3" platform="JavaScript " allPlatforms="JS []" useProjectSettings="false" isTestModule="true" externalProjectId="komp">
|
<configuration version="3" platform="JavaScript " allPlatforms="JS []" useProjectSettings="false" isTestModule="true" externalProjectId="komp">
|
||||||
|
|||||||
@@ -272,11 +272,11 @@ class HtmlBuilder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onTagStart(tag: Tag) {
|
override fun onTagStart(tag: Tag) {
|
||||||
//logReplace"onTagStart, [${tag.tagName}, ${tag.namespace}], currentPosition: $currentPosition")
|
logReplace("onTagStart, [${tag.tagName}, ${tag.namespace}], currentPosition: $currentPosition")
|
||||||
currentNode = currentPosition.currentElement()
|
currentNode = currentPosition.currentElement()
|
||||||
|
|
||||||
if (currentNode == null) {
|
if (currentNode == null) {
|
||||||
//logReplace"onTagStart, currentNode1: $currentNode")
|
logReplace("onTagStart, currentNode1: $currentNode")
|
||||||
currentNode = if (tag.namespace != null) {
|
currentNode = if (tag.namespace != null) {
|
||||||
document.createElementNS(tag.namespace, tag.tagName)
|
document.createElementNS(tag.namespace, tag.tagName)
|
||||||
} else {
|
} else {
|
||||||
@@ -292,8 +292,8 @@ class HtmlBuilder(
|
|||||||
!currentNode?.asElement()?.namespaceURI.equals(tag.namespace, true)
|
!currentNode?.asElement()?.namespaceURI.equals(tag.namespace, true)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
//logReplace"onTagStart, currentElement, namespace: ${currentNode?.asElement()?.namespaceURI} -> ${tag.namespace}")
|
logReplace("onTagStart, currentElement, namespace: ${currentNode?.asElement()?.namespaceURI} -> ${tag.namespace}")
|
||||||
//logReplace"onTagStart, currentElement, replace: ${currentNode?.asElement()?.tagName} -> ${tag.tagName}")
|
logReplace("onTagStart, currentElement, replace: ${currentNode?.asElement()?.tagName} -> ${tag.tagName}")
|
||||||
currentNode = if (tag.namespace != null) {
|
currentNode = if (tag.namespace != null) {
|
||||||
document.createElementNS(tag.namespace, tag.tagName)
|
document.createElementNS(tag.namespace, tag.tagName)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -114,8 +114,8 @@ abstract class Komponent {
|
|||||||
|
|
||||||
val parent = currentElement.parentElement as? HTMLElement ?: error("parent is null!?")
|
val parent = currentElement.parentElement as? HTMLElement ?: error("parent is null!?")
|
||||||
var childIndex = 0
|
var childIndex = 0
|
||||||
for (index in 0 until parent.children.length) {
|
for (index in 0 until parent.childNodes.length) {
|
||||||
if (parent.children[index] == currentElement) {
|
if (parent.childNodes[index] == currentElement) {
|
||||||
childIndex = index
|
childIndex = index
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@ abstract class Komponent {
|
|||||||
var logReplaceEvent = false
|
var logReplaceEvent = false
|
||||||
var unsafeMode = UnsafeMode.UNSAFE_DISABLED
|
var unsafeMode = UnsafeMode.UNSAFE_DISABLED
|
||||||
|
|
||||||
fun create(parent: HTMLElement, component: Komponent, insertAsFirst: Boolean = false) {
|
fun create(parent: HTMLElement, component: Komponent) {
|
||||||
component.create(parent)
|
component.create(parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user