forked from kscience/visionforge
1.9.20-Beta
This commit is contained in:
parent
ba70af3a24
commit
35ec4bac0e
@ -2,7 +2,6 @@ package space.kscience.visionforge.gdml.demo
|
||||
|
||||
import drop.FileDrop
|
||||
import kotlinx.css.*
|
||||
import kotlinx.css.properties.border
|
||||
import org.w3c.files.FileList
|
||||
import react.RBuilder
|
||||
import styled.css
|
||||
@ -13,7 +12,7 @@ import styled.styledDiv
|
||||
fun RBuilder.fileDrop(title: String, action: (files: FileList?) -> Unit) {
|
||||
styledDiv {
|
||||
css {
|
||||
border(style = BorderStyle.dashed, width = 1.px, color = Color.orange)
|
||||
border = Border(style = BorderStyle.dashed, width = 1.px, color = Color.orange)
|
||||
flexGrow = 0.0
|
||||
alignContent = Align.center
|
||||
}
|
||||
|
@ -43,8 +43,8 @@ private class JsPlaygroundApp : Application {
|
||||
createRoot(element).render {
|
||||
styledDiv {
|
||||
css {
|
||||
padding(0.pt)
|
||||
margin(0.pt)
|
||||
padding = Padding(0.pt)
|
||||
margin = Margin(0.pt)
|
||||
height = 100.vh
|
||||
width = 100.vw
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
import kotlinx.css.*
|
||||
import kotlinx.css.properties.border
|
||||
import kotlinx.dom.clear
|
||||
import kotlinx.html.dom.append
|
||||
import org.intellij.markdown.flavours.commonmark.CommonMarkFlavourDescriptor
|
||||
@ -45,10 +44,10 @@ val Markup = fc<MarkupProps>("Markup") { props ->
|
||||
css {
|
||||
width = 100.pct
|
||||
height = 100.pct
|
||||
border(2.pt, BorderStyle.solid, Color.blue)
|
||||
padding(left = 8.pt)
|
||||
border= Border(2.pt, BorderStyle.solid, Color.blue)
|
||||
padding = Padding(left = 8.pt)
|
||||
backgroundColor = Color.white
|
||||
flex(1.0)
|
||||
flex = Flex(1.0)
|
||||
zIndex = 10000
|
||||
}
|
||||
ref = elementRef
|
||||
|
@ -1,5 +1,4 @@
|
||||
import kotlinx.css.*
|
||||
import kotlinx.css.properties.border
|
||||
import org.w3c.dom.Element
|
||||
import org.w3c.dom.HTMLElement
|
||||
import react.*
|
||||
@ -30,8 +29,8 @@ val Plotly = fc<PlotlyProps>("Plotly") { props ->
|
||||
css {
|
||||
width = 100.pct
|
||||
height = 100.pct
|
||||
border(2.pt, BorderStyle.solid, Color.blue)
|
||||
flex(1.0)
|
||||
border = Border(2.pt, BorderStyle.solid, Color.blue)
|
||||
flex = Flex(1.0)
|
||||
}
|
||||
ref = elementRef
|
||||
}
|
||||
|
@ -8,6 +8,6 @@ org.gradle.jvmargs=-Xmx4G
|
||||
|
||||
org.jetbrains.compose.experimental.jscanvas.enabled=true
|
||||
|
||||
toolsVersion=0.15.0-kotlin-1.9.20-Beta
|
||||
#kotlin.experimental.tryK2=true
|
||||
toolsVersion=0.15.0-kotlin-1.9.20-Beta2
|
||||
kotlin.experimental.tryK2=true
|
||||
#kscience.wasm.disabled=true
|
||||
|
@ -1,8 +1,8 @@
|
||||
package space.kscience.visionforge.bootstrap
|
||||
|
||||
public fun useBootstrap(){
|
||||
kotlinext.js.require("bootstrap/dist/css/bootstrap.min.css")
|
||||
kotlinext.js.require("bootstrap")
|
||||
kotlinext.js.require<dynamic>("bootstrap/dist/css/bootstrap.min.css")
|
||||
kotlinext.js.require<dynamic>("bootstrap")
|
||||
}
|
||||
|
||||
//public inline fun TagConsumer<HTMLElement>.card(title: String, crossinline block: TagConsumer<HTMLElement>.() -> Unit) {
|
||||
|
@ -2,11 +2,7 @@ package space.kscience.visionforge.bootstrap
|
||||
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.css.BorderStyle
|
||||
import kotlinx.css.Color
|
||||
import kotlinx.css.padding
|
||||
import kotlinx.css.properties.border
|
||||
import kotlinx.css.px
|
||||
import kotlinx.css.*
|
||||
import kotlinx.html.js.onClickFunction
|
||||
import org.w3c.dom.events.Event
|
||||
import org.w3c.files.Blob
|
||||
@ -29,7 +25,7 @@ private fun saveData(event: Event, fileName: String, mimeType: String = "text/pl
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
val fileSaver = kotlinext.js.require("file-saver")
|
||||
val fileSaver = kotlinext.js.require<dynamic>("file-saver")
|
||||
val blob = Blob(arrayOf(dataBuilder()), BlobPropertyBag("$mimeType;charset=utf-8"))
|
||||
fileSaver.saveAs(blob, fileName)
|
||||
}
|
||||
@ -53,8 +49,8 @@ public val CanvasControls: FC<CanvasControlsProps> = fc("CanvasControls") { prop
|
||||
flexColumn {
|
||||
flexRow {
|
||||
css {
|
||||
border(1.px, BorderStyle.solid, Color.blue)
|
||||
padding(4.px)
|
||||
border = Border(1.px, BorderStyle.solid, Color.blue)
|
||||
padding = Padding(4.px)
|
||||
}
|
||||
props.vision?.let { vision ->
|
||||
button {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package space.kscience.visionforge.bootstrap
|
||||
|
||||
import kotlinx.css.*
|
||||
import kotlinx.css.properties.border
|
||||
import react.FC
|
||||
import react.PropsWithChildren
|
||||
import react.RBuilder
|
||||
@ -33,13 +32,13 @@ public val ThreeControls: FC<ThreeControlsProps> = fc { props ->
|
||||
}
|
||||
tab("Tree") {
|
||||
css {
|
||||
border(1.px, BorderStyle.solid, Color.lightGray)
|
||||
padding(10.px)
|
||||
border = Border(1.px, BorderStyle.solid, Color.lightGray)
|
||||
padding = Padding(10.px)
|
||||
}
|
||||
h2 { +"Object tree" }
|
||||
styledDiv {
|
||||
css {
|
||||
flex(1.0, 1.0, FlexBasis.inherit)
|
||||
flex = Flex(1.0, 1.0, FlexBasis.inherit)
|
||||
}
|
||||
props.vision?.let {
|
||||
visionTree(it, props.selected, props.onSelect)
|
||||
|
@ -130,7 +130,7 @@ public val ThreeCanvasWithControls: FC<ThreeCanvasWithControlsProps> = fc("Three
|
||||
css {
|
||||
height = 100.pct
|
||||
minWidth = 600.px
|
||||
flex(10.0, 1.0, FlexBasis("600px"))
|
||||
flex = Flex(10.0, 1.0, FlexBasis("600px"))
|
||||
position = Position.relative
|
||||
}
|
||||
|
||||
@ -199,11 +199,11 @@ public val ThreeCanvasWithControls: FC<ThreeCanvasWithControlsProps> = fc("Three
|
||||
}
|
||||
flexColumn {
|
||||
css {
|
||||
padding(4.px)
|
||||
padding = Padding(4.px)
|
||||
minWidth = 400.px
|
||||
height = 100.pct
|
||||
overflowY = Overflow.auto
|
||||
flex(1.0, 10.0, FlexBasis("300px"))
|
||||
flex = Flex(1.0, 10.0, FlexBasis("300px"))
|
||||
}
|
||||
ringThreeControls(options, solid, selected, onSelect, additionalTabs = props.additionalTabs)
|
||||
}
|
||||
|
@ -2,11 +2,7 @@ package space.kscience.visionforge.ring
|
||||
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.css.BorderStyle
|
||||
import kotlinx.css.Color
|
||||
import kotlinx.css.padding
|
||||
import kotlinx.css.properties.border
|
||||
import kotlinx.css.px
|
||||
import kotlinx.css.*
|
||||
import kotlinx.html.js.onClickFunction
|
||||
import org.w3c.dom.events.Event
|
||||
import org.w3c.files.Blob
|
||||
@ -34,7 +30,7 @@ internal fun saveData(event: Event, fileName: String, mimeType: String = "text/p
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
val fileSaver = kotlinext.js.require("file-saver")
|
||||
val fileSaver = kotlinext.js.require<dynamic>("file-saver")
|
||||
val blob = Blob(arrayOf(dataBuilder()), BlobPropertyBag("$mimeType;charset=utf-8"))
|
||||
fileSaver.saveAs(blob, fileName)
|
||||
}
|
||||
@ -58,8 +54,8 @@ internal val CanvasControls: FC<CanvasControlsProps> = fc("CanvasControls") { pr
|
||||
flexColumn {
|
||||
flexRow {
|
||||
css {
|
||||
border(1.px, BorderStyle.solid, Color.blue)
|
||||
padding(4.px)
|
||||
border = Border(1.px, BorderStyle.solid, Color.blue)
|
||||
padding = Padding(4.px)
|
||||
}
|
||||
props.vision?.let { vision ->
|
||||
button {
|
||||
|
Loading…
Reference in New Issue
Block a user