expo-paste-input 0.2.0 → 0.2.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.
- package/README.md +26 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
# expo-paste-input
|
|
2
2
|
|
|
3
|
-
`expo-paste-input` is a lightweight wrapper around React Native `TextInput` that lets users paste images and GIFs directly from the system clipboard on **iOS and Android**.
|
|
3
|
+
`expo-paste-input` is a lightweight wrapper around React Native `TextInput` that lets users paste images, stickers, and GIFs directly from the system clipboard on **iOS and Android**.
|
|
4
4
|
|
|
5
5
|
It works at the native level to intercept paste events before React Native handles them, giving you access to pasted media as local file URIs while keeping full control over your own `TextInput` component.
|
|
6
|
+
On iOS, it also uses native text-input hooks to capture keyboard stickers that are not always exposed like normal clipboard image data.
|
|
6
7
|
|
|
7
8
|
See the original demo on [Twitter](https://x.com/iamarunabh/status/1997738168247062774)
|
|
8
9
|
|
|
9
|
-
| iOS
|
|
10
|
-
|
|
|
10
|
+
| iOS | Android |
|
|
11
|
+
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
11
12
|
| <img src="https://github.com/user-attachments/assets/c7d9baac-b2f8-4942-9a7f-52932e65ae7e" /> | <img src="https://github.com/user-attachments/assets/6057745c-ccfc-4ca0-935d-9aa4668f22e3" /> |
|
|
12
13
|
|
|
13
|
-
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
- Paste **text, images, and multiple GIFs**
|
|
18
|
+
- Paste **text, images, stickers, and multiple GIFs**
|
|
19
19
|
- Works on **iOS and Android**
|
|
20
20
|
- True wrapper around `TextInput` (bring your own input)
|
|
21
21
|
- No custom UI, no opinionated styles
|
|
@@ -31,7 +31,7 @@ See the original demo on [Twitter](https://x.com/iamarunabh/status/1997738168247
|
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
npx expo install expo-paste-input
|
|
34
|
-
|
|
34
|
+
```
|
|
35
35
|
|
|
36
36
|
or
|
|
37
37
|
|
|
@@ -93,9 +93,9 @@ type PasteEventPayload =
|
|
|
93
93
|
| { type: "unsupported" };
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
- `text` → pasted text
|
|
97
|
+
- `images` → local file URIs (`file://...`)
|
|
98
|
+
- `unsupported` → anything else
|
|
99
99
|
|
|
100
100
|
---
|
|
101
101
|
|
|
@@ -113,10 +113,10 @@ Instead:
|
|
|
113
113
|
|
|
114
114
|
This means:
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
- you keep full control of your input
|
|
117
|
+
- works with any custom TextInput
|
|
118
|
+
- no prop mirroring
|
|
119
|
+
- future-proof with RN updates
|
|
120
120
|
|
|
121
121
|
---
|
|
122
122
|
|
|
@@ -124,25 +124,27 @@ This means:
|
|
|
124
124
|
|
|
125
125
|
### iOS
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
- Intercepts native `paste(_:)`
|
|
128
|
+
- Extracts images from `UIPasteboard`
|
|
129
|
+
- Saves to temp files
|
|
130
|
+
- Preserves GIFs and stickers
|
|
131
|
+
- Adds native sticker handling for iOS keyboard media using text-input hooks (including adaptive image glyph insertion), because stickers are not always exposed like normal clipboard image data
|
|
131
132
|
|
|
132
133
|
### Android
|
|
133
134
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
- Uses `OnReceiveContentListener` + `ActionMode`
|
|
136
|
+
- Prevents Android "Can't paste images" toast
|
|
137
|
+
- Saves pasted media to cache
|
|
138
|
+
- Stickers and images are handled through regular clipboard/content APIs
|
|
137
139
|
|
|
138
140
|
---
|
|
139
141
|
|
|
140
142
|
## Notes
|
|
141
143
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
- Image URIs are temporary files, move them if you need persistence.
|
|
145
|
+
- Text paste events fire after the text is inserted.
|
|
146
|
+
- Image paste events prevent default paste (since TextInput can't render images).
|
|
147
|
+
- Web is currently a no-op implementation.
|
|
146
148
|
|
|
147
149
|
---
|
|
148
150
|
|
package/package.json
CHANGED