Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ai-driver-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ application {

kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xcontext-parameters")
optIn.addAll("kotlin.time.ExperimentalTime")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,22 +372,22 @@ internal object AppWebSocketHandler : WebSocketHandler<PathSpec0, Unit>,
}

// Standard WebSocketHandler methods — unused because DirectExecutableWebSocketHandler takes priority
context(_: ServerRuntime)
context(serverRuntime: ServerRuntime)
override suspend fun willConnect(request: WebSocketConnectRequest<PathSpec0>) = Unit

context(_: WebSocketConnection<PathSpec0, Unit>)
context(connection: WebSocketConnection<PathSpec0, Unit>)
override suspend fun didConnect() {
}

context(_: WebSocketConnection<PathSpec0, Unit>)
context(connection: WebSocketConnection<PathSpec0, Unit>)
override suspend fun messageFromClient(frame: WebSocketFrame) {
}

context(_: WebSocketConnection<PathSpec0, Unit>)
context(connection: WebSocketConnection<PathSpec0, Unit>)
override suspend fun messageFromSubscription(topic: WebSocketSubscriptionMessage<*, *>) {
}

context(_: WebSocketConnection<PathSpec0, Unit>)
context(connection: WebSocketConnection<PathSpec0, Unit>)
override suspend fun disconnect(reason: WebSocketClose) {
}
}
Expand Down
18 changes: 13 additions & 5 deletions example-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,23 @@ kotlin {
if (onMac) {
iosArm64()
iosSimulatorArm64()
targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>().configureEach {
compilations.configureEach {
compileTaskProvider.configure {
compilerOptions {
optIn.add("kotlinx.cinterop.BetaInteropApi")
optIn.add("kotlinx.cinterop.ExperimentalForeignApi")
}
}
}
}
}
js(IR) {
js {
binaries.executable()
browser()
}
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
optIn.add("kotlinx.cinterop.BetaInteropApi")
optIn.add("kotlinx.cinterop.ExperimentalForeignApi")
optIn.add("kotlin.time.ExperimentalTime")
optIn.add("kotlin.uuid.ExperimentalUuidApi")
}
Expand Down Expand Up @@ -197,7 +205,7 @@ android {
}

fun env(name: String, profile: String) {
tasks.create("deployWeb${name}Init", Exec::class.java) {
tasks.register("deployWeb${name}Init", Exec::class.java) {
group = "deploy"
this.dependsOn("jsBundleProduction")
this.environment("AWS_PROFILE", "$profile")
Expand All @@ -209,7 +217,7 @@ fun env(name: String, profile: String) {
this.args("init")
this.workingDir = file("terraform/$name")
}
tasks.create("deployWeb${name}", Exec::class.java) {
tasks.register("deployWeb${name}", Exec::class.java) {
group = "deploy"
this.dependsOn("deployWeb${name}Init")
this.environment("AWS_PROFILE", "$profile")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.lightningkite.mppexampleapp

import com.lightningkite.kiteui.Build
import com.lightningkite.kiteui.Routable
import com.lightningkite.kiteui.UnsafeModifier
import com.lightningkite.kiteui.models.Icon
import com.lightningkite.kiteui.navigation.Page
import com.lightningkite.kiteui.reactive.Action
Expand Down Expand Up @@ -29,6 +30,7 @@ import kotlin.time.Duration.Companion.milliseconds
@Routable("/")
class HomePage : Page {
override val title: Reactive<String> get() = Constant("KiteUI")
@OptIn(UnsafeModifier::class)
override fun ElementWriter.CanAddTheme.render(): Unit = run {
return withUnsafeModifiers().scrolling.article {
centered.h1("KiteUI - Beautiful by Default")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1324,24 +1324,20 @@ object CheatSheet : DocPage {
}
titledSection("Other (not yet categorized)") {
example(
name = "forEach",
name = "colOfExpensive",
description = "",
code = """
val fruits = listOf("Apples", "Oranges", "Plums", "Bananas", "Cherries")

col {
forEach(remember { fruits }) { fruit ->
card.text(fruit)
}
colOfExpensive(remember { fruits }) { fruit ->
card.text(fruit)
}
""".trimIndent(),
result = {
val fruits = listOf("Apples", "Oranges", "Plums", "Bananas", "Cherries")

col {
forEach(remember { fruits }) { fruit ->
card.text(fruit)
}
colOfExpensive(remember { fruits }) { fruit ->
card.text(fruit)
}
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ object CustomComponentsPage : DocPage {
shownWhen { showDialog() } - confirmDialog(
message = "Are you sure?",
onConfirm = {
toast("Confirmed!")
context.toast("Confirmed!")
showDialog.value = false
},
onCancel = {
Expand Down Expand Up @@ -226,7 +226,7 @@ object CustomComponentsPage : DocPage {
shownWhen { showDialog() }.confirmDialog(
message = "Are you sure?",
onConfirm = {
toast("Confirmed!")
context.toast("Confirmed!")
showDialog.value = false
},
onCancel = {
Expand Down Expand Up @@ -379,7 +379,7 @@ object CustomComponentsPage : DocPage {
userListItem(
name = user.name,
email = user.email,
onClick = { pageNavigator.navigate(UserPage(user.id)) }
onClick = { context.pageNavigator.navigate(UserPage(user.id)) }
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ object DataLoadingPatternsPage : DocPage {
val currentTime = Signal(Clock.System.now())

// Update every 5 seconds
reactiveScope {
reactive {
launch {
while (true) {
delay(5000)
Expand Down Expand Up @@ -375,7 +375,7 @@ object DataLoadingPatternsPage : DocPage {
items
}

reactiveScope {
reactive {
// Append new items to list
allItems.value = allItems() + newItems()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object DataPage : DocPage {
"Signal",
"PersistentProperty",
"remember",
"reactiveScope",
"reactive",
"reactivity",
"::prop { }",
"launch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ object DocSearchPage : Page {
}
}
}
expanding.onNext(ListSemantic).recyclerView {
expanding.themed(ListSemantic).recyclerView {
paddingByEdge = Edges(
left = 0.rem,
top = 0.rem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ object FormsAndValidationPage : DocPage {
// Debounce username check
var checkJob: Job? = null

reactiveScope {
reactive {
val currentUsername = username()
checkJob?.cancel()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ object GettingStartedPage : DocPage {
button {
text("Go to Cheat Sheet")
onClick {
pageNavigator.navigate(CheatSheet)
context.pageNavigator.navigate(CheatSheet)
}
}
""".trimIndent()
Expand Down Expand Up @@ -312,7 +312,7 @@ object GettingStartedPage : DocPage {
code {
content = """
// Navigate with parameter
pageNavigator.navigate(UserDetailPage("123"))
context.pageNavigator.navigate(UserDetailPage("123"))
""".trimIndent()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lightningkite.mppexampleapp.docs

import com.lightningkite.kiteui.InternalKiteUi
import com.lightningkite.kiteui.Routable
import com.lightningkite.kiteui.models.*
import com.lightningkite.kiteui.reactive.*
Expand Down Expand Up @@ -334,29 +335,29 @@ object LayoutPage : DocPage {
text("Sometimes you have a fairly small list of data that you want to display.")
example("""
val strings = Signal(listOf("First", "Second", "Third", "Fourth"))
col {
forEach(strings) {
text { content = it }
}
colOfExpensive(strings) {
text { content = it }
}
""".trimIndent()) {
val strings = Signal(listOf("First", "Second", "Third", "Fourth"))
col {
forEach(strings) {
text { content = it }
}
colOfExpensive(strings) {
text { content = it }
}
}
text("Have a small dataset that needs to scroll add the scrolling\nor scrollingHorizontally view modifiers.")
example("""
sizeConstraints(height = 10.rem).scrolling.col {
val strings = Signal((0..20).toList().map { "String ${'$'}it" })
@OptIn(InternalKiteUi::class)
@Suppress("DEPRECATION")
forEach(strings) { string ->
text { content = string }
}
}""".trimIndent()) {
sizeConstraints(height = 10.rem).scrolling.col {
val strings = Signal((0..20).toList().map { "String $it" })
@OptIn(InternalKiteUi::class)
@Suppress("DEPRECATION")
forEach(strings) { string ->
text { content = string }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ object MaterialIconLibraryPage : Page {
.toList()
}.toReactive()

val filtered: Reactive<List<String>> = shared {
val filtered: Reactive<List<String>> = remember {
val q = searchText().trim().lowercase()
if (q.isEmpty()) allIcons() else allIcons().filter { it.contains(q) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ object MultiplatformPage : DocPage {
Platform.Web -> {
// Browser back button works automatically
// Deep linking just works
pageNavigator.navigate(DetailPage(id = "123"))
context.pageNavigator.navigate(DetailPage(id = "123"))
}
else -> {
// Mobile: Stack-based navigation
pageNavigator.navigate(DetailPage(id = "123"))
context.pageNavigator.navigate(DetailPage(id = "123"))
// Back button pops navigation stack
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object NavigationPage: DocPage {
"""
button {
onClick {
pageNavigator.navigate(DocSearchPage)
context.pageNavigator.navigate(DocSearchPage)
}
centered.row {
centered.icon(Icon.arrowBack, "Back")
Expand All @@ -77,7 +77,7 @@ object NavigationPage: DocPage {
) {
button {
onClick {
pageNavigator.navigate(DocSearchPage)
context.pageNavigator.navigate(DocSearchPage)
}
centered.row {
centered.icon(Icon.arrowBack, "Back")
Expand All @@ -91,7 +91,7 @@ object NavigationPage: DocPage {
col {
button {
onClick {
pageNavigator.goBack()
context.pageNavigator.goBack()
}
row {
centered.icon(Icon.arrowBack, "Back")
Expand All @@ -100,7 +100,7 @@ object NavigationPage: DocPage {
}
button {
onClick {
pageNavigator.replace(DocSearchPage)
context.pageNavigator.replace(DocSearchPage)
}
row {
centered.icon(Icon.arrowBack, "Back")
Expand All @@ -109,7 +109,7 @@ object NavigationPage: DocPage {
}
button {
onClick {
pageNavigator.reset(DocSearchPage)
context.pageNavigator.reset(DocSearchPage)
}
row {
centered.icon(Icon.arrowBack, "Back")
Expand All @@ -122,7 +122,7 @@ object NavigationPage: DocPage {
col {
button {
onClick {
pageNavigator.goBack()
context.pageNavigator.goBack()
}
row {
centered.icon(Icon.arrowBack, "Back")
Expand All @@ -131,7 +131,7 @@ object NavigationPage: DocPage {
}
button {
onClick {
pageNavigator.replace(DocSearchPage)
context.pageNavigator.replace(DocSearchPage)
}
row {
centered.icon(Icon.arrowBack, "Back")
Expand All @@ -140,7 +140,7 @@ object NavigationPage: DocPage {
}
button {
onClick {
pageNavigator.reset(DocSearchPage)
context.pageNavigator.reset(DocSearchPage)
}
row {
centered.icon(Icon.arrowBack, "Back")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.lightningkite.kiteui.views.ViewWriter
import com.lightningkite.kiteui.views.direct.*
import com.lightningkite.kiteui.views.l2.RecyclerViewPlacerVerticalGrid
import com.lightningkite.kiteui.views.l2.children
import com.lightningkite.kiteui.views.l2.Recycler2
import com.lightningkite.reactive.core.*

@Routable("docs/recyclerView")
Expand Down Expand Up @@ -93,7 +94,7 @@ object RecyclerViewPage : DocPage {
h2("Scrolling to a Specific Item")
text("You can programmatically scroll to a specific item in the recyclerView:")
example("""
var recyclerView: RecyclerView? = null
var recyclerView: Recycler2? = null
col {
button {
text("Scroll to Item 10")
Expand All @@ -110,7 +111,7 @@ object RecyclerViewPage : DocPage {
}
}
""".trimIndent()) {
var recyclerView: RecyclerView? = null
var recyclerView: Recycler2? = null
col {
button {
text("Scroll to Item 10")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ object ResourcesPage: DocPage {
backgroundAudio(Resources.audioTaunt, 0.1f) { isPlaying() }
""".trimIndent()) {
val soundEffectPool = SoundEffectPool()
val playing = Property(false)
val status = Property("Click a button to play audio")
val playing = Signal(false)
val status = Signal("Click a button to play audio")
col {
row {
expanding.button {
Expand Down
Loading
Loading