@poolse/react-native 3.7.1 → 3.8.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 +19 -0
- package/README.md +27 -0
- package/dist/index.cjs +676 -344
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +77 -4
- package/dist/index.d.ts +77 -4
- package/dist/index.js +674 -346
- 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",
|
|
@@ -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",
|
|
@@ -3659,12 +3729,12 @@ function EditHistorySheet({
|
|
|
3659
3729
|
live = false;
|
|
3660
3730
|
};
|
|
3661
3731
|
}, [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: [
|
|
3732
|
+
const entry = (key, label, body, when) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles17.entry, { borderBottomColor: theme.colors.border }], children: [
|
|
3733
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles17.entryHead, children: [
|
|
3734
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles17.entryLabel, { color: theme.colors.textMuted }], children: label }),
|
|
3735
|
+
when ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles17.entryTime, { color: theme.colors.textSubtle }], children: when }) : null
|
|
3666
3736
|
] }),
|
|
3667
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3737
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles17.entryBody, { color: theme.colors.text, fontFamily: theme.fonts.body }], children: body ?? "\u2014" })
|
|
3668
3738
|
] }, key);
|
|
3669
3739
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3670
3740
|
reactNative.Modal,
|
|
@@ -3677,14 +3747,14 @@ function EditHistorySheet({
|
|
|
3677
3747
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3678
3748
|
reactNative.Pressable,
|
|
3679
3749
|
{
|
|
3680
|
-
style: [
|
|
3750
|
+
style: [styles17.backdrop, { backgroundColor: theme.colors.overlay }],
|
|
3681
3751
|
onPress: onClose,
|
|
3682
3752
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3683
3753
|
reactNative.Pressable,
|
|
3684
3754
|
{
|
|
3685
3755
|
onPress: () => void 0,
|
|
3686
3756
|
style: [
|
|
3687
|
-
|
|
3757
|
+
styles17.sheet,
|
|
3688
3758
|
{
|
|
3689
3759
|
backgroundColor: theme.colors.surface,
|
|
3690
3760
|
borderTopLeftRadius: theme.radii.lg,
|
|
@@ -3699,12 +3769,12 @@ function EditHistorySheet({
|
|
|
3699
3769
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3700
3770
|
reactNative.Text,
|
|
3701
3771
|
{
|
|
3702
|
-
style: [
|
|
3772
|
+
style: [styles17.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
|
|
3703
3773
|
accessibilityRole: "header",
|
|
3704
3774
|
children: "Edit history"
|
|
3705
3775
|
}
|
|
3706
3776
|
),
|
|
3707
|
-
failed ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3777
|
+
failed ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles17.status, { color: theme.colors.textMuted }], children: "Couldn't load the earlier versions." }) : edits === null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.accent, style: styles17.spinner }) : /* @__PURE__ */ jsxRuntime.jsxs(reactNative.ScrollView, { style: styles17.scroll, children: [
|
|
3708
3778
|
currentBody !== void 0 ? entry("current", "Current", currentBody, "") : null,
|
|
3709
3779
|
edits.map(
|
|
3710
3780
|
(e) => entry(
|
|
@@ -3714,7 +3784,7 @@ function EditHistorySheet({
|
|
|
3714
3784
|
relativeTime(e.written_at)
|
|
3715
3785
|
)
|
|
3716
3786
|
),
|
|
3717
|
-
edits.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3787
|
+
edits.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles17.status, { color: theme.colors.textMuted }], children: "No earlier versions." }) : null
|
|
3718
3788
|
] })
|
|
3719
3789
|
]
|
|
3720
3790
|
}
|
|
@@ -3724,7 +3794,7 @@ function EditHistorySheet({
|
|
|
3724
3794
|
}
|
|
3725
3795
|
);
|
|
3726
3796
|
}
|
|
3727
|
-
var
|
|
3797
|
+
var styles17 = reactNative.StyleSheet.create({
|
|
3728
3798
|
backdrop: {
|
|
3729
3799
|
flex: 1,
|
|
3730
3800
|
justifyContent: "flex-end"
|
|
@@ -3802,7 +3872,7 @@ function AttachmentPreview({
|
|
|
3802
3872
|
reactNative.View,
|
|
3803
3873
|
{
|
|
3804
3874
|
style: [
|
|
3805
|
-
|
|
3875
|
+
styles18.imagePlaceholder,
|
|
3806
3876
|
{
|
|
3807
3877
|
width: maxWidth,
|
|
3808
3878
|
height: 200,
|
|
@@ -3822,7 +3892,7 @@ function AttachmentPreview({
|
|
|
3822
3892
|
onPress,
|
|
3823
3893
|
disabled: !onPress,
|
|
3824
3894
|
style: [
|
|
3825
|
-
|
|
3895
|
+
styles18.fileCard,
|
|
3826
3896
|
{
|
|
3827
3897
|
backgroundColor: onBrand ? "rgba(255,255,255,0.18)" : theme.colors.surfaceAlt,
|
|
3828
3898
|
borderColor: onBrand ? "transparent" : theme.colors.border,
|
|
@@ -3835,12 +3905,12 @@ function AttachmentPreview({
|
|
|
3835
3905
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3836
3906
|
reactNative.Text,
|
|
3837
3907
|
{
|
|
3838
|
-
style: [
|
|
3908
|
+
style: [styles18.fileName, { color: ink, fontFamily: theme.fonts.body }],
|
|
3839
3909
|
numberOfLines: 1,
|
|
3840
3910
|
children: attachment.original_filename ?? "file"
|
|
3841
3911
|
}
|
|
3842
3912
|
),
|
|
3843
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3913
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles18.fileSize, { color: inkSoft, opacity: onBrand ? 0.8 : 1 }], children: formatBytes3(attachment.byte_size) })
|
|
3844
3914
|
] })
|
|
3845
3915
|
]
|
|
3846
3916
|
}
|
|
@@ -3852,7 +3922,7 @@ function formatBytes3(n) {
|
|
|
3852
3922
|
if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
3853
3923
|
return `${(n / 1024 / 1024 / 1024).toFixed(1)} GB`;
|
|
3854
3924
|
}
|
|
3855
|
-
var
|
|
3925
|
+
var styles18 = reactNative.StyleSheet.create({
|
|
3856
3926
|
imagePlaceholder: {},
|
|
3857
3927
|
fileCard: {
|
|
3858
3928
|
flexDirection: "row",
|
|
@@ -3888,7 +3958,7 @@ function ImageMosaic({
|
|
|
3888
3958
|
reactNative.View,
|
|
3889
3959
|
{
|
|
3890
3960
|
style: [
|
|
3891
|
-
|
|
3961
|
+
styles19.root,
|
|
3892
3962
|
{
|
|
3893
3963
|
borderTopLeftRadius: r,
|
|
3894
3964
|
borderTopRightRadius: r,
|
|
@@ -3909,18 +3979,18 @@ function ImageMosaic({
|
|
|
3909
3979
|
{
|
|
3910
3980
|
onLongPress,
|
|
3911
3981
|
attachment: visible[0],
|
|
3912
|
-
style:
|
|
3982
|
+
style: styles19.tileFull,
|
|
3913
3983
|
onPress: () => setViewerIndex(0),
|
|
3914
3984
|
overlay: null
|
|
3915
3985
|
}
|
|
3916
3986
|
) : null,
|
|
3917
|
-
n === 2 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
3987
|
+
n === 2 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles19.rowEven, children: [
|
|
3918
3988
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3919
3989
|
Tile,
|
|
3920
3990
|
{
|
|
3921
3991
|
onLongPress,
|
|
3922
3992
|
attachment: visible[0],
|
|
3923
|
-
style:
|
|
3993
|
+
style: styles19.tileHalfSquare,
|
|
3924
3994
|
onPress: () => setViewerIndex(0),
|
|
3925
3995
|
overlay: null
|
|
3926
3996
|
}
|
|
@@ -3930,7 +4000,7 @@ function ImageMosaic({
|
|
|
3930
4000
|
{
|
|
3931
4001
|
onLongPress,
|
|
3932
4002
|
attachment: visible[1],
|
|
3933
|
-
style:
|
|
4003
|
+
style: styles19.tileHalfSquare,
|
|
3934
4004
|
onPress: () => setViewerIndex(1),
|
|
3935
4005
|
overlay: null
|
|
3936
4006
|
}
|
|
@@ -3942,18 +4012,18 @@ function ImageMosaic({
|
|
|
3942
4012
|
{
|
|
3943
4013
|
onLongPress,
|
|
3944
4014
|
attachment: visible[0],
|
|
3945
|
-
style:
|
|
4015
|
+
style: styles19.tileHero,
|
|
3946
4016
|
onPress: () => setViewerIndex(0),
|
|
3947
4017
|
overlay: null
|
|
3948
4018
|
}
|
|
3949
4019
|
),
|
|
3950
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
4020
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles19.rowEven, { marginTop: 2 }], children: [
|
|
3951
4021
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3952
4022
|
Tile,
|
|
3953
4023
|
{
|
|
3954
4024
|
onLongPress,
|
|
3955
4025
|
attachment: visible[1],
|
|
3956
|
-
style:
|
|
4026
|
+
style: styles19.tileHalfSquare,
|
|
3957
4027
|
onPress: () => setViewerIndex(1),
|
|
3958
4028
|
overlay: null
|
|
3959
4029
|
}
|
|
@@ -3963,7 +4033,7 @@ function ImageMosaic({
|
|
|
3963
4033
|
{
|
|
3964
4034
|
onLongPress,
|
|
3965
4035
|
attachment: visible[2],
|
|
3966
|
-
style:
|
|
4036
|
+
style: styles19.tileHalfSquare,
|
|
3967
4037
|
onPress: () => setViewerIndex(2),
|
|
3968
4038
|
overlay: null
|
|
3969
4039
|
}
|
|
@@ -3971,13 +4041,13 @@ function ImageMosaic({
|
|
|
3971
4041
|
] })
|
|
3972
4042
|
] }) : null,
|
|
3973
4043
|
n === 4 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3974
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4044
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles19.rowEven, children: [
|
|
3975
4045
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3976
4046
|
Tile,
|
|
3977
4047
|
{
|
|
3978
4048
|
onLongPress,
|
|
3979
4049
|
attachment: visible[0],
|
|
3980
|
-
style:
|
|
4050
|
+
style: styles19.tileHalfSquare,
|
|
3981
4051
|
onPress: () => setViewerIndex(0),
|
|
3982
4052
|
overlay: null
|
|
3983
4053
|
}
|
|
@@ -3987,19 +4057,19 @@ function ImageMosaic({
|
|
|
3987
4057
|
{
|
|
3988
4058
|
onLongPress,
|
|
3989
4059
|
attachment: visible[1],
|
|
3990
|
-
style:
|
|
4060
|
+
style: styles19.tileHalfSquare,
|
|
3991
4061
|
onPress: () => setViewerIndex(1),
|
|
3992
4062
|
overlay: null
|
|
3993
4063
|
}
|
|
3994
4064
|
)
|
|
3995
4065
|
] }),
|
|
3996
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
4066
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles19.rowEven, { marginTop: 2 }], children: [
|
|
3997
4067
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3998
4068
|
Tile,
|
|
3999
4069
|
{
|
|
4000
4070
|
onLongPress,
|
|
4001
4071
|
attachment: visible[2],
|
|
4002
|
-
style:
|
|
4072
|
+
style: styles19.tileHalfSquare,
|
|
4003
4073
|
onPress: () => setViewerIndex(2),
|
|
4004
4074
|
overlay: null
|
|
4005
4075
|
}
|
|
@@ -4009,7 +4079,7 @@ function ImageMosaic({
|
|
|
4009
4079
|
{
|
|
4010
4080
|
onLongPress,
|
|
4011
4081
|
attachment: visible[3],
|
|
4012
|
-
style:
|
|
4082
|
+
style: styles19.tileHalfSquare,
|
|
4013
4083
|
onPress: () => setViewerIndex(3),
|
|
4014
4084
|
overlay: overflow > 0 ? `+${overflow}` : null
|
|
4015
4085
|
}
|
|
@@ -4047,18 +4117,18 @@ function Tile({
|
|
|
4047
4117
|
}) {
|
|
4048
4118
|
const theme = useTheme();
|
|
4049
4119
|
const { url } = react$1.useAttachmentUrl(attachment.id);
|
|
4050
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress, onLongPress, style: [
|
|
4120
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress, onLongPress, style: [styles19.tileBase, style], children: [
|
|
4051
4121
|
url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4052
4122
|
reactNative.Image,
|
|
4053
4123
|
{
|
|
4054
4124
|
source: { uri: url },
|
|
4055
|
-
style: [
|
|
4125
|
+
style: [styles19.tileImage, { backgroundColor: theme.colors.surfaceAlt }],
|
|
4056
4126
|
resizeMode: "cover",
|
|
4057
4127
|
accessible: true,
|
|
4058
4128
|
accessibilityLabel: attachment.original_filename ?? "image"
|
|
4059
4129
|
}
|
|
4060
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
4061
|
-
overlay ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
4130
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles19.tileImage, { backgroundColor: theme.colors.surfaceAlt }] }),
|
|
4131
|
+
overlay ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles19.overflow, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles19.overflowText, children: overlay }) }) : null
|
|
4062
4132
|
] });
|
|
4063
4133
|
}
|
|
4064
4134
|
function FullScreenViewer({
|
|
@@ -4068,7 +4138,7 @@ function FullScreenViewer({
|
|
|
4068
4138
|
const { url } = react$1.useAttachmentUrl(attachment.id);
|
|
4069
4139
|
const { width, height } = reactNative.useWindowDimensions();
|
|
4070
4140
|
const insets = useSafeInsets();
|
|
4071
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style:
|
|
4141
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles19.viewer, onPress: onClose, children: [
|
|
4072
4142
|
url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4073
4143
|
reactNative.Image,
|
|
4074
4144
|
{
|
|
@@ -4084,14 +4154,14 @@ function FullScreenViewer({
|
|
|
4084
4154
|
{
|
|
4085
4155
|
onPress: onClose,
|
|
4086
4156
|
hitSlop: 12,
|
|
4087
|
-
style: [
|
|
4157
|
+
style: [styles19.closeBtn, { top: insets.top + 12, right: insets.right + 16 }],
|
|
4088
4158
|
accessibilityLabel: "Close viewer",
|
|
4089
4159
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 20, color: "#ffffff" })
|
|
4090
4160
|
}
|
|
4091
4161
|
)
|
|
4092
4162
|
] });
|
|
4093
4163
|
}
|
|
4094
|
-
var
|
|
4164
|
+
var styles19 = reactNative.StyleSheet.create({
|
|
4095
4165
|
root: {
|
|
4096
4166
|
width: "100%",
|
|
4097
4167
|
overflow: "hidden",
|
|
@@ -4264,7 +4334,7 @@ function LinkPreviewCard({
|
|
|
4264
4334
|
{
|
|
4265
4335
|
onPress: onRemove,
|
|
4266
4336
|
hitSlop: 8,
|
|
4267
|
-
style: [
|
|
4337
|
+
style: [styles20.remove, { backgroundColor: theme.colors.overlay }],
|
|
4268
4338
|
accessibilityRole: "button",
|
|
4269
4339
|
accessibilityLabel: "Remove preview",
|
|
4270
4340
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 12, color: "#FFFFFF", label: null })
|
|
@@ -4280,13 +4350,13 @@ function LinkPreviewCard({
|
|
|
4280
4350
|
...onLongPress ? { onLongPress } : {},
|
|
4281
4351
|
accessibilityRole: "link",
|
|
4282
4352
|
accessibilityLabel: preview.title || "Image link",
|
|
4283
|
-
style: [
|
|
4353
|
+
style: [styles20.imageOnly, { maxWidth, borderRadius: theme.radii.md }],
|
|
4284
4354
|
children: [
|
|
4285
4355
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4286
4356
|
reactNative.Image,
|
|
4287
4357
|
{
|
|
4288
4358
|
source: { uri: src },
|
|
4289
|
-
style: [
|
|
4359
|
+
style: [styles20.inlineImage, { borderRadius: theme.radii.md }],
|
|
4290
4360
|
resizeMode: "cover",
|
|
4291
4361
|
onError: () => setImageFailed(true),
|
|
4292
4362
|
accessible: false
|
|
@@ -4306,7 +4376,7 @@ function LinkPreviewCard({
|
|
|
4306
4376
|
accessibilityRole: "link",
|
|
4307
4377
|
accessibilityLabel: [site, preview.title].filter(Boolean).join(": ") || preview.url,
|
|
4308
4378
|
style: ({ pressed }) => [
|
|
4309
|
-
|
|
4379
|
+
styles20.card,
|
|
4310
4380
|
{
|
|
4311
4381
|
maxWidth,
|
|
4312
4382
|
borderRadius: theme.radii.md,
|
|
@@ -4321,7 +4391,7 @@ function LinkPreviewCard({
|
|
|
4321
4391
|
{
|
|
4322
4392
|
source: { uri: preview.image_url },
|
|
4323
4393
|
style: [
|
|
4324
|
-
|
|
4394
|
+
styles20.cardImage,
|
|
4325
4395
|
{ borderTopLeftRadius: theme.radii.md, borderTopRightRadius: theme.radii.md }
|
|
4326
4396
|
],
|
|
4327
4397
|
resizeMode: "cover",
|
|
@@ -4329,13 +4399,13 @@ function LinkPreviewCard({
|
|
|
4329
4399
|
accessible: false
|
|
4330
4400
|
}
|
|
4331
4401
|
) : null,
|
|
4332
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
4333
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4402
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles20.cardBody, { padding: theme.spacing.sm, gap: 2 }], children: [
|
|
4403
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles20.siteLine, children: [
|
|
4334
4404
|
preview.favicon_url && !faviconFailed ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4335
4405
|
reactNative.Image,
|
|
4336
4406
|
{
|
|
4337
4407
|
source: { uri: preview.favicon_url },
|
|
4338
|
-
style:
|
|
4408
|
+
style: styles20.favicon,
|
|
4339
4409
|
onError: () => setFaviconFailed(true),
|
|
4340
4410
|
accessible: false
|
|
4341
4411
|
}
|
|
@@ -4343,7 +4413,7 @@ function LinkPreviewCard({
|
|
|
4343
4413
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4344
4414
|
reactNative.Text,
|
|
4345
4415
|
{
|
|
4346
|
-
style: [
|
|
4416
|
+
style: [styles20.site, { color: muted, fontFamily: theme.fonts.body }],
|
|
4347
4417
|
numberOfLines: 1,
|
|
4348
4418
|
children: site
|
|
4349
4419
|
}
|
|
@@ -4353,7 +4423,7 @@ function LinkPreviewCard({
|
|
|
4353
4423
|
reactNative.Text,
|
|
4354
4424
|
{
|
|
4355
4425
|
style: [
|
|
4356
|
-
|
|
4426
|
+
styles20.title,
|
|
4357
4427
|
{ color: onBrand ? text : theme.colors.link, fontFamily: theme.fonts.body }
|
|
4358
4428
|
],
|
|
4359
4429
|
numberOfLines: 2,
|
|
@@ -4363,7 +4433,7 @@ function LinkPreviewCard({
|
|
|
4363
4433
|
preview.description ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4364
4434
|
reactNative.Text,
|
|
4365
4435
|
{
|
|
4366
|
-
style: [
|
|
4436
|
+
style: [styles20.description, { color: muted, fontFamily: theme.fonts.body }],
|
|
4367
4437
|
numberOfLines: 2,
|
|
4368
4438
|
children: preview.description
|
|
4369
4439
|
}
|
|
@@ -4378,7 +4448,7 @@ function hostOf(url) {
|
|
|
4378
4448
|
const m = /^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i.exec(url);
|
|
4379
4449
|
return (m?.[1] ?? url).replace(/^www\./, "");
|
|
4380
4450
|
}
|
|
4381
|
-
var
|
|
4451
|
+
var styles20 = reactNative.StyleSheet.create({
|
|
4382
4452
|
card: {
|
|
4383
4453
|
alignSelf: "stretch",
|
|
4384
4454
|
borderLeftWidth: 3,
|
|
@@ -4504,16 +4574,16 @@ function MessageBubble({
|
|
|
4504
4574
|
reactNative.View,
|
|
4505
4575
|
{
|
|
4506
4576
|
style: [
|
|
4507
|
-
|
|
4508
|
-
variant === "inline" &&
|
|
4509
|
-
variant === "inline" && dense &&
|
|
4510
|
-
variant === "wrapped" &&
|
|
4511
|
-
variant === "overlay" &&
|
|
4512
|
-
variant === "block" &&
|
|
4577
|
+
styles21.metaRow,
|
|
4578
|
+
variant === "inline" && styles21.metaInline,
|
|
4579
|
+
variant === "inline" && dense && styles21.metaInlineDense,
|
|
4580
|
+
variant === "wrapped" && styles21.metaWrapped,
|
|
4581
|
+
variant === "overlay" && styles21.metaOverlay,
|
|
4582
|
+
variant === "block" && styles21.metaBlock,
|
|
4513
4583
|
// File-only bubble: the meta row follows the cards directly —
|
|
4514
4584
|
// give it air so the time doesn't sit glued to the card.
|
|
4515
|
-
variant === "block" && hasFiles && !hasBody &&
|
|
4516
|
-
variant === "jumbo" &&
|
|
4585
|
+
variant === "block" && hasFiles && !hasBody && styles21.metaBlockAfterFiles,
|
|
4586
|
+
variant === "jumbo" && styles21.metaJumbo
|
|
4517
4587
|
],
|
|
4518
4588
|
onLayout: variant === "inline" || variant === "wrapped" ? (e) => setMetaWidth(e.nativeEvent.layout.width) : void 0,
|
|
4519
4589
|
pointerEvents: isEdited && onEditedPress ? "box-none" : "none",
|
|
@@ -4521,7 +4591,7 @@ function MessageBubble({
|
|
|
4521
4591
|
isEdited ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4522
4592
|
reactNative.Text,
|
|
4523
4593
|
{
|
|
4524
|
-
style: [
|
|
4594
|
+
style: [styles21.editedTag, { color, opacity: 0.8 }],
|
|
4525
4595
|
...onEditedPress ? {
|
|
4526
4596
|
onPress: onEditedPress,
|
|
4527
4597
|
suppressHighlighting: true,
|
|
@@ -4532,8 +4602,8 @@ function MessageBubble({
|
|
|
4532
4602
|
children: "edited"
|
|
4533
4603
|
}
|
|
4534
4604
|
) : null,
|
|
4535
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4536
|
-
isSelf && readState ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
4605
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles21.meta, { color, opacity: variant === "overlay" ? 1 : 0.75 }], children: time }),
|
|
4606
|
+
isSelf && readState ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles21.readTick, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4537
4607
|
PoolseIcon,
|
|
4538
4608
|
{
|
|
4539
4609
|
name: readState === "read" ? "check-double" : "check",
|
|
@@ -4549,7 +4619,7 @@ function MessageBubble({
|
|
|
4549
4619
|
reactNative.View,
|
|
4550
4620
|
{
|
|
4551
4621
|
style: [
|
|
4552
|
-
|
|
4622
|
+
styles21.wrap,
|
|
4553
4623
|
{ alignSelf: isSelf ? "flex-end" : "flex-start", maxWidth: bubbleMaxWidth }
|
|
4554
4624
|
],
|
|
4555
4625
|
children: [
|
|
@@ -4575,7 +4645,7 @@ function MessageBubble({
|
|
|
4575
4645
|
showSenderName && !isSelf && jumboCount === 0 && (groupPosition === "first" || groupPosition === "standalone") ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4576
4646
|
reactNative.Text,
|
|
4577
4647
|
{
|
|
4578
|
-
style: [
|
|
4648
|
+
style: [styles21.senderName, { color: senderTint, fontFamily: theme.fonts.body }],
|
|
4579
4649
|
...onSenderPress ? {
|
|
4580
4650
|
onPress: onSenderPress,
|
|
4581
4651
|
accessibilityRole: "button",
|
|
@@ -4602,7 +4672,7 @@ function MessageBubble({
|
|
|
4602
4672
|
// 3px of bubble color framing the picture; the mosaic clips
|
|
4603
4673
|
// itself 3px tighter than the bubble so the curves stay
|
|
4604
4674
|
// concentric.
|
|
4605
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4675
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles21.mediaFrame, children: [
|
|
4606
4676
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4607
4677
|
ImageMosaic,
|
|
4608
4678
|
{
|
|
@@ -4616,7 +4686,7 @@ function MessageBubble({
|
|
|
4616
4686
|
metaOverlay ? metaRow("overlay") : null
|
|
4617
4687
|
] })
|
|
4618
4688
|
) : null,
|
|
4619
|
-
hasFiles ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
4689
|
+
hasFiles ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles21.filesBlock, children: files.map((att) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4620
4690
|
AttachmentPreview,
|
|
4621
4691
|
{
|
|
4622
4692
|
attachment: att,
|
|
@@ -4635,9 +4705,9 @@ function MessageBubble({
|
|
|
4635
4705
|
reactNative.View,
|
|
4636
4706
|
{
|
|
4637
4707
|
style: [
|
|
4638
|
-
|
|
4639
|
-
dense &&
|
|
4640
|
-
sectionAbove &&
|
|
4708
|
+
styles21.textBlock,
|
|
4709
|
+
dense && styles21.textBlockDense,
|
|
4710
|
+
sectionAbove && styles21.textBlockAfter
|
|
4641
4711
|
],
|
|
4642
4712
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4643
4713
|
reactNative.Text,
|
|
@@ -4655,7 +4725,7 @@ function MessageBubble({
|
|
|
4655
4725
|
)
|
|
4656
4726
|
}
|
|
4657
4727
|
) : null,
|
|
4658
|
-
hasBody && jumboCount > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
4728
|
+
hasBody && jumboCount > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles21.jumboBlock, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4659
4729
|
reactNative.Text,
|
|
4660
4730
|
{
|
|
4661
4731
|
style: {
|
|
@@ -4669,9 +4739,9 @@ function MessageBubble({
|
|
|
4669
4739
|
reactNative.View,
|
|
4670
4740
|
{
|
|
4671
4741
|
style: [
|
|
4672
|
-
|
|
4673
|
-
dense &&
|
|
4674
|
-
sectionAbove &&
|
|
4742
|
+
styles21.textBlock,
|
|
4743
|
+
dense && styles21.textBlockDense,
|
|
4744
|
+
sectionAbove && styles21.textBlockAfter
|
|
4675
4745
|
],
|
|
4676
4746
|
onLayout: inlineMeta ? (e) => setTextBoxWidth(e.nativeEvent.layout.width - 24) : void 0,
|
|
4677
4747
|
children: [
|
|
@@ -4706,7 +4776,7 @@ function MessageBubble({
|
|
|
4706
4776
|
reactNative.Text,
|
|
4707
4777
|
{
|
|
4708
4778
|
style: [
|
|
4709
|
-
|
|
4779
|
+
styles21.readMore,
|
|
4710
4780
|
{ color: isSelf ? theme.colors.ownBubbleText : theme.colors.link }
|
|
4711
4781
|
],
|
|
4712
4782
|
children: expanded ? "Show less" : "Read more"
|
|
@@ -4721,7 +4791,7 @@ function MessageBubble({
|
|
|
4721
4791
|
hasPreviews ? (
|
|
4722
4792
|
// A fixed width, like media: a card squeezed into the width of
|
|
4723
4793
|
// a one-word message would be unreadable.
|
|
4724
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
4794
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles21.previews, !hasBody && styles21.previewsAlone, { width: mediaWidth }], children: previews.map((p) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4725
4795
|
LinkPreviewCard,
|
|
4726
4796
|
{
|
|
4727
4797
|
preview: p,
|
|
@@ -4733,7 +4803,7 @@ function MessageBubble({
|
|
|
4733
4803
|
)) })
|
|
4734
4804
|
) : null,
|
|
4735
4805
|
!inlineMeta && !metaOverlay && jumboCount === 0 ? metaRow("block") : null,
|
|
4736
|
-
actionsTrigger ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
4806
|
+
actionsTrigger ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles21.actionsSlot, children: actionsTrigger }) : null
|
|
4737
4807
|
]
|
|
4738
4808
|
}
|
|
4739
4809
|
),
|
|
@@ -4760,15 +4830,15 @@ function QuotedCard({
|
|
|
4760
4830
|
onPress,
|
|
4761
4831
|
disabled: !onPress,
|
|
4762
4832
|
style: [
|
|
4763
|
-
|
|
4833
|
+
styles21.quoted,
|
|
4764
4834
|
{
|
|
4765
4835
|
backgroundColor: bg,
|
|
4766
4836
|
borderLeftColor: accent
|
|
4767
4837
|
}
|
|
4768
4838
|
],
|
|
4769
4839
|
children: [
|
|
4770
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4771
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4840
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles21.quotedSender, { color: accent }], numberOfLines: 1, children: senderName }),
|
|
4841
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles21.quotedBody, { color: txt }], numberOfLines: 2, children: quoted.deleted_at ? "Original message deleted" : quoted.body ?? "\u2026" })
|
|
4772
4842
|
]
|
|
4773
4843
|
}
|
|
4774
4844
|
);
|
|
@@ -4801,7 +4871,7 @@ function formatTime2(iso, format2) {
|
|
|
4801
4871
|
function isSameDay(a, b) {
|
|
4802
4872
|
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
4803
4873
|
}
|
|
4804
|
-
var
|
|
4874
|
+
var styles21 = reactNative.StyleSheet.create({
|
|
4805
4875
|
wrap: {
|
|
4806
4876
|
marginBottom: 2
|
|
4807
4877
|
},
|
|
@@ -4928,6 +4998,24 @@ var styles20 = reactNative.StyleSheet.create({
|
|
|
4928
4998
|
opacity: 0.8
|
|
4929
4999
|
}
|
|
4930
5000
|
});
|
|
5001
|
+
|
|
5002
|
+
// src/internal/a11y.ts
|
|
5003
|
+
function messageA11yLabel(msg, senderName, isSelf) {
|
|
5004
|
+
const who = isSelf ? "You" : senderName;
|
|
5005
|
+
if (msg.deleted_at) return `${who}: message deleted`;
|
|
5006
|
+
const parts = [];
|
|
5007
|
+
const body = (msg.body ?? "").trim();
|
|
5008
|
+
if (body) parts.push(body.length > 300 ? `${body.slice(0, 300)}\u2026` : body);
|
|
5009
|
+
const files = Array.isArray(msg.attachments) ? msg.attachments.length : 0;
|
|
5010
|
+
if (files > 0) parts.push(files === 1 ? "1 attachment" : `${files} attachments`);
|
|
5011
|
+
if (msg.edited_at) parts.push("edited");
|
|
5012
|
+
if (msg.local_status === "queued") parts.push("waiting for network");
|
|
5013
|
+
if (msg.local_status === "failed") parts.push("not sent");
|
|
5014
|
+
return `${who}: ${parts.join(", ") || "message"}`;
|
|
5015
|
+
}
|
|
5016
|
+
function reactionA11yLabel(emoji, count, mine) {
|
|
5017
|
+
return `${emoji} ${count}${mine ? ", you reacted" : ""}`;
|
|
5018
|
+
}
|
|
4931
5019
|
var DEFAULT_EMOJIS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F389}", "\u{1F64F}", "\u{1F525}"];
|
|
4932
5020
|
function ReactionStrip({
|
|
4933
5021
|
messageId,
|
|
@@ -4944,7 +5032,7 @@ function ReactionStrip({
|
|
|
4944
5032
|
});
|
|
4945
5033
|
const entries = Object.entries(reactions);
|
|
4946
5034
|
if (entries.length === 0) return null;
|
|
4947
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5035
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles22.strip, children: [
|
|
4948
5036
|
entries.map(([emoji, userIds]) => {
|
|
4949
5037
|
const userArr = Array.isArray(userIds) ? userIds : [];
|
|
4950
5038
|
const meReacted = meId !== null && userArr.includes(meId);
|
|
@@ -4952,8 +5040,12 @@ function ReactionStrip({
|
|
|
4952
5040
|
reactNative.Pressable,
|
|
4953
5041
|
{
|
|
4954
5042
|
onPress: () => meReacted ? removeReaction(emoji) : addReaction(emoji),
|
|
5043
|
+
accessibilityRole: "button",
|
|
5044
|
+
accessibilityLabel: reactionA11yLabel(emoji, userArr.length, meReacted),
|
|
5045
|
+
accessibilityState: { selected: meReacted },
|
|
5046
|
+
accessibilityHint: meReacted ? "Removes your reaction" : "Adds this reaction",
|
|
4955
5047
|
style: [
|
|
4956
|
-
|
|
5048
|
+
styles22.chip,
|
|
4957
5049
|
{
|
|
4958
5050
|
backgroundColor: meReacted ? theme.colors.accentSoft : theme.colors.surfaceAlt,
|
|
4959
5051
|
borderColor: meReacted ? theme.colors.accent : theme.colors.border,
|
|
@@ -4962,12 +5054,12 @@ function ReactionStrip({
|
|
|
4962
5054
|
}
|
|
4963
5055
|
],
|
|
4964
5056
|
children: [
|
|
4965
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
5057
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles22.emoji, children: emoji }),
|
|
4966
5058
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4967
5059
|
reactNative.Text,
|
|
4968
5060
|
{
|
|
4969
5061
|
style: [
|
|
4970
|
-
|
|
5062
|
+
styles22.count,
|
|
4971
5063
|
{
|
|
4972
5064
|
color: meReacted ? theme.colors.accent : theme.colors.textMuted,
|
|
4973
5065
|
fontWeight: meReacted ? "700" : "600"
|
|
@@ -4987,7 +5079,7 @@ function ReactionStrip({
|
|
|
4987
5079
|
onPress: onMorePress,
|
|
4988
5080
|
hitSlop: 4,
|
|
4989
5081
|
style: [
|
|
4990
|
-
|
|
5082
|
+
styles22.chip,
|
|
4991
5083
|
{
|
|
4992
5084
|
backgroundColor: theme.colors.surfaceAlt,
|
|
4993
5085
|
borderColor: theme.colors.border,
|
|
@@ -5020,13 +5112,13 @@ function ReactionPicker({
|
|
|
5020
5112
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5021
5113
|
reactNative.Pressable,
|
|
5022
5114
|
{
|
|
5023
|
-
style: [
|
|
5115
|
+
style: [styles22.backdrop, { paddingTop: insets.top, paddingBottom: insets.bottom }],
|
|
5024
5116
|
onPress: onClose,
|
|
5025
5117
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5026
5118
|
reactNative.View,
|
|
5027
5119
|
{
|
|
5028
5120
|
style: [
|
|
5029
|
-
|
|
5121
|
+
styles22.sheet,
|
|
5030
5122
|
{
|
|
5031
5123
|
backgroundColor: theme.colors.surface,
|
|
5032
5124
|
borderRadius: theme.radii.lg
|
|
@@ -5036,12 +5128,12 @@ function ReactionPicker({
|
|
|
5036
5128
|
children: emojis.map((emoji) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5037
5129
|
reactNative.Pressable,
|
|
5038
5130
|
{
|
|
5039
|
-
style:
|
|
5131
|
+
style: styles22.emojiBtn,
|
|
5040
5132
|
onPress: () => {
|
|
5041
5133
|
onPick(emoji);
|
|
5042
5134
|
onClose();
|
|
5043
5135
|
},
|
|
5044
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
5136
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles22.bigEmoji, children: emoji })
|
|
5045
5137
|
},
|
|
5046
5138
|
emoji
|
|
5047
5139
|
))
|
|
@@ -5052,7 +5144,7 @@ function ReactionPicker({
|
|
|
5052
5144
|
}
|
|
5053
5145
|
);
|
|
5054
5146
|
}
|
|
5055
|
-
var
|
|
5147
|
+
var styles22 = reactNative.StyleSheet.create({
|
|
5056
5148
|
strip: {
|
|
5057
5149
|
flexDirection: "row",
|
|
5058
5150
|
flexWrap: "wrap",
|
|
@@ -5108,6 +5200,69 @@ var styles21 = reactNative.StyleSheet.create({
|
|
|
5108
5200
|
lineHeight: 38
|
|
5109
5201
|
}
|
|
5110
5202
|
});
|
|
5203
|
+
function SendStatus({ message, onRetry, onDiscard, alignEnd = true }) {
|
|
5204
|
+
const theme = useTheme();
|
|
5205
|
+
const status = message.local_status;
|
|
5206
|
+
if (status !== "queued" && status !== "failed") return null;
|
|
5207
|
+
const failed = status === "failed";
|
|
5208
|
+
const text = failed ? message.local_error ? `Not sent: ${message.local_error}` : "Not sent" : "Waiting for network\u2026";
|
|
5209
|
+
const button = (label, onPress, danger = false) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5210
|
+
reactNative.Pressable,
|
|
5211
|
+
{
|
|
5212
|
+
onPress,
|
|
5213
|
+
accessibilityRole: "button",
|
|
5214
|
+
accessibilityLabel: `${label} message`,
|
|
5215
|
+
hitSlop: 8,
|
|
5216
|
+
style: styles23.button,
|
|
5217
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5218
|
+
reactNative.Text,
|
|
5219
|
+
{
|
|
5220
|
+
style: [
|
|
5221
|
+
styles23.buttonText,
|
|
5222
|
+
{ color: danger ? theme.colors.danger : theme.colors.accentStrong },
|
|
5223
|
+
{ fontFamily: theme.fonts.body }
|
|
5224
|
+
],
|
|
5225
|
+
children: label
|
|
5226
|
+
}
|
|
5227
|
+
)
|
|
5228
|
+
}
|
|
5229
|
+
);
|
|
5230
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5231
|
+
reactNative.View,
|
|
5232
|
+
{
|
|
5233
|
+
style: [styles23.root, { justifyContent: alignEnd ? "flex-end" : "flex-start" }],
|
|
5234
|
+
accessibilityLiveRegion: "polite",
|
|
5235
|
+
children: [
|
|
5236
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5237
|
+
reactNative.Text,
|
|
5238
|
+
{
|
|
5239
|
+
style: [
|
|
5240
|
+
styles23.text,
|
|
5241
|
+
{ color: failed ? theme.colors.danger : theme.colors.textMuted },
|
|
5242
|
+
{ fontFamily: theme.fonts.body }
|
|
5243
|
+
],
|
|
5244
|
+
children: text
|
|
5245
|
+
}
|
|
5246
|
+
),
|
|
5247
|
+
onRetry ? button(failed ? "Retry" : "Send now", onRetry) : null,
|
|
5248
|
+
failed && onDiscard ? button("Delete", onDiscard, true) : null
|
|
5249
|
+
]
|
|
5250
|
+
}
|
|
5251
|
+
);
|
|
5252
|
+
}
|
|
5253
|
+
var styles23 = reactNative.StyleSheet.create({
|
|
5254
|
+
root: {
|
|
5255
|
+
flexDirection: "row",
|
|
5256
|
+
flexWrap: "wrap",
|
|
5257
|
+
alignItems: "center",
|
|
5258
|
+
gap: 10,
|
|
5259
|
+
marginTop: 2,
|
|
5260
|
+
marginBottom: 4
|
|
5261
|
+
},
|
|
5262
|
+
text: { fontSize: 12, flexShrink: 1 },
|
|
5263
|
+
button: { paddingVertical: 2 },
|
|
5264
|
+
buttonText: { fontSize: 12, fontWeight: "700" }
|
|
5265
|
+
});
|
|
5111
5266
|
|
|
5112
5267
|
// src/internal/thread.ts
|
|
5113
5268
|
function threadSummaryText(replyCount, lastReplyAt, now = Date.now()) {
|
|
@@ -5148,7 +5303,7 @@ function ThreadSummary({
|
|
|
5148
5303
|
accessibilityLabel: `${label}. Open thread`,
|
|
5149
5304
|
hitSlop: 4,
|
|
5150
5305
|
style: ({ pressed }) => [
|
|
5151
|
-
|
|
5306
|
+
styles24.row,
|
|
5152
5307
|
{
|
|
5153
5308
|
alignSelf: alignEnd ? "flex-end" : "flex-start",
|
|
5154
5309
|
borderRadius: theme.radii.pill,
|
|
@@ -5156,11 +5311,11 @@ function ThreadSummary({
|
|
|
5156
5311
|
}
|
|
5157
5312
|
],
|
|
5158
5313
|
children: [
|
|
5159
|
-
people.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5314
|
+
people.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles24.stack, children: people.map((p, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5160
5315
|
reactNative.View,
|
|
5161
5316
|
{
|
|
5162
5317
|
style: [
|
|
5163
|
-
|
|
5318
|
+
styles24.stacked,
|
|
5164
5319
|
{
|
|
5165
5320
|
marginLeft: i === 0 ? 0 : -6,
|
|
5166
5321
|
borderColor: theme.colors.background,
|
|
@@ -5182,7 +5337,7 @@ function ThreadSummary({
|
|
|
5182
5337
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5183
5338
|
reactNative.Text,
|
|
5184
5339
|
{
|
|
5185
|
-
style: [
|
|
5340
|
+
style: [styles24.text, { color: theme.colors.link, fontFamily: theme.fonts.body }],
|
|
5186
5341
|
numberOfLines: 1,
|
|
5187
5342
|
children: label
|
|
5188
5343
|
}
|
|
@@ -5202,7 +5357,7 @@ function Participant({
|
|
|
5202
5357
|
const src = externalId ? avatarFor?.(externalId) ?? resolved.profile?.avatarUrl ?? null : null;
|
|
5203
5358
|
return /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src, name, seed: externalId ?? fallback, size: "xs" });
|
|
5204
5359
|
}
|
|
5205
|
-
var
|
|
5360
|
+
var styles24 = reactNative.StyleSheet.create({
|
|
5206
5361
|
row: {
|
|
5207
5362
|
flexDirection: "row",
|
|
5208
5363
|
alignItems: "center",
|
|
@@ -5257,7 +5412,9 @@ function FlatMessageRow({
|
|
|
5257
5412
|
linkPreviews = true,
|
|
5258
5413
|
onRemoveLinkPreview,
|
|
5259
5414
|
onMarkUnread,
|
|
5260
|
-
editHistory = true
|
|
5415
|
+
editHistory = true,
|
|
5416
|
+
onRetrySend,
|
|
5417
|
+
onDiscardSend
|
|
5261
5418
|
}) {
|
|
5262
5419
|
const theme = useTheme();
|
|
5263
5420
|
const { width: screenWidth } = reactNative.useWindowDimensions();
|
|
@@ -5286,9 +5443,10 @@ function FlatMessageRow({
|
|
|
5286
5443
|
const isRunStart = compact || groupPosition === "first" || groupPosition === "standalone";
|
|
5287
5444
|
const ctx = { message: msg, isSelf, sender, layout, isRunStart };
|
|
5288
5445
|
const deleted = react$1.isTombstone(msg);
|
|
5446
|
+
const inert = deleted || !!msg.local_status;
|
|
5289
5447
|
const time = formatMessageTime(msg.inserted_at, timeFormat);
|
|
5290
5448
|
const openActions = () => {
|
|
5291
|
-
if (actions && !
|
|
5449
|
+
if (actions && !inert) setActionsOpen(true);
|
|
5292
5450
|
};
|
|
5293
5451
|
const text = { fontFamily: theme.fonts.body, color: theme.colors.text };
|
|
5294
5452
|
const avatarEl = showAvatar ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5315,10 +5473,10 @@ function FlatMessageRow({
|
|
|
5315
5473
|
reactNative.Text,
|
|
5316
5474
|
{
|
|
5317
5475
|
style: [
|
|
5318
|
-
|
|
5476
|
+
styles25.name,
|
|
5319
5477
|
text,
|
|
5320
5478
|
compact ? { color: userColor(ext ?? msg.sender_id ?? msg.id) } : null,
|
|
5321
|
-
compact ?
|
|
5479
|
+
compact ? styles25.nameCompact : null
|
|
5322
5480
|
],
|
|
5323
5481
|
numberOfLines: 1,
|
|
5324
5482
|
...onSenderPress && !isSelf ? {
|
|
@@ -5333,22 +5491,22 @@ function FlatMessageRow({
|
|
|
5333
5491
|
reactNative.Text,
|
|
5334
5492
|
{
|
|
5335
5493
|
style: [
|
|
5336
|
-
|
|
5494
|
+
styles25.time,
|
|
5337
5495
|
{ color: theme.colors.textSubtle, fontFamily: theme.fonts.body },
|
|
5338
|
-
dim ?
|
|
5496
|
+
dim ? styles25.timeDim : null
|
|
5339
5497
|
],
|
|
5340
5498
|
...dim ? { numberOfLines: 1, adjustsFontSizeToFit: true, minimumFontScale: 0.6 } : {},
|
|
5341
5499
|
children: dim ? gutterTime(time) : time
|
|
5342
5500
|
}
|
|
5343
5501
|
);
|
|
5344
|
-
const header = compact ? name : isRunStart ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5502
|
+
const header = compact ? name : isRunStart ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles25.header, children: [
|
|
5345
5503
|
name,
|
|
5346
5504
|
timeText(false)
|
|
5347
5505
|
] }) : null;
|
|
5348
5506
|
const images = attachments && !deleted ? (msg.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
|
|
5349
5507
|
const files = attachments && !deleted ? (msg.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
|
|
5350
5508
|
const mediaWidth = Math.min(screenWidth - GUTTER - 48, 320);
|
|
5351
|
-
const attachmentsEl = images.length > 0 || files.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5509
|
+
const attachmentsEl = images.length > 0 || files.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles25.attachments, children: [
|
|
5352
5510
|
images.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5353
5511
|
ImageMosaic,
|
|
5354
5512
|
{
|
|
@@ -5371,11 +5529,11 @@ function FlatMessageRow({
|
|
|
5371
5529
|
lineHeight: dense ? theme.fonts.lineHeight - 3 : theme.fonts.lineHeight
|
|
5372
5530
|
};
|
|
5373
5531
|
const edited = !!msg.edited_at && !deleted;
|
|
5374
|
-
const meta = edited || isSelf && readState ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5532
|
+
const meta = edited || isSelf && readState ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles25.meta, children: [
|
|
5375
5533
|
edited ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5376
5534
|
reactNative.Text,
|
|
5377
5535
|
{
|
|
5378
|
-
style: [
|
|
5536
|
+
style: [styles25.edited, { color: theme.colors.textSubtle }],
|
|
5379
5537
|
...editHistory && canShowEditHistory(msg.id) ? {
|
|
5380
5538
|
onPress: () => setHistoryOpen(true),
|
|
5381
5539
|
suppressHighlighting: true,
|
|
@@ -5395,7 +5553,7 @@ function FlatMessageRow({
|
|
|
5395
5553
|
}
|
|
5396
5554
|
) : null
|
|
5397
5555
|
] }) : null;
|
|
5398
|
-
const body = deleted ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [bodyText,
|
|
5556
|
+
const body = deleted ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [bodyText, styles25.deleted, { color: theme.colors.textMuted }], children: "This message was deleted" }) : raw ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
|
|
5399
5557
|
jumbo > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { fontSize: emojiFontSize(jumbo), lineHeight: emojiFontSize(jumbo) + 8 }, children: raw }) : markdown && hasMarkdown(shown) ? renderMarkdown(shown, {
|
|
5400
5558
|
textColor: bodyText.color,
|
|
5401
5559
|
linkColor: theme.colors.link,
|
|
@@ -5407,8 +5565,8 @@ function FlatMessageRow({
|
|
|
5407
5565
|
return false;
|
|
5408
5566
|
}
|
|
5409
5567
|
}) : /* @__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:
|
|
5568
|
+
trimmable ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles25.readMore, { color: theme.colors.link }], children: expanded ? "Show less" : "Read more" }) }) : null,
|
|
5569
|
+
previews.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles25.previews, children: previews.map((p) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5412
5570
|
LinkPreviewCard,
|
|
5413
5571
|
{
|
|
5414
5572
|
preview: p,
|
|
@@ -5432,7 +5590,7 @@ function FlatMessageRow({
|
|
|
5432
5590
|
}
|
|
5433
5591
|
) : null
|
|
5434
5592
|
);
|
|
5435
|
-
const reactionsEl = reactions && !
|
|
5593
|
+
const reactionsEl = reactions && !inert ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles25.reactions, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5436
5594
|
ReactionStrip,
|
|
5437
5595
|
{
|
|
5438
5596
|
messageId: msg.id,
|
|
@@ -5451,15 +5609,24 @@ function FlatMessageRow({
|
|
|
5451
5609
|
...onQuotedClick ? { onPress: () => onQuotedClick(msg.quoted_message.id) } : {}
|
|
5452
5610
|
}
|
|
5453
5611
|
) : null;
|
|
5454
|
-
const content = /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5612
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles25.content, children: [
|
|
5455
5613
|
!compact ? renderSlot(slots?.header, ctx, header) : null,
|
|
5456
5614
|
quote,
|
|
5457
5615
|
renderSlot(slots?.attachments, ctx, attachmentsEl),
|
|
5458
5616
|
renderSlot(slots?.body, ctx, body),
|
|
5459
5617
|
renderSlot(slots?.reactions, ctx, reactionsEl),
|
|
5460
|
-
renderSlot(slots?.thread, ctx, threadEl)
|
|
5618
|
+
renderSlot(slots?.thread, ctx, threadEl),
|
|
5619
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5620
|
+
SendStatus,
|
|
5621
|
+
{
|
|
5622
|
+
message: msg,
|
|
5623
|
+
alignEnd: false,
|
|
5624
|
+
...onRetrySend ? { onRetry: onRetrySend } : {},
|
|
5625
|
+
...onDiscardSend ? { onDiscard: onDiscardSend } : {}
|
|
5626
|
+
}
|
|
5627
|
+
)
|
|
5461
5628
|
] });
|
|
5462
|
-
const sheet = actions && actionsOpen && !
|
|
5629
|
+
const sheet = actions && actionsOpen && !inert ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5463
5630
|
RowActionsSheet,
|
|
5464
5631
|
{
|
|
5465
5632
|
msg,
|
|
@@ -5483,28 +5650,32 @@ function FlatMessageRow({
|
|
|
5483
5650
|
reactNative.View,
|
|
5484
5651
|
{
|
|
5485
5652
|
style: [
|
|
5486
|
-
|
|
5487
|
-
compact ?
|
|
5488
|
-
dense ?
|
|
5489
|
-
!compact && isRunStart ? dense ?
|
|
5653
|
+
styles25.row,
|
|
5654
|
+
compact ? styles25.rowCompact : null,
|
|
5655
|
+
dense ? styles25.rowDense : null,
|
|
5656
|
+
!compact && isRunStart ? dense ? styles25.runStartDense : styles25.runStart : null,
|
|
5490
5657
|
mentionsMe ? { backgroundColor: theme.colors.mention, borderLeftColor: theme.colors.accent } : null,
|
|
5491
|
-
isEditing ?
|
|
5658
|
+
isEditing ? styles25.rowEditing : null
|
|
5492
5659
|
],
|
|
5493
5660
|
children: [
|
|
5494
5661
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5495
5662
|
reactNative.Pressable,
|
|
5496
5663
|
{
|
|
5497
5664
|
onLongPress: openActions,
|
|
5498
|
-
style: [
|
|
5499
|
-
|
|
5500
|
-
|
|
5665
|
+
style: [styles25.line, compact ? styles25.lineCompact : null],
|
|
5666
|
+
accessibilityLabel: messageA11yLabel(msg, senderName, isSelf),
|
|
5667
|
+
...actions && !inert ? {
|
|
5668
|
+
accessibilityHint: "Long press for message actions",
|
|
5669
|
+
accessibilityActions: [{ name: "longpress", label: "Message actions" }],
|
|
5670
|
+
onAccessibilityAction: openActions
|
|
5671
|
+
} : {},
|
|
5501
5672
|
children: compact ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5502
5673
|
timeText(false),
|
|
5503
|
-
avatar ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5674
|
+
avatar ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles25.avatarCompact, children: avatar }) : null,
|
|
5504
5675
|
renderSlot(slots?.header, ctx, header),
|
|
5505
5676
|
content
|
|
5506
5677
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5507
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5678
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles25.gutter, children: isRunStart ? avatar : timeText(true) }),
|
|
5508
5679
|
content
|
|
5509
5680
|
] })
|
|
5510
5681
|
}
|
|
@@ -5525,7 +5696,7 @@ function FlatMessageRow({
|
|
|
5525
5696
|
}
|
|
5526
5697
|
);
|
|
5527
5698
|
}
|
|
5528
|
-
var
|
|
5699
|
+
var styles25 = reactNative.StyleSheet.create({
|
|
5529
5700
|
row: {
|
|
5530
5701
|
// 3px left border reserved for the mention accent bar.
|
|
5531
5702
|
borderLeftWidth: 3,
|
|
@@ -5677,13 +5848,13 @@ function MessageActions({
|
|
|
5677
5848
|
animationType: "fade",
|
|
5678
5849
|
onRequestClose: onClose,
|
|
5679
5850
|
...EDGE_TO_EDGE_MODAL,
|
|
5680
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style:
|
|
5851
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles26.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5681
5852
|
reactNative.Pressable,
|
|
5682
5853
|
{
|
|
5683
5854
|
onPress: () => void 0,
|
|
5684
5855
|
accessible: false,
|
|
5685
5856
|
style: [
|
|
5686
|
-
|
|
5857
|
+
styles26.sheet,
|
|
5687
5858
|
{
|
|
5688
5859
|
backgroundColor: theme.colors.surface,
|
|
5689
5860
|
borderTopLeftRadius: theme.radii.lg,
|
|
@@ -5696,7 +5867,7 @@ function MessageActions({
|
|
|
5696
5867
|
theme.shadows.lg
|
|
5697
5868
|
],
|
|
5698
5869
|
children: [
|
|
5699
|
-
showEmojiRow ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
5870
|
+
showEmojiRow ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles26.emojiRow, { borderBottomColor: theme.colors.border }], children: [
|
|
5700
5871
|
emojis.map((emoji) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5701
5872
|
reactNative.Pressable,
|
|
5702
5873
|
{
|
|
@@ -5704,10 +5875,10 @@ function MessageActions({
|
|
|
5704
5875
|
onPickReaction(emoji);
|
|
5705
5876
|
onClose();
|
|
5706
5877
|
},
|
|
5707
|
-
style:
|
|
5878
|
+
style: styles26.emojiBtn,
|
|
5708
5879
|
hitSlop: 6,
|
|
5709
5880
|
accessibilityLabel: `React with ${emoji}`,
|
|
5710
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
5881
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles26.emoji, children: emoji })
|
|
5711
5882
|
},
|
|
5712
5883
|
emoji
|
|
5713
5884
|
)),
|
|
@@ -5718,7 +5889,7 @@ function MessageActions({
|
|
|
5718
5889
|
onClose();
|
|
5719
5890
|
onMoreReactions();
|
|
5720
5891
|
},
|
|
5721
|
-
style: [
|
|
5892
|
+
style: [styles26.moreBtn, { backgroundColor: theme.colors.surfaceAlt }],
|
|
5722
5893
|
hitSlop: 6,
|
|
5723
5894
|
accessibilityRole: "button",
|
|
5724
5895
|
accessibilityLabel: "More reactions",
|
|
@@ -5726,7 +5897,7 @@ function MessageActions({
|
|
|
5726
5897
|
}
|
|
5727
5898
|
) : null
|
|
5728
5899
|
] }) : null,
|
|
5729
|
-
items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress: item.onPress, style:
|
|
5900
|
+
items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress: item.onPress, style: styles26.item, children: [
|
|
5730
5901
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5731
5902
|
PoolseIcon,
|
|
5732
5903
|
{
|
|
@@ -5739,7 +5910,7 @@ function MessageActions({
|
|
|
5739
5910
|
reactNative.Text,
|
|
5740
5911
|
{
|
|
5741
5912
|
style: [
|
|
5742
|
-
|
|
5913
|
+
styles26.itemText,
|
|
5743
5914
|
{
|
|
5744
5915
|
color: item.danger ? theme.colors.danger : theme.colors.text,
|
|
5745
5916
|
fontFamily: theme.fonts.body
|
|
@@ -5759,7 +5930,7 @@ function hostOf2(url) {
|
|
|
5759
5930
|
const m = /^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i.exec(url);
|
|
5760
5931
|
return (m?.[1] ?? url).replace(/^www\./, "");
|
|
5761
5932
|
}
|
|
5762
|
-
var
|
|
5933
|
+
var styles26 = reactNative.StyleSheet.create({
|
|
5763
5934
|
backdrop: {
|
|
5764
5935
|
flex: 1,
|
|
5765
5936
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
@@ -5923,11 +6094,13 @@ function BubbleMessageRow({
|
|
|
5923
6094
|
linkPreviews = true,
|
|
5924
6095
|
onRemoveLinkPreview,
|
|
5925
6096
|
onMarkUnread,
|
|
5926
|
-
editHistory = true
|
|
6097
|
+
editHistory = true,
|
|
6098
|
+
onRetrySend,
|
|
6099
|
+
onDiscardSend
|
|
5927
6100
|
}) {
|
|
5928
6101
|
const theme = useTheme();
|
|
5929
6102
|
const isSelf = meId !== null && msg.sender_id === meId;
|
|
5930
|
-
const tombstone = react$1.isTombstone(msg);
|
|
6103
|
+
const tombstone = react$1.isTombstone(msg) || !!msg.local_status;
|
|
5931
6104
|
const [actionsOpen, setActionsOpen] = react.useState(false);
|
|
5932
6105
|
const [emojiOpen, setEmojiOpen] = react.useState(false);
|
|
5933
6106
|
const [historyOpen, setHistoryOpen] = react.useState(false);
|
|
@@ -6009,8 +6182,7 @@ function BubbleMessageRow({
|
|
|
6009
6182
|
});
|
|
6010
6183
|
const showAvatarSlot = showAvatar && !isSelf;
|
|
6011
6184
|
const showAvatarRender = showAvatarSlot && (groupPosition === "last" || groupPosition === "standalone");
|
|
6012
|
-
const
|
|
6013
|
-
const rowSender = react$1.useUser(wantsSender ? msg.sender_external_id : null);
|
|
6185
|
+
const rowSender = react$1.useUser(msg.sender_external_id);
|
|
6014
6186
|
const avatarUrl = msg.sender_external_id ? avatarFor?.(msg.sender_external_id) ?? rowSender.profile?.avatarUrl ?? null : null;
|
|
6015
6187
|
const senderLabel = msg.sender_external_id ? labelFor?.(msg.sender_external_id) ?? rowSender.profile?.displayName ?? msg.sender_external_id : null;
|
|
6016
6188
|
const sender = {
|
|
@@ -6040,16 +6212,16 @@ function BubbleMessageRow({
|
|
|
6040
6212
|
reactNative.View,
|
|
6041
6213
|
{
|
|
6042
6214
|
style: [
|
|
6043
|
-
|
|
6215
|
+
styles27.row,
|
|
6044
6216
|
{ alignSelf: isSelf ? "flex-end" : "flex-start" },
|
|
6045
|
-
density === "compact" ?
|
|
6217
|
+
density === "compact" ? styles27.rowDense : null,
|
|
6046
6218
|
// Lift this row above the dim backdrop the parent renders
|
|
6047
6219
|
// during edit mode. zIndex covers iOS / web; elevation does
|
|
6048
6220
|
// the equivalent on Android.
|
|
6049
|
-
isEditing ?
|
|
6221
|
+
isEditing ? styles27.rowEditing : null
|
|
6050
6222
|
],
|
|
6051
6223
|
children: [
|
|
6052
|
-
showAvatarSlot ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
6224
|
+
showAvatarSlot ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles27.avatarSlot, children: !showAvatarRender ? null : onAvatarPress ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6053
6225
|
reactNative.Pressable,
|
|
6054
6226
|
{
|
|
6055
6227
|
onPress: () => onAvatarPress(sender),
|
|
@@ -6059,14 +6231,14 @@ function BubbleMessageRow({
|
|
|
6059
6231
|
children: avatar
|
|
6060
6232
|
}
|
|
6061
6233
|
) : avatar }) : null,
|
|
6062
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
6234
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles27.bubbleCol, children: [
|
|
6063
6235
|
swipeEnabled ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6064
6236
|
reactNative.Animated.View,
|
|
6065
6237
|
{
|
|
6066
6238
|
pointerEvents: "none",
|
|
6067
6239
|
style: [
|
|
6068
|
-
|
|
6069
|
-
isSelf ?
|
|
6240
|
+
styles27.replyHint,
|
|
6241
|
+
isSelf ? styles27.replyHintRight : styles27.replyHintLeft,
|
|
6070
6242
|
{
|
|
6071
6243
|
opacity: replyIconOpacity,
|
|
6072
6244
|
transform: [{ scale: replyIconScale }],
|
|
@@ -6088,8 +6260,12 @@ function BubbleMessageRow({
|
|
|
6088
6260
|
if (!actions || tombstone) return;
|
|
6089
6261
|
setActionsOpen(true);
|
|
6090
6262
|
},
|
|
6091
|
-
|
|
6092
|
-
|
|
6263
|
+
accessibilityLabel: messageA11yLabel(msg, senderLabel ?? "Unknown", isSelf),
|
|
6264
|
+
...actions && !tombstone ? {
|
|
6265
|
+
accessibilityHint: "Long press for message actions",
|
|
6266
|
+
accessibilityActions: [{ name: "longpress", label: "Message actions" }],
|
|
6267
|
+
onAccessibilityAction: () => setActionsOpen(true)
|
|
6268
|
+
} : {},
|
|
6093
6269
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6094
6270
|
MessageBubble,
|
|
6095
6271
|
{
|
|
@@ -6118,6 +6294,15 @@ function BubbleMessageRow({
|
|
|
6118
6294
|
)
|
|
6119
6295
|
}
|
|
6120
6296
|
),
|
|
6297
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6298
|
+
SendStatus,
|
|
6299
|
+
{
|
|
6300
|
+
message: msg,
|
|
6301
|
+
alignEnd: isSelf,
|
|
6302
|
+
...onRetrySend ? { onRetry: onRetrySend } : {},
|
|
6303
|
+
...onDiscardSend ? { onDiscard: onDiscardSend } : {}
|
|
6304
|
+
}
|
|
6305
|
+
),
|
|
6121
6306
|
renderSlot(
|
|
6122
6307
|
slots?.thread,
|
|
6123
6308
|
slotContext,
|
|
@@ -6135,7 +6320,7 @@ function BubbleMessageRow({
|
|
|
6135
6320
|
renderSlot(
|
|
6136
6321
|
slots?.reactions,
|
|
6137
6322
|
slotContext,
|
|
6138
|
-
reactions && !tombstone ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
6323
|
+
reactions && !tombstone ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles27.reactionsRow, { alignSelf: isSelf ? "flex-end" : "flex-start" }], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6139
6324
|
ReactionStrip,
|
|
6140
6325
|
{
|
|
6141
6326
|
messageId: msg.id,
|
|
@@ -6186,7 +6371,7 @@ function BubbleMessageRow({
|
|
|
6186
6371
|
}
|
|
6187
6372
|
);
|
|
6188
6373
|
}
|
|
6189
|
-
var
|
|
6374
|
+
var styles27 = reactNative.StyleSheet.create({
|
|
6190
6375
|
row: {
|
|
6191
6376
|
flexDirection: "row",
|
|
6192
6377
|
alignItems: "flex-end",
|
|
@@ -6243,24 +6428,24 @@ function NewMessagesDivider({ label = "New messages" }) {
|
|
|
6243
6428
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6244
6429
|
reactNative.View,
|
|
6245
6430
|
{
|
|
6246
|
-
style: [
|
|
6431
|
+
style: [styles28.row, { paddingHorizontal: theme.spacing.md }],
|
|
6247
6432
|
accessibilityRole: "text",
|
|
6248
6433
|
accessibilityLabel: label,
|
|
6249
6434
|
children: [
|
|
6250
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
6435
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles28.line, { backgroundColor: theme.colors.accent }] }),
|
|
6251
6436
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6252
6437
|
reactNative.Text,
|
|
6253
6438
|
{
|
|
6254
|
-
style: [
|
|
6439
|
+
style: [styles28.label, { color: theme.colors.accentStrong, fontFamily: theme.fonts.body }],
|
|
6255
6440
|
children: label
|
|
6256
6441
|
}
|
|
6257
6442
|
),
|
|
6258
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
6443
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles28.line, { backgroundColor: theme.colors.accent }] })
|
|
6259
6444
|
]
|
|
6260
6445
|
}
|
|
6261
6446
|
);
|
|
6262
6447
|
}
|
|
6263
|
-
var
|
|
6448
|
+
var styles28 = reactNative.StyleSheet.create({
|
|
6264
6449
|
row: {
|
|
6265
6450
|
flexDirection: "row",
|
|
6266
6451
|
alignItems: "center",
|
|
@@ -6429,15 +6614,15 @@ function ThreadSheet({
|
|
|
6429
6614
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6430
6615
|
reactNative.View,
|
|
6431
6616
|
{
|
|
6432
|
-
style:
|
|
6617
|
+
style: styles29.modalRoot,
|
|
6433
6618
|
onLayout: (e) => setRootHeight(Math.round(e.nativeEvent.layout.height)),
|
|
6434
6619
|
children: [
|
|
6435
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style:
|
|
6620
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles29.backdrop, onPress: onClose, accessibilityLabel: "Close thread" }),
|
|
6436
6621
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6437
6622
|
reactNative.Animated.View,
|
|
6438
6623
|
{
|
|
6439
6624
|
style: [
|
|
6440
|
-
|
|
6625
|
+
styles29.sheet,
|
|
6441
6626
|
{
|
|
6442
6627
|
height: sheetHeight,
|
|
6443
6628
|
backgroundColor: theme.colors.background,
|
|
@@ -6451,14 +6636,14 @@ function ThreadSheet({
|
|
|
6451
6636
|
],
|
|
6452
6637
|
children: [
|
|
6453
6638
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ...panHandlers, children: [
|
|
6454
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
6455
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
6639
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles29.dragHandle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles29.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
|
|
6640
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles29.header, { borderBottomColor: theme.colors.border }], children: [
|
|
6456
6641
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6457
6642
|
reactNative.Pressable,
|
|
6458
6643
|
{
|
|
6459
6644
|
onPress: onClose,
|
|
6460
6645
|
hitSlop: 16,
|
|
6461
|
-
style: [
|
|
6646
|
+
style: [styles29.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
|
|
6462
6647
|
accessibilityLabel: "Close thread",
|
|
6463
6648
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
|
|
6464
6649
|
}
|
|
@@ -6466,7 +6651,7 @@ function ThreadSheet({
|
|
|
6466
6651
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6467
6652
|
reactNative.Text,
|
|
6468
6653
|
{
|
|
6469
|
-
style: [
|
|
6654
|
+
style: [styles29.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
|
|
6470
6655
|
children: "Thread"
|
|
6471
6656
|
}
|
|
6472
6657
|
)
|
|
@@ -6475,18 +6660,25 @@ function ThreadSheet({
|
|
|
6475
6660
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6476
6661
|
reactNative.KeyboardAvoidingView,
|
|
6477
6662
|
{
|
|
6478
|
-
style:
|
|
6663
|
+
style: styles29.kavBody,
|
|
6479
6664
|
behavior: "padding",
|
|
6480
6665
|
keyboardVerticalOffset: gutter,
|
|
6481
6666
|
children: [
|
|
6482
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
6483
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
6667
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles29.rootPreview, { backgroundColor: theme.colors.surfaceAlt }], children: rootRow }),
|
|
6668
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles29.listWrap, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6484
6669
|
MessageList,
|
|
6485
6670
|
{
|
|
6486
6671
|
messages: replies,
|
|
6487
6672
|
hasMore,
|
|
6488
6673
|
onLoadMore: loadMore,
|
|
6489
|
-
renderItem: renderReply
|
|
6674
|
+
renderItem: renderReply,
|
|
6675
|
+
emptyState: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6676
|
+
EmptyState,
|
|
6677
|
+
{
|
|
6678
|
+
title: "No replies yet",
|
|
6679
|
+
hint: "Write a reply below to start the thread."
|
|
6680
|
+
}
|
|
6681
|
+
)
|
|
6490
6682
|
}
|
|
6491
6683
|
) }),
|
|
6492
6684
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6518,7 +6710,7 @@ function ThreadSheet({
|
|
|
6518
6710
|
}
|
|
6519
6711
|
);
|
|
6520
6712
|
}
|
|
6521
|
-
var
|
|
6713
|
+
var styles29 = reactNative.StyleSheet.create({
|
|
6522
6714
|
modalRoot: {
|
|
6523
6715
|
flex: 1,
|
|
6524
6716
|
justifyContent: "flex-end"
|
|
@@ -6590,7 +6782,7 @@ function TypingIndicator({ typing, labelFor }) {
|
|
|
6590
6782
|
const ids = Array.from(typing);
|
|
6591
6783
|
const isTyping = ids.length > 0;
|
|
6592
6784
|
if (!isTyping) return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { height: 0 } });
|
|
6593
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
6785
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles30.row, children: [
|
|
6594
6786
|
/* @__PURE__ */ jsxRuntime.jsx(TypingDots, {}),
|
|
6595
6787
|
/* @__PURE__ */ jsxRuntime.jsx(TypingLabel, { ids, ...labelFor ? { labelFor } : {} })
|
|
6596
6788
|
] });
|
|
@@ -6635,7 +6827,7 @@ function TypingDots() {
|
|
|
6635
6827
|
],
|
|
6636
6828
|
opacity: val.interpolate({ inputRange: [0, 1], outputRange: [0.5, 1] })
|
|
6637
6829
|
});
|
|
6638
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
6830
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles30.dotsWrap, children: [
|
|
6639
6831
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: dot(a) }),
|
|
6640
6832
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: dot(b) }),
|
|
6641
6833
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: dot(c) })
|
|
@@ -6651,9 +6843,9 @@ function TypingLabel({
|
|
|
6651
6843
|
const name1 = useDisplayName(id1, labelFor);
|
|
6652
6844
|
const name2 = useDisplayName(id2, labelFor);
|
|
6653
6845
|
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: [
|
|
6846
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles30.label, { color: theme.colors.textMuted, fontFamily: theme.fonts.body }], children: text });
|
|
6655
6847
|
}
|
|
6656
|
-
var
|
|
6848
|
+
var styles30 = reactNative.StyleSheet.create({
|
|
6657
6849
|
row: {
|
|
6658
6850
|
flexDirection: "row",
|
|
6659
6851
|
alignItems: "center",
|
|
@@ -6691,21 +6883,40 @@ function parseDraft(raw) {
|
|
|
6691
6883
|
}
|
|
6692
6884
|
}
|
|
6693
6885
|
var DraftStore = class {
|
|
6886
|
+
/**
|
|
6887
|
+
* `namespace` resolves to the client's namespace; without it keys are
|
|
6888
|
+
* the pre-3.8 `poolse:draft:<conversation>` (tests, single client).
|
|
6889
|
+
*/
|
|
6890
|
+
constructor(namespace) {
|
|
6891
|
+
this.namespace = namespace;
|
|
6892
|
+
}
|
|
6893
|
+
namespace;
|
|
6694
6894
|
memory = /* @__PURE__ */ new Map();
|
|
6895
|
+
written = /* @__PURE__ */ new Map();
|
|
6695
6896
|
/** The in-memory draft, if any. */
|
|
6696
6897
|
peek(conversationId) {
|
|
6697
6898
|
return this.memory.get(conversationId) ?? null;
|
|
6698
6899
|
}
|
|
6699
6900
|
/**
|
|
6700
6901
|
* The draft: from memory, else from `storage` (which then seeds the
|
|
6701
|
-
* memory). Null when there's none, or
|
|
6902
|
+
* memory; a pre-3.8 key is moved over). Null when there's none, or
|
|
6903
|
+
* storage fails.
|
|
6702
6904
|
*/
|
|
6703
6905
|
async load(conversationId, storage) {
|
|
6704
6906
|
const inMemory = this.memory.get(conversationId);
|
|
6705
6907
|
if (inMemory) return inMemory;
|
|
6706
6908
|
if (!storage) return null;
|
|
6707
6909
|
try {
|
|
6708
|
-
const
|
|
6910
|
+
const key = await this.key(conversationId);
|
|
6911
|
+
let stored = parseDraft(await storage.get(key));
|
|
6912
|
+
const legacy = draftKey(conversationId);
|
|
6913
|
+
if (!stored && key !== legacy) {
|
|
6914
|
+
stored = parseDraft(await storage.get(legacy));
|
|
6915
|
+
if (stored && !isEmptyDraft(stored)) {
|
|
6916
|
+
this.write(storage, key, stored);
|
|
6917
|
+
swallow(() => storage.remove(legacy));
|
|
6918
|
+
}
|
|
6919
|
+
}
|
|
6709
6920
|
if (stored && !isEmptyDraft(stored) && !this.memory.has(conversationId)) {
|
|
6710
6921
|
this.memory.set(conversationId, stored);
|
|
6711
6922
|
}
|
|
@@ -6721,15 +6932,72 @@ var DraftStore = class {
|
|
|
6721
6932
|
return;
|
|
6722
6933
|
}
|
|
6723
6934
|
this.memory.set(conversationId, draft);
|
|
6724
|
-
if (storage) {
|
|
6725
|
-
|
|
6935
|
+
if (storage && !this.namespace) {
|
|
6936
|
+
this.write(storage, draftKey(conversationId), draft);
|
|
6937
|
+
} else if (storage) {
|
|
6938
|
+
void this.key(conversationId).then(
|
|
6939
|
+
(key) => this.write(storage, key, draft),
|
|
6940
|
+
() => void 0
|
|
6941
|
+
);
|
|
6726
6942
|
}
|
|
6727
6943
|
}
|
|
6728
6944
|
clear(conversationId, storage) {
|
|
6729
6945
|
this.memory.delete(conversationId);
|
|
6730
|
-
if (storage
|
|
6946
|
+
if (storage && !this.namespace) {
|
|
6947
|
+
swallow(() => storage.remove(draftKey(conversationId)));
|
|
6948
|
+
} else if (storage) {
|
|
6949
|
+
void this.key(conversationId).then(
|
|
6950
|
+
(key) => swallow(() => storage.remove(key)),
|
|
6951
|
+
() => void 0
|
|
6952
|
+
);
|
|
6953
|
+
}
|
|
6954
|
+
}
|
|
6955
|
+
/** Called by `chat.destroy()`. @internal */
|
|
6956
|
+
async destroy(opts) {
|
|
6957
|
+
this.memory.clear();
|
|
6958
|
+
if (!opts.clearStorage) return;
|
|
6959
|
+
const ns = this.namespace ? await this.namespace() : null;
|
|
6960
|
+
for (const [storage, keys] of this.written) {
|
|
6961
|
+
const all = new Set(keys);
|
|
6962
|
+
if (ns) {
|
|
6963
|
+
try {
|
|
6964
|
+
const listed = JSON.parse(await storage.get(indexKey(ns)) ?? "[]");
|
|
6965
|
+
if (Array.isArray(listed)) {
|
|
6966
|
+
for (const k of listed) if (typeof k === "string") all.add(k);
|
|
6967
|
+
}
|
|
6968
|
+
} catch {
|
|
6969
|
+
}
|
|
6970
|
+
swallow(() => storage.remove(indexKey(ns)));
|
|
6971
|
+
}
|
|
6972
|
+
for (const k of all) swallow(() => storage.remove(k));
|
|
6973
|
+
}
|
|
6974
|
+
this.written.clear();
|
|
6975
|
+
}
|
|
6976
|
+
async key(conversationId) {
|
|
6977
|
+
if (!this.namespace) return draftKey(conversationId);
|
|
6978
|
+
return `${await this.namespace()}:draft:${conversationId}`;
|
|
6979
|
+
}
|
|
6980
|
+
write(storage, key, draft) {
|
|
6981
|
+
swallow(() => storage.set(key, JSON.stringify(draft)));
|
|
6982
|
+
let keys = this.written.get(storage);
|
|
6983
|
+
if (!keys) {
|
|
6984
|
+
keys = /* @__PURE__ */ new Set();
|
|
6985
|
+
this.written.set(storage, keys);
|
|
6986
|
+
}
|
|
6987
|
+
if (keys.has(key) || !this.namespace) return;
|
|
6988
|
+
keys.add(key);
|
|
6989
|
+
const all = keys;
|
|
6990
|
+
void this.namespace().then(async (ns) => {
|
|
6991
|
+
try {
|
|
6992
|
+
const listed = JSON.parse(await storage.get(indexKey(ns)) ?? "[]");
|
|
6993
|
+
const prev = Array.isArray(listed) ? listed.filter((k) => typeof k === "string") : [];
|
|
6994
|
+
await storage.set(indexKey(ns), JSON.stringify([.../* @__PURE__ */ new Set([...prev, ...all])]));
|
|
6995
|
+
} catch {
|
|
6996
|
+
}
|
|
6997
|
+
});
|
|
6731
6998
|
}
|
|
6732
6999
|
};
|
|
7000
|
+
var indexKey = (ns) => `${ns}:draft-index`;
|
|
6733
7001
|
function swallow(fn) {
|
|
6734
7002
|
try {
|
|
6735
7003
|
const r = fn();
|
|
@@ -6739,7 +7007,9 @@ function swallow(fn) {
|
|
|
6739
7007
|
} catch {
|
|
6740
7008
|
}
|
|
6741
7009
|
}
|
|
6742
|
-
|
|
7010
|
+
function draftStoreOf(chat) {
|
|
7011
|
+
return chat.scoped("react-native:drafts", (c) => new DraftStore(() => c.whenNamespace()));
|
|
7012
|
+
}
|
|
6743
7013
|
|
|
6744
7014
|
// src/internal/errors.ts
|
|
6745
7015
|
function sendErrorNotice(err) {
|
|
@@ -6854,11 +7124,14 @@ function ConversationView({
|
|
|
6854
7124
|
loadMore,
|
|
6855
7125
|
loadUntil,
|
|
6856
7126
|
send,
|
|
7127
|
+
retry: retrySend,
|
|
7128
|
+
discard: discardSend,
|
|
6857
7129
|
edit,
|
|
6858
7130
|
delete: deleteMsg,
|
|
6859
7131
|
markReadUpTo,
|
|
6860
7132
|
refetch
|
|
6861
7133
|
} = react$1.useMessages(conversationId);
|
|
7134
|
+
const drafts = draftStoreOf(chat);
|
|
6862
7135
|
const { typing: typingPeople, signalTyping } = react$1.useTyping(conversationId);
|
|
6863
7136
|
const streams = react$1.useMessageStreams(conversationId);
|
|
6864
7137
|
const typing = react.useMemo(() => {
|
|
@@ -6899,24 +7172,22 @@ function ConversationView({
|
|
|
6899
7172
|
[layout, density, timeFormat, slots]
|
|
6900
7173
|
);
|
|
6901
7174
|
const [draftFor, setDraftFor] = react.useState(conversationId);
|
|
6902
|
-
const [draftText, setDraftText] = react.useState(
|
|
6903
|
-
() => sharedDraftStore.peek(conversationId)?.text ?? ""
|
|
6904
|
-
);
|
|
7175
|
+
const [draftText, setDraftText] = react.useState(() => drafts.peek(conversationId)?.text ?? "");
|
|
6905
7176
|
const [replyingTo, setReplyingTo] = react.useState(
|
|
6906
|
-
() =>
|
|
7177
|
+
() => drafts.peek(conversationId)?.quote ?? null
|
|
6907
7178
|
);
|
|
6908
7179
|
const touchedRef = react.useRef(false);
|
|
6909
7180
|
const [storedDraftRead, setStoredDraftRead] = react.useState(false);
|
|
6910
7181
|
react.useEffect(() => {
|
|
6911
7182
|
let live = true;
|
|
6912
7183
|
touchedRef.current = false;
|
|
6913
|
-
const inMemory =
|
|
7184
|
+
const inMemory = drafts.peek(conversationId);
|
|
6914
7185
|
setDraftFor(conversationId);
|
|
6915
7186
|
setDraftText(inMemory?.text ?? "");
|
|
6916
7187
|
setReplyingTo(inMemory?.quote ?? null);
|
|
6917
7188
|
if (!inMemory && storage) {
|
|
6918
7189
|
setStoredDraftRead(false);
|
|
6919
|
-
void
|
|
7190
|
+
void drafts.load(conversationId, storage).then((d) => {
|
|
6920
7191
|
if (!live) return;
|
|
6921
7192
|
setStoredDraftRead(true);
|
|
6922
7193
|
if (!d || touchedRef.current) return;
|
|
@@ -6934,23 +7205,23 @@ function ConversationView({
|
|
|
6934
7205
|
react.useEffect(() => {
|
|
6935
7206
|
if (draftFor !== conversationId) return;
|
|
6936
7207
|
const draft = { text: draftText, quote: replyingTo };
|
|
6937
|
-
|
|
7208
|
+
drafts.save(conversationId, draft);
|
|
6938
7209
|
if (!storage || !storedDraftRead) return;
|
|
6939
7210
|
pendingDraftRef.current = { id: conversationId, draft };
|
|
6940
7211
|
const t = setTimeout(() => {
|
|
6941
7212
|
pendingDraftRef.current = null;
|
|
6942
|
-
|
|
7213
|
+
drafts.save(conversationId, draft, storage);
|
|
6943
7214
|
}, 400);
|
|
6944
7215
|
return () => clearTimeout(t);
|
|
6945
|
-
}, [draftFor, conversationId, draftText, replyingTo, storage, storedDraftRead]);
|
|
7216
|
+
}, [drafts, draftFor, conversationId, draftText, replyingTo, storage, storedDraftRead]);
|
|
6946
7217
|
const storageRef = react.useRef(storage);
|
|
6947
7218
|
storageRef.current = storage;
|
|
6948
7219
|
react.useEffect(
|
|
6949
7220
|
() => () => {
|
|
6950
7221
|
const pending = pendingDraftRef.current;
|
|
6951
|
-
if (pending)
|
|
7222
|
+
if (pending) drafts.save(pending.id, pending.draft, storageRef.current);
|
|
6952
7223
|
},
|
|
6953
|
-
[]
|
|
7224
|
+
[drafts]
|
|
6954
7225
|
);
|
|
6955
7226
|
const [notice, setNotice] = react.useState(null);
|
|
6956
7227
|
react.useEffect(() => {
|
|
@@ -7137,6 +7408,10 @@ function ConversationView({
|
|
|
7137
7408
|
showPresence,
|
|
7138
7409
|
linkPreviews,
|
|
7139
7410
|
...markable ? { onMarkUnread: () => markMessageUnread(msg) } : {},
|
|
7411
|
+
...msg.local_status ? {
|
|
7412
|
+
onRetrySend: () => void retrySend(msg.id).catch(() => void 0),
|
|
7413
|
+
onDiscardSend: () => discardSend(msg.id)
|
|
7414
|
+
} : {},
|
|
7140
7415
|
...linkPreviews && isSelf && !tombstone && (msg.link_previews?.length ?? 0) > 0 ? { onRemoveLinkPreview: (url) => removeLinkPreview(msg.id, url) } : {},
|
|
7141
7416
|
reactions,
|
|
7142
7417
|
attachments,
|
|
@@ -7168,6 +7443,8 @@ function ConversationView({
|
|
|
7168
7443
|
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { backgroundColor: theme.colors.accentSoft }, children: row });
|
|
7169
7444
|
},
|
|
7170
7445
|
[
|
|
7446
|
+
retrySend,
|
|
7447
|
+
discardSend,
|
|
7171
7448
|
onCallBack,
|
|
7172
7449
|
onQuotedClick,
|
|
7173
7450
|
onSenderPress,
|
|
@@ -7243,9 +7520,17 @@ function ConversationView({
|
|
|
7243
7520
|
const composerProps = react.useMemo(
|
|
7244
7521
|
() => ({
|
|
7245
7522
|
onSend: async (body, opts) => {
|
|
7523
|
+
const id = sdk.safeUuid();
|
|
7246
7524
|
try {
|
|
7247
|
-
await send({ body, ...opts });
|
|
7525
|
+
await send({ body, ...opts, id });
|
|
7248
7526
|
} catch (err) {
|
|
7527
|
+
const kept = err instanceof sdk.MessageQueuedError || chat.outboxEnabled && !isQuoteGone(err);
|
|
7528
|
+
if (kept) {
|
|
7529
|
+
setReplyingTo(null);
|
|
7530
|
+
setAutoReadPaused(false);
|
|
7531
|
+
return;
|
|
7532
|
+
}
|
|
7533
|
+
if (isQuoteGone(err)) discardSend(id);
|
|
7249
7534
|
setDraftText((now) => now ? now : body);
|
|
7250
7535
|
if (isQuoteGone(err)) setReplyingTo(null);
|
|
7251
7536
|
setNotice(sendErrorNotice(err));
|
|
@@ -7278,6 +7563,8 @@ function ConversationView({
|
|
|
7278
7563
|
}),
|
|
7279
7564
|
[
|
|
7280
7565
|
send,
|
|
7566
|
+
chat.outboxEnabled,
|
|
7567
|
+
discardSend,
|
|
7281
7568
|
signalTyping,
|
|
7282
7569
|
attachments,
|
|
7283
7570
|
replyingTo,
|
|
@@ -7305,7 +7592,7 @@ function ConversationView({
|
|
|
7305
7592
|
return /* @__PURE__ */ jsxRuntime.jsx(UploadProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7306
7593
|
reactNative.KeyboardAvoidingView,
|
|
7307
7594
|
{
|
|
7308
|
-
style: [
|
|
7595
|
+
style: [styles31.root, { backgroundColor: theme.colors.background }],
|
|
7309
7596
|
behavior: reactNative.Platform.OS === "ios" ? "padding" : "height",
|
|
7310
7597
|
keyboardVerticalOffset: keyboardOffset,
|
|
7311
7598
|
children: [
|
|
@@ -7314,7 +7601,7 @@ function ConversationView({
|
|
|
7314
7601
|
reactNative.Text,
|
|
7315
7602
|
{
|
|
7316
7603
|
style: [
|
|
7317
|
-
|
|
7604
|
+
styles31.notice,
|
|
7318
7605
|
{ color: theme.colors.textMuted, backgroundColor: theme.colors.surfaceAlt }
|
|
7319
7606
|
],
|
|
7320
7607
|
accessibilityRole: "alert",
|
|
@@ -7330,7 +7617,7 @@ function ConversationView({
|
|
|
7330
7617
|
onJoin: onJoinCall
|
|
7331
7618
|
}
|
|
7332
7619
|
) : null,
|
|
7333
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
7620
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.listWrap, children: [
|
|
7334
7621
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7335
7622
|
MessageList,
|
|
7336
7623
|
{
|
|
@@ -7349,7 +7636,7 @@ function ConversationView({
|
|
|
7349
7636
|
(stream) => stream.status === "failed" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7350
7637
|
reactNative.Text,
|
|
7351
7638
|
{
|
|
7352
|
-
style: [
|
|
7639
|
+
style: [styles31.streamFailed, { color: theme.colors.textSubtle }],
|
|
7353
7640
|
accessibilityRole: "alert",
|
|
7354
7641
|
children: stream.error ? `The agent couldn't reply: ${stream.error}` : "The agent couldn't reply."
|
|
7355
7642
|
},
|
|
@@ -7376,7 +7663,13 @@ function ConversationView({
|
|
|
7376
7663
|
),
|
|
7377
7664
|
/* @__PURE__ */ jsxRuntime.jsx(TypingIndicator, { typing, ...labelFor ? { labelFor } : {} })
|
|
7378
7665
|
] }),
|
|
7379
|
-
|
|
7666
|
+
emptyState: emptyState !== void 0 ? emptyState : /* @__PURE__ */ jsxRuntime.jsx(
|
|
7667
|
+
EmptyState,
|
|
7668
|
+
{
|
|
7669
|
+
title: "No messages yet",
|
|
7670
|
+
...showComposer ? { hint: "Write the first message below \u2014 everyone here will see it." } : {}
|
|
7671
|
+
}
|
|
7672
|
+
)
|
|
7380
7673
|
}
|
|
7381
7674
|
),
|
|
7382
7675
|
unreadPending ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -7384,7 +7677,7 @@ function ConversationView({
|
|
|
7384
7677
|
{
|
|
7385
7678
|
onPress: jumpToUnread,
|
|
7386
7679
|
style: [
|
|
7387
|
-
|
|
7680
|
+
styles31.unreadPill,
|
|
7388
7681
|
{ backgroundColor: theme.colors.accent, borderRadius: theme.radii.pill },
|
|
7389
7682
|
theme.shadows.sm
|
|
7390
7683
|
],
|
|
@@ -7400,7 +7693,7 @@ function ConversationView({
|
|
|
7400
7693
|
label: null
|
|
7401
7694
|
}
|
|
7402
7695
|
),
|
|
7403
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
7696
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles31.unreadPillText, { color: theme.colors.accentText }], children: seekingUnread ? "Loading\u2026" : "New messages" }),
|
|
7404
7697
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7405
7698
|
reactNative.Pressable,
|
|
7406
7699
|
{
|
|
@@ -7417,7 +7710,7 @@ function ConversationView({
|
|
|
7417
7710
|
editingId ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7418
7711
|
reactNative.Pressable,
|
|
7419
7712
|
{
|
|
7420
|
-
style: [
|
|
7713
|
+
style: [styles31.editBackdrop, { backgroundColor: theme.colors.overlay }],
|
|
7421
7714
|
onPress: () => setEditingId(null),
|
|
7422
7715
|
accessibilityLabel: "Cancel editing"
|
|
7423
7716
|
}
|
|
@@ -7479,7 +7772,7 @@ function readStateForMessage(msg, members, meId, sequenceByMessageId) {
|
|
|
7479
7772
|
return anyRead ? "read" : "sent";
|
|
7480
7773
|
}
|
|
7481
7774
|
var NEW_MESSAGES_KEY = "new-messages";
|
|
7482
|
-
var
|
|
7775
|
+
var styles31 = reactNative.StyleSheet.create({
|
|
7483
7776
|
root: {
|
|
7484
7777
|
flex: 1
|
|
7485
7778
|
},
|
|
@@ -7615,15 +7908,15 @@ function UserPickerSheet({
|
|
|
7615
7908
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7616
7909
|
reactNative.View,
|
|
7617
7910
|
{
|
|
7618
|
-
style:
|
|
7911
|
+
style: styles32.modalRoot,
|
|
7619
7912
|
onLayout: (e) => setRootHeight(Math.round(e.nativeEvent.layout.height)),
|
|
7620
7913
|
children: [
|
|
7621
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style:
|
|
7914
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles32.backdrop, onPress: handleClose }),
|
|
7622
7915
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7623
7916
|
reactNative.Animated.View,
|
|
7624
7917
|
{
|
|
7625
7918
|
style: [
|
|
7626
|
-
|
|
7919
|
+
styles32.sheet,
|
|
7627
7920
|
{
|
|
7628
7921
|
backgroundColor: theme.colors.background,
|
|
7629
7922
|
borderTopLeftRadius: theme.radii.xl,
|
|
@@ -7641,18 +7934,18 @@ function UserPickerSheet({
|
|
|
7641
7934
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7642
7935
|
reactNative.KeyboardAvoidingView,
|
|
7643
7936
|
{
|
|
7644
|
-
style:
|
|
7937
|
+
style: styles32.kav,
|
|
7645
7938
|
behavior: "padding",
|
|
7646
7939
|
keyboardVerticalOffset: screenHeight - sheetHeight,
|
|
7647
7940
|
children: [
|
|
7648
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { ...panHandlers, style:
|
|
7649
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
7941
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { ...panHandlers, style: styles32.dragHandle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles32.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
|
|
7942
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles32.header, children: [
|
|
7650
7943
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7651
7944
|
reactNative.Pressable,
|
|
7652
7945
|
{
|
|
7653
7946
|
onPress: handleClose,
|
|
7654
7947
|
hitSlop: 16,
|
|
7655
|
-
style: [
|
|
7948
|
+
style: [styles32.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
|
|
7656
7949
|
accessibilityLabel: "Close picker",
|
|
7657
7950
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
|
|
7658
7951
|
}
|
|
@@ -7661,7 +7954,7 @@ function UserPickerSheet({
|
|
|
7661
7954
|
reactNative.Text,
|
|
7662
7955
|
{
|
|
7663
7956
|
style: [
|
|
7664
|
-
|
|
7957
|
+
styles32.title,
|
|
7665
7958
|
{ color: theme.colors.text, fontFamily: theme.fonts.display }
|
|
7666
7959
|
],
|
|
7667
7960
|
numberOfLines: 1,
|
|
@@ -7675,7 +7968,7 @@ function UserPickerSheet({
|
|
|
7675
7968
|
disabled: !canCreate,
|
|
7676
7969
|
hitSlop: 6,
|
|
7677
7970
|
style: [
|
|
7678
|
-
|
|
7971
|
+
styles32.createBtn,
|
|
7679
7972
|
{
|
|
7680
7973
|
backgroundColor: canCreate ? theme.colors.accent : theme.colors.surfaceAlt,
|
|
7681
7974
|
opacity: canCreate ? 1 : 0.6
|
|
@@ -7706,7 +7999,7 @@ function UserPickerSheet({
|
|
|
7706
7999
|
value: groupName,
|
|
7707
8000
|
onChangeText: setGroupName,
|
|
7708
8001
|
style: [
|
|
7709
|
-
|
|
8002
|
+
styles32.groupNameInput,
|
|
7710
8003
|
{
|
|
7711
8004
|
color: theme.colors.text,
|
|
7712
8005
|
backgroundColor: theme.colors.surfaceAlt,
|
|
@@ -7725,7 +8018,7 @@ function UserPickerSheet({
|
|
|
7725
8018
|
value: query,
|
|
7726
8019
|
onChangeText: setQuery,
|
|
7727
8020
|
style: [
|
|
7728
|
-
|
|
8021
|
+
styles32.searchInput,
|
|
7729
8022
|
{
|
|
7730
8023
|
color: theme.colors.text,
|
|
7731
8024
|
backgroundColor: theme.colors.surfaceAlt,
|
|
@@ -7742,7 +8035,7 @@ function UserPickerSheet({
|
|
|
7742
8035
|
data: filtered,
|
|
7743
8036
|
keyExtractor: (u) => u.externalId,
|
|
7744
8037
|
keyboardShouldPersistTaps: "handled",
|
|
7745
|
-
ListEmptyComponent: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
8038
|
+
ListEmptyComponent: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles32.empty, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles32.emptyText, { color: theme.colors.textSubtle }], children: query ? "No matches." : "No users to show." }) }),
|
|
7746
8039
|
renderItem: ({ item }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7747
8040
|
UserRow,
|
|
7748
8041
|
{
|
|
@@ -7784,29 +8077,29 @@ function UserRow({
|
|
|
7784
8077
|
{
|
|
7785
8078
|
onPress,
|
|
7786
8079
|
style: [
|
|
7787
|
-
|
|
8080
|
+
styles32.row,
|
|
7788
8081
|
{
|
|
7789
8082
|
backgroundColor: selected ? theme.colors.accentSoft : "transparent"
|
|
7790
8083
|
}
|
|
7791
8084
|
],
|
|
7792
8085
|
children: [
|
|
7793
|
-
user.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { source: { uri: user.avatarUrl }, style:
|
|
7794
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
8086
|
+
user.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { source: { uri: user.avatarUrl }, style: styles32.avatarImg }) : /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: null, name: user.name, seed: user.externalId, size: "md" }),
|
|
8087
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles32.body, children: [
|
|
7795
8088
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7796
8089
|
reactNative.Text,
|
|
7797
8090
|
{
|
|
7798
|
-
style: [
|
|
8091
|
+
style: [styles32.name, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
7799
8092
|
numberOfLines: 1,
|
|
7800
8093
|
children: user.name
|
|
7801
8094
|
}
|
|
7802
8095
|
),
|
|
7803
|
-
user.subtitle ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
8096
|
+
user.subtitle ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles32.subtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: user.subtitle }) : null
|
|
7804
8097
|
] }),
|
|
7805
8098
|
isGroup ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7806
8099
|
reactNative.View,
|
|
7807
8100
|
{
|
|
7808
8101
|
style: [
|
|
7809
|
-
|
|
8102
|
+
styles32.checkbox,
|
|
7810
8103
|
{
|
|
7811
8104
|
borderColor: selected ? theme.colors.accent : theme.colors.border,
|
|
7812
8105
|
backgroundColor: selected ? theme.colors.accent : "transparent"
|
|
@@ -7819,7 +8112,7 @@ function UserRow({
|
|
|
7819
8112
|
}
|
|
7820
8113
|
);
|
|
7821
8114
|
}
|
|
7822
|
-
var
|
|
8115
|
+
var styles32 = reactNative.StyleSheet.create({
|
|
7823
8116
|
modalRoot: {
|
|
7824
8117
|
flex: 1,
|
|
7825
8118
|
justifyContent: "flex-end"
|
|
@@ -8090,7 +8383,7 @@ var PoolseInbox = react.forwardRef(
|
|
|
8090
8383
|
},
|
|
8091
8384
|
[renderConversationRow, meExternalId, meId, labelFor, avatarFor, unreadCounts, showPresence]
|
|
8092
8385
|
);
|
|
8093
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
8386
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles33.root, { backgroundColor: theme.colors.background }], children: [
|
|
8094
8387
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8095
8388
|
reactNative.Animated.View,
|
|
8096
8389
|
{
|
|
@@ -8101,7 +8394,7 @@ var PoolseInbox = react.forwardRef(
|
|
|
8101
8394
|
reactNative.View,
|
|
8102
8395
|
{
|
|
8103
8396
|
style: [
|
|
8104
|
-
|
|
8397
|
+
styles33.listHeader,
|
|
8105
8398
|
{
|
|
8106
8399
|
backgroundColor: theme.colors.surface,
|
|
8107
8400
|
borderBottomColor: theme.colors.border
|
|
@@ -8112,13 +8405,13 @@ var PoolseInbox = react.forwardRef(
|
|
|
8112
8405
|
reactNative.Text,
|
|
8113
8406
|
{
|
|
8114
8407
|
style: [
|
|
8115
|
-
|
|
8408
|
+
styles33.listTitle,
|
|
8116
8409
|
{ color: theme.colors.text, fontFamily: theme.fonts.display }
|
|
8117
8410
|
],
|
|
8118
8411
|
children: title
|
|
8119
8412
|
}
|
|
8120
8413
|
),
|
|
8121
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
8414
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles33.headerActions, children: [
|
|
8122
8415
|
users ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8123
8416
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8124
8417
|
HeaderIconButton,
|
|
@@ -8234,7 +8527,7 @@ function HeaderIconButton({
|
|
|
8234
8527
|
hitSlop: 10,
|
|
8235
8528
|
accessibilityLabel: label,
|
|
8236
8529
|
style: ({ pressed }) => [
|
|
8237
|
-
|
|
8530
|
+
styles33.iconBtn,
|
|
8238
8531
|
{
|
|
8239
8532
|
backgroundColor: pressed ? theme.colors.surfaceAlt : "transparent"
|
|
8240
8533
|
}
|
|
@@ -8267,7 +8560,7 @@ function DefaultConversationRow({
|
|
|
8267
8560
|
{
|
|
8268
8561
|
onPress,
|
|
8269
8562
|
style: [
|
|
8270
|
-
|
|
8563
|
+
styles33.row,
|
|
8271
8564
|
{
|
|
8272
8565
|
backgroundColor: selected ? theme.colors.surfaceAlt : "transparent",
|
|
8273
8566
|
borderBottomColor: theme.colors.border
|
|
@@ -8284,23 +8577,23 @@ function DefaultConversationRow({
|
|
|
8284
8577
|
...presence ? { presence: presence.state, doNotDisturb: !!presence.do_not_disturb } : {}
|
|
8285
8578
|
}
|
|
8286
8579
|
),
|
|
8287
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
8580
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles33.rowBody, children: [
|
|
8288
8581
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8289
8582
|
reactNative.Text,
|
|
8290
8583
|
{
|
|
8291
|
-
style: [
|
|
8584
|
+
style: [styles33.rowTitle, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
8292
8585
|
numberOfLines: 1,
|
|
8293
8586
|
children: title
|
|
8294
8587
|
}
|
|
8295
8588
|
),
|
|
8296
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
8589
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles33.rowSubtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: react$1.formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview ?? (isDirect ? otherExtId ?? "" : `${(conv.member_external_ids ?? []).length} members`) })
|
|
8297
8590
|
] }),
|
|
8298
|
-
unread > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
8591
|
+
unread > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles33.unreadPill, { backgroundColor: theme.colors.badge }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles33.unreadText, { color: theme.colors.badgeText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
|
|
8299
8592
|
]
|
|
8300
8593
|
}
|
|
8301
8594
|
);
|
|
8302
8595
|
}
|
|
8303
|
-
var
|
|
8596
|
+
var styles33 = reactNative.StyleSheet.create({
|
|
8304
8597
|
root: {
|
|
8305
8598
|
flex: 1,
|
|
8306
8599
|
overflow: "hidden"
|
|
@@ -8436,9 +8729,9 @@ function useAppStateLifecycle(options = {}) {
|
|
|
8436
8729
|
const sub = reactNative.AppState.addEventListener("change", (next) => {
|
|
8437
8730
|
if (next === "background") {
|
|
8438
8731
|
setActivity("idle");
|
|
8439
|
-
poolse.
|
|
8732
|
+
poolse.setBackground(true);
|
|
8440
8733
|
} else if (next === "active") {
|
|
8441
|
-
poolse.
|
|
8734
|
+
poolse.setBackground(false);
|
|
8442
8735
|
setActivity("active");
|
|
8443
8736
|
} else {
|
|
8444
8737
|
setActivity("idle");
|
|
@@ -8448,6 +8741,41 @@ function useAppStateLifecycle(options = {}) {
|
|
|
8448
8741
|
}, [poolse, presence]);
|
|
8449
8742
|
}
|
|
8450
8743
|
|
|
8744
|
+
// src/internal/background.ts
|
|
8745
|
+
function applyBackground(clients, active, appActive, keepConnected = []) {
|
|
8746
|
+
for (const c of clients) {
|
|
8747
|
+
if (c.destroyed) continue;
|
|
8748
|
+
const foreground = appActive && (c === active || keepConnected.includes(c));
|
|
8749
|
+
c.setBackground(!foreground);
|
|
8750
|
+
}
|
|
8751
|
+
}
|
|
8752
|
+
|
|
8753
|
+
// src/lifecycle/useBackgroundClients.ts
|
|
8754
|
+
function useBackgroundClients(clients, active, opts = {}) {
|
|
8755
|
+
const [appState, setAppState] = react.useState(reactNative.AppState.currentState ?? "active");
|
|
8756
|
+
react.useEffect(() => {
|
|
8757
|
+
const sub = reactNative.AppState.addEventListener("change", setAppState);
|
|
8758
|
+
return () => sub.remove();
|
|
8759
|
+
}, []);
|
|
8760
|
+
const appActive = appState !== "background";
|
|
8761
|
+
const keep = opts.keepConnected ?? EMPTY;
|
|
8762
|
+
const presence = opts.presence ?? true;
|
|
8763
|
+
const lastActive = react.useRef(null);
|
|
8764
|
+
react.useEffect(() => {
|
|
8765
|
+
applyBackground(clients, active, appActive, keep);
|
|
8766
|
+
}, [clients, active, appActive, keep]);
|
|
8767
|
+
react.useEffect(() => {
|
|
8768
|
+
if (!presence) return;
|
|
8769
|
+
const prev = lastActive.current;
|
|
8770
|
+
if (prev && prev !== active && !prev.destroyed) prev.presence.setActivity("idle");
|
|
8771
|
+
lastActive.current = active;
|
|
8772
|
+
if (active && !active.destroyed) {
|
|
8773
|
+
active.presence.setActivity(appState === "active" ? "active" : "idle");
|
|
8774
|
+
}
|
|
8775
|
+
}, [active, appState, presence]);
|
|
8776
|
+
}
|
|
8777
|
+
var EMPTY = [];
|
|
8778
|
+
|
|
8451
8779
|
// src/voice/callTheme.ts
|
|
8452
8780
|
var callColors = {
|
|
8453
8781
|
/** Behind everything. Near-black, cooled toward the brand. */
|
|
@@ -8496,7 +8824,7 @@ function CallControlButton({
|
|
|
8496
8824
|
const size = large ? CONTROL_SIZE_LARGE : CONTROL_SIZE;
|
|
8497
8825
|
const background = tone === "danger" ? callColors.danger : tone === "accept" ? callColors.accept : active ? callColors.controlActive : callColors.control;
|
|
8498
8826
|
const iconColor = tone === "neutral" && active ? callColors.controlActiveIcon : callColors.onAction;
|
|
8499
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
8827
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles34.slot, children: [
|
|
8500
8828
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8501
8829
|
reactNative.Pressable,
|
|
8502
8830
|
{
|
|
@@ -8507,7 +8835,7 @@ function CallControlButton({
|
|
|
8507
8835
|
accessibilityLabel: accessibilityLabel ?? label ?? icon,
|
|
8508
8836
|
hitSlop: 8,
|
|
8509
8837
|
style: ({ pressed }) => [
|
|
8510
|
-
|
|
8838
|
+
styles34.button,
|
|
8511
8839
|
{
|
|
8512
8840
|
width: size,
|
|
8513
8841
|
height: size,
|
|
@@ -8521,10 +8849,10 @@ function CallControlButton({
|
|
|
8521
8849
|
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: icon, size: large ? 30 : 25, color: iconColor, label: null })
|
|
8522
8850
|
}
|
|
8523
8851
|
),
|
|
8524
|
-
label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style:
|
|
8852
|
+
label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: styles34.label, children: label }) : null
|
|
8525
8853
|
] });
|
|
8526
8854
|
}
|
|
8527
|
-
var
|
|
8855
|
+
var styles34 = reactNative.StyleSheet.create({
|
|
8528
8856
|
// Fixed width so captions of different lengths cannot shift the row.
|
|
8529
8857
|
slot: { width: 76, alignItems: "center", gap: 7 },
|
|
8530
8858
|
button: { alignItems: "center", justifyContent: "center" },
|
|
@@ -8537,7 +8865,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
8537
8865
|
reactNative.View,
|
|
8538
8866
|
{
|
|
8539
8867
|
style: [
|
|
8540
|
-
|
|
8868
|
+
styles35.ring,
|
|
8541
8869
|
{
|
|
8542
8870
|
width: outer,
|
|
8543
8871
|
height: outer,
|
|
@@ -8550,7 +8878,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
8550
8878
|
reactNative.View,
|
|
8551
8879
|
{
|
|
8552
8880
|
style: [
|
|
8553
|
-
|
|
8881
|
+
styles35.circle,
|
|
8554
8882
|
{
|
|
8555
8883
|
width: size,
|
|
8556
8884
|
height: size,
|
|
@@ -8561,7 +8889,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
8561
8889
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8562
8890
|
reactNative.Text,
|
|
8563
8891
|
{
|
|
8564
|
-
style: [
|
|
8892
|
+
style: [styles35.initials, { fontSize: Math.round(size * 0.38) }],
|
|
8565
8893
|
numberOfLines: 1,
|
|
8566
8894
|
allowFontScaling: false,
|
|
8567
8895
|
children: initialsOf(name)
|
|
@@ -8578,7 +8906,7 @@ function initialsOf(name) {
|
|
|
8578
8906
|
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
8579
8907
|
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
8580
8908
|
}
|
|
8581
|
-
var
|
|
8909
|
+
var styles35 = reactNative.StyleSheet.create({
|
|
8582
8910
|
ring: { alignItems: "center", justifyContent: "center" },
|
|
8583
8911
|
circle: { alignItems: "center", justifyContent: "center" },
|
|
8584
8912
|
initials: { color: "#ffffff", fontWeight: "600" }
|
|
@@ -8606,15 +8934,15 @@ function AudioRouteSheet({
|
|
|
8606
8934
|
animationType: "fade",
|
|
8607
8935
|
onRequestClose: onClose,
|
|
8608
8936
|
...EDGE_TO_EDGE_MODAL,
|
|
8609
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style:
|
|
8937
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles36.backdrop, onPress: onClose, accessibilityRole: "button", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8610
8938
|
reactNative.Pressable,
|
|
8611
8939
|
{
|
|
8612
|
-
style: [
|
|
8940
|
+
style: [styles36.sheet, { paddingBottom: Math.max(34, insets.bottom + 16) }],
|
|
8613
8941
|
onPress: () => {
|
|
8614
8942
|
},
|
|
8615
8943
|
children: [
|
|
8616
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
8617
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
8944
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles36.grabber }),
|
|
8945
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles36.title, children: "Audio output" }),
|
|
8618
8946
|
routes.map((route) => {
|
|
8619
8947
|
const selected = route.id === selectedRouteId;
|
|
8620
8948
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -8626,7 +8954,7 @@ function AudioRouteSheet({
|
|
|
8626
8954
|
},
|
|
8627
8955
|
accessibilityRole: "button",
|
|
8628
8956
|
accessibilityState: { selected },
|
|
8629
|
-
style: ({ pressed }) => [
|
|
8957
|
+
style: ({ pressed }) => [styles36.row, pressed && styles36.rowPressed],
|
|
8630
8958
|
children: [
|
|
8631
8959
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8632
8960
|
PoolseIcon,
|
|
@@ -8637,7 +8965,7 @@ function AudioRouteSheet({
|
|
|
8637
8965
|
label: null
|
|
8638
8966
|
}
|
|
8639
8967
|
),
|
|
8640
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
8968
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles36.label, selected && styles36.labelSelected], children: route.label }),
|
|
8641
8969
|
selected && /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "check", size: 19, color: callColors.accept, label: "selected" })
|
|
8642
8970
|
]
|
|
8643
8971
|
},
|
|
@@ -8650,7 +8978,7 @@ function AudioRouteSheet({
|
|
|
8650
8978
|
}
|
|
8651
8979
|
);
|
|
8652
8980
|
}
|
|
8653
|
-
var
|
|
8981
|
+
var styles36 = reactNative.StyleSheet.create({
|
|
8654
8982
|
backdrop: { flex: 1, backgroundColor: "rgba(0,0,0,0.55)", justifyContent: "flex-end" },
|
|
8655
8983
|
sheet: {
|
|
8656
8984
|
backgroundColor: callColors.tile,
|
|
@@ -8747,6 +9075,7 @@ exports.ConversationView = ConversationView;
|
|
|
8747
9075
|
exports.DaySeparator = DaySeparator;
|
|
8748
9076
|
exports.EditHistorySheet = EditHistorySheet;
|
|
8749
9077
|
exports.EmojiPicker = EmojiPicker;
|
|
9078
|
+
exports.EmptyState = EmptyState;
|
|
8750
9079
|
exports.GroupDetailsSheet = GroupDetailsSheet;
|
|
8751
9080
|
exports.ImageMosaic = ImageMosaic;
|
|
8752
9081
|
exports.LinkPreviewCard = LinkPreviewCard;
|
|
@@ -8767,16 +9096,19 @@ exports.PresenceBadge = PresenceBadge;
|
|
|
8767
9096
|
exports.Primitives = primitives;
|
|
8768
9097
|
exports.ReactionPicker = ReactionPicker;
|
|
8769
9098
|
exports.ReactionStrip = ReactionStrip;
|
|
9099
|
+
exports.SendStatus = SendStatus;
|
|
8770
9100
|
exports.ThreadSummary = ThreadSummary;
|
|
8771
9101
|
exports.ThreadView = ThreadView;
|
|
8772
9102
|
exports.TypingIndicator = TypingIndicator;
|
|
8773
9103
|
exports.UploadQueueStrip = UploadQueueStrip;
|
|
8774
9104
|
exports.UserName = UserName;
|
|
9105
|
+
exports.applyBackground = applyBackground;
|
|
8775
9106
|
exports.callColors = callColors;
|
|
8776
9107
|
exports.defaultDarkTheme = defaultDarkTheme;
|
|
8777
9108
|
exports.defaultLightTheme = defaultLightTheme;
|
|
8778
9109
|
exports.useAppStateLifecycle = useAppStateLifecycle;
|
|
8779
9110
|
exports.useAppStatePresence = useAppStatePresence;
|
|
9111
|
+
exports.useBackgroundClients = useBackgroundClients;
|
|
8780
9112
|
exports.useCallDuration = useCallDuration;
|
|
8781
9113
|
exports.useDisplayName = useDisplayName;
|
|
8782
9114
|
exports.usePoolseTheme = usePoolseTheme;
|