@zean-chat/react-native 0.1.13 → 0.1.15
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 -0
- package/dist/components/Composer.d.ts +1 -1
- package/dist/components/MessageBubble.d.ts +3 -2
- package/dist/components/MessageQuote.d.ts +3 -0
- package/dist/hooks/use-pending-photos.d.ts +5 -1
- package/dist/i18n/en.d.ts +4 -0
- package/dist/i18n/fr.d.ts +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +537 -256
- package/dist/interfaces.d.ts +10 -1
- package/dist/models/conversation.utils.d.ts +6 -2
- package/dist/models/sdk.interface.d.ts +18 -2
- package/dist/models/sdk.store.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,8 @@ import { ZeanChat, useZean } from "@zean-chat/react-native";
|
|
|
22
22
|
const { open, close, toggle, unreadCount, identify, signOut, setAttributes, setPushToken } = useZean();
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
`open({ message })` opens the chat with that text in the message field: the person edits it and sends it, nothing goes before. Give the details of the screen they ask from, such as an order number.
|
|
26
|
+
|
|
25
27
|
Passing `user` signs the person in; `undefined` signs them out. `locale` (`fr`, `en`) and `colorScheme` (`light`, `dark`) default to the phone's. `maxPhotos` sets the photos per message, 1 to 6; 4 by default. The chat keeps the newest 100 messages in your app's storage: it shows them at once and downloads only new ones. To choose the storage, pass `storage`: AsyncStorage, an MMKV instance (any version) or anything with `getItem` and `setItem`. 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).
|
|
26
28
|
|
|
27
29
|
## Push notifications
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The Contact's message field: a pill with the photo button, when the app installed a picker, and a round send button
|
|
3
3
|
* in the App's colour. 16 point text; the field grows with the text up to five lines. Emoji come from the phone's keyboard.
|
|
4
|
-
* Picked photos show above the field and upload when the message is sent.
|
|
4
|
+
* Picked photos show above the field and upload when the message is sent. A message given to `open()` fills the field.
|
|
5
5
|
*/
|
|
6
6
|
export declare function Composer(): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MessageBubbleProps } from '../models/sdk.interface';
|
|
2
2
|
/**
|
|
3
3
|
* One message: the Contact's on the right in the App's colour, the team's on the left beside the sender's avatar.
|
|
4
|
-
* Messages of a run sit close, with tight corners where they meet; the run's last one carries the time.
|
|
4
|
+
* Messages of a run sit close, with tight corners where they meet; the run's last one carries the time. Drawn again
|
|
5
|
+
* only when its row changes: typing dots or a connection blip leave the other bubbles alone.
|
|
5
6
|
*/
|
|
6
|
-
export declare
|
|
7
|
+
export declare const MessageBubble: import("react").MemoExoticComponent<({ row, app, onRetry, onQuote, highlighted }: MessageBubbleProps) => import("react").JSX.Element>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { MessageQuoteProps } from '../models/sdk.interface';
|
|
2
|
+
/** The message a Member's reply answers, inside the reply's bubble. Pressed, the chat goes to it, older messages first. */
|
|
3
|
+
export declare function MessageQuote({ quote, app, onQuote }: MessageQuoteProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { ChatAttachment } from '@zean/sdk-core';
|
|
2
2
|
import type { PendingPhoto, PickedPhoto } from '../models/sdk.interface';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Photos picked for the next message: shown at once, uploaded only when the message is sent. Those in the Contact's
|
|
5
|
+
* Draft come back with it, from their file on the phone.
|
|
6
|
+
*/
|
|
4
7
|
export declare function usePendingPhotos(): {
|
|
5
8
|
photos: PendingPhoto[];
|
|
9
|
+
draftFiles: import("@zean/sdk-core").ChatDraftFile[];
|
|
6
10
|
problem: string | null;
|
|
7
11
|
/** Photos that still fit in the message. */
|
|
8
12
|
room: number;
|
package/dist/i18n/en.d.ts
CHANGED
package/dist/i18n/fr.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { ZeanChat } from './components/ZeanChat';
|
|
|
2
2
|
export { useZean } from './hooks/use-zean';
|
|
3
3
|
export { openFromNotification } from './models/sdk.store';
|
|
4
4
|
export { isZeanNotification } from './models/sdk.utils';
|
|
5
|
-
export type { ZeanAttributeValue, ZeanAttributes, ZeanChatProps, ZeanColorScheme, ZeanControls, ZeanKeyValueStorage, ZeanLocale, ZeanMMKV, ZeanStorage, ZeanUser } from './interfaces';
|
|
5
|
+
export type { ZeanAttributeValue, ZeanAttributes, ZeanChatProps, ZeanColorScheme, ZeanControls, ZeanKeyValueStorage, ZeanLocale, ZeanMMKV, ZeanOpenOptions, ZeanStorage, ZeanUser } from './interfaces';
|