Skip to content

Commit b81b525

Browse files
authored
Merge pull request #46 from huanshankeji/rename-project
Rename the project to "Compose Multiplatform HTML Unified"
2 parents fcdae05 + f661ac6 commit b81b525

File tree

333 files changed

+321
-292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+321
-292
lines changed

README.md

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
1-
# Compose Multiplatform Material (better name pending): unified Compose Multiplatform common extensions and Material wrappers for `androidx.compose` and Compose HTML
1+
# Compose Multiplatform HTML Unified
22

3-
[![Maven Central](https://img.shields.io/maven-central/v/com.huanshankeji/compose-multiplatform-material3)](https://search.maven.org/search?q=g:com.huanshankeji%20AND%20a:compose-multiplatform-*)
4-
![Kotlin version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=com.huanshankeji&name=compose-multiplatform-material3)
3+
[![Maven Central](https://img.shields.io/maven-central/v/com.huanshankeji/compose-multiplatform-html-unified-common)](https://search.maven.org/search?q=g:com.huanshankeji%20AND%20a:compose-multiplatform-html-unified-*)
4+
![Kotlin version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=com.huanshankeji&name=compose-multiplatform-html-unified-common)
55

6-
Unified Compose Multiplatform wrappers of common components, layouts, and Material Design components for `androidx.compose` (officially supported on Android, desktop (JVM), iOS, and web (Kotlin/Wasm)) and Compose HTML (mainly based on [Kobweb Silk](https://github.com/varabyte/kobweb?tab=readme-ov-file#silk) [Compose](https://github.com/varabyte/kobweb/tree/main/frontend/kobweb-compose), [KMDC](https://github.com/mpetuska/kmdc), and [Compose HTML Material](https://github.com/huanshankeji/compose-html-material) (which is then based on [Material Web](https://github.com/material-components/material-web)))
6+
Unified Compose Multiplatform wrappers of common and **Material Design** APIs for **rendering-based Compose UI** (officially supported on Android, desktop (JVM), iOS, and web (Kotlin/Wasm)) and **DOM-based Compose HTML**
77

8-
We try to provide a set of common extensions and composable component APIs akin to those in `androidx.compose` (`androidx.compose.foundation`, `androidx.compose.material`, and `androidx.compose.material3`), meanwhile making them compatible with the Compose HTML APIs. However, only subsets of the composables and composable parameters are supported due to the API differences, limitations of the JS (web) platform and the Compose HTML composables this project depends on, and our limited effort.
8+
This library was previously named "Compose Multiplatform Material".
99

10-
Complete visual consistency across different platforms is not guaranteed. See the [the side-by-side demo site](https://huanshankeji.github.io/compose-multiplatform-material/) for the visual effects and their differences.
10+
## The scope and implementations of the APIs provided
1111

12-
This project is still in development and has not reached the stable state yet. Some APIs are likely to be changed and there is no detailed documentation yet. Check out [the demo project source](demo) on how to use the components in addition to the information below.
12+
We try to provide a set of common APIs including composable component APIs akin to those in `androidx.compose` (`androidx.compose.foundation`, `androidx.compose.material`, and `androidx.compose.material3`), meanwhile making them compatible with the Compose HTML APIs. However, only subsets of the composables and composable parameters are supported due to the underlying API differences, limitations of the JS platform and the available Compose HTML composables this project depends on, and our limited effort.
1313

14-
## Supported features
14+
The modules of this library correspond to the Compose Multiplatform modules (or Compose modules in AndroidX) that are not available for Compose HTML, aka those that depend on [the UI module](https://github.com/JetBrains/compose-multiplatform-core/tree/jb-main/compose/ui), more specifically [`ui-graphics`](https://github.com/JetBrains/compose-multiplatform-core/tree/jb-main/compose/ui/ui-graphics). The `common` module of this library corresponds to the `ui` and `foundation` modules, offering UI components (including layouts), modifiers, UI configuration classes, etc.
15+
16+
The Compose HTML / JS DOM source is mainly based on [Kobweb Silk](https://github.com/varabyte/kobweb?tab=readme-ov-file#silk) [Compose](https://github.com/varabyte/kobweb/tree/main/frontend/kobweb-compose), [KMDC](https://github.com/mpetuska/kmdc), and [Compose HTML Material](https://github.com/huanshankeji/compose-html-material) (which is then based on [Material Web](https://github.com/material-components/material-web)).
17+
18+
## References and limitations
19+
20+
Complete visual consistency across different platforms is not guaranteed. See [the side-by-side demo site](https://huanshankeji.github.io/compose-multiplatform-material/) for the visual effects and their differences.
21+
22+
This project is still in development and has not reached a stable state. Some APIs are subject to change and there is no detailed documentation yet. Check out [the demo project source](demo) on how to use the components in addition to the sections below.
23+
24+
## Supported API catalog
1525

1626
### Components
1727

@@ -32,7 +42,7 @@ This project is still in development and has not reached the stable state yet. S
3242

3343
###### `ext` layouts
3444

35-
- `BoxWithConstraints`
45+
- `BoxWithConstraints`
3646

3747
##### Lazy
3848

@@ -82,7 +92,7 @@ This project is still in development and has not reached the stable state yet. S
8292
- `Button` (`FilledButton`), `ElevatedButton`, `FilledTonalButton`, `OutlinedButton`, `TextButton`
8393
- `Card` (`FilledCard`), `ElevatedCard`, `OutlinedCard`
8494
- `DropdownMenu`, `DropdownMenuItem`
85-
- `ExposedDropdownMenuBox`, `ExposedDropdownMenuBoxScope.ExposedDropdownMenuBoxTextField`, `ExposedDropdownMenuBoxScope.ExposedDropdownMenu`, `ExposedDropdownMenuWithTextField`
95+
- `ExposedDropdownMenuBox`, `ExposedDropdownMenuBoxScope.ExposedDropdownMenuBoxTextField`, `ExposedDropdownMenuBoxScope.ExposedDropdownMenu`, `ExposedDropdownMenuWithTextField`
8696
- `FloatingActionButton`, `SmallFloatingActionButton`, `LargeFloatingActionButton`, `ExtendedFloatingActionButton`
8797
- `IconButton`, `IconToggleButton`, `FilledIconButton`, `FilledIconToggleButton`, `FilledTonalIconButton`, `FilledTonalIconToggleButton`, `OutlinedIconButton`, `OutlinedIconToggleButton`
8898
- `NavigationBar`, `NavigationBarItem`
@@ -95,11 +105,11 @@ This project is still in development and has not reached the stable state yet. S
95105

96106
#### About `ext` components (components in the `ext` packages)
97107

98-
The components in the `ext` packages don't follow the `androidx.compose` APIs exactly, but rather provide wrappers are more idiomatic and conventional on both kinds of targets, wrapping different APIs which can't be unified following the `androidx.compose` APIs.
108+
The components in the `ext` packages don't follow the `androidx.compose` APIs exactly, but rather provide wrappers that are more idiomatic and conventional on both kinds of targets, wrapping different APIs that can't be unified following the `androidx.compose` APIs.
99109

100110
#### About parameter names
101111

102-
The parameter names with suffixes such as "JsDom" or "AndroidxCommon" are platform-specific, and only apply on their respective platform(s), Compose HTML / JS DOM or
112+
The parameter names with suffixes such as "JsDom" or "ComposeUi" are platform-specific, and only apply on their respective platform(s), Compose HTML / JS DOM or
103113
`androidx.compose` platforms.
104114

105115
#### Material Icons
@@ -144,23 +154,24 @@ transition or animation on Compose HTML / JS DOM. These APIs are also highly exp
144154
See [CMP-4966](https://youtrack.jetbrains.com/issue/CMP-4966) for a bug to avoid. Also, ViewModel-related functions
145155
are not implemented yet on Compose HTML / JS DOM.
146156

147-
## Add the libraries to your dependency
157+
## Add to your dependencies
148158

149159
Maven coordinate:
150160

151161
```kotlin
152-
"com.huanshankeji:compose-multiplatform-$module:$version"
162+
"com.huanshankeji:compose-multiplatform-html-unified-$module:$version"
153163
```
154164

155165
More specifically:
166+
156167
```kotlin
157-
"com.huanshankeji:compose-multiplatform-common:$version"
158-
"com.huanshankeji:compose-multiplatform-material-icons-core:$version"
159-
"com.huanshankeji:compose-multiplatform-material2:$version"
160-
"com.huanshankeji:compose-multiplatform-material3:$version"
168+
"com.huanshankeji:compose-multiplatform-html-unified-common:$version"
169+
"com.huanshankeji:compose-multiplatform-html-unified-material-icons-core:$version"
170+
"com.huanshankeji:compose-multiplatform-html-unified-material2:$version"
171+
"com.huanshankeji:compose-multiplatform-html-unified-material3:$version"
161172
```
162173

163-
For example, depend on the Material 3 module with Gradle:
174+
For example, to depend on the Material 3 module with Gradle:
164175

165176
```kotlin
166177
kotlin {

buildSrc/src/main/kotlin/VersionsAndDependencies.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import com.huanshankeji.CommonDependencies
22
import org.jetbrains.compose.ComposeBuildConfig
33

4-
val projectVersion = "0.4.1-SNAPSHOT"
4+
val projectVersion = "0.5.0-SNAPSHOT"
55

66
val commonDependencies = CommonDependencies()
77

buildSrc/src/main/kotlin/lib-conventions-without-publishing.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ kotlin {
1616
@OptIn(ExperimentalKotlinGradlePluginApi::class)
1717
applyDefaultHierarchyTemplate {
1818
common {
19-
group("androidxCommon") {
19+
group("composeUi") {
2020
withJvm()
2121
withAndroidTarget()
2222
group("ios")
@@ -27,10 +27,10 @@ kotlin {
2727

2828
/*
2929
sourceSets {
30-
val androidxCommonMain by creating { dependsOn(commonMain.get()) }
31-
jvmMain { dependsOn(androidxCommonMain) }
32-
iosMain { dependsOn(androidxCommonMain) }
33-
named("wasmJsMain") { dependsOn(androidxCommonMain) }
30+
val composeUiMain by creating { dependsOn(commonMain.get()) }
31+
jvmMain { dependsOn(composeUiMain) }
32+
iosMain { dependsOn(composeUiMain) }
33+
named("wasmJsMain") { dependsOn(composeUiMain) }
3434
}
3535
*/
3636
}

0 commit comments

Comments
 (0)