@momo-kits/native-kits 0.163.1-beta.9 → 0.163.1-sp.1

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.
@@ -0,0 +1,75 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(curl -s -o /dev/null -w \"%{http_code}\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
5
+ "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/maven-metadata.xml\")",
6
+ "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko/maven-metadata.xml\")",
7
+ "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko/0.144.6/skiko-0.144.6.module\")",
8
+ "Bash(curl -s -o /dev/null -w '%{http_code}' https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.__TRACKED_VAR__)",
9
+ "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/\")",
10
+ "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/\")",
11
+ "Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.148.1/skiko-android-0.148.1.pom\")",
12
+ "Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.5/skiko-android-0.144.5.pom\")",
13
+ "Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://dl.google.com/dl/android/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
14
+ "Bash(curl -s \"https://search.maven.org/solrsearch/select?q=a:skiko-android&rows=5&wt=json\")",
15
+ "Bash(curl -sL -o /dev/null -w \"%{http_code} %{url_effective}\\\\n\" \"https://repo1.maven.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
16
+ "Bash(curl *)",
17
+ "Bash(./gradlew :sample:androidApp:dependencies --configuration debugRuntimeClasspath)",
18
+ "Bash(./gradlew :sample:shared:compileDebugKotlinAndroid)",
19
+ "Bash(./gradlew :sample:androidApp:compileDebugKotlin)",
20
+ "Bash(ls -d *.xcodeproj)",
21
+ "Bash(grep -c ChipDemo.swift __TRACKED_VAR__/project.pbxproj)",
22
+ "Bash(grep -c PBXFileSystemSynchronizedRootGroup __TRACKED_VAR__/project.pbxproj)",
23
+ "Bash(grep -c InformationDemo.swift __TRACKED_VAR__/project.pbxproj)",
24
+ "Bash(plutil -lint project.pbxproj)",
25
+ "Bash(xcode-select -p)",
26
+ "Bash(/usr/bin/xcrun xcodebuild *)",
27
+ "Bash(echo \"exit: $?\")",
28
+ "Bash(/Applications/Xcode26.app/Contents/Developer/usr/bin/xcodebuild -version)",
29
+ "Bash(./gradlew :compose:tasks --all)",
30
+ "Bash(grep -n \"vanniktech\\\\|mavenPublishing\\\\|^publishing\\\\|version = gitlabVersion\\\\|namespace =\\\\|compileSdk =\\\\|minSdk =\\\\|GitLabPackages\\\\|name = \\\\\"\\\\${gitlabRepo}Packages\\\\\"\")",
31
+ "Bash(git checkout *)",
32
+ "Bash(./gradlew :compose:publishAllPublicationsToGitLabPackagesRepository --dry-run)",
33
+ "Bash(git fetch *)",
34
+ "Bash(git pull *)",
35
+ "Bash(git push *)",
36
+ "Bash(git branch *)",
37
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -list)",
38
+ "Bash(xcrun simctl *)",
39
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
40
+ "Bash(pod install *)",
41
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'id=1E6F9A79-5E64-4590-BEA2-828D75D99393' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
42
+ "Bash(xcrun swiftc *)",
43
+ "Bash(echo \"=== exit: $? \\(1=none found\\) ===\")",
44
+ "Bash(cat Radius.swift)",
45
+ "Bash(cat Spacing.swift)",
46
+ "Bash(echo \"exit=$?\")",
47
+ "Bash(ruby *)",
48
+ "Bash(xcodebuild -list -workspace iosApp.xcworkspace)",
49
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro' build)",
50
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' build)",
51
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' build)",
52
+ "Bash(xcodebuild build *)",
53
+ "Bash(git stash *)",
54
+ "Bash(plutil -lint sample/iosApp/iosApp.xcodeproj/project.pbxproj)",
55
+ "Bash(git add *)",
56
+ "Bash(git commit -m 'feat: DS-646 [ci build] *)",
57
+ "Bash(git commit -q -m 'fix: DS-656 [ci build] *)",
58
+ "Bash(xargs git log --oneline -1)",
59
+ "Bash(git rev-list *)",
60
+ "Bash(git status *)",
61
+ "Bash(git rebase *)",
62
+ "Bash(git merge *)",
63
+ "Bash(git reset *)",
64
+ "Bash(awk '/^ *)",
65
+ "Bash(git ls-tree *)",
66
+ "Bash(awk *)",
67
+ "Read(//Users/sophia/Workspace/momo/momo-app/**)",
68
+ "Bash(git log *)",
69
+ "Bash(xcodebuild -version)",
70
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
71
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
72
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug clean build CODE_SIGNING_ALLOWED=NO)"
73
+ ]
74
+ }
75
+ }
@@ -11,6 +11,7 @@
11
11
  //
12
12
 
13
13
  import Foundation
14
+ import SwiftUI
14
15
 
15
16
  /// Translation dictionary keyed by language; both `vi` and `en` are required.
16
17
  public struct LocalizationObject {
@@ -275,3 +276,34 @@ public final class Localize: ObservableObject {
275
276
  ]
276
277
  )
277
278
  }
279
+
280
+ /// Snapshots `currentLanguage` alongside the instance so SwiftUI sees an environment
281
+ /// *change* on `changeLanguage`: the `Localize` reference alone never changes, and
282
+ /// `@Environment` does not subscribe to `@Published` the way `@EnvironmentObject` does.
283
+ private struct LocalizeBox: Equatable {
284
+ let localize: Localize
285
+ let language: String
286
+
287
+ init(_ localize: Localize) {
288
+ self.localize = localize
289
+ self.language = localize.currentLanguage
290
+ }
291
+
292
+ static func == (lhs: LocalizeBox, rhs: LocalizeBox) -> Bool {
293
+ lhs.localize === rhs.localize && lhs.language == rhs.language
294
+ }
295
+ }
296
+
297
+ private struct LocalizeKey: EnvironmentKey {
298
+ /// A default-constructed `Localize` already carries the full kit dictionary, so a
299
+ /// consumer that never injects one renders untranslated-but-correct text instead of
300
+ /// trapping the way `@EnvironmentObject` does.
301
+ static let defaultValue = LocalizeBox(Localize())
302
+ }
303
+
304
+ public extension EnvironmentValues {
305
+ var localize: Localize {
306
+ get { self[LocalizeKey.self].localize }
307
+ set { self[LocalizeKey.self] = LocalizeBox(newValue) }
308
+ }
309
+ }
@@ -63,12 +63,14 @@ public struct NavigationContainer<Initial: View>: View {
63
63
  .environmentObject(applicationEnvironment)
64
64
  .environment(\.applicationEnvironment, applicationEnvironment)
65
65
  .environmentObject(localize)
66
+ .environment(\.localize, localize)
66
67
  .fullScreenCover(item: $navigator.presented) { route in
67
68
  screenView(forDialog: route)
68
69
  .environmentObject(navigator)
69
70
  .environmentObject(applicationEnvironment)
70
71
  .environment(\.applicationEnvironment, applicationEnvironment)
71
72
  .environmentObject(localize)
73
+ .environment(\.localize, localize)
72
74
  }
73
75
  .overlay {
74
76
  if let item = navigator.overplay {
@@ -77,6 +79,7 @@ public struct NavigationContainer<Initial: View>: View {
77
79
  .environmentObject(applicationEnvironment)
78
80
  .environment(\.applicationEnvironment, applicationEnvironment)
79
81
  .environmentObject(localize)
82
+ .environment(\.localize, localize)
80
83
  }
81
84
  }
82
85
  .onAppear {
@@ -54,7 +54,7 @@ extension View {
54
54
  // MARK: - PopupDisplay
55
55
 
56
56
  public struct PopupDisplay: View {
57
- @EnvironmentObject private var localize: Localize
57
+ @Environment(\.localize) private var localize
58
58
 
59
59
  // MARK: Lifecycle
60
60
 
@@ -38,7 +38,7 @@ public struct PopupNotifyProps {
38
38
  }
39
39
 
40
40
  public struct PopupNotify: View {
41
- @EnvironmentObject private var localize: Localize
41
+ @Environment(\.localize) private var localize
42
42
 
43
43
  public let props: PopupNotifyProps
44
44
 
@@ -20,26 +20,21 @@ public struct PopupPromotion: View {
20
20
  }
21
21
 
22
22
  public var body: some View {
23
- // Mirrors Kotlin's `Modifier.fillMaxWidth().aspectRatio(0.72f)` box with
24
- // `ContentScale.FillBounds` inside it: a fixed-ratio frame the image stretches
25
- // to exactly fill (no `.aspectRatio` modifier on the image itself, unlike the
26
- // previous `.fit`, which letterboxed instead of stretching).
27
- let boxWidth = UIScreen.main.bounds.width - Spacing.XL * 2
28
- let boxHeight = boxWidth / 0.72
29
-
30
23
  VStack(spacing: 8) {
31
24
  if(imageUrl.isEmpty) {
32
- Icon(source: "media_fail", size: boxWidth)
25
+ Icon(source: "media_fail", size: UIScreen.main.bounds.width - Spacing.XL * 2)
33
26
  }
34
27
  else {
35
28
  WebImage(url: URL(string: imageUrl)!)
36
29
  .resizable()
37
30
  .placeholder {
38
31
  Color.gray
39
- .frame(width: boxWidth, height: boxHeight)
32
+ .aspectRatio(0.72, contentMode: .fit)
33
+ .frame(maxWidth: UIScreen.main.bounds.width - Spacing.XL * 2)
40
34
  .clipped()
41
35
  }
42
- .frame(width: boxWidth, height: boxHeight, alignment: .center)
36
+ .aspectRatio(0.72, contentMode: .fit)
37
+ .frame(maxWidth: UIScreen.main.bounds.width - Spacing.XL * 2, alignment: .center)
43
38
  .clipped()
44
39
  .onTapGesture {
45
40
  onAction?()
@@ -70,7 +65,6 @@ public struct PopupPromotion: View {
70
65
  .padding(8)
71
66
  .zIndex(1)
72
67
  }
73
- .buttonStyle(.plain)
74
68
  }
75
69
  }
76
70
 
@@ -51,8 +51,8 @@ let defaultBanner = TrustBannerData(
51
51
  )
52
52
 
53
53
  public struct TrustBanner: View {
54
- @EnvironmentObject var applicationEnvironment: ApplicationEnvironment
55
- @EnvironmentObject private var localize: Localize
54
+ @Environment(\.applicationEnvironment) var applicationEnvironment
55
+ @Environment(\.localize) private var localize
56
56
 
57
57
  var onPress: ((String)->Void)?
58
58
 
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.163.1-beta.9'
3
+ s.version = '0.163.1-sp.1'
4
4
  s.summary = 'MoMoUIKits for iOS'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKitsDemo'
3
- s.version = '0.163.1-beta.9'
3
+ s.version = '0.163.1-sp.1'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.163.1-beta.9",
3
+ "version": "0.163.1-sp.1",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},