Skip to content

Commit

Permalink
Update to 0.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rock3r committed Feb 26, 2024
2 parents 947a718 + cad6cf5 commit 9b8d998
Show file tree
Hide file tree
Showing 19 changed files with 138 additions and 51 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "CodeQL"

on:
push:
branches: [ "main", "*" ]
pull_request:
branches: [ "main", "*" ]
schedule:
- cron: '21 15 * * 0'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: [ 'java-kotlin' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
5 changes: 5 additions & 0 deletions foundation/api/foundation.api
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ public abstract interface class org/jetbrains/jewel/foundation/theme/JewelTheme

public final class org/jetbrains/jewel/foundation/theme/JewelTheme$Companion {
public final fun getContentColor (Landroidx/compose/runtime/Composer;I)J
public final fun getDefaultTextStyle (Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/text/TextStyle;
public final fun getGlobalColors (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/foundation/GlobalColors;
public final fun getGlobalMetrics (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/foundation/GlobalMetrics;
public final fun getTextStyle (Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/text/TextStyle;
Expand Down Expand Up @@ -843,3 +844,7 @@ public final class org/jetbrains/jewel/foundation/theme/ThemeIconData$Companion
public final fun getEmpty ()Lorg/jetbrains/jewel/foundation/theme/ThemeIconData;
}

public final class org/jetbrains/jewel/foundation/util/DebugKt {
public static final fun getInDebugMode ()Z
}

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ public interface JewelTheme {
@ReadOnlyComposable
get() = LocalGlobalMetrics.current

@Deprecated("Use defaultTextStyle instead", ReplaceWith("JewelTheme.defaultTextStyle"), DeprecationLevel.ERROR)
public val textStyle: TextStyle
@Composable
@ReadOnlyComposable
get() = defaultTextStyle

public val defaultTextStyle: TextStyle
@Composable
@ReadOnlyComposable
get() = LocalTextStyle.current
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel.ui.util
package org.jetbrains.jewel.foundation.util

import org.jetbrains.jewel.foundation.InternalJewelApi

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel.foundation.utils
package org.jetbrains.jewel.foundation.util

internal enum class LogLevel(val color: String) {
Trace("\u001b[38;5;33m"),
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ kotlin.stdlib.default.dependency=false
kotlin.incremental.useClasspathSnapshot=false

bridge.ijp.target=233
jewel.release.version=0.14.1
jewel.release.version=0.15.0
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versions]
commonmark = "0.21.0"
composeDesktop = "1.6.0-dev1397"
composeDesktop = "1.6.0-dev1440"
detekt = "1.23.4"
dokka = "1.8.20"
idea = "233.14475.28"
ideaGradlePlugin = "1.17.0"
ideaGradlePlugin = "1.17.1"
jna = "5.14.0"
kotlin = "1.8.21"
kotlinSarif = "0.4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.jetbrains.jewel.ui.component.minus

/**
* The text style to use for regular text. Identical to
* [JewelTheme.textStyle].
* [JewelTheme.defaultTextStyle].
*
* Only available when running in the IntelliJ Platform.
*/
Expand Down
2 changes: 2 additions & 0 deletions samples/ide-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ repositories {
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://www.jetbrains.com/intellij-repository/releases")
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
google()
mavenCentral()

}

dependencies {
Expand Down
5 changes: 0 additions & 5 deletions ui/api/ui.api
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ public final class org/jetbrains/jewel/ui/component/TooltipPlacement : androidx/
public static final field $stable I
public synthetic fun <init> (JLandroidx/compose/ui/Alignment$Horizontal;Landroidx/compose/ui/unit/Density;FILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (JLandroidx/compose/ui/Alignment$Horizontal;Landroidx/compose/ui/unit/Density;FLkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun positionProvider (Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/window/PopupPositionProvider;
public fun positionProvider-9KIMszo (JLandroidx/compose/runtime/Composer;I)Landroidx/compose/ui/window/PopupPositionProvider;
}

Expand Down Expand Up @@ -2361,10 +2360,6 @@ public final class org/jetbrains/jewel/ui/util/ColorExtensionsKt {
public static final fun toRgbaHexString-8_81llA (J)Ljava/lang/String;
}

public final class org/jetbrains/jewel/ui/util/DebugKt {
public static final fun getInDebugMode ()Z
}

public final class org/jetbrains/jewel/ui/util/ModifierExtensionsKt {
public static final fun thenIf (Landroidx/compose/ui/Modifier;ZLkotlin/jvm/functions/Function1;)Landroidx/compose/ui/Modifier;
}
Expand Down
4 changes: 2 additions & 2 deletions ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Button.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public fun DefaultButton(
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
style: ButtonStyle = JewelTheme.defaultButtonStyle,
textStyle: TextStyle = JewelTheme.textStyle,
textStyle: TextStyle = JewelTheme.defaultTextStyle,
content: @Composable RowScope.() -> Unit,
) {
ButtonImpl(
Expand All @@ -70,7 +70,7 @@ public fun OutlinedButton(
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
style: ButtonStyle = JewelTheme.outlinedButtonStyle,
textStyle: TextStyle = JewelTheme.textStyle,
textStyle: TextStyle = JewelTheme.defaultTextStyle,
content: @Composable RowScope.() -> Unit,
) {
ButtonImpl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public fun RadioButton(
outline: Outline = Outline.None,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
style: RadioButtonStyle = JewelTheme.radioButtonStyle,
textStyle: TextStyle = JewelTheme.textStyle,
textStyle: TextStyle = JewelTheme.defaultTextStyle,
) {
RadioButtonImpl(
selected = selected,
Expand All @@ -79,7 +79,7 @@ public fun RadioButtonRow(
outline: Outline = Outline.None,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
style: RadioButtonStyle = JewelTheme.radioButtonStyle,
textStyle: TextStyle = JewelTheme.textStyle,
textStyle: TextStyle = JewelTheme.defaultTextStyle,
) {
RadioButtonImpl(
selected = selected,
Expand All @@ -104,7 +104,7 @@ public fun RadioButtonRow(
outline: Outline = Outline.None,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
style: RadioButtonStyle = JewelTheme.radioButtonStyle,
textStyle: TextStyle = JewelTheme.textStyle,
textStyle: TextStyle = JewelTheme.defaultTextStyle,
content: @Composable RowScope.() -> Unit,
) {
RadioButtonImpl(
Expand Down
4 changes: 2 additions & 2 deletions ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Text.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public fun Text(
softWrap: Boolean = true,
maxLines: Int = Int.MAX_VALUE,
onTextLayout: (TextLayoutResult) -> Unit = {},
style: TextStyle = JewelTheme.textStyle,
style: TextStyle = JewelTheme.defaultTextStyle,
) {
Text(
AnnotatedString(text),
Expand Down Expand Up @@ -77,7 +77,7 @@ public fun Text(
maxLines: Int = Int.MAX_VALUE,
inlineContent: Map<String, InlineTextContent> = emptyMap(),
onTextLayout: (TextLayoutResult) -> Unit = {},
style: TextStyle = JewelTheme.textStyle,
style: TextStyle = JewelTheme.defaultTextStyle,
) {
val textColor = color.takeOrElse { LocalContentColor.current.takeOrElse { style.color } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public fun TextArea(
maxLines: Int = Int.MAX_VALUE,
onTextLayout: (TextLayoutResult) -> Unit = {},
style: TextAreaStyle = JewelTheme.textAreaStyle,
textStyle: TextStyle = JewelTheme.textStyle,
textStyle: TextStyle = JewelTheme.defaultTextStyle,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
) {
var textFieldValueState by remember { mutableStateOf(TextFieldValue(text = value)) }
Expand Down Expand Up @@ -107,7 +107,7 @@ public fun TextArea(
maxLines: Int = Int.MAX_VALUE,
onTextLayout: (TextLayoutResult) -> Unit = {},
style: TextAreaStyle = JewelTheme.textAreaStyle,
textStyle: TextStyle = JewelTheme.textStyle,
textStyle: TextStyle = JewelTheme.defaultTextStyle,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
) {
val minSize = style.metrics.minSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public fun TextField(
keyboardActions: KeyboardActions = KeyboardActions(),
onTextLayout: (TextLayoutResult) -> Unit = {},
style: TextFieldStyle = JewelTheme.textFieldStyle,
textStyle: TextStyle = JewelTheme.textStyle,
textStyle: TextStyle = JewelTheme.defaultTextStyle,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
) {
InputField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,7 @@ public class TooltipPlacement(
) : TooltipPlacement {

@Composable
@Suppress("OVERRIDE_DEPRECATION")
override fun positionProvider(): PopupPositionProvider {
error("Not supported")
}

@Composable
override fun positionProvider(cursorPosition: Offset): PopupPositionProvider =
public override fun positionProvider(cursorPosition: Offset): PopupPositionProvider =
rememberTooltipPositionProvider(
cursorPosition = cursorPosition,
contentOffset = contentOffset,
Expand Down
30 changes: 15 additions & 15 deletions ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Typography.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,61 @@ import org.jetbrains.jewel.foundation.theme.JewelTheme

/**
* A quick way to obtain text styles derived from
* [the default `TextStyle`][JewelTheme.textStyle]. These match the
* [the default `TextStyle`][JewelTheme.defaultTextStyle]. These match the
* functionality provided by `JBFont` in the IntelliJ Platform.
*/
public object Typography {

/** The text style to use for labels. Identical to [JewelTheme.textStyle]. */
/** The text style to use for labels. Identical to [JewelTheme.defaultTextStyle]. */
@Composable
public fun labelTextStyle(): TextStyle = JewelTheme.textStyle
public fun labelTextStyle(): TextStyle = JewelTheme.defaultTextStyle

/**
* The text size to use for labels. Identical to the size set in
* [JewelTheme.textStyle].
* [JewelTheme.defaultTextStyle].
*/
@Composable
public fun labelTextSize(): TextUnit = JewelTheme.textStyle.fontSize
public fun labelTextSize(): TextUnit = JewelTheme.defaultTextStyle.fontSize

/**
* The text style to use for h0 titles. Derived from
* [JewelTheme.textStyle].
* [JewelTheme.defaultTextStyle].
*/
@Composable
public fun h0TextStyle(): TextStyle =
JewelTheme.textStyle.copy(fontSize = labelTextSize() + 12.sp, fontWeight = FontWeight.Bold)
JewelTheme.defaultTextStyle.copy(fontSize = labelTextSize() + 12.sp, fontWeight = FontWeight.Bold)

/**
* The text style to use for h1 titles. Derived from
* [JewelTheme.textStyle].
* [JewelTheme.defaultTextStyle].
*/
@Composable
public fun h1TextStyle(): TextStyle =
JewelTheme.textStyle.copy(fontSize = labelTextSize() + 9.sp, fontWeight = FontWeight.Bold)
JewelTheme.defaultTextStyle.copy(fontSize = labelTextSize() + 9.sp, fontWeight = FontWeight.Bold)

/**
* The text style to use for h2 titles. Derived from
* [JewelTheme.textStyle].
* [JewelTheme.defaultTextStyle].
*/
@Composable
public fun h2TextStyle(): TextStyle =
JewelTheme.textStyle.copy(fontSize = labelTextSize() + 5.sp)
JewelTheme.defaultTextStyle.copy(fontSize = labelTextSize() + 5.sp)

/**
* The text style to use for h3 titles. Derived from
* [JewelTheme.textStyle].
* [JewelTheme.defaultTextStyle].
*/
@Composable
public fun h3TextStyle(): TextStyle =
JewelTheme.textStyle.copy(fontSize = labelTextSize() + 3.sp)
JewelTheme.defaultTextStyle.copy(fontSize = labelTextSize() + 3.sp)

/**
* The text style to use for h4 titles. Derived from
* [JewelTheme.textStyle].
* [JewelTheme.defaultTextStyle].
*/
@Composable
public fun h4TextStyle(): TextStyle =
JewelTheme.textStyle.copy(fontSize = labelTextSize() + 1.sp, fontWeight = FontWeight.Bold)
JewelTheme.defaultTextStyle.copy(fontSize = labelTextSize() + 1.sp, fontWeight = FontWeight.Bold)
}

public operator fun TextUnit.plus(other: TextUnit): TextUnit =
Expand Down
Loading

0 comments on commit 9b8d998

Please sign in to comment.