@momo-kits/native-kits 0.153.1-beta.7 → 0.153.1-newsfeed.6
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/build.gradle.kts +10 -0
- package/compose/build.gradle.kts +14 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +3 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ComposeNavigatorManager.kt +26 -0
- package/ios/Badge/BadgeRibbon.swift +9 -77
- package/package.json +1 -1
- package/settings.gradle.kts +1 -4
- package/local.properties +0 -8
package/build.gradle.kts
CHANGED
|
@@ -11,6 +11,16 @@ plugins {
|
|
|
11
11
|
alias(libs.plugins.android.application) apply false
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
repositories {
|
|
15
|
+
mavenLocal()
|
|
16
|
+
mavenCentral()
|
|
17
|
+
google()
|
|
18
|
+
maven {
|
|
19
|
+
url = uri("http://nexus.mservice.com.vn:8081/repository/maven-public/")
|
|
20
|
+
isAllowInsecureProtocol = true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
buildscript {
|
|
15
25
|
repositories {
|
|
16
26
|
maven("https://storage.googleapis.com/r8-releases/raw")
|
package/compose/build.gradle.kts
CHANGED
|
@@ -7,6 +7,19 @@ plugins {
|
|
|
7
7
|
kotlin("plugin.serialization")
|
|
8
8
|
id("maven-publish")
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
allprojects {
|
|
12
|
+
repositories {
|
|
13
|
+
mavenLocal()
|
|
14
|
+
mavenCentral()
|
|
15
|
+
google()
|
|
16
|
+
maven {
|
|
17
|
+
url = uri("http://nexus.mservice.com.vn:8081/repository/maven-public/")
|
|
18
|
+
isAllowInsecureProtocol = true
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
10
23
|
fun getVersionFromPackageJson(): String {
|
|
11
24
|
val packageJsonFile = file("../package.json")
|
|
12
25
|
val packageJsonText = packageJsonFile.readText()
|
|
@@ -76,7 +89,7 @@ kotlin {
|
|
|
76
89
|
implementation(libs.coil.multiplatform.network.ktor)
|
|
77
90
|
implementation(libs.jetbrains.serialization.json)
|
|
78
91
|
implementation(libs.kotlinx.datetime)
|
|
79
|
-
api(
|
|
92
|
+
api(libs.native.max.api)
|
|
80
93
|
}
|
|
81
94
|
}
|
|
82
95
|
val androidMain by getting {
|
package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt
CHANGED
|
@@ -2,7 +2,8 @@ package vn.momo.kits.components.datetimepicker
|
|
|
2
2
|
|
|
3
3
|
import androidx.compose.runtime.Composable
|
|
4
4
|
import androidx.compose.runtime.remember
|
|
5
|
-
import
|
|
5
|
+
import kotlin.time.Clock
|
|
6
|
+
import kotlin.time.ExperimentalTime
|
|
6
7
|
import kotlinx.datetime.DatePeriod
|
|
7
8
|
import kotlinx.datetime.LocalDateTime
|
|
8
9
|
import kotlinx.datetime.TimeZone
|
|
@@ -149,6 +150,7 @@ val timeMode = listOf("AM", "PM")
|
|
|
149
150
|
/**
|
|
150
151
|
* Get today's date
|
|
151
152
|
*/
|
|
153
|
+
@OptIn(ExperimentalTime::class)
|
|
152
154
|
fun getCurrentDateTime(): LocalDateTime {
|
|
153
155
|
return Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault())
|
|
154
156
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package vn.momo.kits.navigation
|
|
2
|
+
|
|
3
|
+
import kotlinx.coroutines.flow.MutableStateFlow
|
|
4
|
+
import kotlinx.coroutines.flow.asStateFlow
|
|
5
|
+
|
|
6
|
+
// Support swipe back on iOS
|
|
7
|
+
object ComposeNavigatorManager {
|
|
8
|
+
private val _managers = MutableStateFlow<List<Navigator>>(emptyList())
|
|
9
|
+
val managers = _managers.asStateFlow()
|
|
10
|
+
|
|
11
|
+
fun push(manager: Navigator) {
|
|
12
|
+
_managers.value = _managers.value + manager
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
fun removeLast() {
|
|
16
|
+
_managers.value = _managers.value.dropLast(1)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
fun checkCanPop(): Boolean = _managers.value.isNotEmpty()
|
|
20
|
+
|
|
21
|
+
fun pop() {
|
|
22
|
+
top()?.pop()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private fun top(): Navigator? = _managers.value.lastOrNull()
|
|
26
|
+
}
|
|
@@ -1,74 +1,5 @@
|
|
|
1
1
|
import SwiftUI
|
|
2
2
|
|
|
3
|
-
// MARK: - Custom Shape for Rounded Corners
|
|
4
|
-
struct RoundedCorners: Shape {
|
|
5
|
-
var topLeft: CGFloat = 0.0
|
|
6
|
-
var topRight: CGFloat = 0.0
|
|
7
|
-
var bottomLeft: CGFloat = 0.0
|
|
8
|
-
var bottomRight: CGFloat = 0.0
|
|
9
|
-
|
|
10
|
-
func path(in rect: CGRect) -> Path {
|
|
11
|
-
var path = Path()
|
|
12
|
-
|
|
13
|
-
let width = rect.size.width
|
|
14
|
-
let height = rect.size.height
|
|
15
|
-
|
|
16
|
-
// Start from top left
|
|
17
|
-
path.move(to: CGPoint(x: topLeft, y: 0))
|
|
18
|
-
|
|
19
|
-
// Top edge and top right corner
|
|
20
|
-
path.addLine(to: CGPoint(x: width - topRight, y: 0))
|
|
21
|
-
if topRight > 0 {
|
|
22
|
-
path.addArc(
|
|
23
|
-
center: CGPoint(x: width - topRight, y: topRight),
|
|
24
|
-
radius: topRight,
|
|
25
|
-
startAngle: Angle(degrees: -90),
|
|
26
|
-
endAngle: Angle(degrees: 0),
|
|
27
|
-
clockwise: false
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Right edge and bottom right corner
|
|
32
|
-
path.addLine(to: CGPoint(x: width, y: height - bottomRight))
|
|
33
|
-
if bottomRight > 0 {
|
|
34
|
-
path.addArc(
|
|
35
|
-
center: CGPoint(x: width - bottomRight, y: height - bottomRight),
|
|
36
|
-
radius: bottomRight,
|
|
37
|
-
startAngle: Angle(degrees: 0),
|
|
38
|
-
endAngle: Angle(degrees: 90),
|
|
39
|
-
clockwise: false
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Bottom edge and bottom left corner
|
|
44
|
-
path.addLine(to: CGPoint(x: bottomLeft, y: height))
|
|
45
|
-
if bottomLeft > 0 {
|
|
46
|
-
path.addArc(
|
|
47
|
-
center: CGPoint(x: bottomLeft, y: height - bottomLeft),
|
|
48
|
-
radius: bottomLeft,
|
|
49
|
-
startAngle: Angle(degrees: 90),
|
|
50
|
-
endAngle: Angle(degrees: 180),
|
|
51
|
-
clockwise: false
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Left edge and top left corner
|
|
56
|
-
path.addLine(to: CGPoint(x: 0, y: topLeft))
|
|
57
|
-
if topLeft > 0 {
|
|
58
|
-
path.addArc(
|
|
59
|
-
center: CGPoint(x: topLeft, y: topLeft),
|
|
60
|
-
radius: topLeft,
|
|
61
|
-
startAngle: Angle(degrees: 180),
|
|
62
|
-
endAngle: Angle(degrees: 270),
|
|
63
|
-
clockwise: false
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
path.closeSubpath()
|
|
68
|
-
return path
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
3
|
public enum RibbonPosition {
|
|
73
4
|
case topLeft
|
|
74
5
|
case topRight
|
|
@@ -145,13 +76,14 @@ public struct BadgeRibbon: View {
|
|
|
145
76
|
.frame(height: RibbonConstants.roundHeight)
|
|
146
77
|
.padding(.trailing, RibbonConstants.roundPaddingEnd)
|
|
147
78
|
.background(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
79
|
+
RoundedRectangle(cornerRadius: Radius.M)
|
|
80
|
+
.fill(backgroundColor)
|
|
81
|
+
.mask(
|
|
82
|
+
HStack(spacing: 0) {
|
|
83
|
+
Rectangle()
|
|
84
|
+
RoundedRectangle(cornerRadius: Radius.M)
|
|
85
|
+
}
|
|
86
|
+
)
|
|
155
87
|
)
|
|
156
88
|
}
|
|
157
89
|
|
|
@@ -207,7 +139,7 @@ private struct RibbonConstants {
|
|
|
207
139
|
static let ribbonHeight: CGFloat = 20
|
|
208
140
|
static let roundHeight: CGFloat = 16
|
|
209
141
|
static let skewBodyHeight: CGFloat = 16
|
|
210
|
-
static let roundRightRadius: CGFloat =
|
|
142
|
+
static let roundRightRadius: CGFloat = 12
|
|
211
143
|
static let roundPaddingEnd: CGFloat = 6
|
|
212
144
|
static let skewTailWidth: CGFloat = 8
|
|
213
145
|
static let skewTailHeight: CGFloat = 16
|
package/package.json
CHANGED
package/settings.gradle.kts
CHANGED
|
@@ -19,7 +19,4 @@ dependencyResolutionManagement {
|
|
|
19
19
|
google()
|
|
20
20
|
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
|
21
21
|
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
include(":NativeMaxApi")
|
|
25
|
-
project(":NativeMaxApi").projectDir = file("./node_modules/@momo-platform/native-max-api/NativeMaxApi")
|
|
22
|
+
}
|
package/local.properties
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
-
# as it contains information specific to your local configuration.
|
|
3
|
-
#
|
|
4
|
-
# Location of the SDK. This is only used by Gradle.
|
|
5
|
-
# For customization when using a Version Control System, please read the
|
|
6
|
-
# header note.
|
|
7
|
-
#Thu Jan 09 10:43:10 ICT 2025
|
|
8
|
-
sdk.dir=/Users/sophia/Library/Android/sdk
|