@momo-kits/native-kits 0.162.3-fontscale.3 → 0.162.3-fontscale.4

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.
@@ -1,17 +1,16 @@
1
- import Combine
2
1
  import CoreGraphics
3
2
 
4
- /// App-wide font-scale preference for the SwiftUI kit. Populated by the host container
5
- /// (`KitContainer`), which reads `FontScaleProvider.configFlow` the cache-backed source, same
6
- /// as RN/Compose. `scaleSize`/`appFont` read the snapshot; `MomoText` observes it for live redraw.
7
- /// When `useOSScaleRate` is false the kit applies `userScaleRate` instead of the OS Dynamic Type
8
- /// factor. `update` must be called on the main thread.
9
- public final class FontScaleStore: ObservableObject {
3
+ /// App-wide font-scale preference for the SwiftUI kit. An exported holder the host writes once at
4
+ /// app startup (from the cache-backed `FontScaleProvider`); `scaleSize`/`appFont` read the snapshot.
5
+ /// No realtime: the SwiftUI kit has no navigation container to scope reactive updates, so a startup
6
+ /// snapshot is enough. When `useOSScaleRate` is false the kit applies `userScaleRate` instead of the
7
+ /// OS Dynamic Type factor.
8
+ public final class FontScaleStore {
10
9
  public static let shared = FontScaleStore()
11
10
  private init() {}
12
11
 
13
- @Published public private(set) var userScaleRate: CGFloat = 1
14
- @Published public private(set) var useOSScaleRate: Bool = true
12
+ public private(set) var userScaleRate: CGFloat = 1
13
+ public private(set) var useOSScaleRate: Bool = true
15
14
 
16
15
  public func update(userScaleRate: CGFloat, useOSScaleRate: Bool) {
17
16
  self.userScaleRate = userScaleRate
@@ -118,7 +118,6 @@ public extension TypographyStyle {
118
118
  }
119
119
 
120
120
  public struct MomoText: View {
121
- @ObservedObject private var fontScale = FontScaleStore.shared
122
121
  private let content: String
123
122
  private let typography: TypographyStyle
124
123
  private let color: Color
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.162.3-fontscale.3",
3
+ "version": "0.162.3-fontscale.4",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},