@poolse/react-native 2.1.4 → 2.1.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/README.md +63 -15
- package/package.json +21 -19
package/README.md
CHANGED
|
@@ -1,27 +1,75 @@
|
|
|
1
1
|
# `@poolse/react-native`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Mirrors [`@poolse/react-ui`](https://www.npmjs.com/package/@poolse/react-ui)
|
|
5
|
-
for native targets: same component names, same prop shapes, same
|
|
6
|
-
feature flags — implemented against `View` / `Text` / `FlatList` /
|
|
7
|
-
`TextInput` / `Pressable` / `Image` / `Modal` / `KeyboardAvoidingView`.
|
|
3
|
+
Drop-in React Native chat SDK for Expo and bare React Native. `<ConversationView>` and `<PoolseInbox>` mount a complete chat surface with camera, attachments, markdown, typing indicators, reactions, threads, and AppState lifecycle baked in. Mirrors [`@poolse/react-ui`](https://www.npmjs.com/package/@poolse/react-ui) — same component names, same prop shapes — but implemented against native primitives (`View` / `Text` / `FlatList` / `TextInput` / `Pressable` / `Modal` / `KeyboardAvoidingView`).
|
|
8
4
|
|
|
9
|
-
Works out of the box with Expo (SDK 50+) and bare React Native
|
|
10
|
-
|
|
11
|
-
(hooks) and [`@poolse/sdk`](https://www.npmjs.com/package/@poolse/sdk)
|
|
12
|
-
(client).
|
|
5
|
+
> **MIT-licensed alternative to `sendbird-chat-react-native`, `stream-chat-react-native`, and CometChat React Native UIKit.** Works out of the box with Expo (SDK 50+) and bare React Native (≥ 0.73). JS theme tokens, no native module setup beyond standard peer deps.
|
|
6
|
+
|
|
7
|
+
Sits on top of [`@poolse/react`](https://www.npmjs.com/package/@poolse/react) (hooks) and [`@poolse/sdk`](https://www.npmjs.com/package/@poolse/sdk) (client).
|
|
13
8
|
|
|
14
9
|
## Install
|
|
15
10
|
|
|
16
11
|
```bash
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
npx expo install \
|
|
13
|
+
@poolse/sdk @poolse/react @poolse/react-native \
|
|
14
|
+
react-native-svg \
|
|
15
|
+
react-native-markdown-display \
|
|
16
|
+
react-native-safe-area-context \
|
|
17
|
+
expo-clipboard \
|
|
18
|
+
expo-image-picker \
|
|
19
|
+
expo-document-picker \
|
|
20
|
+
expo-image-manipulator
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Use `npx expo install` (not plain `npm install`) so each module is
|
|
24
|
+
pinned to a version compatible with your Expo SDK. On bare React
|
|
25
|
+
Native without the Expo CLI, swap it for `npm install` and pin
|
|
26
|
+
versions yourself.
|
|
27
|
+
|
|
28
|
+
**All peer dependencies are required.** The chat surface eagerly
|
|
29
|
+
imports each one at module-load time (Metro can't follow `try /
|
|
30
|
+
require`, so we don't try — see `2.1.1` release notes). If any peer
|
|
31
|
+
is missing the bundle blows up the first time you mount
|
|
32
|
+
`<ConversationView>` / `<PoolseInbox>` with "Requiring unknown
|
|
33
|
+
module …".
|
|
34
|
+
|
|
35
|
+
| Peer | What it powers |
|
|
36
|
+
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
37
|
+
| `react-native-svg` | All `<PoolseIcon>` glyphs (send, reply, reactions, chevrons). |
|
|
38
|
+
| `react-native-markdown-display` | Bold / italic / code / clickable links inside message bubbles. Disable with `markdown={false}` on `<ConversationView>` if you don't want it — the import still ships in the bundle. |
|
|
39
|
+
| `react-native-safe-area-context` | Composer bottom inset when the keyboard is closed, and the `keyboardVerticalOffset` math `<PoolseInbox>` does for its header. Falls back to hardcoded iOS 50/34 constants if missing — usable, but wrong on devices with non-standard insets. |
|
|
40
|
+
| `expo-clipboard` | The Copy action in the long-press message menu. |
|
|
41
|
+
| `expo-image-picker` | Camera + Photo-library entries in `<AttachmentPicker>`. |
|
|
42
|
+
| `expo-document-picker` | File entry in `<AttachmentPicker>`. |
|
|
43
|
+
| `expo-image-manipulator` | WebP resize + compress on picked photos before upload (keeps payloads under ~250 KB). |
|
|
44
|
+
|
|
45
|
+
**iOS Info.plist** (`app.json` → `ios.infoPlist`):
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"NSCameraUsageDescription": "Take photos to send in chat.",
|
|
50
|
+
"NSPhotoLibraryUsageDescription": "Pick photos to send in chat."
|
|
51
|
+
}
|
|
19
52
|
```
|
|
20
53
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
54
|
+
Pass `camera={false}` to `<AttachmentPicker>` if you want to skip
|
|
55
|
+
the camera entry (and Apple's review burden for `NSCameraUsageDescription`).
|
|
56
|
+
|
|
57
|
+
**App root** — wrap once with `<SafeAreaProvider>` and `<PoolseProvider>`:
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
61
|
+
import { PoolseProvider } from '@poolse/react';
|
|
62
|
+
|
|
63
|
+
export default function App() {
|
|
64
|
+
return (
|
|
65
|
+
<SafeAreaProvider>
|
|
66
|
+
<PoolseProvider config={{ getToken: ..., apiUrl: ... }}>
|
|
67
|
+
<YourScreens />
|
|
68
|
+
</PoolseProvider>
|
|
69
|
+
</SafeAreaProvider>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
```
|
|
25
73
|
|
|
26
74
|
## Quick start
|
|
27
75
|
|
package/package.json
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poolse/react-native",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.1.6",
|
|
4
|
+
"description": "React Native chat SDK for Expo and bare RN. Drop-in ConversationView + PoolseInbox with camera, attachments, markdown, AppState lifecycle, KeyboardAvoidingView baked in. JS theme tokens. MIT — alternative to sendbird-chat-react-native and stream-chat-react-native.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
|
-
"poolse",
|
|
8
7
|
"chat",
|
|
8
|
+
"chat-sdk",
|
|
9
9
|
"react-native",
|
|
10
|
+
"react-native-chat",
|
|
11
|
+
"react-native-messaging",
|
|
10
12
|
"expo",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
+
"expo-chat",
|
|
14
|
+
"expo-router",
|
|
15
|
+
"mobile-chat",
|
|
16
|
+
"in-app-chat",
|
|
17
|
+
"in-app-messaging",
|
|
18
|
+
"ios",
|
|
19
|
+
"android",
|
|
20
|
+
"realtime",
|
|
21
|
+
"realtime-chat",
|
|
13
22
|
"messaging",
|
|
14
|
-
"
|
|
23
|
+
"typescript",
|
|
24
|
+
"sendbird-react-native",
|
|
25
|
+
"stream-chat-react-native",
|
|
26
|
+
"poolse"
|
|
15
27
|
],
|
|
16
28
|
"homepage": "https://poolse.dev",
|
|
17
29
|
"repository": {
|
|
@@ -44,30 +56,20 @@
|
|
|
44
56
|
"CHANGELOG.md"
|
|
45
57
|
],
|
|
46
58
|
"dependencies": {
|
|
47
|
-
"@poolse/react": "2.1.
|
|
48
|
-
"@poolse/sdk": "2.1.
|
|
59
|
+
"@poolse/react": "2.1.6",
|
|
60
|
+
"@poolse/sdk": "2.1.6"
|
|
49
61
|
},
|
|
50
62
|
"peerDependencies": {
|
|
51
63
|
"react": ">=18",
|
|
52
64
|
"react-native": ">=0.73",
|
|
53
65
|
"react-native-svg": ">=14",
|
|
66
|
+
"react-native-safe-area-context": ">=4",
|
|
54
67
|
"expo-image-picker": "*",
|
|
55
68
|
"expo-document-picker": "*",
|
|
56
69
|
"expo-image-manipulator": "*",
|
|
57
70
|
"expo-clipboard": "*",
|
|
58
71
|
"react-native-markdown-display": ">=7"
|
|
59
72
|
},
|
|
60
|
-
"peerDependenciesMeta": {
|
|
61
|
-
"expo-image-picker": {
|
|
62
|
-
"optional": true
|
|
63
|
-
},
|
|
64
|
-
"expo-document-picker": {
|
|
65
|
-
"optional": true
|
|
66
|
-
},
|
|
67
|
-
"expo-image-manipulator": {
|
|
68
|
-
"optional": true
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
73
|
"devDependencies": {
|
|
72
74
|
"@types/react": "^19.0.0",
|
|
73
75
|
"expo-document-picker": "^12.0.0",
|