@robono/messaging-react-native 0.21.0 → 0.22.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.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { DeliveryBar } from './delivery-bar.js';
3
+ import { bubbleCorners, bubbleDelivery } from './bubble-design.js';
2
4
  import { compareMessageOrder, isMessageIdentity } from '@robono/messaging';
3
5
  import { messagingScreenAppearance } from '@robono/messaging';
4
6
  import { messagingHeaderOrder } from '@robono/messaging';
@@ -30,7 +32,7 @@ import { AttachmentMenu } from './attachment-menu.js';
30
32
  import { QuickSendButton } from './quick-send.js';
31
33
  import { MessageExtra, MessagingPrivacyLayer, privacyReadingStripHeight, openChatAddress, ExtraPopup } from './extras.js';
32
34
  export { MessagingPrivacyLayer } from './extras.js';
33
- import { orderChatMessages, continuesAttachmentSend } from './message-order.js';
35
+ import { orderChatMessages } from './message-order.js';
34
36
  import { MessagingPopup, MessagingPopupHost, MessagingPopupHeaderBoundary, useMessagingPopupColors } from './popup.js';
35
37
  import { messageLinks } from './message-links.js';
36
38
  import { MessagingForward } from './forward.js';
@@ -371,16 +373,11 @@ function MediaContent({ message, ink, footer, onOpen, onLongPress }) {
371
373
  return Voice ? _jsx(Voice, { mine: message.senderId === userId, heard: heard, onPlayed: onPlayed, background: message.senderId === userId ? design.colors.outgoing : design.colors.incoming, message: message, ink: ink, accent: design.colors.accent, waveform: preview.waveform ?? message.media?.waveform, showWaveform: design.showWaveform !== false, footer: footer, onOpen: onOpen, onLongPress: onLongPress }) : _jsx(VoicePlayback, { mine: message.senderId === userId, heard: heard, onPlayed: onPlayed, background: message.senderId === userId ? design.colors.outgoing : design.colors.incoming, ink: ink, accent: design.colors.accent, waveform: preview.waveform ?? message.media?.waveform, showWaveform: design.showWaveform !== false, durationMs: message.media?.durationMs, footer: footer, onToggle: onOpen, onLongPress: onLongPress });
372
374
  }
373
375
  if (message.kind === 'image' || message.kind === 'video')
374
- return _jsx(View, { style: { width: 220, maxWidth: '100%', gap: 0 }, children: _jsxs(View, { style: { height: 155, borderRadius: 10, overflow: 'hidden', alignItems: 'center', justifyContent: 'center', backgroundColor: '#00000012' }, children: [preview.uri ? _jsx(Image, { source: { uri: preview.uri }, accessibilityLabel: message.media?.fileName ?? uiText(mediaNames[message.kind]), resizeMode: "cover", onError: onImageError, style: { width: '100%', height: '100%' } }) : _jsx(MessageIcon, { name: message.kind, color: ink, size: 36 }), failed && !preview.uri && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText('Retry preview'), onPress: event => { event.stopPropagation(); retry(); }, style: { position: 'absolute', bottom: 6, right: 6, minHeight: 44, paddingHorizontal: 12, justifyContent: 'center', backgroundColor: design.colors.incoming, borderRadius: 18 }, children: _jsx(Text, { style: { color: design.colors.accent }, children: uiText('Retry preview') }) }), message.kind === 'video' && _jsxs(_Fragment, { children: [_jsx(View, { style: { position: 'absolute', borderRadius: 24, padding: 10, backgroundColor: '#00000099' }, children: _jsx(MessageIcon, { name: "play", color: "#ffffff" }) }), _jsx(Text, { style: { position: 'absolute', left: 8, bottom: 8, color: '#ffffff', backgroundColor: '#000000aa', borderRadius: 4, paddingHorizontal: 5, fontSize: 12 }, children: duration(message.media?.durationMs) })] })] }) });
375
- return _jsxs(View, { testID: "file-message-content", style: { flexDirection: 'row', alignItems: 'center', gap: 10, width: 220, maxWidth: '100%', minHeight: 56, paddingHorizontal: 12, paddingVertical: 6, borderRadius: 10 }, children: [_jsx(MessageIcon, { name: "document", color: design.colors.accent, size: 24 }), _jsxs(View, { style: { flex: 1, gap: 2 }, children: [_jsx(Text, { numberOfLines: 2, style: { color: ink, fontSize: 14, fontWeight: '600' }, children: message.media?.fileName ?? uiText("File") }), _jsxs(Text, { style: { color: ink, fontSize: 12, opacity: 0.75 }, children: [message.media?.fileName?.split('.').pop()?.toUpperCase(), " \u00B7 ", fileSize(message.media?.byteSize)] })] })] });
376
+ return _jsx(View, { style: { width: 220, maxWidth: '100%', gap: 0 }, children: _jsxs(View, { testID: "media-bubble-surface", style: { height: 155, ...bubbleCorners(design, message.senderId === userId, !!message.text), overflow: 'hidden', alignItems: 'center', justifyContent: 'center', backgroundColor: '#00000012' }, children: [preview.uri ? _jsx(Image, { source: { uri: preview.uri }, accessibilityLabel: message.media?.fileName ?? uiText(mediaNames[message.kind]), resizeMode: "cover", onError: onImageError, style: { width: '100%', height: '100%' } }) : _jsx(MessageIcon, { name: message.kind, color: ink, size: 36 }), failed && !preview.uri && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText('Retry preview'), onPress: event => { event.stopPropagation(); retry(); }, style: { position: 'absolute', bottom: 6, right: 6, minHeight: 44, paddingHorizontal: 12, justifyContent: 'center', backgroundColor: design.colors.incoming, borderRadius: 18 }, children: _jsx(Text, { style: { color: design.colors.accent }, children: uiText('Retry preview') }) }), message.kind === 'video' && _jsxs(_Fragment, { children: [_jsx(View, { style: { position: 'absolute', borderRadius: 24, padding: 10, backgroundColor: '#00000099' }, children: _jsx(MessageIcon, { name: "play", color: "#ffffff" }) }), _jsx(Text, { style: { position: 'absolute', left: 8, bottom: 8, color: '#ffffff', backgroundColor: '#000000aa', borderRadius: 4, paddingHorizontal: 5, fontSize: 12 }, children: duration(message.media?.durationMs) })] })] }) });
377
+ return _jsxs(View, { testID: "file-message-content", style: { flexDirection: 'row', alignItems: 'center', gap: 10, width: 220, maxWidth: '100%', minHeight: 56, paddingHorizontal: 12, paddingVertical: 6, ...bubbleCorners(design, message.senderId === userId), ...(message.senderId === userId && design.messageStatus?.style === 'circle' ? { paddingRight: 28 } : {}) }, children: [_jsx(MessageIcon, { name: "document", color: design.colors.accent, size: 24 }), _jsxs(View, { style: { flex: 1, gap: 2 }, children: [_jsx(Text, { numberOfLines: 2, style: { color: ink, fontSize: 14, fontWeight: '600' }, children: message.media?.fileName ?? uiText("File") }), _jsxs(Text, { style: { color: ink, fontSize: 12, opacity: 0.75 }, children: [message.media?.fileName?.split('.').pop()?.toUpperCase(), " \u00B7 ", fileSize(message.media?.byteSize)] })] })] });
376
378
  }
377
379
  function messageTimeLabel(message, format, text) { return (message.editedAt && !message.deleted ? text('edited') + ' · ' : '') + format(message.createdAt); }
378
- function MessageMetadata({ mine, ink, pendingStatus }) {
379
- const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
380
- if (!mine || !pendingStatus)
381
- return null;
382
- return _jsx(View, { accessibilityLabel: pendingStatus === 'queued' ? uiText("Waiting for connection") : pendingStatus === 'sending' ? uiText("Sending message") : uiText("Message not sent"), style: { alignSelf: 'flex-end' }, children: _jsx(MessageIcon, { name: pendingStatus === 'failed' ? 'warning' : 'clock', color: pendingStatus === 'failed' ? '#c94040' : ink, size: 15 }) });
383
- }
380
+ function MessageMetadata(_props) { return null; }
384
381
  /** Keep the heavy row independent of unrelated draft, connection and message updates.
385
382
  * Every permission, appearance, host callback and referenced message is selected
386
383
  * afresh; no access decision or host callback is cached across a change. */
@@ -410,9 +407,9 @@ export function MessagingBubble(props) {
410
407
  const context = useMessagingUI(), last = useRef(null);
411
408
  const selected = selectBubbleUI(context, props, last.current);
412
409
  last.current = selected;
413
- return _jsx(MessagingBubbleView, { message: props.message, pendingStatus: props.pendingStatus, joinsBefore: continuesAttachmentSend(props.previousMessage, props.message), joinsAfter: continuesAttachmentSend(props.message, props.nextMessage), ui: selected });
410
+ return _jsx(MessagingBubbleView, { message: props.message, pendingStatus: props.pendingStatus, ui: selected });
414
411
  }
415
- const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, pendingStatus, joinsBefore, joinsAfter, ui }) {
412
+ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, pendingStatus, ui }) {
416
413
  const messagingPopupColors = useMessagingPopupColors(undefined, 'alerts');
417
414
  const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
418
415
  const { userId, design, state, client, participants, openDiscussion, discussionPreview, discussionRoot, setReply, setEditing, setForwarding, setDeleting, selectionActive, setSelection, saved, saving, toggleSaved, onMessageOptions, openAttachment, language, contact, copyText, components, extras, onCallHistory, linkHandling, languageTools } = ui;
@@ -424,7 +421,9 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
424
421
  const socialReady = linkHandling?.webLinks !== false && !linkHandling?.openUrl && !message.custom && !extra?.address && !pendingStatus && !message.deleted && message.kind === 'text' && state.settings?.enabled && state.socialPreviewAvailable && components?.SocialPlayer && messageLinks(message.text ?? '').some(link => !!link.url && !!socialShare(link.url, socialOrigin));
425
422
  const contextContactName = contact.name;
426
423
  const mine = message.senderId === userId, c = design.colors, ink = message.kind === 'poll' ? c.foreground : mine ? c.outgoingText : c.incomingText;
427
- const bubbleRadius = design.presentation?.bubbleShape === 'square' ? 2 : design.presentation?.bubbleShape === 'rounded' ? 16 : 8;
424
+ const corners = bubbleCorners(design, mine), bubbleRadius = corners.borderTopRightRadius;
425
+ const status = bubbleDelivery(message, deliveryStatus, !!state.settings?.features.readReceipts, design);
426
+ const circleStatus = mine && status.style === 'circle';
428
427
  const messageGap = design.presentation?.messageSpacing === 'compact' ? 4 : design.presentation?.messageSpacing === 'relaxed' ? 12 : 8;
429
428
  const visual = message.kind === 'image' || message.kind === 'video', voice = message.kind === 'voice';
430
429
  const grouped = ui.grouped;
@@ -526,17 +525,16 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
526
525
  const content = showingTransform ? _jsxs(View, { children: [_jsx(Text, { style: { color: ink, fontSize: 11, opacity: .65, marginBottom: 2 }, children: transformed.kind === 'transcript' ? uiText("Transcript") : 'Translated · ' + supportedLanguageLabel(translationLanguage) }), transformed.audio && TranslationVoice ? _jsx(View, { testID: "message-translated-voice", children: _jsx(TranslationVoice, { transform: transformed, ink: ink, accent: c.accent, showWaveform: design.showWaveform !== false, autoPlay: translationAutoPlay }) }) : _jsx(Text, { testID: "message-language-result", selectable: true, style: { color: ink, fontSize: 16, lineHeight: 22, textAlign: mine ? 'right' : 'left' }, children: transformed.text }), !voice && footer] }) : originalContent;
527
526
  const regionProps = { message, mine, appearance: design, pendingStatus };
528
527
  const bodyContent = components?.MessageBody && !message.deleted ? _jsx(components.MessageBody, { ...regionProps, children: content }) : content;
529
- const statusTopRadius = voice && !showingTransform ? 24 : bubbleRadius, statusBottomRadius = voice && !message.text && !showingTransform ? 24 : bubbleRadius;
530
- // Trim the arc ends without moving the indicator away from the bubble's contour.
531
- const statusTopTrim = statusTopRadius / 2, statusBottomTrim = statusBottomRadius / 2;
532
- const bubbleBody = _jsxs(_Fragment, { children: [!bigEmoji && (!mine || !deliveryStatus) && _jsx(View, { testID: mine ? (message.readAt && state.settings?.features.readReceipts ? 'message-status-read' : 'message-status-sent') : 'message-status-incoming', pointerEvents: "none", accessible: false, style: { position: 'absolute', top: joinsBefore ? -(messageGap + 2) / 2 : statusTopTrim, bottom: joinsAfter ? -(messageGap + 2) / 2 : statusBottomTrim, start: 0, end: 0, zIndex: 40, overflow: 'hidden' }, children: _jsx(View, { style: { position: 'absolute', top: joinsBefore ? 0 : -statusTopTrim, bottom: joinsAfter ? 0 : -statusBottomTrim, start: 0, end: 0, ...(mine ? { borderEndWidth: 2, borderEndColor: message.readAt && state.settings?.features.readReceipts ? c.accent : c.foreground, borderTopEndRadius: joinsBefore ? 0 : statusTopRadius, borderBottomEndRadius: joinsAfter ? 0 : statusBottomRadius } : { borderStartWidth: 2, borderStartColor: '#2B2B2B', borderTopStartRadius: joinsBefore ? 0 : statusTopRadius, borderBottomStartRadius: joinsAfter ? 0 : statusBottomRadius }) } }) }), message.replyTo && message.replyTo !== discussionRoot && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Go to quoted message"), onLongPress: menu, onPress: () => { void client.focusMessage(message.replyTo).catch(e => setError(e instanceof Error ? e.message : uiText("This message is unavailable."))); }, style: { alignSelf: 'flex-start', maxWidth: 220, minHeight: 44, borderRadius: 10, backgroundColor: chatSurface(c.background) === '#ffffff' ? '#f3f3f3' : '#242424', borderWidth: StyleSheet.hairlineWidth, borderColor: c.secondary + '55', paddingHorizontal: 8, paddingTop: 6, paddingBottom: 7, marginBottom: 4, overflow: 'hidden' }, children: _jsx(QuotedPreview, { message: ui.quoted, ink: c.foreground }) }), !mine && !grouped && state.conversation?.kind === 'group' && _jsx(Text, { style: { color: ink, fontSize: 12, fontWeight: '600', marginBottom: 5 }, children: message.deleted ? uiText("Former member") : participants?.[message.senderId]?.name ?? uiText("Member") }), message.custom || extra?.address || extra?.weather || extra?.call || voice || message.kind === 'poll' ? bodyContent : _jsx(Pressable, { accessibilityRole: message.kind === 'text' ? undefined : 'button', accessibilityLabel: message.kind === 'text' ? undefined : uiText('{kind}: {name}', { kind: uiText(mediaNames[message.kind]), name: message.media?.fileName ?? uiText('Open attachment') }), disabled: busy, onLongPress: menu, onPress: message.kind === 'text' ? () => { if (quoteGesture.suppressPress())
528
+ const statusTopRadius = voice && !showingTransform ? 24 : design.presentation?.bubbleStyle === 'top-tail' && !visual ? 0 : bubbleRadius, statusBottomRadius = voice && !message.text && !showingTransform ? 24 : corners.borderBottomRightRadius;
529
+ // Cover the full inside edge; each curved end tapers to the bubble's corner.
530
+ const bubbleBody = _jsxs(_Fragment, { children: [mine && _jsx(View, { testID: 'message-status-' + status.phase, pointerEvents: "none", accessibilityLabel: uiText(status.phase === 'failed' ? 'Message not sent' : status.phase === 'sent' ? 'Sending message' : status.phase === 'consumed' ? (voice ? 'Heard' : message.kind === 'video' ? 'Watched' : 'Seen') : 'Delivered'), style: circleStatus ? { position: 'absolute', bottom: 5, end: 5, zIndex: 40, width: 17, height: 17, borderRadius: 9, borderWidth: 1.5, borderColor: status.color, backgroundColor: status.phase === 'consumed' ? status.color : '#00000055', alignItems: 'center', justifyContent: 'center' } : { position: 'absolute', top: 0, bottom: 0, end: 0, width: Math.max(statusTopRadius, statusBottomRadius) + 2, zIndex: 40, overflow: 'hidden' }, children: circleStatus ? (status.phase !== 'sent' && _jsx(MessageIcon, { name: status.phase === 'failed' ? 'warning' : 'check', color: status.phase === 'consumed' ? (parseInt(status.color.slice(1, 3), 16) * .299 + parseInt(status.color.slice(3, 5), 16) * .587 + parseInt(status.color.slice(5, 7), 16) * .114 > 150 ? '#111111' : '#ffffff') : status.color, size: 12 })) : _jsx(DeliveryBar, { color: status.color, topRadius: statusTopRadius, bottomRadius: statusBottomRadius }) }), message.replyTo && message.replyTo !== discussionRoot && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Go to quoted message"), onLongPress: menu, onPress: () => { void client.focusMessage(message.replyTo).catch(e => setError(e instanceof Error ? e.message : uiText("This message is unavailable."))); }, style: { alignSelf: 'flex-start', maxWidth: 220, minHeight: 44, borderRadius: 10, backgroundColor: chatSurface(c.background) === '#ffffff' ? '#f3f3f3' : '#242424', borderWidth: StyleSheet.hairlineWidth, borderColor: c.secondary + '55', paddingHorizontal: 8, paddingTop: 6, paddingBottom: 7, marginBottom: 4, overflow: 'hidden' }, children: _jsx(QuotedPreview, { message: ui.quoted, ink: c.foreground }) }), !mine && !grouped && state.conversation?.kind === 'group' && _jsx(Text, { style: { color: ink, fontSize: 12, fontWeight: '600', marginBottom: 5 }, children: message.deleted ? uiText("Former member") : participants?.[message.senderId]?.name ?? uiText("Member") }), message.custom || extra?.address || extra?.weather || extra?.call || voice || message.kind === 'poll' ? bodyContent : _jsx(Pressable, { accessibilityRole: message.kind === 'text' ? undefined : 'button', accessibilityLabel: message.kind === 'text' ? undefined : uiText('{kind}: {name}', { kind: uiText(mediaNames[message.kind]), name: message.media?.fileName ?? uiText('Open attachment') }), disabled: busy, onLongPress: menu, onPress: message.kind === 'text' ? () => { if (quoteGesture.suppressPress())
533
531
  return; if (extra?.address)
534
532
  extraRef.current?.open();
535
533
  else
536
- socialRef.current?.open(); } : () => void open(), children: bodyContent }), !discussionPreview && state.discussionAvailable && !!message.replyCount && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: message.replyCount + ' ' + (message.replyCount === 1 ? 'reply' : 'replies'), onPress: () => openDiscussion(message.id), style: { minHeight: 32, justifyContent: 'center' }, children: _jsxs(Text, { style: { color: c.accent, fontSize: 12, fontWeight: '600' }, children: [message.replyCount, " ", message.replyCount === 1 ? uiText("reply") : uiText("replies")] }) }), message.kind !== 'text' && !!message.text && _jsx(View, { testID: voice ? 'voice-message-caption' : undefined, style: voice && !showingTransform ? { maxWidth: 220, alignSelf: mine ? 'flex-end' : 'flex-start', marginTop: 1, paddingTop: 4, paddingBottom: 1, borderRadius: 14, ...(mine ? { borderBottomEndRadius: 3 } : { borderBottomStartRadius: 3 }), backgroundColor: mine ? c.outgoing : c.incoming } : undefined, children: _jsx(Text, { testID: "attachment-caption", selectable: true, onLongPress: menu, style: { color: ink, fontSize: 16, lineHeight: 22, marginTop: voice ? 0 : 2, textAlign: mine ? 'right' : 'left', alignSelf: 'stretch', paddingHorizontal: voice || message.kind === 'document' ? 8 : 2, paddingBottom: 2 }, children: renderText(message.text) }) }), deliveryStatus && message.kind !== 'text' && message.kind !== 'poll' && !voice && !visual && _jsx(View, { style: { marginTop: 4, alignSelf: 'flex-end' }, children: footer }), (!voice || showingTransform) && languageActions, components?.MessageFooter && !message.deleted && _jsx(components.MessageFooter, { ...regionProps }), transforming && !voice && _jsx(Text, { accessibilityLiveRegion: "polite", style: { color: ink, fontSize: 11 }, children: uiText("Converting…") }), !!error && _jsxs(MessagingPopup, { screen: "alerts", compact: true, contentWidth: 640, title: uiText("Message"), foreground: c.foreground, background: chatSurface(c.background), onClose: () => setError(''), children: [_jsx(Text, { accessibilityRole: "alert", style: { color: messagingPopupColors.foreground, fontSize: 15, lineHeight: 21, marginTop: 8 }, children: error }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Close message alert"), onPress: () => setError(''), style: { alignSelf: 'flex-end', minHeight: 44, justifyContent: 'center', paddingHorizontal: 8, marginTop: 8 }, children: _jsx(Text, { style: { color: c.accent }, children: uiText("OK") }) })] }), deliveryStatus === 'failed' && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Retry sending message"), onPress: () => void client.retry(message.clientMessageId).catch(() => { }), style: { minHeight: 32, justifyContent: 'center', alignSelf: 'flex-end' }, children: _jsx(Text, { style: { color: c.accent, fontSize: 12 }, children: design.labels.retry }) }), Platform.OS === 'web' && !mine && canInteract && state.settings?.features.reactions && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("React to message"), onFocus: () => setHovered(true), onBlur: () => setHovered(false), onPress: openMenu, style: { opacity: hovered || actions ? 1 : 0, position: 'absolute', top: 6, ...(mine ? { left: -34 } : { right: -34 }), width: 32, height: 32, alignItems: 'center', justifyContent: 'center' }, children: _jsx(MessageIcon, { name: "reaction", color: c.secondary, size: 20 }) }), !!message.reactions?.length && _jsx(View, { testID: "message-reaction-badge", pointerEvents: "none", accessibilityLabel: message.reactions.slice(-3).map(r => r.emoji).join(' '), style: { position: 'absolute', zIndex: 41, top: -16, ...(mine ? { end: -9 } : { start: -9 }), minWidth: 30, height: 20, alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { fontSize: 16, lineHeight: 20 }, children: message.reactions.slice(-3).map(r => r.emoji).join(' ') }) }), _jsx(MessageMenu, { visible: actions, position: menuPosition, screenHeight: viewport.height, mine: mine, reactions: reactionPicker, onClose: () => setActions(false), onDismiss: menuDismissed, children: actions && _jsxs(_Fragment, { children: [quoting && _jsx(MessageMenuRow, { icon: "quote", label: uiText("Quote message"), onPress: () => { setActions(false); setReply(message); } }), !discussionPreview && state.discussionAvailable && !pendingStatus && !message.deleted && _jsx(MessageMenuRow, { icon: "quote", label: uiText("Replies"), onPress: () => leaveMenu(() => openDiscussion(message.threadRoot ?? message.id)) }), state.discussionAvailable && canInteract && state.conversation?.ownerId === userId && _jsx(MessageMenuRow, { icon: "bookmark", label: message.pinned ? uiText("Unpin for group") : uiText("Pin for group"), onPress: () => { setActions(false); void client.pinMessage(message.id, !message.pinned).catch(e => setError(e instanceof Error ? e.message : uiText("The pin could not change."))); } }), canCopy && _jsx(MessageMenuRow, { icon: "copy", label: uiText("Copy"), onPress: () => { setActions(false); void (copyText ? copyText(message.text) : navigator.clipboard.writeText(message.text)).catch(() => setError(uiText("The text could not be copied."))); } }), canInteract && client.canForward(message) && _jsx(MessageMenuRow, { icon: "redo", label: uiText("Forward"), onPress: () => leaveMenu(() => setForwarding([message])) }), !pendingStatus && !message.deleted && message.kind !== 'poll' && client.hasSavedMessages() && _jsx(MessageMenuRow, { icon: "bookmark", label: saved.some(r => r.key === savedMessageKey(message)) ? uiText("Remove from Saved") : uiText("Save"), disabled: saving, onPress: () => { setActions(false); void toggleSaved(message); } }), canChange && !message.custom && message.kind !== 'poll' && state.settings?.features[message.kind] && _jsx(MessageMenuRow, { icon: "edit", label: uiText("Edit"), onPress: () => { setActions(false); setEditing(message); } }), !mine && state.conversation?.safety?.canReport && _jsx(MessageMenuRow, { icon: "flag", label: uiText("Report"), danger: true, onPress: () => leaveMenu(() => setReportOpen(true)) }), !pendingStatus && !message.deleted && ['owner', 'moderator'].includes(state.conversation?.roomRole ?? '') && _jsx(MessageMenuRow, { icon: "trash", label: uiText('Remove from group'), danger: true, onPress: () => leaveMenu(() => setRoomRemoval(true)) }), canChange && _jsx(MessageMenuRow, { icon: "trash", label: uiText("Delete"), danger: true, onPress: () => leaveMenu(() => setDeleting([message])) }), (pendingStatus === 'failed' || pendingStatus === 'queued') && _jsx(MessageMenuRow, { icon: "trash", label: uiText("Remove unsent message"), danger: true, onPress: () => { setActions(false); void client.discardPending(message.clientMessageId).catch(() => setError(uiText("The unsent message could not be removed."))); } }), !pendingStatus && onMessageOptions && _jsx(MessageMenuRow, { icon: "more", label: uiText("More options"), onPress: () => leaveMenu(() => onMessageOptions(message)) }), !pendingStatus && !message.deleted && _jsx(MessageMenuRow, { icon: "check", label: uiText("Select Multiple"), divider: true, onPress: () => { setActions(false); setSelection([message]); Keyboard.dismiss(); } })] }) }), roomRemoval && _jsx(MessagingRoomRemoval, { client: client, message: message, accent: c.accent, onClose: () => setRoomRemoval(false) }), reportOpen && _jsx(MessagingSafety, { client: client, state: state, appearance: design, name: participants?.[message.senderId]?.name ?? 'Contact', messageId: message.id, onClose: () => setReportOpen(false) })] });
537
- return _jsxs(View, { ...(Platform.OS === 'web' ? { onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), onContextMenu: (event) => { event.preventDefault(); menu(); } } : {}), style: { width: '100%', position: 'relative', marginTop: messageGap + (message.reactions?.length ? 16 : 0), marginBottom: 0 }, children: [quoteGesture.infoLoaded && _jsxs(Animated.View, { pointerEvents: "none", testID: "message-info-reveal", accessible: false, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: { ...quoteGesture.revealWebStyle, position: 'absolute', top: '50%', marginTop: -26, minHeight: 52, width: messageInfoRevealWidth, justifyContent: 'center', ...(mine ? { start: 0, alignItems: 'flex-start' } : { end: 0, alignItems: 'flex-end' }), opacity: quoteGesture.infoOpacity }, children: [_jsxs(View, { style: { flexDirection: 'row', alignItems: 'baseline', gap: 4 }, children: [_jsx(Text, { style: { color: c.secondary, fontSize: 8, lineHeight: 11, fontWeight: '900' }, children: uiText("SENT:") }), _jsx(Text, { style: { color: c.foreground, fontSize: 10, lineHeight: 12, fontWeight: '800' }, children: messageTimeLabel(message, ui.formatMessageTime, uiText) })] }), mine && state.settings?.features.readReceipts && _jsxs(View, { style: { flexDirection: 'row', alignItems: 'baseline', gap: 4 }, children: [_jsx(Text, { style: { color: c.secondary, fontSize: 8, lineHeight: 11, fontWeight: '900' }, children: uiText("READ:") }), _jsx(Text, { style: { color: message.readAt ? c.foreground : c.secondary, fontSize: 10, lineHeight: 12, fontWeight: '800' }, children: message.readAt ? ui.formatMessageTime(message.readAt) : uiText("Not yet") })] })] }), quoting && _jsxs(Animated.View, { pointerEvents: "none", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' }), testID: `quote-reveal-${mine ? 'outgoing' : 'incoming'}`, style: { ...quoteGesture.revealWebStyle, position: 'absolute', top: '50%', marginTop: -26, ...(mine ? { end: 0 } : { start: 0 }), width: messageReplyRevealWidth, minHeight: 52, gap: 3, alignItems: 'center', justifyContent: 'center', opacity: quoteGesture.revealOpacity }, children: [_jsx(View, { style: { width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center', backgroundColor: chatSurface(c.background), borderWidth: 1.5, borderColor: c.secondary + '40' }, children: _jsx(MessageIcon, { name: "quote", color: c.accent, size: 30 }) }), _jsx(Text, { style: { color: c.secondary, fontSize: 10, fontWeight: '900' }, children: uiText("QUOTE MESSAGE") })] }), _jsx(Animated.View, { ref: node => { anchor.current = node; if (quoteGesture.webRef)
534
+ socialRef.current?.open(); } : () => void open(), children: bodyContent }), !discussionPreview && state.discussionAvailable && !!message.replyCount && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: message.replyCount + ' ' + (message.replyCount === 1 ? 'reply' : 'replies'), onPress: () => openDiscussion(message.id), style: { minHeight: 32, justifyContent: 'center' }, children: _jsxs(Text, { style: { color: c.accent, fontSize: 12, fontWeight: '600' }, children: [message.replyCount, " ", message.replyCount === 1 ? uiText("reply") : uiText("replies")] }) }), message.kind !== 'text' && !!message.text && _jsx(View, { testID: voice ? 'voice-message-caption' : undefined, style: voice && !showingTransform ? { maxWidth: 220, alignSelf: mine ? 'flex-end' : 'flex-start', marginTop: 1, paddingTop: 4, paddingBottom: 1, borderRadius: 14, ...(mine ? { borderBottomEndRadius: 3 } : { borderBottomStartRadius: 3 }), backgroundColor: mine ? c.outgoing : c.incoming } : visual ? { backgroundColor: mine ? c.outgoing : c.incoming, ...corners, borderTopLeftRadius: 0, borderTopRightRadius: 0, paddingHorizontal: 6, paddingVertical: 3, ...(circleStatus ? { paddingEnd: 24 } : {}) } : undefined, children: _jsx(Text, { testID: "attachment-caption", selectable: true, onLongPress: menu, style: { color: ink, fontSize: 16, lineHeight: 22, marginTop: voice ? 0 : 2, textAlign: mine ? 'right' : 'left', alignSelf: 'stretch', paddingHorizontal: voice || message.kind === 'document' ? 8 : 2, paddingBottom: 2 }, children: renderText(message.text) }) }), deliveryStatus && message.kind !== 'text' && message.kind !== 'poll' && !voice && !visual && _jsx(View, { style: { marginTop: 4, alignSelf: 'flex-end' }, children: footer }), (!voice || showingTransform) && languageActions, components?.MessageFooter && !message.deleted && _jsx(components.MessageFooter, { ...regionProps }), transforming && !voice && _jsx(Text, { accessibilityLiveRegion: "polite", style: { color: ink, fontSize: 11 }, children: uiText("Converting…") }), !!error && _jsxs(MessagingPopup, { screen: "alerts", compact: true, contentWidth: 640, title: uiText("Message"), foreground: c.foreground, background: chatSurface(c.background), onClose: () => setError(''), children: [_jsx(Text, { accessibilityRole: "alert", style: { color: messagingPopupColors.foreground, fontSize: 15, lineHeight: 21, marginTop: 8 }, children: error }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Close message alert"), onPress: () => setError(''), style: { alignSelf: 'flex-end', minHeight: 44, justifyContent: 'center', paddingHorizontal: 8, marginTop: 8 }, children: _jsx(Text, { style: { color: c.accent }, children: uiText("OK") }) })] }), deliveryStatus === 'failed' && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Retry sending message"), onPress: () => void client.retry(message.clientMessageId).catch(() => { }), style: { minHeight: 32, justifyContent: 'center', alignSelf: 'flex-end' }, children: _jsx(Text, { style: { color: c.accent, fontSize: 12 }, children: design.labels.retry }) }), Platform.OS === 'web' && !mine && canInteract && state.settings?.features.reactions && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("React to message"), onFocus: () => setHovered(true), onBlur: () => setHovered(false), onPress: openMenu, style: { opacity: hovered || actions ? 1 : 0, position: 'absolute', top: 6, ...(mine ? { left: -34 } : { right: -34 }), width: 32, height: 32, alignItems: 'center', justifyContent: 'center' }, children: _jsx(MessageIcon, { name: "reaction", color: c.secondary, size: 20 }) }), !!message.reactions?.length && _jsx(View, { testID: "message-reaction-badge", pointerEvents: "none", accessibilityLabel: message.reactions.slice(-3).map(r => r.emoji).join(' '), style: { position: 'absolute', zIndex: 41, top: -16, ...(mine ? { end: -9 } : { start: -9 }), minWidth: 30, height: 20, alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { fontSize: 16, lineHeight: 20 }, children: message.reactions.slice(-3).map(r => r.emoji).join(' ') }) }), _jsx(MessageMenu, { visible: actions, position: menuPosition, screenHeight: viewport.height, mine: mine, reactions: reactionPicker, onClose: () => setActions(false), onDismiss: menuDismissed, children: actions && _jsxs(_Fragment, { children: [quoting && _jsx(MessageMenuRow, { icon: "quote", label: uiText("Quote message"), onPress: () => { setActions(false); setReply(message); } }), !discussionPreview && state.discussionAvailable && !pendingStatus && !message.deleted && _jsx(MessageMenuRow, { icon: "quote", label: uiText("Replies"), onPress: () => leaveMenu(() => openDiscussion(message.threadRoot ?? message.id)) }), state.discussionAvailable && canInteract && state.conversation?.ownerId === userId && _jsx(MessageMenuRow, { icon: "bookmark", label: message.pinned ? uiText("Unpin for group") : uiText("Pin for group"), onPress: () => { setActions(false); void client.pinMessage(message.id, !message.pinned).catch(e => setError(e instanceof Error ? e.message : uiText("The pin could not change."))); } }), canCopy && _jsx(MessageMenuRow, { icon: "copy", label: uiText("Copy"), onPress: () => { setActions(false); void (copyText ? copyText(message.text) : navigator.clipboard.writeText(message.text)).catch(() => setError(uiText("The text could not be copied."))); } }), canInteract && client.canForward(message) && _jsx(MessageMenuRow, { icon: "redo", label: uiText("Forward"), onPress: () => leaveMenu(() => setForwarding([message])) }), !pendingStatus && !message.deleted && message.kind !== 'poll' && client.hasSavedMessages() && _jsx(MessageMenuRow, { icon: "bookmark", label: saved.some(r => r.key === savedMessageKey(message)) ? uiText("Remove from Saved") : uiText("Save"), disabled: saving, onPress: () => { setActions(false); void toggleSaved(message); } }), canChange && !message.custom && message.kind !== 'poll' && state.settings?.features[message.kind] && _jsx(MessageMenuRow, { icon: "edit", label: uiText("Edit"), onPress: () => { setActions(false); setEditing(message); } }), !mine && state.conversation?.safety?.canReport && _jsx(MessageMenuRow, { icon: "flag", label: uiText("Report"), danger: true, onPress: () => leaveMenu(() => setReportOpen(true)) }), !pendingStatus && !message.deleted && ['owner', 'moderator'].includes(state.conversation?.roomRole ?? '') && _jsx(MessageMenuRow, { icon: "trash", label: uiText('Remove from group'), danger: true, onPress: () => leaveMenu(() => setRoomRemoval(true)) }), canChange && _jsx(MessageMenuRow, { icon: "trash", label: uiText("Delete"), danger: true, onPress: () => leaveMenu(() => setDeleting([message])) }), (pendingStatus === 'failed' || pendingStatus === 'queued') && _jsx(MessageMenuRow, { icon: "trash", label: uiText("Remove unsent message"), danger: true, onPress: () => { setActions(false); void client.discardPending(message.clientMessageId).catch(() => setError(uiText("The unsent message could not be removed."))); } }), !pendingStatus && onMessageOptions && _jsx(MessageMenuRow, { icon: "more", label: uiText("More options"), onPress: () => leaveMenu(() => onMessageOptions(message)) }), !pendingStatus && !message.deleted && _jsx(MessageMenuRow, { icon: "check", label: uiText("Select Multiple"), divider: true, onPress: () => { setActions(false); setSelection([message]); Keyboard.dismiss(); } })] }) }), roomRemoval && _jsx(MessagingRoomRemoval, { client: client, message: message, accent: c.accent, onClose: () => setRoomRemoval(false) }), reportOpen && _jsx(MessagingSafety, { client: client, state: state, appearance: design, name: participants?.[message.senderId]?.name ?? 'Contact', messageId: message.id, onClose: () => setReportOpen(false) })] });
535
+ return _jsxs(View, { ...(Platform.OS === 'web' ? { onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), onContextMenu: (event) => { event.preventDefault(); menu(); } } : {}), style: { width: '100%', position: 'relative', marginTop: messageGap + (message.reactions?.length ? 16 : 0), marginBottom: 0 }, children: [quoteGesture.infoLoaded && _jsxs(Animated.View, { pointerEvents: "none", testID: "message-info-reveal", accessible: false, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: { ...quoteGesture.revealWebStyle, position: 'absolute', top: '50%', marginTop: -26, minHeight: 52, width: messageInfoRevealWidth, justifyContent: 'center', ...(mine ? { start: 0, alignItems: 'flex-start' } : { end: 0, alignItems: 'flex-end' }), opacity: quoteGesture.infoOpacity }, children: [_jsxs(View, { style: { flexDirection: 'row', alignItems: 'baseline', gap: 4 }, children: [_jsx(Text, { style: { color: c.secondary, fontSize: 8, lineHeight: 11, fontWeight: '900' }, children: uiText("SENT:") }), _jsx(Text, { style: { color: c.foreground, fontSize: 10, lineHeight: 12, fontWeight: '800' }, children: messageTimeLabel(message, ui.formatMessageTime, uiText) })] }), mine && state.settings?.features.readReceipts && _jsxs(View, { style: { flexDirection: 'row', alignItems: 'baseline', gap: 4 }, children: [_jsx(Text, { style: { color: c.secondary, fontSize: 8, lineHeight: 11, fontWeight: '900' }, children: uiText("READ:") }), _jsx(Text, { style: { color: message.readAt ? c.foreground : c.secondary, fontSize: 10, lineHeight: 12, fontWeight: '800' }, children: message.readAt ? ui.formatMessageTime(message.readAt) : uiText("Not yet") })] })] }), quoting && _jsxs(Animated.View, { pointerEvents: "none", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' }), testID: `quote-reveal-${mine ? 'outgoing' : 'incoming'}`, style: { ...quoteGesture.revealWebStyle, position: 'absolute', top: '50%', marginTop: -26, ...(mine ? { end: 0 } : { start: 0 }), width: messageReplyRevealWidth, minHeight: 52, gap: 3, alignItems: 'center', justifyContent: 'center', opacity: quoteGesture.revealOpacity }, children: [_jsx(View, { style: { width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center', backgroundColor: chatSurface(c.background), borderWidth: 1.5, borderColor: c.secondary + '40' }, children: _jsx(MessageIcon, { name: "quote", color: c.accent, size: 30 }) }), _jsx(Text, { style: { color: c.secondary, fontSize: 10, fontWeight: '900' }, children: uiText("QUOTE MESSAGE") })] }), _jsxs(Animated.View, { ref: node => { anchor.current = node; if (quoteGesture.webRef)
538
536
  quoteGesture.webRef.current = node; }, ...quoteGesture.handlers, accessibilityActions: quoting ? [{ name: "quote", label: uiText("Quote message") }] : undefined, onAccessibilityAction: event => { if (quoting && event.nativeEvent.actionName === "quote")
539
- setReply(message); }, testID: `message-${message.kind}-${mine ? 'outgoing' : 'incoming'}`, style: { ...quoteGesture.webStyle, transform: [{ translateX: quoteGesture.offset }], ...(Platform.OS === "web" && !pendingStatus ? { touchAction: "pan-y", userSelect: "none" } : {}), alignSelf: mine ? 'flex-end' : 'flex-start', maxWidth: `${design.screens?.chat?.messageWidth ?? 88}%`, backgroundColor: mine ? c.outgoing : c.incoming, borderRadius: bubbleRadius, padding: visual ? 3 : 6, paddingBottom: visual || canTranscript || canTranslate ? 3 : 6, boxShadow: bigEmoji ? undefined : '0 1px 1px #00000010', ...((voice || message.kind === 'document') && !showingTransform ? { padding: 0, paddingBottom: 0, boxShadow: undefined, ...(voice ? { backgroundColor: 'transparent' } : {}) } : {}), ...(message.kind === 'poll' ? { backgroundColor: chatSurface(c.background), borderWidth: 1, borderColor: c.accent + '60', paddingHorizontal: 8, paddingTop: 4, paddingBottom: 2 } : {}), ...(bigEmoji ? { backgroundColor: 'transparent', paddingHorizontal: 4, paddingTop: 0, paddingBottom: 0 } : {}), ...(extra?.address || socialReady ? { flexDirection: mine ? 'row-reverse' : 'row', alignItems: 'center', gap: 8, padding: 0, paddingBottom: 0, backgroundColor: 'transparent', boxShadow: undefined } : {}) }, children: extra?.address ? extraCard : socialReady ? socialCard : bubbleBody })] });
537
+ setReply(message); }, testID: `message-${message.kind}-${mine ? 'outgoing' : 'incoming'}`, style: { ...quoteGesture.webStyle, transform: [{ translateX: quoteGesture.offset }], ...(Platform.OS === "web" && !pendingStatus ? { touchAction: "pan-y", userSelect: "none" } : {}), alignSelf: mine ? 'flex-end' : 'flex-start', maxWidth: `${design.screens?.chat?.messageWidth ?? 88}%`, backgroundColor: visual ? 'transparent' : mine ? c.outgoing : c.incoming, ...corners, ...(design.presentation?.bubbleStyle === 'top-tail' && !visual && !voice ? (mine ? { borderTopRightRadius: 0 } : { borderTopLeftRadius: 0 }) : {}), padding: visual ? 0 : 6, paddingBottom: visual ? 0 : canTranscript || canTranslate ? 3 : 6, ...(circleStatus && !visual && !voice && message.kind !== 'document' ? { paddingEnd: 26 } : {}), boxShadow: bigEmoji ? undefined : '0 1px 1px #00000010', ...((voice || message.kind === 'document') && !showingTransform ? { padding: 0, paddingBottom: 0, boxShadow: undefined, ...(voice ? { backgroundColor: 'transparent' } : {}) } : {}), ...(message.kind === 'poll' ? { backgroundColor: chatSurface(c.background), borderWidth: 1, borderColor: c.accent + '60', paddingHorizontal: 8, paddingTop: 4, paddingBottom: 2 } : {}), ...(bigEmoji ? { backgroundColor: 'transparent', paddingHorizontal: 4, paddingTop: 0, paddingBottom: 0 } : {}), ...(extra?.address || socialReady ? { flexDirection: mine ? 'row-reverse' : 'row', alignItems: 'center', gap: 8, padding: 0, paddingBottom: 0, backgroundColor: 'transparent', boxShadow: undefined } : {}) }, children: [design.presentation?.bubbleStyle === 'top-tail' && !visual && !voice && !extra && !socialReady && !bigEmoji && _jsx(View, { testID: "message-top-tail", pointerEvents: "none", style: { position: 'absolute', top: 0, ...(mine ? { right: -7 } : { left: -7 }), width: 0, height: 0, borderTopWidth: 10, borderTopColor: mine ? c.outgoing : c.incoming, ...(mine ? { borderRightWidth: 8, borderRightColor: 'transparent' } : { borderLeftWidth: 8, borderLeftColor: 'transparent' }) } }), extra?.address ? extraCard : socialReady ? socialCard : bubbleBody] })] });
540
538
  });
541
539
  export function MessageDeletion({ messages, onClose }) {
542
540
  const messagingPopupColors = useMessagingPopupColors(undefined, 'alerts');
@@ -578,7 +576,7 @@ const MessagingHistoryRow = React.memo(function MessagingHistoryRow({ item, prev
578
576
  const date = new Date(item.createdAt), start = !previous || date.toDateString() !== new Date(previous.createdAt).toDateString();
579
577
  const checked = selection.some(m => m.id === item.id), selectable = selection.length > 0 && !item.pendingStatus && !item.deleted;
580
578
  const toggle = () => setSelection(checked ? selection.filter(m => m.id !== item.id) : [...selection, item]);
581
- return _jsxs(View, { testID: highlighted ? 'focused-message' : undefined, style: highlighted || checked ? { backgroundColor: design.colors.accent + '20', borderRadius: 8 } : undefined, children: [start && design.screens?.chat?.showDates !== false && _jsx(Text, { testID: "messaging-date-separator", style: { alignSelf: 'center', fontSize: design.screens?.chat?.dateSize ?? 12, color: design.screens?.chat?.dateText ?? design.colors.secondary, backgroundColor: design.screens?.chat?.dateBackground ?? chatSurface(design.colors.background), borderRadius: 7, paddingHorizontal: 12, paddingVertical: 5, marginTop: 4, marginBottom: 10 }, children: date.toDateString() === new Date().toDateString() ? uiText("Today") : date.toLocaleDateString(uiLocale, { month: 'short', day: 'numeric' }) }), _jsx(View, { style: { paddingLeft: selection.length ? 32 : 0 }, pointerEvents: selection.length ? 'none' : 'auto', accessibilityElementsHidden: selection.length > 0, importantForAccessibility: selection.length ? 'no-hide-descendants' : 'auto', ...(Platform.OS === 'web' && selection.length ? { 'aria-hidden': true } : {}), children: Message ? _jsx(Message, { message: item }) : _jsx(MessagingBubbleView, { message: item, pendingStatus: item.pendingStatus, joinsBefore: continuesAttachmentSend(previous, item), joinsAfter: continuesAttachmentSend(item, next), ui: bubbleUI }) }), selectable && _jsx(Pressable, { accessibilityRole: "checkbox", accessibilityLabel: uiText('Select message: {message}', { message: item.text || item.media?.fileName || uiText(mediaNames[item.kind] || 'Message') }), accessibilityState: { checked }, onPress: toggle, style: { position: 'absolute', inset: 0, justifyContent: 'center' }, children: _jsx(View, { style: { width: 24, height: 24, borderRadius: 12, borderWidth: 1, borderColor: design.colors.accent, backgroundColor: checked ? design.colors.accent : design.colors.background, alignItems: 'center', justifyContent: 'center' }, children: checked && _jsx(MessageIcon, { name: "check", size: 16, color: "#ffffff" }) }) })] });
579
+ return _jsxs(View, { testID: highlighted ? 'focused-message' : undefined, style: highlighted || checked ? { backgroundColor: design.colors.accent + '20', borderRadius: 8 } : undefined, children: [start && design.screens?.chat?.showDates !== false && _jsx(Text, { testID: "messaging-date-separator", style: { alignSelf: 'center', fontSize: design.screens?.chat?.dateSize ?? 12, color: design.screens?.chat?.dateText ?? design.colors.secondary, backgroundColor: design.screens?.chat?.dateBackground ?? chatSurface(design.colors.background), borderRadius: 7, paddingHorizontal: 12, paddingVertical: 5, marginTop: 4, marginBottom: 10 }, children: date.toDateString() === new Date().toDateString() ? uiText("Today") : date.toLocaleDateString(uiLocale, { month: 'short', day: 'numeric' }) }), _jsx(View, { style: { paddingLeft: selection.length ? 32 : 0 }, pointerEvents: selection.length ? 'none' : 'auto', accessibilityElementsHidden: selection.length > 0, importantForAccessibility: selection.length ? 'no-hide-descendants' : 'auto', ...(Platform.OS === 'web' && selection.length ? { 'aria-hidden': true } : {}), children: Message ? _jsx(Message, { message: item }) : _jsx(MessagingBubbleView, { message: item, pendingStatus: item.pendingStatus, ui: bubbleUI }) }), selectable && _jsx(Pressable, { accessibilityRole: "checkbox", accessibilityLabel: uiText('Select message: {message}', { message: item.text || item.media?.fileName || uiText(mediaNames[item.kind] || 'Message') }), accessibilityState: { checked }, onPress: toggle, style: { position: 'absolute', inset: 0, justifyContent: 'center' }, children: _jsx(View, { style: { width: 24, height: 24, borderRadius: 12, borderWidth: 1, borderColor: design.colors.accent, backgroundColor: checked ? design.colors.accent : design.colors.background, alignItems: 'center', justifyContent: 'center' }, children: checked && _jsx(MessageIcon, { name: "check", size: 16, color: "#ffffff" }) }) })] });
582
580
  });
583
581
  const conversationReadingPositions = new WeakMap();
584
582
  export function MessagingList() {
@@ -1087,7 +1085,7 @@ export function MessagingComposer() {
1087
1085
  }
1088
1086
  function renderTextComposer(voice = { hasVoice: false, blocked: false }) {
1089
1087
  const blocked = voice.blocked || busy;
1090
- return _jsxs(View, { style: { flexDirection: 'row', alignItems: 'flex-end', gap: 4 }, children: [_jsxs(View, { testID: "messaging-composer-field", style: { flex: 1, minWidth: 0, minHeight: 44, borderRadius: design.composer?.corners === 'square' ? 0 : design.composer?.corners === 'soft' ? 8 : 22, backgroundColor: design.composer?.fieldBackground ?? composerSurface(c.background), flexDirection: 'row', alignItems: 'flex-end', overflow: 'hidden' }, children: [(camera || library.image || library.video || library.document || !editing && (features?.poll || weatherAllowed)) && _jsx(Pressable, { ref: attachmentButton, accessibilityRole: "button", accessibilityLabel: uiText("Attach"), accessibilityState: { expanded: attachmentsOpen }, disabled: busy || blocked, onPress: () => { if (attachmentsOpen) {
1088
+ return _jsxs(View, { style: { flexDirection: 'row', alignItems: 'flex-end', gap: 4 }, children: [_jsxs(View, { testID: "messaging-composer-field", style: { flex: 1, minWidth: 0, minHeight: 44, borderRadius: design.composer?.corners === 'square' ? 0 : design.composer?.corners === 'soft' ? 8 : 22, backgroundColor: design.composer?.fieldBackground ?? composerSurface(c.background), flexDirection: 'row', alignItems: 'flex-end', overflow: 'hidden' }, children: [design.composer?.fieldBorder && _jsx(View, { testID: "messaging-composer-field-border", pointerEvents: "none", accessible: false, style: { position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, zIndex: 1, borderWidth: 1, borderColor: design.composer.fieldBorderColor ?? c.secondary, borderRadius: design.composer?.corners === 'square' ? 0 : design.composer?.corners === 'soft' ? 8 : 22 } }), (camera || library.image || library.video || library.document || !editing && (features?.poll || weatherAllowed)) && _jsx(Pressable, { ref: attachmentButton, accessibilityRole: "button", accessibilityLabel: uiText("Attach"), accessibilityState: { expanded: attachmentsOpen }, disabled: busy || blocked, onPress: () => { if (attachmentsOpen) {
1091
1089
  setAttachmentsOpen(false);
1092
1090
  input.current?.focus();
1093
1091
  }
@@ -1,6 +1,6 @@
1
1
  import type { MessagingMessage } from '@robono/messaging';
2
- /** Only adjacent parts of the same send share a rail. Never join across a
3
- * missing part, another sender/conversation, or a date separator. */
2
+ /** Identifies adjacent parts of one send for ordering consumers.
3
+ * Each part renders its own independent delivery indicator. */
4
4
  export declare function continuesAttachmentSend(before: MessagingMessage | undefined, after: MessagingMessage | undefined): boolean;
5
5
  /** Upload completion order must not reorder the attachments selected together.
6
6
  * Transport state remains in server sequence order for reconnect cursors. */
@@ -1,5 +1,5 @@
1
- /** Only adjacent parts of the same send share a rail. Never join across a
2
- * missing part, another sender/conversation, or a date separator. */
1
+ /** Identifies adjacent parts of one send for ordering consumers.
2
+ * Each part renders its own independent delivery indicator. */
3
3
  export function continuesAttachmentSend(before, after) {
4
4
  if (!before || !after || before.deleted || after.deleted)
5
5
  return false;
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@robono/messaging-react-native",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
- "sideEffects": false,
5
+ "sideEffects": [
6
+ "./dist/expo-notification-cleanup.js"
7
+ ],
6
8
  "description": "Optional, composable direct and group messaging screens for Robono.",
7
9
  "main": "./dist/index.js",
8
10
  "types": "./dist/index.d.ts",
@@ -57,7 +59,7 @@
57
59
  "prepack": "npm run build && node ../../scripts/generate-sdk-file-sbom.mjs"
58
60
  },
59
61
  "peerDependencies": {
60
- "@robono/messaging": "^0.15.1",
62
+ "@robono/messaging": "^0.16.0",
61
63
  "react": ">=18.2 <20",
62
64
  "react-native": ">=0.76 <1",
63
65
  "expo-audio": ">=55 <57",
@@ -69,7 +71,7 @@
69
71
  "expo-crypto": ">=55 <57",
70
72
  "react-native-safe-area-context": ">=5 <6",
71
73
  "react-native-svg": ">=15 <16",
72
- "@robono/calling-react-native": "^0.9.3",
74
+ "@robono/calling-react-native": "^0.10.0",
73
75
  "expo-clipboard": ">=8 <57",
74
76
  "expo-image-manipulator": ">=14 <57",
75
77
  "expo-video-thumbnails": ">=14 <57",
@@ -83,7 +85,8 @@
83
85
  "@robono/location": "^0.4.1",
84
86
  "expo-haptics": ">=55 <57",
85
87
  "@robono/calling": "^0.6.3",
86
- "expo-media-library": ">=55 <57"
88
+ "expo-media-library": ">=55 <57",
89
+ "expo-task-manager": ">=55.0.0 <57.0.0"
87
90
  },
88
91
  "license": "SEE LICENSE IN LICENSE",
89
92
  "peerDependenciesMeta": {
@@ -137,6 +140,9 @@
137
140
  },
138
141
  "expo-media-library": {
139
142
  "optional": true
143
+ },
144
+ "expo-task-manager": {
145
+ "optional": true
140
146
  }
141
147
  },
142
148
  "author": {