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