@robono/messaging-react-native 0.18.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.
@@ -1,12 +1,14 @@
1
1
  # Existing Bridge friends in the standard Messenger
2
2
 
3
- Required versions: `@robono/messaging` **0.13.0**, `@robono/server` **0.32.0**, and `@robono/messaging-react-native` **0.18.0** (Expo) or `@robono/messaging-web` **0.17.0** (web). Use `@robono/location` **0.4.1** for the screen package's shared appearance helpers; this does not enable Maps or location access.
3
+ Bridge language integration — November 9, 2026. This guide covers the package versions below.
4
4
 
5
- Server: `npm install @robono/server@0.32.0`
5
+ Required versions: `@robono/messaging` **0.14.0**, `@robono/server` **0.33.0**, and `@robono/messaging-react-native` **0.19.0** (Expo) or `@robono/messaging-web` **0.18.0** (web). Use `@robono/location` **0.4.1** for the screen package's shared appearance helpers; this does not enable Maps or location access.
6
6
 
7
- Expo: `npm install @robono/messaging@0.13.0 @robono/messaging-react-native@0.18.0 @robono/location@0.4.1`
7
+ Server: `npm install @robono/server@0.33.0`
8
8
 
9
- Web: `npm install @robono/messaging@0.13.0 @robono/messaging-web@0.17.0 @robono/location@0.4.1`
9
+ Expo: `npm install @robono/messaging@0.14.0 @robono/messaging-react-native@0.19.0 @robono/location@0.4.1`
10
+
11
+ Web: `npm install @robono/messaging@0.14.0 @robono/messaging-web@0.18.0 @robono/location@0.4.1`
10
12
 
11
13
  The Expo integration uses the existing supported Expo 55/56 native dependencies. This connector adds no new native dependency. Keep the host's existing supported peers and native configuration. The service endpoint is `https://api.robono.com/v1/bridge/messenger`; a 404 there means the service route is not deployed yet, not that a replacement friend must be created.
12
14
 
@@ -59,8 +61,65 @@ The durable wake covers message creation/change/deletion, receipt changes and co
59
61
 
60
62
  This release does not invent unsupported Bridge reactions, threaded replies, polls, groups, scheduled sends or presence. Their controls remain unavailable in these direct Bridge chats. Delivery/read/heard receipts retain their existing meanings; a heard receipt is not a new claim of complete playback. The separate online-status, phrase-detection and detailed playback-event requests require their own contracts and are not enabled by this connector.
61
63
 
64
+ ## Translation and transcripts
65
+
66
+ The same standard Expo and web screens offer:
67
+
68
+ | Original message | Available result |
69
+ | --- | --- |
70
+ | Text | Translated text |
71
+ | Voice message | Written transcript; translated text |
72
+ | Video with speech | Written transcript; translated text |
73
+
74
+ This Bridge connector produces readable text. It does not dub a video, burn subtitles into it, or offer generated voice output. The original recording/video remains available through **Show original**. Recordings and videos must be at most 20 MB and one hour; a silent video has no speech to transcribe.
75
+
76
+ Enable **Transcription** and/or **Translation** in the existing website feature choices. Friend permissions still apply: `speech.stt.allowed` permits speech processing, `speech.stt.deliver_transcript` permits showing its transcript, and `speech.translation.allowed` plus `deliver_translated_text` permit translated text. Translating voice/video also requires speech processing. The website cannot override a friend restriction. Supply the friend's known language through `contact.language` or let the person choose it in Translation settings. The destination language is saved per friend.
77
+
78
+ The factories now connect these operations automatically. Keep using `createExpoBridgeMessenger` / `createWebBridgeMessenger` and the supplied screen; no custom translation UI or transport is needed. The underlying public operation is `client.transform(messageId, 'transcript' | 'translation', targetLanguage, 'text', {signal, sourceLanguage})`.
79
+
80
+ ### Approve costs on the customer's server
81
+
82
+ Add `authorizeCost` to the existing backend adapter. It receives the authenticated actor, connection, operation and a trusted `quote`. Return `true` only when the customer's policy approves the maximum cost. An absent callback blocks new processing; returning `false` declines it. The callback also runs for a zero-cost quote so a test or complimentary plan never bypasses the customer's policy.
83
+
84
+ ```ts
85
+ const route = createBridgeMessengerBackendAdapter({
86
+ apiKey: process.env.ROBONO_SERVER_KEY!,
87
+ authenticate: verifyExistingSession,
88
+ authorize: checkCurrentFriendPermission,
89
+ authorizeCost: async ({actorId, connectionId, quote, request}) => {
90
+ return approveLanguageBudget({
91
+ actorId, connectionId,
92
+ stage: quote.stage,
93
+ maximumUsdMicros: quote.maximumChargeMicros,
94
+ signal: request.signal,
95
+ });
96
+ },
97
+ });
98
+ ```
99
+
100
+ `approveLanguageBudget` is the customer's own policy function, not a Robono export. Do not copy a callback that always returns `true` unless unrestricted spending is the intended policy. Resolve per-user spending rules on the server; device-supplied prices and approval tokens are ignored.
101
+
102
+ A voice/video translation has two approvals:
103
+
104
+ 1. Robono reads the real recording duration without transcribing it. The callback approves **transcription** for that duration.
105
+ 2. After the transcript is saved, Robono quotes **translation** for the exact input character count. The callback approves that amount before translation begins.
106
+
107
+ This avoids guessing the text length. If the second step is declined or cancelled, the completed transcript remains saved and its completed processing can still be charged. A retry reuses that transcript. Saved results require fresh permissions but no new processing approval or processing charge. Changes to the original message or source-language choice produce a new result rather than reusing the wrong one.
108
+
109
+ Use `quote.maximumChargeMicros` to approve the maximum for that stage; divide by 1,000,000 for dollars. It is a ceiling before applicable included usage/discounts, not a promise that the full amount will be charged. `metric`, `quantity`, `unitAmountMicros` and `unitQuantity` describe the rate. `billingModel` distinguishes `measured_usage`, legacy `fixed_unit`, `complimentary` and `sandbox`. Do not assume every plan has a fixed per-message price.
110
+
111
+ ### Identify the actual current plan
112
+
113
+ From the customer server, call `await robono.usage()` with an API key allowed to read billing. Its new `contract` field contains `available`, `planKey`, `catalogVersion`, `billingModel` and `languageRates`. This is the account's current agreement, including a retained legacy fixed-price agreement; the public pricing catalog is not proof of that account's plan. If `contract.available` is false, show that billing setup needs attention and decline processing. Never fall back to an assumed old price.
114
+
115
+ The quote returned for each request is authoritative. Robono rechecks the plan, rate, permissions and spending limit before starting work. A price change requires a new approval. Repeating a completed request does not charge twice, including when its response was lost.
116
+
117
+ ### Cancellation and retained results
118
+
119
+ The standard bubble shows **Cancel** while processing. Custom hosts may pass an `AbortSignal` to `client.transform`. Cancellation stops subsequent stages and prevents a late result from appearing. It cannot undo a stage that already completed. Results stay attached to the original retained Bridge message; they do not create another conversation or another message. Deleting, expiring or denying access to the original also prevents reading its saved result.
120
+
62
121
  ## Release requirements
63
122
 
64
- Release together: migration `20261108040000_standard_bridge_messenger.sql`, function `external-app-bridge-messenger`, API router `/v1/bridge/messenger`, and core/server/Expo/web packages. Verify deployment before publishing supported install versions. Website/API uploads remain owner-operated.
123
+ Release together: migrations `20261108040000_standard_bridge_messenger.sql` and `20261108060000_bridge_language_authorization.sql`, functions `external-app-bridge-messenger` and `external-app-usage`, and the speech worker duration endpoint, API router `/v1/bridge/messenger`, and core/server/Expo/web packages. Verify deployment before publishing supported install versions. Website/API uploads remain owner-operated.
65
124
 
66
125
  Local verification uses synthetic accepted Bridge connections in an isolated service, through the public adapter and standard screens. iPhone and Android checks cover photo, video, document and voice upload/send/download, thumbnails, native voice playback, changing permissions and revoked access. Browser checks cover opening retained history and sending through the standard composer. Service checks cover original IDs, pagination, private access, duplicate prevention after a lost response and recovery after a missed notification. This is not a claim that a new push notification was delivered through Apple's or Google's service in this check.
package/SBOM.spdx.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "spdxVersion": "SPDX-2.3",
3
3
  "dataLicense": "CC0-1.0",
4
4
  "SPDXID": "SPDXRef-DOCUMENT",
5
- "name": "@robono/messaging-react-native@0.18.0",
6
- "documentNamespace": "https://robono.com/sbom/messaging-react-native/0.18.0/85ab817f88a6761353ea3e720210dbb6625a0524",
5
+ "name": "@robono/messaging-react-native@0.19.0",
6
+ "documentNamespace": "https://robono.com/sbom/messaging-react-native/0.19.0/bff0a0ed6e13c29ca11c74ca4af758f7b29c33c9",
7
7
  "creationInfo": {
8
- "created": "2026-11-08T17:19:29.305Z",
8
+ "created": "2026-11-09T05:04:30.633Z",
9
9
  "creators": [
10
10
  "Organization: Robono (support@robono.com)"
11
11
  ]
@@ -14,11 +14,11 @@
14
14
  {
15
15
  "name": "@robono/messaging-react-native",
16
16
  "SPDXID": "SPDXRef-Package",
17
- "versionInfo": "0.18.0",
17
+ "versionInfo": "0.19.0",
18
18
  "downloadLocation": "NOASSERTION",
19
19
  "filesAnalyzed": true,
20
20
  "packageVerificationCode": {
21
- "packageVerificationCodeValue": "85ab817f88a6761353ea3e720210dbb6625a0524"
21
+ "packageVerificationCodeValue": "bff0a0ed6e13c29ca11c74ca4af758f7b29c33c9"
22
22
  },
23
23
  "licenseConcluded": "LicenseRef-RobonoSDK",
24
24
  "licenseDeclared": "LicenseRef-RobonoSDK",
@@ -26,7 +26,7 @@
26
26
  "LicenseRef-RobonoSDK"
27
27
  ],
28
28
  "copyrightText": "Copyright (c) 2026 Add to Loop LLC.",
29
- "comment": "Host-supplied peers (not bundled): {\"@robono/messaging\":\"^0.13.0\",\"react\":\">=18.2 <20\",\"react-native\":\">=0.76 <1\",\"expo-audio\":\">=55 <57\",\"expo-image-picker\":\">=55 <57\",\"expo-document-picker\":\">=55 <57\",\"expo-file-system\":\">=55.0.5 <57\",\"expo-sharing\":\">=55 <57\",\"expo-video\":\">=55 <57\",\"expo-crypto\":\">=55 <57\",\"react-native-safe-area-context\":\">=5 <6\",\"react-native-svg\":\">=15 <16\",\"@robono/calling-react-native\":\"^0.9.3\",\"expo-clipboard\":\">=8 <57\",\"expo-image-manipulator\":\">=14 <57\",\"expo-video-thumbnails\":\">=14 <57\",\"react-native-webview\":\">=13 <14\",\"expo-blur\":\">=55 <57\",\"expo-notifications\":\">=55 <57\",\"expo-secure-store\":\">=55 <57\",\"@robono/location-react-native\":\"^0.4.1\",\"expo-location\":\">=55 <57\",\"expo-constants\":\">=55 <57\",\"@robono/location\":\"^0.4.1\",\"expo-haptics\":\">=55 <57\",\"@robono/calling\":\"^0.6.2\",\"expo-media-library\":\">=55 <57\"}"
29
+ "comment": "Host-supplied peers (not bundled): {\"@robono/messaging\":\"^0.14.0\",\"react\":\">=18.2 <20\",\"react-native\":\">=0.76 <1\",\"expo-audio\":\">=55 <57\",\"expo-image-picker\":\">=55 <57\",\"expo-document-picker\":\">=55 <57\",\"expo-file-system\":\">=55.0.5 <57\",\"expo-sharing\":\">=55 <57\",\"expo-video\":\">=55 <57\",\"expo-crypto\":\">=55 <57\",\"react-native-safe-area-context\":\">=5 <6\",\"react-native-svg\":\">=15 <16\",\"@robono/calling-react-native\":\"^0.9.3\",\"expo-clipboard\":\">=8 <57\",\"expo-image-manipulator\":\">=14 <57\",\"expo-video-thumbnails\":\">=14 <57\",\"react-native-webview\":\">=13 <14\",\"expo-blur\":\">=55 <57\",\"expo-notifications\":\">=55 <57\",\"expo-secure-store\":\">=55 <57\",\"@robono/location-react-native\":\"^0.4.1\",\"expo-location\":\">=55 <57\",\"expo-constants\":\">=55 <57\",\"@robono/location\":\"^0.4.1\",\"expo-haptics\":\">=55 <57\",\"@robono/calling\":\"^0.6.2\",\"expo-media-library\":\">=55 <57\"}"
30
30
  }
31
31
  ],
32
32
  "files": [
@@ -36,11 +36,11 @@
36
36
  "checksums": [
37
37
  {
38
38
  "algorithm": "SHA256",
39
- "checksumValue": "4a365b01b97e227f46ea6b5dae0fe5de4bd97002a76c82348ddab0d57b4e0c63"
39
+ "checksumValue": "f0fbd0ec0a70c7e50a6299e1be15c3dd34c5a63b99113f18e668d9c7f6bc8d3f"
40
40
  },
41
41
  {
42
42
  "algorithm": "SHA1",
43
- "checksumValue": "dc6e5aefe795c90c4426a6c1be2eb8fcd202b033"
43
+ "checksumValue": "1197f7b389c77343184aa4d010ca091cdebe2044"
44
44
  }
45
45
  ],
46
46
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -720,11 +720,11 @@
720
720
  "checksums": [
721
721
  {
722
722
  "algorithm": "SHA256",
723
- "checksumValue": "1bc33a14bd9a28349ed98e4600db94dce428218969bdf21154a841558d7b9ff6"
723
+ "checksumValue": "a26aaba16918fb2169259f5b71ae7c88ad2092e65be08247ec7d2f4c868d1255"
724
724
  },
725
725
  {
726
726
  "algorithm": "SHA1",
727
- "checksumValue": "1856aa5713eca543119759dbb27e9a135ed0ce86"
727
+ "checksumValue": "f996763b4ace926c2ff6b384b58c9c2f2994c871"
728
728
  }
729
729
  ],
730
730
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -1784,11 +1784,11 @@
1784
1784
  "checksums": [
1785
1785
  {
1786
1786
  "algorithm": "SHA256",
1787
- "checksumValue": "faf18c4434b5ccd1c70cd50f7605d01dfd9cefd6490168f768ac41d0709c9818"
1787
+ "checksumValue": "49ae7826d25981156e462d703b586d956fe32f318324e039d0ff85d5dd77097c"
1788
1788
  },
1789
1789
  {
1790
1790
  "algorithm": "SHA1",
1791
- "checksumValue": "a3da1ebc787f98e8f5951d6d45d8d9fa876f52c3"
1791
+ "checksumValue": "3da96a9bb9c7541c76d272d85518b7af65d5e43e"
1792
1792
  }
1793
1793
  ],
1794
1794
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -3494,11 +3494,11 @@
3494
3494
  "checksums": [
3495
3495
  {
3496
3496
  "algorithm": "SHA256",
3497
- "checksumValue": "8af37fac8091c00c619fc3a3de25b8517d36093211e87ce13e5ccc9a7bdc9219"
3497
+ "checksumValue": "3a143ca909b55653e8ceb886da45b3cdd909678fcc914de1935cee00b1b04271"
3498
3498
  },
3499
3499
  {
3500
3500
  "algorithm": "SHA1",
3501
- "checksumValue": "d9f1cd9609ae0676734291ef2d022520b9454c00"
3501
+ "checksumValue": "4922dd0badaecda62705b7987c3f51dba8bdda45"
3502
3502
  }
3503
3503
  ],
3504
3504
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -1,10 +1,10 @@
1
- import { bridgeMessengerFetch, refreshBridgeMessengerFromPush } from '@robono/messaging';
1
+ import { bridgeMessengerFetch, bridgeLanguageRequest, createMessagingTransport, refreshBridgeMessengerFromPush } from '@robono/messaging';
2
2
  import { createExpoMessagingClient, expoOutbox } from './expo-outbox.js';
3
3
  import { createExpoMessagingStorage, createExpoMessagingAudioSession } from './expo-media.js';
4
4
  /** Standard ExpoMessagingScreen connection for an already accepted Bridge friend. */
5
5
  export function createExpoBridgeMessenger(options) {
6
6
  const transportFetch = bridgeMessengerFetch(options.connectionId, options.fetch);
7
- const client = createExpoMessagingClient({ ...options, fetch: transportFetch, namespace: (options.namespace ?? '') + ':bridge:' + options.connectionId });
7
+ const client = createExpoMessagingClient({ ...options, fetch: transportFetch, transformRequest: bridgeLanguageRequest(createMessagingTransport({ ...options, fetch: transportFetch })), namespace: (options.namespace ?? '') + ':bridge:' + options.connectionId });
8
8
  const storage = createExpoMessagingStorage({ url: options.url, getAccessToken: options.getAccessToken, fetch: transportFetch });
9
9
  const outgoing = expoOutbox(client);
10
10
  if (outgoing)
package/dist/index.js CHANGED
@@ -168,7 +168,7 @@ function MessagingProviderContent({ children, ...props }) {
168
168
  const design = useMemo(() => localizeMessagingAppearance(messagingScreenAppearance(effectiveAppearance, styleScreen), uiText), [effectiveAppearance, styleScreen, uiText]);
169
169
  const messagingPopupColors = useMessagingPopupColors(design);
170
170
  const linkHandling = useMemo(() => ({ ...props.linkHandling, webLinks: props.linkHandling?.webLinks !== false && effectiveAppearance.linkHandling?.webLinks !== false, addresses: props.linkHandling?.addresses !== false && effectiveAppearance.linkHandling?.addresses !== false }), [props.linkHandling, effectiveAppearance.linkHandling]);
171
- const languageTools = useMemo(() => ({ ...props.languageTools, voiceOutput: props.languageTools?.voiceOutput !== false && effectiveAppearance.spokenTranslations !== false }), [props.languageTools, effectiveAppearance.spokenTranslations]);
171
+ const languageTools = useMemo(() => ({ ...props.languageTools, voiceOutput: state.translationVoiceAvailable !== false && props.languageTools?.voiceOutput !== false && effectiveAppearance.spokenTranslations !== false }), [props.languageTools, effectiveAppearance.spokenTranslations, state.translationVoiceAvailable]);
172
172
  // Resolve the device zone once per provider render, not once per bubble.
173
173
  // The formatter is recreated when the locale or zone changes, so resuming
174
174
  // after travel keeps the same local-time behavior without rebuilding it for
@@ -394,6 +394,18 @@ function selectBubbleUI(context, props, previous) {
394
394
  selected.state = previous.state;
395
395
  return previous && Object.keys(selected).every(key => Object.is(selected[key], previous[key])) ? previous : selected;
396
396
  }
397
+ function languageFailure(error) {
398
+ const messages = { language_cost_authorization_required: "Your app needs to finish setting up language tools. Please contact support.", language_cost_declined: "This language request was not approved.", source_language_required: "Choose your friend’s message language in Translation settings.", transcription_size_limit: "This recording is too large to transcribe. The limit is 20 MB.", empty_transcript: "No spoken words were found in this message.", language_price_changed: "The price changed. Please try again." };
399
+ if (error instanceof MessagingError) {
400
+ if (messages[error.code ?? ''])
401
+ return messages[error.code ?? ''];
402
+ if (error.status === 402)
403
+ return 'This language request could not be approved. Check your plan or spending limit.';
404
+ if ([401, 403].includes(error.status))
405
+ return 'This language tool is no longer allowed.';
406
+ }
407
+ return 'This message could not be converted. Try again.';
408
+ }
397
409
  export function MessagingBubble(props) {
398
410
  const context = useMessagingUI(), last = useRef(null);
399
411
  const selected = selectBubbleUI(context, props, last.current);
@@ -432,11 +444,11 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
432
444
  });
433
445
  const [transformed, setTransformed] = useState(null), [transforming, setTransforming] = useState(false), [showOriginal, setShowOriginal] = useState(false), [translationAutoPlay, setTranslationAutoPlay] = useState(false);
434
446
  const TranslationVoice = components?.TranslationVoice;
435
- const canTranscript = languageTools?.transcription !== false && !pendingStatus && voice && !!state.settings?.features.transcription && client.hasLanguageTools() && !message.deleted;
447
+ const canTranscript = languageTools?.transcription !== false && !pendingStatus && (voice || message.kind === 'video') && !!state.settings?.features.transcription && client.hasLanguageTools() && !message.deleted;
436
448
  const translation = state.translationPreference;
437
449
  const translationLanguage = translation?.language ?? languageTools?.preferredLanguage ?? language;
438
450
  const sourceLanguage = participants?.[message.senderId]?.language ?? (state.conversation?.kind === 'direct' ? contact.language : undefined) ?? translation?.sourceLanguage;
439
- const canTranslate = languageTools?.translation !== false && !mine && !extra?.weather && !extra?.call && !pendingStatus && ['text', 'voice'].includes(message.kind) && !!state.settings?.enabled && !!state.settings.features.translation && client.hasLanguageTools() && !message.deleted && translation?.mode !== undefined && translation.mode !== 'off' && needsMessageTranslation(sourceLanguage, translationLanguage) && (translation.mode !== 'voice' || languageTools?.voiceOutput === false || !!TranslationVoice);
451
+ const canTranslate = languageTools?.translation !== false && !mine && !extra?.weather && !extra?.call && !pendingStatus && ['text', 'voice', 'video'].includes(message.kind) && !!state.settings?.enabled && !!state.settings.features.translation && client.hasLanguageTools() && !message.deleted && translation?.mode !== undefined && translation.mode !== 'off' && needsMessageTranslation(sourceLanguage, translationLanguage) && (translation.mode !== 'voice' || languageTools?.voiceOutput === false || !!TranslationVoice);
440
452
  const transformGeneration = useRef(0), transformAbort = useRef(null);
441
453
  useEffect(() => { transformAbort.current?.abort(); transformGeneration.current++; setTransformed(null); setTransforming(false); setShowOriginal(false); setTranslationAutoPlay(false); return () => { transformAbort.current?.abort(); transformGeneration.current++; }; }, [message.id, message.deleted, message.text, message.media?.assetId, translationLanguage, translation?.mode, sourceLanguage, state.settings?.enabled, state.settings?.features.transcription, state.settings?.features.translation, languageTools?.translation, languageTools?.transcription, languageTools?.voiceOutput, languageTools?.revision]);
442
454
  useEffect(() => { if (!transformed?.audio)
@@ -446,7 +458,7 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
446
458
  return;
447
459
  } if (transforming)
448
460
  return; const generation = ++transformGeneration.current, controller = transformAbort.current = new AbortController(); setTransforming(true); setActions(false); setError(''); try {
449
- const result = await client.transform(message.id, kind, translationLanguage ?? Intl.DateTimeFormat().resolvedOptions().locale, output, { signal: controller.signal });
461
+ const result = await client.transform(message.id, kind, translationLanguage ?? Intl.DateTimeFormat().resolvedOptions().locale, output, { signal: controller.signal, sourceLanguage: sourceLanguage ?? undefined });
450
462
  if (generation === transformGeneration.current) {
451
463
  setTransformed(result);
452
464
  setShowOriginal(false);
@@ -455,7 +467,7 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
455
467
  }
456
468
  catch (e) {
457
469
  if (generation === transformGeneration.current && !controller.signal.aborted)
458
- setError(e instanceof MessagingError && e.status === 402 ? uiText("There are not enough credits for this language tool.") : e instanceof MessagingError && [401, 403].includes(e.status) ? uiText("This language tool is no longer allowed.") : uiText("This message could not be converted. Try again."));
470
+ setError(uiText(languageFailure(e)));
459
471
  }
460
472
  finally {
461
473
  if (generation === transformGeneration.current)
@@ -508,7 +520,7 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
508
520
  const footer = _jsx(MessageMetadata, { message: message, mine: mine, ink: visual ? '#ffffff' : ink, pendingStatus: deliveryStatus });
509
521
  const bigEmoji = message.kind === 'text' && !message.replyTo && !extra && !canTranslate && !transformed && isBigEmojiText(message.text);
510
522
  const showingTransform = !!transformed && !showOriginal && (transformed.kind === 'transcript' || canTranslate);
511
- const languageActions = (canTranscript || canTranslate || transformed) && _jsxs(View, { testID: "message-language-actions", style: { flexDirection: 'row', flexWrap: 'wrap', justifyContent: voice && !showingTransform ? 'flex-end' : 'flex-start', columnGap: 8, rowGap: 0 }, children: [transformed && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: showOriginal ? (transformed.kind === 'transcript' ? 'Show transcript' : 'Show translation') : uiText("Show original"), onPress: () => { setTranslationAutoPlay(false); setShowOriginal(v => !v); }, hitSlop: 8, style: { minHeight: 17, paddingVertical: 1, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent, fontSize: 11, lineHeight: 15 }, children: showOriginal ? (transformed.kind === 'transcript' ? 'Show transcript' : 'Show translation') : uiText("Show original") }) }), canTranscript && !transformed && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Read voice message"), disabled: transforming, onPress: () => void transform('transcript'), hitSlop: 8, style: { minHeight: 17, paddingVertical: 1, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent, fontSize: 11, lineHeight: 15 }, children: transforming ? uiText("Transcribing…") : uiText("Transcript") }) }), canTranslate && transformed?.kind !== 'translation' && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: translation.mode === 'voice' && languageTools?.voiceOutput !== false ? uiText("Play translation") : uiText("Translate message"), disabled: transforming, onPress: () => void transform('translation', translation.mode === 'voice' && languageTools?.voiceOutput !== false ? 'voice' : 'text'), hitSlop: 8, style: { minHeight: 17, paddingVertical: 1, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent, fontSize: 11, lineHeight: 15 }, children: translation.mode === 'voice' && languageTools?.voiceOutput !== false ? uiText("Play Translation") : uiText("Translate") }) })] });
523
+ const languageActions = (canTranscript || canTranslate || transformed) && _jsxs(View, { testID: "message-language-actions", style: { flexDirection: 'row', flexWrap: 'wrap', justifyContent: voice && !showingTransform ? 'flex-end' : 'flex-start', columnGap: 8, rowGap: 0 }, children: [transforming && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Cancel"), onPress: () => { transformAbort.current?.abort(); transformGeneration.current++; setTransforming(false); }, hitSlop: 8, children: _jsx(Text, { style: { color: c.accent, fontSize: 11, lineHeight: 15 }, children: uiText("Cancel") }) }), transformed && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: showOriginal ? (transformed.kind === 'transcript' ? 'Show transcript' : 'Show translation') : uiText("Show original"), onPress: () => { setTranslationAutoPlay(false); setShowOriginal(v => !v); }, hitSlop: 8, style: { minHeight: 17, paddingVertical: 1, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent, fontSize: 11, lineHeight: 15 }, children: showOriginal ? (transformed.kind === 'transcript' ? 'Show transcript' : 'Show translation') : uiText("Show original") }) }), canTranscript && !transformed && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Read transcript"), disabled: transforming, onPress: () => void transform('transcript'), hitSlop: 8, style: { minHeight: 17, paddingVertical: 1, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent, fontSize: 11, lineHeight: 15 }, children: transforming ? uiText("Transcribing…") : uiText("Transcript") }) }), canTranslate && transformed?.kind !== 'translation' && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: translation.mode === 'voice' && languageTools?.voiceOutput !== false ? uiText("Play translation") : uiText("Translate message"), disabled: transforming, onPress: () => void transform('translation', translation.mode === 'voice' && languageTools?.voiceOutput !== false ? 'voice' : 'text'), hitSlop: 8, style: { minHeight: 17, paddingVertical: 1, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent, fontSize: 11, lineHeight: 15 }, children: translation.mode === 'voice' && languageTools?.voiceOutput !== false ? uiText("Play Translation") : uiText("Translate") }) })] });
512
524
  const fallbackContent = _jsx(View, { testID: "message-original-text", children: _jsx(Text, { selectable: true, style: { color: ink, fontSize: 16, lineHeight: 22 }, children: renderText(message.text ?? '') }) });
513
525
  const originalContent = message.custom && !message.deleted ? _jsxs(Pressable, { onLongPress: menu, children: [_jsx(CustomMessage, { message: message, mine: mine, appearance: design, pendingStatus: pendingStatus, components: components, enabled: canInteract, children: fallbackContent }), pendingStatus && footer] }) : extra?.weather || extra?.call ? extraCard : message.kind === 'poll' ? _jsx(PollMessage, { onLongPress: menu, message: message, userId: userId, ink: ink, accent: c.accent, background: c.background, foreground: c.foreground, resolveVoterName: id => id === userId ? 'You' : participants?.[id]?.name ?? (state.conversation?.kind === 'direct' ? contextContactName : 'Chat member'), enabled: canInteract && !!state.settings?.features.poll, onVote: options => client.vote(message.id, options), onClose: () => client.closePoll(message.id) }) : message.kind === 'text' ? _jsxs(View, { testID: "message-original-text", children: [_jsx(Text, { selectable: true, style: { color: ink, fontSize: bigEmoji ? 48 : 16, lineHeight: bigEmoji ? 58 : 22 }, children: renderText(message.text ?? '') }), pendingStatus && footer] }) : _jsx(MediaContent, { message: message, ink: ink, accent: c.accent, footer: voice ? languageActions : undefined, onOpen: () => void open(), onLongPress: menu });
514
526
  const content = showingTransform ? _jsxs(View, { children: [_jsx(Text, { style: { color: ink, fontSize: 11, opacity: .65, marginBottom: 2 }, children: transformed.kind === 'transcript' ? uiText("Transcript") : 'Translated · ' + supportedLanguageLabel(translationLanguage) }), transformed.audio && TranslationVoice ? _jsx(View, { testID: "message-translated-voice", children: _jsx(TranslationVoice, { transform: transformed, ink: ink, accent: c.accent, showWaveform: design.showWaveform !== false, autoPlay: translationAutoPlay }) }) : _jsx(Text, { testID: "message-language-result", selectable: true, style: { color: ink, fontSize: 16, lineHeight: 22 }, children: transformed.text }), !voice && footer] }) : originalContent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robono/messaging-react-native",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Optional, composable direct and group messaging screens for Robono.",
@@ -57,7 +57,7 @@
57
57
  "prepack": "npm run build && node ../../scripts/generate-sdk-file-sbom.mjs"
58
58
  },
59
59
  "peerDependencies": {
60
- "@robono/messaging": "^0.13.0",
60
+ "@robono/messaging": "^0.14.0",
61
61
  "react": ">=18.2 <20",
62
62
  "react-native": ">=0.76 <1",
63
63
  "expo-audio": ">=55 <57",