Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main' into k2
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle.kts
#	gradle/libs.versions.toml
#	kotlin-js-store/yarn.lock
#	sample/common/build.gradle.kts
  • Loading branch information
MohamedRejeb committed Aug 20, 2024
2 parents d076f2c + 9d7dac7 commit 559559f
Show file tree
Hide file tree
Showing 58 changed files with 2,963 additions and 629 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,22 @@ permissions:
contents: read

jobs:
build:
api-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Run tests
run: ./gradlew apiCheck

test:
runs-on: macos-14

steps:
Expand All @@ -44,7 +59,7 @@ jobs:

deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
needs: [test, api-check]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024 Mohamed Rejeb

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ plugins {
alias(libs.plugins.kotlinMultiplatform).apply(false)
alias(libs.plugins.composeMultiplatform).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
}
alias(libs.plugins.bcv).apply(false)
}
27 changes: 22 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
[versions]
agp = "8.2.2"
kotlin = "2.0.20-Beta1"
kotlin = "2.0.10"
compose = "1.6.11"
dokka = "1.9.10"

ksoup = "0.4.0"
jetbrainsMarkdown = "0.7.3"
coil = "3.0.0-alpha10"

nexus-publish = "2.0.0-rc-1"
nexus-publish = "2.0.0"

# For sample
activity-compose = "1.9.0"
activity-compose = "1.9.1"
voyager = "1.1.0-beta02"
richeditor = "1.0.0-rc04"
richeditor = "1.0.0-rc05"
coroutines = "1.8.1"
ktor = "3.0.0-wasm2"
android-minSdk = "21"
android-compileSdk = "34"

Expand All @@ -21,18 +24,32 @@ ksoup-html = { module = "com.mohamedrejeb.ksoup:ksoup-html", version.ref = "ksou
ksoup-entities = { module = "com.mohamedrejeb.ksoup:ksoup-entities", version.ref = "ksoup" }
jetbrains-markdown = { module = "org.jetbrains:markdown", version.ref = "jetbrainsMarkdown" }

coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }

nexus-publish = { module = "io.github.gradle-nexus.publish-plugin:io.github.gradle-nexus.publish-plugin.gradle.plugin", version.ref = "nexus-publish" }

# For sample
activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity-compose" }
voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" }
richeditor-compose = { module = "com.mohamedrejeb.richeditor:richeditor-compose", version.ref = "richeditor" }

kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "coroutines" }

coil-svg = { module = "io.coil-kt.coil3:coil-svg", version.ref = "coil" }
coil-network-ktor = { module = "io.coil-kt.coil3:coil-network-ktor2", version.ref = "coil" }

ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }

[plugins]
androidLibrary = { id = "com.android.library", version.ref = "agp" }
androidApplication = { id = "com.android.application", version.ref = "agp" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
bcv = "org.jetbrains.kotlinx.binary-compatibility-validator:0.16.2"
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public final class com/mohamedrejeb/richeditor/coil3/Coil3ImageLoader : com/mohamedrejeb/richeditor/model/ImageLoader {
public static final field $stable I
public static final field INSTANCE Lcom/mohamedrejeb/richeditor/coil3/Coil3ImageLoader;
public fun load (Ljava/lang/Object;Landroidx/compose/runtime/Composer;I)Lcom/mohamedrejeb/richeditor/model/ImageData;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public final class com/mohamedrejeb/richeditor/coil3/Coil3ImageLoader : com/mohamedrejeb/richeditor/model/ImageLoader {
public static final field $stable I
public static final field INSTANCE Lcom/mohamedrejeb/richeditor/coil3/Coil3ImageLoader;
public fun load (Ljava/lang/Object;Landroidx/compose/runtime/Composer;I)Lcom/mohamedrejeb/richeditor/model/ImageData;
}

13 changes: 13 additions & 0 deletions richeditor-compose-coil3/api/richeditor-compose-coil3.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Klib ABI Dump
// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, wasmJs]
// Rendering settings:
// - Signature version: 2
// - Show manifest properties: true
// - Show declarations: true

// Library unique name: <com.mohamedrejeb.richeditor:richeditor-compose-coil3>
final object com.mohamedrejeb.richeditor.coil3/Coil3ImageLoader : com.mohamedrejeb.richeditor.model/ImageLoader { // com.mohamedrejeb.richeditor.coil3/Coil3ImageLoader|null[0]
final fun load(kotlin/Any, androidx.compose.runtime/Composer?, kotlin/Int): com.mohamedrejeb.richeditor.model/ImageData // com.mohamedrejeb.richeditor.coil3/Coil3ImageLoader.load|load(kotlin.Any;androidx.compose.runtime.Composer?;kotlin.Int){}[0]
}

final const val com.mohamedrejeb.richeditor.coil3/com_mohamedrejeb_richeditor_coil3_Coil3ImageLoader$stableprop // com.mohamedrejeb.richeditor.coil3/com_mohamedrejeb_richeditor_coil3_Coil3ImageLoader$stableprop|#static{}com_mohamedrejeb_richeditor_coil3_Coil3ImageLoader$stableprop[0]
76 changes: 76 additions & 0 deletions richeditor-compose-coil3/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.composeMultiplatform)
alias(libs.plugins.androidLibrary)
alias(libs.plugins.bcv)
id("module.publication")
}

kotlin {
explicitApi()
applyDefaultHierarchyTemplate()
androidTarget {
publishLibraryVariants("release")
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
jvm("desktop") {
jvmToolchain(11)
}
js(IR) {
browser()
}
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser {
testTask {
enabled = false
}
}
}
iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets.commonMain.dependencies {
implementation(projects.richeditorCompose)

implementation(compose.ui)
implementation(compose.foundation)

implementation(libs.coil.compose)
}

sourceSets.commonTest.dependencies {
implementation(kotlin("test"))
}
}

android {
namespace = "com.mohamedrejeb.richeditor.compose.coil"
compileSdk = libs.versions.android.compileSdk.get().toInt()

defaultConfig {
minSdk = libs.versions.android.minSdk.get().toInt()
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlin {
jvmToolchain(8)
}
}

apiValidation {
@OptIn(kotlinx.validation.ExperimentalBCVApi::class)
klib {
enabled = true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.mohamedrejeb.richeditor.coil3

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import coil3.compose.AsyncImagePainter
import coil3.compose.rememberAsyncImagePainter
import com.mohamedrejeb.richeditor.annotation.ExperimentalRichTextApi
import com.mohamedrejeb.richeditor.model.ImageData
import com.mohamedrejeb.richeditor.model.ImageLoader

@OptIn(ExperimentalRichTextApi::class)
public object Coil3ImageLoader: ImageLoader {

@Composable
override fun load(model: Any): ImageData {
val painter = rememberAsyncImagePainter(model = model)

return ImageData(
painter = painter
)
}

}
Loading

0 comments on commit 559559f

Please sign in to comment.