@robono/messaging-react-native 0.25.1 → 0.26.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.26.1 — 2026-11-18
4
+
5
+ Open text conversations with less work. Message menus, swipe-to-quote graphics, document viewing and media pickers initialize when used. Background media downloads wait for the message list to render.
6
+
7
+ ## 0.26.0 — 2026-11-18
8
+
9
+ Add shared voice selection and fixed listening samples, with personal choices taking precedence over company defaults. Apply scheduling, weather and social display choices on both platforms.
10
+
11
+ Fix an iPhone freeze when CloudKit returns a partial error, such as a deleted backup part. Only safe error details cross the native bridge; missing-file, storage-full and cancellation handling retain their meanings. Real interrupted-upload recovery and cleanup pass on both phones.
12
+
13
+ Real cloud retention passes with controlled creation dates. Replacement-device, account-change, passkey and natural background recovery retain their existing release gates; automatic delivery-copy deletion stays disabled.
14
+
3
15
  ## 0.25.1
4
16
 
5
17
  - Sync applied website calling logos automatically. Preserve cached branding for locked iPhone calls, support removal and account changes, and refresh without interrupting active calls. Older apps need one SDK update; subsequent logo changes require no rebuild.
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.25.1",
6
- "documentNamespace": "https://robono.com/sbom/messaging-react-native/0.25.1/7f3f66ee83b1ed2b87aa396dfbe5971a50c1260f",
5
+ "name": "@robono/messaging-react-native@0.26.1",
6
+ "documentNamespace": "https://robono.com/sbom/messaging-react-native/0.26.1/417deafb29096225163c256d6fbf14195616f550",
7
7
  "creationInfo": {
8
- "created": "2026-11-16T10:54:28.227Z",
8
+ "created": "2026-11-18T13:08:48.052Z",
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.25.1",
17
+ "versionInfo": "0.26.1",
18
18
  "downloadLocation": "NOASSERTION",
19
19
  "filesAnalyzed": true,
20
20
  "packageVerificationCode": {
21
- "packageVerificationCodeValue": "7f3f66ee83b1ed2b87aa396dfbe5971a50c1260f"
21
+ "packageVerificationCodeValue": "417deafb29096225163c256d6fbf14195616f550"
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.19.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.11.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.2\",\"expo-location\":\">=55 <57\",\"expo-constants\":\">=55 <57\",\"@robono/location\":\"^0.4.1\",\"expo-haptics\":\">=55 <57\",\"@robono/calling\":\"^0.7.0\",\"expo-media-library\":\">=55 <57\",\"expo-task-manager\":\">=55.0.0 <57.0.0\",\"expo-application\":\">=55 <57\",\"react-native-passkey\":\"^3.6.2\",\"expo-background-task\":\">=55 <57\",\"expo-network\":\">=55 <57\"}"
29
+ "comment": "Host-supplied peers (not bundled): {\"@robono/messaging\":\"^0.20.1\",\"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.11.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.2\",\"expo-location\":\">=55 <57\",\"expo-constants\":\">=55 <57\",\"@robono/location\":\"^0.4.1\",\"expo-haptics\":\">=55 <57\",\"@robono/calling\":\"^0.7.0\",\"expo-media-library\":\">=55 <57\",\"expo-task-manager\":\">=55.0.0 <57.0.0\",\"expo-application\":\">=55 <57\",\"react-native-passkey\":\"^3.6.2\",\"expo-background-task\":\">=55 <57\",\"expo-network\":\">=55 <57\"}"
30
30
  }
31
31
  ],
32
32
  "files": [
@@ -55,11 +55,11 @@
55
55
  "checksums": [
56
56
  {
57
57
  "algorithm": "SHA256",
58
- "checksumValue": "893adf6368992850aa840c7b223a2cc3b0a8c2a42326ddbbbe9b318f7d6610d6"
58
+ "checksumValue": "3bb79f222f95fe324b861a93dd184a301edfa29a8907b241ebbac2b6287fb885"
59
59
  },
60
60
  {
61
61
  "algorithm": "SHA1",
62
- "checksumValue": "d71f008a6c9c489377ace92b48e1baba108b1a08"
62
+ "checksumValue": "30b1197d06fec8392a27df6b6921fa1c0f9afefd"
63
63
  }
64
64
  ],
65
65
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -1784,11 +1784,11 @@
1784
1784
  "checksums": [
1785
1785
  {
1786
1786
  "algorithm": "SHA256",
1787
- "checksumValue": "5dc64559d007e469a1d0508a431dc1cb6fdae6714ed8da58b03e46db6740907d"
1787
+ "checksumValue": "2702976a67ad769e2ed6045e857adf139bae1d74e3e277619f1f0ca04dafdfbf"
1788
1788
  },
1789
1789
  {
1790
1790
  "algorithm": "SHA1",
1791
- "checksumValue": "833b54d49cd5db46a273e706e1303227fac027f7"
1791
+ "checksumValue": "cbb0c8b099e8605afb17f0af6dc7eeb37beb551b"
1792
1792
  }
1793
1793
  ],
1794
1794
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -2126,11 +2126,11 @@
2126
2126
  "checksums": [
2127
2127
  {
2128
2128
  "algorithm": "SHA256",
2129
- "checksumValue": "11727d50470a32e57cc99725f7c4e490b9598f34d672ed409e2ac2a9fc1d5cdf"
2129
+ "checksumValue": "cef37378ac15ae305c5954fe4e305cd812c2ef84efdc89e6c68ba7ab214cc218"
2130
2130
  },
2131
2131
  {
2132
2132
  "algorithm": "SHA1",
2133
- "checksumValue": "99f7aaad476557bfce19c9ff5d53f75264b4f6b8"
2133
+ "checksumValue": "d958746acdcb8c369420f8366c1d589936ba42c2"
2134
2134
  }
2135
2135
  ],
2136
2136
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -2506,11 +2506,11 @@
2506
2506
  "checksums": [
2507
2507
  {
2508
2508
  "algorithm": "SHA256",
2509
- "checksumValue": "a8f9888d8a694856b541f26063dbd260a6df244094d475a61da2ab8d7e6cd1e7"
2509
+ "checksumValue": "e58e61237409f66cd13183fc2a811a069d4c12896e14c311b5451330cc224c0e"
2510
2510
  },
2511
2511
  {
2512
2512
  "algorithm": "SHA1",
2513
- "checksumValue": "324fee16111a981466f52df74035efac12632e32"
2513
+ "checksumValue": "563e4453753a5a862944d183035b46e98dca9942"
2514
2514
  }
2515
2515
  ],
2516
2516
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -3057,11 +3057,11 @@
3057
3057
  "checksums": [
3058
3058
  {
3059
3059
  "algorithm": "SHA256",
3060
- "checksumValue": "bd73b5e6c668d91170efb940ef45f9e13c8f0b3f384d1c4048c500decf52a891"
3060
+ "checksumValue": "816f6852344726a5acce8bcb94a0cfbef391d3edf183b96cbea8a0b055fdfc67"
3061
3061
  },
3062
3062
  {
3063
3063
  "algorithm": "SHA1",
3064
- "checksumValue": "061b3ee3f0725a951d5e9db686dfbd8eb2075835"
3064
+ "checksumValue": "4776e06491ca813861230f2001315e2f41a28ebc"
3065
3065
  }
3066
3066
  ],
3067
3067
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -3076,11 +3076,11 @@
3076
3076
  "checksums": [
3077
3077
  {
3078
3078
  "algorithm": "SHA256",
3079
- "checksumValue": "a3af419f6b7eb097df339a9c3715c78173ba4ade539b1d3dda2cf74ff3bbf041"
3079
+ "checksumValue": "0e44c2abd8ce6529fd4ec86cb6958c08391f925e1ccb5dc775d5e3c2b68eb23a"
3080
3080
  },
3081
3081
  {
3082
3082
  "algorithm": "SHA1",
3083
- "checksumValue": "5a554ed65d86eb8bde7a07f5e8c464bd43eb4509"
3083
+ "checksumValue": "61190012bd7feec7b00dbe6169bef3c1fa54fd3e"
3084
3084
  }
3085
3085
  ],
3086
3086
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -3513,11 +3513,11 @@
3513
3513
  "checksums": [
3514
3514
  {
3515
3515
  "algorithm": "SHA256",
3516
- "checksumValue": "fd461c6689caf2d73043be2ddc0c3f7c36551a1f6b3e6e19d727e79d5cbf8a51"
3516
+ "checksumValue": "ae0a67e0fa9e5e4f8022597f71c7ff955e166895b1d7e4e1f39179988c8073ef"
3517
3517
  },
3518
3518
  {
3519
3519
  "algorithm": "SHA1",
3520
- "checksumValue": "f3402aff141c0a31adfa984447546051ca7be6b0"
3520
+ "checksumValue": "a13abf31c8410289857a8bdfea59053233b4e457"
3521
3521
  }
3522
3522
  ],
3523
3523
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -3532,11 +3532,11 @@
3532
3532
  "checksums": [
3533
3533
  {
3534
3534
  "algorithm": "SHA256",
3535
- "checksumValue": "3eedd2898053141c4becd1f8e8c4cf6518aef61207971a7ec40625e1d47acce6"
3535
+ "checksumValue": "898219d79eb5a82948cee2a9e2df5b76b2bbf857032e18ef0251ea4119e1b5f8"
3536
3536
  },
3537
3537
  {
3538
3538
  "algorithm": "SHA1",
3539
- "checksumValue": "09b53c8bd7490e18699560a9f44eb5ca43912741"
3539
+ "checksumValue": "d6382fd0661d0c8ccf401de3348e33d54335e544"
3540
3540
  }
3541
3541
  ],
3542
3542
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -4235,11 +4235,11 @@
4235
4235
  "checksums": [
4236
4236
  {
4237
4237
  "algorithm": "SHA256",
4238
- "checksumValue": "7252bf273e9850bd5ffee4d624fa9a03a9b2d54613b92d704211135a02d53356"
4238
+ "checksumValue": "8c84be75feea383a5e9257d15ca6345afe112d6f78bb77236d5e197dfb14ad21"
4239
4239
  },
4240
4240
  {
4241
4241
  "algorithm": "SHA1",
4242
- "checksumValue": "3c6457ca08275d4137793ee58ededb1368e5a1e3"
4242
+ "checksumValue": "e4d697e268d8023d5de5b5f9d309c9d6816bd5c2"
4243
4243
  }
4244
4244
  ],
4245
4245
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -4254,11 +4254,11 @@
4254
4254
  "checksums": [
4255
4255
  {
4256
4256
  "algorithm": "SHA256",
4257
- "checksumValue": "070e348178c2758e15cb40bca8acb9c36135ee247c4f89030f6e9dd850ea72c2"
4257
+ "checksumValue": "97c4e776ecb88ec792d71266fd9a120a1c0c62379368123dc4917aa2ff59a056"
4258
4258
  },
4259
4259
  {
4260
4260
  "algorithm": "SHA1",
4261
- "checksumValue": "b22506042277f08ef3aa49e0264b9c78f18896cb"
4261
+ "checksumValue": "a5c95509dbc19e5aa49f03656975560a4b46d2d8"
4262
4262
  }
4263
4263
  ],
4264
4264
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -4653,11 +4653,11 @@
4653
4653
  "checksums": [
4654
4654
  {
4655
4655
  "algorithm": "SHA256",
4656
- "checksumValue": "d9635ba17a6f2fb7c038da2c176dfe1b6751e6c0085326b0d3757623be7ace3d"
4656
+ "checksumValue": "acbf165d78bf02f699a6ce700ae1e89e9253fb446d383df138e46ded4dccf406"
4657
4657
  },
4658
4658
  {
4659
4659
  "algorithm": "SHA1",
4660
- "checksumValue": "e6bf3cec812ebf3012aff17b21a7c88bc7996647"
4660
+ "checksumValue": "35763ee4ab63e017ae21eef9557f1e0c18a44c2a"
4661
4661
  }
4662
4662
  ],
4663
4663
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -4672,11 +4672,11 @@
4672
4672
  "checksums": [
4673
4673
  {
4674
4674
  "algorithm": "SHA256",
4675
- "checksumValue": "f75c04f5a015b421f2d5d00b98e419d9793d2975acf5cc0ba7547f29f6faf9e3"
4675
+ "checksumValue": "bd85f6101039375e51f1becbcaafb40c67a036b6c472419f771e03579ae73bcb"
4676
4676
  },
4677
4677
  {
4678
4678
  "algorithm": "SHA1",
4679
- "checksumValue": "fa4b820ea2135c529bbea4023c4d45e66e880609"
4679
+ "checksumValue": "27dd72fc506b3fb3b46f781b4d8c04821bad3eec"
4680
4680
  }
4681
4681
  ],
4682
4682
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -4729,11 +4729,11 @@
4729
4729
  "checksums": [
4730
4730
  {
4731
4731
  "algorithm": "SHA256",
4732
- "checksumValue": "b0502052e241377564ddadcb747052272d8a23037855adcb41e00ac4815f8646"
4732
+ "checksumValue": "d732feb06a0ca68dc069d2dc05a2dfdea2a6d5087e0c59e255f7d545dd2b4ef7"
4733
4733
  },
4734
4734
  {
4735
4735
  "algorithm": "SHA1",
4736
- "checksumValue": "d09fff3130f2c29a4a7afa997fe27a47fa184309"
4736
+ "checksumValue": "dc5f6a767bd7780dfe85c7a0bea44802f5e3f36a"
4737
4737
  }
4738
4738
  ],
4739
4739
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -4748,11 +4748,11 @@
4748
4748
  "checksums": [
4749
4749
  {
4750
4750
  "algorithm": "SHA256",
4751
- "checksumValue": "b52269313c952d9cf71de886f9ae2d502381da183bd46de0791c62d89b997640"
4751
+ "checksumValue": "0cd7b143bddcb1c89fed82706a85d79f15db160b2adf166784585a0382b272ff"
4752
4752
  },
4753
4753
  {
4754
4754
  "algorithm": "SHA1",
4755
- "checksumValue": "292e194cc9532fc5173418f07667b91ec8386b4a"
4755
+ "checksumValue": "81affb64d5df005397bd4c2180bee9efb71f561c"
4756
4756
  }
4757
4757
  ],
4758
4758
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -5085,16 +5085,16 @@
5085
5085
  "copyrightText": "Copyright (c) 2026 Add to Loop LLC."
5086
5086
  },
5087
5087
  {
5088
- "fileName": "./ios/RobonoBackupCloudKit.m",
5088
+ "fileName": "./ios/RobonoBackupCloudError.h",
5089
5089
  "SPDXID": "SPDXRef-File-266",
5090
5090
  "checksums": [
5091
5091
  {
5092
5092
  "algorithm": "SHA256",
5093
- "checksumValue": "4a824d8f8776e82fb03306af84a6259dde36c68b64f93403b7c2f021c1e394cf"
5093
+ "checksumValue": "79e19596aa4712d044b499563ec4b7ebfb401ae3b60120d1007a1be3dfee34ca"
5094
5094
  },
5095
5095
  {
5096
5096
  "algorithm": "SHA1",
5097
- "checksumValue": "f310523cf6d98d1108622430649060ec267b88ba"
5097
+ "checksumValue": "24e58fa8f95d6bab3ce1fdd33e18e6ddbbc383cb"
5098
5098
  }
5099
5099
  ],
5100
5100
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -5104,8 +5104,27 @@
5104
5104
  "copyrightText": "Copyright (c) 2026 Add to Loop LLC."
5105
5105
  },
5106
5106
  {
5107
- "fileName": "./ios/RobonoBackupCrypto.m",
5107
+ "fileName": "./ios/RobonoBackupCloudKit.m",
5108
5108
  "SPDXID": "SPDXRef-File-267",
5109
+ "checksums": [
5110
+ {
5111
+ "algorithm": "SHA256",
5112
+ "checksumValue": "74e5d0678656124d237a009ca5d6e6d856bba7ce66ab415a66d45f150b5336f8"
5113
+ },
5114
+ {
5115
+ "algorithm": "SHA1",
5116
+ "checksumValue": "2b7cd78db4be2c00d18ab69fce0aea044e3e8cbe"
5117
+ }
5118
+ ],
5119
+ "licenseConcluded": "LicenseRef-RobonoSDK",
5120
+ "licenseInfoInFiles": [
5121
+ "LicenseRef-RobonoSDK"
5122
+ ],
5123
+ "copyrightText": "Copyright (c) 2026 Add to Loop LLC."
5124
+ },
5125
+ {
5126
+ "fileName": "./ios/RobonoBackupCrypto.m",
5127
+ "SPDXID": "SPDXRef-File-268",
5109
5128
  "checksums": [
5110
5129
  {
5111
5130
  "algorithm": "SHA256",
@@ -5124,7 +5143,7 @@
5124
5143
  },
5125
5144
  {
5126
5145
  "fileName": "./ios/RobonoHistoryStore.m",
5127
- "SPDXID": "SPDXRef-File-268",
5146
+ "SPDXID": "SPDXRef-File-269",
5128
5147
  "checksums": [
5129
5148
  {
5130
5149
  "algorithm": "SHA256",
@@ -5143,7 +5162,7 @@
5143
5162
  },
5144
5163
  {
5145
5164
  "fileName": "./licenses/pdfjs-LICENSE",
5146
- "SPDXID": "SPDXRef-File-269",
5165
+ "SPDXID": "SPDXRef-File-270",
5147
5166
  "checksums": [
5148
5167
  {
5149
5168
  "algorithm": "SHA256",
@@ -5162,7 +5181,7 @@
5162
5181
  },
5163
5182
  {
5164
5183
  "fileName": "./licenses/robono-icons-lucide-license.txt",
5165
- "SPDXID": "SPDXRef-File-270",
5184
+ "SPDXID": "SPDXRef-File-271",
5166
5185
  "checksums": [
5167
5186
  {
5168
5187
  "algorithm": "SHA256",
@@ -5181,7 +5200,7 @@
5181
5200
  },
5182
5201
  {
5183
5202
  "fileName": "./licenses/robono-icons-weather-attribution.txt",
5184
- "SPDXID": "SPDXRef-File-271",
5203
+ "SPDXID": "SPDXRef-File-272",
5185
5204
  "checksums": [
5186
5205
  {
5187
5206
  "algorithm": "SHA256",
@@ -5200,7 +5219,7 @@
5200
5219
  },
5201
5220
  {
5202
5221
  "fileName": "./licenses/robono-icons-weather-license.txt",
5203
- "SPDXID": "SPDXRef-File-272",
5222
+ "SPDXID": "SPDXRef-File-273",
5204
5223
  "checksums": [
5205
5224
  {
5206
5225
  "algorithm": "SHA256",
@@ -5219,15 +5238,15 @@
5219
5238
  },
5220
5239
  {
5221
5240
  "fileName": "./package.json",
5222
- "SPDXID": "SPDXRef-File-273",
5241
+ "SPDXID": "SPDXRef-File-274",
5223
5242
  "checksums": [
5224
5243
  {
5225
5244
  "algorithm": "SHA256",
5226
- "checksumValue": "acbe88fc9b9b1cb1b1e83b7fa2f02938fd0c10d54205e2060947914b2bcd458f"
5245
+ "checksumValue": "cb381c254ba68d6e4b2f16c7075fd968753b435984e9082d29b4ef738bc5b1ab"
5227
5246
  },
5228
5247
  {
5229
5248
  "algorithm": "SHA1",
5230
- "checksumValue": "5f11574d719ef03a29f3f5c4a064c7a3b5627f5d"
5249
+ "checksumValue": "c5338761e2b817b524aad27f03c27f6f86ee69d9"
5231
5250
  }
5232
5251
  ],
5233
5252
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -5238,7 +5257,7 @@
5238
5257
  },
5239
5258
  {
5240
5259
  "fileName": "./plugin/backup-expiration.cjs",
5241
- "SPDXID": "SPDXRef-File-274",
5260
+ "SPDXID": "SPDXRef-File-275",
5242
5261
  "checksums": [
5243
5262
  {
5244
5263
  "algorithm": "SHA256",
@@ -5257,7 +5276,7 @@
5257
5276
  },
5258
5277
  {
5259
5278
  "fileName": "./plugin/prepare-native.cjs",
5260
- "SPDXID": "SPDXRef-File-275",
5279
+ "SPDXID": "SPDXRef-File-276",
5261
5280
  "checksums": [
5262
5281
  {
5263
5282
  "algorithm": "SHA256",
@@ -5276,7 +5295,7 @@
5276
5295
  },
5277
5296
  {
5278
5297
  "fileName": "./plugin/preserve-call-audio.cjs",
5279
- "SPDXID": "SPDXRef-File-276",
5298
+ "SPDXID": "SPDXRef-File-277",
5280
5299
  "checksums": [
5281
5300
  {
5282
5301
  "algorithm": "SHA256",
@@ -5295,7 +5314,7 @@
5295
5314
  },
5296
5315
  {
5297
5316
  "fileName": "./setup.plugin.cjs",
5298
- "SPDXID": "SPDXRef-File-277",
5317
+ "SPDXID": "SPDXRef-File-278",
5299
5318
  "checksums": [
5300
5319
  {
5301
5320
  "algorithm": "SHA256",
@@ -6708,6 +6727,11 @@
6708
6727
  "spdxElementId": "SPDXRef-Package",
6709
6728
  "relationshipType": "CONTAINS",
6710
6729
  "relatedSpdxElement": "SPDXRef-File-277"
6730
+ },
6731
+ {
6732
+ "spdxElementId": "SPDXRef-Package",
6733
+ "relationshipType": "CONTAINS",
6734
+ "relatedSpdxElement": "SPDXRef-File-278"
6711
6735
  }
6712
6736
  ],
6713
6737
  "hasExtractedLicensingInfos": [
@@ -1,7 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { messageLinks } from './message-links.js';
3
- import { WebView } from 'react-native-webview';
4
- import { pdfDocumentHtml } from './pdf-preview.js';
5
3
  import { useEffect, useState } from 'react';
6
4
  import { ScrollView, View, ActivityIndicator } from 'react-native';
7
5
  import { Text } from './typography.js';
@@ -22,8 +20,12 @@ export function ExpoDocumentPreview({ file, onOpenLink }) {
22
20
  setError('This PDF is too large to preview.');
23
21
  return;
24
22
  }
25
- void FS.readAsStringAsync(file.uri, { encoding: FS.EncodingType.Base64 }).then(bytes => { if (live)
26
- setHtml(pdfDocumentHtml(bytes, !!onOpenLink)); }).catch(() => { if (live)
23
+ void FS.readAsStringAsync(file.uri, { encoding: FS.EncodingType.Base64 }).then(bytes => {
24
+ if (!live)
25
+ return;
26
+ const { pdfDocumentHtml } = require('./pdf-preview.js');
27
+ setHtml(pdfDocumentHtml(bytes, !!onOpenLink));
28
+ }).catch(() => { if (live)
27
29
  setError('This PDF could not be opened. Try again.'); });
28
30
  return () => { live = false; };
29
31
  }
@@ -36,7 +38,8 @@ export function ExpoDocumentPreview({ file, onOpenLink }) {
36
38
  setError('This preview could not be opened. Close it and try again.'); });
37
39
  return () => { live = false; };
38
40
  }, [file.uri, file.mimeType, file.byteSize, !!onOpenLink]);
39
- return html ? _jsx(WebView, { accessibilityLabel: documentStatus, source: { html }, onMessage: event => { try {
41
+ const WebView = html ? require('react-native-webview').WebView : null;
42
+ return html && WebView ? _jsx(WebView, { accessibilityLabel: documentStatus, source: { html }, onMessage: event => { try {
40
43
  const value = JSON.parse(event.nativeEvent.data);
41
44
  if (value.type === 'robono-document-status' && typeof value.status === 'string' && /^(Page \d+ of \d+|Preview unavailable)$/.test(value.status)) {
42
45
  setDocumentStatus(value.status);
@@ -5,8 +5,6 @@ import { awaitMediaScreening } from './media-screening';
5
5
  import { AppState } from 'react-native';
6
6
  import { prepareRecordingPermission } from './recording-permission.js';
7
7
  import { AudioModule, RecordingPresets, createAudioPlayer, setAudioModeAsync } from 'expo-audio';
8
- import * as Picker from 'expo-image-picker';
9
- import * as Documents from 'expo-document-picker';
10
8
  import * as FS from 'expo-file-system/legacy';
11
9
  import { defaultAttachmentLimits } from '@robono/messaging';
12
10
  let audioOwner = false;
@@ -110,12 +108,14 @@ export function createExpoMessagingDevice(audio) {
110
108
  const copies = [];
111
109
  try {
112
110
  if (kind === 'document') {
111
+ const Documents = require('expo-document-picker');
113
112
  const result = await Documents.getDocumentAsync({ type: limits.allowedMimeTypes, multiple: maximum > 1, copyToCacheDirectory: true });
114
113
  assets = result.assets ?? [];
115
114
  if (result.canceled)
116
115
  return [];
117
116
  }
118
117
  else {
118
+ const Picker = require('expo-image-picker');
119
119
  if (source) {
120
120
  const permission = await Picker.requestCameraPermissionsAsync();
121
121
  check(signal);
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Text } from './typography.js';
3
3
  import { useRobonoLocale } from './localization.js';
4
+ import React from 'react';
4
5
  import { Linking, UIManager } from 'react-native';
5
6
  // Expo builds include this native module when the documented peer is installed.
6
- const available = !!UIManager.getViewManagerConfig('RNCWebView');
7
- const WebView = available ? require('react-native-webview').WebView : null;
8
7
  export function ExpoSocialPlayer({ html, origin, onError }) {
9
8
  const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
9
+ const WebView = React.useMemo(() => UIManager.getViewManagerConfig('RNCWebView') ? require('react-native-webview').WebView : null, []);
10
10
  if (!WebView)
11
11
  return _jsx(Text, { children: uiText("Update the app to play this preview.") });
12
12
  const open = (url) => { try {
package/dist/index.d.ts CHANGED
@@ -91,6 +91,8 @@ export interface MessagingScreenProps {
91
91
  transcription?: boolean;
92
92
  voiceOutput?: boolean;
93
93
  preferredLanguage?: string;
94
+ preferredVoice?: string | null;
95
+ voiceSampleBaseUrl?: string;
94
96
  revision?: string | number;
95
97
  };
96
98
  /** Disabled links render as plain text. Callbacks replace system navigation;
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { resolveMessagingVoice } from '@robono/messaging';
2
3
  export { MessagingLinkedAppsScreen } from './linked-apps.js';
3
4
  import { MessagingAccountPageScreen, messagingAccountPages, messagingAccountPageLabels } from './account-pages.js';
4
5
  export { messagingLanguages } from './account-pages.js';
@@ -55,14 +56,14 @@ export { MessagingSafety } from './safety.js';
55
56
  import { PollMessage, PollComposer } from "./polls.js";
56
57
  export { PollMessage, PollComposer } from "./polls.js";
57
58
  import React, { createContext, useContext, useMemo, useCallback, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore, } from "react";
58
- import { Animated, ActivityIndicator, AppState, BackHandler, FlatList, Image, Keyboard, Linking, Platform, Pressable, ScrollView, View, useWindowDimensions, } from "react-native";
59
+ import { Animated, ActivityIndicator, AppState, BackHandler, Dimensions, FlatList, Image, Keyboard, Linking, Platform, Pressable, ScrollView, View, useWindowDimensions, } from "react-native";
59
60
  import { useQuoteGesture, messageInfoRevealWidth, messageReplyRevealWidth } from "./use-quote-gesture.js";
60
61
  import { MessageIcon, duration, fileSize, chatSurface, composerSurface } from "./icons.js";
61
62
  import { VoiceMessageComposer } from "./voice-composer.js";
62
63
  export { VoiceMessageComposer, VoiceDraftPlayback } from "./voice-composer.js";
63
64
  import { VoicePlayback } from "./media-ui.js";
64
65
  export { VoicePlayback, MediaViewer, MediaPlaybackControls, ZoomablePhoto } from "./media-ui.js";
65
- import { MessagingError, findChatAddress, socialShare, needsMessageTranslation, supportedLanguageLabel, defaultMessagingSettings, defaultAttachmentLimits, messageReactions, savedMessageKey, } from "@robono/messaging";
66
+ import { MessagingError, findChatAddress, socialShare, needsMessageTranslation, supportedLanguageLabel, defaultMessagingSettings, messagingToolAvailable, defaultAttachmentLimits, messageReactions, savedMessageKey, } from "@robono/messaging";
66
67
  const Context = createContext(null);
67
68
  const noExtras = () => null;
68
69
  const noSubscribe = () => () => { };
@@ -190,7 +191,7 @@ function MessagingProviderContent({ children, ...props }) {
190
191
  const openDiscussion = useCallback((threadRoot) => setDiscussion({ threadRoot }), []);
191
192
  const value = {
192
193
  ...props,
193
- linkHandling, languageTools, openDiscussion, formatMessageTime,
194
+ linkHandling, languageTools, language: props.language ?? state.settings?.languageDefaults?.language, openDiscussion, formatMessageTime,
194
195
  state: visibleState,
195
196
  extrasState: extrasState?.conversationId === state.conversationId && state.settings?.enabled && !state.offline ? extrasState : null,
196
197
  reply: reply?.conversationId === state.conversationId
@@ -327,7 +328,7 @@ export function MessagingHeader({ children } = {}) {
327
328
  backgroundColor: c.incoming,
328
329
  alignItems: "center",
329
330
  justifyContent: "center",
330
- }, children: _jsx(Text, { style: { color: c.incomingText }, children: state.conversation?.kind === 'group' ? (state.conversation.name ?? 'Group').slice(0, 1) : contact.name.slice(0, 1) }) }))), _jsxs(View, { style: { flex: 1, minWidth: 0 }, children: [_jsx(Text, { numberOfLines: 1, style: { color: header.foreground, fontSize: chatDesign?.titleSize ?? 18, lineHeight: Math.ceil((chatDesign?.titleSize ?? 18) * 1.25), textAlign: chatDesign?.titleAlign ?? 'left', fontWeight: "800" }, children: state.conversation?.kind === 'group' ? state.conversation.name : contact.name }), _jsx(MessagingActivity, { ink: header.foreground })] })] }), messagingHeaderOrder(design).map(action => _jsx(React.Fragment, { children: action === 'switcher' ? chatDesign?.showSwitcher !== false && _jsx(ConversationSelector, { options: headerOptions, selectedId: state.conversationId, color: header.foreground, background: header.background }) : action === 'close' ? chatDesign?.showClose !== false && headerOptions?.onClose && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Close conversation"), onPress: headerOptions.onClose, style: { width: 44, height: 44, alignItems: "center", justifyContent: "center" }, children: _jsx(MessageIcon, { name: "close", color: header.foreground, size: 24 }) }) : action === 'calls' ? _jsxs(_Fragment, { children: [children, components?.HeaderActions && _jsx(components.HeaderActions, { conversationId: state.conversationId, contact: contact, appearance: design }), state.conversation?.canSend !== false && _jsx(MessagingHeaderCalls, { actions: callActions ? { ...callActions, ...(chatDesign?.showVoiceCall === false ? { voice: undefined, phoneNumber: undefined } : {}), ...(chatDesign?.showVideoCall === false ? { video: undefined } : {}) } : undefined, name: state.conversation?.kind === 'group' ? (state.conversation.name ?? 'Group') : contact.name, group: state.conversation?.kind === 'group', color: header.foreground }, state.conversationId)] }) : action === 'privacy' ? null : _jsx(View, { style: { width: 44, height: 44 }, children: (onContactOptions || extrasState?.available.privacyLens || extrasState?.privacyLens || conversationActions || state.settings?.enabled || state.conversation?.safety || state.searchAvailable || state.scheduledMessagesAvailable || translationAvailable) && (_jsx(Pressable, { accessibilityRole: "button", testID: "messaging-contact-options", accessibilityLabel: uiText("Contact options"), ref: menuButton, accessibilityState: { expanded: safetyOpen }, onPress: onContactOptions ?? openContactMenu, style: { width: 44, height: 44, alignItems: "center", justifyContent: "center" }, children: _jsx(MessageIcon, { name: "more", color: header.foreground, size: 25 }) })) }) }, action)), safetyOpen && _jsx(MessagingSafety, { onMedia: state.sharedMediaAvailable ? () => { setSafetyOpen(false); setDetailsTab('media'); setDetailsOpen(true); } : undefined, onOptions: state.presence?.visibilityAvailable || conversationActions || extrasState?.available.privacyLens || extrasState?.privacyLens ? () => { setSafetyOpen(false); setOptionsOpen(true); } : undefined, onScheduled: state.scheduledMessagesAvailable ? () => { setSafetyOpen(false); setScheduledOpen(true); } : undefined, onDetails: state.settings?.enabled ? () => { setSafetyOpen(false); setDetailsTab('profile'); setDetailsOpen(true); } : undefined, onPins: state.discussionAvailable ? () => { setSafetyOpen(false); openDiscussion(); } : undefined, menuAnchor: menuAnchor, client: client, state: state, appearance: design, name: state.conversation?.kind === 'group' ? (state.conversation.name ?? 'Conversation') : contact.name, onSearch: state.searchAvailable && state.settings?.enabled ? () => { setSafetyOpen(false); setSearchOpen(true); } : undefined, onClose: () => setSafetyOpen(false), children: translationAvailable && _jsx(TranslationSettings, { client: client, appearance: design, preference: state.translationPreference, language: languageTools?.preferredLanguage ?? language, sourceLanguage: contact.language, voiceAvailable: languageTools?.voiceOutput !== false && !!components?.TranslationVoice, onSaved: () => setSafetyOpen(false) }, state.conversationId) })] }), scheduledOpen && _jsx(ScheduledMessages, { client: client, accent: c.accent, onClose: () => setScheduledOpen(false) }, state.conversationId), groupOpen && _jsx(MessagingGroupEditor, { client: client, userId: userId, contacts: participants ?? {}, conversation: state.conversation, groups: state.settings?.groups, accent: c.accent, onClose: () => setGroupOpen(false), onSaved: () => setGroupOpen(false) }), moderationOpen && _jsx(MessagingRoomModeration, { client: client, userId: userId, participants: participants, accent: c.accent, onClose: () => setModerationOpen(false) }), optionsOpen && _jsx(ChatOptions, { online: state.presence?.visibilityAvailable ? { hidden: state.presence.hidden === true, set: hidden => client.setOnlineStatusHidden(hidden) } : undefined, actions: conversationActions, accent: c.accent, onClose: () => setOptionsOpen(false), privacy: extras && extrasState && (extrasState.available.privacyLens || extrasState.privacyLens) ? { enabled: extrasState.privacyLens, set: enabled => extras.setPrivacy(enabled) } : undefined }), detailsOpen && _jsx(ConversationDetails, { initialTab: detailsTab, onOptions: state.presence?.visibilityAvailable || conversationActions ? () => setOptionsOpen(true) : undefined, onModerate: () => setModerationOpen(true), onEditGroup: () => setGroupOpen(true), onLeft: onBack, client: client, state: state, userId: userId, contact: contact, participants: participants, accent: c.accent, onClose: () => setDetailsOpen(false), attachmentPreview: attachmentPreview, openAttachment: openAttachment }), searchOpen && state.searchAvailable && state.settings?.enabled && _jsx(MessagingSearch, { client: client, appearance: design, onClose: () => setSearchOpen(false), resolveName: id => id === userId ? 'You' : participants?.[id]?.name ?? (state.conversation?.kind === 'direct' ? contact.name : 'Chat member') }, state.conversationId)] }));
331
+ }, children: _jsx(Text, { style: { color: c.incomingText }, children: state.conversation?.kind === 'group' ? (state.conversation.name ?? 'Group').slice(0, 1) : contact.name.slice(0, 1) }) }))), _jsxs(View, { style: { flex: 1, minWidth: 0 }, children: [_jsx(Text, { numberOfLines: 1, style: { color: header.foreground, fontSize: chatDesign?.titleSize ?? 18, lineHeight: Math.ceil((chatDesign?.titleSize ?? 18) * 1.25), textAlign: chatDesign?.titleAlign ?? 'left', fontWeight: "800" }, children: state.conversation?.kind === 'group' ? state.conversation.name : contact.name }), _jsx(MessagingActivity, { ink: header.foreground })] })] }), messagingHeaderOrder(design).map(action => _jsx(React.Fragment, { children: action === 'switcher' ? chatDesign?.showSwitcher !== false && _jsx(ConversationSelector, { options: headerOptions, selectedId: state.conversationId, color: header.foreground, background: header.background }) : action === 'close' ? chatDesign?.showClose !== false && headerOptions?.onClose && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Close conversation"), onPress: headerOptions.onClose, style: { width: 44, height: 44, alignItems: "center", justifyContent: "center" }, children: _jsx(MessageIcon, { name: "close", color: header.foreground, size: 24 }) }) : action === 'calls' ? _jsxs(_Fragment, { children: [children, components?.HeaderActions && _jsx(components.HeaderActions, { conversationId: state.conversationId, contact: contact, appearance: design }), state.conversation?.canSend !== false && _jsx(MessagingHeaderCalls, { actions: callActions ? { ...callActions, ...(chatDesign?.showVoiceCall === false ? { voice: undefined, phoneNumber: undefined } : {}), ...(chatDesign?.showVideoCall === false ? { video: undefined } : {}) } : undefined, name: state.conversation?.kind === 'group' ? (state.conversation.name ?? 'Group') : contact.name, group: state.conversation?.kind === 'group', color: header.foreground }, state.conversationId)] }) : action === 'privacy' ? null : _jsx(View, { style: { width: 44, height: 44 }, children: (onContactOptions || extrasState?.available.privacyLens || extrasState?.privacyLens || conversationActions || state.settings?.enabled || state.conversation?.safety || state.searchAvailable || state.scheduledMessagesAvailable || translationAvailable) && (_jsx(Pressable, { accessibilityRole: "button", testID: "messaging-contact-options", accessibilityLabel: uiText("Contact options"), ref: menuButton, accessibilityState: { expanded: safetyOpen }, onPress: onContactOptions ?? openContactMenu, style: { width: 44, height: 44, alignItems: "center", justifyContent: "center" }, children: _jsx(MessageIcon, { name: "more", color: header.foreground, size: 25 }) })) }) }, action)), safetyOpen && _jsx(MessagingSafety, { onMedia: state.sharedMediaAvailable ? () => { setSafetyOpen(false); setDetailsTab('media'); setDetailsOpen(true); } : undefined, onOptions: state.presence?.visibilityAvailable || conversationActions || extrasState?.available.privacyLens || extrasState?.privacyLens ? () => { setSafetyOpen(false); setOptionsOpen(true); } : undefined, onScheduled: state.scheduledMessagesAvailable ? () => { setSafetyOpen(false); setScheduledOpen(true); } : undefined, onDetails: state.settings?.enabled ? () => { setSafetyOpen(false); setDetailsTab('profile'); setDetailsOpen(true); } : undefined, onPins: state.discussionAvailable ? () => { setSafetyOpen(false); openDiscussion(); } : undefined, menuAnchor: menuAnchor, client: client, state: state, appearance: design, name: state.conversation?.kind === 'group' ? (state.conversation.name ?? 'Conversation') : contact.name, onSearch: state.searchAvailable && state.settings?.enabled ? () => { setSafetyOpen(false); setSearchOpen(true); } : undefined, onClose: () => setSafetyOpen(false), children: translationAvailable && _jsx(TranslationSettings, { client: client, appearance: design, preference: state.translationPreference, language: languageTools?.preferredLanguage ?? language, sourceLanguage: contact.language, defaults: state.settings?.languageDefaults, preferredVoice: languageTools?.preferredVoice, VoiceSample: components?.TranslationVoice, sampleBaseUrl: languageTools?.voiceSampleBaseUrl, voiceAvailable: languageTools?.voiceOutput !== false && !!components?.TranslationVoice, onSaved: () => setSafetyOpen(false) }, state.conversationId) })] }), scheduledOpen && _jsx(ScheduledMessages, { client: client, accent: c.accent, onClose: () => setScheduledOpen(false) }, state.conversationId), groupOpen && _jsx(MessagingGroupEditor, { client: client, userId: userId, contacts: participants ?? {}, conversation: state.conversation, groups: state.settings?.groups, accent: c.accent, onClose: () => setGroupOpen(false), onSaved: () => setGroupOpen(false) }), moderationOpen && _jsx(MessagingRoomModeration, { client: client, userId: userId, participants: participants, accent: c.accent, onClose: () => setModerationOpen(false) }), optionsOpen && _jsx(ChatOptions, { online: state.presence?.visibilityAvailable ? { hidden: state.presence.hidden === true, set: hidden => client.setOnlineStatusHidden(hidden) } : undefined, actions: conversationActions, accent: c.accent, onClose: () => setOptionsOpen(false), privacy: extras && extrasState && (extrasState.available.privacyLens || extrasState.privacyLens) ? { enabled: extrasState.privacyLens, set: enabled => extras.setPrivacy(enabled) } : undefined }), detailsOpen && _jsx(ConversationDetails, { initialTab: detailsTab, onOptions: state.presence?.visibilityAvailable || conversationActions ? () => setOptionsOpen(true) : undefined, onModerate: () => setModerationOpen(true), onEditGroup: () => setGroupOpen(true), onLeft: onBack, client: client, state: state, userId: userId, contact: contact, participants: participants, accent: c.accent, onClose: () => setDetailsOpen(false), attachmentPreview: attachmentPreview, openAttachment: openAttachment }), searchOpen && state.searchAvailable && state.settings?.enabled && _jsx(MessagingSearch, { client: client, appearance: design, onClose: () => setSearchOpen(false), resolveName: id => id === userId ? 'You' : participants?.[id]?.name ?? (state.conversation?.kind === 'direct' ? contact.name : 'Chat member') }, state.conversationId)] }));
331
332
  }
332
333
  const mediaNames = {
333
334
  voice: "Voice message",
@@ -457,7 +458,7 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
457
458
  const extra = candidateExtra?.address && (linkHandling?.addresses === false || linkHandling?.openAddress) ? undefined : candidateExtra;
458
459
  const extraRef = useRef(null), socialRef = useRef(null);
459
460
  const socialOrigin = ui.socialOrigin ?? 'https://robono.com';
460
- const socialReady = linkHandling?.webLinks !== false && !linkHandling?.openUrl && !message.custom && !extra?.address && !pendingStatus && !message.deleted && message.kind === 'text' && state.settings?.enabled && state.socialPreviewAvailable && components?.SocialPlayer && messageLinks(message.text ?? '').some(link => !!link.url && !!socialShare(link.url, socialOrigin));
461
+ const socialReady = linkHandling?.webLinks !== false && !linkHandling?.openUrl && !message.custom && !extra?.address && !pendingStatus && !message.deleted && message.kind === 'text' && state.settings?.enabled && messagingToolAvailable(design, 'socialPreviews', state.socialPreviewAvailable) && components?.SocialPlayer && messageLinks(message.text ?? '').some(link => !!link.url && !!socialShare(link.url, socialOrigin));
461
462
  const contextContactName = contact.name;
462
463
  const mine = message.senderId === userId, c = design.colors, ink = message.kind === 'poll' ? c.foreground : mine ? c.outgoingText : c.incomingText;
463
464
  const corners = bubbleCorners(design, mine), bubbleRadius = corners.borderTopRightRadius;
@@ -476,10 +477,11 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
476
477
  useEffect(() => () => { afterMenu.current = null; }, [client, message.id]);
477
478
  const wholeMessage = message.part ? client.getSnapshot().messages.find(m => m.id === message.id) ?? message : message;
478
479
  const canChange = (!message.part || wholeMessage !== message) && !extra?.weather && !extra?.call && mine && !pendingStatus && !message.deleted && !!state.messageActionsAvailable && !!state.settings?.enabled && state.conversation?.canSend !== false && !wholeMessage.readAt && !wholeMessage.textReadAt;
479
- const anchor = useRef(null), viewport = useWindowDimensions();
480
- const [menuPosition, setMenuPosition] = useState({ x: 12, y: 12, above: false, available: 400 }), [hovered, setHovered] = useState(false);
480
+ const anchor = useRef(null);
481
+ const [menuPosition, setMenuPosition] = useState(null), [hovered, setHovered] = useState(false);
481
482
  const [addressBubbleHeight, setAddressBubbleHeight] = useState(44);
482
483
  const openMenu = () => anchor.current?.measureInWindow((x, y, width, height) => {
484
+ const viewport = Dimensions.get('window');
483
485
  setMenuPosition(messageMenuPosition(x, y, width, height, viewport.width, viewport.height, mine));
484
486
  setActions(true);
485
487
  });
@@ -488,10 +490,13 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
488
490
  const canTranscript = languageTools?.transcription !== false && !pendingStatus && (voice || message.kind === 'video') && !!state.settings?.features.transcription && client.hasLanguageTools() && !message.deleted;
489
491
  const translation = state.translationPreference;
490
492
  const translationLanguage = translation?.language ?? languageTools?.preferredLanguage ?? language;
493
+ const translationVoice = languageTools?.voiceOutput === false || !state.settings?.features.translation
494
+ ? undefined
495
+ : resolveMessagingVoice(translationLanguage ?? Intl.DateTimeFormat().resolvedOptions().locale, translation?.voice, languageTools?.preferredVoice, state.settings?.languageDefaults?.voices);
491
496
  const sourceLanguage = participants?.[message.senderId]?.language ?? (state.conversation?.kind === 'direct' ? contact.language : undefined) ?? translation?.sourceLanguage;
492
497
  const canTranslate = message.part !== 'text' && 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);
493
498
  const transformGeneration = useRef(0), transformAbort = useRef(null);
494
- 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]);
499
+ 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, translationVoice, translation?.mode, sourceLanguage, state.settings?.enabled, state.settings?.features.transcription, state.settings?.features.translation, languageTools?.translation, languageTools?.transcription, languageTools?.voiceOutput, languageTools?.revision]);
495
500
  useEffect(() => { if (!transformed?.audio)
496
501
  return; const timer = setTimeout(() => setTransformed(null), Math.max(0, Date.parse(transformed.audio.expiresAt) - Date.now())); return () => clearTimeout(timer); }, [transformed]);
497
502
  async function transform(kind, output = 'text') { setShowOriginal(false); setTranslationAutoPlay(false); if (transformed?.kind === kind && !!transformed.audio === (output === 'voice')) {
@@ -499,7 +504,7 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
499
504
  return;
500
505
  } if (transforming)
501
506
  return; const generation = ++transformGeneration.current, controller = transformAbort.current = new AbortController(); setTransforming(true); setActions(false); setError(''); try {
502
- const result = await client.transform(message.id, kind, translationLanguage ?? Intl.DateTimeFormat().resolvedOptions().locale, output, { signal: controller.signal, sourceLanguage: sourceLanguage ?? undefined });
507
+ const result = await client.transform(message.id, kind, translationLanguage ?? Intl.DateTimeFormat().resolvedOptions().locale, output, { signal: controller.signal, sourceLanguage: sourceLanguage ?? undefined, ...(output === 'voice' && translationVoice !== undefined ? { voice: translationVoice } : {}) });
503
508
  if (generation === transformGeneration.current) {
504
509
  setTransformed(result);
505
510
  setShowOriginal(false);
@@ -594,8 +599,8 @@ const MessagingBubbleView = React.memo(function MessagingBubbleView({ message, p
594
599
  return; if (extra?.address)
595
600
  extraRef.current?.open();
596
601
  else
597
- socialRef.current?.open(); } : () => void open(), children: bodyContent }), !discussionPreview && state.discussionAvailable && !!message.replyCount && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: message.replyCount + ' ' + (message.replyCount === 1 ? 'reply' : 'replies'), onPress: () => openDiscussion(message.id), style: { minHeight: 32, justifyContent: 'center' }, children: _jsxs(Text, { style: { color: c.accent, fontSize: 12, fontWeight: '600' }, children: [message.replyCount, " ", message.replyCount === 1 ? uiText("reply") : uiText("replies")] }) }), message.kind !== 'text' && !!message.text && _jsx(View, { testID: voice ? 'voice-message-caption' : undefined, style: voice && !showingTransform ? { maxWidth: 220, alignSelf: mine ? 'flex-end' : 'flex-start', marginTop: 1, paddingTop: 4, paddingBottom: 1, borderRadius: 14, ...(mine ? { borderBottomEndRadius: 3 } : { borderBottomStartRadius: 3 }), backgroundColor: mine ? c.outgoing : c.incoming } : visual ? { backgroundColor: mine ? c.outgoing : c.incoming, ...corners, borderTopLeftRadius: 0, borderTopRightRadius: 0, paddingHorizontal: 6, paddingVertical: 3, ...(mine ? { paddingRight: 12 } : { paddingLeft: 12 }), ...(circleStatus ? { paddingEnd: 24 } : {}) } : undefined, children: _jsx(Text, { testID: "attachment-caption", selectable: true, onLongPress: menu, style: { color: ink, fontSize: 16, lineHeight: 22, marginTop: voice ? 0 : 2, textAlign: 'left', alignSelf: 'stretch', paddingHorizontal: voice || message.kind === 'document' ? 8 : 2, ...(voice || message.kind === 'document' ? (mine ? { paddingRight: 14 } : { paddingLeft: 14 }) : {}), paddingBottom: 2 }, children: renderText(message.text) }) }), deliveryStatus && message.kind !== 'text' && message.kind !== 'poll' && !voice && !visual && _jsx(View, { style: { marginTop: 4, alignSelf: 'flex-end' }, children: footer }), (!voice || showingTransform) && languageActions, (!voice || showingTransform) && insideMeta, components?.MessageFooter && !message.deleted && _jsx(components.MessageFooter, { ...regionProps }), transforming && !voice && _jsx(Text, { accessibilityLiveRegion: "polite", style: { color: ink, fontSize: 11 }, children: uiText("Converting…") }), !!error && _jsxs(MessagingPopup, { screen: "alerts", compact: true, contentWidth: 640, title: uiText("Message"), foreground: c.foreground, background: chatSurface(c.background), onClose: () => setError(''), children: [_jsx(Text, { accessibilityRole: "alert", style: { color: messagingPopupColors.foreground, fontSize: 15, lineHeight: 21, marginTop: 8 }, children: error }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Close message alert"), onPress: () => setError(''), style: { alignSelf: 'flex-end', minHeight: 44, justifyContent: 'center', paddingHorizontal: 8, marginTop: 8 }, children: _jsx(Text, { style: { color: c.accent }, children: uiText("OK") }) })] }), (showingTransform || message.custom || extra?.weather || extra?.call || message.kind === 'text' || message.kind === 'poll') && sendRetry, Platform.OS === 'web' && !mine && canInteract && state.settings?.features.reactions && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("React to message"), onFocus: () => setHovered(true), onBlur: () => setHovered(false), onPress: openMenu, style: { opacity: hovered || actions ? 1 : 0, position: 'absolute', top: 6, ...(mine ? { left: -34 } : { right: -34 }), width: 32, height: 32, alignItems: 'center', justifyContent: 'center' }, children: _jsx(MessageIcon, { name: "reaction", color: c.secondary, size: 20 }) }), !!message.reactions?.length && _jsx(View, { testID: "message-reaction-badge", pointerEvents: "none", accessibilityLabel: message.reactions.slice(-3).map(r => r.emoji).join(' '), style: { position: 'absolute', zIndex: 41, top: -16, ...(mine ? { end: -9 } : { start: -9 }), minWidth: 30, height: 20, alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { fontSize: 16, lineHeight: 20 }, children: message.reactions.slice(-3).map(r => r.emoji).join(' ') }) }), _jsx(MessageMenu, { visible: actions, position: menuPosition, screenHeight: viewport.height, mine: mine, reactions: reactionPicker, onClose: () => setActions(false), onDismiss: menuDismissed, children: actions && _jsxs(_Fragment, { children: [quoting && _jsx(MessageMenuRow, { icon: "quote", label: uiText("Quote message"), onPress: () => { setActions(false); setReply(message); } }), !discussionPreview && state.discussionAvailable && !pendingStatus && !message.deleted && _jsx(MessageMenuRow, { icon: "quote", label: uiText("Replies"), onPress: () => leaveMenu(() => openDiscussion(message.threadRoot ?? message.id)) }), state.discussionAvailable && canInteract && state.conversation?.ownerId === userId && _jsx(MessageMenuRow, { icon: "bookmark", label: message.pinned ? uiText("Unpin for group") : uiText("Pin for group"), onPress: () => { setActions(false); void client.pinMessage(message.id, !message.pinned).catch(e => setError(e instanceof Error ? e.message : uiText("The pin could not change."))); } }), canCopy && _jsx(MessageMenuRow, { icon: "copy", label: uiText("Copy"), onPress: () => { setActions(false); void (copyText ? copyText(message.text) : navigator.clipboard.writeText(message.text)).catch(() => setError(uiText("The text could not be copied."))); } }), canInteract && client.canForward(message) && _jsx(MessageMenuRow, { icon: "redo", label: uiText("Forward"), onPress: () => leaveMenu(() => setForwarding([message])) }), !pendingStatus && !message.deleted && message.kind !== 'poll' && client.hasSavedMessages() && _jsx(MessageMenuRow, { icon: "bookmark", label: saved.some(r => r.key === savedMessageKey(wholeMessage)) ? uiText("Remove from Saved") : uiText(message.part ? "Save both items" : "Save"), disabled: saving, onPress: () => { setActions(false); void toggleSaved(wholeMessage); } }), canChange && !message.custom && message.kind !== 'poll' && state.settings?.features[message.kind] && _jsx(MessageMenuRow, { icon: "edit", label: uiText(message.part ? "Edit both items" : "Edit"), onPress: () => { setActions(false); setEditing(wholeMessage); } }), !mine && state.conversation?.safety?.canReport && _jsx(MessageMenuRow, { icon: "flag", label: uiText("Report"), danger: true, onPress: () => leaveMenu(() => setReportOpen(true)) }), !pendingStatus && !message.deleted && ['owner', 'moderator'].includes(state.conversation?.roomRole ?? '') && _jsx(MessageMenuRow, { icon: "trash", label: uiText('Remove from group'), danger: true, onPress: () => leaveMenu(() => setRoomRemoval(true)) }), canChange && _jsx(MessageMenuRow, { icon: "trash", label: uiText(message.part ? "Delete both items" : "Delete"), danger: true, onPress: () => leaveMenu(() => setDeleting([wholeMessage])) }), (pendingStatus === 'failed' || pendingStatus === 'queued') && _jsx(MessageMenuRow, { icon: "trash", label: uiText("Remove unsent message"), danger: true, onPress: () => { setActions(false); void client.discardPending(message.clientMessageId).catch(() => setError(uiText("The unsent message could not be removed."))); } }), !pendingStatus && onMessageOptions && _jsx(MessageMenuRow, { icon: "more", label: uiText("More options"), onPress: () => leaveMenu(() => onMessageOptions(message)) }), !pendingStatus && !message.deleted && _jsx(MessageMenuRow, { icon: "check", label: uiText(message.part ? "Select both items" : "Select Multiple"), divider: true, onPress: () => { setActions(false); setSelection([wholeMessage]); Keyboard.dismiss(); } })] }) }), roomRemoval && _jsx(MessagingRoomRemoval, { client: client, message: message, accent: c.accent, onClose: () => setRoomRemoval(false) }), reportOpen && _jsx(MessagingSafety, { client: client, state: state, appearance: design, name: participants?.[message.senderId]?.name ?? 'Contact', messageId: message.id, onClose: () => setReportOpen(false) })] });
598
- return _jsxs(View, { ...(Platform.OS === 'web' ? { onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), onContextMenu: (event) => { event.preventDefault(); menu(); } } : {}), style: { width: '100%', position: 'relative', marginTop: messageGap + (message.reactions?.length ? 16 : 0), marginBottom: 0 }, children: [quoteGesture.infoLoaded && _jsxs(Animated.View, { pointerEvents: "none", testID: "message-info-reveal", accessible: false, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: { ...quoteGesture.revealWebStyle, position: 'absolute', top: '50%', marginTop: -26, minHeight: 52, width: messageInfoRevealWidth, justifyContent: 'center', ...(mine ? { start: 0, alignItems: 'flex-start' } : { end: 0, alignItems: 'flex-end' }), opacity: quoteGesture.infoOpacity }, children: [_jsx(_Fragment, { children: timePosition === 'slide' && _jsxs(View, { style: { flexDirection: 'row', alignItems: 'baseline', gap: 4 }, children: [_jsx(Text, { style: { color: c.secondary, fontSize: 8, lineHeight: 11, fontWeight: '900' }, children: uiText("SENT:") }), _jsx(Text, { testID: "message-slide-time", style: { color: c.foreground, fontSize: 10, lineHeight: 12, fontWeight: '800' }, children: messageTimeLabel(message, ui.formatMessageTime, uiText) })] }) }), mine && state.settings?.features.readReceipts && _jsxs(View, { style: { flexDirection: 'row', alignItems: 'baseline', gap: 4 }, children: [_jsx(Text, { style: { color: c.secondary, fontSize: 8, lineHeight: 11, fontWeight: '900' }, children: uiText("READ:") }), _jsx(Text, { style: { color: message.readAt ? c.foreground : c.secondary, fontSize: 10, lineHeight: 12, fontWeight: '800' }, children: message.readAt ? ui.formatMessageTime(message.readAt) : uiText("Not yet") })] })] }), quoting && _jsxs(Animated.View, { pointerEvents: "none", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' }), testID: `quote-reveal-${mine ? 'outgoing' : 'incoming'}`, style: { ...quoteGesture.revealWebStyle, position: 'absolute', top: '50%', marginTop: -26, ...(mine ? { end: 0 } : { start: 0 }), width: messageReplyRevealWidth, minHeight: 52, gap: 3, alignItems: 'center', justifyContent: 'center', opacity: quoteGesture.revealOpacity }, children: [_jsx(View, { style: { width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center', backgroundColor: chatSurface(c.background), borderWidth: 1.5, borderColor: c.secondary + '40' }, children: _jsx(MessageIcon, { name: "quote", color: c.accent, size: 30 }) }), _jsx(Text, { style: { color: c.secondary, fontSize: 10, fontWeight: '900' }, children: uiText("QUOTE MESSAGE") })] }), _jsxs(Animated.View, { ref: node => { anchor.current = node; if (quoteGesture.webRef)
602
+ socialRef.current?.open(); } : () => void open(), children: bodyContent }), !discussionPreview && state.discussionAvailable && !!message.replyCount && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: message.replyCount + ' ' + (message.replyCount === 1 ? 'reply' : 'replies'), onPress: () => openDiscussion(message.id), style: { minHeight: 32, justifyContent: 'center' }, children: _jsxs(Text, { style: { color: c.accent, fontSize: 12, fontWeight: '600' }, children: [message.replyCount, " ", message.replyCount === 1 ? uiText("reply") : uiText("replies")] }) }), message.kind !== 'text' && !!message.text && _jsx(View, { testID: voice ? 'voice-message-caption' : undefined, style: voice && !showingTransform ? { maxWidth: 220, alignSelf: mine ? 'flex-end' : 'flex-start', marginTop: 1, paddingTop: 4, paddingBottom: 1, borderRadius: 14, ...(mine ? { borderBottomEndRadius: 3 } : { borderBottomStartRadius: 3 }), backgroundColor: mine ? c.outgoing : c.incoming } : visual ? { backgroundColor: mine ? c.outgoing : c.incoming, ...corners, borderTopLeftRadius: 0, borderTopRightRadius: 0, paddingHorizontal: 6, paddingVertical: 3, ...(mine ? { paddingRight: 12 } : { paddingLeft: 12 }), ...(circleStatus ? { paddingEnd: 24 } : {}) } : undefined, children: _jsx(Text, { testID: "attachment-caption", selectable: true, onLongPress: menu, style: { color: ink, fontSize: 16, lineHeight: 22, marginTop: voice ? 0 : 2, textAlign: 'left', alignSelf: 'stretch', paddingHorizontal: voice || message.kind === 'document' ? 8 : 2, ...(voice || message.kind === 'document' ? (mine ? { paddingRight: 14 } : { paddingLeft: 14 }) : {}), paddingBottom: 2 }, children: renderText(message.text) }) }), deliveryStatus && message.kind !== 'text' && message.kind !== 'poll' && !voice && !visual && _jsx(View, { style: { marginTop: 4, alignSelf: 'flex-end' }, children: footer }), (!voice || showingTransform) && languageActions, (!voice || showingTransform) && insideMeta, components?.MessageFooter && !message.deleted && _jsx(components.MessageFooter, { ...regionProps }), transforming && !voice && _jsx(Text, { accessibilityLiveRegion: "polite", style: { color: ink, fontSize: 11 }, children: uiText("Converting…") }), !!error && _jsxs(MessagingPopup, { screen: "alerts", compact: true, contentWidth: 640, title: uiText("Message"), foreground: c.foreground, background: chatSurface(c.background), onClose: () => setError(''), children: [_jsx(Text, { accessibilityRole: "alert", style: { color: messagingPopupColors.foreground, fontSize: 15, lineHeight: 21, marginTop: 8 }, children: error }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Close message alert"), onPress: () => setError(''), style: { alignSelf: 'flex-end', minHeight: 44, justifyContent: 'center', paddingHorizontal: 8, marginTop: 8 }, children: _jsx(Text, { style: { color: c.accent }, children: uiText("OK") }) })] }), (showingTransform || message.custom || extra?.weather || extra?.call || message.kind === 'text' || message.kind === 'poll') && sendRetry, Platform.OS === 'web' && !mine && canInteract && state.settings?.features.reactions && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("React to message"), onFocus: () => setHovered(true), onBlur: () => setHovered(false), onPress: openMenu, style: { opacity: hovered || actions ? 1 : 0, position: 'absolute', top: 6, ...(mine ? { left: -34 } : { right: -34 }), width: 32, height: 32, alignItems: 'center', justifyContent: 'center' }, children: _jsx(MessageIcon, { name: "reaction", color: c.secondary, size: 20 }) }), !!message.reactions?.length && _jsx(View, { testID: "message-reaction-badge", pointerEvents: "none", accessibilityLabel: message.reactions.slice(-3).map(r => r.emoji).join(' '), style: { position: 'absolute', zIndex: 41, top: -16, ...(mine ? { end: -9 } : { start: -9 }), minWidth: 30, height: 20, alignItems: 'center', justifyContent: 'center' }, children: _jsx(Text, { style: { fontSize: 16, lineHeight: 20 }, children: message.reactions.slice(-3).map(r => r.emoji).join(' ') }) }), menuPosition && _jsx(MessageMenu, { visible: actions, position: menuPosition, mine: mine, reactions: reactionPicker, onClose: () => setActions(false), onDismiss: menuDismissed, children: actions && _jsxs(_Fragment, { children: [quoting && _jsx(MessageMenuRow, { icon: "quote", label: uiText("Quote message"), onPress: () => { setActions(false); setReply(message); } }), !discussionPreview && state.discussionAvailable && !pendingStatus && !message.deleted && _jsx(MessageMenuRow, { icon: "quote", label: uiText("Replies"), onPress: () => leaveMenu(() => openDiscussion(message.threadRoot ?? message.id)) }), state.discussionAvailable && canInteract && state.conversation?.ownerId === userId && _jsx(MessageMenuRow, { icon: "bookmark", label: message.pinned ? uiText("Unpin for group") : uiText("Pin for group"), onPress: () => { setActions(false); void client.pinMessage(message.id, !message.pinned).catch(e => setError(e instanceof Error ? e.message : uiText("The pin could not change."))); } }), canCopy && _jsx(MessageMenuRow, { icon: "copy", label: uiText("Copy"), onPress: () => { setActions(false); void (copyText ? copyText(message.text) : navigator.clipboard.writeText(message.text)).catch(() => setError(uiText("The text could not be copied."))); } }), canInteract && client.canForward(message) && _jsx(MessageMenuRow, { icon: "redo", label: uiText("Forward"), onPress: () => leaveMenu(() => setForwarding([message])) }), !pendingStatus && !message.deleted && message.kind !== 'poll' && client.hasSavedMessages() && _jsx(MessageMenuRow, { icon: "bookmark", label: saved.some(r => r.key === savedMessageKey(wholeMessage)) ? uiText("Remove from Saved") : uiText(message.part ? "Save both items" : "Save"), disabled: saving, onPress: () => { setActions(false); void toggleSaved(wholeMessage); } }), canChange && !message.custom && message.kind !== 'poll' && state.settings?.features[message.kind] && _jsx(MessageMenuRow, { icon: "edit", label: uiText(message.part ? "Edit both items" : "Edit"), onPress: () => { setActions(false); setEditing(wholeMessage); } }), !mine && state.conversation?.safety?.canReport && _jsx(MessageMenuRow, { icon: "flag", label: uiText("Report"), danger: true, onPress: () => leaveMenu(() => setReportOpen(true)) }), !pendingStatus && !message.deleted && ['owner', 'moderator'].includes(state.conversation?.roomRole ?? '') && _jsx(MessageMenuRow, { icon: "trash", label: uiText('Remove from group'), danger: true, onPress: () => leaveMenu(() => setRoomRemoval(true)) }), canChange && _jsx(MessageMenuRow, { icon: "trash", label: uiText(message.part ? "Delete both items" : "Delete"), danger: true, onPress: () => leaveMenu(() => setDeleting([wholeMessage])) }), (pendingStatus === 'failed' || pendingStatus === 'queued') && _jsx(MessageMenuRow, { icon: "trash", label: uiText("Remove unsent message"), danger: true, onPress: () => { setActions(false); void client.discardPending(message.clientMessageId).catch(() => setError(uiText("The unsent message could not be removed."))); } }), !pendingStatus && onMessageOptions && _jsx(MessageMenuRow, { icon: "more", label: uiText("More options"), onPress: () => leaveMenu(() => onMessageOptions(message)) }), !pendingStatus && !message.deleted && _jsx(MessageMenuRow, { icon: "check", label: uiText(message.part ? "Select both items" : "Select Multiple"), divider: true, onPress: () => { setActions(false); setSelection([wholeMessage]); Keyboard.dismiss(); } })] }) }), roomRemoval && _jsx(MessagingRoomRemoval, { client: client, message: message, accent: c.accent, onClose: () => setRoomRemoval(false) }), reportOpen && _jsx(MessagingSafety, { client: client, state: state, appearance: design, name: participants?.[message.senderId]?.name ?? 'Contact', messageId: message.id, onClose: () => setReportOpen(false) })] });
603
+ return _jsxs(View, { ...(Platform.OS === 'web' ? { onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), onContextMenu: (event) => { event.preventDefault(); menu(); } } : {}), style: { width: '100%', position: 'relative', marginTop: messageGap + (message.reactions?.length ? 16 : 0), marginBottom: 0 }, children: [quoteGesture.infoLoaded && _jsxs(Animated.View, { pointerEvents: "none", testID: "message-info-reveal", accessible: false, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: { ...quoteGesture.revealWebStyle, position: 'absolute', top: '50%', marginTop: -26, minHeight: 52, width: messageInfoRevealWidth, justifyContent: 'center', ...(mine ? { start: 0, alignItems: 'flex-start' } : { end: 0, alignItems: 'flex-end' }), opacity: quoteGesture.infoOpacity }, children: [_jsx(_Fragment, { children: timePosition === 'slide' && _jsxs(View, { style: { flexDirection: 'row', alignItems: 'baseline', gap: 4 }, children: [_jsx(Text, { style: { color: c.secondary, fontSize: 8, lineHeight: 11, fontWeight: '900' }, children: uiText("SENT:") }), _jsx(Text, { testID: "message-slide-time", style: { color: c.foreground, fontSize: 10, lineHeight: 12, fontWeight: '800' }, children: messageTimeLabel(message, ui.formatMessageTime, uiText) })] }) }), mine && state.settings?.features.readReceipts && _jsxs(View, { style: { flexDirection: 'row', alignItems: 'baseline', gap: 4 }, children: [_jsx(Text, { style: { color: c.secondary, fontSize: 8, lineHeight: 11, fontWeight: '900' }, children: uiText("READ:") }), _jsx(Text, { style: { color: message.readAt ? c.foreground : c.secondary, fontSize: 10, lineHeight: 12, fontWeight: '800' }, children: message.readAt ? ui.formatMessageTime(message.readAt) : uiText("Not yet") })] })] }), quoting && _jsx(Animated.View, { pointerEvents: "none", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' }), testID: `quote-reveal-${mine ? 'outgoing' : 'incoming'}`, style: { ...quoteGesture.revealWebStyle, position: 'absolute', top: '50%', marginTop: -26, ...(mine ? { end: 0 } : { start: 0 }), width: messageReplyRevealWidth, minHeight: 52, gap: 3, alignItems: 'center', justifyContent: 'center', opacity: quoteGesture.revealOpacity }, children: quoteGesture.quoteLoaded && _jsxs(_Fragment, { children: [_jsx(View, { style: { width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center', backgroundColor: chatSurface(c.background), borderWidth: 1.5, borderColor: c.secondary + '40' }, children: _jsx(MessageIcon, { name: "quote", color: c.accent, size: 30 }) }), _jsx(Text, { style: { color: c.secondary, fontSize: 10, fontWeight: '900' }, children: uiText("QUOTE MESSAGE") })] }) }), _jsxs(Animated.View, { ref: node => { anchor.current = node; if (quoteGesture.webRef)
599
604
  quoteGesture.webRef.current = node; }, ...quoteGesture.handlers, accessibilityActions: quoting ? [{ name: "quote", label: uiText("Quote message") }] : undefined, onAccessibilityAction: event => { if (quoting && event.nativeEvent.actionName === "quote")
600
605
  setReply(message); }, testID: `message-${message.kind}-${mine ? 'outgoing' : 'incoming'}`, style: { ...quoteGesture.webStyle, transform: [{ translateX: quoteGesture.offset }], ...(Platform.OS === "web" && !pendingStatus ? { touchAction: "pan-y", userSelect: "none" } : {}), alignSelf: mine ? 'flex-end' : 'flex-start', maxWidth: `${design.screens?.chat?.messageWidth ?? 88}%`, backgroundColor: visual ? 'transparent' : mine ? c.outgoing : c.incoming, ...corners, ...(topTail ? (mine ? { borderTopRightRadius: 0 } : { borderTopLeftRadius: 0 }) : {}), padding: visual ? 0 : 6, paddingBottom: visual ? 0 : canTranscript || canTranslate ? 3 : 6, boxShadow: bigEmoji ? undefined : '0 1px 1px #00000010', ...((voice || message.kind === 'document') && !showingTransform ? { padding: 0, paddingBottom: 0, boxShadow: undefined, ...(voice ? { backgroundColor: 'transparent' } : {}) } : {}), ...(message.kind === 'poll' ? { backgroundColor: chatSurface(c.background), borderWidth: 1, borderColor: c.accent + '60', paddingHorizontal: 8, paddingTop: 4, paddingBottom: 2 } : {}), ...(bigEmoji ? { backgroundColor: 'transparent', paddingHorizontal: 4, paddingTop: 0, paddingBottom: 0 } : {}), ...(extra?.address || socialReady ? { flexDirection: mine ? 'row-reverse' : 'row', alignItems: 'center', gap: 8, padding: 0, paddingBottom: 0, backgroundColor: 'transparent', boxShadow: undefined } : {}), ...(paddedBubble ? (mine ? { paddingRight: quoteInset + 6 } : { paddingLeft: quoteInset + 6 }) : {}) }, children: [topTail && _jsx(View, { testID: "message-top-tail", pointerEvents: "none", style: { position: 'absolute', top: 0, ...(mine ? { right: -7 } : { left: -7 }), width: 0, height: 0, borderTopWidth: 10, borderTopColor: hasQuote ? quoteBackground : mine ? c.outgoing : c.incoming, ...(mine ? { borderRightWidth: 8, borderRightColor: 'transparent' } : { borderLeftWidth: 8, borderLeftColor: 'transparent' }) } }), extra?.address ? extraCard : socialReady ? socialCard : bubbleBody] }), notice.text && _jsx(Text, { testID: "message-delivery-notice", accessibilityLiveRegion: "polite", style: { alignSelf: 'flex-end', maxWidth: `${design.screens?.chat?.messageWidth ?? 88}%`, color: c.secondary, fontSize: 11, lineHeight: 15, paddingHorizontal: 3, marginTop: 3 }, children: uiText(notice.text) }), belowMeta && _jsx(Animated.View, { pointerEvents: "none", style: { ...quoteGesture.webStyle, transform: [{ translateX: quoteGesture.offset }], alignSelf: mine ? 'flex-end' : 'flex-start', maxWidth: `${design.screens?.chat?.messageWidth ?? 88}%`, paddingHorizontal: 3, marginTop: 3 }, children: belowMeta })] });
601
606
  });
@@ -859,8 +864,8 @@ function AttachmentStrip({ children, label, height, recent = false }) {
859
864
  }
860
865
  export function MessagingComposer() {
861
866
  const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount, direction: uiDirection } = useRobonoLocale();
862
- const weatherAllowed = !!useMessagingUI().extrasState?.available.weather;
863
- const { state, client, design, extras, pickAttachment, attachmentChoices, attachmentPreview, releaseAttachment, prepareAttachment, retainDraftAttachments, reply, setReply, editing, setEditing, components, openAttachment, userId, participants } = useMessagingUI();
867
+ const { state, client, design, extras, extrasState, pickAttachment, attachmentChoices, attachmentPreview, releaseAttachment, prepareAttachment, retainDraftAttachments, reply, setReply, editing, setEditing, components, openAttachment, userId, participants } = useMessagingUI();
868
+ const weatherAllowed = messagingToolAvailable(design, 'weather', extrasState?.available.weather);
864
869
  const VoiceComposer = components?.VoiceComposer ?? VoiceMessageComposer;
865
870
  const [savedDraft, setDraftState] = useState(state.draft ?? ""), [busy, setBusy] = useState(false), [error, setError] = useState("");
866
871
  const [editDraft, setEditDraft] = useState('');
@@ -1170,7 +1175,7 @@ export function MessagingComposer() {
1170
1175
  event.preventDefault();
1171
1176
  if (!blocked)
1172
1177
  void send();
1173
- } } } : {}), onFocus: () => setAttachmentsOpen(false), style: { ...(Platform.OS === 'web' ? { outlineStyle: 'none' } : {}), writingDirection: draft ? 'auto' : uiDirection, textAlign: uiDirection === 'rtl' ? 'right' : 'left', flex: 1, minWidth: 0, minHeight: 44, maxHeight: 120, color: design.composer?.text ?? c.foreground, fontSize: 16, lineHeight: 22, paddingHorizontal: 4, paddingVertical: 8, backgroundColor: 'transparent' } }), !features?.text && _jsx(View, { style: { flex: 1 } }), features?.voice && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Voice message"), disabled: voicePending || busy || blocked, onPress: () => void pick('voice'), style: { width: 42, height: 44, flexShrink: 0, alignItems: 'center', justifyContent: 'center', opacity: voicePending || busy || blocked ? 0.5 : 1 }, children: _jsx(MessageIcon, { name: "mic", color: c.accent, size: 23 }) })] }), (features?.text || selected.length > 0) && _jsx(QuickSendButton, { choice: state.quickMessage, empty: !draft.trim() && !selected.length && !voice.hasVoice && !voice.sendVoice, enabled: !!features?.text, disabled: blocked, editing: !!editing, sendAvailable: !!draft.trim() || !!voice.sendVoice || selected.length > 0, appearance: design, onSchedule: state.scheduledMessagesAvailable && !editing && (!!draft.trim() || selected.length > 0) && !voice.hasVoice && !voice.sendVoice ? () => { setScheduleError(''); setScheduleOpen(true); } : undefined, onChoose: emoji => { void client.setQuickMessage(emoji).catch(() => setError(uiText("This quick message could not be saved on this device."))); }, onSend: () => { if (voice.sendVoice)
1178
+ } } } : {}), onFocus: () => setAttachmentsOpen(false), style: { ...(Platform.OS === 'web' ? { outlineStyle: 'none' } : {}), writingDirection: draft ? 'auto' : uiDirection, textAlign: uiDirection === 'rtl' ? 'right' : 'left', flex: 1, minWidth: 0, minHeight: 44, maxHeight: 120, color: design.composer?.text ?? c.foreground, fontSize: 16, lineHeight: 22, paddingHorizontal: 4, paddingVertical: 8, backgroundColor: 'transparent' } }), !features?.text && _jsx(View, { style: { flex: 1 } }), features?.voice && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Voice message"), disabled: voicePending || busy || blocked, onPress: () => void pick('voice'), style: { width: 42, height: 44, flexShrink: 0, alignItems: 'center', justifyContent: 'center', opacity: voicePending || busy || blocked ? 0.5 : 1 }, children: _jsx(MessageIcon, { name: "mic", color: c.accent, size: 23 }) })] }), (features?.text || selected.length > 0) && _jsx(QuickSendButton, { choice: state.quickMessage, empty: !draft.trim() && !selected.length && !voice.hasVoice && !voice.sendVoice, enabled: !!features?.text, disabled: blocked, editing: !!editing, sendAvailable: !!draft.trim() || !!voice.sendVoice || selected.length > 0, appearance: design, onSchedule: messagingToolAvailable(design, 'scheduling', state.scheduledMessagesAvailable) && !editing && (!!draft.trim() || selected.length > 0) && !voice.hasVoice && !voice.sendVoice ? () => { setScheduleError(''); setScheduleOpen(true); } : undefined, onChoose: emoji => { void client.setQuickMessage(emoji).catch(() => setError(uiText("This quick message could not be saved on this device."))); }, onSend: () => { if (voice.sendVoice)
1174
1179
  voice.sendVoice();
1175
1180
  else
1176
1181
  void send(); }, onQuickSend: emoji => { void submit({ kind: 'text', text: emoji }).catch(() => { }); } }, state.conversationId)] });
@@ -17,10 +17,9 @@ export declare function MessageMenuRow({ icon, label, onPress, disabled, danger,
17
17
  divider?: boolean;
18
18
  scope?: 'message' | 'friends';
19
19
  }): React.JSX.Element;
20
- export declare function MessageMenu({ visible, position, screenHeight, mine, reactions, children, onClose, onDismiss }: {
20
+ export declare function MessageMenu({ visible, position, mine, reactions, children, onClose, onDismiss }: {
21
21
  visible: boolean;
22
22
  position: MessageMenuPosition;
23
- screenHeight: number;
24
23
  mine: boolean;
25
24
  reactions: ReactNode;
26
25
  children: ReactNode;
@@ -19,7 +19,7 @@ export function MessageMenuRow({ icon, label, onPress, disabled, danger, divider
19
19
  const dangerColor = messagingContrastInk(palette.background) === '#000000' ? '#b42318' : '#F87171';
20
20
  return _jsxs(_Fragment, { children: [divider && _jsx(View, { style: { height: 1, marginHorizontal: 12, marginVertical: 4, backgroundColor: palette.foreground + '22' } }), _jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: label, disabled: disabled, onPress: onPress, style: ({ pressed }) => ({ minHeight: layout.rowHeight, paddingHorizontal: 12, flexDirection: 'row', alignItems: 'center', gap: 8, opacity: disabled ? .5 : 1, backgroundColor: pressed ? palette.foreground + '12' : 'transparent' }), children: [layout.showIcons && _jsx(MessageIcon, { name: icon, color: danger ? dangerColor : palette.icons, size: 22 }), _jsx(Text, { style: { flex: 1, color: danger ? dangerColor : palette.foreground, fontSize: layout.textSize, fontWeight: '700' }, children: label })] })] });
21
21
  }
22
- export function MessageMenu({ visible, position, screenHeight, mine, reactions, children, onClose, onDismiss }) {
22
+ export function MessageMenu({ visible, position, mine, reactions, children, onClose, onDismiss }) {
23
23
  const { text: uiText } = useRobonoLocale();
24
24
  const appearance = useMessagingAppearance() ?? defaultMessagingSettings().appearance, palette = messagingMenuColors(appearance, 'message'), layout = messagingMenuLayout(appearance.menus?.message);
25
25
  useEffect(() => { if (!visible || Platform.OS !== 'web')
@@ -8,6 +8,7 @@ export declare class RecentMessagingMedia {
8
8
  private now;
9
9
  private entries;
10
10
  private running;
11
+ private scheduledFrame?;
11
12
  private foreground;
12
13
  private resumeTimer;
13
14
  constructor(source: MessagingMediaStorage, files: {
@@ -7,6 +7,7 @@ export class RecentMessagingMedia {
7
7
  now;
8
8
  entries = new Map();
9
9
  running = 0;
10
+ scheduledFrame;
10
11
  foreground = new Map();
11
12
  resumeTimer;
12
13
  constructor(source, files, now = Date.now) {
@@ -105,9 +106,26 @@ export class RecentMessagingMedia {
105
106
  entry.expires = this.now() + 60000;
106
107
  }
107
108
  }
108
- this.pump();
109
+ if (![...this.entries.values()].some(entry => !entry.attempted) || this.scheduledFrame !== undefined)
110
+ return;
111
+ // The first frame commits the message list. Give the screen a chance to
112
+ // paint before starting speculative original downloads on the following frame.
113
+ // Explicit taps still call start() immediately, and removals above are synchronous.
114
+ if (typeof requestAnimationFrame !== 'function') {
115
+ this.pump();
116
+ return;
117
+ }
118
+ this.scheduledFrame = requestAnimationFrame(() => {
119
+ this.scheduledFrame = requestAnimationFrame(() => {
120
+ this.scheduledFrame = undefined;
121
+ this.pump();
122
+ });
123
+ });
109
124
  }
110
- clear() { clearTimeout(this.resumeTimer); for (const [signal, release] of this.foreground)
125
+ clear() { if (this.scheduledFrame !== undefined) {
126
+ cancelAnimationFrame(this.scheduledFrame);
127
+ this.scheduledFrame = undefined;
128
+ } clearTimeout(this.resumeTimer); for (const [signal, release] of this.foreground)
111
129
  signal.removeEventListener('abort', release); this.foreground.clear(); for (const [id, entry] of this.entries)
112
130
  this.drop(id, entry); }
113
131
  /** Pause speculation until the viewer closes/cancels, including while a
@@ -136,7 +154,7 @@ export class RecentMessagingMedia {
136
154
  }
137
155
  }
138
156
  pump() {
139
- if (this.foreground.size)
157
+ if (this.foreground.size || this.scheduledFrame !== undefined)
140
158
  return;
141
159
  for (const [id, entry] of this.entries) {
142
160
  if (this.running >= 2)
@@ -1,12 +1,18 @@
1
+ import { type MessagingLanguageDefaults } from '@robono/messaging';
2
+ import type { TranslationVoiceProps } from './index.js';
1
3
  import React from 'react';
2
4
  import { type TranslationPreference, type MessagingClient, type MessagingAppearance } from '@robono/messaging';
3
5
  /** The choice belongs to the conversation, never to an individual message. */
4
- export declare function TranslationSettings({ client, appearance, preference, language, sourceLanguage, voiceAvailable, onSaved }: {
6
+ export declare function TranslationSettings({ client, appearance, preference, language, sourceLanguage, voiceAvailable, defaults, preferredVoice, VoiceSample, sampleBaseUrl, onSaved }: {
5
7
  client: MessagingClient;
6
8
  appearance: MessagingAppearance;
7
9
  preference?: TranslationPreference;
8
10
  language?: string;
9
11
  sourceLanguage?: string;
10
12
  voiceAvailable: boolean;
13
+ defaults?: MessagingLanguageDefaults;
14
+ preferredVoice?: string | null;
15
+ VoiceSample?: React.ComponentType<TranslationVoiceProps>;
16
+ sampleBaseUrl?: string;
11
17
  onSaved: () => void;
12
18
  }): React.JSX.Element;
@@ -1,4 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { messagingVoicesForLanguage, resolveMessagingVoice } from '@robono/messaging';
3
+ import { messagingSpeechSample } from '@robono/messaging';
2
4
  import { messagingContrastInk } from '@robono/messaging';
3
5
  import { Text } from './typography.js';
4
6
  import { useRobonoLocale } from './localization.js';
@@ -8,15 +10,18 @@ import { useEffect, useState } from 'react';
8
10
  import { Pressable, ScrollView, View } from 'react-native';
9
11
  import { normalizeLanguageCode, supportedLanguages, supportedLanguageLabel } from '@robono/messaging';
10
12
  /** The choice belongs to the conversation, never to an individual message. */
11
- export function TranslationSettings({ client, appearance, preference, language, sourceLanguage, voiceAvailable, onSaved }) {
13
+ export function TranslationSettings({ client, appearance, preference, language, sourceLanguage, voiceAvailable, defaults, preferredVoice, VoiceSample, sampleBaseUrl, onSaved }) {
12
14
  const messagingPopupColors = useMessagingPopupColors(appearance, 'translation');
13
15
  const { text: uiText, locale: uiLocale, number: uiNumber, count: uiCount } = useRobonoLocale();
14
- const [value, setValue] = useState(() => preference ? { ...preference, mode: preference.mode === 'voice' && !voiceAvailable ? 'text' : preference.mode } : { mode: 'off', language: normalizeLanguageCode(language ?? Intl.DateTimeFormat().resolvedOptions().locale) ?? 'en', sourceLanguage: normalizeLanguageCode(sourceLanguage) });
16
+ const [value, setValue] = useState(() => preference ? { ...preference, mode: preference.mode === 'voice' && !voiceAvailable ? 'text' : preference.mode } : { mode: 'off', language: normalizeLanguageCode(language ?? defaults?.language ?? Intl.DateTimeFormat().resolvedOptions().locale) ?? 'en', sourceLanguage: normalizeLanguageCode(sourceLanguage) });
17
+ const [sample, setSample] = useState(null);
18
+ const voices = messagingVoicesForLanguage(value.language), voice = resolveMessagingVoice(value.language, value.voice, preferredVoice, defaults?.voices), sampleVoice = voice ?? voices[0]?.id;
19
+ useEffect(() => setSample(null), [value.language, value.voice, value.mode, voiceAvailable]);
15
20
  const [choosing, setChoosing] = useState(null), [busy, setBusy] = useState(false), [error, setError] = useState('');
16
21
  const c = { ...appearance.colors, ...messagingPopupColors };
17
22
  useEffect(() => { if (!voiceAvailable)
18
23
  setValue(value => value.mode === 'voice' ? { ...value, mode: 'text' } : value); }, [voiceAvailable]);
19
- return _jsxs(View, { style: { gap: 8 }, children: [_jsx(Text, { style: { fontSize: 13, fontWeight: '600', color: c.secondary, paddingHorizontal: 4 }, children: uiText("Translation") }), _jsxs(View, { style: { backgroundColor: c.incoming, borderRadius: 12, borderWidth: 1, borderColor: c.foreground + '14', padding: 12, gap: 4 }, children: [_jsx(View, { accessibilityRole: "radiogroup", style: { flexDirection: 'row', borderWidth: 1, borderColor: c.foreground + '14', borderRadius: 9, overflow: 'hidden', padding: 3, gap: 3 }, children: ['off', 'text', 'voice'].filter(mode => mode !== 'voice' || voiceAvailable).map(mode => _jsx(Pressable, { accessibilityRole: "radio", accessibilityLabel: uiText('Translation: {mode}', { mode: mode === 'off' ? uiText('Off') : mode === 'text' ? uiText('Text') : uiText('Voice') }), accessibilityState: { checked: value.mode === mode, disabled: busy || mode === 'voice' && !voiceAvailable }, disabled: busy || mode === 'voice' && !voiceAvailable, onPress: () => setValue(v => ({ ...v, mode })), style: { flex: 1, minHeight: 36, borderRadius: 6, alignItems: 'center', justifyContent: 'center', backgroundColor: value.mode === mode ? c.accent + '25' : 'transparent', opacity: mode === 'voice' && !voiceAvailable ? .4 : 1 }, children: _jsx(Text, { style: { color: value.mode === mode ? c.accent : c.secondary, fontSize: 14, fontWeight: '600' }, children: mode === 'off' ? uiText("Off") : mode === 'text' ? uiText("Text") : uiText("Voice") }) }, mode)) }), ['sourceLanguage', 'language'].map(field => _jsxs(View, { children: [_jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: field === 'language' ? uiText("Translation language") : uiText("Incoming language"), disabled: busy, onPress: () => setChoosing(choosing === field ? null : field), style: { minHeight: 48, flexDirection: 'row', alignItems: 'center', gap: 10, borderBottomWidth: field === 'sourceLanguage' ? 1 : 0, borderBottomColor: c.foreground + '14' }, children: [_jsx(Text, { style: { flex: 1, color: c.secondary, fontSize: 14 }, children: field === 'language' ? uiText("Translate into") : uiText("Messages in") }), _jsx(Text, { style: { color: c.accent, fontSize: 15, flexShrink: 1, textAlign: 'right' }, children: value[field] ? supportedLanguageLabel(value[field]) : uiText("Choose language") }), _jsx(MessageIcon, { name: choosing === field ? 'chevron-up' : 'chevron-down', color: c.secondary, size: 16 })] }), choosing === field && _jsx(ScrollView, { style: { maxHeight: 180 }, keyboardShouldPersistTaps: "handled", children: supportedLanguages.map(item => _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText('Choose {language}', { language: item.name }), onPress: () => { setValue(v => ({ ...v, [field]: item.code })); setChoosing(null); }, style: { minHeight: 40, paddingHorizontal: 8, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.foreground }, children: item.name }) }, item.code)) })] }, field)), !!error && _jsx(Text, { accessibilityRole: "alert", style: { color: c.foreground }, children: error }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Save translation preference"), disabled: busy, onPress: () => { if (value.mode !== 'off' && !value.sourceLanguage) {
24
+ return _jsxs(View, { style: { gap: 8 }, children: [_jsx(Text, { style: { fontSize: 13, fontWeight: '600', color: c.secondary, paddingHorizontal: 4 }, children: uiText("Translation") }), _jsxs(View, { style: { backgroundColor: c.incoming, borderRadius: 12, borderWidth: 1, borderColor: c.foreground + '14', padding: 12, gap: 4 }, children: [_jsx(View, { accessibilityRole: "radiogroup", style: { flexDirection: 'row', borderWidth: 1, borderColor: c.foreground + '14', borderRadius: 9, overflow: 'hidden', padding: 3, gap: 3 }, children: ['off', 'text', 'voice'].filter(mode => mode !== 'voice' || voiceAvailable).map(mode => _jsx(Pressable, { accessibilityRole: "radio", accessibilityLabel: uiText('Translation: {mode}', { mode: mode === 'off' ? uiText('Off') : mode === 'text' ? uiText('Text') : uiText('Voice') }), accessibilityState: { checked: value.mode === mode, disabled: busy || mode === 'voice' && !voiceAvailable }, disabled: busy || mode === 'voice' && !voiceAvailable, onPress: () => setValue(v => ({ ...v, mode })), style: { flex: 1, minHeight: 36, borderRadius: 6, alignItems: 'center', justifyContent: 'center', backgroundColor: value.mode === mode ? c.accent + '25' : 'transparent', opacity: mode === 'voice' && !voiceAvailable ? .4 : 1 }, children: _jsx(Text, { style: { color: value.mode === mode ? c.accent : c.secondary, fontSize: 14, fontWeight: '600' }, children: mode === 'off' ? uiText("Off") : mode === 'text' ? uiText("Text") : uiText("Voice") }) }, mode)) }), ['sourceLanguage', 'language'].map(field => _jsxs(View, { children: [_jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: field === 'language' ? uiText("Translation language") : uiText("Incoming language"), disabled: busy, onPress: () => setChoosing(choosing === field ? null : field), style: { minHeight: 48, flexDirection: 'row', alignItems: 'center', gap: 10, borderBottomWidth: field === 'sourceLanguage' ? 1 : 0, borderBottomColor: c.foreground + '14' }, children: [_jsx(Text, { style: { flex: 1, color: c.secondary, fontSize: 14 }, children: field === 'language' ? uiText("Translate into") : uiText("Messages in") }), _jsx(Text, { style: { color: c.accent, fontSize: 15, flexShrink: 1, textAlign: 'right' }, children: value[field] ? supportedLanguageLabel(value[field]) : uiText("Choose language") }), _jsx(MessageIcon, { name: choosing === field ? 'chevron-up' : 'chevron-down', color: c.secondary, size: 16 })] }), choosing === field && _jsx(ScrollView, { style: { maxHeight: 180 }, keyboardShouldPersistTaps: "handled", children: supportedLanguages.map(item => _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText('Choose {language}', { language: item.name }), onPress: () => { setValue(v => ({ ...v, [field]: item.code, ...(field === 'language' ? { voice: undefined } : {}) })); setChoosing(null); }, style: { minHeight: 40, paddingHorizontal: 8, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.foreground }, children: item.name }) }, item.code)) })] }, field)), value.mode === 'voice' && voiceAvailable && _jsxs(View, { style: { gap: 6 }, children: [_jsx(Text, { style: { color: c.secondary, fontSize: 14 }, children: uiText('Voice') }), _jsx(View, { accessibilityRole: "radiogroup", style: { gap: 4 }, children: [{ id: 'inherit', name: 'Use app default' }, { id: 'automatic', name: 'Automatic' }, ...voices].map(item => _jsx(Pressable, { accessibilityRole: "radio", accessibilityLabel: uiText('Voice: {name}', { name: item.name }), accessibilityState: { checked: item.id === (value.voice === undefined ? 'inherit' : value.voice === null ? 'automatic' : value.voice), disabled: busy }, disabled: busy, onPress: () => setValue(v => ({ ...v, voice: item.id === 'inherit' ? undefined : item.id === 'automatic' ? null : item.id })), style: { minHeight: 40, paddingHorizontal: 8, justifyContent: 'center', borderRadius: 6, backgroundColor: item.id === (value.voice === undefined ? 'inherit' : value.voice === null ? 'automatic' : value.voice) ? c.accent + '25' : 'transparent' }, children: _jsx(Text, { style: { color: c.foreground }, children: uiText(item.name) }) }, item.id)) }), !!sampleVoice && !!VoiceSample && _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText(sample ? 'Stop voice sample' : 'Listen to voice sample'), onPress: () => setSample(sample ? null : sampleVoice), style: { minHeight: 40, justifyContent: 'center' }, children: _jsx(Text, { style: { color: c.accent }, children: uiText(sample ? 'Stop voice sample' : 'Listen to voice sample') }) }), !!sample && !!VoiceSample && _jsx(VoiceSample, { transform: messagingSpeechSample(sample, sampleBaseUrl), ink: c.foreground, accent: c.accent, showWaveform: false, autoPlay: true }, sample)] }), !!error && _jsx(Text, { accessibilityRole: "alert", style: { color: c.foreground }, children: error }), _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: uiText("Save translation preference"), disabled: busy, onPress: () => { if (value.mode !== 'off' && !value.sourceLanguage) {
20
25
  setError(uiText("Choose the incoming language once for this conversation."));
21
26
  return;
22
27
  } setError(''); setBusy(true); void client.setTranslationPreference(value).then(onSaved).catch(() => setError(uiText("The translation preference could not be saved. Try again."))).finally(() => setBusy(false)); }, style: { minHeight: 40, minWidth: 96, paddingHorizontal: 18, marginTop: 8, alignSelf: 'flex-end', alignItems: 'center', justifyContent: 'center', borderRadius: 9, backgroundColor: c.accent, opacity: busy ? 0.5 : 1 }, children: _jsx(Text, { style: { color: messagingContrastInk(c.accent), fontSize: 14, fontWeight: '600' }, children: busy ? uiText("Saving…") : uiText("Save") }) })] })] });
@@ -5,6 +5,7 @@ export declare function useQuoteGesture(enabled: boolean, outgoing: boolean, quo
5
5
  offset: number | Animated.Value;
6
6
  webRef: import("react").RefObject<HTMLElement | null> | undefined;
7
7
  infoLoaded: boolean;
8
+ quoteLoaded: boolean;
8
9
  infoOpacity: number | Animated.AnimatedInterpolation<string | number>;
9
10
  revealOpacity: number | Animated.AnimatedInterpolation<string | number>;
10
11
  revealWebStyle: {
@@ -14,6 +14,7 @@ export function useQuoteGesture(enabled, outgoing, quote, details, onQuoteReady)
14
14
  const nativeInfoOpacity = useMemo(() => offset.interpolate({ inputRange: direction === 1 ? [-24, -8, 0] : [0, 8, 24], outputRange: direction === 1 ? [1, .35, 0] : [0, .35, 1], extrapolate: 'clamp' }), [offset, direction]);
15
15
  const nativeRevealOpacity = useMemo(() => offset.interpolate({ inputRange: direction === -1 ? [-messageReplyRevealWidth, -18, 0] : [0, 18, messageReplyRevealWidth], outputRange: direction === -1 ? [1, .35, 0] : [0, .35, 1], extrapolate: 'clamp' }), [offset, direction]);
16
16
  const [infoLoaded, setInfoLoaded] = useState(false);
17
+ const [quoteLoaded, setQuoteLoaded] = useState(false);
17
18
  const quoteReady = useRef(false);
18
19
  const current = useRef({ enabled, direction, quote, details, onQuoteReady });
19
20
  current.current = { enabled, direction, quote, details, onQuoteReady };
@@ -41,6 +42,8 @@ export function useQuoteGesture(enabled, outgoing, quote, details, onQuoteReady)
41
42
  const info = dx * current.current.direction < 0;
42
43
  if (info)
43
44
  setInfoLoaded(true);
45
+ else if (current.current.quote && dx !== 0)
46
+ setQuoteLoaded(true);
44
47
  const limit = info ? messageInfoRevealWidth : current.current.quote ? messageReplyRevealWidth : 0;
45
48
  const value = Math.sign(dx) * Math.min(limit, Math.abs(dx));
46
49
  if (Platform.OS === 'web') {
@@ -145,6 +148,7 @@ export function useQuoteGesture(enabled, outgoing, quote, details, onQuoteReady)
145
148
  return { offset: Platform.OS === 'web' ? webOffset : offset,
146
149
  webRef: Platform.OS === 'web' ? webRef : undefined,
147
150
  infoLoaded,
151
+ quoteLoaded,
148
152
  infoOpacity: Platform.OS === 'web' ? Math.min(1, Math.max(0, -webOffset * direction) / 24) : nativeInfoOpacity,
149
153
  revealOpacity: Platform.OS === 'web' ? Math.min(1, Math.max(0, webOffset * direction) / messageReplyRevealWidth)
150
154
  : nativeRevealOpacity,
@@ -0,0 +1,34 @@
1
+ #import <Foundation/Foundation.h>
2
+ #import <CloudKit/CloudKit.h>
3
+
4
+ // CloudKit partial errors contain CKRecordID dictionary keys. React Native's
5
+ // error bridge expects string keys and must never receive that raw userInfo.
6
+ static NSError *RobonoBackupCloudItemError(NSError *error) {
7
+ if ([error.domain isEqualToString:CKErrorDomain] && error.code == CKErrorPartialFailure) {
8
+ id items = error.userInfo[CKPartialErrorsByItemIDKey];
9
+ if ([items isKindOfClass:NSDictionary.class] && [items count] == 1) {
10
+ id item = [items allValues].firstObject;
11
+ if ([item isKindOfClass:NSError.class]) return item;
12
+ }
13
+ }
14
+ return error;
15
+ }
16
+
17
+ static NSString *RobonoBackupCloudErrorCode(NSError *error) {
18
+ NSError *item = RobonoBackupCloudItemError(error);
19
+ if ([item.domain isEqualToString:CKErrorDomain]) {
20
+ if (item.code == CKErrorQuotaExceeded) return @"storage_full";
21
+ if (item.code == CKErrorOperationCancelled) return @"cancelled";
22
+ if (item.code == CKErrorUnknownItem || item.code == CKErrorServerRecordChanged) return @"invalid_backup";
23
+ }
24
+ return @"connection";
25
+ }
26
+
27
+ static NSError *RobonoBackupCloudBridgeError(NSError *error) {
28
+ if (!error) return nil;
29
+ NSError *item = RobonoBackupCloudItemError(error);
30
+ return [NSError errorWithDomain:error.domain code:error.code userInfo:@{
31
+ NSLocalizedDescriptionKey: @"Your iCloud backup could not finish. Your previous backup is still available.",
32
+ @"cloudErrorCode": @(item.code)
33
+ }];
34
+ }
@@ -1,6 +1,7 @@
1
1
  #import <React/RCTBridgeModule.h>
2
2
  #import <CloudKit/CloudKit.h>
3
3
  #import <CommonCrypto/CommonDigest.h>
4
+ #import "RobonoBackupCloudError.h"
4
5
 
5
6
  // Private CloudKit records contain only encrypted archive parts and opaque IDs.
6
7
  // A successful local file write never counts as a cloud upload acknowledgement.
@@ -20,7 +21,7 @@ RCT_EXPORT_MODULE();
20
21
  - (void)accountChanged{@synchronized(self){self.generation++;for(NSMutableDictionary *r in self.requests.allValues){r[@"cancelled"]=@YES;[(NSOperation *)r[@"operation"]cancel];}}}
21
22
  static BOOL matches(NSString *text,NSString *pattern){return [text isKindOfClass:NSString.class]&&[text rangeOfString:pattern options:NSRegularExpressionSearch].location!=NSNotFound;}
22
23
  static NSString *digest(NSData *data){unsigned char bytes[CC_SHA256_DIGEST_LENGTH];CC_SHA256(data.bytes,(CC_LONG)data.length,bytes);NSMutableString *s=[NSMutableString new];for(int i=0;i<CC_SHA256_DIGEST_LENGTH;i++)[s appendFormat:@"%02x",bytes[i]];return s;}
23
- static NSString *errorCode(NSError *e){if([e.domain isEqualToString:CKErrorDomain]){if(e.code==CKErrorQuotaExceeded)return @"storage_full";if(e.code==CKErrorOperationCancelled)return @"cancelled";if(e.code==CKErrorUnknownItem||e.code==CKErrorServerRecordChanged)return @"invalid_backup";}return @"connection";}
24
+ static NSString *errorCode(NSError *e){return RobonoBackupCloudErrorCode(e);}
24
25
  RCT_EXPORT_METHOD(cancel:(NSString *)identifier){@synchronized(self){NSMutableDictionary *r=self.requests[identifier];r[@"cancelled"]=@YES;[(NSOperation *)r[@"operation"]cancel];}}
25
26
  RCT_REMAP_METHOD(request, requestIdentifier:(NSString *)identifier input:(NSDictionary *)input resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject){
26
27
  NSString *containerId=input[@"container"],*action=input[@"action"],*scope=input[@"scope"],*snapshot=input[@"snapshot"],*part=input[@"part"];
@@ -32,7 +33,7 @@ RCT_REMAP_METHOD(request, requestIdentifier:(NSString *)identifier input:(NSDict
32
33
  void (^finish)(id,NSString *,NSError *)=^(id result,NSString *code,NSError *error){
33
34
  @synchronized(self){if(state[@"finished"])return;state[@"finished"]=@YES;[self.requests removeObjectForKey:identifier];[state removeObjectForKey:@"operation"];if(state[@"cancelled"]||epoch!=self.generation)code=@"cancelled";}
34
35
  NSString *temporary=state[@"temporary"];if(temporary)[NSFileManager.defaultManager removeItemAtPath:temporary error:nil];
35
- if(code)reject(code,@"Your iCloud backup could not finish. Your previous backup is still available.",error);else resolve(result);
36
+ if(code)reject(code,@"Your iCloud backup could not finish. Your previous backup is still available.",RobonoBackupCloudBridgeError(error));else resolve(result);
36
37
  };
37
38
  dispatch_after(dispatch_time(DISPATCH_TIME_NOW,120*NSEC_PER_SEC),dispatch_get_global_queue(QOS_CLASS_UTILITY,0),^{@synchronized(self){if(state[@"finished"])return;[(NSOperation *)state[@"operation"]cancel];}finish(nil,@"connection",nil);});
38
39
  CKContainer *container;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robono/messaging-react-native",
3
- "version": "0.25.1",
3
+ "version": "0.26.1",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "./dist/expo-notification-cleanup.js"
@@ -73,7 +73,7 @@
73
73
  "prepack": "npm run build && node ../../scripts/generate-sdk-file-sbom.mjs"
74
74
  },
75
75
  "peerDependencies": {
76
- "@robono/messaging": "^0.19.0",
76
+ "@robono/messaging": "^0.20.1",
77
77
  "react": ">=18.2 <20",
78
78
  "react-native": ">=0.76 <1",
79
79
  "expo-audio": ">=55 <57",