[jewel] Backport Jewel 0.28 APIs to 251

(cherry picked from commit b97a1b1fe496644921108a2ae9aa3eb8e8ff3751)

IJ-MR-160613

GitOrigin-RevId: b7c5f656df1add59f1ff0db3e92a94821c567490
This commit is contained in:
Jakub Senohrabek
2025-04-14 23:58:36 +02:00
committed by intellij-monorepo-bot
parent d908f3affb
commit fe23359282
154 changed files with 2886 additions and 2011 deletions

8
.idea/modules.xml generated
View File

@@ -786,10 +786,10 @@
<module fileurl="file://$PROJECT_DIR$/platform/jewel/int-ui/int-ui-decorated-window/intellij.platform.jewel.intUi.decoratedWindow.iml" filepath="$PROJECT_DIR$/platform/jewel/int-ui/int-ui-decorated-window/intellij.platform.jewel.intUi.decoratedWindow.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/int-ui/int-ui-standalone/intellij.platform.jewel.intUi.standalone.iml" filepath="$PROJECT_DIR$/platform/jewel/int-ui/int-ui-standalone/intellij.platform.jewel.intUi.standalone.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/core/intellij.platform.jewel.markdown.core.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/core/intellij.platform.jewel.markdown.core.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/extension/autolink/intellij.platform.jewel.markdown.extension.autolink.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/extension/autolink/intellij.platform.jewel.markdown.extension.autolink.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/extension/gfm-alerts/intellij.platform.jewel.markdown.extension.gfmAlerts.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/extension/gfm-alerts/intellij.platform.jewel.markdown.extension.gfmAlerts.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/extension/gfm-strikethrough/intellij.platform.jewel.markdown.extension.gfmStrikethrough.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/extension/gfm-strikethrough/intellij.platform.jewel.markdown.extension.gfmStrikethrough.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/extension/gfm-tables/intellij.platform.jewel.markdown.extension.gfmTables.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/extension/gfm-tables/intellij.platform.jewel.markdown.extension.gfmTables.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/extensions/autolink/intellij.platform.jewel.markdown.extensions.autolink.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/extensions/autolink/intellij.platform.jewel.markdown.extensions.autolink.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/extensions/gfm-alerts/intellij.platform.jewel.markdown.extensions.gfmAlerts.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/extensions/gfm-alerts/intellij.platform.jewel.markdown.extensions.gfmAlerts.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/extensions/gfm-strikethrough/intellij.platform.jewel.markdown.extensions.gfmStrikethrough.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/extensions/gfm-strikethrough/intellij.platform.jewel.markdown.extensions.gfmStrikethrough.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/extensions/gfm-tables/intellij.platform.jewel.markdown.extensions.gfmTables.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/extensions/gfm-tables/intellij.platform.jewel.markdown.extensions.gfmTables.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/ide-laf-bridge-styling/intellij.platform.jewel.markdown.ideLafBridgeStyling.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/ide-laf-bridge-styling/intellij.platform.jewel.markdown.ideLafBridgeStyling.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/markdown/int-ui-standalone-styling/intellij.platform.jewel.markdown.intUiStandaloneStyling.iml" filepath="$PROJECT_DIR$/platform/jewel/markdown/int-ui-standalone-styling/intellij.platform.jewel.markdown.intUiStandaloneStyling.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/jewel/samples/ide-plugin/intellij.platform.jewel.samples.idePlugin.iml" filepath="$PROJECT_DIR$/platform/jewel/samples/ide-plugin/intellij.platform.jewel.samples.idePlugin.iml" />

View File

@@ -23,8 +23,9 @@ internal object JewelMavenArtifacts {
"intellij.platform.jewel.foundation" to "jewel-foundation",
"intellij.platform.jewel.markdown.core" to "jewel-markdown-core",
"intellij.platform.jewel.ui" to "jewel-ui",
"intellij.platform.jewel.markdown.extension.gfmTables" to "jewel-markdown-extension-gfm-tables",
"intellij.platform.jewel.markdown.extension.gfmAlerts" to "jewel-markdown-extension-gfm-alerts",
"intellij.platform.jewel.markdown.extensions.gfmTables" to "jewel-markdown-extensions-gfm-tables",
"intellij.platform.jewel.markdown.extensions.gfmStrikethrough" to "jewel-markdown-extensions-gfm-strikethrough",
"intellij.platform.jewel.markdown.extensions.gfmAlerts" to "jewel-markdown-extensions-gfm-alerts",
)
val STANDALONE: Map<String, String> = mapOf(
"intellij.platform.jewel.markdown.intUiStandaloneStyling" to "jewel-markdown-int-ui-standalone-styling",

View File

@@ -1,3 +1,8 @@
### auto-generated section `build intellij.platform.compose.compilerPlugin` start
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "compilerPlugin",
visibility = ["//visibility:public"]
)
### auto-generated section `build intellij.platform.compose.compilerPlugin` end

View File

@@ -5,6 +5,7 @@ import androidx.compose.animation.core.animateDpAsState
import androidx.compose.foundation.*
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.input.rememberTextFieldState
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
@@ -13,7 +14,10 @@ import androidx.compose.ui.draw.shadow
import androidx.compose.ui.focus.focusProperties
import androidx.compose.ui.focus.onFocusEvent
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.key.*
import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.isShiftPressed
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.onKeyEvent
import androidx.compose.ui.input.pointer.PointerIcon
import androidx.compose.ui.input.pointer.pointerHoverIcon
import androidx.compose.ui.unit.dp
@@ -24,8 +28,9 @@ import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory
import com.intellij.openapi.keymap.KeymapUtil
import com.intellij.ui.UIBundle
import com.intellij.util.ui.JBUI
import kotlinx.coroutines.*
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.delay
import kotlinx.coroutines.withContext
import org.jetbrains.jewel.bridge.toComposeColor
import org.jetbrains.jewel.foundation.modifier.onHover
import org.jetbrains.jewel.foundation.theme.JewelTheme
@@ -33,6 +38,7 @@ import org.jetbrains.jewel.foundation.theme.OverrideDarkMode
import org.jetbrains.jewel.ui.Orientation
import org.jetbrains.jewel.ui.Outline
import org.jetbrains.jewel.ui.component.*
import org.jetbrains.jewel.ui.icons.AllIconsKeys
import org.jetbrains.jewel.ui.theme.defaultTabStyle
import org.jetbrains.jewel.ui.theme.tooltipStyle
import org.jetbrains.jewel.ui.util.isDark
@@ -50,25 +56,24 @@ internal fun ComposeShowcase() {
Title()
Text("This is Compose bundled inside IntelliJ Platform!")
Row {
val scrollState = rememberScrollState()
Column(
verticalArrangement = Arrangement.spacedBy(15.dp),
modifier = Modifier.weight(1f).verticalScroll(scrollState)
VerticallyScrollableContainer(
modifier = Modifier.weight(1f)
) {
CheckBox()
RadioButton()
Buttons()
Label()
SelectableText()
Tabs()
LinkLabels()
TextFieldSimple()
TextFieldWithButton()
TooltipAreaSimple()
Column(
verticalArrangement = Arrangement.spacedBy(15.dp),
) {
CheckBox()
RadioButton()
Buttons()
Label()
SelectableText()
Tabs()
LinkLabels()
TextFieldSimple()
TextFieldWithButton()
TooltipAreaSimple()
}
}
val adapter = rememberScrollbarAdapter(scrollState)
androidx.compose.foundation.VerticalScrollbar(adapter)
}
}
}
@@ -176,7 +181,7 @@ private fun Buttons() {
.onFocusEvent { focused = it.isFocused }
.background(if (focused) JBUI.CurrentTheme.Focus.focusColor().toComposeColor() else Color.Unspecified, RoundedCornerShape(4.dp))
) {
Icon("expui/image/fitContent.svg", contentDescription = null, iconClass = AllIcons::class.java)
Icon(AllIconsKeys.General.FitContent, contentDescription = null, iconClass = AllIcons::class.java)
}
Text("← Click me #$state3")
}
@@ -219,7 +224,7 @@ private fun LinkLabels() {
@Composable
private fun TextFieldSimple() {
var textFieldState by remember { mutableStateOf("") }
val textFieldState = rememberTextFieldState()
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(5.dp),
@@ -227,9 +232,6 @@ private fun TextFieldSimple() {
Text("Text field:")
TextField(
textFieldState,
onValueChange = {
textFieldState = it
},
modifier = Modifier.padding(5.dp)
)
}
@@ -238,14 +240,13 @@ private fun TextFieldSimple() {
@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun TextFieldWithButton() {
var textFieldState by remember { mutableStateOf("") }
val textFieldState = rememberTextFieldState()
var fileExists by remember { mutableStateOf(true) }
LaunchedEffect(textFieldState) {
delay(300)
withContext(IO) {
fileExists = textFieldState.isEmpty() || File(textFieldState).exists()
fileExists = textFieldState.text.isEmpty() || File(textFieldState.text.toString()).exists()
}
}
@@ -253,7 +254,7 @@ private fun TextFieldWithButton() {
val descriptor = FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor()
descriptor.title = UIBundle.message("file.chooser.default.title")
FileChooser.chooseFile(descriptor, null, null) {
textFieldState = it.path
textFieldState.edit { replace(0, textFieldState.text.length, it.path) }
}
}
@@ -267,8 +268,7 @@ private fun TextFieldWithButton() {
) {
Text("Choose file or folder:")
TextField(
value = textFieldState,
onValueChange = { textFieldState = it },
textFieldState,
modifier = Modifier
.padding(5.dp)
.height(28.dp)
@@ -289,7 +289,7 @@ private fun TextFieldWithButton() {
) {
IconButton({ chooseFile() }, Modifier.size(18.dp).pointerHoverIcon(PointerIcon.Hand).focusProperties { canFocus = false }) {
AllIcons.General.OpenDisk
Icon("expui/inline/browse.svg", openFileChooserHint, iconClass = AllIcons::class.java)
Icon(AllIconsKeys.General.OpenDisk, openFileChooserHint, iconClass = AllIcons::class.java)
}
}
},
@@ -346,4 +346,4 @@ private fun TooltipSimple(modifier: Modifier = Modifier, content: @Composable ()
content()
}
}
}
}

View File

@@ -1,36 +0,0 @@
name: IJ Platform version updates
on:
workflow_dispatch:
schedule:
- cron: 0 8 * * *
jobs:
check-ij-platform-updates:
name: Check for IJP updates
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch-name:
- releases/241
- releases/242
- main
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch-name }}
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: gradle
- name: Setup Gradle
run: chmod +x gradlew
- name: Run Gradle
run: ./gradlew checkLatestIntelliJPlatformBuild --no-daemon

View File

@@ -1,34 +0,0 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests
on:
schedule:
- cron: '0 6 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue has been inactive for a long time.'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'stale'
stale-pr-label: 'stale'
exempt-issue-labels: 'blocked-externally'
exempt-pr-labels: 'blocked-externally'
only-labels: 'needs-info'
days-before-stale: 7
days-before-close: 3
labels-to-remove-when-unstale: 'stale'

View File

@@ -0,0 +1,21 @@
# Fast PR Guide
In order to get your pull requests merged with any futher complications (inside community repository) it is advised to follow these:
1) Make sure your commits are prefixed with `[jewel] <Jewel YouTrack Id> ` to ensure distinction of commits and ensure automation works.
2) Prefix the PR name with `[jewel]` and ideally with `jewel` label.
3) Avoid creating pull requests from chains of feature branches (branching from feature branches), this is possible, but can cause issues if combined with squashing/amending the commits. If you do this, ensure you properly rebase all of the branches.
4) Ideally squash the commits, this is not a requirement, but beware that your feature branch might became unsuable if we squash the commits as part of the cherry-pick process.
## Adding modules
When adding modules, there is multiple tests ensuring quality of community project. These rules should be folowed in addition to rules above:
1) Ensure that .idea/modules.xml is sorted alphabetically
2) Source roots declared in the module .iml should match the folder structure. Do not add source roots that don't exist and vice versa.
3) In resource folder, file called `<module name>.xml` should be placed that contains the V2 Plugin configuration. For sake of Jewel/platform modules, it is essential to alteast declare module dependencies in this file.
4) Make sure that `.iml` files are not being modified after being changed by the IDE dialogs.
## Adding dependencies
1) Library for new dependency has to be stated inside CommunityLibraryLicenses.kt. If you are adding part of library already added, you still need to add the alternative library name to this file.
2) Alternatively, library used by multiple modules might be added to community/libraries as a separate module containing only the dependency.
3) Try not to use "exported" flag in dependencies.
4) Make sure that dependencies already contained in the platform are not included as transitive dependencies. (same applies if the current module depends on module with this dependency already added.)

View File

@@ -13,8 +13,10 @@ dependencies {
sarif(projects.intUi.intUiDecoratedWindow)
sarif(projects.intUi.intUiStandalone)
sarif(projects.markdown.core)
sarif(projects.markdown.extension.autolink)
sarif(projects.markdown.extension.gfmAlerts)
sarif(projects.markdown.extensions.autolink)
sarif(projects.markdown.extensions.gfmAlerts)
sarif(projects.markdown.extensions.gfmStrikethrough)
sarif(projects.markdown.extensions.gfmTables)
sarif(projects.markdown.ideLafBridgeStyling)
sarif(projects.markdown.intUiStandaloneStyling)
sarif(projects.samples.idePlugin)

View File

@@ -30,7 +30,7 @@ internal fun MavenPom.configureJewelPom() {
licenses {
license {
name = "Apache License 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {

View File

@@ -6,6 +6,8 @@ import com.squareup.kotlinpoet.PropertySpec
import com.squareup.kotlinpoet.TypeSpec
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.gradle.tasks.DokkaGenerateModuleTask
import org.jetbrains.dokka.gradle.tasks.DokkaGeneratePublicationTask
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile
import java.lang.reflect.Field
@@ -47,6 +49,8 @@ extension.all item@{
withType<BaseKotlinCompile> { dependsOn(task) }
withType<Detekt> { dependsOn(task) }
withType<DokkaTask> { dependsOn(task) }
withType<DokkaGenerateModuleTask> { dependsOn(task) }
withType<DokkaGeneratePublicationTask> { dependsOn(task) }
withType<Jar> { dependsOn(task) }
}
}

View File

@@ -4,6 +4,8 @@ import com.squareup.kotlinpoet.ClassName
import io.gitlab.arturbosch.detekt.Detekt
import org.gradle.util.internal.GUtil
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.gradle.tasks.DokkaGenerateModuleTask
import org.jetbrains.dokka.gradle.tasks.DokkaGeneratePublicationTask
import org.jetbrains.jewel.buildlogic.theme.IntelliJThemeGeneratorTask
import org.jetbrains.jewel.buildlogic.theme.ThemeGeneration
import org.jetbrains.jewel.buildlogic.theme.ThemeGeneratorContainer
@@ -33,6 +35,8 @@ extension.all {
withType<BaseKotlinCompile> { dependsOn(task) }
withType<Detekt> { dependsOn(task) }
withType<DokkaTask> { dependsOn(task) }
withType<DokkaGenerateModuleTask> { dependsOn(task) }
withType<DokkaGeneratePublicationTask> { dependsOn(task) }
withType<Jar> { dependsOn(task) }
}

View File

@@ -4,9 +4,22 @@ plugins {
kotlin("jvm")
`maven-publish`
id("org.jetbrains.dokka")
id("org.jetbrains.dokka-javadoc")
signing
}
dokka {
dokkaSourceSets {
named("main") {
sourceLink {
// Point to IJP sources
remoteUrl("https://github.com/JetBrains/intellij-community")
localDirectory.set(rootDir)
}
}
}
}
val sourcesJar by
tasks.registering(Jar::class) {
from(kotlin.sourceSets.main.map { it.kotlin })
@@ -17,7 +30,7 @@ val sourcesJar by
val javadocJar by
tasks.registering(Jar::class) {
from(tasks.dokkaHtml)
from(tasks.dokkaGenerateModuleJavadoc)
archiveClassifier = "javadoc"
destinationDirectory = layout.buildDirectory.dir("artifacts")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

View File

@@ -1,14 +1,14 @@
package org.jetbrains.jewel.buildlogic.demodata
import com.squareup.kotlinpoet.ClassName
import gradle.kotlin.dsl.accessors._6b77fac1fb1b8c5058558e9072dfa468.kotlin
import gradle.kotlin.dsl.accessors._6b77fac1fb1b8c5058558e9072dfa468.sourceSets
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.provider.Property
import org.gradle.api.provider.SetProperty
import org.gradle.api.tasks.Input
@@ -16,7 +16,6 @@ import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.TaskAction
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.property
import org.gradle.kotlin.dsl.setProperty
import java.io.File
@@ -27,7 +26,18 @@ open class StudioVersionsGenerationExtension(project: Project) {
project.objects
.directoryProperty()
.convention(
project.layout.dir(project.provider { project.sourceSets.named("main").get().kotlin.srcDirs.first() })
project.layout.dir(
project.provider {
if (project.plugins.hasPlugin("org.gradle.jvm-ecosystem")) {
val sourceSets = project.extensions.getByName("sourceSets") as SourceSetContainer
val mainSourceSet = sourceSets.named("main").get()
val kotlinSourceSet = mainSourceSet.extensions.getByName("kotlin") as SourceDirectorySet
kotlinSourceSet.srcDirs.first()
} else {
error("Gradle plugin 'org.gradle.jvm-ecosystem' is required")
}
}
)
)
val resourcesDirs: SetProperty<File> =
@@ -35,11 +45,11 @@ open class StudioVersionsGenerationExtension(project: Project) {
.setProperty<File>()
.convention(
project.provider {
when {
project.plugins.hasPlugin("org.gradle.jvm-ecosystem") ->
project.extensions.getByType<SourceSetContainer>()["main"].resources.srcDirs
else -> emptySet()
if (project.plugins.hasPlugin("org.gradle.jvm-ecosystem")) {
val javaExtension = project.extensions.getByType(JavaPluginExtension::class.java)
javaExtension.sourceSets.named("main").get().resources.srcDirs
} else {
emptySet<File>()
}
}
)

View File

@@ -33,6 +33,7 @@ internal object AndroidStudioReleasesReader {
private fun createBaseTypeSpec(className: ClassName, releases: ApiAndroidStudioReleases, resourceDirs: Set<File>) =
TypeSpec.objectBuilder(className)
.addModifiers(KModifier.INTERNAL)
.superclass(
ClassName.bestGuess("org.jetbrains.jewel.samples.ideplugin.releasessample.ContentSource")
.parameterizedBy(ContentItemClassName)
@@ -70,7 +71,7 @@ internal object AndroidStudioReleasesReader {
add(" versionName = \"%L\",\n", release.version)
add(" build = \"%L\",\n", release.build)
add(" platformBuild = \"%L\",\n", release.platformBuild)
add(" platformVersion = \"%L\",\n", release.platformVersion)
add(" platformVersion = \"%L\",\n", release.platformVersion ?: "N/A")
add(" channel = %L,\n", readChannel(release.channel))
add(" releaseDate = LocalDate(%L),\n", translateDate(release.date))
add(" key = \"%L\",\n", release.build)

View File

@@ -20,7 +20,7 @@ internal data class ApiAndroidStudioReleases(@SerialName("content") val content:
@SerialName("download") val download: List<Download> = listOf(),
@SerialName("name") val name: String,
@SerialName("platformBuild") val platformBuild: String,
@SerialName("platformVersion") val platformVersion: String,
@SerialName("platformVersion") val platformVersion: String?,
@SerialName("version") val version: String,
) {

View File

@@ -51,7 +51,6 @@ public abstract interface class com/jetbrains/WindowMove {
public final class org/jetbrains/jewel/window/ComposableSingletons$TitleBarKt {
public static final field INSTANCE Lorg/jetbrains/jewel/window/ComposableSingletons$TitleBarKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$decorated_window ()Lkotlin/jvm/functions/Function2;
}

View File

@@ -1,8 +1,6 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
plugins {
jewel
}
plugins { jewel }
dependencies {
compileOnly("io.gitlab.arturbosch.detekt:detekt-api:1.23.7")
@@ -11,6 +9,4 @@ dependencies {
testImplementation("org.assertj:assertj-core:3.26.3")
}
tasks.test {
useJUnitPlatform()
}
tasks.test { useJUnitPlatform() }

View File

@@ -58,4 +58,4 @@ jvm_test(
name = "foundation_test",
runtime_deps = [":foundation_test_lib"]
)
### auto-generated section `build intellij.platform.jewel.foundation` end
### auto-generated section `build intellij.platform.jewel.foundation` end

View File

@@ -646,7 +646,6 @@ f:org.jetbrains.jewel.foundation.theme.JewelTheme$Companion
- f:getGlobalColors(androidx.compose.runtime.Composer,I):org.jetbrains.jewel.foundation.GlobalColors
- f:getGlobalMetrics(androidx.compose.runtime.Composer,I):org.jetbrains.jewel.foundation.GlobalMetrics
- f:getName(androidx.compose.runtime.Composer,I):java.lang.String
- f:getTextStyle(androidx.compose.runtime.Composer,I):androidx.compose.ui.text.TextStyle
- f:isDark(androidx.compose.runtime.Composer,I):Z
- f:isSwingCompatMode(androidx.compose.runtime.Composer,I):Z
f:org.jetbrains.jewel.foundation.theme.JewelThemeKt
@@ -680,8 +679,6 @@ f:org.jetbrains.jewel.foundation.theme.ThemeColorPalette
- f:grayOrNull-ijrfgN4(I):androidx.compose.ui.graphics.Color
- f:green-vNxB06k(I):J
- f:greenOrNull-ijrfgN4(I):androidx.compose.ui.graphics.Color
- f:grey-vNxB06k(I):J
- f:greyOrNull-ijrfgN4(I):androidx.compose.ui.graphics.Color
- hashCode():I
- f:lookup-ijrfgN4(java.lang.String):androidx.compose.ui.graphics.Color
- f:orange-vNxB06k(I):J

View File

@@ -907,7 +907,6 @@ public final class org/jetbrains/jewel/foundation/theme/JewelTheme$Companion {
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 getName (Landroidx/compose/runtime/Composer;I)Ljava/lang/String;
public final fun getTextStyle (Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/text/TextStyle;
public final fun isDark (Landroidx/compose/runtime/Composer;I)Z
public final fun isSwingCompatMode (Landroidx/compose/runtime/Composer;I)Z
}
@@ -945,8 +944,6 @@ public final class org/jetbrains/jewel/foundation/theme/ThemeColorPalette {
public final fun grayOrNull-ijrfgN4 (I)Landroidx/compose/ui/graphics/Color;
public final fun green-vNxB06k (I)J
public final fun greenOrNull-ijrfgN4 (I)Landroidx/compose/ui/graphics/Color;
public final fun grey-vNxB06k (I)J
public final fun greyOrNull-ijrfgN4 (I)Landroidx/compose/ui/graphics/Color;
public fun hashCode ()I
public final fun lookup-ijrfgN4 (Ljava/lang/String;)Landroidx/compose/ui/graphics/Color;
public final fun orange-vNxB06k (I)J

View File

@@ -44,7 +44,6 @@ import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Selected
import org.jetbrains.jewel.foundation.state.FocusableComponentState
import org.jetbrains.jewel.foundation.state.SelectableComponentState
import org.jetbrains.jewel.foundation.util.JewelLogger
/**
* Renders a lazy tree view based on the provided tree data structure.
@@ -184,7 +183,6 @@ public fun <T> BasicLazyTree(
}
.clickable(interactionSource = remember { MutableInteractionSource() }, indication = null) {
val item = flattenedTree[index] as Tree.Element<T>
JewelLogger.getInstance("BasicLazyTree").warn("Clicky clicky: ${item.data}")
(pointerEventScopedActions as? DefaultTreeViewPointerEventAction)?.notifyItemClicked(
item = item,
scope = scope,

View File

@@ -280,21 +280,28 @@ public open class DefaultSelectableLazyColumnKeyActions(
state.lastKeyEventUsedMouse = false
state.isKeyboardNavigating = true
with(keybindings) { with(actions) { execute(keys, state, selectionMode) } }
execute(
keys = keys,
state = state,
selectionMode = selectionMode,
keyEvent = actions,
keyBindings = keybindings,
)
}
context(SelectableColumnKeybindings, SelectableColumnOnKeyEvent)
private fun KeyEvent.execute(
keys: List<SelectableLazyListKey>,
state: SelectableLazyListState,
selectionMode: SelectionMode,
keyEvent: SelectableColumnOnKeyEvent,
keyBindings: SelectableColumnKeybindings,
): Boolean {
val singleSelectionEventHandled = handleSingleSelectionEvents(keys, state)
val singleSelectionEventHandled = handleSingleSelectionEvents(keys, state, keyEvent, keyBindings)
if (singleSelectionEventHandled) {
return true
}
if (selectionMode == SelectionMode.Multiple) {
val multipleSelectionEventHandled = handleMultipleSelectionEvents(keys, state)
val multipleSelectionEventHandled = handleMultipleSelectionEvents(keys, state, keyEvent, keyBindings)
if (multipleSelectionEventHandled) {
return true
}
@@ -302,39 +309,45 @@ public open class DefaultSelectableLazyColumnKeyActions(
return false
}
context(SelectableColumnKeybindings, SelectableColumnOnKeyEvent)
private fun KeyEvent.handleSingleSelectionEvents(
keys: List<SelectableLazyListKey>,
state: SelectableLazyListState,
keyEvent: SelectableColumnOnKeyEvent,
keybindings: SelectableColumnKeybindings,
): Boolean {
when {
isSelectNextItem -> onSelectNextItem(keys, state)
isSelectPreviousItem -> onSelectPreviousItem(keys, state)
isSelectFirstItem -> onSelectFirstItem(keys, state)
isSelectLastItem -> onSelectLastItem(keys, state)
isEdit -> onEdit()
else -> return false
with(keybindings) {
when {
isSelectNextItem -> keyEvent.onSelectNextItem(keys, state)
isSelectPreviousItem -> keyEvent.onSelectPreviousItem(keys, state)
isSelectFirstItem -> keyEvent.onSelectFirstItem(keys, state)
isSelectLastItem -> keyEvent.onSelectLastItem(keys, state)
isEdit -> keyEvent.onEdit()
else -> return false
}
return true
}
return true
}
context(SelectableColumnKeybindings, SelectableColumnOnKeyEvent)
private fun KeyEvent.handleMultipleSelectionEvents(
keys: List<SelectableLazyListKey>,
state: SelectableLazyListState,
keyEvent: SelectableColumnOnKeyEvent,
keyBindings: SelectableColumnKeybindings,
): Boolean {
when {
isExtendSelectionToFirstItem -> onExtendSelectionToFirst(keys, state)
isExtendSelectionToLastItem -> onExtendSelectionToLastItem(keys, state)
isExtendSelectionWithNextItem -> onExtendSelectionWithNextItem(keys, state)
isExtendSelectionWithPreviousItem -> onExtendSelectionWithPreviousItem(keys, state)
isScrollPageDownAndExtendSelection -> onScrollPageDownAndExtendSelection(keys, state)
isScrollPageDownAndSelectItem -> onScrollPageDownAndSelectItem(keys, state)
isScrollPageUpAndExtendSelection -> onScrollPageUpAndExtendSelection(keys, state)
isScrollPageUpAndSelectItem -> onScrollPageUpAndSelectItem(keys, state)
isSelectAll -> onSelectAll(keys, state)
else -> return false
with(keyBindings) {
when {
isExtendSelectionToFirstItem -> keyEvent.onExtendSelectionToFirst(keys, state)
isExtendSelectionToLastItem -> keyEvent.onExtendSelectionToLastItem(keys, state)
isExtendSelectionWithNextItem -> keyEvent.onExtendSelectionWithNextItem(keys, state)
isExtendSelectionWithPreviousItem -> keyEvent.onExtendSelectionWithPreviousItem(keys, state)
isScrollPageDownAndExtendSelection -> keyEvent.onScrollPageDownAndExtendSelection(keys, state)
isScrollPageDownAndSelectItem -> keyEvent.onScrollPageDownAndSelectItem(keys, state)
isScrollPageUpAndExtendSelection -> keyEvent.onScrollPageUpAndExtendSelection(keys, state)
isScrollPageUpAndSelectItem -> keyEvent.onScrollPageUpAndSelectItem(keys, state)
isSelectAll -> keyEvent.onSelectAll(keys, state)
else -> return false
}
return true
}
return true
}
}

View File

@@ -23,10 +23,6 @@ public interface JewelTheme {
public val globalMetrics: GlobalMetrics
@Composable @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

View File

@@ -21,11 +21,6 @@ public class ThemeColorPalette(
public val teal: List<Color>,
public val rawMap: Map<String, Color>,
) {
@Deprecated("Use gray() instead", ReplaceWith("gray(index)")) public fun grey(index: Int): Color = gray(index)
@Deprecated("Use grayOrNull() instead", ReplaceWith("grayOrNull(index)"))
public fun greyOrNull(index: Int): Color? = grayOrNull(index)
public fun gray(index: Int): Color = gray[index - 1]
public fun grayOrNull(index: Int): Color? = gray.getOrNull(index - 1)

View File

@@ -4,7 +4,9 @@ org.gradle.jvmargs=-Xmx2G
kotlin.stdlib.default.dependency=false
org.jetbrains.intellij.platform.buildFeature.useBinaryReleases=false
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
jdk.level=17
ijp.target=243
jewel.release.version=0.27.0
jdk.level=21
ijp.target=251
jewel.release.version=0.28.0

View File

@@ -2,18 +2,19 @@
commonmark = "0.24.0"
composeDesktop = "1.8.0-alpha04"
detekt = "1.23.6"
dokka = "1.9.20"
idea = "2024.3.4.1"
intelliJPlatformBuild = "243.25659.59"
ideaPlugin = "2.3.0"
jna = "5.14.0"
kotlin = "2.0.21"
kotlinSarif = "0.5.0"
kotlinpoet = "1.18.1"
dokka = "2.0.0"
filepicker = "3.1.0"
idea = "251.23774.109"
intelliJPlatformBuild = "251.23774.109-EAP-SNAPSHOT"
ideaPlugin = "2.4.0"
jna = "5.17.0"
kotlin = "2.1.10"
kotlinSarif = "0.6.0"
kotlinpoet = "2.1.0"
kotlinterGradlePlugin = "5.0.1"
kotlinxSerialization = "1.7.3"
kotlinxBinaryCompat = "0.16.3"
ktfmtGradlePlugin = "0.20.1"
kotlinxSerialization = "1.8.0"
kotlinxBinaryCompat = "0.17.0"
ktfmtGradlePlugin = "0.22.0"
[libraries]
commonmark-core = { module = "org.commonmark:commonmark", version.ref = "commonmark" }
@@ -21,7 +22,7 @@ commonmark-ext-autolink = { module = "org.commonmark:commonmark-ext-autolink", v
commonmark-ext-gfm-strikethrough = { module = "org.commonmark:commonmark-ext-gfm-strikethrough", version.ref = "commonmark" }
commonmark-ext-gfm-tables = { module = "org.commonmark:commonmark-ext-gfm-tables", version.ref = "commonmark" }
filePicker = { module = "com.darkrockstudios:mpfilepicker", version = "3.1.0" }
filePicker = { module = "com.darkrockstudios:mpfilepicker", version.ref = "filepicker" }
kotlinSarif = { module = "io.github.detekt.sarif4k:sarif4k", version.ref = "kotlinSarif" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }

View File

@@ -45,8 +45,9 @@ jvm_library(
plugins = ["@lib//:compose-plugin"]
)
jvm_test(
name = "ideLafBridge_test",
jvm_library(
name = "ideLafBridge_test_lib",
visibility = ["//visibility:public"],
srcs = glob(["ide-laf-bridge-tests/src/test/kotlin/**/*.kt", "ide-laf-bridge-tests/src/test/kotlin/**/*.java"], allow_empty = True),
kotlinc_opts = ":custom",
associates = [":ideLafBridge"],
@@ -73,4 +74,9 @@ jvm_test(
runtime_deps = [":ideLafBridge_resources"],
plugins = ["@lib//:compose-plugin"]
)
### auto-generated section `build intellij.platform.jewel.ideLafBridge` end
jvm_test(
name = "ideLafBridge_test",
runtime_deps = [":ideLafBridge_test_lib"]
)
### auto-generated section `build intellij.platform.jewel.ideLafBridge` end

View File

@@ -34,9 +34,7 @@ repositories {
dependencies {
api(projects.ui) { exclude(group = "org.jetbrains.kotlinx") }
intellijPlatform {
intellijIdeaCommunity(libs.versions.idea)
}
intellijPlatform { intellijIdeaCommunity(libs.versions.idea) }
testImplementation(compose.desktop.uiTestJUnit4)
testImplementation(compose.desktop.currentOs) { exclude(group = "org.jetbrains.compose.material") }

View File

@@ -1,10 +1,6 @@
package org.jetbrains.jewel.bridge.actionSystem
import com.intellij.openapi.actionSystem.DataKey
import com.intellij.openapi.actionSystem.DataProvider
import com.intellij.openapi.actionSystem.DataSink
import com.intellij.openapi.actionSystem.DataSnapshotProvider
import com.intellij.openapi.actionSystem.UiDataProvider
import com.intellij.openapi.actionSystem.*
internal class TestDataSink : DataSink {
val allData = mutableMapOf<String, Any>()

View File

@@ -14,6 +14,7 @@ import androidx.compose.ui.unit.toSize
import com.intellij.openapi.actionSystem.DataSink
import com.intellij.openapi.actionSystem.UiDataProvider
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.util.registry.Registry
import java.awt.BorderLayout
import javax.swing.JComponent

View File

@@ -17,7 +17,7 @@ internal fun readTooltipStyle(): TooltipStyle {
metrics =
TooltipMetrics.defaults(
contentPadding = JBUI.CurrentTheme.HelpTooltip.smallTextBorderInsets().toPaddingValues(),
showDelay = Registry.intValue("ide.tooltip.initialDelay").milliseconds,
showDelay = Registry.intValue("ide.tooltip.initialReshowDelay").milliseconds,
cornerSize = CornerSize(JBUI.CurrentTheme.Tooltip.CORNER_RADIUS.dp),
),
colors =

View File

@@ -199,10 +199,10 @@ public object IntUiUndecoratedComboBoxColorsFactory {
}
public fun ComboBoxMetrics.Companion.default(
arrowAreaSize: DpSize = DpSize(23.dp, 24.dp),
minSize: DpSize = DpSize(49.dp, 24.dp),
arrowAreaSize: DpSize = DpSize(28.dp, 28.dp),
minSize: DpSize = DpSize(77.dp, 28.dp),
cornerSize: CornerSize = CornerSize(4.dp),
contentPadding: PaddingValues = PaddingValues(horizontal = 6.dp, vertical = 2.dp),
contentPadding: PaddingValues = PaddingValues(9.dp, 1.dp, 6.dp, 1.dp),
popupContentPadding: PaddingValues = PaddingValues(vertical = 6.dp),
borderWidth: Dp = 1.dp,
maxPopupHeight: Dp = 200.dp,
@@ -218,10 +218,10 @@ public fun ComboBoxMetrics.Companion.default(
)
public fun ComboBoxMetrics.Companion.undecorated(
arrowAreaSize: DpSize = DpSize(23.dp, 24.dp),
minSize: DpSize = DpSize(49.dp, 24.dp),
arrowAreaSize: DpSize = DpSize(28.dp, 28.dp),
minSize: DpSize = DpSize(77.dp, 28.dp),
cornerSize: CornerSize = CornerSize(4.dp),
contentPadding: PaddingValues = PaddingValues(horizontal = 6.dp, vertical = 2.dp),
contentPadding: PaddingValues = PaddingValues(9.dp, 1.dp, 6.dp, 1.dp),
popupContentPadding: PaddingValues = PaddingValues(vertical = 6.dp),
borderWidth: Dp = 0.dp,
maxPopupHeight: Dp = 200.dp,

View File

@@ -62,7 +62,7 @@ If you want to use extensions, you also need to add them **alongside** the `jewe
dependencies {
implementation(libs.jewel.standalone)
implementation(libs.jewel.markdown.intUiStandaloneStyling)
implementation(libs.jewel.markdown.extension.gfm.alerts) // Optional
implementation(libs.jewel.markdown.extensions.gfm.alerts) // Optional
// Et cetera...
}
```
@@ -159,4 +159,4 @@ You can see this in action running the Standalone sample, and selecting Markdown
The following image shows the Jewel Markdown renderer displaying the Jewel readme.
![Image showing the Markdown renderer page from the Jewel standalone sample](../art/docs/markdown-renderer.png)
![Image showing the Markdown renderer page from the Jewel standalone sample](../art/docs/markdown-renderer.png)

View File

@@ -65,4 +65,4 @@ jvm_test(
name = "jewel-markdown-core_test",
runtime_deps = [":jewel-markdown-core_test_lib"]
)
### auto-generated section `build intellij.platform.jewel.markdown.core` end
### auto-generated section `build intellij.platform.jewel.markdown.core` end

View File

@@ -15,9 +15,7 @@ dependencies {
testImplementation(compose.desktop.currentOs)
}
publicApiValidation {
excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.MarkdownBlock.*")
}
publicApiValidation { excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.MarkdownBlock.*") }
publishing.publications.named<MavenPublication>("main") {
val ijpTarget = project.property("ijp.target") as String

View File

@@ -447,7 +447,8 @@ public open class DefaultMarkdownBlockRenderer(
style = styling.editorTextStyle,
modifier =
Modifier.focusProperties { canFocus = false }
.pointerHoverIcon(PointerIcon.Default, overrideDescendants = true),
.pointerHoverIcon(PointerIcon.Default, overrideDescendants = true)
.thenIf(!enabled) { alpha(.5f) },
)
}

View File

@@ -1,5 +0,0 @@
f:org.jetbrains.jewel.markdown.extension.autolink.AutolinkProcessorExtension
- org.jetbrains.jewel.markdown.extensions.MarkdownProcessorExtension
- sf:$stable:I
- sf:INSTANCE:org.jetbrains.jewel.markdown.extension.autolink.AutolinkProcessorExtension
- getParserExtension():org.commonmark.parser.Parser$ParserExtension

View File

@@ -1,4 +1,4 @@
### auto-generated section `build intellij.platform.jewel.markdown.extension.autolink` start
### auto-generated section `build intellij.platform.jewel.markdown.extensions.autolink` start
load("//build:compiler-options.bzl", "create_kotlinc_options")
load("@rules_jvm//:jvm.bzl", "jvm_library", "jvm_resources", "jvm_test")
@@ -14,14 +14,14 @@ create_kotlinc_options(
)
jvm_resources(
name = "jewel-markdown-extension-autolink_resources",
name = "jewel-markdown-extensions-autolink_resources",
files = glob(["src/main/resources/**/*"]),
strip_prefix = "src/main/resources"
)
jvm_library(
name = "jewel-markdown-extension-autolink",
module_name = "intellij.platform.jewel.markdown.extension.autolink",
name = "jewel-markdown-extensions-autolink",
module_name = "intellij.platform.jewel.markdown.extensions.autolink",
visibility = ["//visibility:public"],
srcs = glob(["src/main/kotlin/**/*.kt", "src/main/kotlin/**/*.java"], allow_empty = True),
kotlinc_opts = ":custom",
@@ -32,19 +32,19 @@ jvm_library(
"//platform/jewel/markdown/core:jewel-markdown-core",
"//platform/jewel/ui",
"//platform/jewel/foundation",
"@lib//:platform-jewel-markdown-extension-autolink-commonmark-ext-autolink",
"@lib//:platform-jewel-markdown-extensions-autolink-commonmark-ext-autolink",
"//libraries/compose-foundation-desktop",
],
runtime_deps = [":jewel-markdown-extension-autolink_resources"],
runtime_deps = [":jewel-markdown-extensions-autolink_resources"],
plugins = ["@lib//:compose-plugin"]
)
jvm_library(
name = "jewel-markdown-extension-autolink_test_lib",
name = "jewel-markdown-extensions-autolink_test_lib",
visibility = ["//visibility:public"],
srcs = glob(["src/test/kotlin/**/*.kt", "src/test/kotlin/**/*.java"], allow_empty = True),
kotlinc_opts = ":custom",
associates = [":jewel-markdown-extension-autolink"],
associates = [":jewel-markdown-extensions-autolink"],
deps = [
"@lib//:kotlin-stdlib",
"@lib//:kotlinx-coroutines-core",
@@ -55,16 +55,16 @@ jvm_library(
"//platform/jewel/ui:ui_test_lib",
"//platform/jewel/foundation",
"//platform/jewel/foundation:foundation_test_lib",
"@lib//:platform-jewel-markdown-extension-autolink-commonmark-ext-autolink",
"@lib//:platform-jewel-markdown-extensions-autolink-commonmark-ext-autolink",
"//libraries/compose-foundation-desktop",
"//libraries/compose-foundation-desktop-junit",
],
runtime_deps = [":jewel-markdown-extension-autolink_resources"],
runtime_deps = [":jewel-markdown-extensions-autolink_resources"],
plugins = ["@lib//:compose-plugin"]
)
jvm_test(
name = "jewel-markdown-extension-autolink_test",
runtime_deps = [":jewel-markdown-extension-autolink_test_lib"]
name = "jewel-markdown-extensions-autolink_test",
runtime_deps = [":jewel-markdown-extensions-autolink_test_lib"]
)
### auto-generated section `build intellij.platform.jewel.markdown.extension.autolink` end
### auto-generated section `build intellij.platform.jewel.markdown.extensions.autolink` end

View File

@@ -0,0 +1,5 @@
f:org.jetbrains.jewel.markdown.extensions.autolink.AutolinkProcessorExtension
- org.jetbrains.jewel.markdown.extensions.MarkdownProcessorExtension
- sf:$stable:I
- sf:INSTANCE:org.jetbrains.jewel.markdown.extensions.autolink.AutolinkProcessorExtension
- getParserExtension():org.commonmark.parser.Parser$ParserExtension

View File

@@ -1,6 +1,6 @@
public final class org/jetbrains/jewel/markdown/extension/autolink/AutolinkProcessorExtension : org/jetbrains/jewel/markdown/extensions/MarkdownProcessorExtension {
public final class org/jetbrains/jewel/markdown/extensions/autolink/AutolinkProcessorExtension : org/jetbrains/jewel/markdown/extensions/MarkdownProcessorExtension {
public static final field $stable I
public static final field INSTANCE Lorg/jetbrains/jewel/markdown/extension/autolink/AutolinkProcessorExtension;
public static final field INSTANCE Lorg/jetbrains/jewel/markdown/extensions/autolink/AutolinkProcessorExtension;
public fun getBlockProcessorExtension ()Lorg/jetbrains/jewel/markdown/extensions/MarkdownBlockProcessorExtension;
public fun getDelimitedInlineProcessorExtension ()Lorg/jetbrains/jewel/markdown/extensions/MarkdownDelimitedInlineProcessorExtension;
public fun getParserExtension ()Lorg/commonmark/parser/Parser$ParserExtension;

View File

@@ -1,4 +1,4 @@
package org.jetbrains.jewel.markdown.extension.autolink
package org.jetbrains.jewel.markdown.extensions.autolink
import org.commonmark.ext.autolink.AutolinkExtension
import org.commonmark.parser.Parser.ParserExtension

View File

@@ -1,4 +1,4 @@
package org.jetbrains.jewel.markdown.extension.autolink
package org.jetbrains.jewel.markdown.extensions.autolink
import org.jetbrains.jewel.markdown.InlineMarkdown
import org.jetbrains.jewel.markdown.MarkdownBlock

View File

@@ -1,4 +1,4 @@
### auto-generated section `build intellij.platform.jewel.markdown.extension.gfmAlerts` start
### auto-generated section `build intellij.platform.jewel.markdown.extensions.gfmAlerts` start
load("//build:compiler-options.bzl", "create_kotlinc_options")
load("@rules_jvm//:jvm.bzl", "jvm_library", "jvm_resources", "jvm_test")
@@ -14,14 +14,14 @@ create_kotlinc_options(
)
jvm_resources(
name = "jewel-markdown-extension-gfmAlerts_resources",
name = "jewel-markdown-extensions-gfmAlerts_resources",
files = glob(["src/main/resources/**/*"]),
strip_prefix = "src/main/resources"
)
jvm_library(
name = "jewel-markdown-extension-gfmAlerts",
module_name = "intellij.platform.jewel.markdown.extension.gfmAlerts",
name = "jewel-markdown-extensions-gfmAlerts",
module_name = "intellij.platform.jewel.markdown.extensions.gfmAlerts",
visibility = ["//visibility:public"],
srcs = glob(["src/main/kotlin/**/*.kt", "src/main/kotlin/**/*.java"], allow_empty = True),
kotlinc_opts = ":custom",
@@ -34,15 +34,15 @@ jvm_library(
"//platform/jewel/foundation",
"//libraries/compose-foundation-desktop",
],
runtime_deps = [":jewel-markdown-extension-gfmAlerts_resources"],
runtime_deps = [":jewel-markdown-extensions-gfmAlerts_resources"],
plugins = ["@lib//:compose-plugin"]
)
jvm_test(
name = "jewel-markdown-extension-gfmAlerts_test",
name = "jewel-markdown-extensions-gfmAlerts_test",
srcs = glob(["src/test/kotlin/**/*.kt", "src/test/kotlin/**/*.java"], allow_empty = True),
kotlinc_opts = ":custom",
associates = [":jewel-markdown-extension-gfmAlerts"],
associates = [":jewel-markdown-extensions-gfmAlerts"],
deps = [
"@lib//:kotlin-stdlib",
"@lib//:kotlinx-coroutines-core",
@@ -56,7 +56,7 @@ jvm_test(
"//libraries/compose-foundation-desktop",
"//libraries/compose-foundation-desktop-junit",
],
runtime_deps = [":jewel-markdown-extension-gfmAlerts_resources"],
runtime_deps = [":jewel-markdown-extensions-gfmAlerts_resources"],
plugins = ["@lib//:compose-plugin"]
)
### auto-generated section `build intellij.platform.jewel.markdown.extension.gfmAlerts` end
### auto-generated section `build intellij.platform.jewel.markdown.extensions.gfmAlerts` end

View File

@@ -1,56 +1,3 @@
org.jetbrains.jewel.markdown.extensions.github.alerts.Alert
- org.jetbrains.jewel.markdown.MarkdownBlock$CustomBlock
- a:getContent():java.util.List
f:org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Caution
- org.jetbrains.jewel.markdown.extensions.github.alerts.Alert
- sf:$stable:I
- <init>(java.util.List):V
- f:component1():java.util.List
- f:copy(java.util.List):org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Caution
- bs:copy$default(org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Caution,java.util.List,I,java.lang.Object):org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Caution
- equals(java.lang.Object):Z
- getContent():java.util.List
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Important
- org.jetbrains.jewel.markdown.extensions.github.alerts.Alert
- sf:$stable:I
- <init>(java.util.List):V
- f:component1():java.util.List
- f:copy(java.util.List):org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Important
- bs:copy$default(org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Important,java.util.List,I,java.lang.Object):org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Important
- equals(java.lang.Object):Z
- getContent():java.util.List
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Note
- org.jetbrains.jewel.markdown.extensions.github.alerts.Alert
- sf:$stable:I
- <init>(java.util.List):V
- f:component1():java.util.List
- f:copy(java.util.List):org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Note
- bs:copy$default(org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Note,java.util.List,I,java.lang.Object):org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Note
- equals(java.lang.Object):Z
- getContent():java.util.List
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Tip
- org.jetbrains.jewel.markdown.extensions.github.alerts.Alert
- sf:$stable:I
- <init>(java.util.List):V
- f:component1():java.util.List
- f:copy(java.util.List):org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Tip
- bs:copy$default(org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Tip,java.util.List,I,java.lang.Object):org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Tip
- equals(java.lang.Object):Z
- getContent():java.util.List
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Warning
- org.jetbrains.jewel.markdown.extensions.github.alerts.Alert
- sf:$stable:I
- <init>(java.util.List):V
- f:component1():java.util.List
- f:copy(java.util.List):org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Warning
- bs:copy$default(org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Warning,java.util.List,I,java.lang.Object):org.jetbrains.jewel.markdown.extensions.github.alerts.Alert$Warning
- equals(java.lang.Object):Z
- getContent():java.util.List
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.AlertStyling
- sf:$stable:I
- sf:Companion:org.jetbrains.jewel.markdown.extensions.github.alerts.AlertStyling$Companion
@@ -89,6 +36,59 @@ f:org.jetbrains.jewel.markdown.extensions.github.alerts.CautionAlertStyling
- getTitleTextStyle():androidx.compose.ui.text.TextStyle
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.CautionAlertStyling$Companion
org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert
- org.jetbrains.jewel.markdown.MarkdownBlock$CustomBlock
- a:getContent():java.util.List
f:org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Caution
- org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert
- sf:$stable:I
- <init>(java.util.List):V
- f:component1():java.util.List
- f:copy(java.util.List):org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Caution
- bs:copy$default(org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Caution,java.util.List,I,java.lang.Object):org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Caution
- equals(java.lang.Object):Z
- getContent():java.util.List
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Important
- org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert
- sf:$stable:I
- <init>(java.util.List):V
- f:component1():java.util.List
- f:copy(java.util.List):org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Important
- bs:copy$default(org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Important,java.util.List,I,java.lang.Object):org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Important
- equals(java.lang.Object):Z
- getContent():java.util.List
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Note
- org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert
- sf:$stable:I
- <init>(java.util.List):V
- f:component1():java.util.List
- f:copy(java.util.List):org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Note
- bs:copy$default(org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Note,java.util.List,I,java.lang.Object):org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Note
- equals(java.lang.Object):Z
- getContent():java.util.List
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Tip
- org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert
- sf:$stable:I
- <init>(java.util.List):V
- f:component1():java.util.List
- f:copy(java.util.List):org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Tip
- bs:copy$default(org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Tip,java.util.List,I,java.lang.Object):org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Tip
- equals(java.lang.Object):Z
- getContent():java.util.List
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Warning
- org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert
- sf:$stable:I
- <init>(java.util.List):V
- f:component1():java.util.List
- f:copy(java.util.List):org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Warning
- bs:copy$default(org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Warning,java.util.List,I,java.lang.Object):org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert$Warning
- equals(java.lang.Object):Z
- getContent():java.util.List
- hashCode():I
f:org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlertBlockRenderer
- org.jetbrains.jewel.markdown.extensions.MarkdownBlockRendererExtension
- sf:$stable:I

View File

@@ -1,67 +1,3 @@
public abstract interface class org/jetbrains/jewel/markdown/extensions/github/alerts/Alert : org/jetbrains/jewel/markdown/MarkdownBlock$CustomBlock {
public abstract fun getContent ()Ljava/util/List;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Caution : org/jetbrains/jewel/markdown/extensions/github/alerts/Alert {
public static final field $stable I
public fun <init> (Ljava/util/List;)V
public final fun component1 ()Ljava/util/List;
public final fun copy (Ljava/util/List;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Caution;
public static synthetic fun copy$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Caution;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Caution;
public fun equals (Ljava/lang/Object;)Z
public fun getContent ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Important : org/jetbrains/jewel/markdown/extensions/github/alerts/Alert {
public static final field $stable I
public fun <init> (Ljava/util/List;)V
public final fun component1 ()Ljava/util/List;
public final fun copy (Ljava/util/List;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Important;
public static synthetic fun copy$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Important;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Important;
public fun equals (Ljava/lang/Object;)Z
public fun getContent ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Note : org/jetbrains/jewel/markdown/extensions/github/alerts/Alert {
public static final field $stable I
public fun <init> (Ljava/util/List;)V
public final fun component1 ()Ljava/util/List;
public final fun copy (Ljava/util/List;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Note;
public static synthetic fun copy$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Note;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Note;
public fun equals (Ljava/lang/Object;)Z
public fun getContent ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Tip : org/jetbrains/jewel/markdown/extensions/github/alerts/Alert {
public static final field $stable I
public fun <init> (Ljava/util/List;)V
public final fun component1 ()Ljava/util/List;
public final fun copy (Ljava/util/List;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Tip;
public static synthetic fun copy$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Tip;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Tip;
public fun equals (Ljava/lang/Object;)Z
public fun getContent ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Warning : org/jetbrains/jewel/markdown/extensions/github/alerts/Alert {
public static final field $stable I
public fun <init> (Ljava/util/List;)V
public final fun component1 ()Ljava/util/List;
public final fun copy (Ljava/util/List;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Warning;
public static synthetic fun copy$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Warning;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/Alert$Warning;
public fun equals (Ljava/lang/Object;)Z
public fun getContent ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling {
public static final field $stable I
public static final field Companion Lorg/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling$Companion;
@@ -112,6 +48,70 @@ public final class org/jetbrains/jewel/markdown/extensions/github/alerts/Caution
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/CautionAlertStyling$Companion {
}
public abstract interface class org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert : org/jetbrains/jewel/markdown/MarkdownBlock$CustomBlock {
public abstract fun getContent ()Ljava/util/List;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Caution : org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert {
public static final field $stable I
public fun <init> (Ljava/util/List;)V
public final fun component1 ()Ljava/util/List;
public final fun copy (Ljava/util/List;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Caution;
public static synthetic fun copy$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Caution;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Caution;
public fun equals (Ljava/lang/Object;)Z
public fun getContent ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Important : org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert {
public static final field $stable I
public fun <init> (Ljava/util/List;)V
public final fun component1 ()Ljava/util/List;
public final fun copy (Ljava/util/List;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Important;
public static synthetic fun copy$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Important;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Important;
public fun equals (Ljava/lang/Object;)Z
public fun getContent ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Note : org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert {
public static final field $stable I
public fun <init> (Ljava/util/List;)V
public final fun component1 ()Ljava/util/List;
public final fun copy (Ljava/util/List;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Note;
public static synthetic fun copy$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Note;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Note;
public fun equals (Ljava/lang/Object;)Z
public fun getContent ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Tip : org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert {
public static final field $stable I
public fun <init> (Ljava/util/List;)V
public final fun component1 ()Ljava/util/List;
public final fun copy (Ljava/util/List;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Tip;
public static synthetic fun copy$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Tip;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Tip;
public fun equals (Ljava/lang/Object;)Z
public fun getContent ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Warning : org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert {
public static final field $stable I
public fun <init> (Ljava/util/List;)V
public final fun component1 ()Ljava/util/List;
public final fun copy (Ljava/util/List;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Warning;
public static synthetic fun copy$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Warning;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlert$Warning;
public fun equals (Ljava/lang/Object;)Z
public fun getContent ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class org/jetbrains/jewel/markdown/extensions/github/alerts/GitHubAlertBlockRenderer : org/jetbrains/jewel/markdown/extensions/MarkdownBlockRendererExtension {
public static final field $stable I
public fun <init> (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;)V

View File

@@ -12,9 +12,7 @@ dependencies {
testImplementation(compose.desktop.uiTestJUnit4)
}
publicApiValidation {
excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.extensions.github.alerts.*")
}
publicApiValidation { excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.extensions.github.alerts.*") }
publishing.publications.named<MavenPublication>("main") {
val ijpTarget = project.property("ijp.target") as String

View File

@@ -2,16 +2,16 @@ package org.jetbrains.jewel.markdown.extensions.github.alerts
import org.jetbrains.jewel.markdown.MarkdownBlock
public sealed interface Alert : MarkdownBlock.CustomBlock {
public sealed interface GitHubAlert : MarkdownBlock.CustomBlock {
public val content: List<MarkdownBlock>
public data class Note(override val content: List<MarkdownBlock>) : Alert
public data class Note(override val content: List<MarkdownBlock>) : GitHubAlert
public data class Tip(override val content: List<MarkdownBlock>) : Alert
public data class Tip(override val content: List<MarkdownBlock>) : GitHubAlert
public data class Important(override val content: List<MarkdownBlock>) : Alert
public data class Important(override val content: List<MarkdownBlock>) : GitHubAlert
public data class Warning(override val content: List<MarkdownBlock>) : Alert
public data class Warning(override val content: List<MarkdownBlock>) : GitHubAlert
public data class Caution(override val content: List<MarkdownBlock>) : Alert
public data class Caution(override val content: List<MarkdownBlock>) : GitHubAlert
}

View File

@@ -18,11 +18,11 @@ import androidx.compose.ui.unit.dp
import org.jetbrains.jewel.foundation.theme.LocalContentColor
import org.jetbrains.jewel.markdown.MarkdownBlock.CustomBlock
import org.jetbrains.jewel.markdown.extensions.MarkdownBlockRendererExtension
import org.jetbrains.jewel.markdown.extensions.github.alerts.Alert.Caution
import org.jetbrains.jewel.markdown.extensions.github.alerts.Alert.Important
import org.jetbrains.jewel.markdown.extensions.github.alerts.Alert.Note
import org.jetbrains.jewel.markdown.extensions.github.alerts.Alert.Tip
import org.jetbrains.jewel.markdown.extensions.github.alerts.Alert.Warning
import org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert.Caution
import org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert.Important
import org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert.Note
import org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert.Tip
import org.jetbrains.jewel.markdown.extensions.github.alerts.GitHubAlert.Warning
import org.jetbrains.jewel.markdown.rendering.InlineMarkdownRenderer
import org.jetbrains.jewel.markdown.rendering.MarkdownBlockRenderer
import org.jetbrains.jewel.markdown.rendering.MarkdownStyling
@@ -31,7 +31,7 @@ import org.jetbrains.jewel.ui.component.Text
public class GitHubAlertBlockRenderer(private val styling: AlertStyling, private val rootStyling: MarkdownStyling) :
MarkdownBlockRendererExtension {
override fun canRender(block: CustomBlock): Boolean = block is Alert
override fun canRender(block: CustomBlock): Boolean = block is GitHubAlert
@Composable
override fun render(
@@ -46,7 +46,7 @@ public class GitHubAlertBlockRenderer(private val styling: AlertStyling, private
// Smart cast doesn't work in this case, and then the detection for redundant suppression is
// also borked
@Suppress("MoveVariableDeclarationIntoWhen", "RedundantSuppression") // ktfmt: break line
val alert = block as? Alert
val alert = block as? GitHubAlert
when (alert) {
is Caution -> Alert(alert, modifier, styling.caution, enabled, blockRenderer, onUrlClick, onTextClick)
@@ -60,7 +60,7 @@ public class GitHubAlertBlockRenderer(private val styling: AlertStyling, private
@Composable
private fun Alert(
block: Alert,
block: GitHubAlert,
modifier: Modifier,
styling: BaseAlertStyling,
enabled: Boolean,

View File

@@ -46,11 +46,11 @@ public object GitHubAlertProcessorExtension : MarkdownProcessorExtension {
if (children.isEmpty()) return null
return when (block) {
is Caution -> Alert.Caution(children)
is Important -> Alert.Important(children)
is Note -> Alert.Note(children)
is Tip -> Alert.Tip(children)
is Warning -> Alert.Warning(children)
is Caution -> GitHubAlert.Caution(children)
is Important -> GitHubAlert.Important(children)
is Note -> GitHubAlert.Note(children)
is Tip -> GitHubAlert.Tip(children)
is Warning -> GitHubAlert.Warning(children)
else -> error("Unsupported custom block of type ${block.javaClass.name}")
}
}

View File

@@ -1,4 +1,4 @@
### auto-generated section `build intellij.platform.jewel.markdown.extension.gfmStrikethrough` start
### auto-generated section `build intellij.platform.jewel.markdown.extensions.gfmStrikethrough` start
load("//build:compiler-options.bzl", "create_kotlinc_options")
load("@rules_jvm//:jvm.bzl", "jvm_library", "jvm_resources")
@@ -14,14 +14,14 @@ create_kotlinc_options(
)
jvm_resources(
name = "jewel-markdown-extension-gfmStrikethrough_resources",
name = "jewel-markdown-extensions-gfmStrikethrough_resources",
files = glob(["src/main/resources/**/*"]),
strip_prefix = "src/main/resources"
)
jvm_library(
name = "jewel-markdown-extension-gfmStrikethrough",
module_name = "intellij.platform.jewel.markdown.extension.gfmStrikethrough",
name = "jewel-markdown-extensions-gfmStrikethrough",
module_name = "intellij.platform.jewel.markdown.extensions.gfmStrikethrough",
visibility = ["//visibility:public"],
srcs = glob(["src/main/kotlin/**/*.kt", "src/main/kotlin/**/*.java"], allow_empty = True),
kotlinc_opts = ":custom",
@@ -33,9 +33,9 @@ jvm_library(
"//platform/jewel/ui",
"//platform/jewel/foundation",
"//libraries/compose-foundation-desktop",
"@lib//:platform-jewel-markdown-extension-gfm_strikethrough-commonmark-ext-gfm-strikethrough",
"@lib//:platform-jewel-markdown-extensions-gfm_strikethrough-commonmark-ext-gfm-strikethrough",
],
runtime_deps = [":jewel-markdown-extension-gfmStrikethrough_resources"],
runtime_deps = [":jewel-markdown-extensions-gfmStrikethrough_resources"],
plugins = ["@lib//:compose-plugin"]
)
### auto-generated section `build intellij.platform.jewel.markdown.extension.gfmStrikethrough` end
### auto-generated section `build intellij.platform.jewel.markdown.extensions.gfmStrikethrough` end

View File

@@ -17,6 +17,4 @@ publishing.publications.named<MavenPublication>("main") {
artifactId = "jewel-markdown-extension-${project.name}-$ijpTarget"
}
publicApiValidation {
excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.extensions.github.strikethrough.*")
}
publicApiValidation { excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.extensions.github.strikethrough.*") }

View File

@@ -45,19 +45,17 @@
<artifact url="file://$MAVEN_REPOSITORY$/org/commonmark/commonmark-ext-gfm-strikethrough/0.24.0/commonmark-ext-gfm-strikethrough-0.24.0.jar">
<sha256sum>7385cb637f04dc4cbda4ddca9c2fcd2af7ac536a50e4c8d2c77f4748bb14bf41</sha256sum>
</artifact>
<artifact url="file://$MAVEN_REPOSITORY$/org/commonmark/commonmark/0.24.0/commonmark-0.24.0.jar">
<sha256sum>679338e0b7fc15c02d275d598654b01a149893bc28a87992e90123c8d06af25b</sha256sum>
</artifact>
</verification>
<exclude>
<dependency maven-id="org.commonmark:commonmark" />
</exclude>
</properties>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/commonmark/commonmark-ext-gfm-strikethrough/0.24.0/commonmark-ext-gfm-strikethrough-0.24.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/commonmark/commonmark/0.24.0/commonmark-0.24.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/commonmark/commonmark-ext-gfm-strikethrough/0.24.0/commonmark-ext-gfm-strikethrough-0.24.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/commonmark/commonmark/0.24.0/commonmark-0.24.0-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>

View File

@@ -1,4 +1,4 @@
### auto-generated section `build intellij.platform.jewel.markdown.extension.gfmTables` start
### auto-generated section `build intellij.platform.jewel.markdown.extensions.gfmTables` start
load("//build:compiler-options.bzl", "create_kotlinc_options")
load("@rules_jvm//:jvm.bzl", "jvm_library", "jvm_resources")
@@ -14,14 +14,14 @@ create_kotlinc_options(
)
jvm_resources(
name = "jewel-markdown-extension-gfmTables_resources",
name = "jewel-markdown-extensions-gfmTables_resources",
files = glob(["src/main/resources/**/*"]),
strip_prefix = "src/main/resources"
)
jvm_library(
name = "jewel-markdown-extension-gfmTables",
module_name = "intellij.platform.jewel.markdown.extension.gfmTables",
name = "jewel-markdown-extensions-gfmTables",
module_name = "intellij.platform.jewel.markdown.extensions.gfmTables",
visibility = ["//visibility:public"],
srcs = glob(["src/main/kotlin/**/*.kt", "src/main/kotlin/**/*.java"], allow_empty = True),
kotlinc_opts = ":custom",
@@ -33,9 +33,9 @@ jvm_library(
"//platform/jewel/ui",
"//platform/jewel/foundation",
"//libraries/compose-foundation-desktop",
"@lib//:platform-jewel-markdown-extension-gfm_tables-commonmark-ext-gfm-tables",
"@lib//:platform-jewel-markdown-extensions-gfm_tables-commonmark-ext-gfm-tables",
],
runtime_deps = [":jewel-markdown-extension-gfmTables_resources"],
runtime_deps = [":jewel-markdown-extensions-gfmTables_resources"],
plugins = ["@lib//:compose-plugin"]
)
### auto-generated section `build intellij.platform.jewel.markdown.extension.gfmTables` end
### auto-generated section `build intellij.platform.jewel.markdown.extensions.gfmTables` end

View File

@@ -15,9 +15,7 @@ dependencies {
testImplementation(compose.desktop.uiTestJUnit4)
}
publicApiValidation {
excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.extensions.github.tables.*")
}
publicApiValidation { excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.extensions.github.tables.*") }
publishing.publications.named<MavenPublication>("main") {
val ijpTarget = project.property("ijp.target") as String

View File

@@ -14,7 +14,9 @@
</stringArguments>
<arrayArguments>
<arrayArg name="pluginClasspaths">
<args>$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-compose-compiler-plugin/2.1.10/kotlin-compose-compiler-plugin-2.1.10.jar</args>
<args>
<arg>$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-compose-compiler-plugin/2.1.10/kotlin-compose-compiler-plugin-2.1.10.jar</arg>
</args>
</arrayArg>
</arrayArguments>
</compilerArguments>

View File

@@ -33,8 +33,8 @@ jvm_library(
"//platform/jewel/ui",
"//platform/jewel/foundation",
"//platform/jewel/ide-laf-bridge:ideLafBridge",
"//platform/jewel/markdown/extension/gfm-alerts:jewel-markdown-extension-gfmAlerts",
"//platform/jewel/markdown/extension/gfm-tables:jewel-markdown-extension-gfmTables",
"//platform/jewel/markdown/extensions/gfm-alerts:jewel-markdown-extensions-gfmAlerts",
"//platform/jewel/markdown/extensions/gfm-tables:jewel-markdown-extensions-gfmTables",
"//platform/platform-api:ide",
"//platform/ide-core",
"//platform/ide-core-impl",

View File

@@ -34,12 +34,10 @@ repositories {
dependencies {
api(projects.markdown.core)
api(projects.ideLafBridge)
compileOnly(projects.markdown.extension.gfmAlerts)
compileOnly(projects.markdown.extension.gfmTables)
compileOnly(projects.markdown.extensions.gfmAlerts)
compileOnly(projects.markdown.extensions.gfmTables)
intellijPlatform {
intellijIdeaCommunity(libs.versions.idea)
}
intellijPlatform { intellijIdeaCommunity(libs.versions.idea) }
testImplementation(compose.desktop.uiTestJUnit4)
}

View File

@@ -38,8 +38,8 @@
<orderEntry type="module" module-name="intellij.platform.jewel.ui" exported="" />
<orderEntry type="module" module-name="intellij.platform.jewel.foundation" />
<orderEntry type="module" module-name="intellij.platform.jewel.ideLafBridge" exported="" />
<orderEntry type="module" module-name="intellij.platform.jewel.markdown.extension.gfmAlerts" />
<orderEntry type="module" module-name="intellij.platform.jewel.markdown.extension.gfmTables" />
<orderEntry type="module" module-name="intellij.platform.jewel.markdown.extensions.gfmAlerts" />
<orderEntry type="module" module-name="intellij.platform.jewel.markdown.extensions.gfmTables" />
<orderEntry type="module" module-name="intellij.platform.ide" />
<orderEntry type="module" module-name="intellij.platform.ide.core" />
<orderEntry type="module" module-name="intellij.platform.ide.core.impl" />

View File

@@ -4,7 +4,7 @@
<module name="intellij.platform.jewel.ui" />
<module name="intellij.platform.jewel.ideLafBridge" />
<module name="intellij.platform.jewel.markdown.core" />
<module name="intellij.platform.jewel.markdown.extension.gfmAlerts" />
<module name="intellij.platform.jewel.markdown.extension.gfmTables" />
<module name="intellij.platform.jewel.markdown.extensions.gfmAlerts" />
<module name="intellij.platform.jewel.markdown.extensions.gfmTables" />
</dependencies>
</idea-plugin>

View File

@@ -33,8 +33,8 @@ jvm_library(
"//platform/jewel/ui",
"//platform/jewel/foundation",
"//platform/jewel/int-ui/int-ui-standalone:jewel-intUi-standalone",
"//platform/jewel/markdown/extension/gfm-alerts:jewel-markdown-extension-gfmAlerts",
"//platform/jewel/markdown/extension/gfm-tables:jewel-markdown-extension-gfmTables",
"//platform/jewel/markdown/extensions/gfm-alerts:jewel-markdown-extensions-gfmAlerts",
"//platform/jewel/markdown/extensions/gfm-tables:jewel-markdown-extensions-gfmTables",
"//libraries/compose-foundation-desktop",
],
runtime_deps = [":jewel-markdown-intUiStandaloneStyling_resources"],

View File

@@ -9,8 +9,8 @@ plugins {
dependencies {
api(projects.markdown.core)
api(projects.intUi.intUiStandalone)
compileOnly(projects.markdown.extension.gfmAlerts)
compileOnly(projects.markdown.extension.gfmTables)
compileOnly(projects.markdown.extensions.gfmAlerts)
compileOnly(projects.markdown.extensions.gfmTables)
testImplementation(compose.desktop.uiTestJUnit4)
}

View File

@@ -38,8 +38,8 @@
<orderEntry type="module" module-name="intellij.platform.jewel.ui" />
<orderEntry type="module" module-name="intellij.platform.jewel.foundation" />
<orderEntry type="module" module-name="intellij.platform.jewel.intUi.standalone" />
<orderEntry type="module" module-name="intellij.platform.jewel.markdown.extension.gfmAlerts" />
<orderEntry type="module" module-name="intellij.platform.jewel.markdown.extension.gfmTables" />
<orderEntry type="module" module-name="intellij.platform.jewel.markdown.extensions.gfmAlerts" />
<orderEntry type="module" module-name="intellij.platform.jewel.markdown.extensions.gfmTables" />
<orderEntry type="module" module-name="intellij.libraries.compose.foundation.desktop" />
<orderEntry type="module" module-name="intellij.libraries.compose.foundation.desktop.junit" scope="TEST" />
</component>

View File

@@ -4,6 +4,6 @@
<module name="intellij.platform.jewel.ui" />
<module name="intellij.platform.jewel.foundation" />
<module name="intellij.platform.jewel.intUi.standalone" />
<module name="intellij.platform.jewel.markdown.extension.gfmAlerts" />
<module name="intellij.platform.jewel.markdown.extensions.gfmAlerts"/>
</dependencies>
</idea-plugin>

View File

@@ -1,3 +1,4 @@
import io.gitlab.arturbosch.detekt.Detekt
import java.net.URI
plugins {
@@ -33,15 +34,14 @@ repositories {
dependencies {
intellijPlatform { intellijIdeaCommunity(libs.versions.idea) }
implementation(projects.samples.showcase) { exclude(group = "org.jetbrains.kotlinx") }
implementation(projects.ideLafBridge) { exclude(group = "org.jetbrains.kotlinx") }
implementation(projects.markdown.ideLafBridgeStyling) { exclude(group = "org.jetbrains.kotlinx") }
implementation(compose.desktop.currentOs) {
exclude(group = "org.jetbrains.compose.material")
exclude(group = "org.jetbrains.kotlinx")
}
implementation(project(":samples:showcase")) { exclude(group = "org.jetbrains.kotlinx") }
// TODO remove once https://youtrack.jetbrains.com/issue/IJPL-166436 is fixed
implementation("androidx.lifecycle:lifecycle-common-jvm:2.8.5") { exclude(group = "org.jetbrains.kotlinx") }
@@ -55,4 +55,8 @@ intellijPlatform {
autoReload = false
}
tasks { runIde { jvmArgs = listOf("-Xmx3g") } }
tasks {
runIde { jvmArgs = listOf("-Xmx3g") }
withType<Detekt>() { exclude("**/AndroidStudioReleases.kt") }
}

View File

@@ -15,7 +15,7 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.text.input.rememberTextFieldState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
@@ -53,7 +53,6 @@ import org.jetbrains.jewel.ui.component.EditableListComboBox
import org.jetbrains.jewel.ui.component.Icon
import org.jetbrains.jewel.ui.component.ListComboBox
import org.jetbrains.jewel.ui.component.OutlinedButton
import org.jetbrains.jewel.ui.component.SimpleListItem
import org.jetbrains.jewel.ui.component.Text
import org.jetbrains.jewel.ui.component.TextArea
import org.jetbrains.jewel.ui.component.TextField
@@ -197,7 +196,7 @@ internal class SwingComparisonTabPanel : BorderLayoutPanel() {
}
private fun Panel.comboBoxesRow() {
row("ComboBoxes:") {
row("Combo Boxes:") {
// Swing ComboBoxes
val zoomLevels = arrayOf("100%", "125%", "150%", "175%", "200%", "300%")
@@ -270,86 +269,68 @@ internal class SwingComparisonTabPanel : BorderLayoutPanel() {
"Joy",
)
}
var selectedComboBox1: String? by remember { mutableStateOf(comboBoxItems.first()) }
var selectedComboBox2: String? by remember { mutableStateOf(comboBoxItems.first()) }
var selectedComboBox3: String? by remember { mutableStateOf(comboBoxItems.first()) }
var selectedComboBox4: String? by remember { mutableStateOf(comboBoxItems.first()) }
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
Column {
var selectedIndex by remember { mutableIntStateOf(0) }
val selectedText: String = comboBoxItems[selectedIndex]
Text("Not editable")
Text(text = "Selected item: $selectedComboBox1")
Text(text = "Selected item: $selectedText")
ListComboBox(
items = comboBoxItems,
selectedIndex = selectedIndex,
onSelectedItemChange = { selectedIndex = it },
modifier = Modifier.width(200.dp),
onSelectedItemChange = { _, text -> selectedComboBox1 = text },
itemContent = { item, isSelected, isActive ->
SimpleListItem(
text = item,
isSelected = isSelected,
isActive = isActive,
iconContentDescription = item,
)
},
)
}
Column {
var selectedIndex by remember { mutableIntStateOf(0) }
val selectedText: String = comboBoxItems[selectedIndex]
Text("Not editable + disabled")
Text(text = "Selected item: $selectedComboBox2")
Text(text = "Selected item: $selectedText")
ListComboBox(
items = comboBoxItems,
selectedIndex = selectedIndex,
onSelectedItemChange = { selectedIndex = it },
modifier = Modifier.width(200.dp),
isEnabled = false,
onSelectedItemChange = { _, text -> selectedComboBox2 = text },
itemContent = { item, isSelected, isActive ->
SimpleListItem(
text = item,
isSelected = isSelected,
isActive = isActive,
iconContentDescription = item,
)
},
enabled = false,
)
}
Column {
var selectedIndex by remember { mutableIntStateOf(0) }
val selectedText: String = comboBoxItems[selectedIndex]
Text("Editable")
Text(text = "Selected item: $selectedComboBox3")
Text(text = "Selected item: $selectedText")
EditableListComboBox(
items = comboBoxItems,
selectedIndex = selectedIndex,
onSelectedItemChange = { selectedIndex = it },
modifier = Modifier.width(200.dp),
maxPopupHeight = 150.dp,
onSelectedItemChange = { _, text -> selectedComboBox3 = text },
itemContent = { item, isSelected, isActive ->
SimpleListItem(
text = item,
isSelected = isSelected,
isActive = isActive,
iconContentDescription = item,
)
},
)
}
Column {
var selectedIndex by remember { mutableIntStateOf(0) }
val selectedText: String = comboBoxItems[selectedIndex]
Text("Editable + disabled")
Text(text = "Selected item: $selectedComboBox4")
Text(text = "Selected item: $selectedText")
EditableListComboBox(
items = comboBoxItems,
selectedIndex = selectedIndex,
onSelectedItemChange = { selectedIndex = it },
modifier = Modifier.width(200.dp),
isEnabled = false,
onSelectedItemChange = { _, text -> selectedComboBox4 = text },
itemContent = { item, isSelected, isActive ->
SimpleListItem(
text = item,
isSelected = isSelected,
isActive = isActive,
iconContentDescription = item,
)
},
enabled = false,
)
}
}

View File

@@ -3,13 +3,12 @@ package org.jetbrains.jewel.samples.ideplugin.dialog
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.shape.CornerSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import com.intellij.ide.ui.UISettings
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.ModalityState
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.DialogWrapper
import com.intellij.toolWindow.ResizeStripeManager
@@ -24,6 +23,7 @@ import org.jetbrains.jewel.bridge.theme.macOs
import org.jetbrains.jewel.bridge.toDpSize
import org.jetbrains.jewel.bridge.toPaddingValues
import org.jetbrains.jewel.foundation.theme.JewelTheme
import org.jetbrains.jewel.intui.markdown.bridge.ProvideMarkdownStyling
import org.jetbrains.jewel.samples.showcase.views.ComponentsView
import org.jetbrains.jewel.samples.showcase.views.ComponentsViewModel
import org.jetbrains.jewel.ui.component.styling.IconButtonMetrics
@@ -32,9 +32,6 @@ import org.jetbrains.jewel.ui.theme.iconButtonStyle
internal class ComponentShowcaseDialog(project: Project) : DialogWrapper(project) {
init {
ApplicationManager.getApplication()
.invokeLater({ initializeComposeMainDispatcherChecker() }, ModalityState.any())
title = "Jewel Components Showcase"
init()
contentPanel.border = JBUI.Borders.empty()
@@ -43,7 +40,6 @@ internal class ComponentShowcaseDialog(project: Project) : DialogWrapper(project
override fun createSouthPanel(): JComponent? = null
@OptIn(ExperimentalLayoutApi::class)
override fun createCenterPanel(): JComponent {
val viewModel =
ComponentsViewModel(
@@ -54,33 +50,43 @@ internal class ComponentShowcaseDialog(project: Project) : DialogWrapper(project
val dialogPanel = JewelComposePanel {
val iconButtonMetrics = JewelTheme.iconButtonStyle.metrics
val uiSettings = UISettings.Companion.getInstance()
ComponentsView(
viewModel = viewModel,
toolbarButtonMetrics =
remember(uiSettings.compactMode, ResizeStripeManager.isShowNames()) {
iconButtonMetrics.tweak(
minSize = Toolbar.stripeToolbarButtonSize().toDpSize(),
// See com.intellij.openapi.wm.impl.SquareStripeButtonLook.getButtonArc
cornerSize =
retrieveArcAsCornerSizeOrDefault(
"Button.ToolWindow.arc",
CornerSize(if (uiSettings.compactMode) 4.dp else 6.dp),
),
padding =
Toolbar.stripeToolbarButtonIconPadding(
uiSettings.compactMode, // compactMode
ResizeStripeManager.isShowNames(), // showNames
)
.toPaddingValues(),
borderWidth = 0.dp,
)
},
)
ProvideMarkdownStyling { RootLayout(viewModel, uiSettings, iconButtonMetrics) }
}
dialogPanel.preferredSize = Dimension(800, 600)
return dialogPanel
}
@OptIn(ExperimentalLayoutApi::class)
@Composable
private fun RootLayout(
viewModel: ComponentsViewModel,
uiSettings: UISettings,
iconButtonMetrics: IconButtonMetrics,
) {
ComponentsView(
viewModel = viewModel,
toolbarButtonMetrics =
remember(uiSettings.compactMode, ResizeStripeManager.isShowNames()) {
iconButtonMetrics.tweak(
minSize = Toolbar.stripeToolbarButtonSize().toDpSize(),
// See com.intellij.openapi.wm.impl.SquareStripeButtonLook.getButtonArc
cornerSize =
retrieveArcAsCornerSizeOrDefault(
"Button.ToolWindow.arc",
CornerSize(if (uiSettings.compactMode) 4.dp else 6.dp),
),
padding =
Toolbar.stripeToolbarButtonIconPadding(
uiSettings.compactMode, // compactMode
ResizeStripeManager.isShowNames(), // showNames
)
.toPaddingValues(),
borderWidth = 0.dp,
)
},
)
}
private fun IconButtonMetrics.tweak(
cornerSize: CornerSize = this.cornerSize,
borderWidth: Dp = this.borderWidth,

Some files were not shown because too many files have changed in this diff Show More