Skip to content

Commit 6b456b6

Browse files
authored
Move all the code from web w3c source sets to webMain (#2624)
No functional changes here. It's a refactoring to get rid of all "w3c" source set usages. ## Testing N/A ## Release Notes N/A
2 parents 2adccea + 3260a5c commit 6b456b6

File tree

11 files changed

+11
-12
lines changed

11 files changed

+11
-12
lines changed

compose/foundation/foundation/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,10 @@ if (AndroidXComposePlugin.isMultiplatformEnabled(project)) {
148148
resources.srcDir("src/uikitTest/resources")
149149
}
150150
jsMain {
151-
kotlin.srcDir("src/webCommonW3C/kotlin")
152151
dependsOn(webMain)
153152
}
154153

155154
wasmJsMain {
156-
kotlin.srcDir("src/webCommonW3C/kotlin")
157155
dependsOn(webMain)
158156
}
159157

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package androidx.compose.foundation.text
1818

19-
import androidx.compose.foundation.InternalFoundationApi
2019
import androidx.compose.ui.dom.domEventOrNull
2120
import androidx.compose.ui.input.key.KeyEvent
2221
import androidx.compose.ui.input.key.KeyEventType
@@ -25,8 +24,7 @@ import androidx.compose.ui.input.key.isMetaPressed
2524
import androidx.compose.ui.input.key.type
2625
import org.w3c.dom.events.KeyboardEvent
2726

28-
@InternalFoundationApi // TODO: Remove from public at all
29-
actual val KeyEvent.isTypedEvent: Boolean
27+
internal actual val KeyEvent.isTypedEvent: Boolean
3028
get() = type == KeyEventType.KeyDown
3129
&& !isMetaPressed
3230
&& !isCtrlPressed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@
1616

1717
package androidx.compose.foundation.text
1818

19-
internal actual fun timeNowMillis(): Long = kotlinx.browser.window.performance.now().toLong()
19+
import kotlinx.browser.window
20+
21+
internal actual fun timeNowMillis(): Long = window.performance.now().toLong()
2022

compose/material3/material3/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,9 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
144144
webMain.dependsOn(nonJvmMain)
145145

146146
jsMain {
147-
kotlin.srcDir("src/webCommonW3C/kotlin")
148147
dependsOn(webMain)
149148
}
150149
wasmJsMain {
151-
kotlin.srcDir("src/webCommonW3C/kotlin")
152150
dependsOn(webMain)
153151
dependencies {
154152
implementation(libs.kotlinStdlib)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import androidx.compose.material3.CalendarLocale
2222
import androidx.compose.ui.text.intl.Locale
2323
import androidx.compose.ui.util.fastFlatMap
2424
import androidx.compose.ui.util.fastMap
25+
import kotlin.js.definedExternally
26+
import kotlin.js.js
2527
import kotlin.time.ExperimentalTime
2628
import kotlin.time.Instant
2729
import kotlinx.datetime.LocalDate

compose/ui/ui-text/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,10 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
141141
webMain.dependsOn(nonJvmMain)
142142

143143
jsMain {
144-
kotlin.srcDir("src/webCommonW3C/kotlin")
145144
dependsOn(webMain)
146145
}
147146

148147
wasmJsMain {
149-
kotlin.srcDir("src/webCommonW3C/kotlin")
150148
dependsOn(webMain)
151149
dependencies {
152150
implementation(libs.create("skikoWasm"))

compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/PlatformFont.skiko.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import androidx.compose.ui.text.font.GenericFontFamily
3131
import androidx.compose.ui.text.font.LoadedFontFamily
3232
import androidx.compose.ui.text.font.Typeface
3333
import androidx.compose.ui.text.font.createFontFamilyResolver
34-
import androidx.compose.ui.util.fastFilteredMap
3534
import androidx.compose.ui.util.fastMap
3635
import androidx.compose.ui.util.fastMapNotNull
3736
import org.jetbrains.skia.FontMgrWithFallback
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 The Android Open Source Project
2+
* Copyright 2023 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
1717
package androidx.compose.ui.text.intl
1818

1919
import androidx.compose.ui.util.fastMap
20+
import kotlin.js.JsName
21+
import kotlin.js.js
2022

2123
internal actual val PlatformLocale.language: String
2224
get() = _language
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package androidx.compose.ui.text.platform
1919
import androidx.compose.ui.text.PlatformStringDelegate
2020
import androidx.compose.ui.text.intl.PlatformLocale
2121
import androidx.compose.ui.text.intl.language
22+
import kotlin.js.js
2223

2324
/**
2425
* A JS implementation of StringDelegate

0 commit comments

Comments
 (0)