@zean-chat/react-native 0.1.14 → 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.
@@ -1,6 +1,6 @@
1
- import type { ChatMessage } from '@zean/sdk-core';
1
+ import type { ChatDraftFile, ChatMessage } from '@zean/sdk-core';
2
2
  import type { Locale } from '@zean/shared/constants/app';
3
- import type { ConversationRow } from './sdk.interface';
3
+ import type { ConversationRow, PendingPhoto } from './sdk.interface';
4
4
  import type { fr } from '../i18n/fr';
5
5
  /**
6
6
  * The Conversation, oldest first, with what each message's neighbours decide about it: where runs by one sender start
@@ -13,3 +13,7 @@ export declare function conversationRows(messages: ReadonlyArray<ChatMessage>, s
13
13
  export declare function messageTime(timestamp: number, locale: Locale): string;
14
14
  /** The day above its messages: today, yesterday, the weekday within the week, then the date, with its year if not this one. */
15
15
  export declare function dayLabel(timestamp: number, now: number, locale: Locale, t: Pick<typeof fr, 'today' | 'yesterday'>): string;
16
+ /** The Draft's photos back in the composer, from their file on the phone: uploaded ones ready, the others to upload. */
17
+ export declare function pendingPhotosOfDraft(files: ReadonlyArray<ChatDraftFile>, newId: () => string): Array<PendingPhoto>;
18
+ /** What the Draft keeps of the photos: each one's own file, and its upload once done. */
19
+ export declare function draftFilesOf(photos: ReadonlyArray<PendingPhoto>): Array<ChatDraftFile>;
@@ -1,4 +1,4 @@
1
- import type { Chat, ChatApp, ChatAttachment, ChatMessage, ChatResult, ChatSender, ChatState } from '@zean/sdk-core';
1
+ import type { Chat, ChatApp, ChatAttachment, ChatMessage, ChatQuote, ChatResult, ChatSender, ChatState } from '@zean/sdk-core';
2
2
  import type { Locale } from '@zean/shared/constants/app';
3
3
  import type { AccentColors } from '@zean/shared/interfaces/widget';
4
4
  import type { ReactNode } from 'react';
@@ -121,7 +121,23 @@ export interface MessageListProps {
121
121
  export interface MessageBubbleProps {
122
122
  row: ConversationRow;
123
123
  app: ChatApp;
124
- onRetry: () => void;
124
+ /** Sends the message again, by its id. */
125
+ onRetry: (messageId: string) => void;
126
+ /** Goes to the message this reply quotes, by the reply's id: older messages are read first when needed. */
127
+ onQuote: (replyId: string) => void;
128
+ /** Just gone to from a quote: flashed for a moment. */
129
+ highlighted: boolean;
130
+ }
131
+ export interface MessageQuoteProps {
132
+ quote: ChatQuote;
133
+ app: ChatApp;
134
+ /** Goes to the quoted message: pressable unless it was deleted. */
135
+ onQuote: () => void;
136
+ }
137
+ /** What a FlatList says when the row it was asked to go to is not laid out yet. */
138
+ export interface ScrollToIndexFailure {
139
+ index: number;
140
+ averageItemLength: number;
125
141
  }
126
142
  export interface MessageMetaProps {
127
143
  row: ConversationRow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zean-chat/react-native",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "In-app support chat for React Native and Expo, iOS and Android. Pure JS, no native module. A free Intercom, Crisp and Zendesk mobile SDK alternative.",
5
5
  "keywords": [
6
6
  "react-native",