From 3edb00b6bfe298e1d29829f1e9ce7f59f68f4779 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 28 Oct 2020 22:11:28 +0300 Subject: [PATCH] Remove bootstrap from solid --- build.gradle.kts | 2 +- demo/gdml/build.gradle.kts | 7 ++--- .../vision/gdml/demo/GDMLAppComponent.kt | 29 +++++++++---------- demo/muon-monitor/build.gradle.kts | 2 +- .../mipt/npm/muon/monitor/MMAppComponent.kt | 20 +++++++------ gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 6 ++-- ui/bootstrap/build.gradle.kts | 1 + .../vision/bootstrap}/outputConfig.kt | 7 ++--- ui/react/build.gradle.kts | 4 +-- .../dataforge/vision/react/ConfigEditor.kt | 19 ++++++------ .../hep/dataforge/vision/react/MetaViewer.kt | 2 +- .../hep/dataforge/vision/react/ObjectTree.kt | 8 ++--- .../hep/dataforge/vision/react/react.kt | 24 ++++----------- visionforge-core/build.gradle.kts | 2 +- visionforge-gdml/build.gradle.kts | 2 +- .../dataforge/vision/gdml/GDMLTransformer.kt | 23 +++++++-------- visionforge-solid/build.gradle.kts | 1 - .../hep/dataforge/vision/solid/ConvexTest.kt | 2 +- .../solid/three/ThreeCanvasComponent.kt | 4 +-- 20 files changed, 75 insertions(+), 92 deletions(-) rename {visionforge-solid/src/jsMain/kotlin/hep/dataforge/vision/solid/three => ui/bootstrap/src/main/kotlin/hep/dataforge/vision/bootstrap}/outputConfig.kt (97%) diff --git a/build.gradle.kts b/build.gradle.kts index f2a94902..bc20d61f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { id("ru.mipt.npm.project") } -val dataforgeVersion by extra("0.2.0-dev-3") +val dataforgeVersion by extra("0.2.0-dev-4") val ktorVersion by extra("1.4.1") allprojects { diff --git a/demo/gdml/build.gradle.kts b/demo/gdml/build.gradle.kts index 1824345c..82e03364 100644 --- a/demo/gdml/build.gradle.kts +++ b/demo/gdml/build.gradle.kts @@ -14,11 +14,8 @@ kscience { } kotlin { - jvm { - afterEvaluate { - withJava() - } + withJava() } sourceSets { commonMain { @@ -37,7 +34,7 @@ kotlin { } application { - mainClassName = "hep.dataforge.vision.gdml.demo.GdmlFxDemoAppKt" + mainClass.set("hep.dataforge.vision.gdml.demo.GdmlFxDemoAppKt") } val convertGdmlToJson by tasks.creating(JavaExec::class) { diff --git a/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt index 4b9a4e0d..8624f141 100644 --- a/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt +++ b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt @@ -9,14 +9,10 @@ import hep.dataforge.vision.bootstrap.* import hep.dataforge.vision.gdml.toVision import hep.dataforge.vision.react.component import hep.dataforge.vision.react.objectTree -import hep.dataforge.vision.react.state import hep.dataforge.vision.solid.Solid import hep.dataforge.vision.solid.SolidGroup -import hep.dataforge.vision.solid.specifications.Camera -import hep.dataforge.vision.solid.specifications.Canvas3DOptions import hep.dataforge.vision.solid.three.ThreeCanvas import hep.dataforge.vision.solid.three.ThreeCanvasComponent -import hep.dataforge.vision.solid.three.canvasControls import kotlinx.browser.window import kotlinx.css.FlexBasis import kotlinx.css.Overflow @@ -28,8 +24,10 @@ import org.w3c.files.FileReader import org.w3c.files.get import react.RProps import react.dom.h1 +import react.getValue +import react.setValue +import react.useState import styled.css -import kotlin.math.PI external interface GDMLAppProps : RProps { var context: Context @@ -37,18 +35,19 @@ external interface GDMLAppProps : RProps { var selected: Name? } -private val canvasConfig = Canvas3DOptions { - camera = Camera { - distance = 2100.0 - latitude = PI / 6 - azimuth = PI + PI / 6 - } -} +//private val canvasConfig = Canvas3DOptions { +// camera = Camera { +// distance = 2100.0 +// latitude = PI / 6 +// azimuth = PI + PI / 6 +// } +//} +@JsExport val GDMLApp = component { props -> - var selected by state { props.selected } - var canvas: ThreeCanvas? by state { null } - var vision: Vision? by state { props.rootObject } + var selected by useState { props.selected } + var canvas: ThreeCanvas? by useState { null } + var vision: Vision? by useState { props.rootObject } val select: (Name?) -> Unit = { selected = it diff --git a/demo/muon-monitor/build.gradle.kts b/demo/muon-monitor/build.gradle.kts index 3e0cb8d9..1f44169d 100644 --- a/demo/muon-monitor/build.gradle.kts +++ b/demo/muon-monitor/build.gradle.kts @@ -55,7 +55,7 @@ kotlin { } application { - mainClassName = "ru.mipt.npm.muon.monitor.server.MMServerKt" + mainClass.set("ru.mipt.npm.muon.monitor.server.MMServerKt") } distributions { diff --git a/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMAppComponent.kt b/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMAppComponent.kt index a4540ebd..d492b325 100644 --- a/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMAppComponent.kt +++ b/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMAppComponent.kt @@ -6,16 +6,15 @@ import hep.dataforge.names.NameToken import hep.dataforge.names.isEmpty import hep.dataforge.names.length import hep.dataforge.vision.Vision +import hep.dataforge.vision.bootstrap.canvasControls import hep.dataforge.vision.bootstrap.card import hep.dataforge.vision.react.component import hep.dataforge.vision.react.configEditor import hep.dataforge.vision.react.objectTree -import hep.dataforge.vision.react.state import hep.dataforge.vision.solid.specifications.Camera import hep.dataforge.vision.solid.specifications.Canvas3DOptions import hep.dataforge.vision.solid.three.ThreeCanvas import hep.dataforge.vision.solid.three.ThreeCanvasComponent -import hep.dataforge.vision.solid.three.canvasControls import io.ktor.client.HttpClient import io.ktor.client.request.get import kotlinx.coroutines.GlobalScope @@ -23,6 +22,9 @@ import kotlinx.coroutines.launch import kotlinx.html.js.onClickFunction import react.RProps import react.dom.* +import react.getValue +import react.setValue +import react.useState import kotlin.math.PI external interface MMAppProps : RProps { @@ -42,14 +44,14 @@ private val canvasConfig = Canvas3DOptions { @JsExport val MMApp = component { props -> - var selected by state { props.selected } - var canvas: ThreeCanvas? by state { null } + var selected by useState { props.selected } + var canvas: ThreeCanvas? by useState { null } val select: (Name?) -> Unit = { selected = it } - val visual = props.model.root + val root = props.model.root div("row") { h1("mx-auto") { @@ -60,7 +62,7 @@ val MMApp = component { props -> div("col-lg-3 px-0 overflow-auto") { //tree card("Object tree") { - objectTree(visual, selected, select) + objectTree(root, selected, select) } } div("col-lg-6") { @@ -68,7 +70,7 @@ val MMApp = component { props -> child(ThreeCanvasComponent::class) { attrs { this.context = props.context - this.obj = visual + this.obj = root this.options = canvasConfig this.selected = selected this.clickCallback = select @@ -153,8 +155,8 @@ val MMApp = component { props -> selected.let { selected -> val selectedObject: Vision? = when { selected == null -> null - selected.isEmpty() -> visual - else -> visual[selected] + selected.isEmpty() -> root + else -> root[selected] } if (selectedObject != null) { configEditor(selectedObject, default = selectedObject.getAllProperties(), key = selected) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 12d38de6..be52383e 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-6.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 40fcab11..65690060 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,9 +1,9 @@ pluginManagement { - val kotlinVersion = "1.4.20-M1" - val toolsVersion = "0.6.3-dev-1.4.20-M1" + val kotlinVersion = "1.4.20-M2" + val toolsVersion = "0.6.4-dev-1.4.20-M2" repositories { - mavenLocal() +// mavenLocal() jcenter() gradlePluginPortal() maven("https://dl.bintray.com/kotlin/kotlin-eap") diff --git a/ui/bootstrap/build.gradle.kts b/ui/bootstrap/build.gradle.kts index b2400d0c..1cdd834d 100644 --- a/ui/bootstrap/build.gradle.kts +++ b/ui/bootstrap/build.gradle.kts @@ -5,5 +5,6 @@ plugins { val dataforgeVersion: String by rootProject.extra dependencies{ + api(project(":visionforge-solid")) api(project(":ui:react")) } \ No newline at end of file diff --git a/visionforge-solid/src/jsMain/kotlin/hep/dataforge/vision/solid/three/outputConfig.kt b/ui/bootstrap/src/main/kotlin/hep/dataforge/vision/bootstrap/outputConfig.kt similarity index 97% rename from visionforge-solid/src/jsMain/kotlin/hep/dataforge/vision/solid/three/outputConfig.kt rename to ui/bootstrap/src/main/kotlin/hep/dataforge/vision/bootstrap/outputConfig.kt index f4e65da1..b6326979 100644 --- a/visionforge-solid/src/jsMain/kotlin/hep/dataforge/vision/solid/three/outputConfig.kt +++ b/ui/bootstrap/src/main/kotlin/hep/dataforge/vision/bootstrap/outputConfig.kt @@ -1,11 +1,11 @@ -package hep.dataforge.vision.solid.three +package hep.dataforge.vision.bootstrap import hep.dataforge.js.requireJS import hep.dataforge.meta.DFExperimental -import hep.dataforge.vision.bootstrap.accordion -import hep.dataforge.vision.bootstrap.entry import hep.dataforge.vision.solid.SolidGroup import hep.dataforge.vision.solid.SolidManager +import hep.dataforge.vision.solid.three.ThreeCanvas +import kotlinx.dom.clear import kotlinx.html.* import kotlinx.html.dom.append import kotlinx.html.js.onChangeFunction @@ -21,7 +21,6 @@ import react.dom.button import react.dom.div import react.dom.input import react.dom.label -import kotlin.dom.clear private fun saveData(event: Event, fileName: String, mimeType: String = "text/plain", dataBuilder: () -> String) { event.stopPropagation(); diff --git a/ui/react/build.gradle.kts b/ui/react/build.gradle.kts index 3fb049b5..8d541ffd 100644 --- a/ui/react/build.gradle.kts +++ b/ui/react/build.gradle.kts @@ -2,13 +2,13 @@ plugins { id("ru.mipt.npm.js") } -val reactVersion by extra("16.13.1") +val reactVersion by extra("17.0.0") dependencies{ api(project(":visionforge-core")) //api("org.jetbrains:kotlin-react:16.13.1-pre.104-kotlin-1.3.72") - api("org.jetbrains:kotlin-react-dom:$reactVersion-pre.123-kotlin-1.4.10") + api("org.jetbrains:kotlin-react-dom:$reactVersion-pre.126-kotlin-1.4.10") api(npm("react", reactVersion)) api(npm("react-dom", reactVersion)) diff --git a/ui/react/src/main/kotlin/hep/dataforge/vision/react/ConfigEditor.kt b/ui/react/src/main/kotlin/hep/dataforge/vision/react/ConfigEditor.kt index 6669f491..8c749d47 100644 --- a/ui/react/src/main/kotlin/hep/dataforge/vision/react/ConfigEditor.kt +++ b/ui/react/src/main/kotlin/hep/dataforge/vision/react/ConfigEditor.kt @@ -42,11 +42,11 @@ private val ConfigEditorItem: FunctionalComponent = compo } private fun RFBuilder.configEditorItem(props: ConfigEditorItemProps) { - var expanded: Boolean by state { true } - var item: MetaItem? by state { props.root[props.name] } + var expanded: Boolean by useState { true } + var item: MetaItem? by useState { props.root[props.name] } val descriptorItem: ItemDescriptor? = props.descriptor?.get(props.name) val defaultItem = props.default?.get(props.name) - var actualItem: MetaItem? by state { item ?: defaultItem ?: descriptorItem?.defaultItem() } + var actualItem: MetaItem? by useState { item ?: defaultItem ?: descriptorItem?.defaultItem() } val token = props.name.lastOrNull()?.toString() ?: "Properties" @@ -191,13 +191,14 @@ private fun RFBuilder.configEditorItem(props: ConfigEditorItemProps) { } public external interface ConfigEditorProps : RProps { - var id: Name - var root: Config - var default: Meta? - var descriptor: NodeDescriptor? + public var id: Name + public var root: Config + public var default: Meta? + public var descriptor: NodeDescriptor? } -val ConfigEditor = component { props -> +@JsExport +public val ConfigEditor: FunctionalComponent = component { props -> child(ConfigEditorItem) { attrs { this.key = "" @@ -209,7 +210,7 @@ val ConfigEditor = component { props -> } } -fun Element.configEditor(config: Config, descriptor: NodeDescriptor? = null, default: Meta? = null, key: Any? = null) { +public fun Element.configEditor(config: Config, descriptor: NodeDescriptor? = null, default: Meta? = null, key: Any? = null) { render(this) { child(ConfigEditor) { attrs { diff --git a/ui/react/src/main/kotlin/hep/dataforge/vision/react/MetaViewer.kt b/ui/react/src/main/kotlin/hep/dataforge/vision/react/MetaViewer.kt index 48e49a19..fbf6dcc5 100644 --- a/ui/react/src/main/kotlin/hep/dataforge/vision/react/MetaViewer.kt +++ b/ui/react/src/main/kotlin/hep/dataforge/vision/react/MetaViewer.kt @@ -39,7 +39,7 @@ private val MetaViewerItem: FunctionalComponent = component { p } private fun RFBuilder.metaViewerItem(props: MetaViewerProps) { - var expanded: Boolean by state { true } + var expanded: Boolean by useState { true } val item = props.root[props.name] val descriptorItem: ItemDescriptor? = props.descriptor?.get(props.name) val actualItem = item ?: descriptorItem?.defaultItem() diff --git a/ui/react/src/main/kotlin/hep/dataforge/vision/react/ObjectTree.kt b/ui/react/src/main/kotlin/hep/dataforge/vision/react/ObjectTree.kt index 91760b4a..053569d7 100644 --- a/ui/react/src/main/kotlin/hep/dataforge/vision/react/ObjectTree.kt +++ b/ui/react/src/main/kotlin/hep/dataforge/vision/react/ObjectTree.kt @@ -13,10 +13,10 @@ import react.* import styled.* public external interface ObjectTreeProps : RProps { - var name: Name - var selected: Name? - var obj: Vision - var clickCallback: (Name) -> Unit + public var name: Name + public var selected: Name? + public var obj: Vision + public var clickCallback: (Name) -> Unit } private fun RFBuilder.objectTree(props: ObjectTreeProps): Unit { diff --git a/ui/react/src/main/kotlin/hep/dataforge/vision/react/react.kt b/ui/react/src/main/kotlin/hep/dataforge/vision/react/react.kt index 718a21b7..a0e2c787 100644 --- a/ui/react/src/main/kotlin/hep/dataforge/vision/react/react.kt +++ b/ui/react/src/main/kotlin/hep/dataforge/vision/react/react.kt @@ -1,16 +1,14 @@ package hep.dataforge.vision.react import react.* -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty -class RFBuilder : RBuilder() +public class RFBuilder : RBuilder() /** * Get functional component from [func] */ -fun

component( - func: RFBuilder.(props: P) -> Unit +public inline fun

component( + crossinline func: RFBuilder.(props: P) -> Unit, ): FunctionalComponent

{ return { props: P -> val nodes = RFBuilder().apply { func(props) }.childList @@ -21,18 +19,6 @@ fun

component( } } } - -fun RFBuilder.state(init: () -> T): ReadWriteProperty = - object : ReadWriteProperty { - val pair = react.useState(init) - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return pair.first - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) { - pair.second(value) - } - } - -fun RFBuilder.memoize(vararg deps: dynamic, builder: () -> T): T = useMemo(builder, deps) +// +//public fun RFBuilder.memoize(vararg deps: dynamic, builder: () -> T): T = useMemo(builder, deps) diff --git a/visionforge-core/build.gradle.kts b/visionforge-core/build.gradle.kts index 546587d2..2bf0b6e0 100644 --- a/visionforge-core/build.gradle.kts +++ b/visionforge-core/build.gradle.kts @@ -31,7 +31,7 @@ kotlin { //api("org.jetbrains:kotlin-extensions:1.0.1-pre.105-kotlin-1.3.72") //api("org.jetbrains:kotlin-css-js:1.0.0-pre.105-kotlin-1.3.72") - api("org.jetbrains:kotlin-styled:5.2.0-pre.123-kotlin-1.4.10") + api("org.jetbrains:kotlin-styled:5.2.0-pre.126-kotlin-1.4.10") api(npm("core-js", "2.6.5")) api(npm("inline-style-prefixer", "5.1.0")) diff --git a/visionforge-gdml/build.gradle.kts b/visionforge-gdml/build.gradle.kts index ebb6a865..d6456b16 100644 --- a/visionforge-gdml/build.gradle.kts +++ b/visionforge-gdml/build.gradle.kts @@ -7,7 +7,7 @@ kotlin { val commonMain by getting { dependencies { api(project(":visionforge-solid")) - api("kscience.gdml:gdml:0.2.0-dev-2") + api("kscience.gdml:gdml:0.2.0-dev-3") } } } diff --git a/visionforge-gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/GDMLTransformer.kt b/visionforge-gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/GDMLTransformer.kt index 3995c92f..1374f70f 100644 --- a/visionforge-gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/GDMLTransformer.kt +++ b/visionforge-gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/GDMLTransformer.kt @@ -7,7 +7,6 @@ import hep.dataforge.names.Name import hep.dataforge.names.asName import hep.dataforge.names.plus import hep.dataforge.names.toName -import hep.dataforge.vision.MutableVisionGroup import hep.dataforge.vision.set import hep.dataforge.vision.solid.* import hep.dataforge.vision.solid.SolidMaterial.Companion.MATERIAL_COLOR_KEY @@ -20,21 +19,21 @@ import kotlin.random.Random private val solidsName = "solids".asName() private val volumesName = "volumes".asName() -public class GDMLTransformer internal constructor(val root: GDML) { +public class GDMLTransformer internal constructor(public val root: GDML) { //private val materialCache = HashMap() private val random = Random(222) - enum class Action { + public enum class Action { ADD, REJECT, PROTOTYPE } - var lUnit: LUnit = LUnit.MM - var aUnit: AUnit = AUnit.RADIAN + public var lUnit: LUnit = LUnit.MM + public var aUnit: AUnit = AUnit.RADIAN - var solidAction: (GDMLSolid) -> Action = { Action.PROTOTYPE } - var volumeAction: (GDMLGroup) -> Action = { Action.PROTOTYPE } + public var solidAction: (GDMLSolid) -> Action = { Action.PROTOTYPE } + public var volumeAction: (GDMLGroup) -> Action = { Action.PROTOTYPE } /** * A special group for local templates @@ -71,7 +70,7 @@ public class GDMLTransformer internal constructor(val root: GDML) { private val styleCache = HashMap() - var solidConfiguration: Solid.(parent: GDMLVolume, solid: GDMLSolid) -> Unit = { parent, _ -> + public var solidConfiguration: Solid.(parent: GDMLVolume, solid: GDMLSolid) -> Unit = { parent, _ -> lUnit = LUnit.CM if (parent.physVolumes.isNotEmpty()) { useStyle("opaque") { @@ -101,7 +100,7 @@ public class GDMLTransformer internal constructor(val root: GDML) { obj.solidConfiguration(parent, solid) } - var onFinish: GDMLTransformer.() -> Unit = {} + public var onFinish: GDMLTransformer.() -> Unit = {} private fun T.withPosition( @@ -356,13 +355,13 @@ public class GDMLTransformer internal constructor(val root: GDML) { return final } - val result by lazy { + public val result: SolidGroup by lazy { finalize(volume(root.world)) } } -fun GDML.toVision(block: GDMLTransformer.() -> Unit = {}): SolidGroup { +public fun GDML.toVision(block: GDMLTransformer.() -> Unit = {}): SolidGroup { val context = GDMLTransformer(this).apply(block) return context.result } @@ -370,7 +369,7 @@ fun GDML.toVision(block: GDMLTransformer.() -> Unit = {}): SolidGroup { /** * Append gdml node to the group */ -fun SolidGroup.gdml(gdml: GDML, key: String = "", transformer: GDMLTransformer.() -> Unit = {}) { +public fun SolidGroup.gdml(gdml: GDML, key: String = "", transformer: GDMLTransformer.() -> Unit = {}) { val visual = gdml.toVision(transformer) //println(Visual3DPlugin.json.stringify(VisualGroup3D.serializer(), visual)) set(key, visual) diff --git a/visionforge-solid/build.gradle.kts b/visionforge-solid/build.gradle.kts index 7f08e038..aab7e547 100644 --- a/visionforge-solid/build.gradle.kts +++ b/visionforge-solid/build.gradle.kts @@ -29,7 +29,6 @@ kotlin { } jsMain { dependencies { - implementation(project(":ui:bootstrap"))//to be removed later implementation(npm("three", "0.114.0")) implementation(npm("three-csg-ts", "1.0.1")) api(npm("file-saver", "2.0.2")) diff --git a/visionforge-solid/src/commonTest/kotlin/hep/dataforge/vision/solid/ConvexTest.kt b/visionforge-solid/src/commonTest/kotlin/hep/dataforge/vision/solid/ConvexTest.kt index 7da077bd..d2dbc4b3 100644 --- a/visionforge-solid/src/commonTest/kotlin/hep/dataforge/vision/solid/ConvexTest.kt +++ b/visionforge-solid/src/commonTest/kotlin/hep/dataforge/vision/solid/ConvexTest.kt @@ -1,7 +1,7 @@ package hep.dataforge.vision.solid import hep.dataforge.meta.* -import kotlinx.serialization.json.toJson + import kotlin.test.Test import kotlin.test.assertEquals diff --git a/visionforge-solid/src/jsMain/kotlin/hep/dataforge/vision/solid/three/ThreeCanvasComponent.kt b/visionforge-solid/src/jsMain/kotlin/hep/dataforge/vision/solid/three/ThreeCanvasComponent.kt index fbc90a62..ee033817 100644 --- a/visionforge-solid/src/jsMain/kotlin/hep/dataforge/vision/solid/three/ThreeCanvasComponent.kt +++ b/visionforge-solid/src/jsMain/kotlin/hep/dataforge/vision/solid/three/ThreeCanvasComponent.kt @@ -28,7 +28,7 @@ public external interface ThreeCanvasState : RState { } @JsExport -class ThreeCanvasComponent : RComponent() { +public class ThreeCanvasComponent : RComponent() { private var canvas: ThreeCanvas? = null @@ -62,7 +62,7 @@ class ThreeCanvasComponent : RComponent() { } } -fun RBuilder.threeCanvas(object3D: Solid, options: Canvas3DOptions.() -> Unit = {}) { +public fun RBuilder.threeCanvas(object3D: Solid, options: Canvas3DOptions.() -> Unit = {}) { child(ThreeCanvasComponent::class) { attrs { this.obj = object3D