From 2220a9e22c71765fe586d15a8504a0c12e659d85 Mon Sep 17 00:00:00 2001 From: Sebastiano Poggi Date: Thu, 9 May 2024 13:13:06 +0100 Subject: [PATCH] Move Markdown actual styling to bridge/standalone packages (#379) Having them all in the same package caused problems when trying to apply the style in the code; in particular, when your prod code uses bridge but the tests use standalone, you'd end up with both variants on the classpath, and it would be impossible to choose which one to use when. This moves all bridge theming to .bridge, and all standalone theming in .standalone, to clearly distinguish them. I also renamed the various theming files to fit the common naming pattern we use elsewhere in the library. --- .../api/ide-laf-bridge-styling.api | 11 +++++---- .../BridgeMarkdownBlockRendererExtensions.kt | 14 +++++++++++ .../BridgeProvideMarkdownStyling.kt} | 13 ++--------- .../styling/BridgeMarkdownStyling.kt} | 2 +- .../alerts/BridgeGitHubAlertStyling.kt} | 2 +- .../api/int-ui-standalone-styling.api | 13 +++++++---- .../IntUiMarkdownBlockRendererExtensions.kt | 23 +++++++++++++++++++ .../IntUiProvideMarkdownStyling.kt} | 23 +++---------------- .../styling/IntUiMarkdownStyling.kt} | 2 +- .../github/alerts/IntUiGitHubAlertStyling.kt} | 2 +- .../samples/ideplugin/ComponentShowcaseTab.kt | 2 +- .../view/markdown/MarkdownPreview.kt | 14 +++++------ 12 files changed, 69 insertions(+), 52 deletions(-) create mode 100644 markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/BridgeMarkdownBlockRendererExtensions.kt rename markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/{BridgeMarkdownBlockRendererExtensions.kt => bridge/BridgeProvideMarkdownStyling.kt} (67%) rename markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/{styling/MarkdownBridgeStyling.kt => bridge/styling/BridgeMarkdownStyling.kt} (99%) rename markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/{styling/extension/github/alerts/GitHubAlertBridgeStyling.kt => bridge/styling/extension/github/alerts/BridgeGitHubAlertStyling.kt} (98%) create mode 100644 markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/IntUiMarkdownBlockRendererExtensions.kt rename markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/{IntUiMarkdownBlockRendererExtensions.kt => standalone/IntUiProvideMarkdownStyling.kt} (65%) rename markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/{styling/MarkdownIntUiStyling.kt => standalone/styling/IntUiMarkdownStyling.kt} (99%) rename markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/{styling/extension/github/alerts/GitHubAlertDefaultStyling.kt => standalone/styling/extension/github/alerts/IntUiGitHubAlertStyling.kt} (99%) diff --git a/markdown/ide-laf-bridge-styling/api/ide-laf-bridge-styling.api b/markdown/ide-laf-bridge-styling/api/ide-laf-bridge-styling.api index e1e35d830..572c6fe0a 100644 --- a/markdown/ide-laf-bridge-styling/api/ide-laf-bridge-styling.api +++ b/markdown/ide-laf-bridge-styling/api/ide-laf-bridge-styling.api @@ -1,10 +1,13 @@ -public final class org/jetbrains/jewel/intui/markdown/BridgeMarkdownBlockRendererExtensionsKt { - public static final fun ProvideMarkdownStyling (Ljava/lang/String;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Lorg/jetbrains/jewel/markdown/processing/MarkdownProcessor;Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V +public final class org/jetbrains/jewel/intui/markdown/bridge/BridgeMarkdownBlockRendererExtensionsKt { public static final fun create (Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer$Companion;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Ljava/util/List;Lorg/jetbrains/jewel/markdown/rendering/InlineMarkdownRenderer;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer; public static synthetic fun create$default (Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer$Companion;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Ljava/util/List;Lorg/jetbrains/jewel/markdown/rendering/InlineMarkdownRenderer;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer; } -public final class org/jetbrains/jewel/intui/markdown/styling/MarkdownBridgeStylingKt { +public final class org/jetbrains/jewel/intui/markdown/bridge/BridgeProvideMarkdownStylingKt { + public static final fun ProvideMarkdownStyling (Ljava/lang/String;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Lorg/jetbrains/jewel/markdown/processing/MarkdownProcessor;Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V +} + +public final class org/jetbrains/jewel/intui/markdown/bridge/styling/BridgeMarkdownStylingKt { public static final fun create (Lorg/jetbrains/jewel/markdown/rendering/InlinesStyling$Companion;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/SpanStyle;Landroidx/compose/ui/text/SpanStyle;Landroidx/compose/ui/text/SpanStyle;Landroidx/compose/ui/text/SpanStyle;Landroidx/compose/ui/text/SpanStyle;Z)Lorg/jetbrains/jewel/markdown/rendering/InlinesStyling; public static final fun create (Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Code$Companion;Landroidx/compose/ui/text/TextStyle;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Code$Indented;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Code$Fenced;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Code; public static final fun create (Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$Companion;Landroidx/compose/ui/text/TextStyle;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H1;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H2;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H3;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H4;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H5;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H6;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading; @@ -48,7 +51,7 @@ public final class org/jetbrains/jewel/intui/markdown/styling/MarkdownBridgeStyl public static final fun retrieveEditorColorScheme ()Lcom/intellij/openapi/editor/colors/EditorColorsScheme; } -public final class org/jetbrains/jewel/intui/markdown/styling/extension/github/alerts/GitHubAlertBridgeStylingKt { +public final class org/jetbrains/jewel/intui/markdown/bridge/styling/extension/github/alerts/BridgeGitHubAlertStylingKt { public static final fun create (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling$Companion;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/NoteAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/TipAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/ImportantAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/WarningAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/CautionAlertStyling;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling; public static synthetic fun create$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling$Companion;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/NoteAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/TipAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/ImportantAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/WarningAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/CautionAlertStyling;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling; public static final fun create-gaOEZmc (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/CautionAlertStyling$Companion;Landroidx/compose/foundation/layout/PaddingValues;FJLandroidx/compose/ui/graphics/PathEffect;ILandroidx/compose/ui/text/TextStyle;Ljava/lang/String;JJ)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/CautionAlertStyling; diff --git a/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/BridgeMarkdownBlockRendererExtensions.kt b/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/BridgeMarkdownBlockRendererExtensions.kt new file mode 100644 index 000000000..ee0475428 --- /dev/null +++ b/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/BridgeMarkdownBlockRendererExtensions.kt @@ -0,0 +1,14 @@ +package org.jetbrains.jewel.intui.markdown.bridge + +import org.jetbrains.jewel.intui.markdown.bridge.styling.create +import org.jetbrains.jewel.markdown.extensions.MarkdownRendererExtension +import org.jetbrains.jewel.markdown.rendering.DefaultMarkdownBlockRenderer +import org.jetbrains.jewel.markdown.rendering.InlineMarkdownRenderer +import org.jetbrains.jewel.markdown.rendering.MarkdownBlockRenderer +import org.jetbrains.jewel.markdown.rendering.MarkdownStyling + +public fun MarkdownBlockRenderer.Companion.create( + styling: MarkdownStyling = MarkdownStyling.create(), + rendererExtensions: List = emptyList(), + inlineRenderer: InlineMarkdownRenderer = InlineMarkdownRenderer.default(), +): MarkdownBlockRenderer = DefaultMarkdownBlockRenderer(styling, rendererExtensions, inlineRenderer) diff --git a/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/BridgeMarkdownBlockRendererExtensions.kt b/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/BridgeProvideMarkdownStyling.kt similarity index 67% rename from markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/BridgeMarkdownBlockRendererExtensions.kt rename to markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/BridgeProvideMarkdownStyling.kt index 136462444..8029aa3d2 100644 --- a/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/BridgeMarkdownBlockRendererExtensions.kt +++ b/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/BridgeProvideMarkdownStyling.kt @@ -1,27 +1,18 @@ -package org.jetbrains.jewel.intui.markdown +package org.jetbrains.jewel.intui.markdown.bridge import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember import org.jetbrains.jewel.foundation.ExperimentalJewelApi import org.jetbrains.jewel.foundation.theme.JewelTheme -import org.jetbrains.jewel.intui.markdown.styling.create +import org.jetbrains.jewel.intui.markdown.bridge.styling.create import org.jetbrains.jewel.markdown.extensions.LocalMarkdownBlockRenderer import org.jetbrains.jewel.markdown.extensions.LocalMarkdownProcessor import org.jetbrains.jewel.markdown.extensions.LocalMarkdownStyling -import org.jetbrains.jewel.markdown.extensions.MarkdownRendererExtension import org.jetbrains.jewel.markdown.processing.MarkdownProcessor -import org.jetbrains.jewel.markdown.rendering.DefaultMarkdownBlockRenderer -import org.jetbrains.jewel.markdown.rendering.InlineMarkdownRenderer import org.jetbrains.jewel.markdown.rendering.MarkdownBlockRenderer import org.jetbrains.jewel.markdown.rendering.MarkdownStyling -public fun MarkdownBlockRenderer.Companion.create( - styling: MarkdownStyling = MarkdownStyling.create(), - rendererExtensions: List = emptyList(), - inlineRenderer: InlineMarkdownRenderer = InlineMarkdownRenderer.default(), -): MarkdownBlockRenderer = DefaultMarkdownBlockRenderer(styling, rendererExtensions, inlineRenderer) - @ExperimentalJewelApi @Composable public fun ProvideMarkdownStyling( diff --git a/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/MarkdownBridgeStyling.kt b/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/styling/BridgeMarkdownStyling.kt similarity index 99% rename from markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/MarkdownBridgeStyling.kt rename to markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/styling/BridgeMarkdownStyling.kt index 9feed0c80..730dcaef1 100644 --- a/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/MarkdownBridgeStyling.kt +++ b/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/styling/BridgeMarkdownStyling.kt @@ -1,4 +1,4 @@ -package org.jetbrains.jewel.intui.markdown.styling +package org.jetbrains.jewel.intui.markdown.bridge.styling import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.shape.RoundedCornerShape diff --git a/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/extension/github/alerts/GitHubAlertBridgeStyling.kt b/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/styling/extension/github/alerts/BridgeGitHubAlertStyling.kt similarity index 98% rename from markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/extension/github/alerts/GitHubAlertBridgeStyling.kt rename to markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/styling/extension/github/alerts/BridgeGitHubAlertStyling.kt index a38337523..977b8a3ea 100644 --- a/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/extension/github/alerts/GitHubAlertBridgeStyling.kt +++ b/markdown/ide-laf-bridge-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/bridge/styling/extension/github/alerts/BridgeGitHubAlertStyling.kt @@ -1,4 +1,4 @@ -package org.jetbrains.jewel.intui.markdown.styling.extension.github.alerts +package org.jetbrains.jewel.intui.markdown.bridge.styling.extension.github.alerts import androidx.compose.foundation.layout.PaddingValues import androidx.compose.ui.graphics.Color diff --git a/markdown/int-ui-standalone-styling/api/int-ui-standalone-styling.api b/markdown/int-ui-standalone-styling/api/int-ui-standalone-styling.api index 67ff71480..d3abb2584 100644 --- a/markdown/int-ui-standalone-styling/api/int-ui-standalone-styling.api +++ b/markdown/int-ui-standalone-styling/api/int-ui-standalone-styling.api @@ -1,13 +1,16 @@ -public final class org/jetbrains/jewel/intui/markdown/IntUiMarkdownBlockRendererExtensionsKt { - public static final fun ProvideMarkdownStyling (Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer;Lorg/jetbrains/jewel/markdown/processing/MarkdownProcessor;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V - public static final fun ProvideMarkdownStyling (ZLorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Lorg/jetbrains/jewel/markdown/processing/MarkdownProcessor;Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V +public final class org/jetbrains/jewel/intui/markdown/standalone/IntUiMarkdownBlockRendererExtensionsKt { public static final fun dark (Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer$Companion;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Ljava/util/List;Lorg/jetbrains/jewel/markdown/rendering/InlineMarkdownRenderer;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer; public static synthetic fun dark$default (Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer$Companion;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Ljava/util/List;Lorg/jetbrains/jewel/markdown/rendering/InlineMarkdownRenderer;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer; public static final fun light (Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer$Companion;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Ljava/util/List;Lorg/jetbrains/jewel/markdown/rendering/InlineMarkdownRenderer;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer; public static synthetic fun light$default (Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer$Companion;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Ljava/util/List;Lorg/jetbrains/jewel/markdown/rendering/InlineMarkdownRenderer;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer; } -public final class org/jetbrains/jewel/intui/markdown/styling/MarkdownIntUiStylingKt { +public final class org/jetbrains/jewel/intui/markdown/standalone/IntUiProvideMarkdownStylingKt { + public static final fun ProvideMarkdownStyling (Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer;Lorg/jetbrains/jewel/markdown/processing/MarkdownProcessor;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V + public static final fun ProvideMarkdownStyling (ZLorg/jetbrains/jewel/markdown/rendering/MarkdownStyling;Lorg/jetbrains/jewel/markdown/processing/MarkdownProcessor;Lorg/jetbrains/jewel/markdown/rendering/MarkdownBlockRenderer;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V +} + +public final class org/jetbrains/jewel/intui/markdown/standalone/styling/IntUiMarkdownStylingKt { public static final fun dark (Lorg/jetbrains/jewel/markdown/rendering/InlinesStyling$Companion;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/SpanStyle;Landroidx/compose/ui/text/SpanStyle;Landroidx/compose/ui/text/SpanStyle;Landroidx/compose/ui/text/SpanStyle;Landroidx/compose/ui/text/SpanStyle;Z)Lorg/jetbrains/jewel/markdown/rendering/InlinesStyling; public static final fun dark (Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Code$Companion;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Code$Indented;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Code$Fenced;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Code; public static final fun dark (Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$Companion;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H1;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H2;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H3;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H4;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H5;Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading$H6;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$Heading; @@ -88,7 +91,7 @@ public final class org/jetbrains/jewel/intui/markdown/styling/MarkdownIntUiStyli public static synthetic fun light-pI2OzKA$default (Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$BlockQuote$Companion;Landroidx/compose/foundation/layout/PaddingValues;FJLandroidx/compose/ui/graphics/PathEffect;IJILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/rendering/MarkdownStyling$BlockQuote; } -public final class org/jetbrains/jewel/intui/markdown/styling/extension/github/alerts/GitHubAlertDefaultStylingKt { +public final class org/jetbrains/jewel/intui/markdown/standalone/styling/extension/github/alerts/IntUiGitHubAlertStylingKt { public static final fun dark (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling$Companion;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/NoteAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/TipAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/ImportantAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/WarningAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/CautionAlertStyling;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling; public static synthetic fun dark$default (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling$Companion;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/NoteAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/TipAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/ImportantAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/WarningAlertStyling;Lorg/jetbrains/jewel/markdown/extensions/github/alerts/CautionAlertStyling;ILjava/lang/Object;)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/AlertStyling; public static final fun dark-gaOEZmc (Lorg/jetbrains/jewel/markdown/extensions/github/alerts/CautionAlertStyling$Companion;Landroidx/compose/foundation/layout/PaddingValues;FJLandroidx/compose/ui/graphics/PathEffect;ILandroidx/compose/ui/text/TextStyle;Ljava/lang/String;JJ)Lorg/jetbrains/jewel/markdown/extensions/github/alerts/CautionAlertStyling; diff --git a/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/IntUiMarkdownBlockRendererExtensions.kt b/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/IntUiMarkdownBlockRendererExtensions.kt new file mode 100644 index 000000000..942e2f108 --- /dev/null +++ b/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/IntUiMarkdownBlockRendererExtensions.kt @@ -0,0 +1,23 @@ +package org.jetbrains.jewel.intui.markdown.standalone + +import org.jetbrains.jewel.intui.markdown.standalone.styling.dark +import org.jetbrains.jewel.intui.markdown.standalone.styling.light +import org.jetbrains.jewel.markdown.extensions.MarkdownRendererExtension +import org.jetbrains.jewel.markdown.rendering.DefaultMarkdownBlockRenderer +import org.jetbrains.jewel.markdown.rendering.InlineMarkdownRenderer +import org.jetbrains.jewel.markdown.rendering.MarkdownBlockRenderer +import org.jetbrains.jewel.markdown.rendering.MarkdownStyling + +public fun MarkdownBlockRenderer.Companion.light( + styling: MarkdownStyling = MarkdownStyling.light(), + rendererExtensions: List = emptyList(), + inlineRenderer: InlineMarkdownRenderer = InlineMarkdownRenderer.default(), +): MarkdownBlockRenderer = + DefaultMarkdownBlockRenderer(styling, rendererExtensions, inlineRenderer) + +public fun MarkdownBlockRenderer.Companion.dark( + styling: MarkdownStyling = MarkdownStyling.dark(), + rendererExtensions: List = emptyList(), + inlineRenderer: InlineMarkdownRenderer = InlineMarkdownRenderer.default(), +): MarkdownBlockRenderer = + DefaultMarkdownBlockRenderer(styling, rendererExtensions, inlineRenderer) diff --git a/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/IntUiMarkdownBlockRendererExtensions.kt b/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/IntUiProvideMarkdownStyling.kt similarity index 65% rename from markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/IntUiMarkdownBlockRendererExtensions.kt rename to markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/IntUiProvideMarkdownStyling.kt index a6590aeaf..f0d4c1550 100644 --- a/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/IntUiMarkdownBlockRendererExtensions.kt +++ b/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/IntUiProvideMarkdownStyling.kt @@ -1,36 +1,19 @@ -package org.jetbrains.jewel.intui.markdown +package org.jetbrains.jewel.intui.markdown.standalone import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember import org.jetbrains.jewel.foundation.ExperimentalJewelApi import org.jetbrains.jewel.foundation.theme.JewelTheme -import org.jetbrains.jewel.intui.markdown.styling.dark -import org.jetbrains.jewel.intui.markdown.styling.light +import org.jetbrains.jewel.intui.markdown.standalone.styling.dark +import org.jetbrains.jewel.intui.markdown.standalone.styling.light import org.jetbrains.jewel.markdown.extensions.LocalMarkdownBlockRenderer import org.jetbrains.jewel.markdown.extensions.LocalMarkdownProcessor import org.jetbrains.jewel.markdown.extensions.LocalMarkdownStyling -import org.jetbrains.jewel.markdown.extensions.MarkdownRendererExtension import org.jetbrains.jewel.markdown.processing.MarkdownProcessor -import org.jetbrains.jewel.markdown.rendering.DefaultMarkdownBlockRenderer -import org.jetbrains.jewel.markdown.rendering.InlineMarkdownRenderer import org.jetbrains.jewel.markdown.rendering.MarkdownBlockRenderer import org.jetbrains.jewel.markdown.rendering.MarkdownStyling -public fun MarkdownBlockRenderer.Companion.light( - styling: MarkdownStyling = MarkdownStyling.light(), - rendererExtensions: List = emptyList(), - inlineRenderer: InlineMarkdownRenderer = InlineMarkdownRenderer.default(), -): MarkdownBlockRenderer = - DefaultMarkdownBlockRenderer(styling, rendererExtensions, inlineRenderer) - -public fun MarkdownBlockRenderer.Companion.dark( - styling: MarkdownStyling = MarkdownStyling.dark(), - rendererExtensions: List = emptyList(), - inlineRenderer: InlineMarkdownRenderer = InlineMarkdownRenderer.default(), -): MarkdownBlockRenderer = - DefaultMarkdownBlockRenderer(styling, rendererExtensions, inlineRenderer) - @ExperimentalJewelApi @Composable public fun ProvideMarkdownStyling( diff --git a/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/MarkdownIntUiStyling.kt b/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/styling/IntUiMarkdownStyling.kt similarity index 99% rename from markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/MarkdownIntUiStyling.kt rename to markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/styling/IntUiMarkdownStyling.kt index 1988411dc..0f3cd75f7 100644 --- a/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/MarkdownIntUiStyling.kt +++ b/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/styling/IntUiMarkdownStyling.kt @@ -1,4 +1,4 @@ -package org.jetbrains.jewel.intui.markdown.styling +package org.jetbrains.jewel.intui.markdown.standalone.styling import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.shape.RoundedCornerShape diff --git a/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/extension/github/alerts/GitHubAlertDefaultStyling.kt b/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/styling/extension/github/alerts/IntUiGitHubAlertStyling.kt similarity index 99% rename from markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/extension/github/alerts/GitHubAlertDefaultStyling.kt rename to markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/styling/extension/github/alerts/IntUiGitHubAlertStyling.kt index 2eccabcb1..047d8388e 100644 --- a/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/styling/extension/github/alerts/GitHubAlertDefaultStyling.kt +++ b/markdown/int-ui-standalone-styling/src/main/kotlin/org/jetbrains/jewel/intui/markdown/standalone/styling/extension/github/alerts/IntUiGitHubAlertStyling.kt @@ -1,4 +1,4 @@ -package org.jetbrains.jewel.intui.markdown.styling.extension.github.alerts +package org.jetbrains.jewel.intui.markdown.standalone.styling.extension.github.alerts import androidx.compose.foundation.layout.PaddingValues import androidx.compose.ui.graphics.Color diff --git a/samples/ide-plugin/src/main/kotlin/org/jetbrains/jewel/samples/ideplugin/ComponentShowcaseTab.kt b/samples/ide-plugin/src/main/kotlin/org/jetbrains/jewel/samples/ideplugin/ComponentShowcaseTab.kt index 0a311572f..acf25c994 100644 --- a/samples/ide-plugin/src/main/kotlin/org/jetbrains/jewel/samples/ideplugin/ComponentShowcaseTab.kt +++ b/samples/ide-plugin/src/main/kotlin/org/jetbrains/jewel/samples/ideplugin/ComponentShowcaseTab.kt @@ -36,7 +36,7 @@ import org.jetbrains.jewel.foundation.modifier.onActivated import org.jetbrains.jewel.foundation.modifier.trackActivation import org.jetbrains.jewel.foundation.modifier.trackComponentActivation import org.jetbrains.jewel.foundation.theme.JewelTheme -import org.jetbrains.jewel.intui.markdown.ProvideMarkdownStyling +import org.jetbrains.jewel.intui.markdown.bridge.ProvideMarkdownStyling import org.jetbrains.jewel.markdown.extensions.Markdown import org.jetbrains.jewel.ui.Orientation import org.jetbrains.jewel.ui.Outline diff --git a/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/markdown/MarkdownPreview.kt b/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/markdown/MarkdownPreview.kt index 3f2c4bab9..01ebffe0a 100644 --- a/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/markdown/MarkdownPreview.kt +++ b/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/markdown/MarkdownPreview.kt @@ -20,13 +20,13 @@ import androidx.compose.ui.unit.dp import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.jetbrains.jewel.foundation.theme.JewelTheme -import org.jetbrains.jewel.intui.markdown.ProvideMarkdownStyling -import org.jetbrains.jewel.intui.markdown.dark -import org.jetbrains.jewel.intui.markdown.light -import org.jetbrains.jewel.intui.markdown.styling.dark -import org.jetbrains.jewel.intui.markdown.styling.extension.github.alerts.dark -import org.jetbrains.jewel.intui.markdown.styling.extension.github.alerts.light -import org.jetbrains.jewel.intui.markdown.styling.light +import org.jetbrains.jewel.intui.markdown.standalone.ProvideMarkdownStyling +import org.jetbrains.jewel.intui.markdown.standalone.dark +import org.jetbrains.jewel.intui.markdown.standalone.light +import org.jetbrains.jewel.intui.markdown.standalone.styling.dark +import org.jetbrains.jewel.intui.markdown.standalone.styling.extension.github.alerts.dark +import org.jetbrains.jewel.intui.markdown.standalone.styling.extension.github.alerts.light +import org.jetbrains.jewel.intui.markdown.standalone.styling.light import org.jetbrains.jewel.markdown.MarkdownBlock import org.jetbrains.jewel.markdown.extension.autolink.AutolinkProcessorExtension import org.jetbrains.jewel.markdown.extensions.LazyMarkdown