Skip to content

Commit a6648b4

Browse files
committed
Migrate Settings plugin to Jewel
1 parent 308ee55 commit a6648b4

File tree

35 files changed

+977
-1037
lines changed

35 files changed

+977
-1037
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package io.github.composegears.valkyrie.extension
2+
3+
import org.gradle.api.artifacts.ModuleDependency
4+
import org.gradle.kotlin.dsl.exclude
5+
6+
fun ModuleDependency.excludeCompose() {
7+
exclude("org.jetbrains.compose")
8+
exclude("org.jetbrains.compose.foundation")
9+
exclude("org.jetbrains.compose.runtime")
10+
exclude("org.jetbrains.compose.ui")
11+
}

sdk/compose/codeviewer/api/codeviewer.api

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ public final class io/github/composegears/valkyrie/sdk/compose/codeviewer/CodeVi
66
public static final fun CodeViewer (Ldev/snipme/highlights/Highlights;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
77
}
88

9-
public final class io/github/composegears/valkyrie/sdk/compose/codeviewer/CommonKt {
10-
public static final fun rememberCodeHighlight (Ljava/lang/String;Z[Ldev/snipme/highlights/model/PhraseLocation;Landroidx/compose/runtime/Composer;I)Ldev/snipme/highlights/Highlights;
11-
}
12-
139
public final class io/github/composegears/valkyrie/sdk/compose/codeviewer/KotlinCodeViewerKt {
1410
public static final fun KotlinCodeViewer (Ljava/lang/String;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V
1511
}

sdk/compose/codeviewer/api/codeviewer.klib.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@
99
final fun io.github.composegears.valkyrie.sdk.compose.codeviewer/CodeEditor(dev.snipme.highlights/Highlights, kotlin/Function1<kotlin/String, kotlin/Unit>, androidx.compose.ui/Modifier?, kotlin/Boolean, kotlin/Boolean, kotlin/Boolean, androidx.compose.ui.text/TextStyle?, kotlin/Function2<androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>?, kotlin/Function2<androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>?, kotlin/Function2<androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>?, kotlin/Function2<androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>?, kotlin/Boolean, androidx.compose.ui.text.input/VisualTransformation?, androidx.compose.foundation.text/KeyboardOptions?, androidx.compose.foundation.text/KeyboardActions?, kotlin/Boolean, kotlin/Int, kotlin/Int, androidx.compose.foundation.interaction/MutableInteractionSource?, androidx.compose.ui.graphics/Shape?, androidx.compose.material3/TextFieldColors?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int) // io.github.composegears.valkyrie.sdk.compose.codeviewer/CodeEditor|CodeEditor(dev.snipme.highlights.Highlights;kotlin.Function1<kotlin.String,kotlin.Unit>;androidx.compose.ui.Modifier?;kotlin.Boolean;kotlin.Boolean;kotlin.Boolean;androidx.compose.ui.text.TextStyle?;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>?;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>?;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>?;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>?;kotlin.Boolean;androidx.compose.ui.text.input.VisualTransformation?;androidx.compose.foundation.text.KeyboardOptions?;androidx.compose.foundation.text.KeyboardActions?;kotlin.Boolean;kotlin.Int;kotlin.Int;androidx.compose.foundation.interaction.MutableInteractionSource?;androidx.compose.ui.graphics.Shape?;androidx.compose.material3.TextFieldColors?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int){}[0]
1010
final fun io.github.composegears.valkyrie.sdk.compose.codeviewer/CodeViewer(dev.snipme.highlights/Highlights, androidx.compose.ui/Modifier?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.github.composegears.valkyrie.sdk.compose.codeviewer/CodeViewer|CodeViewer(dev.snipme.highlights.Highlights;androidx.compose.ui.Modifier?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
1111
final fun io.github.composegears.valkyrie.sdk.compose.codeviewer/KotlinCodeViewer(kotlin/String, androidx.compose.ui/Modifier?, kotlin/Function1<kotlin/String, kotlin/Unit>?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.github.composegears.valkyrie.sdk.compose.codeviewer/KotlinCodeViewer|KotlinCodeViewer(kotlin.String;androidx.compose.ui.Modifier?;kotlin.Function1<kotlin.String,kotlin.Unit>?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
12-
final fun io.github.composegears.valkyrie.sdk.compose.codeviewer/rememberCodeHighlight(kotlin/String, kotlin/Boolean, kotlin/Array<out dev.snipme.highlights.model/PhraseLocation>..., androidx.compose.runtime/Composer?, kotlin/Int): dev.snipme.highlights/Highlights // io.github.composegears.valkyrie.sdk.compose.codeviewer/rememberCodeHighlight|rememberCodeHighlight(kotlin.String;kotlin.Boolean;kotlin.Array<out|dev.snipme.highlights.model.PhraseLocation>...;androidx.compose.runtime.Composer?;kotlin.Int){}[0]

sdk/compose/codeviewer/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/compose/codeviewer/CodeViewer.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import dev.snipme.highlights.Highlights
99
import dev.snipme.highlights.model.PhraseLocation
1010
import io.github.composegears.valkyrie.compose.util.isLight
1111
import io.github.composegears.valkyrie.sdk.compose.highlights.core.buildAnnotatedString
12+
import io.github.composegears.valkyrie.sdk.compose.highlights.core.rememberCodeHighlight
1213

1314
@Composable
1415
fun CodeViewer(

sdk/compose/codeviewer/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/compose/codeviewer/Common.kt

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
public final class io/github/composegears/valkyrie/sdk/compose/highlights/core/CommonKt {
22
public static final fun buildAnnotatedString (Ldev/snipme/highlights/Highlights;)Landroidx/compose/ui/text/AnnotatedString;
33
public static final fun getEmphasisLocations (Ljava/lang/String;Ljava/lang/String;)[Ldev/snipme/highlights/model/PhraseLocation;
4+
public static final fun rememberCodeHighlight (Ljava/lang/String;Z[Ldev/snipme/highlights/model/PhraseLocation;Landroidx/compose/runtime/Composer;I)Ldev/snipme/highlights/Highlights;
45
}
56

sdk/compose/highlights-core/api/highlights-core.klib.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
// Library unique name: <valkyrie.sdk.compose:highlights-core>
99
final fun (dev.snipme.highlights/Highlights).io.github.composegears.valkyrie.sdk.compose.highlights.core/buildAnnotatedString(): androidx.compose.ui.text/AnnotatedString // io.github.composegears.valkyrie.sdk.compose.highlights.core/buildAnnotatedString|[email protected](){}[0]
1010
final fun io.github.composegears.valkyrie.sdk.compose.highlights.core/getEmphasisLocations(kotlin/String, kotlin/String): kotlin/Array<dev.snipme.highlights.model/PhraseLocation> // io.github.composegears.valkyrie.sdk.compose.highlights.core/getEmphasisLocations|getEmphasisLocations(kotlin.String;kotlin.String){}[0]
11+
final fun io.github.composegears.valkyrie.sdk.compose.highlights.core/rememberCodeHighlight(kotlin/String, kotlin/Boolean, kotlin/Array<out dev.snipme.highlights.model/PhraseLocation>..., androidx.compose.runtime/Composer?, kotlin/Int): dev.snipme.highlights/Highlights // io.github.composegears.valkyrie.sdk.compose.highlights.core/rememberCodeHighlight|rememberCodeHighlight(kotlin.String;kotlin.Boolean;kotlin.Array<out|dev.snipme.highlights.model.PhraseLocation>...;androidx.compose.runtime.Composer?;kotlin.Int){}[0]

sdk/compose/highlights-core/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/compose/highlights/core/Common.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.github.composegears.valkyrie.sdk.compose.highlights.core
22

3+
import androidx.compose.runtime.Composable
4+
import androidx.compose.runtime.remember
35
import androidx.compose.ui.graphics.Color
46
import androidx.compose.ui.text.SpanStyle
57
import androidx.compose.ui.text.buildAnnotatedString
@@ -9,6 +11,24 @@ import dev.snipme.highlights.Highlights
911
import dev.snipme.highlights.model.BoldHighlight
1012
import dev.snipme.highlights.model.ColorHighlight
1113
import dev.snipme.highlights.model.PhraseLocation
14+
import dev.snipme.highlights.model.SyntaxLanguage
15+
import dev.snipme.highlights.model.SyntaxThemes
16+
17+
@Composable
18+
fun rememberCodeHighlight(
19+
codeBlock: String,
20+
isLight: Boolean,
21+
vararg emphasisLocation: PhraseLocation,
22+
): Highlights {
23+
return remember(isLight, codeBlock, emphasisLocation) {
24+
Highlights.Builder()
25+
.code(codeBlock)
26+
.language(SyntaxLanguage.KOTLIN)
27+
.theme(SyntaxThemes.darcula(darkMode = !isLight))
28+
.emphasis(*emphasisLocation)
29+
.build()
30+
}
31+
}
1232

1333
fun Highlights.buildAnnotatedString() = buildAnnotatedString {
1434
append(getCode())

tools/idea-plugin/build.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import io.github.composegears.valkyrie.extension.excludeCompose
12
import io.github.composegears.valkyrie.task.CheckComposeVersionCompatibility
23
import org.jetbrains.changelog.Changelog
34
import org.jetbrains.intellij.platform.gradle.extensions.excludeKotlinStdlib
@@ -168,11 +169,3 @@ tasks {
168169
dependsOn(checkComposeVersionCompatibility)
169170
}
170171
}
171-
172-
173-
fun ModuleDependency.excludeCompose() {
174-
exclude("org.jetbrains.compose")
175-
exclude("org.jetbrains.compose.foundation")
176-
exclude("org.jetbrains.compose.runtime")
177-
exclude("org.jetbrains.compose.ui")
178-
}

tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/icons/PlayForward.kt

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)