diff --git a/build.gradle.kts b/build.gradle.kts index 68c3569b..775fd191 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,4 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile -import space.kscience.gradle.isInDevelopment import space.kscience.gradle.useApache2Licence import space.kscience.gradle.useSPCTeam @@ -45,14 +44,7 @@ ksciencePublish { useApache2Licence() useSPCTeam() } - github(githubProject = "visionforge", githubOrg = "SciProgCentre") - space( - if (isInDevelopment) { - "https://maven.pkg.jetbrains.space/spc/p/sci/dev" - } else { - "https://maven.pkg.jetbrains.space/spc/p/sci/maven" - } - ) + repository("spc","https://maven.sciprog.center/kscience") sonatype() } diff --git a/demo/js-playground/build.gradle.kts b/demo/js-playground/build.gradle.kts index 94835588..eca736e4 100644 --- a/demo/js-playground/build.gradle.kts +++ b/demo/js-playground/build.gradle.kts @@ -1,19 +1,19 @@ plugins { - id("space.kscience.gradle.js") + id("space.kscience.gradle.mpp") } -kscience{ +kscience { useCoroutines() } -kotlin{ +kotlin { explicitApi = null - js{ + js { useCommonJs() browser { binaries.executable() commonWebpackConfig { - cssSupport{ + cssSupport { enabled.set(false) } } @@ -21,11 +21,15 @@ kotlin{ } } +kscience { -dependencies{ - implementation(projects.visionforge.visionforgeGdml) - implementation(projects.visionforge.visionforgePlotly) - implementation(projects.visionforge.visionforgeMarkdown) - implementation(projects.visionforge.visionforgeThreejs) - implementation(projects.ui.ring) + dependencies { + implementation(projects.visionforge.visionforgeGdml) + implementation(projects.visionforge.visionforgePlotly) + implementation(projects.visionforge.visionforgeMarkdown) + implementation(projects.visionforge.visionforgeThreejs) + } + jsMain { + implementation(projects.ui.ring) + } } \ No newline at end of file diff --git a/demo/js-playground/src/main/kotlin/JsPlaygroundApp.kt b/demo/js-playground/src/jsMain/kotlin/JsPlaygroundApp.kt similarity index 100% rename from demo/js-playground/src/main/kotlin/JsPlaygroundApp.kt rename to demo/js-playground/src/jsMain/kotlin/JsPlaygroundApp.kt diff --git a/demo/js-playground/src/main/kotlin/gravityDemo.kt b/demo/js-playground/src/jsMain/kotlin/gravityDemo.kt similarity index 100% rename from demo/js-playground/src/main/kotlin/gravityDemo.kt rename to demo/js-playground/src/jsMain/kotlin/gravityDemo.kt diff --git a/demo/js-playground/src/main/kotlin/markupComponent.kt b/demo/js-playground/src/jsMain/kotlin/markupComponent.kt similarity index 100% rename from demo/js-playground/src/main/kotlin/markupComponent.kt rename to demo/js-playground/src/jsMain/kotlin/markupComponent.kt diff --git a/demo/js-playground/src/main/kotlin/plotlyComponent.kt b/demo/js-playground/src/jsMain/kotlin/plotlyComponent.kt similarity index 100% rename from demo/js-playground/src/main/kotlin/plotlyComponent.kt rename to demo/js-playground/src/jsMain/kotlin/plotlyComponent.kt diff --git a/demo/js-playground/src/main/resources/index.html b/demo/js-playground/src/jsMain/resources/index.html similarity index 100% rename from demo/js-playground/src/main/resources/index.html rename to demo/js-playground/src/jsMain/resources/index.html diff --git a/gradle.properties b/gradle.properties index dde47c66..a16b8d7b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,6 @@ org.gradle.jvmargs=-Xmx4G org.jetbrains.compose.experimental.jscanvas.enabled=true -toolsVersion=0.14.9-kotlin-1.9.0 -kotlin.experimental.tryK2=true +toolsVersion=0.15.0-kotlin-1.9.20-Beta +#kotlin.experimental.tryK2=true #kscience.wasm.disabled=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84a0b92f..db9a6b82 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/ui/bootstrap/src/jsMain/kotlin/space/kscience/visionforge/bootstrap/outputConfig.kt b/ui/bootstrap/src/jsMain/kotlin/space/kscience/visionforge/bootstrap/outputConfig.kt index a37469ca..3dfba202 100644 --- a/ui/bootstrap/src/jsMain/kotlin/space/kscience/visionforge/bootstrap/outputConfig.kt +++ b/ui/bootstrap/src/jsMain/kotlin/space/kscience/visionforge/bootstrap/outputConfig.kt @@ -8,7 +8,7 @@ import kotlinx.css.padding import kotlinx.css.properties.border import kotlinx.css.px import kotlinx.html.js.onClickFunction -import kotlinx.html.org.w3c.dom.events.Event +import org.w3c.dom.events.Event import org.w3c.files.Blob import org.w3c.files.BlobPropertyBag import react.FC diff --git a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/MetaViewer.kt b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/MetaViewer.kt index d6fff754..651c9d31 100644 --- a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/MetaViewer.kt +++ b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/MetaViewer.kt @@ -3,7 +3,7 @@ package space.kscience.visionforge.react import kotlinx.css.Align import kotlinx.css.alignItems import kotlinx.html.js.onClickFunction -import kotlinx.html.org.w3c.dom.events.Event +import org.w3c.dom.events.Event import react.* import react.dom.a import react.dom.attrs diff --git a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/MultiSelectChooser.kt b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/MultiSelectChooser.kt index 5e8da06c..fc635d21 100644 --- a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/MultiSelectChooser.kt +++ b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/MultiSelectChooser.kt @@ -1,10 +1,10 @@ package space.kscience.visionforge.react import kotlinx.html.js.onChangeFunction -import kotlinx.html.org.w3c.dom.events.Event import org.w3c.dom.HTMLOptionElement import org.w3c.dom.HTMLSelectElement import org.w3c.dom.asList +import org.w3c.dom.events.Event import react.FC import react.dom.attrs import react.dom.option diff --git a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/PropertyEditor.kt b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/PropertyEditor.kt index 991ba2d5..58986076 100644 --- a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/PropertyEditor.kt +++ b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/PropertyEditor.kt @@ -10,7 +10,7 @@ import kotlinx.coroutines.launch import kotlinx.css.* import kotlinx.css.properties.TextDecoration import kotlinx.html.js.onClickFunction -import kotlinx.html.org.w3c.dom.events.Event +import org.w3c.dom.events.Event import react.* import react.dom.attrs import space.kscience.dataforge.meta.MutableMeta @@ -151,7 +151,7 @@ private fun RBuilder.propertyEditorItem(props: PropertyEditorProps) { css { //+TreeStyles.resizeableInput width = 160.px - margin(1.px, 5.px) + margin = Margin(1.px, 5.px) } ValueChooser { attrs { @@ -170,7 +170,7 @@ private fun RBuilder.propertyEditorItem(props: PropertyEditorProps) { css { width = 24.px alignSelf = Align.stretch - margin(1.px, 5.px) + margin = Margin(1.px, 5.px) backgroundColor = Color.white borderStyle = BorderStyle.solid borderRadius = 2.px diff --git a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/RangeValueChooser.kt b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/RangeValueChooser.kt index 3ebe4d51..4a82a6e9 100644 --- a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/RangeValueChooser.kt +++ b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/RangeValueChooser.kt @@ -4,8 +4,9 @@ import kotlinx.css.pct import kotlinx.css.width import kotlinx.html.InputType import kotlinx.html.js.onChangeFunction -import kotlinx.html.org.w3c.dom.events.Event +import kotlinx.html.js.onInputFunction import org.w3c.dom.HTMLInputElement +import org.w3c.dom.events.Event import react.FC import react.dom.attrs import react.fc @@ -58,8 +59,8 @@ public val RangeValueChooser: FC = fc("RangeValueChooser") { attrs { disabled = rangeDisabled value = innerValue?.toString() ?: "" - onChangeFunction = handleChange - consumer.onTagEvent(this, "input", handleChange) +// onChangeFunction = handleChange + onInputFunction = handleChange val minValue = props.descriptor?.attributes?.get("min").string minValue?.let { min = it diff --git a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/TreeStyles.kt b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/TreeStyles.kt index 5d693a3c..109d0256 100644 --- a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/TreeStyles.kt +++ b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/TreeStyles.kt @@ -52,10 +52,10 @@ public object TreeStyles : StyleSheet("treeStyles", true) { } public val treeLabel:RuleSet by css { - border = "none" - padding(left = 4.pt, right = 4.pt, top = 0.pt, bottom = 0.pt) + border = Border.none + padding = Padding(left = 4.pt, right = 4.pt, top = 0.pt, bottom = 0.pt) textAlign = TextAlign.left - flex(1.0) + flex = Flex(1.0) } public val treeLabelInactive: RuleSet by css { diff --git a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/VisionTree.kt b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/VisionTree.kt index 8ec0185c..6212a456 100644 --- a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/VisionTree.kt +++ b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/VisionTree.kt @@ -1,13 +1,10 @@ package space.kscience.visionforge.react -import kotlinx.css.Color -import kotlinx.css.Cursor -import kotlinx.css.color -import kotlinx.css.cursor +import kotlinx.css.* +import kotlinx.css.properties.TextDecoration import kotlinx.css.properties.TextDecorationLine -import kotlinx.css.properties.textDecoration import kotlinx.html.js.onClickFunction -import kotlinx.html.org.w3c.dom.events.Event +import org.w3c.dom.events.Event import react.* import react.dom.attrs import space.kscience.dataforge.names.Name @@ -37,7 +34,7 @@ private val TreeLabel = fc { props -> color = Color("#069") cursor = Cursor.pointer hover { - textDecoration(TextDecorationLine.underline) + textDecoration = TextDecoration(setOf(TextDecorationLine.underline)) } if (props.name == props.selected) { +TreeStyles.treeLabelSelected diff --git a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/valueChooser.kt b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/valueChooser.kt index bc6f1979..5d0c7c3d 100644 --- a/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/valueChooser.kt +++ b/ui/react/src/jsMain/kotlin/space/kscience/visionforge/react/valueChooser.kt @@ -1,15 +1,12 @@ package space.kscience.visionforge.react -import kotlinx.css.margin -import kotlinx.css.pct -import kotlinx.css.px -import kotlinx.css.width +import kotlinx.css.* import kotlinx.html.InputType import kotlinx.html.js.onChangeFunction import kotlinx.html.js.onKeyDownFunction -import kotlinx.html.org.w3c.dom.events.Event import org.w3c.dom.HTMLInputElement import org.w3c.dom.HTMLSelectElement +import org.w3c.dom.events.Event import react.FC import react.Props import react.dom.attrs @@ -145,7 +142,7 @@ public val ColorValueChooser: FC = fc("ColorValueChooser") { styledInput(type = InputType.color) { css { width = 100.pct - margin(0.px) + margin = Margin(0.px) } attrs { this.value = props.value?.let { value -> diff --git a/ui/ring/src/jsMain/kotlin/space.kscience.visionforge.ring/ringThreeControls.kt b/ui/ring/src/jsMain/kotlin/space.kscience.visionforge.ring/ringThreeControls.kt index d59b37b9..6a440e71 100644 --- a/ui/ring/src/jsMain/kotlin/space.kscience.visionforge.ring/ringThreeControls.kt +++ b/ui/ring/src/jsMain/kotlin/space.kscience.visionforge.ring/ringThreeControls.kt @@ -8,7 +8,7 @@ import kotlinx.css.padding import kotlinx.css.properties.border import kotlinx.css.px import kotlinx.html.js.onClickFunction -import kotlinx.html.org.w3c.dom.events.Event +import org.w3c.dom.events.Event import org.w3c.files.Blob import org.w3c.files.BlobPropertyBag import react.FC diff --git a/visionforge-tables/src/jsMain/kotlin/space/kscience/visionforge/tables/TableVisionJsPlugin.kt b/visionforge-tables/src/jsMain/kotlin/space/kscience/visionforge/tables/TableVisionJsPlugin.kt index d61e4664..469d4af8 100644 --- a/visionforge-tables/src/jsMain/kotlin/space/kscience/visionforge/tables/TableVisionJsPlugin.kt +++ b/visionforge-tables/src/jsMain/kotlin/space/kscience/visionforge/tables/TableVisionJsPlugin.kt @@ -25,8 +25,8 @@ public class TableVisionJsPlugin : AbstractPlugin(), ElementVisionRenderer { override fun attach(context: Context) { super.attach(context) - kotlinext.js.require("tabulator-tables/dist/css/tabulator.min.css") - kotlinext.js.require("tabulator-tables/src/js/modules/ResizeColumns/ResizeColumns.js") + kotlinext.js.require("tabulator-tables/dist/css/tabulator.min.css") + kotlinext.js.require("tabulator-tables/src/js/modules/ResizeColumns/ResizeColumns.js") } override fun rateVision(vision: Vision): Int = when (vision) {