@momo-kits/native-kits 0.168.1-sizescale.1-debug → 0.169.1-debug
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +4 -3
- package/PUBLISH_GUIDE.md +29 -658
- package/compose/build.gradle.kts +2 -2
- package/compose/compose.podspec +1 -1
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +4 -5
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +17 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +21 -15
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +76 -83
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +3 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +11 -14
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +3 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +187 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +8 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +57 -163
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +17 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +4 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +5 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +18 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +34 -23
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +321 -149
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +79 -71
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +87 -261
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +104 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +3 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +3 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +7 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +2 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +1 -2
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +3 -2
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +48 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +9 -3
- package/gradle.properties +1 -3
- package/ios/Input/Input.swift +3 -1
- package/ios/Input/InputTextArea.swift +3 -1
- package/ios/Layout/ModalLayout.swift +152 -0
- package/ios/Layout/ScreenLayout.swift +28 -24
- package/ios/Navigation/BottomSheet.swift +29 -156
- package/ios/Navigation/BottomTab/BottomTab.swift +46 -52
- package/ios/Navigation/BottomTab/BottomTabBar.swift +281 -115
- package/ios/Navigation/BottomTab/CurvedContainer.swift +51 -47
- package/ios/Navigation/BottomTab/DuoTabBar.swift +62 -195
- package/ios/Navigation/BottomTab/TabBarMetrics.swift +84 -0
- package/ios/Navigation/Component/HeaderRight.swift +1 -1
- package/ios/Navigation/ModalScreen.swift +18 -7
- package/ios/Navigation/StackScreen.swift +3 -1
- package/ios/Popup/PopupDisplay.swift +4 -2
- package/ios/Popup/PopupInput.swift +4 -2
- package/ios/Popup/PopupLayout.swift +10 -9
- package/ios/Popup/PopupNotify.swift +32 -25
- package/ios/Typography/Text.swift +2 -2
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/ios-demo/Resources/tabbar_scan_qr_button.json +1 -0
- package/ios-demo/Resources/tabbar_scan_qr_label.json +1 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +272 -59
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +103 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +29 -1
- package/local.properties +8 -0
- package/package.json +1 -1
- package/publish.sh +170 -513
- package/compose/build.gradle.kts.backup +0 -198
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitSizeScale.kt +0 -45
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import com.vanniktech.maven.publish.JavadocJar
|
|
2
|
-
import com.vanniktech.maven.publish.KotlinMultiplatform
|
|
3
|
-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
4
|
-
|
|
5
|
-
plugins {
|
|
6
|
-
alias(libs.plugins.jetbrains.kotlin.multiplatform)
|
|
7
|
-
alias(libs.plugins.android.library)
|
|
8
|
-
alias(libs.plugins.compose)
|
|
9
|
-
alias(libs.plugins.kotlin.compose.compiler)
|
|
10
|
-
alias(libs.plugins.vanniktech.mavenPublish)
|
|
11
|
-
id(libs.plugins.jetbrains.kotlin.cocoapods.get().pluginId)
|
|
12
|
-
kotlin("plugin.serialization")
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
val gitlabName: String = findProperty("name") as String? ?: ""
|
|
16
|
-
val gitlabRepo: String = findProperty("repo") as String? ?: ""
|
|
17
|
-
val gitlabUrl: String = findProperty("url") as String? ?: ""
|
|
18
|
-
val gitlabGroup: String = findProperty("group") as String? ?: ""
|
|
19
|
-
val gitlabArtifactId: String = findProperty("artifact.id") as String? ?: ""
|
|
20
|
-
val gitlabVersion: String = findProperty("version") as String? ?: ""
|
|
21
|
-
val gitlabUser: String = findProperty("gitlab.user") as String? ?: ""
|
|
22
|
-
val gitlabKey: String = findProperty("gitlab.password") as String? ?: ""
|
|
23
|
-
|
|
24
|
-
kotlin {
|
|
25
|
-
androidTarget {
|
|
26
|
-
compilerOptions {
|
|
27
|
-
jvmTarget.set(JvmTarget.JVM_17)
|
|
28
|
-
}
|
|
29
|
-
publishLibraryVariants("release")
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
val fwName = gitlabArtifactId
|
|
33
|
-
val iosTargets = listOf(iosArm64(), iosSimulatorArm64())
|
|
34
|
-
iosTargets.forEach {
|
|
35
|
-
it.binaries.framework {
|
|
36
|
-
baseName = fwName
|
|
37
|
-
binaryOption("bundleId", "$gitlabGroup.$fwName")
|
|
38
|
-
isStatic = true
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
cocoapods {
|
|
43
|
-
version = gitlabVersion
|
|
44
|
-
summary = "IOS Shared module"
|
|
45
|
-
homepage = "https://momo.vn"
|
|
46
|
-
ios.deploymentTarget = "15.0"
|
|
47
|
-
|
|
48
|
-
framework {
|
|
49
|
-
baseName = fwName
|
|
50
|
-
isStatic = true
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
pod("lottie-ios") {
|
|
54
|
-
moduleName = "Lottie"
|
|
55
|
-
version = "4.4.3"
|
|
56
|
-
extraOpts += listOf("-compiler-option", "-fmodules")
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
sourceSets {
|
|
61
|
-
all {
|
|
62
|
-
languageSettings.optIn("vn.momo.kits.modifier.InternalApi")
|
|
63
|
-
}
|
|
64
|
-
commonMain.dependencies {
|
|
65
|
-
implementation(compose.runtime)
|
|
66
|
-
implementation(compose.material)
|
|
67
|
-
implementation(compose.material3)
|
|
68
|
-
implementation(compose.components.resources)
|
|
69
|
-
implementation(libs.compose.ui.backhandler)
|
|
70
|
-
implementation(libs.ktor.client.core)
|
|
71
|
-
implementation(libs.jetbrains.coroutines.core)
|
|
72
|
-
implementation(libs.navigation.multiplatform)
|
|
73
|
-
implementation(libs.coil.multiplatform.compose)
|
|
74
|
-
implementation(libs.coil.multiplatform.core)
|
|
75
|
-
implementation(libs.coil.multiplatform.network.ktor)
|
|
76
|
-
implementation(libs.jetbrains.serialization.json)
|
|
77
|
-
implementation(libs.kotlinx.datetime)
|
|
78
|
-
api(libs.native.max.api)
|
|
79
|
-
implementation(libs.compottie)
|
|
80
|
-
implementation(libs.gif.image)
|
|
81
|
-
}
|
|
82
|
-
androidMain.dependencies {
|
|
83
|
-
implementation(libs.ktor.client.okhttp)
|
|
84
|
-
implementation(libs.airbnb.lottie)
|
|
85
|
-
}
|
|
86
|
-
iosMain.dependencies {
|
|
87
|
-
implementation(libs.ktor.client.darwin)
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
android {
|
|
93
|
-
namespace = "$gitlabGroup.$gitlabArtifactId"
|
|
94
|
-
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
|
95
|
-
compileOptions {
|
|
96
|
-
sourceCompatibility = JavaVersion.VERSION_17
|
|
97
|
-
targetCompatibility = JavaVersion.VERSION_17
|
|
98
|
-
}
|
|
99
|
-
defaultConfig {
|
|
100
|
-
minSdk = libs.versions.android.minSdk.get().toInt()
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
dependencies {
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
repositories {
|
|
108
|
-
google {
|
|
109
|
-
mavenContent {
|
|
110
|
-
includeGroupAndSubgroups("androidx")
|
|
111
|
-
includeGroupAndSubgroups("com.android")
|
|
112
|
-
includeGroupAndSubgroups("com.google")
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
mavenCentral()
|
|
116
|
-
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
|
|
117
|
-
maven {
|
|
118
|
-
url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
|
|
119
|
-
credentials {username = "download_packages"; password = "gldt-bjDqLpU_sPcHDuXau2ws" }
|
|
120
|
-
}
|
|
121
|
-
maven {
|
|
122
|
-
url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
|
|
123
|
-
credentials {
|
|
124
|
-
username = "viewer"
|
|
125
|
-
password = "viewer"
|
|
126
|
-
}
|
|
127
|
-
isAllowInsecureProtocol = true
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
compose {
|
|
132
|
-
resources {
|
|
133
|
-
publicResClass = true
|
|
134
|
-
packageOfResClass = "vn.momo.uikits.resources"
|
|
135
|
-
generateResClass = always
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
publishing {
|
|
140
|
-
repositories {
|
|
141
|
-
maven {
|
|
142
|
-
name = "${gitlabRepo}Packages"
|
|
143
|
-
credentials {
|
|
144
|
-
username = gitlabUser
|
|
145
|
-
password = gitlabKey
|
|
146
|
-
}
|
|
147
|
-
url = uri("$gitlabUrl")
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
mavenPublishing {
|
|
153
|
-
configure(
|
|
154
|
-
KotlinMultiplatform(
|
|
155
|
-
javadocJar = JavadocJar.Empty(),
|
|
156
|
-
sourcesJar = true,
|
|
157
|
-
androidVariantsToPublish = listOf("release")
|
|
158
|
-
)
|
|
159
|
-
)
|
|
160
|
-
|
|
161
|
-
repositories {
|
|
162
|
-
maven {
|
|
163
|
-
name = "${gitlabRepo}Packages"
|
|
164
|
-
credentials { username = gitlabUser; password = gitlabKey }
|
|
165
|
-
url = uri("$gitlabUrl")
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
coordinates(gitlabGroup.toString(), gitlabArtifactId, gitlabVersion.toString())
|
|
170
|
-
|
|
171
|
-
pom {
|
|
172
|
-
name = "$gitlabName Klib"
|
|
173
|
-
description = "$gitlabName"
|
|
174
|
-
url = "https://gitlab.mservice.com.vn"
|
|
175
|
-
licenses {
|
|
176
|
-
license {
|
|
177
|
-
name = "The Apache License, Version 2.0"
|
|
178
|
-
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
|
|
179
|
-
distribution = "https://www.apache.org/licenses/LICENSE-2.0.txt"
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
developers {
|
|
183
|
-
developer {
|
|
184
|
-
id = "kotlin-hands-on"
|
|
185
|
-
name = "Kotlin Developer Advocate"
|
|
186
|
-
url = "https://github.com/kotlin-hands-on/"
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Xcode 27 rejects iOS < 15; KGP's synthetic Podfile only raises pods to 12 (KT-57741), leaving lottie-ios at 13.
|
|
193
|
-
tasks.named("podGenIos") {
|
|
194
|
-
doLast {
|
|
195
|
-
val podfile = layout.buildDirectory.file("cocoapods/synthetic/ios/Podfile").get().asFile
|
|
196
|
-
podfile.writeText(podfile.readText().replace("major < 12 ||", "major < 15 ||").replace("#{12}", "#{15}"))
|
|
197
|
-
}
|
|
198
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
package vn.momo.kits.const
|
|
2
|
-
|
|
3
|
-
import androidx.compose.runtime.Composable
|
|
4
|
-
import androidx.compose.runtime.CompositionLocalProvider
|
|
5
|
-
import androidx.compose.runtime.getValue
|
|
6
|
-
import androidx.compose.runtime.mutableStateOf
|
|
7
|
-
import androidx.compose.runtime.setValue
|
|
8
|
-
import androidx.compose.runtime.staticCompositionLocalOf
|
|
9
|
-
import androidx.compose.ui.platform.LocalDensity
|
|
10
|
-
import androidx.compose.ui.unit.Density
|
|
11
|
-
import vn.momo.kits.platform.ProvideOsFontScale
|
|
12
|
-
|
|
13
|
-
object KitSizeScale {
|
|
14
|
-
var rate by mutableStateOf(1f)
|
|
15
|
-
private set
|
|
16
|
-
|
|
17
|
-
fun update(rate: Float) {
|
|
18
|
-
this.rate = if (rate > 0f) rate else 1f
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
internal val LocalSizeScale = staticCompositionLocalOf { 1f }
|
|
23
|
-
|
|
24
|
-
@Composable
|
|
25
|
-
internal fun pendingSizeScale(): Float = KitSizeScale.rate / LocalSizeScale.current
|
|
26
|
-
|
|
27
|
-
@Composable
|
|
28
|
-
internal fun ProvideKitScale(content: @Composable () -> Unit) {
|
|
29
|
-
ProvideOsFontScale { ProvideSizeScale(content) }
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@Composable
|
|
33
|
-
private fun ProvideSizeScale(content: @Composable () -> Unit) {
|
|
34
|
-
val applied = LocalSizeScale.current
|
|
35
|
-
val rate = KitSizeScale.rate
|
|
36
|
-
val density = LocalDensity.current
|
|
37
|
-
CompositionLocalProvider(
|
|
38
|
-
LocalDensity provides Density(
|
|
39
|
-
density = density.density / applied * rate,
|
|
40
|
-
fontScale = density.fontScale * applied / rate,
|
|
41
|
-
),
|
|
42
|
-
LocalSizeScale provides rate,
|
|
43
|
-
content = content,
|
|
44
|
-
)
|
|
45
|
-
}
|