mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[JEWEL-895, JEWEL-878] Clean up Markdown image extension
This cleans up a number of issues with the Markdown image extension:
1. APIs were not annotated as experimental, but everything under
Markdown should be
2. Coil3ImageRendererExtensionImpl was public for no good reason
3. The alt text for inline images was populated incorrectly
4. The dependencies were not set up correctly (partly not exported,
both in JPS and Gradle)
5. We were using an outdated Coil version
6. Naming conventions were not fully followed for the image loading
extension
7. The extension APIs were missing KDoc and the readme was not very
clear
8. In the sample and Markdown preview we were creating a new image
loader on every recomposition
9. We only had a composable way to init a new extension, when all we
needed was a Coil context
10. Some opportunistic cleanup of the Markdown sample, including
updating the Readme with more images
11. Images in Markdown were missing the tooltip with the alt text (if
any)
12. The Markdown editor in the standalone sample crashes at startup
(JEWEL-878)
(cherry picked from commit 12f160f42295fb7be53b08307c4a35881d9c2a85)
(cherry picked from commit 2c6f2b15dc86528c90ff1550b8338b8aea994f4b)
IJ-MR-169155
GitOrigin-RevId: de8caab868a3fbc59c08cb03b4eed950b43db358
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2e2e984d68
commit
9ec092f710
@@ -8373,48 +8373,87 @@ jvm_import(
|
||||
visibility = ["//visibility:public"]
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "platform-jewel-markdown-extensions-images-io-coil-kt-coil3-compose-core-jvm",
|
||||
jar = "@coil-compose-core-jvm-3_1_0_http//file",
|
||||
source_jar = "@coil-compose-core-jvm-3_1_0-sources_http//file",
|
||||
visibility = ["//visibility:public"]
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
java_library(
|
||||
name = "platform-jewel-markdown-extensions-images-io-coil-kt-coil3-compose-jvm",
|
||||
jar = "@coil-compose-jvm-3_1_0_http//file",
|
||||
source_jar = "@coil-compose-jvm-3_1_0-sources_http//file",
|
||||
exports = [
|
||||
":coil-compose-jvm-3_2_0_http_import",
|
||||
":coil-jvm-3_2_0_http_import",
|
||||
":coil-core-jvm-3_2_0_http_import",
|
||||
":okio-jvm-3_11_0_http_import",
|
||||
":coil-compose-core-jvm-3_2_0_http_import",
|
||||
],
|
||||
visibility = ["//visibility:public"]
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "platform-jewel-markdown-extensions-images-io-coil-kt-coil3-core-jvm",
|
||||
jar = "@coil-core-jvm-3_1_0_http//file",
|
||||
source_jar = "@coil-core-jvm-3_1_0-sources_http//file",
|
||||
visibility = ["//visibility:public"]
|
||||
name = "coil-compose-jvm-3_2_0_http_import",
|
||||
jar = "@coil-compose-jvm-3_2_0_http//file",
|
||||
source_jar = "@coil-compose-jvm-3_2_0-sources_http//file"
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "platform-jewel-markdown-extensions-images-io-coil-kt-coil3-network-core-jvm",
|
||||
jar = "@coil-network-core-jvm-3_1_0_http//file",
|
||||
source_jar = "@coil-network-core-jvm-3_1_0-sources_http//file",
|
||||
visibility = ["//visibility:public"]
|
||||
name = "coil-jvm-3_2_0_http_import",
|
||||
jar = "@coil-jvm-3_2_0_http//file",
|
||||
source_jar = "@coil-jvm-3_2_0-sources_http//file"
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "coil-core-jvm-3_2_0_http_import",
|
||||
jar = "@coil-core-jvm-3_2_0_http//file",
|
||||
source_jar = "@coil-core-jvm-3_2_0-sources_http//file"
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "okio-jvm-3_11_0_http_import",
|
||||
jar = "@okio-jvm-3_11_0_http//file",
|
||||
source_jar = "@okio-jvm-3_11_0-sources_http//file"
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "coil-compose-core-jvm-3_2_0_http_import",
|
||||
jar = "@coil-compose-core-jvm-3_2_0_http//file",
|
||||
source_jar = "@coil-compose-core-jvm-3_2_0-sources_http//file"
|
||||
)
|
||||
|
||||
java_library(
|
||||
name = "platform-jewel-markdown-extensions-images-io-coil-kt-coil3-network-ktor3-jvm",
|
||||
jar = "@coil-network-ktor3-jvm-3_1_0_http//file",
|
||||
source_jar = "@coil-network-ktor3-jvm-3_1_0-sources_http//file",
|
||||
exports = [
|
||||
":coil-network-ktor3-jvm-3_2_0_http_import",
|
||||
":coil-core-jvm-3_2_0_http_import",
|
||||
":okio-jvm-3_11_0_http_import",
|
||||
":coil-network-core-jvm-3_2_0_http_import",
|
||||
],
|
||||
visibility = ["//visibility:public"]
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "coil-network-ktor3-jvm-3_2_0_http_import",
|
||||
jar = "@coil-network-ktor3-jvm-3_2_0_http//file",
|
||||
source_jar = "@coil-network-ktor3-jvm-3_2_0-sources_http//file"
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "coil-network-core-jvm-3_2_0_http_import",
|
||||
jar = "@coil-network-core-jvm-3_2_0_http//file",
|
||||
source_jar = "@coil-network-core-jvm-3_2_0-sources_http//file"
|
||||
)
|
||||
|
||||
java_library(
|
||||
name = "platform-jewel-markdown-extensions-images-io-coil-kt-coil3-svg-jvm",
|
||||
jar = "@coil-svg-jvm-3_1_0_http//file",
|
||||
source_jar = "@coil-svg-jvm-3_1_0-sources_http//file",
|
||||
exports = [
|
||||
":coil-svg-jvm-3_2_0_http_import",
|
||||
":coil-core-jvm-3_2_0_http_import",
|
||||
":okio-jvm-3_11_0_http_import",
|
||||
],
|
||||
visibility = ["//visibility:public"]
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "coil-svg-jvm-3_2_0_http_import",
|
||||
jar = "@coil-svg-jvm-3_2_0_http//file",
|
||||
source_jar = "@coil-svg-jvm-3_2_0-sources_http//file"
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "platform-jewel-samples-standalone-com-darkrockstudios-mpfilepicker",
|
||||
jar = "@mpfilepicker-3_1_0_http//file",
|
||||
|
||||
118
lib/MODULE.bazel
118
lib/MODULE.bazel
@@ -11760,87 +11760,115 @@ http_file(
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-compose-core-jvm-3_1_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-compose-core-jvm/3.1.0/coil-compose-core-jvm-3.1.0.jar",
|
||||
sha256 = "8aa1d7ae1d11f969e8cdcc8fee42b7ee6a036e21f70567e3c3486edd9d7dc594",
|
||||
downloaded_file_path = "coil-compose-core-jvm-3.1.0.jar"
|
||||
name = "coil-compose-jvm-3_2_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-compose-jvm/3.2.0/coil-compose-jvm-3.2.0.jar",
|
||||
sha256 = "b135eafcff7545cba7e39c0c8d4e724c0f42e91050b10df5d635a6c7dfd3fb42",
|
||||
downloaded_file_path = "coil-compose-jvm-3.2.0.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-compose-core-jvm-3_1_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-compose-core-jvm/3.1.0/coil-compose-core-jvm-3.1.0-sources.jar",
|
||||
sha256 = "70ae99718a081cb53c353f8f60100960ab27c743465781b96fa2b237aa0f5ed2",
|
||||
downloaded_file_path = "coil-compose-core-jvm-3.1.0-sources.jar"
|
||||
name = "coil-jvm-3_2_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-jvm/3.2.0/coil-jvm-3.2.0.jar",
|
||||
sha256 = "7d0182c987052d6502135a6a6cc7cc68288ef48f990d75ad4c4ae03e25be786e",
|
||||
downloaded_file_path = "coil-jvm-3.2.0.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-compose-jvm-3_1_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-compose-jvm/3.1.0/coil-compose-jvm-3.1.0.jar",
|
||||
sha256 = "d43e0ed4566d30f8ce8e023539240b494be6fa69a1b8c81b4c32f5f465a7cc06",
|
||||
downloaded_file_path = "coil-compose-jvm-3.1.0.jar"
|
||||
name = "coil-core-jvm-3_2_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0.jar",
|
||||
sha256 = "2c64e5a3be4c59a2bf1ead26891cd9c455c37a2802d258ea50a960e7dd1e121a",
|
||||
downloaded_file_path = "coil-core-jvm-3.2.0.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-compose-jvm-3_1_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-compose-jvm/3.1.0/coil-compose-jvm-3.1.0-sources.jar",
|
||||
name = "okio-jvm-3_11_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0.jar",
|
||||
sha256 = "2d22541a192f901a45c95274567d6957ac1ed613d49e41db4e5e5d86139cf022",
|
||||
downloaded_file_path = "okio-jvm-3.11.0.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-compose-core-jvm-3_2_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-compose-core-jvm/3.2.0/coil-compose-core-jvm-3.2.0.jar",
|
||||
sha256 = "a74b96cb179fe8f872d4e9f03468e0477d32787e9b6430a9d137aafb76012a60",
|
||||
downloaded_file_path = "coil-compose-core-jvm-3.2.0.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-compose-jvm-3_2_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-compose-jvm/3.2.0/coil-compose-jvm-3.2.0-sources.jar",
|
||||
sha256 = "f9f84a9feaff1a4299ce2d4f4ba6d4de9cd36865f10676cdc9e798a58088002f",
|
||||
downloaded_file_path = "coil-compose-jvm-3.1.0-sources.jar"
|
||||
downloaded_file_path = "coil-compose-jvm-3.2.0-sources.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-core-jvm-3_1_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-core-jvm/3.1.0/coil-core-jvm-3.1.0.jar",
|
||||
sha256 = "6d44a11188c53f4eea2e87ebadc6aad90069132c9b029fc1b35aeb0added5ef7",
|
||||
downloaded_file_path = "coil-core-jvm-3.1.0.jar"
|
||||
name = "coil-jvm-3_2_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-jvm/3.2.0/coil-jvm-3.2.0-sources.jar",
|
||||
sha256 = "bb9cd4ab24eb9b64d5dee84a7733345d9b17fc90b570bea6c175a3a36b71891f",
|
||||
downloaded_file_path = "coil-jvm-3.2.0-sources.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-core-jvm-3_1_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-core-jvm/3.1.0/coil-core-jvm-3.1.0-sources.jar",
|
||||
sha256 = "3a8039b9e8de0755d0889d53816f02d567bd16e6a5548d3a79ead69d9e1e4b50",
|
||||
downloaded_file_path = "coil-core-jvm-3.1.0-sources.jar"
|
||||
name = "coil-core-jvm-3_2_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0-sources.jar",
|
||||
sha256 = "c0086b413bc0abf66c5727adc73ccb8fb0340cd505ef46ec85db5b8b9c7b5958",
|
||||
downloaded_file_path = "coil-core-jvm-3.2.0-sources.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-network-core-jvm-3_1_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-network-core-jvm/3.1.0/coil-network-core-jvm-3.1.0.jar",
|
||||
sha256 = "8332e45cf792cd24d9814744db84b0e6d33ec6eaf0724bd07ddc1fce7c55591f",
|
||||
downloaded_file_path = "coil-network-core-jvm-3.1.0.jar"
|
||||
name = "okio-jvm-3_11_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0-sources.jar",
|
||||
sha256 = "4cc11c760166d43da9653a5c27ddbf58a510bb8f35ff1aa3a1676206e56a0e4e",
|
||||
downloaded_file_path = "okio-jvm-3.11.0-sources.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-network-core-jvm-3_1_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-network-core-jvm/3.1.0/coil-network-core-jvm-3.1.0-sources.jar",
|
||||
sha256 = "b83d0d40b5f9074240a337fd33b42853c2a92049290623ce3b2c1d84fd1499a9",
|
||||
downloaded_file_path = "coil-network-core-jvm-3.1.0-sources.jar"
|
||||
name = "coil-compose-core-jvm-3_2_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-compose-core-jvm/3.2.0/coil-compose-core-jvm-3.2.0-sources.jar",
|
||||
sha256 = "c50eaefc0894c2d48f48c111c9cc1db2d642ac16991ffea4400bb9101665c817",
|
||||
downloaded_file_path = "coil-compose-core-jvm-3.2.0-sources.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-network-ktor3-jvm-3_1_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-network-ktor3-jvm/3.1.0/coil-network-ktor3-jvm-3.1.0.jar",
|
||||
sha256 = "cc4f9f8d6d447e7559cb9717c3a45dfbd351ddd06a34724001322512160b0215",
|
||||
downloaded_file_path = "coil-network-ktor3-jvm-3.1.0.jar"
|
||||
name = "coil-network-ktor3-jvm-3_2_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-network-ktor3-jvm/3.2.0/coil-network-ktor3-jvm-3.2.0.jar",
|
||||
sha256 = "377ea37e058df261bcc274ea0c947eccc67fec5a0499bdf646b99c2f34f74a6a",
|
||||
downloaded_file_path = "coil-network-ktor3-jvm-3.2.0.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-network-ktor3-jvm-3_1_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-network-ktor3-jvm/3.1.0/coil-network-ktor3-jvm-3.1.0-sources.jar",
|
||||
name = "coil-network-core-jvm-3_2_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-network-core-jvm/3.2.0/coil-network-core-jvm-3.2.0.jar",
|
||||
sha256 = "54cff2971fbcb1743b6d4cb6fb5bb863b4f6fae37002ec57a2fdf837b0c3242e",
|
||||
downloaded_file_path = "coil-network-core-jvm-3.2.0.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-network-ktor3-jvm-3_2_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-network-ktor3-jvm/3.2.0/coil-network-ktor3-jvm-3.2.0-sources.jar",
|
||||
sha256 = "8f1a55a9ed282fe77df261aa7e4d57172508a70843951af422cfcbf97e0ab349",
|
||||
downloaded_file_path = "coil-network-ktor3-jvm-3.1.0-sources.jar"
|
||||
downloaded_file_path = "coil-network-ktor3-jvm-3.2.0-sources.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-svg-jvm-3_1_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-svg-jvm/3.1.0/coil-svg-jvm-3.1.0.jar",
|
||||
sha256 = "413a53b4b6e0a40b851d1a99a01a4cd91ac0dc68facefddd7adfdb2d5456588f",
|
||||
downloaded_file_path = "coil-svg-jvm-3.1.0.jar"
|
||||
name = "coil-network-core-jvm-3_2_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-network-core-jvm/3.2.0/coil-network-core-jvm-3.2.0-sources.jar",
|
||||
sha256 = "b83d0d40b5f9074240a337fd33b42853c2a92049290623ce3b2c1d84fd1499a9",
|
||||
downloaded_file_path = "coil-network-core-jvm-3.2.0-sources.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-svg-jvm-3_1_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-svg-jvm/3.1.0/coil-svg-jvm-3.1.0-sources.jar",
|
||||
name = "coil-svg-jvm-3_2_0_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-svg-jvm/3.2.0/coil-svg-jvm-3.2.0.jar",
|
||||
sha256 = "e412715d1e447a43331f2ceb406435f28aafd7476a987de3d8222e6d39a8c84b",
|
||||
downloaded_file_path = "coil-svg-jvm-3.2.0.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "coil-svg-jvm-3_2_0-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/io/coil-kt/coil3/coil-svg-jvm/3.2.0/coil-svg-jvm-3.2.0-sources.jar",
|
||||
sha256 = "b12fe3352673d00d5b10f6585a456e3bb0a2f19aadf5d9efcb42bf97dbeb856f",
|
||||
downloaded_file_path = "coil-svg-jvm-3.1.0-sources.jar"
|
||||
downloaded_file_path = "coil-svg-jvm-3.2.0-sources.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
|
||||
@@ -238,13 +238,10 @@ object CommunityLibraryLicenses {
|
||||
.mit("https://github.com/twxs/vs.language.cmake/blob/master/LICENSE"),
|
||||
|
||||
// For loading images in Compose (used in Markdown preview, for example)
|
||||
LibraryLicense("Coil", libraryName = "io.coil.kt.coil3.core.jvm", url = "https://github.com/coil-kt/coil")
|
||||
LibraryLicense("Coil", libraryName = "io.coil.kt.coil3.compose.jvm", url = "https://github.com/coil-kt/coil")
|
||||
.additionalLibraryNames(
|
||||
"io.coil.kt.coil3.svg.jvm",
|
||||
"io.coil.kt.coil3.network.core.jvm",
|
||||
"io.coil.kt.coil3.network.ktor3.jvm",
|
||||
"io.coil.kt.coil3.compose.jvm",
|
||||
"io.coil.kt.coil3.compose.core.jvm",
|
||||
"io.coil.kt.coil3.svg.jvm",
|
||||
)
|
||||
.apache("https://github.com/coil-kt/coil/blob/main/README.md#license")
|
||||
.copyrightText("Copyright 2025 Coil Contributors"),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[versions]
|
||||
coil = "3.1.0"
|
||||
coil = "3.2.0"
|
||||
commonmark = "0.24.0"
|
||||
composeDesktop = "1.8.2"
|
||||
detekt = "1.23.8"
|
||||
@@ -18,7 +18,7 @@ kotlinxBinaryCompat = "0.17.0"
|
||||
ktfmtGradlePlugin = "0.23.0"
|
||||
|
||||
[libraries]
|
||||
coil-compose-core = { module = "io.coil-kt.coil3:coil-compose-core", version.ref = "coil" }
|
||||
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }
|
||||
# network is only needed in a standalone non-ide version
|
||||
coil-network-ktor3 = { module = "io.coil-kt.coil3:coil-network-ktor3", version.ref = "coil" }
|
||||
coil-svg = { module = "io.coil-kt.coil3:coil-svg", version.ref = "coil" }
|
||||
|
||||
@@ -168,7 +168,21 @@ public open class DefaultInlineMarkdownRenderer(rendererExtensions: List<Markdow
|
||||
currentTextStyle: TextStyle,
|
||||
) {
|
||||
// Each image source corresponds to one rendered image.
|
||||
appendInlineContent(node.source, "")
|
||||
appendInlineContent(
|
||||
node.source,
|
||||
buildString {
|
||||
append(" 
|
||||
append(node.source)
|
||||
if (!node.title.isNullOrBlank()) {
|
||||
append(" \"")
|
||||
append(node.title)
|
||||
append("\"")
|
||||
}
|
||||
append(") ")
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
// The T type parameter is needed to avoid issues with capturing lambdas
|
||||
|
||||
@@ -534,8 +534,8 @@ public open class DefaultMarkdownBlockRenderer(
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun renderedImages(blockInlineContent: WithInlineMarkdown): Map<String, InlineTextContent> {
|
||||
return rendererExtensions
|
||||
private fun renderedImages(blockInlineContent: WithInlineMarkdown): Map<String, InlineTextContent> =
|
||||
rendererExtensions
|
||||
.firstNotNullOfOrNull { it.imageRendererExtension }
|
||||
?.let { imagesRenderer ->
|
||||
getImages(blockInlineContent).associate { image ->
|
||||
@@ -543,7 +543,6 @@ public open class DefaultMarkdownBlockRenderer(
|
||||
}
|
||||
}
|
||||
.orEmpty()
|
||||
}
|
||||
|
||||
@Composable
|
||||
protected fun MaybeScrollingContainer(
|
||||
@@ -584,8 +583,9 @@ private fun getImages(input: WithInlineMarkdown): List<InlineMarkdown.Image> = b
|
||||
is WithInlineMarkdown -> {
|
||||
collectImagesRecursively(item.inlineContent)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
else -> {
|
||||
// Ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,16 +33,14 @@ jvm_library(
|
||||
"//platform/jewel/ui",
|
||||
"//platform/jewel/foundation",
|
||||
"//libraries/compose-foundation-desktop",
|
||||
"@lib//:platform-jewel-markdown-extensions-images-io-coil-kt-coil3-core-jvm",
|
||||
"@lib//:platform-jewel-markdown-extensions-images-io-coil-kt-coil3-compose-core-jvm",
|
||||
"@lib//:platform-jewel-markdown-extensions-images-io-coil-kt-coil3-compose-jvm",
|
||||
"@lib//:platform-jewel-markdown-extensions-images-io-coil-kt-coil3-network-core-jvm",
|
||||
"@lib//:platform-jewel-markdown-extensions-images-io-coil-kt-coil3-network-ktor3-jvm",
|
||||
"@lib//:platform-jewel-markdown-extensions-images-io-coil-kt-coil3-svg-jvm",
|
||||
"@lib//:ktor-client-java",
|
||||
],
|
||||
exports = [
|
||||
"@lib//:platform-jewel-markdown-extensions-images-io-coil-kt-coil3-compose-core-jvm",
|
||||
"@lib//:platform-jewel-markdown-extensions-images-io-coil-kt-coil3-compose-jvm",
|
||||
"@lib//:platform-jewel-markdown-extensions-images-io-coil-kt-coil3-network-ktor3-jvm",
|
||||
"@lib//:platform-jewel-markdown-extensions-images-io-coil-kt-coil3-svg-jvm",
|
||||
],
|
||||
runtime_deps = [":images_resources"],
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Images module
|
||||
|
||||
This module adds support for inline images, typically rendered from `` syntax.
|
||||
It's based on core CommonMark but allows users to not depend on Coil if they don't need images support
|
||||
and avoiding runtime image loading dependencies.
|
||||
|
||||
It's based on core CommonMark but allows users to not depend on Coil if they don't need images support and avoid runtime image loading dependencies.
|
||||
|
||||
* No Coil or UI image loading logic is included in the image parser module.
|
||||
* Keeps the structure modular, consistent with how other extensions are handled.
|
||||
@@ -10,5 +10,7 @@ and avoiding runtime image loading dependencies.
|
||||
## Usage
|
||||
|
||||
To use the image module, add the `Coil3ImagesRendererExtension` to your `rendererExtensions`.
|
||||
If you don't want to use library-specific image loader, you can pass it as a parameter,
|
||||
but you have to handle its initialization as well as making sure it's the same instance.
|
||||
|
||||
While this extension provides a utility function to create an instance quickly, you should always prefer using a shared `ImageLoader` instance for
|
||||
the entire application/plugin instead, so it can share the cache and contain memory usage. The utility function creates a basic loader with a small
|
||||
in-memory cache only, and it is not recommended to be used except in very simple cases.
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
f:org.jetbrains.jewel.markdown.extensions.images.Coil3ImagesRendererExtension
|
||||
f:org.jetbrains.jewel.markdown.extensions.images.Coil3ImageRendererExtension
|
||||
- org.jetbrains.jewel.markdown.extensions.MarkdownRendererExtension
|
||||
- sf:$stable:I
|
||||
- sf:Companion:org.jetbrains.jewel.markdown.extensions.images.Coil3ImagesRendererExtension$Companion
|
||||
- sf:Companion:org.jetbrains.jewel.markdown.extensions.images.Coil3ImageRendererExtension$Companion
|
||||
- <init>(coil3.ImageLoader):V
|
||||
- getImageRendererExtension():org.jetbrains.jewel.markdown.extensions.ImageRendererExtension
|
||||
f:org.jetbrains.jewel.markdown.extensions.images.Coil3ImagesRendererExtension$Companion
|
||||
- f:withDefaultLoader(androidx.compose.runtime.Composer,I):org.jetbrains.jewel.markdown.extensions.images.Coil3ImagesRendererExtension
|
||||
f:org.jetbrains.jewel.markdown.extensions.images.Coil3ImagesRendererExtensionImpl
|
||||
- org.jetbrains.jewel.markdown.extensions.ImageRendererExtension
|
||||
- sf:$stable:I
|
||||
- <init>(coil3.ImageLoader):V
|
||||
- renderImagesContent(org.jetbrains.jewel.markdown.InlineMarkdown$Image,androidx.compose.runtime.Composer,I):androidx.compose.foundation.text.InlineTextContent
|
||||
f:org.jetbrains.jewel.markdown.extensions.images.Coil3ImageRendererExtension$Companion
|
||||
- f:withDefaultLoader(androidx.compose.runtime.Composer,I):org.jetbrains.jewel.markdown.extensions.images.Coil3ImageRendererExtension
|
||||
- f:withDefaultLoader(coil3.PlatformContext):org.jetbrains.jewel.markdown.extensions.images.Coil3ImageRendererExtension
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
public final class org/jetbrains/jewel/markdown/extensions/images/Coil3ImagesRendererExtension : org/jetbrains/jewel/markdown/extensions/MarkdownRendererExtension {
|
||||
public final class org/jetbrains/jewel/markdown/extensions/images/Coil3ImageRendererExtension : org/jetbrains/jewel/markdown/extensions/MarkdownRendererExtension {
|
||||
public static final field $stable I
|
||||
public static final field Companion Lorg/jetbrains/jewel/markdown/extensions/images/Coil3ImagesRendererExtension$Companion;
|
||||
public static final field Companion Lorg/jetbrains/jewel/markdown/extensions/images/Coil3ImageRendererExtension$Companion;
|
||||
public fun <init> (Lcoil3/ImageLoader;)V
|
||||
public fun getBlockRenderer ()Lorg/jetbrains/jewel/markdown/extensions/MarkdownBlockRendererExtension;
|
||||
public fun getDelimitedInlineRenderer ()Lorg/jetbrains/jewel/markdown/extensions/MarkdownDelimitedInlineRendererExtension;
|
||||
public fun getImageRendererExtension ()Lorg/jetbrains/jewel/markdown/extensions/ImageRendererExtension;
|
||||
}
|
||||
|
||||
public final class org/jetbrains/jewel/markdown/extensions/images/Coil3ImagesRendererExtension$Companion {
|
||||
public final fun withDefaultLoader (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/markdown/extensions/images/Coil3ImagesRendererExtension;
|
||||
}
|
||||
|
||||
public final class org/jetbrains/jewel/markdown/extensions/images/Coil3ImagesRendererExtensionImpl : org/jetbrains/jewel/markdown/extensions/ImageRendererExtension {
|
||||
public static final field $stable I
|
||||
public fun <init> (Lcoil3/ImageLoader;)V
|
||||
public fun renderImagesContent (Lorg/jetbrains/jewel/markdown/InlineMarkdown$Image;Landroidx/compose/runtime/Composer;I)Landroidx/compose/foundation/text/InlineTextContent;
|
||||
public final class org/jetbrains/jewel/markdown/extensions/images/Coil3ImageRendererExtension$Companion {
|
||||
public final fun withDefaultLoader (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/markdown/extensions/images/Coil3ImageRendererExtension;
|
||||
public final fun withDefaultLoader (Lcoil3/PlatformContext;)Lorg/jetbrains/jewel/markdown/extensions/images/Coil3ImageRendererExtension;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,12 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(libs.coil.compose)
|
||||
api(libs.coil.network.ktor3)
|
||||
api(libs.coil.svg)
|
||||
|
||||
implementation(projects.markdown.core)
|
||||
runtimeOnly(libs.ktor.client.java)
|
||||
implementation(libs.coil.compose.core)
|
||||
implementation(libs.coil.network.ktor3)
|
||||
implementation(libs.coil.svg)
|
||||
testImplementation(compose.desktop.uiTestJUnit4)
|
||||
}
|
||||
|
||||
@@ -19,5 +20,3 @@ publishing.publications.named<MavenPublication>("main") {
|
||||
val ijpTarget = project.property("ijp.target") as String
|
||||
artifactId = "jewel-markdown-extension-${project.name}-$ijpTarget"
|
||||
}
|
||||
|
||||
publicApiValidation { excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.extensions.images.*") }
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
androidx/compose/**
|
||||
coil3/ImageLoader
|
||||
coil3/**
|
||||
|
||||
@@ -36,114 +36,180 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.jewel.ui" />
|
||||
<orderEntry type="module" module-name="intellij.platform.jewel.foundation" />
|
||||
<orderEntry type="module" module-name="intellij.libraries.compose.foundation.desktop" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="io.coil.kt.coil3.core.jvm" type="repository">
|
||||
<properties include-transitive-deps="false" maven-id="io.coil-kt.coil3:coil-core-jvm:3.1.0">
|
||||
<verification>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.1.0/coil-core-jvm-3.1.0.jar">
|
||||
<sha256sum>6d44a11188c53f4eea2e87ebadc6aad90069132c9b029fc1b35aeb0added5ef7</sha256sum>
|
||||
</artifact>
|
||||
</verification>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.1.0/coil-core-jvm-3.1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.1.0/coil-core-jvm-3.1.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library name="io.coil.kt.coil3.compose.core.jvm" type="repository">
|
||||
<properties include-transitive-deps="false" maven-id="io.coil-kt.coil3:coil-compose-core-jvm:3.1.0">
|
||||
<verification>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-core-jvm/3.1.0/coil-compose-core-jvm-3.1.0.jar">
|
||||
<sha256sum>8aa1d7ae1d11f969e8cdcc8fee42b7ee6a036e21f70567e3c3486edd9d7dc594</sha256sum>
|
||||
</artifact>
|
||||
</verification>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-core-jvm/3.1.0/coil-compose-core-jvm-3.1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-core-jvm/3.1.0/coil-compose-core-jvm-3.1.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library name="io.coil.kt.coil3.compose.jvm" type="repository">
|
||||
<properties include-transitive-deps="false" maven-id="io.coil-kt.coil3:coil-compose-jvm:3.1.0">
|
||||
<properties maven-id="io.coil-kt.coil3:coil-compose-jvm:3.2.0">
|
||||
<verification>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-jvm/3.1.0/coil-compose-jvm-3.1.0.jar">
|
||||
<sha256sum>d43e0ed4566d30f8ce8e023539240b494be6fa69a1b8c81b4c32f5f465a7cc06</sha256sum>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-jvm/3.2.0/coil-compose-jvm-3.2.0.jar">
|
||||
<sha256sum>b135eafcff7545cba7e39c0c8d4e724c0f42e91050b10df5d635a6c7dfd3fb42</sha256sum>
|
||||
</artifact>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-jvm/3.2.0/coil-jvm-3.2.0.jar">
|
||||
<sha256sum>7d0182c987052d6502135a6a6cc7cc68288ef48f990d75ad4c4ae03e25be786e</sha256sum>
|
||||
</artifact>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0.jar">
|
||||
<sha256sum>2c64e5a3be4c59a2bf1ead26891cd9c455c37a2802d258ea50a960e7dd1e121a</sha256sum>
|
||||
</artifact>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0.jar">
|
||||
<sha256sum>2d22541a192f901a45c95274567d6957ac1ed613d49e41db4e5e5d86139cf022</sha256sum>
|
||||
</artifact>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-core-jvm/3.2.0/coil-compose-core-jvm-3.2.0.jar">
|
||||
<sha256sum>a74b96cb179fe8f872d4e9f03468e0477d32787e9b6430a9d137aafb76012a60</sha256sum>
|
||||
</artifact>
|
||||
</verification>
|
||||
<exclude>
|
||||
<dependency maven-id="org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose-desktop" />
|
||||
<dependency maven-id="org.jetbrains:annotations" />
|
||||
<dependency maven-id="org.jetbrains.compose.animation:animation-core-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.animation:animation-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.foundation:foundation-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.foundation:foundation-layout-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.runtime:runtime-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.runtime:runtime-saveable-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.ui:ui-backhandler-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.ui:ui-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.ui:ui-geometry-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.ui:ui-graphics-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.ui:ui-text-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.ui:ui-unit-desktop" />
|
||||
<dependency maven-id="org.jetbrains.compose.ui:ui-util-desktop" />
|
||||
<dependency maven-id="org.jetbrains.kotlin:kotlin-stdlib-jdk7" />
|
||||
<dependency maven-id="org.jetbrains.kotlin:kotlin-stdlib-jdk8" />
|
||||
<dependency maven-id="org.jetbrains.kotlin:kotlin-stdlib" />
|
||||
<dependency maven-id="org.jetbrains.kotlinx:atomicfu-jvm" />
|
||||
<dependency maven-id="org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm" />
|
||||
<dependency maven-id="org.jetbrains.kotlinx:kotlinx-coroutines-core" />
|
||||
<dependency maven-id="org.jetbrains.skiko:skiko-awt" />
|
||||
<dependency maven-id="androidx.annotation:annotation-jvm" />
|
||||
<dependency maven-id="androidx.annotation:annotation" />
|
||||
<dependency maven-id="androidx.arch.core:core-common" />
|
||||
<dependency maven-id="androidx.collection:collection-jvm" />
|
||||
<dependency maven-id="androidx.lifecycle:lifecycle-common-jvm" />
|
||||
<dependency maven-id="androidx.lifecycle:lifecycle-runtime-desktop" />
|
||||
<dependency maven-id="androidx.lifecycle:lifecycle-viewmodel-desktop" />
|
||||
</exclude>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-jvm/3.1.0/coil-compose-jvm-3.1.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-jvm/3.2.0/coil-compose-jvm-3.2.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-jvm/3.2.0/coil-jvm-3.2.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-core-jvm/3.2.0/coil-compose-core-jvm-3.2.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-jvm/3.2.0/coil-compose-jvm-3.2.0-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-jvm/3.2.0/coil-jvm-3.2.0-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-core-jvm/3.2.0/coil-compose-core-jvm-3.2.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-jvm/3.1.0/coil-compose-jvm-3.1.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-jvm/3.2.0/coil-compose-jvm-3.2.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-jvm/3.2.0/coil-jvm-3.2.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-compose-core-jvm/3.2.0/coil-compose-core-jvm-3.2.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="io.coil.kt.coil3.network.core.jvm" type="repository">
|
||||
<properties include-transitive-deps="false" maven-id="io.coil-kt.coil3:coil-network-core-jvm:3.1.0">
|
||||
<verification>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-core-jvm/3.1.0/coil-network-core-jvm-3.1.0.jar">
|
||||
<sha256sum>8332e45cf792cd24d9814744db84b0e6d33ec6eaf0724bd07ddc1fce7c55591f</sha256sum>
|
||||
</artifact>
|
||||
</verification>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-core-jvm/3.1.0/coil-network-core-jvm-3.1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-core-jvm/3.1.0/coil-network-core-jvm-3.1.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library name="io.coil.kt.coil3.network.ktor3.jvm" type="repository">
|
||||
<properties include-transitive-deps="false" maven-id="io.coil-kt.coil3:coil-network-ktor3-jvm:3.1.0">
|
||||
<properties maven-id="io.coil-kt.coil3:coil-network-ktor3-jvm:3.2.0">
|
||||
<verification>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-ktor3-jvm/3.1.0/coil-network-ktor3-jvm-3.1.0.jar">
|
||||
<sha256sum>cc4f9f8d6d447e7559cb9717c3a45dfbd351ddd06a34724001322512160b0215</sha256sum>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-ktor3-jvm/3.2.0/coil-network-ktor3-jvm-3.2.0.jar">
|
||||
<sha256sum>377ea37e058df261bcc274ea0c947eccc67fec5a0499bdf646b99c2f34f74a6a</sha256sum>
|
||||
</artifact>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0.jar">
|
||||
<sha256sum>2c64e5a3be4c59a2bf1ead26891cd9c455c37a2802d258ea50a960e7dd1e121a</sha256sum>
|
||||
</artifact>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0.jar">
|
||||
<sha256sum>2d22541a192f901a45c95274567d6957ac1ed613d49e41db4e5e5d86139cf022</sha256sum>
|
||||
</artifact>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-core-jvm/3.2.0/coil-network-core-jvm-3.2.0.jar">
|
||||
<sha256sum>54cff2971fbcb1743b6d4cb6fb5bb863b4f6fae37002ec57a2fdf837b0c3242e</sha256sum>
|
||||
</artifact>
|
||||
</verification>
|
||||
<exclude>
|
||||
<dependency maven-id="io.ktor:ktor-client-core-jvm" />
|
||||
<dependency maven-id="io.ktor:ktor-events-jvm" />
|
||||
<dependency maven-id="io.ktor:ktor-http-cio-jvm" />
|
||||
<dependency maven-id="io.ktor:ktor-http-jvm" />
|
||||
<dependency maven-id="io.ktor:ktor-io-jvm" />
|
||||
<dependency maven-id="io.ktor:ktor-network-jvm" />
|
||||
<dependency maven-id="io.ktor:ktor-serialization-jvm" />
|
||||
<dependency maven-id="io.ktor:ktor-sse-jvm" />
|
||||
<dependency maven-id="io.ktor:ktor-utils-jvm" />
|
||||
<dependency maven-id="io.ktor:ktor-websocket-serialization-jvm" />
|
||||
<dependency maven-id="io.ktor:ktor-websockets-jvm" />
|
||||
<dependency maven-id="org.jetbrains:annotations" />
|
||||
<dependency maven-id="org.jetbrains.kotlin:kotlin-stdlib" />
|
||||
<dependency maven-id="org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm" />
|
||||
<dependency maven-id="org.jetbrains.kotlinx:kotlinx-coroutines-slf4j" />
|
||||
<dependency maven-id="org.jetbrains.kotlinx:kotlinx-io-bytestring-jvm" />
|
||||
<dependency maven-id="org.jetbrains.kotlinx:kotlinx-io-core-jvm" />
|
||||
<dependency maven-id="org.jetbrains.kotlinx:kotlinx-serialization-core-jvm" />
|
||||
<dependency maven-id="org.jetbrains.skiko:skiko-awt" />
|
||||
<dependency maven-id="org.slf4j:slf4j-api" />
|
||||
</exclude>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-ktor3-jvm/3.1.0/coil-network-ktor3-jvm-3.1.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-ktor3-jvm/3.2.0/coil-network-ktor3-jvm-3.2.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-core-jvm/3.2.0/coil-network-core-jvm-3.2.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-ktor3-jvm/3.2.0/coil-network-ktor3-jvm-3.2.0-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-core-jvm/3.2.0/coil-network-core-jvm-3.2.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-ktor3-jvm/3.1.0/coil-network-ktor3-jvm-3.1.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-ktor3-jvm/3.2.0/coil-network-ktor3-jvm-3.2.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-network-core-jvm/3.2.0/coil-network-core-jvm-3.2.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library name="io.coil.kt.coil3.svg.jvm" type="repository">
|
||||
<properties include-transitive-deps="false" maven-id="io.coil-kt.coil3:coil-svg-jvm:3.1.0">
|
||||
<properties maven-id="io.coil-kt.coil3:coil-svg-jvm:3.2.0">
|
||||
<verification>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-svg-jvm/3.1.0/coil-svg-jvm-3.1.0.jar">
|
||||
<sha256sum>413a53b4b6e0a40b851d1a99a01a4cd91ac0dc68facefddd7adfdb2d5456588f</sha256sum>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-svg-jvm/3.2.0/coil-svg-jvm-3.2.0.jar">
|
||||
<sha256sum>e412715d1e447a43331f2ceb406435f28aafd7476a987de3d8222e6d39a8c84b</sha256sum>
|
||||
</artifact>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0.jar">
|
||||
<sha256sum>2c64e5a3be4c59a2bf1ead26891cd9c455c37a2802d258ea50a960e7dd1e121a</sha256sum>
|
||||
</artifact>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0.jar">
|
||||
<sha256sum>2d22541a192f901a45c95274567d6957ac1ed613d49e41db4e5e5d86139cf022</sha256sum>
|
||||
</artifact>
|
||||
</verification>
|
||||
<exclude>
|
||||
<dependency maven-id="org.jetbrains:annotations" />
|
||||
<dependency maven-id="org.jetbrains.kotlin:kotlin-stdlib" />
|
||||
<dependency maven-id="org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm" />
|
||||
<dependency maven-id="org.jetbrains.skiko:skiko-awt" />
|
||||
</exclude>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-svg-jvm/3.1.0/coil-svg-jvm-3.1.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-svg-jvm/3.2.0/coil-svg-jvm-3.2.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-svg-jvm/3.2.0/coil-svg-jvm-3.2.0-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-svg-jvm/3.1.0/coil-svg-jvm-3.1.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-svg-jvm/3.2.0/coil-svg-jvm-3.2.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/coil-kt/coil3/coil-core-jvm/3.2.0/coil-core-jvm-3.2.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio-jvm/3.11.0/okio-jvm-3.11.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="ktor-client-java" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.libraries.compose.foundation.desktop.junit" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.jetbrains.jewel.markdown.extensions.images
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import coil3.ImageLoader
|
||||
import coil3.PlatformContext
|
||||
import coil3.compose.LocalPlatformContext
|
||||
import coil3.memory.MemoryCache
|
||||
import org.jetbrains.jewel.foundation.ExperimentalJewelApi
|
||||
import org.jetbrains.jewel.markdown.extensions.ImageRendererExtension
|
||||
import org.jetbrains.jewel.markdown.extensions.MarkdownRendererExtension
|
||||
|
||||
private const val DEFAULT_MEMORY_CACHE_SIZE: Long = 20 * 1024 * 1024 // 20 MB
|
||||
|
||||
/**
|
||||
* A [MarkdownRendererExtension] for rendering images using the Coil3 library.
|
||||
*
|
||||
* This extension enables the display of images specified in Markdown, for example: ``.
|
||||
*
|
||||
* It requires an [ImageLoader] to handle fetching and displaying images. For optimal performance and resource
|
||||
* management (e.g., shared memory and disk caches), it is recommended to provide a single, app-wide [ImageLoader]
|
||||
* instance via the constructor.
|
||||
*/
|
||||
@ExperimentalJewelApi
|
||||
public class Coil3ImageRendererExtension(private val imageLoader: ImageLoader) : MarkdownRendererExtension {
|
||||
override val imageRendererExtension: ImageRendererExtension
|
||||
get() = Coil3ImageRendererExtensionImpl(imageLoader)
|
||||
|
||||
public companion object {
|
||||
/**
|
||||
* A default image loader with a limited in-memory cache.
|
||||
*
|
||||
* This shouldn't be used if there is an app-wide image loader already available; instead, use the constructor
|
||||
* to pass in the already available image loader.
|
||||
*
|
||||
* Note that every invocation creates a new [ImageLoader]; it is not recommended to call this method multiple
|
||||
* times in a process. Instead, create one top-level instance and share it throughout the process if at all
|
||||
* possible.
|
||||
*/
|
||||
@ExperimentalJewelApi
|
||||
@Composable
|
||||
public fun withDefaultLoader(): Coil3ImageRendererExtension = withDefaultLoader(LocalPlatformContext.current)
|
||||
|
||||
/**
|
||||
* A default image loader with a limited in-memory cache.
|
||||
*
|
||||
* This shouldn't be used if there is an app-wide image loader already available; instead, use the constructor
|
||||
* to pass in the already available image loader.
|
||||
*
|
||||
* Note that every invocation creates a new [ImageLoader]; it is not recommended to call this method multiple
|
||||
* times in a process. Instead, create one top-level instance and share it throughout the process if at all
|
||||
* possible.
|
||||
*
|
||||
* @param context The [PlatformContext] to use to create the [ImageLoader].
|
||||
*/
|
||||
@ExperimentalJewelApi
|
||||
public fun withDefaultLoader(context: PlatformContext): Coil3ImageRendererExtension =
|
||||
Coil3ImageRendererExtension(
|
||||
ImageLoader.Builder(context)
|
||||
.memoryCache { MemoryCache.Builder().maxSizeBytes { DEFAULT_MEMORY_CACHE_SIZE }.build() }
|
||||
.build()
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package org.jetbrains.jewel.markdown.extensions.images
|
||||
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.text.InlineTextContent
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.pointer.PointerIcon
|
||||
import androidx.compose.ui.input.pointer.pointerHoverIcon
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.text.Placeholder
|
||||
import androidx.compose.ui.text.PlaceholderVerticalAlign
|
||||
import androidx.compose.ui.unit.DpSize
|
||||
import androidx.compose.ui.unit.sp
|
||||
import coil3.ImageLoader
|
||||
import coil3.compose.AsyncImage
|
||||
import coil3.compose.LocalPlatformContext
|
||||
import coil3.request.ImageRequest
|
||||
import coil3.size.Size
|
||||
import org.jetbrains.jewel.foundation.util.JewelLogger
|
||||
import org.jetbrains.jewel.markdown.InlineMarkdown
|
||||
import org.jetbrains.jewel.markdown.extensions.ImageRendererExtension
|
||||
import org.jetbrains.jewel.ui.component.Text
|
||||
import org.jetbrains.jewel.ui.component.Tooltip
|
||||
|
||||
/**
|
||||
* Renders Markdown images using Coil3.
|
||||
*
|
||||
* This implementation uses [AsyncImage] to load and display images. It reserves space for the image with a
|
||||
* [Placeholder] and updates its size upon successful loading to prevent layout shifts.
|
||||
*
|
||||
* @param imageLoader A custom [ImageLoader] for Coil3 image requests.
|
||||
*/
|
||||
internal class Coil3ImageRendererExtensionImpl(private val imageLoader: ImageLoader) : ImageRendererExtension {
|
||||
@Composable
|
||||
override fun renderImagesContent(image: InlineMarkdown.Image): InlineTextContent {
|
||||
var knownSize by remember(image.source) { mutableStateOf<DpSize?>(null) }
|
||||
|
||||
return InlineTextContent(
|
||||
with(LocalDensity.current) {
|
||||
Placeholder(
|
||||
width = knownSize?.width?.toSp() ?: 0.sp,
|
||||
height = knownSize?.height?.toSp() ?: 1.sp,
|
||||
placeholderVerticalAlign = PlaceholderVerticalAlign.Bottom,
|
||||
)
|
||||
}
|
||||
) {
|
||||
val density = LocalDensity.current
|
||||
Tooltip({ Text(image.alt) }, enabled = image.alt.isNotBlank()) {
|
||||
AsyncImage(
|
||||
model =
|
||||
ImageRequest.Builder(LocalPlatformContext.current)
|
||||
.data(image.source)
|
||||
// make sure the image doesn't get downscaled to the placeholder size
|
||||
.size(Size.ORIGINAL)
|
||||
.build(),
|
||||
imageLoader = imageLoader,
|
||||
contentDescription = image.title,
|
||||
onSuccess = { state ->
|
||||
// onSuccess should only be called once, but adding additional protection from
|
||||
// unnecessary rerender
|
||||
val newSize =
|
||||
with(density) { state.result.image.let { DpSize(it.width.toDp(), it.height.toDp()) } }
|
||||
if (knownSize != newSize) {
|
||||
@Suppress("AssignedValueIsNeverRead") // False positive
|
||||
knownSize = newSize
|
||||
}
|
||||
},
|
||||
onError = { error ->
|
||||
JewelLogger.getInstance("Markdown").warn("AsyncImage loading: ${error.result.throwable}")
|
||||
},
|
||||
modifier =
|
||||
(knownSize?.let { size -> Modifier.size(size) } // If we have a size, let's use it
|
||||
?: Modifier) // Otherwise, we'll do it when we have it
|
||||
.pointerHoverIcon(PointerIcon.Default),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package org.jetbrains.jewel.markdown.extensions.images
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import coil3.ImageLoader
|
||||
import coil3.compose.LocalPlatformContext
|
||||
import coil3.memory.MemoryCache
|
||||
import org.jetbrains.jewel.markdown.extensions.ImageRendererExtension
|
||||
import org.jetbrains.jewel.markdown.extensions.MarkdownRendererExtension
|
||||
|
||||
private const val DEFAULT_MEMORY_CACHE_SIZE: Long = 20 * 1024 * 1024 // 20 MB
|
||||
|
||||
/**
|
||||
* A [MarkdownRendererExtension] for rendering images using the Coil3 library.
|
||||
*
|
||||
* This extension enables the display of images specified in Markdown, for example: ``.
|
||||
*
|
||||
* It requires an [ImageLoader] to handle fetching and displaying images. For optimal performance and resource
|
||||
* management (e.g., shared memory and disk caches), it is recommended to provide a single, app-wide [ImageLoader]
|
||||
* instance via the constructor.
|
||||
*/
|
||||
public class Coil3ImagesRendererExtension(private val imageLoader: ImageLoader) : MarkdownRendererExtension {
|
||||
override val imageRendererExtension: ImageRendererExtension
|
||||
get() = Coil3ImagesRendererExtensionImpl(imageLoader)
|
||||
|
||||
public companion object {
|
||||
/**
|
||||
* A default images loader with limited in-memory cache is to decouple clients from depending directly on coil
|
||||
* internals. This shouldn't be used if there is an app-wide image loader already availble; Which could be set
|
||||
* via a constructor.
|
||||
*/
|
||||
@Composable
|
||||
public fun withDefaultLoader(): Coil3ImagesRendererExtension =
|
||||
Coil3ImagesRendererExtension(
|
||||
ImageLoader.Builder(LocalPlatformContext.current)
|
||||
.memoryCache { MemoryCache.Builder().maxSizeBytes { DEFAULT_MEMORY_CACHE_SIZE }.build() }
|
||||
.build()
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
package org.jetbrains.jewel.markdown.extensions.images
|
||||
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.text.InlineTextContent
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.text.Placeholder
|
||||
import androidx.compose.ui.text.PlaceholderVerticalAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import coil3.ImageLoader
|
||||
import coil3.compose.AsyncImage
|
||||
import coil3.compose.LocalPlatformContext
|
||||
import coil3.request.ImageRequest
|
||||
import coil3.size.Size
|
||||
import org.jetbrains.jewel.foundation.util.JewelLogger
|
||||
import org.jetbrains.jewel.markdown.InlineMarkdown
|
||||
import org.jetbrains.jewel.markdown.extensions.ImageRendererExtension
|
||||
|
||||
/**
|
||||
* Renders Markdown images using Coil3.
|
||||
*
|
||||
* This implementation uses [AsyncImage] to load and display images. It reserves space for the image with a
|
||||
* [Placeholder] and updates its size upon successful loading to prevent layout shifts.
|
||||
*
|
||||
* @param imageLoader A custom [ImageLoader] for Coil3 image requests.
|
||||
*/
|
||||
public class Coil3ImagesRendererExtensionImpl(private val imageLoader: ImageLoader) : ImageRendererExtension {
|
||||
@Composable
|
||||
public override fun renderImagesContent(image: InlineMarkdown.Image): InlineTextContent {
|
||||
val knownSize = remember(image.source) { mutableStateOf<ImageSize?>(null) }
|
||||
return InlineTextContent(
|
||||
with(LocalDensity.current) {
|
||||
// `toSp` ensures that the placeholder size matches the original image size in
|
||||
// pixels.
|
||||
// This approach doesn't allow images from appearing larger with different screen
|
||||
// scaling,
|
||||
// but simply maintains behavior consistent with standalone AsyncImage rendering.
|
||||
Placeholder(
|
||||
width = knownSize.value?.width?.dp?.toSp() ?: 0.sp,
|
||||
height = knownSize.value?.height?.dp?.toSp() ?: 1.sp,
|
||||
placeholderVerticalAlign = PlaceholderVerticalAlign.Bottom,
|
||||
)
|
||||
}
|
||||
) {
|
||||
AsyncImage(
|
||||
model =
|
||||
ImageRequest.Builder(LocalPlatformContext.current)
|
||||
.data(image.source)
|
||||
// make sure image doesn't get downscaled to the placeholder size
|
||||
.size(Size.ORIGINAL)
|
||||
.build(),
|
||||
imageLoader = imageLoader,
|
||||
contentDescription = image.title,
|
||||
onSuccess = { state ->
|
||||
// onSuccess should only be called once, but adding additional protection from
|
||||
// unnecessary rerender
|
||||
if (knownSize.value == null) {
|
||||
knownSize.value = state.result.image.let { ImageSize(it.width, it.height) }
|
||||
}
|
||||
},
|
||||
onError = { error ->
|
||||
JewelLogger.getInstance("Jewel").warn("AsyncImage loading: ${error.result.throwable}")
|
||||
},
|
||||
modifier =
|
||||
knownSize.value
|
||||
// If we have a knownSize, let's use it
|
||||
?.let { size -> Modifier.size(size.height.dp, size.width.dp) }
|
||||
// Otherwise, we'll do it when we have it
|
||||
?: Modifier,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private data class ImageSize(val width: Int, val height: Int)
|
||||
}
|
||||
@@ -31,11 +31,11 @@ jvm_library(
|
||||
"@lib//:jetbrains-annotations",
|
||||
"//platform/jewel/ui",
|
||||
"//platform/jewel/foundation",
|
||||
"//platform/jewel/markdown/core:jewel-markdown-core",
|
||||
"//libraries/skiko",
|
||||
"//platform/jewel/markdown/core",
|
||||
"//libraries/compose-foundation-desktop",
|
||||
"//libraries/skiko",
|
||||
],
|
||||
runtime_deps = [":jewel-samples-showcase_resources"],
|
||||
plugins = ["@lib//:compose-plugin"]
|
||||
)
|
||||
### auto-generated section `build intellij.platform.jewel.samples.showcase` end
|
||||
### auto-generated section `build intellij.platform.jewel.samples.showcase` end
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<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.markdown.core" />
|
||||
<orderEntry type="module" module-name="intellij.libraries.skiko" />
|
||||
<orderEntry type="module" module-name="intellij.libraries.compose.foundation.desktop" />
|
||||
<orderEntry type="module" module-name="intellij.libraries.skiko" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1 +0,0 @@
|
||||
androidx/compose/**
|
||||
@@ -3,13 +3,19 @@ package org.jetbrains.jewel.samples.standalone.markdown
|
||||
import org.intellij.lang.annotations.Language
|
||||
|
||||
@Language("Markdown")
|
||||
public val JewelReadme: String =
|
||||
internal val JewelReadme: String =
|
||||
"""
|
||||
[](https://github.com/JetBrains#jetbrains-on-github) [](https://github.com/JetBrains/jewel/actions/workflows/build.yml) [](https://github.com/JetBrains/jewel/blob/main/LICENSE) [](https://github.com/JetBrains/jewel/releases/latest) 
|
||||
|
||||
# Jewel: a Compose for Desktop theme
|
||||
|
||||

|
||||
|
||||
Jewel aims at recreating the IntelliJ Platform's _New UI_ Swing Look and Feel in Compose for Desktop, providing a
|
||||
desktop-optimized theme and set of components.
|
||||
|
||||
---
|
||||
|
||||
> [!WARNING]
|
||||
>
|
||||
> This project is in active development, and caution is advised when considering it for production uses. You _can_ use
|
||||
@@ -21,20 +27,24 @@ desktop-optimized theme and set of components.
|
||||
>
|
||||
> Use at your own risk!
|
||||
|
||||

|
||||
|
||||
Jewel provides an implementation of the IntelliJ Platform themes that can be used in any Compose for Desktop
|
||||
application. Additionally, it has a Swing LaF Bridge that only works in the IntelliJ Platform (i.e., used to create IDE
|
||||
plugins), but automatically mirrors the current Swing LaF into Compose for a native-looking, consistent UI.
|
||||
|
||||
> [!TIP]
|
||||
> <a href="https://www.droidcon.com/2023/11/15/meet-jewelcreate-ide-plugins-in-compose/">
|
||||
> <img src="https://i.vimeocdn.com/video/1749849437-f275e0337faca5cedab742ea157abbafe5a0207d3a59db891a72b6180ce13a6c-d?mh=120" align="left" />
|
||||
> </a>
|
||||
>
|
||||
> If you want to learn more about Jewel and Compose for Desktop and why they're a great, modern solution for your
|
||||
> desktop
|
||||
> UI needs, check out [this talk](https://www.droidcon.com/2023/11/15/meet-jewelcreate-ide-plugins-in-compose/) by Jewel
|
||||
> contributors Sebastiano and Chris.
|
||||
>
|
||||
> It covers why Compose is a viable choice, and an overview of the Jewel project, plus
|
||||
> some real-life use cases.
|
||||
> some real-life use cases.<br clear="left" />
|
||||
|
||||
<br/>
|
||||
|
||||
## Getting started
|
||||
|
||||
@@ -76,15 +86,15 @@ repositories {
|
||||
To use Jewel in your app, you only need to add the relevant dependency. There are two scenarios: standalone Compose for
|
||||
Desktop app, and IntelliJ Platform plugin.
|
||||
|
||||
If you're writing a **standalone app**, then you should depend on the latest `int-ui-standalone-*` artifact:
|
||||
If you're writing a **standalone app**, then you should depend on the latest `int-ui-standalone` artifact:
|
||||
|
||||
```kotlin
|
||||
dependencies {
|
||||
// See https://github.com/JetBrains/Jewel/releases for the release notes
|
||||
implementation("org.jetbrains.jewel:jewel-int-ui-standalone-[latest platform version]:[jewel version]")
|
||||
implementation("org.jetbrains.jewel:jewel-int-ui-standalone:[jewel version]")
|
||||
|
||||
// Optional, for custom decorated windows:
|
||||
implementation("org.jetbrains.jewel:jewel-int-ui-decorated-window-[latest platform version]:[jewel version]")
|
||||
implementation("org.jetbrains.jewel:jewel-int-ui-decorated-window:[jewel version]")
|
||||
|
||||
// Do not bring in Material (we use Jewel)
|
||||
implementation(compose.desktop.currentOs) {
|
||||
@@ -93,51 +103,44 @@ dependencies {
|
||||
}
|
||||
```
|
||||
|
||||
For an **IntelliJ Platform plugin**, then you should depend on the appropriate `ide-laf-bridge-*` artifact:
|
||||
For an **IntelliJ Platform plugin**, then you should depend on the bundled modules in IntelliJ Platform:
|
||||
|
||||
```kotlin
|
||||
dependencies {
|
||||
// See https://github.com/JetBrains/Jewel/releases for the release notes
|
||||
// The platform version is a supported major IJP version (e.g., 232 or 233 for 2023.2 and 2023.3 respectively)
|
||||
implementation("org.jetbrains.jewel:jewel-ide-laf-bridge-[platform version]:[jewel version]")
|
||||
|
||||
// Do not bring in Material (we use Jewel) and Coroutines (the IDE has its own)
|
||||
api(compose.desktop.currentOs) {
|
||||
exclude(group = "org.jetbrains.compose.material")
|
||||
exclude(group = "org.jetbrains.kotlinx")
|
||||
intellijPlatform {
|
||||
//...
|
||||
bundledModule("intellij.platform.jewel.foundation")
|
||||
bundledModule("intellij.platform.jewel.ui")
|
||||
bundledModule("intellij.platform.jewel.ideLafBridge")
|
||||
bundledModule("intellij.platform.jewel.markdown.core")
|
||||
bundledModule("intellij.platform.jewel.markdown.ideLafBridgeStyling")
|
||||
bundledModule("intellij.libraries.compose.foundation.desktop")
|
||||
bundledModule("intellij.libraries.skiko")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br/>
|
||||
|
||||
> [!TIP]
|
||||
> It's easier to use version catalogs — you can use the Jewel
|
||||
> [version catalog](https://github.com/JetBrains/jewel/blob/main/gradle/libs.versions.toml) as reference.
|
||||
|
||||
## Using ProGuard/obfuscation/minification
|
||||
|
||||
Jewel doesn't officially support using ProGuard to minimize and/or obfuscate your code, and there is currently no plan
|
||||
to.
|
||||
That said, people are reporting successes in using it. Please note that there is no guarantee that it will keep working,
|
||||
and you most definitely need to have some rules in place. We don't provide any official rule set, but these have been
|
||||
known
|
||||
to work for some: https://github.com/romainguy/kotlin-explorer/blob/main/compose-desktop.pro
|
||||
to. That said, some people are using it. Please note that there is no guarantee that it will keep working,
|
||||
and you most definitely need to have some rules in place.
|
||||
|
||||
We don't provide any official rule set, but these have been known to work for
|
||||
some: https://github.com/romainguy/kotlin-explorer/blob/main/compose-desktop.pro
|
||||
|
||||
> [!IMPORTANT]
|
||||
> We won't accept bug reports for issues caused by the use of ProGuard or similar tools.
|
||||
|
||||
## Dependencies matrix
|
||||
|
||||
Jewel is in continuous development and we focus on supporting only the Compose version we use internally.
|
||||
You can see the latest supported version
|
||||
in [libs.versions.toml](https://github.com/JetBrains/jewel/blob/main/gradle/libs.versions.toml).
|
||||
Jewel is in continuous development, and we focus on supporting only the Compose version we use internally.
|
||||
You can see what Compose version each Jewel release is built with in the [release notes](RELEASE%20NOTES.md).
|
||||
|
||||
Different versions of Compose are not guaranteed to work with different versions of Jewel.
|
||||
|
||||
The Compose Compiler version used is the latest compatible with the given Kotlin version. See
|
||||
[here](https://developer.android.com/jetpack/androidx/releases/compose-compiler) for the Compose
|
||||
Compiler release notes, which indicate the compatibility.
|
||||
Different versions of Compose are not guaranteed to work with different versions of Jewel, especially across
|
||||
major versions of Compose. When running Jewel in the IJ Platform, you must use the dependencies provided by
|
||||
the platform itself. You can shadow/jarjar everything and ship your own copy of CMP, Skiko, and Jewel, with
|
||||
your plugin, but that is not a supported scenario.
|
||||
|
||||
The minimum supported Kotlin version is dictated by the minimum supported IntelliJ IDEA platform.
|
||||
|
||||
@@ -145,33 +148,30 @@ The minimum supported Kotlin version is dictated by the minimum supported Intell
|
||||
|
||||
The project is split in modules:
|
||||
|
||||
1. `buildSrc` contains the build logic, including:
|
||||
* The `jewel` and `jewel-publish` configuration plugins
|
||||
* The `jewel-check-public-api` and `jewel-linting` configuration plugins
|
||||
* The Theme Palette generator plugin
|
||||
* The Studio Releases generator plugin
|
||||
2. `foundation` contains the foundational Jewel functionality:
|
||||
* Basic components without strong styling (e.g., `SelectableLazyColumn`, `BasicLazyTree`)
|
||||
* The `JewelTheme` interface with a few basic composition locals
|
||||
* The state management primitives
|
||||
* The Jewel annotations
|
||||
* A few other primitives
|
||||
3. `ui` contains all the styled components and custom painters logic
|
||||
4. `decorated-window` contains basic, unstyled functionality to have custom window decoration on the JetBrains Runtime
|
||||
5. `int-ui` contains two modules:
|
||||
* `int-ui-standalone` has a standalone version of the Int UI styling values that can be used in any Compose for
|
||||
Desktop app
|
||||
* `int-ui-decorated-window` has a standalone version of the Int UI styling values for the custom window decoration
|
||||
that can be used in any Compose for Desktop app
|
||||
6. `ide-laf-bridge` contains the Swing LaF bridge to use in IntelliJ Platform plugins (see more below)
|
||||
7. `markdown` contains a few modules:
|
||||
* `core` the core logic for parsing and rendering Markdown documents with Jewel, using GitHub-like styling
|
||||
* `extension` contains several extensions to the base CommonMark specs that can be used to add more features
|
||||
* `ide-laf-bridge-styling` contains the IntelliJ Platform bridge theming for the Markdown renderer
|
||||
* `int-ui-standalone-styling` contains the standalone Int UI theming for the Markdown renderer
|
||||
8. `samples` contains the example apps, which showcase the available components:
|
||||
* `standalone` is a regular CfD app, using the standalone theme definitions and custom window decoration
|
||||
* `ide-plugin` is an IntelliJ plugin that showcases the use of the Swing Bridge
|
||||
1. `foundation` contains the foundational Jewel functionality:
|
||||
* Basic components without strong styling (e.g., `SelectableLazyColumn`, `BasicLazyTree`)
|
||||
* The `JewelTheme` interface with a few basic composition locals
|
||||
* The state management primitives
|
||||
* The Jewel annotations
|
||||
* A few other primitives
|
||||
2. `ui` contains all the styled components and custom painters logic
|
||||
* `ui-tests` contains all the tests for the `ui` module
|
||||
3. `decorated-window` contains basic, unstyled functionality to have custom window decoration on the JetBrains Runtime
|
||||
4. `int-ui` contains two modules:
|
||||
* `int-ui-standalone` has a standalone version of the Int UI styling values that can be used in any Compose for
|
||||
Desktop app
|
||||
* `int-ui-decorated-window` has a standalone version of the Int UI styling values for the custom window decoration
|
||||
that can be used in any Compose for Desktop app
|
||||
5. `ide-laf-bridge` contains the Swing LaF bridge to use in IntelliJ Platform plugins (see more below)
|
||||
6. `markdown` contains a few modules:
|
||||
* `core` the core logic for parsing and rendering Markdown documents with Jewel, using GitHub-like styling
|
||||
* `extension` contains several extensions to the base CommonMark specs that can be used to add more features
|
||||
* `ide-laf-bridge-styling` contains the IntelliJ Platform bridge theming for the Markdown renderer
|
||||
* `int-ui-standalone-styling` contains the standalone Int UI theming for the Markdown renderer
|
||||
7. `samples` contains the example apps, which showcase the available components:
|
||||
* `standalone` is a regular CfD app, using the standalone theme definitions and custom window decoration
|
||||
* `ide-plugin` is an IntelliJ plugin that showcases the use of the Swing Bridge
|
||||
* `showcase` contains the shared component showcase code, used by both the IDE plugin and the standalone sample
|
||||
|
||||
## Branching strategy and IJ Platforms
|
||||
|
||||
@@ -204,7 +204,7 @@ The standalone theme can be used in any Compose for Desktop app. You use it as a
|
||||
to your heart's content. By default, it matches the official Int UI specs.
|
||||
|
||||
For an example on how to set up a standalone app, you can refer to
|
||||
the [`standalone` sample](https://github.com/JetBrains/jewel/blob/main/samples/standalone/build.gradle.kts).
|
||||
the [`standalone` sample](samples/standalone/build.gradle.kts).
|
||||
|
||||
> [!WARNING]
|
||||
> Note that Jewel **requires** the JetBrains Runtime to work correctly. Some features like font loading depend on it,
|
||||
@@ -226,6 +226,8 @@ If you want more control over the theming, you can use other `IntUiTheme` overlo
|
||||
|
||||
The JetBrains Runtime allows windows to have a custom decoration instead of the regular title bar.
|
||||
|
||||

|
||||
|
||||
The standalone sample app shows how to easily get something that looks like a JetBrains IDE; if you want to go _very_
|
||||
custom, you only need to depend on the `decorated-window` module, which contains all the required primitives, but not
|
||||
the Int UI styling.
|
||||
@@ -272,21 +274,10 @@ SwingBridgeTheme {
|
||||
|
||||
### Supported IntelliJ Platform versions
|
||||
|
||||
To use Jewel in the IntelliJ Platform, you should depend on the appropriate `jewel-ide-laf-bridge-*` artifact, which
|
||||
will bring in the necessary transitive dependencies. These are the currently supported versions of the IntelliJ Platform
|
||||
and the branch on which the corresponding bridge code lives:
|
||||
Jewel is now shipping as part of the IntelliJ Platform, starting from 251.2+. The Jewel API version (e.g., 0.28) is what determines
|
||||
binary compatibility of the Jewel APIs across the various supported IJP versions, and standalone.
|
||||
|
||||
| IntelliJ Platform version(s) | Branch to use |
|
||||
|------------------------------|-------------------------|
|
||||
| 2024.3 (EAP 6+) | `main` |
|
||||
| 2024.2 (beta 1+) | `releases/242` |
|
||||
| 2024.1 (EAP 3+) | `releases/241` |
|
||||
| 2023.3 (**archived**) | `archived-releases/233` |
|
||||
| 2023.2 (**archived**) | `archived-releases/232` |
|
||||
| 2023.1 or older | **Not supported** |
|
||||
|
||||
For an example on how to set up an IntelliJ Plugin, you can refer to
|
||||
the [`ide-plugin` sample](https://github.com/JetBrains/jewel/blob/main/samples/ide-plugin/build.gradle.kts).
|
||||
Please refer to the [release notes](RELEASE%20NOTES.md) to determine the compatibility of each Jewel version with the IJ Platform.
|
||||
|
||||
## Icons
|
||||
|
||||
@@ -458,9 +449,13 @@ you. However, if you want to also enable it in other scenarios and in standalone
|
||||
|
||||
Here is a small selection of projects that use Compose for Desktop and Jewel:
|
||||
|
||||
* [Package Search](https://github.com/JetBrains/package-search-intellij-plugin) (IntelliJ Platform plugin)
|
||||
* [Junie](https://jetbrains.com/junie)
|
||||
* [Journeys](https://developer.android.com/studio/preview/gemini/journeys)
|
||||
* Android Studio profilers (Android Studio Koala+)
|
||||
* [Gemini in Android Studio](https://developer.android.com/studio/preview/gemini)
|
||||
* [Gemini Code Assist](https://codeassist.google/) for IntelliJ-based IDEs
|
||||
* [Kotlin Explorer](https://github.com/romainguy/kotlin-explorer) (standalone app)
|
||||
* New task-based Profiler UI in Android Studio Koala
|
||||
* [Package Search](https://github.com/JetBrains/package-search-intellij-plugin) (now discontinued)
|
||||
* ...and more to come!
|
||||
|
||||
## Need help?
|
||||
@@ -468,25 +463,5 @@ Here is a small selection of projects that use Compose for Desktop and Jewel:
|
||||
You can find help on the [`#jewel`](https://app.slack.com/client/T09229ZC6/C05T8U2C31T) channel on the Kotlin Slack.
|
||||
If you don't already have access to the Kotlin Slack, you can request it
|
||||
[here](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up).
|
||||
|
||||
## License
|
||||
|
||||
Jewel is licensed under the [Apache 2.0 license](https://github.com/JetBrains/jewel/blob/main/LICENSE).
|
||||
|
||||
```
|
||||
Copyright 2022–4 JetBrains s.r.o.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
"""
|
||||
.trimIndent()
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.jetbrains.jewel.ui.component.Text
|
||||
import org.jetbrains.jewel.ui.component.TextArea
|
||||
|
||||
@Composable
|
||||
public fun MarkdownEditor(state: TextFieldState, modifier: Modifier = Modifier) {
|
||||
internal fun MarkdownEditor(state: TextFieldState, modifier: Modifier = Modifier) {
|
||||
Column(modifier) {
|
||||
ControlsRow(
|
||||
modifier = Modifier.fillMaxWidth().background(JewelTheme.globalColors.panelBackground).padding(8.dp),
|
||||
|
||||
@@ -12,6 +12,7 @@ import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
import coil3.compose.LocalPlatformContext
|
||||
import java.awt.Desktop
|
||||
import java.net.URI
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -38,7 +39,7 @@ import org.jetbrains.jewel.markdown.extensions.github.strikethrough.GitHubStrike
|
||||
import org.jetbrains.jewel.markdown.extensions.github.tables.GfmTableStyling
|
||||
import org.jetbrains.jewel.markdown.extensions.github.tables.GitHubTableProcessorExtension
|
||||
import org.jetbrains.jewel.markdown.extensions.github.tables.GitHubTableRendererExtension
|
||||
import org.jetbrains.jewel.markdown.extensions.images.Coil3ImagesRendererExtension
|
||||
import org.jetbrains.jewel.markdown.extensions.images.Coil3ImageRendererExtension
|
||||
import org.jetbrains.jewel.markdown.processing.MarkdownProcessor
|
||||
import org.jetbrains.jewel.markdown.rendering.MarkdownBlockRenderer
|
||||
import org.jetbrains.jewel.markdown.rendering.MarkdownStyling
|
||||
@@ -46,7 +47,7 @@ import org.jetbrains.jewel.ui.component.VerticallyScrollableContainer
|
||||
import org.jetbrains.jewel.ui.component.scrollbarContentSafePadding
|
||||
|
||||
@Composable
|
||||
public fun MarkdownPreview(modifier: Modifier = Modifier, rawMarkdown: CharSequence) {
|
||||
internal fun MarkdownPreview(rawMarkdown: CharSequence, modifier: Modifier = Modifier) {
|
||||
val isDark = JewelTheme.isDark
|
||||
|
||||
val markdownStyling = remember(isDark) { if (isDark) MarkdownStyling.dark() else MarkdownStyling.light() }
|
||||
@@ -66,7 +67,10 @@ public fun MarkdownPreview(modifier: Modifier = Modifier, rawMarkdown: CharSeque
|
||||
)
|
||||
)
|
||||
}
|
||||
val coil3ImagesRendererExtension = Coil3ImagesRendererExtension.withDefaultLoader()
|
||||
|
||||
val coilContext = LocalPlatformContext.current
|
||||
val coil3ImageRendererExtension =
|
||||
remember(coilContext) { Coil3ImageRendererExtension.withDefaultLoader(coilContext) }
|
||||
|
||||
LaunchedEffect(rawMarkdown) {
|
||||
// TODO you may want to debounce or drop on backpressure, in real usages. You should also
|
||||
@@ -83,7 +87,7 @@ public fun MarkdownPreview(modifier: Modifier = Modifier, rawMarkdown: CharSeque
|
||||
styling = markdownStyling,
|
||||
rendererExtensions =
|
||||
listOf(
|
||||
coil3ImagesRendererExtension,
|
||||
coil3ImageRendererExtension,
|
||||
GitHubAlertRendererExtension(AlertStyling.dark(), markdownStyling),
|
||||
GitHubStrikethroughRendererExtension,
|
||||
GitHubTableRendererExtension(GfmTableStyling.dark(), markdownStyling),
|
||||
@@ -94,7 +98,7 @@ public fun MarkdownPreview(modifier: Modifier = Modifier, rawMarkdown: CharSeque
|
||||
styling = markdownStyling,
|
||||
rendererExtensions =
|
||||
listOf(
|
||||
coil3ImagesRendererExtension,
|
||||
coil3ImageRendererExtension,
|
||||
GitHubAlertRendererExtension(AlertStyling.light(), markdownStyling),
|
||||
GitHubStrikethroughRendererExtension,
|
||||
GitHubTableRendererExtension(GfmTableStyling.light(), markdownStyling),
|
||||
|
||||
@@ -13,6 +13,7 @@ import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import coil3.compose.LocalPlatformContext
|
||||
import com.intellij.ide.BrowserUtil
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.project.Project
|
||||
@@ -44,6 +45,7 @@ import org.jetbrains.jewel.markdown.extensions.github.strikethrough.GitHubStrike
|
||||
import org.jetbrains.jewel.markdown.extensions.github.tables.GfmTableStyling
|
||||
import org.jetbrains.jewel.markdown.extensions.github.tables.GitHubTableProcessorExtension
|
||||
import org.jetbrains.jewel.markdown.extensions.github.tables.GitHubTableRendererExtension
|
||||
import org.jetbrains.jewel.markdown.extensions.images.Coil3ImageRendererExtension
|
||||
import org.jetbrains.jewel.markdown.processing.MarkdownProcessor
|
||||
import org.jetbrains.jewel.markdown.rendering.DefaultInlineMarkdownRenderer
|
||||
import org.jetbrains.jewel.markdown.scrolling.ScrollSyncMarkdownBlockRenderer
|
||||
@@ -93,7 +95,9 @@ internal class MarkdownComposePanel(
|
||||
val tableRenderer = remember(markdownStyling) {
|
||||
GitHubTableRendererExtension(GfmTableStyling.create(), markdownStyling)
|
||||
}
|
||||
val allRenderingExtensions = listOf(tableRenderer, GitHubStrikethroughRendererExtension)
|
||||
val coilContext = LocalPlatformContext.current
|
||||
val imageRendererExtension = remember(coilContext) { Coil3ImageRendererExtension.withDefaultLoader(coilContext) }
|
||||
val allRenderingExtensions = listOf(tableRenderer, GitHubStrikethroughRendererExtension, imageRendererExtension)
|
||||
val blockRenderer = remember(markdownStyling) {
|
||||
ScrollSyncMarkdownBlockRenderer(
|
||||
markdownStyling,
|
||||
|
||||
Reference in New Issue
Block a user