@zean-chat/react-native 0.1.1 → 0.1.4
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 +2 -2
- package/dist/components/ContactCodeCard.d.ts +6 -0
- package/dist/components/ZeanChat.d.ts +1 -1
- package/dist/i18n/en.d.ts +9 -0
- package/dist/i18n/fr.d.ts +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +494 -301
- package/dist/interfaces.d.ts +22 -10
- package/dist/models/sdk.interface.d.ts +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,13 +15,13 @@ import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
|
15
15
|
import { ZeanChat, useZean } from "@zean-chat/react-native";
|
|
16
16
|
|
|
17
17
|
// Once, at the root of the app (beside the navigator, or in app/_layout.tsx with Expo Router).
|
|
18
|
-
<ZeanChat appKey="app_your_app_key" storage={AsyncStorage}
|
|
18
|
+
<ZeanChat appKey="app_your_app_key" storage={AsyncStorage} user={user ? { id: user.id, name: user.name, email: user.email } : undefined} locale="fr" />;
|
|
19
19
|
|
|
20
20
|
// Anywhere. The chat opens in a modal over the app.
|
|
21
21
|
const { open, close, toggle, unreadCount, identify, signOut, setAttributes } = useZean();
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
`locale` (`fr`, `en`) and `colorScheme` (`light`, `dark`) default to the phone's. Full guide: [install the chat in React Native and Expo](https://zean.chat/docs/install-react-native), [React Native reference](https://zean.chat/docs/reference-react-native).
|
|
24
|
+
Passing `user` signs the person in; `undefined` signs them out. `locale` (`fr`, `en`) and `colorScheme` (`light`, `dark`) default to the phone's. Full guide: [install the chat in React Native and Expo](https://zean.chat/docs/install-react-native), [React Native reference](https://zean.chat/docs/reference-react-native).
|
|
25
25
|
|
|
26
26
|
## Why Zean
|
|
27
27
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ContactCodeCardProps } from '../models/sdk.interface';
|
|
2
|
+
/**
|
|
3
|
+
* The person's id has its Conversation on another device: a Contact code to their saved email joins this one, and
|
|
4
|
+
* their messages show here (ADR 0010). The code field takes the code the phone offers from the email.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ContactCodeCard({ code, onDismiss }: ContactCodeCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,4 @@ import type { ZeanChatProps } from '../interfaces';
|
|
|
3
3
|
* The chat. Render it once, near the root of the app, inside or outside any navigator: it opens in its own modal when
|
|
4
4
|
* `open()` from `useZean()` is called, and shows nothing until then.
|
|
5
5
|
*/
|
|
6
|
-
export declare function ZeanChat({ appKey, storage,
|
|
6
|
+
export declare function ZeanChat({ appKey, storage, user, attributes, locale, colorScheme, backendUrl }: ZeanChatProps): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -23,6 +23,15 @@ export declare const en: {
|
|
|
23
23
|
email_invalid: string;
|
|
24
24
|
email_saved: string;
|
|
25
25
|
error: string;
|
|
26
|
+
code_prompt: string;
|
|
27
|
+
code_send: string;
|
|
28
|
+
code_label: string;
|
|
29
|
+
code_submit: string;
|
|
30
|
+
code_resend: string;
|
|
31
|
+
code_invalid: string;
|
|
32
|
+
code_expired: string;
|
|
33
|
+
code_rate_limited: string;
|
|
34
|
+
code_dismiss: string;
|
|
26
35
|
attach: string;
|
|
27
36
|
uploading: string;
|
|
28
37
|
ready: string;
|
package/dist/i18n/fr.d.ts
CHANGED
|
@@ -24,6 +24,15 @@ export declare const fr: {
|
|
|
24
24
|
email_invalid: string;
|
|
25
25
|
email_saved: string;
|
|
26
26
|
error: string;
|
|
27
|
+
code_prompt: string;
|
|
28
|
+
code_send: string;
|
|
29
|
+
code_label: string;
|
|
30
|
+
code_submit: string;
|
|
31
|
+
code_resend: string;
|
|
32
|
+
code_invalid: string;
|
|
33
|
+
code_expired: string;
|
|
34
|
+
code_rate_limited: string;
|
|
35
|
+
code_dismiss: string;
|
|
27
36
|
attach: string;
|
|
28
37
|
uploading: string;
|
|
29
38
|
ready: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ZeanChat } from './components/ZeanChat';
|
|
2
2
|
export { useZean } from './hooks/use-zean';
|
|
3
|
-
export type { ZeanAttributeValue, ZeanAttributes, ZeanChatProps, ZeanColorScheme, ZeanControls, ZeanLocale, ZeanStorage,
|
|
3
|
+
export type { ZeanAttributeValue, ZeanAttributes, ZeanChatProps, ZeanColorScheme, ZeanControls, ZeanLocale, ZeanStorage, ZeanUser } from './interfaces';
|