@robono/messaging-react-native 0.26.3 → 0.27.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/README.md +18 -1
- package/SBOM.spdx.json +1696 -616
- package/app.plugin.cjs +4 -0
- package/dist/bubble-design.d.ts +1 -0
- package/dist/bubble-design.js +1 -0
- package/dist/call-message-decoration.d.ts +15 -0
- package/dist/call-message-decoration.js +23 -0
- package/dist/calling-timeline.d.ts +40 -0
- package/dist/calling-timeline.js +79 -0
- package/dist/calling.d.ts +4 -1
- package/dist/calling.js +8 -5
- package/dist/expo-connected-calling.d.ts +4 -0
- package/dist/expo-connected-calling.js +3 -1
- package/dist/expo-messenger.d.ts +10 -0
- package/dist/expo-messenger.js +7 -1
- package/dist/expo-reviews.js +1 -1
- package/dist/expo-screen.d.ts +32 -0
- package/dist/expo-screen.js +93 -49
- package/dist/expo-thumbnails.js +2 -2
- package/dist/expo-video-orientation.d.ts +7 -0
- package/dist/expo-video-orientation.js +14 -0
- package/dist/expo-video-thumbnail.d.ts +6 -0
- package/dist/expo-video-thumbnail.js +30 -0
- package/dist/expo-voicemail-recorder.d.ts +18 -0
- package/dist/expo-voicemail-recorder.js +214 -0
- package/dist/expo-voicemail-storage.d.ts +10 -0
- package/dist/expo-voicemail-storage.js +81 -0
- package/dist/expo-voicemail-video.d.ts +15 -0
- package/dist/expo-voicemail-video.js +44 -0
- package/dist/expo-voicemail.d.ts +34 -0
- package/dist/expo-voicemail.js +110 -0
- package/dist/expo.d.ts +3 -0
- package/dist/expo.js +3 -0
- package/dist/header-action-group.d.ts +11 -0
- package/dist/header-action-group.js +7 -0
- package/dist/header-calls.js +2 -1
- package/dist/history-anchor.d.ts +29 -0
- package/dist/history-anchor.js +74 -0
- package/dist/history-follow.d.ts +18 -0
- package/dist/history-follow.js +35 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +94 -74
- package/dist/message-time.d.ts +7 -0
- package/dist/message-time.js +17 -0
- package/dist/messenger-video-view.d.ts +4 -1
- package/dist/messenger-video-view.js +15 -4
- package/dist/recording-notice.d.ts +5 -0
- package/dist/recording-notice.js +13 -0
- package/dist/use-quote-gesture.d.ts +1 -0
- package/dist/use-quote-gesture.js +1 -0
- package/dist/video-message-badge.d.ts +7 -0
- package/dist/video-message-badge.js +8 -0
- package/dist/video-orientation.d.ts +13 -0
- package/dist/video-orientation.js +58 -0
- package/dist/voice-composer.d.ts +3 -1
- package/dist/voice-composer.js +7 -6
- package/dist/voicemail-flow.d.ts +60 -0
- package/dist/voicemail-flow.js +156 -0
- package/dist/voicemail-media.d.ts +19 -0
- package/dist/voicemail-media.js +45 -0
- package/dist/voicemail-message.d.ts +41 -0
- package/dist/voicemail-message.js +48 -0
- package/dist/voicemail-prompts.d.ts +4 -0
- package/dist/voicemail-prompts.js +3 -0
- package/dist/voicemail-recording.d.ts +15 -0
- package/dist/voicemail-recording.js +46 -0
- package/dist/voicemail-session.d.ts +19 -0
- package/dist/voicemail-session.js +48 -0
- package/dist/voicemail.d.ts +179 -0
- package/dist/voicemail.js +234 -0
- package/package.json +9 -5
- package/plugin/prepare-native.cjs +1 -0
- package/plugin/video-display-mirror.cjs +66 -0
- package/setup.plugin.cjs +1 -0
package/app.plugin.cjs
CHANGED
|
@@ -23,6 +23,10 @@ module.exports=createRunOncePlugin((config,options={})=>{
|
|
|
23
23
|
}
|
|
24
24
|
return value;
|
|
25
25
|
});
|
|
26
|
+
config=withDangerousMod(config,['android',async value=>{
|
|
27
|
+
require('./plugin/prepare-native.cjs').prepareNativeDependencies(value.modRequest.projectRoot,options);
|
|
28
|
+
return value;
|
|
29
|
+
}]);
|
|
26
30
|
return withDangerousMod(config,['ios',async value=>{
|
|
27
31
|
require('./plugin/prepare-native.cjs').prepareNativeDependencies(value.modRequest.projectRoot,options);
|
|
28
32
|
return value;
|
package/dist/bubble-design.d.ts
CHANGED
package/dist/bubble-design.js
CHANGED
|
@@ -11,3 +11,4 @@ export function bubbleDelivery(message, pending, receipts, appearance) {
|
|
|
11
11
|
const color = phase === 'failed' ? '#c94040' : phase === 'sent' ? colors?.sent ?? '#929292' : phase === 'delivered' ? colors?.delivered ?? '#ffffff' : colors?.consumed ?? appearance.colors.accent;
|
|
12
12
|
return { phase, color, style: colors?.style ?? 'bar' };
|
|
13
13
|
}
|
|
14
|
+
export function messageSpacing(appearance) { return appearance.presentation?.messageSpacing === 'compact' ? 4 : appearance.presentation?.messageSpacing === 'relaxed' ? 12 : 8; }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MessagingAppearance } from '@robono/messaging';
|
|
3
|
+
export declare function CallMessageTail({ appearance, mine }: {
|
|
4
|
+
appearance: MessagingAppearance;
|
|
5
|
+
mine: boolean;
|
|
6
|
+
}): React.JSX.Element | null;
|
|
7
|
+
/** Only show delivery when the recording has an actual recipient receipt. */
|
|
8
|
+
export declare function CallMessageStatus({ appearance, mine, delivered, consumed, label, placement }: {
|
|
9
|
+
appearance: MessagingAppearance;
|
|
10
|
+
mine: boolean;
|
|
11
|
+
delivered?: boolean;
|
|
12
|
+
consumed?: boolean;
|
|
13
|
+
label: string;
|
|
14
|
+
placement?: 'inside' | 'below';
|
|
15
|
+
}): React.JSX.Element | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { bubbleCorners } from './bubble-design.js';
|
|
4
|
+
import { DeliveryBar } from './delivery-bar.js';
|
|
5
|
+
import { MessageIcon } from './icons.js';
|
|
6
|
+
export function CallMessageTail({ appearance, mine }) {
|
|
7
|
+
if (appearance.presentation?.bubbleStyle !== 'top-tail')
|
|
8
|
+
return null;
|
|
9
|
+
return _jsx(View, { testID: "call-message-top-tail", pointerEvents: "none", style: { position: 'absolute', top: 0, ...(mine ? { right: -7 } : { left: -7 }), width: 0, height: 0, borderTopWidth: 10, borderTopColor: mine ? appearance.colors.outgoing : appearance.colors.incoming, ...(mine ? { borderRightWidth: 8, borderRightColor: 'transparent' } : { borderLeftWidth: 8, borderLeftColor: 'transparent' }) } });
|
|
10
|
+
}
|
|
11
|
+
/** Only show delivery when the recording has an actual recipient receipt. */
|
|
12
|
+
export function CallMessageStatus({ appearance, mine, delivered = false, consumed = false, label, placement = 'inside' }) {
|
|
13
|
+
if (!mine)
|
|
14
|
+
return null;
|
|
15
|
+
const style = appearance.messageStatus?.style ?? 'bar', position = appearance.messageStatus?.position ?? 'inside';
|
|
16
|
+
const color = consumed ? appearance.messageStatus?.consumed ?? appearance.colors.accent : delivered ? appearance.messageStatus?.delivered ?? appearance.colors.accent : appearance.messageStatus?.sent ?? '#929292';
|
|
17
|
+
if (style === 'circle')
|
|
18
|
+
return placement !== position ? null : _jsx(View, { testID: "call-message-status-circle", accessibilityLabel: label, style: { ...(placement === 'inside' ? { position: 'absolute', right: 5, top: 4, zIndex: 40 } : { alignSelf: 'flex-end', marginTop: 3 }), width: 12, height: 12, borderRadius: 6, borderWidth: 1, borderColor: color, backgroundColor: consumed || delivered ? color : 'transparent', alignItems: 'center', justifyContent: 'center' }, children: consumed && _jsx(MessageIcon, { name: "check", size: 8, color: appearance.colors.outgoingText }) });
|
|
19
|
+
if (placement !== 'inside')
|
|
20
|
+
return null;
|
|
21
|
+
const corners = bubbleCorners(appearance, mine), tail = appearance.presentation?.bubbleStyle === 'top-tail', top = tail ? 0 : corners.borderTopRightRadius, bottom = corners.borderBottomRightRadius;
|
|
22
|
+
return _jsx(View, { testID: "call-message-status-bar", accessibilityLabel: label, pointerEvents: "none", style: { position: 'absolute', top: tail ? 10 : 0, bottom: 0, right: 0, width: Math.max(top, bottom) + 2, zIndex: 40, overflow: 'hidden' }, children: _jsx(DeliveryBar, { color: color, topRadius: top, bottomRadius: bottom, roundedStart: tail }) });
|
|
23
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type CallHistoryItemProps } from '@robono/calling-react-native';
|
|
2
|
+
import { type MessagingAppearance } from '@robono/messaging';
|
|
3
|
+
import React, { type ReactNode } from 'react';
|
|
4
|
+
import type { CallHistoryEntry, CallHistoryPage } from '@robono/calling';
|
|
5
|
+
import type { VoicemailAPI, VoicemailRecord } from './voicemail.js';
|
|
6
|
+
/** Presentation-only rows; never enter ordinary message storage or receipts. */
|
|
7
|
+
export interface CallingTimelineEntry {
|
|
8
|
+
id: string;
|
|
9
|
+
createdAt: number;
|
|
10
|
+
content: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const CallingTimeline: React.Context<readonly CallingTimelineEntry[]>;
|
|
13
|
+
export declare function CallingTimelineProvider({ entries, children }: {
|
|
14
|
+
entries?: readonly CallingTimelineEntry[];
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
/** Both sources authenticate through calling, independently of messaging access. */
|
|
18
|
+
export declare function useCallingConversationHistory(client: {
|
|
19
|
+
history(query: {
|
|
20
|
+
connectionId: string;
|
|
21
|
+
after?: number;
|
|
22
|
+
limit: number;
|
|
23
|
+
}): Promise<CallHistoryPage>;
|
|
24
|
+
subscribe?(listener: () => void): () => void;
|
|
25
|
+
} | null, voicemail: VoicemailAPI | null, conversationId: string | undefined, revision?: number): {
|
|
26
|
+
key: string;
|
|
27
|
+
owner: typeof client;
|
|
28
|
+
calls: CallHistoryEntry[];
|
|
29
|
+
messages: VoicemailRecord[];
|
|
30
|
+
} | {
|
|
31
|
+
calls: never[];
|
|
32
|
+
messages: VoicemailRecord[];
|
|
33
|
+
};
|
|
34
|
+
/** Call rows follow the same owner-selected timestamp placement as media rows. */
|
|
35
|
+
export declare function MessengerCallHistoryItem({ entry, appearance, label, onCallBack }: {
|
|
36
|
+
entry: CallHistoryEntry;
|
|
37
|
+
appearance?: MessagingAppearance;
|
|
38
|
+
label?: CallHistoryItemProps['label'];
|
|
39
|
+
onCallBack?: () => void;
|
|
40
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CallMessageStatus } from './call-message-decoration.js';
|
|
3
|
+
import { Animated, View } from 'react-native';
|
|
4
|
+
import { Text, MessagingTypography } from './typography.js';
|
|
5
|
+
import { bubbleCorners, messageSpacing } from './bubble-design.js';
|
|
6
|
+
import { CallHistoryItem } from '@robono/calling-react-native';
|
|
7
|
+
import { describeCall } from '@robono/calling/history';
|
|
8
|
+
import { defaultMessagingSettings } from '@robono/messaging';
|
|
9
|
+
import { useMessagingAppearance } from './appearance-context.js';
|
|
10
|
+
import { useMessagingTimeFormat } from './message-time.js';
|
|
11
|
+
import { useQuoteGesture } from './use-quote-gesture.js';
|
|
12
|
+
import { createContext, useEffect, useState } from 'react';
|
|
13
|
+
export const CallingTimeline = createContext([]);
|
|
14
|
+
const empty = [];
|
|
15
|
+
export function CallingTimelineProvider({ entries = empty, children }) {
|
|
16
|
+
return _jsx(CallingTimeline.Provider, { value: entries, children: children });
|
|
17
|
+
}
|
|
18
|
+
/** Both sources authenticate through calling, independently of messaging access. */
|
|
19
|
+
export function useCallingConversationHistory(client, voicemail, conversationId, revision = 0) {
|
|
20
|
+
const [state, setState] = useState({ key: '', owner: null, calls: [], messages: [] });
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
let alive = true, working = false, again = false, cursor = 0;
|
|
23
|
+
const calls = new Map();
|
|
24
|
+
const cached = () => { if (alive && voicemail?.cachedList && conversationId)
|
|
25
|
+
setState(previous => ({ key: conversationId, owner: client, calls: previous.key === conversationId && previous.owner === client ? previous.calls : [], messages: voicemail.cachedList({ conversationId, includeSent: true, limit: 100 }) })); };
|
|
26
|
+
cached();
|
|
27
|
+
void voicemail?.restoreHistory?.().then(cached);
|
|
28
|
+
const stopHistory = voicemail?.subscribe?.(cached);
|
|
29
|
+
const load = async () => {
|
|
30
|
+
if (!client || !conversationId)
|
|
31
|
+
return;
|
|
32
|
+
if (working) {
|
|
33
|
+
again = true;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
working = true;
|
|
37
|
+
try {
|
|
38
|
+
const voicemailPage = voicemail?.list({ conversationId, includeSent: true, limit: 100 }).catch(() => null);
|
|
39
|
+
let page;
|
|
40
|
+
do {
|
|
41
|
+
page = await client.history({ connectionId: conversationId, after: cursor, limit: 100 });
|
|
42
|
+
if (!alive)
|
|
43
|
+
return;
|
|
44
|
+
for (const row of page.entries)
|
|
45
|
+
calls.set(row.id, row);
|
|
46
|
+
if (page.hasMore && page.nextCursor <= cursor)
|
|
47
|
+
throw Error('History cursor did not advance');
|
|
48
|
+
cursor = page.nextCursor;
|
|
49
|
+
} while (page.hasMore);
|
|
50
|
+
const messages = voicemail?.cachedList?.({ conversationId, includeSent: true, limit: 100 }) ?? [];
|
|
51
|
+
const result = await voicemailPage;
|
|
52
|
+
if (result)
|
|
53
|
+
messages.splice(0, messages.length, ...result.messages);
|
|
54
|
+
if (alive)
|
|
55
|
+
setState({ key: conversationId, owner: client, calls: [...calls.values()], messages });
|
|
56
|
+
}
|
|
57
|
+
catch { /* Retain already authorized history during a temporary transport failure. */ }
|
|
58
|
+
finally {
|
|
59
|
+
working = false;
|
|
60
|
+
if (alive && again) {
|
|
61
|
+
again = false;
|
|
62
|
+
void load();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
void load();
|
|
67
|
+
const timer = setInterval(() => void load(), 10000), stop = client?.subscribe?.(() => void load());
|
|
68
|
+
return () => { alive = false; clearInterval(timer); stop?.(); stopHistory?.(); };
|
|
69
|
+
}, [client, voicemail, conversationId, revision]);
|
|
70
|
+
return state.key === conversationId && state.owner === client ? state : { calls: [], messages: voicemail?.cachedList?.({ conversationId, includeSent: true, limit: 100 }) ?? [] };
|
|
71
|
+
}
|
|
72
|
+
/** Call rows follow the same owner-selected timestamp placement as media rows. */
|
|
73
|
+
export function MessengerCallHistoryItem({ entry, appearance, label = describeCall, onCallBack }) {
|
|
74
|
+
const design = useMessagingAppearance() ?? appearance ?? defaultMessagingSettings().appearance, c = design.colors;
|
|
75
|
+
const position = design.messageTime?.position ?? 'slide', mine = entry.role === 'caller', format = useMessagingTimeFormat(), time = format(new Date(entry.createdAt).toISOString());
|
|
76
|
+
const gesture = useQuoteGesture(position === 'slide', mine, undefined);
|
|
77
|
+
const topTail = design.presentation?.bubbleStyle === 'top-tail';
|
|
78
|
+
return _jsx(MessagingTypography, { appearance: design, children: _jsxs(View, { testID: "call-message-row", style: { alignSelf: 'stretch', marginTop: messageSpacing(design) }, children: [position === 'slide' && _jsx(Animated.View, { pointerEvents: "none", accessible: false, accessibilityElementsHidden: true, style: { position: 'absolute', top: 0, bottom: 0, ...(mine ? { left: 8 } : { right: 8 }), justifyContent: 'center', opacity: gesture.infoOpacity }, children: _jsx(Text, { testID: "call-time-slide", style: { color: c.secondary, fontSize: 10 }, children: time }) }), _jsxs(Animated.View, { ref: gesture.webRef, ...gesture.handlers, style: { alignItems: mine ? 'flex-end' : 'flex-start', transform: [{ translateX: gesture.offset }], ...gesture.webStyle }, children: [_jsx(CallHistoryItem, { TextComponent: Text, surfaceStyle: { ...bubbleCorners(design, mine), borderWidth: 0, ...(mine && design.messageStatus?.style === 'circle' && design.messageStatus.position !== 'below' ? { paddingRight: 23 } : {}), maxWidth: `${design.screens?.chat?.messageWidth ?? 88}%`, ...(topTail ? (mine ? { borderTopRightRadius: 0 } : { borderTopLeftRadius: 0 }) : {}) }, decoration: _jsxs(_Fragment, { children: [_jsx(CallMessageStatus, { appearance: design, mine: mine, label: "Call ended" }), topTail ? _jsx(View, { testID: "call-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' }) } }) : undefined] }), entry: entry, incomingColor: c.incoming, outgoingColor: c.outgoing, textColor: mine ? c.outgoingText : c.incomingText, secondaryColor: c.secondary, onCallBack: onCallBack, showTime: false, label: row => { const description = label(row); return position === 'inside' ? { ...description, detail: [description.detail, time].filter(Boolean).join(' · ') } : description; } }), _jsx(CallMessageStatus, { appearance: design, mine: mine, label: "Call ended", placement: "below" }), position === 'below' && _jsx(Text, { testID: "call-time-below", style: { color: c.secondary, fontSize: 10, marginTop: 2 }, children: time })] })] }) });
|
|
79
|
+
}
|
package/dist/calling.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CallingTimelineEntry } from './calling-timeline.js';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { type MessagingScreenProps } from './index.js';
|
|
3
4
|
export { UnansweredCallMessage } from './call-message.js';
|
|
@@ -9,7 +10,9 @@ export interface MessagingCallingScreenProps extends MessagingScreenProps {
|
|
|
9
10
|
callLabel?: string;
|
|
10
11
|
onVideoCall?: () => void;
|
|
11
12
|
videoCallLabel?: string;
|
|
13
|
+
voicemail?: React.ReactNode;
|
|
14
|
+
callTimeline?: readonly CallingTimelineEntry[];
|
|
12
15
|
unansweredCallId?: string;
|
|
13
16
|
onDismissCallMessage?: () => void;
|
|
14
17
|
}
|
|
15
|
-
export declare function MessagingCallingScreen({ onCall, onVideoCall, videoCallLabel, callLabel, components, unansweredCallId, onDismissCallMessage, ...props }: MessagingCallingScreenProps): React.JSX.Element;
|
|
18
|
+
export declare function MessagingCallingScreen({ onCall, onVideoCall, videoCallLabel, callLabel, components, unansweredCallId, onDismissCallMessage, voicemail, callTimeline, ...props }: MessagingCallingScreenProps): React.JSX.Element;
|
package/dist/calling.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CallingTimelineProvider } from './calling-timeline.js';
|
|
2
3
|
import { Text } from './typography.js';
|
|
3
4
|
import { useRobonoLocale } from './localization.js';
|
|
4
5
|
import { createContext, useContext, useMemo, useSyncExternalStore } from 'react';
|
|
5
|
-
import { Pressable, View } from 'react-native';
|
|
6
|
+
import { Pressable, ScrollView, View } from 'react-native';
|
|
6
7
|
import { RobonoIcon } from './visual/RobonoIcon.js';
|
|
7
8
|
import { MessagingScreen, MessagingProvider, MessagingHeader, MessagingComposer } from './index.js';
|
|
8
9
|
import { UnansweredCallMessage } from './call-message.js';
|
|
9
10
|
export { UnansweredCallMessage } from './call-message.js';
|
|
11
|
+
const VoicemailSlot = createContext(null);
|
|
10
12
|
const FollowUp = createContext(null);
|
|
11
|
-
function CallingMessageComposer() { const follow = useContext(FollowUp)
|
|
13
|
+
function CallingMessageComposer() { const follow = useContext(FollowUp), voicemail = useContext(VoicemailSlot); if (voicemail)
|
|
14
|
+
return _jsx(View, { style: { paddingHorizontal: 8, paddingVertical: 4 }, children: voicemail }); return _jsxs(_Fragment, { children: [follow && _jsx(UnansweredCallMessage, { callId: follow.callId, onDismiss: follow.dismiss }), _jsx(MessagingComposer, {})] }); }
|
|
12
15
|
/** Optional call entry in the standard message header. The host controls eligibility and admission. */
|
|
13
16
|
export function MessagingCallHeader() { return _jsx(MessagingHeader, {}); }
|
|
14
|
-
export function MessagingCallingScreen({ onCall, onVideoCall, videoCallLabel = 'Video call', callLabel = 'Robono call', components, unansweredCallId, onDismissCallMessage, ...props }) {
|
|
17
|
+
export function MessagingCallingScreen({ onCall, onVideoCall, videoCallLabel = 'Video call', callLabel = 'Robono call', components, unansweredCallId, onDismissCallMessage, voicemail, callTimeline, ...props }) {
|
|
15
18
|
const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
|
|
16
19
|
const state = useSyncExternalStore(props.client.subscribe, props.client.getSnapshot, props.client.getSnapshot);
|
|
17
20
|
const screenComponents = useMemo(() => ({ Header: MessagingCallHeader, Composer: CallingMessageComposer, ...components }), [components]);
|
|
18
21
|
const design = props.appearance ?? state.settings?.appearance;
|
|
19
22
|
const screenProps = { ...props, callActions: { ...props.callActions, ...(onCall ? { voice: onCall, voiceLabel: callLabel } : {}), ...(onVideoCall ? { video: onVideoCall, videoLabel: videoCallLabel } : {}) } };
|
|
20
23
|
const callingOnly = (onCall || onVideoCall) && design && state.settings && !state.settings.enabled;
|
|
21
|
-
const callingContent = design ? _jsxs(View, { style: [{ flex: 1, backgroundColor: design.colors.background }, props.style], children: [_jsx(MessagingCallHeader, {}), _jsxs(View, { style: { flex: 1, alignItems: 'center', justifyContent: 'center', gap: 24, padding: 24 }, children: [_jsx(Text, { style: { fontSize: 28, fontWeight: '600', color: design.colors.foreground }, children: props.contact.name }), onCall && _jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Start {value1}", { value1: callLabel.toLowerCase() }), onPress: onCall, style: { minHeight: 56, minWidth: 160, borderRadius: 28, backgroundColor: design.colors.incoming, alignItems: 'center', justifyContent: 'center', padding: 16, flexDirection: 'row', gap: 12 }, children: [_jsx(RobonoIcon, { name: "phone", size: 24, color: design.colors.incomingText }), _jsx(Text, { style: { fontSize: 18, color: design.colors.incomingText }, children: callLabel })] }), onVideoCall && _jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Start {value1}", { value1: videoCallLabel.toLowerCase() }), onPress: onVideoCall, style: { minHeight: 56, padding: 16, borderRadius: 28, backgroundColor: design.colors.incoming, flexDirection: 'row', alignItems: 'center', gap: 12 }, children: [_jsx(RobonoIcon, { name: "video", size: 24, color: design.colors.incomingText }), _jsx(Text, { style: { color: design.colors.incomingText, fontSize: 18 }, children: videoCallLabel })] })] })] }) : null;
|
|
22
|
-
return _jsx(FollowUp.Provider, { value: unansweredCallId && onDismissCallMessage ? { callId: unansweredCallId, dismiss: onDismissCallMessage } : null, children: callingOnly ? _jsx(MessagingProvider, { ...screenProps, children: props.renderLayout ? props.renderLayout(callingContent) : callingContent }) : _jsx(MessagingScreen, { ...screenProps, components: screenComponents }) });
|
|
24
|
+
const callingContent = design ? _jsxs(View, { style: [{ flex: 1, backgroundColor: design.colors.background }, props.style], children: [_jsx(MessagingCallHeader, {}), !!callTimeline?.length && _jsx(ScrollView, { style: { flex: 1 }, contentContainerStyle: { padding: 12, gap: 8 }, children: callTimeline.map(row => _jsx(View, { children: row.content }, row.id)) }), !voicemail && _jsxs(View, { style: { flex: 1, alignItems: 'center', justifyContent: 'center', gap: 24, padding: 24 }, children: [_jsx(Text, { style: { fontSize: 28, fontWeight: '600', color: design.colors.foreground }, children: props.contact.name }), onCall && _jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Start {value1}", { value1: callLabel.toLowerCase() }), onPress: onCall, style: { minHeight: 56, minWidth: 160, borderRadius: 28, backgroundColor: design.colors.incoming, alignItems: 'center', justifyContent: 'center', padding: 16, flexDirection: 'row', gap: 12 }, children: [_jsx(RobonoIcon, { name: "phone", size: 24, color: design.colors.incomingText }), _jsx(Text, { style: { fontSize: 18, color: design.colors.incomingText }, children: callLabel })] }), onVideoCall && _jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Start {value1}", { value1: videoCallLabel.toLowerCase() }), onPress: onVideoCall, style: { minHeight: 56, padding: 16, borderRadius: 28, backgroundColor: design.colors.incoming, flexDirection: 'row', alignItems: 'center', gap: 12 }, children: [_jsx(RobonoIcon, { name: "video", size: 24, color: design.colors.incomingText }), _jsx(Text, { style: { color: design.colors.incomingText, fontSize: 18 }, children: videoCallLabel })] })] }), voicemail] }) : null;
|
|
25
|
+
return _jsx(CallingTimelineProvider, { entries: callTimeline, children: _jsx(VoicemailSlot.Provider, { value: voicemail, children: _jsx(FollowUp.Provider, { value: unansweredCallId && onDismissCallMessage ? { callId: unansweredCallId, dismiss: onDismissCallMessage } : null, children: callingOnly ? _jsx(MessagingProvider, { ...screenProps, children: props.renderLayout ? props.renderLayout(callingContent) : callingContent }) : _jsx(MessagingScreen, { ...screenProps, components: screenComponents }) }) }) });
|
|
23
26
|
}
|
|
@@ -18,6 +18,10 @@ export declare function createExpoMessengerCalling(options: {
|
|
|
18
18
|
name: string;
|
|
19
19
|
avatarUrl?: string;
|
|
20
20
|
}>): void;
|
|
21
|
+
voicemail: import("@robono/calling/voicemail").VoicemailClient;
|
|
22
|
+
openVoicemailInbox(): void;
|
|
23
|
+
closeVoicemailInbox(): void;
|
|
24
|
+
dismissVoicemail(): void;
|
|
21
25
|
deviceCheck: {
|
|
22
26
|
getSnapshot: () => import("@robono/calling-react-native").CallDeviceCheckState;
|
|
23
27
|
subscribe(fn: () => void): () => void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ExpoVoicemailMailbox } from './expo-voicemail.js';
|
|
3
|
+
import { Modal, ScrollView } from 'react-native';
|
|
2
4
|
import { callDiagnosticsText, callRecordingText } from '@robono/calling-react-native';
|
|
3
5
|
import { Text } from './typography.js';
|
|
4
6
|
import { callingText } from '@robono/calling-react-native/appearance';
|
|
@@ -66,5 +68,5 @@ export function useExpoMessengerCalling(calling) {
|
|
|
66
68
|
}
|
|
67
69
|
export function ExpoMessengerCalls({ calling, state }) {
|
|
68
70
|
const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
|
|
69
|
-
return _jsxs(_Fragment, { children: [state.error && _jsxs(View, { style: { backgroundColor: '#171717', paddingHorizontal: 16, paddingVertical: 8, flexDirection: 'row', gap: 12, alignItems: 'center' }, children: [_jsx(Text, { accessibilityRole: "alert", style: { color: '#FAFAFA', flex: 1 }, children: state.error }), _jsx(Pressable, { accessibilityRole: "button", onPress: () => void calling?.start().catch(() => { }), style: { padding: 8 }, children: _jsx(Text, { style: { color: '#FF8A2C' }, children: uiText("Retry calls") }) })] }), state.direct && _jsx(NativeCallingOverlay, { controller: state.direct, recordingLabels: Object.fromEntries(Object.entries(callRecordingText).map(([key, value]) => [key, uiText(value)])), diagnostics: { labels: Object.fromEntries(Object.entries(callDiagnosticsText).map(([key, value]) => [key, uiText(value)])) }, appearance: state.appearance, labels: Object.fromEntries(Object.entries({ ...callingText, ...state.appearance?.labels }).map(([key, value]) => [key, uiText(value)])) }), state.group && _jsx(NativeGroupCallingOverlay, { controller: state.group, recordingLabels: Object.fromEntries(Object.entries(callRecordingText).map(([key, value]) => [key, uiText(value)])), diagnostics: { labels: Object.fromEntries(Object.entries(callDiagnosticsText).map(([key, value]) => [key, uiText(value)])) }, appearance: state.appearance, labels: Object.fromEntries(Object.entries({ ...callingText, ...state.appearance?.labels }).map(([key, value]) => [key, uiText(value)])) })] });
|
|
71
|
+
return _jsxs(_Fragment, { children: [calling && state.features.voicemailPresentation !== 'custom' && state.voicemailInbox && _jsx(Modal, { visible: true, animationType: "slide", onRequestClose: calling.closeVoicemailInbox, children: _jsxs(ScrollView, { contentContainerStyle: { paddingTop: 48, paddingBottom: 24 }, children: [_jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Close voicemail", onPress: calling.closeVoicemailInbox, style: { minHeight: 44, padding: 12 }, children: _jsx(Text, { children: uiText('Close') }) }), _jsx(ExpoVoicemailMailbox, { client: calling.voicemail, revision: state.voicemailRevision, name: sender => sender.userId })] }) }), state.error && _jsxs(View, { style: { backgroundColor: '#171717', paddingHorizontal: 16, paddingVertical: 8, flexDirection: 'row', gap: 12, alignItems: 'center' }, children: [_jsx(Text, { accessibilityRole: "alert", style: { color: '#FAFAFA', flex: 1 }, children: state.error }), _jsx(Pressable, { accessibilityRole: "button", onPress: () => void calling?.start().catch(() => { }), style: { padding: 8 }, children: _jsx(Text, { style: { color: '#FF8A2C' }, children: uiText("Retry calls") }) })] }), state.direct && _jsx(NativeCallingOverlay, { controller: state.direct, recordingLabels: Object.fromEntries(Object.entries(callRecordingText).map(([key, value]) => [key, uiText(value)])), diagnostics: { labels: Object.fromEntries(Object.entries(callDiagnosticsText).map(([key, value]) => [key, uiText(value)])) }, appearance: state.appearance, labels: Object.fromEntries(Object.entries({ ...callingText, ...state.appearance?.labels }).map(([key, value]) => [key, uiText(value)])) }), state.group && _jsx(NativeGroupCallingOverlay, { controller: state.group, recordingLabels: Object.fromEntries(Object.entries(callRecordingText).map(([key, value]) => [key, uiText(value)])), diagnostics: { labels: Object.fromEntries(Object.entries(callDiagnosticsText).map(([key, value]) => [key, uiText(value)])) }, appearance: state.appearance, labels: Object.fromEntries(Object.entries({ ...callingText, ...state.appearance?.labels }).map(([key, value]) => [key, uiText(value)])) })] });
|
|
70
72
|
}
|
package/dist/expo-messenger.d.ts
CHANGED
|
@@ -56,6 +56,10 @@ export declare function createExpoMessenger(options: {
|
|
|
56
56
|
name: string;
|
|
57
57
|
avatarUrl?: string;
|
|
58
58
|
}>): void;
|
|
59
|
+
voicemail: import("@robono/calling/voicemail").VoicemailClient;
|
|
60
|
+
openVoicemailInbox(): void;
|
|
61
|
+
closeVoicemailInbox(): void;
|
|
62
|
+
dismissVoicemail(): void;
|
|
59
63
|
deviceCheck: {
|
|
60
64
|
getSnapshot: () => import("@robono/calling-react-native").CallDeviceCheckState;
|
|
61
65
|
subscribe(fn: () => void): () => void;
|
|
@@ -102,6 +106,10 @@ export declare function createHostedExpoMessenger(options: Omit<Parameters<typeo
|
|
|
102
106
|
name: string;
|
|
103
107
|
avatarUrl?: string;
|
|
104
108
|
}>): void;
|
|
109
|
+
voicemail: import("@robono/calling/voicemail").VoicemailClient;
|
|
110
|
+
openVoicemailInbox(): void;
|
|
111
|
+
closeVoicemailInbox(): void;
|
|
112
|
+
dismissVoicemail(): void;
|
|
105
113
|
deviceCheck: {
|
|
106
114
|
getSnapshot: () => import("@robono/calling-react-native").CallDeviceCheckState;
|
|
107
115
|
subscribe(fn: () => void): () => void;
|
|
@@ -124,6 +132,8 @@ export declare function createHostedExpoMessenger(options: Omit<Parameters<typeo
|
|
|
124
132
|
maps: LocationWorkspace | undefined;
|
|
125
133
|
}>;
|
|
126
134
|
export interface ExpoMessengerProps extends Omit<ExpoMessagingScreenProps, 'contact' | 'renderConversation' | 'onBack'>, MessagingDirectoryOptions {
|
|
135
|
+
voicemailRecordingStorage?: import('./voicemail-recording.js').VoicemailRecordingStorage;
|
|
136
|
+
voicemailMessageActions?: import('./voicemail-message.js').VoicemailMessageActions;
|
|
127
137
|
calling?: ReturnType<typeof createExpoMessengerCalling>;
|
|
128
138
|
maps?: LocationWorkspace;
|
|
129
139
|
notifications?: {
|
package/dist/expo-messenger.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ExpoVoicemailComposer } from './expo-voicemail.js';
|
|
3
|
+
import { ExpoVoicemailMessage } from './expo-voicemail.js';
|
|
4
|
+
import { MessengerCallHistoryItem, useCallingConversationHistory } from './calling-timeline.js';
|
|
2
5
|
import { createExpoInboxPreferences } from './expo-inbox-preferences.js';
|
|
3
6
|
import { withExpoDeviceHistoryStorage } from './expo-device-history.js';
|
|
4
7
|
import { useDirectoryNavigation, MessagingDirectoryConversation } from './directory-navigation.js';
|
|
@@ -163,6 +166,7 @@ function ExpoMessengerContent({ inbox, contacts = emptyContacts, initialConversa
|
|
|
163
166
|
const groupAllowed = chatState.conversation?.kind !== 'group' || !chatState.conversation.supergroup && (chatState.conversation.memberCount ?? 0) >= 2 && (chatState.conversation.memberCount ?? 0) <= 8;
|
|
164
167
|
const [internal, setInternal] = useState(initialConversation ?? null), [newGroup, setNewGroup] = useState(false), [publicRooms, setPublicRooms] = useState(false);
|
|
165
168
|
const selected = selectedConversation === undefined ? internal : selectedConversation;
|
|
169
|
+
const callHistory = useCallingConversationHistory(callState.direct?.client ?? null, calling?.voicemail ?? null, selected?.id, callState.voicemailRevision);
|
|
166
170
|
// Declarative navigation loads the selected conversation itself. Internal open()
|
|
167
171
|
// changes the client synchronously, so this never opens it a second time.
|
|
168
172
|
useLayoutEffect(() => { if (selected)
|
|
@@ -188,6 +192,8 @@ function ExpoMessengerContent({ inbox, contacts = emptyContacts, initialConversa
|
|
|
188
192
|
const setSelected = (row) => { setInternal(row); onSelectConversation?.(row); };
|
|
189
193
|
const [showMaps, setShowMaps] = useState(false), mapConnection = useMessengerMaps(maps), mapsAvailable = mapConnection.available;
|
|
190
194
|
const inboxState = useSyncExternalStore(inbox.subscribe, inbox.getSnapshot, inbox.getSnapshot);
|
|
195
|
+
const callDesign = props.appearance ?? inboxState.appearance ?? defaultMessagingSettings().appearance;
|
|
196
|
+
const callTimeline = [...callHistory.calls.map(entry => ({ id: entry.id, createdAt: entry.createdAt, content: _jsx(MessengerCallHistoryItem, { entry: entry, appearance: callDesign }) })), ...(calling && (callState.features.voicemailPresentation ?? 'chat') === 'chat' ? callHistory.messages.filter(message => !message.deletedAt).map(message => ({ id: 'voicemail:' + message.id, createdAt: message.createdAt, content: _jsx(ExpoVoicemailMessage, { client: calling.voicemail, message: message, appearance: callDesign, recordingStorage: props.voicemailRecordingStorage, actions: props.voicemailMessageActions }) })) : [])].sort((a, b) => a.createdAt - b.createdAt);
|
|
191
197
|
const selectedId = useRef(selected?.id);
|
|
192
198
|
selectedId.current = selected?.id;
|
|
193
199
|
const conversationActions = selected && inboxState.inboxActionsAvailable ? {
|
|
@@ -210,5 +216,5 @@ function ExpoMessengerContent({ inbox, contacts = emptyContacts, initialConversa
|
|
|
210
216
|
const account = calling?.deviceCheck ? { name: 'Your account', ...notificationAccount, deviceCheck: calling.deviceCheck, renderCallPreview: (stream) => renderNativeCallVideo({ stream, local: true, style: { width: '100%', height: '100%' } }) } : notificationAccount;
|
|
211
217
|
const knownContact = contacts[selected?.contactId ?? ''] ?? props.directory?.find(entry => entry.contactId === selected?.contactId);
|
|
212
218
|
const contact = useMemo(() => selected?.contactId === props.userId ? { name: 'Me', avatarUrl: props.account?.avatarUrl } : selected?.kind === 'group' ? { name: selected.name ?? 'Group' } : knownContact ?? { name: selected?.contactId ?? 'Chat' }, [selected?.contactId, selected?.kind, selected?.name, props.userId, knownContact, props.account?.avatarUrl]);
|
|
213
|
-
return _jsxs(View, { style: { flex: 1, minHeight: 0 }, children: [_jsx(MessengerMapsNotice, { error: mapConnection.error, retry: mapConnection.retry }), showMaps && maps ? _jsx(RobonoMaps, { interfaceLocale: mapsLocale, workspace: maps, contacts: contacts, onClose: () => setShowMaps(false) }) : _jsx(ExpoMessagingScreen, { ...props, initialAppearance: props.initialAppearance ?? inboxState.appearance ?? undefined, conversationActions: conversationActions, account: account, contact: contact, participants: props.participants ?? contacts, extras: selected ? props.extras : undefined, callActions: selected && selected.contactId !== props.userId ? { ...autoCalls, ...props.callActions, phoneNumber: contacts[selected.contactId ?? '']?.phoneNumber ?? props.callActions?.phoneNumber } : undefined, onBack: () => { props.client.stop(); setSelected(null); void inbox.refresh().catch(() => { }); }, renderConversation: screen => directoryNavigation.selection ? _jsx(MessagingDirectoryConversation, { entry: directoryNavigation.selection, busy: directoryNavigation.busy, error: directoryNavigation.error, appearance: props.appearance ?? inboxState.appearance ?? defaultMessagingSettings().appearance, onBack: directoryNavigation.cancel, onRetry: () => void directoryNavigation.open(directoryNavigation.selection) }) : selected ? _jsx(MessagingCallingScreen, { ...screen, onCall: screen.callActions?.voice, onVideoCall: screen.callActions?.video, callLabel: "Internet call", unansweredCallId: callState.unanswered?.conversationId === selected.id ? callState.unanswered.id : undefined, onDismissCallMessage: calling?.dismissUnanswered }) : _jsxs(MessagingProvider, { ...screen, appearance: props.appearance ?? inboxState.appearance ?? undefined, children: [_jsx(MessagingInbox, { selfAvatarUrl: props.account?.avatarUrl, onNewConversation: props.onNewConversation, onDirectorySelect: entry => { props.client.stop(); setSelected(null); void directoryNavigation.open(entry); }, manageUpdates: false, directory: props.directory, onOpenDirectoryContact: props.onOpenDirectoryContact, viewMemory: inboxMemory, client: inbox, userId: props.userId, contacts: contacts, companyName: props.companyName, appearance: props.appearance, active: props.active !== false, headerActions: _jsx(MessagingAccountMenu, { inbox: inbox, onNewConversation: props.onNewConversation, onPublicRooms: inboxState.publicRoomsAvailable ? () => setPublicRooms(true) : undefined, onMaps: mapsAvailable ? () => setShowMaps(true) : undefined, onNewGroup: inboxState.groupCreationAvailable ? () => setNewGroup(true) : undefined }), onSelect: open, onDeleted: id => props.client.forgetConversation(id) }), publicRooms && _jsx(MessagingPublicRooms, { inbox: inbox, accent: (props.appearance ?? inboxState.appearance ?? defaultMessagingSettings().appearance).colors.accent, createRequestId: () => props.client.createForwardId(), onClose: () => setPublicRooms(false), onJoined: (id, name) => { setPublicRooms(false); open(inbox.getSnapshot().conversations.find(c => c.id === id) ?? { id, kind: 'group', name, contactId: null, lastMessage: null, unreadCount: 0, canSend: true }); } }), newGroup && _jsx(MessagingGroupEditor, { client: props.client, inbox: inbox, userId: props.userId, contacts: contacts, groups: inboxState.groups, accent: (props.appearance ?? inboxState.appearance ?? defaultMessagingSettings().appearance).colors.accent, onClose: () => setNewGroup(false), onSaved: (id, name) => { setNewGroup(false); const row = inbox.getSnapshot().conversations.find(c => c.id === id) ?? { id, kind: 'group', name, contactId: null, lastMessage: null, unreadCount: 0, canSend: true }; open(row); } }), props.inboxOverlay] }) }), _jsx(ExpoMessengerCalls, { calling: calling, state: callState })] });
|
|
219
|
+
return _jsxs(View, { style: { flex: 1, minHeight: 0 }, children: [_jsx(MessengerMapsNotice, { error: mapConnection.error, retry: mapConnection.retry }), showMaps && maps ? _jsx(RobonoMaps, { interfaceLocale: mapsLocale, workspace: maps, contacts: contacts, onClose: () => setShowMaps(false) }) : _jsx(ExpoMessagingScreen, { ...props, initialAppearance: props.initialAppearance ?? inboxState.appearance ?? undefined, conversationActions: conversationActions, account: account, contact: contact, participants: props.participants ?? contacts, extras: selected ? props.extras : undefined, callActions: selected && selected.contactId !== props.userId ? { ...autoCalls, ...props.callActions, phoneNumber: contacts[selected.contactId ?? '']?.phoneNumber ?? props.callActions?.phoneNumber } : undefined, onBack: () => { props.client.stop(); setSelected(null); void inbox.refresh().catch(() => { }); }, renderConversation: screen => directoryNavigation.selection ? _jsx(MessagingDirectoryConversation, { entry: directoryNavigation.selection, busy: directoryNavigation.busy, error: directoryNavigation.error, appearance: props.appearance ?? inboxState.appearance ?? defaultMessagingSettings().appearance, onBack: directoryNavigation.cancel, onRetry: () => void directoryNavigation.open(directoryNavigation.selection) }) : selected ? _jsx(MessagingCallingScreen, { ...screen, callTimeline: callTimeline, voicemail: calling && callState.voicemailOffer?.connectionId === selected.id ? _jsx(ExpoVoicemailComposer, { client: calling.voicemail, callId: callState.voicemailOffer.id, initialKind: callState.voicemailOffer.kind, appearance: screen.appearance, onSendMessage: screen.sendLocalRecording, onCancel: calling.dismissVoicemail, onSent: calling.dismissVoicemail }, callState.voicemailOffer.id) : undefined, onCall: screen.callActions?.voice, onVideoCall: screen.callActions?.video, callLabel: "Internet call", unansweredCallId: callState.unanswered?.conversationId === selected.id ? callState.unanswered.id : undefined, onDismissCallMessage: calling?.dismissUnanswered }) : _jsxs(MessagingProvider, { ...screen, appearance: props.appearance ?? inboxState.appearance ?? undefined, children: [_jsx(MessagingInbox, { selfAvatarUrl: props.account?.avatarUrl, onNewConversation: props.onNewConversation, onDirectorySelect: entry => { props.client.stop(); setSelected(null); void directoryNavigation.open(entry); }, manageUpdates: false, directory: props.directory, onOpenDirectoryContact: props.onOpenDirectoryContact, viewMemory: inboxMemory, client: inbox, userId: props.userId, contacts: contacts, companyName: props.companyName, appearance: props.appearance, active: props.active !== false, headerActions: _jsx(MessagingAccountMenu, { inbox: inbox, onVoicemail: callState.features.voicemail && callState.features.voicemailPresentation !== 'custom' ? calling?.openVoicemailInbox : undefined, onNewConversation: props.onNewConversation, onPublicRooms: inboxState.publicRoomsAvailable ? () => setPublicRooms(true) : undefined, onMaps: mapsAvailable ? () => setShowMaps(true) : undefined, onNewGroup: inboxState.groupCreationAvailable ? () => setNewGroup(true) : undefined }), onSelect: open, onDeleted: id => props.client.forgetConversation(id) }), publicRooms && _jsx(MessagingPublicRooms, { inbox: inbox, accent: (props.appearance ?? inboxState.appearance ?? defaultMessagingSettings().appearance).colors.accent, createRequestId: () => props.client.createForwardId(), onClose: () => setPublicRooms(false), onJoined: (id, name) => { setPublicRooms(false); open(inbox.getSnapshot().conversations.find(c => c.id === id) ?? { id, kind: 'group', name, contactId: null, lastMessage: null, unreadCount: 0, canSend: true }); } }), newGroup && _jsx(MessagingGroupEditor, { client: props.client, inbox: inbox, userId: props.userId, contacts: contacts, groups: inboxState.groups, accent: (props.appearance ?? inboxState.appearance ?? defaultMessagingSettings().appearance).colors.accent, onClose: () => setNewGroup(false), onSaved: (id, name) => { setNewGroup(false); const row = inbox.getSnapshot().conversations.find(c => c.id === id) ?? { id, kind: 'group', name, contactId: null, lastMessage: null, unreadCount: 0, canSend: true }; open(row); } }), props.inboxOverlay] }) }), _jsx(ExpoMessengerCalls, { calling: calling, state: callState })] });
|
|
214
220
|
}
|
package/dist/expo-reviews.js
CHANGED
|
@@ -83,7 +83,7 @@ function ReviewVideo({ url, audio, foreground }) {
|
|
|
83
83
|
}, [audio, player]);
|
|
84
84
|
if (!ready)
|
|
85
85
|
return _jsx(View, { style: { width: "100%", height: 240, alignItems: "center", justifyContent: "center" }, children: error ? _jsx(Text, { accessibilityRole: "alert", style: { color: foreground }, children: error }) : _jsx(ActivityIndicator, { accessibilityLabel: "Preparing video", color: foreground }) });
|
|
86
|
-
return (_jsx(MessengerVideoView, { player: player, nativeControls: true, style: { width: "100%", height: 240 } }));
|
|
86
|
+
return (_jsx(MessengerVideoView, { sourceUri: url, player: player, nativeControls: true, style: { width: "100%", height: 240 } }));
|
|
87
87
|
}
|
|
88
88
|
function ReviewDocument({ url, file, foreground }) {
|
|
89
89
|
const [uri, setUri] = useState(null), [error, setError] = useState('');
|
package/dist/expo-screen.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { createExpoMessagingClient } from './expo-outbox.js';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { type MessagingAppearance, type MessagingMessage } from '@robono/messaging';
|
|
6
6
|
import { type MessagingScreenProps } from './index.js';
|
|
7
|
+
import { type VoiceBubbleProps } from './media-ui.js';
|
|
7
8
|
import { MessagingMediaController, type LocalMessagingMedia, type MessagingMediaStorage } from './media-controller.js';
|
|
8
9
|
import { type MediaReadyStage } from './media-readiness.js';
|
|
9
10
|
import { type MessagingAudioSession } from './expo-media.js';
|
|
@@ -11,6 +12,37 @@ export { createExpoMessagingAudioSession, createExpoMessagingDevice, createExpoM
|
|
|
11
12
|
export type { MessagingAudioSession } from './expo-media.js';
|
|
12
13
|
export type { LocalMessagingMedia, MessagingMediaStorage, MediaTransferOptions } from './media-controller.js';
|
|
13
14
|
export { MessagingMediaController } from './media-controller.js';
|
|
15
|
+
export declare const stopVoicePlayers: (except?: () => Promise<void>) => Promise<void>;
|
|
16
|
+
export declare function VoicePlayer({ file, audio, design, inline, draft, autoPlay, onPlayed, onLongPress }: {
|
|
17
|
+
onLongPress?: () => void;
|
|
18
|
+
file: LocalMessagingMedia;
|
|
19
|
+
audio: MessagingAudioSession;
|
|
20
|
+
design: MessagingAppearance;
|
|
21
|
+
inline?: VoiceBubbleProps;
|
|
22
|
+
draft?: {
|
|
23
|
+
onRemove: () => void;
|
|
24
|
+
waveform?: number[];
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
compact?: boolean;
|
|
27
|
+
};
|
|
28
|
+
autoPlay?: boolean;
|
|
29
|
+
onPlayed?: () => void;
|
|
30
|
+
}): React.JSX.Element;
|
|
31
|
+
export declare function VideoPlayer({ file, audio, posterUri, onPlayed, playbackControl, onDimensions }: {
|
|
32
|
+
onPlayed?: () => void;
|
|
33
|
+
posterUri?: string;
|
|
34
|
+
file: LocalMessagingMedia;
|
|
35
|
+
audio: MessagingAudioSession;
|
|
36
|
+
design: MessagingAppearance;
|
|
37
|
+
playbackControl?: {
|
|
38
|
+
bottomInset?: number;
|
|
39
|
+
corners?: import('react-native').ViewStyle;
|
|
40
|
+
playLabel: string;
|
|
41
|
+
pauseLabel: string;
|
|
42
|
+
onLongPress?: () => void;
|
|
43
|
+
};
|
|
44
|
+
onDimensions?: (width: number, height: number) => void;
|
|
45
|
+
}): React.JSX.Element;
|
|
14
46
|
export type MessagingAttachmentDownload = (input: {
|
|
15
47
|
message: MessagingMessage;
|
|
16
48
|
file: LocalMessagingMedia;
|