@onekeyfe/react-native-text-input 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.
- package/README.md +37 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
React Native TextInput with paste events for text and images on Android and iOS.
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
yarn add @onekeyfe/react-native-text-input
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Install the application's iOS pods and rebuild the native application to register
|
|
12
|
+
the paste integration. The default export accepts React Native `TextInputProps`
|
|
13
|
+
and the additional `onPaste` callback.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
5
17
|
```tsx
|
|
6
18
|
import TextInput from '@onekeyfe/react-native-text-input';
|
|
7
19
|
|
|
@@ -12,4 +24,28 @@ import TextInput from '@onekeyfe/react-native-text-input';
|
|
|
12
24
|
/>
|
|
13
25
|
```
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
## Paste events and platform differences
|
|
28
|
+
|
|
29
|
+
`onPaste` receives `nativeEvent.items`, an optional array whose entries have
|
|
30
|
+
`type` and `data` fields. Text items use `text/plain` and carry their text in
|
|
31
|
+
`data`. The event does not supply image bytes directly.
|
|
32
|
+
|
|
33
|
+
- iOS image items contain a MIME type and a temporary local file URL. Consume
|
|
34
|
+
that file while available; the application owns any durable copy it needs.
|
|
35
|
+
- Android inspects the first clipboard item. For URI content it reports the
|
|
36
|
+
content resolver's MIME type and original URI, without copying an image into
|
|
37
|
+
a temporary file. Text paste still follows the underlying native input path.
|
|
38
|
+
- With no `onPaste` callback, the native paste subscription/watcher is disabled.
|
|
39
|
+
|
|
40
|
+
Do not assume an Android content URI is an iOS-style filesystem path. The native
|
|
41
|
+
input retains its ordinary paste fallback when there is no reportable event.
|
|
42
|
+
This package defines paste integration for iOS and Android, not a Web clipboard
|
|
43
|
+
implementation.
|
|
44
|
+
|
|
45
|
+
The public payload types are in [src/type.ts](src/type.ts). The
|
|
46
|
+
[native behavior specification](https://github.com/OneKeyHQ/app-modules/blob/main/native-views/react-native-text-input/docs/SPEC.md)
|
|
47
|
+
records event ownership, temporary-file handling and acceptance limits.
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-text-input",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.163",
|
|
4
4
|
"description": "React Native TextInput with native paste events",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -39,7 +39,10 @@
|
|
|
39
39
|
"text-input",
|
|
40
40
|
"paste"
|
|
41
41
|
],
|
|
42
|
-
"
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/OneKeyHQ/app-modules/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-views/react-native-text-input#readme",
|
|
43
46
|
"repository": {
|
|
44
47
|
"type": "git",
|
|
45
48
|
"url": "git+https://github.com/OneKeyHQ/app-modules.git",
|