@onekeyfe/react-native-text 3.0.162 → 3.0.163

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.
Files changed (2) hide show
  1. package/README.md +35 -0
  2. package/package.json +5 -2
package/README.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  A React Native `Text`-compatible component with an Android text-clipping guard.
4
4
 
5
+ ## Installation
6
+
7
+ ```sh
8
+ yarn add @onekeyfe/react-native-text
9
+ ```
10
+
11
+ Rebuild the native Android application after adding the package so its native
12
+ text host is registered. This component is opt-in: importing it does not replace
13
+ React Native's global Text component.
14
+
15
+ ## Usage
16
+
5
17
  ```tsx
6
18
  import { Text } from '@onekeyfe/react-native-text';
7
19
 
@@ -15,3 +27,26 @@ adds one physical pixel to intrinsic width when constraints permit. Nested text,
15
27
  selection, ellipsizing, text-layout callbacks, press handling, accessibility,
16
28
  and refs retain React Native `Text` semantics. Other platforms export React
17
29
  Native `Text` directly.
30
+
31
+ ## API and platform behavior
32
+
33
+ The package exports `Text` as both a named and default component, together with
34
+ `TextProps`. Use ordinary text props for line limits, styles and event handlers;
35
+ there is no separate imperative layout or measurement API in this wrapper.
36
+
37
+ The Android guard only adds width when the layout constraints allow it. A fixed
38
+ width can still truncate text according to `numberOfLines` and ellipsizing;
39
+ this component does not expand a fixed container or reduce its font size.
40
+ Check clipped strings in the actual application's fonts, density and layout.
41
+
42
+ The implementation uses React Native text internals on Android. Compatibility
43
+ with a different React Native release needs validation with the consumer's
44
+ native build and text interactions. iOS and the generic implementation continue
45
+ to export React Native Text directly.
46
+
47
+ See [src/types.ts](src/types.ts) for the public props and the platform-specific
48
+ files under `src` for the wrapper implementation.
49
+
50
+ ## License
51
+
52
+ MIT.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-text",
3
- "version": "3.0.162",
3
+ "version": "3.0.163",
4
4
  "description": "Opt-in native text rendering for React Native",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/module/index.js",
@@ -42,7 +42,10 @@
42
42
  "android",
43
43
  "text"
44
44
  ],
45
- "homepage": "https://github.com/OneKeyHQ/app-modules#readme",
45
+ "bugs": {
46
+ "url": "https://github.com/OneKeyHQ/app-modules/issues"
47
+ },
48
+ "homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-views/react-native-text#readme",
46
49
  "repository": {
47
50
  "type": "git",
48
51
  "url": "git+https://github.com/OneKeyHQ/app-modules.git",