@momo-kits/foundation 0.169.4-beta.5 → 0.169.4-beta.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/Text/utils.ts CHANGED
@@ -9,18 +9,13 @@ const MAX_DEVICE_SCALE = 5;
9
9
  const useScaleSize = (size: number, scaleRate?: number) => {
10
10
  const { width } = useWindowDimensions();
11
11
  const context = useContext<any>(MiniAppContext);
12
- // opt-in ceiling: when set (arg or context), the final size never exceeds size × capRate,
13
- // in both the mini-app userScaleRate path and the OS path. Undefined keeps the old behavior.
14
- const capRate = scaleRate ?? context?.fontScale?.maxScaleRate;
15
- const cap = (scaled: number) =>
16
- capRate != null ? Math.min(scaled, size * capRate) : scaled;
17
12
  if (context?.fontScale?.useOSScaleRate === false) {
18
- return cap(size * (context.fontScale.userScaleRate ?? 1));
13
+ return size * (context.fontScale.userScaleRate ?? 1);
19
14
  }
20
15
  const fontScale = PixelRatio.getFontScale();
21
16
  const deviceScale = width / DEFAULT_SCREEN_SIZE;
22
17
 
23
- const maxScaleRate = capRate ?? MAX_FONT_SCALE;
18
+ const maxScaleRate = scaleRate ?? MAX_FONT_SCALE;
24
19
 
25
20
  let fontSizeDeviceScale = size;
26
21
  let fontSizeOSScale = size;
@@ -39,7 +34,7 @@ const useScaleSize = (size: number, scaleRate?: number) => {
39
34
  );
40
35
  }
41
36
 
42
- return cap(Math.max(fontSizeDeviceScale, fontSizeOSScale));
37
+ return Math.max(fontSizeDeviceScale, fontSizeOSScale);
43
38
  };
44
39
 
45
40
  const scaleSize = (size: number) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.169.4-beta.5",
3
+ "version": "0.169.4-beta.6",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},