@poolse/react-native 2.23.1 → 2.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs +450 -334
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -3
- package/dist/index.d.ts +27 -3
- package/dist/index.js +452 -337
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useUser, useMe, useConversations, useAttachmentUpload, useConversation, useMembers, usePresence, useMessages, useTyping, useRealtimeStatus, computeGroupPosition, formatDayLabel,
|
|
1
|
+
import { useUser, useMe, useConversations, formatCallLogPreview, useAttachmentUpload, useConversation, useMembers, usePresence, useMessages, useTyping, useRealtimeStatus, isMessageVisibleTo, computeGroupPosition, formatDayLabel, callLogDisplayFor, sameDay, useReactions, useThread, useAttachmentUrl, usePoolse, useVoiceRoom, useCalls, useCallRoom } from '@poolse/react';
|
|
2
2
|
import { createContext, forwardRef, useRef, useState, useEffect, useImperativeHandle, useMemo, useCallback, useContext, createElement } from 'react';
|
|
3
3
|
import { StyleSheet, Keyboard, Platform, View, Pressable, TextInput, Text, useWindowDimensions, Animated, Easing, PanResponder, Image, ScrollView, ActivityIndicator, FlatList, AppState, KeyboardAvoidingView, Modal, Dimensions, Linking, StatusBar } from 'react-native';
|
|
4
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -6,7 +6,7 @@ import Svg2, { SvgXml, Svg, Path, Circle, G, Defs, RadialGradient, Stop, Rect }
|
|
|
6
6
|
import * as ImagePicker from 'expo-image-picker';
|
|
7
7
|
import * as DocumentPicker from 'expo-document-picker';
|
|
8
8
|
import { manipulateAsync, SaveFormat } from 'expo-image-manipulator';
|
|
9
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
9
|
+
import { useSafeAreaInsets, SafeAreaProvider } from 'react-native-safe-area-context';
|
|
10
10
|
import * as Clipboard from 'expo-clipboard';
|
|
11
11
|
import Markdown, { MarkdownIt } from 'react-native-markdown-display';
|
|
12
12
|
|
|
@@ -993,6 +993,7 @@ function ConversationList({
|
|
|
993
993
|
const auto = useConversations();
|
|
994
994
|
const { me } = useMe();
|
|
995
995
|
const meExternalId = me?.external_id ?? null;
|
|
996
|
+
const meId = me?.id ?? null;
|
|
996
997
|
const isControlled = controlled !== void 0;
|
|
997
998
|
const conversations = isControlled ? controlled : auto.conversations;
|
|
998
999
|
const loading = isControlled ? controlledLoading ?? false : auto.loading;
|
|
@@ -1024,6 +1025,7 @@ function ConversationList({
|
|
|
1024
1025
|
conv: item,
|
|
1025
1026
|
selected,
|
|
1026
1027
|
meExternalId,
|
|
1028
|
+
meId,
|
|
1027
1029
|
unread: counts?.[item.id] ?? 0,
|
|
1028
1030
|
...labelFor ? { labelFor } : {},
|
|
1029
1031
|
...avatarFor ? { avatarFor } : {},
|
|
@@ -1038,6 +1040,7 @@ function ConversationRow({
|
|
|
1038
1040
|
conv,
|
|
1039
1041
|
selected,
|
|
1040
1042
|
meExternalId,
|
|
1043
|
+
meId = null,
|
|
1041
1044
|
unread,
|
|
1042
1045
|
labelFor,
|
|
1043
1046
|
avatarFor,
|
|
@@ -1071,7 +1074,7 @@ function ConversationRow({
|
|
|
1071
1074
|
children: title
|
|
1072
1075
|
}
|
|
1073
1076
|
),
|
|
1074
|
-
conv.last_message_preview ? /* @__PURE__ */ jsx(Text, { style: [styles5.preview, { color: theme.colors.ink3 }], numberOfLines: 1, children: conv.last_message_preview }) : conv.last_message_at ? /* @__PURE__ */ jsx(Text, { style: [styles5.preview, { color: theme.colors.ink3 }], numberOfLines: 1, children: formatRelative(conv.last_message_at) }) : null
|
|
1077
|
+
conv.last_message_preview ? /* @__PURE__ */ jsx(Text, { style: [styles5.preview, { color: theme.colors.ink3 }], numberOfLines: 1, children: formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview }) : conv.last_message_at ? /* @__PURE__ */ jsx(Text, { style: [styles5.preview, { color: theme.colors.ink3 }], numberOfLines: 1, children: formatRelative(conv.last_message_at) }) : null
|
|
1075
1078
|
] }),
|
|
1076
1079
|
unread > 0 ? /* @__PURE__ */ jsx(View, { style: [styles5.unreadPill, { backgroundColor: theme.colors.unreadPill }], children: /* @__PURE__ */ jsx(Text, { style: [styles5.unreadText, { color: theme.colors.unreadPillText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
|
|
1077
1080
|
]
|
|
@@ -2177,6 +2180,87 @@ var styles11 = StyleSheet.create({
|
|
|
2177
2180
|
fontWeight: "600"
|
|
2178
2181
|
}
|
|
2179
2182
|
});
|
|
2183
|
+
function CallLogRow({ msg, meId }) {
|
|
2184
|
+
const theme = usePoolseTheme();
|
|
2185
|
+
const display = callLogDisplayFor(msg, meId);
|
|
2186
|
+
if (!display) return null;
|
|
2187
|
+
const accent = display.missed ? theme.colors.error : theme.colors.ink3;
|
|
2188
|
+
const time = formatTime(msg.inserted_at);
|
|
2189
|
+
const label = [display.title, display.detail, time].filter(Boolean).join(", ");
|
|
2190
|
+
const metaStyle = [styles12.meta, { color: theme.colors.ink3, fontFamily: theme.type.fontBody }];
|
|
2191
|
+
return /* @__PURE__ */ jsx(View, { style: styles12.wrap, accessible: true, accessibilityLabel: label, children: /* @__PURE__ */ jsxs(
|
|
2192
|
+
View,
|
|
2193
|
+
{
|
|
2194
|
+
style: [
|
|
2195
|
+
styles12.chip,
|
|
2196
|
+
{
|
|
2197
|
+
backgroundColor: theme.colors.surface2,
|
|
2198
|
+
borderColor: theme.colors.border
|
|
2199
|
+
}
|
|
2200
|
+
],
|
|
2201
|
+
children: [
|
|
2202
|
+
/* @__PURE__ */ jsx(PoolseIcon, { name: display.media === "video" ? "video" : "phone", size: 13, color: accent }),
|
|
2203
|
+
/* @__PURE__ */ jsx(
|
|
2204
|
+
Text,
|
|
2205
|
+
{
|
|
2206
|
+
style: [
|
|
2207
|
+
styles12.title,
|
|
2208
|
+
{
|
|
2209
|
+
color: display.missed ? theme.colors.error : theme.colors.ink2,
|
|
2210
|
+
fontFamily: theme.type.fontBody
|
|
2211
|
+
}
|
|
2212
|
+
],
|
|
2213
|
+
numberOfLines: 1,
|
|
2214
|
+
children: display.title
|
|
2215
|
+
}
|
|
2216
|
+
),
|
|
2217
|
+
display.detail ? /* @__PURE__ */ jsxs(Text, { style: metaStyle, children: [
|
|
2218
|
+
"\xB7 ",
|
|
2219
|
+
display.detail
|
|
2220
|
+
] }) : null,
|
|
2221
|
+
time ? /* @__PURE__ */ jsxs(Text, { style: metaStyle, children: [
|
|
2222
|
+
"\xB7 ",
|
|
2223
|
+
time
|
|
2224
|
+
] }) : null
|
|
2225
|
+
]
|
|
2226
|
+
}
|
|
2227
|
+
) });
|
|
2228
|
+
}
|
|
2229
|
+
function formatTime(iso) {
|
|
2230
|
+
const d = new Date(iso);
|
|
2231
|
+
if (Number.isNaN(d.getTime())) return "";
|
|
2232
|
+
return d.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
|
|
2233
|
+
}
|
|
2234
|
+
var styles12 = StyleSheet.create({
|
|
2235
|
+
wrap: {
|
|
2236
|
+
alignItems: "center",
|
|
2237
|
+
alignSelf: "stretch",
|
|
2238
|
+
marginVertical: 6,
|
|
2239
|
+
paddingHorizontal: 16
|
|
2240
|
+
},
|
|
2241
|
+
chip: {
|
|
2242
|
+
flexDirection: "row",
|
|
2243
|
+
alignItems: "center",
|
|
2244
|
+
gap: 6,
|
|
2245
|
+
maxWidth: "100%",
|
|
2246
|
+
paddingHorizontal: 12,
|
|
2247
|
+
paddingVertical: 4,
|
|
2248
|
+
borderRadius: 999,
|
|
2249
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
2250
|
+
},
|
|
2251
|
+
title: {
|
|
2252
|
+
fontSize: 11,
|
|
2253
|
+
fontWeight: "600",
|
|
2254
|
+
letterSpacing: 0.3,
|
|
2255
|
+
flexShrink: 1
|
|
2256
|
+
},
|
|
2257
|
+
meta: {
|
|
2258
|
+
fontSize: 11,
|
|
2259
|
+
fontWeight: "500",
|
|
2260
|
+
letterSpacing: 0.3,
|
|
2261
|
+
fontVariant: ["tabular-nums"]
|
|
2262
|
+
}
|
|
2263
|
+
});
|
|
2180
2264
|
var DEFAULT_REACTION_EMOJIS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F389}", "\u{1F64F}", "\u{1F525}"];
|
|
2181
2265
|
function MessageActions({
|
|
2182
2266
|
visible,
|
|
@@ -2202,11 +2286,11 @@ function MessageActions({
|
|
|
2202
2286
|
if (isSelf && onDelete)
|
|
2203
2287
|
items.push({ label: "Delete", icon: "trash", onPress: onDelete, danger: true });
|
|
2204
2288
|
const showEmojiRow = !!onPickReaction && emojis.length > 0;
|
|
2205
|
-
return /* @__PURE__ */ jsx(Modal, { visible, transparent: true, animationType: "fade", onRequestClose: onClose, children: /* @__PURE__ */ jsx(Pressable, { style:
|
|
2289
|
+
return /* @__PURE__ */ jsx(Modal, { visible, transparent: true, animationType: "fade", onRequestClose: onClose, children: /* @__PURE__ */ jsx(Pressable, { style: styles13.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs(
|
|
2206
2290
|
View,
|
|
2207
2291
|
{
|
|
2208
2292
|
style: [
|
|
2209
|
-
|
|
2293
|
+
styles13.sheet,
|
|
2210
2294
|
{
|
|
2211
2295
|
backgroundColor: theme.colors.surface,
|
|
2212
2296
|
borderTopLeftRadius: theme.radii.lg,
|
|
@@ -2215,21 +2299,21 @@ function MessageActions({
|
|
|
2215
2299
|
theme.shadows.lg
|
|
2216
2300
|
],
|
|
2217
2301
|
children: [
|
|
2218
|
-
showEmojiRow ? /* @__PURE__ */ jsx(View, { style: [
|
|
2302
|
+
showEmojiRow ? /* @__PURE__ */ jsx(View, { style: [styles13.emojiRow, { borderBottomColor: theme.colors.border }], children: emojis.map((emoji) => /* @__PURE__ */ jsx(
|
|
2219
2303
|
Pressable,
|
|
2220
2304
|
{
|
|
2221
2305
|
onPress: () => {
|
|
2222
2306
|
onPickReaction(emoji);
|
|
2223
2307
|
onClose();
|
|
2224
2308
|
},
|
|
2225
|
-
style:
|
|
2309
|
+
style: styles13.emojiBtn,
|
|
2226
2310
|
hitSlop: 6,
|
|
2227
2311
|
accessibilityLabel: `React with ${emoji}`,
|
|
2228
|
-
children: /* @__PURE__ */ jsx(Text, { style:
|
|
2312
|
+
children: /* @__PURE__ */ jsx(Text, { style: styles13.emoji, children: emoji })
|
|
2229
2313
|
},
|
|
2230
2314
|
emoji
|
|
2231
2315
|
)) }) : null,
|
|
2232
|
-
items.map((item) => /* @__PURE__ */ jsxs(Pressable, { onPress: item.onPress, style:
|
|
2316
|
+
items.map((item) => /* @__PURE__ */ jsxs(Pressable, { onPress: item.onPress, style: styles13.item, children: [
|
|
2233
2317
|
/* @__PURE__ */ jsx(
|
|
2234
2318
|
PoolseIcon,
|
|
2235
2319
|
{
|
|
@@ -2242,7 +2326,7 @@ function MessageActions({
|
|
|
2242
2326
|
Text,
|
|
2243
2327
|
{
|
|
2244
2328
|
style: [
|
|
2245
|
-
|
|
2329
|
+
styles13.itemText,
|
|
2246
2330
|
{
|
|
2247
2331
|
color: item.danger ? theme.colors.error : theme.colors.ink,
|
|
2248
2332
|
fontFamily: theme.type.fontBody
|
|
@@ -2256,7 +2340,7 @@ function MessageActions({
|
|
|
2256
2340
|
}
|
|
2257
2341
|
) }) });
|
|
2258
2342
|
}
|
|
2259
|
-
var
|
|
2343
|
+
var styles13 = StyleSheet.create({
|
|
2260
2344
|
backdrop: {
|
|
2261
2345
|
flex: 1,
|
|
2262
2346
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
@@ -2326,7 +2410,7 @@ function AttachmentPreview({
|
|
|
2326
2410
|
View,
|
|
2327
2411
|
{
|
|
2328
2412
|
style: [
|
|
2329
|
-
|
|
2413
|
+
styles14.imagePlaceholder,
|
|
2330
2414
|
{
|
|
2331
2415
|
width: maxWidth,
|
|
2332
2416
|
height: 200,
|
|
@@ -2346,7 +2430,7 @@ function AttachmentPreview({
|
|
|
2346
2430
|
onPress,
|
|
2347
2431
|
disabled: !onPress,
|
|
2348
2432
|
style: [
|
|
2349
|
-
|
|
2433
|
+
styles14.fileCard,
|
|
2350
2434
|
{
|
|
2351
2435
|
backgroundColor: onBrand ? "rgba(255,255,255,0.18)" : theme.colors.surface2,
|
|
2352
2436
|
borderColor: onBrand ? "transparent" : theme.colors.border,
|
|
@@ -2359,12 +2443,12 @@ function AttachmentPreview({
|
|
|
2359
2443
|
/* @__PURE__ */ jsx(
|
|
2360
2444
|
Text,
|
|
2361
2445
|
{
|
|
2362
|
-
style: [
|
|
2446
|
+
style: [styles14.fileName, { color: ink, fontFamily: theme.type.fontBody }],
|
|
2363
2447
|
numberOfLines: 1,
|
|
2364
2448
|
children: attachment.original_filename ?? "file"
|
|
2365
2449
|
}
|
|
2366
2450
|
),
|
|
2367
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2451
|
+
/* @__PURE__ */ jsx(Text, { style: [styles14.fileSize, { color: inkSoft, opacity: onBrand ? 0.8 : 1 }], children: formatBytes2(attachment.byte_size) })
|
|
2368
2452
|
] })
|
|
2369
2453
|
]
|
|
2370
2454
|
}
|
|
@@ -2376,7 +2460,7 @@ function formatBytes2(n) {
|
|
|
2376
2460
|
if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
2377
2461
|
return `${(n / 1024 / 1024 / 1024).toFixed(1)} GB`;
|
|
2378
2462
|
}
|
|
2379
|
-
var
|
|
2463
|
+
var styles14 = StyleSheet.create({
|
|
2380
2464
|
imagePlaceholder: {},
|
|
2381
2465
|
fileCard: {
|
|
2382
2466
|
flexDirection: "row",
|
|
@@ -2412,7 +2496,7 @@ function ImageMosaic({
|
|
|
2412
2496
|
View,
|
|
2413
2497
|
{
|
|
2414
2498
|
style: [
|
|
2415
|
-
|
|
2499
|
+
styles15.root,
|
|
2416
2500
|
{
|
|
2417
2501
|
borderTopLeftRadius: r,
|
|
2418
2502
|
borderTopRightRadius: r,
|
|
@@ -2433,18 +2517,18 @@ function ImageMosaic({
|
|
|
2433
2517
|
{
|
|
2434
2518
|
onLongPress,
|
|
2435
2519
|
attachment: visible[0],
|
|
2436
|
-
style:
|
|
2520
|
+
style: styles15.tileFull,
|
|
2437
2521
|
onPress: () => setViewerIndex(0),
|
|
2438
2522
|
overlay: null
|
|
2439
2523
|
}
|
|
2440
2524
|
) : null,
|
|
2441
|
-
n === 2 ? /* @__PURE__ */ jsxs(View, { style:
|
|
2525
|
+
n === 2 ? /* @__PURE__ */ jsxs(View, { style: styles15.rowEven, children: [
|
|
2442
2526
|
/* @__PURE__ */ jsx(
|
|
2443
2527
|
Tile,
|
|
2444
2528
|
{
|
|
2445
2529
|
onLongPress,
|
|
2446
2530
|
attachment: visible[0],
|
|
2447
|
-
style:
|
|
2531
|
+
style: styles15.tileHalfSquare,
|
|
2448
2532
|
onPress: () => setViewerIndex(0),
|
|
2449
2533
|
overlay: null
|
|
2450
2534
|
}
|
|
@@ -2454,7 +2538,7 @@ function ImageMosaic({
|
|
|
2454
2538
|
{
|
|
2455
2539
|
onLongPress,
|
|
2456
2540
|
attachment: visible[1],
|
|
2457
|
-
style:
|
|
2541
|
+
style: styles15.tileHalfSquare,
|
|
2458
2542
|
onPress: () => setViewerIndex(1),
|
|
2459
2543
|
overlay: null
|
|
2460
2544
|
}
|
|
@@ -2466,18 +2550,18 @@ function ImageMosaic({
|
|
|
2466
2550
|
{
|
|
2467
2551
|
onLongPress,
|
|
2468
2552
|
attachment: visible[0],
|
|
2469
|
-
style:
|
|
2553
|
+
style: styles15.tileHero,
|
|
2470
2554
|
onPress: () => setViewerIndex(0),
|
|
2471
2555
|
overlay: null
|
|
2472
2556
|
}
|
|
2473
2557
|
),
|
|
2474
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
2558
|
+
/* @__PURE__ */ jsxs(View, { style: [styles15.rowEven, { marginTop: 2 }], children: [
|
|
2475
2559
|
/* @__PURE__ */ jsx(
|
|
2476
2560
|
Tile,
|
|
2477
2561
|
{
|
|
2478
2562
|
onLongPress,
|
|
2479
2563
|
attachment: visible[1],
|
|
2480
|
-
style:
|
|
2564
|
+
style: styles15.tileHalfSquare,
|
|
2481
2565
|
onPress: () => setViewerIndex(1),
|
|
2482
2566
|
overlay: null
|
|
2483
2567
|
}
|
|
@@ -2487,7 +2571,7 @@ function ImageMosaic({
|
|
|
2487
2571
|
{
|
|
2488
2572
|
onLongPress,
|
|
2489
2573
|
attachment: visible[2],
|
|
2490
|
-
style:
|
|
2574
|
+
style: styles15.tileHalfSquare,
|
|
2491
2575
|
onPress: () => setViewerIndex(2),
|
|
2492
2576
|
overlay: null
|
|
2493
2577
|
}
|
|
@@ -2495,13 +2579,13 @@ function ImageMosaic({
|
|
|
2495
2579
|
] })
|
|
2496
2580
|
] }) : null,
|
|
2497
2581
|
n === 4 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2498
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2582
|
+
/* @__PURE__ */ jsxs(View, { style: styles15.rowEven, children: [
|
|
2499
2583
|
/* @__PURE__ */ jsx(
|
|
2500
2584
|
Tile,
|
|
2501
2585
|
{
|
|
2502
2586
|
onLongPress,
|
|
2503
2587
|
attachment: visible[0],
|
|
2504
|
-
style:
|
|
2588
|
+
style: styles15.tileHalfSquare,
|
|
2505
2589
|
onPress: () => setViewerIndex(0),
|
|
2506
2590
|
overlay: null
|
|
2507
2591
|
}
|
|
@@ -2511,19 +2595,19 @@ function ImageMosaic({
|
|
|
2511
2595
|
{
|
|
2512
2596
|
onLongPress,
|
|
2513
2597
|
attachment: visible[1],
|
|
2514
|
-
style:
|
|
2598
|
+
style: styles15.tileHalfSquare,
|
|
2515
2599
|
onPress: () => setViewerIndex(1),
|
|
2516
2600
|
overlay: null
|
|
2517
2601
|
}
|
|
2518
2602
|
)
|
|
2519
2603
|
] }),
|
|
2520
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
2604
|
+
/* @__PURE__ */ jsxs(View, { style: [styles15.rowEven, { marginTop: 2 }], children: [
|
|
2521
2605
|
/* @__PURE__ */ jsx(
|
|
2522
2606
|
Tile,
|
|
2523
2607
|
{
|
|
2524
2608
|
onLongPress,
|
|
2525
2609
|
attachment: visible[2],
|
|
2526
|
-
style:
|
|
2610
|
+
style: styles15.tileHalfSquare,
|
|
2527
2611
|
onPress: () => setViewerIndex(2),
|
|
2528
2612
|
overlay: null
|
|
2529
2613
|
}
|
|
@@ -2533,7 +2617,7 @@ function ImageMosaic({
|
|
|
2533
2617
|
{
|
|
2534
2618
|
onLongPress,
|
|
2535
2619
|
attachment: visible[3],
|
|
2536
|
-
style:
|
|
2620
|
+
style: styles15.tileHalfSquare,
|
|
2537
2621
|
onPress: () => setViewerIndex(3),
|
|
2538
2622
|
overlay: overflow > 0 ? `+${overflow}` : null
|
|
2539
2623
|
}
|
|
@@ -2570,18 +2654,18 @@ function Tile({
|
|
|
2570
2654
|
}) {
|
|
2571
2655
|
const theme = usePoolseTheme();
|
|
2572
2656
|
const { url } = useAttachmentUrl(attachment.id);
|
|
2573
|
-
return /* @__PURE__ */ jsxs(Pressable, { onPress, onLongPress, style: [
|
|
2657
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress, onLongPress, style: [styles15.tileBase, style], children: [
|
|
2574
2658
|
url ? /* @__PURE__ */ jsx(
|
|
2575
2659
|
Image,
|
|
2576
2660
|
{
|
|
2577
2661
|
source: { uri: url },
|
|
2578
|
-
style: [
|
|
2662
|
+
style: [styles15.tileImage, { backgroundColor: theme.colors.surface2 }],
|
|
2579
2663
|
resizeMode: "cover",
|
|
2580
2664
|
accessible: true,
|
|
2581
2665
|
accessibilityLabel: attachment.original_filename ?? "image"
|
|
2582
2666
|
}
|
|
2583
|
-
) : /* @__PURE__ */ jsx(View, { style: [
|
|
2584
|
-
overlay ? /* @__PURE__ */ jsx(View, { style:
|
|
2667
|
+
) : /* @__PURE__ */ jsx(View, { style: [styles15.tileImage, { backgroundColor: theme.colors.surface2 }] }),
|
|
2668
|
+
overlay ? /* @__PURE__ */ jsx(View, { style: styles15.overflow, children: /* @__PURE__ */ jsx(Text, { style: styles15.overflowText, children: overlay }) }) : null
|
|
2585
2669
|
] });
|
|
2586
2670
|
}
|
|
2587
2671
|
function FullScreenViewer({
|
|
@@ -2590,7 +2674,7 @@ function FullScreenViewer({
|
|
|
2590
2674
|
}) {
|
|
2591
2675
|
const { url } = useAttachmentUrl(attachment.id);
|
|
2592
2676
|
const { width, height } = Dimensions.get("window");
|
|
2593
|
-
return /* @__PURE__ */ jsxs(Pressable, { style:
|
|
2677
|
+
return /* @__PURE__ */ jsxs(Pressable, { style: styles15.viewer, onPress: onClose, children: [
|
|
2594
2678
|
url ? /* @__PURE__ */ jsx(
|
|
2595
2679
|
Image,
|
|
2596
2680
|
{
|
|
@@ -2606,14 +2690,14 @@ function FullScreenViewer({
|
|
|
2606
2690
|
{
|
|
2607
2691
|
onPress: onClose,
|
|
2608
2692
|
hitSlop: 12,
|
|
2609
|
-
style:
|
|
2693
|
+
style: styles15.closeBtn,
|
|
2610
2694
|
accessibilityLabel: "Close viewer",
|
|
2611
2695
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 20, color: "#ffffff" })
|
|
2612
2696
|
}
|
|
2613
2697
|
)
|
|
2614
2698
|
] });
|
|
2615
2699
|
}
|
|
2616
|
-
var
|
|
2700
|
+
var styles15 = StyleSheet.create({
|
|
2617
2701
|
root: {
|
|
2618
2702
|
width: "100%",
|
|
2619
2703
|
overflow: "hidden",
|
|
@@ -2787,7 +2871,7 @@ function MessageBubble({
|
|
|
2787
2871
|
const isEdited = !!message.edited_at && !isDeleted;
|
|
2788
2872
|
const trimmable = maxBodyLength > 0 && body.length > maxBodyLength;
|
|
2789
2873
|
const truncated = trimmable && !expanded ? body.slice(0, maxBodyLength) + "\u2026" : body;
|
|
2790
|
-
const time =
|
|
2874
|
+
const time = formatTime2(message.inserted_at);
|
|
2791
2875
|
const images = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
|
|
2792
2876
|
const files = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
|
|
2793
2877
|
const hasMedia = images.length > 0;
|
|
@@ -2804,22 +2888,22 @@ function MessageBubble({
|
|
|
2804
2888
|
View,
|
|
2805
2889
|
{
|
|
2806
2890
|
style: [
|
|
2807
|
-
|
|
2808
|
-
variant === "inline" &&
|
|
2809
|
-
variant === "wrapped" &&
|
|
2810
|
-
variant === "overlay" &&
|
|
2811
|
-
variant === "block" &&
|
|
2891
|
+
styles16.metaRow,
|
|
2892
|
+
variant === "inline" && styles16.metaInline,
|
|
2893
|
+
variant === "wrapped" && styles16.metaWrapped,
|
|
2894
|
+
variant === "overlay" && styles16.metaOverlay,
|
|
2895
|
+
variant === "block" && styles16.metaBlock,
|
|
2812
2896
|
// File-only bubble: the meta row follows the cards directly —
|
|
2813
2897
|
// give it air so the time doesn't sit glued to the card.
|
|
2814
|
-
variant === "block" && hasFiles && !hasBody &&
|
|
2815
|
-
variant === "jumbo" &&
|
|
2898
|
+
variant === "block" && hasFiles && !hasBody && styles16.metaBlockAfterFiles,
|
|
2899
|
+
variant === "jumbo" && styles16.metaJumbo
|
|
2816
2900
|
],
|
|
2817
2901
|
onLayout: variant === "inline" || variant === "wrapped" ? (e) => setMetaWidth(e.nativeEvent.layout.width) : void 0,
|
|
2818
2902
|
pointerEvents: "none",
|
|
2819
2903
|
children: [
|
|
2820
|
-
isEdited ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2821
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2822
|
-
isSelf && readState ? /* @__PURE__ */ jsx(View, { style:
|
|
2904
|
+
isEdited ? /* @__PURE__ */ jsx(Text, { style: [styles16.editedTag, { color, opacity: 0.8 }], children: "edited" }) : null,
|
|
2905
|
+
/* @__PURE__ */ jsx(Text, { style: [styles16.meta, { color, opacity: variant === "overlay" ? 1 : 0.75 }], children: time }),
|
|
2906
|
+
isSelf && readState ? /* @__PURE__ */ jsx(View, { style: styles16.readTick, children: /* @__PURE__ */ jsx(
|
|
2823
2907
|
PoolseIcon,
|
|
2824
2908
|
{
|
|
2825
2909
|
name: readState === "read" ? "check-double" : "check",
|
|
@@ -2831,7 +2915,7 @@ function MessageBubble({
|
|
|
2831
2915
|
}
|
|
2832
2916
|
);
|
|
2833
2917
|
};
|
|
2834
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
2918
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles16.wrap, { alignSelf: isSelf ? "flex-end" : "flex-start", maxWidth: bubbleMaxWidth }], children: [
|
|
2835
2919
|
/* @__PURE__ */ jsxs(
|
|
2836
2920
|
View,
|
|
2837
2921
|
{
|
|
@@ -2851,7 +2935,7 @@ function MessageBubble({
|
|
|
2851
2935
|
showSenderName && !isSelf && jumboCount === 0 && (groupPosition === "first" || groupPosition === "standalone") ? /* @__PURE__ */ jsx(
|
|
2852
2936
|
Text,
|
|
2853
2937
|
{
|
|
2854
|
-
style: [
|
|
2938
|
+
style: [styles16.senderName, { color: senderTint, fontFamily: theme.type.fontBody }],
|
|
2855
2939
|
children: senderLabel
|
|
2856
2940
|
}
|
|
2857
2941
|
) : null,
|
|
@@ -2868,7 +2952,7 @@ function MessageBubble({
|
|
|
2868
2952
|
// 3px of bubble color framing the picture; the mosaic clips
|
|
2869
2953
|
// itself 3px tighter than the bubble so the curves stay
|
|
2870
2954
|
// concentric.
|
|
2871
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2955
|
+
/* @__PURE__ */ jsxs(View, { style: styles16.mediaFrame, children: [
|
|
2872
2956
|
/* @__PURE__ */ jsx(
|
|
2873
2957
|
ImageMosaic,
|
|
2874
2958
|
{
|
|
@@ -2882,7 +2966,7 @@ function MessageBubble({
|
|
|
2882
2966
|
metaOverlay ? metaRow("overlay") : null
|
|
2883
2967
|
] })
|
|
2884
2968
|
) : null,
|
|
2885
|
-
hasFiles ? /* @__PURE__ */ jsx(View, { style:
|
|
2969
|
+
hasFiles ? /* @__PURE__ */ jsx(View, { style: styles16.filesBlock, children: files.map((att) => /* @__PURE__ */ jsx(
|
|
2886
2970
|
AttachmentPreview,
|
|
2887
2971
|
{
|
|
2888
2972
|
attachment: att,
|
|
@@ -2891,7 +2975,7 @@ function MessageBubble({
|
|
|
2891
2975
|
},
|
|
2892
2976
|
att.id
|
|
2893
2977
|
)) }) : null,
|
|
2894
|
-
isDeleted ? /* @__PURE__ */ jsx(View, { style: [
|
|
2978
|
+
isDeleted ? /* @__PURE__ */ jsx(View, { style: [styles16.textBlock, sectionAbove && styles16.textBlockAfter], children: /* @__PURE__ */ jsx(
|
|
2895
2979
|
Text,
|
|
2896
2980
|
{
|
|
2897
2981
|
style: {
|
|
@@ -2905,7 +2989,7 @@ function MessageBubble({
|
|
|
2905
2989
|
children: "Message deleted"
|
|
2906
2990
|
}
|
|
2907
2991
|
) }) : null,
|
|
2908
|
-
hasBody && jumboCount > 0 ? /* @__PURE__ */ jsx(View, { style:
|
|
2992
|
+
hasBody && jumboCount > 0 ? /* @__PURE__ */ jsx(View, { style: styles16.jumboBlock, children: /* @__PURE__ */ jsx(
|
|
2909
2993
|
Text,
|
|
2910
2994
|
{
|
|
2911
2995
|
style: { fontSize: emojiFontSize(jumboCount), lineHeight: emojiFontSize(jumboCount) + 8 },
|
|
@@ -2915,7 +2999,7 @@ function MessageBubble({
|
|
|
2915
2999
|
hasBody && jumboCount === 0 ? /* @__PURE__ */ jsxs(
|
|
2916
3000
|
View,
|
|
2917
3001
|
{
|
|
2918
|
-
style: [
|
|
3002
|
+
style: [styles16.textBlock, sectionAbove && styles16.textBlockAfter],
|
|
2919
3003
|
onLayout: inlineMeta ? (e) => setTextBoxWidth(e.nativeEvent.layout.width - 24) : void 0,
|
|
2920
3004
|
children: [
|
|
2921
3005
|
markdown && !inlineMeta ? renderMarkdown(truncated, {
|
|
@@ -2949,7 +3033,7 @@ function MessageBubble({
|
|
|
2949
3033
|
Text,
|
|
2950
3034
|
{
|
|
2951
3035
|
style: [
|
|
2952
|
-
|
|
3036
|
+
styles16.readMore,
|
|
2953
3037
|
{ color: isSelf ? theme.colors.onBrand : theme.colors.brand }
|
|
2954
3038
|
],
|
|
2955
3039
|
children: expanded ? "Show less" : "Read more"
|
|
@@ -2960,7 +3044,7 @@ function MessageBubble({
|
|
|
2960
3044
|
}
|
|
2961
3045
|
) : null,
|
|
2962
3046
|
!inlineMeta && !metaOverlay && jumboCount === 0 ? metaRow("block") : null,
|
|
2963
|
-
actionsTrigger ? /* @__PURE__ */ jsx(View, { style:
|
|
3047
|
+
actionsTrigger ? /* @__PURE__ */ jsx(View, { style: styles16.actionsSlot, children: actionsTrigger }) : null
|
|
2964
3048
|
]
|
|
2965
3049
|
}
|
|
2966
3050
|
),
|
|
@@ -2985,15 +3069,15 @@ function QuotedCard({
|
|
|
2985
3069
|
onPress,
|
|
2986
3070
|
disabled: !onPress,
|
|
2987
3071
|
style: [
|
|
2988
|
-
|
|
3072
|
+
styles16.quoted,
|
|
2989
3073
|
{
|
|
2990
3074
|
backgroundColor: bg,
|
|
2991
3075
|
borderLeftColor: accent
|
|
2992
3076
|
}
|
|
2993
3077
|
],
|
|
2994
3078
|
children: [
|
|
2995
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2996
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
3079
|
+
/* @__PURE__ */ jsx(Text, { style: [styles16.quotedSender, { color: accent }], numberOfLines: 1, children: senderName }),
|
|
3080
|
+
/* @__PURE__ */ jsx(Text, { style: [styles16.quotedBody, { color: txt }], numberOfLines: 2, children: quoted.deleted_at ? "Original message deleted" : quoted.body ?? "\u2026" })
|
|
2997
3081
|
]
|
|
2998
3082
|
}
|
|
2999
3083
|
);
|
|
@@ -3002,7 +3086,7 @@ function isImageContentType(ct) {
|
|
|
3002
3086
|
if (!ct) return false;
|
|
3003
3087
|
return ct.startsWith("image/");
|
|
3004
3088
|
}
|
|
3005
|
-
function
|
|
3089
|
+
function formatTime2(iso) {
|
|
3006
3090
|
try {
|
|
3007
3091
|
const d = new Date(iso);
|
|
3008
3092
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -3025,7 +3109,7 @@ function formatTime(iso) {
|
|
|
3025
3109
|
function isSameDay(a, b) {
|
|
3026
3110
|
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
3027
3111
|
}
|
|
3028
|
-
var
|
|
3112
|
+
var styles16 = StyleSheet.create({
|
|
3029
3113
|
wrap: {
|
|
3030
3114
|
marginBottom: 2
|
|
3031
3115
|
},
|
|
@@ -3152,7 +3236,7 @@ function ReactionStrip({
|
|
|
3152
3236
|
});
|
|
3153
3237
|
const entries = Object.entries(reactions);
|
|
3154
3238
|
if (entries.length === 0) return null;
|
|
3155
|
-
return /* @__PURE__ */ jsx(View, { style:
|
|
3239
|
+
return /* @__PURE__ */ jsx(View, { style: styles17.strip, children: entries.map(([emoji, userIds]) => {
|
|
3156
3240
|
const userArr = Array.isArray(userIds) ? userIds : [];
|
|
3157
3241
|
const meReacted = meId !== null && userArr.includes(meId);
|
|
3158
3242
|
return /* @__PURE__ */ jsxs(
|
|
@@ -3160,7 +3244,7 @@ function ReactionStrip({
|
|
|
3160
3244
|
{
|
|
3161
3245
|
onPress: () => meReacted ? removeReaction(emoji) : addReaction(emoji),
|
|
3162
3246
|
style: [
|
|
3163
|
-
|
|
3247
|
+
styles17.chip,
|
|
3164
3248
|
{
|
|
3165
3249
|
backgroundColor: meReacted ? theme.colors.brandSoft : theme.colors.surface2,
|
|
3166
3250
|
borderColor: meReacted ? theme.colors.brand : theme.colors.border,
|
|
@@ -3169,12 +3253,12 @@ function ReactionStrip({
|
|
|
3169
3253
|
}
|
|
3170
3254
|
],
|
|
3171
3255
|
children: [
|
|
3172
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
3256
|
+
/* @__PURE__ */ jsx(Text, { style: styles17.emoji, children: emoji }),
|
|
3173
3257
|
/* @__PURE__ */ jsx(
|
|
3174
3258
|
Text,
|
|
3175
3259
|
{
|
|
3176
3260
|
style: [
|
|
3177
|
-
|
|
3261
|
+
styles17.count,
|
|
3178
3262
|
{
|
|
3179
3263
|
color: meReacted ? theme.colors.brand : theme.colors.ink2,
|
|
3180
3264
|
fontWeight: meReacted ? "700" : "600"
|
|
@@ -3196,11 +3280,11 @@ function ReactionPicker({
|
|
|
3196
3280
|
emojis = DEFAULT_EMOJIS
|
|
3197
3281
|
}) {
|
|
3198
3282
|
const theme = usePoolseTheme();
|
|
3199
|
-
return /* @__PURE__ */ jsx(Modal, { visible, transparent: true, animationType: "fade", onRequestClose: onClose, children: /* @__PURE__ */ jsx(Pressable, { style:
|
|
3283
|
+
return /* @__PURE__ */ jsx(Modal, { visible, transparent: true, animationType: "fade", onRequestClose: onClose, children: /* @__PURE__ */ jsx(Pressable, { style: styles17.backdrop, onPress: onClose, children: /* @__PURE__ */ jsx(
|
|
3200
3284
|
View,
|
|
3201
3285
|
{
|
|
3202
3286
|
style: [
|
|
3203
|
-
|
|
3287
|
+
styles17.sheet,
|
|
3204
3288
|
{
|
|
3205
3289
|
backgroundColor: theme.colors.surface,
|
|
3206
3290
|
borderRadius: theme.radii.lg
|
|
@@ -3210,19 +3294,19 @@ function ReactionPicker({
|
|
|
3210
3294
|
children: emojis.map((emoji) => /* @__PURE__ */ jsx(
|
|
3211
3295
|
Pressable,
|
|
3212
3296
|
{
|
|
3213
|
-
style:
|
|
3297
|
+
style: styles17.emojiBtn,
|
|
3214
3298
|
onPress: () => {
|
|
3215
3299
|
onPick(emoji);
|
|
3216
3300
|
onClose();
|
|
3217
3301
|
},
|
|
3218
|
-
children: /* @__PURE__ */ jsx(Text, { style:
|
|
3302
|
+
children: /* @__PURE__ */ jsx(Text, { style: styles17.bigEmoji, children: emoji })
|
|
3219
3303
|
},
|
|
3220
3304
|
emoji
|
|
3221
3305
|
))
|
|
3222
3306
|
}
|
|
3223
3307
|
) }) });
|
|
3224
3308
|
}
|
|
3225
|
-
var
|
|
3309
|
+
var styles17 = StyleSheet.create({
|
|
3226
3310
|
strip: {
|
|
3227
3311
|
flexDirection: "row",
|
|
3228
3312
|
flexWrap: "wrap",
|
|
@@ -3279,7 +3363,14 @@ var styles16 = StyleSheet.create({
|
|
|
3279
3363
|
}
|
|
3280
3364
|
});
|
|
3281
3365
|
var SWIPE_REPLY_THRESHOLD = 50;
|
|
3282
|
-
function MessageRow({
|
|
3366
|
+
function MessageRow(props) {
|
|
3367
|
+
const callLog = callLogDisplayFor(props.msg, props.meId);
|
|
3368
|
+
if (callLog !== void 0) {
|
|
3369
|
+
return callLog ? /* @__PURE__ */ jsx(CallLogRow, { msg: props.msg, meId: props.meId }) : null;
|
|
3370
|
+
}
|
|
3371
|
+
return /* @__PURE__ */ jsx(BubbleMessageRow, { ...props });
|
|
3372
|
+
}
|
|
3373
|
+
function BubbleMessageRow({
|
|
3283
3374
|
msg,
|
|
3284
3375
|
meId,
|
|
3285
3376
|
reactions = true,
|
|
@@ -3390,15 +3481,15 @@ function MessageRow({
|
|
|
3390
3481
|
View,
|
|
3391
3482
|
{
|
|
3392
3483
|
style: [
|
|
3393
|
-
|
|
3484
|
+
styles18.row,
|
|
3394
3485
|
{ alignSelf: isSelf ? "flex-end" : "flex-start" },
|
|
3395
3486
|
// Lift this row above the dim backdrop the parent renders
|
|
3396
3487
|
// during edit mode. zIndex covers iOS / web; elevation does
|
|
3397
3488
|
// the equivalent on Android.
|
|
3398
|
-
isEditing ?
|
|
3489
|
+
isEditing ? styles18.rowEditing : null
|
|
3399
3490
|
],
|
|
3400
3491
|
children: [
|
|
3401
|
-
showAvatarSlot ? /* @__PURE__ */ jsx(View, { style:
|
|
3492
|
+
showAvatarSlot ? /* @__PURE__ */ jsx(View, { style: styles18.avatarSlot, children: showAvatarRender ? /* @__PURE__ */ jsx(
|
|
3402
3493
|
Avatar,
|
|
3403
3494
|
{
|
|
3404
3495
|
src: avatarUrl ?? null,
|
|
@@ -3407,14 +3498,14 @@ function MessageRow({
|
|
|
3407
3498
|
size: "sm"
|
|
3408
3499
|
}
|
|
3409
3500
|
) : null }) : null,
|
|
3410
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
3501
|
+
/* @__PURE__ */ jsxs(View, { style: styles18.bubbleCol, children: [
|
|
3411
3502
|
swipeEnabled ? /* @__PURE__ */ jsx(
|
|
3412
3503
|
Animated.View,
|
|
3413
3504
|
{
|
|
3414
3505
|
pointerEvents: "none",
|
|
3415
3506
|
style: [
|
|
3416
|
-
|
|
3417
|
-
isSelf ?
|
|
3507
|
+
styles18.replyHint,
|
|
3508
|
+
isSelf ? styles18.replyHintRight : styles18.replyHintLeft,
|
|
3418
3509
|
{
|
|
3419
3510
|
opacity: replyIconOpacity,
|
|
3420
3511
|
transform: [{ scale: replyIconScale }],
|
|
@@ -3460,13 +3551,13 @@ function MessageRow({
|
|
|
3460
3551
|
)
|
|
3461
3552
|
}
|
|
3462
3553
|
),
|
|
3463
|
-
threads && (msg.reply_count ?? 0) > 0 && onOpenThread ? /* @__PURE__ */ jsx(Pressable, { onPress: onOpenThread, style:
|
|
3554
|
+
threads && (msg.reply_count ?? 0) > 0 && onOpenThread ? /* @__PURE__ */ jsx(Pressable, { onPress: onOpenThread, style: styles18.threadPill, children: /* @__PURE__ */ jsxs(Text, { style: [styles18.threadPillText, { color: theme.colors.brand }], children: [
|
|
3464
3555
|
"\u{1F4AC} ",
|
|
3465
3556
|
msg.reply_count,
|
|
3466
3557
|
" ",
|
|
3467
3558
|
msg.reply_count === 1 ? "reply" : "replies"
|
|
3468
3559
|
] }) }) : null,
|
|
3469
|
-
reactions ? /* @__PURE__ */ jsx(View, { style: [
|
|
3560
|
+
reactions ? /* @__PURE__ */ jsx(View, { style: [styles18.reactionsRow, { alignSelf: isSelf ? "flex-end" : "flex-start" }], children: /* @__PURE__ */ jsx(
|
|
3470
3561
|
ReactionStrip,
|
|
3471
3562
|
{
|
|
3472
3563
|
messageId: msg.id,
|
|
@@ -3525,7 +3616,7 @@ function MessageRow({
|
|
|
3525
3616
|
}
|
|
3526
3617
|
);
|
|
3527
3618
|
}
|
|
3528
|
-
var
|
|
3619
|
+
var styles18 = StyleSheet.create({
|
|
3529
3620
|
row: {
|
|
3530
3621
|
flexDirection: "row",
|
|
3531
3622
|
alignItems: "flex-end",
|
|
@@ -3685,13 +3776,13 @@ function ThreadSheet({
|
|
|
3685
3776
|
),
|
|
3686
3777
|
[rootMessage, meId, labelFor, avatarFor]
|
|
3687
3778
|
);
|
|
3688
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
3689
|
-
/* @__PURE__ */ jsx(Pressable, { style:
|
|
3779
|
+
return /* @__PURE__ */ jsxs(View, { style: styles19.modalRoot, children: [
|
|
3780
|
+
/* @__PURE__ */ jsx(Pressable, { style: styles19.backdrop, onPress: onClose, accessibilityLabel: "Close thread" }),
|
|
3690
3781
|
/* @__PURE__ */ jsxs(
|
|
3691
3782
|
Animated.View,
|
|
3692
3783
|
{
|
|
3693
3784
|
style: [
|
|
3694
|
-
|
|
3785
|
+
styles19.sheet,
|
|
3695
3786
|
{
|
|
3696
3787
|
height: sheetHeight,
|
|
3697
3788
|
backgroundColor: theme.colors.paper,
|
|
@@ -3703,14 +3794,14 @@ function ThreadSheet({
|
|
|
3703
3794
|
],
|
|
3704
3795
|
children: [
|
|
3705
3796
|
/* @__PURE__ */ jsxs(View, { ...panHandlers, children: [
|
|
3706
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
3707
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
3797
|
+
/* @__PURE__ */ jsx(View, { style: styles19.dragHandle, children: /* @__PURE__ */ jsx(View, { style: [styles19.dragPill, { backgroundColor: theme.colors.ink3 }] }) }),
|
|
3798
|
+
/* @__PURE__ */ jsxs(View, { style: [styles19.header, { borderBottomColor: theme.colors.border }], children: [
|
|
3708
3799
|
/* @__PURE__ */ jsx(
|
|
3709
3800
|
Pressable,
|
|
3710
3801
|
{
|
|
3711
3802
|
onPress: onClose,
|
|
3712
3803
|
hitSlop: 16,
|
|
3713
|
-
style: [
|
|
3804
|
+
style: [styles19.closeBtn, { backgroundColor: theme.colors.surface2 }],
|
|
3714
3805
|
accessibilityLabel: "Close thread",
|
|
3715
3806
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.ink })
|
|
3716
3807
|
}
|
|
@@ -3719,7 +3810,7 @@ function ThreadSheet({
|
|
|
3719
3810
|
Text,
|
|
3720
3811
|
{
|
|
3721
3812
|
style: [
|
|
3722
|
-
|
|
3813
|
+
styles19.title,
|
|
3723
3814
|
{ color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
|
|
3724
3815
|
],
|
|
3725
3816
|
children: "Thread"
|
|
@@ -3730,12 +3821,12 @@ function ThreadSheet({
|
|
|
3730
3821
|
/* @__PURE__ */ jsxs(
|
|
3731
3822
|
KeyboardAvoidingView,
|
|
3732
3823
|
{
|
|
3733
|
-
style:
|
|
3824
|
+
style: styles19.kavBody,
|
|
3734
3825
|
behavior: Platform.OS === "ios" ? "padding" : "height",
|
|
3735
3826
|
keyboardVerticalOffset: Platform.OS === "ios" ? gutter : 0,
|
|
3736
3827
|
children: [
|
|
3737
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
3738
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
3828
|
+
/* @__PURE__ */ jsx(View, { style: [styles19.rootPreview, { backgroundColor: theme.colors.surface2 }], children: rootRow }),
|
|
3829
|
+
/* @__PURE__ */ jsx(View, { style: styles19.listWrap, children: /* @__PURE__ */ jsx(
|
|
3739
3830
|
MessageList,
|
|
3740
3831
|
{
|
|
3741
3832
|
messages: replies,
|
|
@@ -3771,7 +3862,7 @@ function ThreadSheet({
|
|
|
3771
3862
|
)
|
|
3772
3863
|
] });
|
|
3773
3864
|
}
|
|
3774
|
-
var
|
|
3865
|
+
var styles19 = StyleSheet.create({
|
|
3775
3866
|
modalRoot: {
|
|
3776
3867
|
flex: 1,
|
|
3777
3868
|
justifyContent: "flex-end"
|
|
@@ -3843,7 +3934,7 @@ function TypingIndicator({ typing, labelFor }) {
|
|
|
3843
3934
|
const ids = Array.from(typing);
|
|
3844
3935
|
const isTyping = ids.length > 0;
|
|
3845
3936
|
if (!isTyping) return /* @__PURE__ */ jsx(View, { style: { height: 0 } });
|
|
3846
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
3937
|
+
return /* @__PURE__ */ jsxs(View, { style: styles20.row, children: [
|
|
3847
3938
|
/* @__PURE__ */ jsx(TypingDots, {}),
|
|
3848
3939
|
/* @__PURE__ */ jsx(TypingLabel, { ids, ...labelFor ? { labelFor } : {} })
|
|
3849
3940
|
] });
|
|
@@ -3888,7 +3979,7 @@ function TypingDots() {
|
|
|
3888
3979
|
],
|
|
3889
3980
|
opacity: val.interpolate({ inputRange: [0, 1], outputRange: [0.5, 1] })
|
|
3890
3981
|
});
|
|
3891
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
3982
|
+
return /* @__PURE__ */ jsxs(View, { style: styles20.dotsWrap, children: [
|
|
3892
3983
|
/* @__PURE__ */ jsx(Animated.View, { style: dot(a) }),
|
|
3893
3984
|
/* @__PURE__ */ jsx(Animated.View, { style: dot(b) }),
|
|
3894
3985
|
/* @__PURE__ */ jsx(Animated.View, { style: dot(c) })
|
|
@@ -3904,9 +3995,9 @@ function TypingLabel({
|
|
|
3904
3995
|
const name1 = useDisplayName(id1, labelFor);
|
|
3905
3996
|
const name2 = useDisplayName(id2, labelFor);
|
|
3906
3997
|
const text = ids.length === 1 ? `${name1} is typing` : ids.length === 2 ? `${name1} and ${name2} are typing` : `${ids.length} people are typing`;
|
|
3907
|
-
return /* @__PURE__ */ jsx(Text, { style: [
|
|
3998
|
+
return /* @__PURE__ */ jsx(Text, { style: [styles20.label, { color: theme.colors.ink2, fontFamily: theme.type.fontBody }], children: text });
|
|
3908
3999
|
}
|
|
3909
|
-
var
|
|
4000
|
+
var styles20 = StyleSheet.create({
|
|
3910
4001
|
row: {
|
|
3911
4002
|
flexDirection: "row",
|
|
3912
4003
|
alignItems: "center",
|
|
@@ -4008,20 +4099,27 @@ function ConversationView({
|
|
|
4008
4099
|
});
|
|
4009
4100
|
onMarkedRead?.(conversationId, latest.id);
|
|
4010
4101
|
}, [messages, meId, readReceipts, markReadUpTo, onMarkedRead, conversationId]);
|
|
4102
|
+
const visibleMessages = useMemo(
|
|
4103
|
+
() => messages.filter((m) => isMessageVisibleTo(m, meId)),
|
|
4104
|
+
[messages, meId]
|
|
4105
|
+
);
|
|
4011
4106
|
const groupPositionById = useMemo(() => {
|
|
4012
4107
|
const map = /* @__PURE__ */ new Map();
|
|
4013
|
-
for (let i = 0; i <
|
|
4014
|
-
const msg =
|
|
4108
|
+
for (let i = 0; i < visibleMessages.length; i++) {
|
|
4109
|
+
const msg = visibleMessages[i];
|
|
4015
4110
|
if (!msg) continue;
|
|
4016
|
-
const prev = i > 0 ?
|
|
4017
|
-
const next = i <
|
|
4111
|
+
const prev = i > 0 ? visibleMessages[i - 1] ?? null : null;
|
|
4112
|
+
const next = i < visibleMessages.length - 1 ? visibleMessages[i + 1] ?? null : null;
|
|
4018
4113
|
map.set(msg.id, computeGroupPosition(msg, prev, next, GROUPING_WINDOW_MS));
|
|
4019
4114
|
}
|
|
4020
4115
|
return map;
|
|
4021
|
-
}, [
|
|
4116
|
+
}, [visibleMessages]);
|
|
4022
4117
|
const renderItem = useCallback(
|
|
4023
4118
|
(msg) => {
|
|
4024
|
-
if (renderMessage)
|
|
4119
|
+
if (renderMessage) {
|
|
4120
|
+
const custom = renderMessage(msg, meId);
|
|
4121
|
+
if (custom !== null && custom !== void 0) return custom;
|
|
4122
|
+
}
|
|
4025
4123
|
const readState = readReceipts && meId !== null && msg.sender_id === meId ? readStateForMessage(msg, members, meId, sequenceByMessageId) : void 0;
|
|
4026
4124
|
const isSelf = meId !== null && msg.sender_id === meId;
|
|
4027
4125
|
const canEdit = isSelf && !msg.deleted_at && (readState ?? "sent") === "sent";
|
|
@@ -4081,7 +4179,7 @@ function ConversationView({
|
|
|
4081
4179
|
const listItems = useMemo(() => {
|
|
4082
4180
|
const out = [];
|
|
4083
4181
|
let prev = null;
|
|
4084
|
-
for (const msg of
|
|
4182
|
+
for (const msg of visibleMessages) {
|
|
4085
4183
|
if (prev === null || !sameDay(msg.inserted_at, prev.inserted_at)) {
|
|
4086
4184
|
const label = formatDayLabel(msg.inserted_at);
|
|
4087
4185
|
out.push({
|
|
@@ -4094,7 +4192,7 @@ function ConversationView({
|
|
|
4094
4192
|
prev = msg;
|
|
4095
4193
|
}
|
|
4096
4194
|
return out;
|
|
4097
|
-
}, [
|
|
4195
|
+
}, [visibleMessages]);
|
|
4098
4196
|
const composerProps = useMemo(
|
|
4099
4197
|
() => ({
|
|
4100
4198
|
onSend: async (body, opts) => {
|
|
@@ -4144,16 +4242,16 @@ function ConversationView({
|
|
|
4144
4242
|
return /* @__PURE__ */ jsx(UploadProvider, { children: /* @__PURE__ */ jsxs(
|
|
4145
4243
|
KeyboardAvoidingView,
|
|
4146
4244
|
{
|
|
4147
|
-
style: [
|
|
4245
|
+
style: [styles21.root, { backgroundColor: theme.colors.paper }],
|
|
4148
4246
|
behavior: Platform.OS === "ios" ? "padding" : "height",
|
|
4149
4247
|
keyboardVerticalOffset: keyboardOffset,
|
|
4150
4248
|
children: [
|
|
4151
4249
|
headerNode,
|
|
4152
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4250
|
+
/* @__PURE__ */ jsxs(View, { style: styles21.listWrap, children: [
|
|
4153
4251
|
/* @__PURE__ */ jsx(
|
|
4154
4252
|
MessageList,
|
|
4155
4253
|
{
|
|
4156
|
-
messages,
|
|
4254
|
+
messages: visibleMessages,
|
|
4157
4255
|
items: listItems,
|
|
4158
4256
|
meId,
|
|
4159
4257
|
loading,
|
|
@@ -4167,7 +4265,7 @@ function ConversationView({
|
|
|
4167
4265
|
editingId ? /* @__PURE__ */ jsx(
|
|
4168
4266
|
Pressable,
|
|
4169
4267
|
{
|
|
4170
|
-
style:
|
|
4268
|
+
style: styles21.editBackdrop,
|
|
4171
4269
|
onPress: () => setEditingId(null),
|
|
4172
4270
|
accessibilityLabel: "Cancel editing"
|
|
4173
4271
|
}
|
|
@@ -4202,7 +4300,7 @@ function readStateForMessage(msg, members, meId, sequenceByMessageId) {
|
|
|
4202
4300
|
});
|
|
4203
4301
|
return anyRead ? "read" : "sent";
|
|
4204
4302
|
}
|
|
4205
|
-
var
|
|
4303
|
+
var styles21 = StyleSheet.create({
|
|
4206
4304
|
root: {
|
|
4207
4305
|
flex: 1
|
|
4208
4306
|
},
|
|
@@ -4284,13 +4382,13 @@ function UserPickerSheet({
|
|
|
4284
4382
|
animationType: "slide",
|
|
4285
4383
|
onRequestClose: handleClose,
|
|
4286
4384
|
statusBarTranslucent: true,
|
|
4287
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
4288
|
-
/* @__PURE__ */ jsx(Pressable, { style:
|
|
4385
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles22.modalRoot, children: [
|
|
4386
|
+
/* @__PURE__ */ jsx(Pressable, { style: styles22.backdrop, onPress: handleClose }),
|
|
4289
4387
|
/* @__PURE__ */ jsxs(
|
|
4290
4388
|
Animated.View,
|
|
4291
4389
|
{
|
|
4292
4390
|
style: [
|
|
4293
|
-
|
|
4391
|
+
styles22.sheet,
|
|
4294
4392
|
{
|
|
4295
4393
|
backgroundColor: theme.colors.paper,
|
|
4296
4394
|
borderTopLeftRadius: theme.radii.xl,
|
|
@@ -4300,14 +4398,14 @@ function UserPickerSheet({
|
|
|
4300
4398
|
theme.shadows.lg
|
|
4301
4399
|
],
|
|
4302
4400
|
children: [
|
|
4303
|
-
/* @__PURE__ */ jsx(View, { ...panHandlers, style:
|
|
4304
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4401
|
+
/* @__PURE__ */ jsx(View, { ...panHandlers, style: styles22.dragHandle, children: /* @__PURE__ */ jsx(View, { style: [styles22.dragPill, { backgroundColor: theme.colors.ink3 }] }) }),
|
|
4402
|
+
/* @__PURE__ */ jsxs(View, { style: styles22.header, children: [
|
|
4305
4403
|
/* @__PURE__ */ jsx(
|
|
4306
4404
|
Pressable,
|
|
4307
4405
|
{
|
|
4308
4406
|
onPress: handleClose,
|
|
4309
4407
|
hitSlop: 16,
|
|
4310
|
-
style: [
|
|
4408
|
+
style: [styles22.closeBtn, { backgroundColor: theme.colors.surface2 }],
|
|
4311
4409
|
accessibilityLabel: "Close picker",
|
|
4312
4410
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.ink })
|
|
4313
4411
|
}
|
|
@@ -4316,7 +4414,7 @@ function UserPickerSheet({
|
|
|
4316
4414
|
Text,
|
|
4317
4415
|
{
|
|
4318
4416
|
style: [
|
|
4319
|
-
|
|
4417
|
+
styles22.title,
|
|
4320
4418
|
{ color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
|
|
4321
4419
|
],
|
|
4322
4420
|
numberOfLines: 1,
|
|
@@ -4330,7 +4428,7 @@ function UserPickerSheet({
|
|
|
4330
4428
|
disabled: !canCreate,
|
|
4331
4429
|
hitSlop: 6,
|
|
4332
4430
|
style: [
|
|
4333
|
-
|
|
4431
|
+
styles22.createBtn,
|
|
4334
4432
|
{
|
|
4335
4433
|
backgroundColor: canCreate ? theme.colors.brand : theme.colors.surface2,
|
|
4336
4434
|
opacity: canCreate ? 1 : 0.6
|
|
@@ -4361,7 +4459,7 @@ function UserPickerSheet({
|
|
|
4361
4459
|
value: groupName,
|
|
4362
4460
|
onChangeText: setGroupName,
|
|
4363
4461
|
style: [
|
|
4364
|
-
|
|
4462
|
+
styles22.groupNameInput,
|
|
4365
4463
|
{
|
|
4366
4464
|
color: theme.colors.ink,
|
|
4367
4465
|
backgroundColor: theme.colors.surface2,
|
|
@@ -4380,7 +4478,7 @@ function UserPickerSheet({
|
|
|
4380
4478
|
value: query,
|
|
4381
4479
|
onChangeText: setQuery,
|
|
4382
4480
|
style: [
|
|
4383
|
-
|
|
4481
|
+
styles22.searchInput,
|
|
4384
4482
|
{
|
|
4385
4483
|
color: theme.colors.ink,
|
|
4386
4484
|
backgroundColor: theme.colors.surface2,
|
|
@@ -4396,7 +4494,7 @@ function UserPickerSheet({
|
|
|
4396
4494
|
{
|
|
4397
4495
|
data: filtered,
|
|
4398
4496
|
keyExtractor: (u) => u.externalId,
|
|
4399
|
-
ListEmptyComponent: /* @__PURE__ */ jsx(View, { style:
|
|
4497
|
+
ListEmptyComponent: /* @__PURE__ */ jsx(View, { style: styles22.empty, children: /* @__PURE__ */ jsx(Text, { style: [styles22.emptyText, { color: theme.colors.ink3 }], children: query ? "No matches." : "No users to show." }) }),
|
|
4400
4498
|
renderItem: ({ item }) => /* @__PURE__ */ jsx(
|
|
4401
4499
|
UserRow,
|
|
4402
4500
|
{
|
|
@@ -4434,29 +4532,29 @@ function UserRow({
|
|
|
4434
4532
|
{
|
|
4435
4533
|
onPress,
|
|
4436
4534
|
style: [
|
|
4437
|
-
|
|
4535
|
+
styles22.row,
|
|
4438
4536
|
{
|
|
4439
4537
|
backgroundColor: selected ? theme.colors.brandSoft : "transparent"
|
|
4440
4538
|
}
|
|
4441
4539
|
],
|
|
4442
4540
|
children: [
|
|
4443
|
-
user.avatarUrl ? /* @__PURE__ */ jsx(Image, { source: { uri: user.avatarUrl }, style:
|
|
4444
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4541
|
+
user.avatarUrl ? /* @__PURE__ */ jsx(Image, { source: { uri: user.avatarUrl }, style: styles22.avatarImg }) : /* @__PURE__ */ jsx(Avatar, { src: null, name: user.name, seed: user.externalId, size: "md" }),
|
|
4542
|
+
/* @__PURE__ */ jsxs(View, { style: styles22.body, children: [
|
|
4445
4543
|
/* @__PURE__ */ jsx(
|
|
4446
4544
|
Text,
|
|
4447
4545
|
{
|
|
4448
|
-
style: [
|
|
4546
|
+
style: [styles22.name, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
|
|
4449
4547
|
numberOfLines: 1,
|
|
4450
4548
|
children: user.name
|
|
4451
4549
|
}
|
|
4452
4550
|
),
|
|
4453
|
-
user.subtitle ? /* @__PURE__ */ jsx(Text, { style: [
|
|
4551
|
+
user.subtitle ? /* @__PURE__ */ jsx(Text, { style: [styles22.subtitle, { color: theme.colors.ink3 }], numberOfLines: 1, children: user.subtitle }) : null
|
|
4454
4552
|
] }),
|
|
4455
4553
|
isGroup ? /* @__PURE__ */ jsx(
|
|
4456
4554
|
View,
|
|
4457
4555
|
{
|
|
4458
4556
|
style: [
|
|
4459
|
-
|
|
4557
|
+
styles22.checkbox,
|
|
4460
4558
|
{
|
|
4461
4559
|
borderColor: selected ? theme.colors.brand : theme.colors.border,
|
|
4462
4560
|
backgroundColor: selected ? theme.colors.brand : "transparent"
|
|
@@ -4469,7 +4567,7 @@ function UserRow({
|
|
|
4469
4567
|
}
|
|
4470
4568
|
);
|
|
4471
4569
|
}
|
|
4472
|
-
var
|
|
4570
|
+
var styles22 = StyleSheet.create({
|
|
4473
4571
|
modalRoot: {
|
|
4474
4572
|
flex: 1,
|
|
4475
4573
|
justifyContent: "flex-end"
|
|
@@ -4594,6 +4692,7 @@ var PoolseInbox = forwardRef(
|
|
|
4594
4692
|
refetch: refetchConversations
|
|
4595
4693
|
} = useConversations();
|
|
4596
4694
|
const meExternalId = me?.external_id ?? null;
|
|
4695
|
+
const meId = me?.id ?? null;
|
|
4597
4696
|
const detailKeyboardOffset = CHAT_HEADER_HEIGHT;
|
|
4598
4697
|
const [activeId, setActiveId] = useState(null);
|
|
4599
4698
|
const [userPickerOpen, setUserPickerOpen] = useState(false);
|
|
@@ -4720,6 +4819,7 @@ var PoolseInbox = forwardRef(
|
|
|
4720
4819
|
conv,
|
|
4721
4820
|
selected,
|
|
4722
4821
|
meExternalId,
|
|
4822
|
+
meId,
|
|
4723
4823
|
unread,
|
|
4724
4824
|
...labelFor ? { labelFor } : {},
|
|
4725
4825
|
...avatarFor ? { avatarFor } : {},
|
|
@@ -4727,9 +4827,9 @@ var PoolseInbox = forwardRef(
|
|
|
4727
4827
|
}
|
|
4728
4828
|
);
|
|
4729
4829
|
},
|
|
4730
|
-
[renderConversationRow, meExternalId, labelFor, avatarFor, unreadCounts]
|
|
4830
|
+
[renderConversationRow, meExternalId, meId, labelFor, avatarFor, unreadCounts]
|
|
4731
4831
|
);
|
|
4732
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
4832
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles23.root, { backgroundColor: theme.colors.paper }], children: [
|
|
4733
4833
|
/* @__PURE__ */ jsxs(
|
|
4734
4834
|
Animated.View,
|
|
4735
4835
|
{
|
|
@@ -4740,7 +4840,7 @@ var PoolseInbox = forwardRef(
|
|
|
4740
4840
|
View,
|
|
4741
4841
|
{
|
|
4742
4842
|
style: [
|
|
4743
|
-
|
|
4843
|
+
styles23.listHeader,
|
|
4744
4844
|
{
|
|
4745
4845
|
backgroundColor: theme.colors.surface,
|
|
4746
4846
|
borderBottomColor: theme.colors.border
|
|
@@ -4751,13 +4851,13 @@ var PoolseInbox = forwardRef(
|
|
|
4751
4851
|
Text,
|
|
4752
4852
|
{
|
|
4753
4853
|
style: [
|
|
4754
|
-
|
|
4854
|
+
styles23.listTitle,
|
|
4755
4855
|
{ color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
|
|
4756
4856
|
],
|
|
4757
4857
|
children: title
|
|
4758
4858
|
}
|
|
4759
4859
|
),
|
|
4760
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4860
|
+
/* @__PURE__ */ jsxs(View, { style: styles23.headerActions, children: [
|
|
4761
4861
|
users ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4762
4862
|
/* @__PURE__ */ jsx(
|
|
4763
4863
|
HeaderIconButton,
|
|
@@ -4870,7 +4970,7 @@ function HeaderIconButton({
|
|
|
4870
4970
|
hitSlop: 10,
|
|
4871
4971
|
accessibilityLabel: label,
|
|
4872
4972
|
style: ({ pressed }) => [
|
|
4873
|
-
|
|
4973
|
+
styles23.iconBtn,
|
|
4874
4974
|
{
|
|
4875
4975
|
backgroundColor: pressed ? theme.colors.surface2 : "transparent"
|
|
4876
4976
|
}
|
|
@@ -4883,6 +4983,7 @@ function DefaultConversationRow({
|
|
|
4883
4983
|
conv,
|
|
4884
4984
|
selected,
|
|
4885
4985
|
meExternalId,
|
|
4986
|
+
meId = null,
|
|
4886
4987
|
unread,
|
|
4887
4988
|
labelFor,
|
|
4888
4989
|
avatarFor,
|
|
@@ -4900,31 +5001,31 @@ function DefaultConversationRow({
|
|
|
4900
5001
|
{
|
|
4901
5002
|
onPress,
|
|
4902
5003
|
style: [
|
|
4903
|
-
|
|
5004
|
+
styles23.row,
|
|
4904
5005
|
{
|
|
4905
5006
|
backgroundColor: selected ? theme.colors.surface2 : "transparent",
|
|
4906
5007
|
borderBottomColor: theme.colors.border
|
|
4907
5008
|
}
|
|
4908
5009
|
],
|
|
4909
5010
|
children: [
|
|
4910
|
-
avatarUrl ? /* @__PURE__ */ jsx(Image, { source: { uri: avatarUrl }, style:
|
|
4911
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
5011
|
+
avatarUrl ? /* @__PURE__ */ jsx(Image, { source: { uri: avatarUrl }, style: styles23.rowAvatar }) : /* @__PURE__ */ jsx(Avatar, { src: null, name: title, seed: avatarSeed, size: "md" }),
|
|
5012
|
+
/* @__PURE__ */ jsxs(View, { style: styles23.rowBody, children: [
|
|
4912
5013
|
/* @__PURE__ */ jsx(
|
|
4913
5014
|
Text,
|
|
4914
5015
|
{
|
|
4915
|
-
style: [
|
|
5016
|
+
style: [styles23.rowTitle, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
|
|
4916
5017
|
numberOfLines: 1,
|
|
4917
5018
|
children: title
|
|
4918
5019
|
}
|
|
4919
5020
|
),
|
|
4920
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
5021
|
+
/* @__PURE__ */ jsx(Text, { style: [styles23.rowSubtitle, { color: theme.colors.ink3 }], numberOfLines: 1, children: formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview ?? (isDirect ? otherExtId ?? "" : `${(conv.member_external_ids ?? []).length} members`) })
|
|
4921
5022
|
] }),
|
|
4922
|
-
unread > 0 ? /* @__PURE__ */ jsx(View, { style: [
|
|
5023
|
+
unread > 0 ? /* @__PURE__ */ jsx(View, { style: [styles23.unreadPill, { backgroundColor: theme.colors.unreadPill }], children: /* @__PURE__ */ jsx(Text, { style: [styles23.unreadText, { color: theme.colors.unreadPillText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
|
|
4923
5024
|
]
|
|
4924
5025
|
}
|
|
4925
5026
|
);
|
|
4926
5027
|
}
|
|
4927
|
-
var
|
|
5028
|
+
var styles23 = StyleSheet.create({
|
|
4928
5029
|
root: {
|
|
4929
5030
|
flex: 1,
|
|
4930
5031
|
overflow: "hidden"
|
|
@@ -5128,10 +5229,10 @@ function VoiceRoomBar({
|
|
|
5128
5229
|
View,
|
|
5129
5230
|
{
|
|
5130
5231
|
style: [
|
|
5131
|
-
|
|
5232
|
+
styles24.bar,
|
|
5132
5233
|
{ backgroundColor: theme.colors.surface, borderBottomColor: theme.colors.border }
|
|
5133
5234
|
],
|
|
5134
|
-
children: unavailableSlot ?? /* @__PURE__ */ jsx(Text, { style: [
|
|
5235
|
+
children: unavailableSlot ?? /* @__PURE__ */ jsx(Text, { style: [styles24.hint, { color: theme.colors.ink3 }], children: "Voice needs react-native-webrtc and a development build." })
|
|
5135
5236
|
}
|
|
5136
5237
|
);
|
|
5137
5238
|
}
|
|
@@ -5139,22 +5240,22 @@ function VoiceRoomBar({
|
|
|
5139
5240
|
View,
|
|
5140
5241
|
{
|
|
5141
5242
|
style: [
|
|
5142
|
-
|
|
5243
|
+
styles24.bar,
|
|
5143
5244
|
{ backgroundColor: theme.colors.surface, borderBottomColor: theme.colors.border }
|
|
5144
5245
|
],
|
|
5145
5246
|
children: [
|
|
5146
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
5247
|
+
/* @__PURE__ */ jsxs(View, { style: styles24.row, children: [
|
|
5147
5248
|
/* @__PURE__ */ jsx(
|
|
5148
5249
|
View,
|
|
5149
5250
|
{
|
|
5150
5251
|
style: [
|
|
5151
|
-
|
|
5252
|
+
styles24.dot,
|
|
5152
5253
|
{ backgroundColor: connected ? theme.colors.brand : theme.colors.ink3 }
|
|
5153
5254
|
]
|
|
5154
5255
|
}
|
|
5155
5256
|
),
|
|
5156
5257
|
connected ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5157
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
5258
|
+
/* @__PURE__ */ jsx(View, { style: styles24.people, children: participants.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [styles24.hint, { color: theme.colors.ink3 }], children: "Waiting for others\u2026" }) : participants.map((p) => /* @__PURE__ */ jsx(ParticipantChip, { participant: p, label: label(p.userId) }, p.userId)) }),
|
|
5158
5259
|
/* @__PURE__ */ jsx(
|
|
5159
5260
|
Pressable,
|
|
5160
5261
|
{
|
|
@@ -5162,7 +5263,7 @@ function VoiceRoomBar({
|
|
|
5162
5263
|
accessibilityRole: "button",
|
|
5163
5264
|
accessibilityState: { selected: muted },
|
|
5164
5265
|
style: [
|
|
5165
|
-
|
|
5266
|
+
styles24.btn,
|
|
5166
5267
|
{
|
|
5167
5268
|
borderColor: muted ? theme.colors.brand : theme.colors.border,
|
|
5168
5269
|
backgroundColor: muted ? theme.colors.brandSoft : theme.colors.paper
|
|
@@ -5176,25 +5277,25 @@ function VoiceRoomBar({
|
|
|
5176
5277
|
{
|
|
5177
5278
|
onPress: leave,
|
|
5178
5279
|
accessibilityRole: "button",
|
|
5179
|
-
style: [
|
|
5280
|
+
style: [styles24.btn, { borderColor: theme.colors.error }],
|
|
5180
5281
|
children: /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.error }, children: "Leave" })
|
|
5181
5282
|
}
|
|
5182
5283
|
)
|
|
5183
5284
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5184
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
5285
|
+
/* @__PURE__ */ jsx(Text, { style: [styles24.hint, { color: theme.colors.ink3 }], children: status === "connecting" ? "Connecting\u2026" : "Talk to everyone here" }),
|
|
5185
5286
|
/* @__PURE__ */ jsx(
|
|
5186
5287
|
Pressable,
|
|
5187
5288
|
{
|
|
5188
5289
|
onPress: () => void join(),
|
|
5189
5290
|
disabled: status === "connecting",
|
|
5190
5291
|
accessibilityRole: "button",
|
|
5191
|
-
style: [
|
|
5292
|
+
style: [styles24.btn, styles24.btnPrimary, { backgroundColor: theme.colors.brand }],
|
|
5192
5293
|
children: /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.onBrand, fontWeight: "600" }, children: status === "connecting" ? "Joining\u2026" : "Join Voice" })
|
|
5193
5294
|
}
|
|
5194
5295
|
)
|
|
5195
5296
|
] })
|
|
5196
5297
|
] }),
|
|
5197
|
-
error && /* @__PURE__ */ jsx(Text, { style: [
|
|
5298
|
+
error && /* @__PURE__ */ jsx(Text, { style: [styles24.error, { color: theme.colors.error }], children: error.message })
|
|
5198
5299
|
]
|
|
5199
5300
|
}
|
|
5200
5301
|
);
|
|
@@ -5205,7 +5306,7 @@ function ParticipantChip({ participant, label }) {
|
|
|
5205
5306
|
View,
|
|
5206
5307
|
{
|
|
5207
5308
|
style: [
|
|
5208
|
-
|
|
5309
|
+
styles24.chip,
|
|
5209
5310
|
{
|
|
5210
5311
|
backgroundColor: theme.colors.paper,
|
|
5211
5312
|
// The speaking ring is a border colour swap rather than an
|
|
@@ -5224,7 +5325,7 @@ function ParticipantChip({ participant, label }) {
|
|
|
5224
5325
|
}
|
|
5225
5326
|
);
|
|
5226
5327
|
}
|
|
5227
|
-
var
|
|
5328
|
+
var styles24 = StyleSheet.create({
|
|
5228
5329
|
bar: { paddingHorizontal: 14, paddingVertical: 8, borderBottomWidth: StyleSheet.hairlineWidth },
|
|
5229
5330
|
row: { flexDirection: "row", alignItems: "center", gap: 8, flexWrap: "wrap" },
|
|
5230
5331
|
dot: { width: 8, height: 8, borderRadius: 4 },
|
|
@@ -5293,10 +5394,10 @@ function AudioRouteSheet({
|
|
|
5293
5394
|
onSelect,
|
|
5294
5395
|
onClose
|
|
5295
5396
|
}) {
|
|
5296
|
-
return /* @__PURE__ */ jsx(Modal, { visible, transparent: true, animationType: "fade", onRequestClose: onClose, children: /* @__PURE__ */ jsx(Pressable, { style:
|
|
5397
|
+
return /* @__PURE__ */ jsx(Modal, { visible, transparent: true, animationType: "fade", onRequestClose: onClose, children: /* @__PURE__ */ jsx(Pressable, { style: styles25.backdrop, onPress: onClose, accessibilityRole: "button", children: /* @__PURE__ */ jsxs(Pressable, { style: styles25.sheet, onPress: () => {
|
|
5297
5398
|
}, children: [
|
|
5298
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
5299
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
5399
|
+
/* @__PURE__ */ jsx(View, { style: styles25.grabber }),
|
|
5400
|
+
/* @__PURE__ */ jsx(Text, { style: styles25.title, children: "Audio output" }),
|
|
5300
5401
|
routes.map((route) => {
|
|
5301
5402
|
const selected = route.id === selectedRouteId;
|
|
5302
5403
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5308,7 +5409,7 @@ function AudioRouteSheet({
|
|
|
5308
5409
|
},
|
|
5309
5410
|
accessibilityRole: "button",
|
|
5310
5411
|
accessibilityState: { selected },
|
|
5311
|
-
style: ({ pressed }) => [
|
|
5412
|
+
style: ({ pressed }) => [styles25.row, pressed && styles25.rowPressed],
|
|
5312
5413
|
children: [
|
|
5313
5414
|
/* @__PURE__ */ jsx(
|
|
5314
5415
|
PoolseIcon,
|
|
@@ -5319,7 +5420,7 @@ function AudioRouteSheet({
|
|
|
5319
5420
|
label: null
|
|
5320
5421
|
}
|
|
5321
5422
|
),
|
|
5322
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
5423
|
+
/* @__PURE__ */ jsx(Text, { style: [styles25.label, selected && styles25.labelSelected], children: route.label }),
|
|
5323
5424
|
selected && /* @__PURE__ */ jsx(PoolseIcon, { name: "check", size: 19, color: callColors.accept, label: "selected" })
|
|
5324
5425
|
]
|
|
5325
5426
|
},
|
|
@@ -5328,7 +5429,7 @@ function AudioRouteSheet({
|
|
|
5328
5429
|
})
|
|
5329
5430
|
] }) }) });
|
|
5330
5431
|
}
|
|
5331
|
-
var
|
|
5432
|
+
var styles25 = StyleSheet.create({
|
|
5332
5433
|
backdrop: { flex: 1, backgroundColor: "rgba(0,0,0,0.55)", justifyContent: "flex-end" },
|
|
5333
5434
|
sheet: {
|
|
5334
5435
|
backgroundColor: callColors.tile,
|
|
@@ -5410,11 +5511,11 @@ function PulseRings({ size, color }) {
|
|
|
5410
5511
|
});
|
|
5411
5512
|
return () => loops.forEach((l) => l.stop());
|
|
5412
5513
|
}, []);
|
|
5413
|
-
return /* @__PURE__ */ jsx(View, { style: [StyleSheet.absoluteFill,
|
|
5514
|
+
return /* @__PURE__ */ jsx(View, { style: [StyleSheet.absoluteFill, styles26.center], pointerEvents: "none", children: phases.map((p, i) => /* @__PURE__ */ jsx(
|
|
5414
5515
|
Animated.View,
|
|
5415
5516
|
{
|
|
5416
5517
|
style: [
|
|
5417
|
-
|
|
5518
|
+
styles26.ring,
|
|
5418
5519
|
{
|
|
5419
5520
|
width: size,
|
|
5420
5521
|
height: size,
|
|
@@ -5435,7 +5536,7 @@ function PulseRings({ size, color }) {
|
|
|
5435
5536
|
i
|
|
5436
5537
|
)) });
|
|
5437
5538
|
}
|
|
5438
|
-
var
|
|
5539
|
+
var styles26 = StyleSheet.create({
|
|
5439
5540
|
center: { alignItems: "center", justifyContent: "center" },
|
|
5440
5541
|
ring: { position: "absolute", borderWidth: 1.5 }
|
|
5441
5542
|
});
|
|
@@ -5446,7 +5547,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
5446
5547
|
View,
|
|
5447
5548
|
{
|
|
5448
5549
|
style: [
|
|
5449
|
-
|
|
5550
|
+
styles27.ring,
|
|
5450
5551
|
{
|
|
5451
5552
|
width: outer,
|
|
5452
5553
|
height: outer,
|
|
@@ -5459,7 +5560,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
5459
5560
|
View,
|
|
5460
5561
|
{
|
|
5461
5562
|
style: [
|
|
5462
|
-
|
|
5563
|
+
styles27.circle,
|
|
5463
5564
|
{
|
|
5464
5565
|
width: size,
|
|
5465
5566
|
height: size,
|
|
@@ -5470,7 +5571,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
5470
5571
|
children: /* @__PURE__ */ jsx(
|
|
5471
5572
|
Text,
|
|
5472
5573
|
{
|
|
5473
|
-
style: [
|
|
5574
|
+
style: [styles27.initials, { fontSize: Math.round(size * 0.38) }],
|
|
5474
5575
|
numberOfLines: 1,
|
|
5475
5576
|
allowFontScaling: false,
|
|
5476
5577
|
children: initialsOf(name)
|
|
@@ -5487,7 +5588,7 @@ function initialsOf(name) {
|
|
|
5487
5588
|
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
5488
5589
|
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
5489
5590
|
}
|
|
5490
|
-
var
|
|
5591
|
+
var styles27 = StyleSheet.create({
|
|
5491
5592
|
ring: { alignItems: "center", justifyContent: "center" },
|
|
5492
5593
|
circle: { alignItems: "center", justifyContent: "center" },
|
|
5493
5594
|
initials: { color: "#ffffff", fontWeight: "600" }
|
|
@@ -5505,7 +5606,7 @@ function CallControlButton({
|
|
|
5505
5606
|
const size = large ? CONTROL_SIZE_LARGE : CONTROL_SIZE;
|
|
5506
5607
|
const background = tone === "danger" ? callColors.danger : tone === "accept" ? callColors.accept : active ? callColors.controlActive : callColors.control;
|
|
5507
5608
|
const iconColor = tone === "neutral" && active ? callColors.controlActiveIcon : callColors.onAction;
|
|
5508
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
5609
|
+
return /* @__PURE__ */ jsxs(View, { style: styles28.slot, children: [
|
|
5509
5610
|
/* @__PURE__ */ jsx(
|
|
5510
5611
|
Pressable,
|
|
5511
5612
|
{
|
|
@@ -5516,7 +5617,7 @@ function CallControlButton({
|
|
|
5516
5617
|
accessibilityLabel: accessibilityLabel ?? label ?? icon,
|
|
5517
5618
|
hitSlop: 8,
|
|
5518
5619
|
style: ({ pressed }) => [
|
|
5519
|
-
|
|
5620
|
+
styles28.button,
|
|
5520
5621
|
{
|
|
5521
5622
|
width: size,
|
|
5522
5623
|
height: size,
|
|
@@ -5530,10 +5631,10 @@ function CallControlButton({
|
|
|
5530
5631
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: icon, size: large ? 30 : 25, color: iconColor, label: null })
|
|
5531
5632
|
}
|
|
5532
5633
|
),
|
|
5533
|
-
label ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style:
|
|
5634
|
+
label ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles28.label, children: label }) : null
|
|
5534
5635
|
] });
|
|
5535
5636
|
}
|
|
5536
|
-
var
|
|
5637
|
+
var styles28 = StyleSheet.create({
|
|
5537
5638
|
// Fixed width so captions of different lengths cannot shift the row.
|
|
5538
5639
|
slot: { width: 76, alignItems: "center", gap: 7 },
|
|
5539
5640
|
button: { alignItems: "center", justifyContent: "center" },
|
|
@@ -5554,8 +5655,8 @@ function CallParticipantTile({
|
|
|
5554
5655
|
View,
|
|
5555
5656
|
{
|
|
5556
5657
|
style: [
|
|
5557
|
-
|
|
5558
|
-
bleed ?
|
|
5658
|
+
styles29.tile,
|
|
5659
|
+
bleed ? styles29.bleed : styles29.rounded,
|
|
5559
5660
|
{
|
|
5560
5661
|
backgroundColor: callColors.tile,
|
|
5561
5662
|
// A ring rather than a badge: it reads at a glance across a
|
|
@@ -5574,7 +5675,7 @@ function CallParticipantTile({
|
|
|
5574
5675
|
mirror: participant.isSelf,
|
|
5575
5676
|
zOrder: participant.isSelf ? 1 : 0
|
|
5576
5677
|
}
|
|
5577
|
-
) : /* @__PURE__ */ jsx(View, { style:
|
|
5678
|
+
) : /* @__PURE__ */ jsx(View, { style: styles29.placeholder, children: /* @__PURE__ */ jsx(
|
|
5578
5679
|
CallAvatar,
|
|
5579
5680
|
{
|
|
5580
5681
|
name,
|
|
@@ -5583,17 +5684,17 @@ function CallParticipantTile({
|
|
|
5583
5684
|
speaking: participant.speaking
|
|
5584
5685
|
}
|
|
5585
5686
|
) }),
|
|
5586
|
-
!hideName && /* @__PURE__ */ jsxs(View, { style: [
|
|
5687
|
+
!hideName && /* @__PURE__ */ jsxs(View, { style: [styles29.chip, bleed ? styles29.chipBleed : styles29.chipTile], children: [
|
|
5587
5688
|
!participant.micEnabled && // Worth showing even for yourself — it is the answer to
|
|
5588
5689
|
// "why can nobody hear me".
|
|
5589
5690
|
/* @__PURE__ */ jsx(PoolseIcon, { name: "mic-off", size: 13, color: callColors.text, label: "muted" }),
|
|
5590
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style:
|
|
5691
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles29.name, children: name })
|
|
5591
5692
|
] })
|
|
5592
5693
|
]
|
|
5593
5694
|
}
|
|
5594
5695
|
);
|
|
5595
5696
|
}
|
|
5596
|
-
var
|
|
5697
|
+
var styles29 = StyleSheet.create({
|
|
5597
5698
|
tile: { overflow: "hidden", justifyContent: "flex-end", borderWidth: 2 },
|
|
5598
5699
|
rounded: { borderRadius: 18 },
|
|
5599
5700
|
bleed: { borderRadius: 0, borderWidth: 0 },
|
|
@@ -5691,7 +5792,7 @@ function LocalVideoPip({
|
|
|
5691
5792
|
Animated.View,
|
|
5692
5793
|
{
|
|
5693
5794
|
...responder.panHandlers,
|
|
5694
|
-
style: [
|
|
5795
|
+
style: [styles30.pip, { transform: pan.getTranslateTransform() }],
|
|
5695
5796
|
children: /* @__PURE__ */ jsx(
|
|
5696
5797
|
Pressable,
|
|
5697
5798
|
{
|
|
@@ -5701,8 +5802,8 @@ function LocalVideoPip({
|
|
|
5701
5802
|
},
|
|
5702
5803
|
accessibilityRole: "button",
|
|
5703
5804
|
accessibilityLabel: "Your camera. Drag to move, tap to switch camera.",
|
|
5704
|
-
style:
|
|
5705
|
-
children: /* @__PURE__ */ jsx(View, { style:
|
|
5805
|
+
style: styles30.fill,
|
|
5806
|
+
children: /* @__PURE__ */ jsx(View, { style: styles30.fill, children: /* @__PURE__ */ jsx(
|
|
5706
5807
|
CallParticipantTile,
|
|
5707
5808
|
{
|
|
5708
5809
|
participant,
|
|
@@ -5711,7 +5812,7 @@ function LocalVideoPip({
|
|
|
5711
5812
|
avatarSize: 48,
|
|
5712
5813
|
hideName: true,
|
|
5713
5814
|
bleed: true,
|
|
5714
|
-
style:
|
|
5815
|
+
style: styles30.fill
|
|
5715
5816
|
}
|
|
5716
5817
|
) })
|
|
5717
5818
|
}
|
|
@@ -5719,7 +5820,7 @@ function LocalVideoPip({
|
|
|
5719
5820
|
}
|
|
5720
5821
|
);
|
|
5721
5822
|
}
|
|
5722
|
-
var
|
|
5823
|
+
var styles30 = StyleSheet.create({
|
|
5723
5824
|
pip: {
|
|
5724
5825
|
position: "absolute",
|
|
5725
5826
|
top: 0,
|
|
@@ -5768,11 +5869,11 @@ function CallVideoGrid({
|
|
|
5768
5869
|
const availableHeight = size.height > 0 ? size.height - padTop - padBottom : 0;
|
|
5769
5870
|
const tileHeight = availableHeight > 0 ? (availableHeight - GAP * (rows - 1)) / rows : 0;
|
|
5770
5871
|
const scrolls = tileHeight > 0 && tileHeight < MIN_TILE_HEIGHT;
|
|
5771
|
-
if (participants.length === 0) return /* @__PURE__ */ jsx(View, { style:
|
|
5872
|
+
if (participants.length === 0) return /* @__PURE__ */ jsx(View, { style: styles31.stage, onLayout });
|
|
5772
5873
|
if (others.length <= 1) {
|
|
5773
5874
|
const spotlight = others[0] ?? self;
|
|
5774
|
-
if (!spotlight) return /* @__PURE__ */ jsx(View, { style:
|
|
5775
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
5875
|
+
if (!spotlight) return /* @__PURE__ */ jsx(View, { style: styles31.stage, onLayout });
|
|
5876
|
+
return /* @__PURE__ */ jsxs(View, { style: styles31.stage, onLayout, children: [
|
|
5776
5877
|
/* @__PURE__ */ jsx(
|
|
5777
5878
|
CallParticipantTile,
|
|
5778
5879
|
{
|
|
@@ -5782,7 +5883,7 @@ function CallVideoGrid({
|
|
|
5782
5883
|
avatarSize: Math.min(148, Math.max(96, Math.round(size.width * 0.36))),
|
|
5783
5884
|
bleed: true,
|
|
5784
5885
|
hideName: others.length === 1,
|
|
5785
|
-
style:
|
|
5886
|
+
style: styles31.fill
|
|
5786
5887
|
}
|
|
5787
5888
|
),
|
|
5788
5889
|
self && others.length === 1 && size.width > 0 && /* @__PURE__ */ jsx(
|
|
@@ -5800,7 +5901,7 @@ function CallVideoGrid({
|
|
|
5800
5901
|
}
|
|
5801
5902
|
const tiles = [...others, ...self ? [self] : []];
|
|
5802
5903
|
const width = size.width > 0 ? (size.width - GAP * (columns - 1)) / columns : 0;
|
|
5803
|
-
const grid = /* @__PURE__ */ jsx(View, { style: [
|
|
5904
|
+
const grid = /* @__PURE__ */ jsx(View, { style: [styles31.grid, scrolls ? styles31.gridScrolling : styles31.gridFilling], children: tiles.map((participant) => /* @__PURE__ */ jsx(
|
|
5804
5905
|
CallParticipantTile,
|
|
5805
5906
|
{
|
|
5806
5907
|
participant,
|
|
@@ -5817,13 +5918,13 @@ function CallVideoGrid({
|
|
|
5817
5918
|
return /* @__PURE__ */ jsx(
|
|
5818
5919
|
View,
|
|
5819
5920
|
{
|
|
5820
|
-
style: [
|
|
5921
|
+
style: [styles31.stage, { paddingTop: padTop, paddingBottom: padBottom }],
|
|
5821
5922
|
onLayout,
|
|
5822
5923
|
children: scrolls ? /* @__PURE__ */ jsx(
|
|
5823
5924
|
ScrollView,
|
|
5824
5925
|
{
|
|
5825
5926
|
contentContainerStyle: [
|
|
5826
|
-
|
|
5927
|
+
styles31.scroll,
|
|
5827
5928
|
{ paddingBottom: (chromeInsets?.bottom ?? 0) + GAP }
|
|
5828
5929
|
],
|
|
5829
5930
|
showsVerticalScrollIndicator: false,
|
|
@@ -5833,7 +5934,7 @@ function CallVideoGrid({
|
|
|
5833
5934
|
}
|
|
5834
5935
|
);
|
|
5835
5936
|
}
|
|
5836
|
-
var
|
|
5937
|
+
var styles31 = StyleSheet.create({
|
|
5837
5938
|
stage: { flex: 1, overflow: "hidden" },
|
|
5838
5939
|
fill: { ...StyleSheet.absoluteFillObject },
|
|
5839
5940
|
grid: { flexDirection: "row", flexWrap: "wrap", gap: GAP },
|
|
@@ -6031,7 +6132,7 @@ function CallScreen({
|
|
|
6031
6132
|
inCallManager,
|
|
6032
6133
|
nativeIncomingUi
|
|
6033
6134
|
}) {
|
|
6034
|
-
const insets =
|
|
6135
|
+
const [insets, setInsets] = useState({ top: 0, bottom: 0, left: 0, right: 0 });
|
|
6035
6136
|
const ownCalls = useCalls(callsProp ? null : userId);
|
|
6036
6137
|
const calls = callsProp ?? ownCalls;
|
|
6037
6138
|
const meshAvailable = isNativeWebRtcAvailable(webrtc);
|
|
@@ -6124,14 +6225,16 @@ function CallScreen({
|
|
|
6124
6225
|
[wakeChrome]
|
|
6125
6226
|
);
|
|
6126
6227
|
const hangUp = useCallback(() => {
|
|
6127
|
-
const othersOnCall = (usingSfu ? sfu.participants : mesh.participants).filter(
|
|
6128
|
-
(p) => !p.isSelf
|
|
6129
|
-
).length;
|
|
6130
6228
|
sfu.leave();
|
|
6131
6229
|
mesh.leave();
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6230
|
+
void calls.hangUp();
|
|
6231
|
+
}, [sfu, mesh, calls]);
|
|
6232
|
+
const othersNow = (usingSfu ? sfu.participants : mesh.participants).filter(
|
|
6233
|
+
(p) => !p.isSelf
|
|
6234
|
+
).length;
|
|
6235
|
+
useEffect(() => {
|
|
6236
|
+
calls.reportOthersOnCall?.(othersNow);
|
|
6237
|
+
}, [calls, othersNow]);
|
|
6135
6238
|
const alone = usingSfu ? sfu.alone : mesh.alone;
|
|
6136
6239
|
const endedOnEmpty = useRef(false);
|
|
6137
6240
|
if (calls.phase !== "active") endedOnEmpty.current = false;
|
|
@@ -6188,165 +6291,177 @@ function CallScreen({
|
|
|
6188
6291
|
onRequestClose: hangUp,
|
|
6189
6292
|
children: [
|
|
6190
6293
|
/* @__PURE__ */ jsx(StatusBar, { barStyle: "light-content" }),
|
|
6191
|
-
/* @__PURE__ */ jsxs(
|
|
6192
|
-
/* @__PURE__ */ jsx(
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6294
|
+
/* @__PURE__ */ jsxs(SafeAreaProvider, { children: [
|
|
6295
|
+
/* @__PURE__ */ jsx(InsetsProbe, { onChange: setInsets }),
|
|
6296
|
+
/* @__PURE__ */ jsxs(Pressable, { style: styles32.screen, onPress: toggleChrome, accessible: false, children: [
|
|
6297
|
+
/* @__PURE__ */ jsx(CallBackdrop, {}),
|
|
6298
|
+
showStage ? /* @__PURE__ */ jsx(
|
|
6299
|
+
CallVideoGrid,
|
|
6300
|
+
{
|
|
6301
|
+
participants,
|
|
6302
|
+
livekitReactNative,
|
|
6303
|
+
labelFor: label,
|
|
6304
|
+
onLocalPress: () => void sfu.switchCamera(),
|
|
6305
|
+
chromeInsets,
|
|
6306
|
+
safeArea: { top: insets.top, bottom: insets.bottom }
|
|
6307
|
+
}
|
|
6308
|
+
) : (
|
|
6309
|
+
// Audio (and pre-media) calls carry their identity in the
|
|
6310
|
+
// middle of the scene — name under the avatar, status in a
|
|
6311
|
+
// pill — rather than a bar pinned to the top of a void.
|
|
6312
|
+
/* @__PURE__ */ jsxs(
|
|
6313
|
+
View,
|
|
6314
|
+
{
|
|
6315
|
+
style: [styles32.identity, { paddingBottom: insets.bottom + 160 }],
|
|
6316
|
+
pointerEvents: "none",
|
|
6317
|
+
children: [
|
|
6318
|
+
/* @__PURE__ */ jsxs(View, { style: styles32.avatarStage, children: [
|
|
6319
|
+
(ringingIn || ringingOut) && /* @__PURE__ */ jsx(PulseRings, { size: 132, color: callColors.glow }),
|
|
6320
|
+
/* @__PURE__ */ jsx(
|
|
6321
|
+
CallAvatar,
|
|
6322
|
+
{
|
|
6323
|
+
name: peerIds.length === 1 ? label(peerIds[0]) : title,
|
|
6324
|
+
seed: titleConversationId ?? peerIds[0] ?? "call",
|
|
6325
|
+
size: 132
|
|
6326
|
+
}
|
|
6327
|
+
)
|
|
6328
|
+
] }),
|
|
6329
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 2, style: styles32.identityTitle, children: title }),
|
|
6330
|
+
/* @__PURE__ */ jsxs(View, { style: styles32.statusPill, children: [
|
|
6331
|
+
connected && /* @__PURE__ */ jsx(View, { style: styles32.statusDot }),
|
|
6332
|
+
/* @__PURE__ */ jsx(Text, { style: styles32.statusText, children: subtitle })
|
|
6333
|
+
] })
|
|
6334
|
+
]
|
|
6335
|
+
}
|
|
6336
|
+
)
|
|
6337
|
+
),
|
|
6338
|
+
chromeVisible && showStage && /* @__PURE__ */ jsxs(View, { style: [styles32.header, { paddingTop: insets.top + 14 }], pointerEvents: "box-none", children: [
|
|
6339
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles32.title, children: title }),
|
|
6340
|
+
/* @__PURE__ */ jsxs(View, { style: styles32.subtitleRow, children: [
|
|
6341
|
+
isGroup && /* @__PURE__ */ jsx(PoolseIcon, { name: "users", size: 14, color: callColors.textDim, label: null }),
|
|
6342
|
+
/* @__PURE__ */ jsx(Text, { style: styles32.subtitle, children: isGroup ? `${participants.length} \xB7 ${subtitle}` : subtitle })
|
|
6343
|
+
] })
|
|
6344
|
+
] }),
|
|
6345
|
+
chromeVisible && /* @__PURE__ */ jsxs(
|
|
6208
6346
|
View,
|
|
6209
6347
|
{
|
|
6210
|
-
style: [
|
|
6211
|
-
pointerEvents: "none",
|
|
6348
|
+
style: [styles32.controls, { paddingBottom: insets.bottom + 22 }],
|
|
6349
|
+
pointerEvents: "box-none",
|
|
6212
6350
|
children: [
|
|
6213
|
-
/* @__PURE__ */
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
CallAvatar,
|
|
6217
|
-
{
|
|
6218
|
-
name: peerIds.length === 1 ? label(peerIds[0]) : title,
|
|
6219
|
-
seed: titleConversationId ?? peerIds[0] ?? "call",
|
|
6220
|
-
size: 132
|
|
6221
|
-
}
|
|
6222
|
-
)
|
|
6223
|
-
] }),
|
|
6224
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 2, style: styles31.identityTitle, children: title }),
|
|
6225
|
-
/* @__PURE__ */ jsxs(View, { style: styles31.statusPill, children: [
|
|
6226
|
-
connected && /* @__PURE__ */ jsx(View, { style: styles31.statusDot }),
|
|
6227
|
-
/* @__PURE__ */ jsx(Text, { style: styles31.statusText, children: subtitle })
|
|
6228
|
-
] })
|
|
6229
|
-
]
|
|
6230
|
-
}
|
|
6231
|
-
)
|
|
6232
|
-
),
|
|
6233
|
-
chromeVisible && showStage && /* @__PURE__ */ jsxs(View, { style: [styles31.header, { paddingTop: insets.top + 14 }], pointerEvents: "box-none", children: [
|
|
6234
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles31.title, children: title }),
|
|
6235
|
-
/* @__PURE__ */ jsxs(View, { style: styles31.subtitleRow, children: [
|
|
6236
|
-
isGroup && /* @__PURE__ */ jsx(PoolseIcon, { name: "users", size: 14, color: callColors.textDim, label: null }),
|
|
6237
|
-
/* @__PURE__ */ jsx(Text, { style: styles31.subtitle, children: isGroup ? `${participants.length} \xB7 ${subtitle}` : subtitle })
|
|
6238
|
-
] })
|
|
6239
|
-
] }),
|
|
6240
|
-
chromeVisible && /* @__PURE__ */ jsxs(
|
|
6241
|
-
View,
|
|
6242
|
-
{
|
|
6243
|
-
style: [styles31.controls, { paddingBottom: insets.bottom + 22 }],
|
|
6244
|
-
pointerEvents: "box-none",
|
|
6245
|
-
children: [
|
|
6246
|
-
error && /* @__PURE__ */ jsx(Text, { style: styles31.error, children: error.message }),
|
|
6247
|
-
!meshAvailable && !livekit && /* @__PURE__ */ jsx(Text, { style: styles31.error, children: "No WebRTC module supplied \u2014 this call has no audio." }),
|
|
6248
|
-
ringingIn ? /* @__PURE__ */ jsxs(View, { style: styles31.answerRow, children: [
|
|
6249
|
-
/* @__PURE__ */ jsx(
|
|
6250
|
-
CallControlButton,
|
|
6251
|
-
{
|
|
6252
|
-
icon: "phone-off",
|
|
6253
|
-
tone: "danger",
|
|
6254
|
-
large: true,
|
|
6255
|
-
label: "Decline",
|
|
6256
|
-
onPress: () => void calls.decline(),
|
|
6257
|
-
accessibilityLabel: "Decline call"
|
|
6258
|
-
}
|
|
6259
|
-
),
|
|
6260
|
-
/* @__PURE__ */ jsx(
|
|
6261
|
-
CallControlButton,
|
|
6262
|
-
{
|
|
6263
|
-
icon: isVideoCall ? "video" : "phone",
|
|
6264
|
-
tone: "accept",
|
|
6265
|
-
large: true,
|
|
6266
|
-
label: "Accept",
|
|
6267
|
-
onPress: () => void calls.accept(),
|
|
6268
|
-
accessibilityLabel: "Accept call"
|
|
6269
|
-
}
|
|
6270
|
-
)
|
|
6271
|
-
] }) : ended ? /* @__PURE__ */ jsx(View, { style: styles31.row, children: /* @__PURE__ */ jsx(
|
|
6272
|
-
CallControlButton,
|
|
6273
|
-
{
|
|
6274
|
-
icon: "close",
|
|
6275
|
-
onPress: calls.reset,
|
|
6276
|
-
label: "Close",
|
|
6277
|
-
accessibilityLabel: "Close"
|
|
6278
|
-
}
|
|
6279
|
-
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6280
|
-
/* @__PURE__ */ jsxs(View, { style: styles31.dock, children: [
|
|
6351
|
+
error && /* @__PURE__ */ jsx(Text, { style: styles32.error, children: error.message }),
|
|
6352
|
+
!meshAvailable && !livekit && /* @__PURE__ */ jsx(Text, { style: styles32.error, children: "No WebRTC module supplied \u2014 this call has no audio." }),
|
|
6353
|
+
ringingIn ? /* @__PURE__ */ jsxs(View, { style: styles32.answerRow, children: [
|
|
6281
6354
|
/* @__PURE__ */ jsx(
|
|
6282
6355
|
CallControlButton,
|
|
6283
6356
|
{
|
|
6284
|
-
icon:
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6357
|
+
icon: "phone-off",
|
|
6358
|
+
tone: "danger",
|
|
6359
|
+
large: true,
|
|
6360
|
+
label: "Decline",
|
|
6361
|
+
onPress: () => void calls.decline(),
|
|
6362
|
+
accessibilityLabel: "Decline call"
|
|
6289
6363
|
}
|
|
6290
6364
|
),
|
|
6291
6365
|
/* @__PURE__ */ jsx(
|
|
6292
6366
|
CallControlButton,
|
|
6293
6367
|
{
|
|
6294
|
-
icon:
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
),
|
|
6301
|
-
usingSfu && /* @__PURE__ */ jsx(
|
|
6302
|
-
CallControlButton,
|
|
6303
|
-
{
|
|
6304
|
-
icon: videoOn ? "video" : "video-off",
|
|
6305
|
-
label: "Camera",
|
|
6306
|
-
active: !videoOn,
|
|
6307
|
-
onPress: withWake(() => void sfu.toggleCamera()),
|
|
6308
|
-
accessibilityLabel: videoOn ? "Turn camera off" : "Turn camera on"
|
|
6309
|
-
}
|
|
6310
|
-
),
|
|
6311
|
-
usingSfu && videoOn && /* @__PURE__ */ jsx(
|
|
6312
|
-
CallControlButton,
|
|
6313
|
-
{
|
|
6314
|
-
icon: "camera-flip",
|
|
6315
|
-
label: "Flip",
|
|
6316
|
-
onPress: withWake(() => void sfu.switchCamera()),
|
|
6317
|
-
accessibilityLabel: "Switch camera"
|
|
6368
|
+
icon: isVideoCall ? "video" : "phone",
|
|
6369
|
+
tone: "accept",
|
|
6370
|
+
large: true,
|
|
6371
|
+
label: "Accept",
|
|
6372
|
+
onPress: () => void calls.accept(),
|
|
6373
|
+
accessibilityLabel: "Accept call"
|
|
6318
6374
|
}
|
|
6319
6375
|
)
|
|
6320
|
-
] }),
|
|
6321
|
-
/* @__PURE__ */ jsx(View, { style: styles31.hangUpRow, children: /* @__PURE__ */ jsx(
|
|
6376
|
+
] }) : ended ? /* @__PURE__ */ jsx(View, { style: styles32.row, children: /* @__PURE__ */ jsx(
|
|
6322
6377
|
CallControlButton,
|
|
6323
6378
|
{
|
|
6324
|
-
icon: "
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
accessibilityLabel: ringingOut ? "Cancel call" : "Hang up"
|
|
6379
|
+
icon: "close",
|
|
6380
|
+
onPress: calls.reset,
|
|
6381
|
+
label: "Close",
|
|
6382
|
+
accessibilityLabel: "Close"
|
|
6329
6383
|
}
|
|
6330
|
-
) })
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6384
|
+
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6385
|
+
/* @__PURE__ */ jsxs(View, { style: styles32.dock, children: [
|
|
6386
|
+
/* @__PURE__ */ jsx(
|
|
6387
|
+
CallControlButton,
|
|
6388
|
+
{
|
|
6389
|
+
icon: micOn ? "mic" : "mic-off",
|
|
6390
|
+
label: micOn ? "Mute" : "Unmute",
|
|
6391
|
+
active: !micOn,
|
|
6392
|
+
onPress: withWake(toggleMic),
|
|
6393
|
+
accessibilityLabel: micOn ? "Mute microphone" : "Unmute microphone"
|
|
6394
|
+
}
|
|
6395
|
+
),
|
|
6396
|
+
/* @__PURE__ */ jsx(
|
|
6397
|
+
CallControlButton,
|
|
6398
|
+
{
|
|
6399
|
+
icon: speakerIcon(audio),
|
|
6400
|
+
label: speakerLabel(audio),
|
|
6401
|
+
active: audio.speakerOn,
|
|
6402
|
+
onPress: withWake(onSpeakerPress),
|
|
6403
|
+
accessibilityLabel: "Audio output"
|
|
6404
|
+
}
|
|
6405
|
+
),
|
|
6406
|
+
usingSfu && /* @__PURE__ */ jsx(
|
|
6407
|
+
CallControlButton,
|
|
6408
|
+
{
|
|
6409
|
+
icon: videoOn ? "video" : "video-off",
|
|
6410
|
+
label: "Camera",
|
|
6411
|
+
active: !videoOn,
|
|
6412
|
+
onPress: withWake(() => void sfu.toggleCamera()),
|
|
6413
|
+
accessibilityLabel: videoOn ? "Turn camera off" : "Turn camera on"
|
|
6414
|
+
}
|
|
6415
|
+
),
|
|
6416
|
+
usingSfu && videoOn && /* @__PURE__ */ jsx(
|
|
6417
|
+
CallControlButton,
|
|
6418
|
+
{
|
|
6419
|
+
icon: "camera-flip",
|
|
6420
|
+
label: "Flip",
|
|
6421
|
+
onPress: withWake(() => void sfu.switchCamera()),
|
|
6422
|
+
accessibilityLabel: "Switch camera"
|
|
6423
|
+
}
|
|
6424
|
+
)
|
|
6425
|
+
] }),
|
|
6426
|
+
/* @__PURE__ */ jsx(View, { style: styles32.hangUpRow, children: /* @__PURE__ */ jsx(
|
|
6427
|
+
CallControlButton,
|
|
6428
|
+
{
|
|
6429
|
+
icon: "phone-off",
|
|
6430
|
+
tone: "danger",
|
|
6431
|
+
large: true,
|
|
6432
|
+
onPress: ringingOut ? () => void calls.cancel() : hangUp,
|
|
6433
|
+
accessibilityLabel: ringingOut ? "Cancel call" : "Hang up"
|
|
6434
|
+
}
|
|
6435
|
+
) })
|
|
6436
|
+
] })
|
|
6437
|
+
]
|
|
6438
|
+
}
|
|
6439
|
+
),
|
|
6440
|
+
/* @__PURE__ */ jsx(
|
|
6441
|
+
AudioRouteSheet,
|
|
6442
|
+
{
|
|
6443
|
+
visible: routesOpen,
|
|
6444
|
+
routes: audio.routes,
|
|
6445
|
+
selectedRouteId: audio.selectedRouteId,
|
|
6446
|
+
onSelect: audio.selectRoute,
|
|
6447
|
+
onClose: () => setRoutesOpen(false)
|
|
6448
|
+
}
|
|
6449
|
+
)
|
|
6450
|
+
] })
|
|
6345
6451
|
] })
|
|
6346
6452
|
]
|
|
6347
6453
|
}
|
|
6348
6454
|
);
|
|
6349
6455
|
}
|
|
6456
|
+
function InsetsProbe({
|
|
6457
|
+
onChange
|
|
6458
|
+
}) {
|
|
6459
|
+
const insets = useSafeAreaInsets();
|
|
6460
|
+
useEffect(() => {
|
|
6461
|
+
onChange({ top: insets.top, bottom: insets.bottom, left: insets.left, right: insets.right });
|
|
6462
|
+
}, [insets.top, insets.bottom, insets.left, insets.right, onChange]);
|
|
6463
|
+
return null;
|
|
6464
|
+
}
|
|
6350
6465
|
function speakerIcon(audio) {
|
|
6351
6466
|
if (audio.externalDevice) return "headphones";
|
|
6352
6467
|
return audio.speakerOn ? "speaker" : "speaker-off";
|
|
@@ -6384,7 +6499,7 @@ function statusLine(calls, mediaStatus) {
|
|
|
6384
6499
|
return "";
|
|
6385
6500
|
}
|
|
6386
6501
|
}
|
|
6387
|
-
var
|
|
6502
|
+
var styles32 = StyleSheet.create({
|
|
6388
6503
|
screen: { flex: 1, backgroundColor: callColors.bg },
|
|
6389
6504
|
identity: {
|
|
6390
6505
|
flex: 1,
|
|
@@ -6688,6 +6803,6 @@ function guessApnsEnvironment() {
|
|
|
6688
6803
|
return __DEV__ ? "sandbox" : "production";
|
|
6689
6804
|
}
|
|
6690
6805
|
|
|
6691
|
-
export { AttachmentPicker, AttachmentPreview, AudioRouteSheet, Avatar, CallAvatar, CallControlButton, CallParticipantTile, CallScreen, CallVideoGrid, ChatHeader, ConversationList, ConversationView, DaySeparator, GroupDetailsSheet, ImageMosaic, LocalVideoPip, MemberList, MentionInput, MessageActions, MessageBubble, MessageComposer, MessageList, MessageRow, PoolseIcon, PoolseInbox, PoolseLogo, PoolseTheme, primitives as Primitives, ReactionPicker, ReactionStrip, ThreadView, TypingIndicator, UploadQueueStrip, UserName, VoiceRoomBar, callColors, createNativeWebRtcAdapter, defaultDarkTheme, defaultLightTheme, describeRoute, isNativeWebRtcAvailable, isStalePush, useAppStateLifecycle, useCallAudio, useCallDuration, useDisplayName, usePoolseTheme, useVoipCalls };
|
|
6806
|
+
export { AttachmentPicker, AttachmentPreview, AudioRouteSheet, Avatar, CallAvatar, CallControlButton, CallLogRow, CallParticipantTile, CallScreen, CallVideoGrid, ChatHeader, ConversationList, ConversationView, DaySeparator, GroupDetailsSheet, ImageMosaic, LocalVideoPip, MemberList, MentionInput, MessageActions, MessageBubble, MessageComposer, MessageList, MessageRow, PoolseIcon, PoolseInbox, PoolseLogo, PoolseTheme, primitives as Primitives, ReactionPicker, ReactionStrip, ThreadView, TypingIndicator, UploadQueueStrip, UserName, VoiceRoomBar, callColors, createNativeWebRtcAdapter, defaultDarkTheme, defaultLightTheme, describeRoute, isNativeWebRtcAvailable, isStalePush, useAppStateLifecycle, useCallAudio, useCallDuration, useDisplayName, usePoolseTheme, useVoipCalls };
|
|
6692
6807
|
//# sourceMappingURL=index.js.map
|
|
6693
6808
|
//# sourceMappingURL=index.js.map
|