@poolse/react-native 3.2.0 → 3.3.0

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/dist/index.d.cts CHANGED
@@ -76,6 +76,111 @@ interface PoolseInboxHandle {
76
76
  */
77
77
  declare const PoolseInbox: react.ForwardRefExoticComponent<PoolseInboxProps & react.RefAttributes<PoolseInboxHandle>>;
78
78
 
79
+ type BubbleGroupPosition = 'first' | 'middle' | 'last' | 'standalone';
80
+ interface MessageBubbleProps {
81
+ message: Message;
82
+ /** Used to decide left/right alignment, color, and read-receipt visibility. */
83
+ currentUserId: string | null;
84
+ /** `'sent'` → single tick, `'read'` → double tick (theme.colors.brand). */
85
+ readState?: 'sent' | 'read';
86
+ /** Label resolver keyed by `external_id` — falls back to the externalId itself. */
87
+ labelFor?: (externalId: string) => string;
88
+ /** Quoted-card tap handler. Typically used to scroll the list to the original message. */
89
+ onQuotedClick?: (quotedMessageId: Uuid) => void;
90
+ /** Position in a same-sender cluster — drives tail-corner rendering. */
91
+ groupPosition?: BubbleGroupPosition;
92
+ /** Truncate at this many chars and show a "Read more" toggle. Defaults to 0 (off). */
93
+ maxBodyLength?: number;
94
+ /** Show a colored sender label above other-side bubbles. Only meaningful in group chats. */
95
+ showSenderName?: boolean;
96
+ /** Makes the sender label (see `showSenderName`) tappable. */
97
+ onSenderPress?: () => void;
98
+ /** Slot for an actions trigger — typically a chevron rendered by `<MessageRow>`. */
99
+ actionsTrigger?: ReactNode;
100
+ /**
101
+ * Long-press, forwarded into the image tiles. The tiles are
102
+ * Pressables of their own and win the gesture, so a wrapper's
103
+ * onLongPress never fires over an image-only message without this.
104
+ */
105
+ onLongPress?: () => void;
106
+ /** Render in-bubble attachments (images, file cards). Defaults to true. */
107
+ showAttachments?: boolean;
108
+ /**
109
+ * Render the body as Markdown (bold, italic, code, lists, links).
110
+ * Links open via `Linking.openURL`. Requires
111
+ * `react-native-markdown-display` to be installed in the host app;
112
+ * without it we fall back to plain text. Defaults to true.
113
+ */
114
+ markdown?: boolean;
115
+ }
116
+ /**
117
+ * One message bubble, structured as stacked sections rather than one
118
+ * padded box: media bleeds to a 3px frame, text carries its own
119
+ * padding, and the timestamp shares the last text line when measured
120
+ * room allows — which is what makes "ok" a one-line bubble instead of
121
+ * a squat rectangle.
122
+ */
123
+ declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, groupPosition, maxBodyLength, showSenderName, onSenderPress, actionsTrigger, showAttachments, markdown, onLongPress, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
124
+
125
+ /** Who sent a message — what `onSenderPress` / `onAvatarPress` receive. */
126
+ interface MessageUser {
127
+ /** poolse user id. */
128
+ userId: Uuid | null;
129
+ /** Your own user id (`external_id`) — what `userResolver` takes. */
130
+ externalId: string | null;
131
+ /** Resolved name, or the fallback shown in its place. */
132
+ displayName: string;
133
+ avatarUrl: string | null;
134
+ }
135
+ interface MessageRowProps {
136
+ msg: Message;
137
+ meId: string | null;
138
+ reactions?: boolean;
139
+ attachments?: boolean;
140
+ actions?: boolean;
141
+ /** Pass false in ThreadView since nested threads aren't a thing in v1. */
142
+ threads?: boolean;
143
+ /** WhatsApp-style quote-reply. Defaults true on ConversationView. */
144
+ quotations?: boolean;
145
+ /** Forwarded to `<MessageBubble markdown>`. Defaults true. */
146
+ markdown?: boolean;
147
+ readState?: 'sent' | 'read';
148
+ /**
149
+ * Whether this row's message is the one currently being edited.
150
+ * Editing happens in the composer (see MessageComposer's
151
+ * `editingMessage` prop); this flag is only used to elevate the
152
+ * row above the dim backdrop ConversationView renders during
153
+ * edit mode.
154
+ */
155
+ isEditing?: boolean;
156
+ /**
157
+ * Long-press → "Edit". Omitted entirely (no Edit option in the
158
+ * menu) when the parent has decided this message isn't editable
159
+ * (someone read it, it's deleted, it isn't yours).
160
+ */
161
+ onStartEdit?: () => void;
162
+ onDelete?: () => void;
163
+ onOpenThread?: () => void;
164
+ onQuote?: () => void;
165
+ labelFor?: (externalId: string) => string;
166
+ onQuotedClick?: (quotedMessageId: Uuid) => void;
167
+ groupPosition?: BubbleGroupPosition;
168
+ maxBodyLength?: number;
169
+ /** Show a colored sender label above other-side bubbles. */
170
+ showSenderName?: boolean;
171
+ /** Render an avatar to the LEFT of other-side bubbles. */
172
+ showAvatar?: boolean;
173
+ /** Avatar resolver — same signature as `<MemberList avatarFor>`. */
174
+ avatarFor?: (externalId: string) => string | null;
175
+ /** Makes the sender label tappable (other people's messages). */
176
+ onSenderPress?: (user: MessageUser) => void;
177
+ /** Makes the avatar tappable (other people's messages). */
178
+ onAvatarPress?: (user: MessageUser) => void;
179
+ /** Call-log rows: offer "Call back" (see `<CallLogRow onCallBack>`). */
180
+ onCallBack?: (media: 'audio' | 'video') => void;
181
+ }
182
+ declare function MessageRow(props: MessageRowProps): react_jsx_runtime.JSX.Element | null;
183
+
79
184
  interface ConversationViewProps {
80
185
  conversationId: Uuid;
81
186
  emptyState?: ReactElement | string;
@@ -104,6 +209,10 @@ interface ConversationViewProps {
104
209
  actions?: boolean;
105
210
  threads?: boolean;
106
211
  quotations?: boolean;
212
+ /**
213
+ * Show read ticks on your own messages. Only the ticks: the view
214
+ * marks messages read either way, so unread counts stay right.
215
+ */
107
216
  readReceipts?: boolean;
108
217
  /** Render message bodies as Markdown (links, bold, code). Defaults true. */
109
218
  markdown?: boolean;
@@ -113,22 +222,41 @@ interface ConversationViewProps {
113
222
  /** Show avatars to the left of other-side bubbles in group chats. Same semantics. */
114
223
  avatars?: 'auto' | 'always' | 'never';
115
224
  /**
116
- * Fires when auto-mark-read commits a new server-side read cursor.
117
- * Receives the conversation id + the message id that was marked
118
- * as the last-read. Wire this to `useConversations().markConversationRead(convId, msgId)`
119
- * so the sidebar / list view's unread badge clears immediately
120
- * instead of waiting for the next conversations refetch.
225
+ * Fires once the server accepts a new read position (the view marks
226
+ * the newest message read as it arrives). Receives the conversation
227
+ * id + the message id marked as last-read. Every
228
+ * `useConversations()` under the same provider has already cleared
229
+ * the conversation's badge by then.
121
230
  */
122
231
  onMarkedRead?: (conversationId: string, messageId: string) => void;
123
232
  /**
124
- * Fires after every successful message send. Wire to the parent's
125
- * `useConversations().refetch()` so the conversation list shows
126
- * the fresh `last_message_preview` / `last_message_at` for the
127
- * conversation you just sent into. `useConversations` creates
128
- * isolated state per call site, so ConversationView can't refresh
129
- * a parent hook's state on its own.
233
+ * Fires after every successful message send — e.g. to refetch
234
+ * conversations from a list that isn't `useConversations()` (which
235
+ * gets the new preview over realtime already).
130
236
  */
131
237
  onSent?: (conversationId: string) => void;
238
+ /**
239
+ * Jump to this message: older pages load until it's there, then it
240
+ * scrolls into view and is highlighted briefly. Set it again (or to
241
+ * another id) to jump again. When it can't be found — deleted, a
242
+ * thread reply, or not in this conversation — a short notice shows
243
+ * and `onFocusMessageNotFound` fires.
244
+ */
245
+ focusMessageId?: Uuid | null;
246
+ /** `focusMessageId` couldn't be found in this conversation. */
247
+ onFocusMessageNotFound?: (messageId: Uuid) => void;
248
+ /** Makes the sender label on other people's messages tappable. */
249
+ onSenderPress?: (user: MessageUser) => void;
250
+ /** Makes the avatar next to other people's messages tappable. */
251
+ onAvatarPress?: (user: MessageUser) => void;
252
+ /**
253
+ * `false` hides the composer (and with it quote-reply and the
254
+ * attachment picker) — for an archived conversation or a viewer who
255
+ * can't post. Defaults to `true`.
256
+ */
257
+ composer?: boolean;
258
+ /** Same as `composer={false}`. */
259
+ readOnly?: boolean;
132
260
  /**
133
261
  * keyboardVerticalOffset passed to the internal KeyboardAvoidingView.
134
262
  * On iOS this MUST equal the distance from the screen top to the
@@ -155,7 +283,7 @@ interface ConversationViewProps {
155
283
  */
156
284
  currentCallId?: string | null;
157
285
  }
158
- declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, avatarFor, header, onHeaderMembersPress, onHeaderPress, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, senderLabels, avatars, onMarkedRead, onSent, keyboardOffset, onCallBack, onJoinCall, currentCallId, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
286
+ declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, avatarFor, header, onHeaderMembersPress, onHeaderPress, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, senderLabels, avatars, onMarkedRead, onSent, focusMessageId, onFocusMessageNotFound, onSenderPress, onAvatarPress, composer, readOnly, keyboardOffset, onCallBack, onJoinCall, currentCallId, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
159
287
 
160
288
  interface ChatHeaderProps {
161
289
  conversationId: Uuid;
@@ -225,95 +353,6 @@ interface GroupDetailsSheetProps {
225
353
  */
226
354
  declare function GroupDetailsSheet({ visible, onClose, conversationId, labelFor, avatarFor, canRemoveMember, }: GroupDetailsSheetProps): react_jsx_runtime.JSX.Element;
227
355
 
228
- type BubbleGroupPosition = 'first' | 'middle' | 'last' | 'standalone';
229
- interface MessageBubbleProps {
230
- message: Message;
231
- /** Used to decide left/right alignment, color, and read-receipt visibility. */
232
- currentUserId: string | null;
233
- /** `'sent'` → single tick, `'read'` → double tick (theme.colors.brand). */
234
- readState?: 'sent' | 'read';
235
- /** Label resolver keyed by `external_id` — falls back to the externalId itself. */
236
- labelFor?: (externalId: string) => string;
237
- /** Quoted-card tap handler. Typically used to scroll the list to the original message. */
238
- onQuotedClick?: (quotedMessageId: Uuid) => void;
239
- /** Position in a same-sender cluster — drives tail-corner rendering. */
240
- groupPosition?: BubbleGroupPosition;
241
- /** Truncate at this many chars and show a "Read more" toggle. Defaults to 0 (off). */
242
- maxBodyLength?: number;
243
- /** Show a colored sender label above other-side bubbles. Only meaningful in group chats. */
244
- showSenderName?: boolean;
245
- /** Slot for an actions trigger — typically a chevron rendered by `<MessageRow>`. */
246
- actionsTrigger?: ReactNode;
247
- /**
248
- * Long-press, forwarded into the image tiles. The tiles are
249
- * Pressables of their own and win the gesture, so a wrapper's
250
- * onLongPress never fires over an image-only message without this.
251
- */
252
- onLongPress?: () => void;
253
- /** Render in-bubble attachments (images, file cards). Defaults to true. */
254
- showAttachments?: boolean;
255
- /**
256
- * Render the body as Markdown (bold, italic, code, lists, links).
257
- * Links open via `Linking.openURL`. Requires
258
- * `react-native-markdown-display` to be installed in the host app;
259
- * without it we fall back to plain text. Defaults to true.
260
- */
261
- markdown?: boolean;
262
- }
263
- /**
264
- * One message bubble, structured as stacked sections rather than one
265
- * padded box: media bleeds to a 3px frame, text carries its own
266
- * padding, and the timestamp shares the last text line when measured
267
- * room allows — which is what makes "ok" a one-line bubble instead of
268
- * a squat rectangle.
269
- */
270
- declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, groupPosition, maxBodyLength, showSenderName, actionsTrigger, showAttachments, markdown, onLongPress, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
271
-
272
- interface MessageRowProps {
273
- msg: Message;
274
- meId: string | null;
275
- reactions?: boolean;
276
- attachments?: boolean;
277
- actions?: boolean;
278
- /** Pass false in ThreadView since nested threads aren't a thing in v1. */
279
- threads?: boolean;
280
- /** WhatsApp-style quote-reply. Defaults true on ConversationView. */
281
- quotations?: boolean;
282
- /** Forwarded to `<MessageBubble markdown>`. Defaults true. */
283
- markdown?: boolean;
284
- readState?: 'sent' | 'read';
285
- /**
286
- * Whether this row's message is the one currently being edited.
287
- * Editing happens in the composer (see MessageComposer's
288
- * `editingMessage` prop); this flag is only used to elevate the
289
- * row above the dim backdrop ConversationView renders during
290
- * edit mode.
291
- */
292
- isEditing?: boolean;
293
- /**
294
- * Long-press → "Edit". Omitted entirely (no Edit option in the
295
- * menu) when the parent has decided this message isn't editable
296
- * (someone read it, it's deleted, it isn't yours).
297
- */
298
- onStartEdit?: () => void;
299
- onDelete?: () => void;
300
- onOpenThread?: () => void;
301
- onQuote?: () => void;
302
- labelFor?: (externalId: string) => string;
303
- onQuotedClick?: (quotedMessageId: Uuid) => void;
304
- groupPosition?: BubbleGroupPosition;
305
- maxBodyLength?: number;
306
- /** Show a colored sender label above other-side bubbles. */
307
- showSenderName?: boolean;
308
- /** Render an avatar to the LEFT of other-side bubbles. */
309
- showAvatar?: boolean;
310
- /** Avatar resolver — same signature as `<MemberList avatarFor>`. */
311
- avatarFor?: (externalId: string) => string | null;
312
- /** Call-log rows: offer "Call back" (see `<CallLogRow onCallBack>`). */
313
- onCallBack?: (media: 'audio' | 'video') => void;
314
- }
315
- declare function MessageRow(props: MessageRowProps): react_jsx_runtime.JSX.Element | null;
316
-
317
356
  interface CallLogRowProps {
318
357
  /** The call-log message. Rows that aren't call logs render nothing. */
319
358
  msg: Pick<Message, 'type' | 'body' | 'inserted_at'> & {
@@ -474,6 +513,13 @@ interface MessageListProps {
474
513
  * scrolled away from the bottom. Tapping scrolls to the latest.
475
514
  */
476
515
  meId?: string | null;
516
+ /**
517
+ * Scroll this message to the middle of the list (it must already be
518
+ * in `messages`). Changing `scrollRequest` — e.g. a counter — scrolls
519
+ * again to the same message.
520
+ */
521
+ scrollToMessageId?: string | null;
522
+ scrollRequest?: number;
477
523
  }
478
524
  /**
479
525
  * Inverted FlatList wrapper for chat history. Newest message at the
@@ -483,7 +529,7 @@ interface MessageListProps {
483
529
  * Pagination is owned by `useMessages` (hand it `messages` +
484
530
  * `hasMore` + `loadMore`); this component just renders + scrolls.
485
531
  */
486
- declare function MessageList({ messages, items, loading, hasMore, onLoadMore, renderItem, ListHeader, ListFooter, emptyState, meId, }: MessageListProps): react_jsx_runtime.JSX.Element;
532
+ declare function MessageList({ messages, items, loading, hasMore, onLoadMore, renderItem, ListHeader, ListFooter, emptyState, meId, scrollToMessageId, scrollRequest, }: MessageListProps): react_jsx_runtime.JSX.Element;
487
533
 
488
534
  interface DaySeparatorProps {
489
535
  label: string;
@@ -1312,4 +1358,4 @@ declare const callColors: {
1312
1358
  */
1313
1359
  declare function useCallDuration(connected: boolean): string | null;
1314
1360
 
1315
- export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, type AudioRoute, type AudioRouteKind, AudioRouteSheet, type AudioRouteSheetProps, Avatar, type AvatarProps, CallAvatar, type CallAvatarProps, CallControlButton, type CallControlButtonProps, CallLogRow, type CallLogRowProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, LiveCallBanner, type LiveCallBannerProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, MessageList, type MessageListItem, type MessageListProps, MessageRow, type MessageRowProps, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, type PoolseRNTheme, type PoolseRNThemeOverrides, PoolseTheme, type PoolseThemeProps, primitives as Primitives, ReactionPicker, type ReactionPickerProps, ReactionStrip, type ReactionStripProps, type ThemeColors, type ThemeRadii, type ThemeShadows, type ThemeSpacing, type ThemeType, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, callColors, defaultDarkTheme, defaultLightTheme, useAppStateLifecycle, useCallDuration, useDisplayName, usePoolseTheme };
1361
+ export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, type AudioRoute, type AudioRouteKind, AudioRouteSheet, type AudioRouteSheetProps, Avatar, type AvatarProps, CallAvatar, type CallAvatarProps, CallControlButton, type CallControlButtonProps, CallLogRow, type CallLogRowProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, LiveCallBanner, type LiveCallBannerProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, MessageList, type MessageListItem, type MessageListProps, MessageRow, type MessageRowProps, type MessageUser, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, type PoolseRNTheme, type PoolseRNThemeOverrides, PoolseTheme, type PoolseThemeProps, primitives as Primitives, ReactionPicker, type ReactionPickerProps, ReactionStrip, type ReactionStripProps, type ThemeColors, type ThemeRadii, type ThemeShadows, type ThemeSpacing, type ThemeType, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, callColors, defaultDarkTheme, defaultLightTheme, useAppStateLifecycle, useCallDuration, useDisplayName, usePoolseTheme };
package/dist/index.d.ts CHANGED
@@ -76,6 +76,111 @@ interface PoolseInboxHandle {
76
76
  */
77
77
  declare const PoolseInbox: react.ForwardRefExoticComponent<PoolseInboxProps & react.RefAttributes<PoolseInboxHandle>>;
78
78
 
79
+ type BubbleGroupPosition = 'first' | 'middle' | 'last' | 'standalone';
80
+ interface MessageBubbleProps {
81
+ message: Message;
82
+ /** Used to decide left/right alignment, color, and read-receipt visibility. */
83
+ currentUserId: string | null;
84
+ /** `'sent'` → single tick, `'read'` → double tick (theme.colors.brand). */
85
+ readState?: 'sent' | 'read';
86
+ /** Label resolver keyed by `external_id` — falls back to the externalId itself. */
87
+ labelFor?: (externalId: string) => string;
88
+ /** Quoted-card tap handler. Typically used to scroll the list to the original message. */
89
+ onQuotedClick?: (quotedMessageId: Uuid) => void;
90
+ /** Position in a same-sender cluster — drives tail-corner rendering. */
91
+ groupPosition?: BubbleGroupPosition;
92
+ /** Truncate at this many chars and show a "Read more" toggle. Defaults to 0 (off). */
93
+ maxBodyLength?: number;
94
+ /** Show a colored sender label above other-side bubbles. Only meaningful in group chats. */
95
+ showSenderName?: boolean;
96
+ /** Makes the sender label (see `showSenderName`) tappable. */
97
+ onSenderPress?: () => void;
98
+ /** Slot for an actions trigger — typically a chevron rendered by `<MessageRow>`. */
99
+ actionsTrigger?: ReactNode;
100
+ /**
101
+ * Long-press, forwarded into the image tiles. The tiles are
102
+ * Pressables of their own and win the gesture, so a wrapper's
103
+ * onLongPress never fires over an image-only message without this.
104
+ */
105
+ onLongPress?: () => void;
106
+ /** Render in-bubble attachments (images, file cards). Defaults to true. */
107
+ showAttachments?: boolean;
108
+ /**
109
+ * Render the body as Markdown (bold, italic, code, lists, links).
110
+ * Links open via `Linking.openURL`. Requires
111
+ * `react-native-markdown-display` to be installed in the host app;
112
+ * without it we fall back to plain text. Defaults to true.
113
+ */
114
+ markdown?: boolean;
115
+ }
116
+ /**
117
+ * One message bubble, structured as stacked sections rather than one
118
+ * padded box: media bleeds to a 3px frame, text carries its own
119
+ * padding, and the timestamp shares the last text line when measured
120
+ * room allows — which is what makes "ok" a one-line bubble instead of
121
+ * a squat rectangle.
122
+ */
123
+ declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, groupPosition, maxBodyLength, showSenderName, onSenderPress, actionsTrigger, showAttachments, markdown, onLongPress, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
124
+
125
+ /** Who sent a message — what `onSenderPress` / `onAvatarPress` receive. */
126
+ interface MessageUser {
127
+ /** poolse user id. */
128
+ userId: Uuid | null;
129
+ /** Your own user id (`external_id`) — what `userResolver` takes. */
130
+ externalId: string | null;
131
+ /** Resolved name, or the fallback shown in its place. */
132
+ displayName: string;
133
+ avatarUrl: string | null;
134
+ }
135
+ interface MessageRowProps {
136
+ msg: Message;
137
+ meId: string | null;
138
+ reactions?: boolean;
139
+ attachments?: boolean;
140
+ actions?: boolean;
141
+ /** Pass false in ThreadView since nested threads aren't a thing in v1. */
142
+ threads?: boolean;
143
+ /** WhatsApp-style quote-reply. Defaults true on ConversationView. */
144
+ quotations?: boolean;
145
+ /** Forwarded to `<MessageBubble markdown>`. Defaults true. */
146
+ markdown?: boolean;
147
+ readState?: 'sent' | 'read';
148
+ /**
149
+ * Whether this row's message is the one currently being edited.
150
+ * Editing happens in the composer (see MessageComposer's
151
+ * `editingMessage` prop); this flag is only used to elevate the
152
+ * row above the dim backdrop ConversationView renders during
153
+ * edit mode.
154
+ */
155
+ isEditing?: boolean;
156
+ /**
157
+ * Long-press → "Edit". Omitted entirely (no Edit option in the
158
+ * menu) when the parent has decided this message isn't editable
159
+ * (someone read it, it's deleted, it isn't yours).
160
+ */
161
+ onStartEdit?: () => void;
162
+ onDelete?: () => void;
163
+ onOpenThread?: () => void;
164
+ onQuote?: () => void;
165
+ labelFor?: (externalId: string) => string;
166
+ onQuotedClick?: (quotedMessageId: Uuid) => void;
167
+ groupPosition?: BubbleGroupPosition;
168
+ maxBodyLength?: number;
169
+ /** Show a colored sender label above other-side bubbles. */
170
+ showSenderName?: boolean;
171
+ /** Render an avatar to the LEFT of other-side bubbles. */
172
+ showAvatar?: boolean;
173
+ /** Avatar resolver — same signature as `<MemberList avatarFor>`. */
174
+ avatarFor?: (externalId: string) => string | null;
175
+ /** Makes the sender label tappable (other people's messages). */
176
+ onSenderPress?: (user: MessageUser) => void;
177
+ /** Makes the avatar tappable (other people's messages). */
178
+ onAvatarPress?: (user: MessageUser) => void;
179
+ /** Call-log rows: offer "Call back" (see `<CallLogRow onCallBack>`). */
180
+ onCallBack?: (media: 'audio' | 'video') => void;
181
+ }
182
+ declare function MessageRow(props: MessageRowProps): react_jsx_runtime.JSX.Element | null;
183
+
79
184
  interface ConversationViewProps {
80
185
  conversationId: Uuid;
81
186
  emptyState?: ReactElement | string;
@@ -104,6 +209,10 @@ interface ConversationViewProps {
104
209
  actions?: boolean;
105
210
  threads?: boolean;
106
211
  quotations?: boolean;
212
+ /**
213
+ * Show read ticks on your own messages. Only the ticks: the view
214
+ * marks messages read either way, so unread counts stay right.
215
+ */
107
216
  readReceipts?: boolean;
108
217
  /** Render message bodies as Markdown (links, bold, code). Defaults true. */
109
218
  markdown?: boolean;
@@ -113,22 +222,41 @@ interface ConversationViewProps {
113
222
  /** Show avatars to the left of other-side bubbles in group chats. Same semantics. */
114
223
  avatars?: 'auto' | 'always' | 'never';
115
224
  /**
116
- * Fires when auto-mark-read commits a new server-side read cursor.
117
- * Receives the conversation id + the message id that was marked
118
- * as the last-read. Wire this to `useConversations().markConversationRead(convId, msgId)`
119
- * so the sidebar / list view's unread badge clears immediately
120
- * instead of waiting for the next conversations refetch.
225
+ * Fires once the server accepts a new read position (the view marks
226
+ * the newest message read as it arrives). Receives the conversation
227
+ * id + the message id marked as last-read. Every
228
+ * `useConversations()` under the same provider has already cleared
229
+ * the conversation's badge by then.
121
230
  */
122
231
  onMarkedRead?: (conversationId: string, messageId: string) => void;
123
232
  /**
124
- * Fires after every successful message send. Wire to the parent's
125
- * `useConversations().refetch()` so the conversation list shows
126
- * the fresh `last_message_preview` / `last_message_at` for the
127
- * conversation you just sent into. `useConversations` creates
128
- * isolated state per call site, so ConversationView can't refresh
129
- * a parent hook's state on its own.
233
+ * Fires after every successful message send — e.g. to refetch
234
+ * conversations from a list that isn't `useConversations()` (which
235
+ * gets the new preview over realtime already).
130
236
  */
131
237
  onSent?: (conversationId: string) => void;
238
+ /**
239
+ * Jump to this message: older pages load until it's there, then it
240
+ * scrolls into view and is highlighted briefly. Set it again (or to
241
+ * another id) to jump again. When it can't be found — deleted, a
242
+ * thread reply, or not in this conversation — a short notice shows
243
+ * and `onFocusMessageNotFound` fires.
244
+ */
245
+ focusMessageId?: Uuid | null;
246
+ /** `focusMessageId` couldn't be found in this conversation. */
247
+ onFocusMessageNotFound?: (messageId: Uuid) => void;
248
+ /** Makes the sender label on other people's messages tappable. */
249
+ onSenderPress?: (user: MessageUser) => void;
250
+ /** Makes the avatar next to other people's messages tappable. */
251
+ onAvatarPress?: (user: MessageUser) => void;
252
+ /**
253
+ * `false` hides the composer (and with it quote-reply and the
254
+ * attachment picker) — for an archived conversation or a viewer who
255
+ * can't post. Defaults to `true`.
256
+ */
257
+ composer?: boolean;
258
+ /** Same as `composer={false}`. */
259
+ readOnly?: boolean;
132
260
  /**
133
261
  * keyboardVerticalOffset passed to the internal KeyboardAvoidingView.
134
262
  * On iOS this MUST equal the distance from the screen top to the
@@ -155,7 +283,7 @@ interface ConversationViewProps {
155
283
  */
156
284
  currentCallId?: string | null;
157
285
  }
158
- declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, avatarFor, header, onHeaderMembersPress, onHeaderPress, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, senderLabels, avatars, onMarkedRead, onSent, keyboardOffset, onCallBack, onJoinCall, currentCallId, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
286
+ declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, avatarFor, header, onHeaderMembersPress, onHeaderPress, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, senderLabels, avatars, onMarkedRead, onSent, focusMessageId, onFocusMessageNotFound, onSenderPress, onAvatarPress, composer, readOnly, keyboardOffset, onCallBack, onJoinCall, currentCallId, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
159
287
 
160
288
  interface ChatHeaderProps {
161
289
  conversationId: Uuid;
@@ -225,95 +353,6 @@ interface GroupDetailsSheetProps {
225
353
  */
226
354
  declare function GroupDetailsSheet({ visible, onClose, conversationId, labelFor, avatarFor, canRemoveMember, }: GroupDetailsSheetProps): react_jsx_runtime.JSX.Element;
227
355
 
228
- type BubbleGroupPosition = 'first' | 'middle' | 'last' | 'standalone';
229
- interface MessageBubbleProps {
230
- message: Message;
231
- /** Used to decide left/right alignment, color, and read-receipt visibility. */
232
- currentUserId: string | null;
233
- /** `'sent'` → single tick, `'read'` → double tick (theme.colors.brand). */
234
- readState?: 'sent' | 'read';
235
- /** Label resolver keyed by `external_id` — falls back to the externalId itself. */
236
- labelFor?: (externalId: string) => string;
237
- /** Quoted-card tap handler. Typically used to scroll the list to the original message. */
238
- onQuotedClick?: (quotedMessageId: Uuid) => void;
239
- /** Position in a same-sender cluster — drives tail-corner rendering. */
240
- groupPosition?: BubbleGroupPosition;
241
- /** Truncate at this many chars and show a "Read more" toggle. Defaults to 0 (off). */
242
- maxBodyLength?: number;
243
- /** Show a colored sender label above other-side bubbles. Only meaningful in group chats. */
244
- showSenderName?: boolean;
245
- /** Slot for an actions trigger — typically a chevron rendered by `<MessageRow>`. */
246
- actionsTrigger?: ReactNode;
247
- /**
248
- * Long-press, forwarded into the image tiles. The tiles are
249
- * Pressables of their own and win the gesture, so a wrapper's
250
- * onLongPress never fires over an image-only message without this.
251
- */
252
- onLongPress?: () => void;
253
- /** Render in-bubble attachments (images, file cards). Defaults to true. */
254
- showAttachments?: boolean;
255
- /**
256
- * Render the body as Markdown (bold, italic, code, lists, links).
257
- * Links open via `Linking.openURL`. Requires
258
- * `react-native-markdown-display` to be installed in the host app;
259
- * without it we fall back to plain text. Defaults to true.
260
- */
261
- markdown?: boolean;
262
- }
263
- /**
264
- * One message bubble, structured as stacked sections rather than one
265
- * padded box: media bleeds to a 3px frame, text carries its own
266
- * padding, and the timestamp shares the last text line when measured
267
- * room allows — which is what makes "ok" a one-line bubble instead of
268
- * a squat rectangle.
269
- */
270
- declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, groupPosition, maxBodyLength, showSenderName, actionsTrigger, showAttachments, markdown, onLongPress, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
271
-
272
- interface MessageRowProps {
273
- msg: Message;
274
- meId: string | null;
275
- reactions?: boolean;
276
- attachments?: boolean;
277
- actions?: boolean;
278
- /** Pass false in ThreadView since nested threads aren't a thing in v1. */
279
- threads?: boolean;
280
- /** WhatsApp-style quote-reply. Defaults true on ConversationView. */
281
- quotations?: boolean;
282
- /** Forwarded to `<MessageBubble markdown>`. Defaults true. */
283
- markdown?: boolean;
284
- readState?: 'sent' | 'read';
285
- /**
286
- * Whether this row's message is the one currently being edited.
287
- * Editing happens in the composer (see MessageComposer's
288
- * `editingMessage` prop); this flag is only used to elevate the
289
- * row above the dim backdrop ConversationView renders during
290
- * edit mode.
291
- */
292
- isEditing?: boolean;
293
- /**
294
- * Long-press → "Edit". Omitted entirely (no Edit option in the
295
- * menu) when the parent has decided this message isn't editable
296
- * (someone read it, it's deleted, it isn't yours).
297
- */
298
- onStartEdit?: () => void;
299
- onDelete?: () => void;
300
- onOpenThread?: () => void;
301
- onQuote?: () => void;
302
- labelFor?: (externalId: string) => string;
303
- onQuotedClick?: (quotedMessageId: Uuid) => void;
304
- groupPosition?: BubbleGroupPosition;
305
- maxBodyLength?: number;
306
- /** Show a colored sender label above other-side bubbles. */
307
- showSenderName?: boolean;
308
- /** Render an avatar to the LEFT of other-side bubbles. */
309
- showAvatar?: boolean;
310
- /** Avatar resolver — same signature as `<MemberList avatarFor>`. */
311
- avatarFor?: (externalId: string) => string | null;
312
- /** Call-log rows: offer "Call back" (see `<CallLogRow onCallBack>`). */
313
- onCallBack?: (media: 'audio' | 'video') => void;
314
- }
315
- declare function MessageRow(props: MessageRowProps): react_jsx_runtime.JSX.Element | null;
316
-
317
356
  interface CallLogRowProps {
318
357
  /** The call-log message. Rows that aren't call logs render nothing. */
319
358
  msg: Pick<Message, 'type' | 'body' | 'inserted_at'> & {
@@ -474,6 +513,13 @@ interface MessageListProps {
474
513
  * scrolled away from the bottom. Tapping scrolls to the latest.
475
514
  */
476
515
  meId?: string | null;
516
+ /**
517
+ * Scroll this message to the middle of the list (it must already be
518
+ * in `messages`). Changing `scrollRequest` — e.g. a counter — scrolls
519
+ * again to the same message.
520
+ */
521
+ scrollToMessageId?: string | null;
522
+ scrollRequest?: number;
477
523
  }
478
524
  /**
479
525
  * Inverted FlatList wrapper for chat history. Newest message at the
@@ -483,7 +529,7 @@ interface MessageListProps {
483
529
  * Pagination is owned by `useMessages` (hand it `messages` +
484
530
  * `hasMore` + `loadMore`); this component just renders + scrolls.
485
531
  */
486
- declare function MessageList({ messages, items, loading, hasMore, onLoadMore, renderItem, ListHeader, ListFooter, emptyState, meId, }: MessageListProps): react_jsx_runtime.JSX.Element;
532
+ declare function MessageList({ messages, items, loading, hasMore, onLoadMore, renderItem, ListHeader, ListFooter, emptyState, meId, scrollToMessageId, scrollRequest, }: MessageListProps): react_jsx_runtime.JSX.Element;
487
533
 
488
534
  interface DaySeparatorProps {
489
535
  label: string;
@@ -1312,4 +1358,4 @@ declare const callColors: {
1312
1358
  */
1313
1359
  declare function useCallDuration(connected: boolean): string | null;
1314
1360
 
1315
- export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, type AudioRoute, type AudioRouteKind, AudioRouteSheet, type AudioRouteSheetProps, Avatar, type AvatarProps, CallAvatar, type CallAvatarProps, CallControlButton, type CallControlButtonProps, CallLogRow, type CallLogRowProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, LiveCallBanner, type LiveCallBannerProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, MessageList, type MessageListItem, type MessageListProps, MessageRow, type MessageRowProps, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, type PoolseRNTheme, type PoolseRNThemeOverrides, PoolseTheme, type PoolseThemeProps, primitives as Primitives, ReactionPicker, type ReactionPickerProps, ReactionStrip, type ReactionStripProps, type ThemeColors, type ThemeRadii, type ThemeShadows, type ThemeSpacing, type ThemeType, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, callColors, defaultDarkTheme, defaultLightTheme, useAppStateLifecycle, useCallDuration, useDisplayName, usePoolseTheme };
1361
+ export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, type AudioRoute, type AudioRouteKind, AudioRouteSheet, type AudioRouteSheetProps, Avatar, type AvatarProps, CallAvatar, type CallAvatarProps, CallControlButton, type CallControlButtonProps, CallLogRow, type CallLogRowProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, LiveCallBanner, type LiveCallBannerProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, MessageList, type MessageListItem, type MessageListProps, MessageRow, type MessageRowProps, type MessageUser, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, type PoolseRNTheme, type PoolseRNThemeOverrides, PoolseTheme, type PoolseThemeProps, primitives as Primitives, ReactionPicker, type ReactionPickerProps, ReactionStrip, type ReactionStripProps, type ThemeColors, type ThemeRadii, type ThemeShadows, type ThemeSpacing, type ThemeType, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, callColors, defaultDarkTheme, defaultLightTheme, useAppStateLifecycle, useCallDuration, useDisplayName, usePoolseTheme };