Shagen Ogandzhanian
3 years ago
committed by
GitHub
73 changed files with 185 additions and 105 deletions
@ -1,33 +1,34 @@
|
||||
package org.jetbrains.compose.common.core.graphics |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
public data class Color(val red: Int, val green: Int, val blue: Int) { |
||||
|
||||
companion object { |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Black = Color(0, 0, 0) |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val DarkGray = Color(0x44, 0x44, 0x44) |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Gray = Color(0x88, 0x88, 0x88) |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val LightGray = Color(0xCC, 0xCC, 0xCC) |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val White = Color(0xFF, 0xFF, 0xFF) |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Red = Color(0xFF, 0, 0) |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Green = Color(0, 0xFF, 0) |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Blue = Color(0, 0, 0xFF) |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Yellow = Color(0xFF, 0xFF, 0x00) |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Cyan = Color(0, 0xFF, 0xFF) |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Magenta = Color(0xFF, 0, 0xFF) |
||||
} |
||||
} |
||||
|
@ -1,20 +1,21 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
interface Modifier { |
||||
open class Element : Modifier |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
companion object : Element() |
||||
} |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.background(color: Color): Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.padding(all: Dp): Modifier |
||||
|
@ -0,0 +1,8 @@
|
||||
/* |
||||
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. |
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. |
||||
*/ |
||||
|
||||
package org.jetbrains.compose.annotations |
||||
|
||||
const val webWidgetsDeprecationMessage = "compose.web.web-widgets API is deprecated" |
@ -1,9 +1,10 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Modifier.size(size: Dp): Modifier { |
||||
return size(size, size) |
||||
} |
||||
|
@ -1,11 +1,12 @@
|
||||
package jetbrains.compose.common.shapes |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
interface Shape |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
object CircleShape : Shape |
||||
|
@ -1,10 +1,11 @@
|
||||
package org.jetbrains.compose.common.foundation |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.core.graphics.Color |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.border(size: Dp, color: Color): Modifier |
||||
|
@ -1,8 +1,9 @@
|
||||
package org.jetbrains.compose.common.foundation |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.clickable(onClick: () -> Unit): Modifier |
||||
|
@ -1,8 +1,9 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.fillMaxHeight(fraction: Float): Modifier |
||||
|
@ -1,8 +1,9 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.fillMaxWidth(): Modifier |
||||
|
@ -1,9 +1,10 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.offset(x: Dp, y: Dp): Modifier |
||||
|
@ -1,11 +1,12 @@
|
||||
package org.jetbrains.compose.common.ui.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
import org.jetbrains.compose.common.ui.unit.IntSize |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.onSizeChanged( |
||||
onSizeChanged: (IntSize) -> Unit |
||||
): Modifier |
||||
|
@ -1,7 +1,8 @@
|
||||
package org.jetbrains.compose.common.ui |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.size(width: Dp, height: Dp): Modifier |
||||
|
@ -1,9 +1,10 @@
|
||||
package org.jetbrains.compose.common.foundation.layout |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import org.jetbrains.compose.common.ui.unit.Dp |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
expect fun Modifier.width(size: Dp): Modifier |
||||
|
@ -1,7 +1,8 @@
|
||||
package org.jetbrains.compose.common.ui.unit |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
data class Dp(val value: Float) |
||||
|
@ -1,7 +1,8 @@
|
||||
package org.jetbrains.compose.common.ui.unit |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
data class IntSize(val width: Int, val height: Int) |
||||
|
@ -1,29 +1,30 @@
|
||||
package org.jetbrains.compose.common.ui.unit |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
|
||||
// TODO: this have to be in a separate package otherwise there's an error for in cross-module usage (for JVM target) |
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Int.dp: Dp |
||||
get() = Dp(this.toFloat()) |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Int.em: TextUnit |
||||
get() = TextUnit(toFloat(), TextUnitType.Em) |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Float.em: TextUnit |
||||
get() = TextUnit(this, TextUnitType.Em) |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Int.sp: TextUnit |
||||
get() = TextUnit(toFloat(), TextUnitType.Sp) |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Float.sp: TextUnit |
||||
get() = TextUnit(this, TextUnitType.Sp) |
||||
|
@ -1,9 +1,10 @@
|
||||
package org.jetbrains.compose.common.core.graphics |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import androidx.compose.ui.graphics.Color as JColor |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Color.implementation |
||||
get() = JColor(red, green, blue) |
||||
|
@ -1,18 +1,19 @@
|
||||
package org.jetbrains.compose.common.internal |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import androidx.compose.ui.Modifier as JModifier |
||||
import org.jetbrains.compose.common.ui.Modifier |
||||
|
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
private class ModifierElement : JModifier.Element |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
class ActualModifier : Modifier { |
||||
var modifier: JModifier = ModifierElement() |
||||
} |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
fun Modifier.castOrCreate(): ActualModifier = (this as? ActualModifier) ?: ActualModifier() |
||||
|
@ -1,9 +1,10 @@
|
||||
package org.jetbrains.compose.common.ui.unit |
||||
|
||||
import org.jetbrains.compose.annotations.webWidgetsDeprecationMessage |
||||
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi |
||||
import androidx.compose.ui.unit.Dp as JDp |
||||
|
||||
@ExperimentalComposeWebWidgetsApi |
||||
@Deprecated(message = "compose.web.web-widgets API is deprecated") |
||||
@Deprecated(message = webWidgetsDeprecationMessage) |
||||
val Dp.implementation: JDp |
||||
get() = JDp(value) |
||||
|
Loading…
Reference in new issue