@poolse/react-native 3.7.1 → 3.9.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 +30 -0
- package/README.md +37 -0
- package/dist/index.cjs +1536 -348
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +203 -4
- package/dist/index.d.ts +203 -4
- package/dist/index.js +1529 -351
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -7,6 +7,7 @@ var reactNativeSvg = require('react-native-svg');
|
|
|
7
7
|
var theme = require('@poolse/theme');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
var reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
10
|
+
var sdk = require('@poolse/sdk');
|
|
10
11
|
var ImagePicker = require('expo-image-picker');
|
|
11
12
|
var DocumentPicker = require('expo-document-picker');
|
|
12
13
|
var expoImageManipulator = require('expo-image-manipulator');
|
|
@@ -1321,7 +1322,17 @@ function ChatHeader({
|
|
|
1321
1322
|
}
|
|
1322
1323
|
],
|
|
1323
1324
|
children: [
|
|
1324
|
-
onBack ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1325
|
+
onBack ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1326
|
+
reactNative.Pressable,
|
|
1327
|
+
{
|
|
1328
|
+
onPress: onBack,
|
|
1329
|
+
hitSlop: 12,
|
|
1330
|
+
style: styles5.backBtn,
|
|
1331
|
+
accessibilityRole: "button",
|
|
1332
|
+
accessibilityLabel: "Back",
|
|
1333
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "reply", size: 20, color: theme.colors.text })
|
|
1334
|
+
}
|
|
1335
|
+
) : null,
|
|
1325
1336
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1326
1337
|
Avatar,
|
|
1327
1338
|
{
|
|
@@ -1352,6 +1363,7 @@ function ChatHeader({
|
|
|
1352
1363
|
onPress: onMembersPress,
|
|
1353
1364
|
hitSlop: 12,
|
|
1354
1365
|
style: styles5.actionBtn,
|
|
1366
|
+
accessibilityRole: "button",
|
|
1355
1367
|
accessibilityLabel: "Show members",
|
|
1356
1368
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "users", size: 20, color: theme.colors.textMuted })
|
|
1357
1369
|
}
|
|
@@ -1407,6 +1419,34 @@ var styles5 = reactNative.StyleSheet.create({
|
|
|
1407
1419
|
marginLeft: -6
|
|
1408
1420
|
}
|
|
1409
1421
|
});
|
|
1422
|
+
function EmptyState({ title, hint, action }) {
|
|
1423
|
+
const theme = useTheme();
|
|
1424
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles6.root, accessible: true, accessibilityRole: "text", children: [
|
|
1425
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1426
|
+
reactNative.Text,
|
|
1427
|
+
{
|
|
1428
|
+
style: [styles6.title, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
1429
|
+
maxFontSizeMultiplier: 2,
|
|
1430
|
+
children: title
|
|
1431
|
+
}
|
|
1432
|
+
),
|
|
1433
|
+
hint ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1434
|
+
reactNative.Text,
|
|
1435
|
+
{
|
|
1436
|
+
style: [styles6.hint, { color: theme.colors.textMuted, fontFamily: theme.fonts.body }],
|
|
1437
|
+
maxFontSizeMultiplier: 2,
|
|
1438
|
+
children: hint
|
|
1439
|
+
}
|
|
1440
|
+
) : null,
|
|
1441
|
+
action ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles6.action, children: action }) : null
|
|
1442
|
+
] });
|
|
1443
|
+
}
|
|
1444
|
+
var styles6 = reactNative.StyleSheet.create({
|
|
1445
|
+
root: { alignItems: "center", paddingHorizontal: 24, paddingVertical: 24, maxWidth: 360 },
|
|
1446
|
+
title: { fontSize: 16, fontWeight: "600", textAlign: "center" },
|
|
1447
|
+
hint: { fontSize: 14, lineHeight: 20, marginTop: 6, textAlign: "center" },
|
|
1448
|
+
action: { marginTop: 14 }
|
|
1449
|
+
});
|
|
1410
1450
|
|
|
1411
1451
|
// src/internal/conversationSections.ts
|
|
1412
1452
|
var TYPE_SECTIONS = [
|
|
@@ -1428,6 +1468,8 @@ function ConversationList({
|
|
|
1428
1468
|
onSelect,
|
|
1429
1469
|
renderItem,
|
|
1430
1470
|
emptyState,
|
|
1471
|
+
query = "",
|
|
1472
|
+
noResultsState,
|
|
1431
1473
|
conversations: controlled,
|
|
1432
1474
|
loading: controlledLoading,
|
|
1433
1475
|
error: controlledError,
|
|
@@ -1449,7 +1491,15 @@ function ConversationList({
|
|
|
1449
1491
|
const meExternalId = me?.external_id ?? null;
|
|
1450
1492
|
const meId = me?.id ?? null;
|
|
1451
1493
|
const isControlled = controlled !== void 0;
|
|
1452
|
-
const
|
|
1494
|
+
const allConversations = isControlled ? controlled : auto.conversations;
|
|
1495
|
+
const needle = query.trim();
|
|
1496
|
+
const conversations = react.useMemo(
|
|
1497
|
+
() => needle ? react$1.filterConversations(allConversations, needle, {
|
|
1498
|
+
meExternalId,
|
|
1499
|
+
...labelFor ? { labelFor } : {}
|
|
1500
|
+
}) : allConversations,
|
|
1501
|
+
[allConversations, needle, meExternalId, labelFor]
|
|
1502
|
+
);
|
|
1453
1503
|
const loading = isControlled ? controlledLoading ?? false : auto.loading;
|
|
1454
1504
|
const error = isControlled ? controlledError ?? null : auto.error;
|
|
1455
1505
|
const counts = unreadCounts ?? (isControlled ? void 0 : auto.unreadCounts);
|
|
@@ -1498,9 +1548,9 @@ function ConversationList({
|
|
|
1498
1548
|
onSelect
|
|
1499
1549
|
]
|
|
1500
1550
|
);
|
|
1501
|
-
const placeholder = (node) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
1551
|
+
const placeholder = (node) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles7.flex, { backgroundColor: theme.colors.background }], children: [
|
|
1502
1552
|
header,
|
|
1503
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
1553
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles7.placeholder, children: node })
|
|
1504
1554
|
] });
|
|
1505
1555
|
if (loading && conversations.length === 0) {
|
|
1506
1556
|
return placeholder(/* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.accent }));
|
|
@@ -1510,12 +1560,29 @@ function ConversationList({
|
|
|
1510
1560
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.danger, fontFamily: theme.fonts.body }, children: "Failed to load conversations." })
|
|
1511
1561
|
);
|
|
1512
1562
|
}
|
|
1563
|
+
if (conversations.length === 0 && needle && allConversations.length > 0) {
|
|
1564
|
+
return placeholder(
|
|
1565
|
+
typeof noResultsState === "function" ? noResultsState(needle) : noResultsState !== void 0 ? noResultsState : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1566
|
+
EmptyState,
|
|
1567
|
+
{
|
|
1568
|
+
title: `Nothing matches \u201C${needle}\u201D`,
|
|
1569
|
+
hint: "Check the spelling, or search by a person's or channel's name."
|
|
1570
|
+
}
|
|
1571
|
+
)
|
|
1572
|
+
);
|
|
1573
|
+
}
|
|
1513
1574
|
if (conversations.length === 0) {
|
|
1514
1575
|
return placeholder(
|
|
1515
|
-
|
|
1576
|
+
emptyState == null ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1577
|
+
EmptyState,
|
|
1578
|
+
{
|
|
1579
|
+
title: "No conversations yet",
|
|
1580
|
+
hint: "Start a chat with someone, or join a channel \u2014 it shows up here."
|
|
1581
|
+
}
|
|
1582
|
+
) : typeof emptyState === "string" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }, children: emptyState }) : emptyState
|
|
1516
1583
|
);
|
|
1517
1584
|
}
|
|
1518
|
-
const footer = loadingMore ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.textSubtle, style:
|
|
1585
|
+
const footer = loadingMore ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.textSubtle, style: styles7.footerSpinner }) : null;
|
|
1519
1586
|
const common = {
|
|
1520
1587
|
style: { backgroundColor: theme.colors.background },
|
|
1521
1588
|
onEndReached: hasMore ? loadMore : void 0,
|
|
@@ -1536,8 +1603,8 @@ function ConversationList({
|
|
|
1536
1603
|
reactNative.Text,
|
|
1537
1604
|
{
|
|
1538
1605
|
style: [
|
|
1539
|
-
|
|
1540
|
-
density === "compact" ?
|
|
1606
|
+
styles7.sectionTitle,
|
|
1607
|
+
density === "compact" ? styles7.sectionTitleDense : null,
|
|
1541
1608
|
{ color: theme.colors.textMuted, fontFamily: theme.fonts.body }
|
|
1542
1609
|
],
|
|
1543
1610
|
accessibilityRole: "header",
|
|
@@ -1578,7 +1645,7 @@ function ConversationRow({
|
|
|
1578
1645
|
const title = isDirect ? otherExtId ? labelFor?.(otherExtId) ?? resolvedOther.profile?.displayName ?? otherExtId : "Direct chat" : conv.name ?? "Untitled conversation";
|
|
1579
1646
|
const avatarUrl = isDirect && otherExtId ? avatarFor?.(otherExtId) ?? resolvedOther.profile?.avatarUrl ?? null : conv.avatar_url ?? null;
|
|
1580
1647
|
const avatarSeed = isDirect ? otherExtId ?? conv.id : conv.id;
|
|
1581
|
-
const preview = conv.last_message_preview ? react$1.formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview : null;
|
|
1648
|
+
const preview = conv.last_message_preview ? react$1.formatCallLogPreview(conv.last_message_preview, meId) ?? react$1.formatRecordingNoticePreview(conv.last_message_preview, meId) ?? conv.last_message_preview : null;
|
|
1582
1649
|
const when = relativeTime(conv.last_message_at, Date.now(), "short");
|
|
1583
1650
|
const bold = unread > 0;
|
|
1584
1651
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1589,7 +1656,7 @@ function ConversationRow({
|
|
|
1589
1656
|
accessibilityState: { selected },
|
|
1590
1657
|
accessibilityLabel: unread > 0 ? `${title}, ${unread} unread` : title,
|
|
1591
1658
|
style: ({ pressed }) => [
|
|
1592
|
-
|
|
1659
|
+
styles7.row,
|
|
1593
1660
|
{
|
|
1594
1661
|
paddingHorizontal: theme.spacing.md,
|
|
1595
1662
|
paddingVertical: dense ? theme.spacing.xs + 2 : theme.spacing.sm + 2,
|
|
@@ -1608,14 +1675,14 @@ function ConversationRow({
|
|
|
1608
1675
|
...presence ? { presence: presence.state, doNotDisturb: !!presence.do_not_disturb } : {}
|
|
1609
1676
|
}
|
|
1610
1677
|
),
|
|
1611
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
1612
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
1678
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles7.body, children: [
|
|
1679
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles7.titleLine, children: [
|
|
1613
1680
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1614
1681
|
reactNative.Text,
|
|
1615
1682
|
{
|
|
1616
1683
|
style: [
|
|
1617
|
-
|
|
1618
|
-
dense ?
|
|
1684
|
+
styles7.name,
|
|
1685
|
+
dense ? styles7.nameDense : null,
|
|
1619
1686
|
{
|
|
1620
1687
|
color: theme.colors.text,
|
|
1621
1688
|
fontFamily: theme.fonts.body,
|
|
@@ -1630,7 +1697,7 @@ function ConversationRow({
|
|
|
1630
1697
|
reactNative.Text,
|
|
1631
1698
|
{
|
|
1632
1699
|
style: [
|
|
1633
|
-
|
|
1700
|
+
styles7.time,
|
|
1634
1701
|
{ color: bold ? theme.colors.accentStrong : theme.colors.textSubtle }
|
|
1635
1702
|
],
|
|
1636
1703
|
children: when
|
|
@@ -1641,7 +1708,7 @@ function ConversationRow({
|
|
|
1641
1708
|
reactNative.Text,
|
|
1642
1709
|
{
|
|
1643
1710
|
style: [
|
|
1644
|
-
|
|
1711
|
+
styles7.preview,
|
|
1645
1712
|
{ color: bold ? theme.colors.textMuted : theme.colors.textSubtle }
|
|
1646
1713
|
],
|
|
1647
1714
|
numberOfLines: 1,
|
|
@@ -1649,12 +1716,12 @@ function ConversationRow({
|
|
|
1649
1716
|
}
|
|
1650
1717
|
) : null
|
|
1651
1718
|
] }),
|
|
1652
|
-
unread > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
1719
|
+
unread > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles7.unreadPill, { backgroundColor: theme.colors.badge }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles7.unreadText, { color: theme.colors.badgeText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
|
|
1653
1720
|
]
|
|
1654
1721
|
}
|
|
1655
1722
|
);
|
|
1656
1723
|
}
|
|
1657
|
-
var
|
|
1724
|
+
var styles7 = reactNative.StyleSheet.create({
|
|
1658
1725
|
flex: {
|
|
1659
1726
|
flex: 1
|
|
1660
1727
|
},
|
|
@@ -1859,11 +1926,11 @@ function AttachmentPicker({
|
|
|
1859
1926
|
animationType: "slide",
|
|
1860
1927
|
onRequestClose: onClose,
|
|
1861
1928
|
...EDGE_TO_EDGE_MODAL,
|
|
1862
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style:
|
|
1929
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles8.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1863
1930
|
reactNative.View,
|
|
1864
1931
|
{
|
|
1865
1932
|
style: [
|
|
1866
|
-
|
|
1933
|
+
styles8.sheet,
|
|
1867
1934
|
{
|
|
1868
1935
|
backgroundColor: theme.colors.surface,
|
|
1869
1936
|
borderTopLeftRadius: theme.radii.lg,
|
|
@@ -1876,19 +1943,19 @@ function AttachmentPicker({
|
|
|
1876
1943
|
theme.shadows.lg
|
|
1877
1944
|
],
|
|
1878
1945
|
children: [
|
|
1879
|
-
camera ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style:
|
|
1946
|
+
camera ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles8.item, onPress: () => pickFromKind("camera"), children: [
|
|
1880
1947
|
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "camera", size: 20, color: theme.colors.textMuted }),
|
|
1881
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
1948
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.itemText, { color: theme.colors.text }], children: "Camera" })
|
|
1882
1949
|
] }) : null,
|
|
1883
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style:
|
|
1950
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles8.item, onPress: () => pickFromKind("image"), children: [
|
|
1884
1951
|
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "image", size: 20, color: theme.colors.textMuted }),
|
|
1885
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
1952
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.itemText, { color: theme.colors.text }], children: "Photo library" })
|
|
1886
1953
|
] }),
|
|
1887
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style:
|
|
1954
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles8.item, onPress: () => pickFromKind("document"), children: [
|
|
1888
1955
|
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 20, color: theme.colors.textMuted }),
|
|
1889
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
1956
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.itemText, { color: theme.colors.text }], children: "File" })
|
|
1890
1957
|
] }),
|
|
1891
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style:
|
|
1958
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles8.cancel, onPress: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.itemText, { color: theme.colors.accent }], children: "Cancel" }) })
|
|
1892
1959
|
]
|
|
1893
1960
|
}
|
|
1894
1961
|
) })
|
|
@@ -2043,7 +2110,7 @@ async function defaultAdapter(kind, { multiple }) {
|
|
|
2043
2110
|
})
|
|
2044
2111
|
);
|
|
2045
2112
|
}
|
|
2046
|
-
var
|
|
2113
|
+
var styles8 = reactNative.StyleSheet.create({
|
|
2047
2114
|
backdrop: {
|
|
2048
2115
|
flex: 1,
|
|
2049
2116
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
@@ -2073,14 +2140,14 @@ var styles7 = reactNative.StyleSheet.create({
|
|
|
2073
2140
|
});
|
|
2074
2141
|
function DaySeparator({ label, variant = "pill" }) {
|
|
2075
2142
|
const theme = useTheme();
|
|
2076
|
-
const rule = variant === "rule" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
2077
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
2143
|
+
const rule = variant === "rule" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles9.rule, { backgroundColor: theme.colors.border }] }) : null;
|
|
2144
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles9.wrap, rule ? styles9.wrapRule : null], children: [
|
|
2078
2145
|
rule,
|
|
2079
2146
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2080
2147
|
reactNative.View,
|
|
2081
2148
|
{
|
|
2082
2149
|
style: [
|
|
2083
|
-
|
|
2150
|
+
styles9.chip,
|
|
2084
2151
|
{
|
|
2085
2152
|
backgroundColor: theme.colors.surfaceAlt,
|
|
2086
2153
|
borderColor: theme.colors.border
|
|
@@ -2090,7 +2157,7 @@ function DaySeparator({ label, variant = "pill" }) {
|
|
|
2090
2157
|
reactNative.Text,
|
|
2091
2158
|
{
|
|
2092
2159
|
style: [
|
|
2093
|
-
|
|
2160
|
+
styles9.label,
|
|
2094
2161
|
{
|
|
2095
2162
|
color: theme.colors.textMuted,
|
|
2096
2163
|
fontFamily: theme.fonts.body
|
|
@@ -2104,7 +2171,7 @@ function DaySeparator({ label, variant = "pill" }) {
|
|
|
2104
2171
|
rule
|
|
2105
2172
|
] });
|
|
2106
2173
|
}
|
|
2107
|
-
var
|
|
2174
|
+
var styles9 = reactNative.StyleSheet.create({
|
|
2108
2175
|
wrap: {
|
|
2109
2176
|
alignItems: "center",
|
|
2110
2177
|
marginVertical: 8
|
|
@@ -2137,7 +2204,7 @@ function LiveCallBanner({ call, inCall, onJoin }) {
|
|
|
2137
2204
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2138
2205
|
reactNative.View,
|
|
2139
2206
|
{
|
|
2140
|
-
style: [
|
|
2207
|
+
style: [styles10.bar, { backgroundColor: theme.colors.success }],
|
|
2141
2208
|
accessibilityRole: "summary",
|
|
2142
2209
|
accessibilityLabel: `${what}, ${who}`,
|
|
2143
2210
|
children: [
|
|
@@ -2150,9 +2217,9 @@ function LiveCallBanner({ call, inCall, onJoin }) {
|
|
|
2150
2217
|
label: null
|
|
2151
2218
|
}
|
|
2152
2219
|
),
|
|
2153
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
2154
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
2155
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
2220
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles10.text, children: [
|
|
2221
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.title, { fontFamily: theme.fonts.body }], numberOfLines: 1, children: what }),
|
|
2222
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.meta, { fontFamily: theme.fonts.body }], numberOfLines: 1, children: who })
|
|
2156
2223
|
] }),
|
|
2157
2224
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2158
2225
|
reactNative.Pressable,
|
|
@@ -2161,11 +2228,11 @@ function LiveCallBanner({ call, inCall, onJoin }) {
|
|
|
2161
2228
|
accessibilityRole: "button",
|
|
2162
2229
|
accessibilityLabel: "Join call",
|
|
2163
2230
|
hitSlop: 8,
|
|
2164
|
-
style: ({ pressed }) => [
|
|
2231
|
+
style: ({ pressed }) => [styles10.join, pressed && styles10.joinPressed],
|
|
2165
2232
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2166
2233
|
reactNative.Text,
|
|
2167
2234
|
{
|
|
2168
|
-
style: [
|
|
2235
|
+
style: [styles10.joinText, { color: theme.colors.success, fontFamily: theme.fonts.body }],
|
|
2169
2236
|
children: "Join"
|
|
2170
2237
|
}
|
|
2171
2238
|
)
|
|
@@ -2175,7 +2242,7 @@ function LiveCallBanner({ call, inCall, onJoin }) {
|
|
|
2175
2242
|
}
|
|
2176
2243
|
);
|
|
2177
2244
|
}
|
|
2178
|
-
var
|
|
2245
|
+
var styles10 = reactNative.StyleSheet.create({
|
|
2179
2246
|
bar: {
|
|
2180
2247
|
flexDirection: "row",
|
|
2181
2248
|
alignItems: "center",
|
|
@@ -2381,7 +2448,7 @@ function PickerSheet({
|
|
|
2381
2448
|
{
|
|
2382
2449
|
onPress: () => pick(emoji),
|
|
2383
2450
|
style: ({ pressed }) => [
|
|
2384
|
-
|
|
2451
|
+
styles11.cell,
|
|
2385
2452
|
{
|
|
2386
2453
|
borderRadius: theme.radii.sm,
|
|
2387
2454
|
backgroundColor: pressed ? theme.colors.surfaceAlt : void 0
|
|
@@ -2389,15 +2456,15 @@ function PickerSheet({
|
|
|
2389
2456
|
],
|
|
2390
2457
|
accessibilityRole: "button",
|
|
2391
2458
|
accessibilityLabel: emoji,
|
|
2392
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
2459
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.emoji, children: emoji })
|
|
2393
2460
|
},
|
|
2394
2461
|
emoji
|
|
2395
2462
|
);
|
|
2396
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.KeyboardAvoidingView, { style:
|
|
2463
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.KeyboardAvoidingView, { style: styles11.kav, behavior: "padding", children: [
|
|
2397
2464
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2398
2465
|
reactNative.Pressable,
|
|
2399
2466
|
{
|
|
2400
|
-
style: [
|
|
2467
|
+
style: [styles11.backdrop, { backgroundColor: theme.colors.overlay }],
|
|
2401
2468
|
onPress: onClose,
|
|
2402
2469
|
accessibilityLabel: "Close emoji picker"
|
|
2403
2470
|
}
|
|
@@ -2406,7 +2473,7 @@ function PickerSheet({
|
|
|
2406
2473
|
reactNative.View,
|
|
2407
2474
|
{
|
|
2408
2475
|
style: [
|
|
2409
|
-
|
|
2476
|
+
styles11.sheet,
|
|
2410
2477
|
{
|
|
2411
2478
|
height: Math.round(height * 0.55),
|
|
2412
2479
|
backgroundColor: theme.colors.surface,
|
|
@@ -2419,11 +2486,11 @@ function PickerSheet({
|
|
|
2419
2486
|
theme.shadows.lg
|
|
2420
2487
|
],
|
|
2421
2488
|
children: [
|
|
2422
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
2489
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles11.headRow, children: [
|
|
2423
2490
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2424
2491
|
reactNative.Text,
|
|
2425
2492
|
{
|
|
2426
|
-
style: [
|
|
2493
|
+
style: [styles11.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
|
|
2427
2494
|
accessibilityRole: "header",
|
|
2428
2495
|
children: title
|
|
2429
2496
|
}
|
|
@@ -2434,7 +2501,7 @@ function PickerSheet({
|
|
|
2434
2501
|
reactNative.View,
|
|
2435
2502
|
{
|
|
2436
2503
|
style: [
|
|
2437
|
-
|
|
2504
|
+
styles11.search,
|
|
2438
2505
|
{ backgroundColor: theme.colors.surfaceAlt, borderRadius: theme.radii.md }
|
|
2439
2506
|
],
|
|
2440
2507
|
children: [
|
|
@@ -2448,19 +2515,19 @@ function PickerSheet({
|
|
|
2448
2515
|
placeholderTextColor: theme.colors.textSubtle,
|
|
2449
2516
|
autoCorrect: false,
|
|
2450
2517
|
autoCapitalize: "none",
|
|
2451
|
-
style: [
|
|
2518
|
+
style: [styles11.searchInput, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
2452
2519
|
accessibilityLabel: "Search emoji"
|
|
2453
2520
|
}
|
|
2454
2521
|
)
|
|
2455
2522
|
]
|
|
2456
2523
|
}
|
|
2457
2524
|
),
|
|
2458
|
-
query.trim() ? results.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
2459
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
2525
|
+
query.trim() ? results.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles11.results, children: results.map((r) => cell(r.emoji)) }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.empty, { color: theme.colors.textMuted }], children: "No emoji found." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2526
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles11.tabs, { borderBottomColor: theme.colors.border }], children: sections.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2460
2527
|
reactNative.Pressable,
|
|
2461
2528
|
{
|
|
2462
2529
|
hitSlop: 4,
|
|
2463
|
-
style:
|
|
2530
|
+
style: styles11.tab,
|
|
2464
2531
|
onPress: () => listRef.current?.scrollToLocation({
|
|
2465
2532
|
sectionIndex: i,
|
|
2466
2533
|
itemIndex: 0,
|
|
@@ -2469,7 +2536,7 @@ function PickerSheet({
|
|
|
2469
2536
|
}),
|
|
2470
2537
|
accessibilityRole: "button",
|
|
2471
2538
|
accessibilityLabel: s.title,
|
|
2472
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
2539
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.tabEmoji, children: s.id === "recent" ? "\u{1F558}" : s.data[0]?.[0] })
|
|
2473
2540
|
},
|
|
2474
2541
|
s.id
|
|
2475
2542
|
)) }),
|
|
@@ -2483,8 +2550,8 @@ function PickerSheet({
|
|
|
2483
2550
|
stickySectionHeadersEnabled: false,
|
|
2484
2551
|
initialNumToRender: 8,
|
|
2485
2552
|
onScrollToIndexFailed: () => void 0,
|
|
2486
|
-
renderSectionHeader: ({ section }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
2487
|
-
renderItem: ({ item }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
2553
|
+
renderSectionHeader: ({ section }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.sectionTitle, { color: theme.colors.textMuted }], children: section.title }),
|
|
2554
|
+
renderItem: ({ item }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles11.gridRow, children: item.map(cell) })
|
|
2488
2555
|
}
|
|
2489
2556
|
)
|
|
2490
2557
|
] })
|
|
@@ -2498,7 +2565,7 @@ function chunk(list, size) {
|
|
|
2498
2565
|
for (let i = 0; i < list.length; i += size) out.push(list.slice(i, i + size));
|
|
2499
2566
|
return out;
|
|
2500
2567
|
}
|
|
2501
|
-
var
|
|
2568
|
+
var styles11 = reactNative.StyleSheet.create({
|
|
2502
2569
|
kav: {
|
|
2503
2570
|
flex: 1,
|
|
2504
2571
|
justifyContent: "flex-end"
|
|
@@ -2589,8 +2656,8 @@ function UploadQueueStrip() {
|
|
|
2589
2656
|
{
|
|
2590
2657
|
horizontal: true,
|
|
2591
2658
|
showsHorizontalScrollIndicator: false,
|
|
2592
|
-
contentContainerStyle:
|
|
2593
|
-
style: [
|
|
2659
|
+
contentContainerStyle: styles12.scroll,
|
|
2660
|
+
style: [styles12.scrollStyle, { marginBottom: 8 }],
|
|
2594
2661
|
children: upload.queue.map((item) => {
|
|
2595
2662
|
const isError = item.status === "error";
|
|
2596
2663
|
const isUploading = item.status === "uploading" || item.status === "pending";
|
|
@@ -2601,7 +2668,7 @@ function UploadQueueStrip() {
|
|
|
2601
2668
|
if (item.status === "ready" || isError) upload.remove(item.localId);
|
|
2602
2669
|
else upload.cancel(item.localId);
|
|
2603
2670
|
};
|
|
2604
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
2671
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles12.tileWrap, children: [
|
|
2605
2672
|
isImage && previewUri ? /* @__PURE__ */ jsxRuntime.jsx(ImageTile, { uri: previewUri, uploading: isUploading, error: isError }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2606
2673
|
FileTile,
|
|
2607
2674
|
{
|
|
@@ -2616,13 +2683,13 @@ function UploadQueueStrip() {
|
|
|
2616
2683
|
{
|
|
2617
2684
|
onPress: handleClose,
|
|
2618
2685
|
hitSlop: 8,
|
|
2619
|
-
style:
|
|
2686
|
+
style: styles12.closeBtn,
|
|
2620
2687
|
accessibilityLabel: isError ? "Remove failed upload" : "Cancel upload",
|
|
2621
2688
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 11, color: "#fff" })
|
|
2622
2689
|
}
|
|
2623
2690
|
) : null,
|
|
2624
|
-
isUploading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
2625
|
-
isError ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
2691
|
+
isUploading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles12.progressOverlay, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles12.spinner, { borderColor: theme.colors.accentText }] }) }) : null,
|
|
2692
|
+
isError ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles12.errorOverlay, { backgroundColor: "rgba(229,72,77,0.85)" }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles12.errorText, { color: "#fff" }], children: "Failed" }) }) : null
|
|
2626
2693
|
] }, item.localId);
|
|
2627
2694
|
})
|
|
2628
2695
|
}
|
|
@@ -2635,7 +2702,7 @@ function ImageTile({ uri, uploading, error }) {
|
|
|
2635
2702
|
{
|
|
2636
2703
|
source: { uri },
|
|
2637
2704
|
style: [
|
|
2638
|
-
|
|
2705
|
+
styles12.imageTile,
|
|
2639
2706
|
{
|
|
2640
2707
|
backgroundColor: theme.colors.surfaceAlt,
|
|
2641
2708
|
borderColor: error ? theme.colors.danger : "transparent",
|
|
@@ -2657,24 +2724,24 @@ function FileTile({
|
|
|
2657
2724
|
reactNative.View,
|
|
2658
2725
|
{
|
|
2659
2726
|
style: [
|
|
2660
|
-
|
|
2727
|
+
styles12.fileTile,
|
|
2661
2728
|
{
|
|
2662
2729
|
backgroundColor: theme.colors.surfaceAlt,
|
|
2663
2730
|
borderColor: error ? theme.colors.danger : uploading ? theme.colors.accent : theme.colors.border
|
|
2664
2731
|
}
|
|
2665
2732
|
],
|
|
2666
2733
|
children: [
|
|
2667
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
2668
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
2734
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles12.fileIconBox, { backgroundColor: theme.colors.accentSoft }], children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 18, color: theme.colors.accent }) }),
|
|
2735
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles12.fileInfo, children: [
|
|
2669
2736
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2670
2737
|
reactNative.Text,
|
|
2671
2738
|
{
|
|
2672
|
-
style: [
|
|
2739
|
+
style: [styles12.fileName, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
2673
2740
|
numberOfLines: 1,
|
|
2674
2741
|
children: filename
|
|
2675
2742
|
}
|
|
2676
2743
|
),
|
|
2677
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
2744
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles12.fileSize, { color: theme.colors.textSubtle }], children: formatBytes2(size) })
|
|
2678
2745
|
] })
|
|
2679
2746
|
]
|
|
2680
2747
|
}
|
|
@@ -2688,7 +2755,7 @@ function formatBytes2(n) {
|
|
|
2688
2755
|
return `${(n / 1024 / 1024 / 1024).toFixed(1)} GB`;
|
|
2689
2756
|
}
|
|
2690
2757
|
var TILE = 64;
|
|
2691
|
-
var
|
|
2758
|
+
var styles12 = reactNative.StyleSheet.create({
|
|
2692
2759
|
scrollStyle: {
|
|
2693
2760
|
overflow: "visible"
|
|
2694
2761
|
},
|
|
@@ -2922,7 +2989,7 @@ var MessageComposer = react.forwardRef(
|
|
|
2922
2989
|
reactNative.View,
|
|
2923
2990
|
{
|
|
2924
2991
|
style: [
|
|
2925
|
-
|
|
2992
|
+
styles13.wrap,
|
|
2926
2993
|
{
|
|
2927
2994
|
backgroundColor: theme.colors.surface,
|
|
2928
2995
|
borderTopColor: theme.colors.border,
|
|
@@ -2946,13 +3013,14 @@ var MessageComposer = react.forwardRef(
|
|
|
2946
3013
|
) : null,
|
|
2947
3014
|
attachments && !isEditing ? /* @__PURE__ */ jsxRuntime.jsx(UploadQueueStrip, {}) : null,
|
|
2948
3015
|
isEditing ? null : accessory,
|
|
2949
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
3016
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles13.row, children: [
|
|
2950
3017
|
attachments && onAttachPress ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2951
3018
|
reactNative.Pressable,
|
|
2952
3019
|
{
|
|
2953
3020
|
onPress: onAttachPress,
|
|
2954
3021
|
hitSlop: 8,
|
|
2955
|
-
style:
|
|
3022
|
+
style: styles13.iconBtn,
|
|
3023
|
+
accessibilityRole: "button",
|
|
2956
3024
|
accessibilityLabel: "Attach file",
|
|
2957
3025
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 22, color: theme.colors.textMuted })
|
|
2958
3026
|
}
|
|
@@ -2962,7 +3030,7 @@ var MessageComposer = react.forwardRef(
|
|
|
2962
3030
|
{
|
|
2963
3031
|
onPress: () => setEmojiOpen(true),
|
|
2964
3032
|
hitSlop: 8,
|
|
2965
|
-
style:
|
|
3033
|
+
style: styles13.iconBtn,
|
|
2966
3034
|
accessibilityRole: "button",
|
|
2967
3035
|
accessibilityLabel: "Insert emoji",
|
|
2968
3036
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "emoji", size: 22, color: theme.colors.textMuted, label: null })
|
|
@@ -2982,11 +3050,12 @@ var MessageComposer = react.forwardRef(
|
|
|
2982
3050
|
if (!isEditing) onSelectionChange?.(e.nativeEvent.selection);
|
|
2983
3051
|
},
|
|
2984
3052
|
placeholder,
|
|
3053
|
+
accessibilityLabel: placeholder,
|
|
2985
3054
|
placeholderTextColor: theme.colors.textSubtle,
|
|
2986
3055
|
multiline: true,
|
|
2987
3056
|
editable: !disabled,
|
|
2988
3057
|
style: [
|
|
2989
|
-
|
|
3058
|
+
styles13.input,
|
|
2990
3059
|
{
|
|
2991
3060
|
color: theme.colors.text,
|
|
2992
3061
|
backgroundColor: theme.colors.surfaceAlt,
|
|
@@ -3003,12 +3072,13 @@ var MessageComposer = react.forwardRef(
|
|
|
3003
3072
|
onPress: handleSend,
|
|
3004
3073
|
disabled: submitDisabled,
|
|
3005
3074
|
style: [
|
|
3006
|
-
|
|
3075
|
+
styles13.sendBtn,
|
|
3007
3076
|
{
|
|
3008
3077
|
backgroundColor: submitDisabled ? theme.colors.textSubtle : theme.colors.accent,
|
|
3009
3078
|
opacity: submitDisabled ? 0.6 : 1
|
|
3010
3079
|
}
|
|
3011
3080
|
],
|
|
3081
|
+
accessibilityRole: "button",
|
|
3012
3082
|
accessibilityLabel: "Send message",
|
|
3013
3083
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "send", size: 18, color: theme.colors.accentText })
|
|
3014
3084
|
}
|
|
@@ -3046,7 +3116,7 @@ function EditChip({ message, onCancel }) {
|
|
|
3046
3116
|
reactNative.View,
|
|
3047
3117
|
{
|
|
3048
3118
|
style: [
|
|
3049
|
-
|
|
3119
|
+
styles13.replyChip,
|
|
3050
3120
|
{
|
|
3051
3121
|
backgroundColor: theme.colors.surfaceAlt,
|
|
3052
3122
|
borderLeftColor: theme.colors.accent
|
|
@@ -3054,10 +3124,10 @@ function EditChip({ message, onCancel }) {
|
|
|
3054
3124
|
],
|
|
3055
3125
|
children: [
|
|
3056
3126
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: { flex: 1 }, children: [
|
|
3057
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3058
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3127
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles13.replyName, { color: theme.colors.accent }], children: "Editing message" }),
|
|
3128
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles13.replyBody, { color: theme.colors.textMuted }], numberOfLines: 1, children: message.body ?? "\u2026" })
|
|
3059
3129
|
] }),
|
|
3060
|
-
onCancel ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onCancel, hitSlop: 8, style:
|
|
3130
|
+
onCancel ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onCancel, hitSlop: 8, style: styles13.replyCancel, children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.textMuted }) }) : null
|
|
3061
3131
|
]
|
|
3062
3132
|
}
|
|
3063
3133
|
);
|
|
@@ -3074,7 +3144,7 @@ function ReplyChip({
|
|
|
3074
3144
|
reactNative.View,
|
|
3075
3145
|
{
|
|
3076
3146
|
style: [
|
|
3077
|
-
|
|
3147
|
+
styles13.replyChip,
|
|
3078
3148
|
{
|
|
3079
3149
|
backgroundColor: theme.colors.surfaceAlt,
|
|
3080
3150
|
borderLeftColor: theme.colors.accent
|
|
@@ -3082,18 +3152,18 @@ function ReplyChip({
|
|
|
3082
3152
|
],
|
|
3083
3153
|
children: [
|
|
3084
3154
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: { flex: 1 }, children: [
|
|
3085
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [
|
|
3155
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles13.replyName, { color: theme.colors.accent }], children: [
|
|
3086
3156
|
"Replying to ",
|
|
3087
3157
|
senderName
|
|
3088
3158
|
] }),
|
|
3089
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3159
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles13.replyBody, { color: theme.colors.textMuted }], numberOfLines: 1, children: message.body ?? "\u2026" })
|
|
3090
3160
|
] }),
|
|
3091
|
-
onCancel ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onCancel, hitSlop: 8, style:
|
|
3161
|
+
onCancel ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onCancel, hitSlop: 8, style: styles13.replyCancel, children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.textMuted }) }) : null
|
|
3092
3162
|
]
|
|
3093
3163
|
}
|
|
3094
3164
|
);
|
|
3095
3165
|
}
|
|
3096
|
-
var
|
|
3166
|
+
var styles13 = reactNative.StyleSheet.create({
|
|
3097
3167
|
wrap: {
|
|
3098
3168
|
borderTopWidth: reactNative.StyleSheet.hairlineWidth,
|
|
3099
3169
|
paddingTop: 8,
|
|
@@ -3204,7 +3274,7 @@ function MentionInput({
|
|
|
3204
3274
|
reactNative.View,
|
|
3205
3275
|
{
|
|
3206
3276
|
style: [
|
|
3207
|
-
|
|
3277
|
+
styles14.suggestions,
|
|
3208
3278
|
{
|
|
3209
3279
|
backgroundColor: theme.colors.surface,
|
|
3210
3280
|
borderColor: theme.colors.border,
|
|
@@ -3215,7 +3285,7 @@ function MentionInput({
|
|
|
3215
3285
|
accessibilityRole: "menu",
|
|
3216
3286
|
accessibilityLabel: "Mention suggestions",
|
|
3217
3287
|
children: [
|
|
3218
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { keyboardShouldPersistTaps: "always", style:
|
|
3288
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { keyboardShouldPersistTaps: "always", style: styles14.suggestionScroll, children: candidates.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3219
3289
|
MentionRow,
|
|
3220
3290
|
{
|
|
3221
3291
|
externalId: c.externalId,
|
|
@@ -3228,7 +3298,7 @@ function MentionInput({
|
|
|
3228
3298
|
reactNative.Pressable,
|
|
3229
3299
|
{
|
|
3230
3300
|
onPress: () => setDismissedAt(query.start),
|
|
3231
|
-
style:
|
|
3301
|
+
style: styles14.dismiss,
|
|
3232
3302
|
accessibilityRole: "button",
|
|
3233
3303
|
accessibilityLabel: "Dismiss suggestions",
|
|
3234
3304
|
hitSlop: 6,
|
|
@@ -3271,7 +3341,7 @@ function MentionRow({
|
|
|
3271
3341
|
{
|
|
3272
3342
|
onPress,
|
|
3273
3343
|
style: ({ pressed }) => [
|
|
3274
|
-
|
|
3344
|
+
styles14.row,
|
|
3275
3345
|
{ backgroundColor: pressed ? theme.colors.surfaceAlt : "transparent" }
|
|
3276
3346
|
],
|
|
3277
3347
|
accessibilityRole: "menuitem",
|
|
@@ -3281,7 +3351,7 @@ function MentionRow({
|
|
|
3281
3351
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3282
3352
|
reactNative.Text,
|
|
3283
3353
|
{
|
|
3284
|
-
style: [
|
|
3354
|
+
style: [styles14.rowText, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
3285
3355
|
numberOfLines: 1,
|
|
3286
3356
|
children: name
|
|
3287
3357
|
}
|
|
@@ -3290,7 +3360,7 @@ function MentionRow({
|
|
|
3290
3360
|
}
|
|
3291
3361
|
);
|
|
3292
3362
|
}
|
|
3293
|
-
var
|
|
3363
|
+
var styles14 = reactNative.StyleSheet.create({
|
|
3294
3364
|
suggestions: {
|
|
3295
3365
|
borderWidth: reactNative.StyleSheet.hairlineWidth,
|
|
3296
3366
|
marginBottom: 8,
|
|
@@ -3422,15 +3492,15 @@ function MessageList({
|
|
|
3422
3492
|
[renderItem, data.length]
|
|
3423
3493
|
);
|
|
3424
3494
|
if (loading && messages.length === 0) {
|
|
3425
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
3495
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles15.placeholder, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.accent }) });
|
|
3426
3496
|
}
|
|
3427
3497
|
if (messages.length === 0) {
|
|
3428
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
3429
|
-
ListHeader ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
3498
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles15.placeholder, { backgroundColor: theme.colors.background }], children: [
|
|
3499
|
+
ListHeader ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles15.emptyHeader, children: ListHeader }) : null,
|
|
3430
3500
|
typeof emptyState === "string" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }, children: emptyState }) : emptyState ?? null
|
|
3431
3501
|
] });
|
|
3432
3502
|
}
|
|
3433
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
3503
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.root, children: [
|
|
3434
3504
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3435
3505
|
reactNative.FlatList,
|
|
3436
3506
|
{
|
|
@@ -3460,7 +3530,7 @@ function MessageList({
|
|
|
3460
3530
|
{
|
|
3461
3531
|
onPress: scrollToBottom,
|
|
3462
3532
|
style: [
|
|
3463
|
-
|
|
3533
|
+
styles15.jumpButton,
|
|
3464
3534
|
{
|
|
3465
3535
|
backgroundColor: theme.colors.accent
|
|
3466
3536
|
},
|
|
@@ -3469,7 +3539,7 @@ function MessageList({
|
|
|
3469
3539
|
accessibilityLabel: `${newCount} new ${newCount === 1 ? "message" : "messages"}, jump to latest`,
|
|
3470
3540
|
children: [
|
|
3471
3541
|
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "chevron-down", size: 14, color: theme.colors.accentText }),
|
|
3472
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [
|
|
3542
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles15.jumpText, { color: theme.colors.accentText }], children: [
|
|
3473
3543
|
newCount,
|
|
3474
3544
|
" new ",
|
|
3475
3545
|
newCount === 1 ? "message" : "messages"
|
|
@@ -3480,7 +3550,7 @@ function MessageList({
|
|
|
3480
3550
|
] });
|
|
3481
3551
|
}
|
|
3482
3552
|
var VIEWABILITY = { itemVisiblePercentThreshold: 50 };
|
|
3483
|
-
var
|
|
3553
|
+
var styles15 = reactNative.StyleSheet.create({
|
|
3484
3554
|
root: {
|
|
3485
3555
|
flex: 1
|
|
3486
3556
|
},
|
|
@@ -3519,13 +3589,13 @@ function CallLogRow({ msg, meId, onCallBack }) {
|
|
|
3519
3589
|
const accent = display.missed ? theme.colors.danger : theme.colors.textSubtle;
|
|
3520
3590
|
const time = formatTime(msg.inserted_at);
|
|
3521
3591
|
const label = [display.title, display.detail, time].filter(Boolean).join(", ");
|
|
3522
|
-
const metaStyle = [
|
|
3523
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
3592
|
+
const metaStyle = [styles16.meta, { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }];
|
|
3593
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles16.wrap, accessible: true, accessibilityLabel: label, children: [
|
|
3524
3594
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3525
3595
|
reactNative.View,
|
|
3526
3596
|
{
|
|
3527
3597
|
style: [
|
|
3528
|
-
|
|
3598
|
+
styles16.chip,
|
|
3529
3599
|
{
|
|
3530
3600
|
backgroundColor: theme.colors.surfaceAlt,
|
|
3531
3601
|
borderColor: theme.colors.border
|
|
@@ -3537,7 +3607,7 @@ function CallLogRow({ msg, meId, onCallBack }) {
|
|
|
3537
3607
|
reactNative.Text,
|
|
3538
3608
|
{
|
|
3539
3609
|
style: [
|
|
3540
|
-
|
|
3610
|
+
styles16.title,
|
|
3541
3611
|
{
|
|
3542
3612
|
color: display.missed ? theme.colors.danger : theme.colors.textMuted,
|
|
3543
3613
|
fontFamily: theme.fonts.body
|
|
@@ -3565,12 +3635,12 @@ function CallLogRow({ msg, meId, onCallBack }) {
|
|
|
3565
3635
|
accessibilityRole: "button",
|
|
3566
3636
|
accessibilityLabel: display.media === "video" ? "Video call back" : "Call back",
|
|
3567
3637
|
hitSlop: 8,
|
|
3568
|
-
style: ({ pressed }) => [
|
|
3638
|
+
style: ({ pressed }) => [styles16.callBack, pressed && styles16.callBackPressed],
|
|
3569
3639
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3570
3640
|
reactNative.Text,
|
|
3571
3641
|
{
|
|
3572
3642
|
style: [
|
|
3573
|
-
|
|
3643
|
+
styles16.callBackText,
|
|
3574
3644
|
{ color: theme.colors.accent, fontFamily: theme.fonts.body }
|
|
3575
3645
|
],
|
|
3576
3646
|
children: "Call back"
|
|
@@ -3585,7 +3655,7 @@ function formatTime(iso) {
|
|
|
3585
3655
|
if (Number.isNaN(d.getTime())) return "";
|
|
3586
3656
|
return d.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
|
|
3587
3657
|
}
|
|
3588
|
-
var
|
|
3658
|
+
var styles16 = reactNative.StyleSheet.create({
|
|
3589
3659
|
wrap: {
|
|
3590
3660
|
alignItems: "center",
|
|
3591
3661
|
alignSelf: "stretch",
|
|
@@ -3619,6 +3689,403 @@ var styles15 = reactNative.StyleSheet.create({
|
|
|
3619
3689
|
fontVariant: ["tabular-nums"]
|
|
3620
3690
|
}
|
|
3621
3691
|
});
|
|
3692
|
+
function RecDot({ off = false, color }) {
|
|
3693
|
+
const theme = useTheme();
|
|
3694
|
+
const opacity = react.useRef(new reactNative.Animated.Value(1)).current;
|
|
3695
|
+
react.useEffect(() => {
|
|
3696
|
+
if (off) return;
|
|
3697
|
+
let loop = null;
|
|
3698
|
+
let cancelled = false;
|
|
3699
|
+
void reactNative.AccessibilityInfo.isReduceMotionEnabled?.().then((reduce) => {
|
|
3700
|
+
if (reduce || cancelled) return;
|
|
3701
|
+
loop = reactNative.Animated.loop(
|
|
3702
|
+
reactNative.Animated.sequence([
|
|
3703
|
+
reactNative.Animated.timing(opacity, { toValue: 0.35, duration: 800, useNativeDriver: true }),
|
|
3704
|
+
reactNative.Animated.timing(opacity, { toValue: 1, duration: 800, useNativeDriver: true })
|
|
3705
|
+
])
|
|
3706
|
+
);
|
|
3707
|
+
loop.start();
|
|
3708
|
+
}).catch(() => {
|
|
3709
|
+
});
|
|
3710
|
+
return () => {
|
|
3711
|
+
cancelled = true;
|
|
3712
|
+
loop?.stop();
|
|
3713
|
+
};
|
|
3714
|
+
}, [off, opacity]);
|
|
3715
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3716
|
+
reactNative.Animated.View,
|
|
3717
|
+
{
|
|
3718
|
+
style: [
|
|
3719
|
+
styles17.dot,
|
|
3720
|
+
{
|
|
3721
|
+
backgroundColor: off ? theme.colors.textSubtle : color ?? theme.colors.danger,
|
|
3722
|
+
opacity: off ? 1 : opacity
|
|
3723
|
+
}
|
|
3724
|
+
]
|
|
3725
|
+
}
|
|
3726
|
+
);
|
|
3727
|
+
}
|
|
3728
|
+
function RecordingBanner({
|
|
3729
|
+
recording,
|
|
3730
|
+
transcribing = false,
|
|
3731
|
+
mode,
|
|
3732
|
+
consentRequired = false,
|
|
3733
|
+
myConsent,
|
|
3734
|
+
onStop,
|
|
3735
|
+
onChangeConsent,
|
|
3736
|
+
pending = false,
|
|
3737
|
+
style
|
|
3738
|
+
}) {
|
|
3739
|
+
const theme = useTheme();
|
|
3740
|
+
const label = react$1.captureLabel(recording, transcribing, mode);
|
|
3741
|
+
if (!label) return null;
|
|
3742
|
+
const listenOnly = consentRequired && myConsent === "declined";
|
|
3743
|
+
const meta = listenOnly ? "You declined \u2014 you are listen-only" : consentRequired ? "Only people who agreed are captured" : "Everyone in the call is told";
|
|
3744
|
+
const button = (text, onPress) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3745
|
+
reactNative.Pressable,
|
|
3746
|
+
{
|
|
3747
|
+
onPress,
|
|
3748
|
+
disabled: pending,
|
|
3749
|
+
accessibilityRole: "button",
|
|
3750
|
+
accessibilityLabel: text === "Stop" ? "Stop recording" : "Change consent",
|
|
3751
|
+
hitSlop: 8,
|
|
3752
|
+
style: ({ pressed }) => [
|
|
3753
|
+
styles17.bannerBtn,
|
|
3754
|
+
{ borderColor: theme.colors.border, backgroundColor: theme.colors.surface },
|
|
3755
|
+
(pressed || pending) && styles17.pressed
|
|
3756
|
+
],
|
|
3757
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3758
|
+
reactNative.Text,
|
|
3759
|
+
{
|
|
3760
|
+
style: [styles17.bannerBtnText, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
3761
|
+
children: text
|
|
3762
|
+
}
|
|
3763
|
+
)
|
|
3764
|
+
}
|
|
3765
|
+
);
|
|
3766
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3767
|
+
reactNative.View,
|
|
3768
|
+
{
|
|
3769
|
+
style: [
|
|
3770
|
+
styles17.banner,
|
|
3771
|
+
{ backgroundColor: theme.colors.surfaceAlt, borderColor: theme.colors.danger },
|
|
3772
|
+
style
|
|
3773
|
+
],
|
|
3774
|
+
accessibilityRole: "summary",
|
|
3775
|
+
accessibilityLabel: `${label}. ${meta}`,
|
|
3776
|
+
children: [
|
|
3777
|
+
/* @__PURE__ */ jsxRuntime.jsx(RecDot, {}),
|
|
3778
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles17.bannerText, children: [
|
|
3779
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3780
|
+
reactNative.Text,
|
|
3781
|
+
{
|
|
3782
|
+
style: [styles17.bannerTitle, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
3783
|
+
numberOfLines: 1,
|
|
3784
|
+
children: label
|
|
3785
|
+
}
|
|
3786
|
+
),
|
|
3787
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3788
|
+
reactNative.Text,
|
|
3789
|
+
{
|
|
3790
|
+
style: [
|
|
3791
|
+
styles17.bannerMeta,
|
|
3792
|
+
{ color: theme.colors.textMuted, fontFamily: theme.fonts.body }
|
|
3793
|
+
],
|
|
3794
|
+
numberOfLines: 2,
|
|
3795
|
+
children: meta
|
|
3796
|
+
}
|
|
3797
|
+
)
|
|
3798
|
+
] }),
|
|
3799
|
+
listenOnly && onChangeConsent ? button("Change", onChangeConsent) : null,
|
|
3800
|
+
recording && onStop ? button("Stop", onStop) : null
|
|
3801
|
+
]
|
|
3802
|
+
}
|
|
3803
|
+
);
|
|
3804
|
+
}
|
|
3805
|
+
function RecordingIndicator({
|
|
3806
|
+
recording,
|
|
3807
|
+
transcribing = false,
|
|
3808
|
+
mode,
|
|
3809
|
+
color,
|
|
3810
|
+
style
|
|
3811
|
+
}) {
|
|
3812
|
+
const theme = useTheme();
|
|
3813
|
+
const label = react$1.captureLabel(recording, transcribing, mode);
|
|
3814
|
+
if (!label) return null;
|
|
3815
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3816
|
+
reactNative.View,
|
|
3817
|
+
{
|
|
3818
|
+
style: [styles17.indicator, style],
|
|
3819
|
+
accessible: true,
|
|
3820
|
+
accessibilityRole: "image",
|
|
3821
|
+
accessibilityLabel: label,
|
|
3822
|
+
children: [
|
|
3823
|
+
/* @__PURE__ */ jsxRuntime.jsx(RecDot, {}),
|
|
3824
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3825
|
+
reactNative.Text,
|
|
3826
|
+
{
|
|
3827
|
+
style: [
|
|
3828
|
+
styles17.indicatorText,
|
|
3829
|
+
{ color: color ?? theme.colors.danger, fontFamily: theme.fonts.body }
|
|
3830
|
+
],
|
|
3831
|
+
children: recording ? "REC" : "Transcript"
|
|
3832
|
+
}
|
|
3833
|
+
)
|
|
3834
|
+
]
|
|
3835
|
+
}
|
|
3836
|
+
);
|
|
3837
|
+
}
|
|
3838
|
+
function ConsentPrompt({
|
|
3839
|
+
recording,
|
|
3840
|
+
transcribing = false,
|
|
3841
|
+
mode,
|
|
3842
|
+
startedByName,
|
|
3843
|
+
onAnswer,
|
|
3844
|
+
onAccepted,
|
|
3845
|
+
onDeclined,
|
|
3846
|
+
pending = false,
|
|
3847
|
+
error,
|
|
3848
|
+
overlay = true,
|
|
3849
|
+
style
|
|
3850
|
+
}) {
|
|
3851
|
+
const theme = useTheme();
|
|
3852
|
+
const [busy, setBusy] = react.useState(false);
|
|
3853
|
+
const [failed, setFailed] = react.useState(false);
|
|
3854
|
+
const what = recording && transcribing ? "recorded and transcribed" : recording ? mode === "audio" ? "recorded (audio)" : "recorded" : "transcribed";
|
|
3855
|
+
const title = `This call is being ${what}`;
|
|
3856
|
+
react.useEffect(() => {
|
|
3857
|
+
reactNative.AccessibilityInfo.announceForAccessibility?.(title);
|
|
3858
|
+
}, [title]);
|
|
3859
|
+
const answer = async (decision) => {
|
|
3860
|
+
setBusy(true);
|
|
3861
|
+
setFailed(false);
|
|
3862
|
+
try {
|
|
3863
|
+
const ok = await onAnswer(decision);
|
|
3864
|
+
if (ok === false) {
|
|
3865
|
+
setFailed(true);
|
|
3866
|
+
return;
|
|
3867
|
+
}
|
|
3868
|
+
if (decision === "accepted") onAccepted?.();
|
|
3869
|
+
else onDeclined?.();
|
|
3870
|
+
} catch {
|
|
3871
|
+
setFailed(true);
|
|
3872
|
+
} finally {
|
|
3873
|
+
setBusy(false);
|
|
3874
|
+
}
|
|
3875
|
+
};
|
|
3876
|
+
const disabled = busy || pending;
|
|
3877
|
+
const shownError = error ?? (failed ? "That didn\u2019t go through. Try again." : null);
|
|
3878
|
+
const card = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3879
|
+
reactNative.View,
|
|
3880
|
+
{
|
|
3881
|
+
style: [
|
|
3882
|
+
styles17.card,
|
|
3883
|
+
{ backgroundColor: theme.colors.surface, borderColor: theme.colors.border },
|
|
3884
|
+
!overlay && style
|
|
3885
|
+
],
|
|
3886
|
+
accessibilityViewIsModal: overlay,
|
|
3887
|
+
children: [
|
|
3888
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles17.cardHead, children: [
|
|
3889
|
+
/* @__PURE__ */ jsxRuntime.jsx(RecDot, {}),
|
|
3890
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3891
|
+
reactNative.Text,
|
|
3892
|
+
{
|
|
3893
|
+
style: [styles17.cardTitle, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
3894
|
+
accessibilityRole: "header",
|
|
3895
|
+
children: title
|
|
3896
|
+
}
|
|
3897
|
+
)
|
|
3898
|
+
] }),
|
|
3899
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3900
|
+
reactNative.Text,
|
|
3901
|
+
{
|
|
3902
|
+
style: [styles17.cardBody, { color: theme.colors.textMuted, fontFamily: theme.fonts.body }],
|
|
3903
|
+
children: [
|
|
3904
|
+
startedByName ? `${startedByName} started it. ` : "",
|
|
3905
|
+
"Your microphone and camera stay off until you agree. You can still hear and see everyone."
|
|
3906
|
+
]
|
|
3907
|
+
}
|
|
3908
|
+
),
|
|
3909
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles17.cardActions, children: [
|
|
3910
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3911
|
+
reactNative.Pressable,
|
|
3912
|
+
{
|
|
3913
|
+
onPress: () => void answer("declined"),
|
|
3914
|
+
disabled,
|
|
3915
|
+
accessibilityRole: "button",
|
|
3916
|
+
accessibilityLabel: "Stay listen-only",
|
|
3917
|
+
style: ({ pressed }) => [
|
|
3918
|
+
styles17.cardBtn,
|
|
3919
|
+
{ backgroundColor: theme.colors.surfaceAlt, borderColor: theme.colors.border },
|
|
3920
|
+
(pressed || disabled) && styles17.pressed
|
|
3921
|
+
],
|
|
3922
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3923
|
+
reactNative.Text,
|
|
3924
|
+
{
|
|
3925
|
+
style: [styles17.cardBtnText, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
3926
|
+
children: "Stay listen-only"
|
|
3927
|
+
}
|
|
3928
|
+
)
|
|
3929
|
+
}
|
|
3930
|
+
),
|
|
3931
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3932
|
+
reactNative.Pressable,
|
|
3933
|
+
{
|
|
3934
|
+
onPress: () => void answer("accepted"),
|
|
3935
|
+
disabled,
|
|
3936
|
+
accessibilityRole: "button",
|
|
3937
|
+
accessibilityLabel: "Agree to be recorded",
|
|
3938
|
+
style: ({ pressed }) => [
|
|
3939
|
+
styles17.cardBtn,
|
|
3940
|
+
{ backgroundColor: theme.colors.accent, borderColor: theme.colors.accent },
|
|
3941
|
+
(pressed || disabled) && styles17.pressed
|
|
3942
|
+
],
|
|
3943
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3944
|
+
reactNative.Text,
|
|
3945
|
+
{
|
|
3946
|
+
style: [
|
|
3947
|
+
styles17.cardBtnText,
|
|
3948
|
+
{ color: theme.colors.accentText, fontFamily: theme.fonts.body }
|
|
3949
|
+
],
|
|
3950
|
+
children: "Agree"
|
|
3951
|
+
}
|
|
3952
|
+
)
|
|
3953
|
+
}
|
|
3954
|
+
)
|
|
3955
|
+
] }),
|
|
3956
|
+
shownError ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3957
|
+
reactNative.Text,
|
|
3958
|
+
{
|
|
3959
|
+
style: [styles17.cardError, { color: theme.colors.danger, fontFamily: theme.fonts.body }],
|
|
3960
|
+
accessibilityLiveRegion: "assertive",
|
|
3961
|
+
children: shownError
|
|
3962
|
+
}
|
|
3963
|
+
) : null
|
|
3964
|
+
]
|
|
3965
|
+
}
|
|
3966
|
+
);
|
|
3967
|
+
if (!overlay) return card;
|
|
3968
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles17.scrim, { backgroundColor: theme.colors.overlay }, style], children: card });
|
|
3969
|
+
}
|
|
3970
|
+
function RecordingNoticeRow({ msg, meId, nameFor }) {
|
|
3971
|
+
const theme = useTheme();
|
|
3972
|
+
const display = react$1.recordingNoticeDisplayFor(msg, meId, nameFor);
|
|
3973
|
+
if (!display) return null;
|
|
3974
|
+
const time = formatTime2(msg.inserted_at);
|
|
3975
|
+
const label = [display.title, display.detail, time].filter(Boolean).join(", ");
|
|
3976
|
+
const metaStyle = [styles17.meta, { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }];
|
|
3977
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles17.noticeWrap, accessible: true, accessibilityLabel: label, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3978
|
+
reactNative.View,
|
|
3979
|
+
{
|
|
3980
|
+
style: [
|
|
3981
|
+
styles17.chip,
|
|
3982
|
+
{ backgroundColor: theme.colors.surfaceAlt, borderColor: theme.colors.border }
|
|
3983
|
+
],
|
|
3984
|
+
children: [
|
|
3985
|
+
/* @__PURE__ */ jsxRuntime.jsx(RecDot, { off: display.event === "stopped" }),
|
|
3986
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3987
|
+
reactNative.Text,
|
|
3988
|
+
{
|
|
3989
|
+
style: [
|
|
3990
|
+
styles17.chipTitle,
|
|
3991
|
+
{ color: theme.colors.textMuted, fontFamily: theme.fonts.body }
|
|
3992
|
+
],
|
|
3993
|
+
numberOfLines: 1,
|
|
3994
|
+
children: display.title
|
|
3995
|
+
}
|
|
3996
|
+
),
|
|
3997
|
+
display.detail ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: metaStyle, numberOfLines: 1, children: [
|
|
3998
|
+
"\xB7 ",
|
|
3999
|
+
display.detail
|
|
4000
|
+
] }) : null,
|
|
4001
|
+
time ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: metaStyle, children: [
|
|
4002
|
+
"\xB7 ",
|
|
4003
|
+
time
|
|
4004
|
+
] }) : null
|
|
4005
|
+
]
|
|
4006
|
+
}
|
|
4007
|
+
) });
|
|
4008
|
+
}
|
|
4009
|
+
function formatTime2(iso) {
|
|
4010
|
+
const d = new Date(iso);
|
|
4011
|
+
if (Number.isNaN(d.getTime())) return "";
|
|
4012
|
+
return d.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
|
|
4013
|
+
}
|
|
4014
|
+
var styles17 = reactNative.StyleSheet.create({
|
|
4015
|
+
dot: { width: 8, height: 8, borderRadius: 4 },
|
|
4016
|
+
pressed: { opacity: 0.6 },
|
|
4017
|
+
banner: {
|
|
4018
|
+
flexDirection: "row",
|
|
4019
|
+
alignItems: "center",
|
|
4020
|
+
gap: 10,
|
|
4021
|
+
paddingHorizontal: 12,
|
|
4022
|
+
paddingVertical: 6,
|
|
4023
|
+
borderBottomWidth: reactNative.StyleSheet.hairlineWidth
|
|
4024
|
+
},
|
|
4025
|
+
bannerText: { flex: 1, minWidth: 0 },
|
|
4026
|
+
bannerTitle: { fontSize: 13, fontWeight: "600" },
|
|
4027
|
+
bannerMeta: { fontSize: 12, fontWeight: "500" },
|
|
4028
|
+
bannerBtn: {
|
|
4029
|
+
paddingHorizontal: 12,
|
|
4030
|
+
paddingVertical: 4,
|
|
4031
|
+
borderRadius: 999,
|
|
4032
|
+
borderWidth: reactNative.StyleSheet.hairlineWidth
|
|
4033
|
+
},
|
|
4034
|
+
bannerBtnText: { fontSize: 12, fontWeight: "600" },
|
|
4035
|
+
indicator: {
|
|
4036
|
+
flexDirection: "row",
|
|
4037
|
+
alignItems: "center",
|
|
4038
|
+
gap: 6,
|
|
4039
|
+
paddingHorizontal: 8,
|
|
4040
|
+
paddingVertical: 2,
|
|
4041
|
+
borderRadius: 999
|
|
4042
|
+
},
|
|
4043
|
+
indicatorText: { fontSize: 11, fontWeight: "700", letterSpacing: 0.4 },
|
|
4044
|
+
scrim: {
|
|
4045
|
+
...reactNative.StyleSheet.absoluteFillObject,
|
|
4046
|
+
zIndex: 20,
|
|
4047
|
+
alignItems: "center",
|
|
4048
|
+
justifyContent: "center",
|
|
4049
|
+
padding: 16
|
|
4050
|
+
},
|
|
4051
|
+
card: {
|
|
4052
|
+
width: "100%",
|
|
4053
|
+
maxWidth: 380,
|
|
4054
|
+
padding: 18,
|
|
4055
|
+
borderRadius: 16,
|
|
4056
|
+
borderWidth: reactNative.StyleSheet.hairlineWidth
|
|
4057
|
+
},
|
|
4058
|
+
cardHead: { flexDirection: "row", alignItems: "center", gap: 10 },
|
|
4059
|
+
cardTitle: { flex: 1, fontSize: 16, fontWeight: "700" },
|
|
4060
|
+
cardBody: { marginTop: 8, marginBottom: 16, fontSize: 14, lineHeight: 20 },
|
|
4061
|
+
cardActions: { flexDirection: "row", flexWrap: "wrap", justifyContent: "flex-end", gap: 8 },
|
|
4062
|
+
cardBtn: {
|
|
4063
|
+
paddingHorizontal: 16,
|
|
4064
|
+
paddingVertical: 10,
|
|
4065
|
+
borderRadius: 999,
|
|
4066
|
+
borderWidth: reactNative.StyleSheet.hairlineWidth
|
|
4067
|
+
},
|
|
4068
|
+
cardBtnText: { fontSize: 14, fontWeight: "600" },
|
|
4069
|
+
cardError: { marginTop: 10, fontSize: 13, fontWeight: "500" },
|
|
4070
|
+
noticeWrap: {
|
|
4071
|
+
alignItems: "center",
|
|
4072
|
+
alignSelf: "stretch",
|
|
4073
|
+
marginVertical: 6,
|
|
4074
|
+
paddingHorizontal: 16
|
|
4075
|
+
},
|
|
4076
|
+
chip: {
|
|
4077
|
+
flexDirection: "row",
|
|
4078
|
+
alignItems: "center",
|
|
4079
|
+
gap: 6,
|
|
4080
|
+
maxWidth: "100%",
|
|
4081
|
+
paddingHorizontal: 12,
|
|
4082
|
+
paddingVertical: 4,
|
|
4083
|
+
borderRadius: 999,
|
|
4084
|
+
borderWidth: reactNative.StyleSheet.hairlineWidth
|
|
4085
|
+
},
|
|
4086
|
+
chipTitle: { fontSize: 11, fontWeight: "600", letterSpacing: 0.3, flexShrink: 1 },
|
|
4087
|
+
meta: { fontSize: 11, fontWeight: "500", letterSpacing: 0.3, flexShrink: 1 }
|
|
4088
|
+
});
|
|
3622
4089
|
var forbidden = /* @__PURE__ */ new Set();
|
|
3623
4090
|
function canShowEditHistory(messageId) {
|
|
3624
4091
|
return !forbidden.has(messageId);
|
|
@@ -3659,12 +4126,12 @@ function EditHistorySheet({
|
|
|
3659
4126
|
live = false;
|
|
3660
4127
|
};
|
|
3661
4128
|
}, [visible, messageId, chat]);
|
|
3662
|
-
const entry = (key, label, body, when) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
3663
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
3664
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3665
|
-
when ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4129
|
+
const entry = (key, label, body, when) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles18.entry, { borderBottomColor: theme.colors.border }], children: [
|
|
4130
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles18.entryHead, children: [
|
|
4131
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles18.entryLabel, { color: theme.colors.textMuted }], children: label }),
|
|
4132
|
+
when ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles18.entryTime, { color: theme.colors.textSubtle }], children: when }) : null
|
|
3666
4133
|
] }),
|
|
3667
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4134
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles18.entryBody, { color: theme.colors.text, fontFamily: theme.fonts.body }], children: body ?? "\u2014" })
|
|
3668
4135
|
] }, key);
|
|
3669
4136
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3670
4137
|
reactNative.Modal,
|
|
@@ -3677,14 +4144,14 @@ function EditHistorySheet({
|
|
|
3677
4144
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3678
4145
|
reactNative.Pressable,
|
|
3679
4146
|
{
|
|
3680
|
-
style: [
|
|
4147
|
+
style: [styles18.backdrop, { backgroundColor: theme.colors.overlay }],
|
|
3681
4148
|
onPress: onClose,
|
|
3682
4149
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3683
4150
|
reactNative.Pressable,
|
|
3684
4151
|
{
|
|
3685
4152
|
onPress: () => void 0,
|
|
3686
4153
|
style: [
|
|
3687
|
-
|
|
4154
|
+
styles18.sheet,
|
|
3688
4155
|
{
|
|
3689
4156
|
backgroundColor: theme.colors.surface,
|
|
3690
4157
|
borderTopLeftRadius: theme.radii.lg,
|
|
@@ -3699,12 +4166,12 @@ function EditHistorySheet({
|
|
|
3699
4166
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3700
4167
|
reactNative.Text,
|
|
3701
4168
|
{
|
|
3702
|
-
style: [
|
|
4169
|
+
style: [styles18.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
|
|
3703
4170
|
accessibilityRole: "header",
|
|
3704
4171
|
children: "Edit history"
|
|
3705
4172
|
}
|
|
3706
4173
|
),
|
|
3707
|
-
failed ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4174
|
+
failed ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles18.status, { color: theme.colors.textMuted }], children: "Couldn't load the earlier versions." }) : edits === null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.accent, style: styles18.spinner }) : /* @__PURE__ */ jsxRuntime.jsxs(reactNative.ScrollView, { style: styles18.scroll, children: [
|
|
3708
4175
|
currentBody !== void 0 ? entry("current", "Current", currentBody, "") : null,
|
|
3709
4176
|
edits.map(
|
|
3710
4177
|
(e) => entry(
|
|
@@ -3714,7 +4181,7 @@ function EditHistorySheet({
|
|
|
3714
4181
|
relativeTime(e.written_at)
|
|
3715
4182
|
)
|
|
3716
4183
|
),
|
|
3717
|
-
edits.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4184
|
+
edits.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles18.status, { color: theme.colors.textMuted }], children: "No earlier versions." }) : null
|
|
3718
4185
|
] })
|
|
3719
4186
|
]
|
|
3720
4187
|
}
|
|
@@ -3724,7 +4191,7 @@ function EditHistorySheet({
|
|
|
3724
4191
|
}
|
|
3725
4192
|
);
|
|
3726
4193
|
}
|
|
3727
|
-
var
|
|
4194
|
+
var styles18 = reactNative.StyleSheet.create({
|
|
3728
4195
|
backdrop: {
|
|
3729
4196
|
flex: 1,
|
|
3730
4197
|
justifyContent: "flex-end"
|
|
@@ -3802,7 +4269,7 @@ function AttachmentPreview({
|
|
|
3802
4269
|
reactNative.View,
|
|
3803
4270
|
{
|
|
3804
4271
|
style: [
|
|
3805
|
-
|
|
4272
|
+
styles19.imagePlaceholder,
|
|
3806
4273
|
{
|
|
3807
4274
|
width: maxWidth,
|
|
3808
4275
|
height: 200,
|
|
@@ -3822,7 +4289,7 @@ function AttachmentPreview({
|
|
|
3822
4289
|
onPress,
|
|
3823
4290
|
disabled: !onPress,
|
|
3824
4291
|
style: [
|
|
3825
|
-
|
|
4292
|
+
styles19.fileCard,
|
|
3826
4293
|
{
|
|
3827
4294
|
backgroundColor: onBrand ? "rgba(255,255,255,0.18)" : theme.colors.surfaceAlt,
|
|
3828
4295
|
borderColor: onBrand ? "transparent" : theme.colors.border,
|
|
@@ -3835,12 +4302,12 @@ function AttachmentPreview({
|
|
|
3835
4302
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3836
4303
|
reactNative.Text,
|
|
3837
4304
|
{
|
|
3838
|
-
style: [
|
|
4305
|
+
style: [styles19.fileName, { color: ink, fontFamily: theme.fonts.body }],
|
|
3839
4306
|
numberOfLines: 1,
|
|
3840
4307
|
children: attachment.original_filename ?? "file"
|
|
3841
4308
|
}
|
|
3842
4309
|
),
|
|
3843
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4310
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles19.fileSize, { color: inkSoft, opacity: onBrand ? 0.8 : 1 }], children: formatBytes3(attachment.byte_size) })
|
|
3844
4311
|
] })
|
|
3845
4312
|
]
|
|
3846
4313
|
}
|
|
@@ -3852,7 +4319,7 @@ function formatBytes3(n) {
|
|
|
3852
4319
|
if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
3853
4320
|
return `${(n / 1024 / 1024 / 1024).toFixed(1)} GB`;
|
|
3854
4321
|
}
|
|
3855
|
-
var
|
|
4322
|
+
var styles19 = reactNative.StyleSheet.create({
|
|
3856
4323
|
imagePlaceholder: {},
|
|
3857
4324
|
fileCard: {
|
|
3858
4325
|
flexDirection: "row",
|
|
@@ -3888,7 +4355,7 @@ function ImageMosaic({
|
|
|
3888
4355
|
reactNative.View,
|
|
3889
4356
|
{
|
|
3890
4357
|
style: [
|
|
3891
|
-
|
|
4358
|
+
styles20.root,
|
|
3892
4359
|
{
|
|
3893
4360
|
borderTopLeftRadius: r,
|
|
3894
4361
|
borderTopRightRadius: r,
|
|
@@ -3909,18 +4376,18 @@ function ImageMosaic({
|
|
|
3909
4376
|
{
|
|
3910
4377
|
onLongPress,
|
|
3911
4378
|
attachment: visible[0],
|
|
3912
|
-
style:
|
|
4379
|
+
style: styles20.tileFull,
|
|
3913
4380
|
onPress: () => setViewerIndex(0),
|
|
3914
4381
|
overlay: null
|
|
3915
4382
|
}
|
|
3916
4383
|
) : null,
|
|
3917
|
-
n === 2 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4384
|
+
n === 2 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles20.rowEven, children: [
|
|
3918
4385
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3919
4386
|
Tile,
|
|
3920
4387
|
{
|
|
3921
4388
|
onLongPress,
|
|
3922
4389
|
attachment: visible[0],
|
|
3923
|
-
style:
|
|
4390
|
+
style: styles20.tileHalfSquare,
|
|
3924
4391
|
onPress: () => setViewerIndex(0),
|
|
3925
4392
|
overlay: null
|
|
3926
4393
|
}
|
|
@@ -3930,7 +4397,7 @@ function ImageMosaic({
|
|
|
3930
4397
|
{
|
|
3931
4398
|
onLongPress,
|
|
3932
4399
|
attachment: visible[1],
|
|
3933
|
-
style:
|
|
4400
|
+
style: styles20.tileHalfSquare,
|
|
3934
4401
|
onPress: () => setViewerIndex(1),
|
|
3935
4402
|
overlay: null
|
|
3936
4403
|
}
|
|
@@ -3942,18 +4409,18 @@ function ImageMosaic({
|
|
|
3942
4409
|
{
|
|
3943
4410
|
onLongPress,
|
|
3944
4411
|
attachment: visible[0],
|
|
3945
|
-
style:
|
|
4412
|
+
style: styles20.tileHero,
|
|
3946
4413
|
onPress: () => setViewerIndex(0),
|
|
3947
4414
|
overlay: null
|
|
3948
4415
|
}
|
|
3949
4416
|
),
|
|
3950
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
4417
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles20.rowEven, { marginTop: 2 }], children: [
|
|
3951
4418
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3952
4419
|
Tile,
|
|
3953
4420
|
{
|
|
3954
4421
|
onLongPress,
|
|
3955
4422
|
attachment: visible[1],
|
|
3956
|
-
style:
|
|
4423
|
+
style: styles20.tileHalfSquare,
|
|
3957
4424
|
onPress: () => setViewerIndex(1),
|
|
3958
4425
|
overlay: null
|
|
3959
4426
|
}
|
|
@@ -3963,7 +4430,7 @@ function ImageMosaic({
|
|
|
3963
4430
|
{
|
|
3964
4431
|
onLongPress,
|
|
3965
4432
|
attachment: visible[2],
|
|
3966
|
-
style:
|
|
4433
|
+
style: styles20.tileHalfSquare,
|
|
3967
4434
|
onPress: () => setViewerIndex(2),
|
|
3968
4435
|
overlay: null
|
|
3969
4436
|
}
|
|
@@ -3971,13 +4438,13 @@ function ImageMosaic({
|
|
|
3971
4438
|
] })
|
|
3972
4439
|
] }) : null,
|
|
3973
4440
|
n === 4 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3974
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4441
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles20.rowEven, children: [
|
|
3975
4442
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3976
4443
|
Tile,
|
|
3977
4444
|
{
|
|
3978
4445
|
onLongPress,
|
|
3979
4446
|
attachment: visible[0],
|
|
3980
|
-
style:
|
|
4447
|
+
style: styles20.tileHalfSquare,
|
|
3981
4448
|
onPress: () => setViewerIndex(0),
|
|
3982
4449
|
overlay: null
|
|
3983
4450
|
}
|
|
@@ -3987,19 +4454,19 @@ function ImageMosaic({
|
|
|
3987
4454
|
{
|
|
3988
4455
|
onLongPress,
|
|
3989
4456
|
attachment: visible[1],
|
|
3990
|
-
style:
|
|
4457
|
+
style: styles20.tileHalfSquare,
|
|
3991
4458
|
onPress: () => setViewerIndex(1),
|
|
3992
4459
|
overlay: null
|
|
3993
4460
|
}
|
|
3994
4461
|
)
|
|
3995
4462
|
] }),
|
|
3996
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
4463
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles20.rowEven, { marginTop: 2 }], children: [
|
|
3997
4464
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3998
4465
|
Tile,
|
|
3999
4466
|
{
|
|
4000
4467
|
onLongPress,
|
|
4001
4468
|
attachment: visible[2],
|
|
4002
|
-
style:
|
|
4469
|
+
style: styles20.tileHalfSquare,
|
|
4003
4470
|
onPress: () => setViewerIndex(2),
|
|
4004
4471
|
overlay: null
|
|
4005
4472
|
}
|
|
@@ -4009,7 +4476,7 @@ function ImageMosaic({
|
|
|
4009
4476
|
{
|
|
4010
4477
|
onLongPress,
|
|
4011
4478
|
attachment: visible[3],
|
|
4012
|
-
style:
|
|
4479
|
+
style: styles20.tileHalfSquare,
|
|
4013
4480
|
onPress: () => setViewerIndex(3),
|
|
4014
4481
|
overlay: overflow > 0 ? `+${overflow}` : null
|
|
4015
4482
|
}
|
|
@@ -4047,18 +4514,18 @@ function Tile({
|
|
|
4047
4514
|
}) {
|
|
4048
4515
|
const theme = useTheme();
|
|
4049
4516
|
const { url } = react$1.useAttachmentUrl(attachment.id);
|
|
4050
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress, onLongPress, style: [
|
|
4517
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress, onLongPress, style: [styles20.tileBase, style], children: [
|
|
4051
4518
|
url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4052
4519
|
reactNative.Image,
|
|
4053
4520
|
{
|
|
4054
4521
|
source: { uri: url },
|
|
4055
|
-
style: [
|
|
4522
|
+
style: [styles20.tileImage, { backgroundColor: theme.colors.surfaceAlt }],
|
|
4056
4523
|
resizeMode: "cover",
|
|
4057
4524
|
accessible: true,
|
|
4058
4525
|
accessibilityLabel: attachment.original_filename ?? "image"
|
|
4059
4526
|
}
|
|
4060
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
4061
|
-
overlay ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
4527
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles20.tileImage, { backgroundColor: theme.colors.surfaceAlt }] }),
|
|
4528
|
+
overlay ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles20.overflow, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles20.overflowText, children: overlay }) }) : null
|
|
4062
4529
|
] });
|
|
4063
4530
|
}
|
|
4064
4531
|
function FullScreenViewer({
|
|
@@ -4068,7 +4535,7 @@ function FullScreenViewer({
|
|
|
4068
4535
|
const { url } = react$1.useAttachmentUrl(attachment.id);
|
|
4069
4536
|
const { width, height } = reactNative.useWindowDimensions();
|
|
4070
4537
|
const insets = useSafeInsets();
|
|
4071
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style:
|
|
4538
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles20.viewer, onPress: onClose, children: [
|
|
4072
4539
|
url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4073
4540
|
reactNative.Image,
|
|
4074
4541
|
{
|
|
@@ -4084,14 +4551,14 @@ function FullScreenViewer({
|
|
|
4084
4551
|
{
|
|
4085
4552
|
onPress: onClose,
|
|
4086
4553
|
hitSlop: 12,
|
|
4087
|
-
style: [
|
|
4554
|
+
style: [styles20.closeBtn, { top: insets.top + 12, right: insets.right + 16 }],
|
|
4088
4555
|
accessibilityLabel: "Close viewer",
|
|
4089
4556
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 20, color: "#ffffff" })
|
|
4090
4557
|
}
|
|
4091
4558
|
)
|
|
4092
4559
|
] });
|
|
4093
4560
|
}
|
|
4094
|
-
var
|
|
4561
|
+
var styles20 = reactNative.StyleSheet.create({
|
|
4095
4562
|
root: {
|
|
4096
4563
|
width: "100%",
|
|
4097
4564
|
overflow: "hidden",
|
|
@@ -4264,7 +4731,7 @@ function LinkPreviewCard({
|
|
|
4264
4731
|
{
|
|
4265
4732
|
onPress: onRemove,
|
|
4266
4733
|
hitSlop: 8,
|
|
4267
|
-
style: [
|
|
4734
|
+
style: [styles21.remove, { backgroundColor: theme.colors.overlay }],
|
|
4268
4735
|
accessibilityRole: "button",
|
|
4269
4736
|
accessibilityLabel: "Remove preview",
|
|
4270
4737
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 12, color: "#FFFFFF", label: null })
|
|
@@ -4280,13 +4747,13 @@ function LinkPreviewCard({
|
|
|
4280
4747
|
...onLongPress ? { onLongPress } : {},
|
|
4281
4748
|
accessibilityRole: "link",
|
|
4282
4749
|
accessibilityLabel: preview.title || "Image link",
|
|
4283
|
-
style: [
|
|
4750
|
+
style: [styles21.imageOnly, { maxWidth, borderRadius: theme.radii.md }],
|
|
4284
4751
|
children: [
|
|
4285
4752
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4286
4753
|
reactNative.Image,
|
|
4287
4754
|
{
|
|
4288
4755
|
source: { uri: src },
|
|
4289
|
-
style: [
|
|
4756
|
+
style: [styles21.inlineImage, { borderRadius: theme.radii.md }],
|
|
4290
4757
|
resizeMode: "cover",
|
|
4291
4758
|
onError: () => setImageFailed(true),
|
|
4292
4759
|
accessible: false
|
|
@@ -4306,7 +4773,7 @@ function LinkPreviewCard({
|
|
|
4306
4773
|
accessibilityRole: "link",
|
|
4307
4774
|
accessibilityLabel: [site, preview.title].filter(Boolean).join(": ") || preview.url,
|
|
4308
4775
|
style: ({ pressed }) => [
|
|
4309
|
-
|
|
4776
|
+
styles21.card,
|
|
4310
4777
|
{
|
|
4311
4778
|
maxWidth,
|
|
4312
4779
|
borderRadius: theme.radii.md,
|
|
@@ -4321,7 +4788,7 @@ function LinkPreviewCard({
|
|
|
4321
4788
|
{
|
|
4322
4789
|
source: { uri: preview.image_url },
|
|
4323
4790
|
style: [
|
|
4324
|
-
|
|
4791
|
+
styles21.cardImage,
|
|
4325
4792
|
{ borderTopLeftRadius: theme.radii.md, borderTopRightRadius: theme.radii.md }
|
|
4326
4793
|
],
|
|
4327
4794
|
resizeMode: "cover",
|
|
@@ -4329,13 +4796,13 @@ function LinkPreviewCard({
|
|
|
4329
4796
|
accessible: false
|
|
4330
4797
|
}
|
|
4331
4798
|
) : null,
|
|
4332
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
4333
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4799
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles21.cardBody, { padding: theme.spacing.sm, gap: 2 }], children: [
|
|
4800
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles21.siteLine, children: [
|
|
4334
4801
|
preview.favicon_url && !faviconFailed ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4335
4802
|
reactNative.Image,
|
|
4336
4803
|
{
|
|
4337
4804
|
source: { uri: preview.favicon_url },
|
|
4338
|
-
style:
|
|
4805
|
+
style: styles21.favicon,
|
|
4339
4806
|
onError: () => setFaviconFailed(true),
|
|
4340
4807
|
accessible: false
|
|
4341
4808
|
}
|
|
@@ -4343,7 +4810,7 @@ function LinkPreviewCard({
|
|
|
4343
4810
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4344
4811
|
reactNative.Text,
|
|
4345
4812
|
{
|
|
4346
|
-
style: [
|
|
4813
|
+
style: [styles21.site, { color: muted, fontFamily: theme.fonts.body }],
|
|
4347
4814
|
numberOfLines: 1,
|
|
4348
4815
|
children: site
|
|
4349
4816
|
}
|
|
@@ -4353,7 +4820,7 @@ function LinkPreviewCard({
|
|
|
4353
4820
|
reactNative.Text,
|
|
4354
4821
|
{
|
|
4355
4822
|
style: [
|
|
4356
|
-
|
|
4823
|
+
styles21.title,
|
|
4357
4824
|
{ color: onBrand ? text : theme.colors.link, fontFamily: theme.fonts.body }
|
|
4358
4825
|
],
|
|
4359
4826
|
numberOfLines: 2,
|
|
@@ -4363,7 +4830,7 @@ function LinkPreviewCard({
|
|
|
4363
4830
|
preview.description ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4364
4831
|
reactNative.Text,
|
|
4365
4832
|
{
|
|
4366
|
-
style: [
|
|
4833
|
+
style: [styles21.description, { color: muted, fontFamily: theme.fonts.body }],
|
|
4367
4834
|
numberOfLines: 2,
|
|
4368
4835
|
children: preview.description
|
|
4369
4836
|
}
|
|
@@ -4378,7 +4845,7 @@ function hostOf(url) {
|
|
|
4378
4845
|
const m = /^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i.exec(url);
|
|
4379
4846
|
return (m?.[1] ?? url).replace(/^www\./, "");
|
|
4380
4847
|
}
|
|
4381
|
-
var
|
|
4848
|
+
var styles21 = reactNative.StyleSheet.create({
|
|
4382
4849
|
card: {
|
|
4383
4850
|
alignSelf: "stretch",
|
|
4384
4851
|
borderLeftWidth: 3,
|
|
@@ -4485,7 +4952,7 @@ function MessageBubble({
|
|
|
4485
4952
|
const isEdited = !!message.edited_at && !isDeleted;
|
|
4486
4953
|
const trimmable = maxBodyLength > 0 && body.length > maxBodyLength;
|
|
4487
4954
|
const truncated = trimmable && !expanded ? body.slice(0, maxBodyLength) + "\u2026" : body;
|
|
4488
|
-
const time =
|
|
4955
|
+
const time = formatTime3(message.inserted_at, timeFormat);
|
|
4489
4956
|
const images = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
|
|
4490
4957
|
const files = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
|
|
4491
4958
|
const hasMedia = images.length > 0;
|
|
@@ -4504,16 +4971,16 @@ function MessageBubble({
|
|
|
4504
4971
|
reactNative.View,
|
|
4505
4972
|
{
|
|
4506
4973
|
style: [
|
|
4507
|
-
|
|
4508
|
-
variant === "inline" &&
|
|
4509
|
-
variant === "inline" && dense &&
|
|
4510
|
-
variant === "wrapped" &&
|
|
4511
|
-
variant === "overlay" &&
|
|
4512
|
-
variant === "block" &&
|
|
4974
|
+
styles22.metaRow,
|
|
4975
|
+
variant === "inline" && styles22.metaInline,
|
|
4976
|
+
variant === "inline" && dense && styles22.metaInlineDense,
|
|
4977
|
+
variant === "wrapped" && styles22.metaWrapped,
|
|
4978
|
+
variant === "overlay" && styles22.metaOverlay,
|
|
4979
|
+
variant === "block" && styles22.metaBlock,
|
|
4513
4980
|
// File-only bubble: the meta row follows the cards directly —
|
|
4514
4981
|
// give it air so the time doesn't sit glued to the card.
|
|
4515
|
-
variant === "block" && hasFiles && !hasBody &&
|
|
4516
|
-
variant === "jumbo" &&
|
|
4982
|
+
variant === "block" && hasFiles && !hasBody && styles22.metaBlockAfterFiles,
|
|
4983
|
+
variant === "jumbo" && styles22.metaJumbo
|
|
4517
4984
|
],
|
|
4518
4985
|
onLayout: variant === "inline" || variant === "wrapped" ? (e) => setMetaWidth(e.nativeEvent.layout.width) : void 0,
|
|
4519
4986
|
pointerEvents: isEdited && onEditedPress ? "box-none" : "none",
|
|
@@ -4521,7 +4988,7 @@ function MessageBubble({
|
|
|
4521
4988
|
isEdited ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4522
4989
|
reactNative.Text,
|
|
4523
4990
|
{
|
|
4524
|
-
style: [
|
|
4991
|
+
style: [styles22.editedTag, { color, opacity: 0.8 }],
|
|
4525
4992
|
...onEditedPress ? {
|
|
4526
4993
|
onPress: onEditedPress,
|
|
4527
4994
|
suppressHighlighting: true,
|
|
@@ -4532,8 +4999,8 @@ function MessageBubble({
|
|
|
4532
4999
|
children: "edited"
|
|
4533
5000
|
}
|
|
4534
5001
|
) : null,
|
|
4535
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4536
|
-
isSelf && readState ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5002
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles22.meta, { color, opacity: variant === "overlay" ? 1 : 0.75 }], children: time }),
|
|
5003
|
+
isSelf && readState ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles22.readTick, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4537
5004
|
PoolseIcon,
|
|
4538
5005
|
{
|
|
4539
5006
|
name: readState === "read" ? "check-double" : "check",
|
|
@@ -4549,7 +5016,7 @@ function MessageBubble({
|
|
|
4549
5016
|
reactNative.View,
|
|
4550
5017
|
{
|
|
4551
5018
|
style: [
|
|
4552
|
-
|
|
5019
|
+
styles22.wrap,
|
|
4553
5020
|
{ alignSelf: isSelf ? "flex-end" : "flex-start", maxWidth: bubbleMaxWidth }
|
|
4554
5021
|
],
|
|
4555
5022
|
children: [
|
|
@@ -4575,7 +5042,7 @@ function MessageBubble({
|
|
|
4575
5042
|
showSenderName && !isSelf && jumboCount === 0 && (groupPosition === "first" || groupPosition === "standalone") ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4576
5043
|
reactNative.Text,
|
|
4577
5044
|
{
|
|
4578
|
-
style: [
|
|
5045
|
+
style: [styles22.senderName, { color: senderTint, fontFamily: theme.fonts.body }],
|
|
4579
5046
|
...onSenderPress ? {
|
|
4580
5047
|
onPress: onSenderPress,
|
|
4581
5048
|
accessibilityRole: "button",
|
|
@@ -4602,7 +5069,7 @@ function MessageBubble({
|
|
|
4602
5069
|
// 3px of bubble color framing the picture; the mosaic clips
|
|
4603
5070
|
// itself 3px tighter than the bubble so the curves stay
|
|
4604
5071
|
// concentric.
|
|
4605
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5072
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles22.mediaFrame, children: [
|
|
4606
5073
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4607
5074
|
ImageMosaic,
|
|
4608
5075
|
{
|
|
@@ -4616,7 +5083,7 @@ function MessageBubble({
|
|
|
4616
5083
|
metaOverlay ? metaRow("overlay") : null
|
|
4617
5084
|
] })
|
|
4618
5085
|
) : null,
|
|
4619
|
-
hasFiles ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5086
|
+
hasFiles ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles22.filesBlock, children: files.map((att) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4620
5087
|
AttachmentPreview,
|
|
4621
5088
|
{
|
|
4622
5089
|
attachment: att,
|
|
@@ -4635,9 +5102,9 @@ function MessageBubble({
|
|
|
4635
5102
|
reactNative.View,
|
|
4636
5103
|
{
|
|
4637
5104
|
style: [
|
|
4638
|
-
|
|
4639
|
-
dense &&
|
|
4640
|
-
sectionAbove &&
|
|
5105
|
+
styles22.textBlock,
|
|
5106
|
+
dense && styles22.textBlockDense,
|
|
5107
|
+
sectionAbove && styles22.textBlockAfter
|
|
4641
5108
|
],
|
|
4642
5109
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4643
5110
|
reactNative.Text,
|
|
@@ -4655,7 +5122,7 @@ function MessageBubble({
|
|
|
4655
5122
|
)
|
|
4656
5123
|
}
|
|
4657
5124
|
) : null,
|
|
4658
|
-
hasBody && jumboCount > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5125
|
+
hasBody && jumboCount > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles22.jumboBlock, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4659
5126
|
reactNative.Text,
|
|
4660
5127
|
{
|
|
4661
5128
|
style: {
|
|
@@ -4669,9 +5136,9 @@ function MessageBubble({
|
|
|
4669
5136
|
reactNative.View,
|
|
4670
5137
|
{
|
|
4671
5138
|
style: [
|
|
4672
|
-
|
|
4673
|
-
dense &&
|
|
4674
|
-
sectionAbove &&
|
|
5139
|
+
styles22.textBlock,
|
|
5140
|
+
dense && styles22.textBlockDense,
|
|
5141
|
+
sectionAbove && styles22.textBlockAfter
|
|
4675
5142
|
],
|
|
4676
5143
|
onLayout: inlineMeta ? (e) => setTextBoxWidth(e.nativeEvent.layout.width - 24) : void 0,
|
|
4677
5144
|
children: [
|
|
@@ -4706,7 +5173,7 @@ function MessageBubble({
|
|
|
4706
5173
|
reactNative.Text,
|
|
4707
5174
|
{
|
|
4708
5175
|
style: [
|
|
4709
|
-
|
|
5176
|
+
styles22.readMore,
|
|
4710
5177
|
{ color: isSelf ? theme.colors.ownBubbleText : theme.colors.link }
|
|
4711
5178
|
],
|
|
4712
5179
|
children: expanded ? "Show less" : "Read more"
|
|
@@ -4721,7 +5188,7 @@ function MessageBubble({
|
|
|
4721
5188
|
hasPreviews ? (
|
|
4722
5189
|
// A fixed width, like media: a card squeezed into the width of
|
|
4723
5190
|
// a one-word message would be unreadable.
|
|
4724
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
5191
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles22.previews, !hasBody && styles22.previewsAlone, { width: mediaWidth }], children: previews.map((p) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4725
5192
|
LinkPreviewCard,
|
|
4726
5193
|
{
|
|
4727
5194
|
preview: p,
|
|
@@ -4733,7 +5200,7 @@ function MessageBubble({
|
|
|
4733
5200
|
)) })
|
|
4734
5201
|
) : null,
|
|
4735
5202
|
!inlineMeta && !metaOverlay && jumboCount === 0 ? metaRow("block") : null,
|
|
4736
|
-
actionsTrigger ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5203
|
+
actionsTrigger ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles22.actionsSlot, children: actionsTrigger }) : null
|
|
4737
5204
|
]
|
|
4738
5205
|
}
|
|
4739
5206
|
),
|
|
@@ -4760,15 +5227,15 @@ function QuotedCard({
|
|
|
4760
5227
|
onPress,
|
|
4761
5228
|
disabled: !onPress,
|
|
4762
5229
|
style: [
|
|
4763
|
-
|
|
5230
|
+
styles22.quoted,
|
|
4764
5231
|
{
|
|
4765
5232
|
backgroundColor: bg,
|
|
4766
5233
|
borderLeftColor: accent
|
|
4767
5234
|
}
|
|
4768
5235
|
],
|
|
4769
5236
|
children: [
|
|
4770
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4771
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
5237
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles22.quotedSender, { color: accent }], numberOfLines: 1, children: senderName }),
|
|
5238
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles22.quotedBody, { color: txt }], numberOfLines: 2, children: quoted.deleted_at ? "Original message deleted" : quoted.body ?? "\u2026" })
|
|
4772
5239
|
]
|
|
4773
5240
|
}
|
|
4774
5241
|
);
|
|
@@ -4777,7 +5244,7 @@ function isImageContentType(ct) {
|
|
|
4777
5244
|
if (!ct) return false;
|
|
4778
5245
|
return ct.startsWith("image/");
|
|
4779
5246
|
}
|
|
4780
|
-
function
|
|
5247
|
+
function formatTime3(iso, format2) {
|
|
4781
5248
|
try {
|
|
4782
5249
|
const d = new Date(iso);
|
|
4783
5250
|
if (typeof format2 === "function") return format2(d);
|
|
@@ -4801,7 +5268,7 @@ function formatTime2(iso, format2) {
|
|
|
4801
5268
|
function isSameDay(a, b) {
|
|
4802
5269
|
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
4803
5270
|
}
|
|
4804
|
-
var
|
|
5271
|
+
var styles22 = reactNative.StyleSheet.create({
|
|
4805
5272
|
wrap: {
|
|
4806
5273
|
marginBottom: 2
|
|
4807
5274
|
},
|
|
@@ -4928,6 +5395,24 @@ var styles20 = reactNative.StyleSheet.create({
|
|
|
4928
5395
|
opacity: 0.8
|
|
4929
5396
|
}
|
|
4930
5397
|
});
|
|
5398
|
+
|
|
5399
|
+
// src/internal/a11y.ts
|
|
5400
|
+
function messageA11yLabel(msg, senderName, isSelf) {
|
|
5401
|
+
const who = isSelf ? "You" : senderName;
|
|
5402
|
+
if (msg.deleted_at) return `${who}: message deleted`;
|
|
5403
|
+
const parts = [];
|
|
5404
|
+
const body = (msg.body ?? "").trim();
|
|
5405
|
+
if (body) parts.push(body.length > 300 ? `${body.slice(0, 300)}\u2026` : body);
|
|
5406
|
+
const files = Array.isArray(msg.attachments) ? msg.attachments.length : 0;
|
|
5407
|
+
if (files > 0) parts.push(files === 1 ? "1 attachment" : `${files} attachments`);
|
|
5408
|
+
if (msg.edited_at) parts.push("edited");
|
|
5409
|
+
if (msg.local_status === "queued") parts.push("waiting for network");
|
|
5410
|
+
if (msg.local_status === "failed") parts.push("not sent");
|
|
5411
|
+
return `${who}: ${parts.join(", ") || "message"}`;
|
|
5412
|
+
}
|
|
5413
|
+
function reactionA11yLabel(emoji, count, mine) {
|
|
5414
|
+
return `${emoji} ${count}${mine ? ", you reacted" : ""}`;
|
|
5415
|
+
}
|
|
4931
5416
|
var DEFAULT_EMOJIS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F389}", "\u{1F64F}", "\u{1F525}"];
|
|
4932
5417
|
function ReactionStrip({
|
|
4933
5418
|
messageId,
|
|
@@ -4944,7 +5429,7 @@ function ReactionStrip({
|
|
|
4944
5429
|
});
|
|
4945
5430
|
const entries = Object.entries(reactions);
|
|
4946
5431
|
if (entries.length === 0) return null;
|
|
4947
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5432
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles23.strip, children: [
|
|
4948
5433
|
entries.map(([emoji, userIds]) => {
|
|
4949
5434
|
const userArr = Array.isArray(userIds) ? userIds : [];
|
|
4950
5435
|
const meReacted = meId !== null && userArr.includes(meId);
|
|
@@ -4952,8 +5437,12 @@ function ReactionStrip({
|
|
|
4952
5437
|
reactNative.Pressable,
|
|
4953
5438
|
{
|
|
4954
5439
|
onPress: () => meReacted ? removeReaction(emoji) : addReaction(emoji),
|
|
5440
|
+
accessibilityRole: "button",
|
|
5441
|
+
accessibilityLabel: reactionA11yLabel(emoji, userArr.length, meReacted),
|
|
5442
|
+
accessibilityState: { selected: meReacted },
|
|
5443
|
+
accessibilityHint: meReacted ? "Removes your reaction" : "Adds this reaction",
|
|
4955
5444
|
style: [
|
|
4956
|
-
|
|
5445
|
+
styles23.chip,
|
|
4957
5446
|
{
|
|
4958
5447
|
backgroundColor: meReacted ? theme.colors.accentSoft : theme.colors.surfaceAlt,
|
|
4959
5448
|
borderColor: meReacted ? theme.colors.accent : theme.colors.border,
|
|
@@ -4962,12 +5451,12 @@ function ReactionStrip({
|
|
|
4962
5451
|
}
|
|
4963
5452
|
],
|
|
4964
5453
|
children: [
|
|
4965
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
5454
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles23.emoji, children: emoji }),
|
|
4966
5455
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4967
5456
|
reactNative.Text,
|
|
4968
5457
|
{
|
|
4969
5458
|
style: [
|
|
4970
|
-
|
|
5459
|
+
styles23.count,
|
|
4971
5460
|
{
|
|
4972
5461
|
color: meReacted ? theme.colors.accent : theme.colors.textMuted,
|
|
4973
5462
|
fontWeight: meReacted ? "700" : "600"
|
|
@@ -4987,7 +5476,7 @@ function ReactionStrip({
|
|
|
4987
5476
|
onPress: onMorePress,
|
|
4988
5477
|
hitSlop: 4,
|
|
4989
5478
|
style: [
|
|
4990
|
-
|
|
5479
|
+
styles23.chip,
|
|
4991
5480
|
{
|
|
4992
5481
|
backgroundColor: theme.colors.surfaceAlt,
|
|
4993
5482
|
borderColor: theme.colors.border,
|
|
@@ -5020,13 +5509,13 @@ function ReactionPicker({
|
|
|
5020
5509
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5021
5510
|
reactNative.Pressable,
|
|
5022
5511
|
{
|
|
5023
|
-
style: [
|
|
5512
|
+
style: [styles23.backdrop, { paddingTop: insets.top, paddingBottom: insets.bottom }],
|
|
5024
5513
|
onPress: onClose,
|
|
5025
5514
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5026
5515
|
reactNative.View,
|
|
5027
5516
|
{
|
|
5028
5517
|
style: [
|
|
5029
|
-
|
|
5518
|
+
styles23.sheet,
|
|
5030
5519
|
{
|
|
5031
5520
|
backgroundColor: theme.colors.surface,
|
|
5032
5521
|
borderRadius: theme.radii.lg
|
|
@@ -5036,12 +5525,12 @@ function ReactionPicker({
|
|
|
5036
5525
|
children: emojis.map((emoji) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5037
5526
|
reactNative.Pressable,
|
|
5038
5527
|
{
|
|
5039
|
-
style:
|
|
5528
|
+
style: styles23.emojiBtn,
|
|
5040
5529
|
onPress: () => {
|
|
5041
5530
|
onPick(emoji);
|
|
5042
5531
|
onClose();
|
|
5043
5532
|
},
|
|
5044
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
5533
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles23.bigEmoji, children: emoji })
|
|
5045
5534
|
},
|
|
5046
5535
|
emoji
|
|
5047
5536
|
))
|
|
@@ -5052,7 +5541,7 @@ function ReactionPicker({
|
|
|
5052
5541
|
}
|
|
5053
5542
|
);
|
|
5054
5543
|
}
|
|
5055
|
-
var
|
|
5544
|
+
var styles23 = reactNative.StyleSheet.create({
|
|
5056
5545
|
strip: {
|
|
5057
5546
|
flexDirection: "row",
|
|
5058
5547
|
flexWrap: "wrap",
|
|
@@ -5108,6 +5597,69 @@ var styles21 = reactNative.StyleSheet.create({
|
|
|
5108
5597
|
lineHeight: 38
|
|
5109
5598
|
}
|
|
5110
5599
|
});
|
|
5600
|
+
function SendStatus({ message, onRetry, onDiscard, alignEnd = true }) {
|
|
5601
|
+
const theme = useTheme();
|
|
5602
|
+
const status = message.local_status;
|
|
5603
|
+
if (status !== "queued" && status !== "failed") return null;
|
|
5604
|
+
const failed = status === "failed";
|
|
5605
|
+
const text = failed ? message.local_error ? `Not sent: ${message.local_error}` : "Not sent" : "Waiting for network\u2026";
|
|
5606
|
+
const button = (label, onPress, danger = false) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5607
|
+
reactNative.Pressable,
|
|
5608
|
+
{
|
|
5609
|
+
onPress,
|
|
5610
|
+
accessibilityRole: "button",
|
|
5611
|
+
accessibilityLabel: `${label} message`,
|
|
5612
|
+
hitSlop: 8,
|
|
5613
|
+
style: styles24.button,
|
|
5614
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5615
|
+
reactNative.Text,
|
|
5616
|
+
{
|
|
5617
|
+
style: [
|
|
5618
|
+
styles24.buttonText,
|
|
5619
|
+
{ color: danger ? theme.colors.danger : theme.colors.accentStrong },
|
|
5620
|
+
{ fontFamily: theme.fonts.body }
|
|
5621
|
+
],
|
|
5622
|
+
children: label
|
|
5623
|
+
}
|
|
5624
|
+
)
|
|
5625
|
+
}
|
|
5626
|
+
);
|
|
5627
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5628
|
+
reactNative.View,
|
|
5629
|
+
{
|
|
5630
|
+
style: [styles24.root, { justifyContent: alignEnd ? "flex-end" : "flex-start" }],
|
|
5631
|
+
accessibilityLiveRegion: "polite",
|
|
5632
|
+
children: [
|
|
5633
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5634
|
+
reactNative.Text,
|
|
5635
|
+
{
|
|
5636
|
+
style: [
|
|
5637
|
+
styles24.text,
|
|
5638
|
+
{ color: failed ? theme.colors.danger : theme.colors.textMuted },
|
|
5639
|
+
{ fontFamily: theme.fonts.body }
|
|
5640
|
+
],
|
|
5641
|
+
children: text
|
|
5642
|
+
}
|
|
5643
|
+
),
|
|
5644
|
+
onRetry ? button(failed ? "Retry" : "Send now", onRetry) : null,
|
|
5645
|
+
failed && onDiscard ? button("Delete", onDiscard, true) : null
|
|
5646
|
+
]
|
|
5647
|
+
}
|
|
5648
|
+
);
|
|
5649
|
+
}
|
|
5650
|
+
var styles24 = reactNative.StyleSheet.create({
|
|
5651
|
+
root: {
|
|
5652
|
+
flexDirection: "row",
|
|
5653
|
+
flexWrap: "wrap",
|
|
5654
|
+
alignItems: "center",
|
|
5655
|
+
gap: 10,
|
|
5656
|
+
marginTop: 2,
|
|
5657
|
+
marginBottom: 4
|
|
5658
|
+
},
|
|
5659
|
+
text: { fontSize: 12, flexShrink: 1 },
|
|
5660
|
+
button: { paddingVertical: 2 },
|
|
5661
|
+
buttonText: { fontSize: 12, fontWeight: "700" }
|
|
5662
|
+
});
|
|
5111
5663
|
|
|
5112
5664
|
// src/internal/thread.ts
|
|
5113
5665
|
function threadSummaryText(replyCount, lastReplyAt, now = Date.now()) {
|
|
@@ -5148,7 +5700,7 @@ function ThreadSummary({
|
|
|
5148
5700
|
accessibilityLabel: `${label}. Open thread`,
|
|
5149
5701
|
hitSlop: 4,
|
|
5150
5702
|
style: ({ pressed }) => [
|
|
5151
|
-
|
|
5703
|
+
styles25.row,
|
|
5152
5704
|
{
|
|
5153
5705
|
alignSelf: alignEnd ? "flex-end" : "flex-start",
|
|
5154
5706
|
borderRadius: theme.radii.pill,
|
|
@@ -5156,11 +5708,11 @@ function ThreadSummary({
|
|
|
5156
5708
|
}
|
|
5157
5709
|
],
|
|
5158
5710
|
children: [
|
|
5159
|
-
people.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5711
|
+
people.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles25.stack, children: people.map((p, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5160
5712
|
reactNative.View,
|
|
5161
5713
|
{
|
|
5162
5714
|
style: [
|
|
5163
|
-
|
|
5715
|
+
styles25.stacked,
|
|
5164
5716
|
{
|
|
5165
5717
|
marginLeft: i === 0 ? 0 : -6,
|
|
5166
5718
|
borderColor: theme.colors.background,
|
|
@@ -5182,7 +5734,7 @@ function ThreadSummary({
|
|
|
5182
5734
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5183
5735
|
reactNative.Text,
|
|
5184
5736
|
{
|
|
5185
|
-
style: [
|
|
5737
|
+
style: [styles25.text, { color: theme.colors.link, fontFamily: theme.fonts.body }],
|
|
5186
5738
|
numberOfLines: 1,
|
|
5187
5739
|
children: label
|
|
5188
5740
|
}
|
|
@@ -5202,7 +5754,7 @@ function Participant({
|
|
|
5202
5754
|
const src = externalId ? avatarFor?.(externalId) ?? resolved.profile?.avatarUrl ?? null : null;
|
|
5203
5755
|
return /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src, name, seed: externalId ?? fallback, size: "xs" });
|
|
5204
5756
|
}
|
|
5205
|
-
var
|
|
5757
|
+
var styles25 = reactNative.StyleSheet.create({
|
|
5206
5758
|
row: {
|
|
5207
5759
|
flexDirection: "row",
|
|
5208
5760
|
alignItems: "center",
|
|
@@ -5257,7 +5809,9 @@ function FlatMessageRow({
|
|
|
5257
5809
|
linkPreviews = true,
|
|
5258
5810
|
onRemoveLinkPreview,
|
|
5259
5811
|
onMarkUnread,
|
|
5260
|
-
editHistory = true
|
|
5812
|
+
editHistory = true,
|
|
5813
|
+
onRetrySend,
|
|
5814
|
+
onDiscardSend
|
|
5261
5815
|
}) {
|
|
5262
5816
|
const theme = useTheme();
|
|
5263
5817
|
const { width: screenWidth } = reactNative.useWindowDimensions();
|
|
@@ -5286,9 +5840,10 @@ function FlatMessageRow({
|
|
|
5286
5840
|
const isRunStart = compact || groupPosition === "first" || groupPosition === "standalone";
|
|
5287
5841
|
const ctx = { message: msg, isSelf, sender, layout, isRunStart };
|
|
5288
5842
|
const deleted = react$1.isTombstone(msg);
|
|
5843
|
+
const inert = deleted || !!msg.local_status;
|
|
5289
5844
|
const time = formatMessageTime(msg.inserted_at, timeFormat);
|
|
5290
5845
|
const openActions = () => {
|
|
5291
|
-
if (actions && !
|
|
5846
|
+
if (actions && !inert) setActionsOpen(true);
|
|
5292
5847
|
};
|
|
5293
5848
|
const text = { fontFamily: theme.fonts.body, color: theme.colors.text };
|
|
5294
5849
|
const avatarEl = showAvatar ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5315,10 +5870,10 @@ function FlatMessageRow({
|
|
|
5315
5870
|
reactNative.Text,
|
|
5316
5871
|
{
|
|
5317
5872
|
style: [
|
|
5318
|
-
|
|
5873
|
+
styles26.name,
|
|
5319
5874
|
text,
|
|
5320
5875
|
compact ? { color: userColor(ext ?? msg.sender_id ?? msg.id) } : null,
|
|
5321
|
-
compact ?
|
|
5876
|
+
compact ? styles26.nameCompact : null
|
|
5322
5877
|
],
|
|
5323
5878
|
numberOfLines: 1,
|
|
5324
5879
|
...onSenderPress && !isSelf ? {
|
|
@@ -5333,22 +5888,22 @@ function FlatMessageRow({
|
|
|
5333
5888
|
reactNative.Text,
|
|
5334
5889
|
{
|
|
5335
5890
|
style: [
|
|
5336
|
-
|
|
5891
|
+
styles26.time,
|
|
5337
5892
|
{ color: theme.colors.textSubtle, fontFamily: theme.fonts.body },
|
|
5338
|
-
dim ?
|
|
5893
|
+
dim ? styles26.timeDim : null
|
|
5339
5894
|
],
|
|
5340
5895
|
...dim ? { numberOfLines: 1, adjustsFontSizeToFit: true, minimumFontScale: 0.6 } : {},
|
|
5341
5896
|
children: dim ? gutterTime(time) : time
|
|
5342
5897
|
}
|
|
5343
5898
|
);
|
|
5344
|
-
const header = compact ? name : isRunStart ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5899
|
+
const header = compact ? name : isRunStart ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles26.header, children: [
|
|
5345
5900
|
name,
|
|
5346
5901
|
timeText(false)
|
|
5347
5902
|
] }) : null;
|
|
5348
5903
|
const images = attachments && !deleted ? (msg.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
|
|
5349
5904
|
const files = attachments && !deleted ? (msg.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
|
|
5350
5905
|
const mediaWidth = Math.min(screenWidth - GUTTER - 48, 320);
|
|
5351
|
-
const attachmentsEl = images.length > 0 || files.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5906
|
+
const attachmentsEl = images.length > 0 || files.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles26.attachments, children: [
|
|
5352
5907
|
images.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5353
5908
|
ImageMosaic,
|
|
5354
5909
|
{
|
|
@@ -5371,11 +5926,11 @@ function FlatMessageRow({
|
|
|
5371
5926
|
lineHeight: dense ? theme.fonts.lineHeight - 3 : theme.fonts.lineHeight
|
|
5372
5927
|
};
|
|
5373
5928
|
const edited = !!msg.edited_at && !deleted;
|
|
5374
|
-
const meta = edited || isSelf && readState ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5929
|
+
const meta = edited || isSelf && readState ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles26.meta, children: [
|
|
5375
5930
|
edited ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5376
5931
|
reactNative.Text,
|
|
5377
5932
|
{
|
|
5378
|
-
style: [
|
|
5933
|
+
style: [styles26.edited, { color: theme.colors.textSubtle }],
|
|
5379
5934
|
...editHistory && canShowEditHistory(msg.id) ? {
|
|
5380
5935
|
onPress: () => setHistoryOpen(true),
|
|
5381
5936
|
suppressHighlighting: true,
|
|
@@ -5395,7 +5950,7 @@ function FlatMessageRow({
|
|
|
5395
5950
|
}
|
|
5396
5951
|
) : null
|
|
5397
5952
|
] }) : null;
|
|
5398
|
-
const body = deleted ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [bodyText,
|
|
5953
|
+
const body = deleted ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [bodyText, styles26.deleted, { color: theme.colors.textMuted }], children: "This message was deleted" }) : raw ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
|
|
5399
5954
|
jumbo > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { fontSize: emojiFontSize(jumbo), lineHeight: emojiFontSize(jumbo) + 8 }, children: raw }) : markdown && hasMarkdown(shown) ? renderMarkdown(shown, {
|
|
5400
5955
|
textColor: bodyText.color,
|
|
5401
5956
|
linkColor: theme.colors.link,
|
|
@@ -5407,8 +5962,8 @@ function FlatMessageRow({
|
|
|
5407
5962
|
return false;
|
|
5408
5963
|
}
|
|
5409
5964
|
}) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: bodyText, children: shown }),
|
|
5410
|
-
trimmable ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
5411
|
-
previews.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5965
|
+
trimmable ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles26.readMore, { color: theme.colors.link }], children: expanded ? "Show less" : "Read more" }) }) : null,
|
|
5966
|
+
previews.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles26.previews, children: previews.map((p) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5412
5967
|
LinkPreviewCard,
|
|
5413
5968
|
{
|
|
5414
5969
|
preview: p,
|
|
@@ -5432,7 +5987,7 @@ function FlatMessageRow({
|
|
|
5432
5987
|
}
|
|
5433
5988
|
) : null
|
|
5434
5989
|
);
|
|
5435
|
-
const reactionsEl = reactions && !
|
|
5990
|
+
const reactionsEl = reactions && !inert ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles26.reactions, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5436
5991
|
ReactionStrip,
|
|
5437
5992
|
{
|
|
5438
5993
|
messageId: msg.id,
|
|
@@ -5451,15 +6006,24 @@ function FlatMessageRow({
|
|
|
5451
6006
|
...onQuotedClick ? { onPress: () => onQuotedClick(msg.quoted_message.id) } : {}
|
|
5452
6007
|
}
|
|
5453
6008
|
) : null;
|
|
5454
|
-
const content = /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
6009
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles26.content, children: [
|
|
5455
6010
|
!compact ? renderSlot(slots?.header, ctx, header) : null,
|
|
5456
6011
|
quote,
|
|
5457
6012
|
renderSlot(slots?.attachments, ctx, attachmentsEl),
|
|
5458
6013
|
renderSlot(slots?.body, ctx, body),
|
|
5459
6014
|
renderSlot(slots?.reactions, ctx, reactionsEl),
|
|
5460
|
-
renderSlot(slots?.thread, ctx, threadEl)
|
|
6015
|
+
renderSlot(slots?.thread, ctx, threadEl),
|
|
6016
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6017
|
+
SendStatus,
|
|
6018
|
+
{
|
|
6019
|
+
message: msg,
|
|
6020
|
+
alignEnd: false,
|
|
6021
|
+
...onRetrySend ? { onRetry: onRetrySend } : {},
|
|
6022
|
+
...onDiscardSend ? { onDiscard: onDiscardSend } : {}
|
|
6023
|
+
}
|
|
6024
|
+
)
|
|
5461
6025
|
] });
|
|
5462
|
-
const sheet = actions && actionsOpen && !
|
|
6026
|
+
const sheet = actions && actionsOpen && !inert ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5463
6027
|
RowActionsSheet,
|
|
5464
6028
|
{
|
|
5465
6029
|
msg,
|
|
@@ -5483,28 +6047,32 @@ function FlatMessageRow({
|
|
|
5483
6047
|
reactNative.View,
|
|
5484
6048
|
{
|
|
5485
6049
|
style: [
|
|
5486
|
-
|
|
5487
|
-
compact ?
|
|
5488
|
-
dense ?
|
|
5489
|
-
!compact && isRunStart ? dense ?
|
|
6050
|
+
styles26.row,
|
|
6051
|
+
compact ? styles26.rowCompact : null,
|
|
6052
|
+
dense ? styles26.rowDense : null,
|
|
6053
|
+
!compact && isRunStart ? dense ? styles26.runStartDense : styles26.runStart : null,
|
|
5490
6054
|
mentionsMe ? { backgroundColor: theme.colors.mention, borderLeftColor: theme.colors.accent } : null,
|
|
5491
|
-
isEditing ?
|
|
6055
|
+
isEditing ? styles26.rowEditing : null
|
|
5492
6056
|
],
|
|
5493
6057
|
children: [
|
|
5494
6058
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5495
6059
|
reactNative.Pressable,
|
|
5496
6060
|
{
|
|
5497
6061
|
onLongPress: openActions,
|
|
5498
|
-
style: [
|
|
5499
|
-
|
|
5500
|
-
|
|
6062
|
+
style: [styles26.line, compact ? styles26.lineCompact : null],
|
|
6063
|
+
accessibilityLabel: messageA11yLabel(msg, senderName, isSelf),
|
|
6064
|
+
...actions && !inert ? {
|
|
6065
|
+
accessibilityHint: "Long press for message actions",
|
|
6066
|
+
accessibilityActions: [{ name: "longpress", label: "Message actions" }],
|
|
6067
|
+
onAccessibilityAction: openActions
|
|
6068
|
+
} : {},
|
|
5501
6069
|
children: compact ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5502
6070
|
timeText(false),
|
|
5503
|
-
avatar ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
6071
|
+
avatar ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles26.avatarCompact, children: avatar }) : null,
|
|
5504
6072
|
renderSlot(slots?.header, ctx, header),
|
|
5505
6073
|
content
|
|
5506
6074
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5507
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
6075
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles26.gutter, children: isRunStart ? avatar : timeText(true) }),
|
|
5508
6076
|
content
|
|
5509
6077
|
] })
|
|
5510
6078
|
}
|
|
@@ -5525,7 +6093,7 @@ function FlatMessageRow({
|
|
|
5525
6093
|
}
|
|
5526
6094
|
);
|
|
5527
6095
|
}
|
|
5528
|
-
var
|
|
6096
|
+
var styles26 = reactNative.StyleSheet.create({
|
|
5529
6097
|
row: {
|
|
5530
6098
|
// 3px left border reserved for the mention accent bar.
|
|
5531
6099
|
borderLeftWidth: 3,
|
|
@@ -5677,13 +6245,13 @@ function MessageActions({
|
|
|
5677
6245
|
animationType: "fade",
|
|
5678
6246
|
onRequestClose: onClose,
|
|
5679
6247
|
...EDGE_TO_EDGE_MODAL,
|
|
5680
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style:
|
|
6248
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles27.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5681
6249
|
reactNative.Pressable,
|
|
5682
6250
|
{
|
|
5683
6251
|
onPress: () => void 0,
|
|
5684
6252
|
accessible: false,
|
|
5685
6253
|
style: [
|
|
5686
|
-
|
|
6254
|
+
styles27.sheet,
|
|
5687
6255
|
{
|
|
5688
6256
|
backgroundColor: theme.colors.surface,
|
|
5689
6257
|
borderTopLeftRadius: theme.radii.lg,
|
|
@@ -5696,7 +6264,7 @@ function MessageActions({
|
|
|
5696
6264
|
theme.shadows.lg
|
|
5697
6265
|
],
|
|
5698
6266
|
children: [
|
|
5699
|
-
showEmojiRow ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
6267
|
+
showEmojiRow ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles27.emojiRow, { borderBottomColor: theme.colors.border }], children: [
|
|
5700
6268
|
emojis.map((emoji) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5701
6269
|
reactNative.Pressable,
|
|
5702
6270
|
{
|
|
@@ -5704,10 +6272,10 @@ function MessageActions({
|
|
|
5704
6272
|
onPickReaction(emoji);
|
|
5705
6273
|
onClose();
|
|
5706
6274
|
},
|
|
5707
|
-
style:
|
|
6275
|
+
style: styles27.emojiBtn,
|
|
5708
6276
|
hitSlop: 6,
|
|
5709
6277
|
accessibilityLabel: `React with ${emoji}`,
|
|
5710
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
6278
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles27.emoji, children: emoji })
|
|
5711
6279
|
},
|
|
5712
6280
|
emoji
|
|
5713
6281
|
)),
|
|
@@ -5718,7 +6286,7 @@ function MessageActions({
|
|
|
5718
6286
|
onClose();
|
|
5719
6287
|
onMoreReactions();
|
|
5720
6288
|
},
|
|
5721
|
-
style: [
|
|
6289
|
+
style: [styles27.moreBtn, { backgroundColor: theme.colors.surfaceAlt }],
|
|
5722
6290
|
hitSlop: 6,
|
|
5723
6291
|
accessibilityRole: "button",
|
|
5724
6292
|
accessibilityLabel: "More reactions",
|
|
@@ -5726,7 +6294,7 @@ function MessageActions({
|
|
|
5726
6294
|
}
|
|
5727
6295
|
) : null
|
|
5728
6296
|
] }) : null,
|
|
5729
|
-
items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress: item.onPress, style:
|
|
6297
|
+
items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress: item.onPress, style: styles27.item, children: [
|
|
5730
6298
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5731
6299
|
PoolseIcon,
|
|
5732
6300
|
{
|
|
@@ -5739,7 +6307,7 @@ function MessageActions({
|
|
|
5739
6307
|
reactNative.Text,
|
|
5740
6308
|
{
|
|
5741
6309
|
style: [
|
|
5742
|
-
|
|
6310
|
+
styles27.itemText,
|
|
5743
6311
|
{
|
|
5744
6312
|
color: item.danger ? theme.colors.danger : theme.colors.text,
|
|
5745
6313
|
fontFamily: theme.fonts.body
|
|
@@ -5759,7 +6327,7 @@ function hostOf2(url) {
|
|
|
5759
6327
|
const m = /^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i.exec(url);
|
|
5760
6328
|
return (m?.[1] ?? url).replace(/^www\./, "");
|
|
5761
6329
|
}
|
|
5762
|
-
var
|
|
6330
|
+
var styles27 = reactNative.StyleSheet.create({
|
|
5763
6331
|
backdrop: {
|
|
5764
6332
|
flex: 1,
|
|
5765
6333
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
@@ -5876,6 +6444,16 @@ function RowSheets({
|
|
|
5876
6444
|
] });
|
|
5877
6445
|
}
|
|
5878
6446
|
function MessageRow(props) {
|
|
6447
|
+
if (react$1.recordingNoticeDisplayFor(props.msg, props.meId)) {
|
|
6448
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6449
|
+
RecordingNoticeRow,
|
|
6450
|
+
{
|
|
6451
|
+
msg: props.msg,
|
|
6452
|
+
meId: props.meId,
|
|
6453
|
+
...props.nameForUserId ? { nameFor: props.nameForUserId } : {}
|
|
6454
|
+
}
|
|
6455
|
+
);
|
|
6456
|
+
}
|
|
5879
6457
|
const callLog = react$1.callLogDisplayFor(props.msg, props.meId);
|
|
5880
6458
|
if (callLog !== void 0) {
|
|
5881
6459
|
return callLog ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5923,11 +6501,13 @@ function BubbleMessageRow({
|
|
|
5923
6501
|
linkPreviews = true,
|
|
5924
6502
|
onRemoveLinkPreview,
|
|
5925
6503
|
onMarkUnread,
|
|
5926
|
-
editHistory = true
|
|
6504
|
+
editHistory = true,
|
|
6505
|
+
onRetrySend,
|
|
6506
|
+
onDiscardSend
|
|
5927
6507
|
}) {
|
|
5928
6508
|
const theme = useTheme();
|
|
5929
6509
|
const isSelf = meId !== null && msg.sender_id === meId;
|
|
5930
|
-
const tombstone = react$1.isTombstone(msg);
|
|
6510
|
+
const tombstone = react$1.isTombstone(msg) || !!msg.local_status;
|
|
5931
6511
|
const [actionsOpen, setActionsOpen] = react.useState(false);
|
|
5932
6512
|
const [emojiOpen, setEmojiOpen] = react.useState(false);
|
|
5933
6513
|
const [historyOpen, setHistoryOpen] = react.useState(false);
|
|
@@ -6009,8 +6589,7 @@ function BubbleMessageRow({
|
|
|
6009
6589
|
});
|
|
6010
6590
|
const showAvatarSlot = showAvatar && !isSelf;
|
|
6011
6591
|
const showAvatarRender = showAvatarSlot && (groupPosition === "last" || groupPosition === "standalone");
|
|
6012
|
-
const
|
|
6013
|
-
const rowSender = react$1.useUser(wantsSender ? msg.sender_external_id : null);
|
|
6592
|
+
const rowSender = react$1.useUser(msg.sender_external_id);
|
|
6014
6593
|
const avatarUrl = msg.sender_external_id ? avatarFor?.(msg.sender_external_id) ?? rowSender.profile?.avatarUrl ?? null : null;
|
|
6015
6594
|
const senderLabel = msg.sender_external_id ? labelFor?.(msg.sender_external_id) ?? rowSender.profile?.displayName ?? msg.sender_external_id : null;
|
|
6016
6595
|
const sender = {
|
|
@@ -6040,16 +6619,16 @@ function BubbleMessageRow({
|
|
|
6040
6619
|
reactNative.View,
|
|
6041
6620
|
{
|
|
6042
6621
|
style: [
|
|
6043
|
-
|
|
6622
|
+
styles28.row,
|
|
6044
6623
|
{ alignSelf: isSelf ? "flex-end" : "flex-start" },
|
|
6045
|
-
density === "compact" ?
|
|
6624
|
+
density === "compact" ? styles28.rowDense : null,
|
|
6046
6625
|
// Lift this row above the dim backdrop the parent renders
|
|
6047
6626
|
// during edit mode. zIndex covers iOS / web; elevation does
|
|
6048
6627
|
// the equivalent on Android.
|
|
6049
|
-
isEditing ?
|
|
6628
|
+
isEditing ? styles28.rowEditing : null
|
|
6050
6629
|
],
|
|
6051
6630
|
children: [
|
|
6052
|
-
showAvatarSlot ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
6631
|
+
showAvatarSlot ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles28.avatarSlot, children: !showAvatarRender ? null : onAvatarPress ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6053
6632
|
reactNative.Pressable,
|
|
6054
6633
|
{
|
|
6055
6634
|
onPress: () => onAvatarPress(sender),
|
|
@@ -6059,14 +6638,14 @@ function BubbleMessageRow({
|
|
|
6059
6638
|
children: avatar
|
|
6060
6639
|
}
|
|
6061
6640
|
) : avatar }) : null,
|
|
6062
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
6641
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles28.bubbleCol, children: [
|
|
6063
6642
|
swipeEnabled ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6064
6643
|
reactNative.Animated.View,
|
|
6065
6644
|
{
|
|
6066
6645
|
pointerEvents: "none",
|
|
6067
6646
|
style: [
|
|
6068
|
-
|
|
6069
|
-
isSelf ?
|
|
6647
|
+
styles28.replyHint,
|
|
6648
|
+
isSelf ? styles28.replyHintRight : styles28.replyHintLeft,
|
|
6070
6649
|
{
|
|
6071
6650
|
opacity: replyIconOpacity,
|
|
6072
6651
|
transform: [{ scale: replyIconScale }],
|
|
@@ -6088,8 +6667,12 @@ function BubbleMessageRow({
|
|
|
6088
6667
|
if (!actions || tombstone) return;
|
|
6089
6668
|
setActionsOpen(true);
|
|
6090
6669
|
},
|
|
6091
|
-
|
|
6092
|
-
|
|
6670
|
+
accessibilityLabel: messageA11yLabel(msg, senderLabel ?? "Unknown", isSelf),
|
|
6671
|
+
...actions && !tombstone ? {
|
|
6672
|
+
accessibilityHint: "Long press for message actions",
|
|
6673
|
+
accessibilityActions: [{ name: "longpress", label: "Message actions" }],
|
|
6674
|
+
onAccessibilityAction: () => setActionsOpen(true)
|
|
6675
|
+
} : {},
|
|
6093
6676
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6094
6677
|
MessageBubble,
|
|
6095
6678
|
{
|
|
@@ -6118,6 +6701,15 @@ function BubbleMessageRow({
|
|
|
6118
6701
|
)
|
|
6119
6702
|
}
|
|
6120
6703
|
),
|
|
6704
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6705
|
+
SendStatus,
|
|
6706
|
+
{
|
|
6707
|
+
message: msg,
|
|
6708
|
+
alignEnd: isSelf,
|
|
6709
|
+
...onRetrySend ? { onRetry: onRetrySend } : {},
|
|
6710
|
+
...onDiscardSend ? { onDiscard: onDiscardSend } : {}
|
|
6711
|
+
}
|
|
6712
|
+
),
|
|
6121
6713
|
renderSlot(
|
|
6122
6714
|
slots?.thread,
|
|
6123
6715
|
slotContext,
|
|
@@ -6135,7 +6727,7 @@ function BubbleMessageRow({
|
|
|
6135
6727
|
renderSlot(
|
|
6136
6728
|
slots?.reactions,
|
|
6137
6729
|
slotContext,
|
|
6138
|
-
reactions && !tombstone ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
6730
|
+
reactions && !tombstone ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles28.reactionsRow, { alignSelf: isSelf ? "flex-end" : "flex-start" }], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6139
6731
|
ReactionStrip,
|
|
6140
6732
|
{
|
|
6141
6733
|
messageId: msg.id,
|
|
@@ -6186,7 +6778,7 @@ function BubbleMessageRow({
|
|
|
6186
6778
|
}
|
|
6187
6779
|
);
|
|
6188
6780
|
}
|
|
6189
|
-
var
|
|
6781
|
+
var styles28 = reactNative.StyleSheet.create({
|
|
6190
6782
|
row: {
|
|
6191
6783
|
flexDirection: "row",
|
|
6192
6784
|
alignItems: "flex-end",
|
|
@@ -6243,24 +6835,24 @@ function NewMessagesDivider({ label = "New messages" }) {
|
|
|
6243
6835
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6244
6836
|
reactNative.View,
|
|
6245
6837
|
{
|
|
6246
|
-
style: [
|
|
6838
|
+
style: [styles29.row, { paddingHorizontal: theme.spacing.md }],
|
|
6247
6839
|
accessibilityRole: "text",
|
|
6248
6840
|
accessibilityLabel: label,
|
|
6249
6841
|
children: [
|
|
6250
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
6842
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles29.line, { backgroundColor: theme.colors.accent }] }),
|
|
6251
6843
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6252
6844
|
reactNative.Text,
|
|
6253
6845
|
{
|
|
6254
|
-
style: [
|
|
6846
|
+
style: [styles29.label, { color: theme.colors.accentStrong, fontFamily: theme.fonts.body }],
|
|
6255
6847
|
children: label
|
|
6256
6848
|
}
|
|
6257
6849
|
),
|
|
6258
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
6850
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles29.line, { backgroundColor: theme.colors.accent }] })
|
|
6259
6851
|
]
|
|
6260
6852
|
}
|
|
6261
6853
|
);
|
|
6262
6854
|
}
|
|
6263
|
-
var
|
|
6855
|
+
var styles29 = reactNative.StyleSheet.create({
|
|
6264
6856
|
row: {
|
|
6265
6857
|
flexDirection: "row",
|
|
6266
6858
|
alignItems: "center",
|
|
@@ -6429,15 +7021,15 @@ function ThreadSheet({
|
|
|
6429
7021
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6430
7022
|
reactNative.View,
|
|
6431
7023
|
{
|
|
6432
|
-
style:
|
|
7024
|
+
style: styles30.modalRoot,
|
|
6433
7025
|
onLayout: (e) => setRootHeight(Math.round(e.nativeEvent.layout.height)),
|
|
6434
7026
|
children: [
|
|
6435
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style:
|
|
7027
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles30.backdrop, onPress: onClose, accessibilityLabel: "Close thread" }),
|
|
6436
7028
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6437
7029
|
reactNative.Animated.View,
|
|
6438
7030
|
{
|
|
6439
7031
|
style: [
|
|
6440
|
-
|
|
7032
|
+
styles30.sheet,
|
|
6441
7033
|
{
|
|
6442
7034
|
height: sheetHeight,
|
|
6443
7035
|
backgroundColor: theme.colors.background,
|
|
@@ -6451,14 +7043,14 @@ function ThreadSheet({
|
|
|
6451
7043
|
],
|
|
6452
7044
|
children: [
|
|
6453
7045
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ...panHandlers, children: [
|
|
6454
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
6455
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
7046
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles30.dragHandle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles30.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
|
|
7047
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles30.header, { borderBottomColor: theme.colors.border }], children: [
|
|
6456
7048
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6457
7049
|
reactNative.Pressable,
|
|
6458
7050
|
{
|
|
6459
7051
|
onPress: onClose,
|
|
6460
7052
|
hitSlop: 16,
|
|
6461
|
-
style: [
|
|
7053
|
+
style: [styles30.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
|
|
6462
7054
|
accessibilityLabel: "Close thread",
|
|
6463
7055
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
|
|
6464
7056
|
}
|
|
@@ -6466,7 +7058,7 @@ function ThreadSheet({
|
|
|
6466
7058
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6467
7059
|
reactNative.Text,
|
|
6468
7060
|
{
|
|
6469
|
-
style: [
|
|
7061
|
+
style: [styles30.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
|
|
6470
7062
|
children: "Thread"
|
|
6471
7063
|
}
|
|
6472
7064
|
)
|
|
@@ -6475,18 +7067,25 @@ function ThreadSheet({
|
|
|
6475
7067
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6476
7068
|
reactNative.KeyboardAvoidingView,
|
|
6477
7069
|
{
|
|
6478
|
-
style:
|
|
7070
|
+
style: styles30.kavBody,
|
|
6479
7071
|
behavior: "padding",
|
|
6480
7072
|
keyboardVerticalOffset: gutter,
|
|
6481
7073
|
children: [
|
|
6482
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
6483
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
7074
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles30.rootPreview, { backgroundColor: theme.colors.surfaceAlt }], children: rootRow }),
|
|
7075
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles30.listWrap, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6484
7076
|
MessageList,
|
|
6485
7077
|
{
|
|
6486
7078
|
messages: replies,
|
|
6487
7079
|
hasMore,
|
|
6488
7080
|
onLoadMore: loadMore,
|
|
6489
|
-
renderItem: renderReply
|
|
7081
|
+
renderItem: renderReply,
|
|
7082
|
+
emptyState: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7083
|
+
EmptyState,
|
|
7084
|
+
{
|
|
7085
|
+
title: "No replies yet",
|
|
7086
|
+
hint: "Write a reply below to start the thread."
|
|
7087
|
+
}
|
|
7088
|
+
)
|
|
6490
7089
|
}
|
|
6491
7090
|
) }),
|
|
6492
7091
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6518,7 +7117,7 @@ function ThreadSheet({
|
|
|
6518
7117
|
}
|
|
6519
7118
|
);
|
|
6520
7119
|
}
|
|
6521
|
-
var
|
|
7120
|
+
var styles30 = reactNative.StyleSheet.create({
|
|
6522
7121
|
modalRoot: {
|
|
6523
7122
|
flex: 1,
|
|
6524
7123
|
justifyContent: "flex-end"
|
|
@@ -6590,7 +7189,7 @@ function TypingIndicator({ typing, labelFor }) {
|
|
|
6590
7189
|
const ids = Array.from(typing);
|
|
6591
7190
|
const isTyping = ids.length > 0;
|
|
6592
7191
|
if (!isTyping) return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { height: 0 } });
|
|
6593
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
7192
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.row, children: [
|
|
6594
7193
|
/* @__PURE__ */ jsxRuntime.jsx(TypingDots, {}),
|
|
6595
7194
|
/* @__PURE__ */ jsxRuntime.jsx(TypingLabel, { ids, ...labelFor ? { labelFor } : {} })
|
|
6596
7195
|
] });
|
|
@@ -6635,7 +7234,7 @@ function TypingDots() {
|
|
|
6635
7234
|
],
|
|
6636
7235
|
opacity: val.interpolate({ inputRange: [0, 1], outputRange: [0.5, 1] })
|
|
6637
7236
|
});
|
|
6638
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
7237
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.dotsWrap, children: [
|
|
6639
7238
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: dot(a) }),
|
|
6640
7239
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: dot(b) }),
|
|
6641
7240
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: dot(c) })
|
|
@@ -6651,9 +7250,9 @@ function TypingLabel({
|
|
|
6651
7250
|
const name1 = useDisplayName(id1, labelFor);
|
|
6652
7251
|
const name2 = useDisplayName(id2, labelFor);
|
|
6653
7252
|
const text = ids.length === 1 ? `${name1} is typing` : ids.length === 2 ? `${name1} and ${name2} are typing` : `${ids.length} people are typing`;
|
|
6654
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
7253
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles31.label, { color: theme.colors.textMuted, fontFamily: theme.fonts.body }], children: text });
|
|
6655
7254
|
}
|
|
6656
|
-
var
|
|
7255
|
+
var styles31 = reactNative.StyleSheet.create({
|
|
6657
7256
|
row: {
|
|
6658
7257
|
flexDirection: "row",
|
|
6659
7258
|
alignItems: "center",
|
|
@@ -6691,21 +7290,40 @@ function parseDraft(raw) {
|
|
|
6691
7290
|
}
|
|
6692
7291
|
}
|
|
6693
7292
|
var DraftStore = class {
|
|
7293
|
+
/**
|
|
7294
|
+
* `namespace` resolves to the client's namespace; without it keys are
|
|
7295
|
+
* the pre-3.8 `poolse:draft:<conversation>` (tests, single client).
|
|
7296
|
+
*/
|
|
7297
|
+
constructor(namespace) {
|
|
7298
|
+
this.namespace = namespace;
|
|
7299
|
+
}
|
|
7300
|
+
namespace;
|
|
6694
7301
|
memory = /* @__PURE__ */ new Map();
|
|
7302
|
+
written = /* @__PURE__ */ new Map();
|
|
6695
7303
|
/** The in-memory draft, if any. */
|
|
6696
7304
|
peek(conversationId) {
|
|
6697
7305
|
return this.memory.get(conversationId) ?? null;
|
|
6698
7306
|
}
|
|
6699
7307
|
/**
|
|
6700
7308
|
* The draft: from memory, else from `storage` (which then seeds the
|
|
6701
|
-
* memory). Null when there's none, or
|
|
7309
|
+
* memory; a pre-3.8 key is moved over). Null when there's none, or
|
|
7310
|
+
* storage fails.
|
|
6702
7311
|
*/
|
|
6703
7312
|
async load(conversationId, storage) {
|
|
6704
7313
|
const inMemory = this.memory.get(conversationId);
|
|
6705
7314
|
if (inMemory) return inMemory;
|
|
6706
7315
|
if (!storage) return null;
|
|
6707
7316
|
try {
|
|
6708
|
-
const
|
|
7317
|
+
const key = await this.key(conversationId);
|
|
7318
|
+
let stored = parseDraft(await storage.get(key));
|
|
7319
|
+
const legacy = draftKey(conversationId);
|
|
7320
|
+
if (!stored && key !== legacy) {
|
|
7321
|
+
stored = parseDraft(await storage.get(legacy));
|
|
7322
|
+
if (stored && !isEmptyDraft(stored)) {
|
|
7323
|
+
this.write(storage, key, stored);
|
|
7324
|
+
swallow(() => storage.remove(legacy));
|
|
7325
|
+
}
|
|
7326
|
+
}
|
|
6709
7327
|
if (stored && !isEmptyDraft(stored) && !this.memory.has(conversationId)) {
|
|
6710
7328
|
this.memory.set(conversationId, stored);
|
|
6711
7329
|
}
|
|
@@ -6721,15 +7339,72 @@ var DraftStore = class {
|
|
|
6721
7339
|
return;
|
|
6722
7340
|
}
|
|
6723
7341
|
this.memory.set(conversationId, draft);
|
|
6724
|
-
if (storage) {
|
|
6725
|
-
|
|
7342
|
+
if (storage && !this.namespace) {
|
|
7343
|
+
this.write(storage, draftKey(conversationId), draft);
|
|
7344
|
+
} else if (storage) {
|
|
7345
|
+
void this.key(conversationId).then(
|
|
7346
|
+
(key) => this.write(storage, key, draft),
|
|
7347
|
+
() => void 0
|
|
7348
|
+
);
|
|
6726
7349
|
}
|
|
6727
7350
|
}
|
|
6728
7351
|
clear(conversationId, storage) {
|
|
6729
7352
|
this.memory.delete(conversationId);
|
|
6730
|
-
if (storage
|
|
7353
|
+
if (storage && !this.namespace) {
|
|
7354
|
+
swallow(() => storage.remove(draftKey(conversationId)));
|
|
7355
|
+
} else if (storage) {
|
|
7356
|
+
void this.key(conversationId).then(
|
|
7357
|
+
(key) => swallow(() => storage.remove(key)),
|
|
7358
|
+
() => void 0
|
|
7359
|
+
);
|
|
7360
|
+
}
|
|
7361
|
+
}
|
|
7362
|
+
/** Called by `chat.destroy()`. @internal */
|
|
7363
|
+
async destroy(opts) {
|
|
7364
|
+
this.memory.clear();
|
|
7365
|
+
if (!opts.clearStorage) return;
|
|
7366
|
+
const ns = this.namespace ? await this.namespace() : null;
|
|
7367
|
+
for (const [storage, keys] of this.written) {
|
|
7368
|
+
const all = new Set(keys);
|
|
7369
|
+
if (ns) {
|
|
7370
|
+
try {
|
|
7371
|
+
const listed = JSON.parse(await storage.get(indexKey(ns)) ?? "[]");
|
|
7372
|
+
if (Array.isArray(listed)) {
|
|
7373
|
+
for (const k of listed) if (typeof k === "string") all.add(k);
|
|
7374
|
+
}
|
|
7375
|
+
} catch {
|
|
7376
|
+
}
|
|
7377
|
+
swallow(() => storage.remove(indexKey(ns)));
|
|
7378
|
+
}
|
|
7379
|
+
for (const k of all) swallow(() => storage.remove(k));
|
|
7380
|
+
}
|
|
7381
|
+
this.written.clear();
|
|
7382
|
+
}
|
|
7383
|
+
async key(conversationId) {
|
|
7384
|
+
if (!this.namespace) return draftKey(conversationId);
|
|
7385
|
+
return `${await this.namespace()}:draft:${conversationId}`;
|
|
7386
|
+
}
|
|
7387
|
+
write(storage, key, draft) {
|
|
7388
|
+
swallow(() => storage.set(key, JSON.stringify(draft)));
|
|
7389
|
+
let keys = this.written.get(storage);
|
|
7390
|
+
if (!keys) {
|
|
7391
|
+
keys = /* @__PURE__ */ new Set();
|
|
7392
|
+
this.written.set(storage, keys);
|
|
7393
|
+
}
|
|
7394
|
+
if (keys.has(key) || !this.namespace) return;
|
|
7395
|
+
keys.add(key);
|
|
7396
|
+
const all = keys;
|
|
7397
|
+
void this.namespace().then(async (ns) => {
|
|
7398
|
+
try {
|
|
7399
|
+
const listed = JSON.parse(await storage.get(indexKey(ns)) ?? "[]");
|
|
7400
|
+
const prev = Array.isArray(listed) ? listed.filter((k) => typeof k === "string") : [];
|
|
7401
|
+
await storage.set(indexKey(ns), JSON.stringify([.../* @__PURE__ */ new Set([...prev, ...all])]));
|
|
7402
|
+
} catch {
|
|
7403
|
+
}
|
|
7404
|
+
});
|
|
6731
7405
|
}
|
|
6732
7406
|
};
|
|
7407
|
+
var indexKey = (ns) => `${ns}:draft-index`;
|
|
6733
7408
|
function swallow(fn) {
|
|
6734
7409
|
try {
|
|
6735
7410
|
const r = fn();
|
|
@@ -6739,7 +7414,9 @@ function swallow(fn) {
|
|
|
6739
7414
|
} catch {
|
|
6740
7415
|
}
|
|
6741
7416
|
}
|
|
6742
|
-
|
|
7417
|
+
function draftStoreOf(chat) {
|
|
7418
|
+
return chat.scoped("react-native:drafts", (c) => new DraftStore(() => c.whenNamespace()));
|
|
7419
|
+
}
|
|
6743
7420
|
|
|
6744
7421
|
// src/internal/errors.ts
|
|
6745
7422
|
function sendErrorNotice(err) {
|
|
@@ -6854,11 +7531,14 @@ function ConversationView({
|
|
|
6854
7531
|
loadMore,
|
|
6855
7532
|
loadUntil,
|
|
6856
7533
|
send,
|
|
7534
|
+
retry: retrySend,
|
|
7535
|
+
discard: discardSend,
|
|
6857
7536
|
edit,
|
|
6858
7537
|
delete: deleteMsg,
|
|
6859
7538
|
markReadUpTo,
|
|
6860
7539
|
refetch
|
|
6861
7540
|
} = react$1.useMessages(conversationId);
|
|
7541
|
+
const drafts = draftStoreOf(chat);
|
|
6862
7542
|
const { typing: typingPeople, signalTyping } = react$1.useTyping(conversationId);
|
|
6863
7543
|
const streams = react$1.useMessageStreams(conversationId);
|
|
6864
7544
|
const typing = react.useMemo(() => {
|
|
@@ -6886,6 +7566,14 @@ function ConversationView({
|
|
|
6886
7566
|
}, [realtimeStatus, refetch]);
|
|
6887
7567
|
const wantsMembers = mentions || senderLabels === "auto" || avatars === "auto";
|
|
6888
7568
|
const { members } = react$1.useMembers(wantsMembers ? conversationId : "");
|
|
7569
|
+
const nameForUserId = react.useCallback(
|
|
7570
|
+
(userId) => {
|
|
7571
|
+
const ext = members.find((m) => m.user_id === userId)?.external_id;
|
|
7572
|
+
if (!ext) return null;
|
|
7573
|
+
return chat.users.peek(ext)?.displayName ?? labelFor?.(ext) ?? null;
|
|
7574
|
+
},
|
|
7575
|
+
[members, chat, labelFor]
|
|
7576
|
+
);
|
|
6889
7577
|
const isGroupChat = members.length > 2;
|
|
6890
7578
|
const showSenderLabels = senderLabels === "always" || senderLabels === "auto" && isGroupChat;
|
|
6891
7579
|
const showAvatars = showAvatarsProp ?? (layout === "list" ? true : layout === "compact" ? false : avatars === "always" || avatars === "auto" && isGroupChat);
|
|
@@ -6899,24 +7587,22 @@ function ConversationView({
|
|
|
6899
7587
|
[layout, density, timeFormat, slots]
|
|
6900
7588
|
);
|
|
6901
7589
|
const [draftFor, setDraftFor] = react.useState(conversationId);
|
|
6902
|
-
const [draftText, setDraftText] = react.useState(
|
|
6903
|
-
() => sharedDraftStore.peek(conversationId)?.text ?? ""
|
|
6904
|
-
);
|
|
7590
|
+
const [draftText, setDraftText] = react.useState(() => drafts.peek(conversationId)?.text ?? "");
|
|
6905
7591
|
const [replyingTo, setReplyingTo] = react.useState(
|
|
6906
|
-
() =>
|
|
7592
|
+
() => drafts.peek(conversationId)?.quote ?? null
|
|
6907
7593
|
);
|
|
6908
7594
|
const touchedRef = react.useRef(false);
|
|
6909
7595
|
const [storedDraftRead, setStoredDraftRead] = react.useState(false);
|
|
6910
7596
|
react.useEffect(() => {
|
|
6911
7597
|
let live = true;
|
|
6912
7598
|
touchedRef.current = false;
|
|
6913
|
-
const inMemory =
|
|
7599
|
+
const inMemory = drafts.peek(conversationId);
|
|
6914
7600
|
setDraftFor(conversationId);
|
|
6915
7601
|
setDraftText(inMemory?.text ?? "");
|
|
6916
7602
|
setReplyingTo(inMemory?.quote ?? null);
|
|
6917
7603
|
if (!inMemory && storage) {
|
|
6918
7604
|
setStoredDraftRead(false);
|
|
6919
|
-
void
|
|
7605
|
+
void drafts.load(conversationId, storage).then((d) => {
|
|
6920
7606
|
if (!live) return;
|
|
6921
7607
|
setStoredDraftRead(true);
|
|
6922
7608
|
if (!d || touchedRef.current) return;
|
|
@@ -6934,23 +7620,23 @@ function ConversationView({
|
|
|
6934
7620
|
react.useEffect(() => {
|
|
6935
7621
|
if (draftFor !== conversationId) return;
|
|
6936
7622
|
const draft = { text: draftText, quote: replyingTo };
|
|
6937
|
-
|
|
7623
|
+
drafts.save(conversationId, draft);
|
|
6938
7624
|
if (!storage || !storedDraftRead) return;
|
|
6939
7625
|
pendingDraftRef.current = { id: conversationId, draft };
|
|
6940
7626
|
const t = setTimeout(() => {
|
|
6941
7627
|
pendingDraftRef.current = null;
|
|
6942
|
-
|
|
7628
|
+
drafts.save(conversationId, draft, storage);
|
|
6943
7629
|
}, 400);
|
|
6944
7630
|
return () => clearTimeout(t);
|
|
6945
|
-
}, [draftFor, conversationId, draftText, replyingTo, storage, storedDraftRead]);
|
|
7631
|
+
}, [drafts, draftFor, conversationId, draftText, replyingTo, storage, storedDraftRead]);
|
|
6946
7632
|
const storageRef = react.useRef(storage);
|
|
6947
7633
|
storageRef.current = storage;
|
|
6948
7634
|
react.useEffect(
|
|
6949
7635
|
() => () => {
|
|
6950
7636
|
const pending = pendingDraftRef.current;
|
|
6951
|
-
if (pending)
|
|
7637
|
+
if (pending) drafts.save(pending.id, pending.draft, storageRef.current);
|
|
6952
7638
|
},
|
|
6953
|
-
[]
|
|
7639
|
+
[drafts]
|
|
6954
7640
|
);
|
|
6955
7641
|
const [notice, setNotice] = react.useState(null);
|
|
6956
7642
|
react.useEffect(() => {
|
|
@@ -7137,6 +7823,10 @@ function ConversationView({
|
|
|
7137
7823
|
showPresence,
|
|
7138
7824
|
linkPreviews,
|
|
7139
7825
|
...markable ? { onMarkUnread: () => markMessageUnread(msg) } : {},
|
|
7826
|
+
...msg.local_status ? {
|
|
7827
|
+
onRetrySend: () => void retrySend(msg.id).catch(() => void 0),
|
|
7828
|
+
onDiscardSend: () => discardSend(msg.id)
|
|
7829
|
+
} : {},
|
|
7140
7830
|
...linkPreviews && isSelf && !tombstone && (msg.link_previews?.length ?? 0) > 0 ? { onRemoveLinkPreview: (url) => removeLinkPreview(msg.id, url) } : {},
|
|
7141
7831
|
reactions,
|
|
7142
7832
|
attachments,
|
|
@@ -7160,6 +7850,7 @@ function ConversationView({
|
|
|
7160
7850
|
groupPosition,
|
|
7161
7851
|
markdown,
|
|
7162
7852
|
...onCallBack ? { onCallBack } : {},
|
|
7853
|
+
nameForUserId,
|
|
7163
7854
|
...layoutProps,
|
|
7164
7855
|
mentionsMe: mentionsViewer(msg, meId)
|
|
7165
7856
|
}
|
|
@@ -7168,6 +7859,8 @@ function ConversationView({
|
|
|
7168
7859
|
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { backgroundColor: theme.colors.accentSoft }, children: row });
|
|
7169
7860
|
},
|
|
7170
7861
|
[
|
|
7862
|
+
retrySend,
|
|
7863
|
+
discardSend,
|
|
7171
7864
|
onCallBack,
|
|
7172
7865
|
onQuotedClick,
|
|
7173
7866
|
onSenderPress,
|
|
@@ -7197,7 +7890,8 @@ function ConversationView({
|
|
|
7197
7890
|
linkPreviews,
|
|
7198
7891
|
markUnread,
|
|
7199
7892
|
markMessageUnread,
|
|
7200
|
-
removeLinkPreview
|
|
7893
|
+
removeLinkPreview,
|
|
7894
|
+
nameForUserId
|
|
7201
7895
|
]
|
|
7202
7896
|
);
|
|
7203
7897
|
const renderItem = react.useCallback(
|
|
@@ -7243,9 +7937,17 @@ function ConversationView({
|
|
|
7243
7937
|
const composerProps = react.useMemo(
|
|
7244
7938
|
() => ({
|
|
7245
7939
|
onSend: async (body, opts) => {
|
|
7940
|
+
const id = sdk.safeUuid();
|
|
7246
7941
|
try {
|
|
7247
|
-
await send({ body, ...opts });
|
|
7942
|
+
await send({ body, ...opts, id });
|
|
7248
7943
|
} catch (err) {
|
|
7944
|
+
const kept = err instanceof sdk.MessageQueuedError || chat.outboxEnabled && !isQuoteGone(err);
|
|
7945
|
+
if (kept) {
|
|
7946
|
+
setReplyingTo(null);
|
|
7947
|
+
setAutoReadPaused(false);
|
|
7948
|
+
return;
|
|
7949
|
+
}
|
|
7950
|
+
if (isQuoteGone(err)) discardSend(id);
|
|
7249
7951
|
setDraftText((now) => now ? now : body);
|
|
7250
7952
|
if (isQuoteGone(err)) setReplyingTo(null);
|
|
7251
7953
|
setNotice(sendErrorNotice(err));
|
|
@@ -7278,6 +7980,8 @@ function ConversationView({
|
|
|
7278
7980
|
}),
|
|
7279
7981
|
[
|
|
7280
7982
|
send,
|
|
7983
|
+
chat.outboxEnabled,
|
|
7984
|
+
discardSend,
|
|
7281
7985
|
signalTyping,
|
|
7282
7986
|
attachments,
|
|
7283
7987
|
replyingTo,
|
|
@@ -7305,7 +8009,7 @@ function ConversationView({
|
|
|
7305
8009
|
return /* @__PURE__ */ jsxRuntime.jsx(UploadProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7306
8010
|
reactNative.KeyboardAvoidingView,
|
|
7307
8011
|
{
|
|
7308
|
-
style: [
|
|
8012
|
+
style: [styles32.root, { backgroundColor: theme.colors.background }],
|
|
7309
8013
|
behavior: reactNative.Platform.OS === "ios" ? "padding" : "height",
|
|
7310
8014
|
keyboardVerticalOffset: keyboardOffset,
|
|
7311
8015
|
children: [
|
|
@@ -7314,7 +8018,7 @@ function ConversationView({
|
|
|
7314
8018
|
reactNative.Text,
|
|
7315
8019
|
{
|
|
7316
8020
|
style: [
|
|
7317
|
-
|
|
8021
|
+
styles32.notice,
|
|
7318
8022
|
{ color: theme.colors.textMuted, backgroundColor: theme.colors.surfaceAlt }
|
|
7319
8023
|
],
|
|
7320
8024
|
accessibilityRole: "alert",
|
|
@@ -7330,7 +8034,7 @@ function ConversationView({
|
|
|
7330
8034
|
onJoin: onJoinCall
|
|
7331
8035
|
}
|
|
7332
8036
|
) : null,
|
|
7333
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
8037
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles32.listWrap, children: [
|
|
7334
8038
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7335
8039
|
MessageList,
|
|
7336
8040
|
{
|
|
@@ -7349,7 +8053,7 @@ function ConversationView({
|
|
|
7349
8053
|
(stream) => stream.status === "failed" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7350
8054
|
reactNative.Text,
|
|
7351
8055
|
{
|
|
7352
|
-
style: [
|
|
8056
|
+
style: [styles32.streamFailed, { color: theme.colors.textSubtle }],
|
|
7353
8057
|
accessibilityRole: "alert",
|
|
7354
8058
|
children: stream.error ? `The agent couldn't reply: ${stream.error}` : "The agent couldn't reply."
|
|
7355
8059
|
},
|
|
@@ -7376,7 +8080,13 @@ function ConversationView({
|
|
|
7376
8080
|
),
|
|
7377
8081
|
/* @__PURE__ */ jsxRuntime.jsx(TypingIndicator, { typing, ...labelFor ? { labelFor } : {} })
|
|
7378
8082
|
] }),
|
|
7379
|
-
|
|
8083
|
+
emptyState: emptyState !== void 0 ? emptyState : /* @__PURE__ */ jsxRuntime.jsx(
|
|
8084
|
+
EmptyState,
|
|
8085
|
+
{
|
|
8086
|
+
title: "No messages yet",
|
|
8087
|
+
...showComposer ? { hint: "Write the first message below \u2014 everyone here will see it." } : {}
|
|
8088
|
+
}
|
|
8089
|
+
)
|
|
7380
8090
|
}
|
|
7381
8091
|
),
|
|
7382
8092
|
unreadPending ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -7384,7 +8094,7 @@ function ConversationView({
|
|
|
7384
8094
|
{
|
|
7385
8095
|
onPress: jumpToUnread,
|
|
7386
8096
|
style: [
|
|
7387
|
-
|
|
8097
|
+
styles32.unreadPill,
|
|
7388
8098
|
{ backgroundColor: theme.colors.accent, borderRadius: theme.radii.pill },
|
|
7389
8099
|
theme.shadows.sm
|
|
7390
8100
|
],
|
|
@@ -7400,7 +8110,7 @@ function ConversationView({
|
|
|
7400
8110
|
label: null
|
|
7401
8111
|
}
|
|
7402
8112
|
),
|
|
7403
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
8113
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles32.unreadPillText, { color: theme.colors.accentText }], children: seekingUnread ? "Loading\u2026" : "New messages" }),
|
|
7404
8114
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7405
8115
|
reactNative.Pressable,
|
|
7406
8116
|
{
|
|
@@ -7417,7 +8127,7 @@ function ConversationView({
|
|
|
7417
8127
|
editingId ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7418
8128
|
reactNative.Pressable,
|
|
7419
8129
|
{
|
|
7420
|
-
style: [
|
|
8130
|
+
style: [styles32.editBackdrop, { backgroundColor: theme.colors.overlay }],
|
|
7421
8131
|
onPress: () => setEditingId(null),
|
|
7422
8132
|
accessibilityLabel: "Cancel editing"
|
|
7423
8133
|
}
|
|
@@ -7479,7 +8189,7 @@ function readStateForMessage(msg, members, meId, sequenceByMessageId) {
|
|
|
7479
8189
|
return anyRead ? "read" : "sent";
|
|
7480
8190
|
}
|
|
7481
8191
|
var NEW_MESSAGES_KEY = "new-messages";
|
|
7482
|
-
var
|
|
8192
|
+
var styles32 = reactNative.StyleSheet.create({
|
|
7483
8193
|
root: {
|
|
7484
8194
|
flex: 1
|
|
7485
8195
|
},
|
|
@@ -7615,15 +8325,15 @@ function UserPickerSheet({
|
|
|
7615
8325
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7616
8326
|
reactNative.View,
|
|
7617
8327
|
{
|
|
7618
|
-
style:
|
|
8328
|
+
style: styles33.modalRoot,
|
|
7619
8329
|
onLayout: (e) => setRootHeight(Math.round(e.nativeEvent.layout.height)),
|
|
7620
8330
|
children: [
|
|
7621
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style:
|
|
8331
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles33.backdrop, onPress: handleClose }),
|
|
7622
8332
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7623
8333
|
reactNative.Animated.View,
|
|
7624
8334
|
{
|
|
7625
8335
|
style: [
|
|
7626
|
-
|
|
8336
|
+
styles33.sheet,
|
|
7627
8337
|
{
|
|
7628
8338
|
backgroundColor: theme.colors.background,
|
|
7629
8339
|
borderTopLeftRadius: theme.radii.xl,
|
|
@@ -7641,18 +8351,18 @@ function UserPickerSheet({
|
|
|
7641
8351
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7642
8352
|
reactNative.KeyboardAvoidingView,
|
|
7643
8353
|
{
|
|
7644
|
-
style:
|
|
8354
|
+
style: styles33.kav,
|
|
7645
8355
|
behavior: "padding",
|
|
7646
8356
|
keyboardVerticalOffset: screenHeight - sheetHeight,
|
|
7647
8357
|
children: [
|
|
7648
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { ...panHandlers, style:
|
|
7649
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
8358
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { ...panHandlers, style: styles33.dragHandle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles33.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
|
|
8359
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles33.header, children: [
|
|
7650
8360
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7651
8361
|
reactNative.Pressable,
|
|
7652
8362
|
{
|
|
7653
8363
|
onPress: handleClose,
|
|
7654
8364
|
hitSlop: 16,
|
|
7655
|
-
style: [
|
|
8365
|
+
style: [styles33.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
|
|
7656
8366
|
accessibilityLabel: "Close picker",
|
|
7657
8367
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
|
|
7658
8368
|
}
|
|
@@ -7661,7 +8371,7 @@ function UserPickerSheet({
|
|
|
7661
8371
|
reactNative.Text,
|
|
7662
8372
|
{
|
|
7663
8373
|
style: [
|
|
7664
|
-
|
|
8374
|
+
styles33.title,
|
|
7665
8375
|
{ color: theme.colors.text, fontFamily: theme.fonts.display }
|
|
7666
8376
|
],
|
|
7667
8377
|
numberOfLines: 1,
|
|
@@ -7675,7 +8385,7 @@ function UserPickerSheet({
|
|
|
7675
8385
|
disabled: !canCreate,
|
|
7676
8386
|
hitSlop: 6,
|
|
7677
8387
|
style: [
|
|
7678
|
-
|
|
8388
|
+
styles33.createBtn,
|
|
7679
8389
|
{
|
|
7680
8390
|
backgroundColor: canCreate ? theme.colors.accent : theme.colors.surfaceAlt,
|
|
7681
8391
|
opacity: canCreate ? 1 : 0.6
|
|
@@ -7706,7 +8416,7 @@ function UserPickerSheet({
|
|
|
7706
8416
|
value: groupName,
|
|
7707
8417
|
onChangeText: setGroupName,
|
|
7708
8418
|
style: [
|
|
7709
|
-
|
|
8419
|
+
styles33.groupNameInput,
|
|
7710
8420
|
{
|
|
7711
8421
|
color: theme.colors.text,
|
|
7712
8422
|
backgroundColor: theme.colors.surfaceAlt,
|
|
@@ -7725,7 +8435,7 @@ function UserPickerSheet({
|
|
|
7725
8435
|
value: query,
|
|
7726
8436
|
onChangeText: setQuery,
|
|
7727
8437
|
style: [
|
|
7728
|
-
|
|
8438
|
+
styles33.searchInput,
|
|
7729
8439
|
{
|
|
7730
8440
|
color: theme.colors.text,
|
|
7731
8441
|
backgroundColor: theme.colors.surfaceAlt,
|
|
@@ -7742,7 +8452,7 @@ function UserPickerSheet({
|
|
|
7742
8452
|
data: filtered,
|
|
7743
8453
|
keyExtractor: (u) => u.externalId,
|
|
7744
8454
|
keyboardShouldPersistTaps: "handled",
|
|
7745
|
-
ListEmptyComponent: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
8455
|
+
ListEmptyComponent: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles33.empty, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles33.emptyText, { color: theme.colors.textSubtle }], children: query ? "No matches." : "No users to show." }) }),
|
|
7746
8456
|
renderItem: ({ item }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7747
8457
|
UserRow,
|
|
7748
8458
|
{
|
|
@@ -7784,29 +8494,29 @@ function UserRow({
|
|
|
7784
8494
|
{
|
|
7785
8495
|
onPress,
|
|
7786
8496
|
style: [
|
|
7787
|
-
|
|
8497
|
+
styles33.row,
|
|
7788
8498
|
{
|
|
7789
8499
|
backgroundColor: selected ? theme.colors.accentSoft : "transparent"
|
|
7790
8500
|
}
|
|
7791
8501
|
],
|
|
7792
8502
|
children: [
|
|
7793
|
-
user.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { source: { uri: user.avatarUrl }, style:
|
|
7794
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
8503
|
+
user.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { source: { uri: user.avatarUrl }, style: styles33.avatarImg }) : /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: null, name: user.name, seed: user.externalId, size: "md" }),
|
|
8504
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles33.body, children: [
|
|
7795
8505
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7796
8506
|
reactNative.Text,
|
|
7797
8507
|
{
|
|
7798
|
-
style: [
|
|
8508
|
+
style: [styles33.name, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
7799
8509
|
numberOfLines: 1,
|
|
7800
8510
|
children: user.name
|
|
7801
8511
|
}
|
|
7802
8512
|
),
|
|
7803
|
-
user.subtitle ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
8513
|
+
user.subtitle ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles33.subtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: user.subtitle }) : null
|
|
7804
8514
|
] }),
|
|
7805
8515
|
isGroup ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7806
8516
|
reactNative.View,
|
|
7807
8517
|
{
|
|
7808
8518
|
style: [
|
|
7809
|
-
|
|
8519
|
+
styles33.checkbox,
|
|
7810
8520
|
{
|
|
7811
8521
|
borderColor: selected ? theme.colors.accent : theme.colors.border,
|
|
7812
8522
|
backgroundColor: selected ? theme.colors.accent : "transparent"
|
|
@@ -7819,7 +8529,7 @@ function UserRow({
|
|
|
7819
8529
|
}
|
|
7820
8530
|
);
|
|
7821
8531
|
}
|
|
7822
|
-
var
|
|
8532
|
+
var styles33 = reactNative.StyleSheet.create({
|
|
7823
8533
|
modalRoot: {
|
|
7824
8534
|
flex: 1,
|
|
7825
8535
|
justifyContent: "flex-end"
|
|
@@ -8090,7 +8800,7 @@ var PoolseInbox = react.forwardRef(
|
|
|
8090
8800
|
},
|
|
8091
8801
|
[renderConversationRow, meExternalId, meId, labelFor, avatarFor, unreadCounts, showPresence]
|
|
8092
8802
|
);
|
|
8093
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
8803
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles34.root, { backgroundColor: theme.colors.background }], children: [
|
|
8094
8804
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8095
8805
|
reactNative.Animated.View,
|
|
8096
8806
|
{
|
|
@@ -8101,7 +8811,7 @@ var PoolseInbox = react.forwardRef(
|
|
|
8101
8811
|
reactNative.View,
|
|
8102
8812
|
{
|
|
8103
8813
|
style: [
|
|
8104
|
-
|
|
8814
|
+
styles34.listHeader,
|
|
8105
8815
|
{
|
|
8106
8816
|
backgroundColor: theme.colors.surface,
|
|
8107
8817
|
borderBottomColor: theme.colors.border
|
|
@@ -8112,13 +8822,13 @@ var PoolseInbox = react.forwardRef(
|
|
|
8112
8822
|
reactNative.Text,
|
|
8113
8823
|
{
|
|
8114
8824
|
style: [
|
|
8115
|
-
|
|
8825
|
+
styles34.listTitle,
|
|
8116
8826
|
{ color: theme.colors.text, fontFamily: theme.fonts.display }
|
|
8117
8827
|
],
|
|
8118
8828
|
children: title
|
|
8119
8829
|
}
|
|
8120
8830
|
),
|
|
8121
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
8831
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles34.headerActions, children: [
|
|
8122
8832
|
users ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8123
8833
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8124
8834
|
HeaderIconButton,
|
|
@@ -8234,7 +8944,7 @@ function HeaderIconButton({
|
|
|
8234
8944
|
hitSlop: 10,
|
|
8235
8945
|
accessibilityLabel: label,
|
|
8236
8946
|
style: ({ pressed }) => [
|
|
8237
|
-
|
|
8947
|
+
styles34.iconBtn,
|
|
8238
8948
|
{
|
|
8239
8949
|
backgroundColor: pressed ? theme.colors.surfaceAlt : "transparent"
|
|
8240
8950
|
}
|
|
@@ -8267,7 +8977,7 @@ function DefaultConversationRow({
|
|
|
8267
8977
|
{
|
|
8268
8978
|
onPress,
|
|
8269
8979
|
style: [
|
|
8270
|
-
|
|
8980
|
+
styles34.row,
|
|
8271
8981
|
{
|
|
8272
8982
|
backgroundColor: selected ? theme.colors.surfaceAlt : "transparent",
|
|
8273
8983
|
borderBottomColor: theme.colors.border
|
|
@@ -8284,23 +8994,23 @@ function DefaultConversationRow({
|
|
|
8284
8994
|
...presence ? { presence: presence.state, doNotDisturb: !!presence.do_not_disturb } : {}
|
|
8285
8995
|
}
|
|
8286
8996
|
),
|
|
8287
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
8997
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles34.rowBody, children: [
|
|
8288
8998
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8289
8999
|
reactNative.Text,
|
|
8290
9000
|
{
|
|
8291
|
-
style: [
|
|
9001
|
+
style: [styles34.rowTitle, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
8292
9002
|
numberOfLines: 1,
|
|
8293
9003
|
children: title
|
|
8294
9004
|
}
|
|
8295
9005
|
),
|
|
8296
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
9006
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles34.rowSubtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: react$1.formatCallLogPreview(conv.last_message_preview, meId) ?? react$1.formatRecordingNoticePreview(conv.last_message_preview, meId) ?? conv.last_message_preview ?? (isDirect ? otherExtId ?? "" : `${(conv.member_external_ids ?? []).length} members`) })
|
|
8297
9007
|
] }),
|
|
8298
|
-
unread > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
9008
|
+
unread > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles34.unreadPill, { backgroundColor: theme.colors.badge }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles34.unreadText, { color: theme.colors.badgeText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
|
|
8299
9009
|
]
|
|
8300
9010
|
}
|
|
8301
9011
|
);
|
|
8302
9012
|
}
|
|
8303
|
-
var
|
|
9013
|
+
var styles34 = reactNative.StyleSheet.create({
|
|
8304
9014
|
root: {
|
|
8305
9015
|
flex: 1,
|
|
8306
9016
|
overflow: "hidden"
|
|
@@ -8362,6 +9072,439 @@ var styles31 = reactNative.StyleSheet.create({
|
|
|
8362
9072
|
fontWeight: "700"
|
|
8363
9073
|
}
|
|
8364
9074
|
});
|
|
9075
|
+
function LiveTranscriptPanel({
|
|
9076
|
+
callId,
|
|
9077
|
+
enabled = true,
|
|
9078
|
+
showControls = true,
|
|
9079
|
+
onClose,
|
|
9080
|
+
title = "Live transcript",
|
|
9081
|
+
style
|
|
9082
|
+
}) {
|
|
9083
|
+
const theme = useTheme();
|
|
9084
|
+
const live = react$1.useLiveTranscript(callId, { enabled });
|
|
9085
|
+
const blocks = react.useMemo(() => react$1.groupTranscript(live.segments), [live.segments]);
|
|
9086
|
+
const scroller = react.useRef(null);
|
|
9087
|
+
const pinned = react.useRef(true);
|
|
9088
|
+
const error = live.error ? transcriptError(live.error) : null;
|
|
9089
|
+
const text = { color: theme.colors.text, fontFamily: theme.fonts.body };
|
|
9090
|
+
const subtle = { color: theme.colors.textSubtle, fontFamily: theme.fonts.body };
|
|
9091
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles35.panel, { backgroundColor: theme.colors.surface }, style], children: [
|
|
9092
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles35.head, { borderColor: theme.colors.border }], children: [
|
|
9093
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles35.title, text], numberOfLines: 1, accessibilityRole: "header", children: [
|
|
9094
|
+
live.live ? "\u25CF " : "",
|
|
9095
|
+
title
|
|
9096
|
+
] }),
|
|
9097
|
+
showControls && callId ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9098
|
+
reactNative.Pressable,
|
|
9099
|
+
{
|
|
9100
|
+
onPress: () => void (live.live ? live.stop() : live.start()),
|
|
9101
|
+
disabled: live.pending,
|
|
9102
|
+
accessibilityRole: "button",
|
|
9103
|
+
accessibilityLabel: live.live ? "Stop the transcript" : "Start the transcript",
|
|
9104
|
+
hitSlop: 8,
|
|
9105
|
+
style: ({ pressed }) => [
|
|
9106
|
+
styles35.btn,
|
|
9107
|
+
{ backgroundColor: theme.colors.surfaceAlt, borderColor: theme.colors.border },
|
|
9108
|
+
(pressed || live.pending) && styles35.pressed
|
|
9109
|
+
],
|
|
9110
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.btnText, text], children: live.live ? "Stop" : live.transcript ? "Resume" : "Start" })
|
|
9111
|
+
}
|
|
9112
|
+
) : null,
|
|
9113
|
+
onClose ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9114
|
+
reactNative.Pressable,
|
|
9115
|
+
{
|
|
9116
|
+
onPress: onClose,
|
|
9117
|
+
accessibilityRole: "button",
|
|
9118
|
+
accessibilityLabel: "Close transcript",
|
|
9119
|
+
hitSlop: 8,
|
|
9120
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.textMuted, label: null })
|
|
9121
|
+
}
|
|
9122
|
+
) : null
|
|
9123
|
+
] }),
|
|
9124
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9125
|
+
reactNative.ScrollView,
|
|
9126
|
+
{
|
|
9127
|
+
ref: scroller,
|
|
9128
|
+
style: styles35.body,
|
|
9129
|
+
contentContainerStyle: styles35.bodyContent,
|
|
9130
|
+
onScroll: (e) => {
|
|
9131
|
+
const { contentOffset, contentSize, layoutMeasurement } = e.nativeEvent;
|
|
9132
|
+
pinned.current = contentSize.height - contentOffset.y - layoutMeasurement.height < 24;
|
|
9133
|
+
},
|
|
9134
|
+
scrollEventThrottle: 100,
|
|
9135
|
+
onContentSizeChange: () => {
|
|
9136
|
+
if (pinned.current) scroller.current?.scrollToEnd({ animated: false });
|
|
9137
|
+
},
|
|
9138
|
+
accessibilityLiveRegion: "polite",
|
|
9139
|
+
children: blocks.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.empty, subtle], children: error ?? (live.live ? "Listening\u2026" : live.joined ? "Transcription is off. Start it to see what is said." : "Opening the transcript\u2026") }) : blocks.map((b, i) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles35.block, children: [
|
|
9140
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles35.who, children: [
|
|
9141
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.name, text], numberOfLines: 1, children: b.name }),
|
|
9142
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.time, subtle], children: react$1.formatCallDuration(b.startMs) })
|
|
9143
|
+
] }),
|
|
9144
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.text, text], children: b.segments.map((s, k) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: s.final ? void 0 : { color: theme.colors.textSubtle }, children: [
|
|
9145
|
+
k > 0 ? " " : "",
|
|
9146
|
+
s.text
|
|
9147
|
+
] }, k)) })
|
|
9148
|
+
] }, `${b.speaker}-${b.startMs}-${i}`))
|
|
9149
|
+
}
|
|
9150
|
+
),
|
|
9151
|
+
error && blocks.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.error, { color: theme.colors.danger, fontFamily: theme.fonts.body }], children: error }) : null
|
|
9152
|
+
] });
|
|
9153
|
+
}
|
|
9154
|
+
function TranscriptViewer({
|
|
9155
|
+
callId,
|
|
9156
|
+
canRename = true,
|
|
9157
|
+
onSeek,
|
|
9158
|
+
title = "Transcript",
|
|
9159
|
+
style
|
|
9160
|
+
}) {
|
|
9161
|
+
const theme = useTheme();
|
|
9162
|
+
const { transcript, loading, missing, error, renameSpeakers } = react$1.useTranscript(callId);
|
|
9163
|
+
const [query, setQuery] = react.useState("");
|
|
9164
|
+
const [hit, setHit] = react.useState(0);
|
|
9165
|
+
const blocks = react.useMemo(() => react$1.groupTranscript(transcript?.segments ?? []), [transcript]);
|
|
9166
|
+
const scroller = react.useRef(null);
|
|
9167
|
+
const blockY = react.useRef(/* @__PURE__ */ new Map());
|
|
9168
|
+
const hits = react.useMemo(() => {
|
|
9169
|
+
const out = [];
|
|
9170
|
+
if (!query.trim()) return out;
|
|
9171
|
+
blocks.forEach(
|
|
9172
|
+
(block, b) => block.segments.forEach((seg, s) => {
|
|
9173
|
+
for (const r of react$1.findInText(seg.text, query)) out.push({ b, s, r });
|
|
9174
|
+
})
|
|
9175
|
+
);
|
|
9176
|
+
return out;
|
|
9177
|
+
}, [blocks, query]);
|
|
9178
|
+
const go = (next) => {
|
|
9179
|
+
setHit(next);
|
|
9180
|
+
const target = hits[next];
|
|
9181
|
+
const y = target ? blockY.current.get(target.b) : void 0;
|
|
9182
|
+
if (y !== void 0) scroller.current?.scrollTo({ y: Math.max(0, y - 40), animated: true });
|
|
9183
|
+
};
|
|
9184
|
+
const step = (d) => {
|
|
9185
|
+
if (hits.length) go((hit + d + hits.length) % hits.length);
|
|
9186
|
+
};
|
|
9187
|
+
if (!callId) return null;
|
|
9188
|
+
const text = { color: theme.colors.text, fontFamily: theme.fonts.body };
|
|
9189
|
+
const subtle = { color: theme.colors.textSubtle, fontFamily: theme.fonts.body };
|
|
9190
|
+
const meta = transcript ? [
|
|
9191
|
+
transcript.started_at ? formatDate(transcript.started_at) : null,
|
|
9192
|
+
duration(transcript),
|
|
9193
|
+
transcript.speakers.length === 1 ? "1 speaker" : `${transcript.speakers.length} speakers`
|
|
9194
|
+
].filter(Boolean).join(" \xB7 ") : null;
|
|
9195
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles35.panel, { backgroundColor: theme.colors.surface }, style], children: [
|
|
9196
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles35.head, { borderColor: theme.colors.border }], children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles35.heading, children: [
|
|
9197
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.title, text], numberOfLines: 1, accessibilityRole: "header", children: title }),
|
|
9198
|
+
meta ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.meta, subtle], numberOfLines: 1, children: meta }) : null
|
|
9199
|
+
] }) }),
|
|
9200
|
+
transcript && transcript.segments.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles35.search, { backgroundColor: theme.colors.surfaceAlt }], children: [
|
|
9201
|
+
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "search", size: 15, color: theme.colors.textSubtle, label: null }),
|
|
9202
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9203
|
+
reactNative.TextInput,
|
|
9204
|
+
{
|
|
9205
|
+
value: query,
|
|
9206
|
+
onChangeText: (v) => {
|
|
9207
|
+
setQuery(v);
|
|
9208
|
+
setHit(0);
|
|
9209
|
+
},
|
|
9210
|
+
onSubmitEditing: () => step(1),
|
|
9211
|
+
placeholder: "Search the transcript",
|
|
9212
|
+
placeholderTextColor: theme.colors.textSubtle,
|
|
9213
|
+
accessibilityLabel: "Search the transcript",
|
|
9214
|
+
returnKeyType: "search",
|
|
9215
|
+
style: [styles35.searchInput, text]
|
|
9216
|
+
}
|
|
9217
|
+
),
|
|
9218
|
+
query.trim() ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9219
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.count, subtle], accessibilityLiveRegion: "polite", children: hits.length ? `${hit + 1} of ${hits.length}` : "No matches" }),
|
|
9220
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9221
|
+
reactNative.Pressable,
|
|
9222
|
+
{
|
|
9223
|
+
onPress: () => step(-1),
|
|
9224
|
+
disabled: !hits.length,
|
|
9225
|
+
accessibilityRole: "button",
|
|
9226
|
+
accessibilityLabel: "Previous match",
|
|
9227
|
+
hitSlop: 6,
|
|
9228
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9229
|
+
PoolseIcon,
|
|
9230
|
+
{
|
|
9231
|
+
name: "chevron-up",
|
|
9232
|
+
size: 16,
|
|
9233
|
+
color: theme.colors.textMuted,
|
|
9234
|
+
label: null
|
|
9235
|
+
}
|
|
9236
|
+
)
|
|
9237
|
+
}
|
|
9238
|
+
),
|
|
9239
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9240
|
+
reactNative.Pressable,
|
|
9241
|
+
{
|
|
9242
|
+
onPress: () => step(1),
|
|
9243
|
+
disabled: !hits.length,
|
|
9244
|
+
accessibilityRole: "button",
|
|
9245
|
+
accessibilityLabel: "Next match",
|
|
9246
|
+
hitSlop: 6,
|
|
9247
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9248
|
+
PoolseIcon,
|
|
9249
|
+
{
|
|
9250
|
+
name: "chevron-down",
|
|
9251
|
+
size: 16,
|
|
9252
|
+
color: theme.colors.textMuted,
|
|
9253
|
+
label: null
|
|
9254
|
+
}
|
|
9255
|
+
)
|
|
9256
|
+
}
|
|
9257
|
+
)
|
|
9258
|
+
] }) : null
|
|
9259
|
+
] }) : null,
|
|
9260
|
+
transcript && transcript.speakers.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9261
|
+
SpeakerList,
|
|
9262
|
+
{
|
|
9263
|
+
speakers: transcript.speakers,
|
|
9264
|
+
canRename,
|
|
9265
|
+
onRename: renameSpeakers
|
|
9266
|
+
}
|
|
9267
|
+
) : null,
|
|
9268
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { ref: scroller, style: styles35.body, contentContainerStyle: styles35.bodyContent, children: loading && !transcript ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.empty, subtle], children: "Loading the transcript\u2026" }) : missing ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.empty, subtle], children: "This call has no transcript." }) : error && !transcript ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.empty, subtle], children: transcriptError(error) }) : transcript && transcript.segments.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.empty, subtle], children: "Nothing was said in this call." }) : blocks.map((block, b) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9269
|
+
reactNative.View,
|
|
9270
|
+
{
|
|
9271
|
+
style: styles35.block,
|
|
9272
|
+
onLayout: (e) => blockY.current.set(b, e.nativeEvent.layout.y),
|
|
9273
|
+
children: [
|
|
9274
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles35.who, children: [
|
|
9275
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.name, text], numberOfLines: 1, children: block.name }),
|
|
9276
|
+
onSeek ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9277
|
+
reactNative.Pressable,
|
|
9278
|
+
{
|
|
9279
|
+
onPress: () => onSeek(block.startMs),
|
|
9280
|
+
accessibilityRole: "button",
|
|
9281
|
+
accessibilityLabel: `Play from ${react$1.formatCallDuration(block.startMs)}`,
|
|
9282
|
+
hitSlop: 6,
|
|
9283
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.time, subtle, styles35.timeLink], children: react$1.formatCallDuration(block.startMs) })
|
|
9284
|
+
}
|
|
9285
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.time, subtle], children: react$1.formatCallDuration(block.startMs) })
|
|
9286
|
+
] }),
|
|
9287
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.text, text], children: block.segments.map((seg, s) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { children: [
|
|
9288
|
+
s > 0 ? " " : "",
|
|
9289
|
+
highlight(seg, hits, b, s, hit, theme.colors.warning)
|
|
9290
|
+
] }, s)) })
|
|
9291
|
+
]
|
|
9292
|
+
},
|
|
9293
|
+
`${block.speaker}-${block.startMs}-${b}`
|
|
9294
|
+
)) })
|
|
9295
|
+
] });
|
|
9296
|
+
}
|
|
9297
|
+
function SpeakerList({
|
|
9298
|
+
speakers,
|
|
9299
|
+
canRename,
|
|
9300
|
+
onRename
|
|
9301
|
+
}) {
|
|
9302
|
+
const theme = useTheme();
|
|
9303
|
+
const [editing, setEditing] = react.useState(null);
|
|
9304
|
+
const [draft, setDraft] = react.useState("");
|
|
9305
|
+
const [busy, setBusy] = react.useState(false);
|
|
9306
|
+
const [error, setError] = react.useState(null);
|
|
9307
|
+
const text = { color: theme.colors.text, fontFamily: theme.fonts.body };
|
|
9308
|
+
const save = async (key, name) => {
|
|
9309
|
+
setBusy(true);
|
|
9310
|
+
setError(null);
|
|
9311
|
+
try {
|
|
9312
|
+
await onRename({ [key]: name });
|
|
9313
|
+
setEditing(null);
|
|
9314
|
+
} catch (err) {
|
|
9315
|
+
setError(
|
|
9316
|
+
err instanceof react$1.ApiError && err.status === 403 ? "Only people who were in the call can rename speakers." : err instanceof react$1.ApiError && err.code === "validation_failed" ? "Names can be up to 100 characters." : "The name could not be saved. Try again."
|
|
9317
|
+
);
|
|
9318
|
+
} finally {
|
|
9319
|
+
setBusy(false);
|
|
9320
|
+
}
|
|
9321
|
+
};
|
|
9322
|
+
const action = (label, onPress, primary = false) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
9323
|
+
reactNative.Pressable,
|
|
9324
|
+
{
|
|
9325
|
+
onPress,
|
|
9326
|
+
disabled: busy,
|
|
9327
|
+
accessibilityRole: "button",
|
|
9328
|
+
accessibilityLabel: label,
|
|
9329
|
+
hitSlop: 6,
|
|
9330
|
+
style: ({ pressed }) => [styles35.renameBtn, (pressed || busy) && styles35.pressed],
|
|
9331
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9332
|
+
reactNative.Text,
|
|
9333
|
+
{
|
|
9334
|
+
style: [
|
|
9335
|
+
styles35.renameBtnText,
|
|
9336
|
+
{
|
|
9337
|
+
color: primary ? theme.colors.accentStrong : theme.colors.text,
|
|
9338
|
+
fontFamily: theme.fonts.body
|
|
9339
|
+
}
|
|
9340
|
+
],
|
|
9341
|
+
children: label
|
|
9342
|
+
}
|
|
9343
|
+
)
|
|
9344
|
+
}
|
|
9345
|
+
);
|
|
9346
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles35.speakers, children: [
|
|
9347
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles35.speakerRow, accessibilityLabel: "Speakers", children: speakers.map(
|
|
9348
|
+
(sp) => editing === sp.key ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles35.rename, children: [
|
|
9349
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9350
|
+
reactNative.TextInput,
|
|
9351
|
+
{
|
|
9352
|
+
value: draft,
|
|
9353
|
+
onChangeText: setDraft,
|
|
9354
|
+
maxLength: 100,
|
|
9355
|
+
autoFocus: true,
|
|
9356
|
+
accessibilityLabel: "Speaker name",
|
|
9357
|
+
onSubmitEditing: () => draft.trim() && void save(sp.key, draft.trim()),
|
|
9358
|
+
style: [
|
|
9359
|
+
styles35.renameInput,
|
|
9360
|
+
text,
|
|
9361
|
+
{ borderColor: theme.colors.border, backgroundColor: theme.colors.background }
|
|
9362
|
+
]
|
|
9363
|
+
}
|
|
9364
|
+
),
|
|
9365
|
+
action("Save", () => draft.trim() && void save(sp.key, draft.trim()), true),
|
|
9366
|
+
sp.corrected ? action("Use their own name", () => void save(sp.key, null)) : null,
|
|
9367
|
+
action("Cancel", () => setEditing(null))
|
|
9368
|
+
] }, sp.key) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9369
|
+
reactNative.View,
|
|
9370
|
+
{
|
|
9371
|
+
style: [styles35.speaker, { backgroundColor: theme.colors.surfaceAlt }],
|
|
9372
|
+
children: [
|
|
9373
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.speakerName, text], numberOfLines: 1, children: sp.name?.trim() || "Speaker" }),
|
|
9374
|
+
canRename ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9375
|
+
reactNative.Pressable,
|
|
9376
|
+
{
|
|
9377
|
+
onPress: () => {
|
|
9378
|
+
setDraft(sp.name ?? "");
|
|
9379
|
+
setError(null);
|
|
9380
|
+
setEditing(sp.key);
|
|
9381
|
+
},
|
|
9382
|
+
accessibilityRole: "button",
|
|
9383
|
+
accessibilityLabel: `Rename ${sp.name?.trim() || "speaker"}`,
|
|
9384
|
+
hitSlop: 8,
|
|
9385
|
+
style: styles35.speakerEdit,
|
|
9386
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "edit", size: 13, color: theme.colors.textMuted, label: null })
|
|
9387
|
+
}
|
|
9388
|
+
) : null
|
|
9389
|
+
]
|
|
9390
|
+
},
|
|
9391
|
+
sp.key
|
|
9392
|
+
)
|
|
9393
|
+
) }),
|
|
9394
|
+
error ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles35.error, { color: theme.colors.danger, fontFamily: theme.fonts.body }], children: error }) : null
|
|
9395
|
+
] });
|
|
9396
|
+
}
|
|
9397
|
+
function highlight(seg, hits, b, s, current, color) {
|
|
9398
|
+
const mine = hits.map((h, i) => ({ ...h, i })).filter((h) => h.b === b && h.s === s);
|
|
9399
|
+
if (!mine.length) return seg.text;
|
|
9400
|
+
const out = [];
|
|
9401
|
+
let at = 0;
|
|
9402
|
+
for (const h of mine) {
|
|
9403
|
+
if (h.r[0] > at) out.push(seg.text.slice(at, h.r[0]));
|
|
9404
|
+
out.push(
|
|
9405
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { backgroundColor: hexAlpha(color, h.i === current ? 0.65 : 0.3) }, children: seg.text.slice(h.r[0], h.r[1]) }, h.i)
|
|
9406
|
+
);
|
|
9407
|
+
at = h.r[1];
|
|
9408
|
+
}
|
|
9409
|
+
if (at < seg.text.length) out.push(seg.text.slice(at));
|
|
9410
|
+
return out;
|
|
9411
|
+
}
|
|
9412
|
+
function hexAlpha(color, a) {
|
|
9413
|
+
const m = /^#([0-9a-f]{6})$/i.exec(color);
|
|
9414
|
+
if (!m) return color;
|
|
9415
|
+
const n = parseInt(m[1], 16);
|
|
9416
|
+
return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${n & 255}, ${a})`;
|
|
9417
|
+
}
|
|
9418
|
+
function duration(t) {
|
|
9419
|
+
if (!t.started_at || !t.ended_at) return null;
|
|
9420
|
+
const ms = Date.parse(t.ended_at) - Date.parse(t.started_at);
|
|
9421
|
+
return Number.isFinite(ms) && ms > 0 ? react$1.formatCallDuration(ms) : null;
|
|
9422
|
+
}
|
|
9423
|
+
function formatDate(iso) {
|
|
9424
|
+
const d = new Date(iso);
|
|
9425
|
+
if (Number.isNaN(d.getTime())) return null;
|
|
9426
|
+
return d.toLocaleString([], {
|
|
9427
|
+
month: "short",
|
|
9428
|
+
day: "numeric",
|
|
9429
|
+
hour: "numeric",
|
|
9430
|
+
minute: "2-digit"
|
|
9431
|
+
});
|
|
9432
|
+
}
|
|
9433
|
+
function transcriptError(err) {
|
|
9434
|
+
const code = err instanceof react$1.ApiError ? err.code : err.message;
|
|
9435
|
+
if (code === "forbidden") return "You can\u2019t open this transcript.";
|
|
9436
|
+
if (code === "not_found") return "There is no transcript for this call.";
|
|
9437
|
+
return react$1.captureErrorMessage(err instanceof react$1.ApiError ? err : { code });
|
|
9438
|
+
}
|
|
9439
|
+
var styles35 = reactNative.StyleSheet.create({
|
|
9440
|
+
panel: { flex: 1, minHeight: 0 },
|
|
9441
|
+
pressed: { opacity: 0.6 },
|
|
9442
|
+
head: {
|
|
9443
|
+
flexDirection: "row",
|
|
9444
|
+
alignItems: "center",
|
|
9445
|
+
gap: 8,
|
|
9446
|
+
paddingHorizontal: 12,
|
|
9447
|
+
paddingVertical: 10,
|
|
9448
|
+
borderBottomWidth: reactNative.StyleSheet.hairlineWidth
|
|
9449
|
+
},
|
|
9450
|
+
heading: { flex: 1, minWidth: 0 },
|
|
9451
|
+
title: { flex: 1, fontSize: 15, fontWeight: "600" },
|
|
9452
|
+
meta: { fontSize: 12, fontWeight: "500" },
|
|
9453
|
+
btn: {
|
|
9454
|
+
paddingHorizontal: 12,
|
|
9455
|
+
paddingVertical: 4,
|
|
9456
|
+
borderRadius: 999,
|
|
9457
|
+
borderWidth: reactNative.StyleSheet.hairlineWidth
|
|
9458
|
+
},
|
|
9459
|
+
btnText: { fontSize: 12, fontWeight: "600" },
|
|
9460
|
+
search: {
|
|
9461
|
+
flexDirection: "row",
|
|
9462
|
+
alignItems: "center",
|
|
9463
|
+
gap: 6,
|
|
9464
|
+
marginHorizontal: 12,
|
|
9465
|
+
marginTop: 8,
|
|
9466
|
+
paddingLeft: 10,
|
|
9467
|
+
paddingRight: 6,
|
|
9468
|
+
borderRadius: 12
|
|
9469
|
+
},
|
|
9470
|
+
searchInput: { flex: 1, minWidth: 0, paddingVertical: 8, fontSize: 14 },
|
|
9471
|
+
count: { fontSize: 12, fontWeight: "500", fontVariant: ["tabular-nums"] },
|
|
9472
|
+
speakers: { paddingHorizontal: 12, paddingTop: 8 },
|
|
9473
|
+
speakerRow: { flexDirection: "row", flexWrap: "wrap", gap: 6 },
|
|
9474
|
+
speaker: {
|
|
9475
|
+
flexDirection: "row",
|
|
9476
|
+
alignItems: "center",
|
|
9477
|
+
maxWidth: "100%",
|
|
9478
|
+
paddingLeft: 10,
|
|
9479
|
+
paddingRight: 4,
|
|
9480
|
+
paddingVertical: 3,
|
|
9481
|
+
borderRadius: 999
|
|
9482
|
+
},
|
|
9483
|
+
speakerName: { flexShrink: 1, maxWidth: 220, fontSize: 12, fontWeight: "500" },
|
|
9484
|
+
speakerEdit: { padding: 4 },
|
|
9485
|
+
rename: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 4, width: "100%" },
|
|
9486
|
+
renameInput: {
|
|
9487
|
+
flexGrow: 1,
|
|
9488
|
+
minWidth: 140,
|
|
9489
|
+
paddingHorizontal: 8,
|
|
9490
|
+
paddingVertical: 6,
|
|
9491
|
+
fontSize: 13,
|
|
9492
|
+
borderRadius: 8,
|
|
9493
|
+
borderWidth: reactNative.StyleSheet.hairlineWidth
|
|
9494
|
+
},
|
|
9495
|
+
renameBtn: { paddingHorizontal: 8, paddingVertical: 6 },
|
|
9496
|
+
renameBtnText: { fontSize: 12, fontWeight: "600" },
|
|
9497
|
+
body: { flex: 1 },
|
|
9498
|
+
bodyContent: { paddingHorizontal: 12, paddingTop: 8, paddingBottom: 12 },
|
|
9499
|
+
empty: { marginVertical: 24, textAlign: "center", fontSize: 14 },
|
|
9500
|
+
block: { paddingVertical: 6 },
|
|
9501
|
+
who: { flexDirection: "row", alignItems: "baseline", gap: 8, minWidth: 0 },
|
|
9502
|
+
name: { flexShrink: 1, fontSize: 13, fontWeight: "600" },
|
|
9503
|
+
time: { fontSize: 11, fontWeight: "500", fontVariant: ["tabular-nums"] },
|
|
9504
|
+
timeLink: { textDecorationLine: "underline" },
|
|
9505
|
+
text: { marginTop: 2, fontSize: 14, lineHeight: 21 },
|
|
9506
|
+
error: { marginHorizontal: 12, marginVertical: 6, fontSize: 13, fontWeight: "500" }
|
|
9507
|
+
});
|
|
8365
9508
|
var TILE_PATH = "M50 4 C20 4 4 20 4 50 C4 80 20 96 50 96 C80 96 96 80 96 50 C96 20 80 4 50 4 Z";
|
|
8366
9509
|
var PULSE_PATH = "M16 55 H34 L40 55 L47 30 L54 73 L60 55 H72";
|
|
8367
9510
|
var WORDMARK_P_PATH = "M62 -169V258V528H194L196 378L214 376Q223 432 246.0 469.0Q269 506 305.5 524.0Q342 542 389 542Q459 542 509.5 508.0Q560 474 587.0 411.0Q614 348 614 260Q614 182 590.5 120.0Q567 58 519.5 22.0Q472 -14 399 -14Q350 -14 316.0 3.5Q282 21 258.5 55.0Q235 89 219 140H200Q206 113 211.0 85.0Q216 57 219.5 31.0Q223 5 223 -19V-169ZM340 113Q373 113 396.5 131.0Q420 149 433.0 182.0Q446 215 446 259Q446 306 432.5 339.5Q419 373 394.0 391.5Q369 410 336 410Q305 410 283.5 396.5Q262 383 248.5 361.5Q235 340 229.0 316.0Q223 292 223 271V249Q223 230 228.0 211.0Q233 192 243.0 174.5Q253 157 267.0 143.0Q281 129 299.5 121.0Q318 113 340 113Z";
|
|
@@ -8436,9 +9579,9 @@ function useAppStateLifecycle(options = {}) {
|
|
|
8436
9579
|
const sub = reactNative.AppState.addEventListener("change", (next) => {
|
|
8437
9580
|
if (next === "background") {
|
|
8438
9581
|
setActivity("idle");
|
|
8439
|
-
poolse.
|
|
9582
|
+
poolse.setBackground(true);
|
|
8440
9583
|
} else if (next === "active") {
|
|
8441
|
-
poolse.
|
|
9584
|
+
poolse.setBackground(false);
|
|
8442
9585
|
setActivity("active");
|
|
8443
9586
|
} else {
|
|
8444
9587
|
setActivity("idle");
|
|
@@ -8448,6 +9591,41 @@ function useAppStateLifecycle(options = {}) {
|
|
|
8448
9591
|
}, [poolse, presence]);
|
|
8449
9592
|
}
|
|
8450
9593
|
|
|
9594
|
+
// src/internal/background.ts
|
|
9595
|
+
function applyBackground(clients, active, appActive, keepConnected = []) {
|
|
9596
|
+
for (const c of clients) {
|
|
9597
|
+
if (c.destroyed) continue;
|
|
9598
|
+
const foreground = appActive && (c === active || keepConnected.includes(c));
|
|
9599
|
+
c.setBackground(!foreground);
|
|
9600
|
+
}
|
|
9601
|
+
}
|
|
9602
|
+
|
|
9603
|
+
// src/lifecycle/useBackgroundClients.ts
|
|
9604
|
+
function useBackgroundClients(clients, active, opts = {}) {
|
|
9605
|
+
const [appState, setAppState] = react.useState(reactNative.AppState.currentState ?? "active");
|
|
9606
|
+
react.useEffect(() => {
|
|
9607
|
+
const sub = reactNative.AppState.addEventListener("change", setAppState);
|
|
9608
|
+
return () => sub.remove();
|
|
9609
|
+
}, []);
|
|
9610
|
+
const appActive = appState !== "background";
|
|
9611
|
+
const keep = opts.keepConnected ?? EMPTY;
|
|
9612
|
+
const presence = opts.presence ?? true;
|
|
9613
|
+
const lastActive = react.useRef(null);
|
|
9614
|
+
react.useEffect(() => {
|
|
9615
|
+
applyBackground(clients, active, appActive, keep);
|
|
9616
|
+
}, [clients, active, appActive, keep]);
|
|
9617
|
+
react.useEffect(() => {
|
|
9618
|
+
if (!presence) return;
|
|
9619
|
+
const prev = lastActive.current;
|
|
9620
|
+
if (prev && prev !== active && !prev.destroyed) prev.presence.setActivity("idle");
|
|
9621
|
+
lastActive.current = active;
|
|
9622
|
+
if (active && !active.destroyed) {
|
|
9623
|
+
active.presence.setActivity(appState === "active" ? "active" : "idle");
|
|
9624
|
+
}
|
|
9625
|
+
}, [active, appState, presence]);
|
|
9626
|
+
}
|
|
9627
|
+
var EMPTY = [];
|
|
9628
|
+
|
|
8451
9629
|
// src/voice/callTheme.ts
|
|
8452
9630
|
var callColors = {
|
|
8453
9631
|
/** Behind everything. Near-black, cooled toward the brand. */
|
|
@@ -8496,7 +9674,7 @@ function CallControlButton({
|
|
|
8496
9674
|
const size = large ? CONTROL_SIZE_LARGE : CONTROL_SIZE;
|
|
8497
9675
|
const background = tone === "danger" ? callColors.danger : tone === "accept" ? callColors.accept : active ? callColors.controlActive : callColors.control;
|
|
8498
9676
|
const iconColor = tone === "neutral" && active ? callColors.controlActiveIcon : callColors.onAction;
|
|
8499
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
9677
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles36.slot, children: [
|
|
8500
9678
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8501
9679
|
reactNative.Pressable,
|
|
8502
9680
|
{
|
|
@@ -8507,7 +9685,7 @@ function CallControlButton({
|
|
|
8507
9685
|
accessibilityLabel: accessibilityLabel ?? label ?? icon,
|
|
8508
9686
|
hitSlop: 8,
|
|
8509
9687
|
style: ({ pressed }) => [
|
|
8510
|
-
|
|
9688
|
+
styles36.button,
|
|
8511
9689
|
{
|
|
8512
9690
|
width: size,
|
|
8513
9691
|
height: size,
|
|
@@ -8521,10 +9699,10 @@ function CallControlButton({
|
|
|
8521
9699
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: icon, size: large ? 30 : 25, color: iconColor, label: null })
|
|
8522
9700
|
}
|
|
8523
9701
|
),
|
|
8524
|
-
label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style:
|
|
9702
|
+
label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: styles36.label, children: label }) : null
|
|
8525
9703
|
] });
|
|
8526
9704
|
}
|
|
8527
|
-
var
|
|
9705
|
+
var styles36 = reactNative.StyleSheet.create({
|
|
8528
9706
|
// Fixed width so captions of different lengths cannot shift the row.
|
|
8529
9707
|
slot: { width: 76, alignItems: "center", gap: 7 },
|
|
8530
9708
|
button: { alignItems: "center", justifyContent: "center" },
|
|
@@ -8537,7 +9715,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
8537
9715
|
reactNative.View,
|
|
8538
9716
|
{
|
|
8539
9717
|
style: [
|
|
8540
|
-
|
|
9718
|
+
styles37.ring,
|
|
8541
9719
|
{
|
|
8542
9720
|
width: outer,
|
|
8543
9721
|
height: outer,
|
|
@@ -8550,7 +9728,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
8550
9728
|
reactNative.View,
|
|
8551
9729
|
{
|
|
8552
9730
|
style: [
|
|
8553
|
-
|
|
9731
|
+
styles37.circle,
|
|
8554
9732
|
{
|
|
8555
9733
|
width: size,
|
|
8556
9734
|
height: size,
|
|
@@ -8561,7 +9739,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
8561
9739
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8562
9740
|
reactNative.Text,
|
|
8563
9741
|
{
|
|
8564
|
-
style: [
|
|
9742
|
+
style: [styles37.initials, { fontSize: Math.round(size * 0.38) }],
|
|
8565
9743
|
numberOfLines: 1,
|
|
8566
9744
|
allowFontScaling: false,
|
|
8567
9745
|
children: initialsOf(name)
|
|
@@ -8578,7 +9756,7 @@ function initialsOf(name) {
|
|
|
8578
9756
|
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
8579
9757
|
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
8580
9758
|
}
|
|
8581
|
-
var
|
|
9759
|
+
var styles37 = reactNative.StyleSheet.create({
|
|
8582
9760
|
ring: { alignItems: "center", justifyContent: "center" },
|
|
8583
9761
|
circle: { alignItems: "center", justifyContent: "center" },
|
|
8584
9762
|
initials: { color: "#ffffff", fontWeight: "600" }
|
|
@@ -8606,15 +9784,15 @@ function AudioRouteSheet({
|
|
|
8606
9784
|
animationType: "fade",
|
|
8607
9785
|
onRequestClose: onClose,
|
|
8608
9786
|
...EDGE_TO_EDGE_MODAL,
|
|
8609
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style:
|
|
9787
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles38.backdrop, onPress: onClose, accessibilityRole: "button", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8610
9788
|
reactNative.Pressable,
|
|
8611
9789
|
{
|
|
8612
|
-
style: [
|
|
9790
|
+
style: [styles38.sheet, { paddingBottom: Math.max(34, insets.bottom + 16) }],
|
|
8613
9791
|
onPress: () => {
|
|
8614
9792
|
},
|
|
8615
9793
|
children: [
|
|
8616
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
8617
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
9794
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles38.grabber }),
|
|
9795
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles38.title, children: "Audio output" }),
|
|
8618
9796
|
routes.map((route) => {
|
|
8619
9797
|
const selected = route.id === selectedRouteId;
|
|
8620
9798
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -8626,7 +9804,7 @@ function AudioRouteSheet({
|
|
|
8626
9804
|
},
|
|
8627
9805
|
accessibilityRole: "button",
|
|
8628
9806
|
accessibilityState: { selected },
|
|
8629
|
-
style: ({ pressed }) => [
|
|
9807
|
+
style: ({ pressed }) => [styles38.row, pressed && styles38.rowPressed],
|
|
8630
9808
|
children: [
|
|
8631
9809
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8632
9810
|
PoolseIcon,
|
|
@@ -8637,7 +9815,7 @@ function AudioRouteSheet({
|
|
|
8637
9815
|
label: null
|
|
8638
9816
|
}
|
|
8639
9817
|
),
|
|
8640
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
9818
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles38.label, selected && styles38.labelSelected], children: route.label }),
|
|
8641
9819
|
selected && /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "check", size: 19, color: callColors.accept, label: "selected" })
|
|
8642
9820
|
]
|
|
8643
9821
|
},
|
|
@@ -8650,7 +9828,7 @@ function AudioRouteSheet({
|
|
|
8650
9828
|
}
|
|
8651
9829
|
);
|
|
8652
9830
|
}
|
|
8653
|
-
var
|
|
9831
|
+
var styles38 = reactNative.StyleSheet.create({
|
|
8654
9832
|
backdrop: { flex: 1, backgroundColor: "rgba(0,0,0,0.55)", justifyContent: "flex-end" },
|
|
8655
9833
|
sheet: {
|
|
8656
9834
|
backgroundColor: callColors.tile,
|
|
@@ -8742,15 +9920,18 @@ exports.CallAvatar = CallAvatar;
|
|
|
8742
9920
|
exports.CallControlButton = CallControlButton;
|
|
8743
9921
|
exports.CallLogRow = CallLogRow;
|
|
8744
9922
|
exports.ChatHeader = ChatHeader;
|
|
9923
|
+
exports.ConsentPrompt = ConsentPrompt;
|
|
8745
9924
|
exports.ConversationList = ConversationList;
|
|
8746
9925
|
exports.ConversationView = ConversationView;
|
|
8747
9926
|
exports.DaySeparator = DaySeparator;
|
|
8748
9927
|
exports.EditHistorySheet = EditHistorySheet;
|
|
8749
9928
|
exports.EmojiPicker = EmojiPicker;
|
|
9929
|
+
exports.EmptyState = EmptyState;
|
|
8750
9930
|
exports.GroupDetailsSheet = GroupDetailsSheet;
|
|
8751
9931
|
exports.ImageMosaic = ImageMosaic;
|
|
8752
9932
|
exports.LinkPreviewCard = LinkPreviewCard;
|
|
8753
9933
|
exports.LiveCallBanner = LiveCallBanner;
|
|
9934
|
+
exports.LiveTranscriptPanel = LiveTranscriptPanel;
|
|
8754
9935
|
exports.MemberList = MemberList;
|
|
8755
9936
|
exports.MentionInput = MentionInput;
|
|
8756
9937
|
exports.MessageActions = MessageActions;
|
|
@@ -8767,16 +9948,23 @@ exports.PresenceBadge = PresenceBadge;
|
|
|
8767
9948
|
exports.Primitives = primitives;
|
|
8768
9949
|
exports.ReactionPicker = ReactionPicker;
|
|
8769
9950
|
exports.ReactionStrip = ReactionStrip;
|
|
9951
|
+
exports.RecordingBanner = RecordingBanner;
|
|
9952
|
+
exports.RecordingIndicator = RecordingIndicator;
|
|
9953
|
+
exports.RecordingNoticeRow = RecordingNoticeRow;
|
|
9954
|
+
exports.SendStatus = SendStatus;
|
|
8770
9955
|
exports.ThreadSummary = ThreadSummary;
|
|
8771
9956
|
exports.ThreadView = ThreadView;
|
|
9957
|
+
exports.TranscriptViewer = TranscriptViewer;
|
|
8772
9958
|
exports.TypingIndicator = TypingIndicator;
|
|
8773
9959
|
exports.UploadQueueStrip = UploadQueueStrip;
|
|
8774
9960
|
exports.UserName = UserName;
|
|
9961
|
+
exports.applyBackground = applyBackground;
|
|
8775
9962
|
exports.callColors = callColors;
|
|
8776
9963
|
exports.defaultDarkTheme = defaultDarkTheme;
|
|
8777
9964
|
exports.defaultLightTheme = defaultLightTheme;
|
|
8778
9965
|
exports.useAppStateLifecycle = useAppStateLifecycle;
|
|
8779
9966
|
exports.useAppStatePresence = useAppStatePresence;
|
|
9967
|
+
exports.useBackgroundClients = useBackgroundClients;
|
|
8780
9968
|
exports.useCallDuration = useCallDuration;
|
|
8781
9969
|
exports.useDisplayName = useDisplayName;
|
|
8782
9970
|
exports.usePoolseTheme = usePoolseTheme;
|