@robono/messaging-react-native 0.17.0 → 0.19.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/BRIDGE-MESSENGER.md +125 -0
- package/CHANGELOG.md +13 -0
- package/README.md +21 -1
- package/SBOM.spdx.json +567 -279
- package/dist/account.js +5 -3
- package/dist/appearance-context.d.ts +11 -0
- package/dist/appearance-context.js +5 -0
- package/dist/attachment-menu.js +9 -6
- package/dist/brand.js +5 -4
- package/dist/calling.js +3 -2
- package/dist/chat-options.d.ts +12 -0
- package/dist/chat-options.js +25 -0
- package/dist/contact-directory.js +3 -3
- package/dist/conversation-details.d.ts +2 -0
- package/dist/conversation-details.js +7 -5
- package/dist/expo-bridge.d.ts +22 -0
- package/dist/expo-bridge.js +29 -0
- package/dist/expo-history.js +1 -1
- package/dist/expo-media.js +2 -2
- package/dist/expo-messenger.js +14 -4
- package/dist/expo-outbox.js +1 -1
- package/dist/expo-screen.js +15 -11
- package/dist/expo-storage-digest.d.ts +1 -0
- package/dist/expo-storage-digest.js +5 -0
- package/dist/expo.d.ts +1 -0
- package/dist/expo.js +1 -0
- package/dist/extras.d.ts +3 -1
- package/dist/extras.js +5 -3
- package/dist/forward.js +4 -3
- package/dist/group-editor.js +6 -3
- package/dist/header-calls.js +4 -3
- package/dist/inbox-search.js +4 -3
- package/dist/inbox.js +12 -9
- package/dist/index.d.ts +16 -2
- package/dist/index.js +173 -74
- package/dist/media-ui.js +15 -7
- package/dist/message-menu.d.ts +2 -1
- package/dist/message-menu.js +9 -4
- package/dist/native-outbox.d.ts +2 -1
- package/dist/native-outbox.js +20 -3
- package/dist/polls.js +10 -6
- package/dist/popup.d.ts +5 -2
- package/dist/popup.js +13 -7
- package/dist/public-rooms.js +4 -2
- package/dist/quick-send.js +2 -2
- package/dist/room-moderation.js +9 -4
- package/dist/safety.d.ts +5 -2
- package/dist/safety.js +16 -10
- package/dist/saved.js +3 -2
- package/dist/scheduled.js +11 -6
- package/dist/search.js +4 -2
- package/dist/sign-in.js +9 -7
- package/dist/social.d.ts +5 -0
- package/dist/social.js +4 -3
- package/dist/storage-digest-cache.d.ts +2 -0
- package/dist/storage-digest-cache.js +19 -0
- package/dist/translation-settings.js +5 -3
- package/dist/typography.d.ts +8 -3
- package/dist/typography.js +22 -9
- package/dist/use-quote-gesture.js +7 -3
- package/examples/existing-bridge-chat.tsx +44 -0
- package/package.json +11 -5
- package/setup.plugin.cjs +1 -0
package/dist/extras.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useRobonoLocale } from './localization.js';
|
|
|
4
4
|
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
5
5
|
import { ActivityIndicator, Image, Linking, Platform, Pressable, ScrollView, View } from 'react-native';
|
|
6
6
|
import { currentTrackers, trackerFresh, weatherTemperature } from '@robono/messaging';
|
|
7
|
-
import { MessagingPopup,
|
|
7
|
+
import { MessagingPopup, useMessagingPopupColors } from './popup.js';
|
|
8
8
|
import { MessageIcon } from './icons.js';
|
|
9
9
|
import WeatherArtwork from './visual/WeatherArtwork.js';
|
|
10
10
|
import { weatherConditions } from './visual/weather-conditions.js';
|
|
@@ -26,9 +26,11 @@ export async function openChatAddress(address) { const query = encodeURIComponen
|
|
|
26
26
|
}
|
|
27
27
|
else
|
|
28
28
|
await Linking.openURL(`https://www.google.com/maps/search/?api=1&query=${query}`); }
|
|
29
|
-
export function ExtraPopup({ title, onClose, background, foreground, children, expanded = true }) { return _jsx(MessagingPopup, { expanded: expanded, title: title, foreground: foreground, background: background, onClose: onClose, children: children }); }
|
|
29
|
+
export function ExtraPopup({ screen, title, onClose, background, foreground, children, expanded = true }) { return _jsx(MessagingPopup, { screen: screen, expanded: expanded, title: title, foreground: foreground, background: background, onClose: onClose, children: children }); }
|
|
30
30
|
export const MessageExtra = forwardRef(function MessageExtra({ addressBubbleHeight = 44, extra, messageId, userId, extras, ink, accent, background, foreground, footer, renderAddress, Map, onCall, onLongPress }, ref) {
|
|
31
|
+
const styleScreen = extra.weather ? 'weather' : extra.address ? 'tracking' : 'callDetails', messagingPopupColors = useMessagingPopupColors(undefined, styleScreen);
|
|
31
32
|
const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
|
|
33
|
+
accent = messagingPopupColors.accent;
|
|
32
34
|
const [mapHeight, setMapHeight] = useState(230), [pendingShare, setPendingShare] = useState(false);
|
|
33
35
|
const resolution = useRef(null), shareIntent = useRef(false);
|
|
34
36
|
const [open, setOpen] = useState(false), [fahrenheit, setFahrenheit] = useState(extra.weather?.fahrenheit ?? false), [imperial, setImperial] = useState(false), [now, setNow] = useState(Date.now()), [error, setError] = useState(''), [busy, setBusy] = useState(false), [selected, setSelected] = useState();
|
|
@@ -66,7 +68,7 @@ export const MessageExtra = forwardRef(function MessageExtra({ addressBubbleHeig
|
|
|
66
68
|
const addressAction = _jsxs(View, { testID: "address-tracking", style: { flexShrink: 0, maxWidth: 136, height: trackers.length ? addressBubbleHeight : 32, justifyContent: 'center', alignItems: 'center', gap: 2, overflow: 'hidden' }, children: [_jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: mine ? uiText("End tracking") : uiText("Allow tracking"), accessibilityHint: uiText("Share your live location with this chat for 15 minutes"), disabled: busy || !mine && !extras.getSnapshot().available.tracking, hitSlop: { top: 6, bottom: 6, left: 0, right: 0 }, onPress: event => { event.stopPropagation(); void act(share); }, accessibilityState: { busy, disabled: busy || !mine && !extras.getSnapshot().available.tracking }, style: ({ pressed }) => ({ minHeight: 32, paddingHorizontal: 10, paddingVertical: 5, borderRadius: 16, borderWidth: 1, borderColor: accent + (mine ? 'b0' : '70'), backgroundColor: accent + (pressed ? '30' : mine ? '20' : '0d'), flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 6, opacity: (busy || !mine && !extras.getSnapshot().available.tracking) ? 0.45 : 1 }), children: [busy ? _jsx(ActivityIndicator, { size: 16, color: accent }) : _jsx(MessageIcon, { name: mine ? 'stop' : 'location-outline', size: 16, color: accent }), _jsx(Text, { numberOfLines: 1, style: { color: foreground, fontSize: 12, lineHeight: 18, fontWeight: '600' }, children: mine ? uiText("End tracking") : uiText("Allow tracking") })] }), trackers.length > 0 && _jsx(View, { testID: "tracking-map-avatars", style: { flexDirection: 'row', flexWrap: 'nowrap', justifyContent: 'center', gap: 2 }, children: trackers.slice(0, 4).map(t => _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: t.userId === userId ? uiText('Show your location on map') : uiText('Show {name} on map', { name: t.name }), onPress: event => { event.stopPropagation(); setSelected(t.userId); setOpen(true); }, style: ({ pressed }) => ({ width: avatarSize, height: avatarSize, borderRadius: avatarSize / 2, alignItems: 'center', justifyContent: 'center', backgroundColor: accent + (pressed ? '30' : '12'), borderWidth: 1, borderColor: accent + '70' }), children: t.avatarUrl ? _jsx(Image, { source: { uri: t.avatarUrl }, style: { width: avatarSize - 4, height: avatarSize - 4, borderRadius: avatarSize / 2 } }) : _jsx(Text, { style: { color: foreground, fontSize: Math.min(18, avatarSize * .55), fontWeight: '600' }, children: t.name.slice(0, 1).toUpperCase() }) }, t.sessionId)) })] });
|
|
67
69
|
const trackingETA = (t) => trackerFresh(t, now) && t.etaSeconds !== null && Number.isFinite(t.etaSeconds) ? uiText('{count} min', { count: uiNumber(Math.max(1, Math.ceil(t.etaSeconds / 60))) }) : uiText('Updating…');
|
|
68
70
|
const addressParticipants = trackers.length > 0 && _jsx(View, { testID: "address-participants", pointerEvents: "none", style: { alignSelf: 'stretch' }, children: _jsx(Text, { style: { color: ink, fontSize: 13, lineHeight: 18 }, children: trackers.map(t => `${t.userId === userId ? uiText('You') : t.name} · ${trackingETA(t)}`).join(' · ') }) });
|
|
69
|
-
return _jsxs(_Fragment, { children: [weather && _jsxs(Pressable, { testID: "weather-card", accessibilityRole: "button", accessibilityLabel: uiText("Open weather"), onLongPress: onLongPress, onPress: () => setOpen(true), style: { width: 268, maxWidth: '100%', paddingHorizontal: 4, paddingVertical: 2 }, children: [_jsxs(View, { style: row, children: [_jsx(ForecastIcon, { period: weather.current, size: 34 }), _jsxs(View, { style: { flex: 1 }, children: [_jsxs(Text, { style: title, children: [weatherTemperature(weather.current.c, weather.fahrenheit ?? false), " \u00B7 ", weather.current.condition] }), _jsx(Text, { style: { color: ink, fontSize: 12, opacity: .75 }, children: weather.place })] })] }), _jsxs(View, { style: { ...row, justifyContent: 'space-between', marginTop: 2 }, children: [_jsx(Text, { style: { color: ink, fontSize: 11 }, children: weather.current.detail }), footer] })] }), address && (renderAddress ? renderAddress(addressAction, addressParticipants) : _jsxs(_Fragment, { children: [addressAction, addressParticipants] })), call && _jsxs(Pressable, { testID: "call-card", accessibilityRole: "button", accessibilityLabel: uiText("Open call details"), onLongPress: onLongPress, onPress: () => setOpen(true), style: { ...row, width: 268, maxWidth: '100%', padding: 4 }, children: [_jsx(MessageIcon, { name: call.kind === 'video' ? 'video' : 'call', color: call.outcome === 'missed' ? '#c94040' : accent, size: 26 }), _jsxs(View, { style: { flex: 1 }, children: [_jsx(Text, { style: title, children: call.outcome === 'missed' ? (call.kind === 'video' ? uiText('Missed video call') : uiText('Missed voice call')) : call.direction === 'incoming' ? (call.kind === 'video' ? uiText('Incoming video call') : uiText('Incoming voice call')) : (call.kind === 'video' ? uiText('Outgoing video call') : uiText('Outgoing voice call')) }), _jsx(Text, { style: { color: ink, fontSize: 12 }, children: call.outcome === 'completed' ? `${Math.floor(call.durationSeconds / 60)}:${String(Math.floor(call.durationSeconds % 60)).padStart(2, '0')}` : call.outcome })] }), footer] }), open && _jsxs(ExtraPopup, { expanded: !!address || !!weather, title: weather ? uiText("Weather") : address ? uiText("Live tracking") : uiText("Call details"), onClose: () => { shareIntent.current = false; setPendingShare(false); resolution.current = null; setError(''); setOpen(false); }, background: background, foreground: foreground, children: [!!error && _jsxs(View, { style: { paddingVertical: 8 }, children: [_jsx(Text, { accessibilityRole: "alert", style: text, children: error }), address && !address.destination && _jsx(Pressable, { accessibilityRole: "button", disabled: busy, onPress: () => void act(async () => { await extras.resolveAddress(messageId); }), style: { minHeight: 44, justifyContent: 'center' }, children: _jsx(Text, { style: { color: accent }, children: uiText("Try again") }) })] }), address && _jsxs(View, { style: { flex: 1, minHeight: 0 }, children: [!address.destination && !!address.candidates?.length && _jsxs(View, { style: { gap: 8, paddingVertical: 12 }, children: [_jsx(Text, { style: { ...text, fontSize: 17, fontWeight: '600' }, children: uiText("Choose the destination") }), address.candidates.map((place, index) => _jsx(Pressable, { accessibilityRole: "button", disabled: busy, onPress: () => void act(async () => { await extras.resolveAddress(messageId, index); if (pendingShare && shareIntent.current) {
|
|
71
|
+
return _jsxs(_Fragment, { children: [weather && _jsxs(Pressable, { testID: "weather-card", accessibilityRole: "button", accessibilityLabel: uiText("Open weather"), onLongPress: onLongPress, onPress: () => setOpen(true), style: { width: 268, maxWidth: '100%', paddingHorizontal: 4, paddingVertical: 2 }, children: [_jsxs(View, { style: row, children: [_jsx(ForecastIcon, { period: weather.current, size: 34 }), _jsxs(View, { style: { flex: 1 }, children: [_jsxs(Text, { style: title, children: [weatherTemperature(weather.current.c, weather.fahrenheit ?? false), " \u00B7 ", weather.current.condition] }), _jsx(Text, { style: { color: ink, fontSize: 12, opacity: .75 }, children: weather.place })] })] }), _jsxs(View, { style: { ...row, justifyContent: 'space-between', marginTop: 2 }, children: [_jsx(Text, { style: { color: ink, fontSize: 11 }, children: weather.current.detail }), footer] })] }), address && (renderAddress ? renderAddress(addressAction, addressParticipants) : _jsxs(_Fragment, { children: [addressAction, addressParticipants] })), call && _jsxs(Pressable, { testID: "call-card", accessibilityRole: "button", accessibilityLabel: uiText("Open call details"), onLongPress: onLongPress, onPress: () => setOpen(true), style: { ...row, width: 268, maxWidth: '100%', padding: 4 }, children: [_jsx(MessageIcon, { name: call.kind === 'video' ? 'video' : 'call', color: call.outcome === 'missed' ? '#c94040' : accent, size: 26 }), _jsxs(View, { style: { flex: 1 }, children: [_jsx(Text, { style: title, children: call.outcome === 'missed' ? (call.kind === 'video' ? uiText('Missed video call') : uiText('Missed voice call')) : call.direction === 'incoming' ? (call.kind === 'video' ? uiText('Incoming video call') : uiText('Incoming voice call')) : (call.kind === 'video' ? uiText('Outgoing video call') : uiText('Outgoing voice call')) }), _jsx(Text, { style: { color: ink, fontSize: 12 }, children: call.outcome === 'completed' ? `${Math.floor(call.durationSeconds / 60)}:${String(Math.floor(call.durationSeconds % 60)).padStart(2, '0')}` : call.outcome })] }), footer] }), open && _jsxs(ExtraPopup, { screen: styleScreen, expanded: !!address || !!weather, title: weather ? uiText("Weather") : address ? uiText("Live tracking") : uiText("Call details"), onClose: () => { shareIntent.current = false; setPendingShare(false); resolution.current = null; setError(''); setOpen(false); }, background: background, foreground: foreground, children: [!!error && _jsxs(View, { style: { paddingVertical: 8 }, children: [_jsx(Text, { accessibilityRole: "alert", style: text, children: error }), address && !address.destination && _jsx(Pressable, { accessibilityRole: "button", disabled: busy, onPress: () => void act(async () => { await extras.resolveAddress(messageId); }), style: { minHeight: 44, justifyContent: 'center' }, children: _jsx(Text, { style: { color: accent }, children: uiText("Try again") }) })] }), address && _jsxs(View, { style: { flex: 1, minHeight: 0 }, children: [!address.destination && !!address.candidates?.length && _jsxs(View, { style: { gap: 8, paddingVertical: 12 }, children: [_jsx(Text, { style: { ...text, fontSize: 17, fontWeight: '600' }, children: uiText("Choose the destination") }), address.candidates.map((place, index) => _jsx(Pressable, { accessibilityRole: "button", disabled: busy, onPress: () => void act(async () => { await extras.resolveAddress(messageId, index); if (pendingShare && shareIntent.current) {
|
|
70
72
|
await extras.startTracking(messageId);
|
|
71
73
|
setPendingShare(false);
|
|
72
74
|
} }), style: { minHeight: 48, padding: 12, borderRadius: 10, borderWidth: 1, borderColor: accent }, children: _jsx(Text, { style: { ...text, color: accent }, children: place.address }) }, index))] }), _jsx(Pressable, { accessibilityRole: "link", accessibilityLabel: uiText("Open destination in maps"), onPress: () => void act(() => openChatAddress(address.text)), children: _jsx(Text, { style: { ...text, color: accent, marginBottom: 10 }, numberOfLines: 2, children: address.text }) }), _jsx(View, { testID: "tracking-map-area", onLayout: event => setMapHeight(Math.max(1, Math.round(event.nativeEvent.layout.height))), style: { flex: 1, minHeight: 120, overflow: 'hidden' }, children: address.destination && Map ? _jsx(Map, { imperial: imperial, now: now, height: mapHeight, destination: address.destination, trackers: trackers.filter(t => trackerFresh(t, now)), accent: accent, selectedUserId: selected, onSelect: setSelected }) : _jsx(Text, { style: small, children: busy ? uiText("Finding the destination…") : address.candidates?.length ? uiText("Choose the matching destination above.") : uiText("The map is unavailable. Check Maps setup or try again.") }) }), _jsxs(View, { style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(Text, { style: { color: messagingPopupColors.foreground, fontSize: 14 }, children: uiText("Sharing ends after 15 minutes.") }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Change speed and distance units"), onPress: () => setImperial(v => !v), style: { minHeight: 44, paddingHorizontal: 4, justifyContent: 'center' }, children: _jsx(Text, { style: { color: accent, fontSize: 17, fontWeight: '600' }, children: imperial ? uiText("km/h · km") : uiText("mph · mi") }) })] }), _jsxs(ScrollView, { style: { flexGrow: 0, maxHeight: 156 }, children: [!trackers.length && _jsx(Text, { style: text, children: uiText("No one is sharing their location.") }), trackers.map(t => _jsxs(Pressable, { onPress: () => setSelected(t.userId), accessibilityRole: "button", accessibilityLabel: uiText('Locate {name}', { name: t.name }), style: { minHeight: 74, paddingVertical: 8, borderBottomWidth: 1, borderColor: messagingPopupColors.foreground + '18' }, children: [_jsxs(View, { style: { ...row, justifyContent: 'space-between' }, children: [_jsx(Text, { style: { color: messagingPopupColors.foreground, fontSize: 21, lineHeight: 27, fontWeight: '600', flexShrink: 1 }, children: t.userId === userId ? uiText("You") : t.name }), _jsx(Text, { style: { color: accent, fontSize: 25, lineHeight: 30, fontWeight: '700' }, children: trackingETA(t) })] }), _jsxs(View, { style: { ...row, justifyContent: 'space-between', alignItems: 'flex-start' }, children: [_jsx(Text, { style: { color: messagingPopupColors.foreground, fontSize: 19, lineHeight: 26, flex: 1 }, children: trackerFresh(t, now) ? t.speedMps === null ? uiText("Speed unavailable") : Math.round(t.speedMps * (imperial ? 2.23694 : 3.6)) + (imperial ? ' mph' : ' km/h') : uiText("Waiting for a fresh location") }), trackerFresh(t, now) && _jsx(Text, { testID: "tracking-distance", style: { color: messagingPopupColors.foreground, fontSize: 19, lineHeight: 26, textAlign: 'right', flexShrink: 1 }, children: t.distanceMeters === null ? uiText("Distance unavailable") : uiText('{distance} {unit} away', { distance: uiNumber(t.distanceMeters / (imperial ? 1609.344 : 1000), { minimumFractionDigits: 1, maximumFractionDigits: 1 }), unit: imperial ? uiText('mi') : uiText('km') }) })] })] }, t.sessionId))] })] }), !address && _jsxs(ScrollView, { style: weather ? { flex: 1, minHeight: 0 } : { flexShrink: 1 }, children: [weather && (weather.expiresAt <= now ? _jsx(Text, { style: text, children: uiText("Weather details expired.") }) : _jsxs(_Fragment, { children: [_jsx(Text, { style: small, children: weather.place }), _jsxs(View, { style: { ...row, marginVertical: 8 }, children: [_jsx(ForecastIcon, { period: weather.current, size: 36 }), _jsxs(Text, { style: { ...text, flex: 1, fontWeight: '600' }, children: [weatherTemperature(weather.current.c, fahrenheit), " \u00B7 ", weather.current.condition] }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Change temperature unit"), onPress: () => setFahrenheit(v => !v), style: { minWidth: 44, minHeight: 44, alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { color: accent, fontSize: 16, fontWeight: '600' }, children: fahrenheit ? uiText("°C") : uiText("°F") }) })] }), weather.alert && _jsx(Text, { style: { ...text, color: accent }, children: weather.alert }), _jsxs(View, { style: { marginTop: 20, paddingTop: 16, borderTopWidth: 1, borderTopColor: messagingPopupColors.foreground + '24' }, children: [_jsx(Text, { style: { ...text, fontWeight: '600' }, children: uiText("Next three hours") }), _jsx(View, { style: { ...row, marginTop: 12, alignItems: 'flex-start' }, children: weather.hours.slice(0, 3).map(p => _jsxs(View, { style: { flex: 1, gap: 4 }, children: [_jsx(Text, { style: small, children: p.label }), _jsxs(View, { style: row, children: [_jsx(ForecastIcon, { period: p, size: 32 }), _jsx(Text, { style: text, children: weatherTemperature(p.c, fahrenheit) })] }), _jsx(Text, { style: small, children: p.detail })] }, p.at)) })] }), _jsxs(View, { style: { marginTop: 20, paddingTop: 16, borderTopWidth: 1, borderTopColor: messagingPopupColors.foreground + '24' }, children: [_jsx(Text, { style: { ...text, fontWeight: '600', marginBottom: 8 }, children: uiText("Three-day forecast") }), weather.days.slice(0, 3).map(p => _jsxs(View, { style: { ...row, paddingVertical: 8 }, children: [_jsx(Text, { style: { ...text, width: 45 }, children: p.label }), _jsx(ForecastIcon, { period: p, size: 32 }), _jsxs(View, { style: { flex: 1 }, children: [_jsx(Text, { style: text, children: p.condition }), _jsx(Text, { style: small, children: p.detail })] }), _jsxs(Text, { style: text, children: [weatherTemperature(p.c, fahrenheit), p.lowC !== undefined ? ' / ' + weatherTemperature(p.lowC, fahrenheit) : ''] })] }, p.at))] }), !!weather.attribution && _jsx(Text, { style: { ...small, marginTop: 8 }, children: weather.attribution })] })), call && _jsxs(_Fragment, { children: [_jsxs(Text, { style: { ...text, fontWeight: '600', marginVertical: 8 }, children: [call.kind === 'video' ? uiText('Video call') : uiText('Voice call'), " \u00B7 ", uiText(call.outcome)] }), _jsx(Text, { style: text, children: new Date(call.startedAt).toLocaleString(uiLocale) }), call.durationSeconds > 0 && _jsx(Text, { style: { ...text, marginTop: 8 }, children: uiText('{minutes} min {seconds} sec', { minutes: Math.floor(call.durationSeconds / 60), seconds: Math.floor(call.durationSeconds % 60) }) }), call.endedByWarning && _jsx(Text, { style: { ...small, marginTop: 10 }, children: uiText("Ended after the network’s time warning.") }), onCall && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Call again"), onPress: () => { setOpen(false); onCall(call.kind); }, style: { minHeight: 44, justifyContent: 'center', marginTop: 10 }, children: _jsx(Text, { style: { color: accent, fontWeight: '600' }, children: uiText("Call again") }) })] })] })] }), !!error && !open && _jsx(ExtraPopup, { title: uiText("Message"), onClose: () => setError(''), background: background, foreground: foreground, children: _jsx(Text, { accessibilityRole: "alert", style: text, children: error }) })] });
|
package/dist/forward.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text } from './typography.js';
|
|
3
3
|
import { useRobonoLocale } from './localization.js';
|
|
4
|
-
import {
|
|
4
|
+
import { useMessagingPopupColors } from './popup.js';
|
|
5
5
|
import { useEffect, useRef, useState } from 'react';
|
|
6
6
|
import { ActivityIndicator, Pressable, ScrollView, View } from 'react-native';
|
|
7
7
|
import { MessagingPopup } from './popup.js';
|
|
8
8
|
/** Messenger's compact destination picker, retaining per-message retry identities. */
|
|
9
9
|
export function MessagingForward({ messages, client, appearance, participants = {}, userId, onClose }) {
|
|
10
|
+
const messagingPopupColors = useMessagingPopupColors(appearance, 'forward');
|
|
10
11
|
const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
|
|
11
12
|
const [page, setPage] = useState(null), [loading, setLoading] = useState(false), [busy, setBusy] = useState(false), [error, setError] = useState('');
|
|
12
13
|
const live = useRef(true), inFlight = useRef(false), attempts = useRef(new Map()), done = useRef(new Set());
|
|
@@ -60,6 +61,6 @@ export function MessagingForward({ messages, client, appearance, participants =
|
|
|
60
61
|
setBusy(false);
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
|
-
return _jsxs(MessagingPopup, { contentWidth: 640, title: uiText("Forward to"), foreground: c.foreground, closeLabel: uiText("Close forwarding"), closeDisabled: busy, background: c.background, onClose: () => { if (!busy)
|
|
64
|
-
onClose(); }, children: [_jsx(ScrollView, { style: { flex: 1, minHeight: 0, marginTop: 8 }, children: page?.conversations.filter(row => row.canSend).map(row => { const name = row.kind === 'group' ? row.name ?? uiText('Group') : row.contactId === userId ? uiText('You') : participants[row.contactId ?? '']?.name ?? row.contactId ?? uiText('Chat'); return _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText('Forward to {name}', { name }), disabled: busy || loading, onPress: () => void send(row), style: { minHeight: 52, justifyContent: 'center', paddingVertical: 12, paddingHorizontal: 8, borderBottomWidth: 1, borderBottomColor: '
|
|
64
|
+
return _jsxs(MessagingPopup, { screen: 'forward', contentWidth: 640, title: uiText("Forward to"), foreground: c.foreground, closeLabel: uiText("Close forwarding"), closeDisabled: busy, background: c.background, onClose: () => { if (!busy)
|
|
65
|
+
onClose(); }, children: [_jsx(ScrollView, { style: { flex: 1, minHeight: 0, marginTop: 8 }, children: page?.conversations.filter(row => row.canSend).map(row => { const name = row.kind === 'group' ? row.name ?? uiText('Group') : row.contactId === userId ? uiText('You') : participants[row.contactId ?? '']?.name ?? row.contactId ?? uiText('Chat'); return _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText('Forward to {name}', { name }), disabled: busy || loading, onPress: () => void send(row), style: { minHeight: 52, justifyContent: 'center', paddingVertical: 12, paddingHorizontal: 8, borderBottomWidth: 1, borderBottomColor: c.foreground + '14' }, children: _jsx(Text, { style: { color: c.foreground, fontSize: 16 }, children: name }) }, row.id); }) }), loading || busy ? _jsx(ActivityIndicator, { color: c.accent, style: { margin: 12 } }) : page && !page.conversations.some(row => row.canSend) && _jsx(Text, { style: { color: c.secondary, marginVertical: 12 }, children: uiText("No chats available.") }), !!error && _jsx(Text, { accessibilityRole: "alert", style: { color: c.foreground, marginTop: 8 }, children: error }), _jsxs(View, { style: { flexDirection: 'row', justifyContent: 'flex-end', gap: 20, marginTop: 8 }, children: [!page && error && _jsx(Pressable, { accessibilityRole: "button", onPress: () => void load(false), style: { minHeight: 44, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent }, children: uiText("Try again") }) }), page?.hasMore && _jsx(Pressable, { accessibilityRole: "button", disabled: loading || busy, onPress: () => void load(true), style: { minHeight: 44, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent }, children: uiText("More chats") }) })] })] });
|
|
65
66
|
}
|
package/dist/group-editor.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { messagingContrastInk } from '@robono/messaging';
|
|
2
3
|
import { Text, TextInput } from './typography.js';
|
|
3
4
|
import { useRobonoLocale } from './localization.js';
|
|
4
5
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
5
6
|
import { ActivityIndicator, FlatList, Image, Pressable, View } from 'react-native';
|
|
6
7
|
import { MessageIcon } from './icons.js';
|
|
7
|
-
import { MessagingPopup,
|
|
8
|
+
import { MessagingPopup, useMessagingPopupColors } from './popup.js';
|
|
8
9
|
/** Messenger's name, group type and contact checklist; changes use member deltas. */
|
|
9
10
|
export function MessagingGroupEditor({ client, inbox, userId, contacts, conversation, groups, accent, onClose, onSaved }) {
|
|
11
|
+
const c = useMessagingPopupColors(undefined, conversation ? 'editGroup' : 'newGroup');
|
|
12
|
+
accent = c.accent;
|
|
10
13
|
const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
|
|
11
14
|
const editing = !!conversation, conversationId = client.getSnapshot().conversationId;
|
|
12
15
|
const [name, setName] = useState(conversation?.name ?? ''), [supergroup, setSupergroup] = useState(conversation?.supergroup ?? false);
|
|
@@ -96,6 +99,6 @@ export function MessagingGroupEditor({ client, inbox, userId, contacts, conversa
|
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
const locked = busy || loading || !ready, canSave = !locked && !!name.trim() && membersCount >= 2 && membersCount <= max;
|
|
99
|
-
return _jsxs(MessagingPopup, { title: editing ? uiText("Edit group") : uiText("New group"), background: c.background, closeDisabled: busy, onClose: () => { if (!busy)
|
|
100
|
-
onClose(); }, form: true, children: [_jsx(FlatList, { data: people, keyExtractor: id => id, keyboardShouldPersistTaps: "handled", style: { flex: 1 }, contentContainerStyle: { paddingHorizontal: 8, paddingBottom: 16 }, initialNumToRender: 15, ListHeaderComponent: _jsxs(View, { style: { gap: 12, paddingTop: 12 }, children: [_jsx(TextInput, { accessibilityLabel: uiText("Group name"), placeholder: uiText("Group name"), placeholderTextColor: c.secondary, maxLength: 100, value: name, onChangeText: setName, editable: !locked, style: { color: c.foreground, fontSize: 21, minHeight: 48, paddingHorizontal: 4, borderBottomWidth: 1, borderBottomColor: '
|
|
102
|
+
return _jsxs(MessagingPopup, { screen: editing ? 'editGroup' : 'newGroup', title: editing ? uiText("Edit group") : uiText("New group"), background: c.background, closeDisabled: busy, onClose: () => { if (!busy)
|
|
103
|
+
onClose(); }, form: true, children: [_jsx(FlatList, { data: people, keyExtractor: id => id, keyboardShouldPersistTaps: "handled", style: { flex: 1 }, contentContainerStyle: { paddingHorizontal: 8, paddingBottom: 16 }, initialNumToRender: 15, ListHeaderComponent: _jsxs(View, { style: { gap: 12, paddingTop: 12 }, children: [_jsx(TextInput, { accessibilityLabel: uiText("Group name"), placeholder: uiText("Group name"), placeholderTextColor: c.secondary, maxLength: 100, value: name, onChangeText: setName, editable: !locked, style: { backgroundColor: c.incoming, color: c.foreground, fontSize: 21, minHeight: 48, paddingHorizontal: 4, borderBottomWidth: 1, borderBottomColor: c.foreground + '30' } }), groups?.supergroupsEnabled && _jsx(View, { style: { flexDirection: 'row', gap: 20 }, children: [false, true].map(value => _jsxs(Pressable, { accessibilityRole: "radio", accessibilityLabel: value ? uiText("Supergroup") : uiText("Standard group"), accessibilityState: { checked: supergroup === value, disabled: locked }, disabled: locked, onPress: () => setSupergroup(value), style: { minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: 8 }, children: [_jsx(MessageIcon, { name: supergroup === value ? 'radio-button-on' : 'radio-button-off', color: accent, size: 22 }), _jsx(Text, { style: { color: c.foreground, fontSize: 16 }, children: value ? uiText("Supergroup") : uiText("Group") })] }, String(value))) }), _jsx(Text, { style: { color: c.secondary, fontSize: 14 }, children: uiText('{count} / {limit} members', { count: membersCount, limit: max }) }), _jsx(Text, { style: { color: c.foreground, fontSize: 17 }, children: uiText("You · Group owner") }), _jsx(TextInput, { accessibilityLabel: uiText("Search group contacts"), placeholder: uiText("Search contacts"), placeholderTextColor: c.secondary, value: query, onChangeText: setQuery, style: { backgroundColor: c.incoming, color: c.foreground, fontSize: 16, minHeight: 44, borderBottomWidth: 1, borderBottomColor: c.foreground + '30' } })] }), renderItem: ({ item: id }) => _jsxs(Pressable, { accessibilityRole: "checkbox", accessibilityLabel: contacts[id]?.name ?? uiText("Member"), accessibilityState: { checked: chosen(id), disabled: locked }, disabled: locked, onPress: () => toggle(id), style: { minHeight: 56, flexDirection: 'row', alignItems: 'center', gap: 10 }, children: [contacts[id]?.avatarUrl ? _jsx(Image, { source: { uri: contacts[id].avatarUrl }, style: { width: 36, height: 36, borderRadius: 18 } }) : _jsx(View, { style: { width: 36, height: 36, borderRadius: 18, backgroundColor: c.incoming, alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { color: accent, fontSize: 18 }, children: (contacts[id]?.name ?? 'Member').slice(0, 1) }) }), _jsx(Text, { style: { flex: 1, color: c.foreground, fontSize: 16 }, children: contacts[id]?.name ?? uiText("Member") }), _jsx(MessageIcon, { name: chosen(id) ? 'checkmark-circle' : 'ellipse-outline', color: chosen(id) ? accent : c.secondary, size: 24 })] }), ListFooterComponent: _jsxs(View, { style: { gap: 12, paddingTop: 12 }, children: [loading && _jsx(ActivityIndicator, { accessibilityLabel: uiText("Loading group members"), color: accent }), next && _jsx(Pressable, { accessibilityRole: "button", disabled: loading || busy, onPress: () => void load(true), style: { minHeight: 44, justifyContent: 'center' }, children: _jsx(Text, { style: { color: accent }, children: uiText("Load more members") }) }), !people.length && !loading && _jsx(Text, { style: { color: c.secondary }, children: query ? uiText("No matching contacts.") : uiText("Your app has not supplied any contacts to invite.") }), _jsxs(Text, { style: { color: c.secondary, fontSize: 13, lineHeight: 19 }, children: [uiText("Only the group owner can change the name or members."), groups?.historyForNewMembers === 'all' ? uiText("New members can see retained group history.") : uiText("New members see messages sent after they join.")] }), !!error && _jsx(Text, { accessibilityRole: "alert", style: { color: c.foreground, fontSize: 15 }, children: error })] }) }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: editing ? uiText("Save group") : uiText("Create group"), disabled: !canSave, onPress: () => void save(), style: { minHeight: 48, margin: 8, borderRadius: 12, backgroundColor: accent, alignItems: 'center', justifyContent: 'center', opacity: canSave ? 1 : .4 }, children: busy ? _jsx(ActivityIndicator, { color: messagingContrastInk(accent) }) : _jsx(Text, { style: { color: messagingContrastInk(accent), fontSize: 17, fontWeight: '600' }, children: editing ? uiText("Save") : uiText("Create group") }) })] });
|
|
101
104
|
}
|
package/dist/header-calls.js
CHANGED
|
@@ -4,9 +4,10 @@ import { useRobonoLocale } from './localization.js';
|
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { Keyboard, Linking, Platform, Pressable, View } from 'react-native';
|
|
6
6
|
import { MessageIcon } from './icons.js';
|
|
7
|
-
import { MessagingPopup } from './popup.js';
|
|
7
|
+
import { MessagingPopup, useMessagingPopupColors } from './popup.js';
|
|
8
8
|
/** Matches Messenger: video is separate; the phone button chooses internet/carrier. */
|
|
9
9
|
export function MessagingHeaderCalls({ actions, name, group, color }) {
|
|
10
|
+
const c = useMessagingPopupColors(undefined, 'callChoice');
|
|
10
11
|
const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
|
|
11
12
|
const [visible, setVisible] = useState(false), [error, setError] = useState('');
|
|
12
13
|
const pending = useRef(null), latest = useRef(actions);
|
|
@@ -41,9 +42,9 @@ export function MessagingHeaderCalls({ actions, name, group, color }) {
|
|
|
41
42
|
useEffect(() => { pending.current = null; setVisible(false); setError(''); }, [name, group]);
|
|
42
43
|
const choose = (kind) => { pending.current = kind; setVisible(false); };
|
|
43
44
|
const button = (label, icon, press) => _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText(label), onPress: press, style: { width: icon === 'video' ? 42 : 44, height: icon === 'video' ? 42 : 44, alignItems: 'center', justifyContent: 'center' }, children: _jsx(MessageIcon, { name: icon, size: 23, color: color }) });
|
|
44
|
-
const row = (kind, label, detail) => _jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText(label), onPress: () => choose(kind), style: ({ pressed }) => ({ flexDirection: 'row', alignItems: 'center', gap: 16, minHeight: 80, padding: 12, borderRadius: 18, backgroundColor: pressed ?
|
|
45
|
+
const row = (kind, label, detail) => _jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText(label), onPress: () => choose(kind), style: ({ pressed }) => ({ flexDirection: 'row', alignItems: 'center', gap: 16, minHeight: 80, padding: 12, borderRadius: 18, backgroundColor: pressed ? c.incoming : 'transparent' }), children: [_jsx(View, { style: { width: 48, height: 48, borderRadius: 24, backgroundColor: c.incoming, alignItems: 'center', justifyContent: 'center' }, children: _jsx(MessageIcon, { name: kind === 'phone' ? 'phone-portrait-outline' : 'phone', color: c.foreground, size: 24 }) }), _jsxs(View, { style: { flex: 1, gap: 4 }, children: [_jsx(Text, { style: { color: c.foreground, fontSize: 18, fontWeight: '600' }, children: uiText(label) }), _jsx(Text, { style: { color: c.secondary, fontSize: 15 }, children: uiText(detail) })] })] });
|
|
45
46
|
return _jsxs(_Fragment, { children: [actions?.video && button(actions.videoLabel ?? 'Video call', 'video', () => void invoke('video')), (actions?.voice || validPhone) && button(uiText('Call {name}', { name }), 'phone', () => { if (!validPhone) {
|
|
46
47
|
void invoke('voice');
|
|
47
48
|
return;
|
|
48
|
-
} Keyboard.dismiss(); setVisible(true); }), _jsx(MessagingPopup, { visible: visible || !!error, compact: true, title: uiText('Call {name}', { name }), background: "#111111", onDismiss: dismissed, onClose: () => { pending.current = null; setVisible(false); setError(''); }, children: error ? _jsx(Text, { accessibilityRole: "alert", style: { color:
|
|
49
|
+
} Keyboard.dismiss(); setVisible(true); }), _jsx(MessagingPopup, { screen: "callChoice", visible: visible || !!error, compact: true, title: uiText('Call {name}', { name }), background: "#111111", onDismiss: dismissed, onClose: () => { pending.current = null; setVisible(false); setError(''); }, children: error ? _jsx(Text, { accessibilityRole: "alert", style: { color: c.foreground, fontSize: 16, paddingTop: 12 }, children: error }) : _jsxs(_Fragment, { children: [actions?.voice && row('voice', actions.voiceLabel ?? 'Internet call', 'Wi-Fi or mobile data'), validPhone && row('phone', 'Phone call', validPhone)] }) })] });
|
|
49
50
|
}
|
package/dist/inbox-search.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useInboxScroll } from './inbox-view.js';
|
|
3
|
-
import { Text } from './typography.js';
|
|
3
|
+
import { Text, MessagingTypography } from './typography.js';
|
|
4
|
+
import { messagingScreenAppearance } from '@robono/messaging';
|
|
4
5
|
import { useRobonoLocale } from './localization.js';
|
|
5
6
|
import { useEffect, useRef, useState } from 'react';
|
|
6
7
|
import { ActivityIndicator, FlatList, Pressable, View } from 'react-native';
|
|
7
8
|
/** Main-screen search covers retained messages beyond the current inbox page. */
|
|
8
9
|
export function InboxMessageSearch({ client, query, appearance, name, chats, onSelect, viewMemory, directoryHeader }) {
|
|
9
10
|
const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
|
|
10
|
-
const c = appearance.colors, [rows, setRows] = useState([]), [next, setNext] = useState(null), [busy, setBusy] = useState(true), [error, setError] = useState('');
|
|
11
|
+
const c = messagingScreenAppearance(appearance, 'inboxSearch').colors, [rows, setRows] = useState([]), [next, setNext] = useState(null), [busy, setBusy] = useState(true), [error, setError] = useState('');
|
|
11
12
|
const scroll = useInboxScroll(viewMemory, 'search:' + query, rows.length > 0 && !busy, !next);
|
|
12
13
|
const controller = useRef(null), generation = useRef(0);
|
|
13
14
|
async function search(more = false) {
|
|
@@ -61,5 +62,5 @@ export function InboxMessageSearch({ client, query, appearance, name, chats, onS
|
|
|
61
62
|
const timer = setTimeout(() => void search(), 300);
|
|
62
63
|
return () => { clearTimeout(timer); ++generation.current; controller.current?.abort(); };
|
|
63
64
|
}, [client, query]);
|
|
64
|
-
return _jsx(FlatList, { ...scroll, testID: "messaging-inbox-search-results", style: { flex: 1 }, data: rows, keyExtractor: row => row.message.conversationId + ':' + row.message.id, keyboardShouldPersistTaps: "handled", ListHeaderComponent: _jsxs(View, { children: [directoryHeader, chats.length > 0 && _jsxs(_Fragment, { children: [_jsx(Text, { style: { paddingHorizontal: 16, paddingVertical: 8, color: c.secondary, fontSize: 14, fontWeight: '600' }, children: uiText("Chats") }), chats.map(chat => _jsx(Pressable, { accessibilityRole: "button", onPress: () => onSelect(chat), style: { minHeight: 48, paddingHorizontal: 16, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.foreground, fontSize: 16 }, children: name(chat) }) }, chat.id))] }), _jsx(Text, { style: { paddingHorizontal: 16, paddingVertical: 12, color: c.secondary, fontSize: 14, fontWeight: '600' }, children: uiText("Messages") })] }), ListEmptyComponent: !busy && !error ? _jsx(Text, { style: { padding: 16, color: c.secondary }, children: uiText("No matching messages.") }) : null, renderItem: ({ item }) => _jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Message in {value1}: {value2}", { value1: name(item.conversation), value2: item.message.text ?? '' }), onPress: () => onSelect(item.conversation, item.message.id), style: { paddingHorizontal: 16, paddingVertical: 12, gap: 5, borderBottomWidth: 1, borderBottomColor: c.foreground + '16' }, children: [_jsxs(View, { style: { flexDirection: 'row', gap: 8 }, children: [_jsx(Text, { numberOfLines: 1, style: { flex: 1, fontSize: 16, fontWeight: '600', color: c.foreground }, children: name(item.conversation) }), _jsx(Text, { style: { fontSize: 12, color: c.secondary }, children: new Date(item.message.createdAt).toLocaleDateString(uiLocale) })] }), _jsx(Text, { numberOfLines: 3, style: { fontSize: 15, lineHeight: 21, color: c.secondary }, children: item.message.text })] }), ListFooterComponent: _jsxs(View, { children: [busy && _jsx(ActivityIndicator, { accessibilityLabel: uiText("Searching all messages"), color: c.accent, style: { padding: 16 } }), !!error && _jsxs(_Fragment, { children: [_jsx(Text, { accessibilityRole: "alert", style: { padding: 16, color: c.foreground }, children: error }), _jsx(Pressable, { accessibilityRole: "button", onPress: () => void search(rows.length > 0 && !!next), style: { minHeight: 44, paddingHorizontal: 16, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent }, children: uiText("Try again") }) })] }), next && !busy && !error && _jsx(Pressable, { accessibilityRole: "button", onPress: () => void search(true), style: { minHeight: 48, alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent }, children: uiText("More results") }) })] }) });
|
|
65
|
+
return _jsx(MessagingTypography, { appearance: appearance, screen: "inboxSearch", children: _jsx(FlatList, { ...scroll, testID: "messaging-inbox-search-results", style: { flex: 1, backgroundColor: c.background }, data: rows, keyExtractor: row => row.message.conversationId + ':' + row.message.id, keyboardShouldPersistTaps: "handled", ListHeaderComponent: _jsxs(View, { children: [directoryHeader, chats.length > 0 && _jsxs(_Fragment, { children: [_jsx(Text, { style: { paddingHorizontal: 16, paddingVertical: 8, color: c.secondary, fontSize: 14, fontWeight: '600' }, children: uiText("Chats") }), chats.map(chat => _jsx(Pressable, { accessibilityRole: "button", onPress: () => onSelect(chat), style: { minHeight: 48, paddingHorizontal: 16, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.foreground, fontSize: 16 }, children: name(chat) }) }, chat.id))] }), _jsx(Text, { style: { paddingHorizontal: 16, paddingVertical: 12, color: c.secondary, fontSize: 14, fontWeight: '600' }, children: uiText("Messages") })] }), ListEmptyComponent: !busy && !error ? _jsx(Text, { style: { padding: 16, color: c.secondary }, children: uiText("No matching messages.") }) : null, renderItem: ({ item }) => _jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Message in {value1}: {value2}", { value1: name(item.conversation), value2: item.message.text ?? '' }), onPress: () => onSelect(item.conversation, item.message.id), style: { paddingHorizontal: 16, paddingVertical: 12, gap: 5, borderBottomWidth: 1, borderBottomColor: c.foreground + '16' }, children: [_jsxs(View, { style: { flexDirection: 'row', gap: 8 }, children: [_jsx(Text, { numberOfLines: 1, style: { flex: 1, fontSize: 16, fontWeight: '600', color: c.foreground }, children: name(item.conversation) }), _jsx(Text, { style: { fontSize: 12, color: c.secondary }, children: new Date(item.message.createdAt).toLocaleDateString(uiLocale) })] }), _jsx(Text, { numberOfLines: 3, style: { fontSize: 15, lineHeight: 21, color: c.secondary }, children: item.message.text })] }), ListFooterComponent: _jsxs(View, { children: [busy && _jsx(ActivityIndicator, { accessibilityLabel: uiText("Searching all messages"), color: c.accent, style: { padding: 16 } }), !!error && _jsxs(_Fragment, { children: [_jsx(Text, { accessibilityRole: "alert", style: { padding: 16, color: c.foreground }, children: error }), _jsx(Pressable, { accessibilityRole: "button", onPress: () => void search(rows.length > 0 && !!next), style: { minHeight: 44, paddingHorizontal: 16, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent }, children: uiText("Try again") }) })] }), next && !busy && !error && _jsx(Pressable, { accessibilityRole: "button", onPress: () => void search(true), style: { minHeight: 48, alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent }, children: uiText("More results") }) })] }) }) });
|
|
65
66
|
}
|
package/dist/inbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { MessagingBrand } from './brand.js';
|
|
3
|
-
import { messagingFriendsColors } from '@robono/messaging';
|
|
3
|
+
import { messagingScreenAppearance, messagingContrastInk, messagingAvatarStyle, messagingFriendsColors, messagingMenuColors, messagingMenuLayout } from '@robono/messaging';
|
|
4
4
|
import { directoryWithoutChats, MessagingDirectoryRow } from './contact-directory.js';
|
|
5
5
|
import { createInboxViewMemory, useInboxScroll } from './inbox-view.js';
|
|
6
6
|
import { MessagingTypography } from './typography.js';
|
|
@@ -12,21 +12,23 @@ import { MessageIcon } from './icons.js';
|
|
|
12
12
|
import { useEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
13
13
|
import { AppState, FlatList, Image, Platform, Pressable, ScrollView, View } from 'react-native';
|
|
14
14
|
import { defaultMessagingSettings } from '@robono/messaging';
|
|
15
|
-
import { MessagingPopup, MessagingMenuSurface, MessagingPopupHeaderBoundary,
|
|
15
|
+
import { MessagingPopup, MessagingMenuSurface, MessagingPopupHeaderBoundary, useMessagingPopupColors, messagingPopupBackdrop } from './popup.js';
|
|
16
16
|
/** Compact Messenger chat rows: avatar, name, last message, time and unread badge. */
|
|
17
17
|
export function MessagingInbox({ client, userId, contacts = {}, appearance, active = true, onSelect, onDeleted, companyName, headerActions, searchText, selectedId, query: controlledQuery, onSearchChange, viewMemory, directory = [], onOpenDirectoryContact }) {
|
|
18
18
|
const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
|
|
19
|
-
const state = useSyncExternalStore(client.subscribe, client.getSnapshot, client.getSnapshot), design = appearance ?? state.appearance ?? defaultMessagingSettings().appearance, c = messagingFriendsColors(design), friends = design.screens?.friends;
|
|
19
|
+
const state = useSyncExternalStore(client.subscribe, client.getSnapshot, client.getSnapshot), design = messagingScreenAppearance(appearance ?? state.appearance ?? defaultMessagingSettings().appearance), c = messagingFriendsColors(design), friends = design.screens?.friends;
|
|
20
|
+
const messagingPopupColors = useMessagingPopupColors(design, 'alerts');
|
|
20
21
|
useEffect(() => { const update = (value) => { if (active && (value === null || value === 'active'))
|
|
21
22
|
client.start();
|
|
22
23
|
else
|
|
23
24
|
client.stop(); }; update(AppState.currentState); const sub = AppState.addEventListener('change', update); return () => { sub.remove(); client.stop(); }; }, [client, active]);
|
|
24
25
|
const ownMemory = useRef(createInboxViewMemory()), memory = viewMemory ?? ownMemory.current;
|
|
25
26
|
const [localQuery, setLocalQuery] = useState(memory.query);
|
|
26
|
-
const query = controlledQuery ?? localQuery;
|
|
27
|
+
const query = friends?.showSearch === false ? '' : controlledQuery ?? localQuery;
|
|
27
28
|
const setQuery = (value) => { memory.query = value; (onSearchChange ?? setLocalQuery)(value); };
|
|
28
29
|
const scroll = useInboxScroll(memory, 'chats:' + query.trim(), state.conversations.length > 0 && !state.loading, !state.hasMore);
|
|
29
30
|
const [selected, setSelected] = useState(null), [confirm, setConfirm] = useState(false), [busy, setBusy] = useState(false), [error, setError] = useState('');
|
|
31
|
+
const avatar = messagingAvatarStyle(friends?.avatarSize ?? 40, friends?.avatarShape), rowPadding = friends?.rowSpacing === 'compact' ? 6 : friends?.rowSpacing === 'relaxed' ? 16 : 10;
|
|
30
32
|
const title = (row) => row.contactId === userId ? uiText('Notes to self') : row.kind === 'group' ? row.name ?? 'Group' : contacts[row.contactId ?? '']?.name ?? row.contactId ?? 'Chat';
|
|
31
33
|
const [directorySelection, setDirectorySelection] = useState(null), [directoryBusy, setDirectoryBusy] = useState(false), [directoryError, setDirectoryError] = useState('');
|
|
32
34
|
const directoryRequest = useRef(null), directoryRef = useRef(directory);
|
|
@@ -109,7 +111,7 @@ export function MessagingInbox({ client, userId, contacts = {}, appearance, acti
|
|
|
109
111
|
} }
|
|
110
112
|
const preview = (row) => { const m = row.lastMessage; if (!m)
|
|
111
113
|
return 'No messages yet'; const text = m.kind === 'text' ? m.text ?? '' : ({ voice: 'Voice message', image: 'Photo', video: 'Video', document: 'Document', poll: 'Poll' }[m.kind] ?? 'Message'); return (m.senderId === userId ? 'You: ' : '') + text; };
|
|
112
|
-
return _jsx(MessagingTypography, { appearance: design, children: _jsxs(View, { style: { flex: 1, minHeight: 0, backgroundColor: c.background }, children: [_jsx(MessagingPopupHeaderBoundary, { children: _jsxs(View, { testID: "messaging-inbox-header", style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', backgroundColor: friends?.headerBackground ?? c.background, minHeight: 64, paddingHorizontal: 16,
|
|
114
|
+
return _jsx(MessagingTypography, { appearance: design, children: _jsxs(View, { style: { flex: 1, minHeight: 0, backgroundColor: c.background }, children: [_jsx(MessagingPopupHeaderBoundary, { children: _jsxs(View, { testID: "messaging-inbox-header", style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', backgroundColor: friends?.headerBackground ?? c.background, minHeight: friends?.headerSize === 'compact' ? 48 : friends?.headerSize === 'roomy' ? 80 : 64, paddingHorizontal: 16, paddingTop: 4, paddingBottom: 8, gap: 8 }, children: [_jsx(MessagingBrand, { appearance: design, companyName: companyName }), headerActions] }) }), friends?.showSearch !== false && _jsxs(View, { style: { margin: 12, marginTop: 8, flexDirection: 'row', alignItems: 'center', gap: 8, borderRadius: 10, paddingHorizontal: 10, backgroundColor: c.foreground + '0b' }, children: [_jsx(MessageIcon, { name: "search", size: 20, color: c.secondary }), _jsx(TextInput, { accessibilityLabel: uiText("Search chats"), placeholder: state.globalSearchAvailable ? uiText("Search chats and messages") : uiText("Search chats"), placeholderTextColor: c.secondary, value: query, onChangeText: setQuery, maxLength: 200, autoCapitalize: "none", autoCorrect: false, style: { flex: 1, minHeight: 44, color: c.foreground, fontSize: 16 } }), !!query && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Clear chat search"), onPress: () => setQuery(''), style: { width: 44, height: 44, alignItems: 'center', justifyContent: 'center' }, children: _jsx(MessageIcon, { name: "close", size: 20, color: c.secondary }) })] }), state.error && _jsxs(View, { style: { padding: 12 }, children: [_jsx(Text, { accessibilityRole: "alert", style: { color: c.foreground }, children: state.error }), _jsx(Pressable, { accessibilityRole: "button", onPress: () => void client.refresh().catch(() => { }), children: _jsx(Text, { style: { color: c.accent, paddingVertical: 8 }, children: uiText("Try again") }) })] }), query.trim() && state.globalSearchAvailable ? _jsx(InboxMessageSearch, { viewMemory: memory, client: client, query: query.trim(), appearance: { ...design, colors: c }, name: title, chats: state.conversations.filter(row => title(row).toLocaleLowerCase().includes(query.trim().toLocaleLowerCase())), onSelect: onSelect, directoryHeader: directoryRows.map(entry => _jsx(MessagingDirectoryRow, { contact: entry, appearance: design, onPress: () => void openDirectory(entry) }, entry.id)) }, userId) : _jsx(FlatList, { ...scroll, testID: "messaging-inbox-list", data: inboxRows, keyExtractor: row => row.kind === 'chat' ? 'chat:' + row.chat.id : 'directory:' + row.entry.id, contentContainerStyle: { flexGrow: 1 }, ItemSeparatorComponent: () => friends?.showDividers === false ? null : _jsx(View, { style: { height: 1, backgroundColor: c.foreground + '12', marginLeft: 64 } }), ListEmptyComponent: _jsx(Text, { style: { padding: 20, textAlign: 'center', color: c.secondary }, children: state.loading ? uiText("Loading chats…") : state.error ? '' : query ? uiText("No matching chats.") : uiText("No chats yet") }), ListFooterComponent: state.hasMore ? _jsx(Pressable, { accessibilityRole: "button", disabled: state.loading, onPress: () => void client.loadMore().catch(() => { }), children: _jsx(Text, { style: { padding: 12, textAlign: 'center', color: c.accent }, children: state.loading ? uiText("Loading…") : uiText("More chats") }) }) : null, renderItem: ({ item: row }) => {
|
|
113
115
|
if (row.kind === 'directory')
|
|
114
116
|
return _jsx(MessagingDirectoryRow, { contact: row.entry, appearance: design, onPress: () => void openDirectory(row.entry) });
|
|
115
117
|
const item = row.chat;
|
|
@@ -119,11 +121,12 @@ export function MessagingInbox({ client, userId, contacts = {}, appearance, acti
|
|
|
119
121
|
rows.current.set(item.id, node);
|
|
120
122
|
else
|
|
121
123
|
rows.current.delete(item.id); }, accessibilityRole: "button", accessibilityState: { selected: item.id === selectedId }, accessibilityLabel: item.unreadCount ? uiText('{name}, {count} unread', { name: title, count: uiNumber(item.unreadCount) }) : title, onPress: () => onSelect(item), onLongPress: () => openOptions(item), accessibilityActions: state.inboxActionsAvailable ? [{ name: 'showOptions', label: uiText("Chat options") }] : [], onAccessibilityAction: e => { if (e.nativeEvent.actionName === 'showOptions')
|
|
122
|
-
openOptions(item); }, ...(Platform.OS === 'web' ? { onContextMenu: (e) => { e.preventDefault(); openOptions(item); } } : {}), style: { flexDirection: 'row', alignItems: 'center', gap: 12, paddingHorizontal: 12, paddingVertical:
|
|
123
|
-
} }), directorySelection && _jsxs(MessagingPopup, { compact: true, title: directorySelection.name, background: c.background, foreground: c.foreground, onClose: cancelDirectory, children: [_jsx(Text, { accessibilityRole: directoryError ? 'alert' : undefined, style: { color: messagingPopupColors.foreground, fontSize: 16, lineHeight: 23, paddingVertical: 12 }, children: directoryBusy ? uiText('Opening chat…') : directoryError || directorySelection.detail }), !!directoryError && directorySelection.available && _jsx(Pressable, { accessibilityRole: "button", onPress: () => void openDirectory(directorySelection), style: { minHeight: 44, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent }, children: uiText('Try again') }) })] }), selected && _jsxs(_Fragment, { children: [_jsx(MessagingMenuSurface, { visible: menuVisible, onDismiss: dismissed, onClose: () => { if (!busy)
|
|
124
|
+
openOptions(item); }, ...(Platform.OS === 'web' ? { onContextMenu: (e) => { e.preventDefault(); openOptions(item); } } : {}), style: { flexDirection: 'row', alignItems: 'center', gap: 12, paddingHorizontal: 12, paddingVertical: rowPadding, minHeight: Math.max(44, avatar.height + rowPadding * 2), backgroundColor: item.id === selectedId ? c.accent + '15' : undefined }, children: [friends?.showAvatars !== false && (person?.avatarUrl ? _jsx(Image, { source: { uri: person.avatarUrl }, style: { ...avatar } }) : _jsx(View, { style: { ...avatar, backgroundColor: c.accent + '20', alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent, fontSize: 18, fontWeight: '700' }, children: title.slice(0, 1).toUpperCase() }) })), _jsxs(View, { style: { flex: 1, minWidth: 0 }, children: [_jsxs(Text, { numberOfLines: 1, style: { color: c.foreground, fontSize: friends?.nameSize ?? 16, fontWeight: '700' }, children: [title, item.muted ? uiText(" · Muted") : ''] }), friends?.showPreview !== false && _jsx(Text, { numberOfLines: friends?.previewLines ?? 1, style: { color: c.secondary, marginTop: 3, fontSize: friends?.previewSize ?? 14 }, children: preview(item) })] }), _jsxs(View, { style: { alignItems: 'flex-end', gap: 4 }, children: [friends?.showTime !== false && _jsx(Text, { style: { color: item.unreadCount ? c.accent : c.secondary, fontSize: 12 }, children: date ? date.toDateString() === new Date().toDateString() ? date.toLocaleTimeString(uiLocale, { hour: 'numeric', minute: '2-digit' }) : date.toLocaleDateString(uiLocale, { month: 'short', day: 'numeric' }) : '' }), friends?.showUnread !== false && item.unreadCount > 0 && _jsx(View, { style: { minWidth: friends?.unreadStyle === 'dot' ? 10 : 20, height: friends?.unreadStyle === 'dot' ? 10 : 20, borderRadius: 10, borderWidth: 1.5, borderColor: c.accent, backgroundColor: friends?.unreadStyle === 'filled' || friends?.unreadStyle === 'dot' ? c.accent : undefined, alignItems: 'center', justifyContent: 'center', paddingHorizontal: friends?.unreadStyle === 'dot' ? 0 : 5 }, children: friends?.unreadStyle !== 'dot' && _jsx(Text, { style: { color: friends?.unreadStyle === 'filled' ? messagingContrastInk(c.accent) : c.accent, fontSize: 10, fontWeight: '900' }, children: item.unreadCount > 99 ? '99+' : item.unreadCount }) })] })] });
|
|
125
|
+
} }), directorySelection && _jsxs(MessagingPopup, { screen: "profile", compact: true, title: directorySelection.name, background: c.background, foreground: c.foreground, onClose: cancelDirectory, children: [_jsx(Text, { accessibilityRole: directoryError ? 'alert' : undefined, style: { color: messagingPopupColors.foreground, fontSize: 16, lineHeight: 23, paddingVertical: 12 }, children: directoryBusy ? uiText('Opening chat…') : directoryError || directorySelection.detail }), !!directoryError && directorySelection.available && _jsx(Pressable, { accessibilityRole: "button", onPress: () => void openDirectory(directorySelection), style: { minHeight: 44, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent }, children: uiText('Try again') }) })] }), selected && _jsxs(_Fragment, { children: [_jsx(MessagingMenuSurface, { visible: menuVisible, onDismiss: dismissed, onClose: () => { if (!busy)
|
|
124
126
|
setSelected(null); }, children: rect => {
|
|
127
|
+
const palette = messagingMenuColors(design, 'friends'), menuLayout = messagingMenuLayout(design.menus?.friends);
|
|
125
128
|
const width = Math.min(218, rect.width - 24), top = Math.max(12, Math.min(anchor.y - rect.top, rect.height - 124));
|
|
126
129
|
return _jsxs(View, { style: { flex: 1 }, children: [_jsx(Pressable, { accessibilityLabel: uiText("Close chat options"), onPress: () => { if (!busy)
|
|
127
|
-
setSelected(null); }, style: { position: 'absolute', inset: 0, backgroundColor: messagingPopupBackdrop } }), _jsx(View, { testID: "messaging-inbox-dropdown", style: { position: 'absolute', left: Math.max(12, Math.min(anchor.x - rect.left, rect.width - width - 12)), top, width, maxHeight: Math.max(44, rect.height - top - 12), borderRadius:
|
|
128
|
-
} }), confirm && _jsxs(MessagingPopup, { visible: confirmVisible, onDismiss: dismissed, compact: true, title: uiText('Delete chat with {name}?', { name: title(selected) }), foreground: c.foreground, closeLabel: uiText("Close delete chat"), closeDisabled: busy, background: c.background, onClose: returnToMenu, children: [_jsx(Text, { style: { color: messagingPopupColors.secondary, marginTop: 8 }, children: uiText("This removes the chat and its history from your view. Other people keep their copy. New messages can bring the chat back.") }), !!error && _jsx(Text, { accessibilityRole: "alert", style: { color: messagingPopupColors.foreground, paddingVertical: 8 }, children: error }), _jsxs(View, { style: { flexDirection: 'row', gap: 8, marginTop: 12 }, children: [_jsx(Pressable, { accessibilityRole: "button", disabled: busy, onPress: returnToMenu, style: { flex: 1, minHeight: 44, borderRadius: 12, backgroundColor: messagingPopupColors.incoming, alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { color: messagingPopupColors.foreground, fontSize: 16, fontWeight: '600' }, children: uiText("Cancel") }) }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Confirm delete chat"), disabled: busy, onPress: () => void act(true), style: { flex: 1, minHeight: 44, borderRadius: 12, backgroundColor: '#b72d34', alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { color: '#ffffff', fontSize: 16, fontWeight: '600' }, children: uiText("Delete") }) })] })] })] })] }) });
|
|
130
|
+
setSelected(null); }, style: { position: 'absolute', inset: 0, backgroundColor: messagingPopupBackdrop } }), _jsx(View, { testID: "messaging-inbox-dropdown", style: { position: 'absolute', left: Math.max(12, Math.min(anchor.x - rect.left, rect.width - width - 12)), top, width, maxHeight: Math.max(44, rect.height - top - 12), borderRadius: menuLayout.radius, borderWidth: .5, borderColor: palette.foreground + '22', backgroundColor: palette.background, paddingVertical: 4, overflow: 'hidden' }, children: _jsxs(ScrollView, { keyboardShouldPersistTaps: "handled", children: [_jsx(MessageMenuRow, { scope: "friends", icon: selected.muted ? 'notifications-outline' : 'notifications-off-outline', label: selected.muted ? uiText("Unmute") : uiText("Mute"), disabled: busy, onPress: () => void act(false) }), _jsx(MessageMenuRow, { scope: "friends", icon: "trash-outline", label: uiText("Delete chat"), danger: true, divider: true, disabled: busy, onPress: showConfirmation }), !!error && _jsx(Text, { accessibilityRole: "alert", style: { color: '#ffffff', padding: 12 }, children: error })] }) })] });
|
|
131
|
+
} }), confirm && _jsxs(MessagingPopup, { screen: "alerts", visible: confirmVisible, onDismiss: dismissed, compact: true, title: uiText('Delete chat with {name}?', { name: title(selected) }), foreground: c.foreground, closeLabel: uiText("Close delete chat"), closeDisabled: busy, background: c.background, onClose: returnToMenu, children: [_jsx(Text, { style: { color: messagingPopupColors.secondary, marginTop: 8 }, children: uiText("This removes the chat and its history from your view. Other people keep their copy. New messages can bring the chat back.") }), !!error && _jsx(Text, { accessibilityRole: "alert", style: { color: messagingPopupColors.foreground, paddingVertical: 8 }, children: error }), _jsxs(View, { style: { flexDirection: 'row', gap: 8, marginTop: 12 }, children: [_jsx(Pressable, { accessibilityRole: "button", disabled: busy, onPress: returnToMenu, style: { flex: 1, minHeight: 44, borderRadius: 12, backgroundColor: messagingPopupColors.incoming, alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { color: messagingPopupColors.foreground, fontSize: 16, fontWeight: '600' }, children: uiText("Cancel") }) }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Confirm delete chat"), disabled: busy, onPress: () => void act(true), style: { flex: 1, minHeight: 44, borderRadius: 12, backgroundColor: '#b72d34', alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { color: '#ffffff', fontSize: 16, fontWeight: '600' }, children: uiText("Delete") }) })] })] })] })] }) });
|
|
129
132
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type ConversationActions } from './chat-options.js';
|
|
2
|
+
export type { ConversationActions } from './chat-options.js';
|
|
1
3
|
import { type MessagingHeaderOptions } from './conversation-selector.js';
|
|
2
4
|
export type { MessagingHeaderOptions, MessagingConversationChoice } from './conversation-selector.js';
|
|
3
5
|
import { type AttachmentPreviewLoader } from './attachment-preview.js';
|
|
@@ -64,6 +66,8 @@ export interface AttachmentChoice {
|
|
|
64
66
|
durationMs?: number;
|
|
65
67
|
}
|
|
66
68
|
export interface MessagingScreenProps {
|
|
69
|
+
/** Automatically supplied by ExpoMessenger/WebMessenger; single-chat hosts can supply their own authorized actions. */
|
|
70
|
+
conversationActions?: ConversationActions;
|
|
67
71
|
/** Standard header configuration; no replacement Header component required. */
|
|
68
72
|
header?: MessagingHeaderOptions;
|
|
69
73
|
conversationMode?: "messenger" | "walkie-talkie";
|
|
@@ -169,6 +173,7 @@ export interface MessagingContext extends MessagingScreenProps {
|
|
|
169
173
|
openDiscussion: (threadRoot?: string) => void;
|
|
170
174
|
extrasState: MessagingExtrasState | null;
|
|
171
175
|
design: MessagingAppearance;
|
|
176
|
+
formatMessageTime: (value: string) => string;
|
|
172
177
|
reply: MessagingMessage | null;
|
|
173
178
|
editing: MessagingMessage | null;
|
|
174
179
|
setEditing: (message: MessagingMessage | null) => void;
|
|
@@ -186,6 +191,10 @@ export declare function useMessagingUI(): MessagingContext;
|
|
|
186
191
|
export declare function MessagingProvider(props: MessagingScreenProps & {
|
|
187
192
|
children: React.ReactNode;
|
|
188
193
|
}): React.JSX.Element;
|
|
194
|
+
export declare function GroupDiscussion({ threadRoot, onClose }: {
|
|
195
|
+
threadRoot?: string;
|
|
196
|
+
onClose: () => void;
|
|
197
|
+
}): React.JSX.Element;
|
|
189
198
|
export declare function messagingHeaderColors(design: MessagingAppearance, group: boolean): {
|
|
190
199
|
background: string;
|
|
191
200
|
foreground: string;
|
|
@@ -193,12 +202,17 @@ export declare function messagingHeaderColors(design: MessagingAppearance, group
|
|
|
193
202
|
export declare function MessagingHeader({ children }?: {
|
|
194
203
|
children?: ReactNode;
|
|
195
204
|
}): React.JSX.Element;
|
|
196
|
-
|
|
205
|
+
type BubbleProps = {
|
|
197
206
|
message: MessagingMessage;
|
|
198
207
|
pendingStatus?: 'sending' | 'queued' | 'failed';
|
|
199
208
|
previousMessage?: MessagingMessage;
|
|
200
209
|
nextMessage?: MessagingMessage;
|
|
201
|
-
}
|
|
210
|
+
};
|
|
211
|
+
export declare function MessagingBubble(props: BubbleProps): React.JSX.Element;
|
|
212
|
+
export declare function MessageDeletion({ messages, onClose }: {
|
|
213
|
+
messages: MessagingMessage[];
|
|
214
|
+
onClose: () => void;
|
|
215
|
+
}): React.JSX.Element | null;
|
|
202
216
|
export declare function MessagingList(): React.JSX.Element;
|
|
203
217
|
export declare function MessagingComposer(): React.JSX.Element;
|
|
204
218
|
/** Account navigation. Mount in the inbox/app toolbar, never in a contact menu. */
|